diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 27e34144389b1d6c82cf4d47c552ed4b6b053b9b..0000000000000000000000000000000000000000 --- a/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# Object files -*.o -*.ko -*.obj -*.elf - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# Debug files -*.dSYM/ -*.su - - -# vrpn/build files -src/vrpn/build* -src/vrpn/pc_linux64/* - -#Exacutables -./BlueTooth diff --git a/BlueTooth b/BlueTooth deleted file mode 100755 index 474759966239492448f3e6697b4f73ca341e545f..0000000000000000000000000000000000000000 Binary files a/BlueTooth and /dev/null differ diff --git a/Makefile b/Makefile deleted file mode 100644 index c010fe935eb31e334235e0b44c996c978fab8f53..0000000000000000000000000000000000000000 --- a/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# Declaration of variables -GCC=gcc -GXX=g++ -CFLAGS= -Wall -std=c99 -g -CPPFLAGS= -Wall -std=c++11 -g -INCLUDES = $(foreach dir, $(INCDIR), -I$(dir)) - -# Directories -SRCDIR=src -INCDIR=inc src src/vrpn src/vrpn/quat src/vrpn/build -OBJDIR=obj - -# Final exacutable name -EXE=BlueTooth - -# File names -CSOURCES := $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.c )) -CPPSOURCES := $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.cpp )) -COBJECTS = $(CSOURCES:.c=.o) -CPPOBJECTS = $(CPPSOURCES:.cpp=.o) -OBJECTS = $(CPPOBJECTS) $(COBJECTS) - -LIBS= -lpthread -lbluetooth -lvrpn -lquat -Lsrc/vrpn/build -Lsrc/vrpn/build/quat - -# Default target -all: logs vrpn/build $(EXE) - -# Main target -$(EXE): $(OBJECTS) - $(GXX) $(CPPFLAGS) $^ -o $@ $(INCLUDES) $(LIBS) - -$(COBJECTS) : %.o : %.c - $(GCC) $(CFLAGS) -c $< -o $@ $(INCLUDES) $(LIBS) - -$(CPPOBJECTS) : %.o : %.cpp - $(GCC) $(CPPFLAGS) -c $< -o $@ $(INCLUDES) $(LIBS) - -vrpn/build: - mkdir -p src/vrpn/build - cd src/vrpn/build && cmake .. && make - -logs: - mkdir -p logs - -clean_logs: - rm -f logs/* - -clean: - rm -f $(EXE) $(OBJECTS) - -debug: - @echo $(COBJECTS) - @echo $(CPPOBJECTS) diff --git a/README.md b/README.md deleted file mode 100644 index f89fed232d356c457ad4729994eecfe3ee4cbd41..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -# groundStation \ No newline at end of file diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000000000000000000000000000000000000..e1779e1b90dfddf63531449c02e5088f84a284dd --- /dev/null +++ b/Readme.md @@ -0,0 +1 @@ +This is a readme, please update accordingly. \ No newline at end of file diff --git a/logs/Sun_Oct__9_17:47:19_2016.txt b/logs/Sun_Oct__9_17:47:19_2016.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/logs/Sun_Oct__9_17:47:36_2016.txt b/logs/Sun_Oct__9_17:47:36_2016.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/commands.c b/src/commands.c deleted file mode 100644 index dc4749ee334f38da4383ca7d8200bbafa429a2b4..0000000000000000000000000000000000000000 --- a/src/commands.c +++ /dev/null @@ -1,109 +0,0 @@ -#include "commands.h" - -static command_t registeredCommands[NUM_COMMANDS] = { - { 0x00, 0x00, stringType, "debug", &debug }, //DEBUG - { 0x01, 0x00, stringType, "setyaw", &setyaw }, //CALIBRATION - { 0x01, 0x01, stringType, "setyawp", &setyawp }, - { 0x01, 0x02, stringType, "setyawd", &setyawd }, - { 0x01, 0x03, stringType, "setroll", &setroll }, - { 0x01, 0x04, stringType, "setrollp", &setrollp }, - { 0x01, 0x05, stringType, "setrolld", &setrolld }, - { 0x01, 0x06, stringType, "setpitch", &setpitch }, - { 0x01, 0x07, stringType, "setpitchp", &setpitchp }, - { 0x01, 0x08, stringType, "setpitchd", &setpitchd }, - { 0x01, 0x09, stringType, "setthrottle", &setthrottle }, - { 0x01, 0x0A, stringType, "setthrottlep", &setthrottlep }, - { 0x01, 0x0B, stringType, "setthrottlei", &setthrottlei }, - { 0x01, 0x0C, stringType, "setthrottled", &setthrottled }, - { 0x02, 0x00, stringType, "getaccel", &getaccel }, //REQUEST - { 0x02, 0x01, stringType, "getgyro", &getgyro }, - { 0x02, 0x02, stringType, "getpitchangle", &getpitchangle }, - { 0x02, 0x03, stringType, "getrollangle", &getrollangle }, - { 0x03, 0x00, stringType, "accelresp", accelresp }, //RESPONSE - { 0x03, 0x01, stringType, "gyroresp", &gyroresp }, - { 0x03, 0x02, stringType, "pitchangleresp", &pitchangleresp }, - { 0x03, 0x03, stringType, "rollangleresp", &rollangleresp }, - { 0x04, 0x00, stringType, "update", &update }, //UPDATE - { 0x04, 0x01, stringType, "beginupdate", &beginupdate }, - { 0x05, 0x00, stringType, "log", &logdata }, //LOG - { 0x05, 0x01, stringType, "response", &response }, -}; - -int debug(unsigned char *c, int dataLen){ - return 0; -} -int setyaw(unsigned char *c, int dataLen){ - return 0; -} -int setyawp(unsigned char *c, int dataLen){ - return 0; -} -int setyawd(unsigned char *c, int dataLen){ - return 0; -} -int setroll(unsigned char *c, int dataLen){ - return 0; -} -int setrollp(unsigned char *c, int dataLen){ - return 0; -} -int setrolld(unsigned char *c, int dataLen){ - return 0; -} -int setpitch(unsigned char *c, int dataLen){ - return 0; -} -int setpitchp(unsigned char *c, int dataLen){ - return 0; -} -int setpitchd(unsigned char *c, int dataLen){ - return 0; -} -int setthrottle(unsigned char *c, int dataLen){ - return 0; -} -int setthrottlep(unsigned char *c, int dataLen){ - return 0; -} -int setthrottlei(unsigned char *c, int dataLen){ - return 0; -} -int setthrottled(unsigned char *c, int dataLen){ - return 0; -} -int getaccel(unsigned char *c, int dataLen){ - return 0; -} -int getgyro(unsigned char *c, int dataLen){ - return 0; -} -int getpitchangle(unsigned char *c, int dataLen){ - return 0; -} -int getrollangle(unsigned char *c, int dataLen){ - return 0; -} -int accelresp(unsigned char *c, int dataLen){ - return 0; -} -int gyroresp(unsigned char *c, int dataLen){ - return 0; -} -int pitchangleresp(unsigned char *c, int dataLen){ - return 0; -} -int rollangleresp(unsigned char *c, int dataLen){ - return 0; -} -int update(unsigned char *c, int dataLen){ - return 0; -} -int beginupdate(unsigned char *c, int dataLen){ - return 0; -} -int logdata(unsigned char *c, int dataLen){ - return 0; -} -int response(unsigned char *packet, int dataLen){ - return 0; -} \ No newline at end of file diff --git a/src/commands.h b/src/commands.h deleted file mode 100644 index 050990de386d1132419c230744316033805f33af..0000000000000000000000000000000000000000 --- a/src/commands.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef _COMMANDS_H -#define _COMMANDS_H - -#define NUM_COMMANDS 26 - -//TODO handle with enums -#define MAX_TYPE 6 -#define MAX_SUBTYPE 100 - -int debug(unsigned char *c, int dataLen); -int setyaw(unsigned char *c, int dataLen); -int setyawp(unsigned char *c, int dataLen); -int setyawd(unsigned char *c, int dataLen); -int setroll(unsigned char *c, int dataLen); -int setrollp(unsigned char *c, int dataLen); -int setrolld(unsigned char *c, int dataLen); -int setpitch(unsigned char *c, int dataLen); -int setpitchp(unsigned char *c, int dataLen); -int setpitchd(unsigned char *c, int dataLen); -int setthrottle(unsigned char *c, int dataLen); -int setthrottlep(unsigned char *c, int dataLen); -int setthrottlei(unsigned char *c, int dataLen); -int setthrottled(unsigned char *c, int dataLen); -int getaccel(unsigned char *c, int dataLen); -int getgyro(unsigned char *c, int dataLen); -int getpitchangle(unsigned char *c, int dataLen); -int getrollangle(unsigned char *c, int dataLen); -int accelresp(unsigned char *c, int dataLen); -int gyroresp(unsigned char *c, int dataLen); -int pitchangleresp(unsigned char *c, int dataLen); -int rollangleresp(unsigned char *c, int dataLen); -int update(unsigned char *c, int dataLen); -int beginupdate(unsigned char *c, int dataLen); -int logdata(unsigned char *c, int dataLen); -int response(unsigned char *packet, int dataLen); - -enum Message{ - BEGIN_CHAR = 0xBE, - END_CHAR = 0xED -}; - -enum DataType -{ - floatType, - intType, - stringType -}; - -typedef struct command { - char ID; - char subID; - char dataType; - char commandText[100]; - int (*functionPtr)(unsigned char *command, int dataLen); -}command_t; - -enum CommandIDs{ - DEBUG, - CALIBRATION, - REQUEST, - RESPONSE, - UPDATE, - LOG, - MAX_COMMAND_IDS -}; - -static command_t registeredCommands[NUM_COMMANDS]; - -#endif \ No newline at end of file diff --git a/src/communication.c b/src/communication.c deleted file mode 100644 index 9c457bcbdf7fe0d4f75c97fa309ec2cbbc7d5870..0000000000000000000000000000000000000000 --- a/src/communication.c +++ /dev/null @@ -1,255 +0,0 @@ -#include "communication.h" -#include "commands.h" -#include <string.h> -#include <ctype.h> - -static int msgNum = 0; - -tokenList_t tokenize(char* cmd) { - int maxTokens = 16; - tokenList_t ret; - ret.numTokens = 0; - ret.tokens = malloc(sizeof(char*) * maxTokens); - ret.tokens[0] = NULL; - - int i = 0; - char* token = strtok(cmd, " "); - while (token != NULL && i < maxTokens - 1) { - ret.tokens[i++] = token; - ret.tokens[i] = NULL; - ret.numTokens++; - token = strtok(NULL, " "); - } - - return ret; -} - -int checkFloat(char *floatString, float *value) { - char *tmp; - *value = strtod(floatString, &tmp); - if(!(isspace(*tmp) || *tmp == 0)) { - fprintf(stderr, "%s is not a valid floating-point number\n", floatString); - return 0; - } - return 1; -} - -int checkInt(char *intString, int *value) { - char *tmp; - long temp_long; - temp_long = strtol(intString, &tmp, 0); // base 10 number inputted - if(temp_long < INT_MIN || temp_long > INT_MAX || !(isspace(*tmp) || *tmp == 0)) { - fprintf(stderr, "%s is not a valid integer number\n", intString); - return 0; - } - printf("temp: %ld\n\n", temp_long); - *value = (int) temp_long; - return 1; -} - -//-------------------------------- -// Ground Station -//-------------------------------- - -// Formatting commands from ground station CLI -int formatCommand(unsigned char *command, unsigned char **formattedCommand) { - //command[strlen((char *)command) - 1] = 0; - - tokenList_t tokens = tokenize((char *)command); - float floatValue = 0.0; - int intValue = 0; - int valid; - metadata_t metadata = {}; - - // ---------------------------------------------- - if(tokens.numTokens > 1) { - for(int cmdIndex = 0; cmdIndex < NUM_COMMANDS; ++cmdIndex) - { - if(strcmp(tokens.tokens[0], registeredCommands[cmdIndex].commandText) == 0) - { - - switch (registeredCommands[cmdIndex].dataType) - { - // Validate the float input - case floatType: - valid = checkFloat(tokens.tokens[1], &floatValue); - if(!valid) { - return -1; - } - - printf("%f, %s\n", floatValue, tokens.tokens[1]); - - metadata.begin_char = BEGIN_CHAR; - metadata.msg_type = registeredCommands[cmdIndex].ID; - metadata.msg_subtype = registeredCommands[cmdIndex].subID; - metadata.msg_id = msgNum++; - metadata.data_len = sizeof(floatValue); - - formatPacket(&metadata, &floatValue, formattedCommand); - - break; - - // Validate the integer input - case intType: - valid = checkInt(tokens.tokens[1], &intValue); - if(!valid) { - return -1; - } - - metadata.begin_char = BEGIN_CHAR; - metadata.msg_type = registeredCommands[cmdIndex].ID; - metadata.msg_subtype = registeredCommands[cmdIndex].subID; - metadata.msg_id = msgNum++; - metadata.data_len = sizeof(intValue); - - formatPacket(&metadata, &intValue, formattedCommand); - - break; - - // Validate the string input (doesn't need to happen) - case stringType: - metadata.begin_char = BEGIN_CHAR; - metadata.msg_type = registeredCommands[cmdIndex].ID; - metadata.msg_subtype = registeredCommands[cmdIndex].subID; - metadata.msg_id = msgNum++; - metadata.data_len = strlen(tokens.tokens[1]); - - formatPacket(&metadata, &tokens.tokens[1], formattedCommand); - - break; - default: - return -1; - } - - return 0; - } - } - } - - // Only gets here if the command does not exist - return -1; -} - -// QUAD & Ground Station -// Format the log data from log_message -//int formatData(unsigned char *log_msg, unsigned char *formattedCommand) -int formatPacket(metadata_t *metadata, void *data, unsigned char **formattedCommand) -{ - *formattedCommand = malloc(sizeof(unsigned char) * metadata->data_len + 8); - //---------------------------------------------------------------------------------------------- - // index|| 0 | 1 | 2 | 3 & 4 | 5 & 6 | 7+ | end | - //---------------------------------------------------------------------------------------------| - // msg param|| beg char | msg type | msg subtype | msg id | data len (bytes) | data | checksum | - //-------------------------------------------------------------------------------------------- | - // bytes|| 1 | 1 | 1 | 2 | 2 | var | 1 | - //---------------------------------------------------------------------------------------------- - - // Begin Char: - (*formattedCommand)[0] = metadata->begin_char; - - // Msg type: - (*formattedCommand)[1] = metadata->msg_type; - - // Msg subtype - (*formattedCommand)[2] = metadata->msg_subtype; - - //Msg id (msgNum is 2 bytes) - (*formattedCommand)[3] = metadata->msg_id; - - // Data length and data - bytes 5&6 for len, 7+ for data - (*formattedCommand)[5] = metadata->data_len & 0x000000ff; - (*formattedCommand)[6] = (metadata->data_len >> 8) & 0x000000ff; - - memcpy(&((*formattedCommand)[7]), data, metadata->data_len); - - // Checksum - // receive data and calculate checksum - int i; - char data_checksum; - for(i = 0; i < 7 + metadata->data_len; i++) - { - data_checksum ^= (*formattedCommand)[i]; - } - - (*formattedCommand)[7 + metadata->data_len] = data_checksum; - - return 0; -} - -// returns the length of the data in bytes (datalen from packet) and fills data -// and metadata with the packet information -// use as follows: -// -// packet is the entire packet message (formatted) -// data is an unallocated (char *) (pass it to this function as &data) -// meta_data is a pointer to an instance of metadata_t -// -int parse_packet(unsigned char * packet, unsigned char ** data, metadata_t * meta_data) -{ - //---------------------------------------------------------------------------------------------- - // index|| 0 | 1 | 2 | 3 & 4 | 5 & 6 | 7+ | end | - //---------------------------------------------------------------------------------------------| - // msg param|| beg char | msg type | msg subtype | msg id | data len (bytes) | data | checksum | - //-------------------------------------------------------------------------------------------- | - // bytes|| 1 | 1 | 1 | 2 | 2 | var | 1 | - //---------------------------------------------------------------------------------------------- - - // first byte must be the begin char - if(packet[0] != 0xBE) - return -1; - - // receive metadata - meta_data->begin_char = packet[0]; - meta_data->msg_type = packet[1]; - meta_data->msg_subtype = packet[2]; - meta_data->msg_id = (packet[4] << 8) | (packet[3]); - meta_data->data_len = (packet[6] << 8) | (packet[5]); - unsigned char packet_checksum = packet[7+meta_data->data_len]; - //fprintf(stderr, "datalen: %d\n", meta_data->data_len); - - int i; - - // receive data - *data = malloc(meta_data->data_len); - for(i = 0; i < meta_data->data_len; i++) - { - (*data)[i] = packet[7+i]; - } - - // calculate checksum - unsigned char calculated_checksum = 0; - for(i = 0; i < meta_data->data_len + 7; i++) - { - calculated_checksum ^= packet[i]; - } - - // compare checksum - if(packet_checksum != calculated_checksum) - fprintf(stderr, "Checksums did not match (Parse Packet): 0x%02x\t0x%02x\n", packet_checksum, calculated_checksum); - - return 0; -} - -// QUAD & Ground Station -// Process the command received -int processCommand(unsigned char *packet, unsigned int cmdIndex) { - int validPacket; - unsigned char *data; - metadata_t metadata; - - // Validate the message is correctly formatted - validPacket = parse_packet(packet, &data, &metadata); - if(validPacket != 0) { - return -1; - } - - if(metadata.data_len >= 0) { - // Call the appropriate subtype function - (* (registeredCommands[cmdIndex].functionPtr))(data, metadata.data_len); - - return 0; - } - - // Only gets here if there is an error - return -1; -} diff --git a/src/communication.h b/src/communication.h deleted file mode 100644 index 94a3c33c5131ebf2a8c1c4d506bb8e7e5cf62655..0000000000000000000000000000000000000000 --- a/src/communication.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _COMMUNICATION_H -#define _COMMUNICATION_H - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <limits.h> -#include "type_def.h" - -tokenList_t tokenize(char* cmd); -int checkFloat(char *floatString, float *value); -int checkInt(char *intString, int *value); -int formatCommand(unsigned char *command, unsigned char **formattedCommand); -int formatPacket(metadata_t *metadata, void *data, unsigned char **formattedCommand); -int parse_packet(unsigned char * packet, unsigned char ** data, metadata_t * meta_data); -int processCommand(unsigned char *command, unsigned int cmdIndex); -int logData(unsigned char *log_msg, unsigned char *formattedCommand); -float getFloat(unsigned char* str, int pos); -int getInt(unsigned char* str, int pos); - -#endif diff --git a/src/logger.c b/src/logger.c deleted file mode 100644 index 1d8d5896d4bea16f289264f53df74d6106b9f6d3..0000000000000000000000000000000000000000 --- a/src/logger.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Author: Kris Burney - * - * Logger file for holding functions pertaining to loging to a file. - */ -#include "logger.h" -#include <stdio.h> - -int quadlog_file; - -int createLogFile(int argc, char* argv) -{ - char log_file[300] = {'l', 'o', 'g','s', '/'}; - if(argc >= 2) - { - strcat(log_file, argv); - printf("Creating log file '%s'...\n",log_file); - quadlog_file = open(log_file, O_WRONLY | O_CREAT, 0666); - return quadlog_file; - } - else - { - time_t rawtime; - char timestr [30]; - time(&rawtime); - sprintf(timestr,"%s",ctime(&rawtime)); - - // Lets convert space to _ in - char *p = timestr; - int i = 0; - while(i < strlen(timestr)) - { - if (*p == ' ') - *p = '_'; - i++; - p++; - } - - // timestr has a weird char at the end of it. - // we will not include it in our file name - strncat(log_file, timestr, strlen(timestr) -1 ); - strcat(log_file, ".txt"); - printf("Creating log file '%s'...\n",log_file); - quadlog_file = open(log_file, O_WRONLY | O_CREAT, 0666); - return quadlog_file; - } -} - -int updateLogFile(const struct ucart_vrpn_TrackerData * td) -{ - return dprintf(quadlog_file, "FPS: %lf Pos (xyz): (%lf %lf %lf) Att (pry): (%lf %lf %lf)\n", - td->fps, td->x, td->y, td->z, td->pitch, td->roll, td->yaw); -} - -int writeStringToLog(const char * string) -{ - return dprintf(quadlog_file, "%s", string); -} diff --git a/src/logger.h b/src/logger.h deleted file mode 100644 index 5b5ae7541acd36e5991a6ea847af989597527694..0000000000000000000000000000000000000000 --- a/src/logger.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Author: Kris Burney - * - * Logger header file for holding info pertaining to loging to a file. - */ -#ifndef _LOGGER_H -#define _LOGGER_H - -#include <fcntl.h> -#include <time.h> -#include <stdio.h> -#include <string.h> - -#include "vrpn_tracker.hpp" - -int createLogFile(int, char*); -int writeStringToLog(const char*); -int updateLogFile(const struct ucart_vrpn_TrackerData* ); - - -#endif \ No newline at end of file diff --git a/src/microcart_cli.c b/src/microcart_cli.c deleted file mode 100644 index 74c5a7b21be9c68d4d09d05822b7f8c08180c3ae..0000000000000000000000000000000000000000 --- a/src/microcart_cli.c +++ /dev/null @@ -1,390 +0,0 @@ -/* Author: Kris Burney - * - * BlueTooth socket program for passing vrpn data to quad. - */ -//system includes -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <signal.h> -#include <sys/socket.h> -#include <bluetooth/bluetooth.h> -#include <bluetooth/rfcomm.h> -#include <pthread.h> - -//user created includes -#include "communication.h" -#include "commands.h" -#include "vrpn_tracker.hpp" -#include "type_def.h" -#include "logger.h" - -#define QUAD_BT_ADDR "00:06:66:64:61:D6" -#define QUAD_BT_CHANNEL 0x01 -#define CMD_MAX_LENGTH 1024 - -// function prototypes -void killHandler(int); -void readAndPrint(void); -void sendVrpnPacket(struct ucart_vrpn_TrackerData *); -void sendStartPacket(void); -void getVRPNPacket(struct ucart_vrpn_TrackerData *); -void printVrpnData(struct ucart_vrpn_TrackerData *); -int connectToZybo(); -void *handleQuadResponse(); -void *handleCliInput(); -int atomic_check(int*, pthread_mutex_t*); -void performCommand(char *cmdName, char * command); -int startsWith(const char *pre, const char *str); - -//static void cb(struct ucart_vrpn_TrackerData *); - -// global variables -static volatile int keepRunning = 1; -const char *TRACKER_IP = "UAV@192.168.0.120:3883"; -int quadlog_file; -int zyboSocket, status, bytes_read; -struct ucart_vrpn_tracker * tracker = NULL; -const char *logHeader = "";//"#\n#\tDefault log header\n#\tEverything after '#'`s will be printed as is in the processed logs.\n#\n\0"; - -pthread_mutex_t quadResponseMutex, cliInputMutex ; -unsigned char *respBuf, *commandBuf; -int newQuadResponse = 0, newCliInput = 0; - -// Structures to be used throughout -modular_structs_t structs = {}; - -// Callback to be ran whenever the tracker receives data. -// Currently doing much more than it should. It will be slimmed down -// in the future. - -// static void cb(struct ucart_vrpn_TrackerData * td) -// { -// static int count = 0; - -// if(!(count % 10)) { -// sendVrpnPacket(td); -// updateLogFile(td); -// } - -// count++; - -// // This will print the vrpn data to the terminal if necissary. -// // Commented out because the callback will cover quad log data -// // at the end of flight. -// /**if(!(count % 100)) { -// printVrpnData(td); -// printf("[Info] Received %d tracker updates.\n", count); -// }**/ -// } - - -void *handleQuadResponse() { - unsigned char buffer[255]; - - while(keepRunning) { - // Clear the buffer and read the message from the socket (from the server) - memset(buffer, 0, 255); - - // If there was an error reading from the socket, throw an error - if(read(zyboSocket, buffer, 255) <= 0) { - fprintf(stderr, "CLI QUAD: ERROR reading from quad.\n"); - continue; - } - - pthread_mutex_lock(&quadResponseMutex); - newQuadResponse = 1; - memcpy(respBuf, buffer, 255); - pthread_mutex_unlock(&quadResponseMutex); - - //parse_packet(buffer, &respBuf, &metadata); - // fprintf(stderr, "CLI QUAD: %s\n", buffer); - } - - pthread_exit(NULL); -} - -void *handleCliInput() { - sleep(1); - while(keepRunning) - { - char userCommand[CMD_MAX_LENGTH] = {}; - fprintf(stderr, "$microcart> "); - - while(fgets(userCommand, sizeof(userCommand), stdin) != NULL && keepRunning) { - - // if the user simply hit enter then let them try again - if((userCommand[0] == '\n') || (userCommand[0] == '\r')) - { - fprintf(stderr, "$microcart> "); - - memset(userCommand, 0, CMD_MAX_LENGTH); - - continue; - } - - if((userCommand[strlen(userCommand) - 1] == '\n') || (userCommand[strlen(userCommand) - 1] == '\r')) - userCommand[strlen(userCommand) - 1] = '\0'; - - pthread_mutex_lock(&cliInputMutex); - newCliInput = 1; - memcpy(commandBuf, &userCommand, CMD_MAX_LENGTH); - pthread_mutex_unlock(&cliInputMutex); - - fprintf(stderr, "$microcart> "); - - memset(userCommand, 0, CMD_MAX_LENGTH); - } - } - - pthread_exit(NULL); -} - -int main(int argc, char **argv) -{ - pthread_t quadResponse, cliInput; - respBuf = malloc(1024); - commandBuf = malloc(CMD_MAX_LENGTH); - - signal(SIGINT, killHandler); - - if ((zyboSocket = connectToZybo()) < 0) - { - perror("Error connecting to Zybo..."); - free(respBuf); - free(commandBuf); - exit(1); - } - - // create vrpnTracker instance -// tracker = ucart_vrpn_tracker_createInstance(TRACKER_IP); - - // Retrieve VRPN data from the control loop - fprintf(stderr, "CLI: Starting quad receiving thread...\n"); - pthread_create(&quadResponse, NULL, handleQuadResponse, NULL); - fprintf(stderr, "CLI: Thread quad receiving started.\n"); - - // Retrieve user command input - fprintf(stderr, "CLI: Starting cli input thread...\n"); - pthread_create(&cliInput, NULL, handleCliInput, NULL); - fprintf(stderr, "CLI: Thread Cli input started.\n"); - - // open the log file - if( (status = createLogFile(argc, argv[1])) < 0) - { - perror("Error creating log file..."); - free(respBuf); - free(commandBuf); - exit(1); - } - writeStringToLog(logHeader); - - //tell the quad we are ready to send it vrpn data - printf("sending Start Packet...\n"); - sendStartPacket(); - - // this function will be called whenever tracker receives data - // ucart_vrpn_tracker_addCallback(tracker, cb); - int updatePrompt = 0; - while(keepRunning) - { - char tmpRespBuf[1024]; - unsigned char tmpCommandBuf[CMD_MAX_LENGTH]; - - - if(updatePrompt) - { - fprintf(stderr, "$microcart> "); - updatePrompt = 0; - } - - //check for user input via cli - if(atomic_check(&newCliInput, &cliInputMutex)) - { - pthread_mutex_lock(&cliInputMutex); - newCliInput = !newCliInput; - memcpy(tmpCommandBuf, commandBuf, CMD_MAX_LENGTH); - pthread_mutex_unlock(&cliInputMutex); - - // I can use printf becuase the command was gathered using fgets. - //fprintf(stderr, "\rINPUT FOUND via CLI: '%s'\n", tmpCommandBuf); - updatePrompt = !updatePrompt; - unsigned char *packet; - formatCommand(tmpCommandBuf, &packet); - } - - //check for update/response from quad - if(atomic_check(&newQuadResponse, &quadResponseMutex)) - { - pthread_mutex_lock(&quadResponseMutex); - newQuadResponse = !newQuadResponse; - memcpy(tmpRespBuf, respBuf, 1024); - pthread_mutex_unlock(&quadResponseMutex); - - char buf[1025]; - memcpy(buf, tmpRespBuf, 1024); - buf[1025] = '\0'; - //fprintf(stderr, "\rINPUT FOUND via QUAD: '%s'\n", buf); - writeStringToLog(buf); - updatePrompt = !updatePrompt; - } - } - - //ucart_vrpn_tracker_freeInstance(tracker); - //free(vrpnData); - free(respBuf); - free(commandBuf); - pthread_mutex_destroy(&cliInputMutex); - pthread_mutex_destroy(&quadResponseMutex); - close(zyboSocket); - close(quadlog_file); - return 0; -} - -// signal handler to exit while loop of main function -void killHandler(int dummy) { - keepRunning = 0; - printf("\nleaving Bluetooth module\n"); -} - -void readAndPrint() { - // read data from the server - // this is a blocking call. - //TODO: Implement a non blocking version of this. - bytes_read = read(zyboSocket, respBuf, sizeof(respBuf) -1); - if( bytes_read > 0) - { - respBuf[bytes_read] = '\0'; - printf("%s", respBuf); - } -} - -void sendStartPacket() { - unsigned char packet[8] = {0}; - - metadata_t metadata = - { - BEGIN_CHAR, - 0x04, - 0x01, - 0x01, - 0 - }; - - packet[0] = metadata.begin_char; // BEGIN //PACKET_START_BYTE; - packet[1] = metadata.msg_type; // UPDATE //'U'; // U for vrpn camera update, C for command - packet[2] = metadata.msg_subtype; // BEGIN UPDATE - packet[3] = 1; // MSG ID(1) - packet[4] = 0; // MSG ID(2) - packet[5] = 0; // DATALEN(1) - packet[6] = 0; // DATALEN(2) - - char checksum = 0; - int i; - for(i=0; i < metadata.data_len + 7; i++) - checksum ^= packet[i]; - - packet[metadata.data_len + 7] = checksum; //PACKET_END_BYTE; - status = write(zyboSocket, &packet, metadata.data_len + 8); - if (status != 8) - { - perror("Error sending start packet...\n"); - keepRunning = 0; - }else - { - printf("Start packet successfuly sent...\n"); - } -} - -void sendVrpnPacket(struct ucart_vrpn_TrackerData *info) { - int pSize = sizeof(info) + 8; - int n; - char packet[pSize]; - packet[0] = 0xBE; // BEGIN //PACKET_START_BYTE; - packet[1] = 0x04; // UPDATE //'U'; // U for vrpn camera update, C for command - packet[2] = 0x00; // N/A - //TODO Figure out Packet ID with this new ucar_vrpn_TrackerData struct - packet[3] = (0x00 & 0x000000ff); // MSG ID(1) - packet[4] = ((0x00 >> 8) & 0x000000ff); // MSG ID(2) - packet[5] = (sizeof(info) & 0x000000ff); // DATALEN(1) - packet[6] = ((sizeof(info) >> 8) & 0x00000ff); // DATALEN(2) - memcpy(&packet[7], &info, sizeof(info)); - - char checksum = 0; - int i; - for(i=0; i < pSize - 1; i++) - checksum ^= packet[i]; - - packet[pSize - 1] = checksum; //PACKET_END_BYTE; - - n = write(zyboSocket, packet, pSize); - if(n < 0) { - perror("vrpnhandler: ERROR writing to socket"); - keepRunning = 0; - } -} - -void getVRPNPacket(struct ucart_vrpn_TrackerData *td) { - int status; - if((status = ucart_vrpn_tracker_getData(tracker, td)) < 0) - { - perror("Error receiving VRPN data from tracker..."); - keepRunning = 0; - } -} - -void printVrpnData(struct ucart_vrpn_TrackerData * td) { - printf("FPS: %lf Pos (xyz): (%lf %lf %lf) Att (pry): (%lf %lf %lf)\n", - td->fps, td->x, td->y, td->z, td->pitch, td->roll, td->yaw); -} - -int connectToZybo() { - int sock; - struct sockaddr_rc addr = { -1 }; - - // allocate a socket - sock = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); - - //set the connection params ie. who to connect to - addr.rc_family = AF_BLUETOOTH; - addr.rc_channel = (uint8_t) QUAD_BT_CHANNEL; - str2ba( QUAD_BT_ADDR, &addr.rc_bdaddr ); - - printf("Attempting to connect to zybo. Please be patient...\n"); - // blocking call to connect to socket sock ie. zybo board - status = connect(sock, (struct sockaddr *)&addr, sizeof(addr)); - - // connection failed - if(status < 0) - { - close(sock); - printf("Connection failed!...\n"); - return -1; - } - else - { - printf("connection successful!...\n"); - return sock; - } -} - -int atomic_check(int* atomicFlag, pthread_mutex_t* mutex) { - pthread_mutex_lock(mutex); - int result = *atomicFlag; - pthread_mutex_unlock(mutex); - return result; -} - -void performCommand(char *cmdName, char * command) { - for(int i = 0; i < NUM_COMMANDS; ++i) - { - if(startsWith(registeredCommands[i].commandText, command)); - fprintf(stderr, "\r\n You used cmd '%s'\n",registeredCommands[i].commandText); - } -} - -int startsWith(const char *pre, const char *str) { - size_t lenpre = strlen(pre), - lenstr = strlen(str); - return lenstr < lenpre ? 0 : (strncmp(pre, str, lenpre) == 0); -} \ No newline at end of file diff --git a/src/old_main.cold b/src/old_main.cold deleted file mode 100644 index 5234bcc567a6e574b30eea671b3f977a7211f478..0000000000000000000000000000000000000000 --- a/src/old_main.cold +++ /dev/null @@ -1,73 +0,0 @@ -#include <libcli.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <string.h> -#include <strings.h> -#include <signal.h> -#include <unistd.h> -#include <arpa/inet.h> - - -#define CLITEST_PORT 8000 - -int fn_help(struct cli_def *cli, const char *command, char *argv[], int argc); - -struct cli_def * cli; -int on = 1; - -int main(int argc, char **argv) -{ - int s, x; - struct sockaddr_in addr; - - if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) - { - perror("socket"); - return 1; - } - setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = htonl(INADDR_ANY); - addr.sin_port = htons(CLITEST_PORT); - - if (bind(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) - { - perror("bind"); - return 1; - } - - if (listen(s, 50) < 0) - { - perror("listen"); - return 1; - } - - printf("Listening on port %d\n", CLITEST_PORT); - - cli = cli_init(); - cli_set_banner(cli, "Welcome to my test cli"); - - cli_register_command(cli, NULL, "helpme", fn_help, PRIVILEGE_UNPRIVILEGED, MODE_EXEC, "displays help info for a command"); - - - - - while((x = accept(s, NULL, NULL))) - { - cli_loop(cli, x); - close(x); - } - - - cli_done(cli); -} - - -int fn_help(struct cli_def *cli, const char *command, char *argv[], int argc) { - printf("you ran the help function!!\n"); - return 0; -} - diff --git a/src/type_def.h b/src/type_def.h deleted file mode 100644 index 55dca9e8fb27c26397b00961b7dbec8bbe0d4136..0000000000000000000000000000000000000000 --- a/src/type_def.h +++ /dev/null @@ -1,361 +0,0 @@ -/* - * struct_def.h - * - * Created on: Mar 2, 2016 - * Author: ucart - */ - -#ifndef TYPE_DEF_H_ -#define TYPE_DEF_H_ - -/** - * @brief - * The modes for autonomous and manual flight. - * - */ -enum flight_mode{ - AUTO_FLIGHT_MODE, - MANUAL_FLIGHT_MODE -}; - -//---------------------------------------------------------------------------------------------- -// index|| 0 | 1 | 2 | 3 & 4 | 5 & 6 | 7+ | end | -//---------------------------------------------------------------------------------------------| -// msg param|| beg char | msg type | msg subtype | msg id | data len (bytes) | data | checksum | -//-------------------------------------------------------------------------------------------- | -// bytes|| 1 | 1 | 1 | 2 | 2 | var | 1 | -//---------------------------------------------------------------------------------------------- -typedef struct { - char begin_char; - char msg_type; - char msg_subtype; - int msg_id; - int data_len; -} metadata_t; - - -// String builder data type -typedef struct stringBuilder_s { - char* buf; - int length; - int capacity; - int maxCapacity; - - // Methods - int (*addStr)(struct stringBuilder_s*, char*); - int (*addStrAt)(struct stringBuilder_s*, char*, int); - int (*addChar)(struct stringBuilder_s*, char); - int (*addCharAt)(struct stringBuilder_s*, char, int); - int (*removeCharAt)(struct stringBuilder_s*, int); - void (*clear)(struct stringBuilder_s*); -} stringBuilder_t; - -typedef struct { - char** tokens; - int numTokens; -} tokenList_t; - -typedef struct commands{ - int pitch, roll, yaw, throttle; -}commands; - -typedef struct raw{ - int x,y,z; -}raw; -typedef struct PID_Consts{ - float P, I, D; -}PID_Consts; - -//Camera system info -typedef struct { - int packetId; - - double y_pos; - double x_pos; - double alt_pos; - - double yaw; - double roll; - double pitch; -} quadPosition_t; - -typedef struct { - float yaw; - float roll; - float pitch; - float throttle; -} quadTrims_t; - -//Gyro, accelerometer, and magnetometer data structure -//Used for reading an instance of the sensor data -typedef struct { - - // GYRO - //Xint16 raw_gyro_x, raw_gyro_y, raw_gyro_z; - - float gyro_xVel_p; // In degrees per second - float gyro_yVel_q; - float gyro_zVel_r; - - // ACCELEROMETER - //Xint16 raw_accel_x, raw_accel_y, raw_accel_z; - - float accel_x; //In g - float accel_y; - float accel_z; - - float accel_roll; - float accel_pitch; - - - // MAG - //Xint16 raw_mag_x, raw_mag_y, raw_mag_z; - - float heading; // In degrees - - float mag_x; //Magnetic north: ~50 uT - float mag_y; - float mag_z; - - - -}gam_t; - -typedef struct PID_t { - double current_point; // Current value of the system - double setpoint; // Desired value of the system - float Kp; // Proportional constant - float Ki; // Integral constant - float Kd; // Derivative constant - double prev_error; // Previous error - double acc_error; // Accumulated error - double pid_correction; // Correction factor computed by the PID - float dt; // sample period -} PID_t; - -typedef struct PID_values{ - float P; // The P component contribution to the correction output - float I; // The I component contribution to the correction output - float D; // The D component contribution to the correction output - float error; // the error of this PID calculation - float change_in_error; // error change from the previous calc. to this one - float pid_correction; // the correction output (P + I + D) -} PID_values; - -///////// MAIN MODULAR STRUCTS -/** - * @brief - * Holds the data inputed by the user - * - */ -typedef struct user_input_t { - int rc_commands[6]; // Commands from the RC transmitter - - -// float cam_x_pos; // Current x position from the camera system -// float cam_y_pos; // Current y position from the camera system -// float cam_z_pos; // Current z position from the camera system -// float cam_roll; // Current roll angle from the camera system -// float cam_pitch; // Current pitch angle from the camera system -// float cam_yaw; // Current yaw angle from the camera system - - float yaw_manual_setpoint; - float roll_angle_manual_setpoint; - float pitch_angle_manual_setpoint; - - int hasPacket; - stringBuilder_t * sb; -} user_input_t; - -/** - * @brief - * Holds the log data to be sent to the ground station. It may hold the - * timestamp of when a sensor's data was obtained. - * - */ -typedef struct log_t { - // Time - float time_stamp; - float time_slice; - - // Id - int packetId; - - gam_t gam; // Raw and calculated gyro, accel, and mag values are all in gam_t - float phi_dot, theta_dot, psi_dot; // gimbal equation values - - quadPosition_t currentQuadPosition; - - float roll_angle_filtered, pitch_angle_filtered; - float lidar_altitude; - - float pid_P_component, pid_I_component, pid_D_component; // use these generically for any PID that you are testing - - // PID coefficients and errors - PID_t local_x_PID, local_y_PID, altitude_PID; - PID_t angle_yaw_PID, angle_roll_PID, angle_pitch_PID; - PID_t ang_vel_yaw_PID, ang_vel_roll_PID, ang_vel_pitch_PID; - - PID_values local_x_PID_values, local_y_PID_values, altitude_PID_values; - PID_values angle_yaw_PID_values, angle_roll_PID_values, angle_pitch_PID_values; - PID_values ang_vel_yaw_PID_values, ang_vel_roll_PID_values, ang_vel_pitch_PID_values; - - // RC commands - commands commands; - - //trimmed values - quadTrims_t trims; - - int motors[4]; - -} log_t; - -/** - * @brief - * Holds the raw data from the sensors and the timestamp if available - * - */ -typedef struct raw_sensor { - int acc_x; // accelerometer x data - int acc_x_t; // time of accelerometer x data - - int acc_y; // accelerometer y data - int acc_y_t; // time of accelerometer y data - - int acc_z; // accelerometer z data - int acc_z_t; // time of accelerometer z data - - - int gyr_x; // gyroscope x data - int gyr_x_t; // time of gyroscope x data - - int gyr_y; // gyroscope y data - int gyr_y_t; // time of gyroscope y data - - int gyr_z; // gyroscope z data - int gyr_z_t; // time of gyroscope z data - - int ldr_z; //lidar z data (altitude) - int ldr_z_t; //time of lidar z data - - gam_t gam; - - // Structures to hold the current quad position & orientation - quadPosition_t currentQuadPosition; - -} raw_sensor_t; - -/** - * @brief - * Holds the processed data from the sensors and the timestamp if available - * - */ -typedef struct sensor { - int acc_x; // accelerometer x data - int acc_x_t; // time of accelerometer x data - - int acc_y; // accelerometer y data - int acc_y_t; // time of accelerometer y data - - int acc_z; // accelerometer z data - int acc_z_t; // time of accelerometer z data - - - int gyr_x; // gyroscope x data - int gyr_x_t; // time of gyroscope x data - - int gyr_y; // gyroscope y data - int gyr_y_t; // time of gyroscope y data - - int gyr_z; // gyroscope z data - int gyr_z_t; // time of gyroscope z data - - int ldr_z; //lidar z data (altitude) - int ldr_z_t; //time of lidar z data - - float pitch_angle_filtered; - float roll_angle_filtered; - float lidar_altitude; - - float phi_dot, theta_dot, psi_dot; - - // Structures to hold the current quad position & orientation - quadPosition_t currentQuadPosition; - quadTrims_t trims; - -} sensor_t; - -/** - * @brief - * Holds the setpoints to be used in the controller - * - */ -typedef struct setpoint_t { - quadPosition_t desiredQuadPosition; -} setpoint_t; - -/** - * @brief - * Holds the parameters that are specific to whatever type of - * control algorithm is being used - * - */ -typedef struct parameter_t { - PID_t roll_angle_pid, roll_ang_vel_pid; - PID_t pitch_angle_pid, pitch_ang_vel_pid; - PID_t yaw_ang_vel_pid; - PID_t local_x_pid; - PID_t local_y_pid; - PID_t yaw_angle_pid; - PID_t alt_pid; -} parameter_t; - -/** - * @brief - * Holds user defined data for the controller - * - */ -typedef struct user_defined_t { - int flight_mode; - int engaging_auto; -} user_defined_t; - -/** - * @brief - * Holds the raw actuator values before processing - * - */ -typedef struct raw_actuator_t { - - int controller_corrected_motor_commands[6]; - -} raw_actuator_t; - -/** - * @brief - * Holds processed commands to go to the actuators - * - */ -typedef struct actuator_command_t { - int pwms[4]; -} actuator_command_t; - -/** - * @brief - * Structures to be used throughout - */ -typedef struct { - user_input_t user_input_struct; - log_t log_struct; - raw_sensor_t raw_sensor_struct; - sensor_t sensor_struct; - setpoint_t setpoint_struct; - parameter_t parameter_struct; - user_defined_t user_defined_struct; - raw_actuator_t raw_actuator_struct; - actuator_command_t actuator_command_struct; -}modular_structs_t; - -//////// END MAIN MODULAR STRUCTS - -#endif /* TYPE_DEF_H_ */ diff --git a/src/vrpn/.clang-format b/src/vrpn/.clang-format deleted file mode 100644 index 4db5b4174816b346184a84b52af4cd2d4b2e9d0b..0000000000000000000000000000000000000000 --- a/src/vrpn/.clang-format +++ /dev/null @@ -1,15 +0,0 @@ ---- -Language: Cpp -BasedOnStyle: LLVM -Standard: Auto -IndentWidth: 4 -TabWidth: 4 -UseTab: Never -AccessModifierOffset: -4 -AllowShortIfStatementsOnASingleLine: true -BreakBeforeBraces: Stroustrup -BreakConstructorInitializersBeforeComma: true -NamespaceIndentation: All -DerivePointerBinding: true -... - diff --git a/src/vrpn/.clang-tidy b/src/vrpn/.clang-tidy deleted file mode 100644 index efa593154f46d7333fd31d2df8adfce94cb98ba4..0000000000000000000000000000000000000000 --- a/src/vrpn/.clang-tidy +++ /dev/null @@ -1,7 +0,0 @@ ---- -# Remove these blocked checks once the first batch are cleaned up -# - readability-braces-around-statements -Checks: '*,-clang-analyzer-alpha*,-llvm-include-order,-google-*,-llvm-header-guard,-readability-braces-around-statements,-misc-use-override' -HeaderFilterRegex: '.*' -... - diff --git a/src/vrpn/.gitmodules b/src/vrpn/.gitmodules deleted file mode 100644 index 4758fdfbad16add0a7fd3caf42b587405b32a569..0000000000000000000000000000000000000000 --- a/src/vrpn/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "submodules/hidapi"] - path = submodules/hidapi - url = https://github.com/vrpn/hidapi.git -[submodule "submodules/jsoncpp"] - path = submodules/jsoncpp - url = https://github.com/vrpn/jsoncpp.git diff --git a/src/vrpn/.travis.yml b/src/vrpn/.travis.yml deleted file mode 100644 index 512fa2f6722c5ad39aefa3529947f91174ddeb7e..0000000000000000000000000000000000000000 --- a/src/vrpn/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -compiler: - - clang - - gcc - -before_install: - - git submodule update --init --recursive - - sudo apt-get update -qq - - sudo apt-get install -qq libgpm-dev freeglut3-dev libxmu-dev libxi-dev libusb-1.0-0-dev libqt4-dev - -language: cpp -script: mkdir build && cd build && cmake -DVRPN_GPL_SERVER=TRUE -D VRPN_BUILD_EXTRA_COMPILER_WARNINGS=TRUE .. && make && make test diff --git a/src/vrpn/CMakeLists.txt b/src/vrpn/CMakeLists.txt deleted file mode 100644 index a4a0f2b392a767b449e291f8ead6106d14bed446..0000000000000000000000000000000000000000 --- a/src/vrpn/CMakeLists.txt +++ /dev/null @@ -1,1498 +0,0 @@ -cmake_minimum_required(VERSION 2.8.3) -project(VRPN) - -#----------------------------------------------------------------------------- -# XXX Things to make better. -# -# Repeat for all other configurable headers/libraries - see below for a list -# Move the shared-library code over to CMake's normal definition -# Improve this CPack installer. - -### -# Local CMake Modules - keep this first -### -list(APPEND CMAKE_MODULE_PATH ${VRPN_SOURCE_DIR}/cmake) -include(UseBackportedModules) -include(MSVCMultipleProcessCompile) -include(CppcheckTargets) -include(SetDefaultBuildType) -include(OptionRequires) -include(CTest) -include(CreateDashboardScripts) -include(CheckIncludeFileCXX) - -if((NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) OR VRPN_SUBPROJECT_BUILD) - # If you're using this as a subproject and want things installed, set VRPN_INSTALL TRUE. - set(SUBPROJECT TRUE) - set(DEFAULT_OFF_IF_SUBPROJECT OFF_BY_DEFAULT) - set(TRUE_UNLESS_SUBPROJECT FALSE) -else() - set(VRPN_INSTALL TRUE) - set(SUBPROJECT FALSE) - set(DEFAULT_OFF_IF_SUBPROJECT) - set(TRUE_UNLESS_SUBPROJECT TRUE) -endif() - -# TODO Remove the following when it is fixed in the Android CMake. -if(BUILD_WITH_ANDROID_NDK) - set(CMAKE_CXX_FLAGS - "--sysroot=${ANDROID_NDK_SYSROOT} ${CMAKE_CXX_FLAGS}") - set(CMAKE_C_FLAGS "--sysroot=${ANDROID_NDK_SYSROOT} ${CMAKE_C_FLAGS}") -endif() - -### -# On Windows 7, it does not work to install in the default location, -# which is the Program Files directory, because you have to not only have -# file permission to write there but also "run as administrator." This -# means that "make install" from a Visual Studio project fails. To get -# around that, we need to set CMAKE_INSTALL_PREFIX to something other -# than the default. However, it is a cache variable that has already been -# set. If we make a local variable, it uses this rather than the cache -# variable and never tells the poor user what happened (the GUI location -# looks standard but the files end up somewhere else). If we make it a -# non-forced cache variable, it already has a value so does not change. -# If we make it a forced cache variable, it gets overwritten every time -# and the user cannot change it on the GUI. So we have a workaround here. -# We make a cache variable that records whether we have ever forced the -# install prefix. If not, we force it. If so, we don't force it again. -# This has the effect of setting it the first time cmake is run, showing -# the change in the GUI, and also letting the user change the value in -# the GUI if they don't like what we did. If I knew how to do this only -# happen on Windows 7, I'd make the if(WIN32) more specific. -if(WIN32 AND NOT SUBPROJECT) - if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT - AND - (NOT - ONCE_SET_CMAKE_INSTALL_PREFIX)) - set(ONCE_SET_CMAKE_INSTALL_PREFIX - true - CACHE - INTERNAL - "Have we set the install prefix yet?" - FORCE) - set(CMAKE_INSTALL_PREFIX - C:/usr/local - CACHE - PATH - "Install path prefix, prepended onto install directories" - FORCE) - endif() -endif() - - -### -# Basic packaging options and versioning - -include("${CMAKE_CURRENT_SOURCE_DIR}/ParseVersion.cmake") - -message(STATUS - "Configuring the VRPN suite version ${CPACK_PACKAGE_VERSION} using the CMake-based build system\n") - -set(CPACK_PACKAGE_VENDOR - "Russell M. Taylor II at the University of North Carolina at Chapel Hill") -set(CPACK_PACKAGE_FILE_NAME - "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") -set(CPACK_SOURCE_PACKAGE_FILE_NAME - "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-src") -set(CPACK_PACKAGE_CONTACT "VRPN Community <vrpn@listserv.unc.edu>") - -#----------------------------------------------------------------------------- -# Compiler flags we got from Hans for Windows and from Sheldon Andrews -# for other architectures. -if(MSVC) # MS-Windows Visual Studio, both 32 and 64 bits - set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows") - if(MSVC_VERSION GREATER 1310) # This compiler flag needs newer than VS.NET 2003 (7.1) - # Choose fast, possibly less accurate floating point - # See http://msdn.microsoft.com/en-us/library/e7s85ffb(v=vs.80).aspx - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:fast") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast") - endif() - - # Do not assume fixed base address (probably for DLL integration?) - # http://msdn.microsoft.com/en-us/library/w368ysh2(v=vs.80).aspx - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /FIXED:NO") -else() - # GCC compilers on 64-bit machines require -fPIC for shared libraries or libs - # linked into shared libraries. - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_SHARED_LIBRARY_C_FLAGS}") - set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") -endif() - -set(SERVER_EXTRA_LIBS) -set(SERVER_LINK_FLAGS) - -# Set up correct defines for Windows header compilation: -# This theoretically sets the lower-bound on operating system compatibility -# http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx -# NT4 0x0400 -# Win2k 0x0500 -# WinXP 0x0501 -# WS2003SP1/WinXPSP2 0x0502 -# Vista 0x0600 -# Win7 0x0601 -# Win8 0x0602 -# Win8.1 0x0603 (though some docs say 0x0602 with NTDDI_VERSION 0x06030000) -if(WIN32) - set(WIN_MIN_VER 0x0500) # Default to Windows 2000 - if(MSVC AND MSVC_VERSION GREATER 1699) - # VS2012: defaults to vista+, update 1 added XP support in additional toolset. - if("${CMAKE_VS_PLATFORM_TOOLSET}" MATCHES "_xp") - set(WIN_MIN_VER 0x0501) # WinXP - else() - set(WIN_MIN_VER 0x0600) # Vista - endif() - endif() - add_definitions("-D_WIN32_WINNT=${WIN_MIN_VER}" "-DNTDDI_VERSION=${WIN_MIN_VER}0000") -endif() - -#----------------------------------------------------------------------------- -# Options that control what gets built and how. - -if(NOT SUBPROJECT) - # We can build two configurations (passing defs to the compile lines) - which ones do we want? - # Note that we can build both now, if desired! - option(VRPN_BUILD_CLIENT_LIBRARY - "Build the vrpn library including only client code" - ON) - option(VRPN_BUILD_SERVER_LIBRARY - "Build the vrpnserver library including client and server code" - ON) - - # Build various applications if we want them. - option(VRPN_BUILD_CLIENTS "Build VRPN client apps and tests" ON) - option(VRPN_BUILD_SERVERS "Build VRPN servers" ON) - - # Development tools - if(MSVC_IDE AND MSVC_VERSION LESS 1600) - # VS 2012 Express and newer has folder support... - option(VRPN_BUILD_WITH_PROJECT_FOLDERS - "Use project folders in build system - not compatible with Visual C++ Express editions!" - OFF) - else() - set(VRPN_BUILD_WITH_PROJECT_FOLDERS ON) - endif() - - set_property(GLOBAL - PROPERTY - USE_FOLDERS - ${VRPN_BUILD_WITH_PROJECT_FOLDERS}) - - # Set a default build type - set_default_build_type("RelWithDebInfo") - -endif() - -# Force use of our CMake-processed configuration header before the stock one. -include_directories("${PROJECT_BINARY_DIR}") - - -# Include directory needed by all of the files -include_directories(${VRPN_SOURCE_DIR} - ${VRPN_SOURCE_DIR}/atmellib - ${VRPN_SOURCE_DIR}/quat) - - -#----------------------------------------------------------------------------- -# Libraries we need to do our thing. -# -# CMake variables: -# SERVER_EXTRA_LIBS - libraries to link against when building the server lib -# EXTRA_LIBS - libraries to link against when building any VRPN lib -# -# Note that library linking is, by default, transitive: -# Specify linking here (even though static libraries might not use it -# directly - think of shared libs and your fellow developer) rather than -# in the included apps. - -### -# Quatlib -### -add_subdirectory(quat) -list(APPEND EXTRA_LIBS quat) - -### -# Threading (not on win32) -# Remove the test for Android when threads are fixed in the Android CMake. -### -if(NOT WIN32 AND NOT BUILD_WITH_ANDROID_NDK) - find_package(Threads REQUIRED) - list(APPEND EXTRA_LIBS ${CMAKE_THREAD_LIBS_INIT}) -endif() - -### -# Windows-specific (non-Cygwin) dependencies -### -if(WIN32 AND NOT UNIX) - # Winsock - needed for endianness conversion - list(APPEND EXTRA_LIBS ws2_32) - - # Windows multimedia - needed for joywin32 - list(APPEND EXTRA_LIBS winmm) -endif() - -### -# Optional packages -### -message(STATUS - "Now searching for auto-configurable optional packages...\n") - -### -# Submodules - bundled libraries/sources -### -add_subdirectory(submodules) - -### -# SWIG and Python Libs (for python wrappers) -### -find_package(SWIG) - -set(CurrentPythonSettings - "${VRPN_BUILD_PYTHON}${VRPN_BUILD_PYTHON_HANDCODED_2X}${VRPN_BUILD_PYTHON_HANDCODED_3X}") -if(NOT CurrentPythonSettings STREQUAL _VRPN_PYTHON_SETTINGS) - set(vrpn_python_versionsearch) - set(vrpn_python_versionsearchargs) - if(VRPN_BUILD_PYTHON) - # Swig wants 2.x, I assume - set(vrpn_python_versionsearch 2) - if(VRPN_BUILD_PYTHON_HANDCODED_3X) - message(FATAL_ERROR - "Can't build both SWIG (2.x) and hand-coded 3.x Python bindings. Disable either VRPN_BUILD_PYTHON or VRPN_BUILD_PYTHON_HANDCODED_3X.") - endif() - elseif(VRPN_BUILD_PYTHON_HANDCODED_3X - AND - VRPN_BUILD_PYTHON_HANDCODED_2X) - message(FATAL_ERROR - "Can't build handcoded Python bindings for both 2.x and 3.x versions. Pick one, please.") - elseif(VRPN_BUILD_PYTHON_HANDCODED_2X - AND - NOT - VRPN_BUILD_PYTHON_HANDCODED_3X) - set(vrpn_python_versionsearch 2) - elseif(VRPN_BUILD_PYTHON_HANDCODED_3X - AND - NOT - VRPN_BUILD_PYTHON_HANDCODED_2X) - set(vrpn_python_versionsearch 3) - endif() - unset(PYTHON_INCLUDE_DIR CACHE) - unset(PYTHON_INCLUDE_DIR) - unset(PYTHON_LIBRARY CACHE) - unset(PYTHON_LIBRARY) - - set(_VRPN_PYTHON_VERSIONSEARCH - ${vrpn_python_versionsearch} - CACHE - INTERNAL - "" - FORCE) - set(_VRPN_PYTHON_SETTINGS - ${CurrentPythonSettings} - CACHE - INTERNAL - "" - FORCE) -endif() - -# Passing just the major version works with as desired multi-python-capable find module such -# as in latest CMake (2.8.9) -find_package(PythonLibs ${_VRPN_PYTHON_VERSIONSEARCH}) -if(PYTHONLIBS_FOUND) - if(PYTHONLIBS_VERSION_STRING) - string(SUBSTRING - ${PYTHONLIBS_VERSION_STRING} - 0 - 1 - vrpn_python_majorver) - set(PYTHON${vrpn_python_majorver}_FOUND ON) - elseif(PYTHON_LIBRARY MATCHES "python([23])") - set(PYTHON${CMAKE_MATCH_1}_FOUND ON) - elseif(_VRPN_PYTHON_VERSIONSEARCH) - set(PYTHON${_VRPN_PYTHON_VERSIONSEARCH}_FOUND ON) - else() - message(STATUS - "Warning: found python but couldn't determine which version. Please set either VRPN_PYTHON_IS_3 or VRPN_PYTHON_IS_2") - option(VRPN_PYTHON_IS_3 "Python found is version 3.x" OFF) - option(VRPN_PYTHON_IS_2 "Python found is version 2.x" OFF) - if(VRPN_PYTHON_IS_3 AND VRPN_PYTHON_IS_2) - unset(VRPN_PYTHON_IS_2 CACHE) - unset(VRPN_PYTHON_IS_3 CACHE) - message(FATAL_ERROR - "If needed, please set either VRPN_PYTHON_IS_3 or VRPN_PYTHON_IS_2, not both!") - elseif(VRPN_PYTHON_IS_3) - set(PYTHON3_FOUND ON) - elseif(VRPN_PYTHON_IS_2) - set(PYTHON2_FOUND ON) - endif() - endif() -endif() - -# If MSVC, and we don't have a debug lib, default to off, or the default (debug runtime) build is broken. -if(MSVC AND NOT PYTHON_LIBRARY_DEBUG) - set(PYTHON_DEFAULT_OFF OFF_BY_DEFAULT) -else() - set(PYTHON_DEFAULT_OFF ${DEFAULT_OFF_IF_SUBPROJECT}) -endif() -option_requires(VRPN_BUILD_PYTHON - "Build VRPN Python 2.x SWIG-based bindings" - ${PYTHON_DEFAULT_OFF} - SWIG_FOUND - PYTHON2_FOUND) - -option_requires(VRPN_BUILD_PYTHON_HANDCODED_2X - "Build VRPN Python handcoded bindings for Python 2.x" - ${PYTHON_DEFAULT_OFF} - PYTHON2_FOUND) - -option_requires(VRPN_BUILD_PYTHON_HANDCODED_3X - "Build VRPN Python handcoded bindings for Python 3.x" - ${PYTHON_DEFAULT_OFF} - PYTHON3_FOUND) - -### -# javac, jar, and javah (for java wrapper) -### -if(BUILD_WITH_ANDROID_NDK) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) - find_package(Java COMPONENTS Development REQUIRED) - find_package(JNI REQUIRED) -else() - find_package(Java COMPONENTS Development) - find_package(JNI) -endif() -find_program(JAVAH_EXECUTABLE NAMES javah) -mark_as_advanced(JAVAH_EXECUTABLE) -option_requires(VRPN_BUILD_JAVA - "Build VRPN Java bindings" - ${DEFAULT_OFF_IF_SUBPROJECT} - Java_JAVAC_EXECUTABLE - Java_JAR_EXECUTABLE - JNI_FOUND - JAVAH_EXECUTABLE) - -if(BUILD_WITH_ANDROID_NDK) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif() - -### -# MPI -### -find_package(MPI) -# XXX Safe to enable by default if we find it? -option_requires(VRPN_USE_MPI - "Build with MPI support" - OFF_BY_DEFAULT - MPI_FOUND) - -if(VRPN_USE_MPI) - # XXX what else needs to be done here? - add_definitions(${MPI_COMPILE_FLAGS}) - include_directories(${MPI_INCLUDE_PATH}) - list(APPEND EXTRA_LIBS ${MPI_LIBRARIES}) -endif() - -### -# Modbus library -### -find_package(Modbus) -option_requires(VRPN_USE_MODBUS - "Build with Modbus support" - OFF_BY_DEFAULT - MODBUS_FOUND) - -if(VRPN_USE_MODBUS) - # XXX what else needs to be done here? - include_directories(${MODBUS_INCLUDE_DIR}) - list(APPEND EXTRA_LIBS ${MODBUS_LIBRARY}) -endif() - -### -# Libusb1 -### -find_package(Libusb1) -option_requires(VRPN_USE_LIBUSB_1_0 - "Attempt to use LibUSB-1.0 to talk directly to USB devices." - ${DEFAULT_OFF_IF_SUBPROJECT} - LIBUSB1_FOUND) - -if(VRPN_USE_LIBUSB_1_0) - include_directories(${LIBUSB1_INCLUDE_DIRS}) - list(APPEND SERVER_EXTRA_LIBS ${LIBUSB1_LIBRARIES}) -endif() - - -### -# HID and HIDAPI -### - -# Setting up the local HIDAPI was handled above, in the submodules directory -if(NOT VRPN_USE_LOCAL_HIDAPI) - find_package(HIDAPI) -endif() - -# HID requires either local or system-installed HIDAPI -# Both set HIDAPI_FOUND, HIDAPI_LIBRARIES, and HIDAPI_INCLUDE_DIRS -# If the user chose VRPN_USE_LOCAL_HIDAPI, the HIDAPI_SOURCES -# variable, as included in the source list below, will also be set. -option_requires(VRPN_USE_HID - "Build with support for HID devices using HIDAPI" - ${DEFAULT_OFF_IF_SUBPROJECT} - HIDAPI_FOUND) - -if(VRPN_USE_HID) - include_directories(${HIDAPI_INCLUDE_DIRS}) - list(APPEND SERVER_EXTRA_LIBS ${HIDAPI_LIBRARIES}) - option(VRPN_BUILD_HID_GUI - "Should we build a GUI for analyzing live HID streams?" - OFF) - option(VRPN_HID_DEBUGGING - "Should verbose debugging messages be displayed during HID interactions?" - off) - if(VRPN_HID_DEBUGGING) - add_definitions(-DVRPN_HID_DEBUGGING) - endif() -else() - # Clear this variable if they don't want HID after all. - message(STATUS - "NOTE: You have VRPN_USE_LOCAL_HIDAPI enabled, but " - "VRPN_USE_HID disabled: HIDAPI will only be built if you enable HID support for VRPN") - set(HIDAPI_SOURCES) -endif() - -### -# Sensable "OpenHaptics" HDAPI/HLAPI -### -find_package(OpenHaptics) -option_requires(VRPN_USE_HDAPI - "Allow SensAble Phantom support through HDAPI/HLAPI - VRPN_USE_PHANTOM_SERVER must still be set" - ${DEFAULT_OFF_IF_SUBPROJECT} - OPENHAPTICS_FOUND) -if(VRPN_USE_HDAPI) - set(PHANTOM_POSSIBLE ON) -endif() - -### -# Sensable GHOST -### -if(NOT VRPN_USE_HDAPI) - find_package(GHOST) - option_requires(VRPN_USE_GHOST - "Allow SensAble Phantom support through GHOST - VRPN_USE_PHANTOM_SERVER must still be set" - ${DEFAULT_OFF_IF_SUBPROJECT} - GHOST_FOUND) - if(VRPN_USE_GHOST) - if(NOT ${GHOST_LIBRARIES} MATCHES ".*40.*") - message(STATUS "GHOST pre-4.0 detected - calling it 3.1.") - set(VRPN_USE_GHOST_31 ON) - endif() - set(PHANTOM_POSSIBLE ON) - endif() -endif() - -### -# Sensable PHANToM Support - Overall Option -### -option_requires(VRPN_USE_PHANTOM_SERVER - "Build with SensAble Phantom support" - ${DEFAULT_OFF_IF_SUBPROJECT} - PHANTOM_POSSIBLE) - -if(VRPN_USE_PHANTOM_SERVER) - if(VRPN_USE_HDAPI) - include_directories(${OPENHAPTICS_INCLUDE_DIRS}) - list(APPEND SERVER_EXTRA_LIBS ${OPENHAPTICS_LIBRARIES}) - else() - # VRPN_USE_GHOST - include_directories(${GHOST_INCLUDE_DIRS}) - list(APPEND SERVER_EXTRA_LIBS ${GHOST_LIBRARIES}) - endif() -endif() - - -### -# WiiUse -### -find_package(WiiUse) -option_requires(VRPN_USE_WIIUSE - "Build with WiiUse library support (makes servers GPL)" - ${DEFAULT_OFF_IF_SUBPROJECT} - WIIUSE_FOUND) - -if(VRPN_USE_WIIUSE) - include_directories(${WIIUSE_INCLUDE_DIRS}) - list(APPEND SERVER_EXTRA_LIBS ${WIIUSE_LIBRARIES}) -endif() - -### -# JsonCpp -## -## Setting up the local JSONCPP was handled above, in the submodules directory -if(NOT VRPN_USE_LOCAL_JSONCPP) - find_package(JsonCpp) -endif() -option_requires(VRPN_USE_JSONNET - "Build with JSONCPP (for Android widgets and other UDP JSON-based APIs)" - ${DEFAULT_OFF_IF_SUBPROJECT} - JSONCPP_FOUND) - -if(VRPN_USE_JSONNET) - include_directories(${JSONCPP_INCLUDE_DIRS}) - list(APPEND SERVER_EXTRA_LIBS ${JSONCPP_LIBRARIES}) -else() - set(JSONCPP_SOURCES) -endif() - -### -# libnifalcon -### -find_package(LibNifalcon) -option_requires(VRPN_USE_LIBNIFALCON - "Build with libnifalcon support to access Novint Falcon devices" - ${DEFAULT_OFF_IF_SUBPROJECT} - LIBNIFALCON_FOUND) - -if(VRPN_USE_LIBNIFALCON) - include_directories(${LIBNIFALCON_INCLUDE_DIRS}) - list(APPEND SERVER_EXTRA_LIBS ${LIBNIFALCON_LIBRARIES}) -endif() - -### -# DirectInput and XInput -### -if(WIN32) - find_package(DirectX) - option_requires(VRPN_USE_DIRECTINPUT - "Build with Microsoft DirectInput support" - ${DEFAULT_OFF_IF_SUBPROJECT} - DIRECTX_DXGUID_LIBRARY - DIRECTX_DINPUT_LIBRARY - DIRECTX_DINPUT_INCLUDE_DIR - DIRECTX_SDK_SUPPORTS_COMPILER) - if(VRPN_USE_DIRECTINPUT) - include_directories(${DIRECTX_INCLUDE_DIRS}) - list(APPEND - SERVER_EXTRA_LIBS - ${DIRECTX_DXGUID_LIBRARY} - ${DIRECTX_DINPUT_LIBRARY}) - if(MSVC) - # Delay-load DirectInput DLL - # TODO is this always the right name - # TODO how to do this with MinGW? Can we? Do we need to? - list(APPEND SERVER_LINK_FLAGS "/DELAYLOAD:dinput8.dll") - list(APPEND SERVER_EXTRA_LIBS "delayimp.lib") - endif() - endif() - - # XInput - enhanced API for XBOX 360 controllers and more. - find_directx_include(DIRECTX_XINPUT_INCLUDE_DIR - xinput.h) - option_requires(VRPN_USE_WINDOWS_XINPUT - "Build with Microsoft XInput support" - ${DEFAULT_OFF_IF_SUBPROJECT} - DIRECTX_XINPUT_INCLUDE_DIR - DIRECTX_XINPUT_LIBRARY - DIRECTX_SDK_SUPPORTS_COMPILER) #TODO will this be a valid check here? - if(VRPN_USE_WINDOWS_XINPUT) - list(APPEND - SERVER_EXTRA_LIBS - ${DIRECTX_XINPUT_LIBRARY}) - mark_as_advanced(DIRECTX_XINPUT_INCLUDE_DIR) - - # Get name of DLL to delay-load. - include(GetDefineString) - get_define_string(NAME XINPUT_DLL - INCLUDES windows.h xinput.h - DEFINES "-D_WIN32_WINNT=${WIN_MIN_VER}" - INCLUDE_DIRS ${DIRECTX_DINPUT_INCLUDE_DIR} ${DIRECTX_XINPUT_INCLUDE_DIR} - RESULT VRPN_XINPUT_DLL) - if(VRPN_XINPUT_DLL AND MSVC) - # Delay-load XInput DLL - # TODO how to do this with MinGW? Can we? Do we need to? - list(APPEND SERVER_LINK_FLAGS "/DELAYLOAD:${VRPN_XINPUT_DLL}") - list(APPEND SERVER_EXTRA_LIBS "delayimp.lib") - endif() - endif() - - # ATL is used for the vrpn_Tracker_zSight (which is based on DirectInput) - # to provide a smart pointer, but ATL isn't always available. - include(CheckIncludeFileCXX) - check_include_file_cxx(atlbase.h VRPN_HAVE_ATLBASE) -endif() - - -### -# DirectShow -### -# Note that header removal makes this harder for VS10 and later - you need an earlier -# version of MSVC also installed or an older Windows/Platform SDK with qedit.h in it. -if(MSVC) - if(MSVC_VERSION GREATER 1500) - set(DIRECTSHOW_OFF_BY_DEFAULT OFF_BY_DEFAULT) - else() - set(DIRECTSHOW_OFF_BY_DEFAULT) - endif() - find_package(DirectShow) - option_requires(VRPN_USE_DIRECTSHOW - "Build with Microsoft DirectShow support" - ${DIRECTSHOW_OFF_BY_DEFAULT} - DIRECTSHOW_FOUND) - option_requires(VRPN_BUILD_DIRECTSHOW_VIDEO_SERVER - "Enable to build DirectShow Video Server (Windows)" - ${DEFAULT_OFF_IF_SUBPROJECT} - VRPN_BUILD_DIRECTSHOW_VIDEO_SERVER - DIRECTSHOW_FOUND) -endif() - -### -# GPM -### -if(UNIX) - find_package(GPM) - option_requires(VRPN_USE_GPM_MOUSE - "Build with GPM Linux mouse interface support (makes servers GPL)" - ${DEFAULT_OFF_IF_SUBPROJECT} - GPM_FOUND) -endif() - -if(VRPN_USE_GPM_MOUSE) - list(APPEND SERVER_EXTRA_LIBS ${GPM_LIBRARIES}) -endif() - -### -# INTERSENSE -### -find_package(InterSense) -option_requires(VRPN_INCLUDE_INTERSENSE - "Build with InterSense support" - ${DEFAULT_OFF_IF_SUBPROJECT} - INTERSENSE_FOUND) - -if(VRPN_INCLUDE_INTERSENSE) - include_directories(${INTERSENSE_INCLUDE_DIRS}) - list(APPEND SERVER_EXTRA_LIBS ${INTERSENSE_LIBRARIES}) -endif() - -### -# NIDAQMX -### -find_package(NIDAQmx) -option_requires(VRPN_USE_NATIONAL_INSTRUMENTS_MX - "Build with National Instruments NIDAQMX support" - ${DEFAULT_OFF_IF_SUBPROJECT} - NIDAQMX_FOUND) - -if(VRPN_USE_NATIONAL_INSTRUMENTS_MX) - include_directories(${NIDAQMX_INCLUDE_DIRS}) - list(APPEND SERVER_EXTRA_LIBS ${NIDAQMX_LIBRARIES}) -endif() - -### -# Arrington Research ViewPoint EyeTracker -### -find_package(ViewPoint) -option_requires(VRPN_USE_VIEWPOINT - "Build with support for ViewPoint EyeTracker" - ${DEFAULT_OFF_IF_SUBPROJECT} - VIEWPOINT_FOUND) - -if(VRPN_USE_VIEWPOINT) - include_directories(${VIEWPOINT_INCLUDE_DIRS}) - list(APPEND SERVER_EXTRA_LIBS ${VIEWPOINT_LIBRARIES}) - - # Needed for the config file, apparently - it was added to the non-CMake one. - get_filename_component(VRPN_VIEWPOINT_LIB_PATH - "${VIEWPOINT_LIBRARY}" - PATH) - file(TO_CMAKE_PATH - "${VRPN_VIEWPOINT_LIB_PATH}" - VRPN_VIEWPOINT_LIB_PATH) -endif() - -### -# Adrienne timecode boards -### -if(WIN32 OR CYGWIN) - find_package(Adrienne) - option_requires(VRPN_INCLUDE_TIMECODE_SERVER - "Build with support for Adrienne timecode server" - ${DEFAULT_OFF_IF_SUBPROJECT} - ADRIENNE_FOUND) -else() - set(VRPN_INCLUDEE_TIMECODE_SERVER OFF) -endif() - -if(VRPN_INCLUDE_TIMECODE_SERVER) - set(VRPN_ADRIENNE_INCLUDE_FILENAME "${ADRIENNE_INCLUDE_FILENAME}") - set(VRPN_ADRIENNE_INCLUDE_HAS_EXTERN_C - ${ADRIENNE_INCLUDE_HAS_EXTERN_C}) -endif() - -### -# Linux kernel joystick interface -### -if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - check_include_file_cxx(linux/joystick.h HAVE_LINUX_JOYSTICK_H) - option_requires(VRPN_USE_JOYLIN - "Build with support for Linux kernel joystick interface (Uses kernel header - may make servers GPL)" - ${DEFAULT_OFF_IF_SUBPROJECT} - HAVE_LINUX_JOYSTICK_H) -else() - set(VRPN_USE_JOYLIN OFF) -endif() - -### -# /dev/input kernel joystick interface -### -if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - check_include_file_cxx(linux/input.h HAVE_LINUX_INPUT_H) - option_requires(VRPN_USE_DEV_INPUT - "Build with flags to enable the use of DevInput. (Uses kernel header - may make servers GPL)" - ${DEFAULT_OFF_IF_SUBPROJECT} - HAVE_LINUX_INPUT_H) -else() - set(VRPN_USE_DEV_INPUT OFF) -endif() - -### -# Perl, for vrpn_rpc_gen -### -if(NOT WIN32) - # TODO - a bit of a compatibility hack - # MiKTeX 2.9's perl is broken - missing libgcc-s-sjlj-1.dll - - # and can't seem to work around it without popping up dialogs - # which is no fun for automated builds. - find_package(Perl) - find_package(PerlModules COMPONENTS Parse::RecDescent) -endif() - -option_requires(VRPN_BUILD_TEST_RPC_GENERATION - "Build VRPN RPC generation" - ${DEFAULT_OFF_IF_SUBPROJECT} - PERL_FOUND - PERLMODULES_FOUND) - -### -# Polhemus PDI library -### -# TODO Generalize this to use a FindPDI.cmake - someone with access -# to this library must do it. -# Make this also work with debug (use PDID) -option(VRPN_USE_PDI - "Build with flags to enable the use of Polhemus DVI library." - OFF) -if(VRPN_USE_PDI) - include_directories("C:/Program Files (x86)/Polhemus/PDI/PDI_90/Inc") - list(APPEND - SERVER_EXTRA_LIBS - "C:/Program Files (x86)/Polhemus/PDI/PDI_90/Lib/Win32/PDI.lib") -endif() - -### -# PhaseSpace API -### -# TODO Actually do a proper search for the PhaseSpace API headers and libraries -# and not use link_directories. -option(VRPN_INCLUDE_PHASESPACE - "Build with PhaseSpace library support" - OFF) -set(PHASESPACE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/phasespace" CACHE PATH "location of PhaseSpace headers") -set(PHASESPACE_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/phasespace" CACHE PATH "location of PhaseSpace libraries (libowlsock.so, etc") -if(VRPN_INCLUDE_PHASESPACE) - include_directories(${PHASESPACE_INCLUDE_DIR}) - link_directories(${PHASESPACE_LIBRARY_DIR}) - if(WIN32) - list(APPEND SERVER_EXTRA_LIBS libowlsock) - else() - list(APPEND SERVER_EXTRA_LIBS owlsock) - endif() -endif() - -### -# Hillcrest Labs' Freespace -### -find_package(LibFreespace) -option_requires(VRPN_USE_FREESPACE - "Build with Hillcrest Labs' Freespace devices support" - ${DEFAULT_OFF_IF_SUBPROJECT} - LIBFREESPACE_FOUND) - -if(VRPN_USE_FREESPACE) - include_directories(${LIBFREESPACE_INCLUDE_DIRS}) - list(APPEND SERVER_EXTRA_LIBS ${LIBFREESPACE_LIBRARIES}) -endif() - -### -# MotionNode tracker support. Loads shared library dynamically if available -### -option(VRPN_USE_MOTIONNODE - "Build with MotionNode tracker support" - OFF) -if(VRPN_USE_MOTIONNODE) - list(APPEND SERVER_EXTRA_LIBS ${CMAKE_DL_LIBS}) -endif() - -### -# XXX Other libraries needing detection and handling (TODO) -### -# National Instruments Nidaq traditional -# US Digital SEI/A2 -# microscribe3D library -# -# All include paths should be moved out of at least vrpn_Configure.h.cmake_in -# as well as all #pragma comment (lib, "" ) lines, since cmake replaces -# them more flexibly (include_directories and target_link_libraries) - - -# Configuration options controlling what gets included in the build. -# These are the default options for libraries we can't yet detect - -# if a library can be detected above it will be pre-set to an appropriate -# value by default. -option(VRPN_USE_NATIONAL_INSTRUMENTS - "Build with National Instruments (old library) support" - OFF) -option(VRPN_USE_NIDAQ "Build with NIDAQ support ca. 1999" OFF) -option(VRPN_USE_USDIGITAL - "Build with US Digital SEI/A2 library support" - OFF) -option(VRPN_USE_MICROSCRIBE - "Build with MicroScribe3D library support" - OFF) -option(VRPN_USE_TRIVISIOCOLIBRI - "Build with support for TrivisioColibri tracker" - OFF) -if(WIN32) - option(VRPN_USE_WINSOCK2 - "Use Winsock2 library, rather than Winsock." - OFF) - option(VRPN_USE_SHARED_LIBRARY - "Enable to use DLLs on Windows (see vrpn_Configure.h for more info)" - OFF) -endif() - -if(UNIX) - option(VRPN_BUILD_PROFILING_SUPPORT - "Build with flags to enable profiling." - OFF) - if(VRPN_BUILD_PROFILING_SUPPORT) - include(EnableProfiling) - globally_enable_profiling() - endif() - -endif() - -option(VRPN_USE_STATIC_ASSERTIONS "Use some compile-time assertions" ON) -option(VRPN_BUILD_EXTRA_COMPILER_WARNINGS - "Build with flags to enable extra warnings." - OFF) -if(VRPN_BUILD_EXTRA_COMPILER_WARNINGS) - include(EnableExtraCompilerWarnings) - globally_enable_extra_compiler_warnings() - if(NOT MSVC) - # shadowing virtual functions is pretty much unavoidable with the - # multiple inheritance design and methods like "report_changes" - check_cxx_compiler_flag(-Wno-overloaded-virtual SUPPORTS_WNO_OVERLOADED_VIRTUAL_FLAG) - if(SUPPORTS_WNO_OVERLOADED_VIRTUAL_FLAG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-overloaded-virtual") - endif() - endif() -endif() - -set(VRPN_CLIENT_ONLY) -if(VRPN_BUILD_CLIENT_LIBRARY AND NOT VRPN_BUILD_SERVER_LIBRARY) - # We can define VRPN_CLIENT_ONLY in the header in this case! - set(VRPN_CLIENT_ONLY ON) -endif() - -#----------------------------------------------------------------------------- -# configure a header file to pass some of the CMake settings -# to the source code -configure_file("${PROJECT_SOURCE_DIR}/vrpn_Configure.h.cmake_in" - "${PROJECT_BINARY_DIR}/vrpn_Configure.h") -file(RELATIVE_PATH - VRPN_PATH_TO_CMAKE_CONFIG - "${CMAKE_CURRENT_SOURCE_DIR}" - "${PROJECT_BINARY_DIR}/vrpn_Configure.h") -add_definitions("-DVRPN_USING_CMAKE=\"${VRPN_PATH_TO_CMAKE_CONFIG}\"") - -if(SUBPROJECT) - set(BUILD_TESTING FALSE) -endif() - -if(APPLE) - if(NOT CMAKE_OSX_ARCHITECTURES OR CMAKE_OSX_ARCHITECTURES STREQUAL "") - if(_CMAKE_OSX_MACHINE MATCHES "ppc") - set(CMAKE_OSX_ARCHITECTURES - "ppc;ppc64" - CACHE - STRING - "Build architectures for OS X" - FORCE) - else() - set(CMAKE_OSX_ARCHITECTURES - "i386;x86_64" - CACHE - STRING - "Build architectures for OS X" - FORCE) - endif() - endif() - set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ") - set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ") - if(NOT CMAKE_INSTALL_NAME_DIR) - set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib") - endif() - message(STATUS - "Building ${CMAKE_PROJECT_NAME} for ${CMAKE_OSX_ARCHITECTURES}") -endif() - -#----------------------------------------------------------------------------- -# Build the library itself and declare what bits need to be installed - -set(VRPN_CLIENT_SOURCES - vrpn_Analog.C - vrpn_Analog_Output.C - vrpn_Auxiliary_Logger.C - vrpn_BaseClass.C - vrpn_Button.C - vrpn_Connection.C - vrpn_Dial.C - vrpn_FileConnection.C - vrpn_FileController.C - vrpn_ForceDevice.C - vrpn_Forwarder.C - vrpn_ForwarderController.C - vrpn_FunctionGenerator.C - vrpn_Imager.C - vrpn_LamportClock.C - vrpn_Mutex.C - vrpn_Poser.C - vrpn_RedundantTransmission.C - vrpn_Serial.C - vrpn_SerialPort.C - vrpn_Shared.C - vrpn_SharedObject.C - vrpn_Sound.C - vrpn_Text.C - vrpn_Tracker.C) - -set(VRPN_CLIENT_PUBLIC_HEADERS - "${PROJECT_BINARY_DIR}/vrpn_Configure.h" - vrpn_Analog.h - vrpn_Analog_Output.h - vrpn_Auxiliary_Logger.h - vrpn_BaseClass.h - vrpn_Button.h - vrpn_Connection.h - vrpn_ConnectionPtr.h - vrpn_Dial.h - vrpn_FileConnection.h - vrpn_FileController.h - vrpn_ForceDevice.h - vrpn_ForwarderController.h - vrpn_Forwarder.h - vrpn_FunctionGenerator.h - vrpn_Imager.h - vrpn_LamportClock.h - vrpn_Log.h - vrpn_MainloopContainer.h - vrpn_MainloopObject.h - vrpn_Mutex.h - vrpn_RedundantTransmission.h - vrpn_SendTextMessageStreamProxy.h - vrpn_Serial.h - vrpn_SerialPort.h - vrpn_Shared.h - vrpn_SharedObject.h - vrpn_Sound.h - vrpn_Text.h - vrpn_Tracker.h - vrpn_Types.h) - -set(VRPN_SERVER_SOURCES - ${VRPN_CLIENT_SOURCES} - vrpn_3DConnexion.C - vrpn_3DMicroscribe.C - vrpn_3Space.C - vrpn_5DT16.C - vrpn_ADBox.C - vrpn_Analog_5dt.C - vrpn_Analog_5dtUSB.C - vrpn_Analog_Radamec_SPI.C - vrpn_Analog_USDigital_A2.C - vrpn_Atmel.C - vrpn_BiosciencesTools.C - vrpn_Button_NI_DIO24.C - vrpn_Button_USB.cpp - vrpn_CerealBox.C - vrpn_CHProducts_Controller_Raw.C - vrpn_Contour.C - vrpn_DevInput.C - vrpn_DirectXFFJoystick.C - vrpn_DirectXRumblePad.C - vrpn_DreamCheeky.C - vrpn_Dyna.C - vrpn_Event_Analog.C - vrpn_Event.C - vrpn_Event_Mouse.C - vrpn_Flock.C - vrpn_Flock_Parallel.C - vrpn_ForceDeviceServer.C - vrpn_Freespace.C - vrpn_FunctionGenerator.C - vrpn_Futaba.C - vrpn_GlobalHapticsOrb.C - vrpn_Griffin.C - vrpn_HumanInterface.C - vrpn_IDEA.C - vrpn_Imager_Stream_Buffer.C - vrpn_ImmersionBox.C - vrpn_inertiamouse.C - vrpn_JoyFly.C - vrpn_Joylin.C - vrpn_Joywin32.C - vrpn_Keyboard.C - vrpn_LUDL.C - vrpn_Logitech_Controller_Raw.C - vrpn_Magellan.C - vrpn_Microsoft_Controller_Raw.C - vrpn_Mouse.C - vrpn_NationalInstruments.C - vrpn_Nidaq.C - vrpn_nikon_controls.C - vrpn_OmegaTemperature.C - vrpn_Poser_Analog.C - vrpn_Poser_Tek4662.C - vrpn_raw_sgibox.C - vrpn_Retrolink.C - vrpn_Saitek_Controller_Raw.C - vrpn_sgibox.C - vrpn_Spaceball.C - vrpn_Tng3.C - vrpn_Tracker_3DMouse.C - vrpn_Tracker_AnalogFly.C - vrpn_Tracker_ButtonFly.C - vrpn_Tracker_Crossbow.C - vrpn_Tracker_DTrack.C - vrpn_Tracker_Fastrak.C - vrpn_Tracker_Filter.C - vrpn_Tracker_GameTrak.C - vrpn_Tracker_GPS.C - vrpn_Tracker_isense.C - vrpn_Tracker_Isotrak.C - vrpn_Tracker_JsonNet.C - vrpn_Tracker_Liberty.C - vrpn_Tracker_MotionNode.C - vrpn_Tracker_NDI_Polaris.C - vrpn_Tracker_NovintFalcon.C - vrpn_Tracker_OSVRHackerDevKit.C - vrpn_Tracker_PDI.C - vrpn_Tracker_PhaseSpace.C - vrpn_Tracker_RazerHydra.C - vrpn_Tracker_SpacePoint.C - vrpn_Tracker_Wintracker.C - vrpn_Tracker_TrivisioColibri.C - vrpn_Tracker_WiimoteHead.C - vrpn_Tracker_zSight.C - vrpn_Tracker_ViewPoint.C - vrpn_UNC_Joystick.C - vrpn_VPJoystick.C - vrpn_Wanda.C - vrpn_WiiMote.C - vrpn_XInputGamepad.C - vrpn_Xkeys.C - vrpn_Tracker_LibertyHS.C - vrpn_YEI_3Space.C - vrpn_Zaber.C - server_src/vrpn_Generic_server_object.C - ${HIDAPI_SOURCES} - ${JSONCPP_SOURCES} - ${PDI_SOURCES}) - -set(VRPN_SERVER_PUBLIC_HEADERS - ${VRPN_CLIENT_PUBLIC_HEADERS} - vrpn_3DConnexion.h - vrpn_3DMicroscribe.h - vrpn_3Space.h - vrpn_5DT16.h - vrpn_ADBox.h - vrpn_Analog_5dt.h - vrpn_Analog_5dtUSB.h - vrpn_Analog_Radamec_SPI.h - vrpn_Analog_USDigital_A2.h - vrpn_Atmel.h - vrpn_BiosciencesTools.h - vrpn_Button_NI_DIO24.h - vrpn_Button_USB.h - vrpn_CerealBox.h - vrpn_CHProducts_Controller_Raw.h - vrpn_Contour.h - vrpn_DevInput.h - vrpn_DirectXFFJoystick.h - vrpn_DirectXRumblePad.h - vrpn_DreamCheeky.h - vrpn_Dyna.h - vrpn_Event_Analog.h - vrpn_Event.h - vrpn_Event_Mouse.h - vrpn_Flock.h - vrpn_Flock_Parallel.h - vrpn_ForceDeviceServer.h - vrpn_Freespace.h - vrpn_FunctionGenerator.h - vrpn_Futaba.h - vrpn_GlobalHapticsOrb.h - vrpn_Griffin.h - vrpn_HashST.h - vrpn_HumanInterface.h - vrpn_IDEA.h - vrpn_Imager_Stream_Buffer.h - vrpn_ImmersionBox.h - vrpn_inertiamouse.h - vrpn_JoyFly.h - vrpn_Joylin.h - vrpn_Joywin32.h - vrpn_Keyboard.h - vrpn_Logitech_Controller_Raw.h - vrpn_LUDL.h - vrpn_Magellan.h - vrpn_MessageMacros.h - vrpn_Microsoft_Controller_Raw.h - vrpn_Mouse.h - vrpn_NationalInstruments.h - vrpn_Nidaq.h - vrpn_nikon_controls.h - vrpn_OmegaTemperature.h - vrpn_OneEuroFilter.h - vrpn_Poser_Analog.h - vrpn_Poser.h - vrpn_Poser_Tek4662.h - vrpn_raw_sgibox.h - vrpn_Retrolink.h - vrpn_Saitek_Controller_Raw.h - vrpn_sgibox.h - vrpn_Spaceball.h - vrpn_Tng3.h - vrpn_Tracker_3DMouse.h - vrpn_Tracker_AnalogFly.h - vrpn_Tracker_ButtonFly.h - vrpn_Tracker_Crossbow.h - vrpn_Tracker_DTrack.h - vrpn_Tracker_Fastrak.h - vrpn_Tracker_Filter.h - vrpn_Tracker_GameTrak.h - vrpn_Tracker_GPS.h - vrpn_Tracker_isense.h - vrpn_Tracker_Isotrak.h - vrpn_Tracker_JsonNet.h - vrpn_Tracker_Liberty.h - vrpn_Tracker_MotionNode.h - vrpn_Tracker_NDI_Polaris.h - vrpn_Tracker_NovintFalcon.h - vrpn_Tracker_OSVRHackerDevKit.h - vrpn_Tracker_PDI.h - vrpn_Tracker_PhaseSpace.h - vrpn_Tracker_RazerHydra.h - vrpn_Tracker_SpacePoint.h - vrpn_Tracker_Wintracker.h - vrpn_Tracker_TrivisioColibri.h - vrpn_Tracker_WiimoteHead.h - vrpn_Tracker_zSight.h - vrpn_Tracker_ViewPoint.h - vrpn_UNC_Joystick.h - vrpn_VPJoystick.h - vrpn_Wanda.h - vrpn_WiiMote.h - vrpn_XInputGamepad.h - vrpn_Xkeys.h - vrpn_Tracker_LibertyHS.h - vrpn_YEI_3Space.h - vrpn_Zaber.h - server_src/vrpn_Generic_server_object.h) - -set(VRPN_SERVER_LIBRARY) -set(VRPN_CLIENT_LIBRARY) - -if(VRPN_BUILD_SERVER_LIBRARY) - add_library(vrpnserver - ${VRPN_SERVER_SOURCES} - ${VRPN_SERVER_PUBLIC_HEADERS}) - target_link_libraries(vrpnserver ${EXTRA_LIBS} ${SERVER_EXTRA_LIBS}) - set(VRPN_CLIENT_LIBRARY vrpnserver) - set(VRPN_SERVER_LIBRARY vrpnserver) - set_property(TARGET - vrpnserver - PROPERTY - PUBLIC_HEADER - ${VRPN_SERVER_PUBLIC_HEADERS}) - set_property(TARGET - vrpnserver - PROPERTY - PROJECT_LABEL - "Core VRPN Server Library") - set_property(TARGET - vrpnserver - PROPERTY - FOLDER - "Library") - set_property(TARGET - vrpnserver - PROPERTY - LINK_FLAGS - ${SERVER_LINK_FLAGS}) - - if(UNIX) - add_subdirectory(atmellib) - target_link_libraries(vrpnserver vrpn_atmel) - endif() - - add_subdirectory(gpsnmealib) - target_link_libraries(vrpnserver gpsnmea) - if(VRPN_INSTALL) - install(TARGETS - vrpnserver - ARCHIVE - DESTINATION - lib - COMPONENT - serversdk - PUBLIC_HEADER - DESTINATION - include - COMPONENT - serversdk) - endif() - add_cppcheck(vrpnserver STYLE UNUSED_FUNCTIONS) -endif() - - -if(VRPN_BUILD_CLIENT_LIBRARY) - add_library(vrpn ${VRPN_CLIENT_SOURCES} ${VRPN_CLIENT_PUBLIC_HEADERS}) - target_link_libraries(vrpn ${EXTRA_LIBS}) - set(VRPN_CLIENT_LIBRARY vrpn) - - set_property(TARGET - vrpn - PROPERTY - PUBLIC_HEADER - ${VRPN_CLIENT_PUBLIC_HEADERS}) - - if(NOT VRPN_CLIENT_ONLY) - set_property(TARGET - vrpn - PROPERTY - COMPILE_DEFINITIONS - "VRPN_CLIENT_ONLY") - endif() - set_property(TARGET - vrpn - PROPERTY - PROJECT_LABEL - "Core VRPN Client Library") - set_property(TARGET - vrpn - PROPERTY - FOLDER - "Library") - - if(VRPN_INSTALL) - install(TARGETS - vrpn - ARCHIVE - DESTINATION - lib - COMPONENT - clientsdk - PUBLIC_HEADER - DESTINATION - include - COMPONENT - clientsdk) - endif() - add_cppcheck(vrpn STYLE UNUSED_FUNCTIONS) -endif() - -add_subdirectory(client_src) - -#----------------------------------------------------------------------------- -# Set some internal cache variables to make life easier if we're a subproject - -set(VRPN_DEFINITIONS "-DVRPN_USING_CMAKE=\"${CMAKE_CURRENT_BINARY_DIR}/vrpn_Configure.h\"" - CACHE INTERNAL "Definition to add if using as a subproject" FORCE) -set(VRPN_CLIENT_LIBRARY ${VRPN_CLIENT_LIBRARY} CACHE INTERNAL "" FORCE) -set(VRPN_SERVER_LIBRARY ${VRPN_SERVER_LIBRARY} CACHE INTERNAL "" FORCE) -set(VRPN_SERVER_LINK_FLAGS ${SERVER_LINK_FLAGS} CACHE INTERNAL "" FORCE) -set(VRPN_INCLUDE_DIRS - "${CMAKE_CURRENT_BINARY_DIR}" - "${VRPN_SOURCE_DIR}" - "${VRPN_SOURCE_DIR}/atmellib" - "${VRPN_SOURCE_DIR}/quat" - CACHE INTERNAL "" FORCE) - -#----------------------------------------------------------------------------- -# Build the server applications if we've been asked to and we didn't build -# the library client-only. - -if(VRPN_BUILD_SERVERS AND VRPN_BUILD_SERVER_LIBRARY) - add_subdirectory(server_src) -endif() - -#----------------------------------------------------------------------------- -# Build the RPC generation if we've been asked to - -if(VRPN_BUILD_TEST_RPC_GENERATION) - add_subdirectory(util/gen_rpc) -endif() - -if(VRPN_BUILD_CLIENTS) - add_subdirectory(util/printStream) -endif() - -#----------------------------------------------------------------------------- -# Create documentation -if(NOT SUBPROJECT) - add_subdirectory(doxygen) -endif() - -#----------------------------------------------------------------------------- -# Python wrappers -add_subdirectory(python_vrpn) -add_subdirectory(python) - -#----------------------------------------------------------------------------- -# Java wrappers -add_subdirectory(java_vrpn) - -#----------------------------------------------------------------------------- -# HID Gui -if(VRPN_BUILD_HID_GUI) - add_subdirectory(hid_gui) -endif() - -#----------------------------------------------------------------------------- -# Testing applications that live in the main directory. -if(VRPN_BUILD_SERVERS AND VRPN_BUILD_SERVER_LIBRARY AND BUILD_TESTING AND WIN32) - foreach(SOURCE time_test.cpp) - get_filename_component(APP ${SOURCE} NAME_WE) - add_executable(${APP} ${SOURCE}) - target_link_libraries(${APP} vrpnserver) - set_target_properties(${APP} PROPERTIES FOLDER Tests) - if(VRPN_INSTALL) - install(TARGETS ${APP} RUNTIME DESTINATION bin COMPONENT tests) - endif() - endforeach() -endif() - -#----------------------------------------------------------------------------- -# Do a little check for GPL and GPL-incompatible libraries - -# What flags cause us to link against GPL libraries? - -# TODO: Figure out about the kernel headers we use. -# Conflicting stories: -# ML post by Linus: https://lkml.org/lkml/2003/12/5/13 -# Interview of Linus: http://www.itworld.com/open-source/140916/android-sued-microsoft-not-linux - -set(ALL_GPL_SERVER_FLAGS - #VRPN_USE_DEV_INPUT # Kernel header: GPL2 - #VRPN_USE_JOYLIN # Kernel header: GPL2 - VRPN_USE_GPM_MOUSE # GPL2+ - VRPN_USE_WIIUSE # GPL3 -) - -# What flags cause us to link against GPL-incompatible libraries? -set(ALL_GPLINCOMPAT_SERVER_FLAGS - VRPN_INCLUDE_INTERSENSE - VRPN_INCLUDE_TIMECODE_SERVER - VRPN_USE_PHANTOM_SERVER) - -set(GPL_SERVER_FLAGS) -foreach(POSSIBLE_GPL_FLAG ${ALL_GPL_SERVER_FLAGS}) - if(${POSSIBLE_GPL_FLAG}) - list(APPEND GPL_SERVER_FLAGS "${POSSIBLE_GPL_FLAG}") - endif() -endforeach() - -set(GPLINCOMPAT_SERVER_FLAGS) -foreach(POSSIBLE_GPLINCOMPAT_FLAG ${ALL_GPLINCOMPAT_SERVER_FLAGS}) - if(${POSSIBLE_GPLINCOMPAT_FLAG}) - list(APPEND GPLINCOMPAT_SERVER_FLAGS "${POSSIBLE_GPLINCOMPAT_FLAG}") - endif() -endforeach() - - -if(GPL_SERVER_FLAGS) - # Some GPL options are enabled - message(STATUS "") - message(STATUS - "NOTE: The following build options may produce a GPL-licensed server library/binary.") - message(STATUS " ${GPL_SERVER_FLAGS}") - message(STATUS - "NOTE: I am not a lawyer, and this is not legal advice!") - - option(VRPN_GPL_SERVER - "Check this to accept the possibility of linking GPL libraries with the server." - OFF) -endif() - -if(GPLINCOMPAT_SERVER_FLAGS) - # Some GPL-incompatible options are enabled - message(STATUS "") - message(STATUS - "NOTE: The following build options may produce a server library/binary") - message(STATUS - " that is incompatible with the GPL/undistributable if linked with GPL libraries.") - message(STATUS " ${GPLINCOMPAT_SERVER_FLAGS}") - message(STATUS - "NOTE: I am not a lawyer, and this is not legal advice!") -endif() - -# Check for errors. -if(VRPN_BUILD_SERVER_LIBRARY) - if(GPL_SERVER_FLAGS AND NOT VRPN_GPL_SERVER) - message(STATUS "") - message(STATUS "Selected build options produce a GPL server library.") - message(STATUS - "You may disable them, otherwise set VRPN_GPL_SERVER to acknowledge this and build anyway.") - message(FATAL_ERROR - "Need VRPN_GPL_SERVER to build server library with GPL options enabled!") - endif() - - if(GPL_SERVER_FLAGS AND GPLINCOMPAT_SERVER_FLAGS) - message(STATUS "") - message(STATUS "IMPORTANT LICENSING NOTE!") - message(STATUS - "Building with the current settings may produce a legally non-distributable server binary!") - message(STATUS - "NOTE: I am not a lawyer, and this is not legal advice!") - endif() -endif() - -#----------------------------------------------------------------------------- -# Enable testing/dashboards -create_dashboard_scripts("${CMAKE_CURRENT_SOURCE_DIR}/DashboardBuildInitialCache.cmake.in") - -#----------------------------------------------------------------------------- -# If we succeeded, we can go on and include packaging! -if(VRPN_INSTALL) - include(CPack) - cpack_add_component(serversdk - DISPLAY_NAME - "VRPN Server Library and C++ Headers") - cpack_add_component(clientsdk - DISPLAY_NAME - "VRPN Client Library and C++ Headers") - cpack_add_component(tests DISPLAY_NAME "Test applications") - cpack_add_component(clients DISPLAY_NAME "Client applications") - cpack_add_component(servers DISPLAY_NAME "Server applications") - cpack_add_component(mainserver - DISPLAY_NAME - "VRPN main server application") - cpack_add_component(python DISPLAY_NAME "Python bindings") - cpack_add_component(java DISPLAY_NAME "Java bindings") - cpack_add_component(doc DISPLAY_NAME "C++ API Documentation") -endif() diff --git a/src/vrpn/ChangeLog b/src/vrpn/ChangeLog deleted file mode 100644 index bfeebd13372ea62d10a19b1e6debb84d1284bf16..0000000000000000000000000000000000000000 --- a/src/vrpn/ChangeLog +++ /dev/null @@ -1,4377 +0,0 @@ -2010-07-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Types.h : Making the "Need to compile with C++ - error message more verbose. - -2010-07-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Button.C : Change to make this compile under Visual Studio - 6.0 submitted by Andrei State. - * vrpn_Mouse.C : Same. - -2010-07-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_isense.C : Modified to compile with the latest version - of the Intersense library based on comments from Andrew Roth at - York University, Toronto based on info from Rand Kmiec at - Intersense. - * vrpn_Tracker_isense.h : Same. - -2010-06-25 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Connection.C (get_log_names): does not attempt to return - names for NULL input parameters. - * vrpn_FunctionGenerator.h/c: uses vrpn_Callback_List. - -2010-03-16 David Marshburn <marshbur@cs.unc.edu> - * vrpn_FunctionGenerator.C: correctly NULL-terminates decoded - script and description strings. - -2010-03-08 David Marshburn <marshbur@cs.unc.edu> - * vrpn_FunctionGenerator.h (vrpn_FunctionGenerator_function_script::getConstScript): - new, const accessor for the script string. - * vrpn_FunctionGenerator.C (vrpn_FunctionGenerator_Remote::encode_channel): - encodes the correct, desired channel. - -2010-02-18 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.h/C: a few tweaks and additions, - including: the ability for servers to keep up with the number - of channels they're really using, the ability to copy functions, - and some additional, correct const-ing. - -2010-01-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CMakeLists.txt : Added -fPIC option submitted by Sheldon - Andrews from McGill to non-Windows builds. This was - important for his 64-bit Java code. - * vrpn_DreamCheeky.C : Makes it not try to compile except - under Windows, Cygwin, Apple. - * vrpn_DreamCheaky.h : Same. - -2010-01-14 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.h/C: various bug fixes and additions, - mostly involved with sending and receiving channel messages. - -2010-01-05 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.h/C: added error-reporting handlers - for remote objects. also, explicitly defined value for the - enumeration of error codes. - -2009-12-30 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.h/C: added error-reporting capabilities - for servers (intended to be used for script malfunctions). - -2009-12-29 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.h/C: added another constructor to - vrpn_FunctionGenerator_function_script and removed the pure-virtual - specifier from the method generateValues. - -2009-12-27 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_DreamCheeky.h : Added support for the Dream Cheeky USB - roll-up drum kit, which is a HID device. - * vrpn_DreamCheeky.C : Same. - * CMakeLists.txt : Same. - * Makefile : Same. - * vrpn.vcproj : Same. - * vrpndll.vcproj : Same. - -2009-12-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - All changes here are from Ryan Pavlik. I'm just adding them in. - * CMakeLists.txt : Adds vrpn_Configure.h into developer files. - * README.Compiling : Describes building using Cmake. - * vrpn_Configure.h : Added note telling about Cmake build/config. - * vrpn_Configure.h.cmake_in : Same. - * vrpn_HumanInterface.h : Adds default for non-Cmake compilation. - -2009-12-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CmakeLists.txt : Major version number now 7.25. - * vrpn_Connection.C : Same. - -2009-12-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CmakeLists.txt : Improved version from Ryan Pavlik. - -2009-12-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Removed #pragmas calling for linking with the - libraries because it breaks things when running Cmake. All - app builds will need to explicitly link with VRPN now. - * vrpn_Configure.h.cmake_in : Same. - -2009-12-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CMakeLists.txt : Remove un-needed vrpn_TypeDispatcher.[hC] - * vrpn_TypeDispatcher.h : Removed (included in vrpn_Connection.h). - * vrpn_TypeDispatcher.C : Removed (included in vrpn_Connection.C). - -2009-12-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CMakeLists.txt : Improved version from Ryan Pavlik. Refactored to make - them cleaner and updated them to more modern Cmake usage. Also - added CPack descriptions. - * cmake : New directory in support of the above. - * FindDirectShow.cmake : Moved to cmake/ subdirectory. - * FindHDAPI.cmake : Same. - * Findquatlib.cmake : Same. - * vrpn_Atmel.C : Added newline at end of file. - * vrpn_Configure.h : Commented definition of VRPN_USE_PHANTOM_SERVER. - * vrpn_HumanInterface.C : Mac version-agnostic type definition. - * vrpn_Nidaq.C : Turns off inclusion of function when USE_NIDAQ not there. - * vrpn_Nidaq.h : Same. - -2009-11-27 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Replaced MACOSX with __APPLE__ to make things compile - on more Mac platforms. - * Findquatlib.cmake : Knows to look one directory up from the present one - to find quatlib. - * vrpn_Button.C : Patch from Hans Labermont to make it compile under 64-bit - Windows. - -2009-11-24 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.h: added VRPN_CALLBACK to the callback type definitions. - -2009-11-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CMakeLists.txt : Added code to compile the DirectShow video - server and the gen_rpc tests. - * FindDirectShow.cmake : Same. - -2009-11-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_CerealBox.C : Picking lint found by a new compiler (const declarations - and printf format changes). - * vrpn_JoyFly.C : Same. - * vrpn_Magellan.C : Same. - * vrpn_Mutex.C : Same. - * vrpn_RedundantTransmission.C : Same. - * vrpn_Tracker_Crossbow.C : Same. - * vrpn_Tracker_NDI_Polaris.C : Same. - -2009-11-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Button.C : Type conversions to remove compiler warnings. - * vrpn_Connection.C : Same. - -2009-11-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CMakeLists.txt : Removing duplicate entries. - * Findquatlib.cmake : To Unix line endings. - * time_test.cpp : Compiles under Linux. - * vrpn_FunctionGenerator.C : same. - -2009-11-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CMakeLists.txt : File to describe to the Cmake build system how - to compile VRPN. - * FindHDAPI.cmake : Same. - * Findquatlib.cmake : Same. - * vrpn_Configure.h.cmake_in : Same, plus letting user set things to - be compiled in using the Cmake interface. This needs to be - improved -- it overwrites the vrpn_Configure.h file now. - * time_test.cpp : Include adjustments to make it compile on Windows. - * vrpn_Atmel.C : Make it compile on Windows. - * vrpn_Shared.C : Disabled spurious compiler warning on Windows. - -2009-11-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_HumanInterface.C : Patch from Bruno Raffin from imag.fr that - makes it compile cleanly on macosx. - -2009-10-30 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Making this compile under Linux using new 0.4 version of - libfreespace; patch from Phil Black. - * vrpn_Freespace.C : Same. - * vrpn_Freespace.h : Same. - -2009-10-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Changed to always link with the release version - of the libfreespace, even in debug mode, to avoid manifes problems. - * vrpndll.vcproj : Making vrpn_Freespace.C compile as C++ code in debug - mode. - -2009-10-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Put in patch from Ian Curington to work - with devices that have more than 8 buttons. - -2009-10-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Freespace.h : Added code from Phil Black at Hillcrest Labs to - run their Freespace devices in VRPN. - * vrpn_Freespace.C : Same. - * vrpn_Configure.h : Same. - * vrpn.vcproj : Same. - * vrpndll.vcproj : Same. - * vrpn.sln : Same. - * Makefile : Putting the files into the server library. Still - won't compile on anything but Windows. - -2009-10-16 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.C (register_types): corrected a typo - in the message IDs - -2009-09-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Turned "-g" flag into "$(DEBUG_FLAGS)" throughout. - * vrpn_3DConnexion.C : Patch from Hans Lambermont to make the - 3DConnexion and HID drivers work on MacOSX. - * vrpn_3DConnexion.h : Same. - * vrpn_HumanInterface.C : Same. - * vrpn_HumanInterface.h : Same. - * vrpn_Shared.C : Same. - -2009-09-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_DTrack.C : Changes by Kurt Achatz to enable enhanced - timing support and new device support. - * vrpn_Tracker_DTrack.h : Same. - -2009-09-02 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.h, .C: removed all the specific functions - (sine, degauss, ramp, etc.). now, there's just a "script" function, - which is interpreted by the server to generate values. removed - various support facilities for the specific functions. - * added destructor for vrpn_FunctionGenerator_function_script - -2009-08-31 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Mouse.C : Added fix by Chris VanderKnyff to the mouse code on - Windows to make it work when there are multiple screens. - -2009-08-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Imager.C : Fixed a bug in region decoding when a region less - than the whole image was loaded and the repeat count on the - pixel output was more than 1. - -2009-07-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_Isotrak.h : Adds an Isotrak tracker driver - submitted by Burno Herbelin from the Sensorama Laboratory - at AAlborg University. - * vrpn_Tracker_Isotrak.C : Same. - * vrpn.dsp : Same. - * vrpndll.dsp : Same. - * vrpn.vcproj : Same. - * vrpndll.vcproj : Same. - * Makefile : Same. - -2009-07-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.sln : Added a run_auxiliary_logger test program that - lets you connect and ask for a log file for some - duration. - * vrpn.dsw : Same. - -2009-06-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - Version 07.21 released. - - * vrpn_Connection.C : Changed version number higher so that compiles - will be above current release number. - -2009-06-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_BaseClass.h : Added deep-copy operator to the callback list - class, so that it would work properly with the tracker code. - * vrpn_Tracker.h : Added deep-copy operator to the callback list - class, so that it would work with the copy-then-delete - approach to allocating more handlers in the tracker code. - -2009-06-18 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Added fix by Joseph Newman to let this compile - under Mac OSX. - -2009-06-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.C : Removed a spurious #endif that was left - behind from my previous commit. - -2009-06-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.C : Added fix to semaphore code on the mac sent in - by Simon Julier. - * vrpn.sln : Converted back to correct line endings so it can be - opened by Visual Studio. - -2009-05-18 David Marshburn <marshbur@cs.unc.edu> - - * vrpn.sln: made the vrpn project depend on quatlib, so quatlib - will always be rebuilt when needed. - * vrpn_ForceDevice.h: removed an unnecessary include of quat.h - -2009-05-15 Ryan Schubert <res@cs.unc.edu> - - * vrpn_Imager.C : Fixed 16->8 bit transcoding. - -2009-04-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Patch from Hans Lambermont to make the - Linux version read all of the messages in the buffer from - the device. Also fixed both Windows and Linux versions - to both send all messages found in a buffer, rather than - just the last set. (Not yet tested this second set of - fixes). - -2009-03-02 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Tracker.C (ensure_enough_unit2sensors): initializes - the new elements of the new arrays rather than the non-existant - elements of the old arrays. - -2009-02-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Add in vrpn_WiiMote files to server library. - * vrpn_WiiMote.C : Define min() before use. - -2009-02-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Increasing version number after release. - -2009-02-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - Version 07.20 release. - - * vrpn_Connection.C : Moved the connection manager class to the .h file - so that FileConnection can access it in its constructor and - destructor. - * vrpn_Connection.h : Same. - * vrpn_FileConnection.C : Adds itself to the list of open connections in - constructor and removes itself in destructor, so that multiple - devices opening the same file share the same connection. - * vrpn_FileConnection.h : Changed parameter name to make it more clear - what it does. - * vrpn_Tracker.C : Removed spurious ":" that had worked its way into one - of the tracker report strings (for acceleration). - -2009-01-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker.C : Removed the upper limit on the number of - sensors per tracker. The client now dynamically updates - the list to provide sufficient entries until it runs out - of memory. - * vrpn_Tracker.h : Same. - -2009-01-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_WiiMote.C : Fixed a bug that caused the buttons on the - Classic controller and Guitar Hero controller to be ignored - by the driver. - -2009-01-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Making this work with Cygwin. - * vrpn_3DConnexion.h : Same. - * vrpn_HumanInterface.C : Same. - * vrpn_HumanInterface.h : Same. - -2009-01-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Fixed #defines so that it compiles under Cygwin. - * vrpn.vcproj : Removed entry for isense.h (not always present) - * vrpndll.vcproj : Same. - -2009-01-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_ForceDevice.h : Bug fix sent in by Bruno Raffin, where - <quat.h> should have been used but "../quat/qua.h" was. - -2008-12-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Added a comment about where to find a different - library for dxerr8.lib, which has vanished in newer versions of - the SDK from Microsoft. - -2008-12-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Raised version number after releasing version - 7.19. - -2008-12-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Making it also compile under Windows. - -2008-12-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Patch from Hans Lambermont from Virtual Proteins - to light up the 3DConnexion when the server runs. - * vrpn_3DConnexion.h : Same. - -2008-12-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_Fastrak.C : Added fix sent in by Roger Hoang to - keep things working with both Fastrak and IS900s with buttons. - -2008-12-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_WiiMote.C : Driver for the WiiMote device using the WiiUse - library. Tested under Windows; also supposed to work under - Linux. Handles accelerometers, buttons, and raw IR values. - Should handle nunchuck, classic remote, and guitar hero 3 - attachments (not tested). - * vrpn_WiiMote.h : Same. - * vrpn.vcproj : Same. - * vrpn_Configure.h : Same. - * vrpndll.vcproj : Same. - * vrpn.sln : Added rumble test program. - -2008-12-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_XInputGamepad.C : Chris VanderKnyff's implementation of the Xbox 360 - game controller. - * vrpn_XInputGamepad.h : Same. - * vrpn.vcproj : Same. - * vrpndll.vcproj : Same. - -2008-10-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Adds some more checks and deletion to make - things a bit more stable when connections try to overwrite - existing log files. - -2008-10-01 Ian Curington <ianc@acm.org> - * vrpn_3DConnexion.C/h: - Added 3DConnexion Spaceball 5000 device support - -2008-09-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Patch from Ian Curington to get around a - GCC 2.3 bug in converting shorts to doubles. - -2008-09-05 Ryan Schubert <res@cs.unc.edu> - - * vrpn_Imager.C : Looked like 16->8 transcoding was never - committed. - -2008-08-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Changed out a horrible hack where a - structure was being packed using memcpy (and a structure - with a pointer in it at that) into one where it is - explicitly marshalled and unmarshalled to the log files. - This fixes a bug where log files generates on 64-bit - machines were unreadiable on 32-bit machines and vice-versa. - * vrpn_FileConnection.C : Same. - -2008-07-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Imager.c : Modified the unsigned 16 decode routine - to fix a bug where it was crashing when trying to read - from the wrong part of memory. - -2008-07-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_AnalogFly.C : Fixed the order of rotations - when using the clutch on orientation. - -2008-07-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Updating version after release of 7.16. - -2008-07-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Removed debug printout. - -2008-07-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.sln : Added dependencies in quatlib to servers. - * vrpn_Connection.C : Fixed a bug in the determination of - the machine name where it was being truncated for the - case of tcp:// names. - -2008-07-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_AnalogFly.C : Removed a redundant copy from a - redundant temporary variable. - -2008-06-19 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Poser.h, .C: added the capability for remote objects - to make relative pose & velocity requests and for servers to - receive these requests. - -2008-06-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Adding python_vrpn port from Thiebaut Mochel at the - University of Strasborg. - -2008-05-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_AnalogFly.h : Setting clutch name to NULL in the - constructor; it was not set before, causing a crash later. - -2008-05-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_PhaseSpace.C : Added updates from Lawrence K. - at PhaseSpace. - * vrpn_Tracker_PhaseSpace.h : Same. - -2008-04-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Changing comments on when to define the - various NATIONAL_INSTRUMENTS flavors. - * vrpn.vcproj : Pointing at the new location for NI MX header - files. - * vrpndll.vrproj : Same. - -2008-04-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Imager.C : Fixed a signed vs unsigned copy of characters in the - non-unity-stride 8-bit copy function. - -2008-04-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.h : Added patch from Mike Weiblen to - add SpaceExplorer. - * vrpn_3DConnexion.C : Same. - -2008-03-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.vcproj : Added Polaris tracker to VS 2005 project. - * vrpndll.vcproj : Same. - * vrpndll.dsp : Same. - -2008-03-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Adding vrpn_Tracker_NDI_Polaris driver submitted - by Sharif Razzaque from InnerOptic. - * Makefile : Same. - * vrpn_Tracker_NDI_Polaris.C : Same. - * vrpn_Tracker_NDI_Polaris.h : Same. - -2008-03-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_JoyWin32.C : Added another error check submitted by - M. Casas Sanchez at Space Application Services in - Belgium. - -2008-03-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.h : Making it so that specifying a blank - NIC name results in opening the default NIC. - * vrpn_Connection.C : Same. - -2008-03-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.h : Added another optional parameter to the - helper version of vrpn_create_server_connection() so - that it matches the constructor arguments from the old - vrpn_Connection() server constructor to make it easier to - port existing servers. - -2008-03-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Turned off DIRECTSHOW in the default - configuration. - -2008-03-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - WARNING: The changes made in this commit require any code that - created a vrpn_Connection (server connection) using its - constructor to be changed to use the new function - vrpn_create_server_connection() instead. This is required - because a base-class constructor cannot create and return - an object of a derived class. - - * vrpn_Connection.h : Pulling the IP-specific portions of the - vrpn_Connection object into a separate class so that we - can add an MPI implementation. - - Added another parameter to vrpn_get_connection_by_name - to force it to open a new connection even if there was - already one there. - - Should no longer create a vrpn_Connection directly; either - create a specific subclass (vrpn_Connection_IP) or else - use the vrpn_create_server_connection() function to make - one of arbitrary type. - - Made vrpn_Connection_Generic the base type. - * vrpn_Connection.C : Same. - * vrpn_Mutex.C : Makes an IP-based connection to listen on. - * vrpn_ForwarderController.C : Makes an IP-based connection to - forward on. - * vrpn_FileConnection.C : Modified to use the new base class. - * vrpn_Imager_Stream_Buffer.C : Calls vrpn_get_connection_by_name - rather than calling base-class constructor. - * vrpn_Auxilliary_Logger.C : Same. - -2008-03-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Fixed a bug reported by Patric Schmitz - where multiple-report packets from the device were not - being treated correctly. - -2008-02-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Added a configuration entry to enable VRPN - to link with a Message-Passing Interface (MPI) library and - communicate over it between a group of processes. This is - a fast and low-latency communications mechanism available - on clusters. So far, only the definition is in there; the - implementation will be committed in steps as the TCP and UDP - parts are teased out of the general Connection object. - * vrpn_Connection.h : Teasing the IP-specific (TCP, UDP) portions - of the vrpn_Endpoint out into a separate base class. The - basic Connection object has been modified to use the IP - version in all cases (it is effectively an IP connection). - Next up will be teasing the non-IP-specific parts of the - Connection out. - * vrpn_Connection.C : Same. - -2008-02-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Modified to make the tcp: connection - method reconnect after a connection drops (and retry - if the initial connection is not made). Also cleaned - up some names. - * vrpn_Connection.h : Same. - -2007-12-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Changing version number to 7.15 for - release. - -2007-12-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.C : Making this compile on the mac by removing - a spurious extra if statement left over from a bad - patch attempt. Removing a second deletion of an - already-destroyed semaphore. - - * Makefile : Switching mac compiler from gcc to g++. - -2007-12-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Finally tracked down and squashed - that horrible bug where the UDP packets would not - go on the same interface as the TCP packets sometimes - on hosts with multiple interfaces. Did it by using - the same connection for UDP that was established for - TCP unless there was an explicit override in the - constructor. - -2007-12-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_Liberty.C : Patch from Michael Adrian that - makes this work with more versions of the tracker. - -2007-12-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DCOnnexion.C : Patch from Patrick Hartling - to make this compile on the Mac. - * vrpn_Shared.C : Patch from Patrick Hartling to - make this work with the most recent Apple compiler. - -2007-12-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Making it include the vrpn_Tracker_MotionNode. - -2007-12-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Added entry for MotionNode Tracker. - This compiles under Visual Studio 2005 (not 6.0). - * vrpn.dsp : Same. - * vrpn.vcproj : Same. - * vrpn_Tracker_MotionNode.C : Vendor-supplied server code. - * vrpn_Tracker_MotionNode.h : Same. - * vrpndll.dsp : Same. - * vrpndll.vcproj : Same. - -2007-11-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Removed the paths for DirectX and - replaced them with instructions for how to put the - include and lib directories into the Visual Studio - options. - * vrpn_Shared.C : Whitespace cleanup - * vrpn.sln : Adding required dependency. - -2007-11-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_Liberty.C : Added patch from Eric Griffith - to include control of a stylus. - * vrpn_Tracker_Liberty.h : Same. - -2007-11-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Included definitions needed to compile with - the InterSense library. - -2007-11-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Picking some lint. - -2007-11-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Made this compile under Linux. - Had to add in a structure definition that was not - in the system header files. - * vrpn_3DConnexion.h : Same. - -2007-11-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Added code to run with the event - interface on non-Windows platforms. This was sent - in by Jan Ciger. - * vrpn_3Dconnexion.h : Same. - * vrpn_Configure.h : Removed vrpn_USE_HID; this turned - into checks for _WIN32 all over the place. - * vrpn_HumanInterface.C : Pulling out the non-Windows- - specific parts so that all of the acceptor code - can be used. - * vrpn_HumanInterface.h : Same. - * vrpn_Xkeys.C : Switched to checking for _WIN32 rather than - vrpn_USE_HID - * vrpn_Xkeys.h : Same. - -2007-11-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Joywin32.C : Allows more than two joysticks - to be opened. - -2007-11-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Flock.C : Uses 36" rather than 144" as the - range when not using the extended-range - transmitter. Fix submitted by Jo Skjermo. - -2007-11-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Renamed Auxilliary to Auxiliary. - Moved Keyboard_Mouse to Keyboard. - * vrpn_Mouse.C : Added required include file. - -2007-11-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Button.C : Moved the serial-mouse button code - into the vrpn_Mouse.C file to have all of the - mice in one place. - * vrpn_Button.h : Same. Made the MAX_BUTTONS and BUF_SIZE - values 256, rather than 100, to support the keyboard - class. - * vrpn_Mouse.C : Added Windows interface to the class. - Changed Windows interface to report mouse position - in fraction of screen rather than pixels, so - that the Windows and Linux implementations match. - Moved the serial mouse-button class into this file - so all of the mice are here. - * vrpn_Mouse.h : Same. - * vrpn_Keyboard.C : Pared-down version of vrpn_KeyMouse - that only implements the keyboard portion. - * vrpn_Keyboard.h : Same. - * vrpn_KeyMouse.C : Removed. - * vrpn_KeyMouse.h : Removed. - * vrpn_AnalogFly.C : Added a clutch button that causes - the differential tracker to only move when the - button is pressed and causes an absolute tracker - to behave like a mouse, also only moving when the - button is down. - * vrpn.dsp : Removed vrpn_KeyMouse. Added vrpn_Keyboard. - * vrpndll.dsp : Same. - * vrpn.vcproj : Same. - * vrpndll.vcproj : Same. - -2007-11-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Toook out NationalInstruments. - Reverted to old version of Microsoft DirectX - SDK (let the tug-of-war begin). - * vrpn.dsp : Changed name of Auxilliary to Auxiliary. - * vrpndll.dsp : Same. - -2007-11-12 David Marshburn <marshbur@cs.unc.edu> - - * corrected the spelling of Auxilliary to Auxiliary - -2007-10-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Making an fprintf() with the - machine IP address work under Linux. - -2007-10-11 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Imager_Stream_Buffer.h/C: implemented - handle_request_logging_status - (vrpn_Imager_Stream_Shared_State): this now keeps around - the log-file-name results. added appropriate memory management - for that. added lots of NULL tests. added an accessor for - log file names, get log file names, which doesn't depend on - whether the file names are unqueried. added comments. - -2007-10-02 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Log.h (vrpn_Log::getName): new, returns the - log file name. - * vrpn_Connection.h (vrpn_Connection::get_log_names): - returns the names of the local/remote in/out log files. - * vrpn_Connection.C: - implementation of vrpn_Connection::get_log_names - and vrpn_Log::getName. - * vrpn_Auxilliary_Logger.h/C: added code for a - "request logging status" message, including an example - in the generic server. - - -2007-09-18 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpndll.vcproj : Added preprocessor definitions that - make VRPN build the files needed to link in the - DLL state. - * vrpn.sln : Making it come much closer to being able to - build DLL. - * vrpn_Connection.h : Removed redundant check for #ifdef. - -2007-09-18 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Added SpaceMouse code from - Lode Vanacken. - * vrpn_3DConnexion.h : Same. - -2007-09-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Imager_Stream_Buffer.C : const casts so that we - can delete buffers without the VC 6.0 compiler - complaining. - -2007-09-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Added the name of the endpoint to - the data structure so we get a reasonable error - message when connections fail. - * vrpn_Connection.h : Whitespace change. - * vrpn_Imager_Stream_Buffer.C : Initialized a variable so - we don't get a race condition when making logging - connections. - -2007-09-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Imager.C : Does transcoding for the simple case - of an 8-bit input image going to a 16-bit output - image by shifting left 8 bits. - -2007-08-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_GlobalHapticsOrb.C : Removing things that were not - needed. Replacing member variables that start with - underscore with those that start with d_. Code - cleaning that should leave the behavior unchanged. - * vrpn_GlobalHapticsOrb.h : Same. - * vrpn_VPJoystick.C : Same. - * vrpn_VPJoystick.h : Same. - * vrpn_Zaber.C : Same. - * vrpn_Zaber.h : Same. - -2007-08-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Imager_Stream_Buffer.C : Deletes the buffer for - each message that has been passed to the initial - thread from the real-time thread. Not doing this - caused a massive memory leak. The comments said - to do it but the code didn't. - -2007-08-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Imager.h : Added friend reference to the imager - stream buffer to enable passing values from one - thread to the other. - * vrpn_Imager_Stream_Buffer.C : Now passes the channel - descriptions from the real-time logging thread up - to the client-management thread so that it can send - correct descriptions when multiple clients connect. - * vrpn_Imager_Stream_Buffer.h : Same. - -2007-08-25 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Changed version number to 7.13 - for new release. - -2007-08-25 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog_Output.C : Moved some methods from public - to protected. Added a new derived class for the server - that calls user-level callbacks when things change. - This was needed for MegaWatt Solar's tracker drive. - * vrpn_Analog_Output.h : Same. - * vrpn_Connection.C : Comment change. - * vrpn_Analog.h : Removed blank line. - -2007-08-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Changed version number to 7.12 - (for some reason it was 7.10, even though version - 7.11 has been out for a while). - -2007-08-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Patch from Patrick Hartling for compilation - under 64-bit Windows. - * vrpn_Tracker_DTrack.h : Same. - * vrpn_Tracker_DTrack.C : Same. - * vrpn_HumanInterface.h : Added carriage return to last line. - * vrpn_XKeys.h : Same. - * vrpn_3DConnexion.h : Same. - -2007-08-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.h : Adding more clarifying comments. - * vrpn_Imager.C : Removed line that set throttle drop count - to zero when it should not have. - * vrpn_Imager_Stream_Buffer.C : Completed the implementation - and debugging. - * vrpn_Imager_Stream_Buffer.h : Same. - -2007-08-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DConnexion.C : Thanks to Chris V's new HID class, I - was able to write a driver for the Space Traveler and - Space Navigator from 3DConnexion. These are a $55 and - $200 replacement for the Magellans. - * vrpn_3DConnexion.h : Same. - * vrpn.dsp : Same. - * vrpn.vcproj : Same. - * vrpndll.dsp : Same. - * vrpndll.vcproj : Same. - * vrpn.dsw : Added new project from Chris VanderKnyff that - prints out the values from a HID device, enabling you - to figure out how to write a driver for it. That's what - I used to figure out the bytes from the 3DConnexions. - -2007-08-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Added option to enable compilation - of the HID devices (including the Xkeys devices). - This will only work on Windows for now. - * vrpn_HumanInterface.C : Chris VanderKnyff's implementation - of a generic HID device interface for Windows. - * vrpn_HumanInterface.h : Same. - * vrpn_Xkeys.C : Chris VanderKnyff's implementation of a - driver for four of the X-Keys devices from P.I. - Engineering - * vrpn_Xkeys.h : Same. - * vrpn.dsp : Adding HID and XKeys to project. - * vrpn.vcproj : Same. - * vrpndll.dsp : Same. - * vrpndll.vcproj : Same. - -2007-08-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Added vrpn_Imager_Stream_Buffer. - * vrpndll.dsp : Same. - -2007-08-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Imager_Stream_Buffer.h : Class that provides - full-rate logging of a vrpn_Imager stream while - forwarding a subset of the stream to a client. - This is for the UNC NSRG research group to enable - scientists to log microscope video data at full - camera rates of 120 frames/second while previewing - live during the experiment. The implementation is - not yet complete, but this version has all of the - logging and logfile-switching code working with - multiple threads so I wanted to check it in before - doing the next step. - * vrpn_Imager_Stream_Buffer.C : Same. - * Makefile : Adding vrpn_Imager_Stream_Buffer class. - * vrpn.vcproj : Same. - * vrpndll.vcproj : Same. - * vrpn_Imager.h : Comment improvements. - * vrpn_Shared.h : Comment fixes. - -2007-07-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_DirectXRumblePad.C : Changes by Chris VanderKnyff to - make this work correctly on Visual Studio .NET and 6. - * vrpn_DirectXRumblePad.h : Same. - -2007-07-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.sln : Organizing the various projects into folders - within the solution to make it easier to figure out - what is what. - -2007-07-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding the vrpn_Auxilliary_Logger under - Linux. - -2007-07-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Auxilliary_Logger.h : New class that lets a client - request an additional log file to be started on a - local or remote server. Intended for logging on - scientific instruments in the UNC NSRG group but - there is a generic server for use elsewhere. - * vrpn_Auxilliary_Logger.C : Same. - * vrpn.dsp : Added to project. - * vrpndll.dsp : Same. - * vrpn.vcproj : Same. - * vrpndll.vcproj : Same. - * vrpn.dsw : Added build project for test program. - * vrpn.sln : Same. - * vrpn_Analog_Output.h : White space change. - * vrpn_Connection.C : Modified the pack_log_description() - function to remove the fixed-buffer-length hack that - had been in there. It now allocates a buffer that is - large enough and frees it when it is done. - Modified code to handle empty-string ("") names for - log files meaning "no log file" in addition to - NULL pointers. - Comment changes. Fixing error - messages to work properly with perror(). - -2007-07-18 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Comment and white-space changes. - Converting from C-style casts to static_cast<> - in several locations. - -2007-07-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.C : This version compiles and runs under - Linux again (removed an &). - -2007-07-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : More fixes to get the atmellib compiling - correctly. - * vrpn_Share.h : Changes to make this work on the Mac, which - uses a different Posix open/close call than Linux. Also - changed to using a semaphore pointer rather than a - semaphore under Posix, which requried new and delete. - Works under mac and Windows. Needs to be tested - under Linux. - * vrpn_Shared.C : Same. - -2007-07-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.h : Added VRPN_API where needed for the - Thread code to compile under DLL linkage. - -2007-07-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Fixing problems put in when I added the atmellib - stuff; it was not making the client library as client- - only code any more. - * vrpn_Shared.C : Bug fixes in the Semaphore and Thread code. - Made the interface to them a bit cleaner (fewer - pointers). Added test routine that make sure the - Semaphore and Thread code is working. - * vrpn_Shared.h : Same. - -2007-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.C : Fixed the thread code to be Posix-compliant, - and not specify pthread_t as unsigned long; this makes - it work on mac as well as Linux. - * vrpn_Shared.h : Same. - -2007-07-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_DirectXRumblePad.C : This code is broken (Chris - V. verified this). The constructor now reports that - it is broken. Once we get a bug fix, we can let the - constructor construct one again. - -2007-07-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_DTrack.C : Changed type of a struct so that it - has vrpn_ prepended to the name (don't want anything in - the library that can be seen globally to have a name that - doesn't start with vrpn_ to avoid name-collisions. - * vrpn_Tracker_DTrack.h : Same. - -2007-07-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_DTrack.C : Patch from Kurt Achatz to build for new - version of A.R.T. DTrack, which supports the new Flystick2 - input device. The patch was necessary to support the new - (additional) DTrack output format called '6df2'; the driver - still understands the former output format '6df', so that - it can work with any existing DTrack installation too. - Note that there was a change how buttons of a 'Flystick' - device are sorted; this was done to fit DTrack's standards - described in A.R.T. documentation. For backward - compatibility the driver uses the old sorting when using - the old output format '6df'. - * vrpn_Tracker_DTrack.h : Same. - -2007-07-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_inertiamouse.h : Removing iostream and std::vector class - from the code. It turns out that the standard template - libraries don't work across all platforms VRPN is built - upon, which keeps folks from using (linking to) it if it - has these references. Totally horrible, but true; someone - had trouble linking as soon as this was added. - * vrpn_inertiamouse.C : Same. - -2007-07-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : White space, comment, and error message - editing. - * vrpn_Log.h : Same. - -2007-07-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Fixed bug in the recent patch. - Updated version number. - -2007-07-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Applied patch from Mike Weiblen that - doesn't restrict the number of file descriptors to - 32, but rather uses as many as are needed based - on the actual file descriptor being used. - * vrpn_Joylin.C : Same. - * vrpn_Mouse.C : Fix from Mike Weiblen to code cleanup that - I did that broke the Mouse class. - -2007-06-30 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Atmel.C : Making it also compile on Mac Universal. - * vrpn_Event.C : Same. - -2007-06-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.C : Extra includes to work on non-Windows - machines. - -2007-06-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_DirectXFFJoystick.C : Comment fixed. - * vrpn_Shared.h : Added vrpn_Semaphore and vrpn_Thread classes - based on Hans Weber's classes. These are to support an - upcoming vrpn_Imager_Logger class that will enable full- - bandwidth logging while subsetting the images to a - client across the network. - * vrpn_Shared.C : Same. - -2007-06-25 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Updated version number. - * Makefile : Adding a number of devices from Bauhaus University Weimar - submitted by Jan Springer, including some helper classes - used by their code. - * vrpn_Atmel.C : Same. - * vrpn_Atmel.h : Same. - * vrpn_Event.C : Same. - * vrpn_Event.h : Same. - * vrpn_Event_Analog.C : Same. - * vrpn_Event_Analog.h : Same. - * vrpn_Event_Mouse.C : Same. - * vrpn_Event_Mouse.h : Same. - * vrpn_Joylin.C : Adding typecasts to time reads. - * vrpn_atmellib.h : Same. - * vrpn_atmellib_errno.h : Same. - * vrpn_atmellib_helper.h : Same. - * vrpn_atmellib_helper.C : Same. - * vrpn_atmellib_iobasic.C : Same. - * vrpn_atmellib_openclose.C : Same. - * vrpn_atmellib_register.C : Same. - * vrpn_atmellib_tester.C : Same. - * vrpn_interiamouse.C : Same. - * vrpn_interiamouse.h : Same. - -2007-06-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Serial.C : Attempting to fix some problems with RTS/CTS that - came in when we switched to termios serial control in version - 7 of VRPN. There was a bug introduced in the Windows clear - call that has been fixed. Trying out a new way to control - the RTS/CTS that should work across Linux and Mac platform; - hope it works! - -2007-06-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Changed to version 7.07. - -2007-06-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Adding vrpn_DirectXRumblePad driver submitted by - Chris VanderKnyff and Jeff Feasel. - * vrpndll.dsp : Same. - * vrpn.vjproj : Same. - * vrpndll.vjproj : Same. - * vrpn_DirectXRumblePad.C : Same. - * vrpn_DirectXRumblePad.h : Same. - * vrpn_BaseClass.C : Added a public "shutup" boolean member that - makes an object not print that it cannot connect to its - server counterpart when set to "true". This functionality - is deprecated from the start; we need to figure out a good - functional interface for this. Leaving it in so as not to - break EVE code while a new version is implemented. - * vrpn_BaseClass.h : Same. - * vrpn_Flock.C : Added the ability to set the hemisphere for the - Flock (code from Jeff Feasel). - * vrpn_Flock.h : Same. - -2007-06-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.vcproj : Making all of the .C files compile with the C++ - compiler. - * vrpndll.vcproj: Adding the Poser_Tek4662 file. - -2007-06-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Removed dependencies on vrpn.lib and vrpndll.lib, - because they are handled indirectly and through lines in - vrpn_Configure.h. - * vrpn.dsw : Same. - * vrpndll.dsp : Added Poser_Tek4662 source files to the project. - * vrpn_Mouse.h : Added VRPN_API to class definition (needed for - DLL linkage). - * vrpn_Mouse.C : Comment clean-up. - * vrpn_Tracker_3DMouse.h : Added VRPN_API to class definition - (needed for DLL Linkage). - * vrpn_Configure.h : Whitespace changes. - -2007-06-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding patch submitted by Patrick Hartling from - Infiscape.com for making this compile on MacOSX - to create universal binaries. - -2007-06-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Fixing the path to the PhaseSpace libraries. - -2007-06-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Adding PhaseSpace driver submitted by - Lawrence Kwan. - * vrpndll.dsp : Same. - * vrpndll.vcproj : Same. - * vrpn_Configure.h : Fixing the path to the include files. - -2007-06-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Compiles with PhaseSpace driver submitted by - Lawrence Kwan. - * vrpn.vcproj : Same. - * vrpn_Tracker_PhaseSpace.h : Same. - * vrpn_Tracker_PhaseSpace.C : Same. - -2007-05-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.sln : It was building the release configuration as - Debug for some reason. So changed that. - -2007-04-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_DirectXFFJoystick.C : Made the joystick report at the - requested rate, whether or not there have been changes - to its analog values. - -2007-04-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_DirectXFFJoystick.C : Uncommenting the lines that make sure - not to send force commands or read values at a rate greater - than was asked for. No idea why these had been commented - out, but it broke the case where you opened a non-FF - joystick with a zero force update rate. - -2007-03-18 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Changing version number to 07.05. - -2007-03-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.h : Made both the vrpn_big_endian and the - htond() code use the same test to see what the - endianness is. - * vrpn_Shared.C : It turns out that some ARM processors have - a mixed-endian double format, where you have to both - swap the bytes and then swap the two words that make - up the double. Horrible. This checks for that and - does it if needed. - -2007-03-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Mouse.C : Removing the mouse library except when the - new VRPN_USE_GPM_MOUSE definition is specified in - vrpn_Configure.h - * vrpn_Configure.h : Added entry to let us use the GPM mouse - under linux. - * Makefile : Added a build environment description for cross- - compiling to ARM from PCs running Cygwin - -2007-03-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Mouse.C : Removing the mouse library when compiling - for the ARM, which is the embedded version of the - OS. This device was not present (at least not on - the ARM development I'm working on now). - -2007-02-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.sln : Adding required dependencies on quatlib and two - new files that were added to the VS 6.0 files. - * vrpn.vcproj : Same. - * vrpndll.vcproj : Same. - -2007-01-23 David Borland <borland@cs.unc.edu> - - * vrpn_DirectXFFJoystick.C : Removed DIENVELOPE struct when - creating the force effect. This was causing a buzzing when - applying forces, as the force was ramped down and then back - up again. - -2007-01-23 David Borland <borland@cs.unc.edu> - - * vrpn_DirectXFFJoystick.h : Now handles changed force field - messages. Currently, just assuming a constant force. The center, - jacobian, and radius are ignored. - * vrpn_DirectXFFJoystick.C : Same. - -2007-01-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_isense.C : Changed the interpretation of the - Intersense Quaternion to match that of VRPN/Quatlib. - This lets us translate the positions directly, rather - than scrambled. Thanks to Christian Odom for the - fix! - * vrpn_Connection.C : Updated version number to 7.04. - -2006-11-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Adding new objects to the project to support - the two new devices. - * vrpndll.dsp : Same. - * vrpn_Analog_USDigital_A2.C : Modified to use the device - #define in vrpn_Configure.h rather than WIN32. - * vrpn_Button_NI_DIO24.C : same. - * vrpn_Button_NI_DIO24.h : same. - -2006-11-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog_USDigital_A2.h : New device driver submitted - by William West from Disney VR Studios. - * vrpn_Analog_USDigital_A2.h : Same. - * vrpn_Button_NI_DIO24.h : Same. - * vrpn_Button_NI_DIO24.C : Same. - * Makefile : Added the above files. - * vrpn_Configure.h : Adds configuration option for these - devices and paths needed. - -2006-10-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * time_test.vcproj : Updated to use the August 2006 version - of the DirectX SDK and the Microsoft Platform SDK - for Windows Server 20003 R2. - * vrpn.vcproj : Same. - * vrpndll.vcproj : Same. - * vrpn.sln : Added projects needed to do a DirectShow video - camera vrpn_Imager server. Updated to latest DirectX - SDK and Platform SDK. - * vrpn_FunctionGenerator.C : Removed ambiguity about the - pow() operator by casting one of its inputs. - -2006-08-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsw : Added projects needed to implement a DirectShow - video imager server. - * vrpn_Configure.h : Added entry to tell whether to include - DirectShow video in the build. This must be defined - to build the DirectShow video imager server. - -2006-08-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Switched to most recent version of - DirectX SDK. Moved include into config file so - everything can be edited in one location. - * vrpn_DirectXFFJoystick.h : Same. - -2006-08-28 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.C: correct version of the file. - -2006-08-28 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.h,C: moved the definition of the - message-type strings into the C file. they should have - always been here. - -2006-08-21 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.h,C: fixed up a few things for - vrpn_FunctionGenerator_function_degauss -- constructor and - the way cycleTime is calculated. - -2006-08-14 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.h,C: added a new function, - vrpn_FunctionGenerator_function_degauss. also, made the data - members of the other functions protected and added accessors for - them all. - -2006-07-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_BaseClass.h : Edited some comments. - * vrpn_Connection.h : Added functions to tell the connection to only - handle a finite number of messages per mainloop() call. - * vrpn_Connection.C : Same. - * vrpn_FileConnection.h : Re-implemented the limit_messages_played_back - function and its functionality using the new capability in the - vrpn_Connection object (from which FileConnection derives). - -2006-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker.h : Increased the maximum number of - tracker sensors from 100 to 500. This is to support - more reported beads in the CISMM Video Spot Tracker - program. - -2006-06-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added install and uninstall targets. - -2006-06-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Added HL library when compiling Phantom - driver with HDAPI library. - * vrpn_Connection.C : Increased version number. - -2006-05-04 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Configure.h: undoing the change i accidentally committed. - -2006-05-02 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Connection.[h,C]: added get_time, which returns the - current UTC time in the steam (as opposed to elapsed time, or - time since the connection was opened). - * vrpn_FileConnection.h: same. - -2006-04-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Increased version number for new - release. - -2006-03-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpndll.dsp : Added Button_USB and Keyboard_Mouse. - * vrpndll.vcproj : Same. - -2006-03-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Changing version number for new release. - -2006-03-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Button_USB.cpp : Code from Tom De Weyer to handle USB - buttons on Windows. - * vrpn_Button_USB.h : Same. - * vrpn.dsp : Adding vrpn_Button_USB.cpp and .h. - * vrpn.vcproj : Same. - * vrpn_Keyboard_Mouse.C : Updates to export analogs rather than tracker. - * vrpn_Keyboard_Mouse.h : same. - -2006-03-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * time_test.cpp : Added type-cast. - * vrpn_Keyboard_Mouse.C : Added required library. - * vrpn_Tracker_DTrack.C : Changed from WIN to _WIN check. - * vrpn.sln : Visual C++ 2005 solution file for VRPN. - * *.vcproj : Visual C++ 2005 project files for VRPN. - -2006-02-23 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FileConnection.C: the bookmarking mechanism used when searching - through vrpn logs for start/end times did not correctly handle the - end-of-file case (NULL d_currentLogEntry) in the case of !preload and - !accumulate. store_stream_bookmark and return_to_bookmark now - correctly handle going to/from the end of file (without preload and - accumulate). - -2006-02-22 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Imager.h: added is_description_valid() to vrpn_Imager_Remote. - this function says whether the imager has received a description - message yet. - -2006-02-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Removing vrpn_Router.[hC] - * vrpndll.dsp : Same. - -2006-02-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Router.h : Removing the Sierra Router Server and its - associated files. It was coded in a style that used - the serial messages directly, rather than defining its - own message types. It is no longer being used at UNC, - and I don't know that it has ever been used elsewhere. - A user asked that it be removed. - * vrpn_Router.C : Same. - -2006-02-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Making the C: drive the default in preparation - for release of version 7.00. - -2006-01-27 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_File_Connection.h (get_replay_rate): new. there - was no accessor for replay rate, only a way to set it. - -2005-12-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Added newline to end of error print. - * vrpn_raw_sgibox.C : Removed spurious checks that caused - compiler warnings under Cygwin. Isn't it great to - compile under multiple architectures -- it catches - so many silly things! - -2005-12-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Switching to HDAPI default. - * Makefile : Fixed to compile under Cygwin. - -2005-12-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_HashST.h : Removed function setting non-existent - member variable. - * vrpn_Keyboard_Mouse.C : Moved definitions to make them - legal in modern compilers. - * vrpn.dsp : Added vrpn_HashST.h to the files. - -2005-10-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Adding vrpn_Keyboard_Mouse.[hC] into the build. - * vrpn_Keyboard_Mouse.C : Fixing bugs I introduced when making - it compile under Linux. - * vrpn_Keyboard_Mouse.h : Same. - -2005-10-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Keyboard_Mouse.h : Lets us use Windows keyboard to fly. - From Tom De Weyer at EDM-Uhasselt from Belgium. - * vrpn_Keyboard_Mouse.C : Same. - * Makefile : Same. - -2005-10-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker.h : Made some parameters const that can be. - * vrpn_Tracker.C : Same. - -2005-10-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.h : Making a protected method public to expose - it; it used to be exposed by calling the same method on - the vrpn_Synchronized_Connection class, which no longer - exists. - -2005-10-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added target for 64-bit Intel-based SGI compilation. - -2005-09-30 Russell M. Taylor II <taylorr@cs.unc.edu> - - MAJOR VERSION NUMBER CHANGED TO 7.0 because the vrpn_ForceDevice - protocol values have changed. It is now possible to include trimeshes - that are in a tree structure, and move individual ones around, as - part of the GHOST build. The HDAPI build still builds, but doesn't - have trimeshes in it yet. - - These changes were sent in by Tom De Weyer's group in Belgium after - several rounds of discussion and design. - - * Makefile : Added vrpn_ForceDeviceServer.[hC} - * vrpn.dsp : Same. - * vrpndll.dsp : Same (plus added others needed). - * vrpn_Configure.h : Rearranged entries. - * vrpn_Connection.C : Upgraded version number. - * vrpn_DirectXFFJoystick.h : Now derived from ForceDeviceServer, and - includes stubbed member functions that needed to be defined. - * vrpn_DirectXFFJoystick.C : Same. - * vrpn_ForceDevice.h : Redone to enable multiple objects in a - hierarchy in the scene. The hierarchy handling stuff on - the server side is wrapped into vrpn_ForceDeviceServer. - * vrpn_ForceDevice.C : Same. - * vrpn_ForceDeviceServer.h : Implements the hierarchy-figuring - stuff on the server side. All servers should now derive - from this class. - * vrpn_ForceDeviceServer.C : Same. - * vrpn_HashST.h : Helper class for ForceDeviceServer. - -2005-09-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Added the 5DT16 analog and button drivers. - -2005-09-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding 5DT16 driver along with button driver - to convert from its analog outputs to button - outputs. - * vrpn_5DT16.h : Same. - * vrpn_5DT16.C : Same. - -2005-09-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Added the Microscribe. - -2005-09-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3DMicroscribe.C : Added driver from Tom de Weyer's group - in Belgium for the Microscribe. - * vrpn_3DMicroscribe.h : Same. - * vrpn_Configure.h : Same. - * Makefile : Same, but only works on Unix whereas the scribe - only works on Windows and Mac (need to modify things - to make it link correctly on these). - -2005-09-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_Crossbow.h : Removing a function no longer needed. - * vrpn_Tracker_Crossbow.C : Same. - -2005-09-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3Space.C : Fixing up type-casts. - * vrpn_Connection.C : Removing typecasts that are not needed - * vrpn_Joylin.C : Fixing type cast that was a bug under the - C++ standard, and on some compilers. - * vrpn_Tracker_Fastrak.C : Fixing up typecasts. - -2005-09-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsw : Modified all applications to also depend on - VRPN library, in addition to "make_vrpn_build." This - is going to break things for those who want to build - DLLs, but not having it meant that the apps would not - re-link with the library when only library files were - changed. This was debugging hell. - -2005-09-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_ForceDevice.C : Fixed a bug in the line-mode - constraint code. Involved remembering lots of - linear algebra. Eigenstuff that I always wondered - why I would use it when I had it in course. Also - modified both line and plane codes to normalize the - direction vectors they are passed in. This avoids - unexpected scaling of the forces. - -2005-09-02 Kalpit Desai <kvdesai@cs.unc.edu> - * vrpn_Text.h: Modified the signature of send_message() method to expect 4th argument (time stamp) which may be supplied. - * vrpn_Text.C: Modified the definition of send_message() method to send the user specified timestamp when supplied. - -2005-08-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_BaseClass.h : Whitespace change. - * vrpn_Connection.C : Fixed a bug where a zero-time select() - during an interrupt was not setting the stop time, so - would return with an inconsistent state. Also, whitespace - changes. - * vrpn_Shared.h : Whitspace changes. - -2005-08-13 David Marshburn <marshbur@cs.unc.edu> - - * vrpn.dsw: makes vrpn_Phantom project depend on vrpn project - -2005-08-05 Kalpit Desai <kvdesai@cs.unc.edu> - - * vrpn_Poser.h: Added register_change_handler routines and vrpn_POSERCB - template that provides a way to call back user-routines. - * vrpn_Poser.C: Modified handle_change_message routine of server to - pack the information in vrpn_POSERCB format and then callback - the registered user-routines. - -2005-07-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsw : Added a clock drift estimator project to the list - of available projects. - * vrpn_Connection.C : Modified the getservicename function so that - it doesn't seg fault if passed a NULL pointer. - -2005-07-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Serial.C : Debugged and tested on a mac. Tested on - Linux box. Only tested with the serial mouse, so - more testing should be done before we're entirely - certain that the port worked. - -2005-07-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Serial.C : Switched over to the termios-style commands - from the termio/ioctl() style. This lets things compile - on the Mac platform and should retain backwards compatibility - with the other Unix/Linux platforms. The code does indeed - compile on linux, sgi, and sparc. Not yet tested. - -2005-07-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * time_test.dsp : Added include directories on $(SYSTEMDRIVE) - and lib directories also on $(SYSTEMDRIVE) so that the - apps can build correctly with only edits in the - vrpn_Configure.h file if things are installed in standard - locations. - * vrpn.dsp : Same. - * vrpn_Configure.h : Same. - * vrpndll.dsp : Same. - -2005-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Removed vrpn_Clock.C and .h, which are - no longer needed. - -2005-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Removed vrpn_Clock.C and .h files from those needed. - * vrpndll.dsp : Same. - * vrpn_BaseClass.C : Removed option to not count an object when - doing reference counting. This was only in there for the - synchronized connections, which are now gone. - * vrpn_BaseClass.h : Same. - * vrpn_Clock.C : Removed. - * vrpn_Clock.h : Removed. - * vrpn_Connection.C : Removed references to vrpn_Clock, and the - implementation of vrpn_Synchronized_Connection. This is - going to break every server ever compiled for VRPN, but the - fix is to change to using a vrpn_Connection wherever there - was a vrpn_Synchronized_Connection before. If you were - including the parameters for the clock frequency and - interval, remove them. - * vrpn_Connection.h : Same. - * vrpn_ForwarderController.C : Removed Synchronized. - * vrpn_Mutex.C : Same. - -2005-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Adding vrpn_Mouse to Windows build. - * vrpndll.dsp : Same. - * vrpn_Mouse.C : Modified so that it will compile on Windows. - -2005-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Including vrpn_Mouse class in the server build. - * vrpn_Mouse.h : Linux GPM-based mouse driver submitted by - Mike Weiblen at 3DLabs. - * vrpn_Mouse.C : Same. - -2005-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Adding Logitech 3DMouse into the Windows build. - * vrpndll.dsp : Same. - * vrpn_Tracker_3DMouse.C : Switching to C++ type casts and putting - in some more to prevent compile-time warnings on Windows. - -2005-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_3DMouse.C : Driver for Logitech 3D Mouse - provided by Jinseok Seo from the VR Lab of - POSTECH in Korea. - * vrpn_Tracker_3DMouse.h : Same. - * Makefile : Added the 3D mouse into the build. - -2005-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Adding Crossbow into the set of files built - into VRPN. - * vrpndll.dsp : Same. - * vrpn_Tracker_Crossbow.C : Changed warning pragmas to work - with VC6.0. - -2005-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_Crossbow.h : Driver from Chris V. for a - Crossbow accelerometer and rate gyro server. - * vrpn_Tracker_Crossbow.C : Same. - -2005-06-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Serial.C : Fixed type on GNUC define pointed out by - Chris V. - -2005-06-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Imager.C : Added transcoding from float32 - to uint8 to enable testing the receipt of - different image servers. - -2005-05-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Adds patch for compile on Mac submitted - by Patrick Hartling. - -2005-05-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Clock.h : Added "class" keyword so it would compile on - Linux. - -2005-05-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_BaseClass.C : Changes from Jeff Feasel to fix a - bug I introduced when I put the reference-counting - stuff in without his earlier patch. This makes the - Clock object behave differently. It also hides the - clock objects away so that users don't create them - and cause reference-count problems. Also adds - comments describing why we need both unique and - non-unique base classes. - * vrpn_BaseClass.h : Same. - * vrpn_Clock.C : Same. - * vrpn_Clock.h : Same. - * vrpn_Connection.C : Same. Also bumps minor version number. - * vrpn_Connection.h : Same. - * vrpn_Forwarder.C : Adds reference-counting to this class, which - is not derived from BaseClass. - * vrpn_Forwarder.h : Same. - * vrpn_ForwarderController.C : Same. - * vrpn_ForwarderController.h : Same. - * vrpn_Mutex.C : Same. - * vrpn_RedundantTransmission.C : Same. - * vrpn_SharedObject.C : Same. - -2005-05-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Removing HMD directory stuff that is no - longer useful, and might cause permission - problems on builds at UNC. - -2005-04-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_ForceDevice.h : Replaced the callback list code - with new code based on the template. This file - was missed in the mass conversion 12/14/2004. - * vrpn_ForceDevice.C : Same. - -2005-04-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Moved the location to look for DirectX - SDK to where the Feb 2005 installer puts it. This - version works with release but not debug code. How - Nice of them :-) - * vrpn_NationalInstruments.h : Removed a redundant place to - store the number of output channels. There is already - a member variable for this is the AnalogOutput class; - having another one here just causes fragility. - * vrpn_NationalInstruments.C : Same. - -2005-04-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_NationalInstruments.C : Marked one particular - error return code as not a problem for AO_Configure. - This makes the new NI module work like the old - NI_Output. It is almost certainly something to - fix for real later. - * vrpn.dsw : Added dependencies to make the server - rebuild when library does. - -2005-02-25 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Removed -LANG:std from compile, no streams - used in the code anymore. - -2005-02-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog_Output.C : Whitespace change. - * vrpn_Analoh_Output.h : Same. - * vrpn_Poser_Analog.C : By default, a poser will not send - updates until it gets a request from a client. Also, - it sends them only when they arrive, not every - time through mainloop(). - * vrpn_Poser_Analog.h : Same. - * vrpn_nikon_controls.h : Guard definitions to enable - multiple inclusion. - * vrpn_NationalInstruments.C : Replacement for the - vrpn_Analog_Output_NI.C file that makes a more- - general read/write server. - * vrpn_NationalInstruments.h : Replacement for the - vrpn_Analog_Output_NI.h file that makes a more- - general read/write server. - * vrpn.dsp : Modified to use new files. - * vrpndll.dsp : Modified to use new files. - * Makefile : Changed NI files to NationalInstruments. - -2005-02-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added John Stone's definitions to make - things compile under 64-bit Linux. - -2005-01-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_BaseClass.C : Removing last vestiges of STREAMS from VRPN. - * vrpn_BaseClass.h : Same. - * vrpn_Clock.C : Same. - * vrpn_Configure.h : Same. - * vrpn_Shared.h : Same. - -2005-01-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Imager.C : Removed all references to the ill-planned - RGB and BGR formats. - * vrpn_Imager.h : Same. - -2004-12-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3Space.C : Turned on a higher level of warnings in - Windows and then went through and fixed all of the - warnings, except a few on FunctionGenerator (which - has an uncompleted function) and on Sound (which has - a bunch of uncompleted functions). Fixed a few bugs - that turned up along the way. Ripped out every trace - of iostream (old or new type) from the base library. - Also removed VRPN_NO_STREAMS, which was obviated by - this. - * vrpn_ADBox.C : Same. - * vrpn_Analog.C : Same. - * vrpn_Analog.h : Same. - * vrpn_Analog_5dt.h : Same. - * vrpn_Analog_Output_NI.C : Same. - * vrpn_Analog_Output_NI.h : Same. - * vrpn_Analog_Radamec_SPI.C : Same. - * vrpn_BaseClass.C : Same. - * vrpn_BaseClass.h : Same. - * vrpn_Button.C : Same. - * vrpn_CerealBox.C : Same. - * vrpn_Configure.h : Same. - * vrpn_Connection.C : Same. - * vrpn_DirectXFFJoystick.C : Same. - * vrpn_Dyna.C : Same. - * vrpn_FileConnection.C : Same. - * vrpn_Flock.C : Same. - * vrpn_FunctionGenerator.C : Same. - * vrpn_FunctionGenerator.h : Same. - * vrpn_Imager.C : Same. - * vrpn_Imager.h : Same. - * vrpn_ImmersionBox.C : Same. - * vrpn_ImmersionBox.h : Same. - * vrpn_Joywin32.C : Same. - * vrpn_Joywin32.h : Same. - * vrpn_Mutex.C : Same. - * vrpn_Poser_Analog.h : Same. - * vrpn_Poser_Tek4662.C : Same. - * vrpn_Serial.C : Same. - * vrpn_Shared.C : Same. - * vrpn_Shared.h : Same. - * vrpn_SharedObject.C : Same. - * vrpn_Sound.C : Same. - * vrpn_Spaceball.C : Same. - * vrpn_Tng3.C : Same. - * vrpn_Tracker_DTrack.C : Same. - * vrpn_Tracker_Fastrak.C : Same. - * vrpn_Tracker_Liberty.C : Same. - * vrpn_UNC_Joystick.C : Same. - * vrpn_VPJoystick.C : Same. - * vrpn_Wanda.C : Same. - * vrpn_Zaber.C : Same. - * vrpn_nikon_controls.C : Same. - * vrpn_raw_sgibox.C : Same. - -2004-12-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_BaseClass.h : Guarding the #pragma that turns off - the warning so that it only happens on Windows, - so that the SGI compiler doesn't complain about - every file. - -2004-12-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_BaseClass.h : Added a template class to deal with - callback list handling. This does not use STL, to - avoid the problems with having incompatible STL - versions on some systems. It generated a warning - message when using DLLs that seemed to make no sense, - and the test code still works in DLL mode (tested), - so I turned the warning off. This change removes - a lot of duplicate code from derived classes, and - ensures proper clean-up of lists at destruction. - * vrpn_Analog.C : Modified to use templated callbacks. - * vrpn_Analog.h : Same. - * vrpn_Button.C : Same. - * vrpn_Button.h : Same. - * vrpn_Clock.C : Same. - * vrpn_Clock.h : Same. - * vrpn_Connection.C : Same (modified Clock callback). - * vrpn_Dial.C : Same. - * vrpn_Dial.h : Same. - * vrpn_Imager.C : Same. - * vrpn_Imager.h : Same. - * vrpn_Router.C : Same. - * vrpn_Router.h : Same. - * vrpn_Text.C : Same. - * vrpn_Text.h : Same. - * vrpn_Tracker.C : Same. - * vrpn_Tracker.h : Same. - * vrpndll.dsp : Must have tweaked a compiler flag. - -2004-12-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Changes from Patrick Hartling to make - VRPN compile under FreeBSD. - * vrpn_Types.h : Same. - -2004-12-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Switched out TempImager for Imager - * vrpn.dsw : Changed to test_imager from test_tempimager - * vrpn_Imager.h : Added #include needed on Unix - -2004-12-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp Added vrpn_Imager.[hC] and removed - vrpn_TempImager.[hC]. - * vrpndll.dsp Same. - * vrpn.dsw Added vrpn_testimager_server.dsp - * vrpn_Imager.C Final design, partial implementation of - VRPN Imager class. Pulls the image pose out as a - separate class and adds throttle capability to the - client code (implemented in server by dropping frames - rather than sending them). Adds count of frames - dropped to alert client application. Adds 12-in-16 - data type. Transcoding between types not yet - implemented. Client-side selection of data types to - send not yet implemented. RGB and BGR packed formats - not yet implemented. - * vrpn_Imager.h Same. - -2004-11-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Whitespace changes. - -2004-11-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Dyna.C : Added changes from Uni-Hamburg to also work with - the SeeReal D4D stereo Display, which is an older version. - This still works with the newer DynaSight at UNC. - * vrpn_Tracker_Liberty.C : Also works with the Patriot, which - sends a slightly different record format. This version - comes from Uni-Hamburg. Roland Schroeder-Kroll sent - these fixes in from Steffi Beckhaus' group there. - -2004-11-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Happy Birthday to me! - * Makefile : Added John Stone's additions to make it compile on - 64-bit Solaris - -2004-11-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog.C : Fixed a bug where a specified time value never - got stored into the timestamp before sending. - -2004-10-20 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_TempImager.h: added VRPN_CALLBACK to the friend function - declaration of java_vrpn_handle_region_change in - vrpn_TempImager_Region - -2004-10-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Types.h : Added a flag to tell the file not to throw an error - when compiled with a C compiler rather than a C++ compiler. - Useful to programs that want to hide things behind a C - interface. - -2004-10-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_DirectXFFJoystick.C : Fixed a crash bug when you didn't have - a joystick open. - -2004-09-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Button.C : Adding a couple more VRPN_CALLBACKs that I thought - we didn't need but we do. - * vrpn_raw_sgibox.C : same. - * vrpn_Configure.h : Changing back to the C: drive for normal users - (I've got everything installed on D:). - -2004-09-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - Adding Chris VanderKnyff's changes that enable DLL linkage - for applications. Heading towards enabling C# and other language - support. - - * ChangeLog : Fixing date on my earlier message, reordering. - * Makefile : Adding new source-code files. - * make_vrpn_libs_build.dsp : New project file to make - dependency on both VRPN and VRPNDLL. - * time_test.dsp : Making it depend on the project that causes - both VRPN and VRPNDLL projects to be built, rather - than on VRPN. If you try to make it depend on both - VRPN and VRPNDLL, you get linking trouble. - * vrpn.dsp : Same. Also, defining things needed to make DLL - linkage work correctly. - * vrpn.dsw : Adding make_vrpn_libs.build project. Adding - dependencies. - * vrpn_Configure.h : Added an entry for compiling with DLL linkage. - Added definitions needed to make this work for the three - cases (library DLL, library static, application). - * vrpn_Connection.C : Removed iostream. Chris made error output - go to stderr rather than stdout. - * vrpn_Router.C : Moved external functions into static member - functions to avoid cluttering the name space. - * vrpn_Types.h : Changed to #error from ad-hoc error generator. - * vrpn_3Space.h : Making all classes defined with VRPN_API. - Making all callbacks use VRPN_CALLBACK. Making all - external functions and structures VRPN_API. - * vrpn_ADBox.h : Same. - * vrpn_Analog.h : Same. - * vrpn_Analog_5dt.h : Same. - * vrpn_Analog_Output.h : Same. - * vrpn_Analog_Output_NI.h : Same. - * vrpn_Radamec_SPI.h : Same. - * vrpn_BaseClass.h : Same. - * vrpn_Button.h : Same. - * vrpn_CerealBox.h : Same. - * vrpn_Clock.h : Same. - * vrpn_Connection.h : Same. - * vrpn_Dial.h : Same. - * vrpn_DirectXFFJoystick.h : Same. - * vrpn_Dyna.h : Same. - * vrpn_FileConnection.h : Same. - * vrpn_FileController.h : Same. - * vrpn_Flock.h : Same. - * vrpn_Flock_Parallel.h : Same. - * vrpn_ForeceDevice.h : Same. - * vrpn_ForwarderController.h : Same. - * vrpn_FunctionGenerator.h : Same. - * vrpn_GlobalHapticsOrb.h : Same. - * vrpn_ImmersionBox.h : Same. - * vrpn_JoyFly.h : Same. - * vrpn_Joylin.h : Same. - * vrpn_Joywin32.h : Same. - * vrpn_LamportClock.h : Same. - * vrpn_Log.h : Same. - * vrpn_Magellan.h : Same. - * vrpn_Mutex.h : Same. - * vrpn_Nidaq.h : Same. - * vrpn_Poser.h : Same. - * vrpn_Poser_Analog.h : Same. - * vrpn_Poser_Tek4662.h : Same. - * vrpn_RedundantTransmission.h : Same. - * vrpn_Router.h : Same. - * vrpn_Serial.h : Same. - * vrpn_Shared.h : Same. - * vrpn_SharedObject.h : Same. - * vrpn_Sound.h : Same. - * vrpn_Spaceball.h : Same. - * vrpn_TemImager.h : Same. - * vrpn_Text.h : Same. - * vrpn_Tng3.h : Same. - * vrpn_Tracker.h : Same. - * vrpn_Tracker_AnalogFly.h : Same. - * vrpn_Tracker_ButtonFly.h : Same. - * vrpn_Tracker_DTrack.h : Same. - * vrpn_Tracker_Fastrak.h : Same. - * vrpn_Tracker_Liberty.h : Same. - * vrpn_Tracker_isense.h : Same. - * vrpn_TypeDispatcher.h : Same. - * vrpn_UNC_Joystick.h : Same. - * vrpn_VPJoystick.h : Same. - * vrpn_Wanda.h : Same. - * vrpn_Zaber.h : Same. - * vrpn_nikon_controls.h : Same. - * vrpn_raw_sgibox.h : Same. - * vrpn_sgibox.h : Same. - -2004-09-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker.h : Bumped the maximum number of sensors per tracker - from 20 to 100. - * vrpn_BaseClass.C : Making the d_servicename and d_connection - code only run once for a multiple-inheritance tree. - Moved the deletion code into the Unique base class - destructor to avoid crashing due to accessing already- - deleted connection object. - * vrpn_Connection.C : Prettifying. - * time_test.dsp : Switching back to DLL-based linkage - * vrpn.dsp : Same. - -2004-09-01 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGenerator.[h,C]: first commit of a new device - type, and function generator - * vrpn.dsp: includes function generator files - -2004-08-31 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Serial.C : Added John Stone's fix to make it compile on macs. - -2004-08-31 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding build for vrpn_Poser_Tek4662 in server library. - * time_test.dsp : Changing code generation to use multithreaded - non-DLL for both debug and release. This turns out to have - always been the proper setting to use. Unfortunately, all - apps have to be rebuild with new settings, and all libraries - have to use the same setting. - * vrpn.dsp : Same. - * vrpn_Analog.C : Whitespace changes. - * vrpn_Poser.C : Same. - * vrpn_Poser.h : Same. - * vrpn_CerealBox.C : Comment correction. - * vrpn_Connection.C : Setting values to NULL to avoid multiple - deletion attempts on clock object at shutdown. - * vrpn_Serial.C : Declared const parameter when appropriate. - * vrpn_Serial.h : Same. - * vrpn_Nikon_Controls.C : Error message correction. - * vrpn_Nikon_Controls.h : Uppercased "com1" for Windows. - -2004-08-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - Adding changes made by Jeff Feasel to include reference counting - in the vrpn_Connection object so that they would be deleted when - all objects using them are deleted (and when all objects opening - them with vrpn_get_connection_by_name() remove their references. - * vrpn_BaseClass.C : Adds reference-counting for vrpn_Connections. - * vrpn_Clock.C : Same. - * vrpn_Connection.C : Same. - * vrpn_Connection.h : Same. - * vrpn_Mutex.h : Same. Also fixed a bug whereby the number of - allocated connections was not being properly incremented. - -2004-08-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Adds possibility that NI files are on D: - * vrpn_Button.C : Moving global constants not starting with vrpn_ - from header file to source file. - * vrpn_Button.h : Same. - -2004-08-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - Changes submitted by Kurt Achatz at A.R.T. - * Makefile : Adding vrpn_Tracker_DTrack.[Ch] to server. - * vrpn_Analog.C : Fixing time-comparison bug. - * vrpn_Configure.h : No longer need to configure the - DTrack driver -- all needed files are built in. - * vrpn_Tracker_DTrack.C : Updated to not switch target ID - numbering. Now supports up to for A.R.T. Flysticks. - * vrpn_Tracker.DTrack.h : Same. - -2004-07-27 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_FileConnection.C : Made all of the deletes for - arrays of characters use the [] version of - delete on (char *). Very scary that it didn't - used to do this. - -2004-07-27 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding in recent files. Deleting commented-out - rules. - * vrpn_Poser.C : removing unused variables. - * vrpn_Poser.h : Adding newline at end of file. - -2004-07-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsw : Added project file for forcedevice test client. - * vrpn_Configure.h : Added entry for using the HDAPI library from - SensAble Technologies in place of the older GHOST library. - -2004-07-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Added port number to printed comment. - -2004-06-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Turns off streams when compiling for the - Phantom server. - * vrpn_TempImager.C : Adds functions to send using pointers to - the data to be sent, rather than pointer to the whole - image. Added functions to set the resolution and range. - * vrpn_TempImager.h : Same. Increased number of channels. - -2004-05-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog_Output_NI.C : Removed debug print statements. - * vrpn_Poser_Analog.C : Changed the parameters so that it can - use a different analog output device for each channel. - This is going to break code that uses the Posers, but it - was needed to split it up for the case where some channels - were driven by one device and others by a different - device. It now behaves more like an AnalogFly in terms - of parameters. - * vrpn_Poser_Analog.h : Same. - -2004-05-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog_Output_NI.h : Analog output that uses National - Instruments board. - * vrpn_Analog_Output_NH.C : Same. - * vrpn.dsp : Added NI-DAQ to library path, files to project. - Enable/disable using vrpn_Configure.h. - * vrpn.dsw : Added tracker_to_poser project (client_src). - * vrpn_Configure.h : Added entry for National Instruments - board. Also loads libraries if NI is configured. - * vrpn_Poser.C : Made several things const that should have - been. - * vrpn_Poser.h : Same. - * vrpn_Poser_Analog.C : Added comment. - * vrpn_TempImager.C : Checks to make sure we have sent the - description before sending any regions. Removed an - unused parameter. - * vrpn_TempImager.h : Added comments for improvements. Added - some functions. Still a work in progress. - -2004-05-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_TempImager.C : Implemented another of the decode functions. - -2004-04-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_ButtonC : Modified the reset command for the Pinchglove - so that it works more reliably (fixed timeout bug - and reworked logic). Tested by offsite user who - had problems with the original version. - * vrpn_ForceDevice.C : Making it compile under Cygwin. - * vrpn_Serial.C : Making it compile undre Cygwin. - * vrpn_Tracker.h : Describing the format of the values to be returned. - * vrpn_Types.h : Making it compile under Cygwin. - -2004-04-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Button.h : Returns the port argument for the parallel - button device to an int to make error checking work. - Points to the web page where the Python button is - described. - -2004-04-13 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FileConnection.h: adds new data members to track earliest - and latest user-message times and functions for finding these times. - Adds a function, jump_to_filetime, that jumps the current time in - a vrpn stream to a specified absolute time. Adds an internal - class, vrpn_FileBookmark, used when jumping around in a stream. - * vrpn_FileConnection.C: this should no longer cause repeated - or missed message when (internally) jumping around in streams. - Also, elapsed time is computed based on the earliest-timed user - message. As a result, functions that query elapsed time or - stream length will cause vrpn to examine the entire stream once. - -2004-04-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.C : Added check for old/new streams. - * vrpn_BaseClass.C : Same. - -2004-04-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding flag to SGI compile in the hope that it would - fix things and let us use the new streams libraries. It - got us part of the way there on my system. - * vrpn_BaseClass.C : Added Patrick Hartling's changes to make VRPN - compile with Visual Studio.NET, which required switching to - new streams, which required retrofitting SGIs to use old - streams (using yet another define in vrpn_Configure.h). - * vrpn_BaseClass.h : Same. - * vrpn_Clock.C : Same. - * vrpn_Configure.h : Same. - * vrpn_Connection.C : Same. - * vrpn_ImmersionBox. : Same. - * vrpn_Shared.C : Same. - * vrpn_TempImager.h : Same. - * vrpn_Tng3.C : Same. - * vrpn_Tracker_AnalogFly : Adding Patrick Hartlings changes to make - it compile with Visual Studio.NET, in this case a type cast - to let the compiler know which function to call. - * vrpn_Tracker_ButtonFly : Same. - -2004-04-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.C : Modified all of VRPN to use calls to a new - function vrpn_gettimeofday() rather than the standard - gettimeofday() to avoid exporting gettimeofday(). On - all but Windows with WINSOCK, this is defined back to - gettimeofday(). On Windows with WINSOCK, it is the - function that implements gettimeofday(). By editing - a flag in vrpn_Configure.h, VRPN will still export - gettimeofday; otherwise, it no longer does on any - operating system. - * vrpn_Shared.h : Same. - * vrpn_Configure.h : Modified to include an optional parameter - that will export vrpn_gettimeofday() as gettimeofday() and also - 'struct timezone' when it is set, but not otherwise. - * time_test.cpp : Using vrpn_gettimeofday() not gettimeofday() - * vrpn_3Space.C : Same. - * vrpn_ADBox.C : Same. - * vrpn_Analog.C : Same. - * vrpn_Analog_3dt.C : Same. - * vrpn_Analog_Output.C : Same. - * vrpn_Analog_Radamec_SPI.C : Same. - * vrpn_BaseClass.C : Same. - * vrpn_Button.C : Same. - * vrpn_CerealBox.C : Same. - * vrpn_Clock.C : Same. - * vrpn_Connection.C : Same. - * vrpn_Dial.C : Same. - * vrpn_DirectXFFJoystick.C : Same. - * vrpn_Dyna. : Same. - * vrpn_FileController.C : Same. - * vrpn_Flock.C : Same. - * vrpn_Flock_Parallel.C : Same. - * vrpn_ForceDevice.C : Same. - * vrpn_ForewardController.C : Same. - * vrpn_GlobalHapticsOrb.C : Same. - * vrpn_ImmersionBox.C : Same. - * vrpn_Joylin.C : Same. - * vrpn_Joywin32.C : Same. - * vrpn_Magellan.C : Same. - * vrpn_Mutex.C : Same. - * vrpn_Nidaq.C : Same. - * vrpn_Nidaq.h : Same. - * vrpn_Poser.C : Same. - * vrpn_Poser_Analog.C : Same. - * vrpn_RedundantTransmission.C : Sam.e - * vrpn_Router.C : Same. - * vrpn_Serial.C : Same. - * vrpn_SharedObject.C : Same. - * vrpn_Sound.C : Same. - * vrpn_Spaceball.C : Same. - * vrpn_TempImager.C : Same. - * vrpn_Text.C : Same. - * vrpn_Tng.C : Same. - * vrpn_Tracker.C : Same. - * vrpn_Tracker_AnalogFly.C : Same. - * vrpn_Tracker_ButtonFly.C : Same. - * vrpn_Tracker_DTrack.C : Same. - * vrpn_Tracker_Fastrak.C : Same. - * vrpn_Tracker_Liberty.C : Same. - * vrpn_Tracker_isense.C : Same. - * vrpn_UNC_Joystick.C : Same. - * vrpn_Wanda.C : Same. - * vrpn_Zaber.C : Same. - * vrpn_nikon_controls.C : Same. - * vrpn_FileConnection.C : Same. Also, modified some calls to - advance_currentLogEntry() so that they were function - calls so that the code would compile. Not sure how - they compiled before... - -2004-03-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_CerealBox.C : Fixed a bug that encoded the negative tick - incorrectly. - * vrpn_Joywin32.h : Added credits. - * vrpn_Tracker.C : Closes the serial device when the tracker's - destructor is called. - * vrpn_Tracker.h : Same. - -2004-02-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Closes file handle that is no longer needed. - * vrpn_RedundantTransmission.C : Same. - * vrpn_FileConnection.h : Added three new global flags that - control the state of buffering when a FileConnection - reads a log file. PRELOAD controls whether it grabs - the whole file into memory when it starts. ACCUMULATE - controls whether it keep the file in memory as it reads - it. SKIP_TO_USER_MESSAGES tells whether it should jump - over all initial system messages in a file when it is - loaded or rewound. - * vrpn_FileConnection.C : Major changes throughout to implement - the flexibility described above. Also lots of code - factoring and consolidation so that there is only one - function to do each particular operation that is called - by all other functions requiring the operation. Tested - with Nano, Video_spot_tracker, and vrpnLogToMatlab in - several different states of operation. - -2004-02-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_isense.C : Added change by David Nahon to make - the units correct (meters rather than centimeters). - -2004-02-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsw : Removed separate library for DTrack. - * vrpn_Tracker.DTrack.C : Includes the necessary .c file from - dtracklib to avoid having to load a library. - -2004-02-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Told the release version where to find Dtrack.h. - * vrpn_Tracker_DTrack.C : Modified the order of includes so that - it can compile properly when VRPN_USE_DTRACK is defined. - Initialized some member variables correctly. - * vrpn_Tracker.DTrack.h : Same. - -2004-02-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - Adding changes from David Nahon at Virtools. - * vrpn.dsp : Added DTrack files and includes and project. - * vrpn.dsw : Same. - * vrpn_Configure.h : Added configuration setting to enable - building the DTrack code from Advanced Realtime - Tracking CmbH. - * vrpn_Tracker_isense.C : Modified this to return the orientation - with the axes permuted in a way that makes it match - what other trackers report. - -2004-02-04 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Connection.C (handle_sender_message): auto-registers - unknown senders. - -2004-01-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker.C : Added initialization of the watchdog timer - in the constructor to keep it from accidentally taking - over and causing infinite-reset problems on all but - the Liberty. - -2003-12-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Flock.h : Added an optional flag to tell whether to invert - the Quaternion orientation report before sending it back. - This has been done always in the past, but it was probably - a hack to make the sensors work in the wrong hemisphere. - * vrpn_Flock.C : Same. - * vrpn_Flock_Parallel.h : Same. - * vrpn_Flock_Parallel.C : Same. - -2003-12-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog_5dt.h : Added optional parameter to make it try - 10 bytes per message rather than 9. This is because one - group has one that does this. - * vrpn_Analog_5dt.C : Same. Also fixed some bugs reported by - Sebastien Maraux. - -2003-12-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Serial.h : Added calls to raise and lower RTS line. - Should work on Windows. Not sure it will work on Linux/Unix. - Not tested on any. - - * vrpn_Serial.C : Same. - - * vrpn_Flock.C : Changed to use the new RTS raise/lower calls - in vrpn_Serial.C to reset the tracker. This should enable - Flocks to work even with serial connectors that have all - the wires connected. - -2003-12-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Clock.C : Plugging memory leaks. - * vrpn_Connection.C : Plugging memory leaks. - -2003-12-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_Liberty.h : Adds driver submitted by Daniel Myall - from Westco for the Polhemus Liberty tracker. - * vrpn_Tracker_Liberty.C : Same. - * vrpn_Tracker.h : Same. - * vrpn_Tracker.C : Same. - * vrpn.dsp : Same. - * Makefile : Same. - -2003-11-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog.C : report() : Added parameter to tell the timestamp - that should be used by the Analog for the report. Both - for vrpn_Analog and vrpn_Analog_Server. - : report_changes() : Same. - * vrpn_Analog.h : Same. Also added default time parameter. Also - re-ordered where include files happen. - -2003-11-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker.h : Modified so that you can set the class of - service in the vrpn_Tracker_Server. - * vrpn_Tracker.C : Same. - -2003-11-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : I messed up the commented-out config for UNC - with the last commit. Fixed here. - -2003-11-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Compiler warning on SGI caught this! There - was an = rather than == where we were checking for the - existence of a local type. No harm done, but this avoids - extra checking. - -2003-11-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Exposing constructor with stern warning - against using it. - -2003-11-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Flock.C : Added changes so that the use o the extended-range - transmitter is optional, rather than required as it was - before. - * vrpn_Flock.h : Same. - -2003-11-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_isense.C : Added changed by David Nahon that lets - the user specify whether to do a boresight reset at startup. - Also changes the sensor numbers to be zero-indexed like all - other VRPN trackers. Also changes units to meters and - radians to match other VRPN trackers. - * vrpn_Tracker_isense.h : Same. - -2003-11-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Changes the default port number one more time, - to the one given to us by the Internet Address Naming - Authority. - -2003-10-31 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Connection.h (vrpn_Endpoint): new methods setConnection and - getConnection, and a new data member d_parent of type vrpn_Connection*. - * vrpn_Connection.C (vrpn_Endpoint::handle_type_message): message - type auto-registration. If the type from the remote side is unknown, - register the type locally. This enables generic stream examiners - and editors. - (vrpn_Connection::connect_to_client): call vrpn_Endpoint:: - setConnection after creating an endpoint. - (vrpn_Connection::vrpn_Connection): same - (vrpn_Connection::server_check_for_incoming_connections): same - -2003-10-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker.C : Fixed a bug that was added in the code that - unregisters handlers in the destructor. It needed to pass - another parameter, which it does here, to work in the - general case. This bug caused nano to hang at exit, - repeatedly tryin to unregister the same (wrong) handler. - -2003-09-26 Matt Harvey <m.j.harvey@ucl.ac.uk> - - * Makefile : Added VPJoystick driver. - * vrpn.dsp : Same. - * vrpn_VPJoystick.h : Driver for a commercial joystick. - * vrpn_VPJoystick.C : Same. - * vrpn_raw_sgibox.C : Modified to remove #defines from the header - file that didn't start with vrpn_ - * vrpn_raw_sgibox.h : Same. - -2003-09-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.h : Rearranged order of functions so that - it would compile on HPUX. - * vrpn_ForceDevice.C : Made it compile on HPUX. - * vrpn_ForceDevice.h : Rationalized const vs. non-const params. - * vrpn_Shared.h : Moved hack to make it compile on HPUX. - -2003-09-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * time_test.cpp : Compiles without warnings (commented out - unused variables). - * time_test.dsp : Making it build on Release setting. - * vrpn_ForceDevice : Changed types to prevent compiler warnings. - -2003-09-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker.C : Cleans up memory in the destructor to - prevent it leaking when remote tracker objects - are created and destroyed. - -2003-09-26 Sebastien MARAUX <maraux@ondim.fr> - - * vrpn_ForceDevice.C : Added custom effect to ForceDevice, - in particular a buzzing effect whose amplitude - and frequency can be set. - * vrpn_ForceDevice.h : Same. - * vrpn_Serial.C : Change to make it compile on SGI. - -2003-09-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_isense.h : Fixing things that broke the build. - Bad Russ. No Cookie! - * vrpn_Tracker_isense.C : Same. Still no cookie. - -2003-09-16 Blair MacIntyre <blair@cc.gatech.edu> - - * vrpn_Tracker_isense.h : Added code to add Wands and other - devices to the tracker like the Fastrak version of - the Intersense driver could. - * vrpn_Tracker_isense.C : Same. - -2003-09-02 Blair MacIntyre <blair@cc.gatech.edu> - - * Makefile : Makes it work on MacOSX with Intersense. - * vrpn_ADBox.C : Compiles on Mac. - * vrpn_Serial.C : Compiles on Mac. - * vrpn_Tracker_isense.C : Calls required function in constructor. - * vrpn_Tracker_isense.h : Works on Mac. - -2003-08-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Includes the new files for Joywin32. - -2003-08-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Serial.C : Added include needed on Linux - * vrpn_Joywin32.C : Code from Sebastien Maraux to read - from joysticks without going through DirectX. - * vrpn_Joywin32.h : Same. - -2003-08-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.C : Removed #ifdef'd out code. - -2003-08-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.C : Fixed the code that handles high-resolution - Windows timing. This version always has time moving - forwards. - * time_test.cpp : Modified to test the monotonicity of time. - * time_test.dsp : Same. - * vrpn.dsw : Same. - -2003-08-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_DirectXFFJoystick.C : Made not crash when it couldn't - open a joystick. - -2003-07-31 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Prints a more useful error message when - the bind() function call fails. - -2003-07-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Added configurable default port, no longer - set to 4500 (which is being used by VPN and Microsoft). - * vrpn_Connection.h : Same. - * vrpn_Connection.C : Uses non-interruptable version of select, - which is more general for apps that have interrupts. - * vrpn_Serial.C : Switches to interrupt-savvy version of read. - -2003-07-24 Matt McCallus <mccallus@cs.unc.edu> - - * vrpn_Sound.C : Added a "look at/look up" call for setting - orientation, rather than quaternions. Later will - either remove quaternion one or (better) reimplement - in terms of at/up (or vice-versa). - * vrpn_Sound.h : Same. - -2003-07-21 Sascha Scholz <sascha.scholz@imk.fraunhofer.de> - - * Makefile : Removed un-needed include directories that caused - problems with non-standard Linux compiler installation. - -2003-07-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Button.C : Turns on a second bit to work with the HiBall. - This is a fix from Ben Elgin. - -2003-07-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Added support for compiling ADBox/CubicMouse driver. - * vrpn_ADBox.C : Removed definitions that exclude Windows. - -2003-07-07 Sascha Scholz <sascha.scholz@imk.fraunhofer.de> - - * Makefile : added ADBox/CubicMouse driver - * vrpn.C : Same. - * vrpn_ADBox.C : Same. - * vrpn_ADBox.h : Same. - -2003-06-20 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Configure.h: adds a (commented-out) option to use Ghost 3.1 - -2003-06-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Removed syntax error that kept it from compiling. - -2003-06-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Changes to include Intersense files in ../isense. - * vrpn_Configure.h : Describes how to link with InterSense library. - * vrpn_Tracker_isense.C : Updated to newer version of InterSense - library. Now works with USB trackers. - -2003-05-30 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Configure.h: change the default path for the Ghost library - to point to version 4.0. - -2003-05-21 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Connection.C: - (vrpn_Endpoint::setLogNames): set the in or out log-file name only - if each is non-NULL - (vrpn_Connection::handle_log_message): correctly handle the case in - which only one log file has been requested (in or out). previously - assumed both would be requested. - -2003-05-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_TempImager.C : Fixes bug by which a new imager client would - not get the region description message, causing it to never - get region callbacks. - -2003-05-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Added configuration entry for Intersense driver. - * vrpn_Tracker_isense.C : Made it include the Intersense-supplied - C file that interacts with the DLL code. Note that this - does not compile with the currently-supplied SDK from - InterSense. I don't have any trackers to test it on if I - mess with it, so decided to leave it alone. - -2003-04-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_raw_sgibox.C : Fixed bug on analog code that read from the - dials, where the 16-bit integer was not read in the correct - order and not sign-extended. Added Dial interface, so that - the dial box reports both analog and dial values. - * vrpn_raw_sgibox.h : Same. - -2003-04-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsw : Removed phan_server project. Added vrpn_phantom.lib - dependency to the vrpn_server project. - * vrpn_Configure.h : Added configuration for using Phantom. - -2003-04-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Added definitions to control which version of - the system clock is used in Windows. - * vrpn_Shared.C : Added Haris' code to use the system performance - clock, guarded by VRPN_WINDOWS_CLOCK_V2. Tested using - the Analogfly test program. - * vrpn_Tracker_AnalogFly.C : Comment change. - -2003-01-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Configure.h : Put back the uncommented #pragma for library loads - and added comments describing how to change them in the - future. - * vrpn_DirectXCCJoystick.C : Added casts to get rid of compiler - warnings, white space changes, comments. - * vrpn_Shared.h : Uncommented definition in Windows CE compile. - -2003-01-15 Alexandra Bokinsky <bokinsky@cs.unc.edu> - - * vrpn_Configure.h : Commented out DirectX library load #pragmas. - * vrpn.dsw : Added force-feedback joystick server. - * vrpn_Shared.h : Commented out definition for Windows CE compile. - * vrpn_DirectXFFJoystick.C : Changed startup parameters for force and - made the force command average the last three values before - sending them to the joystick. - -2003-01-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_GlobalHapticsOrb.C : Server for the Global Haptics GeoOrb device. - * vrpn_GlobalHapticsOrb.h : Same. - * vrpn_Tracker_ButtonFly.C : Server for a device that lets you fly - or teleport using button devices. - * vrpn_Tracker_ButtonFly.g : Same. - * Makefile : Adding GlobalHapticsOrb and ButtonFly servers. - * vrpn.dsp : Same. - * vrpn_Tng3.h : Comment fix. - * vrpn_Tracker_AnalogFly.C : Switched to autodeleted handler, rather - than registering and unregistering the handler. - -2003-01-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_Fastrak.C : Installing fix from Sascha Scholz to make - the fastrak work with a fastrak stylus. I couldn't test the - code I put in the previous commit. - -2003-01-02 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Analog_Output.h: uniform formatting, new data members for - num-channel report and new-connection message types, plus: - (vrpn_Analog_Output::getNumChannels): new - (vrpn_Analog_Output::encode_to): removed, unused. - (vrpn_Analog_Output_Server::setNumChannels): note about expected use. - (vrpn_Analog_Output_Server::vrpn_Analog_Output_Sever): added a third - parameter which specifies the number of active channels. defaults - to vrpn_CHANNEL_MAX. - (vrpn_Analog_Output_Server::handle_got_connection): new - (vrpn_Analog_Output_Server::report_num_channels): new - (vrpn_Analog_Output_Server::encode_num_channels_to): new - (vrpn_Analog_Output_Remote::handle_report_num_channels): new - - * vrpn_Analog_Output.C: the functions noted above, plus: - (vrpn_Analog_Output::register_types): register "number of channels" - and "new connection" message types. - (vrpn_Analog_Output_Server::vrpn_Analog_Output_Server): register - handler for new-connection messages. - (vrpn_Analog_Output_Server::handle_request_message): sends a text - error message to the client if it tries to set an invalid/inactive - channel. - (vrpn_Analog_Output_Server::handle_request_channels_message): same. - also catches the case in which the number of channels to change is - negative. - (vrpn_Analog_Output_Remote::vrpn_Analog_Ouput_Remote): register - handler for "number of active channels" message. - (vrpn_Analog_Output_Remote::request_change_channels): uses a - statically declared buffer instead of one dynamically declared. - -2003-01-02 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Analog.h: - (vrpn_Analog::getNumChannels): new - (vrpn_Analog_Server::numChannels): removed - (vrpn_Analog_Server::setNumChannels): added a note about expected use. - (vrpn_Analog_Server::vrpn_Analog_Server): added a third parameter - which specifies the number of active channels. defaults to - vrpn_CHANNEL_MAX. - (vrpn_Clipping_Analog_Server::vrpn_Clipping_Analog_Server): same - - * vrpn_Analog.C: changes corresponding to the above, plus: - (vrpn_Analog::encode_to): initializes buflen correctly, to - be of size vrpn_CHANNEL_MAX+1. Also, uses sizeof(vrpn_float64) - instead of sizeof(double). - (vrpn_Analog::report): create the buffer to be of length - vrpn_CHANNEL_MAX+1. - (vrpn_Analog_Remote::handle_change_message): updates num_channel - -2002-12-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_Fastrak.h : Added return type to member function. - * vrpn_DirectXFFJoystick.h : Added newline at end of file. - -2002-12-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_Fastrak.h : Added Deepak's code to handle the fastrak - with a stylus that has a button. - * vrpn_Tracker_Fastrak.C : Same. - * vrpn_UNC_Joystick.h : Changed return type to say if got report. - * vrpn_UNC_Joystick.C : Changed server to read multiple reports from - the joystick if they are available. - -2002-12-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_TempImager.h : Removed duplicate definition. Note to self, - always try compiling after update before commit. - -2002-12-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * time_test.dsp : DSP files have been modified to not do definitions of - VRPN_NO_STREAMS and other constants directly, rather these are - now set by editing vrpn_Configure.h. Also, made projects - compile in both debug and release versions. - * vrpn.dsp : Same. - * vrpn.dsw : Removed vrpn_server_with_timecode project because you - can now build vrpn_server.exe with the proper definition in - the vrpn_Configure.h file to do this. - * vrpn_Analog.h : Added structure names to help offsite users not - have to include all of the VRPN header files when building. - * vrpn_Button.h : Same. - * vrpn_Clock.h : Same. - * vrpn_Dial.h : Same. - * vrpn_ForceDevice.h : Same. - * vrpn_Router.h : Same. - * vrpn_Text.h : Same. - * vrpn_Tracker.h : Same. - * vrpn_Analog_Output.h : White space changes. - * vrpn_Connection.C : Modified the read-with-timeout routine to try - and read all characters at once; should only be used with - a socket. Removed commented-out printfs. Whitespace changes. - * vrpn_Connecton.h : Comment change. - * vrpn_DirectXFFJoystick.C : Reordered #includes to work with the - vrpn_Configure.h file. Comment corrections. Made the - joystick opened for exclusive access even if it is only going - to be used as a joystick (was causing problems with VMD, which - also opened the joystick and then the two programs would fight - over it. - * vrpn_DirectXFFJoystick.h : Reordered #includes to work with - vrpn_Configure.h. - * vrpn_Poser.C : Removed reporting calls that were duplicates of the - vrpn_Tracker calls. Now a server that wants to report its - poses should use a vrpn_Tracker to report them and the Poser - only to set them. - * vrpn_Poser.h : Same. Whitespace changes. - * vrpn_Poser_Analog.C : Modified to work with the reduced-function - vrpn_Poser class: now opens a vrpn_Tracker as well to report - the new poses. - * vrpn_Poser_Analog.h : Same. - * vrpn_TempImager.C : Changed all member variables to begin with - "d_" rather than just "_" ("_" violates C++ rules). - * vrpn_TempImager.h : Same. - * vrpn_Types.h : Includes vrpn_Configure.h (so that it will be included - by every VRPN include file). - - -2002-11-25 <marshbur@cs.unc.edu> - - * vrpn_TempImager.C: makes the function java_vrpn_handle_region_change - a friend of class vrpn_TempImager_Region (so it can copy directly from - the value array). Also, moves the declarations of vrpn_IMAGERREGIONCB, - vrpn_IMAGERREGIONHANDLER and vrpn_IMAGERDESCRIPTIONHANDLER forward - in the file. - -2002-11-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog.C : Inlined the channels() function. - * vrpn_Analog.h : Same. - * vrpn_Connection.h : Whitespace changes. - * vrpn_Shared.C : changed variables to constants for speed. - * vrpn_TempImager.C : Major modifications to reduce the number of - copies from three down to one when going through the imager. - On the server side, there is a reformatting copy into a - buffer for VRPN, then the VRPN buffer copy. On the client - side, there is a reformatting copy right from the VRPN - buffer. Made it so that several different message types - can be sent for regions; the receiver code will do - transcoding to make it right (not yet implemented). Uses - memcpy() when it can to increase throughput. Several - functions collapsed into send_region_using_base_pointer(). - * vrpn_TempImager.h : Same. - -2002-11-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.h : Made Connection constructor public. - -2002-11-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Changes to work with Cygwin on Windows 2000. - -2002-11-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.h : Added const boolean vrpn_big_endian that tells if - the machine the program is running on is big-endian. - * vrpn_TempImager.h : Uses memcpy() on little-endian machines to - copy data, rather than vrpn_buffer() and vrpn_unbuffer(). - This switches the endian-ness from normal VRPN, but makes - the copies much faster. - * vrpn_testimager_client.C : Increased the sleep length to make the - image reads faster when both client and server are on the - same machine. - -2002-11-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added vrpn_Analog_Output.[Ch] to server build. - -2002-11-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Put back in 'endif' that was deleted by accident. - -2002-11-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Inserted changes from John Stone to make the code compile - on Mac's running OS/X. - * vrpn_Connection.C : Changed function return type in declaration - to match definition. Added things from John Stone that make - it compile on Mac's running OS/X. - * vrpn_Connection.h : Changed function declaration types to match - function definition. - * vrpn_Serial.C : Added changes by John Stone to make it compile - on Mac's running OS/X. - * vrpn_Shared.C : Same. - * vrpn_Types.h : Same. - -2002-10-27 Charalampos Fretzagias <fretzagi@cs.unc.edu> - - * vrpn_TempImager.C : The 16bit version of fill_region will no - longer use offset or scale unless they are really needed - * testimager_client.C : Added some optimizations, removed call to - glutPostRedisplay() which has some bug. It will also not - sleep when idle. - -2002-09-27 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsw : Adds testimager_client project from client_src. - -2002-09-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added to compile on ARM - * vrpn_TempImager.C : Added include needed on Linux. - -2002-09-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Magellan.h : Added 'altreset' parameter to constructor. - * vrpn_Magellan.C : Alternate reset command for older Magellans added. - -2002-09-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_TempImager.h : Only send region message to user if description gotten. - * vrpn_TempImager.C : Same. - -2002-09-19 David Borland <borland@cs.unc.edu> - - * vrpn_Tracker.C : implemented the request_workspace method in - vrpn_Tracker_Remote. - -2002-09-18 David Borland <borland@cs.unc.edu> - - * vrpn_Analog_Output.C : wasn't regestering callbacks in the sample - server. Changed this. - -2002-09-18 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog_Output.h : Comment changes, cosmetic changes. - * vrpn_Analog_Output.C : Cosmetic changes. - * vrpn_Zaber.C : Switches to using vrpn_Analog_Output (multi-channel). - * vrpn_Zaber.h : Switches to using vrpn_Analog_Output (multi-channel). - * vrpn_nikon_controls.C : Switches to using vrpn_Analog_Output. - * vrpn_nikon_controls.h : Switches to using vrpn_Analog_Output. - -2002-09-18 David Borland <borland@cs.unc.edu> - - * vrpn_Poser.C : cosmetic changes - - * vrpn_Poser_Analog.C : wasn't registering callbacks. Changed this. - -2002-09-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Serial.C (vrpn_flush_input_buffer) : Changed to return 0 or -1 - on Windows the same way it does on Unix. - -2002-09-13 David Borland <borland@cs.unc.edu> - - * vrpn_Poser.[Ch] : Changed some data member names so that if - we want to derive from a poser and a tracker, there won't be - a naming ambiguity. Made some small changes to the Poser_Server - sample class. Added print functions. - - * vrpn_Poser_Analog.[Ch] : Changed so that the Poser_Analog is now - derived from Poser, not Poser_Server. Poser_Server is only a sample - server. - -2002-09-13 David Borland <borland@cs.unc.edu> - - * vrpn_Analog_Output.[Ch] : Minor changes to the sample - vrpn_Analog_Output_Server class - -2002-09-12 David Borland <borland@cs.unc.edu> - - * vrpn_Analog_Output.[Ch] : New classes for analog devices that - write values. vrpn_Analog was getting overloaded with both - input and output functions, so these have been factored into - the old vrpn_Analog, which does analog input, and the new - vrpn_Analog_Output, which does analog output. - - * vrpn_Analog.[Ch] : took out the output functionality - - * vrpn_Poser_Analog.[Ch] : changed so that it now uses a - vrpn_Analog_Output_Remote - - * vrpn_Zaber.[Ch] : now derived from vrpn_Serial_Analog and - vrpn_Analog_Output - - * vrpn_nikon_controls.[Ch] : now derived from vrpn_Serial_Analog - and vrpn_Analog_Output - - * vrpn.dsp : added the vrpn_Analog_Output files - -2002-09-11 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_TempImager.h (getNumVals): new, returns the number of - entries in the 'vals' array. - -2002-09-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_TempImager.h : Changed a lot a debugged to make test program work. - * vrpn_TempImager.C : Same. - -2002-09-06 David Borland <borland@cs.unc.edu> - - * vrpn_Poser_Analog.[Ch] : Changed the Poser_Analog to have a - vrpn_Analog_Server member instead of a vrpn_Analog_Remote. - Therefore, the server code must open up a vrpn_Analog_Remote - connection. This seems counter-intuitive, but it is correct for - the Poser, since we are sending analog values, not receiving them. - -2002-09-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_TempImager.h : Temporary Imager class until the new cool one arrives. - Not yet tested, but compiles on PCs and SGIs. - * vrpn_TempImager.C : Same. - * vrpn.dsp : Adds vrpn_TempImager classes. - * Makefile : Adds vrpn_TempImager classes. Removed obsolete "NEW_LIB" stuff. - * vrpn_Analog.h : White space cleanup. - -2002-09-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_nikon_controls.h : Control for the focus stage of a Nikon - optical microscope. Later may include other controls as - well. This is a pretty specialized driver for the 3DFM - project at UNC. - * vrpn_nikon_controls.C : Same. - * Makefile : Includes the Nikon files in server source build. - * vrpn.dsp : Same. - -2002-08-15 David Borland <borland@cs.unc.edu> - - * vrpn_Analog.[Ch] : fixed some bugs from the last commit - - * vrpn_Poser_Analog.[Ch] : fixed some bugs from the last commit - -2002-08-15 David Borland <borland@cs.unc.edu> - - * vrpn_Analog.[Ch] : added functions for sending requests to - change a range of channels at once. - - * vrpn_Poser_Analog.[Ch] : created new vrpn_Poser_Analog class that is - used when we wish to "pose" an analog device. Still in testing - phase. - - * vrpn_Poser.[Ch] : moved some code from here to vrpn_Poser_Analog - -2002-08-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_DirectXFFJoystick.C : Changed the way the lateral force is - computed to be the slope rather than the component of the - normal vector pointing in that direction. Clip forces in - a way that preserves direction. - -2002-08-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_DirectXFFJoystick.h : Added force feedback. - * vrpn_DirectXFFJoystick.C : Added force feedback. - -2002-08-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp : Add in definition of VRPN_USE_DIRECTINPUT to enable the - compilation of force-feedback joystick code under DirectX (this - first implementation doesn't use force feedback, just reads from - the joystick). Remove this definition from VRPN and from - vrpn_server to compile without the DirectX 8.0 SDK. - * vrpn_DirectXFFJoystick.h : Driver for Force Feedback joystick. - * vrpn_DirectXFFJoystick.C : Driver for Force Feedback joystick. - -2002-08-12 David Borland <borland@cs.unc.edu> - - * vrpn_Poser.[Ch] : Incorporating an Analog Device into the Poser - class. Not finished, but want to do some tests. - -2002-08-02 David Borland <borland@cs.unc.edu> - - * vrpn_Poser.[Ch] : files for the new Poser class. A Poser - is basically the inverse of a Tracker. It takes pose requests for - a device and will (eventually) drive the device to the given pose. - Right now, we can give pose and velocity requests on the client - side and receive them on the server side. Just performing this - commit for some testing purposes. - -2002-07-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Serial.C (vrpn_drain_output_buffer) : Changed return value to - match what it was supposed to be. - -2002-07-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_UNC_Joystick.C : Changed memcpy() to normal assignment - to avoid segfault. - -2002-07-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Serial.C (vrpn_open_commport) : Sets the DTR line to be - on while the port is open. Windows XP turns this off. - The TNG3 uses this line for power, so goes dead when - opened on XP unless this is done. - * vrpn_Serial.C (read_available_characters) : The timeout was - coded incorrectly so that it waited zero time when - passed a NULL pointer to the timeout; it should wait - an infinite time in this case. Pass it a structure - with zeroes to get a zero timeout (or use the other - function of the same name). - * vrpn_Serial.C (vrpn_flush_output_buffer) : The flush and drain - routines were backwards for Windows. Flush now throws - out the characters and drain waits for them to get out - the port. - * vrpn_Serial.C (vrpn_drain_output_buffer) : The flush and drain - routines were backwards for Windows. Flush now throws - out the characters and drain waits for them to get out - the port. - * vrpn_Tng3.h : Made timeout named _timeout to show that it is - a member variable. - * vrpn_Tng3.C : Made timout named _timeout to match header. - Changed error message to say "TNG3" rather than - "Cerealbox" (cut-and-paste error). - -2002-07-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Reordered functions (for HP build). - * vrpn_Shared.h : Hack to get bools to work on old HP compiler. - -2002-07-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_FileConnection.C : Include needed for Linux. - -2002-07-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Clock.h : Cosmetic changes. - * vrpn_Connection.C : Adds hostname to error messages. - Only reports broken connection message once/second. - * vrpn_FileConnection.C : Comment changes. Only print out - error messages once per second. - * vrpn_Tracker.h : Changed array sizes to use the defined - constant meant for that purpose. - -2002-06-24 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_ForceDevice.[h,C]: constructors now take the name of - the connection as a const char* argument. - -2002-06-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Button.C : Fixing "for (int i = 0;" initialization. - -2002-05-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tng3.C : Cosmetic + fixing infinite-loop bug by turning it from - hanging waiting for characters to polling for any - available characters. - * vrpn_Tng3.h : Same. - -2002-05-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_isense.C : Code to interface to Intersense trackers - using their library. By default, it is not built (requires - proprietary library) but instead prints an error message. - * vrpn_Tracker_isense.h : Same. - * Makefile : Added Zaber and Isense drivers to the server library. - * vrpn.dsp : Added Zaber and Isense drivers to the server library. - -2002-05-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Zaber.C : Code to handle report types 20 and 255. Added code - to tell the - remote device its values upon initial connection. Code to - tell it to start off more slowly and have a smaller maximum - speed (to help with torque). Fixed timeout code so that it - will reset correctly if devices are unplugged and replugged. - * vrpn_Zaber.h : Code to tell the remote device its values upon - initial connection - -2002-05-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog.C : Added capability to send requests from an analog - remote to an analog server for it to change a channel to the - requested value. Modified the example server to respond by - setting its channels to this. This is done to enable the - Zaber linear actuator to be moved to requested positions. - * vrpn_Analog.h : Same. - * vrpn_Zaber.h : Code to control a Zaber linear actuator. - * vrpn_Zaber.C : Code to control a Zaber linear actuator. - * vrpn.dsw : Added vrpn_Zaber.[hC] to compile code for Windows. - It should work for any architecture. - -2002-04-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Dial.C (vrpn_Dial_Remote::mainloop) : Calls client_mainloop() - -2002-03-20 Aron Helser <helser@cs.unc.edu> - - * time_test.dsp : Moved here so it is next to the code it - compiles. Standardized settings, see below. - * vrpn.dsp : standardized settings, see below. - * vrpn.dsw : Changed location of many dsp files, and made - standardized settings for all Debug and Release - builds. VRPN_NO_STREAMS defined by default. All object files and - compiler-generated files go in vrpn/pc_win32 directory, in a - subdirectory that matches the source directory or executable - name. - -2002-03-18 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Button.C (read): change in Python's read method to allow - compilation on the SGI. - -2002-03-15 Aron Helser <helser@cs.unc.edu> - - * *.dsp: Added VRPN_COMPILE_DEF environment variable to - preprocessor definitions of all projects. Allows nano to define - VRPN_NO_STREAMS from the environment, as needed. - -2002-03-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Button.C (read): Sets the debounce on the Python to check - over 30 reads rather than just 3, also makes the code - general so that you change one constant and it checks - that number of readings. This is to make the foot pedal - for the 3DFM not bounce. - -2002-03-13 Aron Helser <helser@cs.unc.edu> - - * vrpn_Connection.C (setControlMsgTimeOffset): new method to - assist writing a stream file with artibrary time stamps inside. - (d_controlMsgTimeOffset): new, same. - (drop_connection): Use d_controlMsgTimeOffset - * vrpn_Spaceball.C: compiler warning fix. - -2002-02-01 David Marshburn <marshbur@cs.unc.edu> - - * vrpn.dsp: added vrpn_LamportClock.[C,h] - -2002-01-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Spaceball.C : Code to drive Spaceballs (from John Stone). - * vrpn_Spaceball.h : Code to drive Spaceballs (from John Stone). - * Makefile : Include files needed to drive Spaceballs (from John Stone). - * vrpn.dsp : Include files needed to drive Spaceballs (from John Stone). - -2002-01-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker.C : Adding vrpn_Tracker_Server (utility class for apps) - * vrpn_Tracker.h : Adding vrpn_Tracker_Server (utility class for apps) - -2002-01-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Wande.C : Changing istream messages into stdio messages - so that it can compile without the streams library. - -2002-01-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3Space.C (vrpn_Tracker_3Space::get_report) : Decodes the - orientation bytes correctly for all orientations. Fixes - a bug. This code is still too specific, it looks like it - will only work on machines with the same byte order as - PCs, and with machines that allow unaligned access. - -2002-01-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Button.C (vrpn_Button_SerialMouse::read) : Checks more - carefully for unwanted characters. More comments to - describe what is happening. - -2002-01-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_Fastrak.C (reset) : Some IS900 trackers report - a status message with only 54 bytes, rather than the 55 bytes - for a Fastrak. This code is generalized to handle both. - -2002-01-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker_Fastrak.C (get_report) : Added a call to report - the changes in IS900 analogs. The semantics of mainloop() - on the analog server had changed so that it no longer calls - report() each time through, and this change had not been - filtered into the servers that relied on it calling - report(). Since sometimes you want report(), and sometimes - you want report_changes(), and sometimes you want neither, - this is more general. - -2001-12-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Button.C (client_msg_handler) : Made the parsing of the admin - message match the encoding of it, so that filtered buttons - will respond to requests to set buttons toggle/momentary. - This fixes a bug. - -2001-12-10 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Connection.C (vrpn_Log::open): added some more diagnostic - output when this fails to open a log file. - -2001-11-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * time_test.cpp : Program to compare two ways of reading time on Windows. - * vrpn.dsw : Added project file to compile time_test application. - * vrpn_Analog.C : Modify to compile under Windows CE development environment. - * vrpn_BaseClass.C : Modify to compile under Windows CE development environment. - * vrpn_BaseClass.h : Modify to compile under Windows CE development environment. - * vrpn_Button.C : Modify to compile under Windows CE development environment. - * vrpn_Button.h : Modify to compile under Windows CE development environment. - * vrpn_Clock.C : Modify to compile under Windows CE development environment. - * vrpn_Connection.C : Modify to compile under Windows CE development environment. - * vrpn_FileConnection.C : Modify to compile under Windows CE development environment. - * vrpn_Serial.C : Modify to compile under Windows CE development environment. - * vrpn_Shared.C : Modify to compile under Windows CE development environment. - * vrpn_Shared.h : Modify to compile under Windows CE development environment. - Note that VRPN_NO_STREAMS is defined whenever Windows CE is being - used (they don't have I/O streams!) This same definition can be used - at any time to build a VRPN library that uses FILE * rather than streams. - * vrpn_Tracker.C : Modify to compile under Windows CE development environment. - * vrpn_Tracker.h : Modify to compile under Windows CE development environment. - * vrpn_embedded : Directory containing workspace and project files to build - VRPN library under Windows CE. I can't get the application to build, - but am checking this in so that it will start to track other changes. - -2001-11-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog_5dt.C (vrpn_5dt::get_report) : - Changed it to expect 10 characters per report, since - that is what they are getting in France (they are the - only group that has the glove, and they wrote the - driver, so I does what they sez. - -2001-11-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C (vrpn_TranslationTable::addRemoteEntry) : - The check put in below causes the system to fail when - reading from tracker log files. This is scary, but I'm - taking the check back out until I can debug this - properly. - -2001-11-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C (vrpn_TranslationTable::addRemoteEntry) : - Check added to see if there is already an entry in the - table. If so, error printed and returned. - -2001-10-23 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_SharedObject.C (vrpn_Shared_String::set): fixed some bad - logic here that was causing a memory bug - was comparing strings - by comparing the pointers for those strings despite the fact that - string values were being put into newly allocated arrays - -2001-09-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsw : Adds a DAQ driver server for the UNC 3D Force Microscope - * vrpn_Types.h : Comment clarification - -2001-08-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsw : Makes all libraries in Phantom server use same style - * vrpn_Connection.C (vrpn_Endpoint::send_pending_messages) : - Better handling of this check to avoid problems. - -2001-08-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsw : Added vrpn_print_devices project file - * vrpn_Connection.C (vrpn_Endpoint::send_pending_messages) : - Check for valid connection before doing anything - -2001-07-30 David Marshburn <marshbur@cs.unc.edu> - - * server_src\vrpn_phantom.dsp: changed the include directories - to ghost3.1 and ghost-stl. - -2001-07-29 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_Connection.C (vrpn_Endpoint::drop_connection) : - Fix parentheses on d_connectionCounter reference. - (vrpn_Endpoint::finish_new_connection) : Same. - - * vrpn_Connection.C (vrpn_Synchronized_Connection::mainloop) : - Partially fix logic for calling clock server/remote. - - * vrpn_Mutex.C (vrpn_Mutex_Remote::requestIndex) : Add verbose - debugging printfs. - (vrpn_Mutex_Remote::request) : Same. - (vrpn_Mutex_Remote::release) : Same. - (vrpn_Mutex_Remote::handle_initialize) : Same. - -2001-07-25 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_Log.h : New file. - * vrpn_Connection.C (vrpn_Log declaration) : Moved to new file. - - * vrpn_File_Connection.C (play_to_user_message) : Log "incoming" - messages. - (playone_to_filetime) : Same. - (read_cookie) : Log cookie. - -2001-07-03 David Marshburn <marshbur@tungsten-cs.cs.unc.edu> - - * vrpn_Shared.h, C: added vrpn_TimevalEqual - - * vrpn_SharedObject.C: - (shouldAcceptUpdate) changed the logic of shouldAcceptUpdate - in regard to timing. Changes were formerly ignored if the - timestamp of the update was <= the time of the last update. - Due to poor time resolution, the "=" part of this comparison - is a bug. Now, we only reject an update if the time of the - current and last updates are equal, and we are not the - serializer, and the update is of a local source. - (vrpn_SharedObject) made d_isSerializer initialized to vrpn_TRUE, - so shared object will by default accept changes having equal - timestamps. - (vrpn_Shared_int32::shouldAcceptUpdate) removed test of - Lamport clock, so that we only ever test the standard timevals. - The implementation of vrpn_LamportClock is incomplete. - (useLamportClock) disabled so that Lamport clocks can't be - accidentally turned on. - - Also removed a bunch of commented-out print statements. - -2001-06-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Flock_Parallel.h : Spoof Master ID directly, removed un-needed - re-registry of IDs by using inherited function to send the - tracker reports. The previous version was sending messages - with bogus ID because of recent refactoring of the Serial - Tracker classes. - * vrpn_Flock_Parallel.C : Same. - -2001-06-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Serial.C : Removed dynamic allocation of comm handles, - which was causing seg faults. - * vrpn_Tracker.C : Added check for negative sensor number in callback - handler (this happened when connected to a malfunctioning - tracker server). - -2001-06-27 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_Connection.C (vrpn_Endpoint::drop_connection): removed a hack - that had been put in to ensure that the "connection dropped" timestamp - was at least as late as the last message in the log (this had - caused problems in translating some old files but I don't remember how) - -2001-06-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3Space.C : Massive cleanup - * vrpn_3Space.h : Massive cleanup - * vrpn_Analog.C : Massive cleanup - * vrpn_Analog.h : Massive cleanup - * vrpn_Analog_5dt.C : Massive cleanup - * vrpn_Analog_Radamec_SPI.C : Massive cleanup - * vrpn_Analog_Radamec_SPI.h : Massive cleanup - * vrpn_BaseClass.h : Massive cleanup - * vrpn_Button.C : Massive cleanup - * vrpn_Button.h : Massive cleanup - * vrpn_CerealBox.C : Massive cleanup - * vrpn_CerealBox.h : Massive cleanup - * vrpn_Clock.C : Massive cleanup - * vrpn_Connection.C : Massive cleanup - * vrpn_Connection.h : Massive cleanup - * vrpn_Dial.h : Massive cleanup - * vrpn_Dyna.C : Massive cleanup - * vrpn_Dyna.h : Massive cleanup - * vrpn_Flock.C : Massive cleanup - * vrpn_Flock.h : Massive cleanup - * vrpn_Flock_Parallel.C : Massive cleanup - * vrpn_Flock_Parallel.h : Massive cleanup - * vrpn_ForceDevice.C : Massive cleanup - * vrpn_ImmersionBox.C : Massive cleanup - * vrpn_ImmersionBox.h : Massive cleanup - * vrpn_Joylin.C : Massive cleanup - * vrpn_Magellan.C : Massive cleanup - * vrpn_Mutex.C : Massive cleanup - * vrpn_Serial.C : Massive cleanup - * vrpn_Sound.C : Massive cleanup - * vrpn_Tng3.C : Massive cleanup - * vrpn_Tng3.h : Massive cleanup - * vrpn_Tracker.C : Massive cleanup - * vrpn_Tracker.h : Massive cleanup - * vrpn_Tracker_Fastrak.C : Massive cleanup - * vrpn_Tracker_Fastrak.h : Massive cleanup - * vrpn_Types.h : Massive cleanup - * vrpn_UNC_Joystick.C : Massive cleanup - * vrpn_Wanda.C : Massive cleanup - * vrpn_raw_sgibox.C : Massive cleanup - -2001-06-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Bumped minor version number - * vrpn_Shared.C : Put back Perf code, guarded by VRPN_UNSAFE_WINDOWS_CLOCK - -2001-06-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Flock.C : Modified to print an error when trying to open a Flock - that has a transmitter other than as unit 1. The code doesn't - work in this case, and it is good to tell the user what's up. - -2001-06-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.C (gettimeofday) : Modified the PC version to always use the - _ftime() call, rather than attempting to use the performance counter. - This means only 6ms accuracy on timing, but the other code was fragile - and didn't work across operating systems (98, NT, 2000). - -2001-06-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Button.h (vrpn_Button_Parallel) : Moving default parameter into - header file and out of C file - * vrpn_Button.C (vrpn_Button_Parallel) : same - -2001-06-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_3Space.C (mainloop) : Made it so that it tries to read a record - before checking for timeout (to prevent infinite resets when there - are two trackers or other devices running on same server). - * vrpn_Analog_5dt.C (mainloop) : Same - * vrpn_Analog_Radamec_SPI.C (mainloop) : Same - * vrpn_CerealBox.C (mainloop) : Same - * vrpn_Analog_.C (mainloop) : Same - * vrpn_Dyna.C (mainloop) : Same - * vrpn_Flock.C (mainloop) : Same - * vrpn_Flock_Parallel.C (mainloop) : Same - * vrpn_ImmersionBox.C (mainloop) : Same - * vrpn_Tracker_Fastrak.C (mainloop) : Same - * vrpn_Button.h : Added entry to read from the buttons on a mouse that - is treated as a serial device. - * vrpn_Button.C : Same - * vrpn_Tng3.h : Code to run a "Totally Neat Gadget", or at least its - buttons. Driver by Rob King at NRL. - * vrpn_Tng3.C : Same - * Makefile : Modified to load the Tng drivers into servers. - -2001-06-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog_5dt.h : Driver for 5DT data glove (5 fingers, roll, pitch) - * vrpn_Analog_5dt.C : Same - * vrpn_Button.h : Added Bel Elgin's changes from 3rdTech to allow the - hex specification of the parallel port address as a 4th argument. - * vrpn_Button.C : Same plus ability to set an output bit on the port to - 1 to driver power to an external button device. - * vrpn_Joylin.h : Driver for PC joysticks under Linux, written by Harald - Barth. - * vrpn_Joylin.C : Same - -2001-06-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.h (vrpn_Endpoint) : Adds d_tcp_only member, which tells - the endpoint not to try and communicate with its peer using any - other mechanism. - - * vrpn_Connection.C : Removed commented-out things left hanging around. - (vrpn_Connection) : Made parsing of "tcp:" names more robust and - made it so that an endpoint created using the "tcp:" URL is - told not to communicate except via TCP. - (header_len) : Const helper routine for the following - (vrpn_copy_machine_name) : Uses more-robust helper routine - (vrpn_get_port_number) : Same - (vrpn_copy_rsh_program) : Same - (vrpn_copy_rsh_arguments) : Same - (server_check_for_incoming_connections) : Tells the endpoint not - to open a UDP link if it was created on a server that was - connected to with a TCP connection (presumably going through - a firewall or NAT). - (finish_new_connection_setup) : Doesn't open UDP port if it is a - TCP-only endpoint. Otherwise, it does. - (connect_udp_to) : Same. - -2001-05-01 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_Mutex.C (vrpn_Mutex_Remote::requestIndex): now packs the IP - address and process id into this message - (vrpn_Mutex_Remote::handle_initialize): checks to see if the - index message is tagged with the same IP address and process id that - was included in the requestIndex message; this also handles the case - when other clients that may use an older version of the code - do not provide this unique identifier and ignores index assignments - designated for those clients - (vrpn_Mutex_Server::handle_requestIndex): now packs whatever was - in the requestIndex message from the client so it gets echoed back - and the client can figure out which index belongs to it - (presumably the client put some unique identifier into the - requestIndex message) - -2001-04-30 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_Mutex.C (handle_gotConnection) : Fix logic error to request - a new ID if one hasn't been set already. Has known failure modes - (?), but fewer than when this was incorrect. - -2001-04-30 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_Tracker_AnalogFly.C (d_reportChanges) : new member variable - recording whether we're reporting at the full update_rate or at the - rate at which changes actually happen - (shouldReport) : new function - (mainloop) : call shouldReport() - -2001-04-24 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_Mutex.hC : added a new message to let the client request - the initialization message instead of having the server - send this automatically on getting a connection - the problem - with the old method is that if the connection was opened before - creating the vrpn_Mutex_Remote then the message could be - received before the vrpn_Mutex_Remote's callback was registered - Now, when creating a vrpn_Mutex_Remote with an already- - connected vrpn_Connection, a request for initialization is sent - immediately. Otherwise, the vrpn_Mutex_Remote requests - initialization when its got_connection callback is - triggered. - * vrpn_Tracker.C : changed checks for sensor > TRACKER_MAX_SENSOR_LIST - to sensor >= TRACKER_MAX_SENSOR_LIST because a sensor index - equal to TRACKER_MAX_SENSOR_LIST is also illegal - -2001-03-25 Aron Helser <helser@cs.unc.edu> - - * vrpn_Analog.C : Tweak of message types to make them more uniform - an easy to automatically generate. Class name is first, followed - by space, followed by message type. - * vrpn_BaseClass.C : same - * vrpn_Button.C : same - * vrpn_Clock.C : same - * vrpn_Connection.C : same - * vrpn_Dial.C : same - * vrpn_FileConnection.C : same - * vrpn_FileController.C : same - * vrpn_ForceDevice.C : same - * vrpn_ForwarderController.C : same - * vrpn_Mutex.C : same - * vrpn_RedundantTransmission.C : same - * vrpn_Router.C : same - * vrpn_SharedObject.C : same - * vrpn_Sound.C : same - * vrpn_Tracker.C : same - -2001-03-25 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog.C : Removed spaces and other characters not available in - C variable names from the message type and sender descriptions - so that Aron's Perl script could be used to generate all of - these objects (or a program to print them). - * vrpn_BaseClass.C : same - * vrpn_Button.C : same - * vrpn_Clock.C : same - * vrpn_Connection.C : same - * vrpn_Dial.C : same - * vrpn_FileConnection.C : same - * vrpn_FileController.C : same - * vrpn_ForceDevice.C : same - * vrpn_ForwarderController.C : same - * vrpn_Mutex.C : same - * vrpn_RedundantTransmission.C : same - * vrpn_Router.C : same - * vrpn_SharedObject.C : same - * vrpn_Sound.C : same - * vrpn_Tracker.C : same - -2001-03-01 Aron Helser <helser@cs.unc.edu> - - * vrpn_BaseClass.h: Fixed D'Oxygen comments. - -2001-02-15 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_Connection.h (vrpn_Connection::vrpn_Connection) : change - logfile arguments for both server and client constructors. - (vrpn_Synchronized_Connection::vrpn_Synchronized_Connection) : same. - (vrpn_get_connection_by_name) : same. - (vrpn_Endpoint) : replace remote_log_name with two names, one for - incoming and one for outgoing; replace d_log with two vrpn_Logs, - add d_ convention to remote_log_mode. - (vrpn_Endpoint::setLogNames) : new function. - (vrpn_Endpoint::openLogs) : same. - * vrpn_Connection.C (vrpn_Connection::vrpn_Connection) : handle - changed method of log specification. - (vrpn_Synchronized_Connection::vrpn_Synchronized_Connection) : pass - changed arguments to Connection constructor. - (vrpn_get_connection_by_nbame) : same. - (vrpn_Endpoint::vrpn_Endpoint) : initialize both log names. - (vrpn_Endpoint::init) : create both logs. - (vrpn_Endpoint::pack_log_description) : pass both log names. - (vrpn_Endpoint::handle_log_message) : unpack both log names. - * vrpn_FileConnection.h (vrpn_File_Connection::vrpn_File_Connection) : - change logfile arguments for constructor. - * vrpn_FileConnection.C (vrpn_File_Connection::vrpn_File_Connection) : - same. - -2001-02-12 Russell M. Taylor II <taylorr@cs.unc.edu> - * vrpn_shared.C : vrpn_unbuffer ( ) {All of them} Modified to handle - conversions from unaligned buffers. This was causing problems with - the code being used to read from serial buffers in tracker drivers. - I give up on trying to save the extra copy. - -2001-02-09 Kwan Torrich Skinner <skinner@cs.unc.edu> - * vrpn.dsp : removes references to vrpn_DelayedConnection.[C,h] - -2001-02-07 Kwan Torrich Skinner <skinner@cs.unc.edu> - * vrpn_Connection.C : increased minor version number. - * Changelog : fixed Tom's (and my own) dates to be 2001 and not y2k. - -2001-02-05 Tom Hudson <hudson@cs.unc.edu> - - (vrpn_Connection::server_check_for_incoming_connections) : - Change one type to compile on the PC - -2001-02-05 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_Connection.h: add vrpn_Connection::listen_tcp_sock - vrpn_Connection.C - (open_tcp_socket) : Add portno argument just like open_udp_socket; - default to NULL - (vrpn_Endpoint::connect_tcp_to) : Refactor into two functions - (vrpn_Connection::server_check_for_incoming_connections) : - Add check for TCP connections - (vrpn_Connection server constructor) : Add initialization, - opening, and listen() call for tcp socket - (vrpn_Connection client constructor) : Check for "tcp:" - station name; if found, initiate a TCP connection instead - of sending UDP message asking the server to initiate on - -2001-01-07 Kwan Torrich Skinner <skinner@cs.unc.edu> - - * vrpn_MTd.dsp: added vrpn_RedundantTransmission to the project - file so topo will compile. - -2000-12-6 Tom Hudson <hudson@cs.unc.edu> - - * Makefile: remove vrpn_DelayedConnection.C, vrpn_DelayedConnection.h - - * vrpn_RedundantTransmission.C - (vrpn_RedundantTransmission::mainloop) : rewrite deletion routine - so it doesn't occasionally crash for no apparent reason on PCs - - (vrpn_RedundantTransmission::pack_message) : add new parameter; - handle special cases and boundary conditions better - * vrpn_Tracker.C (vrpn_Tracker_NULL::mainloop) : pass new parameter - to vrpn_RedundantTransmission::pack_message - - (vrpn_RedundantTransmission) : new data member d_isEnabled - (vrpn_RedundantTransmission::isEnabled) : new function - (vrpn_RedundantTransmission::enable) : same - (vrpn_RedundantController_Protocol::encode_enable) : same - (vrpn_RedundantController_Protocol::decode_enable) : same - (vrpn_RedundantController::handle_enable) : same - (vrpn_RedundantRemote::enable) : same - (vrpn_RedundantController constructor) : add handler registration - - (vrpn_RedundantReceiver) : new class - -2000-11-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Flock_Parallel.C (mainloop) : Made the code close and then - reopen the serial ports (like it used to do before I turned - it off because of a buggy Linux kernel). - -2000-11-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Shared.C (gettimeofday) : Turned off hi-perf clock for Win98 - (vrpn_AdjustFrequency) : Removed buggy clock-check code - -2000-11-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_FileConnection.C : Fixed parsing of file://. - * vrpn_Connection.C : Removed more of the WINDOWS_GETHOSTBYNAME hack - -2000-11-01 Aron Helser <helser@cs.unc.edu> - - * vrpn_Connection.Ch (vrpn_Log::close): calls saveLogSoFar then - closes file. - (vrpn_Log::saveLogSoFar): Incremental save of log file whenever - called. - (vrpn_Connection::save_log_so_far): calls vrpn_Log::saveLogSoFar - on all open endpoints. - -2000-10-20 Aron Helser <helser@cs.unc.edu> - - * vrpn_Connection.C (connect_tcp_to): Don't call gethostbyname if - machine name provided is an IP number. - (vrpn_connect_udp_port): same - (connect_tcp_to): same - (connect_udp_to): comment out, replaced with call to - vrpn_connect_udp_port - - * vrpn_Mutex.C (getmyIP): Don't call gethostbyname if machine name - provided is an IP number. Fixes byte-order problem with return - value on win32. - - * vrpn_BaseClass.C (~vrpn_TextPrinter): Fix compiler warnings. - -2000-10-18 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Serial.C (vrpn_drain_output_buffer) : - Called drain function, rather than flush. - -2000-10-18 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_Connection.C (vrpn_Connection) : add data members - d_endpointAllocator, d_updateEndpoint - (vrpn_Connection client constructor) : add endpoint allocator - as extra argument, call (*d_endpointAllocator) & set d_updateEndpoint - instead of calling allocateEndpoint() - (vrpn_Connection server constructor) : same - (vrpn_Synchronized_Connection client constructor) : add endpoint - allocator as extra argument - (vrpn_Synchronized_Connection server constructor) : same - (vrpn_Connection::updateEndpoints) : new function - (vrpn_Connection::allocateEndpoint) : change from virtual to static - (vrpn_Connection::connect_to_client) : replace call to - allocateEndpoint() with (*d_endpointAllocator), set d_updateEndpoint - (vrpn_Connection::server_check_for_incoming_connections) : same - (vrpn_Connection::mainloop) : call updateEndpoints() if - d_updateEndpoint is true - (vrpn_Endpoint::dispatch) : make virtual - - * vrpn_DelayedConnection.C (vrpn_DelayedEndpoint) : new data - members d_delayListEnd, d_delayAllTypes, d_typeIsDelayed - (vrpn_DelayedConnection) : new data members d_delayAllTypes, - d_typeIsDelayed - (vrpn_DelayedEndpoint constructor) : remove timeval parameter, - initialize d_typeIsDelayed - (vrpn_DelayedEndpoint::delayAllTypes) : new function - (vrpn_DelayedEndpoint::delayType) : same - (vrpn_DelayedEndpoint::enqueue) : same - (vrpn_DelayedEndpoint::updateEndpoints) : same - (vrpn_DelayedEndpoint::dispatch) : don't delay system messages; - TCP/UDP connections will timeout otherwise - (vrpn_DelayedConnection constructor) : initialize d_typeIsDelayed - (vrpn_DelayedConnection::delayAllTypes) : new function - (vrpn_DelayedConnection::delayType) : same - (vrpn_RelativeDelayEndpoint) : new class - (vrpn_RelativeDelayConnection) : new class - - * vrpn_RedundantTransmission.C - (vrpn_RedundantTransmission::mainloop) : detect & clean-up after - error states - -2000-10-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C : Deleted commented-out code. - -2000-10-16 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_RedundantTransmission.C (defaultInterval) : new function - (defaultRetransmissions) : same - -2000-10-11 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_Connection.C (vrpn_TranslationTable::addRemoteEntry) : - add details to error output - - * vrpn_Tracker.C (vrpn_Tracker_NULL::mainloop) : add support for - vrpn_RedundantTransmission - (vrpn_Tracker_NULL::setRedundantTransmission) : new function - * vrpn_RedundantTransmission.h : new file - * vrpn_RedundantTransmission.C : new file - -2000-10-10 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_FileConnection.hC (vrpn_File_Connection::get_filename) : - new function that lets you easily find out what the name of the - file was that vrpn opened (you could also do this using - vrpn_copy_file_name with the name passed in originally) - -2000-10-09 Aron Helser <helser@cs.unc.edu> - - * vrpn_Connection.C (server_check_for_incoming_connections): A - server used to get NIC for tcp connection from information in the - UDP message sent by the client. Instead, use the NIC the UDP - message came in on, ignoring NIC information in the UDP - message. Allows us to handle multiple NICs more gracefully, - because client can't easily discover the right NIC to put in the - message. - Other comment and verbose printout changes. - -2000-10-08 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_FileConnection.C (vrpn_File_Connection::vrpn_File_Connection): - sets d_start_time to be the first time after playing to the first - user message to avoid problems with log files that have system - messages with messed up timestamps - -2000-10-05 Sang-Uok Kum <kumsu@cs.unc.edu> - - * vrpn_Shared.h: Fixed a mistake which made it not work in VC++. - sleep is still not defined in VC++. - -2000-10-04 Sang-Uok Kum <kumsu@cs.unc.edu> - - * vrpn_Button.C : Include files and #ifdefs changed so in cygwin v1.1 - it always uses unix sockets instead of window sockets. (The vrpn library - compiled but gave run time errors.) This was only tested for vrpn - client. - * vrpn_Clock.C : same - * vrpn_Connection.C : same - * vrpn_FileConnection.C : same - * vrpn_FileController.C : same - * vrpn_ForwarderController.C : same - * vrpn_Serial.C : same - * vrpn_Shared.C : same - * vrpn_Shared.h : same - -2000-10-02 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_SharedObject.h : Uncommented initial #include of - vrpn_Shared.h, which is necessary for compiling under - Cygwin 1.1; code still compiles under VC++ and Cygwin 1.0 - -2000-10-02 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_Shared.C (vrpn_buffer, vrpn_unbuffer) : added these functions - for vrpn_int16 and vrpn_uint16 - also, had to remove the one for - vrpn_bool because a vrpn_bool is a vrpn_int16 - -2000-09-26 Tom Hudson <hudson@cs.unc.edu> - - * Makefile : now that we're using makedepend, got rid of rebuild - of entire library whenever any header file changed. - - * vrpn_DelayedConnection.C - (vrpn_DelayedEndpoint::send_pending_reports) : implemented - (vrpn_DelayedEndpoint::dispatch) : same - (vrpn_DelayedEndpoint::dispatchPending) : same - (vrpn_DelayedEndpoint::setDelay) : new function - (vrpn_DelayedEndpoint::deletePending) : same - (vrpn_DelayedConnection::setDelay) : same - -2000-09-25 Tom Hudson <hudson@cs.unc.edu> - - * connection : new directory, to be populated later today - - * vrpn_Connection.C (vrpn_Endpoint::dispatch) : new function - (vrpn_Connection::allocateEndpoint) : new function - (vrpn_Endpoint::getOneTCPMessage) : call dispatch() - (vrpn_Endpoint::getOneUDPMessage) : same - (vrpn_Connection::connectToClient) : call allocateEndpoint() - (vrpn_Connection::server_check_for_incoming_connections) : same - (vrpn_Connection::server constuctor) : same - (vrpn_Connection::client constuctor) : same - - * vrpn_DelayedConnection.C : new file - -2000-09-22 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_Connection.C (vrpn_Log::lastLogTime) : new function to - return the last timestamp for a logged message - * vrpn_Connection.C (vrpn_Endpoint::drop_connection) : Since we - read the actual time here to log dropped connection message, this - was setting back the time for programs that used the logging - mechanism for translation of old data into new log files. Now, in the - case of logging and when the current time is less than the last log - time, this function records the dropped_connection message with - the previous log time instead - * vrpn_Connection.C (vrpn_Synchronized_Connection::client constructor): - this function now calls pack_sender_description for vrpn_CONTROL and - pack_type_description for vrpn_got_connection, vrpn_dropped_connection, - vrpn_got_first_connection, vrpn_dropped_last_connection so that they - will get put into a log file even if the endpoint is not connected - (needed for translation) - (At least I think this is why they aren't - getting put into the log file) - -2000-09-21 Tom Hudson <hudson@cs.unc.edu> - - (vrpn_SharedObject::handle_gotConnection) : small fix for - non-serialized use - -2000-09-18 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_SharedObject.C: - (class vrpn_SharedObject) - d_isNegotiatingSerializer : new data member - (vrpn_SharedObject::becomeSerializer) : test & set - d_isNegotiatingSerializer - (vrpn_SharedObject::handle_requestSerializer) : same - (vrpn_SharedObject::handle_grantSerializer) : clear - d_isNegotiatingSerializer - (vrpn_SharedObject::handle_assumeSerializer) : same - (vrpn_SharedObject::postBindConnection) : check for NULL connection, - moved code from serverPostBindConnection - (vrpn_SharedObject::serverPostBindConnection) : same - (vrpn_SharedObject::handle_gotConnection) : generalized, - renamed from handle_gotConnectionToRemote - - -2000-09-17 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_SharedObject.C: - (class vrpn_SharedObject) - d_serverId, d_remoteId, d_peerId, d_update_type, d_lamportUpdate_type : - new data members - d_updateFromServer_type, d_updateFromRemote_type, d_myUpdate_type, - d_updateFromServerLamport_type, d_updateFromRemoteLamport_type : - remove - (vrpn_SharedObject::postBindCleanup) : new function - (vrpn_SharedObject::serverPostBindCleanup) : same - (vrpn_SharedObject::remotePostBindCleanup) : same - (vrpn_SharedObject::sendUpdate) : same - (vrpn_SharedObject::handleUpdate) : same - (vrpn_SharedObject::handle_gotConnectionToRemote) : same - (vrpn_SharedObject::handle_update) : same - (vrpn_SharedObject::becomeSerializer) : simplify - (vrpn_SharedObject::handle_requestSerializer) : simplify - (vrpn_SharedObject::handle_grantSerializer) : simplify - (vrpn_SharedObject::handle_assumeSerializer) : simplify - (vrpn_Shared_int32::sendUpdate) : remove first parameter - (vrpn_Shared_float64::sendUpdate) : same - (vrpn_Shared_String::sendUpdate) : same - (vrpn_Shared_int32::handleUpdate) : new function - (vrpn_Shared_float64::handleUpdate) : same - (vrpn_Shared_String::handleUpdate) : same - -2000-09-15 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_LamportClock.h : changed <> on include to "" - -2000-09-12 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_BaseClass.h : made some of the comments 80-column correct - so I could read them. - - * vrpn_SharedObject.h: (becomeSerializer) : new function - d_requestSerializer_type, d_grantSerializer_type, - d_assumeSerializer_type : new data members - d_queueSets : new data member (probably unnecessary) - d_becomeSerializer_type : removed old data member - (handle_requestSerializer) : new function - (handle_grantSerializer) : renamed from handle_becomeSerializer - (handle_assumeSerializer) : new function - (vrpn_SerializerPolicy) : renamed vrpn_DENY to vrpn_DENY_REMOTE, - added vrpn_DENY_LOCAL - - * vrpn_SharedObject.C: (vrpn_SharedObject constructor) : - default values for new data members, d_lClock. - (vrpn_SharedObject::becomeSerializer) : new function - (vrpn_SharedObject::handle_requestSerializer) : new function - (vrpn_SharedObject::handle_grantSerializer) : - renamed from handle_becomeSerializer - (vrpn_SharedObject::handle_assumeSerializer) : new function - (vrpn_Shared_int32_Server::bindConnection) : added registration - of handler for requestSerializer - (vrpn_Shared_float64_Server::bindConnection) : added registration - of handler for requestSerializer - (vrpn_Shared_String_Server::bindConnection) : added registration - of handler for requestSerializer - (vrpn_Shared_int32::shouldAcceptUpdate) : added handling for - vrpn_DENY_LOCAL - (vrpn_Shared_float64::shouldAcceptUpdate) : same - (vrpn_Shared_String::shouldAcceptUpdate) : same - - -2000-09-11 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_FileConnection.C (vrpn_File_Connection::reset) : - Added call to d_endpoints[0]->drop_connection() to clear all state for - replaying the file from the beginning. - * vrpn_FileConnection.C (vrpn_File_Connection::mainloop) : - returns -1 if there is an error reading from the file - -2000-09-11 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_Mutex.C (vrpn_Mutex_Server::~vrpn_Mutex_Server) : added - unregister messages to correspond to register messages in the - constructor (should be fixed using vrpn_BaseClass later) - * vrpn_Mutex.C (vrpn_Mutex_Remote::~vrpn_Mutex_Remote) : added - unregister messages to correspond to register messages in the - constructor (should be fixed using vrpn_BaseClass later) - * vrpn_FileConnection.C (vrpn_File_Connection::constructor) : - took out code that set the first message to the first - user message because when we later get a message that clears - the translation table there is no way to rewind and rebuild - the translation table because the initial system messages - don't get replayed (left in the part that actually skips to the - first user message though because this is apparently useful in - order to avoid timing problems) - * vrpn_FileConnection.C (vrpn_File_Connection::reset) : - added code from constructor to skip to the first user message - -2000-09-07 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_Connection.C (vrpn_TranslationTable::clear) : changed this - to do delete [] instead of delete on d_entry[i].name since a - cName (its type) is a typedef for an array - -2000-09-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Magellan.C (vrpn_write_slowly) : Added parameter for how long - wait. - (get_report) : Returns 1 if a full report found - (mainloop): Retries reading when a full report is found - so that the buffer is cleared of all reports - - * vrpn_Router.C : #include string.h to compile on Linux - -2000-09-01 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_Connection.h (check_vrpn_file_cookie) : Now this will work - if the version is >= 4.0 and <= the current version - -2000-09-01 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_Connection.h (check_vrpn_file_cookie) : This only worked if - the version was 4.0, now it works if the version is the current one - or less - -2000-08-31 Tom Hudson <hudson@cs.unc.edu> - - * vrpn_Connection.C (vrpn_TranslationTable): Removed a lot of - #if 1/#if 0 clauses that have become set. - * vrpn_Connection.C (vrpn_TranslationTable::addLocalID): Added - a guard to strcmp to make sure we weren't comparing against NULL. - -2000-08-28 Adam Seeger <seeger@cs.unc.edu> - - * vrpn_Router.[hC] (vrpn_Router, ~vrpn_Router) : Made it so that - the big arrays in this class get dynamically allocated instead - of statically allocated so we don't have to use the huge_objects - flag with Visual C++ - -2000-08-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added Brown patches to compile under AIX. - Cleaned up RANLIB and some dependencies. - - * vrpn_Shared.h : Added INVALID_SOCKET defs for Win32. - - * vrpn_Types.h : Added AIX definitions. - -2000-08-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Wanda.h : New file - * vrpn_Wanda.C : New file - * Makefile : Add Wanda to server library - -2000-08-27 Jeffrey Juliano <juliano@cs.unc.edu> - - * .cvsignore: Add sgi_irix.n32.mips3 to ignore list. - -2000-08-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_BaseClass.C (~vrpn_TextPrinter) : Hack to remove segfaults - * vrpn_Router.C : New file - * vrpn_Router.h : New file - * Makefile : Added vrpn_Router compilation - -2000-08-22 Kwan Skinner <skinner@cs.unc.edu> - - * vrpn_Connection.C (check_vrpn_file_cookie) : New function - * vrpn_Connection.h (check_vrpn_file_cookie) : New function - * vrpn_FileConnection.C (read_cookie) : Now calls check_vrpn_file_cookie - -2000-08-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Connection.C (connect_to_client) : Bug fix - Remove parameter that is now obsolete. - -2000-08-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Mutex.C (vrpn_Mutex_Remote) : Type cast - -2000-08-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog_Radamec.C (int_to_pan) : Fix negative rotations - -2000-08-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog_Radamec.C (send_command) : Removed slow writes - (int_to_pan) : Conversion fixed - (reset) : Chopped out large parts that didn't work but should - (get_report) : Set to ignore commands in case they are sent - - * vrpn_Tracker_AnalogFly.h : Added "absolute" and offset - * vrpn_Tracker_AnalogFly.C : Added "absolute" and offset - -2000-08-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Analog_Radamec_SPI.C : Changed some warnings into errors - (mainloop) : Added a watchdog timer - - * vrpn_Connection.C (vrpn_Log::setCompoundName): added 'const' - - * vrpn_Serial.C (vrpn_open_commport): Adds input baud to SGI code - - * vrpn_Tracker_Fastrak.C (get_report): Flushes buffer when resynching - - * vrpn_ImmersionBox.h : New file - - * vrpn_ImmersionBox.C : New file - -2000-08-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.dsp: Adds a driver for the Radamec Serial Position Interface - (Camera tracker) - - * vrpn.dsw: same - * vrpn_Analog_Radamec_SPI.h: same - * vrpn_Analog_Radamec_SPI.C: same - - * vrpn_Serial.h (vrpn_open_commport): Adds bit length and parity to - the optional parameters to the serial-port open. - - * vrpn_Serial.C (vrpn_open_commport): same - * vrpn_Analog.C (vrpn_Serial_Analog::vrpn_Serial_Analog): same - * vrpn_Analog.h (vrpn_Serial_Analog::vrpn_Serial_Analog): same - - * vrpn_Tracker.C: Modified the packing code to use vrpn_buffer() - and vrpn_unbufer(). Removed the redundant change handlers for all - sensors, by replacing them with ones that have optional parameters. - - * vrpn_Tracker.h: same - - * vrpn_AnalogFly.C (vrpn_AnalogFly::vrpn_AnalogFly): Sets the reset - button to NULL by default so that the code won't blow up if you don't - have one. diff --git a/src/vrpn/DashboardBuildInitialCache.cmake.in b/src/vrpn/DashboardBuildInitialCache.cmake.in deleted file mode 100644 index 70e63ac51df05474cc6ac388cf3e4c1483e8dcc8..0000000000000000000000000000000000000000 --- a/src/vrpn/DashboardBuildInitialCache.cmake.in +++ /dev/null @@ -1,22 +0,0 @@ -# Project configuration settings -set(VRPN_USE_PHANTOM_SERVER "@VRPN_USE_PHANTOM_SERVER@" CACHE BOOL "") -set(VRPN_INCLUDE_TIMECODE_SERVER "@VRPN_INCLUDE_TIMECODE_SERVER@" CACHE BOOL "") -set(VRPN_INCLUDE_INTERSENSE "@VRPN_INCLUDE_INTERSENSE@" CACHE BOOL "") -set(VRPN_USE_NATIONAL_INSTRUMENTS "@VRPN_USE_NATIONAL_INSTRUMENTS@" CACHE BOOL "") -set(VRPN_USE_NATIONAL_INSTRUMENTS_MX "@VRPN_USE_NATIONAL_INSTRUMENTS_MX@" CACHE BOOL "") -set(VRPN_USE_NIDAQ "@VRPN_USE_NIDAQ@" CACHE BOOL "") -set(VRPN_USE_USDIGITAL "@VRPN_USE_USDIGITAL@" CACHE BOOL "") -set(VRPN_USE_MICROSCRIBE "@VRPN_USE_MICROSCRIBE@" CACHE BOOL "") -set(VRPN_INCLUDE_PHASESPACE "@VRPN_INCLUDE_PHASESPACE@" CACHE BOOL "") -set(VRPN_USE_MOTIONNODE "@VRPN_USE_MOTIONNODE@" CACHE BOOL "") -set(VRPN_USE_WIIUSE "@VRPN_USE_WIIUSE@" CACHE BOOL "") -set(VRPN_USE_FREESPACE "@VRPN_USE_FREESPACE@" CACHE BOOL "") -set(VRPN_USE_DIRECTINPUT "@VRPN_USE_DIRECTINPUT@" CACHE BOOL "") -set(VRPN_USE_DIRECTSHOW "@VRPN_USE_DIRECTSHOW@" CACHE BOOL "") -set(VRPN_USE_SHARED_LIBRARY "@VRPN_USE_SHARED_LIBRARY@" CACHE BOOL "") -set(VRPN_USE_GPM_MOUSE "@VRPN_USE_GPM_MOUSE@" CACHE BOOL "") - -set(VRPN_GPL_SERVER "@VRPN_GPL_SERVER@" CACHE BOOL "") - -# Root directories to search for dependencies -set(WIIUSE22_ROOT_DIR "@WIIUSE_ROOT_DIR@" CACHE PATH "") diff --git a/src/vrpn/Format b/src/vrpn/Format deleted file mode 100644 index 60fa3f5014b3510e3cce8d549f55f3ffea8cf622..0000000000000000000000000000000000000000 --- a/src/vrpn/Format +++ /dev/null @@ -1,144 +0,0 @@ - -/* - * - * VRPN Header Format - * - * +------------+------------+------------+------------+ - * | Total Length | - * +------------+------------+------------+------------+ - * | Timestamp (Seconds) | - * +------------+------------+------------+------------+ - * | Timestamp (Microseconds) | - * +------------+------------+------------+------------+ - * | Sender | - * +------------+------------+------------+------------+ - * | Type | - * +------------+------------+------------+------------+ - * | padding | - * +------------+------------+------------+------------+ - * - * Total Length = Padded Payload Length + Padded Header Length. - * Padded Header Length = 24 bytes. - * Padded Payload Length = Payload Length + (Payload Length % 8). - * - * All header fields are 32-bit integers sent in network order. - * Both header and payload are padded to end on 8-byte boundaries. - * - * Implementation in vrpn_Connection::marshall_message(). - * - */ - -/* - * - * VRPN Connection setup sequence - * - * Server opens a TCP socket and listens() on port - default vrpn_DEFAULT_LISTEN_PORT_NO - * Client connects() to port - * Server and client both write a COOKIE - * Server and client both wait (nonblocking) for a COOKIE and - * verify version #, etc. - * If either peer is requesting remote logging, a log_description message - * is sent. - * Server and client both open UDP sockets. - * Server and client both send udp_description messages. - * Server and client both send sender_description messages for all senders - * registered locally. - * Server and client both send type_description messages for all types - * registered locally. - * - * Implementation in vrpn_Connection::setup_new_connection(), - * finish_new_connection_setup(), - */ - -/* - * VRPN Cookie Format - * - * +------------+------------+------------+------------+ - * + 'v' | 'r' | 'p' | 'n' + - * +------------+------------+------------+------------+ - * + ':' | ' ' | 'v' | 'e' + - * +------------+------------+------------+------------+ - * + 'r' | '.' | ' ' | X + - * +------------+------------+------------+------------+ - * + X | '.' | Y | Y + - * +------------+------------+------------+------------+ - * + ' ' | ' ' | L | padding | - * +------------+------------+------------+------------+ - * + padding | - * +------------+------------+------------+------------+ - * - * XX = major version number (2 ASCII characters) - * YY = minor version number (2 ASCII characters) - * L = remote log mode requested (ASCII '0', '1', '2', or '3') - * - * This cookie is in ASCII so that humans scanning a dump can - * quickly determine whether or not it is a VRPN session. - */ - -/* - * VRPN Log description message: - * - * type = vrpn_CONNECTION_LOG_DESCRIPTION (-4) - * sender = logging mode (0, 1, 2, or 3) - * payload length = strlen(logfile name) + 1 - * data = null-terminated ASCII string giving pathname of file to log to - */ - -/* - * VRPN UDP description message: - * - * type = vrpn_CONNECTION_UDP_DESCRIPTION (-3) - * sender = UDP port number to contact - * payload length = strlen(IP address) + 1 - * data = ASCII string containing host's IP address - */ - -/* - * VRPN Sender description message: - * - * type = vrpn_CONNECTION_SENDER_DESCRIPTION (-1) - * sender = ID of sender - * payload length = 5 + strlen(sender name) - * data = - * - * +------------+------------+------------+------------+ - * + length of sender name + 1 | - * +------------+------------+------------+------------+ - * + sender name | - * +------------+------------+------------+------------+ - * + ... | - * +------------+------------+------------+------------+ - * - * N.B. There is redundant length data here - */ - -/* - * VRPN Type description message: - * - * type = vrpn_CONNECTION_TYPE_DESCRIPTION (-2) - * sender = ID of type - * payload length = 5 + strlen(sender name) - * data = - * - * +------------+------------+------------+------------+ - * + length of type name + 1 | - * +------------+------------+------------+------------+ - * + type name | - * +------------+------------+------------+------------+ - * + ... | - * +------------+------------+------------+------------+ - * - * N.B. There is redundant length data here - */ - -/* - * VRPN disconnect message: - * - * type = vrpn_CONNECTION_DISCONNECT_MESSAGE (-5) - * sender = 0 - * payload length = 0 - * - * This message is never sent over the wire; it is written into logs - * to mark the point at which a connection was broken. - */ - diff --git a/src/vrpn/Makefile b/src/vrpn/Makefile deleted file mode 100644 index aae28095f800f0b07e5827cf353234aa4e760cd5..0000000000000000000000000000000000000000 --- a/src/vrpn/Makefile +++ /dev/null @@ -1,1008 +0,0 @@ -############################################################################# -# Makefile for VRPN libraries. Needs to be built using 'gmake'. -# Should run on any architecture that is currently supported. It should -# be possible to build simultaneously on multiple architectures. -# -# On the sgi, both g++ and CC versions are built by default. -# -# Author: Russ Taylor, 10/2/1997 -# -# modified: -# * Andrew Roth June 16/2012 -# * Updates for MacOSX builds for 32/64, 64 bit and Xcode 4.3 -# * Jeff Juliano, 10/99 -# * added "make depend" (see comments at end of this makefile) -# * changed to use RM, RMF, MV, and MVF -# these are overridable as follows: -# gmake RM=/mybin/rm, or gmake RMF="/bin/rm -option" -# * Jeff Juliano, 9/1999 -# support for parallel make (see WARNING below) -# * Tom Hudson, 25 Jun 1998 -# Support for n32 ABI on sgi. (gmake n32) -# * Hans Weber, ??? -# Support for both g++ and native compilers on sgi. -# * Tom Hudson, 13 Feb 1998 -# Build two different libraries: client (libvrpn) and server -# (libvrpnserver). Our solution is to compile twice, once with the -# flag -DVRPN_CLIENT_ONLY and once without. Any server-specific code -# (vrpn_3Space, vrpn_Tracker_Fastrak, vrpn_Flock) should ONLY be -# compiled into the server library! -############################################################################# - -########################## -# common definitions. For non-UNC sites, uncomment one of the lines -# that defines hw_os for the machine you are on in the section just -# below. Then, the code should compile in your environment. -# -#HW_OS := sgi_irix -#HW_OS := pc_linux -HW_OS := pc_linux64 -#HW_OS := pc_linux_ia64 -# Try this to cross-compile on a Linux PC for an ARM embedded controller. -#HW_OS := pc_linux_arm -# Try this to cross-compile on a Cygwin PC for an ARM embedded controller. -#HW_OS := pc_cygwin_arm -#HW_OS := pc_cygwin -#HW_OS := pc_FreeBSD -#HW_OS := sparc_solaris -#HW_OS := sparc_solaris_64 -#HW_OS := powerpc_aix -#HW_OS := powerpc_macosx -#HW_OS := universal_macosx -#HW_OS := macosx_32_64 -#HW_OS := macosx_64 -########################## - -########################## -# Mac OS X-specific options. If HW_OS is powerpc_macosx or universal_macosx, -# uncomment one line below to choose the minimum targeted OS X version and -# corresponding SDK. If none of the lines below is commented out, 10.5 will -# be the minimum version. 10.7/4.3 removes ppc support. In Xcode 4.3 - you -# must now manually install command line tools from: -# Xcode menu > Preferences > Downloads. -########################## -#MAC_OS_MIN_VERSION := 10.4 -#MAC_OS_MIN_VERSION := 10.5 -#MAC_OS_MIN_VERSION := 10.6 -#MAC_OS_MIN_VERSION := 10.7 -#MAC_OS_MIN_VERSION := 10.8 - -INSTALL_DIR := /usr/local -BIN_DIR := $(INSTALL_DIR)/bin -INCLUDE_DIR := $(INSTALL_DIR)/include -LIB_DIR := $(INSTALL_DIR)/lib - -MV = /bin/mv -MVF = $(MV) -f - -RM = /bin/rm -RMF = $(RM) -f - -ifndef HW_OS - # hw_os does not exist on FreeBSD at UNC or on CYGWIN - UNAME := $(shell uname -s) - ifeq ($(UNAME), FreeBSD) - HW_OS := pc_FreeBSD - else - # pc_cygwin doesn't have HW_OS - ifeq ($(UNAME), CYGWIN_NT-4.0) - HW_OS := pc_cygwin - # On cygwin make is gmake (and gmake doesn't exist) - MAKE := make -f $(MAKEFILE) - else - ifeq ($(UNAME), CYGWIN_98-4.10) - HW_OS := pc_cygwin - MAKE := make -f $(MAKEFILE) - else - ifeq ($(UNAME), CYGWIN_NT-5.0) - HW_OS := pc_cygwin - MAKE := make -f $(MAKEFILE) - else - HW_OS := $(shell hw_os) - endif - endif - endif - endif -endif - -# check if its for pxfl -ifdef PBASE_ROOT - HW_OS := hp_flow - ifeq ($(PXFL_COMPILER), aCC) - HW_OS = hp_flow_aCC - endif -endif - -ifndef HW_OS - exit -endif - -# Which C++ compiler to use. Default is g++, but some don't use this. -# -# IF YOU CHANGE THESE, document either here or in the header comment -# why. Multiple contradictory changes have been made recently. - - -CC := g++ -AR := ar ruv -# need default 'ranlib' to be touch for platforms that don't use it, -# otherwise make fails. -RANLIB := touch - -ifeq ($(FORCE_GPP),1) - CC := g++ -else - - ifeq ($(HW_OS),sparc_solaris) - CC := /opt/SUNWspro/bin/CC - AR := /opt/SUNWspro/bin/CC -xar -o - endif - - ifeq ($(HW_OS),sparc_solaris_64) - CC := /opt/SUNWspro/bin/CC -xarch=v9a - AR := /opt/SUNWspro/bin/CC -xarch=v9a -xar -o - endif - - ifeq ($(HW_OS),powerpc_aix) - CC := /usr/ibmcxx/bin/xlC_r -g -qarch=pwr3 -w - RANLIB := ranlib - endif - - ifeq ($(HW_OS), pc_linux64) - CC := cc -m64 -fPIC - RANLIB := ranlib - endif - - ifeq ($(HW_OS), pc_linux) - CC := gcc - RANLIB := ranlib - endif - - ifeq ($(HW_OS), pc_linux_ia64) - CC := gcc - RANLIB := ranlib - endif - - ifneq (,$(findstring macosx,$(HW_OS))) - ifndef MAC_OS_MIN_VERSION - MAC_OS_MIN_VERSION := 10.5 - endif - - # Select which compiler and MAC OS X SDK to use - MAC_GCC := g++ - ifeq ($(MAC_OS_MIN_VERSION), 10.8) - MAC_OS_SDK := MacOSX10.8.sdk - else - ifeq ($(MAC_OS_MIN_VERSION), 10.7) - MAC_OS_SDK := MacOSX10.7.sdk - else - ifeq ($(MAC_OS_MIN_VERSION), 10.6) - MAC_OS_SDK := MacOSX10.6.sdk - else - ifeq ($(MAC_OS_MIN_VERSION), 10.5) - MAC_OS_SDK := MacOSX10.5.sdk - else - MAC_OS_SDK := MacOSX10.4u.sdk - MAC_GCC := g++-4.0 - endif - endif - endif - endif -endif - - ifneq (,$(findstring macosx,$(HW_OS))) - ifeq ($(wildcard /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK)),/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK)) - PATH_TO_DEV := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK) -$(info ---> Xcode 4.3+: Platform SDK found. Setting dev path to $(PATH_TO_DEV)) - else - PATH_TO_DEV := /Developer/SDKs/$(MAC_OS_SDK) -$(info Xcode 4.3+: Platform SDK not found in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK)! Attempting to locate SDK in $(PATH_TO_DEV)) - endif -endif - - ifeq ($(HW_OS), powerpc_macosx) - CC := $(MAC_GCC) -arch ppc -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - RANLIB := ranlib - AR := libtool -static -o - SYSLIBS := -framework CoreFoundation -framework IOKit -framework System - endif - - ifeq ($(HW_OS), universal_macosx) - CC := $(MAC_GCC) -arch ppc -arch i386 -arch x86_64 -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - RANLIB := : - AR := libtool -static -o - SYSLIBS := -framework CoreFoundation -framework IOKit -framework System - endif - - ifeq ($(HW_OS), macosx_32_64) - CC := $(MAC_GCC) -arch i386 -arch x86_64 -isysroot $(PATH_TO_DEV) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - RANLIB := : - AR := libtool -static -o - SYSLIBS := -framework CoreFoundation -framework IOKit -framework System - endif - - ifeq ($(HW_OS), macosx_64) - CC := $(MAC_GCC) -arch x86_64 -isysroot $(PATH_TO_DEV) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - RANLIB := : - AR := libtool -static -o - SYSLIBS := -framework CoreFoundation -framework IOKit -framework System - endif - - ifeq ($(HW_OS), pc_linux_arm) - CC := arm-linux-g++ - RANLIB := arm-linux-ranlib - AR := arm-linux-ar ruv - endif - - ifeq ($(HW_OS), pc_cygwin_arm) - CC := arm-unknown-linux-gnu-g++ - RANLIB := arm-unknown-linux-gnu-ranlib - AR := arm-unknown-linux-gnu-ar ruv - endif - - ifeq ($(HW_OS),sgi_irix) - ifndef SGI_ABI - SGI_ABI := n32 - endif - ifndef SGI_ARCH - SGI_ARCH := mips3 - endif - OBJECT_DIR_SUFFIX := .$(SGI_ABI).$(SGI_ARCH) - CC := CC -$(SGI_ABI) -$(SGI_ARCH) -LANG:std - RANLIB := : - endif - - ifeq ($(HW_OS),hp700_hpux10) - CC := CC +a1 - endif - ifeq ($(HW_OS),pc_cygwin) - CC := g++ - endif - ifeq ($(HW_OS),sparc_sunos) - CC := /usr/local/lib/CenterLine/bin/CC - endif - ifeq ($(HW_OS), hp_flow_aCC) - CC := /opt/aCC/bin/aCC - endif -endif - -#ifeq ($(HW_OS),sparc_solaris) -# AR := /usr/ccs/bin/ar -#endif - -########################## -# directories -# - -# subdirectory for make -ifeq ($(FORCE_GPP),1) -OBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/g++ -SOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/g++/server -AOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/atmellib -GOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/gpsnmealib -else -UNQUAL_OBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX) -UNQUAL_SOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/server -UNQUAL_AOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/atmellib -UNQUAL_GOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/gpsnmealib -OBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX) -SOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/server -AOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/atmellib -GOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/gpsnmealib -endif - -# directories that we can do an rm -f on because they only contain -# object files and executables -SAFE_KNOWN_ARCHITECTURES := \ - hp700_hpux/* \ - hp700_hpux10/* \ - mips_ultrix/* \ - pc_linux/* \ - sgi_irix.32/* \ - sgi_irix.n32/* \ - sparc_solaris/* \ - sparc_solaris_64/* \ - sparc_sunos/* \ - pc_cygwin/* \ - powerpc_aix/* \ - pc_linux_arm/* \ - powerpc_macosx/* \ - universal_macosx/* \ - macosx_32_64/* \ - macosx_64/* \ - pc_linux64/* \ - pc_linux_ia64/* - -CLIENT_SKA = $(patsubst %,client_src/%,$(SAFE_KNOWN_ARCHITECTURES)) -SERVER_SKA = $(patsubst %,server_src/%,$(SAFE_KNOWN_ARCHITECTURES)) - -########################## -# Include flags -# - -#SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include -SYS_INCLUDE := - -ifeq ($(HW_OS),powerpc_macosx) -# SYS_INCLUDE := -I/usr/include - SYS_INCLUDE :=-DMACOSX -I../isense -endif - -ifeq ($(HW_OS),universal_macosx) -# SYS_INCLUDE := -I/usr/include - SYS_INCLUDE :=-DMACOSX -I../isense -endif - -ifeq ($(HW_OS),macosx_32_64) -# SYS_INCLUDE := -I/usr/include - SYS_INCLUDE :=-DMACOSX -I../isense -endif - -ifeq ($(HW_OS),macosx_64) -# SYS_INCLUDE := -I/usr/include - SYS_INCLUDE :=-DMACOSX -I../isense -endif - -ifeq ($(HW_OS),pc_linux) - # The following is for the InterSense and Freespace libraries. - SYS_INCLUDE := -DUNIX -DLINUX -I../libfreespace/include -I./submodules/hidapi/hidapi -I/usr/include/libusb-1.0 -endif - -ifeq ($(HW_OS),pc_linux64) - # The following is for the InterSense and Freespace libraries. - SYS_INCLUDE := -DUNIX -DLINUX -I../libfreespace/include -I./submodules/hidapi/hidapi -I/usr/include/libusb-1.0 -endif - -ifeq ($(HW_OS),pc_linux_arm) - SYS_INCLUDE := -I/opt/Embedix/arm-linux/include -# -I/usr/local/contrib/include \ -# -I/usr/local/contrib/mod/include -I/usr/include/bsd \ -# -I/usr/include/g++ -endif - -ifeq ($(HW_OS),pc_cygwin_arm) - SYS_INCLUDE := -I/opt/Embedix/arm-linux/include -# -I/usr/local/contrib/include \ -# -I/usr/local/contrib/mod/include -I/usr/include/bsd \ -# -I/usr/include/g++ -endif - -ifeq ($(HW_OS),sgi_irix) -# SYS_INCLUDE := -I/usr/local/contrib/mod/include - SYS_INCLUDE := -endif - -ifeq ($(HW_OS),hp700_hpux10) - SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include \ - -I/usr/include/bsd -endif - -ifeq ($(HW_OS),hp_flow) - SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include \ - -I/usr/include/bsd -DFLOW -endif - -ifeq ($(HW_OS),hp_flow_aCC) - SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include \ - -I/usr/include/bsd -DFLOW -endif - -# On the PC, place quatlib in the directory ./quat. No actual system -# includes should be needed. -ifeq ($(HW_OS),pc_cygwin) - INCLUDE_FLAGS := -I. -I./quat -I./atmellib -I./gpsnmealib -else - INCLUDE_FLAGS := -I. $(SYS_INCLUDE) -I./quat -I../quat -I./atmellib -I./gpsnmealib -endif - - -ifeq ($(HW_OS),universal_macosx) - LOAD_FLAGS := $(LOAD_FLAGS) -endif -ifeq ($(HW_OS),macosx_32_64) - LOAD_FLAGS := $(LOAD_FLAGS) -endif -ifeq ($(HW_OS),macosx_64) - LOAD_FLAGS := $(LOAD_FLAGS) -endif - -########################## -# Load flags -# - -#LOAD_FLAGS := -L./$(HW_OS)$(OBJECT_DIR_SUFFIX) -L/usr/local/lib \ -# -L/usr/local/contrib/unmod/lib -L/usr/local/contrib/mod/lib -g -LOAD_FLAGS := -L./$(HW_OS)$(OBJECT_DIR_SUFFIX) -L/usr/local/lib \ - -L/usr/local/contrib/unmod/lib -L/usr/local/contrib/mod/lib $(DEBUG_FLAGS) $(LDFLAGS) - -ifeq ($(HW_OS),sgi_irix) - LOAD_FLAGS := $(LOAD_FLAGS) -old_ld -LANG:std -endif - -ifeq ($(HW_OS),pc_linux) - LOAD_FLAGS := $(LOAD_FLAGS) -L/usr/X11R6/lib -endif - -ifeq ($(HW_OS),pc_linux_ia64) - LOAD_FLAGS := $(LOAD_FLAGS) -L/usr/X11R6/lib -endif - -ifeq ($(HW_OS),pc_linux64) - LOAD_FLAGS := $(LOAD_FLAGS) -L/usr/X11R6/lib -endif - -ifeq ($(HW_OS),powerpc_macosx) - LOAD_FLAGS := $(LOAD_FLAGS) -endif - - -########################## -# Libraries -# - -ifeq ($(HW_OS),pc_linux64) - ARCH_LIBS := -lbsd -ldl -else - ifeq ($(HW_OS),pc_linux) - ARCH_LIBS := -lbsd -ldl - else - ifeq ($(HW_OS),pc_linux_ia64) - ARCH_LIBS := -lbsd -ldl - else - ifeq ($(HW_OS),sparc_solaris) - ARCH_LIBS := -lsocket -lnsl - else - ifeq ($(HW_OS),sparc_solaris_64) - ARCH_LIBS := -lsocket -lnsl - else - ARCH_LIBS := - endif - endif - endif - endif -endif - -LIBS := -lquat -lsdi $(TCL_LIBS) -lXext -lX11 $(ARCH_LIBS) -lm - -# -# Defines for the compilation, CFLAGS -# - -#CFLAGS := $(INCLUDE_FLAGS) -g -override CFLAGS := $(INCLUDE_FLAGS) $(DEBUG_FLAGS) $(CFLAGS) -override CXXFLAGS := $(INCLUDE_FLAGS) $(DEBUG_FLAGS) $(CXXFLAGS) - -# If we're building for sgi_irix, we need both g++ and non-g++ versions, -# unless we're building for one of the weird ABIs, which are only supported -# by the native compiler. - -ifeq ($(HW_OS),sgi_irix) - ifeq ($(SGI_ABI),32) -all: client server client_g++ server_g++ atmellib gpsnmealib - else -all: client server atmellib gpsnmealib - endif -else - ifeq ($(HW_OS),pc_cygwin) -all: client server atmellib gpsnmealib - else -all: client server atmellib gpsnmealib - endif -endif - -.PHONY: client_g++ -client_g++: - $(MAKE) FORCE_GPP=1 $(UNQUAL_OBJECT_DIR)/g++/libvrpn.a - $(MV) $(UNQUAL_OBJECT_DIR)/g++/libvrpn.a $(UNQUAL_OBJECT_DIR)/libvrpn_g++.a - -.PHONY: server_g++ -server_g++: - $(MAKE) FORCE_GPP=1 $(UNQUAL_OBJECT_DIR)/g++/libvrpnserver.a - $(MV) $(UNQUAL_OBJECT_DIR)/g++/libvrpnserver.a $(UNQUAL_OBJECT_DIR)/libvrpnserver_g++.a - -.PHONY: client -client: $(OBJECT_DIR) $(OBJECT_DIR)/libvrpn.a - -.PHONY: server -server: $(SOBJECT_DIR) - $(MAKE) $(OBJECT_DIR)/libvrpnserver.a - -.PHONY: atmellib -atmellib: $(AOBJECT_DIR) - $(MAKE) $(OBJECT_DIR)/libvrpnatmel.a - -.PHONY: gpsnmealib -gpsnmealib: $(GOBJECT_DIR) - $(MAKE) $(OBJECT_DIR)/libvrpngpsnmea.a - -$(OBJECT_DIR): - -mkdir -p $(OBJECT_DIR) - -$(SOBJECT_DIR): - -mkdir -p $(SOBJECT_DIR) - -$(AOBJECT_DIR): - -mkdir -p $(AOBJECT_DIR) - -$(GOBJECT_DIR): - -mkdir -p $(GOBJECT_DIR) - -############################################################################# -# -# implicit rule for all .c files -# -.SUFFIXES: .c .C .o .a - -.c.o: - $(CC) -c $(CFLAGS) $< -.C.o: - $(CC) -c $(CXXFLAGS) $< - -# Build objects from .c files -$(OBJECT_DIR)/%.o: %.c $(LIB_INCLUDES) $(MAKEFILE) - @[ -d $(OBJECT_DIR) ] || mkdir -p $(OBJECT_DIR) - $(CC) $(CFLAGS) -DVRPN_CLIENT_ONLY -o $@ -c $< - -# Build objects from .C files -$(OBJECT_DIR)/%.o: %.C $(LIB_INCLUDES) $(MAKEFILE) - @[ -d $(OBJECT_DIR) ] || mkdir -p $(OBJECT_DIR) - $(CC) $(CFLAGS) -DVRPN_CLIENT_ONLY -o $@ -c $< - -# Build objects from .C files -$(SOBJECT_DIR)/%.o: %.C $(SLIB_INCLUDES) $(MAKEFILE) - @[ -d $(SOBJECT_DIR) ] || mkdir -p $(SOBJECT_DIR) - $(CC) $(CFLAGS) -o $@ -c $< - -# Build objects from .C files -$(AOBJECT_DIR)/%.o: %.C $(ALIB_INCLUDES) $(MAKEFILE) - @[ -d $(AOBJECT_DIR) ] || mkdir -p $(AOBJECT_DIR) - $(CC) $(CFLAGS) -o $@ -c $< - -# Special rule for vrpn_Local_HIDAPI.C, which must be build with -# the C compiler. -$(SOBJECT_DIR)/vrpn_Local_HIDAPI.o : vrpn_Local_HIDAPI.C $(SLIB_INCLUDES) $(MAKEFILE) - @[ -d $(SOBJECT_DIR) ] || mkdir -p $(SOBJECT_DIR) - $(CC) $(CFLAGS) -x c -o $@ -c $< - -# -# -############################################################################# - -############################################################################# -# -# library code -# -############################################################################# - -# files to be compiled into the client library - -LIB_FILES = \ - vrpn_Analog.C \ - vrpn_Analog_Output.C \ - vrpn_Auxiliary_Logger.C \ - vrpn_BaseClass.C \ - vrpn_Button.C \ - vrpn_Connection.C \ - vrpn_Dial.C \ - vrpn_FileConnection.C \ - vrpn_FileController.C \ - vrpn_ForceDevice.C \ - vrpn_Forwarder.C \ - vrpn_ForwarderController.C \ - vrpn_Imager.C \ - vrpn_LamportClock.C \ - vrpn_Mutex.C \ - vrpn_Poser.C \ - vrpn_RedundantTransmission.C \ - vrpn_Serial.C \ - vrpn_Shared.C \ - vrpn_SharedObject.C \ - vrpn_Sound.C \ - vrpn_Text.C \ - vrpn_Tracker.C - -LIB_OBJECTS = $(patsubst %,$(OBJECT_DIR)/%,$(LIB_FILES:.C=.o)) - -LIB_INCLUDES = \ - vrpn_Connection.h \ - vrpn_Tracker.h \ - vrpn_Button.h \ - vrpn_Sound.h \ - vrpn_ForceDevice.h \ - vrpn_Shared.h \ - vrpn_Analog.h \ - vrpn_FileConnection.h \ - vrpn_FileController.h \ - vrpn_Forwarder.h \ - vrpn_Text.h \ - vrpn_ForwarderController.h \ - vrpn_Serial.h \ - vrpn_Dial.h \ - vrpn_SharedObject.h \ - vrpn_LamportClock.h \ - vrpn_Mutex.h \ - vrpn_BaseClass.h \ - vrpn_Imager.h \ - vrpn_Analog_Output.h \ - vrpn_Poser.h \ - vrpn_Auxiliary_Logger.h \ - vrpn_MainloopObject.h \ - vrpn_MainloopContainer.h \ - vrpn_BufferUtils.h \ - vrpn_SendTextMessageStreamProxy.h - -$(LIB_OBJECTS): -$(OBJECT_DIR)/libvrpn.a: $(MAKEFILE) $(LIB_OBJECTS) - $(AR) $(OBJECT_DIR)/libvrpn.a $(LIB_OBJECTS) - -$(RANLIB) $(OBJECT_DIR)/libvrpn.a - -# We aren't going to use architecture-dependent sets of files. -# If vrpn_sgibox isn't supposed to be compiled on any other architecture, -# then put all of it inside "#ifdef sgi"! - -SLIB_FILES = $(LIB_FILES) \ - vrpn_3DConnexion.C \ - vrpn_3DMicroscribe.C \ - vrpn_3Space.C \ - vrpn_5DT16.C \ - vrpn_ADBox.C \ - vrpn_Analog_5dt.C \ - vrpn_Analog_5dtUSB.C \ - vrpn_Analog_Radamec_SPI.C \ - vrpn_Analog_USDigital_A2.C \ - vrpn_Atmel.C \ - vrpn_BiosciencesTools.C \ - vrpn_Button_NI_DIO24.C \ - vrpn_CerealBox.C \ - vrpn_CHProducts_Controller_Raw.C \ - vrpn_Contour.C \ - vrpn_Dyna.C \ - vrpn_DreamCheeky.C \ - vrpn_Event_Analog.C \ - vrpn_Event.C \ - vrpn_Event_Mouse.C \ - vrpn_Flock.C \ - vrpn_Flock_Parallel.C \ - vrpn_ForceDeviceServer.C \ - vrpn_Freespace.C \ - vrpn_FunctionGenerator.C \ - vrpn_Futaba.C \ - vrpn_GlobalHapticsOrb.C \ - vrpn_Griffin.C \ - vrpn_HumanInterface.C \ - vrpn_IDEA.C \ - vrpn_Imager_Stream_Buffer.C \ - vrpn_ImmersionBox.C \ - vrpn_inertiamouse.C \ - vrpn_JoyFly.C \ - vrpn_Joylin.C \ - vrpn_Keyboard.C \ - vrpn_Local_HIDAPI.C \ - vrpn_Logitech_Controller_Raw.C \ - vrpn_LUDL.C \ - vrpn_Magellan.C \ - vrpn_Microsoft_Controller_Raw.C \ - vrpn_Mouse.C \ - vrpn_NationalInstruments.C \ - vrpn_nikon_controls.C \ - vrpn_OmegaTemperature.C \ - vrpn_Poser_Analog.C \ - vrpn_Poser_Tek4662.C \ - vrpn_raw_sgibox.C \ - vrpn_Retrolink.C \ - vrpn_Saitek_Controller_Raw.C \ - vrpn_sgibox.C \ - vrpn_Spaceball.C \ - vrpn_Tng3.C \ - vrpn_Tracker_3DMouse.C \ - vrpn_Tracker_AnalogFly.C \ - vrpn_Tracker_ButtonFly.C \ - vrpn_Tracker_Crossbow.C \ - vrpn_Tracker_DTrack.C \ - vrpn_Tracker_Fastrak.C \ - vrpn_Tracker_Filter.C \ - vrpn_Tracker_GameTrak.C \ - vrpn_Tracker_isense.C \ - vrpn_Tracker_Isotrak.C \ - vrpn_Tracker_Liberty.C \ - vrpn_Tracker_PDI.C \ - vrpn_Tracker_MotionNode.C \ - vrpn_Tracker_NDI_Polaris.C \ - vrpn_Tracker_PhaseSpace.C \ - vrpn_Tracker_RazerHydra.C \ - vrpn_Tracker_TrivisioColibri.C \ - vrpn_Tracker_ViewPoint.C \ - vrpn_Tracker_NovintFalcon.C \ - vrpn_Tracker_SpacePoint.C \ - vrpn_Tracker_Wintracker.C \ - vrpn_Tracker_WiimoteHead.C \ - vrpn_Tracker_GPS.C \ - vrpn_UNC_Joystick.C \ - vrpn_VPJoystick.C \ - vrpn_Wanda.C \ - vrpn_WiiMote.C \ - vrpn_Xkeys.C \ - vrpn_Tracker_LibertyHS.C \ - vrpn_YEI_3Space.C \ - vrpn_Zaber.C - -SLIB_OBJECTS = $(patsubst %,$(SOBJECT_DIR)/%,$(SLIB_FILES:.C=.o)) - -SLIB_INCLUDES = $(LIB_INCLUDES) \ - vrpn_3DConnexion.h \ - vrpn_3DMicroscribe.h \ - vrpn_3Space.h \ - vrpn_5DT16.h \ - vrpn_ADBox.h \ - vrpn_Analog_5dt.h \ - vrpn_Analog_5dtUSB.h \ - vrpn_Analog_Radamec_SPI.h \ - vrpn_Analog_USDigital_A2.h \ - vrpn_Atmel.h \ - vrpn_BiosciencesTools.h \ - vrpn_Button_NI_DIO24.h \ - vrpn_CerealBox.h \ - vrpn_CHProducts_Controller_Raw.h \ - vrpn_Contour.h \ - vrpn_Dyna.h \ - vrpn_DreamCheeky.h \ - vrpn_Event_Analog.h \ - vrpn_Event.h \ - vrpn_Event_Mouse.h \ - vrpn_Flock.h \ - vrpn_Flock_Parallel.h \ - vrpn_ForceDeviceServer.h \ - vrpn_Freespace.h \ - vrpn_Futaba.C \ - vrpn_GlobalHapticsOrb.h \ - vrpn_Griffin.h \ - vrpn_HumanInterface.h \ - vrpn_IDEA.h \ - vrpn_Imager_Stream_Buffer.h \ - vrpn_ImmersionBox.h \ - vrpn_inertiamouse.h \ - vrpn_JoyFly.h \ - vrpn_Joylin.h \ - vrpn_Keyboard.h \ - vrpn_Logitech_Controller_Raw.h \ - vrpn_LUDL.h \ - vrpn_Magellan.h \ - vrpn_Microsoft_Controller_Raw.h \ - vrpn_Mouse.h \ - vrpn_NationalInstruments.h \ - vrpn_nikon_controls.h \ - vrpn_OneEuroFilter.h \ - vrpn_OmegaTemperature.h \ - vrpn_Poser_Analog.h \ - vrpn_Poser_Tek4662.h \ - vrpn_raw_sgibox.h \ - vrpn_Retrolink.h \ - vrpn_Saitek_Controller_Raw.h \ - vrpn_sgibox.h \ - vrpn_Spaceball.h \ - vrpn_Tng3.h \ - vrpn_Tracker_3DMouse.h \ - vrpn_Tracker_AnalogFly.h \ - vrpn_Tracker_ButtonFly.h \ - vrpn_Tracker_Crossbow.h \ - vrpn_Tracker_DTrack.h \ - vrpn_Tracker_Fastrak.h \ - vrpn_Tracker_Filter.h \ - vrpn_Tracker_GameTrak.h \ - vrpn_Tracker_isense.h \ - vrpn_Tracker_Isotrak.h \ - vrpn_Tracker_Liberty.h \ - vrpn_Tracker_PDI.h \ - vrpn_Tracker_MotionNode.h \ - vrpn_Tracker_NDI_Polaris.h \ - vrpn_Tracker_PhaseSpace.h \ - vrpn_Tracker_RazerHydra.h \ - vrpn_Tracker_SpacePoint.h \ - vrpn_Tracker_Wintracker.h \ - vrpn_Tracker_TrivisioColibri.h \ - vrpn_Tracker_ViewPoint.h \ - vrpn_Tracker_NovintFalcon.h \ - vrpn_Tracker_WiimoteHead.h \ - vrpn_Tracker_GPS.h \ - vrpn_UNC_Joystick.h \ - vrpn_VPJoystick.h \ - vrpn_Wanda.h \ - vrpn_WiiMote.h \ - vrpn_Xkeys.h \ - vrpn_Tracker_LibertyHS.h \ - vrpn_YEI_3Space.h \ - vrpn_Zaber.h - -ifeq ($(HW_OS), pc_linux64) - SLIB_FILES += vrpn_DevInput.C - SLIB_INCLUDES += vrpn_DevInput.h -endif -ifeq ($(HW_OS), pc_linux) - SLIB_FILES += vrpn_DevInput.C - SLIB_INCLUDES += vrpn_DevInput.h -endif - -$(SLIB_OBJECTS): -$(OBJECT_DIR)/libvrpnserver.a: $(MAKEFILE) $(SLIB_OBJECTS) - $(AR) $(OBJECT_DIR)/libvrpnserver.a $(SLIB_OBJECTS) - -$(RANLIB) $(OBJECT_DIR)/libvrpnserver.a - -# atmellib files. - -ALIB_FILES = \ - atmellib/vrpn_atmellib_helper.C \ - atmellib/vrpn_atmellib_iobasic.C \ - atmellib/vrpn_atmellib_openclose.C \ - atmellib/vrpn_atmellib_register.C \ - atmellib/vrpn_atmellib_tester.C - -ALIB_OBJECTS = $(patsubst %,$(AOBJECT_DIR)/../%,$(ALIB_FILES:.C=.o)) - -ALIB_INCLUDES = \ - vrpn_atmellib.h \ - vrpn_atmellib_helper.h \ - vrpn_atmellib_errno.h - -$(ALIB_OBJECTS): -$(OBJECT_DIR)/libvrpnatmel.a: $(MAKEFILE) $(ALIB_OBJECTS) - $(AR) $(OBJECT_DIR)/libvrpnatmel.a $(ALIB_OBJECTS) - -$(RANLIB) $(OBJECT_DIR)/libvrpnatmel.a - -# gpsnmealib files. - -GLIB_FILES = \ - gpsnmealib/latLonCoord.C \ - gpsnmealib/nmeaParser.C \ - gpsnmealib/typedCoord.C \ - gpsnmealib/utmCoord.C - -GLIB_OBJECTS = $(patsubst %,$(GOBJECT_DIR)/../%,$(GLIB_FILES:.C=.o)) - -GLIB_INCLUDES = \ - latLonCoord.h \ - nmeaParser.h \ - typeCoord.h \ - utmCoord.h - -$(GLIB_OBJECTS): -$(OBJECT_DIR)/libvrpngpsnmea.a: $(MAKEFILE) $(GLIB_OBJECTS) - $(AR) $(OBJECT_DIR)/libvrpngpsnmea.a $(GLIB_OBJECTS) - -$(RANLIB) $(OBJECT_DIR)/libvrpngpsnmea.a - -############################################################################# -# -# other stuff -# -############################################################################# - -.PHONY: clean -clean: -ifeq ($(HW_OS),) - echo "Must specify HW_OS !" -else - $(RMF) $(LIB_OBJECTS) $(OBJECT_DIR)/libvrpn.a \ - $(OBJECT_DIR)/libvrpn_g++.a \ - $(SLIB_OBJECTS) \ - $(ALIB_OBJECTS) \ - $(GLIB_OBJECTS) \ - $(OBJECT_DIR)/libvrpnserver.a \ - $(OBJECT_DIR)/libvrpnatmel.a \ - $(OBJECT_DIR)/libvrpngpsnmea.a \ - $(OBJECT_DIR)/libvrpnserver_g++.a \ - $(OBJECT_DIR)/.depend \ - $(OBJECT_DIR)/.depend-old -ifneq (xxx$(FORCE_GPP),xxx1) - @echo ----------------------------------------------------------------- - @echo -- Wart: type \"$(MAKE) clean_g++\" to clean up after g++ - @echo -- I don\'t do it automatically in case you don\'t have g++ - @echo ----------------------------------------------------------------- -endif -#ifneq ($(CC), g++) -# $(MAKE) FORCE_GPP=1 clean -#endif -endif - -.PHONY: clean -clean_g++: - $(MAKE) FORCE_GPP=1 clean - - -# clobberall removes the object directory for EVERY architecture. -# One problem - the object directory for pc_win32 also contains files -# that must be saved. -# clobberall also axes left-over CVS cache files. - -.PHONY: clobberall -clobberall: clobberwin32 - $(RMF) -r $(SAFE_KNOWN_ARCHITECTURES) - $(RMF) -r $(CLIENT_SKA) - $(RMF) -r $(SERVER_SKA) - $(RMF) .#* server_src/.#* client_src/.#* - -.PHONY: clobberwin32 -clobberwin32: - $(RMF) -r pc_win32/DEBUG/* - $(RMF) -r pc_win32/vrpn/Debug/* - $(RMF) -r client_src/pc_win32/printvals/Debug/* - $(RMF) -r server_src/pc_win32/vrpn_server/Debug/* - -install: all - -mkdir -p $(LIB_DIR) - ( cd $(LIB_DIR) ; rm -f libvrpn*.a ) - ( cd $(OBJECT_DIR) ; cp *.a $(LIB_DIR) ) - -mkdir -p $(INCLUDE_DIR) - cp vrpn*.h $(INCLUDE_DIR) - -uninstall: - ( cd $(LIB_DIR) ; rm -f libvrpn*.a ) - ( cd $(INCLUDE_DIR) ; rm -f vrpn*.h ) - -############################################################################# -# -# Dependencies -# -# If it doesn't already exist, this makefile automatically creates -# a dependency file called .depend. Then it includes it so that -# the build will know the dependency information. -# -# to recreate a dependencies file, type "make depend" -# do this any time you add a file to the project, -# or add/remove #include lines from a source file -# -# if you are on an SGI and want g++ to make the dependency file, -# then type: gmake CC=g++ depend -# -# if you don't want a dependency file, then remove .depend if it exists, -# and type "touch .depend". if it exists (and is empty), make will not -# automatically create it or automatically update it (unless you type -# make depend) -# - -############### -### this way works better -### you type "make depend" anytime you add a file or -### add/remove #includes from a file -######## - -include $(OBJECT_DIR)/.depend - -.PHONY: depend -depend: - -$(MVF) $(OBJECT_DIR)/.depend $(OBJECT_DIR)/.depend-old - $(MAKE) $(OBJECT_DIR)/.depend - -$(OBJECT_DIR)/.depend: - @echo ---------------------------------------------------------------- - @echo -- Making dependency file. If you add files to the makefile, - @echo -- or add/remove includes from a .h or .C file, then you should - @echo -- remake the dependency file by typing \"$(MAKE) depend\" - @echo ---------------------------------------------------------------- - -mkdir -p $(OBJECT_DIR) -ifeq ($(HW_OS),hp700_hpux10) - @echo -- $(HW_OS): Using g++ since HP CC does not understand -M - @echo -- if this causes an error, then delete .depend and type - @echo -- \"touch .depend\" to create an empty file - @echo ---------------------------------------------------------------- - $(SHELL) -ec 'g++ -MM $(CXXFLAGS) $(LIB_FILES) \ - | sed '\''s/\(.*\.o[ ]*:[ ]*\)/$(OBJECT_DIR)\/\1/g'\'' > $(OBJECT_DIR)/.depend' -else - ifeq ($(HW_OS),hp_flow_aCC) - @echo -- $(HW_OS): Using g++ since HP aCC does not understand -M - @echo -- if this causes an error, then delete .depend and type - @echo -- \"touch .depend\" to create an empty file - @echo ---------------------------------------------------------------- - $(SHELL) -ec 'g++ -MM $(CXXFLAGS) $(LIB_FILES) \ - | sed '\''s/\(.*\.o[ ]*:[ ]*\)/$(OBJECT_DIR)\/\1/g'\'' > $(OBJECT_DIR)/.depend' - else - ifeq ($(HW_OS),powerpc_aix) - @$(RMF) *.u - $(SHELL) -ec '$(CC) -E -M $(CFLAGS) $(LIB_FILES) > /dev/null 2>&1' - cat *.u > .depend - @$(RMF) *.u - else - $(SHELL) -ec '$(CC) -M $(CFLAGS) $(LIB_FILES) \ - | sed '\''s/\(.*\.o[ ]*:[ ]*\)/$(OBJECT_DIR)\/\1/g'\'' > $(OBJECT_DIR)/.depend' - endif - endif -endif - @echo ---------------------------------------------------------------- diff --git a/src/vrpn/MinGWToolchain.cmake b/src/vrpn/MinGWToolchain.cmake deleted file mode 100644 index 9f6c07ebc5a119bffaaea8d92b17d39ca5fe37d1..0000000000000000000000000000000000000000 --- a/src/vrpn/MinGWToolchain.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# Example toolchain file for building with mingw32 on Ubuntu 10.04 x64 -# Pass to CMake using cmake -DCMAKE_TOOLCHAIN_FILE=MinGWToolchain.cmake -# Not needed when actually building on Windows using mingw, only when -# cross-compiling - -# the name of the target operating system -set(CMAKE_SYSTEM_NAME Windows) - -# which compilers to use for C and C++ -set(CMAKE_C_COMPILER i586-mingw32msvc-gcc) -set(CMAKE_CXX_COMPILER i586-mingw32msvc-g++) -set(CMAKE_RC_COMPILER i586-mingw32msvc-windres) - -# here is the target environment located -set(CMAKE_FIND_ROOT_PATH - /usr/i586-mingw32msvc - $ENV{HOME}/mingw-install) - -# adjust the default behaviour of the FIND_XXX() commands: -# search headers and libraries in the target environment, search -# programs in the host environment -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/src/vrpn/ParseVersion.cmake b/src/vrpn/ParseVersion.cmake deleted file mode 100644 index 1ef5f551a3b97a316f3d495cc954a9358550ad90..0000000000000000000000000000000000000000 --- a/src/vrpn/ParseVersion.cmake +++ /dev/null @@ -1,95 +0,0 @@ -### -# Get the version number by parsing vrpn_Connection.C -### -include(WarningDev.cmake) -set(_vrpn_version_file "${CMAKE_CURRENT_SOURCE_DIR}/vrpn_Connection.C") -if(EXISTS "${_vrpn_version_file}") - file(READ "${_vrpn_version_file}" _vrpn_version_contents) -endif() -set(_vrpn_version_regex "vrpn: ver. ([0-9]+).([0-9]+)") -string(REGEX - MATCH - "${_vrpn_version_regex}" - _dummy - "${_vrpn_version_contents}") - -if(CMAKE_MATCH_1) - set(CPACK_PACKAGE_VERSION_MAJOR "${CMAKE_MATCH_1}") -else() - set(CPACK_PACKAGE_VERSION_MAJOR "07") - warning_dev("Could not parse major version from vrpn_Connection.C") -endif() - -if(CMAKE_MATCH_2) - set(CPACK_PACKAGE_VERSION_MINOR "${CMAKE_MATCH_2}") -else() - set(CPACK_PACKAGE_VERSION_MAJOR "26") - warning_dev("Could not parse minor version from vrpn_Connection.C") -endif() - -set(CPACK_PACKAGE_VERSION - "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") -set(CONFIG_VERSION "${CPACK_PACKAGE_VERSION}") -set(BRIEF_VERSION "${CPACK_PACKAGE_VERSION}") - -include(GetGitRevisionDescription) -git_get_exact_tag(GIT_EXACT_TAG --tags --match version_*) -if(GIT_EXACT_TAG) - # Extract simple version number from description to verify it - string(REPLACE "version_" "" GIT_LAST_TAGGED_VER "${GIT_EXACT_TAG}") - string(REGEX - REPLACE - "-.*" - "" - GIT_LAST_TAGGED_VER - "${GIT_LAST_TAGGED_VER}") - if(GIT_LAST_TAGGED_VER VERSION_EQUAL CPACK_PACKAGE_VERSION) - # OK, they match. All done! - return() - endif() - - message("WARNING: Git reports that the current source code is tagged '${GIT_EXACT_TAG}', - but the version extracted from the source code (${CPACK_PACKAGE_VERSION}) differs! - You may need to fix the source code's version and/or update the tag! - - The version extracted from the source code will be trusted for now, - but please fix this issue!\n") - -else() - # Not an exact tag, let's try a description - git_describe(GIT_REVISION_DESCRIPTION --tags --match version_*) - if(GIT_REVISION_DESCRIPTION) - # Extract simple version number from description - string(REPLACE - "version_" - "" - GIT_LAST_TAGGED_VER - "${GIT_REVISION_DESCRIPTION}") - set(GIT_REDUCED_REVISION_DESCRIPTION "${GIT_LAST_TAGGED_VER}") - string(REGEX - REPLACE - "-.*" - "" - GIT_LAST_TAGGED_VER - "${GIT_LAST_TAGGED_VER}") - - if(GIT_LAST_TAGGED_VER VERSION_LESS CPACK_PACKAGE_VERSION) - # Prerelease - message(STATUS - "Git's description of the current revision indicates this is a prerelease of ${CPACK_PACKAGE_VERSION}: ${GIT_REVISION_DESCRIPTION}\n") - set(CPACK_PACKAGE_VERSION_PATCH - "0~prerelease-git-${GIT_REDUCED_REVISION_DESCRIPTION}") - set(CONFIG_VERSION "pre-${CONFIG_VERSION}") - else() - # OK, this is a followup version - # TODO verify assumption - message(STATUS - "Git's description of the current revision indicates this is a patched version of ${CPACK_PACKAGE_VERSION}: ${GIT_REVISION_DESCRIPTION}\n") - set(CONFIG_VERSION "post-${CONFIG_VERSION}") - set(CPACK_PACKAGE_VERSION_PATCH "0-git-${GIT_REDUCED_REVISION_DESCRIPTION}") - endif() - set(CPACK_PACKAGE_VERSION - "${CPACK_PACKAGE_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}") - endif() -endif() - diff --git a/src/vrpn/README b/src/vrpn/README deleted file mode 100644 index b25afbcda60e5a05b484e3acaba20d4313ebf1b0..0000000000000000000000000000000000000000 --- a/src/vrpn/README +++ /dev/null @@ -1,6 +0,0 @@ -IMPORTANT LEGAL INFORMATION for offsite use is in README.Legal -IMPORTANT compiling at other sites information in README.Compile - -NOTE: See http://www.vrpn.org for -information on VRPN. - diff --git a/src/vrpn/README.Compiling b/src/vrpn/README.Compiling deleted file mode 100644 index afab51bcae5cc43f50d9c6bccc770d6fba4d6061..0000000000000000000000000000000000000000 --- a/src/vrpn/README.Compiling +++ /dev/null @@ -1,75 +0,0 @@ -VRPN has had a CMake-based build system since version 07.23. CMake is -similar in purpose but not in implementation to the Autoconf collection -of tools, and permits building on multiple platforms by creating native -project files for MSVC, XCode, Eclipse, Code::Blocks, makefiles, and -more. - -Get CMake from your Linux distribution and/or from www.cmake.org - -Use the current directory (vrpn_XX_XX) as the "source code" directory -in the CMake GUI; the quat directory (vrpn_XX_XX/quat) will be automatically -detected and built as well. Choose any directory you want (the source -directory followed by /build is suggested) as the "build binaries" -directory: generated build files will be placed there rather than cluttering -up your source tree. - -Many options can be fully configured using CMake as of Dec 2009, and more -are sure to come. Until then, if you need specific compilation needs -that CMake doesn't appear to provide an interface for, look in the -vrpn_Configure.h.cmake_in file. - -If you'd rather use the command line, here's the basics: - mkdir build - cd build - ccmake ../ - - Press 'c' to run the initial configuration - - Change any options, pressing 'c' to re-configure after each change - - when satisfied, after configuring, press 'g' to create makefiles, etc - make - -and any/all of these if desired: - make package - - Create binary install packages of your configured build using CPack - make package_source - - Create source code packages using CPack - make install - - Install all libraries, executables, and headers (as configured) - to your system, to the configured path. Add DESTDIR=whatever/ - to place the installation tree somewhere other than root. - -Instructions for the original Makefile-based or project-based build follow. - -For those not at UNC, you compile by doing the following: - - for Visual C++: - Open the vrpn.dsw file. - Compile the quat project. - Compile the VRPN project. - Then compile whichever of vrpn_server, printvals, etc you want. - - for Unix/Cygwin: - Go to ../quat. - Edit 'makefile' to uncomment the architecture you are on. - gmake - Come back here (cd ../vrpn) - Edit Makefile to uncomment your architecture - gmake - Go to client_src - Edit Makefile to uncomment your architecture - gmake - Go to server_src - Edit Makefile to uncomment your architecture - gmake - - edit the vrpn.cfg file to set it to start tracker you want - See the file vrpn.cfg.SAMPLE for examples. - Example: vrpn_Tracker_NULL Tracker0@MYHOSTNAME 2 2 - (Run the server: sgi_irix/vrpn_server -millisleep 1 -f vrpn.cfg) - - Go to client_src - Run printvals to check the server - Example: sgi_irix/printvals localhost - -For those wanting to build client code for Android, see the README_Android.txt in -the java_vrpn directory. - diff --git a/src/vrpn/README.Legal b/src/vrpn/README.Legal deleted file mode 100644 index b7a50b37cca8d8422ccbadeb1b40965b64d0649b..0000000000000000000000000000000000000000 --- a/src/vrpn/README.Legal +++ /dev/null @@ -1,32 +0,0 @@ -The initial release of VRPN (The Virtual Reality Peripheral Network) was placed into the public domain on 5/4/1998 by the copyright holder Russell M. Taylor II at the University of North Carolina at Chapel Hill. - -To protect all VRPN contributors from liability without restricting the use of VRPN, as of July 22, 2010, future versions of VRPN (versions 7.27 and higher) are being released under the Boost Software License 1.0, which is as follows: - -Boost Software License 1.0 (BSL1.0) - -Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Additional requests follow: - -1. Please acknowledge this library in any publication, written, videotaped, - or otherwise produced, that results from making programs using it. - The acknowledgement will credit - - CISMM Project - University of North Carolina at Chapel Hill, - Supported by the NIH/NCRR and the NIH/NIBIB. - -2. Please furnish us a copy of any publication, including videotape, - that you produce and disseminate outside your group using our - program. These should be addressed to Professor R.M. Taylor - at taylorr@cs.unc.edu. - -3. Please send us derived classes and drivers for new devices that you - create for the library. We will attempt to include them in - future releases of the library for you and others to use. This - is the fastest way to get a working system for everyone. - diff --git a/src/vrpn/README.git b/src/vrpn/README.git deleted file mode 100644 index a156d9e30211fbfe48aacaaf23df33f38c2bf4d2..0000000000000000000000000000000000000000 --- a/src/vrpn/README.git +++ /dev/null @@ -1,42 +0,0 @@ -vrpn_devel is currently accessed over https:// at git.cs.unc.edu. -Use a password to push changes. - -Getting to the Git repository using a public/private key pair from a UNC Linux host. - ---------------------- -1) Generate a public/private key pair and store them securely on your AFS space: - - cd ~ - mkdir .ssh-private - fs sa .ssh-private system:anyuser none - fs sa .ssh-private system:administrators none - cd ~/.ssh-private - ssh-keygen -t dsa -b 1024 -f ./git_dsa - (Decide if you want a passphrase on the key, enter it if so - or blank if not.) - ---------------------- -2) Tell SSH to share this key with the other side when you're connecting to the server by adding the following lines into the file ~/.ssh/config under Linux: - - Host cvs.cs.unc.edu - IdentityFile ~/.ssh-private/git_dsa - - Host git.cs.unc.edu - IdentityFile ~/.ssh-private/git_dsa - ---------------------- -3) Send the public key to Murray to be added to the list of users who can log on to CVS as the git user. You can paste the text of the key into an email to him. - ---------------------- -4) Use the following name for the repository: git@git.cs.unc.edu:vrpn.git, for example: - - git clone git@git.cs.unc.edu:vrpn.git - git push git@git.cs.unc.edu:vrpn.git master - ---------------------- -Random: If you end up pushing in a way that requires a password, you may need to do the following in your shell ahead of time to avoid having it attempt to display via an X server: -unset DISPLAY -unset SSH_ASKPASS - - - diff --git a/src/vrpn/README.jsoncpp b/src/vrpn/README.jsoncpp deleted file mode 100644 index 172f240d73f18f5ae4854b93e343bf99cc6d5320..0000000000000000000000000000000000000000 --- a/src/vrpn/README.jsoncpp +++ /dev/null @@ -1,40 +0,0 @@ -JSONCPP is required to build a VRPN server for the Vrpn Android widgets (see android_widgets directory). - -If you've done a recursive clone, JSONCPP is in the submodules directory, -will be built automatically, and you can completely ignore the rest of this file. - -Get the latest JSONCPP (r156 has been used successfully) from - http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp - -You will also need Scons and Python - -To build jsoncpp, see README.txt in the JSONCPP directory, but : -1/ Get scons-local (2.0.1 is OK) from http://www.scons.org/download.php - instead of the link in the README, then - extract scons-local into the jsoncpp directory as mentionned in the README -2/ To avoid LNK2005 errors when building VRPN, you will need to edit jsoncpp/Sconstruct - locate the section relative to your build environment, for instance : - elif platform == 'msvc90': - in this instruction block, replace the line : - env['CXXFLAGS']='xxxxxxx /MT' - by : - env['CXXFLAGS']='xxxxxxx /MD' -3/ To build with Visual Studio, run the Visual Studio command that configures environment variables - (on VS-2008-32, look for a file named vsvars32.bat), otherwise scons may not find the compiler - -Then build, for instance with the command - c:\Python27\python.exe scons.py platform=msvc90 - -The values allowed for platform are - suncc vacpp mingw msvc6 msvc7 msvc71 msvc80 msvc90 linux-gcc - -WARNING: - the JSONCPP build system builds a Release version. Using this release library with a - Debug VRPN server crashes. - -To clean, use the command - c:\Python271\python.exe scons.py platform=msvc90 -c - -Then, run CMAKE for VRPN, define VRPN_USE_JSONNET and JSONCPP_ROOT_DIR. - - diff --git a/src/vrpn/README.python b/src/vrpn/README.python deleted file mode 100644 index 6911bbc29acbe63e71189592d4515c65d6884f43..0000000000000000000000000000000000000000 --- a/src/vrpn/README.python +++ /dev/null @@ -1,9 +0,0 @@ -python_vrpn: - VRPN wrapped in Python using Swig. Works with Python 2.7. - -python: - Hand-written Python classes that work with Python 2.7 and 3.2. - Compile the main library (ie.: root of VRPN) and the quat library. Then, go to the "python" folder. Before making the binary, you have to define the "PYTHON_VERSION" environment variable to the version of python you want to compile it for (ie.: "3.2", "2.7" ...). And you have to put the resulting vrpn.so shared library (found in $HW_OS/$PYTHON_VERSION) in the python module folder or in a path defined in the PYTHONPATH environment variable. - - The "essai_*.py" are simple python files that show you how to use this module (the single difference is a call to python3.2 or python2.7 interpreter). - diff --git a/src/vrpn/WarningDev.cmake b/src/vrpn/WarningDev.cmake deleted file mode 100644 index 9699462ce874c9c444f81ee0ba91f7177117f9b0..0000000000000000000000000000000000000000 --- a/src/vrpn/WarningDev.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# - Print a developer warning, using author_warning if we have cmake 2.8 -# -# warning_dev("your desired message") -# -# Original Author: -# 2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC - -function(warning_dev _yourmsg) - if("1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0") - # CMake version <2.8.0 - message(STATUS - "The following is a developer warning - end users may ignore it") - message(STATUS "Dev Warning: ${_yourmsg}") - else() - message(AUTHOR_WARNING "${_yourmsg}") - endif() -endfunction() diff --git a/src/vrpn/android_widgets/README.txt b/src/vrpn/android_widgets/README.txt deleted file mode 100644 index 7b01b9b72bbc090fa4a86a563797e24aefd0e7aa..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/README.txt +++ /dev/null @@ -1,14 +0,0 @@ -This project is totally distinct from java_vrpn and the Vrpn server running on Android. - -The Vrpn widgets for Android provide a set of Android Widgets that are bound to a Vrpn server. On the Android device, an application can be written mainly with Android XML layout, almost without Java coding. The documentation of the widgets is in android_widgets/vrpn_library/doc/ - -The Android application will send updates as UDP packets with a JSON payload to the vrpn_Tracker_JsonNet device. You need a VRPN server build with VRPN_USE_JSONNET and a vrpn.cfg file that declares a vrpn_Tracker_JsonNet device. - -To build such a server you need JSONCPP. See README.jsoncpp for instructions about obtaining and building JSONCPP first, then use CMAKE to generate the VRPN project with VRPN_USE_JSONNET. You will need to define the JSONCPP_ROOT_DIR CMake variable. - -Note : - the JSONNET server was built and tested only on Windows 7 32 bits, MSVC 2008 - -Philippe Crassous / Ensam ParisTech - Institut Image / 2011 -p.crassous@free.fr - diff --git a/src/vrpn/android_widgets/example_app/.classpath b/src/vrpn/android_widgets/example_app/.classpath deleted file mode 100644 index 986218d3e4aad3a8e5c302fb9d4e35f3696165a9..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/example_app/.classpath +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="gen"/> - <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> - <classpathentry kind="src" path="vrpn_library_src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/src/vrpn/android_widgets/example_app/.project b/src/vrpn/android_widgets/example_app/.project deleted file mode 100644 index 5f27830a5eae58319faa422d675a6006e0ac631a..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/example_app/.project +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>example_app</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.ApkBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>com.android.ide.eclipse.adt.AndroidNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> - <linkedResources> - <link> - <name>vrpn_library_src</name> - <type>2</type> - <locationURI>_android_vrpn_library_5bacf36/src</locationURI> - </link> - </linkedResources> -</projectDescription> diff --git a/src/vrpn/android_widgets/example_app/AndroidManifest.xml b/src/vrpn/android_widgets/example_app/AndroidManifest.xml deleted file mode 100644 index 3ede8d1a69cc98d87acfba8ce2f25196e0a79c98..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/example_app/AndroidManifest.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="test.app1" - android:versionCode="1" - android:versionName="1.0"> - <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:name="eu.ensam.ii.vrpn.VrpnApplication"> - <activity android:name=".MainActivity" android:label="@string/app_name"> - <intent-filter><action android:name="eu.ensam.ii.vrpn.STARTUI"></action> -<category android:name="android.intent.category.DEFAULT"></category> - -<data android:scheme="vrpn"></data> -</intent-filter><intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - -</activity> - - </application> - -<uses-sdk android:minSdkVersion="8"></uses-sdk> -<uses-permission android:name="android.permission.INTERNET"></uses-permission> -</manifest> \ No newline at end of file diff --git a/src/vrpn/android_widgets/example_app/default.properties b/src/vrpn/android_widgets/example_app/default.properties deleted file mode 100644 index edb3ede212759a1c3c311a550ba5043c03b6c30a..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/example_app/default.properties +++ /dev/null @@ -1,12 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-8 -android.library.reference.1=../vrpn_library/ diff --git a/src/vrpn/android_widgets/example_app/proguard.cfg b/src/vrpn/android_widgets/example_app/proguard.cfg deleted file mode 100644 index 12dd0392c055019367e1fede8ad2c2d6e4cbb62c..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/example_app/proguard.cfg +++ /dev/null @@ -1,36 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference --keep public class com.android.vending.licensing.ILicensingService - --keepclasseswithmembernames class * { - native <methods>; -} - --keepclasseswithmembernames class * { - public <init>(android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembernames class * { - public <init>(android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/src/vrpn/android_widgets/example_app/res/drawable-hdpi/icon.png b/src/vrpn/android_widgets/example_app/res/drawable-hdpi/icon.png deleted file mode 100644 index 8074c4c571b8cd19e27f4ee5545df367420686d7..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/example_app/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/src/vrpn/android_widgets/example_app/res/drawable-ldpi/icon.png b/src/vrpn/android_widgets/example_app/res/drawable-ldpi/icon.png deleted file mode 100644 index 1095584ec21f71cd0afc9e0993aa2209671b590c..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/example_app/res/drawable-ldpi/icon.png and /dev/null differ diff --git a/src/vrpn/android_widgets/example_app/res/drawable-mdpi/icon.png b/src/vrpn/android_widgets/example_app/res/drawable-mdpi/icon.png deleted file mode 100644 index a07c69fa5a0f4da5d5efe96eea12a543154dbab6..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/example_app/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/src/vrpn/android_widgets/example_app/res/layout/main.xml b/src/vrpn/android_widgets/example_app/res/layout/main.xml deleted file mode 100644 index 724a303550b2c82b69c10490d3e487c7e300d56c..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/example_app/res/layout/main.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -The following line : - xmlns:app="http://schemas.android.com/apk/res/my.application.package -must be added after the xmlns:android line in the root widget. - -It allows the use of the app: custom attributes -The list of these custom attributes is in vrpn_library/res/values/attrs.xml - --> - -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res/test.app1" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:id="@+id/main_layout" - > - - <TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="Lights" - /> - - <eu.ensam.ii.vrpn.VrpnToggleButton - android:layout_width="wrap_content" - android:layout_height="wrap_content" - app:vrpnButton="@id/VrpnButtonLightsOn" - /> - - <TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="Light intensity" - /> - - <eu.ensam.ii.vrpn.VrpnSeekBar - android:layout_width="fill_parent" - android:layout_height="wrap_content" - app:minValue="0" - app:maxValue="255" - app:defaultValue="128" - app:vrpnAnalog="@id/VrpnAnalogLightIntensity" - /> - - <TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="Tracker" - /> - - <ToggleButton - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:id = "@+id/btnEnableTiltTracker" - /> - - <eu.ensam.ii.vrpn.VrpnSpinner - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:prompt="@string/prompt_material" - android:entries="@array/array_materials" - app:vrpnAnalog="@id/VrpnAnalogMaterial" - /> - - <eu.ensam.ii.vrpn.VrpnSurface - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:background = "#444" - app:leftX="-1" - app:rightX="1" - app:topY="-1" - app:bottomY="1" - app:vrpnAnalogX="@id/VrpnAnalogSurfaceX" - app:vrpnAnalogY="@id/VrpnAnalogSurfaceY" - /> - -</LinearLayout> diff --git a/src/vrpn/android_widgets/example_app/res/values/arrays.xml b/src/vrpn/android_widgets/example_app/res/values/arrays.xml deleted file mode 100644 index d38d1c69c9b0781b782c13dedcf309c8e4b00015..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/example_app/res/values/arrays.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> -<string-array name="array_materials"> - <item>"Plastic"</item> - <item>"Gold"</item> - <item>"Wood"</item> - <item>"Silver"</item> -</string-array> - -</resources> diff --git a/src/vrpn/android_widgets/example_app/res/values/strings.xml b/src/vrpn/android_widgets/example_app/res/values/strings.xml deleted file mode 100644 index f6a52d65a51c3a8af97203962a919d17efd4441b..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/example_app/res/values/strings.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="hello">Hello World, MainActivity!</string> - <string name="app_name">vrpn-test</string> - - -<string name="prompt_material">Choose the material</string> -</resources> diff --git a/src/vrpn/android_widgets/example_app/res/values/vrpn.xml b/src/vrpn/android_widgets/example_app/res/values/vrpn.xml deleted file mode 100644 index 1794985dbafadf9735bee07814a6fabfd60f6aa3..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/example_app/res/values/vrpn.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -Vrpn button numbers. - -Keep them in a single file for easy reference and matching with your C++ code - - --> - -<resources> - -<!-- For SeekBars and Spinners --> -<item type="id" format="integer" name="VrpnAnalogLightIntensity">0</item> -<item type="id" format="integer" name="VrpnAnalogSurfaceX">2</item> -<item type="id" format="integer" name="VrpnAnalogSurfaceY">3</item> -<item type="id" format="integer" name="VrpnAnalogMaterial">4</item> - - -<!-- For RadioButtons, PressButtons, ToggleButtons --> -<item type="id" format="integer" name="VrpnButtonLightsOn">0</item> - - -</resources> diff --git a/src/vrpn/android_widgets/example_app/src/test/app1/MainActivity.java b/src/vrpn/android_widgets/example_app/src/test/app1/MainActivity.java deleted file mode 100644 index f01f7b43af4baf1f3fe6dc503b7d70d7fb08189c..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/example_app/src/test/app1/MainActivity.java +++ /dev/null @@ -1,62 +0,0 @@ -package test.app1; - -import java.net.InetAddress; -import java.net.UnknownHostException; - -import android.app.Activity; -import android.os.Bundle; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.ToggleButton; - -import eu.ensam.ii.vrpn.VrpnClient; - -public class MainActivity extends Activity { - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - /* - * The VrpnClient must be initialized before setContentView, since the views will - * trigger Vrpn updates with their initial value upon creation. - */ - - /* - * The address of the Vrpn server - * When running on the emulator, 10.0.2.2 is loopback on the development machine - */ - InetAddress addr = null; - try { - //addr = InetAddress.getByName("192.168.173.1"); - addr = InetAddress.getByName("10.0.2.2"); - } catch (UnknownHostException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - /* - * The Vrpn server port as defined in vrpn.cfg, on the line - * vrpn_Tracker_JsonNet 7777 - */ - final int port = 7777; - VrpnClient.getInstance().setupVrpnServer(addr, port); - - - /* - * This layout in in res/layout/main.xml by default - */ - setContentView(R.layout.main); - - /* - * Configure the button that controls the tracker - */ - final ToggleButton btn = (ToggleButton) findViewById(R.id.btnEnableTiltTracker); - btn.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - VrpnClient.getInstance().enableTiltTracker(btn.isChecked()); - } - }); - } -} \ No newline at end of file diff --git a/src/vrpn/android_widgets/vrpn_library/.classpath b/src/vrpn/android_widgets/vrpn_library/.classpath deleted file mode 100644 index 53360f9c11ea8ae3978f8dfd1480f0c9fa725ab8..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry excluding="eu/ensam/ii/vrpn/views/VrpnHostActivity.java|eu/ensam/ii/vrpn/DebugSensors.java" kind="src" path="src"/> - <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> - <classpathentry kind="src" path="gen"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/src/vrpn/android_widgets/vrpn_library/.project b/src/vrpn/android_widgets/vrpn_library/.project deleted file mode 100644 index 5d6ab82eb01a5715f3fc857c855029a83f6ffd4d..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/.project +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>vrpn_library</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.ApkBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>com.android.ide.eclipse.adt.AndroidNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/src/vrpn/android_widgets/vrpn_library/AndroidManifest.xml b/src/vrpn/android_widgets/vrpn_library/AndroidManifest.xml deleted file mode 100644 index e0b5682271742b8d9bcd6f7dfc84ed7536006b2e..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/AndroidManifest.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - android:versionCode="1" - android:versionName="1.0" package="eu.ensam.ii.vrpn"> - <application android:icon="@drawable/icon" android:label="@string/app_name"> - - - - - -</application> - - -<uses-sdk android:minSdkVersion="8"></uses-sdk> -</manifest> \ No newline at end of file diff --git a/src/vrpn/android_widgets/vrpn_library/default.properties b/src/vrpn/android_widgets/vrpn_library/default.properties deleted file mode 100644 index 948be06ed73118295cb6f616d9d19a51eac12321..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/default.properties +++ /dev/null @@ -1,12 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-8 -android.library=true diff --git a/src/vrpn/android_widgets/vrpn_library/doc/allclasses-frame.html b/src/vrpn/android_widgets/vrpn_library/doc/allclasses-frame.html deleted file mode 100644 index 296445f5cabdf10ba33bd79cc9e4fb989c953dd1..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/allclasses-frame.html +++ /dev/null @@ -1,45 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -All Classes -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - - -</HEAD> - -<BODY BGCOLOR="white"> -<FONT size="+1" CLASS="FrameHeadingFont"> -<B>All Classes</B></FONT> -<BR> - -<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> -<TR> -<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="eu/ensam/ii/vrpn/VrpnApplication.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnApplication</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnClient</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnPressButton</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnRadioButton</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnSeekBar</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnSpinner</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnSurface</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnToggleButton</A> -<BR> -</FONT></TD> -</TR> -</TABLE> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/allclasses-noframe.html b/src/vrpn/android_widgets/vrpn_library/doc/allclasses-noframe.html deleted file mode 100644 index a6160057852fe65b5f2b69ee88f6a4ba3331802a..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/allclasses-noframe.html +++ /dev/null @@ -1,45 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -All Classes -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - - -</HEAD> - -<BODY BGCOLOR="white"> -<FONT size="+1" CLASS="FrameHeadingFont"> -<B>All Classes</B></FONT> -<BR> - -<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> -<TR> -<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="eu/ensam/ii/vrpn/VrpnApplication.html" title="class in eu.ensam.ii.vrpn">VrpnApplication</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn">VrpnPressButton</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn">VrpnRadioButton</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn">VrpnSeekBar</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn">VrpnSpinner</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn">VrpnSurface</A> -<BR> -<A HREF="eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn">VrpnToggleButton</A> -<BR> -</FONT></TD> -</TR> -</TABLE> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/constant-values.html b/src/vrpn/android_widgets/vrpn_library/doc/constant-values.html deleted file mode 100644 index 8fa28b26136d83f9fcf2780d5bd61736499bc0be..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/constant-values.html +++ /dev/null @@ -1,144 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -Constant Field Values -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Constant Field Values"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A> - <A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H1> -Constant Field Values</H1> -</CENTER> -<HR SIZE="4" NOSHADE> -<B>Contents</B><UL> -</UL> - -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A> - <A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/deprecated-list.html b/src/vrpn/android_widgets/vrpn_library/doc/deprecated-list.html deleted file mode 100644 index d3da577b06c7ffa74786d2e5737374f5b3974a13..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/deprecated-list.html +++ /dev/null @@ -1,144 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -Deprecated List -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Deprecated List"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?deprecated-list.html" target="_top"><B>FRAMES</B></A> - <A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -<B>Deprecated API</B></H2> -</CENTER> -<HR SIZE="4" NOSHADE> -<B>Contents</B><UL> -</UL> - -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?deprecated-list.html" target="_top"><B>FRAMES</B></A> - <A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnApplication.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnApplication.html deleted file mode 100644 index 52130ec97d0853072efd1496fe0f3b3094d8e710..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnApplication.html +++ /dev/null @@ -1,267 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -VrpnApplication -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="VrpnApplication"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnApplication.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV CLASS - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnApplication.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnApplication.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -eu.ensam.ii.vrpn</FONT> -<BR> -Class VrpnApplication</H2> -<PRE> -<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/Application.html?is-external=true" title="class or interface in android.app">android.app.Application</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>eu.ensam.ii.vrpn.VrpnApplication</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>VrpnApplication</B><DT>extends <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/Application.html?is-external=true" title="class or interface in android.app">Application</A></DL> -</PRE> - -<P> -This class must be used as an <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/Application.html?is-external=true" title="class or interface in android.app"><CODE>Application</CODE></A> for applications that use the Vrpn widgets. - <p> - - An application that wants to use the Vrpn widgets must define an - <em>application</em> tag with the name of this class in its manifest : - </p> - <ul> - <li>edit your application <em>AndroidManifext.xml</em> and open the <em>Application</em> tab</li> - <li>in the <em>Application toggle</em> section , check - <em>Define an <application> tag ...</em></li> - <li>in the <em>Application Attributes</em> section, type <em>eu.ensam.ii.vrpn.VrpnApplication</em> as the value of the - <em>Name</em> attribute or use the <em>Browse...<em>button</li> - </ul> -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnApplication.html#VrpnApplication()">VrpnApplication</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnApplication.html#onCreate()">onCreate</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="VrpnApplication()"><!-- --></A><H3> -VrpnApplication</H3> -<PRE> -public <B>VrpnApplication</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="onCreate()"><!-- --></A><H3> -onCreate</H3> -<PRE> -public void <B>onCreate</B>()</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnApplication.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV CLASS - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnApplication.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnApplication.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnClient.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnClient.html deleted file mode 100644 index 7a3fbdacdcff2c71867e142cab9fe4d73d57ef2e..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnClient.html +++ /dev/null @@ -1,407 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -VrpnClient -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="VrpnClient"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnClient.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnApplication.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnClient.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnClient.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -eu.ensam.ii.vrpn</FONT> -<BR> -Class VrpnClient</H2> -<PRE> -<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>eu.ensam.ii.vrpn.VrpnClient</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>VrpnClient</B><DT>extends <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL> -</PRE> - -<P> -Send updates button, analog and tracker updates to the JsonNet Vrpn server. - - <p> - A application that uses the Vrpn widgets must initialize the unique instance - of this class by calling <CODE>setUri</CODE> before the - widgets are used. - </p> - <p> - This class is not thread-safe. The methods <code>sendButton</code> and - <code>sendAnalog</code> must be called from the main UI thread - </p> - <p> - Currently the messages neither include a timestamp nor a sequence number - </p> - - TODO Add timestamps and sequence numbers Add a method to allow sending TODO - tracker updates from the widgets -<P> - -<P> -<HR> - -<P> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html#enableTiltTracker(boolean)">enableTiltTracker</A></B>(boolean enable)</CODE> - -<BR> - Enables or disable the tilt tracker.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static <A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A></CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html#getInstance()">getInstance</A></B>()</CODE> - -<BR> - Returns the unique VrpnClient instance</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html#onAccuracyChanged(Sensor, int)">onAccuracyChanged</A></B>(Sensor sensor, - int accuracy)</CODE> - -<BR> - Called by the system when the sensor accuracy changes - - This method is empty and should not be called by widgets</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html#onSensorChanged(SensorEvent)">onSensorChanged</A></B>(SensorEvent event)</CODE> - -<BR> - Called by the system when a sensor data changes.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html#sendAnalog(int, double)">sendAnalog</A></B>(int channelId, - double channelValue)</CODE> - -<BR> - Send an update to a Vrpn Analog channel.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html#sendButton(int, boolean)">sendButton</A></B>(int buttonId, - boolean buttonState)</CODE> - -<BR> - Send an update to a Vrpn Button.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html#setupVrpnServer(java.net.InetAddress, int)">setupVrpnServer</A></B>(<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/net/InetAddress.html?is-external=true" title="class or interface in java.net">InetAddress</A> hostAddress, - int port)</CODE> - -<BR> - Initializes the address and port of the VRPN server.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="getInstance()"><!-- --></A><H3> -getInstance</H3> -<PRE> -public static <A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A> <B>getInstance</B>()</PRE> -<DL> -<DD>Returns the unique VrpnClient instance -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="setupVrpnServer(java.net.InetAddress, int)"><!-- --></A><H3> -setupVrpnServer</H3> -<PRE> -public void <B>setupVrpnServer</B>(<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/net/InetAddress.html?is-external=true" title="class or interface in java.net">InetAddress</A> hostAddress, - int port)</PRE> -<DL> -<DD>Initializes the address and port of the VRPN server. - - <p> - This method must be called before sending any update to the server. - </p> - Note that the widgets trigger updates when they they are displayed for - the first time. So this method must be called before calling - <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/Activity.html?is-external=true#setContentView(int)" title="class or interface in android.app"><CODE>setContentView</CODE></A> in the - main <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/Activity.html?is-external=true" title="class or interface in android.app"><CODE>activity</CODE></A> - <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/Activity.html?is-external=true#onCreate" title="class or interface in android.app"><CODE>setContentView</CODE></A> - <code>onCreate</code> method -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>host</CODE> - a string that is a valid host name or IP address<DD><CODE>port</CODE> - the port number of the VRPN server</DL> -</DD> -</DL> -<HR> - -<A NAME="sendButton(int, boolean)"><!-- --></A><H3> -sendButton</H3> -<PRE> -public void <B>sendButton</B>(int buttonId, - boolean buttonState)</PRE> -<DL> -<DD>Send an update to a Vrpn Button. - - This update will trigger a button callback on the application side -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>buttonId</CODE> - the button number. Invalid button numbers are ignored on this - side, but may trigger an error message on the Vrpn server<DD><CODE>buttonState</CODE> - the new status of the button</DL> -</DD> -</DL> -<HR> - -<A NAME="sendAnalog(int, double)"><!-- --></A><H3> -sendAnalog</H3> -<PRE> -public void <B>sendAnalog</B>(int channelId, - double channelValue)</PRE> -<DL> -<DD>Send an update to a Vrpn Analog channel. - - This update will trigger an analog callback on the application side -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>channelId</CODE> - The channel number. Invalid channel numbers are ignored on - this side but, they may trigger an error message on the Vrpn - server<DD><CODE>channelValue</CODE> - the data that will be sent on the analog channel</DL> -</DD> -</DL> -<HR> - -<A NAME="enableTiltTracker(boolean)"><!-- --></A><H3> -enableTiltTracker</H3> -<PRE> -public void <B>enableTiltTracker</B>(boolean enable)</PRE> -<DL> -<DD>Enables or disable the tilt tracker. - - The tilt tracker send a tracker update with a quaternion that rotates the - "earth vertical up" vector to the +Z vector in device coordinates. See - <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/hardware/SensorEvent.html?is-external=true" title="class or interface in android.hardware"><CODE>SensorEvent</CODE></A> for a description of the - device coordinate system. This quaternion can be used to retrieve the - roll and pitch of the device. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>enable</CODE> - <code>true</code> enables the tilt tracker updates and - <code>false</code> disable the tilt tracker updates</DL> -</DD> -</DL> -<HR> - -<A NAME="onAccuracyChanged(Sensor, int)"><!-- --></A><H3> -onAccuracyChanged</H3> -<PRE> -public void <B>onAccuracyChanged</B>(Sensor sensor, - int accuracy)</PRE> -<DL> -<DD>Called by the system when the sensor accuracy changes - - This method is empty and should not be called by widgets -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="onSensorChanged(SensorEvent)"><!-- --></A><H3> -onSensorChanged</H3> -<PRE> -public void <B>onSensorChanged</B>(SensorEvent event)</PRE> -<DL> -<DD>Called by the system when a sensor data changes. - - This method retrieves the Android sensor object. If an vrpn Tracker is - active that involves this sensor object this method sends a Vrpn tracker - update to the appropriate tracker. packages the sensor data into a JSON - object then send the JSON object onto an UDP socket. The target socket - endpoint configuration is configured by calling setupVrpnServer -<P> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnClient.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnApplication.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnClient.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnClient.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnPressButton.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnPressButton.html deleted file mode 100644 index d88ac26c389151a73b929ce911ee503025efd5c2..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnPressButton.html +++ /dev/null @@ -1,338 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -VrpnPressButton -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="VrpnPressButton"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnPressButton.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnPressButton.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnPressButton.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -eu.ensam.ii.vrpn</FONT> -<BR> -Class VrpnPressButton</H2> -<PRE> -<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Button.html?is-external=true" title="class or interface in android.widget">android.widget.Button</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>eu.ensam.ii.vrpn.VrpnPressButton</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>VrpnPressButton</B><DT>extends <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Button.html?is-external=true" title="class or interface in android.widget">Button</A></DL> -</PRE> - -<P> -A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Button.html?is-external=true" title="class or interface in android.widget"><CODE>Button</CODE></A> connected to a VRPN Button. - - <p> - This button is linked to a Vrpn button. It sends sends a <code>true</code> - update when its status changes to checked and a <code>false</code> update - when its status changes to unchecked. The status of the VrpnPressButton - changes when it is pushed, and also when it is released, unlike a - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn"><CODE>VrpnToggleButton</CODE></A>. - </p> - - <p> - In your <code>res/layout.xml</code>, include the widget in - its parent layout : - </p> - <pre> - <eu.ensam.ii.VrpnPressButton - android:layout_width="fill_parent" - android:layout_height="wrap_content" - app:vrpnButton="@id/MyButton" - /> - </pre> - - <p> - The root element of the layout must declare the following line just after the - <code>xmlns:android ... </code>line : - - <pre> - xmlns:app="http://schemas.android.com/apk/res/your.package.name.here" - </pre> - - </p> - - <p> - <strong>Custom XML attributes :</strong> - </p> - <ul> - <li><code>app:vrpnButton</code> : the id of the Vrpn button that will receive - updated from this widget. This value can be a literal or a resource Id that - can be kept in a <a href="package-summary.html#vrpnids">separate Vrpn Id - list</a></li> - </ul> -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnPressButton.html#VrpnPressButton(Context)">VrpnPressButton</A></B>(Context context)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnPressButton.html#VrpnPressButton(Context, AttributeSet)">VrpnPressButton</A></B>(Context context, - AttributeSet attrs)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnPressButton.html#VrpnPressButton(Context, AttributeSet, int)">VrpnPressButton</A></B>(Context context, - AttributeSet attrs, - int defStyle)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> boolean</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnPressButton.html#onTouch(View, MotionEvent)">onTouch</A></B>(View v, - MotionEvent event)</CODE> - -<BR> - Called when a touch event is dispatched to this VrpnPressButton.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="VrpnPressButton(Context)"><!-- --></A><H3> -VrpnPressButton</H3> -<PRE> -public <B>VrpnPressButton</B>(Context context)</PRE> -<DL> -</DL> -<HR> - -<A NAME="VrpnPressButton(Context, AttributeSet)"><!-- --></A><H3> -VrpnPressButton</H3> -<PRE> -public <B>VrpnPressButton</B>(Context context, - AttributeSet attrs)</PRE> -<DL> -</DL> -<HR> - -<A NAME="VrpnPressButton(Context, AttributeSet, int)"><!-- --></A><H3> -VrpnPressButton</H3> -<PRE> -public <B>VrpnPressButton</B>(Context context, - AttributeSet attrs, - int defStyle)</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="onTouch(View, MotionEvent)"><!-- --></A><H3> -onTouch</H3> -<PRE> -public boolean <B>onTouch</B>(View v, - MotionEvent event)</PRE> -<DL> -<DD>Called when a touch event is dispatched to this VrpnPressButton. - - This method sends a <code>true</code> update when the button is pressed - and a <code>false</code> update when the button is released. when it is - released. No event is send while the button is pressed. -<P> -<DD><DL> -<DT><B>See Also:</B><DD><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/View.OnTouchListener.html?is-external=true#onTouch(android.view.View, - android.view.MotionEvent)" title="class or interface in android.view"><CODE>View.OnTouchListener</CODE></A></DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnPressButton.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnPressButton.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnPressButton.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnRadioButton.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnRadioButton.html deleted file mode 100644 index c1fcaf008f16faba37ef8ff40064ecab94871e5a..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnRadioButton.html +++ /dev/null @@ -1,342 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -VrpnRadioButton -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="VrpnRadioButton"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnRadioButton.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnRadioButton.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnRadioButton.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -eu.ensam.ii.vrpn</FONT> -<BR> -Class VrpnRadioButton</H2> -<PRE> -<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/RadioButton.html?is-external=true" title="class or interface in android.widget">android.widget.RadioButton</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>eu.ensam.ii.vrpn.VrpnRadioButton</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>VrpnRadioButton</B><DT>extends <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/RadioButton.html?is-external=true" title="class or interface in android.widget">RadioButton</A></DL> -</PRE> - -<P> -A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/RadioButton.html?is-external=true" title="class or interface in android.widget"><CODE>RadioButton</CODE></A> that updates a Vrpn Button channel. - - <p> - The <code>VrpnRadioButton</code> is to be included inside a <CODE>RadioGroup</CODE>. The - <code>VrpnRadioButton</code> will send a <code>true</code> when its state changes to - checked and a <code> false</code> update when its state changes to unchecked. - Checking another button of the <code>RadioGroup</code> will uncheck the <code>RadioButton</code>.</p> - <p>in a <code>RadioGroup</code>, it is possible to include : - <ul> - <li>a <code>VrpnRadiobutton</code> and a <code>RadioButton</code>. Checking the <code>RadioButton</code> will uncheck the <code>VrpnRadioButton</code> that will send an update</li> - <li>several <code>VrpnRadioButton</code> widgets. In this case the checked and the unchecked widgets will send updates</li> - </ul> - </p> - <p> - In your layout, declare the following : - </p> - - <pre> - <RadioGroup - android:id="@+id/RadioGroup01" - > - <eu.ensam.ii.vrpn.VrpnRadioButton - android:text="This way" - android:checked="true" - app:vrpnButton="@id/VrpnButtonThisWay" - /> - <RadioButton - android:text="other Way" - android:checked="false" - /> - </RadioGroup> - </pre> - - <p> - The root element of the layout must declare the following line just after the - <code>xmlns:android ... </code>line : - - <pre> - xmlns:app="http://schemas.android.com/apk/res/your.package.name.here" - </pre> - - </p> - - <p> - <strong>Custom XML attributes :</strong> - </p> - <ul> - <li><code>app:vrpnButton</code> : the id of the Vrpn button that will receive - updated from this widget. This value can be a literal or a resource Id that - can be kept in a <a href="package-summary.html#vrpnids">separate Vrpn Id - list</a></li> - </ul> -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnRadioButton.html#VrpnRadioButton(Context)">VrpnRadioButton</A></B>(Context context)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnRadioButton.html#VrpnRadioButton(Context, AttributeSet)">VrpnRadioButton</A></B>(Context context, - AttributeSet attrs)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnRadioButton.html#VrpnRadioButton(Context, AttributeSet, int)">VrpnRadioButton</A></B>(Context context, - AttributeSet attrs, - int defStyle)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnRadioButton.html#onCheckedChanged(CompoundButton, boolean)">onCheckedChanged</A></B>(CompoundButton buttonView, - boolean isChecked)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="VrpnRadioButton(Context)"><!-- --></A><H3> -VrpnRadioButton</H3> -<PRE> -public <B>VrpnRadioButton</B>(Context context)</PRE> -<DL> -</DL> -<HR> - -<A NAME="VrpnRadioButton(Context, AttributeSet)"><!-- --></A><H3> -VrpnRadioButton</H3> -<PRE> -public <B>VrpnRadioButton</B>(Context context, - AttributeSet attrs)</PRE> -<DL> -</DL> -<HR> - -<A NAME="VrpnRadioButton(Context, AttributeSet, int)"><!-- --></A><H3> -VrpnRadioButton</H3> -<PRE> -public <B>VrpnRadioButton</B>(Context context, - AttributeSet attrs, - int defStyle)</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="onCheckedChanged(CompoundButton, boolean)"><!-- --></A><H3> -onCheckedChanged</H3> -<PRE> -public void <B>onCheckedChanged</B>(CompoundButton buttonView, - boolean isChecked)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnRadioButton.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnRadioButton.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnRadioButton.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnSeekBar.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnSeekBar.html deleted file mode 100644 index 4941537760650ccbf8cd054a92e5135c1fc1fba2..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnSeekBar.html +++ /dev/null @@ -1,380 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -VrpnSeekBar -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="VrpnSeekBar"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnSeekBar.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnSeekBar.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnSeekBar.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -eu.ensam.ii.vrpn</FONT> -<BR> -Class VrpnSeekBar</H2> -<PRE> -<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/LinearLayout.html?is-external=true" title="class or interface in android.widget">android.widget.LinearLayout</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>eu.ensam.ii.vrpn.VrpnSeekBar</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>VrpnSeekBar</B><DT>extends <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/LinearLayout.html?is-external=true" title="class or interface in android.widget">LinearLayout</A></DL> -</PRE> - -<P> -A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/SeekBar.html?is-external=true" title="class or interface in android.widget"><CODE>SeekBar</CODE></A> that updates a Vrpn Analog channel. - - <p> - The seekbar include a line with the min, max and current - values of the seekbar, and the seekbar itself. - - The seekbar progress is converted into a value in the - <code>app:minValue</code> .. <code>app:maxValue</code> - range. This value is then sent out to the Vrpn Analog channel whose - id is specified in the <code>app:vrpnAnalog</code> attribute. The <code>VrpnSeekBar</code> - moves in increments that are one hundredth of the value range. - </p> - <p> - In your layout, declare the following (note the app:attributes) - </p> - - <pre> - <eu.ensam.ii.vrpn.VrpnSeekBar - android:layout_width="fill_parent" - android:layout_height="wrap_content" - app:minValue="-3" - app:minValue="3" - app:minValue="0" - app:vrpnAnalog="@id/MyVrpnAnalogId" - /> - </pre> - - <p> - The root element of the layout must declare the following line just after the - <code>xmlns:android ... </code>line : - - <pre> - xmlns:app="http://schemas.android.com/apk/res/your.package.name.here" - </pre> - - </p> - - <p> - <strong>Custom XML attributes :</strong> - </p> - <ul> - <li><code>app:vrpnAnalog</code> : the id of the Vrpn analog that will receive - updates from this widget. This value can be a literal or a resource Id that - can be kept in a <a href="package-summary.html#vrpnids">separate Vrpn Id - list</a></li> - <li><code>app:minValue</code> : the numeric value mapped onto the left - position of the VrpnSeekbar</li> - <li><code>app:maxValue</code> : the numeric value mapped onto the left - position of the VrpnSeekbar</li> - <li><code>app:defaultValue</code> : the initial numeric value of the VrpnSeekbar;</li> - <li><code>app:hideValues</code> : <code>true</code> will cause the line with - the minimum, maximum and current values to be hidden, <code>false</code> will cause - the line to be displayed (default)</li> - </ul> -<P> - -<P> -<DL> -<DT><B>Author:</B></DT> - <DD>Philippe</DD> -</DL> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html#VrpnSeekBar(Context)">VrpnSeekBar</A></B>(Context context)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html#VrpnSeekBar(Context, AttributeSet)">VrpnSeekBar</A></B>(Context context, - AttributeSet attrs)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html#onProgressChanged(SeekBar, int, boolean)">onProgressChanged</A></B>(SeekBar seekBar, - int progress, - boolean fromUser)</CODE> - -<BR> - Called when the progress of the SeekBar changes - - Compute the value from the progress and send a VrpnUpdate to the analog - channel that is associated to the widget with the custom attribute - app:vrpnAnalog</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html#onStartTrackingTouch(SeekBar)">onStartTrackingTouch</A></B>(SeekBar seekBar)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html#onStopTrackingTouch(SeekBar)">onStopTrackingTouch</A></B>(SeekBar seekBar)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="VrpnSeekBar(Context)"><!-- --></A><H3> -VrpnSeekBar</H3> -<PRE> -public <B>VrpnSeekBar</B>(Context context)</PRE> -<DL> -</DL> -<HR> - -<A NAME="VrpnSeekBar(Context, AttributeSet)"><!-- --></A><H3> -VrpnSeekBar</H3> -<PRE> -public <B>VrpnSeekBar</B>(Context context, - AttributeSet attrs)</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="onProgressChanged(SeekBar, int, boolean)"><!-- --></A><H3> -onProgressChanged</H3> -<PRE> -public void <B>onProgressChanged</B>(SeekBar seekBar, - int progress, - boolean fromUser)</PRE> -<DL> -<DD>Called when the progress of the SeekBar changes - - Compute the value from the progress and send a VrpnUpdate to the analog - channel that is associated to the widget with the custom attribute - app:vrpnAnalog -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="onStartTrackingTouch(SeekBar)"><!-- --></A><H3> -onStartTrackingTouch</H3> -<PRE> -public void <B>onStartTrackingTouch</B>(SeekBar seekBar)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="onStopTrackingTouch(SeekBar)"><!-- --></A><H3> -onStopTrackingTouch</H3> -<PRE> -public void <B>onStopTrackingTouch</B>(SeekBar seekBar)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnSeekBar.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnSeekBar.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnSeekBar.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnSpinner.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnSpinner.html deleted file mode 100644 index f954e09f905d5bde2d8094ba14808feebc556dd9..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnSpinner.html +++ /dev/null @@ -1,340 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -VrpnSpinner -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="VrpnSpinner"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnSpinner.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnSpinner.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnSpinner.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -eu.ensam.ii.vrpn</FONT> -<BR> -Class VrpnSpinner</H2> -<PRE> -<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Spinner.html?is-external=true" title="class or interface in android.widget">android.widget.Spinner</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>eu.ensam.ii.vrpn.VrpnSpinner</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>VrpnSpinner</B><DT>extends <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Spinner.html?is-external=true" title="class or interface in android.widget">Spinner</A></DL> -</PRE> - -<P> -A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Spinner.html?is-external=true" title="class or interface in android.widget"><CODE>Spinner</CODE></A> that updates a Vrpn Analog channel. - - <p> - Picking a value from the spinner will update a Vrpn Analog channel with the - position of the item that was picked in the item list. On the application side, the value will be delivered as a <em>double</em>. - </p> - <p> - In your layout, declare the following : - </p> - - <pre> - <eu.ensam.ii.vrpn.VrpnSpinner - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:prompt="@string/the_prompt" - android:entries="@array/the_array" - app:vrpnAnalog="@id/VrpnAnalogMySpinner" - /> - </pre> - - In a resource XML file located in <em>res/values</em>, define the prompt that - will be displayed in the choice dialog, as well as the list of values to choose from.</p>< - - <pre> - <string name="the_prompt">Message displayed when the choice dialog is opened</string> - <string-array name="the_array"> - <item>"Mars"</item> - <item>"Venus"</item> - </string-array> - </pre> - <p> - The root element of the layout must declare the following line just after the - <code>xmlns:android ... </code>line :</p> - <pre> - xmlns:app="http://schemas.android.com/apk/res/your.package.name.here" - </pre> - <p> - <strong>Custom XML attributes :</strong> - </p> - <ul> - <li><code>app:vrpnAnalog</code> : the id of the Vrpn analog that will receive - updated from this widget. This value can be a literal or a resource Id that - can be kept in a <a href="package-summary.html#vrpnids">separate Vrpn Id - list</a></li> - </ul> -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSpinner.html#VrpnSpinner(Context)">VrpnSpinner</A></B>(Context context)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSpinner.html#VrpnSpinner(Context, AttributeSet)">VrpnSpinner</A></B>(Context context, - AttributeSet attrs)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSpinner.html#onItemSelected(, View, int, long)">onItemSelected</A></B>(<any> parent, - View view, - int position, - long id)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSpinner.html#onNothingSelected()">onNothingSelected</A></B>(<any> arg0)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="VrpnSpinner(Context)"><!-- --></A><H3> -VrpnSpinner</H3> -<PRE> -public <B>VrpnSpinner</B>(Context context)</PRE> -<DL> -</DL> -<HR> - -<A NAME="VrpnSpinner(Context, AttributeSet)"><!-- --></A><H3> -VrpnSpinner</H3> -<PRE> -public <B>VrpnSpinner</B>(Context context, - AttributeSet attrs)</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="onItemSelected(, View, int, long)"><!-- --></A><H3> -onItemSelected</H3> -<PRE> -public void <B>onItemSelected</B>(<any> parent, - View view, - int position, - long id)</PRE> -<DL> -<DD><DL> -<DT><B>See Also:</B><DD><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/AdapterView.OnItemSelectedListener.html?is-external=true#onItemSelected(android.widget.AdapterView, android.view.View, int, long)" title="class or interface in android.widget"><CODE>AdapterView.OnItemSelectedListener</CODE></A></DL> -</DD> -</DL> -<HR> - -<A NAME="onNothingSelected()"><!-- --></A><H3> -onNothingSelected</H3> -<PRE> -public void <B>onNothingSelected</B>(<any> arg0)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnSpinner.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnSpinner.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnSpinner.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnSurface.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnSurface.html deleted file mode 100644 index 44dec219233d1c6f20f3c8f268c751f6d6e6f1cc..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnSurface.html +++ /dev/null @@ -1,363 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -VrpnSurface -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="VrpnSurface"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnSurface.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnSurface.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnSurface.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -eu.ensam.ii.vrpn</FONT> -<BR> -Class VrpnSurface</H2> -<PRE> -<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/SurfaceView.html?is-external=true" title="class or interface in android.view">android.view.SurfaceView</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>eu.ensam.ii.vrpn.VrpnSurface</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>VrpnSurface</B><DT>extends <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/SurfaceView.html?is-external=true" title="class or interface in android.view">SurfaceView</A></DL> -</PRE> - -<P> -This <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/SurfaceView.html?is-external=true" title="class or interface in android.view"><CODE>SurfaceView</CODE></A> updates two Vrpn Analog channels with the coordinates of the - Surface point that is touched. - - <p> - Updates are sent as long astouch events occur within the surface. The - X channel range from - <code>app:leftX</code> to <code>app:rightX</code>, - and the Y channel values range from <code>app:topY</code> to - <code>app:bottomY</code>. - </p> - - <p> - In your layout, declare the following (note the <code>app:</code> attributes) - </p> - - <pre> - <eu.ensam.ii.vrpn.VrpnSurface - android:layout_width="fill_parent" - android:layout_height="fill_parent" - app:leftX="-1" - app:rightX="1" - app:topY="0" - app:bottomY="1" - app:vrpnAnalogX="@id/MyVrpnAnalogX" - app:vrpnAnalogY="@id/MyVrpnAnalogY" - /> - </pre> - - <p> - - <p> - The root element of the layout must declare the following line just after the - <code>xmlns:android ... </code>line : - <pre> - xmlns:app="http://schemas.android.com/apk/res/your.package.name.here" - </pre> - </p> - - <p> - <strong>Custom XML attributes :</strong> - </p> - <ul> - <li><code>app:vrpnAnalogX</code> : the id of the Vrpn analog that will - receive the X position of the touch event from this widget. The update value - sent to the Vrpn analog ranges from the <code>app:leftX</code> value to the - <code>app:rightX</code> value.</li> - <li><code>app:vrpnAnalogY</code> : the id of the Vrpn analog that will - receive the Y position of the touch event from this widget. The update value - sent to the Vrpn analog ranges from the <code>app:bottomY</code> value to the - <code>app:topX</code> value.</li> - <li><code>app:leftX</code> : the numeric value mapped onto the left border of - the surface.</li> - <li><code>app:rightX</code> : the numeric value mapped onto the right border - of the surface. May be greater or lower than <code>app:leftX</code>.</li> - <li><code>app:bottomY</code> : the numeric value mapped onto the top border - of the surface</li> - <li><code>app:topY</code> : the numeric value mapped onto the top border of - the surface. May be greater or lower than <code>app:bottomY</code></li> - </ul> - - The <code>app:vrpnAnalogX</code> and <code>app:vrpnAnalogY</code> ids can be - literals or a resource Ids. These resource ids may be kept in a <a - href="package-summary.html#vrpnids">separate Vrpn Id list</a> -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSurface.html#VrpnSurface(Context)">VrpnSurface</A></B>(Context context)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSurface.html#VrpnSurface(Context, AttributeSet)">VrpnSurface</A></B>(Context context, - AttributeSet attrs)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSurface.html#VrpnSurface(Context, AttributeSet, int)">VrpnSurface</A></B>(Context context, - AttributeSet attrs, - int defStyle)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> boolean</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSurface.html#onTouch(View, MotionEvent)">onTouch</A></B>(View v, - MotionEvent event)</CODE> - -<BR> - Called when a touch event is dispatched to this widget.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="VrpnSurface(Context)"><!-- --></A><H3> -VrpnSurface</H3> -<PRE> -public <B>VrpnSurface</B>(Context context)</PRE> -<DL> -</DL> -<HR> - -<A NAME="VrpnSurface(Context, AttributeSet)"><!-- --></A><H3> -VrpnSurface</H3> -<PRE> -public <B>VrpnSurface</B>(Context context, - AttributeSet attrs)</PRE> -<DL> -</DL> -<HR> - -<A NAME="VrpnSurface(Context, AttributeSet, int)"><!-- --></A><H3> -VrpnSurface</H3> -<PRE> -public <B>VrpnSurface</B>(Context context, - AttributeSet attrs, - int defStyle)</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="onTouch(View, MotionEvent)"><!-- --></A><H3> -onTouch</H3> -<PRE> -public boolean <B>onTouch</B>(View v, - MotionEvent event)</PRE> -<DL> -<DD>Called when a touch event is dispatched to this widget. - - <p> - If the touch event occurs within the surface of the view, two analog Vrpn - updates are send for the X and y position. Updates are sent when - ACTION_DOWN, ACTION_MOVE, and ACTION_UP are received. the event history - is ignored. - </p> -<P> -<DD><DL> -<DT><B>See Also:</B><DD><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/View.OnTouchListener.html?is-external=true#onTouch(View, MotionEvent)" title="class or interface in android.view"><CODE>View.OnTouchListener</CODE></A>, -<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/MotionEvent.html?is-external=true" title="class or interface in android.view"><CODE>MotionEvent</CODE></A></DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnSurface.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnSurface.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnSurface.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnToggleButton.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnToggleButton.html deleted file mode 100644 index e57fa90af2a32302d772425caadff99f53047f4e..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnToggleButton.html +++ /dev/null @@ -1,324 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -VrpnToggleButton -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="VrpnToggleButton"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnToggleButton.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - NEXT CLASS</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnToggleButton.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnToggleButton.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -eu.ensam.ii.vrpn</FONT> -<BR> -Class VrpnToggleButton</H2> -<PRE> -<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/ToggleButton.html?is-external=true" title="class or interface in android.widget">android.widget.ToggleButton</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>eu.ensam.ii.vrpn.VrpnToggleButton</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>VrpnToggleButton</B><DT>extends <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/ToggleButton.html?is-external=true" title="class or interface in android.widget">ToggleButton</A></DL> -</PRE> - -<P> -A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/ToggleButton.html?is-external=true" title="class or interface in android.view"><CODE>ToggleButton</CODE></A> connected to a Vrpn Button. - - <p> - This button sends a true update when its status changes to checked and false - when its status changes to unchecked. Unlike a - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn"><CODE>VrpnPressButton</CODE></A>, the status of this widget changes when it is - pressed, but not when it is released, - </p> - - <p> - In your layout XML file, include the following into a container widget : - <pre> - <eu.ensam.ii.vrpn.VrpnButton - app:vrpnButton="@id/MyButton" - /> - </pre> - <p> - The root element of the layout must declare the following line just after the - <code>xmlns:android ... </code>line : - <pre> - xmlns:app="http://schemas.android.com/apk/res/your.package.name.here" - </pre> - - </p> - - <p> - <strong>Custom XML attributes :</strong> - </p> - <ul> - <li><code>app:vrpnButton</code> : the id of the Vrpn button that will receive - updated from this widget. This value can be a literal or a resource Id that - can be kept in a <a href="package-summary.html#vrpnids">separate Vrpn Id - list</a></li> - </ul> -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html#VrpnToggleButton(Context)">VrpnToggleButton</A></B>(Context context)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html#VrpnToggleButton(Context, AttributeSet)">VrpnToggleButton</A></B>(Context context, - AttributeSet attrs)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html#VrpnToggleButton(Context, AttributeSet, int)">VrpnToggleButton</A></B>(Context context, - AttributeSet attrs, - int defStyle)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html#onCheckedChanged(CompoundButton, boolean)">onCheckedChanged</A></B>(CompoundButton buttonView, - boolean isChecked)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="VrpnToggleButton(Context)"><!-- --></A><H3> -VrpnToggleButton</H3> -<PRE> -public <B>VrpnToggleButton</B>(Context context)</PRE> -<DL> -</DL> -<HR> - -<A NAME="VrpnToggleButton(Context, AttributeSet)"><!-- --></A><H3> -VrpnToggleButton</H3> -<PRE> -public <B>VrpnToggleButton</B>(Context context, - AttributeSet attrs)</PRE> -<DL> -</DL> -<HR> - -<A NAME="VrpnToggleButton(Context, AttributeSet, int)"><!-- --></A><H3> -VrpnToggleButton</H3> -<PRE> -public <B>VrpnToggleButton</B>(Context context, - AttributeSet attrs, - int defStyle)</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="onCheckedChanged(CompoundButton, boolean)"><!-- --></A><H3> -onCheckedChanged</H3> -<PRE> -public void <B>onCheckedChanged</B>(CompoundButton buttonView, - boolean isChecked)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VrpnToggleButton.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn"><B>PREV CLASS</B></A> - NEXT CLASS</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/VrpnToggleButton.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnToggleButton.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnApplication.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnApplication.html deleted file mode 100644 index 26805fd26455951f42e65e0daf0ff9c7913424ab..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnApplication.html +++ /dev/null @@ -1,142 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -Uses of Class eu.ensam.ii.vrpn.VrpnApplication -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Uses of Class eu.ensam.ii.vrpn.VrpnApplication"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnApplication.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnApplication.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnApplication.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -<B>Uses of Class<br>eu.ensam.ii.vrpn.VrpnApplication</B></H2> -</CENTER> -No usage of eu.ensam.ii.vrpn.VrpnApplication -<P> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnApplication.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnApplication.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnApplication.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnClient.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnClient.html deleted file mode 100644 index 84c1c098a163779566bff24fdccc03ab2555a1c1..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnClient.html +++ /dev/null @@ -1,165 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -Uses of Class eu.ensam.ii.vrpn.VrpnClient -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Uses of Class eu.ensam.ii.vrpn.VrpnClient"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnClient.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnClient.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -<B>Uses of Class<br>eu.ensam.ii.vrpn.VrpnClient</B></H2> -</CENTER> -<A NAME="eu.ensam.ii.vrpn"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -Uses of <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A> in <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html">eu.ensam.ii.vrpn</A></FONT></TH> -</TR> -</TABLE> - -<P> - -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html">eu.ensam.ii.vrpn</A> that return <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A></CODE></FONT></TD> -<TD><CODE><B>VrpnClient.</B><B><A HREF="../../../../../eu/ensam/ii/vrpn/VrpnClient.html#getInstance()">getInstance</A></B>()</CODE> - -<BR> - Returns the unique VrpnClient instance</TD> -</TR> -</TABLE> - -<P> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnClient.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnClient.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnPressButton.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnPressButton.html deleted file mode 100644 index e62ad9c64d5dfa6d886d627aeeda0d96f840f6fc..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnPressButton.html +++ /dev/null @@ -1,142 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -Uses of Class eu.ensam.ii.vrpn.VrpnPressButton -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Uses of Class eu.ensam.ii.vrpn.VrpnPressButton"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnPressButton.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnPressButton.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -<B>Uses of Class<br>eu.ensam.ii.vrpn.VrpnPressButton</B></H2> -</CENTER> -No usage of eu.ensam.ii.vrpn.VrpnPressButton -<P> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnPressButton.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnPressButton.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnRadioButton.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnRadioButton.html deleted file mode 100644 index dfa16e272a136cd63dd00d91b2ac539e8a90f5f4..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnRadioButton.html +++ /dev/null @@ -1,142 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -Uses of Class eu.ensam.ii.vrpn.VrpnRadioButton -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Uses of Class eu.ensam.ii.vrpn.VrpnRadioButton"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnRadioButton.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnRadioButton.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -<B>Uses of Class<br>eu.ensam.ii.vrpn.VrpnRadioButton</B></H2> -</CENTER> -No usage of eu.ensam.ii.vrpn.VrpnRadioButton -<P> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnRadioButton.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnRadioButton.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnSeekBar.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnSeekBar.html deleted file mode 100644 index bb76be4165d4eed733e319aebbc0b593257896f5..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnSeekBar.html +++ /dev/null @@ -1,142 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -Uses of Class eu.ensam.ii.vrpn.VrpnSeekBar -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Uses of Class eu.ensam.ii.vrpn.VrpnSeekBar"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnSeekBar.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnSeekBar.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -<B>Uses of Class<br>eu.ensam.ii.vrpn.VrpnSeekBar</B></H2> -</CENTER> -No usage of eu.ensam.ii.vrpn.VrpnSeekBar -<P> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnSeekBar.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnSeekBar.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnSpinner.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnSpinner.html deleted file mode 100644 index cc7b2ac9e81342dbe09c1913dabb79b4ad3d20dd..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnSpinner.html +++ /dev/null @@ -1,142 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -Uses of Class eu.ensam.ii.vrpn.VrpnSpinner -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Uses of Class eu.ensam.ii.vrpn.VrpnSpinner"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnSpinner.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnSpinner.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -<B>Uses of Class<br>eu.ensam.ii.vrpn.VrpnSpinner</B></H2> -</CENTER> -No usage of eu.ensam.ii.vrpn.VrpnSpinner -<P> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnSpinner.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnSpinner.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnSurface.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnSurface.html deleted file mode 100644 index b691cab1f937ffebb7944735cd762d9d06c33554..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnSurface.html +++ /dev/null @@ -1,142 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -Uses of Class eu.ensam.ii.vrpn.VrpnSurface -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Uses of Class eu.ensam.ii.vrpn.VrpnSurface"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnSurface.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnSurface.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -<B>Uses of Class<br>eu.ensam.ii.vrpn.VrpnSurface</B></H2> -</CENTER> -No usage of eu.ensam.ii.vrpn.VrpnSurface -<P> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnSurface.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnSurface.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnToggleButton.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnToggleButton.html deleted file mode 100644 index 104babb309ad74d59dec035c6e6702bf3d3d7760..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnToggleButton.html +++ /dev/null @@ -1,142 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -Uses of Class eu.ensam.ii.vrpn.VrpnToggleButton -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Uses of Class eu.ensam.ii.vrpn.VrpnToggleButton"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnToggleButton.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnToggleButton.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -<B>Uses of Class<br>eu.ensam.ii.vrpn.VrpnToggleButton</B></H2> -</CENTER> -No usage of eu.ensam.ii.vrpn.VrpnToggleButton -<P> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../../index.html?eu/ensam/ii/vrpn/\class-useVrpnToggleButton.html" target="_top"><B>FRAMES</B></A> - <A HREF="VrpnToggleButton.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-frame.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-frame.html deleted file mode 100644 index dd8e01319ad8289b1d1f4e3c23f7c48b9d366c26..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-frame.html +++ /dev/null @@ -1,46 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -eu.ensam.ii.vrpn -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - - -</HEAD> - -<BODY BGCOLOR="white"> -<FONT size="+1" CLASS="FrameTitleFont"> -<A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html" target="classFrame">eu.ensam.ii.vrpn</A></FONT> -<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> -<TR> -<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> -Classes</FONT> -<FONT CLASS="FrameItemFont"> -<BR> -<A HREF="VrpnApplication.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnApplication</A> -<BR> -<A HREF="VrpnClient.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnClient</A> -<BR> -<A HREF="VrpnPressButton.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnPressButton</A> -<BR> -<A HREF="VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnRadioButton</A> -<BR> -<A HREF="VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnSeekBar</A> -<BR> -<A HREF="VrpnSpinner.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnSpinner</A> -<BR> -<A HREF="VrpnSurface.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnSurface</A> -<BR> -<A HREF="VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn" target="classFrame">VrpnToggleButton</A></FONT></TD> -</TR> -</TABLE> - - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-summary.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-summary.html deleted file mode 100644 index 4c2578bebb926896056623d077518478ba7b45e2..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-summary.html +++ /dev/null @@ -1,562 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -eu.ensam.ii.vrpn -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="eu.ensam.ii.vrpn"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV PACKAGE - NEXT PACKAGE</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/package-summary.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<H2> -Package eu.ensam.ii.vrpn -</H2> -This package include a set of widgets that are bound to a Vrpn server - buttons, analogs and trackers. -<P> -<B>See:</B> -<BR> - <A HREF="#package_description"><B>Description</B></A> -<P> - -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Class Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnApplication.html" title="class in eu.ensam.ii.vrpn">VrpnApplication</A></B></TD> -<TD>This class must be used as an <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/Application.html?is-external=true" title="class or interface in android.app"><CODE>Application</CODE></A> for applications that use the Vrpn widgets.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A></B></TD> -<TD>Send updates button, analog and tracker updates to the JsonNet Vrpn server.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn">VrpnPressButton</A></B></TD> -<TD>A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Button.html?is-external=true" title="class or interface in android.widget"><CODE>Button</CODE></A> connected to a VRPN Button.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn">VrpnRadioButton</A></B></TD> -<TD>A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/RadioButton.html?is-external=true" title="class or interface in android.widget"><CODE>RadioButton</CODE></A> that updates a Vrpn Button channel.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn">VrpnSeekBar</A></B></TD> -<TD>A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/SeekBar.html?is-external=true" title="class or interface in android.widget"><CODE>SeekBar</CODE></A> that updates a Vrpn Analog channel.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn">VrpnSpinner</A></B></TD> -<TD>A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Spinner.html?is-external=true" title="class or interface in android.widget"><CODE>Spinner</CODE></A> that updates a Vrpn Analog channel.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn">VrpnSurface</A></B></TD> -<TD>This <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/SurfaceView.html?is-external=true" title="class or interface in android.view"><CODE>SurfaceView</CODE></A> updates two Vrpn Analog channels with the coordinates of the - Surface point that is touched.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn">VrpnToggleButton</A></B></TD> -<TD>A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/ToggleButton.html?is-external=true" title="class or interface in android.view"><CODE>ToggleButton</CODE></A> connected to a Vrpn Button.</TD> -</TR> -</TABLE> - - -<P> -<A NAME="package_description"><!-- --></A><H2> -Package eu.ensam.ii.vrpn Description -</H2> - -<P> -This package include a set of widgets that are bound to a Vrpn server - buttons, analogs and trackers. - - - <h3>Create a simple application that uses the widgets</h3> - <p> - The following chapters describe how to create a simple application - with a <A HREF="../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn"><CODE>VrpnToggleButton</CODE></A> and - a <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn"><CODE>VrpnSeekBar</CODE></A>. An example - application project that contains these widgets and more can be found - in the <em>example_app</em> directory. - </p> - <h4>Create and configure the project</h4> - <p> - Refer to any Android documentation for instructions about how to - set-up the Android SDK and the Eclipse plugin. Do not forget to setup - the Android SDK in any new workspace (<em>Window</em> > <em>Preferences</em>, - then go to the <em>Android</em> tab and configure the SDK location). - </p> - <p> - Import the <em>Vrpn_library</em> project into your Eclipse workspace. - Open the Android section of the project property page and verify that - <em>Is library</em> checked. If the build complains about "Android - requires .class compatibility set to 5.0", you need first to select - the project, right-click > <em>Properties</em> > <em>Android - tools</em> > <em>Fix project properties</em>, then open the project - properties, go to the <em>Java compiler</em> section, then deselect - <em>enable project specific settings</em>. You may need to clean and - rebuild (<em>Project</em> > <em>Clean</em>) several times before - the project shows no errors. - </p> - - <p> - Create a new Android project : <em>File</em> > <em>New</em> > <em>Other - ...</em> , <em>Android</em> > <em>Android Project</em>. On the first - page of the wizard, check <em>Create activity</em> and enter any name - you like for the main activity (for instance <em>MainActivity</em>). - </p> - - <p> - Add the library to your project : open the properties of the project, - go to the <em>Android</em> page. In the <em>Library</em> pane, click <em>Add</em> - then select <em>vrpn_library</em>, apply the changes and close the - window. At this point, the Eclipse <em>Package Explorer</em> view of - your project should contain a <em>vrpn_library_src</em> folder and the - <em>gen</em> folder should contain a package entry named <em>eu.ensam.ii.vrpn</em>. - </p> - <p> - Open the - <code>AndroidManifest.xml</code> - file. On the <em>Application</em> tab, check <em>Define an - <Application> tag in the AndroidManifest.xml</em>. Then click on the - <em>Browse</em> button that is on the right of <em>Name</em> and - select <em>VrpnApplication</em>. - </p> - - <h4>Modify the main activity</h4> - - - <p>Edit the main activity to define the binding to the Vrpn server - when the activity is created. The method <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/Activity.html?is-external=true#onCreate" title="class or interface in android.app"><CODE>onCreate</CODE></A> is called when the Activity is - created. The default version of this method contain only the first and - last lines :</p> - <pre> - super.onCreate(savedInstanceState); - .... - setContentView(R.layout.main); -</pre> - <p>We need to define the binding with the Vrpn server. The method - becomes :</p> - <pre> -@Override -public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - InetAddress vrpnServerAddress = null; - try { - // Replace the IP address - vrpnServerAddress = InetAddress.getByName("192.168.173.1"); - } catch (UnknownHostException e) { - } - final int vrpnServerPort = 7777; - VrpnClient.getInstance().setupVrpnServer(vrpnServerAddress, vrpnServerPort); - - setContentView(R.layout.main); -} -</pre> - <a name="vrpnids"></a> - <h4>Create a Vrpn Ids list</h4> - <p> - Before laying out your Vrpn widgets in your application, you should - create an XML configuration file that contains the IDs of the Vrpn - buttons and analog that you will be using. This allows you to keep a - unique list of Vrpn IDs, making it easier to avoid duplicate values - and reference this list from your application. Create this file with <em>File</em> - > <em>New</em> > <em>Other</em>, then <em>Android </em> > <em>Android - XML File</em>. In XML file dialog, type any file name you like, for - instance <em>vrpn.xml</em>, then select <em>Values</em> as the type of - resource to create. - </p> - <p> - Edit the resulting file, found at <em>res/values/vrpn.xml</em> to add - the numbers of the Vrpn Buttons and Analogs that you will be using. - </p> - <pre> -<resources> - <item type="id" format="integer" name="VrpnAnalogLightIntensity">0</item> - <item type="id" format="integer" name="VrpnButtonLightsOn">0</item> -</resources> -</pre> - - <p> - Note that <em>type</em> must be <em>id</em> and <em>format</em> must - be <em>integer</em>, but <em>name</em> can be anything you like. - </p> - - <h4>Add your widgets to the main layout</h4> - <p>Say we want an Android application to control the lighting in - our VR application : turn the light on or off and also control the - light intensity. We will create an application with a <A HREF="../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn"><CODE>VrpnToggleButton</CODE></A> as the light - switch and a <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn"><CODE>VrpnSeekBar</CODE></A> as a - light intensity controller.</p> - <p> - By default, the layout of the main Activity is described in <em>res/layout/main.xml</em> - and just displays <em>Hello</em>. Edit this file. The XML code looks - is something like : - </p> - <pre> -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - > - <TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="@string/hello" - /> -</LinearLayout> -</pre> - - <p> - The root element, - <code>LinearLayout</code> - , is a container for the other widgets, currently contains a - <code>TextView</code> - . - <p> - The basics about XML layouts are presented in <a - href="http://developer.android.com/guide/topics/ui/declaring-layout.html">Declaring - layout</a> SDK page. - </p> - <p> - Before the end tag - <code></LinearLayout></code> - , include a <A HREF="../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn"><CODE>VrpnToggleButton</CODE></A> - to turn the lights on or off : - <pre> -<eu.ensam.ii.vrpn.VrpnToggleButton - android:layout_width="fill_parent" - android:layout_height="wrap_content" - app:vrpnButton="@id/VrpnButtonLightsOn" -/> -</pre> - - The Vrpn widgets use so-called - <em>custom XML properties</em> , such as - <em>app:vrpnButton</em> . This custom property allows you to specify - the id of the target Vrpn button in the XML layout file rather than in - Java code. However, the use of this custom property requires the - addition of an XML namespace tag so that the build system can find - then. After the - <em>xmlns:android</em> line, add the following line : - <pre> - xmlns:app="http://schemas.android.com/apk/res/your.application.package.name.here" -</pre> - Different attributes exist for each widgets and the whole list is shown - when you unfold - <em>gen/eu/ensam.ii.vrpn/R.java/R/attr</em> in the Eclipse Package - View. Your layout is now ready for your to include the Vrpn widgets. - Now save the file to build your project. If there are build errors, - check the following : - <ul> - <li>you have added the <code>xmlns::app</code> line in the root - layout</li> - <li>the spelling of the <code>app:</code> attribute</li> - <li>the value of the Vrpn attributes</li> - <li>the spelling of the widget name</li> - </ul> - - <p> - In most cases, the <em>Preview</em> tab of the XML layout is not - displayed properly as soon as you include one of the Vrpn widgets. - This is a known problem for which not solution has currently been - found. It prevents you from previewing the layout it wil be displayed - correctly in the application, either on a device or in the emulator. - </p> - - <p>Now add a <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn"><CODE>VrpnSeekBar</CODE></A> to - control the light intensity :</p> - <pre> -<eu.ensam.ii.vrpn.VrpnSeekBar - android:layout_width="fill_parent" - android:layout_height="wrap_content" - app:minValue="0" - app:maxValue="255" - app:defaultValue="128" - app:vrpnAnalog="@id/VrpnAnalogLightIntensity" -/> -</pre> - Your Android application is now ready to run. Upload on a device and - run. There is not much to seen for the time being. However, if you run - a network sniffer on a machine connected to the same network as the - Android device, you should see UDP packets flowing out of the device. - If you are using the emulator instead of an actual device, see the - <a - href=" -http://developer.android.com/guide/developing/devices/emulator.html#emulatornetworking">Emulator - networking</a> SDK page for the correct network setup. - <h4>Test your application</h4> - In order to test your application, you need a VRPN server built with - VRPN_USE_JSONNET. See the - <code>README.jsoncpp</code> - file for instructions to build this server. When you get this server - running, the easiest way to test the Android application is to use the - <code>vrpn_print_devices</code> - application provided with Vrpn. Type the command : - <pre> -vrpn_print_devices Jsonnet@localhost -</pre> - The command should then report the values of the Button and SeekBar as - they are changed. - - <h3>Beyond the basics</h3> - <h4>Application with multiple tabs</h4> - If you want to create an application with more widgets that can be - placed on a single screen, using a <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/TabActivity.html?is-external=true" title="class or interface in android.app"><CODE>TabActivity</CODE></A> instead of a regular Activity may be the way to go. A - <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/TabActivity.html?is-external=true" title="class or interface in android.app"><CODE>TabActivity</CODE></A> can display several - activities of view, each inside a tab. The Android SDK documentation - explains how to create a tabbed application with activities. However, - using activities require careful state management since the activities - may be terminated when the use switches from one tab to another. It is - therefore easier to manage a <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/TabActivity.html?is-external=true" title="class or interface in android.app"><CODE>TabActivity</CODE></A> that display - <em>views</em> intead of activities. - <p></p> - <p>First of all, your main activity must extend <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/TabActivity.html?is-external=true" title="class or interface in android.app"><CODE>TabActivity</CODE></A> intead of <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/Activity.html?is-external=true" title="class or interface in android.app"><CODE>Activity</CODE></A>.</p> - <p> - Then, create a layout for each tab in <em>res/layout</em> with <em>File</em> - > <em>New</em> > <em>Other...</em> , then <em>Android</em> > <em>New - XML file</em>. In the <em>New Android XML file</em> dialog, name the file - <em>tab_one.xml</em>, select <em>Layout</em> as the type of resource, - then select <em>LinearLayout</em> as the root element. Repeat the - process with a second tab layout named <em>tab_two.xml</em>. Update - each tab layout as described in <em>Add your widgets to the main - layout</em> above, paying attention not to forget the <em>xmlns:app</em> - line. - </p> - <p> - The next step is to create a new layout names <em>res/layout/tab_group.xml</em>for - the whole activity. This layout looks like : - </p> - <pre> -<?xml version="1.0" encoding="utf-8"?> -<TabHost - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@android:id/tabhost" - android:layout_width="fill_parent" - android:layout_height="fill_parent"> - <TabWidget - android:id="@android:id/tabs" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - /> - <FrameLayout - android:id="@android:id/tabcontent" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:padding="5dp"> - </FrameLayout> - <include layout="@layout/tab_one"></include> - <include layout="@layout/tab_two"></include> -</TabHost> -</pre> - - <p> - Then edit the <em>onCreate</em> method of your activity. After the - line <em>super.onCreate()</em> add the <em>VrpnClient.getInstance().setUri(....)</em> - line, then add : - <pre> - LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); - inflater.inflate(R.layout.tab_group, getTabHost().getTabContentView(), true); - TabHost.TabSpec spec; - spec = getTabHost().newTabSpec("1").setContent(R.id.tab_one); - getTabHost().addTab(spec) - spec = getTabHost().newTabSpec("2").setContent(R.id.tab_two); - getTabHost().addTab(spec); - getTabHost().setCurrentTab(0); -</pre> - <p>See in the SDK documentation how to use the <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/TabHost.TabSpec.html?is-external=true#setIndicator" title="class or interface in android.widget"><CODE>setIndicator</CODE></A> method in - order to display an icon in the tab headers.</p> - <h3>Updating the widget library</h3> - <h4>Create a new Widget</h4> - <p>To create a new Widget type you should look at the source code - of VrpnSeekBar, which is the more elaborate. The main steps are as - follows :</p> - <ul> - <li>Decide which Android widget class you want to extend and - which events will trigger Vrpn updates.</li> - <li>Decide whether your widget will send Vrpn button,analog or - tracker updates.</li> - <li>Decide whether your widget needs new custom XML attributes. - If this is the case, look at <code>res/values/attrs.xml</code> for - examples.</li> - <li>Implement a private <em>init</em> method that each - constructor will call. In this method, you must obtain the XML custom - attributes of the widget. You should also send a Vrpn update with the - initial value of the widget</li> - <li>Implement the appropriate change listener, according to which - event you want your widget to respond to. In the change listener, - call the appropriate method : <A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html#sendAnalog(int, double)"><CODE>sendAnalog</CODE></A> or - <A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html#sendButton(int, boolean)"><CODE>sendButton</CODE></A>. Note that a single widget can s end several updates, - like the <A HREF="../../../../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn"><CODE>VrpnSurface</CODE></A> does or - like a <a - href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/ColorPickerDialog.html">color - picker</a>would do. There is currently no <em>sendTracker</em> method - although this may be useful to implement an Arcball for instance.</li> - </ul> - <p>Note that using the full path of the parent class such as in : - <pre>public class VrpnRadioButton extends android.widget.RadioButton</pre> - allows Javadoc to generate a link to the parent class. - </p> - - <h4>Generate the documentation</h4> - <p> - Select the <em>vrpn_library/src</em> folder, then select the menu item - <em>Project</em> > <em>Generate Javadoc</em>. - <p> - On the first page of the wizard, select the path of the <em>javadoc</em> - tool. Check that <em>vrpn_library/src</em> is selected, but not <em>vrpn_library/gen</em>, - then select an appropriate destination for the documentation. - </p> - <p> - On the second page of the wizard select <em>android.jar</em> in the <em>Referenced - archives</em> list and take note of the <em>android.jar</em> doc path - (like - <code>file:/E:/android/docs/reference</code> - ). - </p> - <p> - On the third page of the wizard add the following line to the <em>Extra - javadoc options</em> text box : - <pre> --linkoffline http://d.android.com/reference file:/E:/android/docs/reference -</pre> - but replace the - <code>file:/</code> - URL by your local Android SDK URL noted from the page two of the - wizard. This allows Javadoc to include full references to the on-line - Android documentation. - -/* - End of paste Here -<P> - -<P> -<DL> -</DL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV PACKAGE - NEXT PACKAGE</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/package-summary.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-tree.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-tree.html deleted file mode 100644 index 7c73adfeba7510dd556d5920e41fcd2a9300ea47..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-tree.html +++ /dev/null @@ -1,162 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -eu.ensam.ii.vrpn Class Hierarchy -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="eu.ensam.ii.vrpn Class Hierarchy"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/package-tree.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -Hierarchy For Package eu.ensam.ii.vrpn -</H2> -</CENTER> -<H2> -Class Hierarchy -</H2> -<UL> -<LI TYPE="circle">java.lang.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><B>Object</B></A><UL> -<LI TYPE="circle">android.app.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/Application.html?is-external=true" title="class or interface in android.app"><B>Application</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="../../../../eu/ensam/ii/vrpn/VrpnApplication.html" title="class in eu.ensam.ii.vrpn"><B>VrpnApplication</B></A></UL> -<LI TYPE="circle">android.widget.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Button.html?is-external=true" title="class or interface in android.widget"><B>Button</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="../../../../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn"><B>VrpnPressButton</B></A></UL> -<LI TYPE="circle">android.widget.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/LinearLayout.html?is-external=true" title="class or interface in android.widget"><B>LinearLayout</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="../../../../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn"><B>VrpnSeekBar</B></A></UL> -<LI TYPE="circle">android.widget.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/RadioButton.html?is-external=true" title="class or interface in android.widget"><B>RadioButton</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="../../../../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn"><B>VrpnRadioButton</B></A></UL> -<LI TYPE="circle">android.widget.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Spinner.html?is-external=true" title="class or interface in android.widget"><B>Spinner</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="../../../../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn"><B>VrpnSpinner</B></A></UL> -<LI TYPE="circle">android.view.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/SurfaceView.html?is-external=true" title="class or interface in android.view"><B>SurfaceView</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="../../../../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn"><B>VrpnSurface</B></A></UL> -<LI TYPE="circle">android.widget.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/ToggleButton.html?is-external=true" title="class or interface in android.widget"><B>ToggleButton</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="../../../../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn"><B>VrpnToggleButton</B></A></UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="../../../../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn"><B>VrpnClient</B></A></UL> -</UL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/package-tree.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-use.html b/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-use.html deleted file mode 100644 index cb73be5f3de8d5ac59a9745e347e329b54486704..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-use.html +++ /dev/null @@ -1,155 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -Uses of Package eu.ensam.ii.vrpn -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Uses of Package eu.ensam.ii.vrpn"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/package-use.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -<B>Uses of Package<br>eu.ensam.ii.vrpn</B></H2> -</CENTER> -<A NAME="eu.ensam.ii.vrpn"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -Classes in <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html">eu.ensam.ii.vrpn</A> used by <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html">eu.ensam.ii.vrpn</A></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><B><A HREF="../../../../eu/ensam/ii/vrpn/class-use/VrpnClient.html#eu.ensam.ii.vrpn"><B>VrpnClient</B></A></B> - -<BR> - Send updates button, analog and tracker updates to the JsonNet Vrpn server.</TD> -</TR> -</TABLE> - -<P> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?eu/ensam/ii/vrpn/package-use.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-use.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/help-doc.html b/src/vrpn/android_widgets/vrpn_library/doc/help-doc.html deleted file mode 100644 index 43edaebce4d3ec15553094ca2325229610a76bdc..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/help-doc.html +++ /dev/null @@ -1,215 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -API Help -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="API Help"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A> - <A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H1> -How This API Document Is Organized</H1> -</CENTER> -This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.<H3> -Package</H3> -<BLOCKQUOTE> - -<P> -Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:<UL> -<LI>Interfaces (italic)<LI>Classes<LI>Enums<LI>Exceptions<LI>Errors<LI>Annotation Types</UL> -</BLOCKQUOTE> -<H3> -Class/Interface</H3> -<BLOCKQUOTE> - -<P> -Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:<UL> -<LI>Class inheritance diagram<LI>Direct Subclasses<LI>All Known Subinterfaces<LI>All Known Implementing Classes<LI>Class/interface declaration<LI>Class/interface description -<P> -<LI>Nested Class Summary<LI>Field Summary<LI>Constructor Summary<LI>Method Summary -<P> -<LI>Field Detail<LI>Constructor Detail<LI>Method Detail</UL> -Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</BLOCKQUOTE> -</BLOCKQUOTE> -<H3> -Annotation Type</H3> -<BLOCKQUOTE> - -<P> -Each annotation type has its own separate page with the following sections:<UL> -<LI>Annotation Type declaration<LI>Annotation Type description<LI>Required Element Summary<LI>Optional Element Summary<LI>Element Detail</UL> -</BLOCKQUOTE> -</BLOCKQUOTE> -<H3> -Enum</H3> -<BLOCKQUOTE> - -<P> -Each enum has its own separate page with the following sections:<UL> -<LI>Enum declaration<LI>Enum description<LI>Enum Constant Summary<LI>Enum Constant Detail</UL> -</BLOCKQUOTE> -<H3> -Use</H3> -<BLOCKQUOTE> -Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.</BLOCKQUOTE> -<H3> -Tree (Class Hierarchy)</H3> -<BLOCKQUOTE> -There is a <A HREF="overview-tree.html">Class Hierarchy</A> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.<UL> -<LI>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.<LI>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</UL> -</BLOCKQUOTE> -<H3> -Deprecated API</H3> -<BLOCKQUOTE> -The <A HREF="deprecated-list.html">Deprecated API</A> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</BLOCKQUOTE> -<H3> -Index</H3> -<BLOCKQUOTE> -The <A HREF="index-files/index-1.html">Index</A> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</BLOCKQUOTE> -<H3> -Prev/Next</H3> -These links take you to the next or previous class, interface, package, or related page.<H3> -Frames/No Frames</H3> -These links show and hide the HTML frames. All pages are available with or without frames. -<P> -<H3> -Serialized Form</H3> -Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. -<P> -<H3> -Constant Field Values</H3> -The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values. -<P> -<FONT SIZE="-1"> -<EM> -This help file applies to API documentation generated using the standard doclet.</EM> -</FONT> -<BR> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A> - <A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-1.html b/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-1.html deleted file mode 100644 index 38346a07d86f1794f7bf0dbaacb6687359b0a199..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-1.html +++ /dev/null @@ -1,144 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -E-Index -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="E-Index"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV LETTER - <A HREF="index-2.html"><B>NEXT LETTER</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../index.html?index-filesindex-1.html" target="_top"><B>FRAMES</B></A> - <A HREF="index-1.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<A HREF="index-1.html">E</A> <A HREF="index-2.html">G</A> <A HREF="index-3.html">O</A> <A HREF="index-4.html">S</A> <A HREF="index-5.html">V</A> <HR> -<A NAME="_E_"><!-- --></A><H2> -<B>E</B></H2> -<DL> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnClient.html#enableTiltTracker(boolean)"><B>enableTiltTracker(boolean)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A> -<DD>Enables or disable the tilt tracker. -<DT><A HREF="../eu/ensam/ii/vrpn/package-summary.html"><B>eu.ensam.ii.vrpn</B></A> - package eu.ensam.ii.vrpn<DD>This package include a set of widgets that are bound to a Vrpn server - buttons, analogs and trackers.</DL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV LETTER - <A HREF="index-2.html"><B>NEXT LETTER</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../index.html?index-filesindex-1.html" target="_top"><B>FRAMES</B></A> - <A HREF="index-1.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<A HREF="index-1.html">E</A> <A HREF="index-2.html">G</A> <A HREF="index-3.html">O</A> <A HREF="index-4.html">S</A> <A HREF="index-5.html">V</A> <HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-2.html b/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-2.html deleted file mode 100644 index 02c3cca491b809af1b712e9a7fa790f36316e5dc..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-2.html +++ /dev/null @@ -1,143 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -G-Index -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="G-Index"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index-1.html"><B>PREV LETTER</B></A> - <A HREF="index-3.html"><B>NEXT LETTER</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../index.html?index-filesindex-2.html" target="_top"><B>FRAMES</B></A> - <A HREF="index-2.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<A HREF="index-1.html">E</A> <A HREF="index-2.html">G</A> <A HREF="index-3.html">O</A> <A HREF="index-4.html">S</A> <A HREF="index-5.html">V</A> <HR> -<A NAME="_G_"><!-- --></A><H2> -<B>G</B></H2> -<DL> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnClient.html#getInstance()"><B>getInstance()</B></A> - -Static method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A> -<DD>Returns the unique VrpnClient instance -</DL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index-1.html"><B>PREV LETTER</B></A> - <A HREF="index-3.html"><B>NEXT LETTER</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../index.html?index-filesindex-2.html" target="_top"><B>FRAMES</B></A> - <A HREF="index-2.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<A HREF="index-1.html">E</A> <A HREF="index-2.html">G</A> <A HREF="index-3.html">O</A> <A HREF="index-4.html">S</A> <A HREF="index-5.html">V</A> <HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-3.html b/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-3.html deleted file mode 100644 index 79cfb88d2d097119f36aa9e52d538a32a4a1a002..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-3.html +++ /dev/null @@ -1,182 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -O-Index -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="O-Index"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index-2.html"><B>PREV LETTER</B></A> - <A HREF="index-4.html"><B>NEXT LETTER</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../index.html?index-filesindex-3.html" target="_top"><B>FRAMES</B></A> - <A HREF="index-3.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<A HREF="index-1.html">E</A> <A HREF="index-2.html">G</A> <A HREF="index-3.html">O</A> <A HREF="index-4.html">S</A> <A HREF="index-5.html">V</A> <HR> -<A NAME="_O_"><!-- --></A><H2> -<B>O</B></H2> -<DL> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnClient.html#onAccuracyChanged(Sensor, int)"><B>onAccuracyChanged(Sensor, int)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A> -<DD>Called by the system when the sensor accuracy changes - - This method is empty and should not be called by widgets -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnRadioButton.html#onCheckedChanged(CompoundButton, boolean)"><B>onCheckedChanged(CompoundButton, boolean)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn">VrpnRadioButton</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnToggleButton.html#onCheckedChanged(CompoundButton, boolean)"><B>onCheckedChanged(CompoundButton, boolean)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn">VrpnToggleButton</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnApplication.html#onCreate()"><B>onCreate()</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnApplication.html" title="class in eu.ensam.ii.vrpn">VrpnApplication</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSpinner.html#onItemSelected(, View, int, long)"><B>onItemSelected(<any>, View, int, long)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn">VrpnSpinner</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSpinner.html#onNothingSelected()"><B>onNothingSelected(<any>)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn">VrpnSpinner</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSeekBar.html#onProgressChanged(SeekBar, int, boolean)"><B>onProgressChanged(SeekBar, int, boolean)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn">VrpnSeekBar</A> -<DD>Called when the progress of the SeekBar changes - - Compute the value from the progress and send a VrpnUpdate to the analog - channel that is associated to the widget with the custom attribute - app:vrpnAnalog -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnClient.html#onSensorChanged(SensorEvent)"><B>onSensorChanged(SensorEvent)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A> -<DD>Called by the system when a sensor data changes. -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSeekBar.html#onStartTrackingTouch(SeekBar)"><B>onStartTrackingTouch(SeekBar)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn">VrpnSeekBar</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSeekBar.html#onStopTrackingTouch(SeekBar)"><B>onStopTrackingTouch(SeekBar)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn">VrpnSeekBar</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnPressButton.html#onTouch(View, MotionEvent)"><B>onTouch(View, MotionEvent)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn">VrpnPressButton</A> -<DD>Called when a touch event is dispatched to this VrpnPressButton. -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSurface.html#onTouch(View, MotionEvent)"><B>onTouch(View, MotionEvent)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn">VrpnSurface</A> -<DD>Called when a touch event is dispatched to this widget. -</DL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index-2.html"><B>PREV LETTER</B></A> - <A HREF="index-4.html"><B>NEXT LETTER</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../index.html?index-filesindex-3.html" target="_top"><B>FRAMES</B></A> - <A HREF="index-3.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<A HREF="index-1.html">E</A> <A HREF="index-2.html">G</A> <A HREF="index-3.html">O</A> <A HREF="index-4.html">S</A> <A HREF="index-5.html">V</A> <HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-4.html b/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-4.html deleted file mode 100644 index f2a0ff8e3cab825ec2f9ed8d8b0219857db16b25..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-4.html +++ /dev/null @@ -1,149 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -S-Index -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="S-Index"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index-3.html"><B>PREV LETTER</B></A> - <A HREF="index-5.html"><B>NEXT LETTER</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../index.html?index-filesindex-4.html" target="_top"><B>FRAMES</B></A> - <A HREF="index-4.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<A HREF="index-1.html">E</A> <A HREF="index-2.html">G</A> <A HREF="index-3.html">O</A> <A HREF="index-4.html">S</A> <A HREF="index-5.html">V</A> <HR> -<A NAME="_S_"><!-- --></A><H2> -<B>S</B></H2> -<DL> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnClient.html#sendAnalog(int, double)"><B>sendAnalog(int, double)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A> -<DD>Send an update to a Vrpn Analog channel. -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnClient.html#sendButton(int, boolean)"><B>sendButton(int, boolean)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A> -<DD>Send an update to a Vrpn Button. -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnClient.html#setupVrpnServer(java.net.InetAddress, int)"><B>setupVrpnServer(InetAddress, int)</B></A> - -Method in class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn">VrpnClient</A> -<DD>Initializes the address and port of the VRPN server. -</DL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index-3.html"><B>PREV LETTER</B></A> - <A HREF="index-5.html"><B>NEXT LETTER</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../index.html?index-filesindex-4.html" target="_top"><B>FRAMES</B></A> - <A HREF="index-4.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<A HREF="index-1.html">E</A> <A HREF="index-2.html">G</A> <A HREF="index-3.html">O</A> <A HREF="index-4.html">S</A> <A HREF="index-5.html">V</A> <HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-5.html b/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-5.html deleted file mode 100644 index 6cc9914528161148e354c8a67e6f56751d94361d..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/index-files/index-5.html +++ /dev/null @@ -1,192 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -V-Index -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="V-Index"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index-4.html"><B>PREV LETTER</B></A> - NEXT LETTER</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../index.html?index-filesindex-5.html" target="_top"><B>FRAMES</B></A> - <A HREF="index-5.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<A HREF="index-1.html">E</A> <A HREF="index-2.html">G</A> <A HREF="index-3.html">O</A> <A HREF="index-4.html">S</A> <A HREF="index-5.html">V</A> <HR> -<A NAME="_V_"><!-- --></A><H2> -<B>V</B></H2> -<DL> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnApplication.html" title="class in eu.ensam.ii.vrpn"><B>VrpnApplication</B></A> - Class in <A HREF="../eu/ensam/ii/vrpn/package-summary.html">eu.ensam.ii.vrpn</A><DD>This class must be used as an <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/Application.html?is-external=true" title="class or interface in android.app"><CODE>Application</CODE></A> for applications that use the Vrpn widgets.<DT><A HREF="../eu/ensam/ii/vrpn/VrpnApplication.html#VrpnApplication()"><B>VrpnApplication()</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnApplication.html" title="class in eu.ensam.ii.vrpn">VrpnApplication</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn"><B>VrpnClient</B></A> - Class in <A HREF="../eu/ensam/ii/vrpn/package-summary.html">eu.ensam.ii.vrpn</A><DD>Send updates button, analog and tracker updates to the JsonNet Vrpn server.<DT><A HREF="../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn"><B>VrpnPressButton</B></A> - Class in <A HREF="../eu/ensam/ii/vrpn/package-summary.html">eu.ensam.ii.vrpn</A><DD>A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Button.html?is-external=true" title="class or interface in android.widget"><CODE>Button</CODE></A> connected to a VRPN Button.<DT><A HREF="../eu/ensam/ii/vrpn/VrpnPressButton.html#VrpnPressButton(Context)"><B>VrpnPressButton(Context)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn">VrpnPressButton</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnPressButton.html#VrpnPressButton(Context, AttributeSet)"><B>VrpnPressButton(Context, AttributeSet)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn">VrpnPressButton</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnPressButton.html#VrpnPressButton(Context, AttributeSet, int)"><B>VrpnPressButton(Context, AttributeSet, int)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn">VrpnPressButton</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn"><B>VrpnRadioButton</B></A> - Class in <A HREF="../eu/ensam/ii/vrpn/package-summary.html">eu.ensam.ii.vrpn</A><DD>A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/RadioButton.html?is-external=true" title="class or interface in android.widget"><CODE>RadioButton</CODE></A> that updates a Vrpn Button channel.<DT><A HREF="../eu/ensam/ii/vrpn/VrpnRadioButton.html#VrpnRadioButton(Context)"><B>VrpnRadioButton(Context)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn">VrpnRadioButton</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnRadioButton.html#VrpnRadioButton(Context, AttributeSet)"><B>VrpnRadioButton(Context, AttributeSet)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn">VrpnRadioButton</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnRadioButton.html#VrpnRadioButton(Context, AttributeSet, int)"><B>VrpnRadioButton(Context, AttributeSet, int)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn">VrpnRadioButton</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn"><B>VrpnSeekBar</B></A> - Class in <A HREF="../eu/ensam/ii/vrpn/package-summary.html">eu.ensam.ii.vrpn</A><DD>A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/SeekBar.html?is-external=true" title="class or interface in android.widget"><CODE>SeekBar</CODE></A> that updates a Vrpn Analog channel.<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSeekBar.html#VrpnSeekBar(Context)"><B>VrpnSeekBar(Context)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn">VrpnSeekBar</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSeekBar.html#VrpnSeekBar(Context, AttributeSet)"><B>VrpnSeekBar(Context, AttributeSet)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn">VrpnSeekBar</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn"><B>VrpnSpinner</B></A> - Class in <A HREF="../eu/ensam/ii/vrpn/package-summary.html">eu.ensam.ii.vrpn</A><DD>A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Spinner.html?is-external=true" title="class or interface in android.widget"><CODE>Spinner</CODE></A> that updates a Vrpn Analog channel.<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSpinner.html#VrpnSpinner(Context)"><B>VrpnSpinner(Context)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn">VrpnSpinner</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSpinner.html#VrpnSpinner(Context, AttributeSet)"><B>VrpnSpinner(Context, AttributeSet)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn">VrpnSpinner</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn"><B>VrpnSurface</B></A> - Class in <A HREF="../eu/ensam/ii/vrpn/package-summary.html">eu.ensam.ii.vrpn</A><DD>This <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/SurfaceView.html?is-external=true" title="class or interface in android.view"><CODE>SurfaceView</CODE></A> updates two Vrpn Analog channels with the coordinates of the - Surface point that is touched.<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSurface.html#VrpnSurface(Context)"><B>VrpnSurface(Context)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn">VrpnSurface</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSurface.html#VrpnSurface(Context, AttributeSet)"><B>VrpnSurface(Context, AttributeSet)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn">VrpnSurface</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnSurface.html#VrpnSurface(Context, AttributeSet, int)"><B>VrpnSurface(Context, AttributeSet, int)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn">VrpnSurface</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn"><B>VrpnToggleButton</B></A> - Class in <A HREF="../eu/ensam/ii/vrpn/package-summary.html">eu.ensam.ii.vrpn</A><DD>A <A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/ToggleButton.html?is-external=true" title="class or interface in android.view"><CODE>ToggleButton</CODE></A> connected to a Vrpn Button.<DT><A HREF="../eu/ensam/ii/vrpn/VrpnToggleButton.html#VrpnToggleButton(Context)"><B>VrpnToggleButton(Context)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn">VrpnToggleButton</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnToggleButton.html#VrpnToggleButton(Context, AttributeSet)"><B>VrpnToggleButton(Context, AttributeSet)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn">VrpnToggleButton</A> -<DD> -<DT><A HREF="../eu/ensam/ii/vrpn/VrpnToggleButton.html#VrpnToggleButton(Context, AttributeSet, int)"><B>VrpnToggleButton(Context, AttributeSet, int)</B></A> - -Constructor for class eu.ensam.ii.vrpn.<A HREF="../eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn">VrpnToggleButton</A> -<DD> -</DL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index-4.html"><B>PREV LETTER</B></A> - NEXT LETTER</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../index.html?index-filesindex-5.html" target="_top"><B>FRAMES</B></A> - <A HREF="index-5.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<A HREF="index-1.html">E</A> <A HREF="index-2.html">G</A> <A HREF="index-3.html">O</A> <A HREF="index-4.html">S</A> <A HREF="index-5.html">V</A> <HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/index.html b/src/vrpn/android_widgets/vrpn_library/doc/index.html deleted file mode 100644 index 92324d2a3a94885e3c40213141abbf03c84a8688..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/index.html +++ /dev/null @@ -1,36 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc on Sat Apr 30 22:53:31 CEST 2011--> -<TITLE> -Generated Documentation (Untitled) -</TITLE> -<SCRIPT type="text/javascript"> - targetPage = "" + window.location.search; - if (targetPage != "" && targetPage != "undefined") - targetPage = targetPage.substring(1); - if (targetPage.indexOf(":") != -1) - targetPage = "undefined"; - function loadFrames() { - if (targetPage != "" && targetPage != "undefined") - top.classFrame.location = top.targetPage; - } -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> -</HEAD> -<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()"> -<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)"> -<FRAME src="eu/ensam/ii/vrpn/package-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes"> -<NOFRAMES> -<H2> -Frame Alert</H2> - -<P> -This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. -<BR> -Link to<A HREF="eu/ensam/ii/vrpn/package-summary.html">Non-frame version.</A> -</NOFRAMES> -</FRAMESET> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/overview-tree.html b/src/vrpn/android_widgets/vrpn_library/doc/overview-tree.html deleted file mode 100644 index 81d2b664cb6516f6cf47b38c43c7806ec0ec4294..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/overview-tree.html +++ /dev/null @@ -1,164 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_21) on Sat Apr 30 22:53:31 CEST 2011 --> -<TITLE> -Class Hierarchy -</TITLE> - -<META NAME="date" CONTENT="2011-04-30"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Class Hierarchy"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A> - <A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -Hierarchy For All Packages</H2> -</CENTER> -<DL> -<DT><B>Package Hierarchies:</B><DD><A HREF="eu/ensam/ii/vrpn/package-tree.html">eu.ensam.ii.vrpn</A></DL> -<HR> -<H2> -Class Hierarchy -</H2> -<UL> -<LI TYPE="circle">java.lang.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><B>Object</B></A><UL> -<LI TYPE="circle">android.app.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/app/Application.html?is-external=true" title="class or interface in android.app"><B>Application</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="eu/ensam/ii/vrpn/VrpnApplication.html" title="class in eu.ensam.ii.vrpn"><B>VrpnApplication</B></A></UL> -<LI TYPE="circle">android.widget.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Button.html?is-external=true" title="class or interface in android.widget"><B>Button</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="eu/ensam/ii/vrpn/VrpnPressButton.html" title="class in eu.ensam.ii.vrpn"><B>VrpnPressButton</B></A></UL> -<LI TYPE="circle">android.widget.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/LinearLayout.html?is-external=true" title="class or interface in android.widget"><B>LinearLayout</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="eu/ensam/ii/vrpn/VrpnSeekBar.html" title="class in eu.ensam.ii.vrpn"><B>VrpnSeekBar</B></A></UL> -<LI TYPE="circle">android.widget.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/RadioButton.html?is-external=true" title="class or interface in android.widget"><B>RadioButton</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="eu/ensam/ii/vrpn/VrpnRadioButton.html" title="class in eu.ensam.ii.vrpn"><B>VrpnRadioButton</B></A></UL> -<LI TYPE="circle">android.widget.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/Spinner.html?is-external=true" title="class or interface in android.widget"><B>Spinner</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="eu/ensam/ii/vrpn/VrpnSpinner.html" title="class in eu.ensam.ii.vrpn"><B>VrpnSpinner</B></A></UL> -<LI TYPE="circle">android.view.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/view/SurfaceView.html?is-external=true" title="class or interface in android.view"><B>SurfaceView</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="eu/ensam/ii/vrpn/VrpnSurface.html" title="class in eu.ensam.ii.vrpn"><B>VrpnSurface</B></A></UL> -<LI TYPE="circle">android.widget.<A HREF="file:/F:/Program Files (x86)/Android/android-sdk-windows/docs/reference/android/widget/ToggleButton.html?is-external=true" title="class or interface in android.widget"><B>ToggleButton</B></A><UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="eu/ensam/ii/vrpn/VrpnToggleButton.html" title="class in eu.ensam.ii.vrpn"><B>VrpnToggleButton</B></A></UL> -<LI TYPE="circle">eu.ensam.ii.vrpn.<A HREF="eu/ensam/ii/vrpn/VrpnClient.html" title="class in eu.ensam.ii.vrpn"><B>VrpnClient</B></A></UL> -</UL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="eu/ensam/ii/vrpn/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A> - <A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/src/vrpn/android_widgets/vrpn_library/doc/package-list b/src/vrpn/android_widgets/vrpn_library/doc/package-list deleted file mode 100644 index c319b9ad391be2d8877c8f73021464cc36490e0d..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/package-list +++ /dev/null @@ -1 +0,0 @@ -eu.ensam.ii.vrpn diff --git a/src/vrpn/android_widgets/vrpn_library/doc/resources/inherit.gif b/src/vrpn/android_widgets/vrpn_library/doc/resources/inherit.gif deleted file mode 100644 index c814867a13deb0ca7ea2156c6ca1d5a03372af7e..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/doc/resources/inherit.gif and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/doc/stylesheet.css b/src/vrpn/android_widgets/vrpn_library/doc/stylesheet.css deleted file mode 100644 index 6ea9e5161615fcf6cdb0d194d913139c26fa417a..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/doc/stylesheet.css +++ /dev/null @@ -1,29 +0,0 @@ -/* Javadoc style sheet */ - -/* Define colors, fonts and other style attributes here to override the defaults */ - -/* Page background color */ -body { background-color: #FFFFFF; color:#000000 } - -/* Headings */ -h1 { font-size: 145% } - -/* Table colors */ -.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ -.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ -.TableRowColor { background: #FFFFFF; color:#000000 } /* White */ - -/* Font used in left-hand frame lists */ -.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } -.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } -.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } - -/* Navigation bar fonts and colors */ -.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ -.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ -.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} -.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} - -.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} -.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} - diff --git a/src/vrpn/android_widgets/vrpn_library/proguard.cfg b/src/vrpn/android_widgets/vrpn_library/proguard.cfg deleted file mode 100644 index 8ad7d3352aea60f9011009dc23604aa47d489ba4..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/proguard.cfg +++ /dev/null @@ -1,34 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class com.android.vending.licensing.ILicensingService - --keepclasseswithmembernames class * { - native <methods>; -} - --keepclasseswithmembernames class * { - public <init>(android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembernames class * { - public <init>(android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_lock_silent_mode_vibrate.png b/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_lock_silent_mode_vibrate.png deleted file mode 100644 index 4503aceb7ddec3da0845c4486d3dc3f92b9c631a..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_lock_silent_mode_vibrate.png and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_manage.png b/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_manage.png deleted file mode 100644 index c7c4cbce6f6b9c5ad96447c9f8190ef0e7fc9351..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_manage.png and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_preferences.png b/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_preferences.png deleted file mode 100644 index 81bca4ae6b243d7f64d8f69bc69492730d02e908..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_preferences.png and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_refresh.png b/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_refresh.png deleted file mode 100644 index 53caccace3947f3188cd58283efa242b6842d5da..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_refresh.png and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_rotate_left.png b/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_rotate_left.png deleted file mode 100644 index 9e8aec1863df08540166e9779d43fa7b16832ad0..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_rotate_left.png and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_rotate_right.png b/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_rotate_right.png deleted file mode 100644 index 85115af238424ed2d76ddc41bd386d682152f373..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_rotate_right.png and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/icon.png b/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/icon.png deleted file mode 100644 index 8074c4c571b8cd19e27f4ee5545df367420686d7..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/res/drawable-ldpi/icon.png b/src/vrpn/android_widgets/vrpn_library/res/drawable-ldpi/icon.png deleted file mode 100644 index 1095584ec21f71cd0afc9e0993aa2209671b590c..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/res/drawable-ldpi/icon.png and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/res/drawable-mdpi/ic_lock_silent_mode_vibrate.png b/src/vrpn/android_widgets/vrpn_library/res/drawable-mdpi/ic_lock_silent_mode_vibrate.png deleted file mode 100644 index 7da79aa20cb268bdbbf7a40e1856fa8fb5db3ef0..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/res/drawable-mdpi/ic_lock_silent_mode_vibrate.png and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/res/drawable-mdpi/ic_menu_rotate_left.png b/src/vrpn/android_widgets/vrpn_library/res/drawable-mdpi/ic_menu_rotate_left.png deleted file mode 100644 index eaa43195e32a42f86862d52e260e2d24cc617ec5..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/res/drawable-mdpi/ic_menu_rotate_left.png and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/res/drawable-mdpi/ic_menu_rotate_right.png b/src/vrpn/android_widgets/vrpn_library/res/drawable-mdpi/ic_menu_rotate_right.png deleted file mode 100644 index 27368b2454f5d2746d43edd90deddd42ddef7e6f..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/res/drawable-mdpi/ic_menu_rotate_right.png and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/res/drawable-mdpi/icon.png b/src/vrpn/android_widgets/vrpn_library/res/drawable-mdpi/icon.png deleted file mode 100644 index a07c69fa5a0f4da5d5efe96eea12a543154dbab6..0000000000000000000000000000000000000000 Binary files a/src/vrpn/android_widgets/vrpn_library/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/src/vrpn/android_widgets/vrpn_library/res/layout/tab_debug_sensors.xml b/src/vrpn/android_widgets/vrpn_library/res/layout/tab_debug_sensors.xml deleted file mode 100644 index 890d86ef1a40051cf3c1b19b260408f3095ac29a..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/res/layout/tab_debug_sensors.xml +++ /dev/null @@ -1,125 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<eu.ensam.ii.vrpn.views.DebugSensors -xmlns:android="http://schemas.android.com/apk/res/android" -android:layout_height="fill_parent" -android:layout_width="fill_parent" -android:orientation="vertical" -android:id="@+id/DebugSensors" -> - - <ToggleButton android:text="Save" android:id="@+id/BtnSave" - android:layout_width="wrap_content" - android:layout_height="wrap_content"> - </ToggleButton> - - <TableLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:stretchColumns ="*"> - <TableRow android:id="@+id/TableRow01" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - <TextView android:text="Sensor" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Rel." android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="X" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Y" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Z" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="L" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - </TableRow> - - <TableRow android:id="@+id/TableRow01" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - <TextView android:text="Accelerator" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="" android:id="@+id/AccAccuracy" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="X" android:id="@+id/AccX" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Y" android:id="@+id/AccY" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Z" android:id="@+id/AccZ" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="L" android:id="@+id/AccL" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - </TableRow> - - - <TableRow android:id="@+id/TableRow01" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - <TextView android:text="AcceleratorN" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="" android:id="@+id/xx" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="X" android:id="@+id/AccXn" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Y" android:id="@+id/AccYn" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Z" android:id="@+id/AccZn" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="L" android:id="@+id/AccLn" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - </TableRow> - - <TableRow android:id="@+id/TableRow01" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - <TextView android:text="Magnetic" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="" android:id="@+id/MagAccuracy" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="X" android:id="@+id/MagX" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Y" android:id="@+id/MagY" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Z" android:id="@+id/MagZ" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="L" android:id="@+id/MagL" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - </TableRow> - - <TableRow android:id="@+id/TableRow01" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - <TextView android:text="Magnetic" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="" android:id="@+id/xx" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="X" android:id="@+id/MagXn" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Y" android:id="@+id/MagYn" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Z" android:id="@+id/MagZn" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="L" android:id="@+id/MagLn" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - </TableRow> - - <TableRow android:id="@+id/TableRow01" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - <TextView android:text="Gyroscope" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="" android:id="@+id/GyrAccuracy" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="X" android:id="@+id/GyrX" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Y" android:id="@+id/GyrY" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Z" android:id="@+id/GyrZ" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - </TableRow> - - <TableRow android:id="@+id/TableRow01" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - <TextView android:text="Orientation" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="" android:id="@+id/xxx" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="X" android:id="@+id/OriX" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Y" android:id="@+id/OriY" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Z" android:id="@+id/OriZ" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - </TableRow> - - <TableRow android:id="@+id/TableRow01" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - <TextView android:text="Or. remapped" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="" android:id="@+id/xxx" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="X" android:id="@+id/OriRX" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Y" android:id="@+id/OriRY" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Z" android:id="@+id/OriRZ" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - </TableRow> - - <TableRow android:id="@+id/TableRow01" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - <TextView android:text="Rotation" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="" android:id="@+id/xxx" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="X" android:id="@+id/RotX" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Y" android:id="@+id/RotY" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="Z" android:id="@+id/RotZ" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - </TableRow> - - <TableRow android:id="@+id/TableRow01" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - <TextView android:text="inclination" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - <TextView android:text="X" android:id="@+id/Inclination" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> - </TableRow> - - </TableLayout> - -</eu.ensam.ii.vrpn.views.DebugSensors> diff --git a/src/vrpn/android_widgets/vrpn_library/res/layout/vrpn_seekbar.xml b/src/vrpn/android_widgets/vrpn_library/res/layout/vrpn_seekbar.xml deleted file mode 100644 index 9989e1aeb877fc470b54244d126d858170ff28ff..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/res/layout/vrpn_seekbar.xml +++ /dev/null @@ -1,64 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -Layout for the composite widget VrpnSeekBar , backed by the class VrpnSeekBar - -The widget includes -- a title line -- a line with min, max and current values of the seekbar -- the seekbar itself - --> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:id="@+id/vrpn_seekbar" - android:orientation="vertical" - > - <TextView - android:id="@+id/txtSeekBarTitle" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="Label"> - </TextView> - - <LinearLayout - android:id="@+id/lytSeekBarValues" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:orientation="horizontal"> - <TextView - android:id="@+id/txtSeekBarMinValue" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="left" - android:gravity="bottom|left" - android:layout_weight="1" - android:text="min" - > - </TextView> - <TextView - android:id="@+id/txtSeekBarCurrentValue" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:gravity="center" - android:textSize="20dip" - android:layout_weight="1" - android:text="Current"> - </TextView> - <TextView - android:id="@+id/txtSeekBarMaxValue" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="right" - android:gravity="bottom|right" - android:layout_weight="1" - android:text="max"> - </TextView> - </LinearLayout> - <SeekBar - android:id="@+id/seekBarWidget" - android:layout_width="fill_parent" - android:layout_height="wrap_content"> - </SeekBar> -</LinearLayout> diff --git a/src/vrpn/android_widgets/vrpn_library/res/values/attrs.xml b/src/vrpn/android_widgets/vrpn_library/res/values/attrs.xml deleted file mode 100644 index 6fc1056d772095dbce7cb02460f2a5c5e50296a1..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/res/values/attrs.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <declare-styleable name="VrpnSeekBar"> - <attr name="hideTitle" format="boolean"/> - <attr name="hideValues" format="boolean"/> - <attr name="defaultValue" format="float"/> - <attr name="minValue" format="float"/> - <attr name="maxValue" format="float"/> - <attr name="title" format="string"/> - <attr name="vrpnAnalog" format="integer"/> - </declare-styleable> - - <declare-styleable name="VrpnRadioButton"> - <!-- - This is the definition : declare the format. - The next ones will be declarations, without the forat - --> - <attr name="vrpnButton" format="integer"/> - </declare-styleable> - - <declare-styleable name="VrpnPressButton"> - <attr name="vrpnButton"/> - </declare-styleable> - - <declare-styleable name="VrpnToggleButton"> - <attr name="vrpnButton"/> - </declare-styleable> - - <declare-styleable name="VrpnSurface"> - <attr name="vrpnAnalogX" format="integer"/> - <attr name="vrpnAnalogY" format="integer"/> - <attr name="leftX" format="float"/> - <attr name="rightX" format="float"/> - <attr name="topY" format="float"/> - <attr name="bottomY" format="float"/> - </declare-styleable> - - <declare-styleable name="VrpnSpinner"> - <attr name="vrpnAnalog"/> - </declare-styleable> - -</resources> diff --git a/src/vrpn/android_widgets/vrpn_library/res/values/strings.xml b/src/vrpn/android_widgets/vrpn_library/res/values/strings.xml deleted file mode 100644 index 5af1a8a6118dea8798625fab7d2878af0bca8140..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/res/values/strings.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="hello">Hello World!</string> - <string name="app_name">vrpn_library</string> - <string name="DefaultIntentString">eu.ensam.ii.vrpn.STARTUI</string> -</resources> diff --git a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/Quat.java b/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/Quat.java deleted file mode 100644 index aa592169b54aea7781912c149aac2c5022be8fc0..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/Quat.java +++ /dev/null @@ -1,54 +0,0 @@ -package eu.ensam.ii.vrpn; - -import org.json.JSONArray; -import org.json.JSONException; - -import android.util.FloatMath; - -/** - * A simple float quaternion - * - * @author Philippe - * - */ -class Quat { - Vec3f v = new Vec3f(); - float w = 0.0f; - - Quat() { - } - - /** - * Computes a rotation quaternion that rotates <code>s</code> to <code>t</code> - * - * @param s - * @param t - */ - void setRotate(final Vec3f s, final Vec3f t) { - // from Real-Time Rendering, 3d ed p 79 - final float e = s.dot(t); - final float k = FloatMath.sqrt(2.0f * (1.0f + e)); - v = s.cross(t).mul(1.0f / k); - w = k / 2.0f; - } - - /** - * Fill the first 4 elements of the JSON array with the values of this quaternion object - * - * Extraneous existing elements of the array are set to null - * - * @param jsonArray the JSON array to be filled - * @throws JSONException - */ - final void fill(JSONArray jsonArray) throws JSONException { - jsonArray.put(0, v.x); - jsonArray.put(1, v.y); - jsonArray.put(2, v.z); - jsonArray.put(3, w); - int i = 4; - while (i < jsonArray.length()) { - jsonArray.put(i++, null); - } - } - -} diff --git a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/Vec3f.java b/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/Vec3f.java deleted file mode 100644 index c4531fe1758c41bd32c5ad27d0b7152806de1962..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/Vec3f.java +++ /dev/null @@ -1,99 +0,0 @@ -package eu.ensam.ii.vrpn; - -import android.util.FloatMath; -import org.json.JSONArray; -import org.json.JSONException; - -/** - * A basic 3-element float vector. - * - * Used for some computations with SensorEvent values - * - * @author Philippe - * - */ -class Vec3f { - public float x, y, z; - - Vec3f() { - x = y = z = 0.0f; - } - - Vec3f(float _x, float _y, float _z) { - set(_x, _y, _z); - } - - void set(float _x, float _y, float _z) { - x = _x; - y = _y; - z = _z; - } - - - final float dot(final Vec3f v) { - return x*v.x + y*v.y + z*v.z; - } - - final Vec3f cross(final Vec3f v) { - Vec3f w = new Vec3f( - y*v.z - z*v.y, - z*v.x - x*v.z, - x*v.y - y*v.x); - return w; - } - - /** - * Computes a normalized vector - * @param u - * @return normalized vector value - */ - static Vec3f normalize(final Vec3f u) { - final float norm = u.norm(); - Vec3f v = u; - v.x /= norm; - v.y /= norm; - v.z /= norm; - return v; - } - - /** - * Normalizes this vector - */ - final void normalize() { - final float norm = norm(); - x /= norm; - y /= norm; - z /= norm; - } - - /** - * Computes the norm of this vector - * - * @return the float value of the norm of the object - */ - final float norm() { - return FloatMath.sqrt(x*x + y*y + z*z); - } - - /** - * Fill the first 3 elements of the JSON array with the values of this Vec3f object - * - * Extraneous existing elements of the array are set to null - * - * @param jsonArray the JSON array to be filled - * @throws JSONException - */ - final void fill(JSONArray jsonArray) throws JSONException { - jsonArray.put(0, x); - jsonArray.put(1, y); - jsonArray.put(2, z); - int i = 3; - while (i < jsonArray.length()) { - jsonArray.put(i++, null); - } - } - - Vec3f mul(float k) { - return new Vec3f(x*k, y*k, z*k); - } -} diff --git a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnApplication.java b/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnApplication.java deleted file mode 100644 index 22d8ae0ff8aa0809ed0ff5447a40bec418e85446..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnApplication.java +++ /dev/null @@ -1,31 +0,0 @@ -package eu.ensam.ii.vrpn; - -/** - * This class must be used as an {@link android.app.Application Application} for applications that use the Vrpn widgets. - * <p> - - * An application that wants to use the Vrpn widgets must define an - * <em>application</em> tag with the name of this class in its manifest : - * </p> - * <ul> - * <li>edit your application <em>AndroidManifext.xml</em> and open the <em>Application</em> tab</li> - * <li>in the <em>Application toggle</em> section , check - * <em>Define an <application> tag ...</em></li> - * <li>in the <em>Application Attributes</em> section, type <em>eu.ensam.ii.vrpn.VrpnApplication</em> as the value of the - * <em>Name</em> attribute or use the <em>Browse...<em>button</li> - * </ul> - * - */ -public class VrpnApplication extends android.app.Application { - /* - * The VrpnApplication object holds and initializes an instance of VrpnClient. - */ - private VrpnClient _vrpnClient; - - @Override - public void onCreate() { - _vrpnClient = VrpnClient.getInstance(); - _vrpnClient.init(getApplicationContext()); - } - -} diff --git a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnClient.java b/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnClient.java deleted file mode 100644 index 12c9b376601c34fe1f00d26da8749ce691b879ff..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnClient.java +++ /dev/null @@ -1,382 +0,0 @@ -package eu.ensam.ii.vrpn; - -import java.io.IOException; -import java.net.DatagramPacket; -import java.net.DatagramSocket; -import java.net.InetAddress; -import java.net.SocketException; -import java.net.UnknownHostException; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import android.content.Context; -import android.hardware.Sensor; -import android.hardware.SensorEvent; -import android.hardware.SensorEventListener; -import android.hardware.SensorManager; -import android.net.Uri; -import android.util.Log; - -/** - * Send updates button, analog and tracker updates to the JsonNet Vrpn server. - * - * <p> - * A application that uses the Vrpn widgets must initialize the unique instance - * of this class by calling {@link #setUri(Context, Uri) setUri} before the - * widgets are used. - * </p> - * <p> - * This class is not thread-safe. The methods <code>sendButton</code> and - * <code>sendAnalog</code> must be called from the main UI thread - * </p> - * <p> - * Currently the messages neither include a timestamp nor a sequence number - * </p> - * - * TODO Add timestamps and sequence numbers Add a method to allow sending TODO - * tracker updates from the widgets - */ -public class VrpnClient implements SensorEventListener { - - private static VrpnClient _instance; - - private static String LOG_TAG = "VrpnClient"; - private SensorManager _sensorManager; - - private boolean _isTiltTrackerEnabled = false; - private boolean _isRawGyroscopeEnabled = false; - private boolean _isRawAccelerometerEnabled = false; - - private int _tiltTrackerSequenceNumber = 0; - private static final Vec3f Zpos = new Vec3f(0.0f, 0.0f, 1.0f); - - float _values[] = new float[3]; - - /* - * Create the objects once to avoid repeated allocations in frequently - * called functions. As long as the VrpnClient methods that update the - * object are called from the same thread, no problem. This is currently the - * case, since the sensor updates are call on the main and the other updates - * are called from UI widgets callbacks, also on the main UI thread.. - */ - private DatagramSocket _socket; - private DatagramPacket _packet; - JSONArray _jsonArray = new JSONArray(); - private JSONObject _sensorJsonObject = new JSONObject(); - private JSONObject _buttonJsonObject = new JSONObject(); - private JSONObject _analogJsonObject = new JSONObject(); - private Quat _quat = new Quat(); - private Vec3f _v = new Vec3f(); - - /* - * These Ids must match those declared in vrpn_Tracker_Android.cpp - */ - private static final String MSG_KEY_TYPE = "type"; - private static final String MSG_KEY_SEQUENCE_NUMBER = "sn"; - private static final String MSG_KEY_TIMESTAMP = "ts"; - - private static final String MSG_KEY_TRACKER_ID = "id"; - private static final String MSG_KEY_TRACKER_QUAT = "quat"; - @SuppressWarnings("unused") - private static final String MSG_KEY_TRACKER_POS = "pos"; - - // Values for MSG_KEY_TRACKER_ID - private static final int MSG_SENSOR_ID_TILT = 0; - @SuppressWarnings("unused") - private static final int MSG_SENSOR_ID_RAW_ACCELEROMETER = 1; - @SuppressWarnings("unused") - private static final int MSG_SENSOR_ID_RAW_GYROSCOPE = 2; - - private static final String MSG_KEY_BUTTON_ID = "button"; - private static final String MSG_KEY_BUTTON_STATUS = "state"; - - private static final String MSG_KEY_ANALOG_CHANNEL = "num"; - private static final String MSG_KEY_ANALOG_DATA = "data"; - - private final int MSG_TYPE_TRACKER = 1; - private final int MSG_TYPE_BUTTON = 2; - private final int MSG_TYPE_ANALOG = 3; - - /************************************************************************** - * - * Create / Destroy - * - **************************************************************************/ - /** - * Returns the unique VrpnClient instance - */ - public static VrpnClient getInstance() { - if (_instance == null) { - _instance = new VrpnClient(); - } - return _instance; - } - - /** - * Initializes the address and port of the VRPN server. - * - * <p> - * This method must be called before sending any update to the server. - * </p> - * Note that the widgets trigger updates when they they are displayed for - * the first time. So this method must be called before calling - * {@link android.app.Activity#setContentView(int) setContentView} in the - * main {@link android.app.Activity activity} - * {@link android.app.Activity#onCreate setContentView} - * <code>onCreate</code> method - * - * @param host - * a string that is a valid host name or IP address - * @param port - * the port number of the VRPN server - */ - public void setupVrpnServer(InetAddress hostAddress, int port) { - - Log.d(LOG_TAG, "server:host = " + hostAddress + ":" + port); - /* - * Initialize the packet destination - */ - _packet.setAddress(hostAddress); - _packet.setPort(port); - } - - /** - * Load the target server address and port from the shared preferences - * - * @param context - */ - void init(Context context) { - _sensorManager = (SensorManager) context - .getSystemService(Context.SENSOR_SERVICE); - enableOrDisableSensors(); - } - - /** - * Send an update to a Vrpn Button. - * - * This update will trigger a button callback on the application side - * - * @param buttonId - * the button number. Invalid button numbers are ignored on this - * side, but may trigger an error message on the Vrpn server - * @param buttonState - * the new status of the button - */ - public void sendButton(int buttonId, boolean buttonState) { - try { - _buttonJsonObject.put(MSG_KEY_TYPE, MSG_TYPE_BUTTON); - _buttonJsonObject.put(MSG_KEY_BUTTON_ID, buttonId); - _buttonJsonObject.put(MSG_KEY_BUTTON_STATUS, buttonState); - } catch (JSONException e1) { - e1.printStackTrace(); - } - _sendObject(_buttonJsonObject); - } - - /** - * Send an update to a Vrpn Analog channel. - * - * This update will trigger an analog callback on the application side - * - * @param channelId - * The channel number. Invalid channel numbers are ignored on - * this side but, they may trigger an error message on the Vrpn - * server - * @param channelValue - * the data that will be sent on the analog channel - */ - public void sendAnalog(int channelId, double channelValue) { - try { - _analogJsonObject.put(MSG_KEY_TYPE, MSG_TYPE_ANALOG); - _analogJsonObject.put(MSG_KEY_ANALOG_CHANNEL, channelId); - _analogJsonObject.put(MSG_KEY_ANALOG_DATA, channelValue); - } catch (JSONException e1) { - e1.printStackTrace(); - } - _sendObject(_analogJsonObject); - } - - /** - * Enables or disable the tilt tracker. - * - * The tilt tracker send a tracker update with a quaternion that rotates the - * "earth vertical up" vector to the +Z vector in device coordinates. See - * {@link android.hardware.SensorEvent SensorEvent} for a description of the - * device coordinate system. This quaternion can be used to retrieve the - * roll and pitch of the device. - * - * @param enable - * <code>true</code> enables the tilt tracker updates and - * <code>false</code> disable the tilt tracker updates - */ - public void enableTiltTracker(boolean enable) { - _isTiltTrackerEnabled = enable; - enableOrDisableSensors(); - } - - /************************************************************************** - * - * Sensorlistener implementation - * - **************************************************************************/ - /** - * Called by the system when the sensor accuracy changes - * - * This method is empty and should not be called by widgets - * - */ - @Override - public void onAccuracyChanged(Sensor sensor, int accuracy) { - } - - /** - * Called by the system when a sensor data changes. - * - * This method retrieves the Android sensor object. If an vrpn Tracker is - * active that involves this sensor object this method sends a Vrpn tracker - * update to the appropriate tracker. packages the sensor data into a JSON - * object then send the JSON object onto an UDP socket. The target socket - * endpoint configuration is configured by calling setupVrpnServer - * - */ - @Override - public void onSensorChanged(SensorEvent event) { - final int sensorType = event.sensor.getType(); - - // retrieve and update the adequate sequence number. - switch (sensorType) { - case Sensor.TYPE_ACCELEROMETER: - if (_isTiltTrackerEnabled) { - buildTiltTrackerObject(event.values, event.timestamp); - _sendObject(_sensorJsonObject); - } - if (_isRawAccelerometerEnabled) { - // To do - } - break; - case Sensor.TYPE_GYROSCOPE: - if (_isRawGyroscopeEnabled) { - // To do - } - break; - - default: - return; - } - - // Add other trackers here - - // Send the data onto the network - } - - /**************************************************************************** - * Private methods - ****************************************************************************/ - - private VrpnClient() { - try { - _socket = new DatagramSocket(); - } catch (SocketException e) { - // Check this device IP network configuration - e.printStackTrace(); - } - - /* - * There is a single _packet instance to avoid numerous object creation - * in onSensorChanged() - */ - byte dummy[] = { 0 }; - _packet = new DatagramPacket(dummy, dummy.length); - - // Set the address with anything since _sendObject will be called before - // setUri has been called // why - try { - _packet.setAddress(InetAddress.getLocalHost()); - } catch (UnknownHostException e) { - } - } - - /** - * Send the string representation of a Json Object. - * - * @param[in] o the json object to send - */ - private void _sendObject(final JSONObject o) { - Log.d(LOG_TAG, o.toString()); - - // Send the data onto the network - _packet.setData(o.toString().getBytes()); - try { - _socket.send(_packet); - } catch (SocketException e) { - // Local network not ready, no route to host, ... - ; - } catch (IOException e) { - // TODO Auto-generated catch block : send a notification ? - e.printStackTrace(); - } - } - - /** - * Build a tilt tracker JSON object - * - * This method updates the _sensorJsonObject object - * - * @param x - * @param y - * @param z - * @param timestamp - */ - private void buildTiltTrackerObject(final float[] values, long timestamp) { - _v.set(values[0], values[1], values[2]); - _v.normalize(); - /* - * When the device is at rest, the acceleration vector is -g (earth - * vertical up) in device coordinate system (Z out of the screen, that - * is Z up when the device lays on a table). Compute the rotation +Z --> - * -g - */ - _quat.setRotate(Zpos, _v); - - // Build a Json message - try { - _sensorJsonObject.put(MSG_KEY_TYPE, MSG_TYPE_TRACKER); - _sensorJsonObject.put(MSG_KEY_SEQUENCE_NUMBER, - _tiltTrackerSequenceNumber++); - _sensorJsonObject.put(MSG_KEY_TIMESTAMP, timestamp); - _sensorJsonObject.put(MSG_KEY_TRACKER_ID, MSG_SENSOR_ID_TILT); - - _quat.fill(_jsonArray); - _sensorJsonObject.put(MSG_KEY_TRACKER_QUAT, _jsonArray); - } catch (JSONException e2) { - // TODO Auto-generated catch block - e2.printStackTrace(); - } - } - - /** - * Update the device sensor activation status. - */ - private void enableOrDisableSensors() { - final int rate = SensorManager.SENSOR_DELAY_GAME; - final Sensor accelerometer = _sensorManager - .getDefaultSensor(Sensor.TYPE_ACCELEROMETER); - - _sensorManager.unregisterListener(this); - - if (_isTiltTrackerEnabled) { - _sensorManager.registerListener(this, accelerometer, rate); - } else { - /* - * We are closing down the tilt tracker, Send an update with - * horizontal position - */ - buildTiltTrackerObject(new float[] { 0.0f, 0.0f, 1.0f }, - System.nanoTime()); - _sendObject(_sensorJsonObject); - } - } - -} diff --git a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnPressButton.java b/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnPressButton.java deleted file mode 100644 index 7544856c710f6fad90cce821c37a0d8ce24b2bf5..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnPressButton.java +++ /dev/null @@ -1,145 +0,0 @@ -package eu.ensam.ii.vrpn; - -import android.content.Context; -import android.content.res.TypedArray; -import android.util.AttributeSet; -import android.util.Log; -import android.view.MotionEvent; -import android.view.View; - -/** - * A {@link android.widget.Button Button} connected to a VRPN Button. - * - * <p> - * This button is linked to a Vrpn button. It sends sends a <code>true</code> - * update when its status changes to checked and a <code>false</code> update - * when its status changes to unchecked. The status of the VrpnPressButton - * changes when it is pushed, and also when it is released, unlike a - * {@link VrpnToggleButton}. - * </p> - * - * <p> - * In your <code>res/layout.xml</code>, include the widget in - * its parent layout : - * </p> - * <pre> - * <eu.ensam.ii.VrpnPressButton - * android:layout_width="fill_parent" - * android:layout_height="wrap_content" - * app:vrpnButton="@id/MyButton" - * /> - * </pre> - * - * <p> - * The root element of the layout must declare the following line just after the - * <code>xmlns:android ... </code>line : - * - * <pre> - * xmlns:app="http://schemas.android.com/apk/res/your.package.name.here" - * </pre> - * - * </p> - * - * <p> - * <strong>Custom XML attributes :</strong> - * </p> - * <ul> - * <li><code>app:vrpnButton</code> : the id of the Vrpn button that will receive - * updated from this widget. This value can be a literal or a resource Id that - * can be kept in a <a href="package-summary.html#vrpnids">separate Vrpn Id - * list</a></li> - * </ul> - * - */ -public class VrpnPressButton extends android.widget.Button implements - android.view.View.OnTouchListener { - private String TAG = "VrpnPressButton"; - private int _vrpnButtonId = 0; - - public VrpnPressButton(Context context) { - super(context); - init(null); - } - - public VrpnPressButton(Context context, AttributeSet attrs) { - super(context, attrs); - init(attrs); - } - - public VrpnPressButton(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - init(attrs); - } - - /** - * Widget initialization - * - * @param attrs - * the AttributeSet that is required to access to the XML custom - * attributes - */ - private void init(AttributeSet attrs) { - // this.onTouch() will be called when this widget is touched - setOnTouchListener(this); - - /* - * Get The Vrpn button id from the xml app:vrpnButton attribute The - * custom attribute is declared is in res/values/attrs.xml - */ - TypedArray a = getContext().obtainStyledAttributes(attrs, - R.styleable.VrpnRadioButton); - _vrpnButtonId = a.getInt(R.styleable.VrpnRadioButton_vrpnButton, 0); - a.recycle(); - - // Send a "false" since a PressButton is always initially released - Log.d(TAG, "ctor init : button " + _vrpnButtonId + " released "); - VrpnClient.getInstance().sendButton(_vrpnButtonId, false); - } - - /** - * Called when a touch event is dispatched to this VrpnPressButton. - * - * This method sends a <code>true</code> update when the button is pressed - * and a <code>false</code> update when the button is released. when it is - * released. No event is send while the button is pressed. - * - * @see android.view.View.OnTouchListener#onTouch(android.view.View, - * android.view.MotionEvent) - */ - @Override - public boolean onTouch(View v, MotionEvent event) { - final int action = event.getAction(); - /* - * Avoid unnecessary processing for irrelevant events Nothing is sent - * while the button is hold down (event=ACTION_MOVE) - */ - if (action != MotionEvent.ACTION_DOWN - && action != MotionEvent.ACTION_UP - && action != MotionEvent.ACTION_CANCEL) { - // Mark the event has handled, so it is not be handled by - // ToggleButton::onClick - return true; - } - - /* - * Send true when the button is pressed and false when it is released. - */ - switch (event.getAction()) { - case MotionEvent.ACTION_DOWN: - Log.d(TAG, " button " + _vrpnButtonId + " pressed "); - VrpnClient.getInstance().sendButton(_vrpnButtonId, true); - break; - case MotionEvent.ACTION_UP: - case MotionEvent.ACTION_CANCEL: - Log.d(TAG, " button " + _vrpnButtonId + " released "); - VrpnClient.getInstance().sendButton(_vrpnButtonId, false); - break; - default: - break; - } - // Mark the event has handled, so it is not be handled by - // ToggleButton::onClick - return false; - } - -} diff --git a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnRadioButton.java b/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnRadioButton.java deleted file mode 100644 index d68d9b2e9bdac4ea96070512767cb800bff0fd9f..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnRadioButton.java +++ /dev/null @@ -1,107 +0,0 @@ -package eu.ensam.ii.vrpn; - -import android.content.Context; -import android.content.res.TypedArray; -import android.util.AttributeSet; -import android.util.Log; -import android.widget.CompoundButton; -import android.widget.RadioGroup; -import android.widget.CompoundButton.OnCheckedChangeListener; - -/** - * A {@link android.widget.RadioButton RadioButton} that updates a Vrpn Button channel. - * - * <p> - * The <code>VrpnRadioButton</code> is to be included inside a {@link RadioGroup}. The - * <code>VrpnRadioButton</code> will send a <code>true</code> when its state changes to - * checked and a <code> false</code> update when its state changes to unchecked. - * Checking another button of the <code>RadioGroup</code> will uncheck the <code>RadioButton</code>.</p> - * <p>in a <code>RadioGroup</code>, it is possible to include : - * <ul> - * <li>a <code>VrpnRadiobutton</code> and a <code>RadioButton</code>. Checking the <code>RadioButton</code> will uncheck the <code>VrpnRadioButton</code> that will send an update</li> - * <li>several <code>VrpnRadioButton</code> widgets. In this case the checked and the unchecked widgets will send updates</li> - * </ul> - * </p> - * <p> - * In your layout, declare the following : - * </p> - * - * <pre> - * <RadioGroup - * android:id="@+id/RadioGroup01" - * > - * <eu.ensam.ii.vrpn.VrpnRadioButton - * android:text="This way" - * android:checked="true" - * app:vrpnButton="@id/VrpnButtonThisWay" - * /> - * <RadioButton - * android:text="other Way" - * android:checked="false" - * /> - * </RadioGroup> - * </pre> - * - * <p> - * The root element of the layout must declare the following line just after the - * <code>xmlns:android ... </code>line : - * - * <pre> - * xmlns:app="http://schemas.android.com/apk/res/your.package.name.here" - * </pre> - * - * </p> - * - * <p> - * <strong>Custom XML attributes :</strong> - * </p> - * <ul> - * <li><code>app:vrpnButton</code> : the id of the Vrpn button that will receive - * updated from this widget. This value can be a literal or a resource Id that - * can be kept in a <a href="package-summary.html#vrpnids">separate Vrpn Id - * list</a></li> - * </ul> - */ - -public class VrpnRadioButton extends android.widget.RadioButton implements - OnCheckedChangeListener { - private static final String TAG = "VrpnRadioButton"; - int _vrpnButtonId = 0; - - public VrpnRadioButton(Context context) { - super(context); - init(null); - } - - public VrpnRadioButton(Context context, AttributeSet attrs) { - super(context, attrs); - init(attrs); - } - - public VrpnRadioButton(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - init(attrs); - } - - private void init(AttributeSet attrs) { - setOnCheckedChangeListener(this); - - // get The Vrpn button id from the xml app:vrpnButton attribute - TypedArray a = getContext().obtainStyledAttributes(attrs, - R.styleable.VrpnRadioButton); - _vrpnButtonId = a.getInt(R.styleable.VrpnRadioButton_vrpnButton, 0); - a.recycle(); - - // Trigger an initial Vrpn update - Log.d(TAG, "ctor init " + _vrpnButtonId + " : " + isChecked()); - VrpnClient.getInstance().sendButton(_vrpnButtonId, isChecked()); - } - - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - Log.d(TAG, "onCheckChanged " + _vrpnButtonId + " : " + isChecked); - // Send the update through the Vrpn service - VrpnClient.getInstance().sendButton(_vrpnButtonId, isChecked()); - - } -} diff --git a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnSeekBar.java b/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnSeekBar.java deleted file mode 100644 index 9101042e0d7727fe74e341134de197c88fc392e4..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnSeekBar.java +++ /dev/null @@ -1,180 +0,0 @@ -package eu.ensam.ii.vrpn; - -import android.content.Context; -import android.content.res.TypedArray; -import android.util.AttributeSet; -import android.util.Log; -import android.view.LayoutInflater; -import android.widget.LinearLayout; -import android.widget.SeekBar; -import android.widget.SeekBar.OnSeekBarChangeListener; -import android.widget.TextView; - -/** - * A {@link android.widget.SeekBar SeekBar} that updates a Vrpn Analog channel. - * - * <p> - * The seekbar include a line with the min, max and current - * values of the seekbar, and the seekbar itself. - * - * The seekbar progress is converted into a value in the - * <code>app:minValue</code> .. <code>app:maxValue</code> - * range. This value is then sent out to the Vrpn Analog channel whose - * id is specified in the <code>app:vrpnAnalog</code> attribute. The <code>VrpnSeekBar</code> - * moves in increments that are one hundredth of the value range. - * </p> - * <p> - * In your layout, declare the following (note the app:attributes) - * </p> - * - * <pre> - * <eu.ensam.ii.vrpn.VrpnSeekBar - * android:layout_width="fill_parent" - * android:layout_height="wrap_content" - * app:minValue="-3" - * app:minValue="3" - * app:minValue="0" - * app:vrpnAnalog="@id/MyVrpnAnalogId" - * /> - * </pre> - * - * <p> - * The root element of the layout must declare the following line just after the - * <code>xmlns:android ... </code>line : - * - * <pre> - * xmlns:app="http://schemas.android.com/apk/res/your.package.name.here" - * </pre> - * - * </p> - * - * <p> - * <strong>Custom XML attributes :</strong> - * </p> - * <ul> - * <li><code>app:vrpnAnalog</code> : the id of the Vrpn analog that will receive - * updates from this widget. This value can be a literal or a resource Id that - * can be kept in a <a href="package-summary.html#vrpnids">separate Vrpn Id - * list</a></li> - * <li><code>app:minValue</code> : the numeric value mapped onto the left - * position of the VrpnSeekbar</li> - * <li><code>app:maxValue</code> : the numeric value mapped onto the left - * position of the VrpnSeekbar</li> - * <li><code>app:defaultValue</code> : the initial numeric value of the VrpnSeekbar;</li> - * <li><code>app:hideValues</code> : <code>true</code> will cause the line with - * the minimum, maximum and current values to be hidden, <code>false</code> will cause - * the line to be displayed (default)</li> - * </ul> - * - * @author Philippe - * - */ -public class VrpnSeekBar extends android.widget.LinearLayout implements - OnSeekBarChangeListener { - // Partly adapted from - // http://www.codeproject.com/KB/android/seekbar_preference.aspx - - private static final String TAG = "VrpnSeekBar"; - - private static final float DEFAULT_MIN_VALUE = 0.0f; - private static final float DEFAULT_MAX_VALUE = 100.0f; - - private float _minValue; - private float _maxValue; - private float _currentValue; - private TextView _currentValueText; - private CharSequence _title; - private int _vrpnAnalogId; - private SeekBar _seekBar; - private boolean _hideValues; - - public VrpnSeekBar(Context context) { - this(context, null); - } - - public VrpnSeekBar(Context context, AttributeSet attrs) { - super(context, attrs); - - // Get the custom attribute values - TypedArray a = getContext().obtainStyledAttributes(attrs, - R.styleable.VrpnSeekBar); - _minValue = a - .getFloat(R.styleable.VrpnSeekBar_minValue, DEFAULT_MIN_VALUE); - _maxValue = a - .getFloat(R.styleable.VrpnSeekBar_maxValue, DEFAULT_MAX_VALUE); - _currentValue = a.getFloat(R.styleable.VrpnSeekBar_defaultValue, - (_maxValue + _minValue) / 2.0f); - _title = a.getText(R.styleable.VrpnSeekBar_title); - _vrpnAnalogId = a.getInt(R.styleable.VrpnSeekBar_vrpnAnalog, 0); - boolean hideTitle = a.getBoolean(R.styleable.VrpnSeekBar_hideTitle, false); - _hideValues = a.getBoolean(R.styleable.VrpnSeekBar_hideValues, false); - a.recycle(); - - // Load the view layout - LayoutInflater li = (LayoutInflater) context - .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - li.inflate(R.layout.vrpn_seekbar, this, true); - - // Load or hide the title - TextView titleView = (TextView) findViewById(R.id.txtSeekBarTitle); - if (hideTitle) { - titleView.setVisibility(GONE); - } else { - titleView.setText(_title); - } - - // Load or hide the layout with the values - if (_hideValues) { - ((LinearLayout) findViewById(R.id.lytSeekBarValues)) - .setVisibility(GONE); - - } else { - ((TextView) findViewById(R.id.txtSeekBarMinValue)).setText(Float - .toString(_minValue)); - ((TextView) findViewById(R.id.txtSeekBarMaxValue)).setText(Float - .toString(_maxValue)); - _currentValueText = (TextView) findViewById(R.id.txtSeekBarCurrentValue); - } - - // Setup the SeekBar - _seekBar = (SeekBar) findViewById(R.id.seekBarWidget); - _seekBar.setOnSeekBarChangeListener(this); - - // This triggers OnProgressChanged() and a VrpnUpdate - int currentValue = (int) (100.0 * (_currentValue - _minValue) / (_maxValue - _minValue)); - _seekBar.setProgress(currentValue); - } - - /** - * Called when the progress of the SeekBar changes - * - * Compute the value from the progress and send a VrpnUpdate to the analog - * channel that is associated to the widget with the custom attribute - * app:vrpnAnalog - */ - @Override - public void onProgressChanged(SeekBar seekBar, int progress, - boolean fromUser) { - // progress is in range 0..100 : map to min..max - _currentValue = (_maxValue - _minValue) / 100 * progress + _minValue; - if (!_hideValues) { - _currentValueText.setText(String.format("%.2f", _currentValue)); - } - - Log.d(TAG, "onProgressChanged " + _vrpnAnalogId + " progress/value: " - + progress + " " + _currentValue); - // Send the vrpn update - // Note : The line below throws an exception in the Eclipse GUI preview - VrpnClient.getInstance().sendAnalog(_vrpnAnalogId, _currentValue); - - } - - @Override - public void onStartTrackingTouch(SeekBar seekBar) { - } - - @Override - public void onStopTrackingTouch(SeekBar seekBar) { - } - -} diff --git a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnSpinner.java b/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnSpinner.java deleted file mode 100644 index a5c5d721399d01a679c692c26fc0758353f00c1d..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnSpinner.java +++ /dev/null @@ -1,105 +0,0 @@ -package eu.ensam.ii.vrpn; - -import android.content.Context; -import android.content.res.TypedArray; -import android.util.AttributeSet; -import android.util.Log; -import android.view.View; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemSelectedListener; - -/** - * A {@link android.widget.Spinner Spinner} that updates a Vrpn Analog channel. - * - * <p> - * Picking a value from the spinner will update a Vrpn Analog channel with the - * position of the item that was picked in the item list. On the application side, the value will be delivered as a <em>double</em>. - * </p> - * <p> - * In your layout, declare the following : - * </p> - * - * <pre> - * <eu.ensam.ii.vrpn.VrpnSpinner - * android:layout_width="fill_parent" - * android:layout_height="wrap_content" - * android:prompt="@string/the_prompt" - * android:entries="@array/the_array" - * app:vrpnAnalog="@id/VrpnAnalogMySpinner" - * /> - * </pre> - * - * In a resource XML file located in <em>res/values</em>, define the prompt that - * will be displayed in the choice dialog, as well as the list of values to choose from.</p>< - * - * <pre> - * <string name="the_prompt">Message displayed when the choice dialog is opened</string> - * <string-array name="the_array"> - * <item>"Mars"</item> - * <item>"Venus"</item> - * </string-array> - * </pre> - * <p> - * The root element of the layout must declare the following line just after the - * <code>xmlns:android ... </code>line :</p> - * <pre> - * xmlns:app="http://schemas.android.com/apk/res/your.package.name.here" - * </pre> - * <p> - * <strong>Custom XML attributes :</strong> - * </p> - * <ul> - * <li><code>app:vrpnAnalog</code> : the id of the Vrpn analog that will receive - * updated from this widget. This value can be a literal or a resource Id that - * can be kept in a <a href="package-summary.html#vrpnids">separate Vrpn Id - * list</a></li> - * </ul> - */ -public class VrpnSpinner extends android.widget.Spinner implements OnItemSelectedListener { - - private static final String TAG = "VrpnSpinner"; - - private int _vrpnAnalogId; - - public VrpnSpinner(Context context) { - super(context); - init(null); - } - - public VrpnSpinner(Context context, AttributeSet attrs) { - super(context, attrs); - init(attrs); - } - - private void init(AttributeSet attrs) { - // Get the custom attribute values - TypedArray a = getContext().obtainStyledAttributes(attrs, - R.styleable.VrpnSpinner); - _vrpnAnalogId = a.getInt(R.styleable.VrpnSpinner_vrpnAnalog, 0); - a.recycle(); - - setOnItemSelectedListener(this); - setSelection(0); - - // Trigger a Vrpn update to get a known initial state - Log.d(TAG, "ctor " + _vrpnAnalogId + " position " + 0); - VrpnClient.getInstance().sendAnalog(_vrpnAnalogId, 0); - } - - /** - * - * @see android.widget.AdapterView.OnItemSelectedListener#onItemSelected(android.widget.AdapterView, android.view.View, int, long) - */ - @Override - public void onItemSelected(AdapterView<?> parent, View view, int position, - long id) { - Log.d(TAG, "onItemSelected " + _vrpnAnalogId + " position" + position); - // Send the vrpn update - // Note : The line below throws an exception in the Eclipse GUI preview - VrpnClient.getInstance().sendAnalog(_vrpnAnalogId, position); - } - - @Override - public void onNothingSelected(AdapterView<?> arg0) { - } -} diff --git a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnSurface.java b/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnSurface.java deleted file mode 100644 index 5137afe4cf57baee5738b978e6ee57b1cc74620c..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnSurface.java +++ /dev/null @@ -1,168 +0,0 @@ -package eu.ensam.ii.vrpn; - -import android.content.Context; -import android.content.res.TypedArray; -import android.util.AttributeSet; -import android.util.Log; -import android.view.MotionEvent; -import android.view.View; -import android.view.View.OnTouchListener; - -/** - * This {@link android.view.SurfaceView SurfaceView} updates two Vrpn Analog channels with the coordinates of the - * Surface point that is touched. - * - * <p> - * Updates are sent as long astouch events occur within the surface. The - * X channel range from - * <code>app:leftX</code> to <code>app:rightX</code>, - * and the Y channel values range from <code>app:topY</code> to - * <code>app:bottomY</code>. - * </p> - * - * <p> - * In your layout, declare the following (note the <code>app:</code> attributes) - * </p> - * - * <pre> - * <eu.ensam.ii.vrpn.VrpnSurface - * android:layout_width="fill_parent" - * android:layout_height="fill_parent" - * app:leftX="-1" - * app:rightX="1" - * app:topY="0" - * app:bottomY="1" - * app:vrpnAnalogX="@id/MyVrpnAnalogX" - * app:vrpnAnalogY="@id/MyVrpnAnalogY" - * /> - * </pre> - * - * <p> - * - * <p> - * The root element of the layout must declare the following line just after the - * <code>xmlns:android ... </code>line : - * <pre> - * xmlns:app="http://schemas.android.com/apk/res/your.package.name.here" - * </pre> - * </p> - - * <p> - * <strong>Custom XML attributes :</strong> - * </p> - * <ul> - * <li><code>app:vrpnAnalogX</code> : the id of the Vrpn analog that will - * receive the X position of the touch event from this widget. The update value - * sent to the Vrpn analog ranges from the <code>app:leftX</code> value to the - * <code>app:rightX</code> value.</li> - * <li><code>app:vrpnAnalogY</code> : the id of the Vrpn analog that will - * receive the Y position of the touch event from this widget. The update value - * sent to the Vrpn analog ranges from the <code>app:bottomY</code> value to the - * <code>app:topX</code> value.</li> - * <li><code>app:leftX</code> : the numeric value mapped onto the left border of - * the surface.</li> - * <li><code>app:rightX</code> : the numeric value mapped onto the right border - * of the surface. May be greater or lower than <code>app:leftX</code>.</li> - * <li><code>app:bottomY</code> : the numeric value mapped onto the top border - * of the surface</li> - * <li><code>app:topY</code> : the numeric value mapped onto the top border of - * the surface. May be greater or lower than <code>app:bottomY</code></li> - * </ul> - * - * The <code>app:vrpnAnalogX</code> and <code>app:vrpnAnalogY</code> ids can be - * literals or a resource Ids. These resource ids may be kept in a <a - * href="package-summary.html#vrpnids">separate Vrpn Id list</a> - * - */ -public class VrpnSurface extends android.view.SurfaceView implements - OnTouchListener { - protected String TAG = "VrpnSurface"; - int _vrpnAnalogXId = 0; - int _vrpnAnalogYId = 0; - - float _leftX, _rightX, _topY, _bottomY; - - public VrpnSurface(Context context) { - super(context); - init(null); - } - - public VrpnSurface(Context context, AttributeSet attrs) { - super(context, attrs); - init(attrs); - } - - public VrpnSurface(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - init(attrs); - } - - /** - * Perform initialization that is common to the constructors - * - * @param attrs - */ - private void init(AttributeSet attrs) { - setOnTouchListener(this); - - // get The Vrpn button id from the xml app:vrpnButton attribute - TypedArray a = getContext().obtainStyledAttributes(attrs, - R.styleable.VrpnSurface); - _vrpnAnalogXId = a.getInt(R.styleable.VrpnSurface_vrpnAnalogX, 0); - _vrpnAnalogYId = a.getInt(R.styleable.VrpnSurface_vrpnAnalogY, 0); - _leftX = a.getFloat(R.styleable.VrpnSurface_leftX, 0.0f); - _rightX = a.getFloat(R.styleable.VrpnSurface_rightX, 1.0f); - _topY = a.getFloat(R.styleable.VrpnSurface_topY, 0.0f); - _bottomY = a.getFloat(R.styleable.VrpnSurface_bottomY, 1.0f); - a.recycle(); - - // Start at origin - // TODO start at the middle - Log.d(TAG, "ctor init : " + _vrpnAnalogXId + " " + _vrpnAnalogYId); - VrpnClient.getInstance().sendAnalog(_vrpnAnalogXId, 0); - VrpnClient.getInstance().sendAnalog(_vrpnAnalogYId, 0); - } - - /** - * Called when a touch event is dispatched to this widget. - * - * <p> - * If the touch event occurs within the surface of the view, two analog Vrpn - * updates are send for the X and y position. Updates are sent when - * ACTION_DOWN, ACTION_MOVE, and ACTION_UP are received. the event history - * is ignored. - * </p> - * - * @see android.view.View.OnTouchListener#onTouch(View, MotionEvent) - * @see android.view.MotionEvent - */ - @Override - public boolean onTouch(View v, MotionEvent event) { - final int action = event.getAction(); - if (action == MotionEvent.ACTION_OUTSIDE) { - return false; - } - final float x = event.getX(); - final float y = event.getY(); - final float w = getWidth(); - final float h = getHeight(); - - if (x < 0 || x > w || y < 0 || y > h) { - // dragging the touch point may trigger values outside the view - // dimensions - return false; - } - - /* - * event reports absolute View X/Y coordinates, convert to the - * appropriate bounds then send the updates - */ - final float vrpnX = (x / w) * (_rightX - _leftX) + _leftX; - final float vrpnY = (y / h) * (_bottomY - _topY) + _topY; - Log.d(TAG, "touch action x/y = " + action + " " + vrpnX + "/" + vrpnY); - VrpnClient.getInstance().sendAnalog(_vrpnAnalogXId, vrpnX); - VrpnClient.getInstance().sendAnalog(_vrpnAnalogYId, vrpnY); - return true; - } - -} diff --git a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnToggleButton.java b/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnToggleButton.java deleted file mode 100644 index 3e7c00ab077e2df5195ecd7b1bbe976681a500a7..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnToggleButton.java +++ /dev/null @@ -1,86 +0,0 @@ -package eu.ensam.ii.vrpn; - -import android.content.Context; -import android.content.res.TypedArray; -import android.util.AttributeSet; -import android.util.Log; -import android.widget.CompoundButton; -import android.widget.CompoundButton.OnCheckedChangeListener; - -/** - * A {@link android.view.ToggleButton ToggleButton} connected to a Vrpn Button. - * - * <p> - * This button sends a true update when its status changes to checked and false - * when its status changes to unchecked. Unlike a - * {@link VrpnPressButton}, the status of this widget changes when it is - * pressed, but not when it is released, - * </p> - * - * <p> - * In your layout XML file, include the following into a container widget : - * <pre> - * <eu.ensam.ii.vrpn.VrpnButton - * app:vrpnButton="@id/MyButton" - * /> - * </pre> - * <p> - * The root element of the layout must declare the following line just after the - * <code>xmlns:android ... </code>line : - * <pre> - * xmlns:app="http://schemas.android.com/apk/res/your.package.name.here" - * </pre> - * - * </p> - * - * <p> - * <strong>Custom XML attributes :</strong> - * </p> - * <ul> - * <li><code>app:vrpnButton</code> : the id of the Vrpn button that will receive - * updated from this widget. This value can be a literal or a resource Id that - * can be kept in a <a href="package-summary.html#vrpnids">separate Vrpn Id - * list</a></li> - * </ul> - */ -public class VrpnToggleButton extends android.widget.ToggleButton implements - OnCheckedChangeListener { - private static final String TAG = "VrpnToggleButton"; - private int _vrpnButtonId; - - public VrpnToggleButton(Context context) { - super(context); - init(null); - } - - public VrpnToggleButton(Context context, AttributeSet attrs) { - super(context, attrs); - init(attrs); - } - - public VrpnToggleButton(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - init(attrs); - } - - private void init(AttributeSet attrs) { - setOnCheckedChangeListener(this); - - // get The Vrpn button id from the xml app:vrpnButton attribute - TypedArray a = getContext().obtainStyledAttributes(attrs, - R.styleable.VrpnRadioButton); - _vrpnButtonId = a.getInt(R.styleable.VrpnToggleButton_vrpnButton, 0); - a.recycle(); - - // Trigger an initial Vrpn update - Log.d(TAG, "ctor init " + _vrpnButtonId + " : " + isChecked()); - VrpnClient.getInstance().sendButton(_vrpnButtonId, isChecked()); - } - - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - Log.d(TAG, "onCheckedChanged " + _vrpnButtonId + " : " + isChecked); - VrpnClient.getInstance().sendButton(_vrpnButtonId, - buttonView.isChecked()); - } -} diff --git a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/package-info.html b/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/package-info.html deleted file mode 100644 index 705fd6f0aa8734368d61cf39f7d2329c3651b9af..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/package-info.html +++ /dev/null @@ -1,381 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>Insert title here</title> -</head> -<!-- -Edit the documentation here, then copy the contents of the <body> tag into package-info.java (without the tags) --> -<body> - - This package include a set of widgets that are bound to a Vrpn server - buttons, analogs and trackers. - - - <h3>Create a simple application that uses the widgets</h3> - <p> - The following chapters describe how to create a simple application - with a {@link eu.ensam.ii.vrpn.VrpnToggleButton VrpnToggleButton} and - a {@link eu.ensam.ii.vrpn.VrpnSeekBar VrpnSeekBar}. An example - application project that contains these widgets and more can be found - in the <em>example_app</em> directory. - </p> - <h4>Create and configure the project</h4> - <p> - Refer to any Android documentation for instructions about how to - set-up the Android SDK and the Eclipse plugin. Do not forget to setup - the Android SDK in any new workspace (<em>Window</em> > <em>Preferences</em>, - then go to the <em>Android</em> tab and configure the SDK location). - </p> - <p> - Import the <em>Vrpn_library</em> project into your Eclipse workspace. - Open the Android section of the project property page and verify that - <em>Is library</em> checked. If the build complains about "Android - requires .class compatibility set to 5.0", you need first to select - the project, right-click > <em>Properties</em> > <em>Android - tools</em> > <em>Fix project properties</em>, then open the project - properties, go to the <em>Java compiler</em> section, then deselect - <em>enable project specific settings</em>. You may need to clean and - rebuild (<em>Project</em> > <em>Clean</em>) several times before - the project shows no errors. - </p> - - <p> - Create a new Android project : <em>File</em> > <em>New</em> > <em>Other - ...</em> , <em>Android</em> > <em>Android Project</em>. On the first - page of the wizard, check <em>Create activity</em> and enter any name - you like for the main activity (for instance <em>MainActivity</em>). - </p> - - <p> - Add the library to your project : open the properties of the project, - go to the <em>Android</em> page. In the <em>Library</em> pane, click <em>Add</em> - then select <em>vrpn_library</em>, apply the changes and close the - window. At this point, the Eclipse <em>Package Explorer</em> view of - your project should contain a <em>vrpn_library_src</em> folder and the - <em>gen</em> folder should contain a package entry named <em>eu.ensam.ii.vrpn</em>. - </p> - <p> - Open the - <code>AndroidManifest.xml</code> - file. On the <em>Application</em> tab, check <em>Define an - <Application> tag in the AndroidManifest.xml</em>. Then click on the - <em>Browse</em> button that is on the right of <em>Name</em> and - select <em>VrpnApplication</em>. - </p> - - <h4>Modify the main activity</h4> - - - <p>Edit the main activity to define the binding to the Vrpn server - when the activity is created. The method {@link - android.app.Activity#onCreate onCreate} is called when the Activity is - created. The default version of this method contain only the first and - last lines :</p> - <pre> - super.onCreate(savedInstanceState); - .... - setContentView(R.layout.main); -</pre> - <p>We need to define the binding with the Vrpn server. The method - becomes :</p> - <pre> -@Override -public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - InetAddress vrpnServerAddress = null; - try { - // Replace the IP address - vrpnServerAddress = InetAddress.getByName("192.168.173.1"); - } catch (UnknownHostException e) { - } - final int vrpnServerPort = 7777; - VrpnClient.getInstance().setupVrpnServer(vrpnServerAddress, vrpnServerPort); - - setContentView(R.layout.main); -} -</pre> - <a name="vrpnids"></a> - <h4>Create a Vrpn Ids list</h4> - <p> - Before laying out your Vrpn widgets in your application, you should - create an XML configuration file that contains the IDs of the Vrpn - buttons and analog that you will be using. This allows you to keep a - unique list of Vrpn IDs, making it easier to avoid duplicate values - and reference this list from your application. Create this file with <em>File</em> - > <em>New</em> > <em>Other</em>, then <em>Android </em> > <em>Android - XML File</em>. In XML file dialog, type any file name you like, for - instance <em>vrpn.xml</em>, then select <em>Values</em> as the type of - resource to create. - </p> - <p> - Edit the resulting file, found at <em>res/values/vrpn.xml</em> to add - the numbers of the Vrpn Buttons and Analogs that you will be using. - </p> - <pre> -<resources> - <item type="id" format="integer" name="VrpnAnalogLightIntensity">0</item> - <item type="id" format="integer" name="VrpnButtonLightsOn">0</item> -</resources> -</pre> - - <p> - Note that <em>type</em> must be <em>id</em> and <em>format</em> must - be <em>integer</em>, but <em>name</em> can be anything you like. - </p> - - <h4>Add your widgets to the main layout</h4> - <p>Say we want an Android application to control the lighting in - our VR application : turn the light on or off and also control the - light intensity. We will create an application with a {@link - eu.ensam.ii.vrpn.VrpnToggleButton VrpnToggleButton} as the light - switch and a {@link eu.ensam.ii.vrpn.VrpnSeekBar VrpnSeekBar} as a - light intensity controller.</p> - <p> - By default, the layout of the main Activity is described in <em>res/layout/main.xml</em> - and just displays <em>Hello</em>. Edit this file. The XML code looks - is something like : - </p> - <pre> -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - > - <TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="@string/hello" - /> -</LinearLayout> -</pre> - - <p> - The root element, - <code>LinearLayout</code> - , is a container for the other widgets, currently contains a - <code>TextView</code> - . - <p> - The basics about XML layouts are presented in <a - href="http://developer.android.com/guide/topics/ui/declaring-layout.html">Declaring - layout</a> SDK page. - </p> - <p> - Before the end tag - <code></LinearLayout></code> - , include a {@link eu.ensam.ii.vrpn.VrpnToggleButton VrpnToggleButton} - to turn the lights on or off : - <pre> -<eu.ensam.ii.vrpn.VrpnToggleButton - android:layout_width="fill_parent" - android:layout_height="wrap_content" - app:vrpnButton="@id/VrpnButtonLightsOn" -/> -</pre> - - The Vrpn widgets use so-called - <em>custom XML properties</em> , such as - <em>app:vrpnButton</em> . This custom property allows you to specify - the id of the target Vrpn button in the XML layout file rather than in - Java code. However, the use of this custom property requires the - addition of an XML namespace tag so that the build system can find - then. After the - <em>xmlns:android</em> line, add the following line : - <pre> - xmlns:app="http://schemas.android.com/apk/res/your.application.package.name.here" -</pre> - Different attributes exist for each widgets and the whole list is shown - when you unfold - <em>gen/eu/ensam.ii.vrpn/R.java/R/attr</em> in the Eclipse Package - View. Your layout is now ready for your to include the Vrpn widgets. - Now save the file to build your project. If there are build errors, - check the following : - <ul> - <li>you have added the <code>xmlns::app</code> line in the root - layout</li> - <li>the spelling of the <code>app:</code> attribute</li> - <li>the value of the Vrpn attributes</li> - <li>the spelling of the widget name</li> - </ul> - - <p> - In most cases, the <em>Preview</em> tab of the XML layout is not - displayed properly as soon as you include one of the Vrpn widgets. - This is a known problem for which not solution has currently been - found. It prevents you from previewing the layout it wil be displayed - correctly in the application, either on a device or in the emulator. - </p> - - <p>Now add a {@link eu.ensam.ii.vrpn.VrpnSeekBar VrpnSeekBar} to - control the light intensity :</p> - <pre> -<eu.ensam.ii.vrpn.VrpnSeekBar - android:layout_width="fill_parent" - android:layout_height="wrap_content" - app:minValue="0" - app:maxValue="255" - app:defaultValue="128" - app:vrpnAnalog="@id/VrpnAnalogLightIntensity" -/> -</pre> - Your Android application is now ready to run. Upload on a device and - run. There is not much to seen for the time being. However, if you run - a network sniffer on a machine connected to the same network as the - Android device, you should see UDP packets flowing out of the device. - If you are using the emulator instead of an actual device, see the - <a - href=" -http://developer.android.com/guide/developing/devices/emulator.html#emulatornetworking">Emulator - networking</a> SDK page for the correct network setup. - <h4>Test your application</h4> - In order to test your application, you need a VRPN server built with - VRPN_USE_JSONNET. See the - <code>README.jsoncpp</code> - file for instructions to build this server. When you get this server - running, the easiest way to test the Android application is to use the - <code>vrpn_print_devices</code> - application provided with Vrpn. Type the command : - <pre> -vrpn_print_devices Jsonnet@localhost -</pre> - The command should then report the values of the Button and SeekBar as - they are changed. - - <h3>Beyond the basics</h3> - <h4>Application with multiple tabs</h4> - If you want to create an application with more widgets that can be - placed on a single screen, using a {@link android.app.TabActivity - TabActivity} instead of a regular Activity may be the way to go. A - {@link android.app.TabActivity TabActivity} can display several - activities of view, each inside a tab. The Android SDK documentation - explains how to create a tabbed application with activities. However, - using activities require careful state management since the activities - may be terminated when the use switches from one tab to another. It is - therefore easier to manage a {@link android.app.TabActivity - TabActivity} that display - <em>views</em> intead of activities. - <p></p> - <p>First of all, your main activity must extend {@link - android.app.TabActivity TabActivity} intead of {@link - android.app.Activity Activity}.</p> - <p> - Then, create a layout for each tab in <em>res/layout</em> with <em>File</em> - > <em>New</em> > <em>Other...</em> , then <em>Android</em> > <em>New - XML file</em>. In the <em>New Android XML file</em> dialog, name the file - <em>tab_one.xml</em>, select <em>Layout</em> as the type of resource, - then select <em>LinearLayout</em> as the root element. Repeat the - process with a second tab layout named <em>tab_two.xml</em>. Update - each tab layout as described in <em>Add your widgets to the main - layout</em> above, paying attention not to forget the <em>xmlns:app</em> - line. - </p> - <p> - The next step is to create a new layout names <em>res/layout/tab_group.xml</em>for - the whole activity. This layout looks like : - </p> - <pre> -<?xml version="1.0" encoding="utf-8"?> -<TabHost - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@android:id/tabhost" - android:layout_width="fill_parent" - android:layout_height="fill_parent"> - <TabWidget - android:id="@android:id/tabs" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - /> - <FrameLayout - android:id="@android:id/tabcontent" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:padding="5dp"> - </FrameLayout> - <include layout="@layout/tab_one"></include> - <include layout="@layout/tab_two"></include> -</TabHost> -</pre> - - <p> - Then edit the <em>onCreate</em> method of your activity. After the - line <em>super.onCreate()</em> add the <em>VrpnClient.getInstance().setUri(....)</em> - line, then add : - <pre> - LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); - inflater.inflate(R.layout.tab_group, getTabHost().getTabContentView(), true); - TabHost.TabSpec spec; - spec = getTabHost().newTabSpec("1").setContent(R.id.tab_one); - getTabHost().addTab(spec) - spec = getTabHost().newTabSpec("2").setContent(R.id.tab_two); - getTabHost().addTab(spec); - getTabHost().setCurrentTab(0); -</pre> - <p>See in the SDK documentation how to use the {@link - android.widget.TabHost.TabSpec#setIndicator setIndicator} method in - order to display an icon in the tab headers.</p> - <h3>Updating the widget library</h3> - <h4>Create a new Widget</h4> - <p>To create a new Widget type you should look at the source code - of VrpnSeekBar, which is the more elaborate. The main steps are as - follows :</p> - <ul> - <li>Decide which Android widget class you want to extend and - which events will trigger Vrpn updates.</li> - <li>Decide whether your widget will send Vrpn button,analog or - tracker updates.</li> - <li>Decide whether your widget needs new custom XML attributes. - If this is the case, look at <code>res/values/attrs.xml</code> for - examples.</li> - <li>Implement a private <em>init</em> method that each - constructor will call. In this method, you must obtain the XML custom - attributes of the widget. You should also send a Vrpn update with the - initial value of the widget</li> - <li>Implement the appropriate change listener, according to which - event you want your widget to respond to. In the change listener, - call the appropriate method : {@link - eu.ensam.ii.vrpn.VrpnClient#sendAnalog(int,double) sendAnalog} or - {@link eu.ensam.ii.vrpn.VrpnClient#sendButton(int,boolean) - sendButton}. Note that a single widget can s end several updates, - like the {@link eu.ensam.ii.vrpn.VrpnSurface VrpnSurface} does or - like a <a - href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/ColorPickerDialog.html">color - picker</a>would do. There is currently no <em>sendTracker</em> method - although this may be useful to implement an Arcball for instance.</li> - </ul> - <p>Note that using the full path of the parent class such as in : - <pre>public class VrpnRadioButton extends android.widget.RadioButton</pre> - allows Javadoc to generate a link to the parent class. - </p> - - <h4>Generate the documentation</h4> - <p> - Select the <em>vrpn_library/src</em> folder, then select the menu item - <em>Project</em> > <em>Generate Javadoc</em>. - <p> - On the first page of the wizard, select the path of the <em>javadoc</em> - tool. Check that <em>vrpn_library/src</em> is selected, but not <em>vrpn_library/gen</em>, - then select an appropriate destination for the documentation. - </p> - <p> - On the second page of the wizard select <em>android.jar</em> in the <em>Referenced - archives</em> list and take note of the <em>android.jar</em> doc path - (like - <code>file:/E:/android/docs/reference</code> - ). - </p> - <p> - On the third page of the wizard add the following line to the <em>Extra - javadoc options</em> text box : - <pre> --linkoffline http://d.android.com/reference file:/E:/android/docs/reference -</pre> - but replace the - <code>file:/</code> - URL by your local Android SDK URL noted from the page two of the - wizard. This allows Javadoc to include full references to the on-line - Android documentation. -</body> -</html> \ No newline at end of file diff --git a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/package-info.java b/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/package-info.java deleted file mode 100644 index 2365adeec1ce4bef0d166e051025558d0d0dd3e7..0000000000000000000000000000000000000000 --- a/src/vrpn/android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/package-info.java +++ /dev/null @@ -1,384 +0,0 @@ -// -// -// Please edit package-info.html, then paste here -// - -/** - * - - - This package include a set of widgets that are bound to a Vrpn server - buttons, analogs and trackers. - - - <h3>Create a simple application that uses the widgets</h3> - <p> - The following chapters describe how to create a simple application - with a {@link eu.ensam.ii.vrpn.VrpnToggleButton VrpnToggleButton} and - a {@link eu.ensam.ii.vrpn.VrpnSeekBar VrpnSeekBar}. An example - application project that contains these widgets and more can be found - in the <em>example_app</em> directory. - </p> - <h4>Create and configure the project</h4> - <p> - Refer to any Android documentation for instructions about how to - set-up the Android SDK and the Eclipse plugin. Do not forget to setup - the Android SDK in any new workspace (<em>Window</em> > <em>Preferences</em>, - then go to the <em>Android</em> tab and configure the SDK location). - </p> - <p> - Import the <em>Vrpn_library</em> project into your Eclipse workspace. - Open the Android section of the project property page and verify that - <em>Is library</em> checked. If the build complains about "Android - requires .class compatibility set to 5.0", you need first to select - the project, right-click > <em>Properties</em> > <em>Android - tools</em> > <em>Fix project properties</em>, then open the project - properties, go to the <em>Java compiler</em> section, then deselect - <em>enable project specific settings</em>. You may need to clean and - rebuild (<em>Project</em> > <em>Clean</em>) several times before - the project shows no errors. - </p> - - <p> - Create a new Android project : <em>File</em> > <em>New</em> > <em>Other - ...</em> , <em>Android</em> > <em>Android Project</em>. On the first - page of the wizard, check <em>Create activity</em> and enter any name - you like for the main activity (for instance <em>MainActivity</em>). - </p> - - <p> - Add the library to your project : open the properties of the project, - go to the <em>Android</em> page. In the <em>Library</em> pane, click <em>Add</em> - then select <em>vrpn_library</em>, apply the changes and close the - window. At this point, the Eclipse <em>Package Explorer</em> view of - your project should contain a <em>vrpn_library_src</em> folder and the - <em>gen</em> folder should contain a package entry named <em>eu.ensam.ii.vrpn</em>. - </p> - <p> - Open the - <code>AndroidManifest.xml</code> - file. On the <em>Application</em> tab, check <em>Define an - <Application> tag in the AndroidManifest.xml</em>. Then click on the - <em>Browse</em> button that is on the right of <em>Name</em> and - select <em>VrpnApplication</em>. - </p> - - <h4>Modify the main activity</h4> - - - <p>Edit the main activity to define the binding to the Vrpn server - when the activity is created. The method {@link - android.app.Activity#onCreate onCreate} is called when the Activity is - created. The default version of this method contain only the first and - last lines :</p> - <pre> - super.onCreate(savedInstanceState); - .... - setContentView(R.layout.main); -</pre> - <p>We need to define the binding with the Vrpn server. The method - becomes :</p> - <pre> -@Override -public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - InetAddress vrpnServerAddress = null; - try { - // Replace the IP address - vrpnServerAddress = InetAddress.getByName("192.168.173.1"); - } catch (UnknownHostException e) { - } - final int vrpnServerPort = 7777; - VrpnClient.getInstance().setupVrpnServer(vrpnServerAddress, vrpnServerPort); - - setContentView(R.layout.main); -} -</pre> - <a name="vrpnids"></a> - <h4>Create a Vrpn Ids list</h4> - <p> - Before laying out your Vrpn widgets in your application, you should - create an XML configuration file that contains the IDs of the Vrpn - buttons and analog that you will be using. This allows you to keep a - unique list of Vrpn IDs, making it easier to avoid duplicate values - and reference this list from your application. Create this file with <em>File</em> - > <em>New</em> > <em>Other</em>, then <em>Android </em> > <em>Android - XML File</em>. In XML file dialog, type any file name you like, for - instance <em>vrpn.xml</em>, then select <em>Values</em> as the type of - resource to create. - </p> - <p> - Edit the resulting file, found at <em>res/values/vrpn.xml</em> to add - the numbers of the Vrpn Buttons and Analogs that you will be using. - </p> - <pre> -<resources> - <item type="id" format="integer" name="VrpnAnalogLightIntensity">0</item> - <item type="id" format="integer" name="VrpnButtonLightsOn">0</item> -</resources> -</pre> - - <p> - Note that <em>type</em> must be <em>id</em> and <em>format</em> must - be <em>integer</em>, but <em>name</em> can be anything you like. - </p> - - <h4>Add your widgets to the main layout</h4> - <p>Say we want an Android application to control the lighting in - our VR application : turn the light on or off and also control the - light intensity. We will create an application with a {@link - eu.ensam.ii.vrpn.VrpnToggleButton VrpnToggleButton} as the light - switch and a {@link eu.ensam.ii.vrpn.VrpnSeekBar VrpnSeekBar} as a - light intensity controller.</p> - <p> - By default, the layout of the main Activity is described in <em>res/layout/main.xml</em> - and just displays <em>Hello</em>. Edit this file. The XML code looks - is something like : - </p> - <pre> -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - > - <TextView - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:text="@string/hello" - /> -</LinearLayout> -</pre> - - <p> - The root element, - <code>LinearLayout</code> - , is a container for the other widgets, currently contains a - <code>TextView</code> - . - <p> - The basics about XML layouts are presented in <a - href="http://developer.android.com/guide/topics/ui/declaring-layout.html">Declaring - layout</a> SDK page. - </p> - <p> - Before the end tag - <code></LinearLayout></code> - , include a {@link eu.ensam.ii.vrpn.VrpnToggleButton VrpnToggleButton} - to turn the lights on or off : - <pre> -<eu.ensam.ii.vrpn.VrpnToggleButton - android:layout_width="fill_parent" - android:layout_height="wrap_content" - app:vrpnButton="@id/VrpnButtonLightsOn" -/> -</pre> - - The Vrpn widgets use so-called - <em>custom XML properties</em> , such as - <em>app:vrpnButton</em> . This custom property allows you to specify - the id of the target Vrpn button in the XML layout file rather than in - Java code. However, the use of this custom property requires the - addition of an XML namespace tag so that the build system can find - then. After the - <em>xmlns:android</em> line, add the following line : - <pre> - xmlns:app="http://schemas.android.com/apk/res/your.application.package.name.here" -</pre> - Different attributes exist for each widgets and the whole list is shown - when you unfold - <em>gen/eu/ensam.ii.vrpn/R.java/R/attr</em> in the Eclipse Package - View. Your layout is now ready for your to include the Vrpn widgets. - Now save the file to build your project. If there are build errors, - check the following : - <ul> - <li>you have added the <code>xmlns::app</code> line in the root - layout</li> - <li>the spelling of the <code>app:</code> attribute</li> - <li>the value of the Vrpn attributes</li> - <li>the spelling of the widget name</li> - </ul> - - <p> - In most cases, the <em>Preview</em> tab of the XML layout is not - displayed properly as soon as you include one of the Vrpn widgets. - This is a known problem for which not solution has currently been - found. It prevents you from previewing the layout it wil be displayed - correctly in the application, either on a device or in the emulator. - </p> - - <p>Now add a {@link eu.ensam.ii.vrpn.VrpnSeekBar VrpnSeekBar} to - control the light intensity :</p> - <pre> -<eu.ensam.ii.vrpn.VrpnSeekBar - android:layout_width="fill_parent" - android:layout_height="wrap_content" - app:minValue="0" - app:maxValue="255" - app:defaultValue="128" - app:vrpnAnalog="@id/VrpnAnalogLightIntensity" -/> -</pre> - Your Android application is now ready to run. Upload on a device and - run. There is not much to seen for the time being. However, if you run - a network sniffer on a machine connected to the same network as the - Android device, you should see UDP packets flowing out of the device. - If you are using the emulator instead of an actual device, see the - <a - href=" -http://developer.android.com/guide/developing/devices/emulator.html#emulatornetworking">Emulator - networking</a> SDK page for the correct network setup. - <h4>Test your application</h4> - In order to test your application, you need a VRPN server built with - VRPN_USE_JSONNET. See the - <code>README.jsoncpp</code> - file for instructions to build this server. When you get this server - running, the easiest way to test the Android application is to use the - <code>vrpn_print_devices</code> - application provided with Vrpn. Type the command : - <pre> -vrpn_print_devices Jsonnet@localhost -</pre> - The command should then report the values of the Button and SeekBar as - they are changed. - - <h3>Beyond the basics</h3> - <h4>Application with multiple tabs</h4> - If you want to create an application with more widgets that can be - placed on a single screen, using a {@link android.app.TabActivity - TabActivity} instead of a regular Activity may be the way to go. A - {@link android.app.TabActivity TabActivity} can display several - activities of view, each inside a tab. The Android SDK documentation - explains how to create a tabbed application with activities. However, - using activities require careful state management since the activities - may be terminated when the use switches from one tab to another. It is - therefore easier to manage a {@link android.app.TabActivity - TabActivity} that display - <em>views</em> intead of activities. - <p></p> - <p>First of all, your main activity must extend {@link - android.app.TabActivity TabActivity} intead of {@link - android.app.Activity Activity}.</p> - <p> - Then, create a layout for each tab in <em>res/layout</em> with <em>File</em> - > <em>New</em> > <em>Other...</em> , then <em>Android</em> > <em>New - XML file</em>. In the <em>New Android XML file</em> dialog, name the file - <em>tab_one.xml</em>, select <em>Layout</em> as the type of resource, - then select <em>LinearLayout</em> as the root element. Repeat the - process with a second tab layout named <em>tab_two.xml</em>. Update - each tab layout as described in <em>Add your widgets to the main - layout</em> above, paying attention not to forget the <em>xmlns:app</em> - line. - </p> - <p> - The next step is to create a new layout names <em>res/layout/tab_group.xml</em>for - the whole activity. This layout looks like : - </p> - <pre> -<?xml version="1.0" encoding="utf-8"?> -<TabHost - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@android:id/tabhost" - android:layout_width="fill_parent" - android:layout_height="fill_parent"> - <TabWidget - android:id="@android:id/tabs" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - /> - <FrameLayout - android:id="@android:id/tabcontent" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:padding="5dp"> - </FrameLayout> - <include layout="@layout/tab_one"></include> - <include layout="@layout/tab_two"></include> -</TabHost> -</pre> - - <p> - Then edit the <em>onCreate</em> method of your activity. After the - line <em>super.onCreate()</em> add the <em>VrpnClient.getInstance().setUri(....)</em> - line, then add : - <pre> - LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); - inflater.inflate(R.layout.tab_group, getTabHost().getTabContentView(), true); - TabHost.TabSpec spec; - spec = getTabHost().newTabSpec("1").setContent(R.id.tab_one); - getTabHost().addTab(spec) - spec = getTabHost().newTabSpec("2").setContent(R.id.tab_two); - getTabHost().addTab(spec); - getTabHost().setCurrentTab(0); -</pre> - <p>See in the SDK documentation how to use the {@link - android.widget.TabHost.TabSpec#setIndicator setIndicator} method in - order to display an icon in the tab headers.</p> - <h3>Updating the widget library</h3> - <h4>Create a new Widget</h4> - <p>To create a new Widget type you should look at the source code - of VrpnSeekBar, which is the more elaborate. The main steps are as - follows :</p> - <ul> - <li>Decide which Android widget class you want to extend and - which events will trigger Vrpn updates.</li> - <li>Decide whether your widget will send Vrpn button,analog or - tracker updates.</li> - <li>Decide whether your widget needs new custom XML attributes. - If this is the case, look at <code>res/values/attrs.xml</code> for - examples.</li> - <li>Implement a private <em>init</em> method that each - constructor will call. In this method, you must obtain the XML custom - attributes of the widget. You should also send a Vrpn update with the - initial value of the widget</li> - <li>Implement the appropriate change listener, according to which - event you want your widget to respond to. In the change listener, - call the appropriate method : {@link - eu.ensam.ii.vrpn.VrpnClient#sendAnalog(int,double) sendAnalog} or - {@link eu.ensam.ii.vrpn.VrpnClient#sendButton(int,boolean) - sendButton}. Note that a single widget can s end several updates, - like the {@link eu.ensam.ii.vrpn.VrpnSurface VrpnSurface} does or - like a <a - href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/ColorPickerDialog.html">color - picker</a>would do. There is currently no <em>sendTracker</em> method - although this may be useful to implement an Arcball for instance.</li> - </ul> - <p>Note that using the full path of the parent class such as in : - <pre>public class VrpnRadioButton extends android.widget.RadioButton</pre> - allows Javadoc to generate a link to the parent class. - </p> - - <h4>Generate the documentation</h4> - <p> - Select the <em>vrpn_library/src</em> folder, then select the menu item - <em>Project</em> > <em>Generate Javadoc</em>. - <p> - On the first page of the wizard, select the path of the <em>javadoc</em> - tool. Check that <em>vrpn_library/src</em> is selected, but not <em>vrpn_library/gen</em>, - then select an appropriate destination for the documentation. - </p> - <p> - On the second page of the wizard select <em>android.jar</em> in the <em>Referenced - archives</em> list and take note of the <em>android.jar</em> doc path - (like - <code>file:/E:/android/docs/reference</code> - ). - </p> - <p> - On the third page of the wizard add the following line to the <em>Extra - javadoc options</em> text box : - <pre> --linkoffline http://d.android.com/reference file:/E:/android/docs/reference -</pre> - but replace the - <code>file:/</code> - URL by your local Android SDK URL noted from the page two of the - wizard. This allows Javadoc to include full references to the on-line - Android documentation. - -/* - ********************************* End of paste Here - */ - -package eu.ensam.ii.vrpn; \ No newline at end of file diff --git a/src/vrpn/atmellib/CMakeLists.txt b/src/vrpn/atmellib/CMakeLists.txt deleted file mode 100644 index 30d51f1f560716e2aaa2ce8da579c630a5dcc168..0000000000000000000000000000000000000000 --- a/src/vrpn/atmellib/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -set(ATMELLIB_PUBLIC_HEADERS - vrpn_atmellib_errno.h - vrpn_atmellib.h) - -set(ATMELLIB_SOURCES - vrpn_atmellib_helper.h - vrpn_atmellib_helper.C - vrpn_atmellib_iobasic.C - vrpn_atmellib_openclose.C - vrpn_atmellib_register.C - vrpn_atmellib_tester.C) - -add_library(vrpn_atmel ${ATMELLIB_PUBLIC_HEADERS} ${ATMELLIB_SOURCES}) -set_property(TARGET - vrpn_atmel - PROPERTY - PUBLIC_HEADER - ${ATMELLIB_PUBLIC_HEADERS}) -set_property(TARGET - vrpn_atmel - PROPERTY - FOLDER - "Library") -if(VRPN_INSTALL) - install(TARGETS - vrpn_atmel - ARCHIVE - DESTINATION - lib - COMPONENT - serversdk - PUBLIC_HEADER - DESTINATION - include - COMPONENT - serversdk) -endif() diff --git a/src/vrpn/atmellib/vrpn_atmellib.h b/src/vrpn/atmellib/vrpn_atmellib.h deleted file mode 100644 index 487e136444f2699de4168207622cd3b99dbf772d..0000000000000000000000000000000000000000 --- a/src/vrpn/atmellib/vrpn_atmellib.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode:C -*- */ - -/***************************************************************************************************/ -/* */ -/* Copyright (C) 2003 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/***************************************************************************************************/ -/* */ -/* module : vrpn_atmellib.h */ -/* project : vrpn_avango */ -/* description: part of vrpn_avango_atmel_server */ -/* */ -/***************************************************************************************************/ -/* */ -/* */ -/***************************************************************************************************/ - -#if !defined(VRPN_AVANGO_ATMELLIB_SERIAL_H) -#define VRPN_AVANGO_ATMELLIB_SERIAL_H - -/* includes, system */ -/* #include <> */ - -/* includes, project */ -#include "vrpn_atmellib_errno.h" - -#if defined(__cplusplus) -extern "C" { -#endif - -/*************************************************************************************************/ -/* constants you have to remember */ - -/* maiximum time to wait for a new byte from the atmel */ -#define VRPN_ATMELLIB_SELECT_WAIT_SEC 0 -#define VRPN_ATMELLIB_SELECT_WAIT_USEC 150000 - -/*************************************************************************************************/ -/* types, exported (enum, struct, union, typedef) */ -/*************************************************************************************************/ - -/* the 2 bytes which defines a message from/to the microcontroller */ -struct command_t { - unsigned char addr; - unsigned char value; -}; - -/*************************************************************************************************/ - -typedef int error_t; -typedef int handle_t; - -/*************************************************************************************************/ - -/* for development purpose mainly - displays a value as Bits on the screen */ - extern void outBit( unsigned char ); - -/*************************************************************************************************/ -/* BASICS */ -/*************************************************************************************************/ - -/* opens the the specified port (whole path needed) and sets the parameters -for the communication with the microcontroller -CAUTION: the return value is a program specific file handler and not the - system file handler */ -extern handle_t openPort(const char*i, const int baud, struct termios * init_param); - -/* close the specified port and reset all parameters */ -extern error_t closePort (handle_t, struct termios * init_param); - -/* checks if the given file handler is valid: returns 1 (true) if the handle is invalid otherwise -return 0 (false) */ -extern error_t handle_invalid (int); - -/* checks if the register is valid */ -extern error_t register_invalid( unsigned char ); - - -/*************************************************************************************************/ -/* LOW LEVEL INTERFACE */ -/*************************************************************************************************/ - -/* send one/more command(s) to the microcontroller which don't change the state of it -the return value of the command - i.e. the value of a register - is returned in the -second calling variable */ -extern int getCmd (handle_t, struct command_t*); - -/* send one/more command(s) to the microcontroller which change the state of the microcontrolle */ -extern int setCmd (int, struct command_t*); - -/* set the value of the specified register */ -extern error_t -setRegister( handle_t Hd , const unsigned char Register , const unsigned char Val); - -/* get the value of the specified register */ -extern int getRegister( handle_t Hd , const unsigned char Register); - -#if defined(__cplusplus) -} /* extern "C" { */ -#endif - -#endif /* #if !defined(VRPN_AVANGO_ATMELLIB_SERIAL_H) */ - diff --git a/src/vrpn/atmellib/vrpn_atmellib_errno.h b/src/vrpn/atmellib/vrpn_atmellib_errno.h deleted file mode 100644 index 7399f2da38a9f13634198b5524993054f08dbbdf..0000000000000000000000000000000000000000 --- a/src/vrpn/atmellib/vrpn_atmellib_errno.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- Mode:C -*- */ - -/***************************************************************************************************/ -/* */ -/* Copyright (C) 2003 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/***************************************************************************************************/ -/* */ -/* module : atmel_serial_errno.h */ -/* project : atmellib */ -/* description: error numbers of the lib */ -/* */ -/***************************************************************************************************/ - -#if !defined(ATMELLIB_SERIAL_ERRNO_H) - -#define ATMELLIB_SERIAL_ERRNO_H - - -/* program specific error codes */ - -#define ATMELLIB_NOERROR 1 /* no error */ -#define ATMELLIB_ERROR_GENERAL -1 /* general error */ -#define ATMELLIB_ERROR_SEQTO -5 /* sequence to small */ -#define ATMELLIB_ERROR_NORESPVAL -6 /* the mc didn't confirm the command */ -#define ATMELLIB_ERROR_NOCOMVAL -7 /* no valid command (must be bigger than 127 ) */ -#define ATMELLIB_ERROR_REGINV -10 /* the register is invalid */ -#define ATMELLIB_ERROR_VALINV -11 /* the value register is invalid */ -#define ATMELLIB_ERROR_RESINV -12 /* hardware ressource invalid */ -#define ATMELLIB_ERROR_NOTINIT -13 /* the prequists are not ok: i.e. to put a - light on the pin must be in output mode */ -#define ATMELLIB_ERROR_PARAMINV -14 /* functioncall with invalid parameter*/ -#define ATMELLIB_ERROR_NOSTATEVAL -15 /* no valid state or not able to read it out */ - - -#endif /* #if !defined(ATMELLIB_SERIAL_ERRNO_H) */ - diff --git a/src/vrpn/atmellib/vrpn_atmellib_helper.C b/src/vrpn/atmellib/vrpn_atmellib_helper.C deleted file mode 100644 index b2404d963f43e19a3f0d25333bc3a489142daa1c..0000000000000000000000000000000000000000 --- a/src/vrpn/atmellib/vrpn_atmellib_helper.C +++ /dev/null @@ -1,194 +0,0 @@ -/***************************************************************************************************/ -/* */ -/* Copyright (C) 2004 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/***************************************************************************************************/ -/* */ -/* module : vrpn_atmellib_helper.C */ -/* project : atmel-avango */ -/* description: part of the serial lib for the Atmel */ -/* miscellaneous functions */ -/* */ -/***************************************************************************************************/ - -/* include system headers */ - -#include <errno.h> // for error_t -#include <stdio.h> // for printf - -/* include i/f header */ - -#include "vrpn_atmellib.h" // for command_t, getCmd, setCmd, etc -#include "vrpn_atmellib_errno.h" // for ATMELLIB_NOERROR, etc -#include "vrpn_atmellib_helper.h" - -/***************************************************************************************************/ -/* set the defined bit in the command to the expected value and leave the rest like it is */ -/***************************************************************************************************/ -error_t -setBitCmd( struct command_t * Cmd , const unsigned char Pos , unsigned char Val ) -{ - /* check if the parameter are valid */ - if ((Val != 0) && (Val != 1)) - return ATMELLIB_ERROR_VALINV; - if (Pos > 7) - return ATMELLIB_ERROR_VALINV; - - - /* check if the value for "our" pin is already correct else change it */ - if (Pos == 7) { - /* bit seven is in byte one */ - if (((*Cmd).addr) & 0x01) { - if (Val == 0) - (*Cmd).addr -= 1; /* it's 1 and it has to be 0*/ - } - else { - if (Val == 1) /* it's 0 and it has to be 1 */ - (*Cmd).addr += 1; - } - } - else { /* the bits in the second byte */ - unsigned char Reference = 0x01 << Pos; - if ( ((*Cmd).value) & Reference ) { - if (Val == 0) - (*Cmd).value -= PowToTwo(Pos); - } - else { /* change necessary */ - if (Val == 1) - (*Cmd).value += PowToTwo(Pos); - } - } - - return ATMELLIB_NOERROR; -} - -/***************************************************************************************************/ -/* change only one bit of the value of the specified register */ -/***************************************************************************************************/ -error_t -setBitReg( const handle_t Hd , const unsigned char Reg , \ - const unsigned char Pos , const unsigned char Val ) -{ - struct command_t Cmd; - error_t R; - unsigned char i; - - - /* check if the parameters are valid */ - if ((Val != 0) && (Val != 1)) - return ATMELLIB_ERROR_VALINV; - - /* set the correct address for the register */ - /* check if the first bit is already set or if it has to be done here */ - if (Reg & 0x80) - Cmd.addr = Reg; - else { - Cmd.addr = Reg + 64; - Cmd.addr <<= 1; - } - - Cmd.value = 0x00; - - /* get the current setting of the register on the microcontroller */ - /* if you get sth invalid try again */ - for (i=0 ; i<10 ; ++i) { - - if ( (R = getCmd( Hd , &Cmd )) != ATMELLIB_NOERROR ) - return R; - - if ( Cmd.value<128) - break; - } - if (i==10) - return ATMELLIB_ERROR_NOSTATEVAL; - - if ( (R = setBitCmd( &Cmd , Pos , Val )) != ATMELLIB_NOERROR) - return R; - - /* write the corrected value back to the microcontroller */ - if ( (R = setCmd( Hd , &Cmd )) != ATMELLIB_NOERROR ) - return R; - - return ATMELLIB_NOERROR; -} - -/***************************************************************************************************/ -/* 2^Exponent */ -/***************************************************************************************************/ -unsigned int -PowToTwo( unsigned int Exponent ) -{ - unsigned int i; - unsigned int R = 1; - - for( i=0 ; i<Exponent ; i++) - R *= 2; - - return R; -} - - -/***************************************************************************************************/ -/* valid address byte to the specified register */ -/* the MSB data bit is set to zero */ -/***************************************************************************************************/ -unsigned char -getAddress( unsigned char Reg ) -{ - Reg += 64; - Reg <<= 1; - return Reg; -} - - -/***************************************************************************************************/ -/* set the value in a two byte command */ -/***************************************************************************************************/ -void -setValue( struct command_t * Cmd , unsigned char Val) -{ - if (Val>127) { - - Val -= 128; - if ( ! ((*Cmd).addr & 0x01)) - (*Cmd).addr +=1; - } - else - if ((*Cmd).addr & 0x01) - (*Cmd).addr -=1; - - (*Cmd).value = Val; -} - - -/***************************************************************************************************/ -/* helper function */ -/***************************************************************************************************/ -/* extern */ void -outBit( unsigned char Arg ) -{ - unsigned char Ref; - - for ( Ref=0x80 ; Ref != 0x00 ; Ref >>= 1 ) { - - if (Ref & Arg) - printf("1"); - else - printf("0"); - } - - printf("\n"); -} - - - -#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) -# pragma set woff 1174 -#endif - -#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) -# pragma reset woff 1174 -#endif - diff --git a/src/vrpn/atmellib/vrpn_atmellib_helper.h b/src/vrpn/atmellib/vrpn_atmellib_helper.h deleted file mode 100644 index 211716e09270de75b8fa4963d233205243b5123b..0000000000000000000000000000000000000000 --- a/src/vrpn/atmellib/vrpn_atmellib_helper.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode:C -*- */ - -/***************************************************************************************************/ -/* */ -/* Copyright (C) 2003 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/***************************************************************************************************/ -/* */ -/* module : lib */ -/* project : atmellib */ -/* description: private part of the header for internal use */ -/* */ -/***************************************************************************************************/ - -/* $Id: vrpn_atmellib_helper.h,v 1.1 2007/06/25 19:56:16 taylorr Exp $ */ - -#if !defined(ATMELLIB_SERIAL_HELPER_H) -#define ATMELLIB_SERIAL_HELPER_H - -/* includes, system */ -/* #include <> */ - -#include <errno.h> // for error_t - -/* includes, project */ -#include "vrpn_atmellib.h" // for handle_t - - -#if defined(__cplusplus) -extern "C" { -#endif - - /*****************************************************************/ - /* types, variables NOT exported, internal (static) */ - - /* internal functions */ - - /* set the specified bit in the given Command without interfering the other bits*/ - error_t setBitCmd( struct command_t * Command , \ - const unsigned char Position , unsigned char Value ); - - /* set the specified bit in the Register without interfering the other bits */ - error_t setBitReg( const handle_t Handle , const unsigned char Register , \ - const unsigned char Position , const unsigned char Value ); - - /* gives you the 2^Exponent */ - unsigned int PowToTwo( unsigned int Exponent); - - /* valid address byte for the specified Register - the MSB data bit is set to zero */ - unsigned char getAddress( unsigned char Register ); - - /* set a value in an two byte command*/ - void setValue( struct command_t * Command , unsigned char Value); - - -#if defined(__cplusplus) -} /* extern "C" { */ -#endif - -#endif /* #if !defined(ATMELLIB_SERIAL_HELPER_H) */ - diff --git a/src/vrpn/atmellib/vrpn_atmellib_iobasic.C b/src/vrpn/atmellib/vrpn_atmellib_iobasic.C deleted file mode 100644 index 15607a4aa7f8589ecad8db406fe686a2224fe1d3..0000000000000000000000000000000000000000 --- a/src/vrpn/atmellib/vrpn_atmellib_iobasic.C +++ /dev/null @@ -1,384 +0,0 @@ -/***************************************************************************************************/ -/* */ -/* Copyright (C) 2004 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/***************************************************************************************************/ -/* */ -/* module : vrpn_atmel_iobasic.C */ -/* project : atmel-avango */ -/* description: basic functions for serial io access on the tty */ -/* */ -/***************************************************************************************************/ - -//#define VRPN_ATMELLIB_VERBOSE_OUTBIT -//#define VRPN_ATMELLIB_VERBOSE - -/* include system headers */ - -#include <errno.h> // for errno, ENXIO, error_t -#include <stddef.h> // for size_t -#include <stdio.h> // for fprintf, stderr, NULL, etc -#include <string.h> // for strerror -#include <sys/select.h> // for select, FD_SET, FD_ZERO, etc -#include <termios.h> // for tcflush, TCIOFLUSH -#include <unistd.h> // for read, write - -/* include i/f header */ - -#include "vrpn_Shared.h" // for timeval -#include "vrpn_atmellib.h" // for command_t, handle_t, etc -#include "vrpn_atmellib_errno.h" // for ATMELLIB_ERROR_NORESPVAL, etc - -/***************************************************************************************************/ -/* read data from the tty */ -/* returns the bytes read or one of the system wide error codes returned by read */ -/***************************************************************************************************/ -static int -read_wrapper (handle_t fd, void* buf, size_t len) -{ - return read (fd, buf, len); -} - -/***************************************************************************************************/ -/* write data to the tty: return the byte written or one of the system - wide error codes returned by write */ -/***************************************************************************************************/ -static int -write_wrapper ( handle_t fd , const void* buf , size_t len ) -{ - return write (fd , buf , len ); -} - -/***************************************************************************************************/ -/* make a select for lib-wide time and if this is successfully read one byte */ -/***************************************************************************************************/ -static int -select_read_wrapper(handle_t fd , struct timeval * time) -{ - fd_set rdfs; - unsigned char byte; - int ret; - - FD_ZERO( &rdfs ); - FD_SET(fd , &rdfs); - - ret = select( fd+1, &rdfs, NULL, NULL, time); - if (ret<0) { - - fprintf(stderr, "select_read_wrapper:: error during select: %s (%i)\n", - strerror(errno) ,errno); - return ATMELLIB_ERROR_NORESPVAL; - } - else if (ret==0) { - - // time expired - fprintf(stderr, "vrpn_atmellib::select_read_wrapper: select timed out\n" ); - return ATMELLIB_ERROR_NORESPVAL; - } - - // successful select -> read out one command - if ((ret = read_wrapper(fd , (void *) (&byte), 1)) <=0 ) - return ret; - -#ifdef VRPN_ATMELLIB_VERBOSE_OUTBIT - outBit(byte); -#endif - - return byte; -} - -/***************************************************************************************************/ -/* make a select for lib-wide time and if this is successfully read one byte */ -/***************************************************************************************************/ -static int -select_write_wrapper(handle_t fd , struct timeval * time, unsigned char * data , int len) -{ - fd_set wrfs; - int ret; - - FD_ZERO( &wrfs ); - FD_SET(fd , &wrfs); - - ret = select( fd+1, NULL, &wrfs, NULL, time); - if (ret<0) { - - fprintf(stderr, - "vrpn_atmellib::select_write_wrapper::error during waiting for writing permission: %s (%i)\n", - strerror(errno) ,errno); - - return ATMELLIB_ERROR_NORESPVAL; - } - else if (ret==0) { - - // time expired - fprintf(stderr, "vrpn_atmellib::select_write_wrapper: timed out in wrapper\n" ); - return ATMELLIB_ERROR_NORESPVAL; - } - - // successful select -> write down command - // write twice to ensure that the atmel receives it - //write_wrapper(fd , (void *) data, len); - return write_wrapper(fd , (void *) data, len); -} - -/***************************************************************************************************/ -/* PART OF THE BASIC INTERFACE: for explainations to the functions see the header file */ -/***************************************************************************************************/ - - -/***************************************************************************************************/ -/* get the value of one register */ -/***************************************************************************************************/ -/* extern */ error_t -getCmd (handle_t fd, struct command_t* Cmd) -{ - struct timeval time_wait; - int ret; - -#ifdef VRPN_ATMEL_SERIAL_VRPN - unsigned char read_val; -#endif - - // some adds to measure time for reading out -#ifdef VRPN_ATMELLIB_TIME_MEASURE - struct timeval start; - struct timeval end; - int sec, usec; - vrpn_gettimeofday( &start , 0); -#endif - - unsigned char PossibilityOne; - unsigned char PossibilityTwo; - unsigned char Reference; - - /* check if the given parameters are valid */ - if (handle_invalid(fd)) - return ENXIO; - if ((*Cmd).addr < 128) - return ATMELLIB_ERROR_NOCOMVAL; - - PossibilityOne = (*Cmd).addr; - PossibilityTwo = (*Cmd).addr; - Reference = 0x01; - - if (Reference & PossibilityTwo) - /* the LSB of the Address is 1 -> make 0 -> use XOR operator */ - PossibilityTwo ^= Reference; - else - /* the LSB of the address is 0 -> make 1 -> use OR operator */ - PossibilityTwo |= Reference; - -#ifdef VRPN_ATMEL_SERIAL_VRPN - vrpn_flush_input_buffer(fd); - vrpn_flush_output_buffer(fd); -#else - tcflush( fd , TCIOFLUSH ); -#endif - - time_wait.tv_sec = VRPN_ATMELLIB_SELECT_WAIT_SEC; - time_wait.tv_usec = VRPN_ATMELLIB_SELECT_WAIT_USEC; - -#ifdef VRPN_ATMEL_SERIAL_VRPN - vrpn_write_characters(fd, (&((*Cmd).addr)) , 1); -#else - /* you have to send the address first */ - if ( (ret = select_write_wrapper( fd , - &(time_wait), - (&((*Cmd).addr)) , - 1 )) - != 1 ) { - - fprintf(stderr, "\n vrpn_atmellib::getCmd: Error while writing down. error=%i\n", - ret); - - return ret; - } -#endif - - while (time_wait.tv_usec!=0) { - -#ifdef VRPN_ATMEL_SERIAL_VRPN - if (( vrpn_read_available_characters(fd, &(read_val), 1, &time_wait)) != 1) { - - fprintf(stderr, "vrpn_atmellib::getCmd: Error vrpn_read_available_characters for first byte\n"); - break; - } - - // else - ret = read_val; -#else - if ((ret = select_read_wrapper(fd, &time_wait)) < 0) { - - fprintf(stderr, "vrpn_atmellib::getCmd:\ - Error select_read_wrapper for first byte: %i\n" , ret); - break; - } -#endif - - // found expected first byte - if ((ret==PossibilityOne) || (ret==PossibilityTwo )) { - - (*Cmd).addr = ret; - -#ifdef VRPN_ATMEL_SERIAL_VRPN - if (( vrpn_read_available_characters(fd, &(read_val), 1, &time_wait)) != 1) { - - fprintf(stderr, "vrpn_atmellib::getCmd: Error vrpn_read_available_characters.\n");; - break; - } - - //else - ret = read_val; -#else - ret = select_read_wrapper(fd, &time_wait); -#endif - - if ((ret < 0) || (ret > 128)) { - - fprintf(stderr, "vrpn_atmellib::getCmd: Error reading second byte: %i\n\n" , ret); - break; - } - - (*Cmd).value = ret; - -#ifdef VRPN_ATMELLIB_TIME_MEASURE - // display time for - vrpn_gettimeofday( &end , 0); - sec=end.tv_sec-start.tv_sec; - usec=end.tv_usec-start.tv_usec; - printf("Time for reading out: sec=%i , usec=%i\n", sec, usec); -#endif - - return ATMELLIB_NOERROR; - } - - } - - return ATMELLIB_ERROR_NORESPVAL; -} - - -/***************************************************************************************************/ -/* write one command to the mc and wait for confirmation */ -/***************************************************************************************************/ -/* extern */ error_t -setCmd (handle_t fd , struct command_t * Cmd) -{ - - struct timeval time_wait; - int ret; - -#ifdef VRPN_ATMEL_SERIAL_VRPN - unsigned char read_val; -#endif - - // some adds to measure time for reading out -#ifdef VRPN_ATMELLIB_TIME_MEASURE - struct timeval start; - struct timeval end; - int sec, usec; - vrpn_gettimeofday( &start , 0); -#endif - - /* check if the given parameters are valid */ - if (handle_invalid(fd)) - return ENXIO; - if ((*Cmd).addr < 128) - return ATMELLIB_ERROR_NOCOMVAL; - - time_wait.tv_sec = VRPN_ATMELLIB_SELECT_WAIT_SEC; - time_wait.tv_usec = VRPN_ATMELLIB_SELECT_WAIT_USEC; - -#ifdef VRPN_ATMEL_SERIAL_VRPN - vrpn_write_characters(fd, (unsigned char*) Cmd, 2); -#else - if ( (ret = select_write_wrapper( fd , - &(time_wait), - (unsigned char*) Cmd , - 2 )) - != 2 ) { - - fprintf(stderr, "\n vrpn_atmellib::setCmd: Error while writing down. error=%i\n", - ret); - - return ret; - } -#endif - - -#ifdef VRPN_ATMEL_SERIAL_VRPN - vrpn_flush_input_buffer(fd); - vrpn_flush_output_buffer(fd); -#else - tcflush( fd , TCIOFLUSH ); -#endif - - while (time_wait.tv_usec!=0) { - -#ifdef VRPN_ATMEL_SERIAL_VRPN - if (( vrpn_read_available_characters(fd, &(read_val), 1, &time_wait)) != 1) { - - fprintf(stderr, "vrpn_atmellib::setCmd: Error vrpn_read_available_characters.\n");; - break; - } - - //else - ret = read_val; -#else - if ((ret = select_read_wrapper(fd, &time_wait)) < 0) { - - fprintf(stderr, "vrpn_atmellib::setCmd: Error select_read_wrapper for first byte: %i\n" , ret); - break; - } -#endif - - // found expected first byte - if (ret==(*Cmd).addr) { - -#ifdef VRPN_ATMEL_SERIAL_VRPN - if (( vrpn_read_available_characters(fd, &(read_val), 1, &time_wait)) != 1) { - - printf("Error vrpn_read_available_characters.\n");; - break; - } - - //else - ret = read_val; -#else - ret = select_read_wrapper(fd, &time_wait); -#endif - - if (ret!=(*Cmd).value) { - - printf("vrpn_atmellib::setCmd: Error select_read_wrapper for second byte: %i\n" , ret); - break; - } - -#ifdef ATMELLIB_TIME_MEASURE - // display time for - vrpn_gettimeofday( &end , 0); - sec=end.tv_sec-start.tv_sec; - usec=end.tv_usec-start.tv_usec; - printf("Time for writing down: sec=%i , usec=%i\n", sec, usec); -#endif - - return ATMELLIB_NOERROR; - } - - } - - return ATMELLIB_ERROR_NORESPVAL; -} - -/* file static for <ident> or <what> */ - -#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) -# pragma set woff 1174 -#endif - -#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) -# pragma reset woff 1174 -#endif - diff --git a/src/vrpn/atmellib/vrpn_atmellib_openclose.C b/src/vrpn/atmellib/vrpn_atmellib_openclose.C deleted file mode 100644 index d6100b45bbb155bc5c91bcffc3c33cf2a0685991..0000000000000000000000000000000000000000 --- a/src/vrpn/atmellib/vrpn_atmellib_openclose.C +++ /dev/null @@ -1,132 +0,0 @@ -/***************************************************************************************************/ -/* */ -/* Copyright (C) 2004 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/***************************************************************************************************/ -/* */ -/* module : vrpn_atmellib_openclose.C */ -/* project : atmel-avango */ -/* description: handle open, close and initalization of the tty */ -/* */ -/***************************************************************************************************/ - -/* include system headers */ - -#include <errno.h> // for ENXIO, error_t -#include <fcntl.h> // for open, O_NOCTTY, O_RDWR -#include <termios.h> // for termios, cfsetispeed, etc -#include <unistd.h> // for close, isatty - -/* include i/f header */ - -#include "vrpn_atmellib.h" // for handle_t, handle_invalid -#include "vrpn_atmellib_errno.h" // for ATMELLIB_NOERROR - - -/***************************************************************************************************/ -/* internal (static) functions */ - -/*****************************************************************/ -/* set the parameter to communicate with the microcontroller */ -/*****************************************************************/ -static int -Set_Params( handle_t fd , const int baud, struct termios * init_param) -{ - struct termios Params; - - /* get the actual parameters of the tty */ - tcgetattr( fd , &Params ); - - /* save the init values of the tty */ - (*init_param) = Params; - - /* wait time for new data */ - Params.c_cc[VTIME] = 0; - Params.c_cc[VMIN] = 1; - - if (baud==38400) { - - Params.c_cflag = B38400 | CSIZE | CS8 | CREAD | CLOCAL | HUPCL; - cfsetospeed( &Params , B38400 ); - cfsetispeed( &Params , B38400 ); - } - else { - - // 9600 baud is default - Params.c_cflag = B9600 | CSIZE | CS8 | CREAD | CLOCAL | HUPCL; - cfsetospeed( &Params , B9600 ); - cfsetispeed( &Params , B9600 ); - } - - Params.c_iflag = (IGNBRK | IGNPAR); - Params.c_lflag = 0; - Params.c_oflag = 0; - - /* activate the new settings */ - tcsetattr( fd , TCSANOW , &Params ); - - return ATMELLIB_NOERROR; -} - -/***************************************************************************************************/ -/* PART OF THE BASIC INTERFACE: for explainations to the functions see the header file */ -/***************************************************************************************************/ - - -/***************************************************************************************************/ -/* open the specified serial port and set the parameter that it's ready to communicate with the mc*/ -/***************************************************************************************************/ -/* extern */ handle_t -openPort (const char* tty , const int baud, struct termios * init_param) -{ - handle_t fd; - - /* try to open thespecified device */ - if ( (fd = open( tty , O_RDWR | O_NOCTTY )) < 0) - return fd; - - /* check if the open file is a tty */ - if (!isatty( fd )) { - close (fd); - return -1; - } - - /* set the correct serial parameter to communicate with the microcontroller */ - if ( Set_Params( fd , baud, init_param ) < 0 ) - { - close (fd); - return -1; - } - - return fd; -} - -/***************************************************************************************************/ -/* close the specified port and reset the parameter to the initial values */ -/***************************************************************************************************/ -/* extern */ error_t -closePort (handle_t fd , struct termios * init_param) -{ - if (handle_invalid(fd)) - return ENXIO; - - /* first reset the parameters and then close the port */ - tcsetattr( fd , TCSADRAIN, init_param ); - close( fd ); - - return ATMELLIB_NOERROR; -} - - -/* file static for <ident> or <what> */ - -#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) -# pragma set woff 1174 -#endif - -#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) -# pragma reset woff 1174 -#endif - diff --git a/src/vrpn/atmellib/vrpn_atmellib_register.C b/src/vrpn/atmellib/vrpn_atmellib_register.C deleted file mode 100644 index d345381f3819c0f98d3a170364726c5fa9982249..0000000000000000000000000000000000000000 --- a/src/vrpn/atmellib/vrpn_atmellib_register.C +++ /dev/null @@ -1,91 +0,0 @@ -/***************************************************************************************************/ -/* */ -/* Copyright (C) 2003 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/***************************************************************************************************/ -/* */ -/* module : vrpn_atmellib_register.C */ -/* project : atmel-avango */ -/* description: function of an easy high level interface for access to the registers */ -/* */ -/***************************************************************************************************/ - -/* include system headers */ - -#include <errno.h> // for ENXIO, error_t - -/* include i/f header */ - -#include "vrpn_atmellib.h" // for command_t, handle_invalid, etc -#include "vrpn_atmellib_errno.h" // for ATMELLIB_ERROR_REGINV, etc -#include "vrpn_atmellib_helper.h" // for getAddress, setValue - -/***************************************************************************************************/ -/* HIGH LEVEL INTERFACE */ -/***************************************************************************************************/ - -/***************************************************************************************************/ -/* write the value of the specified register and wait for confirmation */ -/***************************************************************************************************/ -/* extern */ error_t -setRegister( handle_t Handle , const unsigned char Register , const unsigned char Value) -{ - struct command_t Cmd; - - /* check if the arguments are valid */ - if (handle_invalid(Handle)) - return ENXIO; - if (register_invalid( Register ) != ATMELLIB_NOERROR) - return ATMELLIB_ERROR_REGINV; - - /* combine the parameter to a valid commande */ - Cmd.addr = getAddress( Register ); - setValue( &Cmd , Value ); - - /* send the command to the microcontroller */ - return ( setCmd( Handle , &Cmd ) ); -} - -/***************************************************************************************************/ -/* read out the value of the specified register */ -/***************************************************************************************************/ -/*extern*/ int -getRegister( handle_t Handle , const unsigned char Register ) -{ - error_t R; - struct command_t Cmd; - - /* check if the arguments are valid */ - if (handle_invalid(Handle)) - return ENXIO; - if (register_invalid( Register ) == ATMELLIB_ERROR_GENERAL) - return ATMELLIB_ERROR_REGINV; - - /* make a valid command */ - Cmd.addr = getAddress( Register ); - - /* Send the command to the microcontroller */ - if ( (R = getCmd( Handle , &Cmd )) != ATMELLIB_NOERROR) - return R; - - /* get the value */ - if ( Cmd.addr & 0x01 ) Cmd.value += 128; - - return (Cmd.value); -} - - - -/* file static for <ident> or <what> */ - -#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) -# pragma set woff 1174 -#endif - -#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) -# pragma reset woff 1174 -#endif - - diff --git a/src/vrpn/atmellib/vrpn_atmellib_tester.C b/src/vrpn/atmellib/vrpn_atmellib_tester.C deleted file mode 100644 index 9f8bb5a73afb4a10236d426a8e43eeeabcbc4acd..0000000000000000000000000000000000000000 --- a/src/vrpn/atmellib/vrpn_atmellib_tester.C +++ /dev/null @@ -1,64 +0,0 @@ -/***************************************************************************************************/ -/* */ -/* Copyright (C) 2004 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/***************************************************************************************************/ -/* */ -/* module : vrpn_atmellib_tester.C */ -/* project : atmel-avango */ -/* description: functions to test the state */ -/* */ -/***************************************************************************************************/ - -/* include system headers */ - -#include <errno.h> // for error_t - -/* include i/f header */ - -#include "vrpn_atmellib.h" // for handle_t -#include "vrpn_atmellib_errno.h" // for ATMELLIB_ERROR_GENERAL, etc - -/***************************************************************************************************/ -/* internal (static) variables */ - -/* define a invalid handle */ -const static int invalid_handle = -1; - - -/***************************************************************************************************/ -/* test if the given handler is a valid handle */ -/***************************************************************************************************/ -/* extern */ error_t -handle_invalid (handle_t handle) -{ - return (invalid_handle == handle); -} - -/***************************************************************************************************/ -/* test if the register is valid - if it exists on the mc */ -/***************************************************************************************************/ -/* extern */ error_t -register_invalid (unsigned char Register) -{ - if (Register > 63) { - - return ATMELLIB_ERROR_GENERAL; - } - - return ATMELLIB_NOERROR; -} - - -/* file static for <ident> or <what> */ - -#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) -# pragma set woff 1174 -#endif - -#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) -# pragma reset woff 1174 -#endif - diff --git a/src/vrpn/client_src/.cvsignore b/src/vrpn/client_src/.cvsignore deleted file mode 100644 index 58f8f321c71c1bd836992589100ddfd28912c982..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/.cvsignore +++ /dev/null @@ -1,9 +0,0 @@ -.depend -make.out -makefile -pc_cygwin -pc_linux -sgi_irix -sparc_solaris -powerpc_aix -*.vcproj.*.user diff --git a/src/vrpn/client_src/CMakeLists.txt b/src/vrpn/client_src/CMakeLists.txt deleted file mode 100644 index 2896e8d878026720835da524ef436014fe4bd542..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/CMakeLists.txt +++ /dev/null @@ -1,166 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -#----------------------------------------------------------------------------- -# XXX Things to make better. -# -# XXX clock_drift_estimator -# Move applications into subprojects in visual studio -# Make the files with ".c" extension also compile as C++. -# Make the c_interface_example work - -#----------------------------------------------------------------------------- -# Build the client applications if we've been asked to. -if(VRPN_BUILD_CLIENTS) - - if(NOT VRPN_CLIENT_LIBRARY) - message(FATAL_ERROR - "Cannot compile clients without either the client or full library. Enable one and try again.") - endif() - - #----------------------------------------------------------------------------- - # Libraries we need to do our thing. - find_package(GLUT) - if(APPLE) - mark_as_advanced(GLUT_cocoa_LIBRARY) - endif() - find_package(OpenGL) - - set(CLIENTS_SOURCES - vrpn_print_devices.C - vrpn_print_performance.C - vrpn_print_messages.C - ) - - set(TEST_SOURCES - add_vrpn_cookie.C - bdbox_client.C - clock_drift_estimator.C - ff_client.C - forcedevice_test_client.cpp - forwarderClient.C - #midi_client.C # XXX TODO No vrpn_Sound_Remote ever defined in this repository - #ohm_client.C # XXX TODO No vrpn_Ohmmeter (vrpn_Ohmmeter.h) defined in this repository - phan_client.C - printcereal.C - printvals.C - sound_client.C - sphere_client.C - testSharedObject.C - test_Zaber.C - test_imager.C - test_mutex.C - text.C - tracker_to_poser.cpp - vrpn_LamportClock.t.C - vrpn_ping.C - ) - - if(NOT WIN32) - # TODO: These need "open" calls modified to build on win. - list(APPEND - TEST_SOURCES - logfilesenders.C - logfiletypes.C - checklogfile.C) - endif() - - ### - # Tests - ### - if(BUILD_TESTING) - foreach(SOURCE ${TEST_SOURCES}) - get_filename_component(APP ${SOURCE} NAME_WE) - add_executable(${APP} ${SOURCE}) - target_link_libraries(${APP} ${VRPN_CLIENT_LIBRARY}) - - set_target_properties(${APP} PROPERTIES FOLDER Tests) - if(VRPN_INSTALL) - install(TARGETS ${APP} RUNTIME DESTINATION bin COMPONENT tests) - endif() - endforeach() - - if(GLUT_FOUND AND OPENGL_FOUND) - include_directories(${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) - add_executable(testimager_client testimager_client.C) - target_link_libraries(testimager_client - ${VRPN_CLIENT_LIBRARY} - ${GLUT_glut_LIBRARY} - ${OPENGL_LIBRARIES}) - - set_target_properties(testimager_client PROPERTIES FOLDER Tests) - - if(VRPN_INSTALL) - install(TARGETS - testimager_client - RUNTIME - DESTINATION - bin - COMPONENT - tests) - endif() - option(VRPN_GLUT_IS_STATIC_FREEGLUT - "Is the GLUT used for the imaging test client a static build of FreeGLUT?" - NO) - mark_as_advanced(VRPN_GLUT_IS_STATIC_FREEGLUT) - if(VRPN_GLUT_IS_STATIC_FREEGLUT) - set_property(TARGET - testimager_client - PROPERTY - COMPILE_DEFINITIONS - "FREEGLUT_STATIC") - endif() - endif() - - endif() - - add_executable(c_interface_example - c_interface_example.c - c_interface.h - c_interface.cpp) - target_link_libraries(c_interface_example ${VRPN_CLIENT_LIBRARY}) - - set_target_properties(c_interface_example PROPERTIES FOLDER Tests) - - if(VRPN_INSTALL) - install(TARGETS - c_interface_example - RUNTIME - DESTINATION - bin - COMPONENT - tests) - endif() - - - ### - # Clients - ### - foreach(SOURCE ${CLIENTS_SOURCES}) - get_filename_component(APP ${SOURCE} NAME_WE) - add_executable(${APP} ${SOURCE}) - target_link_libraries(${APP} ${VRPN_CLIENT_LIBRARY}) - - set_target_properties(${APP} PROPERTIES FOLDER Clients) - - if(VRPN_INSTALL) - install(TARGETS ${APP} RUNTIME DESTINATION bin COMPONENT clients) - endif() - endforeach() - - ### - # Servers - ### - add_executable(run_auxiliary_logger run_auxiliary_logger.C) - target_link_libraries(run_auxiliary_logger ${VRPN_CLIENT_LIBRARY}) - set_target_properties(run_auxiliary_logger PROPERTIES FOLDER Servers) - if(VRPN_INSTALL) - install(TARGETS - run_auxiliary_logger - RUNTIME - DESTINATION - bin - COMPONENT - servers) - endif() - -endif() diff --git a/src/vrpn/client_src/ChangeLog b/src/vrpn/client_src/ChangeLog deleted file mode 100644 index 1c3dd39e5912178c6b46085852c83098583a69f6..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/ChangeLog +++ /dev/null @@ -1,570 +0,0 @@ -2009-12-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * c_interface_example.cpp : Gets rid of a compiler warning. - -2009-12-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CmakeLists.txt : Improvements by Ryan Pavlik to the Cmake files that - make them cleaner and use more modern constructions. Also various - bug fixes to make code compile on a number of architectures. - * bdbox_client.C : Compiles with modern VRPN. - * logfilesenders.c : Compiles on all architectures. - * logfiletypes.c : Same. - * testimager_client.C : Compiles on Apple. - * tracker_to_poser.cpp : Compiles on all architectures. - -2009-11-27 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CMakeLists.txt : Turning off testimager_client on all but Windows. - * testimager_client.C : Removing declarations that aren't needed but that - only worked on Windows. - -2009-11-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * ff_client.C : Picking lint found by a new compiler (const declarations and - printf format descriptions. - * phan_client.C : Same. - * printceral.C : Same. - * sphere_client.C : Same. - * text.C : Same. - * vrpn_print_devices.C : Same. - -2009-11-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CMakeLists.txt : File to describe to the Cmake build system how - to compile VRPN. - * ff_client.C : Upgrade to compile on Windows with recent VRPN. - * phan_client.C : same. - * testSharedObject.C : same. - * text.C : same. - * vrpn_ping.C : same. - -2009-11-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * sound_client.c : Fixed it so that it compiles. There must - have been an inadvertent cutting out of some lines in - the code. - -2009-09-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Turned "-g" flag into "$(DEBUG_FLAGS)" throughout. - -2009-07-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * run_auxiliary_logger.C : Added a test program that - lets you connect and ask for a log file for some - duration. - * run_auxiliary_logger.dsp : Same. - * run_auxiliary_logger.vcproj : Same. - -2009_06_16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Removed UNC-specific include and library paths. - -2009_04_17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Patch from Hans Lambermont to make it compile under Linux. - * test_imager.C : Same. - -2009_03_07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added entry to compile a C-interface example program. - * c_interface.cpp : Code to provide a C interface to remote classes. - * c_interface.h : Same. - * c_interface_example.c : Example C program using the interface. - -2009_01_21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * forcedevice_test_client.vcproj : Making it compile with quatlib - in expected location. - * sphere_client.vcproj : Same. - * vrpn_print_devices.C : Removed limit on the number of sensors per - tracker. Now uses a vector to keep track of counts, which - can add more until we run out of memory. - -2008_07_02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_print_devices.C : Has the code not preload or - accumulate in case of reading from a file. - -2008_03_04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * clock_drift_estimator.C : Replaces vrpn_Connection - constructor with call to vrpn_create_server_connection() - * test_imager.C : Same. - * testimager_client.C : Whitespace changes - * vrpn_print_devices.C : Added Text_Receiver to the objects - being created, so you can print out text messages from an - object as well. - -2007-12-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : Has VRPN fileconnections neither preload - nor accumulate in case we open a logfile to read the - device. - -2007-08-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : Fixed a race-condition bug at startup that - would cause a crash when a Glut function was called before - Glut was initialized. - -2007-06-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added linking with pthreads because of vrpn_Thread class. - -2007-06-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding patch submitted by Patrick Hartling from - Infiscape.com for making this compile on MacOSX - to create universal binaries. - -2007-03-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding a build environment for cross-compiling to - ARM from PCs running Cygwin - -2007-03-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Making this code compile under pc_linux_arm. - -2006-10-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * clock_drift_estimator.vcproj : Updated to use the August 2006 version - of the DirectX SDK and the Microsoft Platform SDK - for Windows Server 20003 R2. - * forcedevice_test_client.vcproj : Same. - * printcerial.vcproj : Same. - * printvals.vcproj : Same. - * sphere_client.vcproj : Same. - * test_imager.vcproj : Same. - * test_zaber.vcproj : Same. - * testimager_client.vcproj : Same. - * tracker_to_poser.vcproj : Same. - * vrpn_print_devices.vcproj : Same. - -2006-08-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : It now renders when it gets the - end of a frame, which helps reduce the tearing in the - video being displayed. - -2006-07-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : Adding a call to make the connection limit - the number of messages it will handle before returning control - to the application. This prevents the server from choking the - whole program by continually filling the network with packets. - -2006-06-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added install and uninstall. - -2006-03-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * *.vcproj : Visual C++ 2005 project files for VRPN. - -2006-02-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : Switched to the more standard - GL/glut.h for the include. - * testimager_client.dsp : Modified so that it looks in - the NSRG buildime rather than a nearby local - directory. - -2005-10-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * forcedevice_test_client.cpp : Modified to also include the - presentation of a cube using the triangle interface. - -2005-10-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added target for 64-bit Intel-based SGI compilation. - -2005-09-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * forcedevice_test_client.C : Modified to only put - in normalized directions. - -2005-08-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * clock_drift_estimator.C : Diff went crazy, so it is hard to - tell. Newer version. - -2005-08-10 Ben Wilde <wilde@cs.unc.edu> - - * forcedevice_test_client.cpp - -Added tests for the line and plane constraints. The plane - seems to work fine, but the line constraint has a strange - behavior. Either due to poor implementation or vrpn problem. - -2005-07-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * clock_drift_estimator.C : Application to estimate the drift between - the local machine's clock and another machine's clock using - the PING/PONG response from an arbitrary server object. - * clock_drift_estimator.dsp : Project file for this. - -2005-07-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * forcedevice_test_client.cpp : Deleted objects before exiting. - * phan_client.C : Same. - * sphere_client.C : Same. - -2005-07-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * printcereal.dsp : Added include directories on $(SYSTEMDRIVE) - and lib directories also on $(SYSTEMDRIVE) so that the - apps can build correctly with only edits in the - vrpn_Configure.h file if things are installed in standard - locations. - * forcedevice_test_client.dsp : Same. - * printvals.h : Same. - * setrouter.dsp : Same. - * test_imager.dsp : Same. - * test_zaber.dsp : Same. - * testimager_client.dsp : Same. - * tracker_to_poser.dsp : Same. - * vrpn_Router_Client_GUI.dsp : Same. - * vrpn_print_devices.dsp : Same. - -2005-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * clock_client.C : Removed. - * vrpnTrackerClient.cpp : Same. - * printcereal.C : Removed Synchronized. - * printvals.c : Same. - * sound_client.c : same. - * test_imager.C : Deleted objects that had been created, to - avoid reference-count warning at the end. - -2005-04-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : Clears image to black so that - anything not filled in has a definite value. - -2005-02-25 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Removed -LANG:std from compile, no streams - used in the code anymore. - -2005-02-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added John Stone's definitions to make - things compile under 64-bit Linux. - -2005-01-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : Modified to handle red, green, - blue channels from client. - -2004-12-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpnTrackerClient.cpp : Fixed compiler warnings. - -2004-12-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Swapped out test_tempimager for test_imager. - * test_imager.dsp : Same. - * test_imager.C : Same. - * test_tempimager.dsp : Same. - * test_tempimager.C : Same. - -2004-12-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Modified to use vrpn_Imager rather than vrpn_TempImager. - -2004-11-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Happy Birthday to me! - * Makefile : Added John Stone's additions to make it compile on - 64-bit Solaris - -2004-09-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - Adding Chris VanderKnyff's changes that enable DLL linkage - for applications. Heading towards enabling C# and other language - support. - - * forcedevice_test_client.cpp : Adding VRPN_CALLBACK. - * printcereal.C : same. - * printvals.C : same. - * sphere_client.C : same. - * test_Zaber.C : same. - * test_tempimager.C : same. - * testimager_client.C : same. - * tracker_to_poser.cpp : same. - * vrpn_Router_Client_GUI.C : same. - * vrpn_print_devices.C : same. - * forcedevice_test_client.dsp : Making it depend on the project - that causes both VRPN and VRPNDLL projects to be built, rather - than on VRPN. If you try to make it depend on both - VRPN and VRPNDLL, you get linking trouble. - * printcereal.dsp : same. - * printvals.dsp : same. - * setrouter.dsp : same. - * sphere_client.dsp : same. - * test_tempimager.dsp : same. - * test_zaber.dsp : same. - * testimager_client.dsp : same. - * tracker_to_poser.dsp : same. - * vrpn_Router_Client_GUI.dsp : same. - * vrpn_print_devices.dsp : same. - -2004-09-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * forcedevice_test_client.dsp : Changing code generation back to - DLL-based for all classes, like it was supposed to be in - the first place. Confusion over the cause for a crash led - us to incorrectly change it before. - * printcereal.dsp : Same. - * printvals.dsp : Same. - * setrouter.dsp : Same. - * sphere_client.dsp : Same. - * test_tempimager.dsp : Same. - * test_zaber.dsp : Same. - * testimager_client.dsp : Same. - * tracker_to_poser.dsp : Same. - * vrpn_Router_Client_GUI.dsp : Same. - * vrpn_print_devices.dsp : Same. - -2004-08-31 Russell M. Taylor II <taylorr@cs.unc.edu> - - * forcedevice_test_client.dsp : Changing code generation to use - multithreaded non-DLL for both debug and release. This turns - out to have always been the proper setting to use. - Unfortunately, all apps have to be rebuild with new settings, - and all libraries have to use the same setting. - * printcereal.dsp : Same. - * printvals.dsp : Same. - * setrouter.dsp : Same. - * sphere_client.dsp : Same. - * test_tempimager.dsp : Same. - * test_zaber.dsp : Same. - * testimager_client.dsp : Same. - * tracker_to_poser.dsp : Same. - * vrpn_Router_Client_GUI.dsp : Same. - * vrpn_print_devices.dsp : Same. - -2004-08-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * printcereal.C : Removed references to objects that were never - created. - -2004-07-27 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding build rule for .cpp (Horrible Windows extension - that is the same as the default rule in Unix for running the - C-pre-processor). Adding rule to build force test client. - * forcedevice_test.client.cpp : Removing unused variables. - -2004-07-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : Changed default port number. - * test_force_device_client.cpp : Test program for vrpn_ForceDevice/ - * test_force_device_client.dsp : Project file to build this. - -2004-05-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * tracker_to_poser.cpp : Can specify name of tracker and poser - on command line. - -2004-05-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * client_to_poser.cpp : New application to read from tracker - and send to poser. - * client_to_poser.dsp : Project file for this app. - -2004-04-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding flag to SGI compile in the hope that it would - fix things and let us use the new streams libraries. It - got us part of the way there on my system. - * clock_client.C : Added Patrick Hartling's changes to make VRPN - compile with Visual Studio.NET, which required switching to - new streams, which required retrofitting SGIs to use old - streams (using yet another define in vrpn_Configure.h). - * test_tempimager.C : same. - * vrpnTrackerClient.cpp : Same. - * vrpn_LamportClock.t.C : Same. - -2004-04-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * test_Zaber.C : Using vrpn_gettimeofday() not gettimeofday(). - * testimager_client.C : Same. - * vrpn_ping.C : Same. - * vrpn_print_devices.C : Same. - -2003-12-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : Added #ifdef-ed out line to save log. - -2003-07-24 Matt McCallus <mccallus@cs.unc.edu> - - * sound_client.c : white space, include path removed. - -2003-05-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * printcereal.C : main() now returns int like it should. - * printvals.C : Same. - * sphere_clien.C : Same. - * test_Zaber.C : Same. - * test_tempimager.C : Uses new interface to TempImager. - * test_tempimager.dsp : Release version compiles now. - * test_zaber.dsp : Same. - -2002-12-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * printcereal.dsp : DSP files have been modified to not do definitions - of VRPN_NO_STREAMS and other constants directly, rather these - are now set by editing vrpn_Configure.h. Also, made projects - compile in both debug and release versions. - * printvals.dsp : Same. - * setrouter.dsp : Same. - * sphere_client.dsp : Same. - * test_zaber.dsp : Same. - * vrpn_Router_Client_GUI.dsp : Same. - * vrpn_print_devices.dsp : Same. - * testimager_client.C : Comment change. - - -2002-11-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : Modified to use new vrpn_Tempimager class. - * testimager_client.dsp : Made os that Release version can be built - and is stored in the correct place. - -2002-10-30 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : Only post redisplay to Glut once before it - actually calls the display function. Otherwise, the calls - bunch up and the application even stops responding to windows - events. - * test_tempimager.dsp : Enables build for Release. - * test_zaber.dsp : Same. - * testimager_client.dsp : Same. - -2002-10-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : Scales faster, puts in more timing info. - -2002-09-27 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_client.C : Displays TempImager server output in OpenGL/Glut. - * testimager_client.dsp : Project file for testimager_client.C. - -2002-09-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * test_Zaber.C : Modified to use vrpn_Analog_Output. Not tested. - -2002-09-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * test_tempimager.C : Test file for TempImager class. - * test_tempimager.dsp : build file. - * Makefile : same. - -2002-07-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Removing seldom-used clients that don't compile on - all architectures. - -2002-07-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_print_devices.C : Added handlers for velocity and - acceleration to the tracker device. - -2002-05-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * haptic : New directory with examples of using a Phantom. - -2002-05-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * test_Zaber.C : Program to joj the Zaber back and forth once we have gotten - a response to see where it is. - * vrpn_zaber.dsp : Build file to make the test program. - -2001-11-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_print_devices.C : Modify to compile under Windows CE development environment. - -2001-06-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_print_devices.C : Updates to use cleaner Tracker code. - -2001-06-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_print_devices.C : Program to print all message types from a list - of devices (Tracker, Button, Analog, Dial). - * Makefile : Changed to include building the new application. - -2001-04-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * sound_client.c : Changed to compile with more recent version. - -2001-04-19 Adam Seeger <seeger@cs.unc.edu> - - * phan_client.C, sphere_client.C (main): added while-loop to wait until - the connection is established before sending commands - -2001-02-17 Tom Hudson <hudson@cs.unc.edu> - - * printvals.c (main) : remove code to Usage(), change command-line - parameters to work with new logging methods. - (init) : work with new logging methods. - (Usage) : new function. - -2000-11-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * printvals.c (handle_cntl_c) : The ^C handler in Windows is - multi-threaded, which means it is busy tearing down - the connections while the main loop is still going. - This fixes it so that a flag is set and the main thread - does the shutdown. - -2000-10-18 Tom Hudson <hudson@cs.unc.edu> - - * printvals.c (init) : sometimes use vrpn_DelayedConnection instead - of a straight vrpn_(Synchronized_)Connection - (Usage) : new option -delay - (main) : parse new option -delay, fix set of redundant - transmission time - (handle_gotConnection) : fix set of redundant transmission time - -2000-10-17 Tom Hudson <hudson@cs.unc.edu> - - * printvals.c (handle_gotConnection) : new function - (init) : register handle_gotConnection - -2000-10-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added vrpn_ping test program - -2000-10-11 Tom Hudson <hudson@cs.unc.edu> - - * printvals.c : add vrpn_RedundantRemote, global parameters - (init) : create vrpn_RedundantRemote - (main) : add parameters -quiet, -red - -2000-09-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added vrpn_ping compilation - * vrpn_ping.C : New file - -2000-09-12 Tom Hudson <hudson@cs.unc.edu> - - * testSharedObject : added more complete test of features - -2000-08-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added AIX compile - -2000-08-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * setrouter : New file - * vrpn_Router_Client_GUI : New file - * Makefile : Added two router test clients, one of which uses GLUT - -2000-08-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * printcereal.C (handle_control_C) : fixed deletion bug - diff --git a/src/vrpn/client_src/Makefile b/src/vrpn/client_src/Makefile deleted file mode 100644 index 1b1d58607b275747eaac54ad9f8aa0d202f46ec7..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/Makefile +++ /dev/null @@ -1,349 +0,0 @@ -# Couldn't understand or usefully modify the former makefile. -# Copied the one from ../server_src here and put the former one -# in Makefile.old - -########################## -# common definitions. For non-UNC sites, uncomment one of the lines -# that defines hw_os for the machine you are on in the section just -# below. Then, the code should compile in your environment. -# -#HW_OS := sgi_irix -#HW_OS := sparc_solaris -#HW_OS := sparc_solaris_64 -#HW_OS := hp700_hpux10 -#HW_OS := pc_linux -HW_OS := pc_linux64 -#HW_OS := pc_linux_ia64 -# Try using this to cross-compile for ARM on a PC running Linux -#HW_OS := pc_linux_arm -# Try using this to cross-compile for ARM on a PC running Cygwin -#HW_OS := pc_cygwin_arm -#HW_OS := pc_cygwin -#HW_OS := pc_FreeBSD -#HW_OS := powerpc_aix -#HW_OS := powerpc_macosx -#HW_OS := universal_macosx -#HW_OS := macosx_32_64 -#HW_OS := macosx_64 -########################## - -INSTALL_DIR := /usr/local -BIN_DIR := $(INSTALL_DIR)/bin -INCLUDE_DIR := $(INSTALL_DIR)/include -LIB_DIR := $(INSTALL_DIR)/lib - -ifndef HW_OS -# hw_os does not exist on FreeBSD at UNC -UNAME := $(shell uname -s) -ifeq ($(UNAME), FreeBSD) - HW_OS := pc_FreeBSD -else - # pc_cygwin doesn't have HW_OS - ifeq ($(UNAME), CYGWIN_NT-4.0) - HW_OS := pc_cygwin - else - ifeq ($(UNAME), CYGWIN_98-4.10) - HW_OS := pc_cygwin - else - HW_OS := $(shell hw_os) - endif - endif -endif -endif - - -# check if its for pxfl -ifdef PBASE_ROOT - HW_OS := hp_flow - ifeq ($(PXFL_COMPILER), aCC) - HW_OS = hp_flow_aCC - endif -endif - -CC := g++ -ARCH_LIBS := -lpthread -lquat -lm - -ifeq ($(HW_OS),pc_linux) - CC := g++ -endif - -ifeq ($(HW_OS),pc_linux_ia64) - CC := g++ -endif - -ifeq ($(HW_OS), pc_linux_arm) - CC := arm-linux-g++ - RANLIB := arm-linux-ranlib - AR := arm-linux-ar ruv -endif - -ifeq ($(HW_OS), pc_cygwin_arm) - CC := arm-unknown-linux-gnu-g++ - RANLIB := arm-unknown-linux-gnu-ranlib - AR := arm-unknown-linux-gnu-ar ruv -endif - -ifeq ($(HW_OS),pc_linux64) - CC := g++ -m64 -endif - -ifeq ($(HW_OS),sgi_irix) - ifndef SGI_ABI - SGI_ABI := n32 - endif - ifndef SGI_ARCH - SGI_ARCH := mips3 - endif - OBJECT_DIR_SUFFIX := .$(SGI_ABI).$(SGI_ARCH) - CC := CC -$(SGI_ABI) -$(SGI_ARCH) - GLUTLIBS := -lglut -lGLU -lGL -lXmu -lXext -lX11 -endif - -ifeq ($(HW_OS),hp700_hpux10) - CC := CC +a1 -endif -ifeq ($(HW_OS), hp_flow_aCC) - CC := /opt/aCC/bin/aCC -endif - -ifeq ($(HW_OS),sparc_solaris) - CC := /opt/SUNWspro/bin/CC - ARCH_LIBS := -lsocket -lnsl $(ARCH_LIBS) -endif - -ifeq ($(HW_OS),sparc_solaris_64) - CC := /opt/SUNWspro/bin/CC -xarch=v9a - AR := /opt/SUNWspro/bin/CC -xarch=v9a -xar -o - ARCH_LIBS := -lsocket -lnsl $(ARCH_LIBS) -endif - -ifeq ($(HW_OS),powerpc_aix) -# CC := /usr/ibmcxx/bin/xlC_r -g -qarch=pwr3 -w -+ - CC := /usr/ibmcxx/bin/xlC_r $(DEBUG_FLAGS) -qarch=pwr3 -w -+ -endif - -ifeq ($(HW_OS),pc_cygwin) - ARCH_LIBS := -lquat -lcygwin -luser32 -lgdi32 -lcomdlg32 -lwsock32 -endif - -#CFLAGS = -I../ -I../quat -g -override CFLAGS := -I../ -I../quat $(DEBUG_FLAGS) $(CFLAGS) -override CXXFLAGS := -I../ -I../quat $(DEBUG_FLAGS) $(CXXFLAGS) - -.SUFFIXES: .cpp - -.c.o: - $(CC) $(CFLAGS) -c $*.c - -.C.o: - $(CC) $(CXXFLAGS) -c $*.C - -.cpp.o: - $(CC) $(CXXFLAGS) -c $*.cpp - -OBJ_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX) -LIB_DIR := ../$(OBJ_DIR) - -#LFLAGS = -g -L$(LIB_DIR) -L../quat/$(HW_OS)$(OBJECT_DIR_SUFFIX) -override LFLAGS := -L$(LIB_DIR) -L../quat/$(HW_OS)$(OBJECT_DIR_SUFFIX) $(DEBUG_FLAGS) $(LDFLAGS) - -$(OBJ_DIR)/%.o: %.c - @[ -d $(OBJ_DIR) ] || mkdir -p $(OBJ_DIR) - $(CC) $(CFLAGS) -o $@ -c $< - -$(OBJ_DIR)/%.o: %.C - @[ -d $(OBJ_DIR) ] || mkdir -p $(OBJ_DIR) - $(CC) $(CXXFLAGS) -o $@ -c $< - -$(OBJ_DIR)/%.o: %.cpp - @[ -d $(OBJ_DIR) ] || mkdir -p $(OBJ_DIR) - $(CC) $(CXXFLAGS) -o $@ -c $< - -INSTALL_APPS := vrpn_print_devices forcedevice_test_client vrpn_ping \ - add_vrpn_cookie vrpn_print_performance vrpn_print_messages - -APPS := $(INSTALL_APPS) printvals printcereal checklogfile logfilesenders \ - logfiletypes text forwarderClient bdbox_client ff_client phan_client \ - sphere_client bdbox_client test_mutex test_imager c_interface_example - -all: $(APPS) - -.PHONY: vrpn_print_devices -vrpn_print_devices: $(OBJ_DIR)/vrpn_print_devices - -.PHONY: vrpn_print_messages -vrpn_print_messages: $(OBJ_DIR)/vrpn_print_messages - -.PHONY: vrpn_print_performance -vrpn_print_performance: $(OBJ_DIR)/vrpn_print_performance - -.PHONY: forcedevice_test_client -forcedevice_test_client: $(OBJ_DIR)/forcedevice_test_client - -.PHONY: printvals -printvals: $(OBJ_DIR)/printvals - -.PHONY: printcereal -printcereal: $(OBJ_DIR)/printcereal - -.PHONY: checklogfile -checklogfile: $(OBJ_DIR)/checklogfile - -.PHONY: bdbox_client -bdbox_client: $(OBJ_DIR)/bdbox_client - -.PHONY: ff_client -ff_client: $(OBJ_DIR)/ff_client - -.PHONY: phan_client -phan_client: $(OBJ_DIR)/phan_client - -.PHONY: sphere_client -sphere_client: $(OBJ_DIR)/sphere_client - -.PHONY: forwarderClient -forwarderClient: $(OBJ_DIR)/forwarderClient - -.PHONY: add_vrpn_cookie -add_vrpn_cookie: $(OBJ_DIR)/add_vrpn_cookie - -.PHONY: testSharedObject -testSharedObject: $(OBJ_DIR)/testSharedObject - -.PHONY: vrpn_ping -vrpn_ping: $(OBJ_DIR)/vrpn_ping - -.PHONY: testLamport -testLamport: $(OBJ_DIR)/testLamport - -.PHONY: test_mutex -test_mutex: $(OBJ_DIR)/test_mutex - -.PHONY: test_imager -test_imager: $(OBJ_DIR)/test_imager - -.PHONY: c_interface_example -c_interface_example: $(OBJ_DIR)/c_interface_example - -.PHONY: text -text: $(OBJ_DIR)/text - -$(OBJ_DIR)/sound_client: $(OBJ_DIR)/sound_client.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/sound_client \ - $(OBJ_DIR)/sound_client.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/vrpn_print_messages: $(OBJ_DIR)/vrpn_print_messages.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/vrpn_print_messages \ - $(OBJ_DIR)/vrpn_print_messages.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/printvals: $(OBJ_DIR)/printvals.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/printvals \ - $(OBJ_DIR)/printvals.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/vrpn_print_devices: $(OBJ_DIR)/vrpn_print_devices.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/vrpn_print_devices \ - $(OBJ_DIR)/vrpn_print_devices.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/vrpn_print_messages: $(OBJ_DIR)/vrpn_print_messages.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/vrpn_print_messages \ - $(OBJ_DIR)/vrpn_print_messages.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/vrpn_print_performance: $(OBJ_DIR)/vrpn_print_performance.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/vrpn_print_performance \ - $(OBJ_DIR)/vrpn_print_performance.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/printcereal: $(OBJ_DIR)/printcereal.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/printcereal \ - $(OBJ_DIR)/printcereal.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/bdbox_client: $(OBJ_DIR)/bdbox_client.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/bdbox_client \ - $(OBJ_DIR)/bdbox_client.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/ff_client: $(OBJ_DIR)/ff_client.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/ff_client \ - $(OBJ_DIR)/ff_client.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/forcedevice_test_client: $(OBJ_DIR)/forcedevice_test_client.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/forcedevice_test_client \ - $(OBJ_DIR)/forcedevice_test_client.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/phan_client: $(OBJ_DIR)/phan_client.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/phan_client \ - $(OBJ_DIR)/phan_client.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/sphere_client: $(OBJ_DIR)/sphere_client.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/sphere_client \ - $(OBJ_DIR)/sphere_client.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/listen_client: $(OBJ_DIR)/listen_client.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/listen_client \ - $(OBJ_DIR)/listen_client.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/text: $(OBJ_DIR)/text.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/text \ - $(OBJ_DIR)/text.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/forwarderClient: $(OBJ_DIR)/forwarderClient.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/forwarderClient \ - $(OBJ_DIR)/forwarderClient.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/checklogfile: $(OBJ_DIR)/checklogfile.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/checklogfile \ - $(OBJ_DIR)/checklogfile.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/add_vrpn_cookie: $(OBJ_DIR)/add_vrpn_cookie.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/add_vrpn_cookie \ - $(OBJ_DIR)/add_vrpn_cookie.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/testSharedObject: $(OBJ_DIR)/testSharedObject.o \ - $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/testSharedObject \ - $(OBJ_DIR)/testSharedObject.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/vrpn_ping: $(OBJ_DIR)/vrpn_ping.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/vrpn_ping \ - $(OBJ_DIR)/vrpn_ping.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/testLamport: $(OBJ_DIR)/vrpn_LamportClock.t.o \ - $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/testLamport \ - $(OBJ_DIR)/vrpn_LamportClock.t.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/test_mutex: $(OBJ_DIR)/test_mutex.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/test_mutex \ - $(OBJ_DIR)/test_mutex.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/test_imager: $(OBJ_DIR)/test_imager.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/test_imager \ - $(OBJ_DIR)/test_imager.o -lvrpn $(ARCH_LIBS) - -$(OBJ_DIR)/c_interface_example: $(OBJ_DIR)/c_interface_example.o $(OBJ_DIR)/c_interface.o $(LIB_DIR)/libvrpn.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/c_interface_example \ - $(OBJ_DIR)/c_interface_example.o $(OBJ_DIR)/c_interface.o -lvrpn $(ARCH_LIBS) - - -# These utilities actually DON'T use libvrpn - -$(OBJ_DIR)/logfilesenders: $(OBJ_DIR)/logfilesenders.o - $(CC) $(LFLAGS) -o $(OBJ_DIR)/logfilesenders \ - $(OBJ_DIR)/logfilesenders.o - -$(OBJ_DIR)/logfiletypes: $(OBJ_DIR)/logfiletypes.o - $(CC) $(LFLAGS) -o $(OBJ_DIR)/logfiletypes $(OBJ_DIR)/logfiletypes.o - -install: all - -mkdir -p $(BIN_DIR) - ( cd $(BIN_DIR) ; rm -f $(INSTALL_APPS) ) - ( cd $(OBJ_DIR) ; cp $(INSTALL_APPS) $(BIN_DIR) ) - ( cd $(BIN_DIR) ; strip $(INSTALL_APPS) ) - -uninstall: - ( cd $(BIN_DIR) ; rm -f $(INSTALL_APPS) ) - -clean: - rm -f $(OBJ_DIR)/* - -$(LIB_DIR)/libvrpn.a: - - diff --git a/src/vrpn/client_src/add_vrpn_cookie.C b/src/vrpn/client_src/add_vrpn_cookie.C deleted file mode 100644 index 15e39b4daac0f4d2805a9b1e3fa4d2a9cd063a9e..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/add_vrpn_cookie.C +++ /dev/null @@ -1,90 +0,0 @@ -#include <stdio.h> // for fprintf, fclose, fopen, etc -#include <stdlib.h> // for exit -#include <vrpn_Connection.h> // for vrpn_cookie_size, etc - -static const char DESC[] = "Reads a vrpn log; writes out the same log with a (current-version) " - "magic cookie in front."; - -// TODO: -// Smart checking of command-line arguments -// Check to see if there's already a magic cookie there. - -// ? Allow the user to specify cookie version inserted (non-current) - -void Usage (char * name) { - fprintf(stderr, "%s\n", DESC); - fprintf(stderr, "Usage: %s <input filename> <output filename>\n", - name); -} - -int main (int argc, char ** argv) { - - FILE * f_in; - FILE * f_out; - char magicbuf [733]; // HACK - char a; - char * in_name; - char * out_name; - int final_retval = 0; - int retval; - - // parse command line arguments - - if (argc != 3) { - Usage(argv[0]); - exit(0); - } - - in_name = argv[1]; - out_name = argv[2]; - - f_in = fopen(in_name, "rb"); - if (!f_in) { - fprintf(stderr, "Couldn't open input file %s.\n", in_name); - exit(0); - } - - // check to see if f_out exists - f_out = fopen(out_name, "rb"); - if (f_out) { - fprintf(stderr, "Output file \"%s\" already exists.\n", out_name); - fclose(f_in); - exit(0); - } - - f_out = fopen(out_name, "wb"); - if (!f_out) { - fprintf(stderr, "Couldn't open output file (%s).\n", out_name); - fclose(f_in); - exit(0); - } - - retval = write_vrpn_cookie(magicbuf, vrpn_cookie_size() + 1, - vrpn_LOG_NONE); - if (retval < 0) { - fprintf(stderr, "vrpn_Connection::close_log: " - "Couldn't create magic cookie.\n"); - goto CLEANUP; - } - - retval = static_cast<int>(fwrite(magicbuf, 1, vrpn_cookie_size(), f_out)); - if (retval != vrpn_cookie_size()) { - fprintf(stderr, "vrpn_Connection::close_log: " - "Couldn't write magic cookie to log file " - "(got %d, expected %d).\n", - retval, static_cast<int>(vrpn_cookie_size())); - goto CLEANUP; - } - - while (!final_retval && !feof(f_in)) { - a = fgetc(f_in); - fputc(a, f_out); - } - -CLEANUP: - - fclose(f_out); - fclose(f_in); - -} - diff --git a/src/vrpn/client_src/bdbox_client.C b/src/vrpn/client_src/bdbox_client.C deleted file mode 100644 index 046f84cee0e66976be1c3aba6cc9d5d986a1ee3c..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/bdbox_client.C +++ /dev/null @@ -1,101 +0,0 @@ -// test client for sgi button/dial box - -/* -button layout: - - 00 01 02 03 - 04 05 06 07 08 09 - 10 11 12 13 14 15 - 16 17 18 19 20 21 - 22 23 24 25 26 27 - 28 29 30 31 - -dial layout: - - 06 07 - 04 05 - 02 03 - 00 01 - -*/ - -#include <stdio.h> // for printf, NULL -#include <vrpn_Analog.h> // for vrpn_ANALOGCB, etc -#include <vrpn_Button.h> // for vrpn_BUTTONCB, etc - -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Types.h" // for vrpn_float64 -/* -// this is the one in the PIT area -#define BDBOX_SERVER "sgibox0@x-vrsh://152.2.128.163/~seeger/src/vrpn/server_src/sgi_irix/vrpn_server,-f,~seeger/src/config/sgibox.cfg,-q" -*/ - -#define BDBOX_SERVER "sgibox0@x-vrsh://nano//net/nano/nano1/bin/vrpn_server,-f,/net/nano/nano1/config/sgibdbox.cfg,-q,4501,>/dev/null" - -/***************************************************************************** - * - Callback handler - * - *****************************************************************************/ - - -void VRPN_CALLBACK handle_button_change(void *userdata, const vrpn_BUTTONCB b) -{ - static int count=0; - static int buttonstate = 1; - - if (b.state != buttonstate) { - printf("button #%d is in state %d\n", b.button, b.state); - buttonstate = b.state; - count++; - } - if (count > 20) { - *(int*)userdata = 1; - } -} - -void VRPN_CALLBACK handle_dial_change(void *userdata, const vrpn_ANALOGCB info) -{ - static double channel_values[vrpn_CHANNEL_MAX]; - static bool initialized = false; - - int i; - if (!initialized) { - for (i = 0; i < vrpn_CHANNEL_MAX; i++) { - channel_values[i] = 0.0; - } - initialized = true; - } - - for (i = 0; i < info.num_channel; i++){ - if (channel_values[i] != info.channel[i]) { - printf("dial #%d has value %f\n", i, (float)(info.channel[i])); - } - channel_values[i] = info.channel[i]; - } -} - -int main(int argc, char *argv[]) -{ - int done = 0; - vrpn_Analog_Remote *bd_dials; - vrpn_Button_Remote *bd_buttons; - - printf("Connecting to sgi button/dial box:\n" BDBOX_SERVER "\n"); - - // initialize the buttons - bd_buttons = new vrpn_Button_Remote(BDBOX_SERVER); - bd_buttons->register_change_handler(&done, handle_button_change); - - // initialize the dials - bd_dials = new vrpn_Analog_Remote(BDBOX_SERVER); - bd_dials->register_change_handler(NULL, handle_dial_change); - - - // main loop - while (!done ){ - bd_dials->mainloop(); - bd_buttons->mainloop(); - } - -} /* main */ diff --git a/src/vrpn/client_src/c_interface.cpp b/src/vrpn/client_src/c_interface.cpp deleted file mode 100644 index bf1b257664d5ec078375d5a54d91b57eb0648eaf..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/c_interface.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* Example of providing an interface to VRPN client-side objects through C. - * Initially made to handle the Tracker and Button objects, for the purpose - * of connecting to a Spaceball through Fortran. If you know how to link - * C and C++ code into Fortran, then you should be able to use it to link. - * (Note, you may need to add an underscore to the name of the C functions.) - * Also note, the implementation code is C++ code, but exposes its functions using - * a C interface. - */ - -#include <stddef.h> // for NULL -#include <vrpn_Button.h> // for vrpn_Button_Remote, etc -#include <vrpn_Tracker.h> // for vrpn_TRACKERCB, etc - -#include "c_interface.h" -#include "vrpn_Configure.h" // for VRPN_CALLBACK - -/* Helper function that receives the callback handler from the C++ Tracker - * remote, repackages the values, and calls the user callback function. */ -void VRPN_CALLBACK handle_tracker_pos_quat (void *userdata, const vrpn_TRACKERCB t) -{ - vrpn_c_tracker_callback_function f = (vrpn_c_tracker_callback_function)(userdata); - f(t.sensor, t.pos, t.quat); -}; - -/* Open a tracker device, returning an opaque pointer to it. Returns NULL on - * failure, an opaque pointer to the tracker device on success. The tracker - * pointer needs to be passed to the poll and close functions. */ -extern "C" void *vrpn_c_open_tracker(const char *device_name, vrpn_c_tracker_callback_function callback) -{ - vrpn_Tracker_Remote *tkr = new vrpn_Tracker_Remote(device_name); - if (tkr != NULL) { - /* Tell the callback handler what function to call. */ - tkr->register_change_handler((void*)callback, handle_tracker_pos_quat); - } - return tkr; -}; - -/* Poll the tracker whose device pointer is passed in. This will cause the - * callback handler to be called whenever a new value comes in for - * a sensor. Returns false if the device is not working. */ -extern "C" vrpn_c_bool vrpn_c_poll_tracker(void *device) -{ - if (device == NULL) { return false; } - vrpn_Tracker_Remote *tkr = (vrpn_Tracker_Remote *)device; - - tkr->mainloop(); - return true; -}; - - -/* Close the tracker whose device pointer is passed in. Returns true on success, - * false on failure. */ -extern "C" vrpn_c_bool vrpn_c_close_tracker(void *device) -{ - if (device == NULL) { return false; } - vrpn_Tracker_Remote *tkr = (vrpn_Tracker_Remote *)device; - - delete tkr; - return true; -}; - - -/* Helper function that receives the callback handler from the C++ Button - * remote, repackages the values, and calls the user callback function. */ -void VRPN_CALLBACK handle_button_event (void *userdata, const vrpn_BUTTONCB b) -{ - vrpn_c_button_callback_function f = (vrpn_c_button_callback_function)(userdata); - f(b.button, (b.state != 0)); -}; - -/* Open a button device, returning an opaque pointer to it. Returns NULL on - * failure, an opaque pointer to the button device on success. The button - * device pointer needs to be passed to the read and close functions. */ -extern "C" void *vrpn_c_open_button(const char *device_name, vrpn_c_button_callback_function callback) -{ - vrpn_Button_Remote *btn = new vrpn_Button_Remote(device_name); - if (btn != NULL) { - /* Tell the callback handler what function to call. */ - btn->register_change_handler((void*)callback, handle_button_event); - } - return btn; -}; - -/* Poll the button whose device pointer is passed in. This will cause the - * callback handler to be called whenever a new value comes in for - * a button. Returns false if the device is not working. */ -extern "C" vrpn_c_bool vrpn_c_poll_button(void *device) -{ - if (device == NULL) { return false; } - vrpn_Button_Remote *btn = (vrpn_Button_Remote *)device; - - btn->mainloop(); - return true; -}; - -/* Close the button whose device pointer is passed in. Returns true on success, - * false on failure. */ -extern "C" vrpn_c_bool vrpn_c_close_button(void *device) -{ - if (device == NULL) { return false; } - vrpn_Button_Remote *btn = (vrpn_Button_Remote *)device; - - delete btn; - return true; -}; - diff --git a/src/vrpn/client_src/c_interface.h b/src/vrpn/client_src/c_interface.h deleted file mode 100644 index 15219702d510b294b637c4bb65ca1d4f855fca7e..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/c_interface.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Example of providing an interface to VRPN client-side objects through C. - * Initially made to handle the Tracker and Button objects, for the purpose - * of connecting to a Spaceball through Fortran. If you know how to link - * C and C++ code into Fortran, then you should be able to use it to link. - * (Note, you may need to add an underscore to the name of the C functions.) - * Also note, the implementation code is C++ code, but exposes its functions using - * a C interface. - */ - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef char vrpn_c_bool; - -/* Function prototype for the function that will be called whenever a tracker - * report comes in. */ -typedef void (*vrpn_c_tracker_callback_function)(unsigned sensor, const double pos[3], const double quat[4]); - -/* Open a tracker device, returning an opaque pointer to it. Returns NULL on - * failure, an opaque pointer to the tracker device on success. The tracker - * pointer needs to be passed to the poll and close functions. */ -void *vrpn_c_open_tracker(const char *device_name, vrpn_c_tracker_callback_function callback); - -/* Poll the tracker whose device pointer is passed in. This will cause the - * callback handler to be called whenever a new value comes in for - * a sensor. Returns false if the device is not working. */ -vrpn_c_bool vrpn_c_poll_tracker(void *device); - -/* Close the tracker whose device pointer is passed in. Returns true on success, - * false on failure. */ -vrpn_c_bool vrpn_c_close_tracker(void *device); - - -/* Function prototype for the function that will be called whenever a button - * report comes in. */ -typedef void (*vrpn_c_button_callback_function)(const unsigned button, const vrpn_c_bool value); - -/* Open a button device, returning an opaque pointer to it. Returns NULL on - * failure, an opaque pointer to the button device on success. The button - * device pointer needs to be passed to the read and close functions. */ -void *vrpn_c_open_button(const char *device_name, vrpn_c_button_callback_function callback); - -/* Poll the button whose device pointer is passed in. This will cause the - * callback handler to be called whenever a new value comes in for - * a button. Returns false if the device is not working. */ -vrpn_c_bool vrpn_c_poll_button(void *device); - -/* Close the button whose device pointer is passed in. Returns true on success, - * false on failure. */ -vrpn_c_bool vrpn_c_close_button(void *device); - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif diff --git a/src/vrpn/client_src/c_interface_example.c b/src/vrpn/client_src/c_interface_example.c deleted file mode 100644 index dcaab6a96f9d71d8a2989e0e0a28cd3c50c2eb4e..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/c_interface_example.c +++ /dev/null @@ -1,32 +0,0 @@ -#include <stdio.h> // for printf -#include "c_interface.h" - -void tracker_callback(unsigned sensor, const double pos[3], const double quat[4]) -{ - printf("Tracker sensor %d at (%lf,%lf,%lf) with orientation (%lf,%lf,%lf,%lf)\n", - sensor, pos[0], pos[1], pos[2], quat[0], quat[1], quat[2], quat[3]); -} - -void button_callback(unsigned button, vrpn_c_bool value) -{ - const char *state = (value?"pressed":"released"); - printf("Button %d %s\n", button, state); -} - -int main() -{ - void *tkr; - void *btn; - const char *device_name = "Spaceball0@localhost"; - printf("This is just a simple dummy application to show how you could access VRPN from straight C with a C-style interface.\n"); - printf("It will try to connect to a local tracker and button device %s\n", device_name); - tkr = vrpn_c_open_tracker(device_name, tracker_callback); - btn = vrpn_c_open_button(device_name, button_callback); - - while (1) { - vrpn_c_poll_tracker(tkr); - vrpn_c_poll_button(btn); - } - return 0; -} - diff --git a/src/vrpn/client_src/checklogfile.C b/src/vrpn/client_src/checklogfile.C deleted file mode 100644 index 5a3f0f18f847515571ff1b0da1cb900117d17f2a..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/checklogfile.C +++ /dev/null @@ -1,153 +0,0 @@ -#include <fcntl.h> // for open, O_RDONLY -#include <stdio.h> // for printf, fprintf, stderr -#include <stdlib.h> // for exit -#include <string.h> // for strcmp -#ifndef _WIN32 -#include <netinet/in.h> // for ntohl -#include <unistd.h> // for close, read -#else - #include <io.h> -#endif - -#include <vrpn_Connection.h> // for vrpn_HANDLERPARAM, etc - -#include "vrpn_Shared.h" // for timeval, vrpn_TimevalMsecs - - -const int buflen = 8000; - -void Usage (const char * name) { - fprintf(stderr, "Usage: %s [-n|-s] <filename>\n", name); - fprintf(stderr," -n: Print names instead of numbers.\n"); - fprintf(stderr," -s: Summary only, start/end/duration\n"); -} - - -int main (int argc, char ** argv) { - - char * filename; - int name_mode = 0, summary_mode = 0; - - char buffer [buflen]; - vrpn_HANDLERPARAM header; - int file; - int retval; - - if (argc < 2) { - Usage(argv[0]); - exit(0); - } - - filename = argv[1]; - if (!strcmp(argv[1], "-n")) { - filename = argv[2]; - name_mode = 1; - fprintf(stderr, "FATAL ERROR: Name mode not implemented.\n"); - exit(0); - } else if (!strcmp(argv[1], "-s")) { - filename = argv[2]; - summary_mode = 1; - } - - #ifdef _WIN32 - // blech - const int oflag = O_RDONLY | O_BINARY; - #else - const int oflag = O_RDONLY; - #endif - file = open(filename, oflag); - if (file == -1) { - fprintf(stderr, "Couldn't open \"%s\".\n", filename); - exit(0); - } - - struct timeval tvFirst, time; - int cEntries = 0; - - while (1) { - int len; - long sender; - long type; - int len2; - - retval = read(file, &header, sizeof(header)); - if (retval < 0) { printf("ERROR\n"); close(file); exit(0); } - if (!retval) { - if (summary_mode) { - printf("Last timestamp in file: %ld:%ld\n", time.tv_sec, static_cast<long>(time.tv_usec)); - timeval tvDuration = vrpn_TimevalDiff(time, tvFirst); - double dDuration = vrpn_TimevalMsecs(tvDuration) / 1000.0; - printf("Duration: %ld:%ld\n", tvDuration.tv_sec, static_cast<long>(tvDuration.tv_usec)); - printf("%d enties over %gs = %.3fHz\n", - cEntries, dDuration, cEntries/dDuration); - } else { - printf("EOF\n"); - } - close(file); - break; - } - cEntries++; - - len = ntohl(header.payload_len); - time.tv_sec = ntohl(header.msg_time.tv_sec); - time.tv_usec = ntohl(header.msg_time.tv_usec); - sender = ntohl(header.sender); - type = ntohl(header.type); - - if (summary_mode) { - static int first = 1; - if (first) { - printf("First timestamp in file: %ld:%ld\n", time.tv_sec, static_cast<long>(time.tv_usec)); - tvFirst = time; - first = 0; - } - } - - if (!summary_mode) { - if (name_mode) - printf("%ld from %ld, payload length %d\n", - type, sender, len); - else - printf("Message type %ld, sender %ld, payload length %d\n", - type, sender, len); - } - - retval = read(file, buffer, len); - if (retval < 0) { printf("ERROR\n"); close(file); exit(0); } - if (!retval) { printf("EOF\n"); close(file); exit(0); } - - if (summary_mode) { - continue; - } - - printf(" <%d bytes> at %ld:%ld\n", retval, time.tv_sec, static_cast<long>(time.tv_usec)); - - switch (type) { - - case vrpn_CONNECTION_SENDER_DESCRIPTION: - len2 = ntohl(* ((int *) buffer)); - buffer[len2 + sizeof(int)] = 0; - printf(" The name of sender #%ld is \"%s\".\n", sender, buffer + sizeof(int)); - break; - - case vrpn_CONNECTION_TYPE_DESCRIPTION: - len2 = ntohl(* ((int *) buffer)); - buffer[len2 + sizeof(int)] = 0; - printf(" The name of type #%ld is \"%s\".\n", sender, buffer + sizeof(int)); - break; - - case vrpn_CONNECTION_UDP_DESCRIPTION: - buffer[len] = 0; - printf(" UDP host is \"%s\", port %ld.\n", buffer, sender); - break; - - case vrpn_CONNECTION_LOG_DESCRIPTION: - buffer[len] = 0; - printf(" Log to file \"%s\".\n", buffer); - break; - } - } - - return 0; -} - diff --git a/src/vrpn/client_src/clock_drift_estimator.C b/src/vrpn/client_src/clock_drift_estimator.C deleted file mode 100644 index c259d3f8b4101f23709a92aaacb10eef8225fb7e..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/clock_drift_estimator.C +++ /dev/null @@ -1,278 +0,0 @@ -/* clock_drift_estimator.C - - This is a VRPN client program that will connect to a VRPN - server device use the built-in ping/poing messages from the - vrpn_BaseClass to estimate both the round-trip time for - VRPN messages and the clock drift between the client machine - and the server machine. -*/ - -#include <math.h> // for floor -#include <stdio.h> // for NULL, printf, fprintf, etc -#include <stdlib.h> // for exit -#include <vrpn_Shared.h> // for vrpn_gettimeofday, timeval, vrpn_TimevalSum, etc -#ifndef _WIN32_WCE -#include <signal.h> // for signal, SIGINT -#endif -#include <string.h> // for strcmp -#include <vrpn_BaseClass.h> // for vrpn_BaseClass -#include <vrpn_Connection.h> // for vrpn_Connection, etc -#include <vrpn_Tracker.h> // for vrpn_Tracker_NULL - -#include "vrpn_Configure.h" // for VRPN_CALLBACK - -int done = 0; // Signals that the program should exit - -//------------------------------------- -// This object is used to connect to whatever server object is -// specified. The server object can be anything, a tracker, a button, -// an analog, etc. It just needs to be derived from vrpn_BaseClass -// so that it implements the ping/pong messages. -// XXX Later, make an interface to this so that it can be more generally -// useful as an estimator and move the printing up to the application. - -class vrpn_Clock_Drift_Estimator : public vrpn_BaseClass { -public: - // The constructor adds another entry for the Pong message handler, - // so that we can use these responses to estimate. - vrpn_Clock_Drift_Estimator(const char * name, double min_repeat_wait_secs = 0, double estimation_interval_secs = 10, vrpn_Connection * c = NULL) : - vrpn_BaseClass(name, c), - d_doing_estimate(false), - d_doing_ping(false), - d_count(0) - { - vrpn_BaseClass::init(); - - if (d_connection != NULL) { - // Put in an additional handler for the pong message so that we can - // tell when we get a response. - register_autodeleted_handler(d_pong_message_id, handle_pong, this, d_sender_id); - - // Initialize the member variables used in estimating the time. - // We want the estimation interval to start two seconds into the - // future to give things time to settle in and get connected. - vrpn_gettimeofday(&d_next_interval_time, NULL); - d_next_interval_time.tv_sec += 2; - d_next_ping_time = d_next_interval_time; - - // Initialize the estimation interval and minimum waits used to - // tell when to do things. - if ( (min_repeat_wait_secs < 0) || (estimation_interval_secs <= 0) || (min_repeat_wait_secs > estimation_interval_secs) ) { - fprintf(stderr,"vrpn_Clock_Drift_Estimator::vrpn_Clock_Drift_Estimator(): Invalid time parameters (using 0, 10)\n"); - min_repeat_wait_secs = 0; - estimation_interval_secs = 10; - } - d_min_repeat_wait.tv_sec = static_cast<long>(floor(min_repeat_wait_secs)); - d_min_repeat_wait.tv_usec = static_cast<long>(floor( (min_repeat_wait_secs - d_min_repeat_wait.tv_sec) * 1e6)); - d_estimation_interval.tv_sec = static_cast<long>(floor(estimation_interval_secs)); - d_estimation_interval.tv_usec = static_cast<long>(floor( (min_repeat_wait_secs - d_estimation_interval.tv_sec) * 1e6)); - - d_last_ping_time.tv_sec = d_last_ping_time.tv_usec = 0; - } - }; - - ~vrpn_Clock_Drift_Estimator() { return; }; - - /// Mainloop the connection to send the message. - void mainloop(void) { - client_mainloop(); - if (d_connection) { - // Send any pings, collect any pongs. - d_connection->mainloop(); - - // See if it is time for the next interval to start. Start it if so. - struct timeval now; - vrpn_gettimeofday(&now, NULL); - if (vrpn_TimevalGreater(now, d_next_interval_time) || vrpn_TimevalEqual(now, d_next_interval_time)) { - - // If we were doing an estimate, print the results. - if (d_doing_estimate) { - if (d_count == 0) { - fprintf(stderr,"vrpn_Clock_Drift_Estimator::mainloop(): Zero count in ping response!\n"); - } else { - printf("vrpn_Clock_Drift_Estimator::mainloop(): Clock statistics for %d responses:\n", d_count); - printf(" Round-trip time: mean = %lg, min = %lg, max = %lg\n", d_sum_rtt/d_count, d_min_rtt, d_max_rtt); - printf(" Remote clock offset: mean = %lg, min = %lg, max = %lg\n", d_sum_skew/d_count, d_min_skew, d_max_skew); - } - } - - // Set up for the next estimate interval. - d_doing_estimate = true; - d_next_interval_time = vrpn_TimevalSum(now, d_estimation_interval); - d_next_ping_time = now; - d_count = 0; - d_sum_rtt = 0; - d_sum_skew = 0; - } - - // See if it is time to send the next ping. Send it if so. - if (vrpn_TimevalGreater(now, d_next_ping_time) | vrpn_TimevalEqual(now, d_next_ping_time)) { - vrpn_gettimeofday(&now, NULL); - //printf("XXX ping\n"); - d_connection->pack_message(0, now, d_ping_message_id, d_sender_id, - NULL, vrpn_CONNECTION_RELIABLE); - d_last_ping_time = now; - - // Tells the pong callback to listen to the response. - d_doing_ping = true; - - // Don't do another until we hear a response. - d_next_ping_time = now; - d_next_ping_time.tv_sec += 10000; - } - - // Send any pings, collect any pongs. - d_connection->mainloop(); - } - }; - -protected: - // The interval over which to test before printing results, - // and the minimum time to wait between sending pings - struct timeval d_estimation_interval; - struct timeval d_min_repeat_wait; - - // When we're going to next try a ping and when the next estimation interval starts - struct timeval d_next_ping_time; - struct timeval d_next_interval_time; - - // When we last sent a ping. - struct timeval d_last_ping_time; - - // Have we started doing an estimate or a ping? - bool d_doing_estimate; - bool d_doing_ping; - - // Ping statistics - double d_min_rtt; // Round-trip time - double d_max_rtt; - double d_sum_rtt; - double d_min_skew; // Skew is from remote time to local time - double d_max_skew; - double d_sum_skew; - unsigned d_count; - - /// No types to register beyond the ping/pong, which are done in BaseClass. - virtual int register_types(void) { return 0; }; - - // Report the elapsed time in seconds between the first and second time, where - // the first time is sooner. It will return a negative number if the first - // is later than the second. - static double elapsed_secs(const struct timeval &t1, const struct timeval &t2) - { - return 1e-3 * vrpn_TimevalMsecs( vrpn_TimevalDiff(t2,t1) ); - }; - - static int VRPN_CALLBACK handle_pong(void *userdata, vrpn_HANDLERPARAM p) - { - //printf("XXX PONG\n"); - vrpn_Clock_Drift_Estimator *me = static_cast<vrpn_Clock_Drift_Estimator *>(userdata); - - // If we're currently estimating, then update the statistics based on - // the time of the response and the time we asked for a response. - if (me->d_doing_ping) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - - // Find the round trip was by subtracting the time the last - // ping was sent from the current time. - double rtt = elapsed_secs(me->d_last_ping_time, now); - - // Estimate the clock skew by assuming that the response was generated - // halfway between the sending time and now. We want to compute - // the number to add to the remote clock value to produce a time in - // the local clock value. - struct timeval interval = vrpn_TimevalDiff(now, me->d_last_ping_time); - struct timeval half_interval = vrpn_TimevalScale(interval, 0.5); - struct timeval expected = vrpn_TimevalSum(me->d_last_ping_time, half_interval); - double remote_to_local = elapsed_secs(p.msg_time, expected); - - // If this is the first return, set the min and max values to the values - if (me->d_count == 0) { - me->d_min_rtt = me->d_max_rtt = rtt; - me->d_min_skew = me->d_max_skew = remote_to_local; - } - - // Add these into the ongoing statistics and increment the count of - // samples. - me->d_sum_rtt += rtt; - if (rtt < me->d_min_rtt) { me->d_min_rtt = rtt; } - if (rtt > me->d_max_rtt) { me->d_max_rtt = rtt; } - me->d_sum_skew += remote_to_local; - if (remote_to_local < me->d_min_skew) { me->d_min_skew = remote_to_local; } - if (remote_to_local > me->d_max_skew) { me->d_max_skew = remote_to_local; } - me->d_count++; - - // Set the time for the next ping. Mark us down as not doing an - // estimate, so we'll ignore misaligned pong responses. - me->d_next_ping_time = vrpn_TimevalSum(now, me->d_min_repeat_wait); - me->d_doing_ping = false; - } - - return 0; - }; -}; - -static vrpn_Clock_Drift_Estimator *g_clock = NULL; -static vrpn_Connection *g_connection = NULL; -static vrpn_Tracker_NULL *g_tracker = NULL; - -// WARNING: On Windows systems, this handler is called in a separate -// thread from the main program (this differs from Unix). To avoid all -// sorts of chaos as the main program continues to handle packets, we -// set a done flag here and let the main program shut down in its own -// thread by calling shutdown() to do all of the stuff we used to do in -// this handler. - -void handle_cntl_c(int) { - done = 1; -} - -void Usage (const char * arg0) { - fprintf(stderr, -"Usage: %s server_to_use | LOCAL\n" -" server_to_use: VRPN name of device to connect to (eg: Tracker0@ioglab)\n" -" 'LOCAL' means to launch a local server on a dedicated connection\n", - arg0); - - exit(0); -} - -int main (int argc, char * argv []) -{ - if (argc != 2) { - Usage(argv[0]); - } else { - if (strcmp(argv[1], "LOCAL") == 0) { - printf("Opening local server on dedicated connection\n"); - g_connection = vrpn_create_server_connection(); - g_tracker = new vrpn_Tracker_NULL("Tracker0", g_connection); - g_clock = new vrpn_Clock_Drift_Estimator("Tracker0@localhost", 0.01, 5); - } else { - printf("Connecting to server %s\n", argv[1]); - g_clock = new vrpn_Clock_Drift_Estimator(argv[1], 0.01, 5); - } - } - -#ifndef _WIN32_WCE - // signal handler so logfiles get closed right - signal(SIGINT, handle_cntl_c); -#endif - -/* - * main interactive loop - */ - printf("Press ^C to exit.\n"); - while ( ! done ) { - g_clock->mainloop(); - if (g_tracker) { g_tracker->mainloop(); } - if (g_connection) { g_connection->mainloop(); } - } - - if (g_clock) { delete g_clock; g_clock = NULL; } - if (g_tracker) { delete g_tracker; g_tracker = NULL; } - if (g_connection) { delete g_connection; g_connection = NULL; } - return 0; -} /* main */ - - diff --git a/src/vrpn/client_src/clock_drift_estimator.dsp b/src/vrpn/client_src/clock_drift_estimator.dsp deleted file mode 100644 index 53a6df956f611223ecba9bfee4a7d1b6336aa55d..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/clock_drift_estimator.dsp +++ /dev/null @@ -1,100 +0,0 @@ -# Microsoft Developer Studio Project File - Name="clock_drift_estimator" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=clock_drift_estimator - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "clock_drift_estimator.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "clock_drift_estimator.mak" CFG="clock_drift_estimator - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "clock_drift_estimator - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "clock_drift_estimator - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "clock_drift_estimator - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/client_src/clock_drift_estimatorRelease" -# PROP Intermediate_Dir "../pc_win32/client_src/clock_drift_estimatorRelease" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "clock_drift_estimator - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/client_src/clock_drift_estimatorDebug" -# PROP Intermediate_Dir "../pc_win32/client_src/clock_drift_estimator/Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "clock_drift_estimator - Win32 Release" -# Name "clock_drift_estimator - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\clock_drift_estimator.C -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/client_src/clock_drift_estimator.vcproj b/src/vrpn/client_src/clock_drift_estimator.vcproj deleted file mode 100644 index eb06c09e2ae798a752d5466a6e14752cd559c266..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/clock_drift_estimator.vcproj +++ /dev/null @@ -1,244 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="clock_drift_estimator" - ProjectGUID="{9B18AC3E-2CA6-425A-9049-228821F3D081}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/client_src/clock_drift_estimatorDebug" - IntermediateDirectory=".\../pc_win32/client_src/clock_drift_estimator/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/clock_drift_estimatorDebug/clock_drift_estimator.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include";.." - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/client_src/clock_drift_estimator/Debug/clock_drift_estimator.pch" - AssemblerListingLocation=".\../pc_win32/client_src/clock_drift_estimator/Debug/" - ObjectFile=".\../pc_win32/client_src/clock_drift_estimator/Debug/" - ProgramDataBaseFileName=".\../pc_win32/client_src/clock_drift_estimator/Debug/" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/client_src/clock_drift_estimatorDebug/clock_drift_estimator.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/client_src/clock_drift_estimatorDebug/clock_drift_estimator.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/clock_drift_estimatorDebug/clock_drift_estimator.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/client_src/clock_drift_estimatorRelease" - IntermediateDirectory=".\../pc_win32/client_src/clock_drift_estimatorRelease" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/clock_drift_estimatorRelease/clock_drift_estimator.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include";.." - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/client_src/clock_drift_estimatorRelease/clock_drift_estimator.pch" - AssemblerListingLocation=".\../pc_win32/client_src/clock_drift_estimatorRelease/" - ObjectFile=".\../pc_win32/client_src/clock_drift_estimatorRelease/" - ProgramDataBaseFileName=".\../pc_win32/client_src/clock_drift_estimatorRelease/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/client_src/clock_drift_estimatorRelease/clock_drift_estimator.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/client_src/clock_drift_estimatorRelease/clock_drift_estimator.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/clock_drift_estimatorRelease/clock_drift_estimator.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="clock_drift_estimator.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/client_src/directx_sound_client/directx_sound_client.cpp b/src/vrpn/client_src/directx_sound_client/directx_sound_client.cpp deleted file mode 100644 index 471eac2256da21cd1d99bb819b484fd4436123b1..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/directx_sound_client/directx_sound_client.cpp +++ /dev/null @@ -1,412 +0,0 @@ -#include "vrpn_Sound.h" -#include <string.h> -#include <math.h> -#include <conio.h> -#include <cstdlib> - -#define FASTSPEED 500 -#define CIRCLERADIUS 5.0F - - -vrpn_Sound_Client *soundClient; -float X,Y,Z,adj; -int numconnections; -int numSounds = 0; -vrpn_Connection connection; - -void MoveListener() -{ - vrpn_float64 pos[3], ori[4]; - char kbchar; - - ori[0]=0; - ori[1]=0; - ori[2]=1; - ori[3]=1; - - pos[0]=0; - pos[1]=0; - pos[2]=0; - - printf(" Move Listener\n"); - printf("*******************************\n"); - printf(" I\n"); - printf(" J K\n"); - printf(" M\n"); - printf("*******************************\n"); - printf(" hit Q to return to main menu\n"); - - while(!(_kbhit() && ((_getch()=='q') || (_getch()=='Q')))){ - - kbchar = _getch(); - - if((kbchar=='i') || (kbchar=='I')){ - - pos[1] += .1; - (void)soundClient->setListenerPose(pos,ori); - soundClient->mainloop(); - connection.mainloop(); - } - - if((kbchar=='j') || (kbchar=='J')){ - - pos[0] -= .1; - (void)soundClient->setListenerPose(pos,ori); - soundClient->mainloop(); - connection.mainloop(); - } - - if((kbchar=='k') || (kbchar=='K')){ - - pos[0] += .1; - (void)soundClient->setListenerPose(pos,ori); - soundClient->mainloop(); - connection.mainloop(); - } - - if((kbchar=='m') || (kbchar=='M')){ - - pos[1] -= .1; - (void)soundClient->setListenerPose(pos,ori); - soundClient->mainloop(); - connection.mainloop(); - } - - if((kbchar=='q') || (kbchar=='Q')){ - break; - } - - kbchar = ' '; - } -} - - -static void init_sample_values() -{ - Y=Z=0.0F; - X=5.0F; - adj=0.0F; -} - - -static void move_sample_values() -{ - // handle the circle movement - adj+=(2.0F*3.14159265358979F/(((FASTSPEED+1-50.0F)*1.6F)+20.0F)); - X=(float)(CIRCLERADIUS*cos(adj)); - Y=(float)(CIRCLERADIUS*sin(adj)); -} - - -void loopSound(vrpn_SoundID id) -{ - float sA = 0; - vrpn_float64 position[3], orientation[4]; - - while(1) - { - - //save old settings - position[0] = X; position[1] = Y; position[2] = Z; - orientation[0] = -X; orientation[1] = -Y; orientation[2] = Z; orientation[3] = 1; - (void)soundClient->setSoundPose(id,position, orientation); - - printf(" %f %f %f \r",position[0], position[1], position[2]); - - // move the sample values - move_sample_values(); - - /* - - // calculate the delta vector - velocity[0]=X-sX; - velocity[1]=0; - velocity[2]=Z-sZ; - velocity[3]=((50.0F/300.0F)+1.0F)/1500.0F; - - // restore the values to original - //X=sX; - //Z=sZ; - //adj=sA; - */ - // (void)soundClient->setSoundVelocity(id,velocity); - soundClient->mainloop(); - if (X == 25.0F) - break; - vrpn_SleepMsecs(1); - } -} - -void shutdown(){ - - printf("\nSound Client shutting down.\n"); - soundClient = NULL; -} - -int getOnlyDigits(){ - - char temp[80]; - int id; - fgets(temp, sizeof(temp)-1, stdin); - for(int x=0; x<80; x++) - if(isalpha(temp[x])) return -1; - id=strtol(temp,0,10); - return id; -} - - - - - -int main(int argc, char** argv) -{ - char dummy[80]; - vrpn_SoundID ids[100], id; - char files[100][80]; - int curID = 0; - int command; - int loop = 1, i; - vrpn_int32 repeat, volume; - vrpn_float64 position[3], orientation[4], velocity[4]; - vrpn_float64 pos[3], ori[4], Lvelocity[4]; - numconnections = 0; - int flag = 0; - - position[0] = 0; position[1] = 0; position[2] = 0; - orientation[0] = 0; orientation[1] = 0; orientation[2] = -1; orientation[3] = 1; - velocity[0] = 0; velocity[1] = 0; velocity[2] = 0; velocity[3] = 0; - - pos[0] = 0; - pos[1] = 0; - pos[2] = 0; - ori[0] = 0; - ori[1] = 0; - ori[2] = 0; - ori[3] = 1; -/* - printf("Please enter the server you wish to connect to.\n"); - scanf("%s", server); - printf("Please enter the sound device name you wish to connect to.\n"); - scanf("%s", device); -*/ - vrpn_Connection connection("localhost"); - soundClient = new vrpn_Sound_Client("sound", &connection); - - for(i = 0; i < 100; i++) - ids[i] = -1; - - - /******************************************* - * - * Client mainloop - * - *******************************************/ - while(loop) - { - vrpn_SleepMsecs(1); - - soundClient->mainloop(); - connection.mainloop(); - - if (numconnections==0 && connection.connected()) - numconnections++; - - if (((numconnections!=0) && (!connection.connected())) || !connection.doing_okay()) { - shutdown(); - numconnections=0; - break; - } - - printf("\nCurrent sounds loaded***************\n"); - for(i = 0; i < numSounds; i++) - printf("Sound# %d: %s\n", ids[i], files[i]); - printf("************************************\n"); - - printf("\nOptions\n"); - printf("1) Load Sound\n"); - printf("2) Unload Sound\n"); - printf("3) Play Sound\n"); - printf("4) Stop Sound\n"); - printf("5) Change Sound Volume\n"); - printf("6) Change Sound Position\n"); - printf("7) Change Sound Orientation\n"); - printf("8) Change Sound Velocity\n"); - printf("9) Change Listener Position\n"); - printf("10) Change Listener Orientation\n"); - printf("11) Change Listener Velocity\n"); - printf("12) Loop sound around head\n"); - printf("13) Move Listener\n"); - printf("14) Quit\n"); - printf("Choose option "); - - - do{ - command = getOnlyDigits(); - }while(command == -1); - - - - switch(command) - { - case 1: - printf("Enter path and file to load\n"); - scanf("%s", dummy); - vrpn_SoundDef SoundDef; - - // 1 meter in front of listener - SoundDef.pose.position[0] = 0; - SoundDef.pose.position[1] = 0; - SoundDef.pose.position[2] = 0; - - // Looking back at listener - SoundDef.pose.orientation[0] = 0; - SoundDef.pose.orientation[1] = 0; - SoundDef.pose.orientation[2] = 0; - SoundDef.pose.orientation[3] = 1; - - // DirectX default for both is 360 - SoundDef.cone_inner_angle = 360; - SoundDef.cone_outer_angle = 360; - - // No attenuation - SoundDef.cone_gain = -60; - - SoundDef.min_front_dist = .1; - SoundDef.max_front_dist = 50; - - SoundDef.velocity[0] = 0; - SoundDef.velocity[1] = 0; - SoundDef.velocity[2] = 0; - - ids[curID] = soundClient->loadSound(dummy, curID, SoundDef); - strcpy(files[curID++], dummy); - numSounds++; - soundClient->mainloop(); - break; - case 2: - do{ - printf("Enter id of sound to unload:"); - id = getOnlyDigits(); - }while(id == -1); - - - (void)soundClient->unloadSound(id); - for(i = id; i < numSounds; i++){ - strcpy(files[i], files[i+1]); - } - numSounds--; - curID--; - soundClient->mainloop(); - break; - case 3: - do{ - printf("Enter id of sound to play:"); - id = getOnlyDigits(); - }while(id == -1); - - do{ - printf("Enter number of times to repeat. (0 = continuous) "); - repeat = getOnlyDigits(); - }while(repeat == -1); - - (void)soundClient->playSound(id, repeat); - soundClient->mainloop(); - break; - case 4: - do{ - printf("Enter ID of sound to stop "); - id = getOnlyDigits(); - }while(id == -1); - - (void)soundClient->stopSound(id); - soundClient->mainloop(); - break; - case 5: - do{ - printf("Enter ID of sound to change "); - id = getOnlyDigits(); - }while(id == -1); - - do{ - printf("Enter value to change volume to "); - volume = getOnlyDigits(); - }while(volume == -1); - - (void)soundClient->setSoundVolume(id, volume); - soundClient->mainloop(); - break; - case 6: - do{ - printf("Enter ID of sound to change "); - id = getOnlyDigits(); - }while(id == -1); - - printf("Enter the new X,Y, and Z position coordinates for the sound\n"); - scanf("%lf %lf %lf", &position[0], &position[1], &position[2]); - (void)soundClient->setSoundPose(id, position, orientation); - soundClient->mainloop(); - break; - case 7: - do{ - printf("Enter ID of sound to change "); - id = getOnlyDigits(); - }while(id == -1); - - printf("Enter the new X,Y, Z, and W orientation coordinates for the sound\n"); - scanf("%lf %lf %lf %lf", &orientation[0], &orientation[1], &orientation[2], &orientation[3]); - (void)soundClient->setSoundPose(id, position, orientation); - soundClient->mainloop(); - break; - case 8: - do{ - printf("Enter ID of sound to change "); - id = getOnlyDigits(); - }while(id == -1); - - printf("Enter the new X,Y, and Z velocity coordinates for the sound and magnitude\n"); - scanf("%lf %lf %lf %lf", &velocity[0], &velocity[1], &velocity[2], &velocity[3]); - (void)soundClient->setSoundVelocity(id,velocity); - soundClient->mainloop(); - break; - case 9: - printf("Enter the new X,Y, and Z position coordinates for the listener\n"); - scanf("%lf %lf %lf", &pos[0], &pos[1], &pos[2]); - (void)soundClient->setListenerPose(pos,ori); - soundClient->mainloop(); - break; - case 10: - printf("Enter the new orientation quaternion for the listener\n"); - scanf("%lf %lf %lf %lf", &ori[0], &ori[1], &ori[2], &ori[3]); - - (void)soundClient->setListenerPose(pos, ori); - soundClient->mainloop(); - break; - case 11: - printf("Enter the new X,Y, and Z velocity coordinates for the listener and magnitude\n"); - scanf("%lf %lf %lf %lf", &Lvelocity[0], &Lvelocity[1], &Lvelocity[2], &Lvelocity[3]); - (void)soundClient->setListenerVelocity(Lvelocity); - soundClient->mainloop(); - break; - case 12: - do{ - printf("Enter ID of sound to loop"); - id = getOnlyDigits(); - }while(id == -1); - - init_sample_values(); - loopSound(id); - break; - case 13: - MoveListener(); - break; - case 14: - loop = 0; - shutdown(); - break; - default: - break; - } - } - - return 0; -} diff --git a/src/vrpn/client_src/directx_sound_client/directx_sound_client.dsp b/src/vrpn/client_src/directx_sound_client/directx_sound_client.dsp deleted file mode 100644 index 7e04d508852204683f043d03d484d1b34d6b19cc..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/directx_sound_client/directx_sound_client.dsp +++ /dev/null @@ -1,101 +0,0 @@ -# Microsoft Developer Studio Project File - Name="directx_sound_client" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=directx_sound_client - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "directx_sound_client.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "directx_sound_client.mak" CFG="directx_sound_client - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "directx_sound_client - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "directx_sound_client - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "directx_sound_client - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "directx_sound_client - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib vrpn.lib quat.lib winmm.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "directx_sound_client - Win32 Release" -# Name "directx_sound_client - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\directx_sound_client.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/client_src/directx_sound_client/directx_sound_client.dsw b/src/vrpn/client_src/directx_sound_client/directx_sound_client.dsw deleted file mode 100644 index 00a48e1be1468825c50d857e7703b674b30d3c0b..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/directx_sound_client/directx_sound_client.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "directx_sound_client"=.\directx_sound_client.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/vrpn/client_src/ff_client.C b/src/vrpn/client_src/ff_client.C deleted file mode 100644 index be8c632fece49d88ddd5a50d213c040a7f187c5f..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/ff_client.C +++ /dev/null @@ -1,127 +0,0 @@ -// -// ff_client.C - generates an interesting sinusoidal force field -// - -#include <math.h> // for M_PI, cos, sin -#include <stdio.h> // for printf, NULL -#include <vrpn_Button.h> // for vrpn_BUTTONCB, etc -#include <vrpn_ForceDevice.h> // for vrpn_ForceDevice_Remote, etc -#include <vrpn_Tracker.h> // for vrpn_TRACKERCB, etc - -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Types.h" // for vrpn_float64 - -#ifndef M_PI -#define M_PI (2*asin(0.0)) -#endif - -#define PHANTOM_SERVER "Tracker0@localhost" - -/***************************************************************************** - * - Callback handler - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_force_change(void *userdata, const vrpn_FORCECB f) -{ - static vrpn_FORCECB lr; // last report - static int first_report_done = 0; - - if ((!first_report_done) || - ((f.force[0] != lr.force[0]) || (f.force[1] != lr.force[1]) - || (f.force[2] != lr.force[2]))) { - //printf("force is (%f,%f,%f)\n", f.force[0], f.force[1], f.force[2]); - } - - first_report_done = 1; - lr = f; -} - -void VRPN_CALLBACK handle_tracker_change(void *userdata, const vrpn_TRACKERCB t) -{ - static vrpn_TRACKERCB lr; // last report - static float dist_interval_sq = 0.004f; - float *pos = (float *)userdata; - - if ((lr.pos[0] - t.pos[0])*(lr.pos[0] - t.pos[0]) + - (lr.pos[1] - t.pos[1])*(lr.pos[1] - t.pos[1]) + - (lr.pos[2] - t.pos[2])*(lr.pos[2] - t.pos[2]) > dist_interval_sq){ - //printf("Sensor %d is now at (%g,%g,%g)\n", t.sensor, - // t.pos[0], t.pos[1], t.pos[2]); - lr = t; - } - pos[0] = static_cast<float>(t.pos[0]); - pos[1] = static_cast<float>(t.pos[1]); - pos[2] = static_cast<float>(t.pos[2]); -} - -void VRPN_CALLBACK handle_button_change(void *userdata, const vrpn_BUTTONCB b) -{ - static int buttonstate = 1; - - if (b.state != buttonstate) { - printf("button #%d is in state %d\n", b.button, b.state); - buttonstate = b.state; - } - - *(int *)userdata = buttonstate; -} - -int main(int /* argc */, char * /* argv */ []) -{ - printf("Trying to connect to ForceDevice, Tracker, and Button named:\n"); - printf("%s\n", PHANTOM_SERVER); - int done = 0; - float pos[3]; - int forceInEffect = 0; - int forceEnabled = 0; - vrpn_ForceDevice_Remote *forceDevice; - vrpn_Tracker_Remote *tracker; - vrpn_Button_Remote *button; - - /* initialize the force device */ - forceDevice = new vrpn_ForceDevice_Remote(PHANTOM_SERVER); - forceDevice->register_force_change_handler(NULL, handle_force_change); - - /* initialize the tracker */ - tracker = new vrpn_Tracker_Remote(PHANTOM_SERVER); - tracker->register_change_handler((void *)pos, handle_tracker_change); - - /* initialize the button */ - button = new vrpn_Button_Remote(PHANTOM_SERVER); - button->register_change_handler((void *)&forceEnabled, handle_button_change); - - // main loop - while (! done ) - { - // Let the forceDevice send its messages to remote force device - forceDevice->mainloop(); - - // Let tracker receive position information from remote tracker - tracker->mainloop(); - - // Let button receive button status from remote button - button->mainloop(); - - if (forceEnabled) { - forceDevice->setFF_Origin(pos[0],pos[1],pos[2]); - // units = dynes - forceDevice->setFF_Force((float)cos(pos[0]*20.0*M_PI), - (float)cos(pos[1]*20.0*M_PI),(float)cos(pos[2]*20.0*M_PI)); - // set derivatives of force field: - // units = dynes/meter - forceDevice->setFF_Jacobian((float)(-20.0*M_PI*sin(pos[0]*20.0*M_PI)), 0, 0, - 0, (float)(-20.0*M_PI*sin(pos[1]*20.0*M_PI)), 0, - 0, 0, (float)(-20.0*M_PI*sin(pos[2]*20.0*M_PI))); - forceDevice->setFF_Radius(0.05f); // 5cm radius of validity - forceDevice->sendForceField(); - forceInEffect = 1; - } - else if (forceInEffect){ - forceDevice->stopForceField(); - forceInEffect = 0; - } - } - -} /* main */ diff --git a/src/vrpn/client_src/forcedevice_test_client.cpp b/src/vrpn/client_src/forcedevice_test_client.cpp deleted file mode 100644 index d68a77ab906373c94e3f04cb5bc597a8901c4075..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/forcedevice_test_client.cpp +++ /dev/null @@ -1,635 +0,0 @@ -// -// forcedevice_test_client.cpp - Program to test out the various functions -// of a vrpn_ForceDevice server, inspired by Randy Heiland. First, -// it generates a box within which the user can feel around; the walls -// have different characteristics. It later generates force fields -// and instant buzzing effects. -// -// It is meant to test devices that have a button and tracker associated -// with them, because it uses these devices to set coordinate systems and -// locations for effects. -// - -#include <math.h> // for fabs, sqrt -#include <stdio.h> // for printf, NULL -#include <stdlib.h> // for exit -#include <vrpn_Shared.h> // for vrpn_gettimeofday -#include <vrpn_Button.h> // for vrpn_Button_Remote, etc -#include <vrpn_ForceDevice.h> // for vrpn_ForceDevice_Remote, etc -#include <vrpn_Tracker.h> // for vrpn_TRACKERCB, etc - -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Connection.h" // for vrpn_Connection -#include "vrpn_Shared.h" // for timeval, vrpn_TimevalDiff, etc -#include "vrpn_Types.h" // for vrpn_float32, vrpn_int32, etc - -/***************************************************************************** - * - Classes and types and such - * - *****************************************************************************/ - -// What type of effect the application is presenting -typedef enum { box, pointconstraint, lineconstraint, planeconstraint, forcefield, buzzing, geometry, quit } APP_STATE; - -// Which Object ID for the cube geometry object -vrpn_int32 CUBE_ID = 0; - -// For the display of the box, this holds a description of the parameters -// for each side. -class BoxSide { -public: - BoxSide(double ox, double oy, double oz, - double nx, double ny, double nz, - double sMult, double fMult, double dMult) - { d_oX = (float)ox; d_oY = (float)oy; d_oZ = (float)oz; - d_nX = (float)nx; d_nY = (float)ny; d_nZ = (float)nz; - d_sMult = (float)sMult; - d_fMult = (float)fMult; - d_dMult = (float)dMult; - } - - float d_oX; //< Offset from center in X direction - float d_oY; //< Offset from center in Y direction - float d_oZ; //< Offset from center in Z direction - - float d_nX; //< Normal in X; - float d_nY; //< Normal in Y; - float d_nZ; //< Normal in Z; - - float d_sMult; //< (signed) How many multiples of change in spring constant to add - float d_fMult; //< (signed) How many multiples of change in friction to add - float d_dMult; //< (signed) How many multiples of change in damping to add -}; - -/***************************************************************************** - * - Global variables - * - *****************************************************************************/ - -// Force device client to use to control the server. -static vrpn_ForceDevice_Remote *g_forceDevice; - -// Standard stiffness of a surface, and factor to multiply/divide by when it varies -static float g_kSpring = (float)0.5; // Unit is unknown, seems to be range is 0 < value <= 1. -static float g_kSpringMult = 2; - -// Standard damping of a surface, and factor to multiply/divide by when it varies -static float g_kDamping = (float)0.001; // Unit is dynes*sec/cm. Range is 0 <= value <= 0.005 -static float g_kDampingMult = 2; - -// Standard values for static and dynamic friction -// Factors by which to multiple/divide static and dynamic friction when they vary -static float g_sFric = (float)0.2; // Unit is fraction of normal force, range is 0 <= value <= 1 -//static float g_dFric = (float)0.2; // Unit is fraction of normal force, range is 0 <= value <= 1, dynamic <= static -static float g_sFricMult = (float)2; -//static float g_dFricMult = (float)2; - -// State of the application (what should be generated now). -static APP_STATE g_state = box; //< What mode are we in? -static bool g_active = false; //< Is the current mode active? - -// Current position of the device -static float g_xPos = (float)0.0; -static float g_yPos = (float)0.0; -static float g_zPos = (float)0.0; - -// Center position for the current effect. -static float g_xCenter = g_xPos; -static float g_yCenter = g_yPos; -static float g_zCenter = g_zPos; - -// Box side descriptions. They are in the following order: -X. -Y. -Z. +X. +Y, +Z. -// They are offset by 2cm from the center. Their characteristics match those -// found in the button-press description message. -static BoxSide g_box[6] = { BoxSide(-0.02, 0.00, 0.00, 1, 0, 0, -1, 0, 0), - BoxSide( 0.00,-0.02, 0.00, 0, 1, 0, 0,-1, 0), - BoxSide( 0.00, 0.00,-0.02, 0, 0, 1, 0, 0,-1), - BoxSide( 0.02, 0.00, 0.00, -1, 0, 0, 1, 0, 0), - BoxSide( 0.00, 0.02, 0.00, 0,-1, 0, 0, 1, 0), - BoxSide( 0.00, 0.00, 0.02, 0, 0,-1, 0, 0, 1) }; - -// Stiffness of the point, line and plane constraint -static float g_pointConstraintStiffness = (float)100.0; -static float g_lineConstraintStiffness = (float) 300.0; -static float g_planeConstraintStiffness = (float) 500.0; - -// Strength and variability of the force field -static float g_forceFieldStrength = (float)0.0; -static float g_forceFieldVaries = (float)20.0; -static float g_forceFieldRadius = (float)0.3; - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_force_change(void *userdata, const vrpn_FORCECB f) -{ -/*XXX - static vrpn_FORCECB lr; // last report - static int first_report_done = 0; - - if ((!first_report_done) || - ((f.force[0] != lr.force[0]) || (f.force[1] != lr.force[1]) - || (f.force[2] != lr.force[2]))) { - printf("force is (%f,%f,%f)\n", f.force[0], f.force[1], f.force[2]); - } - - first_report_done = 1; - lr = f; - XXX*/ -} - - -void VRPN_CALLBACK handle_tracker_change(void *userdata, const vrpn_TRACKERCB t) -{ - // Record the current position of the device in global variables - // so that the button routine can know where to store the center - // position. - g_xPos = (float)t.pos[0]; - g_yPos = (float)t.pos[1]; - g_zPos = (float)t.pos[2]; - - // This is the workhorse function for the program. - - // If we are not active, then don't do anything. - if (!g_active) { return; } - - // Depending on the - // current state of the application, it generates the appropriate - // effect. - - switch (g_state) { - case box: - // We let the user feel around a box whose sides have different - // characteristics as described in the print statements in the - // button-press code. - { - // Figure out which side of the box to use. The index we are computing - // should have 0 = negative X from center, 1 = negative Y from center, - // 2 = negative Z, 3 = +X, 4 = +Y, 5 = +Z. This is determined based - // on which wall we are closest to touching. - double dx = g_xPos - g_xCenter; - double dy = g_yPos - g_yCenter; - double dz = g_zPos - g_zCenter; - - double magx = fabs(dx); - double magy = fabs(dy); - double magz = fabs(dz); - - double magmax = magx; - if (magy > magmax) { magmax = magy; } - if (magz > magmax) { magmax = magz; } - - int index; - - if (magx == magmax) { - if (dx < 0) { - index = 0; // X largest mag, cursor in -X from center - } else { - index = 3; // X largest mag, cursor in +X from center - } - } - if (magy == magmax) { - if (dy < 0) { - index = 1; // Y largest mag, cursor in -Y from center - } else { - index = 4; // Y largest mag, cursor in +Y from center - } - } - if (magz == magmax) { - if (dz < 0) { - index = 2; // Z largest mag, cursor in -Z from center - } else { - index = 5; // Z largest mag, cursor in +Z from center - } - } - - // Find the A,B,C coefficients for the plane, which are just - // the normal pulled from the box side descriptor - float a = g_box[index].d_nX; - float b = g_box[index].d_nY; - float c = g_box[index].d_nZ; - - // Find a point on the plane, one of which is located at the - // box wall's offset from the center location. We're going to - // need this to solve for D in the plane equation. - float ppx = g_xCenter + g_box[index].d_oX; - float ppy = g_yCenter + g_box[index].d_oY; - float ppz = g_zCenter + g_box[index].d_oZ; - - // Find the value of D in the plane equation that makes it zero - // at the point on the plane we just found above: this requires - // D = - (Ax + By + Cz) for that point - float d = - ( a*ppx + b*ppy + c*ppz ); - - // Set plane parameters. First, the plane equation and then the - // surface parameters. We raise the multiplier to the power of - // the box-description multiplier and then apply this to the surface - // parameter to vary each for different sides. A box parameter of - // 0 will therefore cause no change (multiply by one), a parameter of - // -1 will reduce by the factor and a parameter of 1 will increase - // by the parameter. NOTE: Static and dynamic friction are set equal. - g_forceDevice->set_plane(a, b, c, d); - float spring = g_kSpring, springmult = g_box[index].d_sMult; - if (springmult == 1) { spring *= g_kSpringMult; } - if (springmult == -1) { spring /= g_kSpringMult; } - g_forceDevice->setSurfaceKspring(spring); - float damping = g_kDamping, dampingmult = g_box[index].d_dMult; - if (dampingmult == 1) { damping *= g_kDampingMult; } - if (dampingmult == -1) { damping /= g_kDampingMult; } - g_forceDevice->setSurfaceKdamping(damping); - float friction = g_sFric, frictionmult = g_box[index].d_fMult; - if (frictionmult == 1) { friction *= g_sFricMult; } - if (frictionmult == -1) { friction /= g_sFricMult; } - g_forceDevice->setSurfaceFstatic(friction); - g_forceDevice->setSurfaceFdynamic(friction); - - // texture and buzzing stuff: - // this turns off buzzing and texture - g_forceDevice->setSurfaceBuzzAmplitude(0.0); - g_forceDevice->setSurfaceBuzzFrequency(60.0); // Hz - g_forceDevice->setSurfaceTextureAmplitude(0.00); // meters!!! - g_forceDevice->setSurfaceTextureWavelength((float)0.01); // meters!!! - - g_forceDevice->setRecoveryTime(10); // recovery occurs over 10 - // force update cycles - - // enable force device and send surface. - g_forceDevice->startSurface(); - } - break; - - case pointconstraint: - // We produce a point constraint that pulls the user back towards the place where - // they pressed the button. The strength of this constraint is stored in a global. - { - vrpn_float32 center[3] = { g_xCenter, g_yCenter, g_zCenter }; - g_forceDevice->setConstraintMode(vrpn_ForceDevice::POINT_CONSTRAINT); - g_forceDevice->setConstraintKSpring(g_pointConstraintStiffness); - g_forceDevice->setConstraintPoint(center); - g_forceDevice->enableConstraint(1); - } - break; - - case lineconstraint: - // We produce a point constraint that pulls the user back towards the place where - // they pressed the button. The strength of this constraint is stored in a global. - { - vrpn_float32 center[3] = { g_xCenter, g_yCenter, g_zCenter }; - vrpn_float32 direction[3] = { 0, 0, 1}; - g_forceDevice->setConstraintMode(vrpn_ForceDevice::LINE_CONSTRAINT); - g_forceDevice->setConstraintKSpring(g_lineConstraintStiffness); - g_forceDevice->setConstraintLinePoint(center); - g_forceDevice->setConstraintLineDirection( direction ); - g_forceDevice->enableConstraint(1); - } - break; - - case planeconstraint: - // We produce a point constraint that pulls the user back towards the place where - // they pressed the button. The strength of this constraint is stored in a global. - { - vrpn_float32 center[3] = { g_xCenter, g_yCenter, g_zCenter }; - vrpn_float32 direction[3] = { 0, 0, 1}; - g_forceDevice->setConstraintMode(vrpn_ForceDevice::PLANE_CONSTRAINT); - g_forceDevice->setConstraintKSpring(g_planeConstraintStiffness); - g_forceDevice->setConstraintPlanePoint(center); - g_forceDevice->setConstraintPlaneNormal( direction ); - g_forceDevice->enableConstraint(1); - } - break; - - case forcefield: - // Produce a force field pointing in +Z, starting at the center position. As the - // user moves more in the +Z direction, the field will get smaller; larger as they - // move in -Z. - { - vrpn_float32 center[3] = { g_xCenter, g_yCenter, g_zCenter }; - vrpn_float32 force[3] = { 0, 0, g_forceFieldStrength }; - vrpn_float32 jacobian[3][3] = { { 0, 0, 0 }, {0, 0, 0}, {g_forceFieldVaries, 0, 0} }; - g_forceDevice->sendForceField(center, force, jacobian, g_forceFieldRadius); - } - break; - - case buzzing: - { - // Black magic dredged up from vrpn_Phantom.C - vrpn_float32 amplitude; //< - vrpn_float32 frequency; //< Frequency of the buzzing - vrpn_float32 duration; //< Duration of the effect - vrpn_float32 direction[3]; //< Normalized? - vrpn_float32 params[6]; //< In the order shown above - vrpn_int32 effectID = 0; //< 0 means "instant buzzing effect" - - // We only send this every half second; the duration of the effect is - // 1/4 second. - { static struct timeval last_sent = {0,0}; - struct timeval now; - vrpn_gettimeofday(&now, NULL); - if (vrpn_TimevalMsecs(vrpn_TimevalDiff(now, last_sent)) < 500) { break; } - last_sent = now; - } - - // See how far we are from the center in meters. - vrpn_float32 offset[3] = { g_xPos - g_xCenter, g_yPos - g_yCenter, g_zPos - g_zCenter }; - - // Adjust the amplitude based on motion in X - amplitude = (float)(0.5 + 0.5 * (offset[0] / 0.2)); - if (amplitude < 0) { amplitude = 0; } - - // Adjust the frequency based on motion in Y - frequency = (float)(200 + 200 * (offset[1] / 0.2)); - if (frequency < 1) { frequency = 1; } - - // Duration is 1/4 second, send twice per second! - duration = (float)0.25; - - // Normalize the direction from the center and put it into direction. - // Set the direction to +Z if the probe is at the center. - vrpn_float32 length = (float)sqrt(offset[0]*offset[0] + offset[1]*offset[1] + offset[2]*offset[2]); - if (length == 0) { - direction[0] = direction[1] = 0; direction[2] = 1.0; - } else { - direction[0] = offset[0] / length; - direction[1] = offset[1] / length; - direction[2] = offset[2] / length; - } - - params[0] = amplitude; - params[1] = frequency; - params[2] = duration; - params[3] = direction[0]; - params[4] = direction[1]; - params[5] = direction[2]; - g_forceDevice->setCustomEffect(effectID, params, 6); - g_forceDevice->startEffect(); - } - break; - - case geometry: - { - // Only do this creation once! - static bool first_time = true; - if (first_time) { - first_time = false; - } else { - break; - } - - const vrpn_float32 halfwidth = static_cast<vrpn_float32>(0.02); - vrpn_float32 left = g_xCenter - halfwidth; - vrpn_float32 right = g_xCenter + halfwidth; - vrpn_float32 top = g_yCenter - halfwidth; - vrpn_float32 bottom = g_yCenter + halfwidth; - vrpn_float32 front = g_zCenter - halfwidth; - vrpn_float32 back = g_zCenter + halfwidth; - - // Create the cube object, rooted in the world. - g_forceDevice->useGhost(); - g_forceDevice->addObject(CUBE_ID); - - // Create a set of points at the cube corners. - const vrpn_int32 LBF = 0, RBF = 1, LTF = 2, RTF = 3, - LBB = 4, RBB = 5, LTB = 6, RTB = 7; - g_forceDevice->setObjectVertex(CUBE_ID, LBF, left, bottom, front); - g_forceDevice->setObjectVertex(CUBE_ID, RBF, right, bottom, front); - g_forceDevice->setObjectVertex(CUBE_ID, LTF, left, top, front); - g_forceDevice->setObjectVertex(CUBE_ID, RTF, right, top, front); - g_forceDevice->setObjectVertex(CUBE_ID, LBB, left, bottom, back); - g_forceDevice->setObjectVertex(CUBE_ID, RBB, right, bottom, back); - g_forceDevice->setObjectVertex(CUBE_ID, LTB, left, top, back); - g_forceDevice->setObjectVertex(CUBE_ID, RTB, right, top, back); - - // Create a set of triangles that are the cube faces. - // REMEMBER to use the right-hand rule for creating of the - // triangles: the normal points out of that face. - - // Front - g_forceDevice->setObjectTriangle(CUBE_ID, 0, LBF, LTF, RBF); - g_forceDevice->setObjectTriangle(CUBE_ID, 1, RBF, LTF, RTF); - - // Back - g_forceDevice->setObjectTriangle(CUBE_ID, 2, LBB, RBB, LTB); - g_forceDevice->setObjectTriangle(CUBE_ID, 3, RBB, RTB, LTB); - - // Left - g_forceDevice->setObjectTriangle(CUBE_ID, 4, LBF, LBB, LTF); - g_forceDevice->setObjectTriangle(CUBE_ID, 5, LTF, LBB, LTB); - - // Right - g_forceDevice->setObjectTriangle(CUBE_ID, 6, RBF, RTF, RBB); - g_forceDevice->setObjectTriangle(CUBE_ID, 7, RTF, RTB, RBB); - - // Top - g_forceDevice->setObjectTriangle(CUBE_ID, 8, LTF, LTB, RTF); - g_forceDevice->setObjectTriangle(CUBE_ID, 9, RTF, LTB, RTB); - - // Bottom - g_forceDevice->setObjectTriangle(CUBE_ID, 10, LBF, RBF, LBB); - g_forceDevice->setObjectTriangle(CUBE_ID, 11, RBF, RBB, LBB); - - // Push all of the changes and make them active. - g_forceDevice->updateObjectTrimeshChanges(CUBE_ID); - } - break; - - default: - break; - }; -} - -void VRPN_CALLBACK handle_button_change(void *userdata, const vrpn_BUTTONCB b) -{ - // When the button is pressed, start things going for the state - // we are in and tell that the forces are active. - // When the button is released, switch to a new state and set things - // as they need to be set for that state. Also, tell that the - // forces are inactive. - if (b.state) { - - // Forces becoming active in the current state - g_active = true; - - // Set the location at which the button was pressed based on - // the last tracker position so that effects which depend on - // it can know. - g_xCenter = g_xPos; - g_yCenter = g_yPos; - g_zCenter = g_zPos; - - // Set things up to generate forces in the state we are in - switch (g_state) { - case box: - printf(" -X wall will have low spring constant\n"); - printf(" +X wall will have high spring constant\n"); - printf(" -Y wall will have low friction\n"); - printf(" +Y wall will have high friction\n"); - printf(" -Z wall will have low damping\n"); - printf(" +Z wall will have high damping\n"); - printf("\n"); - printf("Release button to stop feeling inside box\n"); - break; - - case pointconstraint: - printf(" You will be pulled back towards where you pressed the button\n"); - printf("\n"); - printf("Release button to stop point constraint\n"); - break; - - case lineconstraint: - printf(" You will be able to pull along a line in the z direction\n"); - printf("\n"); - printf("Release button to stop line constraint\n"); - break; - - case planeconstraint: - printf(" You will be able to pull along the x-y plane\n"); - printf("\n"); - printf("Release button to stop plane constraint\n"); - break; - - case forcefield: - printf(" You will be pushed in Z while you are within the field\n"); - printf(" The push is in +Z when you move in +X, in -Z when you move in -X\n"); - printf("\n"); - printf("Release button to stop force field\n"); - break; - - case buzzing: - printf(" Amplitude will increase as you move in +X, decrease as you move in -X\n"); - printf(" Frequency will increase as you move in +Y, decrease as you move in -Y\n"); - printf(" Direction will be towards where the button was pressed\n"); - printf("\n"); - printf("Release button to stop buzzing\n"); - break; - - case geometry: - printf(" A cube 4cm on a side will be created, centered at your start location.\n"); - printf("\n"); - printf("Release button to stop feeling the cube\n"); - break; - - default: - break; - }; - } else { - - // Not doing any forces until button pressed again. - g_active = false; - - // Move from the state we are in to the next state. - switch (g_state) { - case box: - g_forceDevice->stopSurface(); - printf("\n"); - printf("Press button to start point constraint\n"); - g_state = pointconstraint; - break; - - case pointconstraint: - g_forceDevice->enableConstraint(0); - printf("\n"); - printf("Press button to line constraint\n"); - g_state = lineconstraint; - break; - - case lineconstraint: - g_forceDevice->enableConstraint(0); - printf("\n"); - printf("Press button to start plane constraint\n"); - g_state = planeconstraint; - break; - - case planeconstraint: - g_forceDevice->enableConstraint(0); - printf("\n"); - printf("Press button to start force field\n"); - g_state = forcefield; - break; - - case forcefield: - g_forceDevice->stopForceField(); - printf("\n"); - printf("Press button to start buzzing\n"); - g_state = buzzing; - break; - - - case buzzing: - g_forceDevice->stopEffect(); - printf("\n"); - printf("Press button to start geometry cube!\n"); - g_state = geometry; - break; - - case geometry: - g_forceDevice->removeObject(CUBE_ID); - printf("\n"); - printf("Qutting program!\n"); - g_state = quit; - break; - - default: - g_state = quit; - break; - }; - } -} - -int main(int argc, char *argv[]) -{ - vrpn_Tracker_Remote *tracker; - vrpn_Button_Remote *button; - - if (argc != 2) { - printf("Usage: %s device_name\n",argv[0]); - printf(" Example: %s Phantom@localhost\n",argv[0]); - exit(-1); - } - - char *device_name = argv[1]; - printf("Connecting to %s:\n",device_name); - - /* initialize the force device */ - g_forceDevice = new vrpn_ForceDevice_Remote(device_name); - g_forceDevice->register_force_change_handler(NULL, handle_force_change); - - /* initialize the tracker */ - tracker = new vrpn_Tracker_Remote(device_name); - tracker->register_change_handler(NULL, handle_tracker_change); - - /* initialize the button */ - button = new vrpn_Button_Remote(device_name); - button->register_change_handler(NULL, handle_button_change); - - // Wait until we get connected to the server. - while (!g_forceDevice->connectionPtr()->connected()) { - g_forceDevice->mainloop(); - } - - printf("Press forceDevice's first button to begin feeling inside a box\n"); - - // main loop - while ( g_state != quit ) - { - // Let tracker receive position information from remote tracker - tracker->mainloop(); - - // Let button receive button status from remote button - button->mainloop(); - - // Let the forceDevice send its planes to remote force device - g_forceDevice->mainloop(); - } - - delete tracker; - delete button; - delete g_forceDevice; - - return 0; -} /* main */ - diff --git a/src/vrpn/client_src/forcedevice_test_client.dsp b/src/vrpn/client_src/forcedevice_test_client.dsp deleted file mode 100644 index 86e3d38c83321c3e243c6bc57ebf0e2f32712573..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/forcedevice_test_client.dsp +++ /dev/null @@ -1,101 +0,0 @@ -# Microsoft Developer Studio Project File - Name="forcedevice_test_client" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=forcedevice_test_client - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "forcedevice_test_client.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "forcedevice_test_client.mak" CFG="forcedevice_test_client - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "forcedevice_test_client - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "forcedevice_test_client - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "forcedevice_test_client - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "forcedevice_test_client - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "forcedevice_test_client - Win32 Release" -# Name "forcedevice_test_client - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\forcedevice_test_client.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/client_src/forcedevice_test_client.vcproj b/src/vrpn/client_src/forcedevice_test_client.vcproj deleted file mode 100644 index 3c44350f90cacf960fb24b85bd56ef302e6e5af7..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/forcedevice_test_client.vcproj +++ /dev/null @@ -1,243 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="forcedevice_test_client" - ProjectGUID="{91042ED0-E0EC-40E1-9AEB-FD5296EA11A7}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\Debug" - IntermediateDirectory=".\Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\Debug/forcedevice_test_client.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include";..;..\..\quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\Debug/forcedevice_test_client.pch" - AssemblerListingLocation=".\Debug/" - ObjectFile=".\Debug/" - ProgramDataBaseFileName=".\Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\Debug/forcedevice_test_client.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\Debug/forcedevice_test_client.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\Debug/forcedevice_test_client.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\Release" - IntermediateDirectory=".\Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\Release/forcedevice_test_client.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include";..;..\..\quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\Release/forcedevice_test_client.pch" - AssemblerListingLocation=".\Release/" - ObjectFile=".\Release/" - ProgramDataBaseFileName=".\Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\Release/forcedevice_test_client.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\Release/forcedevice_test_client.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\Release/forcedevice_test_client.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="forcedevice_test_client.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/client_src/forwarderClient.C b/src/vrpn/client_src/forwarderClient.C deleted file mode 100644 index 0f17a0fc8279eb4688062f9c465e80ac7a879304..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/forwarderClient.C +++ /dev/null @@ -1,76 +0,0 @@ -#include <vrpn_Connection.h> -#include <vrpn_ForwarderController.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -// This program connects to a vrpn (Tracker) server and can be used -// to tell it to open ports for other clients to listen to and to -// start forwarding Tracker messages to them. - -// Tom Hudson, October 1998 - -vrpn_Connection * connection; -vrpn_Forwarder_Controller * controller; - -void Usage (char * s) { - fprintf(stderr, "Usage: %s location\n", s); - exit(0); -} - -int main (int argc, char ** argv) { - - char ib [1000]; - char sb [75], tb [75]; - char * qp; - char * source_location; - int port; - int len; - - if (argc != 2) Usage(argv[0]); - - source_location = argv[1]; - - connection = vrpn_get_connection_by_name (source_location); - - controller = new vrpn_Forwarder_Controller (connection); - - printf("Commands:\n" - " quit\n" - " open <port>\n" - " forward <port> \"<service name>\" \"<message type>\"\n"); - do { - if (fgets(ib, 1000, stdin) == NULL) { - perror("Could not read line"); - return -1; - } - fprintf(stderr, "Got: >%s<\n", ib); - if (!strncmp(ib, "open", 4)) { - port = atoi(ib + 5); - controller->start_remote_forwarding(port); - fprintf(stderr, "Opening %d.\n", port); - } - if (!strncmp(ib, "forward", 7)) { - port = atoi(ib + 8); - qp = strchr(ib, '\"'); // start of service name - qp++; - len = static_cast<int>(strcspn(qp, "\"")); fprintf(stderr, "Prefix len %d.\n", len); - strncpy(sb, qp, len); - sb[len] = '\0'; - qp = strchr(qp, '\"'); // end of service name - qp++; - qp = strchr(qp, '\"'); // start of message type name - qp++; - len = static_cast<int>(strcspn(qp, "\"")); fprintf(stderr, "Prefix len %d.\n", len); - strncpy(tb, qp, len); - tb[len] = '\0'; - qp = strchr(qp, '\"'); // end of message type name - - controller->forward_message_type(port, sb, tb); -fprintf(stderr, "Forwarding %s of %s on %d.\n", tb, sb, port); - } - connection->mainloop(); - } while (strncmp(ib, "quit", 4)); - -} diff --git a/src/vrpn/client_src/haptic/Makefile b/src/vrpn/client_src/haptic/Makefile deleted file mode 100644 index 641f69face43cc7f272bdcd9e40979267e8c146c..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/haptic/Makefile +++ /dev/null @@ -1,51 +0,0 @@ - -CC = gcc -CXX = g++ - -CFLAGS = -O -CCFLAGS = -O - - -VRPNDIR = $(HOME)/vrpn -VRPNINC = -I$(VRPNDIR)/include -VRPNLIB = -L$(VRPNDIR)/lib -lvrpn -lquat -lpthread - -INCS = $(VRPNINC) -LIBS = $(VRPNLIB) -lm - -OBJS = testvrpn.o phantom-field.o phantom-plane.o phantom-wave.o \ - glwin.o glvrpn.o smdvrpn.o -BINS = testvrpn phantom-field phantom-plane phantom-wave glvrpn smdvrpn - -all: $(BINS) $(OBJS) - -.c.o : - $(CC) $(CCFLAGS) $(INCS) -c $*.c - -.C.o : - $(CXX) $(CCFLAGS) $(INCS) -c $*.C - -glwin.o : glwin.c glwin.h - $(CC) $(CCFLAGS) -DUSEOPENGL $(INCS) -c $*.c - -testvrpn : testvrpn.o - $(CXX) $(CCFLAGS) $(INCS) testvrpn.o $(LIBS) -o $@ - -phantom-field : phantom-field.o - $(CXX) $(CCFLAGS) $(INCS) phantom-field.o $(LIBS) -o $@ - -phantom-plane : phantom-plane.o - $(CXX) $(CCFLAGS) $(INCS) phantom-plane.o $(LIBS) -o $@ - -phantom-wave : phantom-wave.o - $(CXX) $(CCFLAGS) $(INCS) phantom-wave.o $(LIBS) -o $@ - -glvrpn : glvrpn.o glwin.o - $(CXX) $(CCFLAGS) $(INCS) glvrpn.o glwin.o $(LIBS) -lGL -lGLU -lX11 -o $@ - -smdvrpn: smdvrpn.o glwin.o - $(CXX) $(CCFLAGS) $(INCS) smdvrpn.o glwin.o $(LIBS) -lGL -lGLU -lX11 -o $@ - - -clean : - rm -f $(OBJS) $(BINS) diff --git a/src/vrpn/client_src/haptic/README b/src/vrpn/client_src/haptic/README deleted file mode 100644 index 9fbb01055c96aeac4e835a0755c086772e1b609b..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/haptic/README +++ /dev/null @@ -1,37 +0,0 @@ -This directory contains test and example files for using a Phantom -force-feedback device with VRPN. They were written by John Stone -at the NIH Resource for Macromolecular Modeling and Bioinformatics at the -Beckman Institute at UIUC. - -These programs are made to compile and run on an SGI. The VRPN portions of -these programs should be portable across platforms, but the openGL portions -(if any) have not been ported to Windows. - -This README is made by Russ Taylor, so hopefully it is accurate. - -testvrpn.C: - This opens the Phantom as a tracker, button, and forcedevice. -It prints out all tracker messages, button messages, amd force messages -(should there be force messages?) - -glwin.[hc]: - Helper functions to create openGL windows quickly and easily on Unix. - -glvrpn.C: - This opens and openGL window and displays the tracker as it moves -around (along with a line from the origin to the tracker). It is a good -example of how to use a VRPN tracker with openGL. - -phantom-field.C: - Sends a forcefield to the Phantom when the button is held down. - -phantom-plane.C: - Sends a plane to the Phantom that the user can feel, quits when the -button is pressed. - -phantom-wave.c: - Sends a spatially-varying force field to the Phantom while the button -is held down. - -smdvrpn.C: - Simple molecular dynamics simulation using VRPN, graphics, and haptics. diff --git a/src/vrpn/client_src/haptic/drag-sphere.C b/src/vrpn/client_src/haptic/drag-sphere.C deleted file mode 100644 index 951b0d13f04aa7c15511deca2986c4f39d6bb830..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/haptic/drag-sphere.C +++ /dev/null @@ -1,119 +0,0 @@ -#include <iostream> -#include <stdlib.h> -#include <stdio.h> -#include <vrpn_ForceDevice.h> -#include <vrpn_Tracker.h> -#include <vrpn_Button.h> - - -#define PHANTOM_SERVER "Tracker0@localhost" - -/***************************************************************************** - * - Callback handler - * - *****************************************************************************/ - -void handle_force_change(void *userdata, const vrpn_FORCECB f) -{ - static vrpn_FORCECB lr; // last report - static int first_report_done = 0; - - if ((!first_report_done) || - ((f.force[0] != lr.force[0]) || (f.force[1] != lr.force[1]) - || (f.force[2] != lr.force[2]))) { - //printf("force is (%f,%f,%f)\n", f.force[0], f.force[1], f.force[2]); - } - - first_report_done = 1; - lr = f; -} - -void handle_tracker_change(void *userdata, const vrpn_TRACKERCB t) -{ - static vrpn_TRACKERCB lr; // last report - static float dist_interval_sq = 0.004; - float *pos = (float *)userdata; - - if ((lr.pos[0] - t.pos[0])*(lr.pos[0] - t.pos[0]) + - (lr.pos[1] - t.pos[1])*(lr.pos[1] - t.pos[1]) + - (lr.pos[2] - t.pos[2])*(lr.pos[2] - t.pos[2]) + dist_interval_sq){ - //printf("Sensor %d is now at (%g,%g,%g)\n", t.sensor, - // t.pos[0], t.pos[1], t.pos[2]); - lr = t; - } - pos[0] = t.pos[0]; - pos[1] = t.pos[1]; - pos[2] = t.pos[2]; -} - -void handle_button_change(void *userdata, const vrpn_BUTTONCB b) -{ - static int buttonstate = 1; - - if (b.state != buttonstate) { - printf("button #%ld is in state %ld\n", b.button, b.state); - buttonstate = b.state; - } - - *(int *)userdata = buttonstate; -} - -int main(int argc, char *argv[]) -{ - int done = 0; - float pos[3]; - - int forceInEffect = 0; - int forceEnabled = 0; - vrpn_ForceDevice_Remote *forceDevice; - vrpn_Tracker_Remote *tracker; - vrpn_Button_Remote *button; - - /* initialize the force device */ - forceDevice = new vrpn_ForceDevice_Remote(PHANTOM_SERVER); - forceDevice->register_change_handler(NULL, handle_force_change); - - /* initialize the tracker */ - tracker = new vrpn_Tracker_Remote(PHANTOM_SERVER); - tracker->register_change_handler((void *)pos, handle_tracker_change); - - /* initialize the button */ - button = new vrpn_Button_Remote(PHANTOM_SERVER); - button->register_change_handler((void *)&forceEnabled, handle_button_change); - - // main loop - while (! done ) - { - // Let the forceDevice send its messages to remote force device - forceDevice->mainloop(); - - // Let tracker receive position information from remote tracker - tracker->mainloop(); - - // Let button receive button status from remote button - button->mainloop(); - - if (forceEnabled) { - forceDevice->setFF_Origin(0.1,0.1,0.0); - // units = dynes - forceDevice->setFF_Force(-10.0*pos[0],-10.0*pos[1],-10.0*pos[2]); - -// set derivatives of force field: -// units = dynes/meter - forceDevice->setFF_Jacobian(-10,0, 0, 0, - -10, 0, 0, 0, - -10); - forceDevice->setFF_Radius(0.2); // 20cm radius of validity - forceDevice->sendForceField(); - - forceInEffect = 1; - } - else if (forceInEffect){ - forceDevice->stopForceField(); - forceInEffect = 0; - } - } - -} /* main */ - diff --git a/src/vrpn/client_src/haptic/glvrpn.C b/src/vrpn/client_src/haptic/glvrpn.C deleted file mode 100644 index f574e1977e99b86ec26068acc62c6b778d9ca8c9..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/haptic/glvrpn.C +++ /dev/null @@ -1,216 +0,0 @@ -#include <stdio.h> -#include "vrpn_Tracker.h" -#include "vrpn_Button.h" -#include "vrpn_ForceDevice.h" -#include "quat.h" - -#include "glwin.h" -#include <GL/gl.h> -#include <GL/glu.h> -#include <GL/glx.h> - - -typedef struct { - float x; // position - float y; - float z; - double qx, qy, qz, qw; // quaternion orientation -} posquat; - -typedef struct { - int b[100]; -} buttons; - -void handle_tracker(void *userdata, const vrpn_TRACKERCB t) { - posquat *pq = (posquat *) userdata; - - pq->x = t.pos[0]; - pq->y = t.pos[1]; - pq->z = t.pos[2]; - pq->qx=t.quat[Q_X]; - pq->qy=t.quat[Q_Y]; - pq->qz=t.quat[Q_Z]; - pq->qw=t.quat[Q_W]; -} - -void handle_button(void *userdata, const vrpn_BUTTONCB b) { - buttons *bt = (buttons *) userdata; - - if (b.button < 100) - bt->b[b.button] = b.state; - printf("\nButton %3d is in state: %d \n", - b.button, b.state); - fflush(stdout); -} - -void handle_force(void *userdata, const vrpn_FORCECB f) { -#if 0 - static vrpn_FORCECB lr; // last report - static int first_report_done = 0; - - if ((!first_report_done) || ((f.force[0] != lr.force[0]) || - (f.force[1] != lr.force[1]) || (f.force[2] != lr.force[2]))) - printf("\nForce is (%11f, %11f, %11f) \n", - f.force[0], f.force[1], f.force[2]); - - first_report_done = 1; - lr = f; -#endif -} - -void init_graphics(void *myglwin) { - glwin_handle_events(myglwin); // let window to open and handle events once - glwin_handle_events(myglwin); // let window to open and handle events once - - // setup OpenGL state... - glShadeModel(GL_SMOOTH); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(45.0, 1.0, 0.01, 10.0); - gluLookAt( 0.0, 0.1, -5.0, // eye pos - 0.0, 0.0, 0.0, // look at this point - 0.0, 1.0, 0.0); // up direction - - glClearColor(0.0, 0.0, 0.0, 0.0); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glEnable(GL_DEPTH_TEST); - - // - // Setup cute lighting parms.. - // - glEnable(GL_LIGHTING); - glEnable(GL_LEQUAL); - - GLfloat lpos[] = { 0.0, 0.0, -100.0, 1.0}; - GLfloat lamb[] = { 0.05, 0.05, 0.05, 1.0}; - GLfloat ldif[] = { 0.5, 0.5, 0.5, 1.0}; - GLfloat lspc[] = { 0.5, 0.5, 0.5, 1.0}; - - glLightfv(GL_LIGHT0, GL_POSITION, lpos); - glLightfv(GL_LIGHT0, GL_AMBIENT, lamb); - glLightfv(GL_LIGHT0, GL_DIFFUSE, ldif); - glLightfv(GL_LIGHT0, GL_SPECULAR, lspc); - glLightf(GL_LIGHT0, GL_SHININESS, 400.0); - glEnable(GL_LIGHT0); - - GLfloat mdif[] = {0.9, 0.0, 0.2, 1.0}; - GLfloat mspc[] = {0.2, 0.2, 0.2, 1.0}; - glMaterialfv(GL_FRONT, GL_SPECULAR, mspc); - glMaterialfv(GL_FRONT, GL_DIFFUSE, mdif); - glEnable(GL_COLOR_MATERIAL); -} - -void draw_axes() { - // - // Draw Coordinate Axes - // - glDisable(GL_LIGHTING); - glBegin(GL_LINES); - float i; - - glColor3f(0.0, 1.0, 0.0); - for (i=-10; i<10; i += 0.50) { - glVertex3f( -10.0, 0.0, i); - glVertex3f( 10.0, 0.0, i); - glVertex3f( i, 0.0, -10.0); - glVertex3f( i, 0.0, 10.0); - } - glEnd(); -} - -void draw_tracker(posquat *pq, GLUquadricObj *qobj1, GLUquadricObj *qobj2) -{ - float x, y, z; - - // Convert from haptic coordinates to our scene coordinates - x=-10.0*(pq->x); - y=10.0*(pq->y); - z=-10.0*(pq->z); - double q[4] = {-(pq->qx), (pq->qy), -(pq->qz), pq->qw}; - // convert the orientation from quaternion to OpenGL matrix - double rotation[16]; - q_to_ogl_matrix(rotation,q); - - - // Draw the tracker itself - // - - // First draw line to object - glColor3f(1.0, 1.0, 1.0); - glBegin(GL_LINES); - glVertex3f(0.0, 0.0, 0.0 ); - glVertex3f(x, y, z); - glEnd(); - - - glEnable(GL_LIGHTING); - glColor3f(1.0, 0.0, 0.2); - glPushMatrix(); - glTranslatef(x, y, z); - glMultMatrixd(rotation); - glTranslatef(-1.5, 0.0, 0.0); - gluSphere(qobj1, 0.2, 32, 32); - glTranslatef(3.0,0.0,0.0); - gluSphere(qobj2, 0.2, 32, 32); - glPopMatrix(); -} - -int main(int argc, char **argv) { - char * server; - posquat *tposquat = new posquat; - buttons bpos; - - vrpn_Tracker_Remote *tkr; - vrpn_Button_Remote *btn; - vrpn_ForceDevice_Remote *fdv; - - if (argc < 2) { - printf("%s: Invalid parms\n", argv[0]); - printf("usage: \n"); - printf(" %s Tracker0@host\n", argv[0]); - - return -1; - } - server = argv[1]; - - - printf("Opening: %s ...\n", server); - tkr = new vrpn_Tracker_Remote(server); - tkr->register_change_handler(tposquat, handle_tracker); - - btn = new vrpn_Button_Remote(server); - btn->register_change_handler(&bpos, handle_button); - - fdv = new vrpn_ForceDevice_Remote(server); - fdv->register_force_change_handler(NULL, handle_force); - - void * myglwin = glwin_create(700, 700); - if (myglwin == NULL) { - printf("Failed to open OpenGL window!!\n"); - return -1; - } - - init_graphics(myglwin); - GLUquadricObj *qobj1 = gluNewQuadric(); - GLUquadricObj *qobj2 = gluNewQuadric(); - - /* - * main interactive loop - */ - while (1) { - // Let the tracker do its thing - tkr->mainloop(); - btn->mainloop(); - fdv->mainloop(); - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - draw_axes(); - - draw_tracker(tposquat, qobj1, qobj2); - - glwin_swap_buffers(myglwin); - } -} /* main */ diff --git a/src/vrpn/client_src/haptic/glwin.c b/src/vrpn/client_src/haptic/glwin.c deleted file mode 100644 index 1e2153b87ee90f5e93454e4ecbdaba9171b7b409..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/haptic/glwin.c +++ /dev/null @@ -1,449 +0,0 @@ -/* - * glwin.c -- simple code for opening an OpenGL display window, and doing - * BitBlt operations or whatever... - * - */ - -#include <stdio.h> -#include <stdlib.h> - -#ifdef USEOPENGL - -#if !defined(WIN32) && !defined(_MSC_VER) - -#include <X11/Xlib.h> -#include <GL/gl.h> -#include <GL/glu.h> -#include <GL/glx.h> - -#include "glwin.h" - -typedef struct { - int scrnum; - Display *dpy; - Window root; - Window win; - GLXContext ctx; - int width; - int height; -} oglhandle; - - -void * glwin_create(int width, int height) { - oglhandle * handle; - XSetWindowAttributes attr; - unsigned long mask; - XVisualInfo *visinfo; - int attrib[] = { GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, GLX_DEPTH_SIZE, 16, GLX_DOUBLEBUFFER, None }; - - handle = (oglhandle *) malloc(sizeof(oglhandle)); - if (handle == NULL) { - printf("failed to allocate handle\n"); - return NULL; - } - - handle->width = width; - handle->height = height; - - handle->dpy = XOpenDisplay(getenv("DISPLAY")); - if (handle->dpy == NULL) { - printf("failed to open Display!!\n"); - free(handle); - return NULL; - } - - handle->scrnum = DefaultScreen( handle->dpy ); - handle->root = RootWindow( handle->dpy, handle->scrnum ); - - visinfo = glXChooseVisual( handle->dpy, handle->scrnum, attrib ); - - if (visinfo == NULL) { - printf("Error: couldn't get an RGB, Double-buffered visual\n"); - free(handle); - return NULL; - } - - /* window attributes */ - attr.background_pixel = 0; - attr.border_pixel = 0; - attr.colormap = XCreateColormap(handle->dpy, handle->root, - visinfo->visual, AllocNone); - - attr.event_mask = StructureNotifyMask | ExposureMask; - mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; - - handle->win = XCreateWindow(handle->dpy, handle->root, 0, 0, width, height, - 0, visinfo->depth, InputOutput, - visinfo->visual, mask, &attr ); - - handle->ctx = glXCreateContext( handle->dpy, visinfo, NULL, True ); - - glXMakeCurrent( handle->dpy, handle->win, handle->ctx ); - - XStoreName(handle->dpy, handle->win, - "OpenGL Window"); - - XMapWindow(handle->dpy, handle->win); - - glClearColor(0.0, 0.0, 0.0, 1.0); - glClear(GL_COLOR_BUFFER_BIT); - glwin_swap_buffers(handle); - glClear(GL_COLOR_BUFFER_BIT); - glwin_swap_buffers(handle); - - glwin_handle_events(handle); - glwin_handle_events(handle); - - XFlush(handle->dpy); - - return handle; -} - - -void glwin_destroy(void * voidhandle) { - oglhandle * handle = (oglhandle *) voidhandle; - - if (handle == NULL) - return; - - XUnmapWindow(handle->dpy, handle->win); - - glXMakeCurrent(handle->dpy, None, NULL); - - XDestroyWindow(handle->dpy, handle->win); - - XCloseDisplay(handle->dpy); -} - -void glwin_swap_buffers(void * voidhandle) { - oglhandle * handle = (oglhandle *) voidhandle; - - if (handle != NULL) - glXSwapBuffers(handle->dpy, handle->win); -} - -int glwin_handle_events(void * voidhandle) { - oglhandle * handle = (oglhandle *) voidhandle; - XEvent event; - - if (handle == NULL) - return 0; - - XNextEvent(handle->dpy, &event); - - switch(event.type) { - case ConfigureNotify: - handle->width = event.xconfigure.width; - handle->height = event.xconfigure.height; - - glShadeModel(GL_FLAT); - glViewport(0, 0, handle->width, handle->height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - - /* this is upside-down for what most code thinks, but it is */ - /* right side up for the ray tracer.. */ - gluOrtho2D(0.0, handle->width, 0.0, handle->height); - - glMatrixMode(GL_MODELVIEW); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glPixelZoom(1.0, 1.0); /* for upside-down images that ray uses */ - - return 1; - } - - return 0; -} - -void glwin_draw_image(void * voidhandle, int xsize, int ysize, - unsigned char * img) { - glRasterPos2i(0, 0); - glDrawPixels(xsize, ysize, GL_RGB, GL_UNSIGNED_BYTE, img); - glwin_swap_buffers(voidhandle); -} - - -#else - - -/* - * WIN32 Version - */ - -#include <windows.h> -#include <GL/gl.h> -#include <GL/glu.h> - -#include "glwin.h" - -typedef struct { - HWND hWnd; - HDC hDC; - HGLRC hRC; - long scrwidth; - long scrheight; - int width; - int height; -} oglhandle; - -static char szAppName[] = "OpenGL"; -static char szAppTitle[]="OpenGL Window"; - - /* XXX GET RID OF THIS!!!!! */ -static oglhandle * globhandle; /* XXX GET RID OF THIS!!!!! */ - /* XXX GET RID OF THIS!!!!! */ - -/* - * declaration of myWindowProc() - */ -LONG WINAPI myWindowProc( HWND, UINT, WPARAM, LPARAM ); - -static int OpenWin32Connection(oglhandle * handle) { - WNDCLASS wc; - HINSTANCE hInstance = GetModuleHandle(NULL); - - /* Clear (important!) and then fill in the window class structure. */ - memset(&wc, 0, sizeof(WNDCLASS)); - wc.style = CS_OWNDC; - wc.lpfnWndProc = (WNDPROC) myWindowProc; - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(NULL, IDI_WINLOGO); - wc.hCursor = LoadCursor(hInstance, IDC_ARROW); - wc.hbrBackground = NULL; /* Default color */ - wc.lpszMenuName = NULL; - wc.lpszClassName = szAppName; - - if(!RegisterClass(&wc)) { - printf("Cannot register window class.\n"); - return -1; - } - - handle->scrwidth = GetSystemMetrics(SM_CXSCREEN); - handle->scrheight = GetSystemMetrics(SM_CYSCREEN); - - return 0; -} - -static HGLRC SetupOpenGL(HWND hWnd) { - int nMyPixelFormatID; - HDC hDC; - HGLRC hRC; - static PIXELFORMATDESCRIPTOR pfd = { - sizeof (PIXELFORMATDESCRIPTOR), /* struct size */ - 1, /* Version number */ - PFD_DRAW_TO_WINDOW /* Flags, draw to a window, */ - | PFD_SUPPORT_OPENGL, /* use OpenGL */ - PFD_TYPE_RGBA, /* RGBA pixel values */ - 24, /* 24-bit color */ - 0, 0, 0, /* RGB bits & shift sizes. */ - 0, 0, 0, /* Don't care about them */ - 0, 0, /* No alpha buffer info */ - 0, 0, 0, 0, 0, /* No accumulation buffer */ - 32, /* 32-bit depth buffer */ - 0, /* No stencil buffer */ - 0, /* No auxiliary buffers */ - PFD_MAIN_PLANE, /* Layer type */ - 0, /* Reserved (must be 0) */ - 0, /* No layer mask */ - 0, /* No visible mask */ - 0 /* No damage mask */ - }; - - hDC = GetDC(hWnd); - nMyPixelFormatID = ChoosePixelFormat(hDC, &pfd); - - /* - * catch errors here. - * If nMyPixelFormat is zero, then there's - * something wrong... most likely the window's - * style bits are incorrect (in CreateWindow() ) - * or OpenGL isn't installed on this machine - * - */ - - if (nMyPixelFormatID == 0) { - printf("Error selecting OpenGL Pixel Format!!\n"); - return NULL; - } - - SetPixelFormat( hDC, nMyPixelFormatID, &pfd ); - - hRC = wglCreateContext(hDC); - ReleaseDC(hWnd, hDC); - - return hRC; -} - -static int myCreateWindow(oglhandle * handle, - int xpos, int ypos, int xs, int ys) { - /* Create a main window for this application instance. */ - handle->hWnd = - CreateWindow( - szAppName, /* app name */ - szAppTitle, /* Text for window title bar */ - WS_OVERLAPPEDWINDOW /* Window style */ - | WS_CLIPCHILDREN - | WS_CLIPSIBLINGS, /* NEED THESE for OpenGL calls to work! */ - xpos, ypos, - xs, ys, - NULL, /* no parent window */ - NULL, /* Use the window class menu. */ - GetModuleHandle(NULL), /* This instance owns this window */ - handle /* We don't use any extra data */ - ); - - if (!handle->hWnd) { - printf("Couldn't Open Window!!\n"); - return -1; - } - - handle->hDC = GetDC(handle->hWnd); - wglMakeCurrent(handle->hDC, handle->hRC); - - /* Make the window visible & update its client area */ - ShowWindow( handle->hWnd, SW_SHOW); /* Show the window */ - UpdateWindow( handle->hWnd ); /* Sends WM_PAINT message */ - - return 0; -} - - -LONG WINAPI myWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - PAINTSTRUCT ps; /* Paint structure. */ - - switch(msg) { - case WM_CREATE: - globhandle->hRC = SetupOpenGL(hwnd); - return 0; - - case WM_SIZE: - // hDC = GetDC(hwnd); - wglMakeCurrent(globhandle->hDC, globhandle->hRC); - - glShadeModel(GL_FLAT); - glViewport(0, 0, (GLsizei) LOWORD(lParam), (GLsizei) HIWORD (lParam)); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - - /* this is upside-down for what most code thinks, but it is */ - /* right side up for the ray tracer.. */ - gluOrtho2D(0.0, (GLsizei) LOWORD(lParam), 0.0, (GLsizei) HIWORD (lParam)); - - glMatrixMode(GL_MODELVIEW); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glPixelZoom(1.0, 1.0); /* for upside-down images that ray uses */ - return 0; - - case WM_CLOSE: - PostQuitMessage(0); - return 0; - - case WM_PAINT: - BeginPaint(hwnd, &ps); - EndPaint(hwnd, &ps); - return 0; - - default: - return DefWindowProc(hwnd, msg, wParam, lParam); - } - - return 0; -} - - -void * glwin_create(int width, int height) { - oglhandle * handle; - int rc; - - handle = (oglhandle *) malloc(sizeof(oglhandle)); - if (handle == NULL) - return NULL; - globhandle = handle; - - rc = OpenWin32Connection(handle); - if (rc != 0) { - printf("OpenWin32Connection() returned an error!\n"); - free(handle); - return NULL; - } - - handle->width = width; - handle->height = height; - - rc = myCreateWindow(handle, 0, 0, width, height); - if (rc != 0) { - printf("CreateWindow() returned an error!\n"); - free(handle); - return NULL; - } - - - return handle; -} - -void glwin_destroy(void * voidhandle) { - oglhandle * handle = (oglhandle *) voidhandle; - - wglDeleteContext(handle->hRC); - PostQuitMessage( 0 ); - - /* glwin_handle_events(handle); */ -} - -void glwin_swap_buffers(void * voidhandle) { - oglhandle * handle = (oglhandle *) voidhandle; - glFlush(); -} - -int glwin_handle_events(void * voidhandle) { - oglhandle * handle = (oglhandle *) voidhandle; - MSG msg; - - if (GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - return 1; - } - - return 0; -} - -void glwin_draw_image(void * voidhandle, int xsize, int ysize, unsigned char * img) { - oglhandle * handle = (oglhandle *) voidhandle; - glRasterPos2i(0, 0); - glDrawPixels(xsize, ysize, GL_RGB, GL_UNSIGNED_BYTE, img); - glwin_swap_buffers(voidhandle); - return; -} - - -#endif - - - - -#else - -void * glwin_create(int width, int height) { - return NULL; -} - -void glwin_destroy(void * voidhandle) { - return; -} - -void glwin_swap_buffers(void * voidhandle) { - return; -} - -int glwin_handle_events(void * voidhandle) { - return 0; -} - -void glwin_draw_image(void * voidhandle, int xsize, int ysize, unsigned char * img) { - return; -} - -#endif - diff --git a/src/vrpn/client_src/haptic/glwin.h b/src/vrpn/client_src/haptic/glwin.h deleted file mode 100644 index 98bcda27e61b273b65d86ee69c763a64a215ab99..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/haptic/glwin.h +++ /dev/null @@ -1,14 +0,0 @@ - -#ifdef __cplusplus -extern "C" { -#endif - -void * glwin_create(int width, int height); -void glwin_destroy(void * voidhandle); -void glwin_swap_buffers(void * voidhandle); -int glwin_handle_events(void * voidhandle); -void glwin_draw_image(void * voidhandle, int xsize, int ysize, unsigned char * img); - -#ifdef __cplusplus -} -#endif diff --git a/src/vrpn/client_src/haptic/phantom-field.C b/src/vrpn/client_src/haptic/phantom-field.C deleted file mode 100644 index 98a90d9aae56948e89aa9d8c1e0d4efccacef7f1..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/haptic/phantom-field.C +++ /dev/null @@ -1,120 +0,0 @@ - -#include <stdlib.h> -#include <stdio.h> -#include <vrpn_ForceDevice.h> -#include <vrpn_Tracker.h> -#include <vrpn_Button.h> - - - - -/***************************************************************************** - * - Callback handler - * - *****************************************************************************/ - -void handle_force_change(void *userdata, const vrpn_FORCECB f) -{ - static vrpn_FORCECB lr; // last report - static int first_report_done = 0; - - if ((!first_report_done) || - ((f.force[0] != lr.force[0]) || (f.force[1] != lr.force[1]) - || (f.force[2] != lr.force[2]))) { - //printf("force is (%f,%f,%f)\n", f.force[0], f.force[1], f.force[2]); - } - - first_report_done = 1; - lr = f; -} - -void handle_tracker_change(void *userdata, const vrpn_TRACKERCB t) -{ - static vrpn_TRACKERCB lr; // last report - static float dist_interval_sq = 0.004; - float *pos = (float *)userdata; - - if ((lr.pos[0] - t.pos[0])*(lr.pos[0] - t.pos[0]) + - (lr.pos[1] - t.pos[1])*(lr.pos[1] - t.pos[1]) + - (lr.pos[2] - t.pos[2])*(lr.pos[2] - t.pos[2]) + dist_interval_sq){ - //printf("Sensor %d is now at (%g,%g,%g)\n", t.sensor, - // t.pos[0], t.pos[1], t.pos[2]); - lr = t; - } - pos[0] = t.pos[0]; - pos[1] = t.pos[1]; - pos[2] = t.pos[2]; -} - -void handle_button_change(void *userdata, const vrpn_BUTTONCB b) -{ - static int buttonstate = 1; - - if (b.state != buttonstate) { - printf("button #%ld is in state %ld\n", b.button, b.state); - buttonstate = b.state; - } - - *(int *)userdata = buttonstate; -} - -int main(int argc, char **argv) { - int done = 0; - float pos[3]; - int forceInEffect = 0; - int forceEnabled = 0; - vrpn_ForceDevice_Remote *forceDevice; - vrpn_Tracker_Remote *tracker; - vrpn_Button_Remote *button; - - if (argc < 2) { - printf("Usage: %s Phantom@machine\n", argv[0]); - exit(1); - } - char * servername = argv[1]; - - /* initialize the force device */ - forceDevice = new vrpn_ForceDevice_Remote(servername); - forceDevice->register_force_change_handler(NULL, handle_force_change); - - /* initialize the tracker */ - tracker = new vrpn_Tracker_Remote(servername); - tracker->register_change_handler((void *)pos, handle_tracker_change); - - /* initialize the button */ - button = new vrpn_Button_Remote(servername); - button->register_change_handler((void *)&forceEnabled, handle_button_change); - - // main loop - while (! done ) { - // Let the forceDevice send its messages to remote force device - forceDevice->mainloop(); - - // Let tracker receive position information from remote tracker - tracker->mainloop(); - - // Let button receive button status from remote button - button->mainloop(); - - if (forceEnabled) { - forceDevice->setFF_Origin(pos[0],pos[1],pos[2]); - // units = dynes - forceDevice->setFF_Force(0.02*cos(pos[0]*200.0*M_PI), - 0.02*cos(pos[1]*200.0*M_PI), - 0.02*cos(pos[2]*200.0*M_PI)); - // set derivatives of force field: - // units = dynes/meter - forceDevice->setFF_Jacobian(-4.0*M_PI*sin(pos[0]*200.0*M_PI), 0, 0, 0, - -4.0*M_PI*sin(pos[1]*200.0*M_PI), 0, 0, 0, - -4.0*M_PI*sin(pos[2]*200.0*M_PI)); - forceDevice->setFF_Radius(0.15); // radius of validity - forceDevice->sendForceField(); - forceInEffect = 1; - } - else if (forceInEffect){ - forceDevice->stopForceField(); - forceInEffect = 0; - } - } -} /* main */ diff --git a/src/vrpn/client_src/haptic/phantom-plane.C b/src/vrpn/client_src/haptic/phantom-plane.C deleted file mode 100644 index db2408d02de4502e988c1c64f0e0f52d88c1f7b2..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/haptic/phantom-plane.C +++ /dev/null @@ -1,103 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <vrpn_ForceDevice.h> -#include <vrpn_Tracker.h> -#include <vrpn_Button.h> - -#define PHANTOM_SERVER "Phantom@budapest" - -/****************************************************************************** - * Callback handler - *****************************************************************************/ - -void handle_force_change(void *userdata, vrpn_FORCECB f) -{ - static vrpn_FORCECB lr; // last report - static int first_report_done = 0; - - if ((!first_report_done) || - ((f.force[0] != lr.force[0]) || (f.force[1] != lr.force[1]) - || (f.force[2] != lr.force[2]))) - printf("force is (%f,%f,%f)\n", f.force[0], f.force[1], f.force[2]); - first_report_done = 1; - lr = f; -} - -void handle_tracker_change(void *userdata, const vrpn_TRACKERCB t) -{ - static vrpn_TRACKERCB lr; // last report - static float dist_interval_sq = 0.004; - - if ((lr.pos[0] - t.pos[0])*(lr.pos[0] - t.pos[0]) + - (lr.pos[1] - t.pos[1])*(lr.pos[1] - t.pos[1]) + - (lr.pos[2] - t.pos[2])*(lr.pos[2] - t.pos[2]) > dist_interval_sq){ - printf("Sensor %d is now at (%g,%g,%g)\n", t.sensor, - t.pos[0], t.pos[1], t.pos[2]); - lr = t; - } -} - -void handle_button_change(void *userdata, vrpn_BUTTONCB b) -{ - static int count=0; - static int buttonstate = 1; - int done = 0; - - if (b.state != buttonstate) { - printf("button #%ld is in state %ld\n", b.button, b.state); - buttonstate = b.state; - count++; - } - if (count > 4) - done = 1; - *(int *)userdata = done; -} - -int main(int argc, char *argv[]) { - int done = 0; - vrpn_ForceDevice_Remote *forceDevice; - vrpn_Tracker_Remote *tracker; - vrpn_Button_Remote *button; - - /* initialize the force device */ - forceDevice = new vrpn_ForceDevice_Remote(PHANTOM_SERVER); - forceDevice->register_force_change_handler(NULL, handle_force_change); - - /* initialize the tracker */ - tracker = new vrpn_Tracker_Remote(PHANTOM_SERVER); - tracker->register_change_handler(NULL, handle_tracker_change); - - /* initialize the button */ - button = new vrpn_Button_Remote(PHANTOM_SERVER); - button->register_change_handler(&done, handle_button_change); - - // Set plane and surface parameters - forceDevice->set_plane(0.0, 1.0, 0.0, 1.0); - forceDevice->setSurfaceKspring(0.1); // spring constant - units of - // dynes/cm - forceDevice->setSurfaceKdamping(0.002); // damping constant - - // units of dynes*sec/cm - forceDevice->setSurfaceFstatic(0.01); // set static friction - forceDevice->setSurfaceFdynamic(0.005); // set dynamic friction - forceDevice->setRecoveryTime(10); // recovery occurs over 10 - // force update cycles - // enable force device and send first surface - forceDevice->startSurface(); - // main loop - while (! done ){ - // Let the forceDevice send its planes to remote force device - forceDevice->mainloop(); - // Let tracker receive position information from remote tracker - tracker->mainloop(); - // Let button receive button status from remote button - button->mainloop(); - // we may call forceDevice->set_plane(...) followed by - // forceDevice->sendSurface() here to change the plane - // for example: using position information from a tracker we can - // compute a plane to approximate a complex surface at that - // position and send that approximation 15-30 times per - // second to simulate the complex surface - } - // shut off force device - forceDevice->stopSurface(); -} /* main */ diff --git a/src/vrpn/client_src/haptic/phantom-wave.C b/src/vrpn/client_src/haptic/phantom-wave.C deleted file mode 100644 index 8e0e1a8b16ebfedde16c1427ee8d7652d52dc531..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/haptic/phantom-wave.C +++ /dev/null @@ -1,135 +0,0 @@ - -#include <stdlib.h> -#include <stdio.h> -#include <vrpn_ForceDevice.h> -#include <vrpn_Tracker.h> -#include <vrpn_Button.h> - - -#define PHANTOM_SERVER "Tracker0@localhost" - -/***************************************************************************** - * - Callback handler - * - *****************************************************************************/ - -void handle_force_change(void *userdata, const vrpn_FORCECB f) -{ - static vrpn_FORCECB lr; // last report - static int first_report_done = 0; - - if ((!first_report_done) || - ((f.force[0] != lr.force[0]) || (f.force[1] != lr.force[1]) - || (f.force[2] != lr.force[2]))) { - //printf("force is (%f,%f,%f)\n", f.force[0], f.force[1], f.force[2]); - } - - first_report_done = 1; - lr = f; -} - -void handle_tracker_change(void *userdata, const vrpn_TRACKERCB t) -{ - static vrpn_TRACKERCB lr; // last report - static float dist_interval_sq = 0.04; - float *pos = (float *)userdata; - - if ((lr.pos[0] - t.pos[0])*(lr.pos[0] - t.pos[0]) + - (lr.pos[1] - t.pos[1])*(lr.pos[1] - t.pos[1]) + - (lr.pos[2] - t.pos[2])*(lr.pos[2] - t.pos[2]) + dist_interval_sq){ - //printf("Sensor %d is now at (%g,%g,%g)\n", t.sensor, - // t.pos[0], t.pos[1], t.pos[2]); - lr = t; - } - pos[0] = t.pos[0]; - pos[1] = t.pos[1]; - pos[2] = t.pos[2]; -} - -void handle_button_change(void *userdata, const vrpn_BUTTONCB b) -{ - static int buttonstate = 1; - - if (b.state != buttonstate) { - printf("button #%ld is in state %ld\n", b.button, b.state); - buttonstate = b.state; - } - - *(int *)userdata = buttonstate; -} - -int main(int argc, char *argv[]) { - int done = 0; - float pos[3]; - int forceInEffect = 0; - int forceEnabled = 0; - vrpn_ForceDevice_Remote *forceDevice; - vrpn_Tracker_Remote *tracker; - vrpn_Button_Remote *button; - float t; - - /* initialize the force device */ - forceDevice = new vrpn_ForceDevice_Remote(PHANTOM_SERVER); - forceDevice->register_force_change_handler(NULL, handle_force_change); - - /* initialize the tracker */ - tracker = new vrpn_Tracker_Remote(PHANTOM_SERVER); - tracker->register_change_handler((void *)pos, handle_tracker_change); - - /* initialize the button */ - button = new vrpn_Button_Remote(PHANTOM_SERVER); - button->register_change_handler((void *)&forceEnabled, handle_button_change); - - t=0.0; - - // main loop - while (!done) { - t+=0.001f; - - // Let the forceDevice send its messages to remote force device - forceDevice->mainloop(); - - // Let tracker receive position information from remote tracker - tracker->mainloop(); - - // Let button receive button status from remote button - button->mainloop(); - - forceEnabled = 1; - - if (forceEnabled) { - float py = (0.05 * sin(t + pos[0]*40.0*M_PI) + 0.05); - if (pos[1] > py) { - forceDevice->stopForceField(); - forceInEffect = 0; - } else { - float fy; - - forceDevice->setFF_Origin(pos[0],pos[1],pos[2]); - - fy = (py - pos[1]) * 14.0; - // units = dynes - forceDevice->setFF_Force(0.20 * cos(t + pos[0]*200.0*M_PI), - fy, - 0.0 * cos( pos[2]*200.0*M_PI)); - // set derivatives of force field: - // units = dynes/meter - forceDevice->setFF_Jacobian( - -20.0*sin(t + pos[0]*200.0*M_PI), 0, 0, - 0, -14.0, 0, - 0, 0, -0.0*M_PI*sin(pos[2]*200.0*M_PI) - ); - - forceDevice->setFF_Radius(0.02); // 2cm radius of validity - forceDevice->sendForceField(); - forceInEffect = 1; - } - } - else if (forceInEffect){ - forceDevice->stopForceField(); - forceInEffect = 0; - } - } -} /* main */ - diff --git a/src/vrpn/client_src/haptic/smdvrpn.C b/src/vrpn/client_src/haptic/smdvrpn.C deleted file mode 100644 index eb7cb963688a9a862eecc959018be091b04084be..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/haptic/smdvrpn.C +++ /dev/null @@ -1,310 +0,0 @@ -#include <stdio.h> -#include "vrpn_Tracker.h" -#include "vrpn_Button.h" -#include "vrpn_ForceDevice.h" -#include "quat.h" - -#include "glwin.h" -#include <GL/gl.h> -#include <GL/glu.h> -#include <GL/glx.h> - - -typedef struct { - float x; // position - float y; - float z; -} pos; - -typedef struct { - float fx; - float fy; - float fz; -} force; - -typedef struct { - float x; - float y; - float z; - float vx; - float vy; - float vz; - float ax; - float ay; - float az; - float mass; - float charge; -} state; - -void handle_tracker(void *userdata, const vrpn_TRACKERCB t) { - pos *p = (pos *) userdata; - - p->x = -t.pos[0]; - p->y = t.pos[1]; - p->z = -t.pos[2]; -} - -void handle_force(void *userdata, const vrpn_FORCECB fcb) { - force *f = (force *) userdata; - - f->fx = -fcb.force[0]; - f->fy = fcb.force[1]; - f->fz = -fcb.force[2]; -} - - -void handle_button(void *userdata, const vrpn_BUTTONCB b) { - - switch (b.button) { - case 0: - *(int *)userdata = b.state; - if (b.state == 1) printf("Force field enabled\n"); - else printf("Force field disabled\n"); - break; - default: - printf("Unknown button %3d was pressed\n",b.button); - } - fflush(stdout); -} - -void init_graphics(void *myglwin) -{ - // allw the window to open and do its stuff once - glwin_handle_events(myglwin); - - // setup OpenGL state... - glShadeModel(GL_SMOOTH); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(45.0, 1.0, 0.01, 10.0); - gluLookAt( 0.0, 0.1, -5.0, // eye pos - 0.0, 0.0, 0.0, // look at this point - 0.0, 1.0, 0.0); // up direction - glClearColor(0.0, 0.0, 0.0, 0.0); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glEnable(GL_DEPTH_TEST); - - // - // Setup cute lighting parms.. - // - glEnable(GL_LIGHTING); - GLfloat lpos[] = { 0.0, 0.0, -100.0, 1.0}; - GLfloat lamb[] = { 0.05, 0.05, 0.05, 1.0}; - GLfloat ldif[] = { 0.5, 0.5, 0.5, 1.0}; - GLfloat lspc[] = { 0.5, 0.5, 0.5, 1.0}; - - glLightfv(GL_LIGHT0, GL_POSITION, lpos); - glLightfv(GL_LIGHT0, GL_AMBIENT, lamb); - glLightfv(GL_LIGHT0, GL_DIFFUSE, ldif); - glLightfv(GL_LIGHT0, GL_SPECULAR, lspc); - glLightf(GL_LIGHT0, GL_SHININESS, 400.0); - glEnable(GL_LIGHT0); - - GLfloat mdif[] = {0.9, 0.0, 0.2, 1.0}; - GLfloat mspc[] = {0.2, 0.2, 0.2, 1.0}; - glMaterialfv(GL_FRONT, GL_DIFFUSE, mdif); - glMaterialfv(GL_FRONT, GL_SPECULAR, mspc); - glEnable(GL_COLOR_MATERIAL); -} - -void draw_axes() { - // - // Draw Coordinate Axes - // - glDisable(GL_LIGHTING); - glBegin(GL_LINES); - float i; - - glColor3f(0.0, 1.0, 0.0); - for (i=-10; i<10; i += 0.50) { - glVertex3f( -10.0, 0.0, i); - glVertex3f( 10.0, 0.0, i); - glVertex3f( i, 0.0, -10.0); - glVertex3f( i, 0.0, 10.0); - } - for (i=-10; i<10; i += 0.50) { - glVertex3f( -10.0, 1.0, i); - glVertex3f( 10.0, 1.0, i); - glVertex3f( i, 1.0, -10.0); - glVertex3f( i, 1.0, 10.0); - } - glEnd(); -} - -void draw_tracker_and_atom(force *p, GLUquadricObj *qobj, - state *atom, GLUquadricObj *qatom) -{ - float x, y, z; - float atomx, atomy, atomz; - - - // Convert from atom coordinates to scene coordinates - atomx = atom->x; - atomy = atom->y; - atomz = atom->z; - - // Convert from haptic coordinates to our scene coordinates - x=-(p->fx) + atomx; - y=-(p->fy) + atomy; - z=-(p->fz) + atomz; - - // First draw line from tracker to atom - glColor3f(1.0, 1.0, 1.0); - glBegin(GL_LINES); - glVertex3f(x, y, z); - glVertex3f(atomx, atomy, atomz); - glEnd(); - - - glEnable(GL_LIGHTING); - glColor3f(1.0, 0.0, 0.2); - glPushMatrix(); - glTranslatef(x, y, z); - gluSphere(qobj, 0.2, 32, 32); - glPopMatrix(); - glColor3f(0.0, 1.0, 0.2); - glPushMatrix(); - glTranslatef(atomx, atomy, atomz); - gluSphere(qobj, 0.2, 32, 32); - glPopMatrix(); -} -void apply_bc(state *atom) -{ - const float floor_k = 20.0; - const float maxdim = 1.0; - const float nearclip = 3.99; - const float farclip = 5.0; - - if (atom->y < 0) atom->ay -= floor_k*atom->y/atom->mass; - if (atom->y > maxdim) atom->ay -= floor_k*(atom->y-maxdim)/atom->mass; - - if (atom->x > maxdim) atom->ax -= floor_k*(atom->x-maxdim)/atom->mass; - if (atom->x < -maxdim) atom->ax -= floor_k*(atom->x+maxdim)/atom->mass; - - if (atom->z > farclip) atom->az -= floor_k*(atom->z-farclip)/atom->mass; - if (atom->z < -nearclip) atom->az -= floor_k*(atom->z+nearclip)/atom->mass; -} - -void run_dynamics(state *atom, force *f) -{ - const int N=1; - const float dt = 0.0004; - - for (int i=0; i < N; i++) { - atom->x += dt*atom->vx + .5*dt*dt*atom->ax; - atom->y += dt*atom->vy + .5*dt*dt*atom->ay; - atom->z += dt*atom->vz + .5*dt*dt*atom->az; - - atom->vx += 0.5*dt*(atom->ax); - atom->vy += 0.5*dt*(atom->ay); - atom->vz += 0.5*dt*(atom->az); - - atom->ax = -f->fx/atom->mass; - atom->ay = -f->fy/atom->mass; - atom->az = -f->fz/atom->mass; - - apply_bc(atom); - - atom->vx += 0.5*dt*(atom->ax); - atom->vy += 0.5*dt*(atom->ay); - atom->vz += 0.5*dt*(atom->az); - } -} - -int main(int argc, char **argv) { - if (argc < 2) { - printf("%s: Invalid parms\n", argv[0]); - printf("usage: \n"); - printf(" %s Tracker0@host\n", argv[0]); - - return -1; - } - char *server = argv[1]; - pos *phan_position = new pos; - pos *phan_offset = new pos; - force *phan_force = new force; - state *atom_state = new state; - - int ff_enabled, ff_active; - double kspr = 500.0; // Units??? - - vrpn_Tracker_Remote *tkr; - vrpn_Button_Remote *btn; - vrpn_ForceDevice_Remote *fdv; - - printf("Opening: %s ...\n", server); - - tkr = new vrpn_Tracker_Remote(server); - tkr->register_change_handler(phan_position, handle_tracker); - - btn = new vrpn_Button_Remote(server); - btn->register_change_handler(&ff_enabled, handle_button); - - fdv = new vrpn_ForceDevice_Remote(server); - fdv->register_force_change_handler(phan_force, handle_force); - - void * myglwin = glwin_create(700, 700); - if (myglwin == NULL) { - printf("Failed to open OpenGL window!!\n"); - return -1; - } - atom_state->x = 0.0; atom_state->y = 0.0; atom_state->z = 0.0; - atom_state->vx = 0.0; atom_state->vy = 0.0; atom_state->vz = 0.0; - atom_state->ax = 0.0; atom_state->ay = 0.0; atom_state->az = 0.0; - atom_state->mass = .001; - - ff_active = 0; - - init_graphics(myglwin); - GLUquadricObj *qobj = gluNewQuadric(); - GLUquadricObj *qatom = gluNewQuadric(); - - /* - * main interactive loop - */ - while (1) { - // Let the tracker do its thing - tkr->mainloop(); - btn->mainloop(); - fdv->mainloop(); - - run_dynamics(atom_state, phan_force); - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - if (ff_enabled ) { - if (!ff_active) { - // Set up force field so initially the force is zero - phan_offset->x = phan_position->x - .2*atom_state->x; - phan_offset->y = phan_position->y - .2*atom_state->y; - phan_offset->z = phan_position->z - .2*atom_state->z; - } - - // Now turn the force field on - // scene -> haptic: rotate 180 about the y axis - fdv->setConstraintMode(vrpn_ForceDevice::POINT_CONSTRAINT); - float cpos[3]; - cpos[0] = -(.2*atom_state->x + phan_offset->x); - cpos[1] = (.2*atom_state->y + phan_offset->y); - cpos[2] = -(.2*atom_state->z + phan_offset->z); - fdv->setConstraintPoint(cpos); - fdv->setConstraintKSpring(kspr); - fdv->enableConstraint(1); // enable force field - - - ff_active = 1; - } - else if (ff_active) { - fdv->enableConstraint(0); // disable force field - ff_active = 0; - } - - draw_axes(); - - draw_tracker_and_atom(phan_force, qobj, atom_state, qatom); - - glwin_swap_buffers(myglwin); - } -} /* main */ diff --git a/src/vrpn/client_src/haptic/testvrpn.C b/src/vrpn/client_src/haptic/testvrpn.C deleted file mode 100644 index d4601aae85e8808df99f326f47d4c1ea4c2001f1..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/haptic/testvrpn.C +++ /dev/null @@ -1,71 +0,0 @@ -#include <stdio.h> -#include "vrpn_Tracker.h" -#include "vrpn_Button.h" -#include "vrpn_ForceDevice.h" - -void handle_tracker(void *userdata, const vrpn_TRACKERCB t) { - printf("Sensor %3d is now at (%11f, %11f, %11f, %11f, %11f, %11f, %11f) \r", - t.sensor, t.pos[0], t.pos[1], t.pos[2], - t.quat[0], t.quat[1], t.quat[2], t.quat[3]); - fflush(stdout); -} - -void handle_button(void *userdata, const vrpn_BUTTONCB b) { - printf("\nButton %3d is in state: %d \n", - b.button, b.state); - fflush(stdout); -} - -void handle_force(void *userdata, const vrpn_FORCECB f) { - static vrpn_FORCECB lr; // last report - static int first_report_done = 0; - - if ((!first_report_done) || ((f.force[0] != lr.force[0]) || - (f.force[1] != lr.force[1]) || (f.force[2] != lr.force[2]))) - printf("\nForce is (%11f, %11f, %11f) \n", - f.force[0], f.force[1], f.force[2]); - - first_report_done = 1; - lr = f; -} - - - -int main(int argc, char **argv) { - char * server; - - vrpn_Tracker_Remote *tkr; - vrpn_Button_Remote *btn; - vrpn_ForceDevice_Remote *fdv; - - - if (argc < 2) { - printf("%s: Invalid parms\n", argv[0]); - printf("usage: \n"); - printf(" %s Tracker0@host\n", argv[0]); - - return -1; - } - server = argv[1]; - - printf("Opening: %s ...\n", server); - tkr = new vrpn_Tracker_Remote(server); - tkr->register_change_handler(NULL, handle_tracker); - - btn = new vrpn_Button_Remote(server); - btn->register_change_handler(NULL, handle_button); - - fdv = new vrpn_ForceDevice_Remote(server); - fdv->register_force_change_handler(NULL, handle_force); - - tkr->reset_origin(); - /* - * main interactive loop - */ - while (1) { - // Let the tracker do its thing - tkr->mainloop(); - btn->mainloop(); - fdv->mainloop(); - } -} /* main */ diff --git a/src/vrpn/client_src/logfilesenders b/src/vrpn/client_src/logfilesenders deleted file mode 100755 index e66e8074a72070fb1defa23261f86aae1aa2b38a..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/logfilesenders and /dev/null differ diff --git a/src/vrpn/client_src/logfilesenders.C b/src/vrpn/client_src/logfilesenders.C deleted file mode 100644 index 6fb88282e6fa1f6766e01ceb745a00b9c5ff8747..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/logfilesenders.C +++ /dev/null @@ -1,91 +0,0 @@ -#include <fcntl.h> // for open, O_RDONLY -#ifndef _WIN32 -#include <netinet/in.h> // for ntohl -#include <unistd.h> // for close, read -#endif -#include <stdio.h> // for printf, fprintf, stderr -#include <stdlib.h> // for exit -#include <vrpn_Connection.h> // for vrpn_HANDLERPARAM, etc - -#include "vrpn_Shared.h" // for timeval - -const int buflen = 8000; - -void Usage (const char * name) { - fprintf(stderr, "Usage: %s <filename>\n", name); -} - - -int main (int argc, char ** argv) { - - char buffer [buflen]; - vrpn_HANDLERPARAM header; - int file; - int retval; - - if (argc != 2) { - Usage(argv[0]); - exit(0); - } - - file = open(argv[1], O_RDONLY); - if (file == -1) { - fprintf(stderr, "Couldn't open \"%s\".\n", argv[1]); - exit(0); - } - - while (1) { - - int len; - struct timeval time; - long sender; - long type; - int len2; - - retval = read(file, &header, sizeof(header)); - if (retval < 0) { printf("ERROR\n"); close(file); exit(0); } - if (!retval) { printf("EOF\n"); close(file); exit(0); } - - len = ntohl(header.payload_len); - time.tv_sec = ntohl(header.msg_time.tv_sec); - time.tv_usec = ntohl(header.msg_time.tv_usec); - sender = ntohl(header.sender); - type = ntohl(header.type); - - //printf("Message type %d, sender %d, payload length %d\n", - //type, sender, len); - - retval = read(file, buffer, len); - if (retval < 0) { printf("ERROR\n"); close(file); exit(0); } - if (!retval) { printf("EOF\n"); close(file); exit(0); } - - //printf(" <%d bytes>\n", retval); - - switch (type) { - - case vrpn_CONNECTION_SENDER_DESCRIPTION: - len2 = ntohl(* ((int *) buffer)); - buffer[len2 + sizeof(int)] = 0; - printf(" The name of sender #%ld is \"%s\".\n", sender, buffer + sizeof(int)); - break; - - case vrpn_CONNECTION_TYPE_DESCRIPTION: - len2 = ntohl(* ((int *) buffer)); - buffer[len2 + sizeof(int)] = 0; - //printf(" The name of type #%d is \"%s\".\n", sender, buffer + sizeof(int)); - break; - - case vrpn_CONNECTION_UDP_DESCRIPTION: - buffer[len] = 0; - //printf(" UDP host is \"%s\", port %d.\n", buffer, sender); - break; - - case vrpn_CONNECTION_LOG_DESCRIPTION: - buffer[len] = 0; - //printf(" Log to file \"%s\".\n", buffer); - break; - - } - } -} - diff --git a/src/vrpn/client_src/logfiletypes b/src/vrpn/client_src/logfiletypes deleted file mode 100755 index d92e0631391c97703c51266b20eb4c5ba197de74..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/logfiletypes and /dev/null differ diff --git a/src/vrpn/client_src/logfiletypes.C b/src/vrpn/client_src/logfiletypes.C deleted file mode 100644 index 84a99535098d4e53abadef24aebc099412bbf0c0..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/logfiletypes.C +++ /dev/null @@ -1,90 +0,0 @@ -#include <fcntl.h> // for open, O_RDONLY -#ifndef _WIN32 -#include <netinet/in.h> // for ntohl -#include <unistd.h> // for close, read -#endif -#include <stdio.h> // for printf, fprintf, stderr -#include <stdlib.h> // for exit -#include <vrpn_Connection.h> // for vrpn_HANDLERPARAM, etc - -#include "vrpn_Shared.h" // for timeval - -const int buflen = 8000; - -void Usage (const char * name) { - fprintf(stderr, "Usage: %s <filename>\n", name); -} - -int main (int argc, char ** argv) { - - char buffer [buflen]; - vrpn_HANDLERPARAM header; - int file; - int retval; - - if (argc != 2) { - Usage(argv[0]); - exit(0); - } - - file = open(argv[1], O_RDONLY); - if (file == -1) { - fprintf(stderr, "Couldn't open \"%s\".\n", argv[1]); - exit(0); - } - - while (1) { - - int len; - struct timeval time; - long sender; - long type; - int len2; - - retval = read(file, &header, sizeof(header)); - if (retval < 0) { printf("ERROR\n"); close(file); exit(0); } - if (!retval) { printf("EOF\n"); close(file); exit(0); } - - len = ntohl(header.payload_len); - time.tv_sec = ntohl(header.msg_time.tv_sec); - time.tv_usec = ntohl(header.msg_time.tv_usec); - sender = ntohl(header.sender); - type = ntohl(header.type); - - //printf("Message type %d, sender %d, payload length %d\n", - //type, sender, len); - - retval = read(file, buffer, len); - if (retval < 0) { printf("ERROR\n"); close(file); exit(0); } - if (!retval) { printf("EOF\n"); close(file); exit(0); } - - //printf(" <%d bytes>\n", retval); - - switch (type) { - - case vrpn_CONNECTION_SENDER_DESCRIPTION: - len2 = ntohl(* ((int *) buffer)); - buffer[len2 + sizeof(int)] = 0; - //printf(" The name of sender #%d is \"%s\".\n", sender, buffer + sizeof(int)); - break; - - case vrpn_CONNECTION_TYPE_DESCRIPTION: - len2 = ntohl(* ((int *) buffer)); - buffer[len2 + sizeof(int)] = 0; - printf(" The name of type #%ld is \"%s\".\n", sender, buffer + sizeof(int)); - break; - - case vrpn_CONNECTION_UDP_DESCRIPTION: - buffer[len] = 0; - //printf(" UDP host is \"%s\", port %d.\n", buffer, sender); - break; - - case vrpn_CONNECTION_LOG_DESCRIPTION: - buffer[len] = 0; - //printf(" Log to file \"%s\".\n", buffer); - break; - - } - } -} - diff --git a/src/vrpn/client_src/midi_client.C b/src/vrpn/client_src/midi_client.C deleted file mode 100644 index d5961954a8a5156388002923e4cec296c8391937..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/midi_client.C +++ /dev/null @@ -1,37 +0,0 @@ -#include <unistd.h> -#include <stdio.h> -#include "vrpn_Sound.h" - -char *SERVER = "Sound0@ioph100"; - -int main() -{ - vrpn_Sound_Remote *remote; - remote = new vrpn_Sound_Remote(SERVER); - printf("Opened sound server %s\n",SERVER); - - printf("Playing at level 0.24:\n"); - remote->play_midi_sound(0.24); - remote->mainloop(); - sleep (10); - - printf("Playing at level 0.45:\n"); - remote->play_midi_sound(0.45); - remote->mainloop(); - sleep (10); - - printf("Playing at level 0.74:\n"); - remote->play_midi_sound(0.74); - remote->mainloop(); - sleep (10); - - printf("Playing at level 1.00:\n"); - remote->play_midi_sound(1.00); - remote->mainloop(); - sleep (10); - - printf("...Done\n"); - remote->play_stop(1); - remote->mainloop(); - return 0; -} diff --git a/src/vrpn/client_src/pc_linux64/add_vrpn_cookie b/src/vrpn/client_src/pc_linux64/add_vrpn_cookie deleted file mode 100755 index 62323f344a21cfa9c2a238fe3a498cf94b7db7d4..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/add_vrpn_cookie and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/bdbox_client b/src/vrpn/client_src/pc_linux64/bdbox_client deleted file mode 100755 index 3ac0dd842ee3c14570aa54646109955eb4f28ec6..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/bdbox_client and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/c_interface_example b/src/vrpn/client_src/pc_linux64/c_interface_example deleted file mode 100755 index b83ee3e26fe54914bda360a4bb28cd00f8b975a2..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/c_interface_example and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/checklogfile b/src/vrpn/client_src/pc_linux64/checklogfile deleted file mode 100755 index bcaff08b1259b8429d3b71073c313f88d03ee3ed..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/checklogfile and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/ff_client b/src/vrpn/client_src/pc_linux64/ff_client deleted file mode 100755 index d75eefae8253c9ea045165351edf0f8015190679..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/ff_client and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/forcedevice_test_client b/src/vrpn/client_src/pc_linux64/forcedevice_test_client deleted file mode 100755 index 1a5106dface0ee882c11903857de09748100057c..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/forcedevice_test_client and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/forwarderClient b/src/vrpn/client_src/pc_linux64/forwarderClient deleted file mode 100755 index 8df8651320fc24c6df78c5e8994949c10faed645..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/forwarderClient and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/phan_client b/src/vrpn/client_src/pc_linux64/phan_client deleted file mode 100755 index c243b13918886e63cce32947c7cda4d92b747da8..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/phan_client and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/printcereal b/src/vrpn/client_src/pc_linux64/printcereal deleted file mode 100755 index 63c1b408840c1ff860a2284e11bb8e638fac41e7..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/printcereal and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/printvals b/src/vrpn/client_src/pc_linux64/printvals deleted file mode 100755 index e6b46b50c5c601f269c4935c01e2f9537372cdf0..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/printvals and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/sphere_client b/src/vrpn/client_src/pc_linux64/sphere_client deleted file mode 100755 index 0bbc98873564b3034ce94c0416ab36026ba4fa36..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/sphere_client and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/test_imager b/src/vrpn/client_src/pc_linux64/test_imager deleted file mode 100755 index 1e2282791a979ec60788ddeb43e5faf7cd1be28d..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/test_imager and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/test_mutex b/src/vrpn/client_src/pc_linux64/test_mutex deleted file mode 100755 index ea06bca048a5bff440c85ff83fd4b51639368c0f..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/test_mutex and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/text b/src/vrpn/client_src/pc_linux64/text deleted file mode 100755 index 23f65842514317828a7a662c48ccee8bea37eef5..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/text and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/vrpn_ping b/src/vrpn/client_src/pc_linux64/vrpn_ping deleted file mode 100755 index 5f3d9b54b6a4d322eb6f4665b79e7fcf78e5d7e7..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/vrpn_ping and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/vrpn_print_devices b/src/vrpn/client_src/pc_linux64/vrpn_print_devices deleted file mode 100755 index 157321eb2dd4c652dec89d45fd14900685ceb3a6..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/vrpn_print_devices and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/vrpn_print_messages b/src/vrpn/client_src/pc_linux64/vrpn_print_messages deleted file mode 100755 index 02fce0326c4da1d41e5bc16b9e359c1320cc6644..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/vrpn_print_messages and /dev/null differ diff --git a/src/vrpn/client_src/pc_linux64/vrpn_print_performance b/src/vrpn/client_src/pc_linux64/vrpn_print_performance deleted file mode 100755 index 30c30ca28aed5705380bd2f16b47804a7e00b5b9..0000000000000000000000000000000000000000 Binary files a/src/vrpn/client_src/pc_linux64/vrpn_print_performance and /dev/null differ diff --git a/src/vrpn/client_src/phan_client.C b/src/vrpn/client_src/phan_client.C deleted file mode 100644 index b8ba6a896d46f12f51967277a7fef7f3b63cfa91..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/phan_client.C +++ /dev/null @@ -1,151 +0,0 @@ -// phan_client.C - simplest example: generates a flat horizontal plane - -#include <stdio.h> // for printf, NULL -#include <vrpn_Button.h> // for vrpn_BUTTONCB, etc -#include <vrpn_Tracker.h> // for vrpn_TRACKERCB, etc - -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Connection.h" // for vrpn_Connection -#include "vrpn_ForceDevice.h" // for vrpn_ForceDevice_Remote, etc -#include "vrpn_Types.h" // for vrpn_float64 - -#define PHANTOM_SERVER "Tracker0@localhost" - -/***************************************************************************** - * - Callback handler - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_force_change(void *userdata, const vrpn_FORCECB f) -{ - static vrpn_FORCECB lr; // last report - static int first_report_done = 0; - - if ((!first_report_done) || - ((f.force[0] != lr.force[0]) || (f.force[1] != lr.force[1]) - || (f.force[2] != lr.force[2]))) - printf("force is (%f,%f,%f)\n", f.force[0], f.force[1], f.force[2]); - first_report_done = 1; - lr = f; -} - -void VRPN_CALLBACK handle_tracker_change(void *userdata, const vrpn_TRACKERCB t) -{ - static vrpn_TRACKERCB lr; // last report - static float dist_interval_sq = 0.004f; - - if ((lr.pos[0] - t.pos[0])*(lr.pos[0] - t.pos[0]) + - (lr.pos[1] - t.pos[1])*(lr.pos[1] - t.pos[1]) + - (lr.pos[2] - t.pos[2])*(lr.pos[2] - t.pos[2]) > dist_interval_sq){ - printf("Sensor %d is now at (%g,%g,%g)\n", t.sensor, - t.pos[0], t.pos[1], t.pos[2]); - lr = t; - } -} - -void VRPN_CALLBACK handle_button_change(void *userdata, const vrpn_BUTTONCB b) -{ - static int count=0; - static int buttonstate = 1; - int done = 0; - - if (b.state != buttonstate) { - printf("button #%d is in state %d\n", b.button, b.state); - buttonstate = b.state; - count++; - } - if (count > 4) - done = 1; - *(int *)userdata = done; -} - -int main(int argc, char *argv[]) -{ - printf("generates a flat horizontal plane on ForceDevice %s\n", PHANTOM_SERVER); - int done = 0; - vrpn_ForceDevice_Remote *forceDevice; - vrpn_Tracker_Remote *tracker; - vrpn_Button_Remote *button; - - // initialize the force device - forceDevice = new vrpn_ForceDevice_Remote(PHANTOM_SERVER); - forceDevice->register_force_change_handler(NULL, handle_force_change); - - // initialize the tracker - tracker = new vrpn_Tracker_Remote(PHANTOM_SERVER); - tracker->register_change_handler(NULL, handle_tracker_change); - - // initialize the button - button = new vrpn_Button_Remote(PHANTOM_SERVER); - button->register_change_handler(&done, handle_button_change); - - while (!forceDevice->connectionPtr()->connected()) { - forceDevice->mainloop(); - } - - // Set plane and surface parameters - forceDevice->set_plane(0.0, 1.0, 0.0, 0.0); - forceDevice->setSurfaceKspring(0.8f); // spring constant - units of - // dynes/cm - forceDevice->setSurfaceKdamping(0.0); // damping constant - - // units of dynes*sec/cm - forceDevice->setSurfaceFstatic(0.0); // set static friction - forceDevice->setSurfaceFdynamic(0.0); // set dynamic friction - forceDevice->setRecoveryTime(10); // recovery occurs over 10 - // force update cycles - - forceDevice->setSurfaceBuzzAmplitude(0.0); - forceDevice->setSurfaceBuzzFrequency(60.0); - forceDevice->setSurfaceTextureAmplitude(0.0); - forceDevice->setSurfaceTextureWavelength(0.01f); - - // enable force device and send first surface - forceDevice->startSurface(); - -/* - // test spring constraint instead - - vrpn_float32 p [3]; - p[0] = 0.0f; - p[1] = 0.0f; - p[2] = 0.0f; - vrpn_float32 d [3]; - d[0] = 0.0f; - d[1] = 1.0f; - d[2] = 0.0f; - - //forceDevice->setConstraintMode(vrpn_ForceDevice::POINT_CONSTRAINT); - //forceDevice->setConstraintPoint(p); - // works - //forceDevice->setConstraintMode(vrpn_ForceDevice::LINE_CONSTRAINT); - //forceDevice->setConstraintLinePoint(p); - //forceDevice->setConstraintLineDirection(d); - // works - - forceDevice->setConstraintMode(vrpn_ForceDevice::PLANE_CONSTRAINT); - forceDevice->setConstraintPlanePoint(p); - forceDevice->setConstraintPlaneNormal(d); - forceDevice->setConstraintKSpring(10.0); - forceDevice->enableConstraint(1); -*/ - - // main loop - while (! done ){ - // Let the forceDevice send its planes to remote force device - forceDevice->mainloop(); - // Let tracker receive position information from remote tracker - tracker->mainloop(); - // Let button receive button status from remote button - button->mainloop(); - // we may call forceDevice->set_plane(...) followed by - // forceDevice->sendSurface() here to change the plane - // for example: using position information from a tracker we can - // compute a plane to approximate a complex surface at that - // position and send that approximation 15-30 times per - // second to simulate the complex surface - } - // shut off force device - forceDevice->stopSurface(); - -} /* main */ diff --git a/src/vrpn/client_src/printcereal.C b/src/vrpn/client_src/printcereal.C deleted file mode 100644 index 3c9b5eadef5046e1079da37e3598eaf8799c42a7..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/printcereal.C +++ /dev/null @@ -1,147 +0,0 @@ -#include <signal.h> // for signal, SIGINT -#include <stdio.h> // for printf, fprintf, stderr, etc -#include <stdlib.h> // for exit - -#include "vrpn_Analog.h" // for vrpn_Analog_Remote, etc -#include "vrpn_Button.h" // for vrpn_Button_Remote, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Dial.h" // for vrpn_DIALCB, etc -#include "vrpn_Shared.h" // for vrpn_SleepMsecs -#include "vrpn_Types.h" // for vrpn_float64 - -vrpn_Button_Remote *btn; -vrpn_Analog_Remote *ana; -vrpn_Dial_Remote *dial; - -int done = 0; - -const int MAX_DIALS = 128; -vrpn_float64 cur_dial_values[MAX_DIALS]; - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_button (void *, const vrpn_BUTTONCB b) -{ - printf("B%d->%d\n", b.button, b.state); -} - -void VRPN_CALLBACK handle_analog (void *, const vrpn_ANALOGCB a) -{ - int i; - printf("Analogs: "); - for (i = 0; i < a.num_channel; i++) { - printf("%4.2f ",a.channel[i]); - } - printf("\n"); -} - - -void VRPN_CALLBACK handle_dial (void *, const vrpn_DIALCB d) -{ - cur_dial_values[d.dial] += d.change; - printf("Dial %d spun by %lf (currently at %lf)\n", d.dial, d.change, - cur_dial_values[d.dial]); -} - - -/***************************************************************************** - * - init - initialize everything - * - *****************************************************************************/ - -void init (const char * devicename) -{ - int i; - - fprintf(stderr, "Button's name is %s.\n", devicename); - btn = new vrpn_Button_Remote (devicename); - - fprintf(stderr, "Analog's name is %s.\n", devicename); - ana = new vrpn_Analog_Remote (devicename); - - fprintf(stderr, "Dial's name is %s.\n", devicename); - dial = new vrpn_Dial_Remote (devicename); - - // Zero all of the dial records - for (i = 0; i < MAX_DIALS; i++) { - cur_dial_values[i] = 0.0; - } - - // Set up the callback handlers - printf("Button update: B<number> is <newstate>\n"); - btn->register_change_handler(NULL, handle_button); - printf("Analog update: Analogs: [new values listed]\n"); - ana->register_change_handler(NULL, handle_analog); - printf("Dial update: Dial# spun by [amount]\n"); - dial->register_change_handler(NULL, handle_dial); - -} /* init */ - - -void handle_cntl_c (int) { - done = 1; -} - -void shutdown (void) { - - fprintf(stderr, "\nIn control-c handler.\n"); - - if (btn) delete btn; - if (ana) delete ana; - if (dial) delete dial; - - exit(0); -} - -int main (int argc, char * argv []) -{ - -#ifdef hpux - char default_station_name [100]; - strcpy(default_station_name, "CerealBox@ioglab"); -#else - char default_station_name [] = { "CerealBox@ioglab" }; -#endif - - const char * station_name = default_station_name; - - if (argc < 2) { - fprintf(stderr, "Usage: %s Device_name\n" - " Device_name: VRPN name of data source to contact\n" - " example: CerealBox@ioglab\n", - argv[0]); - exit(0); - } - - // parse args - - station_name = argv[1]; - - // initialize the PC/station - init(station_name); - - // signal handler so logfiles get closed right - signal(SIGINT, handle_cntl_c); - - /* - * main interactive loop - */ - while ( ! done ) - { - // Let the tracker and button do their things - btn->mainloop(); - ana->mainloop(); - dial->mainloop(); - - // Sleep for 1ms so we don't eat the CPU - vrpn_SleepMsecs(1); - } - - shutdown(); - return 0; -} /* main */ diff --git a/src/vrpn/client_src/printcereal.dsp b/src/vrpn/client_src/printcereal.dsp deleted file mode 100644 index bb4f2b9a0575b9b2b6a49f988c221935adb58fcf..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/printcereal.dsp +++ /dev/null @@ -1,90 +0,0 @@ -# Microsoft Developer Studio Project File - Name="printcereal" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=printcereal - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "printcereal.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "printcereal.mak" CFG="printcereal - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "printcereal - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "printcereal - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "printcereal - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/client_src/printcereal/Release" -# PROP Intermediate_Dir "../pc_win32/client_src/printcereal/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "printcereal - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/client_src/printcereal/Debug" -# PROP Intermediate_Dir "../pc_win32/client_src/printcereal/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\\" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "printcereal - Win32 Release" -# Name "printcereal - Win32 Debug" -# Begin Source File - -SOURCE=printcereal.C -# End Source File -# End Target -# End Project diff --git a/src/vrpn/client_src/printcereal.vcproj b/src/vrpn/client_src/printcereal.vcproj deleted file mode 100644 index 6ef2170716b1f4b6793b6f2423163701cf68ae31..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/printcereal.vcproj +++ /dev/null @@ -1,229 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="printcereal" - ProjectGUID="{4FC1C71E-8977-438B-AE1D-F1CD7D2C2D03}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/client_src/printcereal/Release" - IntermediateDirectory=".\../pc_win32/client_src/printcereal/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/printcereal/Release/printcereal.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";.." - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/client_src/printcereal/Release/printcereal.pch" - AssemblerListingLocation=".\../pc_win32/client_src/printcereal/Release/" - ObjectFile=".\../pc_win32/client_src/printcereal/Release/" - ProgramDataBaseFileName=".\../pc_win32/client_src/printcereal/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/client_src/printcereal/Release/printcereal.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/client_src/printcereal/Release/printcereal.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/printcereal/Release/printcereal.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/client_src/printcereal/Debug" - IntermediateDirectory=".\../pc_win32/client_src/printcereal/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/printcereal/Debug/printcereal.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";.." - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/client_src/printcereal/Debug/printcereal.pch" - AssemblerListingLocation=".\../pc_win32/client_src/printcereal/Debug/" - ObjectFile=".\../pc_win32/client_src/printcereal/Debug/" - ProgramDataBaseFileName=".\../pc_win32/client_src/printcereal/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/client_src/printcereal/Debug/printcereal.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/client_src/printcereal/Debug/printcereal.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/printcereal/Debug/printcereal.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <File - RelativePath="printcereal.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/client_src/printvals.C b/src/vrpn/client_src/printvals.C deleted file mode 100644 index e51856f83eab2c9dff9b03fc0162d371f0ea3f7b..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/printvals.C +++ /dev/null @@ -1,395 +0,0 @@ -#include <signal.h> // for signal, SIGINT -#include <stdio.h> // for fprintf, stderr, NULL, etc -#include <stdlib.h> // for atof, exit, atoi -#include <string.h> // for strcmp, strncmp -#include <vrpn_Configure.h> // for VRPN_CALLBACK -#include <vrpn_Button.h> // for vrpn_BUTTONCB -#include <vrpn_Shared.h> // for vrpn_SleepMsecs -#include <vrpn_Tracker.h> // for vrpn_TRACKERCB, etc - -#include <vrpn_Connection.h> // for vrpn_HANDLERPARAM -#include <vrpn_Types.h> // for vrpn_float64, vrpn_int32 -#include <vrpn_BaseClass.h> // for vrpn_System_TextPrinter, etc -#include <vrpn_FileConnection.h> -#include <vrpn_FileController.h> -#include <vrpn_RedundantTransmission.h> -//#include <vrpn_DelayedConnection.h> - -vrpn_Button_Remote *btn,*btn2; -vrpn_Tracker_Remote *tkr; -vrpn_Connection * c; -vrpn_File_Controller * fc; - -vrpn_RedundantRemote * rc; - -int print_for_tracker = 1; // Print tracker reports? -int beQuiet = 0; -int beRedundant = 0; -int redNum = 0; -double redTime = 0.0; -double delayTime = 0.0; - -int done = 0; // Signals that the program should exit - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_pos (void *, const vrpn_TRACKERCB t) -{ - static int count = 0; - - if (!print_for_tracker) { return; }; - fprintf(stderr, "%d.", t.sensor); - if ((++count % 20) == 0) { - fprintf(stderr, "\n"); - if (count > 300) { - printf("Pos, sensor %d = %5.3f, %5.3f, %5.3f", t.sensor, - t.pos[0], t.pos[1], t.pos[2]); - printf(" Quat = %5.2f, %5.2f, %5.2f, %5.2f\n", - t.quat[0], t.quat[1], t.quat[2], t.quat[3]); - count = 0; - } - } -} - -void VRPN_CALLBACK handle_vel (void *, const vrpn_TRACKERVELCB t) -{ - //static int count = 0; - - if (!print_for_tracker) { return; }; - fprintf(stderr, "%d/", t.sensor); -} - -void VRPN_CALLBACK handle_acc (void *, const vrpn_TRACKERACCCB t) -{ - //static int count = 0; - - if (!print_for_tracker) { return; }; - fprintf(stderr, "%d~", t.sensor); -} - -void VRPN_CALLBACK handle_button (void *, const vrpn_BUTTONCB b) -{ - printf("B%d is %d\n", b.button, b.state); -} - -int VRPN_CALLBACK handle_gotConnection (void *, vrpn_HANDLERPARAM) { - - if (beRedundant) { - fprintf(stderr, "printvals got connection; " - "initializing redundant xmission.\n"); - rc->set(redNum, vrpn_MsecsTimeval(redTime * 1000.0)); - } - - return 0; -} - -int VRPN_CALLBACK filter_pos (void * userdata, vrpn_HANDLERPARAM p) { - - vrpn_Connection * c = (vrpn_Connection *) userdata; - int postype = c->register_message_type("Tracker Pos/Quat"); - - if (p.type == postype) - return 0; // keep position messages - - return 1; // discard all others -} - -/***************************************************************************** - * - init - initialize everything - * - *****************************************************************************/ - -void init (const char * station_name, - const char * local_in_logfile, const char * local_out_logfile, - const char * remote_in_logfile, const char * remote_out_logfile, - const char * NIC) -{ - char devicename [1000]; - //char * hn; - - vrpn_int32 gotConn_type; - - // explicitly open up connections with the proper logging parameters - // these will be entered in the table and found by the - // vrpn_get_connection_by_name() inside vrpn_Tracker and vrpn_Button - - sprintf(devicename, "Tracker0@%s", station_name); - if (!strncmp(station_name, "file:", 5)) { -fprintf(stderr, "Opening file %s.\n", station_name); - c = new vrpn_File_Connection (station_name); // now unnecessary! - if (local_in_logfile || local_out_logfile || - remote_in_logfile || remote_out_logfile) { - fprintf(stderr, "Warning: Reading from file, so not logging.\n"); - } - } else { -fprintf(stderr, "Connecting to host %s.\n", station_name); - c = vrpn_get_connection_by_name - (station_name, - local_in_logfile, local_out_logfile, - remote_in_logfile, remote_out_logfile, - NIC); - if (delayTime > 0.0) { - //((vrpn_DelayedConnection *) c)->setDelay - //(vrpn_MsecsTimeval(delayTime * 1000.0)); - //((vrpn_DelayedConnection *) c)->delayAllTypes(vrpn_TRUE); - } - } - - fc = new vrpn_File_Controller (c); - - if (beRedundant) { - rc = new vrpn_RedundantRemote (c); - } - -fprintf(stderr, "Tracker's name is %s.\n", devicename); - tkr = new vrpn_Tracker_Remote (devicename); - - - sprintf(devicename, "Button0@%s", station_name); -fprintf(stderr, "Button's name is %s.\n", devicename); - btn = new vrpn_Button_Remote (devicename); - sprintf(devicename, "Button1@%s", station_name); -fprintf(stderr, "Button 2's name is %s.\n", devicename); - btn2 = new vrpn_Button_Remote (devicename); - - - // Set up the tracker callback handler - printf("Tracker update: '.' = pos, '/' = vel, '~' = acc\n"); - tkr->register_change_handler(NULL, handle_pos); - tkr->register_change_handler(NULL, handle_vel); - tkr->register_change_handler(NULL, handle_acc); - - // Set up the button callback handler - printf("Button update: B<number> is <newstate>\n"); - btn->register_change_handler(NULL, handle_button); - btn2->register_change_handler(NULL, handle_button); - - gotConn_type = c->register_message_type(vrpn_got_connection); - - c->register_handler(gotConn_type, handle_gotConnection, NULL); - -} /* init */ - - -void shutdown () { - - const char * n; - long i; - - fprintf(stderr, "\nIn control-c handler.\n"); -/* Commented out this test code for the common case - static int invocations = 0; - if (!invocations) { - printf("(First press -- setting replay rate to 2.0 -- 3 more to exit)\n"); - fc->set_replay_rate(2.0f); - invocations++; - signal(SIGINT, handle_cntl_c); - return; - } - if (invocations == 1) { - printf("(Second press -- Starting replay over -- 2 more to exit)\n"); - fc->reset(); - invocations++; - signal(SIGINT, handle_cntl_c); - return; - } - if (invocations == 2) { - struct timeval t; - printf("(Third press -- Jumping replay to t+30 seconds -- " - "1 more to exit)\n"); - t.tv_sec = 30L; - t.tv_usec = 0L; - fc->play_to_time(t); - invocations++; - signal(SIGINT, handle_cntl_c); - return; - } -*/ - - // print out sender names - - if (c) - for (i = 0L; (n = c->sender_name(i)); i++) - printf("Knew local sender \"%s\".\n", n); - - // print out type names - - if (c) - for (i = 0L; (n = c->message_type_name(i)); i++) - printf("Knew local type \"%s\".\n", n); - - if (btn) - delete btn; - if (btn2) - delete btn2; - if (tkr) - delete tkr; - if (c) - delete c; - - exit(0); -} - -// WARNING: On Windows systems, this handler is called in a separate -// thread from the main program (this differs from Unix). To avoid all -// sorts of chaos as the main program continues to handle packets, we -// set a done flag here and let the main program shut down in its own -// thread by calling shutdown() to do all of the stuff we used to do in -// this handler. - -void handle_cntl_c(int) { - done = 1; -} - -void Usage (const char * arg0) { - fprintf(stderr, -"Usage: %s [-lli logfile] [-llo logfile] [-rli logfile ] [-rlo logfile]\n" -" [-NIC ip] [-filterpos] [-quiet]\n" -" [-red num time] [-delay time] station_name\n" -" -notracker: Don't print tracker reports\n" -" -lli: log incoming messages locally in <logfile>\n" -" -llo: log outgoing messages locally in <logfile>\n" -" -rli: log incoming messages remotely in <logfile>\n" -" -rlo: log outgoing messages remotely in <logfile>\n" -" -NIC: use network interface with address <ip>\n" -" -filterpos: log only Tracker Position messages\n" -" -quiet: ignore VRPN warnings\n" -" -red <num> <time>: send every message <num>\n" -" times <time> seconds apart\n" -" -delay <time: delay all messages received by <time>\n" -" station_name: VRPN name of data source to contact\n" -" one of: <hostname>[:<portnum>]\n" -" file:<filename>\n", - arg0); - - exit(0); -} - -int main (int argc, char * argv []) -{ - -#ifdef hpux - char default_station_name [20]; - strcpy(default_station_name, "ioph100"); -#else - char default_station_name [] = { "ioph100" }; -#endif - - const char * station_name = default_station_name; - const char * local_in_logfile = NULL; - const char * local_out_logfile = NULL; - const char * remote_in_logfile = NULL; - const char * remote_out_logfile = NULL; - const char * NIC = NULL; - //long local_logmode = vrpn_LOG_NONE; - //long remote_logmode = vrpn_LOG_NONE; - int filter = 0; - int i; - -#ifdef _WIN32 - WSADATA wsaData; - int status; - if ((status = WSAStartup(MAKEWORD(1,1), &wsaData)) != 0) { - fprintf(stderr, "WSAStartup failed with %d\n", status); - exit(1); - } -#endif - - if (argc < 2) { - Usage(argv[0]); - } - - // parse args - - for (i = 1; i < argc; i++) { - if (!strcmp(argv[i], "-lli")) { - i++; - local_in_logfile = argv[i]; - } else if (!strcmp(argv[i], "-llo")) { - i++; - local_out_logfile = argv[i]; - } else if (!strcmp(argv[i], "-rli")) { - i++; - remote_in_logfile = argv[i]; - } else if (!strcmp(argv[i], "-rlo")) { - i++; - remote_out_logfile = argv[i]; - } else if (!strcmp(argv[i], "-notracker")) { - print_for_tracker = 0; - } else if (!strcmp(argv[i], "-filterpos")) { - filter = 1; - } else if (!strcmp(argv[i], "-NIC")) { - i++; - NIC = argv[i]; - } else if (!strcmp(argv[i], "-quiet")) { - beQuiet = 1; - } else if (!strcmp(argv[i], "-red")) { - beRedundant = 1; - i++; - redNum = atoi(argv[i]); - i++; - redTime = atof(argv[i]); - } else if (!strcmp(argv[i], "-delay")) { - i++; - delayTime = atof(argv[i]); - } else - station_name = argv[i]; - } - - // initialize the PC/station - init(station_name, - local_in_logfile, local_out_logfile, - remote_in_logfile, remote_out_logfile, - NIC); - - // signal handler so logfiles get closed right - signal(SIGINT, handle_cntl_c); - - // filter the log if requested - if (filter && c) { - c->register_log_filter(filter_pos, c); - } - - if (beQuiet) { - vrpn_System_TextPrinter.remove_object(btn); - vrpn_System_TextPrinter.remove_object(btn2); - vrpn_System_TextPrinter.remove_object(tkr); - if (beRedundant) { - vrpn_System_TextPrinter.remove_object(rc); - } - } - - if (beRedundant) { - rc->set(redNum, vrpn_MsecsTimeval(redTime * 1000.0)); - } - -/* - * main interactive loop - */ - while ( ! done ) { - - // Run this so control happens! - c->mainloop(); - - // Let the tracker and button do their things - btn->mainloop(); - btn2->mainloop(); - tkr->mainloop(); - - if (beRedundant) { - rc->mainloop(); - } - - // Sleep for 1ms so we don't eat the CPU - vrpn_SleepMsecs(1); - } - - shutdown(); - return 0; - -} /* main */ diff --git a/src/vrpn/client_src/printvals.dsp b/src/vrpn/client_src/printvals.dsp deleted file mode 100644 index f95b8c1331eb338018dab3a2fd85033c2b2ae44c..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/printvals.dsp +++ /dev/null @@ -1,92 +0,0 @@ -# Microsoft Developer Studio Project File - Name="printvals" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=printvals - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "printvals.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "printvals.mak" CFG="printvals - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "printvals - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "printvals - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "printvals - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/client_src/printvals/Release" -# PROP Intermediate_Dir "../pc_win32/client_src/printvals/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" -# SUBTRACT LINK32 /incremental:yes - -!ELSEIF "$(CFG)" == "printvals - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/client_src/printvals/Debug" -# PROP Intermediate_Dir "../pc_win32/client_src/printvals/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I ".." /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" -# SUBTRACT LINK32 /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "printvals - Win32 Release" -# Name "printvals - Win32 Debug" -# Begin Source File - -SOURCE=printvals.C -# End Source File -# End Target -# End Project diff --git a/src/vrpn/client_src/printvals.vcproj b/src/vrpn/client_src/printvals.vcproj deleted file mode 100644 index bb1917df9a2ff855201579b9182177e55d30e54f..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/printvals.vcproj +++ /dev/null @@ -1,228 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="printvals" - ProjectGUID="{A1B0D907-E30D-4CB9-B313-D342AD5CC3E7}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/client_src/printvals/Release" - IntermediateDirectory=".\../pc_win32/client_src/printvals/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/printvals/Release/printvals.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,.." - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/client_src/printvals/Release/printvals.pch" - AssemblerListingLocation=".\../pc_win32/client_src/printvals/Release/" - ObjectFile=".\../pc_win32/client_src/printvals/Release/" - ProgramDataBaseFileName=".\../pc_win32/client_src/printvals/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/client_src/printvals/Release/printvals.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/client_src/printvals/Release/printvals.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/printvals/Release/printvals.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/client_src/printvals/Debug" - IntermediateDirectory=".\../pc_win32/client_src/printvals/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/printvals/Debug/printvals.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,.." - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/client_src/printvals/Debug/printvals.pch" - AssemblerListingLocation=".\../pc_win32/client_src/printvals/Debug/" - ObjectFile=".\../pc_win32/client_src/printvals/Debug/" - ProgramDataBaseFileName=".\../pc_win32/client_src/printvals/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/client_src/printvals/Debug/printvals.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/client_src/printvals/Debug/printvals.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/printvals/Debug/printvals.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <File - RelativePath="printvals.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/client_src/run_auxiliary_logger.C b/src/vrpn/client_src/run_auxiliary_logger.C deleted file mode 100644 index 527117bf1a7a826b4155ef8a345d64715e34f527..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/run_auxiliary_logger.C +++ /dev/null @@ -1,163 +0,0 @@ -#include <stdio.h> // for fprintf, NULL, printf, etc -#include <stdlib.h> // for atoi, exit -#include <string.h> // for strcmp, strncpy - -#include "vrpn_Auxiliary_Logger.h" -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday, etc - -vrpn_Auxiliary_Logger_Remote *g_logger; - - -/***************************************************************************** - * - Callback handlers and the data structures they use to pass information - to the rest of the program. - * - *****************************************************************************/ - -// Caller sets to false before mainloop(); handle_log_report sets to true -// when a report arrives. -bool g_got_report = false; - -// Names returned to the log report handler. Filled in by the report handler. -const unsigned NAMELEN = 2048; -char g_local_in[NAMELEN]; -char g_local_out[NAMELEN]; -char g_remote_in[NAMELEN]; -char g_remote_out[NAMELEN]; - -void VRPN_CALLBACK handle_log_report (void *, const vrpn_AUXLOGGERCB info) -{ - strncpy(g_local_in, info.local_in_logfile_name, NAMELEN); - strncpy(g_local_out, info.local_out_logfile_name, NAMELEN); - strncpy(g_remote_in, info.remote_in_logfile_name, NAMELEN); - strncpy(g_remote_out, info.remote_out_logfile_name, NAMELEN); - printf( "log report: \'%s\' \'%s\' \'%s\' \'%s\'\n", - g_local_in, g_local_out, g_remote_in, g_remote_out ); - g_got_report = true; -} - -/***************************************************************************** - * - *****************************************************************************/ - -// Request some log files and wait up to a second for the report of these -// files. Return true if we got a report and the names match. -bool test_logfile_names(const char *local_in, const char *local_out, - const char *remote_in, const char *remote_out) -{ - struct timeval start; - struct timeval now; - - // Mark no report and the request logging with the specified - // parameters. - g_got_report = false; - if (!g_logger->send_logging_request(local_in, local_out, remote_in, remote_out)) { - fprintf(stderr, "test_logfile_names: Logging request send failed\n"); - return false; - } - - // Mainloop the logger for up to five seconds waiting for a response. - // If we don't get a response, this is a failure. - vrpn_gettimeofday(&start, NULL); - do { - g_logger->mainloop(); - vrpn_gettimeofday(&now, NULL); - vrpn_SleepMsecs(1); - } while ( !g_got_report && (vrpn_TimevalDurationSeconds(now, start) < 5.0)); - if (!g_got_report) { - fprintf(stderr, "test_logfile_names: Timeout waiting for report of logging from server\n"); - return false; - } - - // Check to see if the names are the same. Return true if they all are. - if ( (strcmp(g_local_in, local_in) == 0) && - (strcmp(g_local_out, local_out) == 0) && - (strcmp(g_remote_in, remote_in) == 0) && - (strcmp(g_remote_out, remote_out) == 0) ) { - return true; - } else { - return false; - } -} - - -/***************************************************************************** - * - init - initialize everything - * - *****************************************************************************/ - -int main (int argc, char * argv []) -{ - const char * devicename = "Logger0@localhost"; - const char * logfilename = "deleteme.vrpn"; - int log_duration_seconds = 120; - struct timeval start; - struct timeval now; - int ret = 0; - - // parse args - if (argc != 4) { - fprintf(stderr, "Usage: %s Device_name remote_logfile_name time_seconds\n" - " Device_name: VRPN name of data source to contact\n" - " example: Logger0@localhost\n" - " remote_logfile_name: The name of the file to log remotely\n" - " time_seconds: How long to log before closing and exiting\n", - argv[0]); - exit(0); - } else { - devicename = argv[1]; - logfilename = argv[2]; - log_duration_seconds = atoi(argv[3]); - } - - // Open the logger and set up its callback handler. - fprintf(stderr, "Logger's name is %s.\n", devicename); - g_logger = new vrpn_Auxiliary_Logger_Remote (devicename); - g_logger->register_report_handler(NULL, handle_log_report); - - // Main loop for half a second to get things started on the - // connection. - vrpn_gettimeofday(&start, NULL); - do { - g_logger->mainloop(); - vrpn_gettimeofday(&now, NULL); - } while (vrpn_TimevalDurationSeconds(now, start) < 0.5); - - // Try to create the named log file as the remote outgoing log - // on the server. Wait for the specified duration to give it - // time to log. - if (!test_logfile_names("", "", "", logfilename) ) { - fprintf(stderr,"Error creating remote outgoing log file %s\n",logfilename); - ret = -1; - } - vrpn_gettimeofday(&start, NULL); - do { - g_logger->mainloop(); - vrpn_gettimeofday(&now, NULL); - } while (vrpn_TimevalDurationSeconds(now, start) <= log_duration_seconds); - - // Try to create blank log files (no log should be made). Wait for a while after - // creation to give time to stop logging. - if (!test_logfile_names("", "", "", "") ) { - fprintf(stderr,"Error turning off logs\n"); - ret = -1; - } - vrpn_gettimeofday(&start, NULL); - do { - g_logger->mainloop(); - vrpn_gettimeofday(&now, NULL); - } while (vrpn_TimevalDurationSeconds(now, start) < 5.0); - - // Done. - if (ret == 0) { - printf("Success!\n"); - } else { - printf("Make sure that files with the requested names don't already exist.\n"); - } - delete g_logger; - return ret; - -} /* main */ diff --git a/src/vrpn/client_src/run_auxiliary_logger.dsp b/src/vrpn/client_src/run_auxiliary_logger.dsp deleted file mode 100644 index e49604c72ba54a6e727e3bb54b2d6f2f6dc5b779..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/run_auxiliary_logger.dsp +++ /dev/null @@ -1,90 +0,0 @@ -# Microsoft Developer Studio Project File - Name="run_auxiliary_logger" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=run_auxiliary_logger - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "run_auxiliary_logger.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "run_auxiliary_logger.mak" CFG="run_auxiliary_logger - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "run_auxiliary_logger - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "run_auxiliary_logger - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "run_auxiliary_logger - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/run_auxiliary_logger/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/run_auxiliary_logger/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\..\quat" /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "run_auxiliary_logger - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/run_auxiliary_logger/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/run_auxiliary_logger/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /I "..\..\quat" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "run_auxiliary_logger - Win32 Release" -# Name "run_auxiliary_logger - Win32 Debug" -# Begin Source File - -SOURCE=run_auxiliary_logger.C -# End Source File -# End Target -# End Project diff --git a/src/vrpn/client_src/run_auxiliary_logger.vcproj b/src/vrpn/client_src/run_auxiliary_logger.vcproj deleted file mode 100644 index 414f88d07034a1321f166b4bb534b6a590da5d5e..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/run_auxiliary_logger.vcproj +++ /dev/null @@ -1,242 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="run_auxiliary_logger" - ProjectGUID="{1D303E7B-DBBD-409B-BBEC-2A11AF9847A9}" - RootNamespace="run_auxiliary_logger" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/run_auxiliary_logger/Release" - IntermediateDirectory=".\../pc_win32/server_src/run_auxiliary_logger/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/run_auxiliary_logger/Release/run_auxiliary_logger.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,../quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/server_src/run_auxiliary_logger/Release/run_auxiliary_logger.pch" - AssemblerListingLocation=".\../pc_win32/server_src/run_auxiliary_logger/Release/" - ObjectFile=".\../pc_win32/server_src/run_auxiliary_logger/Release/" - ProgramDataBaseFileName=".\../pc_win32/server_src/run_auxiliary_logger/Release/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/run_auxiliary_logger/Release/run_auxiliary_logger.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/server_src/run_auxiliary_logger/Release/run_auxiliary_logger.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/run_auxiliary_logger/Release/run_auxiliary_logger.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/run_auxiliary_logger/Debug" - IntermediateDirectory=".\../pc_win32/server_src/run_auxiliary_logger/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/run_auxiliary_logger/Debug/run_auxiliary_logger.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,../quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/run_auxiliary_logger/Debug/run_auxiliary_logger.pch" - AssemblerListingLocation=".\../pc_win32/server_src/run_auxiliary_logger/Debug/" - ObjectFile=".\../pc_win32/server_src/run_auxiliary_logger/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/run_auxiliary_logger/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/run_auxiliary_logger/Debug/run_auxiliary_logger.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/server_src/run_auxiliary_logger/Debug/run_auxiliary_logger.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/run_auxiliary_logger/Debug/run_auxiliary_logger.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="run_auxiliary_logger.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/client_src/sound_client.C b/src/vrpn/client_src/sound_client.C deleted file mode 100644 index bfd770c3900d7d57ca3834df1422881c8bf89a82..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/sound_client.C +++ /dev/null @@ -1,220 +0,0 @@ -#include "vrpn_Sound.h" -#include <string.h> -#include <math.h> - -#define FASTSPEED 100 -#define CIRCLERADIUS 25.0F - -vrpn_Sound_Client *soundClient; -float X,Y,Z,adj; - - - -static void init_sample_values() -{ - Y=Z=0.0F; - - X=25.0F; - adj=0.0F; -} - -static void move_sample_values() -{ - // handle the circle movement - adj+=(2.0F*3.14159265358979F/(((FASTSPEED+1-50.0F)*1.6F)+20.0F)); - X=(float)(CIRCLERADIUS*cos(adj)); - Z=(float)(CIRCLERADIUS*sin(adj)); -} - -void loopSound(vrpn_SoundID id) -{ - vrpn_float64 position[3], orientation[4], velocity[4]; - - while(1) - { - //save old settings - position[0] = X; position[1] = Y; position[2] = Z; - orientation[0] = -X; orientation[1] = -Y; orientation[2] = -Z; orientation[3] = 1; - (void)soundClient->setSoundPose(id, position, orientation); - - // move the sample values - move_sample_values(); - - // calculate the delta vector - velocity[0]=X-position[0]; - velocity[1]=0-position[1]; - velocity[2]=Z-position[2]; - velocity[3]=((50.0F/300.0F)+1.0F)/1500.0F; - - (void)soundClient->setSoundVelocity(id,velocity); - soundClient->mainloop(); - if (X == 25.0F) - break; - vrpn_SleepMsecs(1); - } -} - -int main(int argc, char** argv) -{ - char server[80], device[80], dummy[80]; - vrpn_SoundID ids[100], id; - char files[100][80]; - int curID = 0; - int command; - int loop = 1, i; - vrpn_int32 repeat, volume; - vrpn_float64 position[3], orientation[4], velocity[4]; - vrpn_float64 Lposition[3], Lorientation[4], Lvelocity[4]; - - position[0] = 0; position[1] = 0; position[2] = 0; - orientation[0] = 0; orientation[1] = 0; orientation[2] = 1; orientation[3] = 0; - velocity[0] = 0; velocity[1] = 0; velocity[2] = 0; velocity[3] = 0; - - Lposition[0] = 0; Lposition[1] = 0; Lposition[2] = 0; - Lorientation[0] = 0; Lorientation[1] = 0; Lorientation[2] = -1; Lorientation[3] = 1; - Lvelocity[0] = 0; Lvelocity[1] = 0; Lvelocity[2] = 0; Lvelocity[3] = 0; - - printf("Please enter the server you wish to connect to.\n"); - scanf("%s", server); - printf("Please enter the sound device name you wish to connect to.\n"); - scanf("%s", device); - - vrpn_Connection *connection = vrpn_get_connection_by_name(server); - soundClient = new vrpn_Sound_Client(device, connection); - - for(i = 0; i < 100; i++) - ids[i] = -1; - - while(loop) - { - printf("Current sounds loaded\n"); - for(i = 0; i < 100; i++) - { - if (ids[i] == -1) - continue; - - if (i % 3 == 2) - printf("\n"); - else - printf("\t"); - printf("%d %s", ids[i], files[i]); - } - printf("\nOptions\n"); - printf("1) Load Sound\n"); - printf("2) Unload Sound\n"); - printf("3) Play Sound\n"); - printf("4) Stop Sound\n"); - printf("5) Change Sound Volume\n"); - printf("6) Change Sound Position\n"); - printf("7) Change Sound Orientation\n"); - printf("8) Change Sound Velocity\n"); - printf("9) Change Listener Position\n"); - printf("10) Change Listener Orientation\n"); - printf("11) Change Listener Velocity\n"); - printf("12) Loop sound around head\n"); - printf("13) Quit\n"); - printf("Choose option "); - scanf("%d", &command); - - switch(command) - { - case 1: { - printf("Enter path and file to load\n"); - scanf("%s", dummy); - vrpn_SoundDef SoundDef; - ids[curID] = soundClient->loadSound(dummy, curID, SoundDef); - strcpy(files[curID++], dummy); - soundClient->mainloop(); - } - break; - case 2: - printf("Enter ID of sound to unload "); - scanf("%d", &id); - (void)soundClient->unloadSound(id); - for(i = 0; i < 100; i++) - if (ids[i] == id) ids[i] = -1; - soundClient->mainloop(); - break; - case 3: - printf("Enter ID of sound to play "); - scanf("%d", &id); - printf("Enter number of times to repeat. (0 = continuous) "); - scanf("%d", &repeat); - (void)soundClient->playSound(id, repeat); - soundClient->mainloop(); - break; - case 4: - printf("Enter ID of sound to stop "); - scanf("%d", &id); - (void)soundClient->stopSound(id); - soundClient->mainloop(); - break; - case 5: - printf("Enter ID of sound to change "); - scanf("%d", &id); - printf("Enter value to change volume to "); - scanf("%d", &volume); - (void)soundClient->setSoundVolume(id, volume); - soundClient->mainloop(); - break; - case 6: - printf("Enter ID of sound to change "); - scanf("%d", &id); - printf("Enter the new X,Y, and Z position coordinates for the sound\n"); - scanf("%lf %lf %lf", &position[0], &position[1], &position[2]); - (void)soundClient->setSoundPose(id, position, orientation); - soundClient->mainloop(); - break; - case 7: - printf("Enter ID of sound to change "); - scanf("%d", &id); - printf("Enter the new X,Y, Z, and W orientation coordinates for the sound\n"); - scanf("%lf %lf %lf %lf", &orientation[0], &orientation[1], &orientation[2], &orientation[3]); - (void)soundClient->setSoundPose(id, position, orientation); - soundClient->mainloop(); - break; - case 8: - printf("Enter ID of sound to change "); - scanf("%d", &id); - printf("Enter the new X,Y, and Z velocity coordinates for the sound and magnitude\n"); - scanf("%lf %lf %lf %lf", &velocity[0], &velocity[1], &velocity[2], &velocity[3]); - (void)soundClient->setSoundVelocity(id,velocity); - soundClient->mainloop(); - break; - case 9: - printf("Enter the new X,Y, and Z position coordinates for the listener\n"); - scanf("%lf %lf %lf", &Lposition[0], &Lposition[1], &Lposition[2]); - (void)soundClient->setListenerPose(Lposition, Lorientation); - soundClient->mainloop(); - break; - case 10: - printf("Enter the new X,Y, Z, and W orientation coordinates for the listener\n"); - scanf("%lf %lf %lf %lf", &Lorientation[0], &Lorientation[1], &Lorientation[2], &Lorientation[3]); - (void)soundClient->setListenerPose(Lposition, Lorientation); - soundClient->mainloop(); - break; - case 11: - printf("Enter the new X,Y, and Z velocity coordinates for the listener and magnitude\n"); - scanf("%lf %lf %lf %lf", &Lvelocity[0], &Lvelocity[1], &Lvelocity[2], &Lvelocity[3]); - (void)soundClient->setListenerVelocity(Lvelocity); - soundClient->mainloop(); - break; - case 12: - printf("Enter ID of sound to loop"); - scanf("%d", &id); - init_sample_values(); - loopSound(id); - break; - case 13: - loop = 0; - break; - default: - break; - } - - - } - - - return 0; -} diff --git a/src/vrpn/client_src/sphere_client.C b/src/vrpn/client_src/sphere_client.C deleted file mode 100644 index 373dbf5d1a9014ee97d3d0d635f43e9c1dbdece7..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/sphere_client.C +++ /dev/null @@ -1,184 +0,0 @@ -// -// sphere.C - simple VRPN client, inspired by Randy Heiland -// generates a sphere with a radius of 3 cm -// - -#include <math.h> // for sqrt -#include <stdio.h> // for printf, NULL -#include <stdlib.h> // for atof, exit -#include <vrpn_Button.h> // for vrpn_BUTTONCB, etc -#include <vrpn_ForceDevice.h> // for vrpn_ForceDevice_Remote, etc -#include <vrpn_Tracker.h> // for vrpn_TRACKERCB, etc - -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Connection.h" // for vrpn_Connection -#include "vrpn_Types.h" // for vrpn_float64 - -static float xpos,ypos,zpos; - - -/***************************************************************************** - * - Callback handler - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_force_change(void * /*userdata*/, const vrpn_FORCECB f) -{ - static vrpn_FORCECB lr; // last report - static int first_report_done = 0; - - if ((!first_report_done) || - ((f.force[0] != lr.force[0]) || (f.force[1] != lr.force[1]) - || (f.force[2] != lr.force[2]))) { - printf("force is (%f,%f,%f)\n", f.force[0], f.force[1], f.force[2]); - } - - first_report_done = 1; - lr = f; -} - -vrpn_ForceDevice_Remote *forceDevice; - -void VRPN_CALLBACK handle_tracker_change(void * /*userdata*/, const vrpn_TRACKERCB t) -{ - static vrpn_TRACKERCB lr; // last report - static float dist_interval_sq = (float)0.004; - - if ((lr.pos[0] - t.pos[0])*(lr.pos[0] - t.pos[0]) + - (lr.pos[1] - t.pos[1])*(lr.pos[1] - t.pos[1]) + - (lr.pos[2] - t.pos[2])*(lr.pos[2] - t.pos[2]) > dist_interval_sq){ - printf("Sensor %d is now at (%g,%g,%g)\n", t.sensor, - t.pos[0], t.pos[1], t.pos[2]); - lr = t; - } - xpos = (float)t.pos[0]; - ypos = (float)t.pos[1]; - zpos = (float)t.pos[2]; - - // we may call forceDevice->set_plane(...) followed by - // forceDevice->sendSurface() here to change the plane - // for example: using position information from a tracker we can - // compute a plane to approximate a complex surface at that - // position and send that approximation 15-30 times per - // second to simulate the complex surface - - double norm = sqrt(xpos*xpos + ypos*ypos + zpos*zpos); - double radius = .03; // radius is 3 cm - forceDevice->set_plane(xpos,ypos,zpos, (float)(-radius*norm)); - - forceDevice->sendSurface(); -} - -void VRPN_CALLBACK handle_button_change(void *userdata, const vrpn_BUTTONCB b) -{ - static int count=0; - static int buttonstate = 1; - int done = 0; - - if (b.state != buttonstate) { - printf("button #%d is in state %d\n", b.button, b.state); - buttonstate = b.state; - count++; - } - if (count > 4) - done = 1; - - *(int *)userdata = done; -} - -int main(int argc, char *argv[]) -{ - int done = 0; - vrpn_Tracker_Remote *tracker; - vrpn_Button_Remote *button; - - if (argc != 4) { - printf("Usage: %s sFric dFric device_name\n",argv[0]); - printf(" Example: %s 0.1 0.1 Phantom@myhost.mydomain.edu\n",argv[0]); - exit(-1); - } - float sFric = (float)atof(argv[1]); - float dFric = (float)atof(argv[2]); - char *device_name = argv[3]; - printf("Connecting to %s: sFric, dFric= %f %f\n",device_name, sFric,dFric); - - /* initialize the force device */ - forceDevice = new vrpn_ForceDevice_Remote(device_name); - forceDevice->register_force_change_handler(NULL, handle_force_change); - - /* initialize the tracker */ - tracker = new vrpn_Tracker_Remote(device_name); - tracker->register_change_handler(NULL, handle_tracker_change); - - /* initialize the button */ - button = new vrpn_Button_Remote(device_name); - button->register_change_handler(&done, handle_button_change); - - // Wait until we are connected to the server. - while (!forceDevice->connectionPtr()->connected()) { - forceDevice->mainloop(); - } - - // Set plane and surface parameters. Initially, the plane will be - // far outside the volume so we don't get a sudden jerk at startup. - forceDevice->set_plane(0.0, 1.0, 0.0, 100.0); - -/*------------------------------------------------------------- -correct ranges for these values (from GHOST 1.2 documentation): -dynamic, static friction: 0-1.0 -Kspring: 0-1.0 -Kdamping: 0-0.005 - -An additional constraint that I discovered is that dynamic friction must -be smaller than static friction or you will get the same error. "1.0" means -the maximum stable surface presentable by the device. ---------------------------------------------------------------*/ - forceDevice->setSurfaceKspring(1.0); - - forceDevice->setSurfaceKdamping(0.0); // damping constant - - // units of dynes*sec/cm - - forceDevice->setSurfaceFstatic(sFric); // set static friction - forceDevice->setSurfaceFdynamic(dFric); // set dynamic friction - - // texture and buzzing stuff: - // this turns off buzzing and texture - forceDevice->setSurfaceBuzzAmplitude(0.0); - forceDevice->setSurfaceBuzzFrequency(60.0); // Hz - forceDevice->setSurfaceTextureAmplitude(0.00); // meters!!! - forceDevice->setSurfaceTextureWavelength((float)0.01); // meters!!! - - forceDevice->setRecoveryTime(10); // recovery occurs over 10 - // force update cycles - - // enable force device and send first surface - forceDevice->startSurface(); - - printf("\n3cm sphere at the origin should be present always\n"); - printf("Press and release the Phantom button 3 times to exit\n"); - - // main loop - while (! done ) - { - // Let the forceDevice send its planes to remote force device - forceDevice->mainloop(); - - // Let tracker receive position information from remote tracker - tracker->mainloop(); - - // Let button receive button status from remote button - button->mainloop(); - } - - // shut off force device - forceDevice->stopSurface(); - - // Delete the objects - delete forceDevice; - delete button; - delete tracker; - - return 0; -} /* main */ - diff --git a/src/vrpn/client_src/sphere_client.dsp b/src/vrpn/client_src/sphere_client.dsp deleted file mode 100644 index 88ca9df604a299f0260168db90e1096762071ad7..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/sphere_client.dsp +++ /dev/null @@ -1,90 +0,0 @@ -# Microsoft Developer Studio Project File - Name="sphere_client" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=sphere_client - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "sphere_client.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "sphere_client.mak" CFG="sphere_client - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "sphere_client - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "sphere_client - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "sphere_client - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/client_src/Release" -# PROP Intermediate_Dir "../pc_win32/client_src/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "sphere_client - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/client_src/Debug" -# PROP Intermediate_Dir "../pc_win32/client_src/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "sphere_client - Win32 Release" -# Name "sphere_client - Win32 Debug" -# Begin Source File - -SOURCE=sphere_client.C -# End Source File -# End Target -# End Project diff --git a/src/vrpn/client_src/sphere_client.vcproj b/src/vrpn/client_src/sphere_client.vcproj deleted file mode 100644 index d61ba07088a0b83277d3c680060dcf95044bb965..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/sphere_client.vcproj +++ /dev/null @@ -1,229 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="sphere_client" - ProjectGUID="{14E21AB6-F3E9-4CA9-BF51-1E9443979B3C}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/client_src/Debug" - IntermediateDirectory=".\../pc_win32/client_src/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/Debug/sphere_client.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include";..;..\..\quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/client_src/Debug/sphere_client.pch" - AssemblerListingLocation=".\../pc_win32/client_src/Debug/" - ObjectFile=".\../pc_win32/client_src/Debug/" - ProgramDataBaseFileName=".\../pc_win32/client_src/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/client_src/Debug/sphere_client.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/client_src/Debug/sphere_client.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/Debug/sphere_client.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/client_src/Release" - IntermediateDirectory=".\../pc_win32/client_src/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/Release/sphere_client.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include";..;..\..\quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/client_src/Release/sphere_client.pch" - AssemblerListingLocation=".\../pc_win32/client_src/Release/" - ObjectFile=".\../pc_win32/client_src/Release/" - ProgramDataBaseFileName=".\../pc_win32/client_src/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/client_src/Release/sphere_client.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/client_src/Release/sphere_client.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/Release/sphere_client.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <File - RelativePath="sphere_client.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/client_src/testSharedObject.C b/src/vrpn/client_src/testSharedObject.C deleted file mode 100644 index f094aa16576276ccdb0d06a30c999256e1804179..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/testSharedObject.C +++ /dev/null @@ -1,86 +0,0 @@ -#include <stdio.h> // for printf -#include <stdlib.h> // for exit -#include <vrpn_Connection.h> // for vrpn_Connection, etc -#include <vrpn_SharedObject.h> // for vrpn_Shared_int32_Remote, etc - -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_bool, vrpn_int32 - -int VRPN_CALLBACK noteChange (void * userdata, vrpn_int32 newValue, vrpn_bool isLocal) { - vrpn_Shared_int32_Remote * ip; - - ip = (vrpn_Shared_int32_Remote *) userdata; - printf("Remote %s set to %d.\n", ip->name(), newValue); - - return 0; -} - -int main (int argc, char ** argv) { - - vrpn_Connection * c; - timeval qsec; - - qsec.tv_sec = 0L; - qsec.tv_usec = 250000L; - - c = vrpn_get_connection_by_name(argv[1]); - - if (!c) { - exit(0); - } - - vrpn_Shared_int32_Remote a ("a", 0, VRPN_SO_DEFER_UPDATES); - - a.bindConnection(c); - a.register_handler(noteChange, &a); - - c->mainloop(&qsec); - - printf("a = %d.\n", a.value()); - - c->mainloop(&qsec); - - a = 3; - - c->mainloop(&qsec); - - printf("a = %d.\n", a.value()); - - c->mainloop(&qsec); - - a = -3; - - c->mainloop(&qsec); - - printf("a = %d.\n", a.value()); - - a.becomeSerializer(); - c->mainloop(&qsec); - - c->mainloop(&qsec); - - printf("a = %d.\n", a.value()); - - c->mainloop(&qsec); - - a = 3; - - c->mainloop(&qsec); - - printf("a = %d.\n", a.value()); - - c->mainloop(&qsec); - - a = -3; - - c->mainloop(&qsec); - - printf("a = %d.\n", a.value()); - - while (1) { - c->mainloop(); - } - -} - diff --git a/src/vrpn/client_src/test_Zaber.C b/src/vrpn/client_src/test_Zaber.C deleted file mode 100644 index 50e7ffe091e26dccbd95d3217a528deed2cd21cc..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/test_Zaber.C +++ /dev/null @@ -1,146 +0,0 @@ -#include <signal.h> // for signal, SIGINT -#include <stdio.h> // for printf, fprintf, NULL, etc -#include <stdlib.h> // for exit - -#include "vrpn_Analog.h" // for vrpn_Analog_Remote, etc -#include "vrpn_Analog_Output.h" // for vrpn_Analog_Output_Remote -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday, etc -#include "vrpn_Types.h" // for vrpn_float64 - -#define POLL_INTERVAL (2000000) // time to poll if no response in a while (usec) -vrpn_Analog_Remote *ana; -vrpn_Analog_Output_Remote *anaout; - -int done = 0; - -bool analog_0_set = false; -vrpn_float64 analog_0; - - - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_analog (void *, const vrpn_ANALOGCB a) -{ - int i; - printf("Analogs: "); - for (i = 0; i < a.num_channel; i++) { - printf("%4.2f ",a.channel[i]); - } - analog_0 = a.channel[0]; - analog_0_set = true; - printf("\n"); -} - - -/***************************************************************************** - * - init - initialize everything - * - *****************************************************************************/ - -void init (const char * devicename) -{ - fprintf(stderr, "Zaber's name is %s.\n", devicename); - ana = new vrpn_Analog_Remote (devicename); - anaout = new vrpn_Analog_Output_Remote(devicename); - - // Set up the callback handlers - printf("Analog update: Analogs: [new values listed]\n"); - ana->register_change_handler(NULL, handle_analog); -} /* init */ - - -void handle_cntl_c (int) { - done = 1; -} - -void shutdown (void) { - - fprintf(stderr, "\nIn control-c handler.\n"); - - if (ana) delete ana; - if (anaout) delete anaout; - exit(0); -} - -int main (int argc, char * argv []) -{ - struct timeval timestamp; - vrpn_gettimeofday(×tamp, NULL); - -#ifdef hpux - char default_station_name [100]; - strcpy(default_station_name, "Analog0@localhost"); -#else - char default_station_name [] = { "Analog0@localhost" }; -#endif - - const char * station_name = default_station_name; - - if (argc < 2) { - fprintf(stderr, "Usage: %s Device_name\n" - " Device_name: VRPN name of data source to contact\n" - " example: Analog0@localhost\n", - argv[0]); - exit(0); - } - - // parse args - - station_name = argv[1]; - - // initialize the PC/station - init(station_name); - - // signal handler so logfiles get closed right - signal(SIGINT, handle_cntl_c); - - // Wait until we hear a value from analog0 so we know where - // to start. - analog_0_set = false; - while (!analog_0_set) { - ana->mainloop(); - } - - /* - * main interactive loop - */ - while ( ! done ) { - // Once every two seconds, ask the first analog to move - // 10000 steps bigger (if it is less than 10000) or - // 10000 steps shorter (if it is more than 10000) - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) > POLL_INTERVAL) { - if (analog_0_set) { - double newval; - if (analog_0 > 10000) { - newval = analog_0-10000; - } else { - newval = analog_0+10000; - } - printf("Requesting change to %lf\n", newval); - anaout->request_change_channel_value(0, newval); - } else { - printf("No value yet from Zaber, not sending change request\n"); - } - vrpn_gettimeofday(×tamp, NULL); - } - - // Let the devices do their things - anaout->mainloop(); - ana->mainloop(); - - // Sleep for 1ms so we don't eat the CPU - vrpn_SleepMsecs(1); - } - shutdown(); - return 0; - -} /* main */ diff --git a/src/vrpn/client_src/test_imager.C b/src/vrpn/client_src/test_imager.C deleted file mode 100644 index a791d117638cc03d4e7a375afcb6a56090b9b2f7..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/test_imager.C +++ /dev/null @@ -1,177 +0,0 @@ -#include <math.h> // for pow -#include <stdio.h> // for fprintf, stderr, NULL, etc -#include <stdlib.h> // for rand - -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Connection.h" -#include "vrpn_Imager.h" // for vrpn_IMAGERREGIONCB, etc -#include "vrpn_Types.h" // for vrpn_uint16 - -//----------------------------------------------------------------- -// This section contains a copy of an image that is shared between -// the client and server. It is completely an artifact of this test -// program. The program works by sending the whole image one piece -// at a time from the server to the client; the client then compares -// with the image to make sure it matches. - -vrpn_uint16 *image = NULL; //< Holds the image to be sent and tested -const vrpn_uint16 image_x_size = 256; -const vrpn_uint16 image_y_size = 128; - -// Allocate the image and fill it with random numbers -bool init_test_image(void) -{ - vrpn_uint16 x,y; - - if ( (image = new vrpn_uint16[image_x_size * image_y_size]) == NULL) { - fprintf(stderr, "Could not allocate image\n"); - return false; - } - for (x = 0; x < image_x_size; x++) { - for (y = 0; y < image_y_size; y++) { - image[x + y*image_x_size] = rand(); - } - } - - return true; -} - -//----------------------------------------------------------------- -// This section contains code that does what the server should do - -vrpn_Connection *svrcon; //< Connection for server to talk on -vrpn_Imager_Server *svr; //< Image server to be used to send -int svrchan; //< Server channel index for image data - -bool init_server_code(void) -{ - if ( (svrcon = vrpn_create_server_connection()) == NULL) { - fprintf(stderr, "Could not open server connection\n"); - return false; - } - if ( (svr = new vrpn_Imager_Server("TestImage", svrcon, - image_x_size, image_y_size)) == NULL) { - fprintf(stderr, "Could not open Imager Server\n"); - return false; - } - if ( (svrchan = svr->add_channel("value", "unsigned16bit", 0, (float)(pow(2.0,16)-1))) == -1) { - fprintf(stderr, "Could not add channel to server image\n"); - return false; - } - - return true; -} - -void mainloop_server_code(void) -{ - static vrpn_uint16 y = 0; //< Loops through the image and sends data - - // Send the current row over to the client. - svr->send_region_using_base_pointer(svrchan, 0, image_x_size-1, y,y, image, 1, image_x_size); - svr->mainloop(); - printf("Sent a region\n"); - - // Go to the next line for next time. - if (++y == image_y_size) { y = 0; } - - // Mainloop the server connection (once per server mainloop, not once per object) - svrcon->mainloop(); -} - -//----------------------------------------------------------------- -// This section contains code that does what the client should do. -// It listens until it has gotten twice as many rows as there are in -// the image and then indicates that it is done. - -vrpn_Imager_Remote *clt; //< Client imager -int client_rows_gotten = 0; //< Keeps track of how many rows we've gotten -bool client_done = false; //< Lets us know if the client wants to quit - -// Handler to get an image region in and check it against the image to make -// sure it came over okay. Also keeps track of how many rows we have. - -void VRPN_CALLBACK handle_region_data(void *, const vrpn_IMAGERREGIONCB info) -{ - unsigned x,y; - const vrpn_Imager_Channel *chan; - - // Find out the scale and offset for this channel. - if ( (chan = clt->channel(info.region->d_chanIndex)) == NULL) { - fprintf(stderr, "Warning: Illegal channel index (%d) in region report\n", info.region->d_chanIndex); - return; - } - double scale = chan->scale; - double offset = chan->offset; - - // Check the image data against the image to make sure it matches. - for (y = info.region->d_rMin; y <= info.region->d_rMax; y++) { - for (x = info.region->d_cMin; x <= info.region->d_cMax; x++) { - vrpn_uint16 val; - if (!info.region->read_unscaled_pixel(x,y,val)) { - fprintf(stderr, "Error indexing region that was read\n"); - client_done = true; - return; - } - val = (vrpn_uint16)(val * scale + offset); - if (image[x+y*image_x_size] != val) { - fprintf(stderr, "Error: Read pixel (%d) does not match stored pixel (%d)\n", - val, image[x+y*image_x_size]); - client_done = true; - return; - } - } - } - - // One more region... are we done? - printf("Got a region\n"); - if (++client_rows_gotten >= 2*image_y_size) { - printf("Got %d rows -- success!\n", client_rows_gotten); - client_done = true; - } -} - -bool init_client_code(void) -{ - // Open the client object and set the callback handler for new region data - if ( (clt = new vrpn_Imager_Remote("TestImage@localhost")) == NULL) { - fprintf(stderr, "Error: Cannot create remote image object\n"); - return false; - } - if (clt->register_region_handler(NULL, handle_region_data) == -1) { - fprintf(stderr, "Error: cannot register handler for regions\n"); - return false; - } - - // Set callback handler for new description data (user code might not do this). - - return true; -} - -void mainloop_client_code(void) -{ - clt->mainloop(); -} - -//----------------------------------------------------------------- -// Mostly just calls the above functions; split into client and -// server parts is done clearly to help people who want to use this -// as example code. You could pull the above functions down into -// the main() program body without trouble (except for the callback -// handler, of course). - -int main(int argc, char *argv[]) -{ - if (!init_test_image()) { return -1; } - if (!init_server_code()) { return -1; } - if (!init_client_code()) { return -1; } - - while (!client_done) { - mainloop_server_code(); - mainloop_client_code(); - } - - if (clt) { delete clt; } - if (svr) { delete svr; } - - return 0; -} diff --git a/src/vrpn/client_src/test_imager.dsp b/src/vrpn/client_src/test_imager.dsp deleted file mode 100644 index c136962551bfeba4d2dbdf401623c2b49c1daf71..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/test_imager.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_imager" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_imager - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_imager.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_imager.mak" CFG="test_imager - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_imager - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_imager - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_imager - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/test_imager/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/test_imager/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "test_imager - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/test_imager/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/test_imager/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "test_imager - Win32 Release" -# Name "test_imager - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=test_imager.C -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/client_src/test_imager.vcproj b/src/vrpn/client_src/test_imager.vcproj deleted file mode 100644 index 319a45c3b0cd1453b82a9567fba42e9311589316..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/test_imager.vcproj +++ /dev/null @@ -1,245 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="test_imager" - ProjectGUID="{3A77BE37-0660-4CC9-A7F8-CE83070278CB}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/test_imager/Release" - IntermediateDirectory=".\../pc_win32/server_src/test_imager/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_imager/Release/test_imager.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..\" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_imager/Release/test_imager.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_imager/Release/" - ObjectFile=".\../pc_win32/server_src/test_imager/Release/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_imager/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_imager/Release/test_imager.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/server_src/test_imager/Release/test_imager.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_imager/Release/test_imager.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/test_imager/Debug" - IntermediateDirectory=".\../pc_win32/server_src/test_imager/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_imager/Debug/test_imager.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..\" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_imager/Debug/test_imager.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_imager/Debug/" - ObjectFile=".\../pc_win32/server_src/test_imager/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_imager/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_imager/Debug/test_imager.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/server_src/test_imager/Debug/test_imager.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_imager/Debug/test_imager.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="test_imager.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/client_src/test_mutex.C b/src/vrpn/client_src/test_mutex.C deleted file mode 100644 index d3c607282ace910584ff16cee43d9fc3d3471d8b..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/test_mutex.C +++ /dev/null @@ -1,69 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> // for exit(), atoi() - -#include <vrpn_Mutex.h> - - -int rg (void *) { - printf("callback - Mutex granted.\n"); - return 0; -} - -int rd (void *) { - printf("callback - Mutex denied.\n"); - return 0; -} - -int rel (void *) { - printf("callback - Mutex released.\n"); - return 0; -} - -int main (int argc, char ** argv) { - - vrpn_Mutex_Remote * me; - char inputLine [100]; - - me = new vrpn_Mutex_Remote (argv[1]); - - me->addRequestGrantedCallback(NULL, rg); - me->addRequestDeniedCallback(NULL, rd); - me->addReleaseCallback(NULL, rel); - - printf("req - request the mutex.\n"); - printf("rel - release the mutex.\n"); - printf("? - get current mutex state.\n"); - printf("quit - exit.\n"); - - while (1) { - - me->mainloop(); - memset(inputLine, 0, 100); - if (fgets(inputLine, 100, stdin) == NULL) { - perror("Could not read line"); - exit(-1); - } - - if (!strncmp(inputLine, "req", 3)) { - printf("test_mutex: sending request.\n"); - me->request(); - } else if (!strncmp(inputLine, "rel", 3)) { - printf("test_mutex: sending release.\n"); - me->release(); - } else if (!strncmp(inputLine, "?", 1)) { - printf("isAvailable: %d.\n", me->isAvailable()); - printf("isHeldLocally: %d.\n", me->isHeldLocally()); - printf("isHeldRemotely: %d.\n", me->isHeldRemotely()); - } else if (!strncmp(inputLine, "quit", 4)) { - delete me; - exit(0); - } else { - printf(".\n"); - } - } - - -} - - diff --git a/src/vrpn/client_src/test_zaber.dsp b/src/vrpn/client_src/test_zaber.dsp deleted file mode 100644 index be0f025401a793c85530a8c98f83fa796cc7367c..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/test_zaber.dsp +++ /dev/null @@ -1,101 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_zaber" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_zaber - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_zaber.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_zaber.mak" CFG="test_zaber - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_zaber - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_zaber - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_zaber - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\..\quat" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "test_zaber - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/client_src/test_Zaber/Debug" -# PROP Intermediate_Dir "../pc_win32/client_src/test_Zaber/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\..\quat" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /YX /FD /GZ /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "test_zaber - Win32 Release" -# Name "test_zaber - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\test_Zaber.C -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/client_src/test_zaber.vcproj b/src/vrpn/client_src/test_zaber.vcproj deleted file mode 100644 index 9c6f0863e5db36dea235d5f5e00304c263de004f..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/test_zaber.vcproj +++ /dev/null @@ -1,244 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="test_zaber" - ProjectGUID="{218270DA-87E3-4DF5-9550-FE9A9B07BFBB}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\Release" - IntermediateDirectory=".\Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\Release/test_zaber.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,.." - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\Release/test_zaber.pch" - AssemblerListingLocation=".\Release/" - ObjectFile=".\Release/" - ProgramDataBaseFileName=".\Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\Release/test_zaber.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\Release/test_zaber.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\Release/test_zaber.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/client_src/test_Zaber/Debug" - IntermediateDirectory=".\../pc_win32/client_src/test_Zaber/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/test_Zaber/Debug/test_zaber.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,.." - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/client_src/test_Zaber/Debug/test_zaber.pch" - AssemblerListingLocation=".\../pc_win32/client_src/test_Zaber/Debug/" - ObjectFile=".\../pc_win32/client_src/test_Zaber/Debug/" - ProgramDataBaseFileName=".\../pc_win32/client_src/test_Zaber/Debug/" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/client_src/test_Zaber/Debug/test_zaber.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/client_src/test_Zaber/Debug/test_zaber.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/test_Zaber/Debug/test_zaber.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="test_Zaber.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/client_src/testimager_client.C b/src/vrpn/client_src/testimager_client.C deleted file mode 100644 index 3ec7b1a5906df97fa2ce5c5711360bdd6d9d9a89..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/testimager_client.C +++ /dev/null @@ -1,386 +0,0 @@ -//---------------------------------------------------------------------------- -// Example program to read pixels from a vrpn_Imager server and display -// them in an OpenGL window. It assumes that the size of the imager does -// not change during the run. It asks for unsigned 8-bit pixels. - -#include <stdio.h> // for printf, NULL, fprintf, etc -#include <stdlib.h> // for exit -#include <string.h> // for strcmp - -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Shared.h" // for timeval, vrpn_SleepMsecs, etc -#include <vrpn_Connection.h> // for vrpn_Connection, etc -#include <vrpn_FileConnection.h> -#include <vrpn_Imager.h> // for vrpn_Imager_Remote, etc - -#ifdef __APPLE__ -#include <GLUT/glut.h> -#include <OpenGL/OpenGL.h> -#else -#include <GL/gl.h> // for glClear, glClearColor, etc -#include <GL/glut.h> // for glutCreateWindow, etc // IWYU pragma: keep -#endif - -//---------------------------------------------------------------------------- -// Glut insists on taking over the whole application, leaving us to use -// global variables to pass information between the various callback -// handlers. - -bool g_quit = false; //< Set to true when time to quit -vrpn_Connection *g_connection; //< Set if logging is enabled. -vrpn_Imager_Remote *g_imager; //< Imager client object -bool g_got_dimensions = false; //< Heard image dimensions from server? -int g_Xdim, g_Ydim; //< Dimensions in X and Y -bool g_ready_for_region = false; //< Everything set up to handle a region? -unsigned char *g_image = NULL; //< Pointer to the storage for the image -bool g_already_posted = false; //< Posted redisplay since the last display? -bool g_autoscale = false; //< Should we auto-scale the brightness and contrast? - -//---------------------------------------------------------------------------- -// Imager callback handlers. - -void VRPN_CALLBACK handle_discarded_frames(void *, const vrpn_IMAGERDISCARDEDFRAMESCB info) -{ - printf("Server discarded %d frames\n", (int)(info.count)); -} - -void VRPN_CALLBACK handle_description_message(void *, const struct timeval) -{ - // This method is different from other VRPN callbacks because it simply - // reports that values have been filled in on the Imager_Remote class. - // It does not report what the new values are, only the time at which - // they changed. - - // If we have already heard the dimensions, then check and make sure they - // have not changed. Also ensure that there is at least one channel. If - // not, then print an error and exit. - if (g_got_dimensions) { - if ( (g_Xdim != g_imager->nCols()) || (g_Ydim != g_imager->nRows()) ) { - fprintf(stderr,"Error -- different image dimensions reported\n"); - exit(-1); - } - if (g_imager->nChannels() <= 0) { - fprintf(stderr,"Error -- No channels to display!\n"); - exit(-1); - } - } - - // Record that the dimensions are filled in. Fill in the globals needed - // to store them. - g_Xdim = g_imager->nCols(); - g_Ydim = g_imager->nRows(); - g_got_dimensions = true; -} - -void myDisplayFunc(); - -// New pixels coming: fill them into the image and tell Glut to redraw. - -void VRPN_CALLBACK handle_region_change(void *userdata, const vrpn_IMAGERREGIONCB info) -{ - const vrpn_Imager_Region *region=info.region; - const vrpn_Imager_Remote *imager = (const vrpn_Imager_Remote *)userdata; - - // Just leave things alone if we haven't set up the drawable things - // yet. - if (!g_ready_for_region) { return; } - - // Copy pixels into the image buffer. - // Flip the image over in Y so that the image coordinates - // display correctly in OpenGL. - // Figure out which color to put the data in depending on the name associated - // with the channel index. If it is one of "red", "green", or "blue" then put - // it into that channel. - if (strcmp(imager->channel(region->d_chanIndex)->name, "red") == 0) { - region->decode_unscaled_region_using_base_pointer(g_image+0, 3, 3*g_Xdim, 0, g_Ydim, true); - } else if (strcmp(imager->channel(region->d_chanIndex)->name, "green") == 0) { - region->decode_unscaled_region_using_base_pointer(g_image+1, 3, 3*g_Xdim, 0, g_Ydim, true); - } else if (strcmp(imager->channel(region->d_chanIndex)->name, "blue") == 0) { - region->decode_unscaled_region_using_base_pointer(g_image+2, 3, 3*g_Xdim, 0, g_Ydim, true); - } else { - // This uses a repeat count of three to put the data into all channels. - // NOTE: This copies each channel into all buffers, rather - // than just a specific one (overwriting all with the last one written). A real - // application will probably want to provide a selector to choose which - // is drawn. It can check region->d_chanIndex to determine which channel - // is being reported for each callback. - region->decode_unscaled_region_using_base_pointer(g_image, 3, 3*g_Xdim, 0, g_Ydim, true, 3); - } - - // If we're logging, save to disk. This is needed to keep up with - // logging and because the program is killed to exit. - if (g_connection) { g_connection->save_log_so_far(); } - - // We do not post a redisplay here, because we want to do that only - // when we've gotten the end of a frame. It is done in the - // end_of_frame message handler. -} - -void VRPN_CALLBACK handle_end_of_frame(void *,const struct _vrpn_IMAGERENDFRAMECB) -{ - // Tell Glut it is time to draw. Make sure that we don't post the redisplay - // operation more than once by checking to make sure that it has been handled - // since the last time we posted it. If we don't do this check, it gums - // up the works with tons of redisplay requests and the program won't - // even handle windows events. - - // NOTE: This exposes a race condition. If more video messages arrive - // before the frame-draw is executed, then we'll end up drawing some of - // the new frame along with this one. To make really sure there is not tearing, - // double buffer: fill partial frames into one buffer and draw from the - // most recent full frames in another buffer. You could use an OpenGL texture - // as the second buffer, sending each full frame into texture memory and - // rendering a textured polygon. - - if (!g_already_posted) { - g_already_posted = true; - glutPostRedisplay(); - } -} - -//---------------------------------------------------------------------------- -// Capture timing information and print out how many frames per second -// are being drawn. Remove this function if you don't want timing info. -void print_timing_info(void) -{ static struct timeval last_print_time; - struct timeval now; - static bool first_time = true; - static int frame_count = 0; - - if (first_time) { - vrpn_gettimeofday(&last_print_time, NULL); - first_time = false; - } else { - frame_count++; - vrpn_gettimeofday(&now, NULL); - double timesecs = 0.001 * vrpn_TimevalMsecs(vrpn_TimevalDiff(now, last_print_time)); - if (timesecs >= 5) { - double frames_per_sec = frame_count / timesecs; - frame_count = 0; - printf("Displayed frames per second = %lg\n", frames_per_sec); - last_print_time = now; - } - } -} - -//---------------------------------------------------------------------------- -// Auto-scale the image so that the darkest pixel is 0 and the brightest -// is 255. This is to provide a function that someone using this program -// to watch a microscope video wanted -- we're starting down the slippery -// slope of turning this from an example program into an application... - -void do_autoscale(void) -{ - // Find the minimum and maximum value of all pixels of all colors - // in the image. - unsigned char min_val = g_image[0]; - unsigned char max_val = min_val; - int x,y,c; - for (x = 0; x < g_Xdim; x++) { - for (y = 0; y < g_Ydim; y++) { - for (c = 0; c < 3; c++) { - unsigned char val = g_image[c + 3 * ( x + g_Xdim * ( y ) )]; - if (val < min_val) { min_val = val; } - if (val > max_val) { max_val = val; } - } - } - } - - // Compute the scale and offset to apply to map the minimum value to - // zero and the maximum value to 255. - float offset = min_val; - float scale; - if (max_val == min_val) { - scale = 1; - } else { - scale = 255.0 / (max_val - min_val); - } - - // Apply this scaling to each pixel. - for (x = 0; x < g_Xdim; x++) { - for (y = 0; y < g_Ydim; y++) { - for (c = 0; c < 3; c++) { - float val = g_image[c + 3 * ( x + g_Xdim * ( y ) )]; - val = (val - offset) * scale; - g_image[c + 3 * ( x + g_Xdim * ( y ) )] = static_cast<unsigned char>(val); - } - } - } -} - -//---------------------------------------------------------------------------- -// Glut callback handlers. - -void myDisplayFunc(void) -{ - // Clear the window and prepare to draw in the back buffer. - // This is not strictly necessary, because we're going to overwrite - // the entire window without Z buffering turned on. - glDrawBuffer(GL_BACK); - glClearColor(0.0, 0.0, 0.0, 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - // If we're auto-scaling the image, do so now. - if (g_autoscale) { - do_autoscale(); - } - - // Store the pixels from the image into the frame buffer - // so that they cover the entire image (starting from lower-left - // corner, which is at (-1,-1)). - glRasterPos2f(-1, -1); - glDrawPixels(g_imager->nCols(),g_imager->nRows(), GL_RGB, GL_UNSIGNED_BYTE, g_image); - - // Swap buffers so we can see it. - glutSwapBuffers(); - - // Capture timing information and print out how many frames per second - // are being drawn. - print_timing_info(); - - // We've no longer posted redisplay since the last display. - g_already_posted = false; -} - -void myIdleFunc(void) -{ - // See if there are any more messages from the server and then sleep - // a little while so that we don't eat the whole CPU. - g_imager->mainloop(); - vrpn_SleepMsecs(5); - if (g_quit) { - delete g_imager; - if (g_image) { delete [] g_image; g_image = NULL; }; - exit(0); - } -} - -void myKeyboardFunc(unsigned char key, int x, int y) -{ - switch (key) { - case 27: // Escape - case 'q': - case 'Q': - g_quit = 1; - break; - - case 'a': - case 'A': - g_autoscale = !g_autoscale; - printf("Turning autoscaling %s\n", g_autoscale?"on":"off" ); - break; - - case '0': // For a number, set the throttle to that number - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - printf("Throttling after %d frames\n", key - '0'); - g_imager->throttle_sender(key - '0'); - break; - - case '-': // For the '-' sign, set the throttle to unlimited - printf("Turning off frame throttle\n"); - g_imager->throttle_sender(-1); - break; - } -} - - -int main(int argc, char **argv) -{ - char default_imager[] = "TestImage@localhost"; - char *device_name = default_imager; - char *logfile_name = NULL; - int i; - - // Parse the command line. If there is one argument, it is the device - // name. If there is a second, it is a logfile name. - if (argc >= 2) { device_name = argv[1]; } - if (argc >= 3) { logfile_name = argv[2]; } - if (argc > 3) { fprintf(stderr, "Usage: %s [device_name [logfile_name]]\n", argv[0]); exit(-1); } - - // In case we end up loading an video from a file, make sure we - // neither pre-load nor accumulate the images. - vrpn_FILE_CONNECTIONS_SHOULD_PRELOAD = false; - vrpn_FILE_CONNECTIONS_SHOULD_ACCUMULATE = false; - - // Say that we've posted a redisplay so that the callback handler - // for endframe doesn't try to post one before glut is open. - g_already_posted = true; - - // Create a log file of the video if we've been asked to do logging. - // This has the side effect of having the imager also use this same - // connection, because VRPN maps the same connection name to the - // same one rather than creating a new one. - if (logfile_name) { - g_connection = vrpn_get_connection_by_name(device_name, logfile_name); - } - - // Open the Imager client and set the callback - // for new data and for information about the size of - // the image. - printf("Opening %s\n", device_name); - g_imager = new vrpn_Imager_Remote(device_name); - g_imager->register_description_handler(NULL, handle_description_message); - g_imager->register_region_handler(g_imager, handle_region_change); - g_imager->register_discarded_frames_handler(NULL, handle_discarded_frames); - g_imager->register_end_frame_handler(g_imager, handle_end_of_frame); - - printf("Waiting to hear the image dimensions...\n"); - while (!g_got_dimensions) { - g_imager->mainloop(); - vrpn_SleepMsecs(1); - } - - // Because the vrpn_Imager server doesn't follow "The VRPN Way" in that - // it will continue to attempt to flood the network with more data than - // can be sent, we need to tell the client's connection to stop handling - // incoming messages after some finite number, to avoid getting stuck down - // in the imager's mainloop() and never returning control to the main - // program. This strange-named function does this for us. If the camera - // is not sending too many messages for the network, this should not have - // any effect. - g_imager->connectionPtr()->Jane_stop_this_crazy_thing(50); - - // Allocate memory for the image and clear it, so that things that - // don't get filled in will be black. - if ( (g_image = new unsigned char[g_Xdim * g_Ydim * 3]) == NULL) { - fprintf(stderr,"Out of memory when allocating image!\n"); - return -1; - } - for (i = 0; i < g_Xdim * g_Ydim * 3; i++) { - g_image[i] = 0; - } - g_ready_for_region = true; - printf("Receiving images at size %dx%d\n", g_Xdim, g_Ydim); - printf("Press '0'-'9' in OpenGL window to throttle incoming images.\n"); - printf("Press '-' to disable throttling.\n"); - printf("Press 'a' to enable/disable autoscaling of brightness.\n"); - printf("Press 'q' or 'Q' or ESC to quit.\n"); - - // Initialize GLUT and create the window that will display the - // video -- name the window after the device that has been - // opened in VRPN. - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH); - glutInitWindowSize(g_Xdim, g_Ydim); - glutInitWindowPosition(100, 100); - glutCreateWindow(vrpn_copy_service_name(device_name)); - - // Set the display function and idle function for GLUT (they - // will do all the work) and then give control over to GLUT. - glutDisplayFunc(myDisplayFunc); - glutIdleFunc(myIdleFunc); - glutKeyboardFunc(myKeyboardFunc); - glutMainLoop(); - - // Clean up objects and return. This code is never called because - // glutMainLoop() never returns. - return 0; -} diff --git a/src/vrpn/client_src/testimager_client.dsp b/src/vrpn/client_src/testimager_client.dsp deleted file mode 100644 index b3256e6f1e08b042a950fd13b5ea24369fb5b8c6..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/testimager_client.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testimager_client" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=testimager_client - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testimager_client.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testimager_client.mak" CFG="testimager_client - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testimager_client - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "testimager_client - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testimager_client - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/client_src/testimager_client/Release" -# PROP Intermediate_Dir "../pc_win32/client_src/testimager_client/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../" /I "C:\nsrg\external\pc_win32\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 glut32.lib opengl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" /libpath:"C:\nsrg\external\pc_win32\lib" - -!ELSEIF "$(CFG)" == "testimager_client - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/client_src/testimager_client/Debug" -# PROP Intermediate_Dir "../pc_win32/client_src/testimager_client/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../" /I "C:\nsrg\external\pc_win32\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 glut32.lib opengl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" /libpath:"C:\nsrg\external\pc_win32\lib" - -!ENDIF - -# Begin Target - -# Name "testimager_client - Win32 Release" -# Name "testimager_client - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\testimager_client.C -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/client_src/testimager_client.vcproj b/src/vrpn/client_src/testimager_client.vcproj deleted file mode 100644 index c2ee96d7968aef3a94d3710971a6582b8cc075f0..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/testimager_client.vcproj +++ /dev/null @@ -1,250 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="testimager_client" - ProjectGUID="{AC3D4ACE-C143-484A-B4E7-2EC70AA12781}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/client_src/testimager_client/Release" - IntermediateDirectory=".\../pc_win32/client_src/testimager_client/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/testimager_client/Release/testimager_client.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include";../;C:\nsrg\external\pc_win32\GL\include" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/client_src/testimager_client/Release/testimager_client.pch" - AssemblerListingLocation=".\../pc_win32/client_src/testimager_client/Release/" - ObjectFile=".\../pc_win32/client_src/testimager_client/Release/" - ProgramDataBaseFileName=".\../pc_win32/client_src/testimager_client/Release/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="glut32.lib opengl32.lib" - OutputFile=".\../pc_win32/client_src/testimager_client/Release/testimager_client.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib";C:\nsrg\external\pc_win32\GL\lib;"C:\Program Files (x86)\CISMM\external\GL\lib"" - ProgramDatabaseFile=".\../pc_win32/client_src/testimager_client/Release/testimager_client.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - EmbedManifest="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/testimager_client/Release/testimager_client.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/client_src/testimager_client/Debug" - IntermediateDirectory=".\../pc_win32/client_src/testimager_client/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/testimager_client/Debug/testimager_client.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include";../;C:\nsrg\external\pc_win32\GL\include" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/client_src/testimager_client/Debug/testimager_client.pch" - AssemblerListingLocation=".\../pc_win32/client_src/testimager_client/Debug/" - ObjectFile=".\../pc_win32/client_src/testimager_client/Debug/" - ProgramDataBaseFileName=".\../pc_win32/client_src/testimager_client/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="glut32.lib opengl32.lib" - OutputFile=".\../pc_win32/client_src/testimager_client/Debug/testimager_client.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib";C:\nsrg\external\pc_win32\GL\lib;"C:\Program Files (x86)\CISMM\external\GL\lib"" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/client_src/testimager_client/Debug/testimager_client.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - EmbedManifest="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/testimager_client/Debug/testimager_client.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="testimager_client.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/client_src/text.C b/src/vrpn/client_src/text.C deleted file mode 100644 index 64c088b599b88f365174c58a58d3a73cc9ce9a3c..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/text.C +++ /dev/null @@ -1,46 +0,0 @@ -#include <signal.h> // for signal, SIGINT -#include <stdio.h> // for printf, NULL -#include <stdlib.h> // for exit -#include <vrpn_Connection.h> // for vrpn_Connection -#include <vrpn_Text.h> // for vrpn_Text_Receiver, etc - -#include "vrpn_Configure.h" // for VRPN_CALLBACK - -vrpn_Connection * c; - -void handle_cntl_c (int) { - - const char * n; - long i; - - if (c) - for (i = 0L; (n = c->sender_name(i)); i++) - printf("Knew sender \"%s\".\n", n); - - // print out type names - - if (c) - for (i = 0L; (n = c->message_type_name(i)); i++) - printf("Knew type \"%s\".\n", n); - - exit(0); -} - -void VRPN_CALLBACK my_handler(void * userdata, const vrpn_TEXTCB info){ - printf("%d %d %s\n", info.type, info.level, info.message); -} - -int main(int argc, char* argv[]) -{ - vrpn_Text_Receiver * r = new vrpn_Text_Receiver (argv[1]); - - r->register_message_handler(NULL, my_handler); - - // DEBUGGING - TCH 8 Sept 98 - c = r->connectionPtr(); - signal(SIGINT, handle_cntl_c); - - while (1) - r->mainloop(); -} - diff --git a/src/vrpn/client_src/tracker_to_poser.cpp b/src/vrpn/client_src/tracker_to_poser.cpp deleted file mode 100644 index cd369b3ef9f2c71033ba642d2315408f45ee29e6..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/tracker_to_poser.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include <stdio.h> // for fprintf, stderr, printf, etc -#include <stdlib.h> // for atoi, exit -#include <string.h> // for strcmp -#include <vrpn_Shared.h> // for vrpn_gettimeofday, vrpn_SleepMsecs, timeval - -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Poser.h" // for vrpn_Poser_Remote -#include "vrpn_Tracker.h" // for vrpn_TRACKERCB, etc - -static bool g_verbose = false; - -void Usage (const char * s) -{ - fprintf(stderr,"Usage: %s [-v] [-millisleep n] [trackername [posername]]\n",s); - fprintf(stderr," -millisleep: Sleep n milliseconds each loop cycle\n"); - fprintf(stderr," (if no option is specified, the Windows architecture\n"); - fprintf(stderr," will free the rest of its time slice on each loop\n"); - fprintf(stderr," but leave the processes available to be run immediately;\n"); - fprintf(stderr," a 1ms sleep is the default on all other architectures).\n"); - fprintf(stderr," -millisleep 0 is recommended when using this server and\n"); - fprintf(stderr," a client on the same uniprocessor CPU Win32 PC.\n"); - fprintf(stderr," -millisleep -1 will cause the server process to use the\n"); - fprintf(stderr," whole CPU on any uniprocessor machine.\n"); - fprintf(stderr," -v: Verbose.\n"); - fprintf(stderr," trackername: String name of the tracker device (default Tracker0@localhost)\n"); - fprintf(stderr," posername: String name of the poser device (default Poser0@localhost)\n"); - exit(0); -} - -//-------------------------------------------------------------------------------------- -// This function takes the pose reported by the tracker and sends it -// directly to the poser, without changing it in any way. For this to -// work properly, the tracker must report translations in just the right -// space for the poser. - -void VRPN_CALLBACK handle_tracker_update(void *userdata, const vrpn_TRACKERCB t) -{ - // Turn the pointer into a poser pointer. - vrpn_Poser_Remote *psr= (vrpn_Poser_Remote*)userdata; - - // Get the data from the tracker and send it to the poser. - struct timeval now; - vrpn_gettimeofday(&now, NULL); - psr->request_pose(now, t.pos, t.quat); -} - -int main (int argc, char * argv[]) -{ - char default_tracker[] = "Tracker0@localhost"; - char default_poser[] = "Poser0@localhost"; - char *tracker_client_name = default_tracker; - char *poser_client_name = default_poser; - int realparams = 0; - int i; - -#ifdef _WIN32 - // On Windows, the millisleep with 0 option frees up the CPU time slice for other jobs - // but does not sleep for a specific time. On Unix, this returns immediately and does - // not do anything but waste cycles. - int milli_sleep_time = 0; // How long to sleep each iteration (default: free the timeslice but be runnable again immediately) -#else - int milli_sleep_time = 1; // How long to sleep each iteration (default: 1ms) -#endif -#ifdef WIN32 - WSADATA wsaData; - int status; - if ((status = WSAStartup(MAKEWORD(1,1), &wsaData)) != 0) { - fprintf(stderr, "WSAStartup failed with %d\n", status); - return(1); - } -#endif // not WIN32 - - //-------------------------------------------------------------------------------------- - // Parse the command line - i = 1; - while (i < argc) { - if (!strcmp(argv[i], "-v")) { // Specify config-file name - g_verbose = true; - } else if (!strcmp(argv[i], "-millisleep")) { // How long to sleep each loop? - if (++i > argc) { Usage(argv[0]); } - milli_sleep_time = atoi(argv[i]); - } else if (argv[i][0] == '-') { // Unknown flag - Usage(argv[0]); - } else switch (realparams) { // Non-flag parameters - case 0: - tracker_client_name = argv[i]; - realparams++; - break; - case 1: - poser_client_name = argv[i]; - realparams++; - break; - default: - Usage(argv[0]); - } - i++; - } - if (realparams > 2) { - Usage(argv[0]); - } - - //-------------------------------------------------------------------------------------- - // Open the tracker and poser objects that we're going to use. - if (g_verbose) { - printf("Opening tracker %s, poser %s\n", tracker_client_name, poser_client_name); - } - vrpn_Tracker_Remote *tkr = new vrpn_Tracker_Remote(tracker_client_name); - vrpn_Poser_Remote *psr = new vrpn_Poser_Remote(poser_client_name); - - //-------------------------------------------------------------------------------------- - // Set up the callback handler on the tracker object and pass it - // a pointer to the poser it is to use. Only ask for data from - // sensor 0. - tkr->register_change_handler(psr, handle_tracker_update, 0); - - //-------------------------------------------------------------------------------------- - // Loop forever until killed. - while (1) { - tkr->mainloop(); - psr->mainloop(); - vrpn_SleepMsecs(milli_sleep_time); - } - - return 0; -} diff --git a/src/vrpn/client_src/tracker_to_poser.dsp b/src/vrpn/client_src/tracker_to_poser.dsp deleted file mode 100644 index 146b960c031214e77239f4e727a0cb480630bd2c..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/tracker_to_poser.dsp +++ /dev/null @@ -1,101 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tracker_to_poser" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=tracker_to_poser - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "tracker_to_poser.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "tracker_to_poser.mak" CFG="tracker_to_poser - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "tracker_to_poser - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "tracker_to_poser - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "tracker_to_poser - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../quat" /I "../" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "tracker_to_poser - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../quat" /I "../" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "tracker_to_poser - Win32 Release" -# Name "tracker_to_poser - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\tracker_to_poser.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/client_src/tracker_to_poser.vcproj b/src/vrpn/client_src/tracker_to_poser.vcproj deleted file mode 100644 index fb43e75b3271bc4717316637421b9e92de47c0ab..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/tracker_to_poser.vcproj +++ /dev/null @@ -1,243 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="tracker_to_poser" - ProjectGUID="{1AC1C1EB-400A-4838-AC5E-48F3F9CE7D5C}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\Release" - IntermediateDirectory=".\Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\Release/tracker_to_poser.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,../quat,../" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\Release/tracker_to_poser.pch" - AssemblerListingLocation=".\Release/" - ObjectFile=".\Release/" - ProgramDataBaseFileName=".\Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\Release/tracker_to_poser.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\Release/tracker_to_poser.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\Release/tracker_to_poser.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\Debug" - IntermediateDirectory=".\Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\Debug/tracker_to_poser.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,../quat,../" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\Debug/tracker_to_poser.pch" - AssemblerListingLocation=".\Debug/" - ObjectFile=".\Debug/" - ProgramDataBaseFileName=".\Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\Debug/tracker_to_poser.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\Debug/tracker_to_poser.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\Debug/tracker_to_poser.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="tracker_to_poser.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/client_src/vrpn_LamportClock.t.C b/src/vrpn/client_src/vrpn_LamportClock.t.C deleted file mode 100644 index 32d6b75a9272cccbd45d241a9e2521e86126bcdf..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/vrpn_LamportClock.t.C +++ /dev/null @@ -1,112 +0,0 @@ -// Test code for vrpn_LamportClock - -#ifdef VRPN_USE_OLD_STREAMS - #include <iostream.h> -#else - #include <iostream> - using namespace std; -#endif - -#include <assert.h> - -#include <vrpn_LamportClock.h> - - - -vrpn_LamportClock * clockA; -vrpn_LamportClock * clockB; - - -void setUp (void) { - - clockA = new vrpn_LamportClock (2, 0); - clockB = new vrpn_LamportClock (2, 1); - -} - -void tearDown (void) { - - if (clockA) delete clockA; - if (clockB) delete clockB; - -} - -void test_one_getTimestampAndAdvance (void) { - - vrpn_LamportTimestamp * t1 = clockA->getTimestampAndAdvance(); - vrpn_LamportTimestamp tc (*t1); - - assert(t1); - - assert(t1->size() == 2); - assert((*t1)[0] == 1); - assert((*t1)[1] == 0); - - assert(!(*t1 < *t1)); - - assert(!(tc < *t1)); - assert(!(*t1 < tc)); - - vrpn_LamportTimestamp * t2 = clockA->getTimestampAndAdvance(); - - assert(t2); - - assert((*t1)[0] == 1); - assert((*t1)[1] == 0); - assert(t2->size() == 2); - assert((*t2)[0] == 2); - assert((*t2)[1] == 0); - - assert(*t1 < *t2); - assert(!(*t2 < *t1)); - - vrpn_LamportTimestamp * t3 = clockA->getTimestampAndAdvance(); - vrpn_LamportTimestamp * t4 = clockA->getTimestampAndAdvance(); - vrpn_LamportTimestamp * t5 = clockA->getTimestampAndAdvance(); - - assert(t5->size() == 2); - assert((*t5)[0] == 5); - assert((*t5)[1] == 0); - - delete t1; - delete t2; - delete t3; - delete t4; - delete t5; -} - -void test_two (void) { - - vrpn_LamportTimestamp * ta1 = clockA->getTimestampAndAdvance(); - vrpn_LamportTimestamp * tb1 = clockB->getTimestampAndAdvance(); - clockA->receive(*tb1); - vrpn_LamportTimestamp * ta2 = clockA->getTimestampAndAdvance(); - - assert((*ta2)[0] == 2); - assert((*ta2)[1] == 1); - - assert(*ta1 < *ta2); - assert(*tb1 < *ta2); - assert(!(*tb1 < *ta1)); - assert(!(*ta1 < *tb1)); - - delete ta1; - delete tb1; - delete ta2; -} - - -int main (int argc, char ** argv) { - - setUp(); - test_one_getTimestampAndAdvance(); - tearDown(); - - setUp(); - test_two(); - tearDown(); - - cout << "OK" << endl; - -} - diff --git a/src/vrpn/client_src/vrpn_ping.C b/src/vrpn/client_src/vrpn_ping.C deleted file mode 100644 index b7a2d8062731c6218079b5e2e26247420a4de3d2..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/vrpn_ping.C +++ /dev/null @@ -1,109 +0,0 @@ -/* This program will ping a VRPN server and time how long it takes the server - that is being pinged to respond. It makes use of the VRPN ping/pong - mechanism by which objects detect if they have connected to servers. - It gives an indication of the round-trip time from a message at the user - level from a client through the user level at a server. -*/ - -#include <signal.h> // for signal, SIGINT -#include <stdio.h> // for NULL, printf -#include <stdlib.h> // for exit -#include <vrpn_Connection.h> // for vrpn_Connection, etc -#include <vrpn_Text.h> // for vrpn_Text_Receiver - -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday, etc -#include "vrpn_Types.h" // for vrpn_int32 - -vrpn_Text_Receiver *r; -vrpn_Connection *c; -vrpn_int32 ping_message_id; -vrpn_int32 pong_message_id; -vrpn_int32 sender; - -struct timeval now; -struct timeval last_ping; - -void handle_cntl_c(int) { exit(0); } - -int VRPN_CALLBACK my_pong_handler(void *userdata, vrpn_HANDLERPARAM p) -{ - static int count = 0; - static double min = 10000, max = 0, sum = 0; - - // See how long it has been between the ping request and - // the pong response. - struct timeval diff; - vrpn_gettimeofday(&now, NULL); - double msecs; - diff = vrpn_TimevalDiff(now, last_ping); - msecs = vrpn_TimevalMsecs(vrpn_TimevalNormalize(diff)); - - // Keep statistics on the length (min, max, average) - if (msecs < min) { - min = msecs; - }; - if (msecs > max) { - max = msecs; - }; - sum += msecs; - - // Print and reset the statistics every once in a while - if (++count == 500) { - printf("Min = %4.2g, Max = %4.2g, Mean = %4.2g\n", min, max, - sum / count); - count = 0; - min = 10000; - max = sum = 0.0; - } - - // Send a new ping request, and record when we sent it. - // REMEMBER not to call mainloop() within the handler. - vrpn_gettimeofday(&last_ping, NULL); - c->pack_message(0, last_ping, ping_message_id, sender, NULL, - vrpn_CONNECTION_RELIABLE); - c->send_pending_reports(); - - return 0; -} - -int main(int argc, char *argv[]) -{ - // Declare a new text receiver (all objects are text senders) - // and find out what connection it is using. - r = new vrpn_Text_Receiver(argv[1]); - c = r->connectionPtr(); - - // Declare the same sender and message types that the BaseClass - // will use for doing the ping/pong, so we can use the same - // mechanism. Register a handler for the pong message, so we - // can deal with them. - ping_message_id = c->register_message_type("Server, are you there?"); - pong_message_id = c->register_message_type("Server is here!"); - sender = c->register_sender(vrpn_copy_service_name(argv[1])); - c->register_handler(pong_message_id, my_pong_handler, NULL, sender); - - // Let the user kill the program "nicely." - signal(SIGINT, handle_cntl_c); - - // Wait a few seconds (spinning while we do) in order to allow the - // real pong message to clear from the system. - struct timeval then, diff; - vrpn_gettimeofday(&then, NULL); - do { - vrpn_gettimeofday(&now, NULL); - r->mainloop(); - diff = vrpn_TimevalDiff(now, then); - } while (vrpn_TimevalMsecs(vrpn_TimevalNormalize(diff)) < 2000); - - // Send a new ping request to the server, and start counting how - // long it takes to respond. - vrpn_gettimeofday(&last_ping, NULL); - c->pack_message(0, last_ping, ping_message_id, sender, NULL, - vrpn_CONNECTION_RELIABLE); - - // Loop forever. - while (1) { - r->mainloop(); - } -} diff --git a/src/vrpn/client_src/vrpn_print_devices.C b/src/vrpn/client_src/vrpn_print_devices.C deleted file mode 100644 index c059cdf2aced1eacc4ce2ca028e235cee27022e9..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/vrpn_print_devices.C +++ /dev/null @@ -1,397 +0,0 @@ -/* vrpn_print_devices.C - - This is a VRPN client program that will connect to one or more VRPN - server devices and print out descriptions of any of a number of - message types. These include at least tracker, button, dial and analog - messages. It is useful for testing whether a server is up and running, - and perhaps for simple debugging. -*/ - -#include <stdio.h> // for printf, fprintf, NULL, etc -#include <stdlib.h> // for exit, atoi -#ifndef _WIN32_WCE -#include <signal.h> // for signal, SIGINT -#endif -#include <string.h> // for strcmp, strncpy -#include <vrpn_Analog.h> // for vrpn_ANALOGCB, etc -#include <vrpn_Button.h> // for vrpn_Button_Remote, etc -#include <vrpn_Dial.h> // for vrpn_Dial_Remote, etc -#include <vrpn_FileConnection.h> // For preload and accumulate settings -#include <vrpn_Shared.h> // for vrpn_SleepMsecs -#include <vrpn_Text.h> // for vrpn_Text_Receiver, etc -#include <vrpn_Tracker.h> // for vrpn_TRACKERACCCB, etc -#include <vector> // for vector - -#include "vrpn_BaseClass.h" // for vrpn_System_TextPrinter, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Types.h" // for vrpn_float64, vrpn_int32 - -using namespace std; - -int done = 0; // Signals that the program should exit -unsigned tracker_stride = 1; // Every nth report will be printed - -//------------------------------------- -// This section contains the data structure that holds information on -// the devices that are created. For each named device, a remote of each -// type (tracker, button, analog, dial, text) is created. A particular device -// may only report a subset of these values, but that doesn't hurt anything -- -// there simply will be no messages of the other types to receive and so -// nothing is printed. - -class device_info { -public: - char *name; - vrpn_Tracker_Remote *tkr; - vrpn_Button_Remote *btn; - vrpn_Analog_Remote *ana; - vrpn_Dial_Remote *dial; - vrpn_Text_Receiver *text; -}; -const unsigned MAX_DEVICES = 50; - -//------------------------------------- -// This section contains the data structure that is used to determine how -// often to print a report for each sensor of each tracker. Each element -// contains a counter that is used by the callback routine to keep track -// of how many it has skipped. There is an element for each possible sensor. -// A new array of elements is created for each new tracker object, and a -// pointer to it is passed as the userdata pointer to the callback handlers. -// A separate array is kept for the position, velocity, and acceleration for -// each -// tracker. The structure passed to the callback handler also has a -// string that is the name of the tracker. - -class t_user_callback { -public: - char t_name[vrpn_MAX_TEXT_LEN]; - vector<unsigned> t_counts; -}; - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK -handle_tracker_pos_quat(void *userdata, const vrpn_TRACKERCB t) -{ - t_user_callback *t_data = static_cast<t_user_callback *>(userdata); - - // Make sure we have a count value for this sensor - while (t_data->t_counts.size() <= static_cast<unsigned>(t.sensor)) { - t_data->t_counts.push_back(0); - } - - // See if we have gotten enough reports from this sensor that we should - // print this one. If so, print and reset the count. - if (++t_data->t_counts[t.sensor] >= tracker_stride) { - t_data->t_counts[t.sensor] = 0; - printf("Tracker %s, sensor %d:\n pos (%5.2f, %5.2f, %5.2f); " - "quat (%5.2f, %5.2f, %5.2f, %5.2f)\n", - t_data->t_name, t.sensor, t.pos[0], t.pos[1], t.pos[2], - t.quat[0], t.quat[1], t.quat[2], t.quat[3]); - } -} - -void VRPN_CALLBACK handle_tracker_vel(void *userdata, const vrpn_TRACKERVELCB t) -{ - t_user_callback *t_data = static_cast<t_user_callback *>(userdata); - - // Make sure we have a count value for this sensor - while (t_data->t_counts.size() <= static_cast<unsigned>(t.sensor)) { - t_data->t_counts.push_back(0); - } - - // See if we have gotten enough reports from this sensor that we should - // print this one. If so, print and reset the count. - if (++t_data->t_counts[t.sensor] >= tracker_stride) { - t_data->t_counts[t.sensor] = 0; - printf("Tracker %s, sensor %d:\n vel (%5.2f, %5.2f, %5.2f); " - "quatvel (%5.2f, %5.2f, %5.2f, %5.2f)\n", - t_data->t_name, t.sensor, t.vel[0], t.vel[1], t.vel[2], - t.vel_quat[0], t.vel_quat[1], t.vel_quat[2], t.vel_quat[3]); - } -} - -void VRPN_CALLBACK handle_tracker_acc(void *userdata, const vrpn_TRACKERACCCB t) -{ - t_user_callback *t_data = static_cast<t_user_callback *>(userdata); - - // Make sure we have a count value for this sensor - while (t_data->t_counts.size() <= static_cast<unsigned>(t.sensor)) { - t_data->t_counts.push_back(0); - } - - // See if we have gotten enough reports from this sensor that we should - // print this one. If so, print and reset the count. - if (++t_data->t_counts[t.sensor] >= tracker_stride) { - t_data->t_counts[t.sensor] = 0; - printf("Tracker %s, sensor %d:\n acc (%5.2f, %5.2f, %5.2f); " - "quatacc (%5.2f, %5.2f, %5.2f, %5.2f)\n", - t_data->t_name, t.sensor, t.acc[0], t.acc[1], t.acc[2], - t.acc_quat[0], t.acc_quat[1], t.acc_quat[2], t.acc_quat[3]); - } -} - -void VRPN_CALLBACK handle_button(void *userdata, const vrpn_BUTTONCB b) -{ - const char *name = (const char *)userdata; - - printf("##########################################\r\n" - "Button %s, number %d was just %s\n" - "##########################################\r\n", - name, b.button, b.state ? "pressed" : "released"); -} - -void VRPN_CALLBACK -handle_button_states(void *userdata, const vrpn_BUTTONSTATESCB b) -{ - const char *name = (const char *)userdata; - - printf("Button %s has %d buttons with states:", name, b.num_buttons); - int i; - for (i = 0; i < b.num_buttons; i++) { - printf(" %d", b.states[i]); - } - printf("\n"); -} - -void VRPN_CALLBACK handle_analog(void *userdata, const vrpn_ANALOGCB a) -{ - int i; - const char *name = (const char *)userdata; - - printf("Analog %s:\n %5.2f", name, a.channel[0]); - for (i = 1; i < a.num_channel; i++) { - printf(", %5.2f", a.channel[i]); - } - printf(" (%d chans)\n", a.num_channel); -} - -void VRPN_CALLBACK handle_dial(void *userdata, const vrpn_DIALCB d) -{ - const char *name = (const char *)userdata; - - printf("Dial %s, number %d was moved by %5.2f\n", name, d.dial, d.change); -} - -void VRPN_CALLBACK handle_text(void *userdata, const vrpn_TEXTCB t) -{ - const char *name = (const char *)userdata; - - // Warnings and errors are printed by the system text printer. - if (t.type == vrpn_TEXT_NORMAL) { - printf("%s: Text message: %s\n", name, t.message); - } -} - -// WARNING: On Windows systems, this handler is called in a separate -// thread from the main program (this differs from Unix). To avoid all -// sorts of chaos as the main program continues to handle packets, we -// set a done flag here and let the main program shut down in its own -// thread by calling shutdown() to do all of the stuff we used to do in -// this handler. - -void handle_cntl_c(int) { done = 1; } - -void Usage(const char *arg0) -{ - fprintf( - stderr, - "Usage: %s [-notracker] [-nobutton] [-noanalog] [-nodial]\n" - " [-trackerstride n]\n" - " [-notext] device1 [device2] [device3] [device4] [...]\n" - " -trackerstride: Print every nth report from each tracker sensor\n" - " -notracker: Don't print tracker reports for following devices\n" - " -nobutton: Don't print button reports for following devices\n" - " -noanalog: Don't print analog reports for following devices\n" - " -nodial: Don't print dial reports for following devices\n" - " -notext: Don't print text messages (warnings, errors) for " - "following devices\n" - " deviceX: VRPN name of device to connect to (eg: Tracker0@ioglab)\n" - " The default behavior is to print all message types for all devices " - "listed\n" - " The order of the parameters can be changed to suit\n", - arg0); - - exit(0); -} - -int main(int argc, char *argv[]) -{ - int print_for_tracker = 1; // Print tracker reports? - int print_for_button = 1; // Print button reports? - int print_for_analog = 1; // Print analog reports? - int print_for_dial = 1; // Print dial reports? - int print_for_text = 1; // Print warning/error messages? - - // If we happen to open a file, neither preload nor accumulate the - // messages in memory, to avoid crashing for huge files. - vrpn_FILE_CONNECTIONS_SHOULD_PRELOAD = false; - vrpn_FILE_CONNECTIONS_SHOULD_ACCUMULATE = false; - - device_info device_list[MAX_DEVICES]; - unsigned num_devices = 0; - - int i; - - // Parse arguments, creating objects as we go. Arguments that - // change the way a device is treated affect all devices that - // follow on the command line. - for (i = 1; i < argc; i++) { - if (!strcmp(argv[i], "-notracker")) { - print_for_tracker = 0; - } - else if (!strcmp(argv[i], "-nobutton")) { - print_for_button = 0; - } - else if (!strcmp(argv[i], "-noanalog")) { - print_for_analog = 0; - } - else if (!strcmp(argv[i], "-nodial")) { - print_for_dial = 0; - } - else if (!strcmp(argv[i], "-notext")) { - print_for_text = 0; - } - else if (!strcmp(argv[i], "-trackerstride")) { - if (++i >= argc) { - Usage(argv[0]); - } - if (atoi(argv[i]) <= 0) { - fprintf(stderr, - "-trackerstride argument must be 1 or greater\n"); - return -1; - } - tracker_stride = atoi(argv[i]); - } - else { // Create a device and connect to it. - device_info *dev; - - // Make sure we have enough room for the new device - if (num_devices == MAX_DEVICES) { - fprintf(stderr, "Too many devices!\n"); - exit(-1); - } - - // Name the device and open it as everything - dev = &device_list[num_devices]; - dev->name = argv[i]; - dev->tkr = new vrpn_Tracker_Remote(dev->name); - dev->ana = new vrpn_Analog_Remote(dev->name); - dev->btn = new vrpn_Button_Remote(dev->name); - dev->dial = new vrpn_Dial_Remote(dev->name); - dev->text = new vrpn_Text_Receiver(dev->name); - if ((dev->ana == NULL) || (dev->btn == NULL) || - (dev->dial == NULL) || (dev->tkr == NULL) || - (dev->text == NULL)) { - fprintf(stderr, "Error opening %s\n", dev->name); - return -1; - } - else { - printf("Opened %s as:", dev->name); - } - - // If we are printing the tracker reports, prepare the - // user-data callbacks and hook them up to be called with - // the correct data for this device. - if (print_for_tracker) { - vrpn_Tracker_Remote *tkr = dev->tkr; - t_user_callback *tc1 = new t_user_callback; - t_user_callback *tc2 = new t_user_callback; - t_user_callback *tc3 = new t_user_callback; - - if ((tc1 == NULL) || (tc2 == NULL) || (tc3 == NULL)) { - fprintf(stderr, "Out of memory\n"); - } - printf(" Tracker"); - - // Fill in the user-data callback information - strncpy(tc1->t_name, dev->name, sizeof(tc1->t_name)); - strncpy(tc2->t_name, dev->name, sizeof(tc2->t_name)); - strncpy(tc3->t_name, dev->name, sizeof(tc3->t_name)); - - // Set up the tracker callback handlers - tkr->register_change_handler(tc1, handle_tracker_pos_quat); - tkr->register_change_handler(tc2, handle_tracker_vel); - tkr->register_change_handler(tc3, handle_tracker_acc); - } - - if (print_for_button) { - printf(" Button"); - dev->btn->register_change_handler(dev->name, handle_button); - dev->btn->register_states_handler(dev->name, - handle_button_states); - } - - if (print_for_analog) { - printf(" Analog"); - dev->ana->register_change_handler(dev->name, handle_analog); - } - - if (print_for_dial) { - printf(" Dial"); - dev->dial->register_change_handler(dev->name, handle_dial); - } - - if (print_for_text) { - printf(" Text"); - dev->text->register_message_handler(dev->name, handle_text); - } - else { - vrpn_System_TextPrinter.remove_object(dev->tkr); - vrpn_System_TextPrinter.remove_object(dev->btn); - vrpn_System_TextPrinter.remove_object(dev->ana); - vrpn_System_TextPrinter.remove_object(dev->dial); - vrpn_System_TextPrinter.remove_object(dev->text); - } - - printf(".\n"); - num_devices++; - } - } - if (num_devices == 0) { - Usage(argv[0]); - } - -#ifndef _WIN32_WCE - // signal handler so logfiles get closed right - signal(SIGINT, handle_cntl_c); -#endif - - /* - * main interactive loop - */ - printf("Press ^C to exit.\n"); - while (!done) { - unsigned i; - - // Let all the devices do their things - for (i = 0; i < num_devices; i++) { - device_list[i].tkr->mainloop(); - device_list[i].btn->mainloop(); - device_list[i].ana->mainloop(); - device_list[i].dial->mainloop(); - device_list[i].text->mainloop(); - } - - // Sleep for 1ms so we don't eat the CPU - vrpn_SleepMsecs(1); - } - - // Delete all devices. - { - unsigned i; - for (i = 0; i < num_devices; i++) { - delete device_list[i].tkr; - delete device_list[i].btn; - delete device_list[i].ana; - delete device_list[i].dial; - delete device_list[i].text; - } - } - - return 0; -} /* main */ diff --git a/src/vrpn/client_src/vrpn_print_devices.dsp b/src/vrpn/client_src/vrpn_print_devices.dsp deleted file mode 100644 index 0883901a6034885345e31365b2c80a8c83f4e9ae..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/vrpn_print_devices.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="vrpn_print_devices" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=vrpn_print_devices - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "vrpn_print_devices.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "vrpn_print_devices.mak" CFG="vrpn_print_devices - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "vrpn_print_devices - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "vrpn_print_devices - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "vrpn_print_devices - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/client_src/vrpn_print_devices/Release" -# PROP Intermediate_Dir "../pc_win32/client_src/vrpn_print_devices/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/client_src/vrpn_print_devices/Debug" -# PROP Intermediate_Dir "../pc_win32/client_src/vrpn_print_devices/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /GZ /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "vrpn_print_devices - Win32 Release" -# Name "vrpn_print_devices - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=vrpn_print_devices.C -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/client_src/vrpn_print_devices.vcproj b/src/vrpn/client_src/vrpn_print_devices.vcproj deleted file mode 100644 index 1a764443f5329e1d1928dc577febf97a74c93de0..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/vrpn_print_devices.vcproj +++ /dev/null @@ -1,246 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="vrpn_print_devices" - ProjectGUID="{AED1729B-0600-4ECD-BE20-9F1964FFD2C8}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/client_src/vrpn_print_devices/Debug" - IntermediateDirectory=".\../pc_win32/client_src/vrpn_print_devices/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/vrpn_print_devices/Debug/vrpn_print_devices.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";.." - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/client_src/vrpn_print_devices/Debug/vrpn_print_devices.pch" - AssemblerListingLocation=".\../pc_win32/client_src/vrpn_print_devices/Debug/" - ObjectFile=".\../pc_win32/client_src/vrpn_print_devices/Debug/" - ProgramDataBaseFileName=".\../pc_win32/client_src/vrpn_print_devices/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/client_src/vrpn_print_devices/Debug/vrpn_print_devices.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/client_src/vrpn_print_devices/Debug/vrpn_print_devices.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/vrpn_print_devices/Debug/vrpn_print_devices.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/client_src/vrpn_print_devices/Release" - IntermediateDirectory=".\../pc_win32/client_src/vrpn_print_devices/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/client_src/vrpn_print_devices/Release/vrpn_print_devices.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";.." - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/client_src/vrpn_print_devices/Release/vrpn_print_devices.pch" - AssemblerListingLocation=".\../pc_win32/client_src/vrpn_print_devices/Release/" - ObjectFile=".\../pc_win32/client_src/vrpn_print_devices/Release/" - ProgramDataBaseFileName=".\../pc_win32/client_src/vrpn_print_devices/Release/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/client_src/vrpn_print_devices/Release/vrpn_print_devices.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/client_src/vrpn_print_devices/Release/vrpn_print_devices.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/client_src/vrpn_print_devices/Release/vrpn_print_devices.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="vrpn_print_devices.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/client_src/vrpn_print_messages.C b/src/vrpn/client_src/vrpn_print_messages.C deleted file mode 100644 index 106d304039e15d7bf770d0921884b3a22aa34bb8..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/vrpn_print_messages.C +++ /dev/null @@ -1,82 +0,0 @@ -// vrpn_print_message.C: Print out information about all the messages -// that come from a VRPN file or connection. Useful for seeing what -// is at a server or in a file. -// It uses the logging feature to get called even for messages that -// it has not registered senders for. - -// XXX Does not work on files; nothing gets printed... - -// XXX Bad side effect: It produces a file called vrpn_temp.deleteme -// in the current directory. -#include <stdio.h> // for fprintf, NULL, stderr, etc -#include <stdlib.h> // for exit - -#include <vrpn_Configure.h> // for VRPN_CALLBACK -#include <vrpn_Shared.h> // for timeval -#include <vrpn_Connection.h> // for vrpn_HANDLERPARAM, etc - -vrpn_Connection *conn; // Connection pointer - -int Usage(char *s) -{ - fprintf(stderr, "Usage: %s vrpn_connection_name\n", s); - fprintf(stderr, " (Note: file:filename can be connection name)\n"); - return -1; -} - -// This function does the work. It prints out the message type, -// sender, size and time for each message that comes in to the -// connection. - -int VRPN_CALLBACK msg_handler(void *, vrpn_HANDLERPARAM p) -{ - const char *sender_name = conn->sender_name(p.sender); - const char *type_name = conn->message_type_name(p.type); - - // We'll need to adjust the sender and type if it was - // unknown. - if (sender_name == NULL) { - sender_name = "UNKNOWN_SENDER"; - } - if (type_name == NULL) { - type_name = "UNKNOWN_TYPE"; - } - printf("Time: %ld:%ld, Sender: %s, Type %s, Length %d\n", - static_cast<long>(p.msg_time.tv_sec), - static_cast<long>(p.msg_time.tv_usec), sender_name, type_name, - p.payload_len); - - return -1; // Do not log the message -} - -int main(int argc, char *argv[]) -{ - char *conn_name; // Name of the connection or file - - // Parse the command line - if (argc != 2) { - return Usage(argv[0]); - } - else { - conn_name = argv[1]; - } - - // Open the connection, with a file for incoming log required for some - // reason. - // (I think it's so that there is a log that we can filter by displaying it) - conn = vrpn_get_connection_by_name(conn_name, "vrpn_temp.deleteme"); - if (conn == NULL) { - fprintf(stderr, "ERROR: Can't get connection %s\n", conn_name); - return -1; - } - - // Set up the callback for all message types - conn->register_log_filter(msg_handler, NULL); - - // Mainloop until they kill us. - while (1) { - conn->mainloop(); - } - - return 0; // Sure! -} diff --git a/src/vrpn/client_src/vrpn_print_performance.C b/src/vrpn/client_src/vrpn_print_performance.C deleted file mode 100644 index b3b3127831b8ac9a568c51888c5b12d7992072c7..0000000000000000000000000000000000000000 --- a/src/vrpn/client_src/vrpn_print_performance.C +++ /dev/null @@ -1,370 +0,0 @@ -/* vrpn_print_performance.C - - This is a VRPN client program that will connect to one or more VRPN - server devices and print out the rate of any of a number of message types. - These include only tracker messages at this time, but the rest are easy. - While it doesn't (currently) attempt to consider latency, its measurement of - update rate might be informative to some. -*/ - -#include <stdio.h> // for printf, NULL, fprintf, etc -#include <stdlib.h> // for exit, atoi -#ifndef _WIN32_WCE -#include <signal.h> // for signal, SIGINT -#endif -#include <string.h> // for strcmp, strncpy -#include <vrpn_Analog.h> // for vrpn_Analog_Remote, etc -#include <vrpn_Button.h> // for vrpn_Button_Remote, etc -#include <vrpn_FileConnection.h> // For preload and accumulate settings -#include <vrpn_Shared.h> // for vrpn_gettimeofday, etc -#include <vrpn_Tracker.h> // for vrpn_TRACKERACCCB, etc -#include <vector> // for vector - -#include "vrpn_BaseClass.h" // for vrpn_System_TextPrinter, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK - -using namespace std; - -int done = 0; // Signals that the program should exit -double report_interval = 1; // Every n seconds a report will be printed - -//------------------------------------- -// This section contains the data structure that holds information on -// the devices that are created. For each named device, a remote of each -// type (tracker, button, analog, dial, text) is created. A particular device -// may only report a subset of these values, but that doesn't hurt anything -- -// there simply will be no messages of the other types to receive and so -// nothing is printed. - -class device_info { -public: - char *name; - vrpn_Tracker_Remote *tkr; - vrpn_Button_Remote *btn; - vrpn_Analog_Remote *ana; -}; -const unsigned MAX_DEVICES = 50; - -//------------------------------------- -// This section contains the data structure that is used to determine how -// often to print a report for each sensor of each tracker. Each element -// contains a counter that is used by the callback routine to keep track -// of how many it has skipped. There is an element for each possible sensor. -// A new array of elements is created for each new tracker object, and a -// pointer to it is passed as the userdata pointer to the callback handlers. -// A separate array is kept for the position, velocity, and acceleration for -// each -// tracker. The structure passed to the callback handler also has a -// string that is the name of the tracker. - -class t_user_callback { -public: - char t_name[vrpn_MAX_TEXT_LEN]; - vector<unsigned> t_counts; - vector<struct timeval> t_last_report; -}; - -struct timeval t_analog_last_report; -unsigned t_analog_count; - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK -handle_tracker_pos_quat(void *userdata, const vrpn_TRACKERCB t) -{ - t_user_callback *t_data = static_cast<t_user_callback *>(userdata); - - // Make sure we have a count value for this sensor - while (t_data->t_counts.size() <= static_cast<unsigned>(t.sensor)) { - t_data->t_counts.push_back(0); - } - struct timeval now; - double interval; - vrpn_gettimeofday(&now, NULL); - // Make sure we have a count value for this sensor - while (t_data->t_last_report.size() <= static_cast<unsigned>(t.sensor)) { - t_data->t_last_report.push_back(now); - } - - interval = - vrpn_TimevalDurationSeconds(now, t_data->t_last_report[t.sensor]); - t_data->t_counts[t.sensor]++; - - // See if it's been long enough to display a frequency notification - if (interval >= report_interval) { - double frequency = t_data->t_counts[t.sensor] / interval; - t_data->t_counts[t.sensor] = 0; - t_data->t_last_report[t.sensor] = now; - printf("Tracker %s, sensor %d:\t%5.2f Hz (%5.2f sec)\n", t_data->t_name, - t.sensor, frequency, interval); - } -} - -void VRPN_CALLBACK handle_tracker_vel(void *userdata, const vrpn_TRACKERVELCB t) -{ - t_user_callback *t_data = static_cast<t_user_callback *>(userdata); - - // Make sure we have a count value for this sensor - while (t_data->t_counts.size() <= static_cast<unsigned>(t.sensor)) { - t_data->t_counts.push_back(0); - } - struct timeval now; - double interval; - vrpn_gettimeofday(&now, NULL); - // Make sure we have a count value for this sensor - while (t_data->t_last_report.size() <= static_cast<unsigned>(t.sensor)) { - t_data->t_last_report.push_back(now); - } - - interval = - vrpn_TimevalDurationSeconds(now, t_data->t_last_report[t.sensor]); - t_data->t_counts[t.sensor]++; - - // See if it's been long enough to display a frequency notification - if (interval >= report_interval) { - double frequency = t_data->t_counts[t.sensor] / interval; - t_data->t_counts[t.sensor] = 0; - t_data->t_last_report[t.sensor] = now; - printf("Tracker %s, sensor %d:\t\t%5.2f messages per second averaged " - "over %5.2f seconds\n", - t_data->t_name, t.sensor, frequency, interval); - } -} - -void VRPN_CALLBACK handle_tracker_acc(void *userdata, const vrpn_TRACKERACCCB t) -{ - t_user_callback *t_data = static_cast<t_user_callback *>(userdata); - - // Make sure we have a count value for this sensor - while (t_data->t_counts.size() <= static_cast<unsigned>(t.sensor)) { - t_data->t_counts.push_back(0); - } - struct timeval now; - double interval; - vrpn_gettimeofday(&now, NULL); - // Make sure we have a count value for this sensor - while (t_data->t_last_report.size() <= static_cast<unsigned>(t.sensor)) { - t_data->t_last_report.push_back(now); - } - - interval = - vrpn_TimevalDurationSeconds(now, t_data->t_last_report[t.sensor]); - t_data->t_counts[t.sensor]++; - // See if it's been long enough to display a frequency notification - if (interval >= report_interval) { - double frequency = t_data->t_counts[t.sensor] / interval; - t_data->t_counts[t.sensor] = 0; - t_data->t_last_report[t.sensor] = now; - printf("Tracker %s, sensor %d:\t\t%5.2f messages per second averaged " - "over %5.2f seconds\n", - t_data->t_name, t.sensor, frequency, interval); - } -} - -void VRPN_CALLBACK handle_button(void *userdata, const vrpn_BUTTONCB b) -{ - const char *name = (const char *)userdata; - - printf("Button %s, number %d was just %s\n", name, b.button, - b.state ? "pressed" : "released"); -} - -void VRPN_CALLBACK handle_analog(void *userdata, const vrpn_ANALOGCB /*a*/) -{ - const char *name = (const char *)userdata; - struct timeval now; - double interval; - vrpn_gettimeofday(&now, NULL); - - interval = vrpn_TimevalDurationSeconds(now, t_analog_last_report); - t_analog_count++; - // See if it's been long enough to display a frequency notification - if (interval >= report_interval) { - double frequency = t_analog_count / interval; - t_analog_count = 0; - t_analog_last_report = now; - printf("Analog %s:\t\t%5.2f messages per second averaged over %5.2f " - "seconds\n", - name, frequency, interval); - } - /* - const char *name = (const char *)userdata; - int i; - printf("Analog %s:\n %5.2f", name, a.channel[0]); - for (i = 1; i < a.num_channel; i++) { - printf(", %5.2f", a.channel[i]); - } - printf(" (%d chans)\n", a.num_channel); - */ -} - -// WARNING: On Windows systems, this handler is called in a separate -// thread from the main program (this differs from Unix). To avoid all -// sorts of chaos as the main program continues to handle packets, we -// set a done flag here and let the main program shut down in its own -// thread by calling shutdown() to do all of the stuff we used to do in -// this handler. - -void handle_cntl_c(int) { done = 1; } - -void Usage(const char *arg0) -{ - fprintf( - stderr, - "Usage: %s [--notracker] [--nobutton] [--noanalog] [--nodial]\n" - " [--reportinterval n]\n" - " [--notext] device1 [device2] [device3] [device4] [...]\n" - " -trackerstride: Print every nth report from each tracker sensor\n" - " -notracker: Don't print tracker reports for following devices\n" - " -nobutton: Don't print button reports for following devices\n" - " -noanalog: Don't print analog reports for following devices\n" - " deviceX: VRPN name of device to connect to (eg: Tracker0@ioglab)\n" - " The default behavior is to print all message types for all devices " - "listed\n" - " The order of the parameters can be changed to suit\n", - arg0); - - exit(0); -} - -int main(int argc, char *argv[]) -{ - int print_for_tracker = 1; // Print tracker reports? - int print_for_button = 1; // Print button reports? - int print_for_analog = 1; // Print analog reports? - - // If we happen to open a file, neither preload nor accumulate the - // messages in memory, to avoid crashing for huge files. - vrpn_FILE_CONNECTIONS_SHOULD_PRELOAD = false; - vrpn_FILE_CONNECTIONS_SHOULD_ACCUMULATE = false; - - device_info device_list[MAX_DEVICES]; - int num_devices = 0; - - int i; - - // Parse arguments, creating objects as we go. Arguments that - // change the way a device is treated affect all devices that - // follow on the command line. - for (i = 1; i < argc; i++) { - if (!strcmp(argv[i], "-notracker")) { - print_for_tracker = 0; - } - else if (!strcmp(argv[i], "--nobutton")) { - print_for_button = 0; - } - else if (!strcmp(argv[i], "--noanalog")) { - print_for_analog = 0; - } - else if (!strcmp(argv[i], "--reportinterval")) { - if (++i >= argc) { - Usage(argv[0]); - } - report_interval = atoi(argv[i]); - if (report_interval <= 0) { - fprintf(stderr, - "--reportinterval argument must be 1 or greater\n"); - return -1; - } - } - else { // Create a device and connect to it. - device_info *dev; - - // Make sure we have enough room for the new device - if (num_devices == MAX_DEVICES) { - fprintf(stderr, "Too many devices!\n"); - exit(-1); - } - - // Name the device and open it as everything - dev = &device_list[num_devices]; - dev->name = argv[i]; - dev->tkr = new vrpn_Tracker_Remote(dev->name); - dev->ana = new vrpn_Analog_Remote(dev->name); - dev->btn = new vrpn_Button_Remote(dev->name); - if ((dev->tkr == NULL) || (dev->ana == NULL) || - (dev->btn == NULL)) { - fprintf(stderr, "Error opening %s\n", dev->name); - return -1; - } - else { - printf("Opened %s as:", dev->name); - } - - struct timeval now; - vrpn_gettimeofday(&now, NULL); - - // If we are printing the tracker reports, prepare the - // user-data callbacks and hook them up to be called with - // the correct data for this device. - if (print_for_tracker) { - vrpn_Tracker_Remote *tkr = dev->tkr; - t_user_callback *tc1 = new t_user_callback; - t_user_callback *tc2 = new t_user_callback; - t_user_callback *tc3 = new t_user_callback; - - if ((tc1 == NULL) || (tc2 == NULL) || (tc3 == NULL)) { - fprintf(stderr, "Out of memory\n"); - } - printf(" Tracker"); - - // Fill in the user-data callback information - strncpy(tc1->t_name, dev->name, sizeof(tc1->t_name)); - strncpy(tc2->t_name, dev->name, sizeof(tc2->t_name)); - strncpy(tc3->t_name, dev->name, sizeof(tc3->t_name)); - - // Set up the tracker callback handlers - tkr->register_change_handler(tc1, handle_tracker_pos_quat); - tkr->register_change_handler(tc2, handle_tracker_vel); - tkr->register_change_handler(tc3, handle_tracker_acc); - } - - if (print_for_button) { - printf(" Button"); - dev->btn->register_change_handler(dev->name, handle_button); - } - - if (print_for_analog) { - printf(" Analog"); - t_analog_last_report = now; - t_analog_count = 0; - dev->ana->register_change_handler(dev->name, handle_analog); - } - - printf(".\n"); - num_devices++; - } - } - if (num_devices == 0) { - Usage(argv[0]); - } - -#ifndef _WIN32_WCE - // signal handler so logfiles get closed right - signal(SIGINT, handle_cntl_c); -#endif - - /* - * main interactive loop - */ - printf("Press ^C to exit.\n"); - while (!done) { - int i; - - // Let all the devices do their things - for (i = 0; i < num_devices; i++) { - device_list[i].tkr->mainloop(); - device_list[i].btn->mainloop(); - device_list[i].ana->mainloop(); - } - - // Sleep for 1ms so we don't eat the CPU - vrpn_SleepMsecs(1); - } - - return 0; -} /* main */ diff --git a/src/vrpn/cmake/CheckMacHIDAPI.cmake b/src/vrpn/cmake/CheckMacHIDAPI.cmake deleted file mode 100644 index 54337835a3f55cbeb763b5803bdfb4c3dbae823f..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/CheckMacHIDAPI.cmake +++ /dev/null @@ -1,73 +0,0 @@ -# - Script to check if the signature for a mac HID callback uses UInt32 or uint32_t -# Requires that the associated CPP file be present: CheckMacHIDAPI.cpp. -# -# MACOSX_HID_UINT32T, set according to the results of our test. -# -# Use add_definitions(-DMACOSX_HID_UINT32T=${MACOSX_HID_UINT32T}) in your -# listfile and the following prototype for the function you'd like to -# register using setInterruptReportHandlerCallback: -# void ReaderReportCallback( -# void *target, -# IOReturn result, -# void *refcon, -# void *sender, -# MACOSX_HID_UINT32T size -# ) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - - -if(APPLE) - if(NOT MACOSX_HID_UINT32T) - get_filename_component(_moddir ${CMAKE_CURRENT_LIST_FILE} PATH) - - try_compile(_HID_uint32t - ${CMAKE_BINARY_DIR} - ${_moddir}/CheckMacHIDAPI.cpp - OUTPUT_VARIABLE - _HID_uint32t_OUTPUT - COMPILE_DEFINITIONS - -DMACOSX_HID_UINT32T=uint32_t) - message(STATUS - "Checking uint32_t in HID callback signature... ${_HID_uint32t}") - - try_compile(_HID_UInt32 - ${CMAKE_BINARY_DIR} - ${_moddir}/CheckMacHIDAPI.cpp - OUTPUT_VARIABLE - _HID_UInt32_OUTPUT - COMPILE_DEFINITIONS - -DMACOSX_HID_UINT32T=UInt32) - message(STATUS - "Checking UInt32 in HID callback signature... ${_HID_UInt32}") - - - if(_HID_uint32t) - set(MACOSX_HID_UINT32T - "uint32_t" - CACHE - STRING - "The 32-bit uint type desired in the callback set by setInterruptReportHandlerCallback") - mark_as_advanced(MACOSX_HID_UINT32T) - elseif(_HID_UInt32) - set(MACOSX_HID_UINT32T - "UInt32" - CACHE - STRING - "The 32-bit uint type desired in the callback set by setInterruptReportHandlerCallback") - mark_as_advanced(MACOSX_HID_UINT32T) - else() - message(SEND_ERROR - "ERROR: Could not detect appropriate Mac HID uint32 type!") - endif() - - endif() -endif() diff --git a/src/vrpn/cmake/CheckMacHIDAPI.cpp b/src/vrpn/cmake/CheckMacHIDAPI.cpp deleted file mode 100644 index 00d2a46790786a5b25e5ae3c4e72356066abaa0b..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/CheckMacHIDAPI.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/** - * \file CheckMacHIDAPI.cpp - * \brief C++ source file used by CMake module CheckMacHIDAPI.cmake - * - * \author - * Ryan Pavlik, 2009-2010 - * <rpavlik@iastate.edu> - * http://academic.cleardefinition.com/ - * - * \author - * Based on code extracted from VRPN 07.22 for use as a minimal test case - * - * Attempts to compile a difficult bit of code against the Mac - * HID API, as two different types have been required in the callback - * function (UInt32 and uint32_t) and testing is the best way to know - * which one is correct for a given system. - * - */ - - -#if defined(__APPLE__) - -#include <stdio.h> -#include <IOKit/IOCFPlugIn.h> -#include <IOKit/hid/IOHIDLib.h> -#include <IOKit/hid/IOHIDKeys.h> -#include <CoreFoundation/CoreFoundation.h> -void ReaderReportCallback( - void *target, IOReturn result, void *refcon, void *sender, MACOSX_HID_UINT32T size - ) - {} -#endif - -int main(int argc, char* argv[]) { -#if defined(__APPLE__) - io_object_t _ioObject; - IOHIDDeviceInterface122 **_interface; - unsigned char _buffer[512]; - IOReturn result = (*_interface)->setInterruptReportHandlerCallback(_interface, - _buffer, 512, - ReaderReportCallback, - NULL, 0); -#endif - return 0; -} diff --git a/src/vrpn/cmake/CleanDirectoryList.cmake b/src/vrpn/cmake/CleanDirectoryList.cmake deleted file mode 100644 index 58b8963f9ee3ae27493c8bda68909692b59f4994..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/CleanDirectoryList.cmake +++ /dev/null @@ -1,48 +0,0 @@ -# - Removes duplicate entries and non-directories from a provided list -# -# clean_directory_list(<listvar> [<additional list items>...]) -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__clean_directory_list) - return() -endif() -set(__clean_directory_list YES) - -function(clean_directory_list _var) - # combine variable's current value with additional list items - set(_in ${${_var}} ${ARGN}) - - if(_in) - # Initial list cleaning - list(REMOVE_DUPLICATES _in) - - # Grab the absolute path of each actual directory - set(_out) - foreach(_dir ${_in}) - if(IS_DIRECTORY "${_dir}") - get_filename_component(_dir "${_dir}" ABSOLUTE) - file(TO_CMAKE_PATH "${_dir}" _dir) - list(APPEND _out "${_dir}") - endif() - endforeach() - - if(_out) - # Clean up the output list now - list(REMOVE_DUPLICATES _out) - endif() - - # return _out - set(${_var} "${_out}" PARENT_SCOPE) - endif() -endfunction() diff --git a/src/vrpn/cmake/CleanLibraryList.cmake b/src/vrpn/cmake/CleanLibraryList.cmake deleted file mode 100644 index 77613934dc062c70b9af689f8017065e0a07a8e6..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/CleanLibraryList.cmake +++ /dev/null @@ -1,72 +0,0 @@ -# - A smarter replacement for list(REMOVE_DUPLICATES) for library lists -# -# Note that, in the case of cyclic link dependencies, you _do_ actually need -# a library in a list multiple times. So, only use this function when you know -# that the dependency graph is acyclic. -# -# clean_library_list(<listvar> [<additional list items>...]) - where -# listvar is the name of a destination variable, and also possibly a source, and -# it is followed by any number (including 0) of additional libraries to append -# to the list before processing. -# -# Removes duplicates from the list, leaving only the last instance, while -# preserving the meaning of the "optimized", "debug", and "general" labeling. -# (Libraries listed as general are listed in the result instead as optimized and -# debug) -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__clean_library_list) - return() -endif() -set(__clean_library_list YES) - -function(clean_library_list _var) - # combine variable's current value with additional list items - set(_work ${${_var}} ${ARGN}) - if(_work) - # Turn each of optimized, debug, and general into flags - # prefixed on their respective library (combining list items) - string(REGEX REPLACE "optimized;" "1CLL%O%" _work "${_work}") - string(REGEX REPLACE "debug;" "1CLL%D%" _work "${_work}") - string(REGEX REPLACE "general;" "1CLL%G%" _work "${_work}") - - # Any library that doesn't have a prefix is general, and a general - # library is both debug and optimized so stdize it - set(_std) - foreach(_lib ${_work}) - if(NOT "${_lib}" MATCHES "^1CLL%.%") - list(APPEND _std "1CLL%D%${_lib}" "1CLL%O%${_lib}") - elseif("${_lib}" MATCHES "^1CLL%G%") - string(REPLACE "1CLL%G%" "" _justlib "${_lib}") - list(APPEND _std "1CLL%D%${_justlib}" "1CLL%O%${_justlib}") - else() - list(APPEND _std "${_lib}") - endif() - endforeach() - - # REMOVE_DUPLICATES leaves the first - so we reverse before and after - # to keep the last, instead - list(REVERSE _std) - list(REMOVE_DUPLICATES _std) - list(REVERSE _std) - - # Split list items back out again: turn prefixes into the - # library type flags. - string(REGEX REPLACE "1CLL%D%" "debug;" _std "${_std}") - string(REGEX REPLACE "1CLL%O%" "optimized;" _std "${_std}") - - # Return _std - set(${_var} ${_std} PARENT_SCOPE) - endif() -endfunction() diff --git a/src/vrpn/cmake/CppcheckTargets.cmake b/src/vrpn/cmake/CppcheckTargets.cmake deleted file mode 100644 index b465ba87140b72f59e1f2425af97fb747cc5f39d..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/CppcheckTargets.cmake +++ /dev/null @@ -1,231 +0,0 @@ -# - Run cppcheck on c++ source files as a custom target and a test -# -# include(CppcheckTargets) -# add_cppcheck(<target-name> [UNUSED_FUNCTIONS] [STYLE] [POSSIBLE_ERROR] [FORCE] [FAIL_ON_WARNINGS]) - -# Create a target to check a target's sources with cppcheck and the indicated options -# add_cppcheck_sources(<target-name> [UNUSED_FUNCTIONS] [STYLE] [POSSIBLE_ERROR] [FORCE] [FAIL_ON_WARNINGS]) - -# Create a target to check standalone sources with cppcheck and the indicated options -# -# Requires these CMake modules: -# Findcppcheck -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__add_cppcheck) - return() -endif() -set(__add_cppcheck YES) - -if(NOT CPPCHECK_FOUND) - find_package(cppcheck QUIET) -endif() - -if(CPPCHECK_FOUND) - if(NOT TARGET all_cppcheck) - add_custom_target(all_cppcheck) - set_target_properties(all_cppcheck PROPERTIES EXCLUDE_FROM_ALL TRUE) - endif() -endif() - -function(add_cppcheck_sources _targetname) - if(CPPCHECK_FOUND) - set(_cppcheck_args) - set(_input ${ARGN}) - list(FIND _input UNUSED_FUNCTIONS _unused_func) - if("${_unused_func}" GREATER "-1") - list(APPEND _cppcheck_args ${CPPCHECK_UNUSEDFUNC_ARG}) - list(REMOVE_AT _input ${_unused_func}) - endif() - - list(FIND _input STYLE _style) - if("${_style}" GREATER "-1") - list(APPEND _cppcheck_args ${CPPCHECK_STYLE_ARG}) - list(REMOVE_AT _input ${_style}) - endif() - - list(FIND _input POSSIBLE_ERROR _poss_err) - if("${_poss_err}" GREATER "-1") - list(APPEND _cppcheck_args ${CPPCHECK_POSSIBLEERROR_ARG}) - list(REMOVE_AT _input ${_poss_err}) - endif() - - list(FIND _input FORCE _force) - if("${_force}" GREATER "-1") - list(APPEND _cppcheck_args "--force") - list(REMOVE_AT _input ${_force}) - endif() - - list(FIND _input FAIL_ON_WARNINGS _fail_on_warn) - if("${_fail_on_warn}" GREATER "-1") - list(APPEND - CPPCHECK_FAIL_REGULAR_EXPRESSION - ${CPPCHECK_WARN_REGULAR_EXPRESSION}) - list(REMOVE_AT _input ${_fail_on_warn}) - endif() - - set(_files) - foreach(_source ${_input}) - get_source_file_property(_cppcheck_loc "${_source}" LOCATION) - if(_cppcheck_loc) - # This file has a source file property, carry on. - get_source_file_property(_cppcheck_lang "${_source}" LANGUAGE) - if("${_cppcheck_lang}" MATCHES "CXX") - list(APPEND _files "${_cppcheck_loc}") - endif() - else() - # This file doesn't have source file properties - figure it out. - get_filename_component(_cppcheck_loc "${_source}" ABSOLUTE) - if(EXISTS "${_cppcheck_loc}") - list(APPEND _files "${_cppcheck_loc}") - else() - message(FATAL_ERROR - "Adding CPPCHECK for file target ${_targetname}: " - "File ${_source} does not exist or needs a corrected path location " - "since we think its absolute path is ${_cppcheck_loc}") - endif() - endif() - endforeach() - - if("1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0") - # Older than CMake 2.8.0 - add_test(${_targetname}_cppcheck_test - "${CPPCHECK_EXECUTABLE}" - ${CPPCHECK_TEMPLATE_ARG} - ${_cppcheck_args} - ${_files}) - else() - # CMake 2.8.0 and newer - add_test(NAME - ${_targetname}_cppcheck_test - COMMAND - "${CPPCHECK_EXECUTABLE}" - ${CPPCHECK_TEMPLATE_ARG} - ${_cppcheck_args} - ${_files}) - endif() - - set_tests_properties(${_targetname}_cppcheck_test - PROPERTIES - FAIL_REGULAR_EXPRESSION - "${CPPCHECK_FAIL_REGULAR_EXPRESSION}") - - add_custom_command(TARGET - all_cppcheck - PRE_BUILD - COMMAND - ${CPPCHECK_EXECUTABLE} - ${CPPCHECK_QUIET_ARG} - ${CPPCHECK_TEMPLATE_ARG} - ${_cppcheck_args} - ${_files} - WORKING_DIRECTORY - "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT - "${_targetname}_cppcheck: Running cppcheck on target ${_targetname}..." - VERBATIM) - endif() -endfunction() - -function(add_cppcheck _name) - if(NOT TARGET ${_name}) - message(FATAL_ERROR - "add_cppcheck given a target name that does not exist: '${_name}' !") - endif() - if(CPPCHECK_FOUND) - set(_cppcheck_args) - - list(FIND ARGN UNUSED_FUNCTIONS _unused_func) - if("${_unused_func}" GREATER "-1") - list(APPEND _cppcheck_args ${CPPCHECK_UNUSEDFUNC_ARG}) - endif() - - list(FIND ARGN STYLE _style) - if("${_style}" GREATER "-1") - list(APPEND _cppcheck_args ${CPPCHECK_STYLE_ARG}) - endif() - - list(FIND ARGN POSSIBLE_ERROR _poss_err) - if("${_poss_err}" GREATER "-1") - list(APPEND _cppcheck_args ${CPPCHECK_POSSIBLEERROR_ARG}) - endif() - - list(FIND ARGN FORCE _force) - if("${_force}" GREATER "-1") - list(APPEND _cppcheck_args "--force") - endif() - - list(FIND _input FAIL_ON_WARNINGS _fail_on_warn) - if("${_fail_on_warn}" GREATER "-1") - list(APPEND - CPPCHECK_FAIL_REGULAR_EXPRESSION - ${CPPCHECK_WARN_REGULAR_EXPRESSION}) - list(REMOVE_AT _input ${_unused_func}) - endif() - - get_target_property(_cppcheck_includes "${_name}" INCLUDE_DIRECTORIES) - set(_includes) - foreach(_include ${_cppcheck_includes}) - list(APPEND _includes "-I${_include}") - endforeach() - - get_target_property(_cppcheck_sources "${_name}" SOURCES) - set(_files) - foreach(_source ${_cppcheck_sources}) - get_source_file_property(_cppcheck_lang "${_source}" LANGUAGE) - get_source_file_property(_cppcheck_loc "${_source}" LOCATION) - if("${_cppcheck_lang}" MATCHES "CXX") - list(APPEND _files "${_cppcheck_loc}") - endif() - endforeach() - - if("1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0") - # Older than CMake 2.8.0 - add_test(${_name}_cppcheck_test - "${CPPCHECK_EXECUTABLE}" - ${CPPCHECK_TEMPLATE_ARG} - ${_cppcheck_args} - ${_files}) - else() - # CMake 2.8.0 and newer - add_test(NAME - ${_name}_cppcheck_test - COMMAND - "${CPPCHECK_EXECUTABLE}" - ${CPPCHECK_TEMPLATE_ARG} - ${_cppcheck_args} - ${_files}) - endif() - - set_tests_properties(${_name}_cppcheck_test - PROPERTIES - FAIL_REGULAR_EXPRESSION - "${CPPCHECK_FAIL_REGULAR_EXPRESSION}") - - add_custom_command(TARGET - all_cppcheck - PRE_BUILD - COMMAND - ${CPPCHECK_EXECUTABLE} - ${CPPCHECK_QUIET_ARG} - ${CPPCHECK_TEMPLATE_ARG} - ${_cppcheck_args} - ${_includes} - ${_files} - WORKING_DIRECTORY - "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT - "${_name}_cppcheck: Running cppcheck on target ${_name}..." - VERBATIM) - endif() - -endfunction() diff --git a/src/vrpn/cmake/CreateDashboardScripts.cmake b/src/vrpn/cmake/CreateDashboardScripts.cmake deleted file mode 100644 index ec1664a55b66e1e938b56dfe64b587aaeba9001f..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/CreateDashboardScripts.cmake +++ /dev/null @@ -1,196 +0,0 @@ -# - Create ctest -S scripts to use to run dashboard builds -# -# include(CreateDashboardScripts) -# create_dashboard_scripts([<initialcachetemplatefilename>]) -# -# If you need additional settings to persist from the "parent" CMake instance -# to the initial cache created by the dashboard script, -# you may pass a filename which will be configured into the initial cache. -# -# In the resulting DASHBOARDSCRIPT_BASE_DIRECTORY, an end-user -# may optionally create a file named -# CustomInitialCache.${DASHBOARDSCRIPT_SCRIPT_NAME} -# (by default, CustomInitialCache.go.cmake) containing set commands that use -# the CACHE option, to set up additional site-local cache variable values. -# -# Requires these CMake modules: -# GetCompilerInfoString -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -# Only do any of the prep work if not already in a dashboard script -if(NOT IN_DASHBOARD_SCRIPT) - - # Hide a CTest variable - mark_as_advanced(DART_TESTING_TIMEOUT) - - include(GetCompilerInfoString) - - get_compiler_info_string(_COMPILERID) - - # We must run the following at "include" time, not at function call time, - # to find the path to this module rather than the path to a calling list file - get_filename_component(_dashboardmoddir - ${CMAKE_CURRENT_LIST_FILE} - PATH) - - if(NOT "$ENV{USER}" MATCHES "^$") - set(_user "$ENV{USER}") - elseif(NOT "$ENV{USERNAME}" MATCHES "^$") - set(_user "$ENV{USERNAME}") - endif() - - if(NOT _dashboardscript_machine) - if(NOT SITE) - site_name(SITE) - endif() - set(_dashboardscript_machine "${SITE}" CACHE INTERNAL "") - set(SITE - "${_user}@${_dashboardscript_machine}" - CACHE - STRING - "Human-readable site name" - FORCE) - endif() - - set(DASHBOARDSCRIPT_BASE_DIRECTORY - "${CMAKE_BINARY_DIR}/Dashboards-${_dashboardscript_machine}-${_user}" - CACHE - PATH - "Directory to use as the root of all dashboard work") - mark_as_advanced(DASHBOARDSCRIPT_BASE_DIRECTORY) - - set(DASHBOARDSCRIPT_SOURCE_DIRECTORY "${CMAKE_SOURCE_DIR}") - - set(BUILDNAME - "${CMAKE_SYSTEM}-${CMAKE_SYSTEM_PROCESSOR}-${_COMPILERID}" - CACHE - STRING - "Human-readable build ID info") - - set(DASHBOARDSCRIPT_CMAKE_COMMAND - "${CMAKE_COMMAND}" - CACHE - FILEPATH - "The cmake binary to use when configuring a dashboard build") - mark_as_advanced(DASHBOARDSCRIPT_CMAKE_COMMAND) - - # Try to find CTest, preferably right next to the chosen CMake - if(DASHBOARDSCRIPT_CMAKE_COMMAND) - get_filename_component(_cmake_dir - ${DASHBOARDSCRIPT_CMAKE_COMMAND} - PATH) - else() - get_filename_component(_cmake_dir ${CMAKE_COMMAND} PATH) - endif() - find_program(DASHBOARDSCRIPT_CTEST_EXECUTABLE - NAMES - ctest - HINTS - "${_cmake_dir}" - NO_DEFAULT_PATH) - find_program(DASHBOARDSCRIPT_CTEST_EXECUTABLE - NAMES - ctest - HINTS - "${_cmake_dir}") - - - set(DASHBOARDSCRIPT_CTEST_EXECUTABLE - "${DASHBOARDSCRIPT_CTEST_EXECUTABLE}" - CACHE - FILEPATH - "Path to the CTest executable to use for dashboard builds.") - mark_as_advanced(DASHBOARDSCRIPT_CTEST_EXECUTABLE) - - - # Optionals - - if(NOT "1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0") - if(IS_DIRECTORY "${CMAKE_SOURCE_DIRECTORY}/.git") - find_program(DASHBOARDSCRIPT_GIT_EXECUTABLE NAMES git git.cmd) - if(DASHBOARDSCRIPT_GIT_EXECUTABLE) - - set(UPDATE_TYPE "git") - set(UPDATE_COMMAND "${DASHBOARDSCRIPT_GIT_EXECUTABLE}") - set(UPDATE_OPTIONS "") - mark_as_advanced(DASHBOARDSCRIPT_GIT_EXECUTABLE) - endif() - endif() - endif() - -else() - # IN_DASHBOARD_SCRIPT is YES - message(STATUS - "CreateDashboardScripts detected that we're in a dashboard script already.") -endif() - -function(create_dashboard_scripts) - # Only create the script if we have all the required variables - # and are not already in it, and are at least 2.8.0. - if(DASHBOARDSCRIPT_BASE_DIRECTORY AND - DASHBOARDSCRIPT_SOURCE_DIRECTORY AND - DASHBOARDSCRIPT_BASE_DIRECTORY AND - BUILDNAME AND - DASHBOARDSCRIPT_CMAKE_COMMAND AND - DASHBOARDSCRIPT_CTEST_EXECUTABLE AND - NOT IN_DASHBOARD_SCRIPT AND - NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.0") - - set(_Continuous_cron "15 * * * * ") - set(_Nightly_cron "15 0 * * * ") - set(_Experimental_cron - "\nor run this command for an one-off experimental test build:\n") - set(_Experimental_flags "-VV") - - message(STATUS - "Dashboard scripts have been generated for automatic nightly and continuous builds.") - if(WIN32) - set(_Continuous_cron) - set(_Nightly_cron) - message(STATUS - "You can set up scheduled tasks to run these command lines:") - else() - message(STATUS "You can add these sample lines to your crontab:") - endif() - - set(_msg) - - if(NOT DASHBOARDSCRIPT_BUILD_CONFIGURATION) - set(DASHBOARDSCRIPT_BUILD_CONFIGURATION "RelWithDebInfo") - endif() - set(DASHBOARDSCRIPT_BUILD_CONFIGURATION "${DASHBOARDSCRIPT_BUILD_CONFIGURATION}" CACHE STRING "Build configuration to use for dashboard builds by default") - mark_as_advanced(DASHBOARDSCRIPT_BUILD_CONFIGURATION) - - foreach(DASHBOARDSCRIPT_DASH_TYPE Nightly Continuous Experimental) - # If given a cache template, configure it - if(ARGN) - configure_file(${ARGN} - "${DASHBOARDSCRIPT_BASE_DIRECTORY}/GeneratedInitialCache.run${DASHBOARDSCRIPT_DASH_TYPE}.cmake" - @ONLY) - endif() - - # Actually create the script file - configure_file(${_dashboardmoddir}/DashboardScript.cmake.in - "${DASHBOARDSCRIPT_BASE_DIRECTORY}/run${DASHBOARDSCRIPT_DASH_TYPE}.cmake" - @ONLY) - - set(_msg - "${_msg}\n${_${DASHBOARDSCRIPT_DASH_TYPE}_cron}\"${DASHBOARDSCRIPT_CTEST_EXECUTABLE}\" -S \"${DASHBOARDSCRIPT_BASE_DIRECTORY}/run${DASHBOARDSCRIPT_DASH_TYPE}.cmake\" ${_${DASHBOARDSCRIPT_DASH_TYPE}_flags}") - - endforeach() - message(STATUS "\n${_msg}\n") - message(STATUS "") - - endif() -endfunction() diff --git a/src/vrpn/cmake/DashboardScript.cmake.in b/src/vrpn/cmake/DashboardScript.cmake.in deleted file mode 100644 index da348a8c5c7ffe4121d0e4eb80bf75a070ee363b..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/DashboardScript.cmake.in +++ /dev/null @@ -1,122 +0,0 @@ -# - Dashboard driver script for use with ctest. -# -# Generated file processed by CreateDashboardScripts.cmake -# Run it like: -# ctest -S nameofthisfile -# with -V or -V -VV if you want more feedback. -# -# Generally you do not need to edit this file by hand! -# -# If this file isn't named DashboardScript.cmake.in and located -# in the same directory as CreateDashboardScripts.cmake, it has been -# auto-generated and will be overwritten every time CMake configures -# itself. (This may be every build!) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC - -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) - -set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -set(CTEST_PROJECT_NAME "@PROJECT_NAME@") - -set(CTEST_DASHBOARD_ROOT "@DASHBOARDSCRIPT_BASE_DIRECTORY@") -set(CTEST_SOURCE_DIRECTORY "@DASHBOARDSCRIPT_SOURCE_DIRECTORY@") -set(DASH_TYPE "@DASHBOARDSCRIPT_DASH_TYPE@") -set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/build-${DASH_TYPE}") - -set(CTEST_NOTES_FILES - "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" - "${CTEST_DASHBOARD_ROOT}/GeneratedCombinedCache.${CTEST_SCRIPT_NAME}") - -set(CTEST_BUILD_NAME "@BUILDNAME@") -set(CTEST_SITE "@SITE@") - -set(CTEST_USE_LAUNCHERS TRUE) - -set(CTEST_COMMAND "@DASHBOARDSCRIPT_CTEST_EXECUTABLE@") -set(CTEST_CMAKE_COMMAND "@DASHBOARDSCRIPT_CMAKE_COMMAND@") -set(CTEST_UPDATE_TYPE "@UPDATE_TYPE@") -set(CTEST_UPDATE_COMMAND "@UPDATE_COMMAND@") -set(CTEST_UPDATE_OPTIONS "@UPDATE_OPTIONS@") - -if((NOT CTEST_CONFIGURATION_TYPE) OR (NOT CTEST_BUILD_CONFIGURATION)) - set(CTEST_BUILD_CONFIGURATION "@DASHBOARDSCRIPT_BUILD_CONFIGURATION@") - set(CTEST_CONFIGURATION_TYPE "@DASHBOARDSCRIPT_BUILD_CONFIGURATION@") -endif() - - -# Avoid non-ascii characters in tool output. -set(ENV{LC_ALL} C) - -if(EXISTS "${CTEST_DASHBOARD_ROOT}/GeneratedInitialCache.${CTEST_SCRIPT_NAME}") - file(READ "${CTEST_DASHBOARD_ROOT}/GeneratedInitialCache.${CTEST_SCRIPT_NAME}" _initcache) -else() - set(_initcache) -endif() - -if(EXISTS "${CTEST_DASHBOARD_ROOT}/CustomInitialCache.cmake") - file(READ "${CTEST_DASHBOARD_ROOT}/CustomInitialCache.cmake" _customcache) - set(_initcache "${_initcache} -${_customcache}") -endif() -set(_initcache "# This file is automatically regenerated every dashboard build - -# Do not edit it directly! -# If you want to add initial cache values, you can create/modify -# the CustomInitialCache.cmake file in this directory. - -# Pretty typical settings to preseve from the generating cache -set(BUILD_TESTING ON CACHE BOOL docstring) -set(IN_DASHBOARD_SCRIPT ON CACHE BOOL docstring) -set(CTEST_USE_LAUNCHERS ON CACHE BOOL docstring) -set(CMAKE_PREFIX_PATH \"@CMAKE_PREFIX_PATH@\" CACHE STRING docstring) -set(CMAKE_BUILD_TYPE \"@CMAKE_BUILD_TYPE@\" CACHE STRING docstring) -set(CTEST_CONFIGURATION_TYPE \"@CMAKE_BUILD_TYPE@\" CACHE STRING docstring) - -# testing tool locations -# Saved here because the tools in the path might be outdated -set(CPPCHECK_EXECUTABLE \"@CPPCHECK_EXECUTABLE@\" CACHE FILEPATH docstring) -set(DOXYGEN_EXECUTABLE \"@DOXYGEN_EXECUTABLE@\" CACHE FILEPATH docstring) - -${_initcache}") - -file(WRITE "${CTEST_DASHBOARD_ROOT}/GeneratedCombinedCache.${CTEST_SCRIPT_NAME}" "${_initcache}") - -ctest_empty_binary_directory("${CTEST_BINARY_DIRECTORY}") - -ctest_start(${DASH_TYPE}) - -if(CTEST_UPDATE_COMMAND AND NOT DASH_TYPE STREQUAL "Experimental") - ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res) -endif() - -# Only proceed if we updated a file or if we're not a continuous build -set(PROCEED NO) -if(res GREATER 0) - message(STATUS "One or more files were updated, so we will proceed to " - "and build") - set(PROCEED YES) -endif() - -if(NOT DASH_TYPE STREQUAL "Continuous") - message(STATUS "We are not a continuous dashboard, so continuing regardless " - "of whether any files were updated") - set(PROCEED YES) -endif() - -if(PROCEED) - ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res - OPTIONS "-C${CTEST_DASHBOARD_ROOT}/GeneratedCombinedCache.${CTEST_SCRIPT_NAME}") - if(${res} EQUAL 0) - # Only try to build if we could configure - ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - - # Some tests, like cppcheck tests, don't depend on a successful build - ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) - endif() -endif() - -# Always submit results -ctest_submit(RETURN_VALUE res) diff --git a/src/vrpn/cmake/DoxygenTargets.cmake b/src/vrpn/cmake/DoxygenTargets.cmake deleted file mode 100644 index 8e51fac0dd043e6a11e64ddda8047d18c9c2c58d..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/DoxygenTargets.cmake +++ /dev/null @@ -1,342 +0,0 @@ -# - Run doxygen on source files as a custom target -# -# include(DoxygenTargets) -# add_doxygen(<doxyfile> [OUTPUT_DIRECTORY <outputdir>] -# [EXTRA_INPUT <single path or quoted list of paths>] -# [EXTRA_STRIP_FROM_PATH <single path or quoted list of paths>] -# [EXTRA_STRIP_FROM_INC_PATH <single path or quoted list of paths>] -# [INSTALL_DESTINATION <installdir> -# [INSTALL_COMPONENT <installcomponent>] -# [INSTALL_PDF_NAME <installpdfname>] ] -# [DOC_TARGET <targetname>] -# [PROJECT_NUMBER <versionnumber>] -# [NO_WARNINGS] -# [NO_PDF]) -# -# Requires these CMake modules: -# FindDoxygen -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__add_doxygen) - return() -endif() -set(__add_doxygen YES) - -# We must run the following at "include" time, not at function call time, -# to find the path to this module rather than the path to a calling list file -get_filename_component(_doxygenmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) - -if(APPLE) - list(APPEND CMAKE_PREFIX_PATH "/usr/texbin") -endif() - -if(NOT DOXYGEN_FOUND) - find_package(Doxygen QUIET) -endif() - -set(DOXYGEN_LATEX "NO") -set(DOXYGEN_PDFLATEX "NO") -set(DOXYGEN_DOT "NO") - -if(DOXYGEN_DOT_EXECUTABLE) - set(DOXYGEN_DOT "YES") -endif() - -find_package(LATEX QUIET) -if(LATEX_COMPILER AND MAKEINDEX_COMPILER) - set(DOXYGEN_LATEX "YES") -endif() - -if(PDFLATEX_COMPILER) - set(DOXYGEN_PDFLATEX "YES") -endif() - -# An optional single-file install that supports cmake older than 2.8.0 -# For internal use -function(_dt_install_file target filename dest rename) - if(CMAKE_VER VERSION_LESS 2.8.0) - set(INSTALL_CODE " - if(EXISTS \"${filename}\") - message(STATUS \"Found: ${filename}\") - file(INSTALL - DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${dest}\" - TYPE FILE - RENAME \"${rename}\" - FILES \"${filename}\") - else() - message(STATUS \"Skipping (build '${target}' to create): ${filename}\") - endif() - ") - if(NOT ARGN STREQUAL "") - set(INSTALL_COMPONENT "${ARGN}") - set(INSTALL_CODE " - if(NOT CMAKE_INSTALL_COMPONENT OR \"\${CMAKE_INSTALL_COMPONENT}\" STREQUAL \"${INSTALL_COMPONENT}\") - ${INSTALL_CODE} - endif() - ") - endif() - install(CODE "${INSTALL_CODE}") - else() - set(COMPONENT_ARGS) - if(NOT ARGN STREQUAL "") - set(COMPONENT_ARGS COMPONENT "${ARGN}") - endif() - install(FILES - "${filename}" - DESTINATION - "${dest}" - RENAME "${rename}" - ${COMPONENT_ARGS} - OPTIONAL) - endif() - -endfunction() - -# An optional single-directory install that supports cmake older than 2.8.0 -# For internal use -function(_dt_install_dir target dir dest) - if(CMAKE_VER VERSION_LESS 2.8.0) - set(INSTALL_CODE " - if(EXISTS \"${dir}\") - message(STATUS \"Found: ${dir}\") - file(INSTALL - DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${dest}\" - TYPE DIRECTORY - FILES \"${dir}\") - else() - message(STATUS \"Skipping (build '${target}' to create): ${dir}\") - endif() - ") - if(NOT ARGN STREQUAL "") - set(INSTALL_COMPONENT "${ARGN}") - set(INSTALL_CODE " - - if(NOT CMAKE_INSTALL_COMPONENT OR \"\${CMAKE_INSTALL_COMPONENT}\" STREQUAL \"${INSTALL_COMPONENT}\") - ${INSTALL_CODE} - endif() - ") - endif() - install(CODE "${INSTALL_CODE}") - else() - set(COMPONENT_ARGS) - if(NOT ARGN STREQUAL "") - set(COMPONENT_ARGS COMPONENT "${ARGN}") - endif() - install(DIRECTORY - "${dir}" - DESTINATION - "${dest}" - ${COMPONENT_ARGS} - OPTIONAL) - endif() - -endfunction() - -function(add_doxygen _doxyfile) - # parse arguments - set(WARNINGS YES) - set(_nowhere) - set(_curdest _nowhere) - set(_val_args - OUTPUT_DIRECTORY - EXTRA_INPUT - EXTRA_STRIP_FROM_PATH - EXTRA_STRIP_FROM_INC_PATH - DOC_TARGET - INSTALL_DESTINATION - INSTALL_COMPONENT - INSTALL_PDF_NAME - PROJECT_NUMBER) - set(_bool_args - NO_WARNINGS - NO_PDF) - foreach(_arg ${_val_args} ${_bool_args}) - set(${_arg}) - endforeach() - foreach(_element ${ARGN}) - list(FIND _val_args "${_element}" _val_arg_find) - list(FIND _bool_args "${_element}" _bool_arg_find) - if("${_val_arg_find}" GREATER "-1") - set(_curdest "${_element}") - elseif("${_bool_arg_find}" GREATER "-1") - set("${_element}" ON) - set(_curdest _nowhere) - else() - list(APPEND ${_curdest} "${_element}") - endif() - endforeach() - - if(_nowhere) - message(FATAL_ERROR "Syntax error in use of add_doxygen!") - endif() - - if(NO_WARNINGS) - set(WARNINGS NO) - endif() - - if(NOT DOC_TARGET) - set(DOC_TARGET doc) - endif() - - if(NOT OUTPUT_DIRECTORY) - set(OUTPUT_DIRECTORY "docs-generated") - endif() - - file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_DIRECTORY}") - - if(NOT INSTALL_PDF_NAME) - set(INSTALL_PDF_NAME "docs-generated.pdf") - endif() - - if(NOT PROJECT_NUMBER) - set(PROJECT_NUMBER "${CPACK_PACKAGE_VERSION}") - endif() - - if(DOXYGEN_FOUND) - if(TARGET ${DOC_TARGET}) - message(FATAL_ERROR "Documentation target ${DOC_TARGET} already exists!") - endif() - - if(NOT IS_ABSOLUTE "${OUTPUT_DIRECTORY}") - get_filename_component(OUTPUT_DIRECTORY - "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_DIRECTORY}" - ABSOLUTE) - endif() - - set_property(DIRECTORY - APPEND - PROPERTY - ADDITIONAL_MAKE_CLEAN_FILES - "${OUTPUT_DIRECTORY}/html" - "${OUTPUT_DIRECTORY}/latex") - - if(NOT TARGET ${DOC_TARGET}_open) - # Create a target to open the generated HTML file. - if(WIN32) - set(DOXYGEN_LAUNCHER_COMMAND start) - elseif(NOT APPLE) - set(DOXYGEN_LAUNCHER_COMMAND xdg-open) - endif() - if(DOXYGEN_LAUNCHER_COMMAND) - add_custom_target(${DOC_TARGET}_open - COMMAND ${DOXYGEN_LAUNCHER_COMMAND} "${OUTPUT_DIRECTORY}/html/index.html" - VERBATIM) - set_target_properties(${DOC_TARGET}_open - PROPERTIES - EXCLUDE_FROM_ALL - TRUE) - set_target_properties(${DOC_TARGET}_open - PROPERTIES - EXCLUDE_FROM_DEFAULT_BUILD - TRUE) - add_dependencies(${DOC_TARGET}_open ${DOC_TARGET}) - endif() - endif() - - get_filename_component(_doxyfileabs "${_doxyfile}" ABSOLUTE) - get_filename_component(INCLUDE_FILE "${_doxyfileabs}" NAME) - get_filename_component(INCLUDE_PATH "${_doxyfileabs}" PATH) - - # Doesn't currently work on Windows, so don't bother - if(DOXYGEN_LATEX AND NOT NO_PDF AND NOT WIN32) - set(MAKE_PDF YES) - set(GENERATE_LATEX YES) - else() - set(MAKE_PDF NO) - set(GENERATE_LATEX NO) - endif() - - if(DOXYGEN_PDFLATEX AND MAKE_PDF) - set(USE_PDFLATEX YES) - else() - set(USE_PDFLATEX NO) - endif() - - if(DOXYGEN_DOT) - set(HAVE_DOT YES) - set(DOT_PATH ${DOXYGEN_DOT_PATH}) - else() - set(HAVE_DOT NO) - set(DOT_PATH) - endif() - - # See http://www.cmake.org/pipermail/cmake/2006-August/010786.html - # for info on this variable - if("${CMAKE_BUILD_TOOL}" MATCHES "(msdev|devenv)") - set(WARN_FORMAT "\"$file($line) : $text \"") - else() - set(WARN_FORMAT "\"$file:$line: $text \"") - endif() - - configure_file("${_doxygenmoddir}/DoxygenTargets.doxyfile.in" - "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.${DOC_TARGET}.additional" - @ONLY) - - if(IN_DASHBOARD_SCRIPT) - set(ALL_IN_DASHBOARD ALL) - else() - set(ALL_IN_DASHBOARD) - endif() - - add_custom_target(${DOC_TARGET} ${ALL_IN_DASHBOARD} - COMMAND - "${DOXYGEN_EXECUTABLE}" - "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.${DOC_TARGET}.additional" - WORKING_DIRECTORY - "${CMAKE_CURRENT_SOURCE_DIR}" - #MAIN_DEPENDENCY ${DOC_TARGET} - COMMENT - "Running Doxygen with configuration ${_doxyfile}..." - VERBATIM) - - if(NOT IN_DASHBOARD_SCRIPT) - set_target_properties(${DOC_TARGET} - PROPERTIES - EXCLUDE_FROM_ALL - TRUE) - set_target_properties(${DOC_TARGET} - PROPERTIES - EXCLUDE_FROM_DEFAULT_BUILD - TRUE) - endif() - if(MAKE_PDF) - add_custom_command(TARGET - ${DOC_TARGET} - POST_BUILD - COMMAND - ${CMAKE_MAKE_PROGRAM} - WORKING_DIRECTORY - "${OUTPUT_DIRECTORY}/latex" - COMMENT - "Generating PDF using PDFLaTeX..." - VERBATIM) - endif() - - if(INSTALL_DESTINATION) - if(INSTALL_COMPONENT) - _dt_install_dir("${DOC_TARGET}" "${OUTPUT_DIRECTORY}/html" "${INSTALL_DESTINATION}" "${INSTALL_COMPONENT}") - if(MAKE_PDF) - _dt_install_file("${DOC_TARGET}" "${OUTPUT_DIRECTORY}/latex/refman.pdf" "${INSTALL_DESTINATION}" "${INSTALL_PDF_NAME}" "${INSTALL_COMPONENT}") - endif() - - else() - _dt_install_dir("${DOC_TARGET}" "${OUTPUT_DIRECTORY}/html" "${INSTALL_DESTINATION}") - if(MAKE_PDF) - _dt_install_file("${DOC_TARGET}" "${OUTPUT_DIRECTORY}/latex/refman.pdf" "${INSTALL_DESTINATION}" "${INSTALL_PDF_NAME}") - endif() - endif() - endif() - - endif() -endfunction() diff --git a/src/vrpn/cmake/DoxygenTargets.doxyfile.in b/src/vrpn/cmake/DoxygenTargets.doxyfile.in deleted file mode 100644 index d5b36e9f49f254dc24e69e71588f728e884f3077..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/DoxygenTargets.doxyfile.in +++ /dev/null @@ -1,22 +0,0 @@ -@INCLUDE_PATH = "@INCLUDE_PATH@" -@INCLUDE = "@INCLUDE_FILE@" - -OUTPUT_DIRECTORY = "@OUTPUT_DIRECTORY@" -GENERATE_LATEX = "@GENERATE_LATEX@" -USE_PDFLATEX = @USE_PDFLATEX@ -HAVE_DOT = @HAVE_DOT@ -DOT_PATH = "@DOT_PATH@" -LATEX_CMD_NAME = "@LATEX_COMPILER@" -MAKEINDEX_CMD_NAME = "@MAKEINDEX_COMPILER@" - -WARNINGS = @WARNINGS@ -WARN_FORMAT = @WARN_FORMAT@ - -PROJECT_NUMBER = @PROJECT_NUMBER@ - -INPUT += @EXTRA_INPUT@ -STRIP_FROM_PATH += @EXTRA_STRIP_FROM_PATH@ -STRIP_FROM_INC_PATH += @EXTRA_STRIP_FROM_INC_PATH@ - -LATEX_BATCHMODE = YES -QUIET = YES diff --git a/src/vrpn/cmake/EnableExtraCompilerWarnings.cmake b/src/vrpn/cmake/EnableExtraCompilerWarnings.cmake deleted file mode 100644 index 833172ae1a5894ee8826a87750cc0aa0692c2c37..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/EnableExtraCompilerWarnings.cmake +++ /dev/null @@ -1,79 +0,0 @@ -# - Add flags to compile with extra warnings -# -# enable_extra_compiler_warnings(<targetname>) -# globally_enable_extra_compiler_warnings() - to modify CMAKE_CXX_FLAGS, etc -# to change for all targets declared after the command, instead of per-command -# -# -# Original Author: -# 2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__enable_extra_compiler_warnings) - return() -endif() -set(__enable_extra_compiler_warnings YES) - -macro(_enable_extra_compiler_warnings_flags) - set(_flags) - if(MSVC) - option(COMPILER_WARNINGS_EXTREME - "Use compiler warnings that are probably overkill." - off) - mark_as_advanced(COMPILER_WARNINGS_EXTREME) - set(_flags "/W4") - if(COMPILER_WARNINGS_EXTREME) - set(_flags "${_flags} /Wall /wd4619 /wd4668 /wd4820 /wd4571 /wd4710") - endif() - else() - include(CheckCXXCompilerFlag) - set(_flags) - - check_cxx_compiler_flag(-W SUPPORTS_W_FLAG) - if(SUPPORTS_W_FLAG) - set(_flags "${_flags} -W") - endif() - - check_cxx_compiler_flag(-Wall SUPPORTS_WALL_FLAG) - if(SUPPORTS_WALL_FLAG) - set(_flags "${_flags} -Wall") - endif() - - check_cxx_compiler_flag(-Wextra SUPPORTS_WEXTRA_FLAG) - if(SUPPORTS_WEXTRA_FLAG) - set(_flags "${_flags} -Wextra") - endif() - - endif() -endmacro() - -function(enable_extra_compiler_warnings _target) - _enable_extra_compiler_warnings_flags() - get_target_property(_origflags ${_target} COMPILE_FLAGS) - if(_origflags) - set_property(TARGET - ${_target} - PROPERTY - COMPILE_FLAGS - "${_flags} ${_origflags}") - else() - set_property(TARGET - ${_target} - PROPERTY - COMPILE_FLAGS - "${_flags}") - endif() - -endfunction() - -function(globally_enable_extra_compiler_warnings) - _enable_extra_compiler_warnings_flags() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" PARENT_SCOPE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" PARENT_SCOPE) -endfunction() diff --git a/src/vrpn/cmake/EnableProfiling.cmake b/src/vrpn/cmake/EnableProfiling.cmake deleted file mode 100644 index e2a340f7c83dacd3cd30e365aba4699bb96a7809..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/EnableProfiling.cmake +++ /dev/null @@ -1,56 +0,0 @@ -# - Add flags to compile with profiling support - currently only for GCC -# -# enable_profiling(<targetname>) -# globally_enable_profiling() - to modify CMAKE_CXX_FLAGS, etc -# to change for all targets declared after the command, instead of per-command -# -# -# Original Author: -# 2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__enable_profiling) - return() -endif() -set(__enable_profiling YES) - -macro(_enable_profiling_flags) - set(_flags) - if(MSVC) - # TODO: what kind of flags are needed to profile on MSVC? - #set(_flags /W4) - elseif(CMAKE_COMPILER_IS_GNUCXX) - set(_flags "-p") - endif() -endmacro() - -function(enable_profiling _target) - _enable_profiling_flags() - get_target_property(_origflags ${_target} COMPILE_FLAGS) - if(_origflags) - set_property(TARGET - ${_target} - PROPERTY - COMPILE_FLAGS - "${_flags} ${_origflags}") - else() - set_property(TARGET - ${_target} - PROPERTY - COMPILE_FLAGS - "${_flags}") - endif() - -endfunction() - -function(globally_enable_profiling) - _enable_profiling_flags() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" PARENT_SCOPE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" PARENT_SCOPE) -endfunction() diff --git a/src/vrpn/cmake/FindAdrienne.cmake b/src/vrpn/cmake/FindAdrienne.cmake deleted file mode 100644 index d4f174c0cda9f1a0c6960b47ab16075f83fa10f9..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindAdrienne.cmake +++ /dev/null @@ -1,202 +0,0 @@ -# - try to find Adrienne Electronics Corporation timecode card library -# -# SDK available from the manufacturer: http://www.adrielec.com/ -# -# Cache Variables: (probably not for direct use in your scripts) -# ADRIENNE_INCLUDE_DIR -# ADRIENNE_LIBRARY -# ADRIENNE_RUNTIME_LIBRARY -# ADRIENNE_INCLUDE_FILE -# -# Variables you might use in your CMakeLists.txt: -# ADRIENNE_FOUND -# ADRIENNE_INCLUDE_DIRS -# ADRIENNE_LIBRARIES -# ADRIENNE_RUNTIME_LIBRARIES - the AEC_NTTC.dll file -# ADRIENNE_RUNTIME_LIBRARY_DIRS -# -# ADRIENNE_INCLUDE_FILENAME - this is probably AEC_NTTC.h, but it might also -# be AECINTTC.H. -# -# ADRIENNE_INCLUDE_HAS_EXTERN_C - Some (most) versions of the header already -# wrap their definitions in extern "C" { }, but some do not. -# -# ADRIENNE_DEFINITIONS - defines a quoted ADRIENNE_INCLUDE_FILENAME as above, -# so you can write a line like #include ADRIENNE_INCLUDE_FILENAME -# Also defines ADRIENNE_BEFORE_INCLUDE and ADRIENNE_AFTER_INCLUDE to handle -# adding extern "C" { and } if the header file doesn't do so itself. -# -# Variables that might be set by the user in the gui/command line to help -# find the library: -# ADRIENNE_ROOT_DIR - root of an Adrienne CD, disk, or extracted/copied contents -# thereof. -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2012. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -# Apparently Windows only. -if(WIN32 OR CYGWIN) - set(ADRIENNE_ROOT_DIR - "${ADRIENNE_ROOT_DIR}" - CACHE - PATH - "Directory to search for Adrienne Electronics Timecode data - root of a software distribution or extracted download from http://www.adrielec.com/") - - set(ADRIENNE_DEFINITIONS) - - set(ADRIENNE_INCLUDE_SEARCH - # from AecPCIeTC_8-12a: contains AEC_NTTC.h with extern "C" and three extra functions: - # AEC_PCTC_OPEN_ALL, AEC_PCTC_CLOSE_ALL, AEC_PCTC_INITIALIZE_EVENT - "SDK_SourceCode" - - # from AecPci6_02_CD - called AECINTTC.H but otherwise essentially identical to earlier versions - "TestPrograms_WithDLL/DLL_API_INFO" - # A zipped development project contains essentially the same, named AEC_NTTC.h so we'll add this in case it's unzipped. - "TestPrograms_WithDLL/ZippedDevelopmentProjects/AecMfc32_Rel504" - - # from pc-ltc - called AECINTTC.H and lacks extern "C" - "NT-CODE/C40-APP1" - ) - set(ADRIENNE_HEADER_NAMES - AEC_NTTC.H - AEC_NTTC.h - Aec_nttc.h - AECINTTC.H) - - set(ADRIENNE_LIB_SEARCH) - set(ADRIENNE_DLL_SEARCH) - - if(CMAKE_SIZEOF_VOID_P MATCHES "8") - # 64 bit code - apparently initially packaged only in the - # PCIe version of their software - list(APPEND ADRIENNE_LIB_SEARCH - # from AecPCIeTC_8-12a - "64BitOS_files/DLL Versions") - - list(APPEND ADRIENNE_DLL_SEARCH - # from AecPCIeTC_8-12a - "64BitOS_files/DLL Versions") - else() - # 32-bit code, much more prevalent. - list(APPEND ADRIENNE_LIB_SEARCH - # from AecPCIeTC_8-12a - "32BitOS_files/DLLversions" - - # from AecPci6_02_CD - "TestPrograms_WithDLL/DLL_API_INFO" - - # from pc-ltc - "NT-CODE/DLL" - ) - - list(APPEND ADRIENNE_DLL_SEARCH - # from AecPCIeTC_8-12a - "32BitOS_files/DLLversions" - - # from AecPci6_02_CD - "TestPrograms_WithDLL" - - # from pc-ltc - "NT-CODE/DLL") - endif() - - find_library(ADRIENNE_LIBRARY - NAMES - AEC_NTTC - PATHS - "${ADRIENNE_ROOT_DIR}" - PATH_SUFFIXES - ${ADRIENNE_LIB_SEARCH}) - - find_path(ADRIENNE_INCLUDE_DIR - NAMES - ${ADRIENNE_HEADER_NAMES} - PATHS - "${ADRIENNE_ROOT_DIR}" - PATH_SUFFIXES - ${ADRIENNE_INCLUDE_SEARCH}) - - if(ADRIENNE_INCLUDE_DIR) - find_file(ADRIENNE_INCLUDE_FILE - NAMES - ${ADRIENNE_HEADER_NAMES} - HINTS - ${ADRIENNE_INCLUDE_DIR}) - - # Get include filename - get_filename_component(ADRIENNE_INCLUDE_FILENAME - "${ADRIENNE_INCLUDE_FILE}" - NAME) - list(APPEND ADRIENNE_DEFINITIONS -DADRIENNE_INCLUDE_FILENAME="ADRIENNE_INCLUDE_FILENAME") - - # Find out if it has extern "C" in it. - file(STRINGS "${ADRIENNE_INCLUDE_FILE}" strings) - set(ADRIENNE_INCLUDE_HAS_EXTERN_C OFF) - foreach(_line ${strings}) - if("${_line}" STREQUAL "extern \"C\"") - set(ADRIENNE_INCLUDE_HAS_EXTERN_C ON) - break() - endif() - endforeach() - - if(ADRIENNE_INCLUDE_HAS_EXTERN_C) - list(APPEND ADRIENNE_DEFINITIONS -DADRIENNE_BEFORE_INCLUDE -DADRIENNE_AFTER_INCLUDE) - else() - list(APPEND ADRIENNE_DEFINITIONS "-DADRIENNE_BEFORE_INCLUDE=extern \"C\" {" "-DADRIENNE_AFTER_INCLUDE=}") - endif() - endif() - - get_filename_component(_adrienne_libdir "${ADRIENNE_LIBRARY}" PATH) - find_file(ADRIENNE_RUNTIME_LIBRARY - NAMES - AEC_NTTC.dll - HINTS - "${_adrienne_libdir}" - "${_adrienne_libdir}/.." - PATHS - "${ADRIENNE_ROOT_DIR}" - PATH_SUFFIXES - ${ADRIENNE_DLL_SEARCH}) - - - set(ADRIENNE_RUNTIME_LIBRARIES "${ADRIENNE_RUNTIME_LIBRARY}") - get_filename_component(ADRIENNE_RUNTIME_LIBRARY_DIRS - "${ADRIENNE_RUNTIME_LIBRARY}" - PATH) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Adrienne - DEFAULT_MSG - ADRIENNE_LIBRARY - ADRIENNE_RUNTIME_LIBRARY - ADRIENNE_INCLUDE_DIR - ADRIENNE_INCLUDE_FILENAME) - - if(ADRIENNE_FOUND) - set(ADRIENNE_LIBRARIES "${ADRIENNE_LIBRARY}") - set(ADRIENNE_INCLUDE_DIRS "${ADRIENNE_INCLUDE_DIR}") - mark_as_advanced(ADRIENNE_ROOT_DIR) - endif() - - mark_as_advanced( - ADRIENNE_LIBRARY - ADRIENNE_RUNTIME_LIBRARY - ADRIENNE_INCLUDE_DIR - ADRIENNE_INCLUDE_FILE) -else() - set(ADRIENNE_FOUND OFF) - set(ADRIENNE_SDK_IS_WINDOWS_ONLY NOTFOUND) - find_package_handle_standard_args(Adrienne - DEFAULT_MSG - ADRIENNE_SDK_IS_WINDOWS_ONLY) -endif() diff --git a/src/vrpn/cmake/FindDirectShow.cmake b/src/vrpn/cmake/FindDirectShow.cmake deleted file mode 100644 index f2b4f6720f431e020d59cc50ad87d6809cdbca7e..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindDirectShow.cmake +++ /dev/null @@ -1,125 +0,0 @@ -# - Find Microsoft DirectShow sample files, library, and headers. -# -# DIRECTSHOW_INCLUDE_DIRS - where to find needed include file -# DIRECTSHOW_BASECLASS_DIR- Directory containing the DirectShow baseclass sample code. -# DIRECTSHOW_FOUND - True if DirectShow found. -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Initially in VRPN - Distributed under the Boost Software License, Version 1.0. -# -# Almost entirely re-written by: -# 2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2012. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -# Look for one of the sample files. - -find_package(WindowsSDK) -find_package(DirectX QUIET) - -set(DIRECTSHOW_WINDOWSSDK_ROOT - "${DIRECTSHOW_WINDOWSSDK_ROOT}" - CACHE - PATH - "A specific Windows SDK to use for DirectShow.") - -if(MSVC AND CMAKE_CL_64) - set(DIRECTSHOW_LIB_SUBDIR /x64) -else() - set(DIRECTSHOW_LIB_SUBDIR) -endif() - -set(_acceptable_winsdk) -if(WINDOWSSDK_FOUND) - foreach(_sdkdir ${WINDOWSSDK_DIRS}) - if(EXISTS "${_sdkdir}/Samples/Multimedia/DirectShow/BaseClasses/streams.h" - AND EXISTS "${_sdkdir}/Lib${DIRECTSHOW_LIB_SUBDIR}/strmiids.lib" - AND EXISTS "${_sdkdir}/Include/DShow.h") - list(APPEND _acceptable_winsdk "${_sdkdir}") - endif() - endforeach() -endif() - -find_path(DIRECTSHOW_BASECLASS_DIR - NAMES - streams.h - HINTS - "${DIRECTSHOW_WINDOWSSDK_ROOT}" - PATHS - ${_acceptable_winsdk} - PATH_SUFFIXES - "Samples/Multimedia/DirectShow/BaseClasses") - -find_path(DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR - NAMES - DShow.h - HINTS - "${DIRECTSHOW_WINDOWSSDK_ROOT}" - PATHS - ${_acceptable_winsdk} - PATH_SUFFIXES - "Include") - -# This one we can grab from another SDK version. -find_path(DIRECTSHOW_QEDIT_INCLUDE_DIR - NAMES - qedit.h - HINTS - "${DIRECTSHOW_WINDOWSSDK_ROOT}" - PATHS - ${WINDOWSSDK_DIRS} - PATH_SUFFIXES - "Include") - -find_library(DIRECTSHOW_STRMIIDS_LIBRARY - NAMES - strmiids - HINTS - "${DIRECTSHOW_WINDOWSSDK_ROOT}" - PATHS - ${_acceptable_winsdk} - PATH_SUFFIXES - "Lib${DIRECTSHOW_LIB_SUBDIR}") - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(DirectShow - DEFAULT_MSG - DIRECTSHOW_BASECLASS_DIR - DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR - DIRECTSHOW_QEDIT_INCLUDE_DIR - DIRECTX_INCLUDE_DIR - DIRECTSHOW_STRMIIDS_LIBRARY) - -if(DIRECTSHOW_FOUND) - set(DIRECTSHOW_INCLUDE_DIRS - # Baseclass must be before SDK so it gets the correct refclock.h - "${DIRECTSHOW_BASECLASS_DIR}" - "${DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR}" - "${DIRECTX_INCLUDE_DIR}" - ) - if(EXISTS "${DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR}/atl/atlbase.h") - list(APPEND - DIRECTSHOW_INCLUDE_DIRS - "${DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR}/atl") - endif() - if(NOT "${DIRECTSHOW_QEDIT_INCLUDE_DIR}" STREQUAL "${DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR}") - # QEdit include dir might be an older SDK, so put it last. - list(APPEND DIRECTSHOW_INCLUDE_DIRS "${DIRECTSHOW_QEDIT_INCLUDE_DIR}") - endif() - - set(DIRECTSHOW_LIBRARIES "${DIRECTSHOW_STRMIIDS_LIBRARY}") - - mark_as_advanced(DIRECTSHOW_WINDOWSSDK_ROOT) -endif() - -mark_as_advanced(DIRECTSHOW_BASECLASS_DIR - DIRECTSHOW_WINDOWSSDK_INCLUDE_DIR - DIRECTSHOW_QEDIT_INCLUDE_DIR - DIRECTSHOW_STRMIIDS_LIBRARY) diff --git a/src/vrpn/cmake/FindDirectX.cmake b/src/vrpn/cmake/FindDirectX.cmake deleted file mode 100644 index 2aedd352c54dedd02fa3da47c124b9116a0952d3..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindDirectX.cmake +++ /dev/null @@ -1,317 +0,0 @@ -# - try to find part of DirectX SDK -# -# Cache Variables: (probably not for direct use in your scripts) -# DIRECTX_INCLUDE_DIR -# -# Variables you should use in your CMakeLists.txt: -# DIRECTX_DXGUID_LIBRARY - deprecated, see below -# DIRECTX_DXERR_LIBRARY - deprecated, see http://blogs.msdn.com/b/chuckw/archive/2012/04/24/where-s-dxerr-lib.aspx -# DIRECTX_DINPUT_LIBRARY -# DIRECTX_DINPUT_INCLUDE_DIR -# DIRECTX_D3D9_LIBRARY -# DIRECTX_D3DXOF_LIBRARY -# DIRECTX_D3DX9_LIBRARIES -# DIRECTX_INCLUDE_DIRS -# DIRECTX_FOUND - if this is not true, do not attempt to use this library -# -# Defines these macros: -# find_directx_include - wrapper for find_path that provides PATHS, HINTS, and PATH_SUFFIXES. -# find_directx_library - wrapper for find_library that provides PATHS, HINTS, and PATH_SUFFIXES. -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# SelectLibraryConfigurations -# -# Original Author: -# 2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2012. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - - -set(DIRECTX_ROOT_DIR - "${DIRECTX_ROOT_DIR}" - CACHE - PATH - "Root directory to search for DirectX") - -if(MSVC) - file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _PROG_FILES) - file(TO_CMAKE_PATH "$ENV{ProgramFiles(x86)}" _PROG_FILES_X86) - if(_PROG_FILES_X86) - set(_PROG_FILES "${_PROG_FILES_X86}") - endif() - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(_dx_lib_suffixes lib/x64 lib) - else() - set(_dx_lib_suffixes lib/x86 lib) - endif() - set(DXSDK_DIRS) - - find_package(WindowsSDK) - if(WINDOWSSDK_FOUND) - foreach(_dir ${WINDOWSSDK_DIRS}) - get_windowssdk_include_dirs(${_dir} _include_dirs) - if(_include_dirs) - list(APPEND DXSDK_DIRS ${_include_dirs}) - endif() - endforeach() - endif() - - macro(_append_dxsdk_in_inclusive_range _low _high) - if((NOT MSVC_VERSION LESS ${_low}) AND (NOT MSVC_VERSION GREATER ${_high})) - list(APPEND DXSDK_DIRS ${ARGN}) - endif() - endmacro() - _append_dxsdk_in_inclusive_range(1500 1600 "${_PROG_FILES}/Microsoft DirectX SDK (June 2010)") - _append_dxsdk_in_inclusive_range(1400 1600 - "${_PROG_FILES}/Microsoft DirectX SDK (February 2010)" - "${_PROG_FILES}/Microsoft DirectX SDK (August 2009)" - "${_PROG_FILES}/Microsoft DirectX SDK (March 2009)" - "${_PROG_FILES}/Microsoft DirectX SDK (November 2008)" - "${_PROG_FILES}/Microsoft DirectX SDK (August 2008)" - "${_PROG_FILES}/Microsoft DirectX SDK (June 2008)" - "${_PROG_FILES}/Microsoft DirectX SDK (March 2008)") - _append_dxsdk_in_inclusive_range(1310 1500 - "${_PROG_FILES}/Microsoft DirectX SDK (November 2007)" - "${_PROG_FILES}/Microsoft DirectX SDK (August 2007)" - "${_PROG_FILES}/Microsoft DirectX SDK (June 2007)" - "${_PROG_FILES}/Microsoft DirectX SDK (April 2007)" - "${_PROG_FILES}/Microsoft DirectX SDK (February 2007)" - "${_PROG_FILES}/Microsoft DirectX SDK (December 2006)" - "${_PROG_FILES}/Microsoft DirectX SDK (October 2006)" - "${_PROG_FILES}/Microsoft DirectX SDK (August 2006)" - "${_PROG_FILES}/Microsoft DirectX SDK (June 2006)" - "${_PROG_FILES}/Microsoft DirectX SDK (April 2006)" - "${_PROG_FILES}/Microsoft DirectX SDK (February 2006)") - - file(TO_CMAKE_PATH "$ENV{DXSDK_DIR}" ENV_DXSDK_DIR) - if(ENV_DXSDK_DIR) - list(APPEND DXSDK_DIRS ${ENV_DXSDK_DIR}) - endif() -else() - set(_dx_lib_suffixes lib) - set(DXSDK_DIRS /mingw) -endif() - -find_path(DIRECTX_INCLUDE_DIR - NAMES - dxdiag.h - dinput.h - dxerr8.h - PATHS - ${DXSDK_DIRS} - HINTS - "${DIRECTX_ROOT_DIR}" - PATH_SUFFIXES - include) -find_path(DIRECTX_DINPUT_INCLUDE_DIR - NAMES - dinput.h - PATHS - ${DXSDK_DIRS} - HINTS - "${DIRECTX_ROOT_DIR}" - PATH_SUFFIXES - include) - -set(DXLIB_HINTS) -if(WINDOWSSDK_FOUND AND DIRECTX_INCLUDE_DIR) - get_windowssdk_from_component("${DIRECTX_INCLUDE_DIR}" _winsdk) - if(_winsdk) - get_windowssdk_library_dirs("${_winsdk}" _libdirs) - if(_libdirs) - list(APPEND DXLIB_HINTS ${_libdirs}) - endif() - endif() -endif() - -if(WINDOWSSDK_FOUND AND DIRECTX_DINPUT_INCLUDE_DIR) - get_windowssdk_from_component("${DIRECTX_DINPUT_INCLUDE_DIR}" _winsdk) - if(_winsdk) - get_windowssdk_library_dirs("${_winsdk}" _includes) - if(_includes) - list(APPEND DXLIB_HINTS ${_includes}) - endif() - endif() -endif() - -find_library(DIRECTX_DXGUID_LIBRARY - NAMES - dxguid - PATHS - ${DXLIB_HINTS} - ${DXSDK_DIRS} - HINTS - "${DIRECTX_ROOT_DIR}" - PATH_SUFFIXES - ${_dx_lib_suffixes}) - -if(DIRECTX_DXGUID_LIBRARY) - get_filename_component(_dxsdk_lib_dir ${DIRECTX_DXGUID_LIBRARY} PATH) - list(APPEND DXLIB_HINTS "${_dxsdk_lib_dir}") -endif() - -find_library(DIRECTX_DINPUT_LIBRARY - NAMES - dinput8 - dinput - PATHS - ${DXSDK_DIRS} - HINTS - ${DXLIB_HINTS} - "${DIRECTX_ROOT_DIR}" - PATH_SUFFIXES - ${_dx_lib_suffixes}) - -find_library(DIRECTX_DXERR_LIBRARY - NAMES - dxerr - dxerr9 - dxerr8 - PATHS - ${DXSDK_DIRS} - HINTS - ${DXLIB_HINTS} - "${DIRECTX_ROOT_DIR}" - PATH_SUFFIXES - ${_dx_lib_suffixes}) - -find_library(DIRECTX_D3D9_LIBRARY - NAMES - d3d9 - PATHS - ${DXSDK_DIRS} - HINTS - ${DXLIB_HINTS} - "${DIRECTX_ROOT_DIR}" - PATH_SUFFIXES - ${_dx_lib_suffixes}) - -find_library(DIRECTX_D3DXOF_LIBRARY - NAMES - d3dxof - PATHS - ${DXSDK_DIRS} - HINTS - ${DXLIB_HINTS} - "${DIRECTX_ROOT_DIR}" - PATH_SUFFIXES - ${_dx_lib_suffixes}) - -find_library(DIRECTX_D3DX9_LIBRARY_RELEASE - NAMES - d3dx9 - PATHS - ${DXSDK_DIRS} - HINTS - ${DXLIB_HINTS} - "${DIRECTX_ROOT_DIR}" - PATH_SUFFIXES - ${_dx_lib_suffixes}) - -find_library(DIRECTX_D3DX9_LIBRARY_DEBUG - NAMES - d3dx9d - PATHS - ${DXSDK_DIRS} - HINTS - ${DXLIB_HINTS} - "${DIRECTX_ROOT_DIR}" - PATH_SUFFIXES - ${_dx_lib_suffixes}) - -find_library(DIRECTX_XINPUT_LIBRARY - NAMES - Xinput9_1_0 - Xinput - PATHS - ${DXSDK_DIRS} - HINTS - ${DXLIB_HINTS} - "${DIRECTX_ROOT_DIR}" - PATH_SUFFIXES - ${_dx_lib_suffixes}) - -include(SelectLibraryConfigurations) -select_library_configurations(DIRECTX_D3DX9) - -set(DIRECTX_EXTRA_CHECK) -if(DIRECTX_INCLUDE_DIR) - if(MSVC80) - set(DXSDK_DEPRECATION_BUILD 1962) - endif() - - if(DXSDK_DEPRECATION_BUILD) - include(CheckCSourceCompiles) - set(_dinput_old_includes ${CMAKE_REQUIRED_INCLUDES}) - set(CMAKE_REQUIRED_INCLUDES "${DIRECTX_INCLUDE_DIR}") - check_c_source_compiles(" - #include <dxsdkver.h> - #if _DXSDK_BUILD_MAJOR >= ${DXSDK_DEPRECATION_BUILD} - #error - #else - int main(int argc, char * argv[]) { - return 0; - } - #endif - " - DIRECTX_SDK_SUPPORTS_COMPILER) - set(DIRECTX_EXTRA_CHECK DIRECTX_SDK_SUPPORTS_COMPILER) - set(CMAKE_REQUIRED_INCLUDES "${_dinput_old_includes}") - else() - # Until proven otherwise. - set(DIRECTX_SDK_SUPPORTS_COMPILER TRUE) - endif() -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(DirectX - DEFAULT_MSG - DIRECTX_DXGUID_LIBRARY - DIRECTX_DINPUT_LIBRARY - DIRECTX_INCLUDE_DIR - ${DIRECTX_EXTRA_CHECK}) - -if(DIRECTX_FOUND) - set(DIRECTX_LIBRARIES - "${DIRECTX_DXGUID_LIBRARY}" - "${DIRECTX_DINPUT_LIBRARY}") - - set(DIRECTX_INCLUDE_DIRS "${DIRECTX_INCLUDE_DIR}") - - mark_as_advanced(DIRECTX_ROOT_DIR) -endif() - -macro(find_directx_library) - find_library(${ARGN} - PATHS - ${DXSDK_DIRS} - HINTS - ${DXLIB_HINTS} - "${DIRECTX_ROOT_DIR}" - PATH_SUFFIXES - ${_dx_lib_suffixes}) -endmacro() -macro(find_directx_include) - find_path(${ARGN} - PATHS - ${DXSDK_DIRS} - HINTS - ${DIRECTX_INCLUDE_DIR} - "${DIRECTX_ROOT_DIR}" - PATH_SUFFIXES - include) -endmacro() - -mark_as_advanced(DIRECTX_DINPUT_LIBRARY - DIRECTX_DXGUID_LIBRARY - DIRECTX_DXERR_LIBRARY - DIRECTX_D3D9_LIBRARY - DIRECTX_D3DXOF_LIBRARY - DIRECTX_D3DX9_LIBRARY_RELEASE - DIRECTX_D3DX9_LIBRARY_DEBUG - DIRECTX_INCLUDE_DIR) diff --git a/src/vrpn/cmake/FindGHOST.cmake b/src/vrpn/cmake/FindGHOST.cmake deleted file mode 100644 index 71f17ee5650a69f5e4865cc87591548bc7a220ed..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindGHOST.cmake +++ /dev/null @@ -1,90 +0,0 @@ -# - try to find Sensable GHOST library and include files -# GHOST_INCLUDE_DIRS, where to find GL/glut.h, etc. -# GHOST_LIBRARIES, the libraries to link against -# GHOST_FOUND, If false, do not try to use GLUT. -# GHOST_RUNTIME_LIBRARY_DIRS, path to DLL on Windows for runtime use. -# -# Requires these CMake modules: -# no additional modules required -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(GHOST_ROOT_DIR - "${GHOST_ROOT_DIR}" - CACHE - PATH - "Path to search for GHOST") - -set(_dirs) -if(WIN32) - include(ProgramFilesGlob) - program_files_fallback_glob(_dirs "/Sensable/GHOST/v*/") -endif() - -find_path(GHOST_INCLUDE_DIR - gstPHANToM.h - PATHS - ${_dirs} - HINTS - "${GHOST_ROOT_DIR}" - PATH_SUFFIXES - include) - -find_library(GHOST_LIBRARY - GHOST40 - GHOST31 - PATHS - ${_dirs} - HINTS - "${GHOST_ROOT_DIR}" - PATH_SUFFIXES - lib) - -if(MSVC) - if(MSVC_VERSION GREATER 1300) - # .NET and newer: fake the STL headers - get_filename_component(_moddir "${CMAKE_CURRENT_LIST_FILE}" PATH) - set(GHOST_STL_INCLUDE_DIR "${_moddir}/ghost-fake-stl") - else() - # 6.0 and earlier - use GHOST-provided STL - find_path(GHOST_STL_INCLUDE_DIR - vector.h - PATHS - ${_dirs} - HINTS - "${GHOST_ROOT_DIR}" - "${GHOST_INCLUDE_DIR}" - PATH_SUFFIXES - external/stl - stl) - endif() - set(_deps_check GHOST_STL_INCLUDE_DIR) -else() - set(_deps_check) -endif() - -# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GHOST - DEFAULT_MSG - GHOST_LIBRARY - ${_deps_check} - GHOST_INCLUDE_DIR) - -if(GHOST_FOUND) - set(GHOST_LIBRARIES "${GHOST_LIBRARY}") - set(GHOST_INCLUDE_DIRS "${GHOST_INCLUDE_DIR}") - - mark_as_advanced(GHOST_ROOT_DIR) -endif() - -mark_as_advanced(GHOST_LIBRARY GHOST_STL_INCLUDE_DIR GHOST_INCLUDE_DIR) diff --git a/src/vrpn/cmake/FindGPM.cmake b/src/vrpn/cmake/FindGPM.cmake deleted file mode 100644 index ea70d8550ad5672d8afc64ed6b43e9f38a26dd19..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindGPM.cmake +++ /dev/null @@ -1,43 +0,0 @@ -# - try to find GPM library -# -# Cache Variables: (probably not for direct use in your scripts) -# GPM_INCLUDE_DIR -# GPM_LIBRARY -# -# Non-cache variables you might use in your CMakeLists.txt: -# GPM_FOUND -# GPM_INCLUDE_DIRS -# GPM_LIBRARIES -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -find_library(GPM_LIBRARY - NAMES gpm) - -find_path(GPM_INCLUDE_DIR - NAMES gpm.h) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GPM - DEFAULT_MSG - GPM_LIBRARY - GPM_INCLUDE_DIR) - -if(GPM_FOUND) - set(GPM_LIBRARIES "${GPM_LIBRARY}") - - set(GPM_INCLUDE_DIRS "${GPM_INCLUDE_DIR}") -endif() - -mark_as_advanced(GPM_INCLUDE_DIR GPM_LIBRARY) diff --git a/src/vrpn/cmake/FindHIDAPI.cmake b/src/vrpn/cmake/FindHIDAPI.cmake deleted file mode 100644 index e53502a877bdb59f2cb39115d59e03365257e6b7..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindHIDAPI.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# - try to find HIDAPI library -# from http://www.signal11.us/oss/hidapi/ -# -# Cache Variables: (probably not for direct use in your scripts) -# HIDAPI_INCLUDE_DIR -# HIDAPI_LIBRARY -# -# Non-cache variables you might use in your CMakeLists.txt: -# HIDAPI_FOUND -# HIDAPI_INCLUDE_DIRS -# HIDAPI_LIBRARIES -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -find_library(HIDAPI_LIBRARY - NAMES hidapi) - -find_path(HIDAPI_INCLUDE_DIR - NAMES hidapi.h) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(HIDAPI - DEFAULT_MSG - HIDAPI_LIBRARY - HIDAPI_INCLUDE_DIR) - -if(HIDAPI_FOUND) - set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARY}") - - set(HIDAPI_INCLUDE_DIRS "${HIDAPI_INCLUDE_DIR}") -endif() - -mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY) diff --git a/src/vrpn/cmake/FindInterSense.cmake b/src/vrpn/cmake/FindInterSense.cmake deleted file mode 100644 index 6edfaa513ee4946a39813a423e6b0e22b79aae32..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindInterSense.cmake +++ /dev/null @@ -1,98 +0,0 @@ -# - try to find InterSense library -# -# Cache Variables: (probably not for direct use in your scripts) -# INTERSENSE_INCLUDE_DIR -# INTERSENSE_ISENSEC_DIR - location of the isense.c "import library" substitute. -# INTERSENSE_LIBRARY -# -# Non-cache variables you might use in your CMakeLists.txt: -# INTERSENSE_FOUND -# INTERSENSE_INCLUDE_DIRS -# INTERSENSE_LIBRARIES -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Author: -# 2013 Eric Marsh <bits@wemarsh.com> -# http://wemarsh.com/ -# Kognitiv Neuroinformatik, Universität Bremen -# -# (building on Ryan Pavlik's templates) -# -# 2013 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(INTERSENSE_ROOT_DIR - "${INTERSENSE_ROOT_DIR}" - CACHE - PATH - "Directory to search for the Intersense SDK") - -if(APPLE) - set(_ARCH UniversalLib) -else() - if(CMAKE_SIZEOF_VOID_P MATCHES "8") - set(_ARCH x86_64) - else() - set(_ARCH x86_32) - endif() -endif() - -if(APPLE) - set(_SDKDIR MacOSX) -elseif(WIN32) - set(_SDKDIR Windows) -else() # Assume Linux, since that's the only other platform supported by this library - set(_SDKDIR Linux) -endif() - -find_path(INTERSENSE_INCLUDE_DIR - NAMES isense.h - PATHS "${INTERSENSE_ROOT_DIR}" "${INTERSENSE_ROOT_DIR}/SDK") - -find_path(INTERSENSE_ISENSEC_DIR - NAMES isense.c - PATHS "${INTERSENSE_ROOT_DIR}" "${INTERSENSE_ROOT_DIR}/SDK" - PATH_SUFFIXES - Linux/Sample - MacOSX/Sample - "Windows/Sample/Visual C++ 2005" - "Windows/Sample/Visual C++ 2005 (single tracker)") - -include(FindPackageHandleStandardArgs) - -# This is a weird one - no import library is supplied, and instead, at least on Windows, they use -# an isense.c file to call into the DLL. Not sure if MinGW can link right against the dll in this case. -if(WIN32) - find_package_handle_standard_args(InterSense - DEFAULT_MSG - INTERSENSE_INCLUDE_DIR - INTERSENSE_ISENSEC_DIR) - if(INTERSENSE_FOUND) - set(INTERSENSE_LIBRARIES "") - set(INTERSENSE_INCLUDE_DIRS "${INTERSENSE_INCLUDE_DIR}" "${INTERSENSE_ISENSEC_DIR}") - endif() -else() # Only MSVC on Windows theoretically needs import libraries, so... - find_library(INTERSENSE_LIBRARY - NAMES isense - PATHS "${INTERSENSE_ROOT_DIR}" "${INTERSENSE_ROOT_DIR}/SDK" - PATH_SUFFIXES "${_SDKDIR}/${_ARCH}") - - find_package_handle_standard_args(InterSense - DEFAULT_MSG - INTERSENSE_LIBRARY - INTERSENSE_INCLUDE_DIR) - - if(INTERSENSE_FOUND) - set(INTERSENSE_LIBRARIES "${INTERSENSE_LIBRARY}" ${CMAKE_DL_LIBS}) - set(INTERSENSE_INCLUDE_DIRS "${INTERSENSE_INCLUDE_DIR}") - endif() -endif() - -mark_as_advanced(INTERSENSE_INCLUDE_DIR INTERSENSE_ISENSEC_DIR INTERSENSE_LIBRARY) diff --git a/src/vrpn/cmake/FindJsonCpp.cmake b/src/vrpn/cmake/FindJsonCpp.cmake deleted file mode 100644 index 7b30f6699c3c2f470112532bc2e2da3b50d7595d..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindJsonCpp.cmake +++ /dev/null @@ -1,98 +0,0 @@ -# - try to find JSONCPP library -# -# Cache Variables: (probably not for direct use in your scripts) -# JSONCPP_INCLUDE_DIR -# JSONCPP_LIBRARY -# -# Non-cache variables you might use in your CMakeLists.txt: -# JSONCPP_FOUND -# JSONCPP_INCLUDE_DIRS -# JSONCPP_LIBRARIES -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Author: -# 2011 Philippe Crassous (ENSAM ParisTech / Institut Image) p.crassous _at_ free.fr - - -set(JSONCPP_ROOT_DIR - "${JSONCPP_ROOT_DIR}" - CACHE - PATH - "Directory to search for JSONCPP") -set(_jsoncppnames) -set(_pathsuffixes - suncc - vacpp - mingw - msvc6 - msvc7 - msvc71 - msvc80 - msvc90 - linux-gcc) -if(CMAKE_COMPILER_IS_GNUCXX) - execute_process(COMMAND - ${CMAKE_CXX_COMPILER} - -dumpversion - OUTPUT_VARIABLE - _gnucxx_ver - OUTPUT_STRIP_TRAILING_WHITESPACE) - list(APPEND - _jsoncppnames - json_linux-gcc-${_gnucxx_ver}_libmt - json_linux-gcc_libmt) - list(APPEND _pathsuffixes linux-gcc-${_gnucxx_ver}) -elseif(MSVC) - if(MSVC_VERSION EQUAL 1200) - list(APPEND _jsoncppnames json_vc6_libmt) - elseif(MSVC_VERSION EQUAL 1300) - list(APPEND _jsoncppnames json_vc7_libmt) - elseif(MSVC_VERSION EQUAL 1310) - list(APPEND _jsoncppnames json_vc71_libmt) - elseif(MSVC_VERSION EQUAL 1400) - list(APPEND _jsoncppnames json_vc8_libmt) - elseif(MSVC_VERSION EQUAL 1500) - list(APPEND _jsoncppnames json_vc9_libmt) - elseif(MSVC_VERSION EQUAL 1600) - list(APPEND _jsoncppnames json_vc10_libmt) - endif() -else() - list(APPEND _jsoncppnames - json_suncc_libmt - json_vacpp_libmt) -endif() - -list(APPEND _jsoncppnames - json_mingw_libmt) - -find_library(JSONCPP_LIBRARY - NAMES - ${_jsoncppnames} - PATHS - "${JSONCPP_ROOT_DIR}/libs" - PATH_SUFFIXES - ${_pathsuffixes}) - -find_path(JSONCPP_INCLUDE_DIR - NAMES - json/json.h - PATHS - "${JSONCPP_ROOT_DIR}" - PATH_SUFFIXES - include) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(JSONCPP - DEFAULT_MSG - JSONCPP_LIBRARY - JSONCPP_INCLUDE_DIR) - -if(JSONCPP_FOUND) - set(JSONCPP_LIBRARIES "${JSONCPP_LIBRARY}") - set(JSONCPP_INCLUDE_DIRS "${JSONCPP_INCLUDE_DIR}") - mark_as_advanced(JSONCPP_ROOT_DIR) -endif() - -mark_as_advanced(JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY) diff --git a/src/vrpn/cmake/FindLibFreespace.cmake b/src/vrpn/cmake/FindLibFreespace.cmake deleted file mode 100644 index 452eb6616afc2cbccab3a6a7d681fb16cc2c39d6..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindLibFreespace.cmake +++ /dev/null @@ -1,78 +0,0 @@ -# - try to find Hillcrest Labs' libfreespace library -# -# Cache Variables: (probably not for direct use in your scripts) -# LIBFREESPACE_INCLUDE_DIR -# LIBFREESPACE_LIBRARY -# -# Non-cache variables you might use in your CMakeLists.txt: -# LIBFREESPACE_FOUND -# LIBFREESPACE_INCLUDE_DIRS -# LIBFREESPACE_LIBRARIES -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2014 Ryan Pavlik <ryan@sensics.com> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# -# Copyright Sensics 2014. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(LIBFREESPACE_ROOT_DIR - "${LIBFREESPACE_ROOT_DIR}" - CACHE - PATH - "Directory to search for libfreespace") - -find_library(LIBFREESPACE_LIBRARY - NAMES - freespace - libfreespace - PATHS - "${LIBFREESPACE_ROOT_DIR}" - PATH_SUFFIXES - lib) - -get_filename_component(_libdir "${LIBFREESPACE_LIBRARY}" PATH) - -find_path(LIBFREESPACE_INCLUDE_DIR - NAMES - freespace/freespace.h - HINTS - "${_libdir}" - "${_libdir}/.." - PATHS - "${LIBFREESPACE_ROOT_DIR}" - PATH_SUFFIXES - include/) - - -include(FindPackageHandleStandardArgs) -if(WIN32) - find_package(WinHID QUIET) - find_package_handle_standard_args(LibFreespace - DEFAULT_MSG - LIBFREESPACE_LIBRARY - LIBFREESPACE_INCLUDE_DIR - WINHID_LIBRARIES) -else() - find_package_handle_standard_args(LibFreespace - DEFAULT_MSG - LIBFREESPACE_LIBRARY - LIBFREESPACE_INCLUDE_DIR) -endif() - -if(LIBFREESPACE_FOUND) - set(LIBFREESPACE_LIBRARIES "${LIBFREESPACE_LIBRARY}") - if(WIN32) - list(APPEND LIBFREESPACE_LIBRARIES ${WINHID_LIBRARIES}) - endif() - set(LIBFREESPACE_INCLUDE_DIRS "${LIBFREESPACE_INCLUDE_DIR}") - mark_as_advanced(LIBFREESPACE_ROOT_DIR) -endif() - -mark_as_advanced(LIBFREESPACE_INCLUDE_DIR - LIBFREESPACE_LIBRARY) diff --git a/src/vrpn/cmake/FindLibNifalcon.cmake b/src/vrpn/cmake/FindLibNifalcon.cmake deleted file mode 100644 index b36617a4a8324ae982663083b3abd7af7f2fe942..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindLibNifalcon.cmake +++ /dev/null @@ -1,95 +0,0 @@ -# - try to find Libnifalcon library -# -# -# Cache Variables: (probably not for direct use in your scripts) -# LIBNIFALCON_ROOT_DIR - where to start searching -# LIBNIFALCON_INCLUDE_DIR -# LIBNIFALCON_LIBRARY -# LIBNIFALCON_LIBUSB1_LIBRARY - Unix only -# LIBNIFALCON_LIBUSB1_INCLUDE_DIR - Unix only -# LIBNIFALCON_rt_LIBRARY - Unix only -# -# Non-cache variables you might use in your CMakeLists.txt: -# LIBNIFALCON_FOUND -# LIBNIFALCON_INCLUDE_DIRS -# LIBNIFALCON_LIBRARIES -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known to be included with CMake >=2.6.2) -# -# 2010 Axel Kohlmeyer, <akohlmey@gmail.com> - -set(LIBNIFALCON_ROOT_DIR - "${LIBNIFALCON_ROOT_DIR}" - CACHE - PATH - "Where to start searching") - -find_library(LIBNIFALCON_LIBRARY - NAMES - libnifalcon - nifalcon - HINTS - "${LIBNIFALCON_ROOT_DIR}" - PATH_SUFFIXES - include) - -get_filename_component(_libdir "${LIBNIFALCON_LIBRARY}" PATH) - -find_path(LIBNIFALCON_INCLUDE_DIR - NAMES - falcon/core/FalconDevice.h - HINTS - "${_libdir}") - -set(_deps_check) -if(NOT WIN32) - find_library(LIBNIFALCON_LIBUSB1_LIBRARY NAMES libusb-1.0 usb-1.0) - get_filename_component(_libdir "${LIBNIFALCON_LIBUSB1_LIBRARY}" PATH) - - find_path(LIBNIFALCON_LIBUSB1_INCLUDE_DIR - NAMES - libusb-1.0/libusb.h - HINTS - "${_libdir}") - - find_library(LIBNIFALCON_rt_LIBRARY NAMES rt) - set(_deps_check - LIBNIFALCON_LIBUSB1_LIBRARY - LIBNIFALCON_LIBUSB1_INCLUDE_DIR - LIBNIFALCON_rt_LIBRARY) -endif() - -find_package(Boost QUIET) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(libnifalcon - DEFAULT_MSG - LIBNIFALCON_LIBRARY - LIBNIFALCON_INCLUDE_DIR - Boost_INCLUDE_DIR - ${_deps_check}) - -if(LIBNIFALCON_FOUND) - set(LIBNIFALCON_LIBRARIES "${LIBNIFALCON_LIBRARY}") - set(LIBNIFALCON_LIBRARY_DIRS "${_libdir}") - set(LIBNIFALCON_INCLUDE_DIRS "${LIBNIFALCON_INCLUDE_DIR}" "${Boost_INCLUDE_DIR}") - - if(NOT WIN32) - list(APPEND - LIBNIFALCON_LIBRARIES - "${LIBNIFALCON_LIBUSB1_LIBRARY}" - "${LIBNIFALCON_rt_LIBRARY}") - list(APPEND - LIBNIFALCON_INCLUDE_DIRS - "${LIBNIFALCON_LIBUSB1_INCLUDE_DIR}") - endif() - - mark_as_advanced(LIBNIFALCON_ROOT_DIR) -endif() - -mark_as_advanced(LIBNIFALCON_INCLUDE_DIR - LIBNIFALCON_LIBRARY - LIBNIFALCON_LIBUSB1_LIBRARY - LIBNIFALCON_LIBUSB1_INCLUDE_DIR - LIBNIFALCON_rt_LIBRARY) diff --git a/src/vrpn/cmake/FindLibusb1.cmake b/src/vrpn/cmake/FindLibusb1.cmake deleted file mode 100644 index ef5afee2d219a914d3e60369a28f3602b217d6d2..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindLibusb1.cmake +++ /dev/null @@ -1,92 +0,0 @@ -# - try to find libusb-1 library -# -# Cache Variables: (probably not for direct use in your scripts) -# LIBUSB1_LIBRARY -# LIBUSB1_INCLUDE_DIR -# -# Non-cache variables you should use in your CMakeLists.txt: -# LIBUSB1_LIBRARIES -# LIBUSB1_INCLUDE_DIRS -# LIBUSB1_FOUND - if this is not true, do not attempt to use this library -# -# Requires these CMake modules: -# ProgramFilesGlob -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - - -set(LIBUSB1_ROOT_DIR - "${LIBUSB1_ROOT_DIR}" - CACHE - PATH - "Root directory to search for libusb-1") - -if(WIN32) - include(ProgramFilesGlob) - program_files_fallback_glob(_dirs "LibUSB-Win32") - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - if(MSVC) - set(_lib_suffixes lib/msvc_x64) - endif() - else() - if(MSVC) - set(_lib_suffixes lib/msvc) - elseif(COMPILER_IS_GNUCXX) - set(_lib_suffixes lib/gcc) - endif() - endif() -else() - set(_lib_suffixes) - find_package(PkgConfig QUIET) - if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_LIBUSB1 libusb-1.0) - endif() -endif() - -find_path(LIBUSB1_INCLUDE_DIR - NAMES - libusb.h - PATHS - ${PC_LIBUSB1_INCLUDE_DIRS} - ${PC_LIBUSB1_INCLUDEDIR} - ${_dirs} - HINTS - "${LIBUSB1_ROOT_DIR}" - PATH_SUFFIXES - include - libusb-1.0) - -find_library(LIBUSB1_LIBRARY - NAMES - usb-1.0 - PATHS - ${PC_LIBUSB1_LIBRARY_DIRS} - ${PC_LIBUSB1_LIBDIR} - ${_dirs} - PATH_SUFFIXES - ${_lib_suffixes}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Libusb1 - DEFAULT_MSG - LIBUSB1_LIBRARY - LIBUSB1_INCLUDE_DIR) - -if(LIBUSB1_FOUND) - set(LIBUSB1_LIBRARIES "${LIBUSB1_LIBRARY}") - - set(LIBUSB1_INCLUDE_DIRS "${LIBUSB1_INCLUDE_DIR}") - - mark_as_advanced(LIBUSB1_ROOT_DIR) -endif() - -mark_as_advanced(LIBUSB1_INCLUDE_DIR LIBUSB1_LIBRARY) diff --git a/src/vrpn/cmake/FindMacHID.cmake b/src/vrpn/cmake/FindMacHID.cmake deleted file mode 100644 index d96baceb597b82cb0effab01b17c27d780fb8756..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindMacHID.cmake +++ /dev/null @@ -1,66 +0,0 @@ -# - try to find Mac HID frameworks -# -# Cache Variables: (probably not for direct use in your scripts) -# MACHID_CoreFoundation_LIBRARY -# MACHID_CoreFoundation_INCLUDE_DIR -# MACHID_IOKit_LIBRARY -# MACHID_IOKit_INCLUDE_DIR -# MACOSX_HID_UINT32T (from CheckMacHIDAPI) -# -# Non-cache variables you should use in your CMakeLists.txt: -# MACHID_DEFINITIONS -# MACHID_LIBRARIES -# MACHID_INCLUDE_DIRS -# MACHID_FOUND - if this is not true, do not attempt to use this library -# -# Requires these CMake modules: -# CheckMacHIDAPI -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(APPLE) - find_library(MACHID_CoreFoundation_LIBRARY CoreFoundation) - find_path(MACHID_CoreFoundation_INCLUDE_DIR - CoreFoundation/CoreFoundation.h) - - find_library(MACHID_IOKit_LIBRARY IOKit) - find_path(MACHID_IOKit_INCLUDE_DIR IOKit/hid/IOHIDLib.h) - - include(CheckMacHIDAPI) - set(MACHID_DEFINITIONS "-DMACOSX_HID_UINT32T=${MACOSX_HID_UINT32T}") - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(MacHID - DEFAULT_MSG - MACHID_CoreFoundation_LIBRARY - MACHID_CoreFoundation_INCLUDE_DIR - MACHID_IOKit_LIBRARY - MACHID_IOKit_INCLUDE_DIR - MACOSX_HID_UINT32T) - -endif() - -if(MACHID_FOUND) - set(MACHID_LIBRARIES - "${MACHID_CoreFoundation_LIBRARY}" - "${MACHID_IOKit_LIBRARY}") - - set(MACHID_INCLUDE_DIRS - "${MACHID_CoreFoundation_INCLUDE_DIR}" - "${MACHID_IOKit_INCLUDE_DIR}") - - mark_as_advanced(MACHID_CoreFoundation_LIBRARY - MACHID_CoreFoundation_INCLUDE_DIR - MACHID_IOKit_LIBRARY - MACHID_IOKit_INCLUDE_DIR) - -endif() diff --git a/src/vrpn/cmake/FindModbus.cmake b/src/vrpn/cmake/FindModbus.cmake deleted file mode 100644 index 03e8dce48c7f1593fa1367912d36fcf86f781d2b..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindModbus.cmake +++ /dev/null @@ -1,87 +0,0 @@ -# - Find Modbus library -# Find the Modbus headers and libraries. -# -# MODBUS_INCLUDE_DIRS - where to find modbus.h -# MODBUS_LIBRARIES - List of libraries when using modbus. -# MODBUS_FOUND - True if modbus library found. -# - -# Based on Findquatlib.cmake, Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(MODBUS_ROOT_DIR - "${MODBUS_ROOT_DIR}" - CACHE - PATH - "Root directory to search for libmodbus") - -if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8") - set(_libsuffixes lib64 lib) - - # 64-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _progfiles) -else() - set(_libsuffixes lib) - if(NOT "$ENV{ProgramFiles(x86)}" STREQUAL "") - # 32-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles(x86)}" _progfiles) - else() - # 32-bit dir on win32, useless to us on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _progfiles) - endif() -endif() - -# Look for the header file. -find_path(MODBUS_INCLUDE_DIR - NAMES - modbus.h - HINTS - "${MODBUS_ROOT_DIR}" - PATH_SUFFIXES - include - PATHS - "${_progfiles}/libmodbus" - C:/usr/local - /usr/local) - -# Look for the library. -find_library(MODBUS_LIBRARY - NAMES - libmodbus.lib - libmodbus.a - HINTS - "${MODBUS_ROOT_DIR}" - PATH_SUFFIXES - ${_libsuffixes} - PATHS - "${_progfiles}/libmodbus" - C:/usr/local - /usr/local) - -# handle the QUIETLY and REQUIRED arguments and set MODBUS_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Modbus - DEFAULT_MSG - MODBUS_LIBRARY - MODBUS_INCLUDE_DIR) - -if(MODBUS_FOUND) - set(MODBUS_LIBRARIES ${MODBUS_LIBRARY}) - set(MODBUS_INCLUDE_DIRS ${MODBUS_INCLUDE_DIR}) - - mark_as_advanced(MODBUS_ROOT_DIR) -else() - set(MODBUS_LIBRARIES) - set(MODBUS_INCLUDE_DIRS) -endif() - -mark_as_advanced(MODBUS_LIBRARY MODBUS_INCLUDE_DIR) - diff --git a/src/vrpn/cmake/FindNIDAQmx.cmake b/src/vrpn/cmake/FindNIDAQmx.cmake deleted file mode 100644 index 6a74fc3b4aad6e5d5c5fc96e484879b277205fa3..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindNIDAQmx.cmake +++ /dev/null @@ -1,48 +0,0 @@ -# - try to find NIDAQMX library -# -# Cache Variables: (probably not for direct use in your scripts) -# NIDAQMX_INCLUDE_DIR -# NIDAQMX_LIBRARY -# -# Non-cache variables you might use in your CMakeLists.txt: -# NIDAQMX_FOUND -# NIDAQMX_INCLUDE_DIRS -# NIDAQMX_LIBRARIES -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2011 Russell M. Taylor II <taylorr@cs.unc.edu> - -# Copyright University of North Carolina at Chapel Hill 2011 -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -find_library(NIDAQMX_LIBRARY - NAMES - NIDAQmx - PATHS - "C:/Program Files (x86)/National Instruments/NI-DAQ/DAQmx ANSI C Dev/lib/msvc") - -find_path(NIDAQMX_INCLUDE_DIR - NAMES - NIDAQmx.h - PATHS - "C:/Program Files (x86)/National Instruments/NI-DAQ/DAQmx ANSI C Dev/include") - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(NIDAQmx - DEFAULT_MSG - NIDAQMX_LIBRARY - NIDAQMX_INCLUDE_DIR) - -if(NIDAQMX_FOUND) - set(NIDAQMX_LIBRARIES "${NIDAQMX_LIBRARY}") - - set(NIDAQMX_INCLUDE_DIRS "${NIDAQMX_INCLUDE_DIR}") -endif() - -mark_as_advanced(NIDAQMX_INCLUDE_DIR NIDAQMX_LIBRARY) - diff --git a/src/vrpn/cmake/FindOpenHaptics.cmake b/src/vrpn/cmake/FindOpenHaptics.cmake deleted file mode 100644 index 0e4958c5f5ccbfac3a50b0676f1a4c32b2077b2b..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindOpenHaptics.cmake +++ /dev/null @@ -1,481 +0,0 @@ -# - try to find OpenHaptics libraries -# -# Cache Variables: (probably not for direct use in your scripts) -# HDAPI_INCLUDE_DIR -# HDAPI_LIBRARY -# HDAPI_LIBRARY_RELEASE -# HDAPI_LIBRARY_DEBUG -# HDAPI_HDU_INCLUDE_DIR -# HDAPI_HDU_LIBRARY -# HDAPI_HDU_LIBRARY_RELEASE -# HDAPI_HDU_LIBRARY_DEBUG -# HLAPI_INCLUDE_DIR -# HLAPI_LIBRARY -# HLAPI_LIBRARY_RELEASE -# HLAPI_LIBRARY_DEBUG -# HLAPI_HLU_INCLUDE_DIR -# HLAPI_HLU_LIBRARY -# HLAPI_HLU_LIBRARY_RELEASE -# HLAPI_HLU_LIBRARY_DEBUG -# -# Non-cache variables you might use in your CMakeLists.txt: -# OPENHAPTICS_FOUND -# HDAPI_INCLUDE_DIRS -# HDAPI_LIBRARIES -# HDAPI_HDU_INCLUDE_DIRS -# HDAPI_HDU_LIBRARIES -# HLAPI_INCLUDE_DIRS -# HLAPI_LIBRARIES -# HLAPI_HLU_INCLUDE_DIRS -# HLAPI_HLU_LIBRARIES -# OPENHAPTICS_LIBRARIES - includes HD, HDU, HL, HLU -# OPENHAPTICS_RUNTIME_LIBRARY_DIRS -# OPENHAPTICS_ENVIRONMENT -# OPENHAPTICS_LIBRARY_DIRS -# OPENHAPTICS_INCLUDE_DIRS -# -# Requires these CMake modules: -# CleanDirectoryList -# CleanLibraryList -# ListCombinations -# ProgramFilesGlob -# SelectLibraryConfigurations (included with CMake >=2.8.0) -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# CMake 2.6.3 (uses "unset") -# -# Original Author: -# 2009-2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -cmake_minimum_required(VERSION 2.6.3) - -set(OPENHAPTICS_ROOT_DIR - "${OPENHAPTICS_ROOT_DIR}" - CACHE - PATH - "Path to search for OpenHaptics") -option(OPENHAPTICS_NESTED_TARGETS - "Whether we should compile HDU and HLU, if needed, as a part of the solution" - ON) -mark_as_advanced(OPENHAPTICS_NESTED_TARGETS) - -### -# Configure OpenHaptics -### - -include(SelectLibraryConfigurations) -include(ListCombinations) -include(CleanDirectoryList) -include(CleanLibraryList) -include(ProgramFilesGlob) - -set(_nest_targets) -set(_incsearchdirs) -set(_libsearchdirs) -set(OPENHAPTICS_ENVIRONMENT) -set(OPENHAPTICS_RUNTIME_LIBRARY_DIRS) - -set(_dirs) -if(NOT "$ENV{OH_SDK_BASE}" STREQUAL "") - list(APPEND _dirs "$ENV{OH_SDK_BASE}") -elseif(NOT "$ENV{3DTOUCH_BASE}" STREQUAL "") - list(APPEND _dirs "$ENV{3DTOUCH_BASE}") -endif() -if(WIN32) - program_files_fallback_glob(_pfdirs "/Sensable/3DTouch*/") - foreach(_OH_DEFAULT_LOCATION "C:/OpenHaptics/3.1" "C:/OpenHaptics/Academic/3.1") - if(EXISTS "${_OH_DEFAULT_LOCATION}") - list(APPEND _dirs "${_OH_DEFAULT_LOCATION}") - endif() - endforeach() - set(_dirs "${_dirs};${_pfdirs}") - if(MSVC60) - set(_vc "vc6") - elseif(MSVC70 OR MSVC71) - set(_vc "vc7") - elseif(MSVC80) - set(_vc "vc8") - endif() - if(CMAKE_SIZEOF_VOID_P MATCHES "8") - # 64-bit - list_combinations(_libsearch - PREFIXES - "${OPENHAPTICS_ROOT_DIR}" - ${_dirs} - SUFFIXES - "/lib/x64") - list_combinations(_libsearch2 - PREFIXES - "${OPENHAPTICS_ROOT_DIR}" - ${_dirs} - SUFFIXES - "/utilities/lib/x64") - else() - # 32-bit - list_combinations(_libsearch - PREFIXES - "${OPENHAPTICS_ROOT_DIR}" - ${_dirs} - SUFFIXES - "/lib" - "/lib/win32") - list_combinations(_libsearch2 - PREFIXES - "${OPENHAPTICS_ROOT_DIR}" - ${_dirs} - SUFFIXES - "/utilities/lib/Win32" - "/utilities/lib" - "/utilities/lib/${_vc}") - endif() - - clean_directory_list(_libsearchdirs ${_libsearch} ${_libsearch2}) -endif() - -list_combinations(_incsearch - PREFIXES - "${OPENHAPTICS_ROOT_DIR}" - ${_dirs} - SUFFIXES - "/include") -list_combinations(_incsearch2 - PREFIXES - "${OPENHAPTICS_ROOT_DIR}" - ${_dirs} - SUFFIXES - "/utilities/include") -clean_directory_list(_incsearchdirs ${_incsearch} ${_incsearch2}) - -set(_deps_check) -set(_deps_libs) - -### -# HDAPI: HD -### - -if(UNIX) - find_library(HDAPI_PHANToMIO_LIBRARY - NAMES - PHANToMIO - HINTS - ${_libsearchdirs}) - mark_as_advanced(HDAPI_PHANToMIO_LIBRARY) - list(APPEND _deps_check HDAPI_PHANToMIO_LIBRARY) - list(APPEND _deps_libs "${HDAPI_PHANToMIO_LIBRARY}") -endif() - -find_path(HDAPI_INCLUDE_DIR - NAMES - HD/hd.h - HINTS - ${_incsearchdirs}) - -find_library(HDAPI_LIBRARY_RELEASE - NAMES - HD - PATH_SUFFIXES - ReleaseAcademicEdition - Release - HINTS - ${_libsearchdirs}) - -find_library(HDAPI_LIBRARY_DEBUG - NAMES - HD - PATH_SUFFIXES - DebugAcademicEdition - Debug - HINTS - ${_libsearchdirs}) - -select_library_configurations(HDAPI) - -### -# HDAPI: HDU -### -find_path(HDAPI_HDU_INCLUDE_DIR - NAMES - HDU/hdu.h - HINTS - ${_incsearchdirs}) - -find_library(HDAPI_HDU_LIBRARY_RELEASE - NAMES - HDU - PATH_SUFFIXES - ReleaseAcademicEdition - Release - HINTS - ${_libsearchdirs}) - -find_library(HDAPI_HDU_LIBRARY_DEBUG - NAMES - HDU - PATH_SUFFIXES - DebugAcademicEdition - Debug - HINTS - ${_libsearchdirs}) - -# Fallback -find_library(HDAPI_HDU_LIBRARY_DEBUG - NAMES - HDUD - PATH_SUFFIXES - DebugAcademicEdition - Debug - HINTS - ${_libsearchdirs}) - -select_library_configurations(HDAPI_HDU) - -if(OPENHAPTICS_NESTED_TARGETS OR NOT HDAPI_HDU_LIBRARY) - if(HDAPI_HDU_SOURCE_DIR AND NOT EXISTS "${HDAPI_HDU_SOURCE_DIR}/hdu.cpp") - unset(HDAPI_HDU_SOURCE_DIR) - endif() - find_path(HDAPI_HDU_SOURCE_DIR - NAMES - hdu.cpp - PATH_SUFFIXES - src - src/HDU - src/HDU/src - libsrc/HDU - HINTS - "${HDAPI_HDU_INCLUDE_DIR}/.." - "${HDAPI_HDU_INCLUDE_DIR}/../share/3DTouch") - list(APPEND _deps_check HDAPI_HDU_SOURCE_DIR) - if(HDAPI_HDU_SOURCE_DIR) - mark_as_advanced(HDAPI_HDU_SOURCE_DIR) - set(_nest_targets YES) - set(HDAPI_HDU_LIBRARY - "openhaptics_hdu_nested_target" - CACHE - STRING - "We will build the OpenHaptics HDU lib." - FORCE) - set(HDAPI_HDU_LIBRARIES ${HDAPI_HDU_LIBRARY}) - endif() -endif() - - -### -# HLAPI: HL -### -find_path(HLAPI_INCLUDE_DIR - NAMES - HL/hl.h - HINTS - ${_incsearchdirs}) - -find_library(HLAPI_LIBRARY_RELEASE - NAMES - HL - PATH_SUFFIXES - ReleaseAcademicEdition - Release - HINTS - ${_libsearchdirs}) - -find_library(HLAPI_LIBRARY_DEBUG - NAMES - HL - PATH_SUFFIXES - DebugAcademicEdition - Debug - HINTS - ${_libsearchdirs}) - -select_library_configurations(HLAPI) - -### -# HLAPI: HLU -### -find_path(HLAPI_HLU_INCLUDE_DIR - NAMES - HLU/hlu.h - HINTS - ${_incsearchdirs}) - -find_library(HLAPI_HLU_LIBRARY_RELEASE - NAMES - HLU - PATH_SUFFIXES - ReleaseAcademicEdition - Release - HINTS - ${_libsearchdirs}) - -find_library(HLAPI_HLU_LIBRARY_DEBUG - NAMES - HLU - PATH_SUFFIXES - DebugAcademicEdition - Debug - HINTS - ${_libsearchdirs}) - -# fallback -find_library(HLAPI_HLU_LIBRARY_DEBUG - NAMES - HLUD - PATH_SUFFIXES - DebugAcademicEdition - Debug - HINTS - ${_libsearchdirs}) - -select_library_configurations(HLAPI_HLU) - -if(OPENHAPTICS_NESTED_TARGETS OR NOT HLAPI_HLU_LIBRARY) - if(HLAPI_HLU_SOURCE_DIR AND NOT EXISTS "${HLAPI_HLU_SOURCE_DIR}/hlu.cpp") - unset(HLAPI_HLU_SOURCE_DIR) - endif() - find_path(HLAPI_HLU_SOURCE_DIR - NAMES - hlu.cpp - PATH_SUFFIXES - src - src/HLU - src/HLU/src - libsrc/HLU - HINTS - "${HLAPI_HLU_INCLUDE_DIR}/.." - "${HLAPI_HLU_INCLUDE_DIR}/../share/3DTouch") - list(APPEND _deps_check HLAPI_HLU_SOURCE_DIR) - if(HLAPI_HLU_SOURCE_DIR) - mark_as_advanced(HLAPI_HLU_SOURCE_DIR) - set(_nest_targets YES) - set(HLAPI_HLU_LIBRARY - "openhaptics_hlu_nested_target" - CACHE - STRING - "We will build the OpenHaptics HLU lib." - FORCE) - set(HLAPI_HLU_LIBRARIES ${HLAPI_HLU_LIBRARY}) - endif() -endif() - -### -# Add dependencies: Libraries -### -set(HDAPI_LIBRARIES "${HDAPI_LIBRARY}" ${_deps_libs}) - -if(HDAPI_HDU_LIBRARIES AND HDAPI_LIBRARIES) - list(APPEND HDAPI_HDU_LIBRARIES ${HDAPI_LIBRARIES}) -else() - set(HDAPI_HDU_LIBRARIES) -endif() - -if(HLAPI_LIBRARY AND HDAPI_LIBRARIES) - set(HLAPI_LIBRARIES ${HLAPI_LIBRARY} ${HDAPI_LIBRARIES}) -else() - set(HLAPI_LIBRARIES) -endif() - -if(HLAPI_HLU_LIBRARIES AND HLAPI_LIBRARIES) - list(APPEND HLAPI_HLU_LIBRARIES ${HLAPI_LIBRARIES}) -else() - set(HLAPI_HLU_LIBRARIES) -endif() - -### -# Add dependencies: Include dirs -### -if(HDAPI_INCLUDE_DIR) - set(HDAPI_INCLUDE_DIRS ${HDAPI_INCLUDE_DIR}) - - if(HDAPI_HDU_INCLUDE_DIR) - set(HDAPI_HDU_INCLUDE_DIRS - ${HDAPI_INCLUDE_DIRS} - ${HDAPI_HDU_INCLUDE_DIR}) - - if(HDAPI_HDU_INCLUDE_DIR) - set(HLAPI_INCLUDE_DIRS ${HDAPI_INCLUDE_DIRS} ${HLAPI_INCLUDE_DIR}) - - if(HLAPI_HLU_INCLUDE_DIR) - set(HLAPI_HLU_INCLUDE_DIRS - ${HLAPI_INCLUDE_DIRS} - ${HLAPI_HLU_INCLUDE_DIR}) - - endif() - endif() - endif() -endif() - -# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(OpenHaptics - DEFAULT_MSG - HDAPI_LIBRARY - HDAPI_INCLUDE_DIR - HDAPI_HDU_INCLUDE_DIR - HDAPI_HDU_LIBRARY - HLAPI_INCLUDE_DIR - HLAPI_LIBRARY - HLAPI_HLU_INCLUDE_DIR - HLAPI_HLU_LIBRARY - ${_deps_check}) - -if(OPENHAPTICS_FOUND) - # Recurse into the nested targets subdirectory if needed - if(_nest_targets) - get_filename_component(_moddir "${CMAKE_CURRENT_LIST_FILE}" PATH) - add_subdirectory("${_moddir}/nested_targets/OpenHaptics" "OpenHapticsNestedTargets") - endif() - - set(OPENHAPTICS_LIBRARIES - ${HDAPI_LIBRARY} - ${HDAPI_HDU_LIBRARY} - ${HLAPI_LIBRARY} - ${HLAPI_HLU_LIBRARY}) - set(OPENHAPTICS_LIBRARY_DIRS) - foreach(_lib - ${_deps_check} - HDAPI_LIBRARY_RELEASE - HDAPI_LIBRARY_DEBUG - HDAPI_HDU_LIBRARY_RELEASE - HDAPI_HDU_LIBRARY_DEBUG - HLAPI_LIBRARY_RELEASE - HLAPI_LIBRARY_DEBUG - HLAPI_HLU_LIBRARY_RELEASE - HLAPI_HLU_LIBRARY_DEBUG) - get_filename_component(_libdir ${${_lib}} PATH) - list(APPEND OPENHAPTICS_LIBRARY_DIRS ${_libdir}) - endforeach() - - set(OPENHAPTICS_INCLUDE_DIRS - ${HLAPI_HLU_INCLUDE_DIRS} - ${HDAPI_HDU_INCLUDE_DIRS}) - - clean_directory_list(OPENHAPTICS_LIBRARY_DIRS) - clean_directory_list(OPENHAPTICS_INCLUDE_DIRS) - - list(APPEND - OPENHAPTICS_RUNTIME_LIBRARY_DIRS - ${OPENHAPTICS_LIBRARY_DIRS}) - - clean_library_list(OPENHAPTICS_LIBRARIES) - - mark_as_advanced(OPENHAPTICS_ROOT_DIR) -endif() - -mark_as_advanced(HDAPI_INCLUDE_DIR - HDAPI_LIBRARY_RELEASE - HDAPI_LIBRARY_DEBUG - HDAPI_HDU_INCLUDE_DIR - HDAPI_HDU_LIBRARY_RELEASE - HDAPI_HDU_LIBRARY_DEBUG - HLAPI_INCLUDE_DIR - HLAPI_LIBRARY_RELEASE - HLAPI_LIBRARY_DEBUG - HLAPI_HLU_INCLUDE_DIR - HLAPI_HLU_LIBRARY_RELEASE - HLAPI_HLU_LIBRARY_DEBUG) diff --git a/src/vrpn/cmake/FindPerlModules.cmake b/src/vrpn/cmake/FindPerlModules.cmake deleted file mode 100644 index f09ff851d1191c6b8fff26126ea24334794a51b4..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindPerlModules.cmake +++ /dev/null @@ -1,78 +0,0 @@ -# - try to find perl modules, passed as COMPONENTS -# -# Non-cache variable you might use in your CMakeLists.txt: -# PERLMODULES_FOUND -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2012. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(NOT PERL_FOUND) - find_package(Perl QUIET) -endif() - -set(_deps_check) -if(PERL_FOUND) - foreach(module ${PerlModules_FIND_COMPONENTS}) - string(REPLACE "::" "/" modfilename "${module}.pm") - string(REPLACE "::" "_" modvarname "PERLMODULES_${module}_MODULE") - string(TOUPPER "${modvarname}" modvarname) - list(APPEND _deps_check ${modvarname}) - if(NOT ${modvarname}) - if(NOT PerlModules_FIND_QUIETLY) - message(STATUS "Checking for perl module ${module}") - endif() - execute_process(COMMAND - "${PERL_EXECUTABLE}" - "-e" - "use ${module}; print \$INC{\"${modfilename}\"}" - RESULT_VARIABLE result_code - OUTPUT_VARIABLE filename - ERROR_VARIABLE error_info - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(result_code EQUAL 0) - if(NOT PerlModules_FIND_QUIETLY) - message(STATUS - "Checking for perl module ${module} - found at ${filename}") - endif() - set(${modvarname} - "${filename}" - CACHE - FILEPATH - "Location found for module ${module}" - FORCE) - mark_as_advanced(${modvarname}) - else() - if(NOT PerlModules_FIND_QUIETLY) - message(STATUS "Checking for perl module ${module} - failed") - endif() - set(${modvarname} - "NOTFOUND" - CACHE - FILEPATH - "No location found for module ${module}" - FORCE) - file(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the Perl module ${module} exists failed with the following error output:\n" - "${error_info}\n\n") - endif() - endif() - endforeach() -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(PerlModules - DEFAULT_MSG - PERL_FOUND - ${_deps_check}) - diff --git a/src/vrpn/cmake/FindVRPN.cmake b/src/vrpn/cmake/FindVRPN.cmake deleted file mode 100644 index 8391b61d17c3aa34dc5249bdcddfbbc24626d89b..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindVRPN.cmake +++ /dev/null @@ -1,142 +0,0 @@ -# - try to find VRPN library -# -# Cache Variables: -# VRPN_LIBRARY -# VRPN_SERVER_LIBRARY -# VRPN_INCLUDE_DIR -# -# Non-cache variables you might use in your CMakeLists.txt: -# VRPN_FOUND -# VRPN_SERVER_LIBRARIES - server libraries -# VRPN_LIBRARIES - client libraries -# VRPN_CLIENT_DEFINITIONS - definitions if you only use the client library -# VRPN_DEFINITIONS - Client-only definition if all we found was the client library. -# VRPN_INCLUDE_DIRS -# -# VRPN_ROOT_DIR is searched preferentially for these files -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2009-2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2012. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(VRPN_ROOT_DIR - "${VRPN_ROOT_DIR}" - CACHE - PATH - "Root directory to search for VRPN") - -if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8") - set(_libsuffixes lib64 lib) - - # 64-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _progfiles) -else() - set(_libsuffixes lib) - if(NOT "$ENV{ProgramFiles(x86)}" STREQUAL "") - # 32-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles(x86)}" _progfiles) - else() - # 32-bit dir on win32, useless to us on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _progfiles) - endif() -endif() - -### -# Configure VRPN -### - -find_path(VRPN_INCLUDE_DIR - NAMES - vrpn_Connection.h - PATH_SUFFIXES - include - include/vrpn - HINTS - "${VRPN_ROOT_DIR}" - PATHS - "${_progfiles}/VRPN" - C:/usr/local - /usr/local) - -find_library(VRPN_LIBRARY - NAMES - vrpn - PATH_SUFFIXES - ${_libsuffixes} - HINTS - "${VRPN_ROOT_DIR}" - PATHS - "${_progfiles}/VRPN" - C:/usr/local - /usr/local) - -find_library(VRPN_SERVER_LIBRARY - NAMES - vrpnserver - PATH_SUFFIXES - ${_libsuffixes} - HINTS - "${VRPN_ROOT_DIR}" - PATHS - "${_progfiles}/VRPN" - C:/usr/local - /usr/local) - -### -# Dependencies -### -set(_deps_libs) -set(_deps_includes) -set(_deps_check) - -find_package(quatlib) -list(APPEND _deps_libs ${QUATLIB_LIBRARIES}) -list(APPEND _deps_includes ${QUATLIB_INCLUDE_DIRS}) -list(APPEND _deps_check QUATLIB_FOUND) - -if(NOT WIN32) - find_package(Threads) - list(APPEND _deps_libs ${CMAKE_THREAD_LIBS_INIT}) - list(APPEND _deps_check CMAKE_HAVE_THREADS_LIBRARY) -endif() - - -# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(VRPN - DEFAULT_MSG - VRPN_LIBRARY - VRPN_INCLUDE_DIR - ${_deps_check}) - -if(VRPN_FOUND) - set(VRPN_INCLUDE_DIRS "${VRPN_INCLUDE_DIR}" ${_deps_includes}) - set(VRPN_LIBRARIES "${VRPN_LIBRARY}" ${_deps_libs}) - set(VRPN_SERVER_LIBRARIES "${VRPN_SERVER_LIBRARY}" ${_deps_libs}) - - if(VRPN_LIBRARY) - set(VRPN_CLIENT_DEFINITIONS -DVRPN_CLIENT_ONLY) - else() - unset(VRPN_CLIENT_DEFINITIONS) - endif() - - if(VRPN_LIBRARY AND NOT VRPN_SERVER_LIBRARY) - set(VRPN_DEFINITIONS -DVRPN_CLIENT_ONLY) - else() - unset(VRPN_DEFINITIONS) - endif() - - mark_as_advanced(VRPN_ROOT_DIR) -endif() - -mark_as_advanced(VRPN_LIBRARY VRPN_SERVER_LIBRARY VRPN_INCLUDE_DIR) diff --git a/src/vrpn/cmake/FindViewPoint.cmake b/src/vrpn/cmake/FindViewPoint.cmake deleted file mode 100644 index a18b6145d673ae6b80528729a433771ba16db89a..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindViewPoint.cmake +++ /dev/null @@ -1,94 +0,0 @@ -# - try to find Arrington Research ViewPoint EyeTracker SDK -# -# Cache Variables: (probably not for direct use in your scripts) -# VIEWPOINT_INCLUDE_DIR -# VIEWPOINT_LIBRARY -# VIEWPOINT_RUNTIME_LIBRARY -# -# Non-cache variables you might use in your CMakeLists.txt: -# VIEWPOINT_FOUND -# VIEWPOINT_INCLUDE_DIRS -# VIEWPOINT_LIBRARIES -# VIEWPOINT_RUNTIME_LIBRARIES - aka the dll for installing -# VIEWPOINT_RUNTIME_LIBRARY_DIRS -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2012. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(VIEWPOINT_ROOT_DIR - "${VIEWPOINT_ROOT_DIR}" - CACHE - PATH - "Directory to search for Arrington Research ViewPoint EyeTracker SDK") - -if(CMAKE_SIZEOF_VOID_P MATCHES "8") - set(_LIBSUFFIXES /lib64 /lib) -else() - set(_LIBSUFFIXES /lib) -endif() - -find_library(VIEWPOINT_LIBRARY - NAMES - VPX_InterApp - PATHS - "${VIEWPOINT_ROOT_DIR}" - PATH_SUFFIXES - "${_LIBSUFFIXES}") - -get_filename_component(_libdir "${VIEWPOINT_LIBRARY}" PATH) - -find_path(VIEWPOINT_INCLUDE_DIR - NAMES - vpx.h - HINTS - "${_libdir}" - PATHS - "${VIEWPOINT_ROOT_DIR}" - PATH_SUFFIXES - include/) - -set(_deps_check) -if(WIN32) - find_file(VIEWPOINT_RUNTIME_LIBRARY - NAMES - VPX_InterApp.dll - HINTS - "${_libdir}") - - set(VIEWPOINT_RUNTIME_LIBRARIES "${VIEWPOINT_RUNTIME_LIBRARY}") - get_filename_component(VIEWPOINT_RUNTIME_LIBRARY_DIRS - "${VIEWPOINT_RUNTIME_LIBRARY}" - PATH) - list(APPEND _deps_check VIEWPOINT_RUNTIME_LIBRARY) -else() - get_filename_component(VIEWPOINT_RUNTIME_LIBRARY_DIRS - "${VIEWPOINT_LIBRARY}" - PATH) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(ViewPoint - DEFAULT_MSG - VIEWPOINT_LIBRARY - VIEWPOINT_INCLUDE_DIR - ${_deps_check}) - -if(VIEWPOINT_FOUND) - set(VIEWPOINT_LIBRARIES "${VIEWPOINT_LIBRARY}") - set(VIEWPOINT_INCLUDE_DIRS "${VIEWPOINT_INCLUDE_DIR}") - mark_as_advanced(VIEWPOINT_ROOT_DIR) -endif() - -mark_as_advanced(VIEWPOINT_INCLUDE_DIR - VIEWPOINT_LIBRARY - VIEWPOINT_RUNTIME_LIBRARY) diff --git a/src/vrpn/cmake/FindWiiUse.cmake b/src/vrpn/cmake/FindWiiUse.cmake deleted file mode 100644 index 2657cbb6008e2a90677938947631d98978ce548a..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindWiiUse.cmake +++ /dev/null @@ -1,99 +0,0 @@ -# - try to find WiiUse library -# -# Cache Variables: (probably not for direct use in your scripts) -# WIIUSE_INCLUDE_DIR -# WIIUSE_LIBRARY -# -# Non-cache variables you might use in your CMakeLists.txt: -# WIIUSE_FOUND -# WIIUSE_INCLUDE_DIRS -# WIIUSE_LIBRARIES -# WIIUSE_RUNTIME_LIBRARIES - aka the dll for installing -# WIIUSE_RUNTIME_LIBRARY_DIRS -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(WIIUSE_ROOT_DIR - "${WIIUSE_ROOT_DIR}" - CACHE - PATH - "Directory to search for WiiUse") - -if(CMAKE_SIZEOF_VOID_P MATCHES "8") - set(_LIBSUFFIXES /lib64 /lib) -else() - set(_LIBSUFFIXES /lib) -endif() - -find_library(WIIUSE_LIBRARY - NAMES - wiiuse - PATHS - "${WIIUSE_ROOT_DIR}" - PATH_SUFFIXES - "${_LIBSUFFIXES}") - -get_filename_component(_libdir "${WIIUSE_LIBRARY}" PATH) - -find_path(WIIUSE_INCLUDE_DIR - NAMES - wiiuse.h - HINTS - "${_libdir}" - "${_libdir}/.." - PATHS - "${WIIUSE_ROOT_DIR}" - PATH_SUFFIXES - include/) - -set(_deps_check) -if(WIN32) - find_file(WIIUSE_RUNTIME_LIBRARY - NAMES - wiiuse.dll - HINTS - "${_libdir}" - "${_libdir}/.." - PATH_SUFFIXES - bin) - - set(WIIUSE_RUNTIME_LIBRARIES "${WIIUSE_RUNTIME_LIBRARY}") - get_filename_component(WIIUSE_RUNTIME_LIBRARY_DIRS - "${WIIUSE_RUNTIME_LIBRARY}" - PATH) - list(APPEND _deps_check WIIUSE_RUNTIME_LIBRARY) -else() - set(WIIUSE_RUNTIME_LIBRARY "${WIIUSE_LIBRARY}") - set(WIIUSE_RUNTIME_LIBRARIES "${WIIUSE_RUNTIME_LIBRARY}") - get_filename_component(WIIUSE_RUNTIME_LIBRARY_DIRS - "${WIIUSE_LIBRARY}" - PATH) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(WiiUse - DEFAULT_MSG - WIIUSE_LIBRARY - WIIUSE_INCLUDE_DIR - ${_deps_check}) - -if(WIIUSE_FOUND) - set(WIIUSE_LIBRARIES "${WIIUSE_LIBRARY}") - set(WIIUSE_INCLUDE_DIRS "${WIIUSE_INCLUDE_DIR}") - mark_as_advanced(WIIUSE_ROOT_DIR) -endif() - -mark_as_advanced(WIIUSE_INCLUDE_DIR - WIIUSE_LIBRARY - WIIUSE_RUNTIME_LIBRARY) diff --git a/src/vrpn/cmake/FindWinHID.cmake b/src/vrpn/cmake/FindWinHID.cmake deleted file mode 100644 index 4445c0dacedb417cbaa0a53437d10b2c38d0acc2..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindWinHID.cmake +++ /dev/null @@ -1,189 +0,0 @@ -# - try to find Windows HID support, part of the WDK/DDK -# -# Cache Variables: (probably not for direct use in your scripts) -# WINHID_INCLUDE_DIR -# WINHID_CRT_INCLUDE_DIR -# WINHID_LIBRARY -# -# Non-cache variables you might use in your CMakeLists.txt: -# WINHID_FOUND -# WINHID_INCLUDE_DIRS -# WINHID_LIBRARIES -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# PrefixListGlob -# CleanDirectoryList -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(NOT WIN32) - find_package_handle_standard_args(WinHID - "Skipping search for Windows HID on non-Windows platform" - WIN32) - return() -endif() -if(MSVC) - if( (NOT WINHID_ROOT_DIR) AND (NOT ENV{DDKROOT} STREQUAL "") ) - set(WINHID_ROOT_DIR "$ENV{DDKROOT}") - endif() -endif() -set(WINHID_ROOT_DIR - "${WINHID_ROOT_DIR}" - CACHE - PATH - "Directory to search") - -if(CMAKE_SIZEOF_VOID_P MATCHES "8") - set(_arch amd64) # what the architecture used to be called - set(_arch8 x64) # what the WDK for Win8+ calls this architecture -else() - set(_arch i386) # what the architecture used to be called - set(_arch8 x86) # what the WDK for Win8+ calls this architecture -endif() - -set(_deps_check) -set(_need_crt_dir) -if(MSVC) - include(PrefixListGlob) - include(CleanDirectoryList) - prefix_list_glob(_prefixed - "*/" - "$ENV{SYSTEMDRIVE}/WinDDK/" - "$ENV{ProgramFiles}/Windows Kits/" - "c:/WinDDK/") - clean_directory_list(_prefixed) - find_library(WINHID_LIBRARY - NAMES - hid - libhid - HINTS - "${WINHID_ROOT_DIR}" - ${_prefixed} - PATH_SUFFIXES - "lib/w2k/${_arch}" # Win2k min requirement - "lib/wxp/${_arch}" # WinXP min requirement - "lib/wnet/${_arch}" # Win Server 2003 min requirement - "lib/wlh/${_arch}" # Win Vista ("Long Horn") min requirement - "lib/wlh/um/${_arch8}" # Win Vista ("Long Horn") min requirement - "lib/win7/${_arch}" # Win 7 min requirement - "lib/win7/um/${_arch8}" # Win 7 min requirement - "lib/win8/${_arch}" # Win 8 min requirement - "lib/win8/um/${_arch8}" # Win 8 min requirement - ) - # Might want to look close to the library first for the includes. - if(WINHID_LIBRARY) - set(_prevdir) - get_filename_component(_basedir "${WINHID_LIBRARY}" PATH) - while(NOT IS_DIRECTORY "${_basedir}/lib" AND NOT (_basedir STREQUAL _prevdir)) - set(_prevdir "${_basedir}") - get_filename_component(_basedir "${_basedir}/.." ABSOLUTE) - endwhile() - endif() - - if(WINHID_LIBRARY AND EXISTS "${_basedir}/inc") - find_path(WINHID_CRT_INCLUDE_DIR # otherwise you get weird compile errors - NAMES - stdio.h - HINTS - "${_basedir}" - PATHS - "${WINHID_ROOT_DIR}" - PATH_SUFFIXES - inc/crt - NO_DEFAULT_PATH) - list(APPEND _deps_check WINHID_CRT_INCLUDE_DIR) - set(_need_crt_dir ON) - endif() - - find_path(WINHID_INCLUDE_DIR - NAMES - hidsdi.h - HINTS - "${_basedir}" - PATHS - "${WINHID_ROOT_DIR}" - PATH_SUFFIXES - inc/ddk - inc/api - inc/w2k - inc/wxp - inc/wnet - include/shared) -else() - find_library(WINHID_LIBRARY - NAMES - libhid - HINTS - "${WINHID_ROOT_DIR}" - /mingw - PATH_SUFFIXES - lib - lib/w32api) - find_path(WINHID_INCLUDE_DIR - NAMES - hidsdi.h - PATHS - "${WINHID_ROOT_DIR}" - /mingw - PATH_SUFFIXES - include/w32api/ddk - include/ddk - ddk) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(WinHID - DEFAULT_MSG - WINHID_LIBRARY - WINHID_INCLUDE_DIR - ${_deps_check}) - -if(WINHID_FOUND) - if(MSVC) - set(_winreq "Unknown") - if(WINHID_LIBRARY MATCHES "lib/w2k") - set(_winreq "Windows 2000") - elseif(WINHID_LIBRARY MATCHES "lib/wxp") - set(_winreq "Windows XP") - elseif(WINHID_LIBRARY MATCHES "lib/wnet") - set(_winreq "Windows Server 2003") - elseif(WINHID_LIBRARY MATCHES "lib/wlh") - set(_winreq "Windows Vista") - elseif(WINHID_LIBRARY MATCHES "lib/win7") - set(_winreq "Windows 7") - elseif(WINHID_LIBRARY MATCHES "lib/win8") - set(_winreq "Windows 8 (Possibly?)") - endif() - if(NOT "${WINHID_MIN_WINDOWS_VER}" STREQUAL "${_winreq}") - if(NOT WinHID_FIND_QUIETLY) - message(STATUS - "Linking against WINHID_LIBRARY will enforce this minimum version: ${_winreq}") - endif() - set(WINHID_MIN_WINDOWS_VER "${_winreq}" CACHE INTERNAL "" FORCE) - endif() - endif() - set(WINHID_LIBRARIES "${WINHID_LIBRARY}") - if(_need_crt_dir) - set(WINHID_INCLUDE_DIRS - "${WINHID_CRT_INCLUDE_DIR}" - "${WINHID_INCLUDE_DIR}") - else() - # Don't need that CRT include dir for WDK 8+ - set(WINHID_INCLUDE_DIRS - "${WINHID_INCLUDE_DIR}") - endif() - mark_as_advanced(WINHID_ROOT_DIR) -endif() - -mark_as_advanced(WINHID_INCLUDE_DIR - WINHID_CRT_INCLUDE_DIR - WINHID_LIBRARY) diff --git a/src/vrpn/cmake/FindWindowsSDK.cmake b/src/vrpn/cmake/FindWindowsSDK.cmake deleted file mode 100644 index 665a87f04aab968aa0e6dee04fc3396d955c6d74..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/FindWindowsSDK.cmake +++ /dev/null @@ -1,322 +0,0 @@ -# - Find the Windows SDK aka Platform SDK -# -# Relevant Wikipedia article: http://en.wikipedia.org/wiki/Microsoft_Windows_SDK -# -# Variables: -# WINDOWSSDK_FOUND - if any version of the windows or platform SDK was found that is usable with the current version of visual studio -# WINDOWSSDK_LATEST_DIR -# WINDOWSSDK_LATEST_NAME -# WINDOWSSDK_FOUND_PREFERENCE - if we found an entry indicating a "preferred" SDK listed for this visual studio version -# WINDOWSSDK_PREFERRED_DIR -# WINDOWSSDK_PREFERRED_NAME -# -# WINDOWSSDK_DIRS - contains no duplicates, ordered most recent first. -# WINDOWSSDK_PREFERRED_FIRST_DIRS - contains no duplicates, ordered with preferred first, followed by the rest in descending recency -# -# Functions: -# windowssdk_name_lookup(<directory> <output variable>) - Find the name corresponding with the SDK directory you pass in, or -# NOTFOUND if not recognized. Your directory must be one of WINDOWSSDK_DIRS for this to work. -# -# get_windowssdk_from_component(<file or dir> <output variable>) - Given a library or include dir, -# find the Windows SDK root dir corresponding to it, or NOTFOUND if unrecognized. -# -# get_windowssdk_library_dirs(<directory> <output variable>) - Find the architecture-appropriate -# library directories corresponding to the SDK directory you pass in (or NOTFOUND if none) -# -# get_windowssdk_include_dirs(<directory> <output variable>) - Find the -# include directories corresponding to the SDK directory you pass in (or NOTFOUND if none) -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2012 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2012. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(_preferred_sdk_dirs) -set(_win_sdk_dirs) -set(_win_sdk_versanddirs) -if(MSVC_VERSION GREATER 1310) # Newer than VS .NET/VS Toolkit 2003 - - # Environment variable for SDK dir - if(EXISTS "$ENV{WindowsSDKDir}" AND (NOT "$ENV{WindowsSDKDir}" STREQUAL "")) - message(STATUS "Got $ENV{WindowsSDKDir} - Windows/Platform SDK directories: ${_win_sdk_dirs}") - list(APPEND _preferred_sdk_dirs "$ENV{WindowsSDKDir}") - endif() - - if(MSVC_VERSION LESS 1600) - # Per-user current Windows SDK for VS2005/2008 - get_filename_component(_sdkdir - "[HKEY_CURRENT_USER\\Software\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" - ABSOLUTE) - if(EXISTS "${_sdkdir}") - list(APPEND _preferred_sdk_dirs "${_sdkdir}") - endif() - - # System-wide current Windows SDK for VS2005/2008 - get_filename_component(_sdkdir - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" - ABSOLUTE) - if(EXISTS "${_sdkdir}") - list(APPEND _preferred_sdk_dirs "${_sdkdir}") - endif() - endif() - - if(MSVC_VERSION LESS 1700) - # VC 10 and older has broad target support - set(_winsdk_vistaonly) - else() - # VC 11 by default targets Vista and later only, so we can add a few more SDKs that (might?) only work on vista+ - if("${CMAKE_VS_PLATFORM_TOOLSET}" MATCHES "_xp") - # This is the XP-compatible v110 toolset - elseif("${CMAKE_VS_PLATFORM_TOOLSET}" STREQUAL "v100") - # This is the VS2010 toolset - else() - if(NOT WINDOWSSDK_FOUND AND NOT WindowsSDK_FIND_QUIETLY) - message(STATUS "FindWindowsSDK: Detected Visual Studio 2012 or newer, not using the _xp toolset variant: including SDK versions that drop XP support in search!") - endif() - # These versions have no XP (and possibly Vista pre-SP1) support - set(_winsdk_vistaonly) - if(NOT MSVC_VERSION LESS 1800) - list(APPEND _winsdk_vistaonly - # Windows Software Development Kit (SDK) for Windows 8.1 - # http://msdn.microsoft.com/en-gb/windows/desktop/bg162891 - v8.1) - endif() - list(APPEND _winsdk_vistaonly - # Included in Visual Studio 2012 - v8.0A - - # Microsoft Windows SDK for Windows 8 and .NET Framework 4.5 - # This is the first version to also include the DirectX SDK - # http://msdn.microsoft.com/en-US/windows/desktop/hh852363.aspx - v8.0 - - # Microsoft Windows SDK for Windows 7 and .NET Framework 4 - # http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b - v7.1 - ) - endif() - endif() - foreach(_winsdkver - ${_winsdk_vistaonly} - - # Included in Visual Studio 2013 - # Includes the v120_xp toolset - v8.1A - - # Included with VS 2012 Update 1 or later - # Introduces v110_xp toolset - v7.1A - - # Included with VS 2010 - v7.0A - - # Windows SDK for Windows 7 and .NET Framework 3.5 SP1 - # Works with VC9 - #http://www.microsoft.com/en-us/download/details.aspx?id=18950 - v7.0 - - # Two versions call themselves "v6.1": - # Older: - # Windows Vista Update & .NET 3.0 SDK - # http://www.microsoft.com/en-us/download/details.aspx?id=14477 - - # Newer: - # Windows Server 2008 & .NET 3.5 SDK - # may have broken VS9SP1? they recommend v7.0 instead, or a KB... - # http://www.microsoft.com/en-us/download/details.aspx?id=24826 - v6.1 - - # Included in VS 2008 - v6.0A - - # Microsoft Windows Software Development Kit for Windows Vista and .NET Framework 3.0 Runtime Components - # http://blogs.msdn.com/b/stanley/archive/2006/11/08/microsoft-windows-software-development-kit-for-windows-vista-and-net-framework-3-0-runtime-components.aspx - v6.0) - - get_filename_component(_sdkdir - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\${_winsdkver};InstallationFolder]" - ABSOLUTE) - if(EXISTS "${_sdkdir}") - list(APPEND _win_sdk_dirs "${_sdkdir}") - list(APPEND - _win_sdk_versanddirs - "Windows SDK ${_winsdkver}" - "${_sdkdir}") - endif() - endforeach() -endif() -if(MSVC_VERSION GREATER 1200) - foreach(_platformsdkinfo - "D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1_Microsoft Platform SDK for Windows Server 2003 R2" - "8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3_Microsoft Platform SDK for Windows Server 2003 SP1") - string(SUBSTRING "${_platformsdkinfo}" 0 36 _platformsdkguid) - string(SUBSTRING "${_platformsdkinfo}" 37 -1 _platformsdkname) - foreach(HIVE HKEY_LOCAL_MACHINE HKEY_CURRENT_USER) - get_filename_component(_sdkdir - "[${HIVE}\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\${_platformsdkguid};Install Dir]" - ABSOLUTE) - if(EXISTS "${_sdkdir}") - list(APPEND _win_sdk_dirs "${_sdkdir}") - list(APPEND _win_sdk_versanddirs "${_platformsdkname}" "${_sdkdir}") - endif() - endforeach() - endforeach() -endif() - -set(_win_sdk_versanddirs - "${_win_sdk_versanddirs}" - CACHE - INTERNAL - "mapping between windows sdk version locations and names" - FORCE) - -function(windowssdk_name_lookup _dir _outvar) - list(FIND _win_sdk_versanddirs "${_dir}" _diridx) - math(EXPR _nameidx "${_diridx} - 1") - if(${_nameidx} GREATER -1) - list(GET _win_sdk_versanddirs ${_nameidx} _sdkname) - else() - set(_sdkname "NOTFOUND") - endif() - set(${_outvar} "${_sdkname}" PARENT_SCOPE) -endfunction() - -if(_win_sdk_dirs) - # Remove duplicates - list(REMOVE_DUPLICATES _win_sdk_dirs) - list(GET _win_sdk_dirs 0 WINDOWSSDK_LATEST_DIR) - windowssdk_name_lookup("${WINDOWSSDK_LATEST_DIR}" - WINDOWSSDK_LATEST_NAME) - set(WINDOWSSDK_DIRS ${_win_sdk_dirs}) -endif() -if(_preferred_sdk_dirs) - list(GET _preferred_sdk_dirs 0 WINDOWSSDK_PREFERRED_DIR) - windowssdk_name_lookup("${WINDOWSSDK_LATEST_DIR}" - WINDOWSSDK_PREFERRED_NAME) - set(WINDOWSSDK_PREFERRED_FIRST_DIRS - ${_preferred_sdk_dirs} - ${_win_sdk_dirs}) - list(REMOVE_DUPLICATES WINDOWSSDK_PREFERRED_FIRST_DIRS) - set(WINDOWSSDK_FOUND_PREFERENCE ON) - - # In case a preferred dir was found that isn't found otherwise - #set(WINDOWSSDK_DIRS ${WINDOWSSDK_DIRS} ${WINDOWSSDK_PREFERRED_FIRST_DIRS}) - #list(REMOVE_DUPLICATES WINDOWSSDK_DIRS) -else() - set(WINDOWSSDK_PREFERRED_DIR "${WINDOWSSDK_LATEST_DIR}") - set(WINDOWSSDK_PREFERRED_NAME "${WINDOWSSDK_LATEST_NAME}") - set(WINDOWSSDK_PREFERRED_FIRST_DIRS ${WINDOWSSDK_DIRS}) - set(WINDOWSSDK_FOUND_PREFERENCE OFF) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(WindowsSDK - "No compatible version of the Windows SDK or Platform SDK found." - WINDOWSSDK_DIRS) - -if(WINDOWSSDK_FOUND) - if(NOT _winsdk_remembered_dirs STREQUAL WINDOWSSDK_DIRS) - set(_winsdk_remembered_dirs - "${WINDOWSSDK_DIRS}" - CACHE - INTERNAL - "" - FORCE) - if(NOT WindowsSDK_FIND_QUIETLY) - foreach(_sdkdir ${WINDOWSSDK_DIRS}) - windowssdk_name_lookup("${_sdkdir}" _sdkname) - message(STATUS " - Found ${_sdkname} at ${_sdkdir}") - endforeach() - endif() - endif() - - # Internal: Architecture-appropriate library directory names. - if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM") - set(_winsdk_archbare /arm) # what the architecture used to be called in oldest SDKs - set(_winsdk_arch arm) # what the architecture used to be called - set(_winsdk_arch8 arm) # what the WDK for Win8+ calls this architecture - else() - if(CMAKE_SIZEOF_VOID_P MATCHES "8") - set(_winsdk_archbare /x64) # what the architecture used to be called in oldest SDKs - set(_winsdk_arch amd64) # what the architecture used to be called - set(_winsdk_arch8 x64) # what the WDK for Win8+ calls this architecture - else() - set(_winsdk_archbare ) # what the architecture used to be called in oldest SDKs - set(_winsdk_arch i386) # what the architecture used to be called - set(_winsdk_arch8 x86) # what the WDK for Win8+ calls this architecture - endif() - endif() - - function(get_windowssdk_from_component _component _var) - get_filename_component(_component "${_component}" ABSOLUTE) - file(TO_CMAKE_PATH "${_component}" _component) - foreach(_sdkdir ${WINDOWSSDK_DIRS}) - get_filename_component(_sdkdir "${_sdkdir}" ABSOLUTE) - string(LENGTH "${_sdkdir}" _sdklen) - file(RELATIVE_PATH _rel "${_sdkdir}" "${_component}") - # If we don't have any "parent directory" items... - if(NOT "${_rel}" MATCHES "[.][.]") - set(${_var} "${_sdkdir}" PARENT_SCOPE) - return() - endif() - endforeach() - # Fail. - set(${_var} "NOTFOUND" PARENT_SCOPE) - endfunction() - function(get_windowssdk_library_dirs _winsdk_dir _var) - set(_result) - foreach(_suffix - "lib${_winsdk_archbare}" # SDKs like 7.1A - "lib/w2k/${_winsdk_arch}" # Win2k min requirement - "lib/wxp/${_winsdk_arch}" # WinXP min requirement - "lib/wnet/${_winsdk_arch}" # Win Server 2003 min requirement - "lib/wlh/${_winsdk_arch}" # Win Vista ("Long Horn") min requirement - "lib/wlh/um/${_winsdk_arch8}" # Win Vista ("Long Horn") min requirement - "lib/win7/${_winsdk_arch}" # Win 7 min requirement - "lib/win7/um/${_winsdk_arch8}" # Win 7 min requirement - "lib/win8/um/${_winsdk_arch8}" # Win 8 min requirement - "lib/win8/km/${_winsdk_arch8}" # Win 8 min requirement - "lib/winv6.3/km/${_winsdk_arch8}" # Win 8.1 min requirement - "lib/winv6.3/um/${_winsdk_arch8}" # Win 8.1 min requirement - ) - # Check to see if a library actually exists here. - file(GLOB _libs "${_winsdk_dir}/${_suffix}/*.lib") - if(_libs) - list(APPEND _result "${_winsdk_dir}/${_suffix}") - endif() - endforeach() - if(NOT _result) - set(_result NOTFOUND) - endif() - set(${_var} ${_result} PARENT_SCOPE) - endfunction() - function(get_windowssdk_include_dirs _winsdk_dir _var) - set(_result) - foreach(_suffix - "Include" - "Include/shared" - "Include/um" - "Include/winrt" - "Include/km" - "Include/wdf" - ) - # Check to see if a header file actually exists here. - file(GLOB _headers "${_winsdk_dir}/${_suffix}/*.h") - if(_headers) - list(APPEND _result "${_winsdk_dir}/${_suffix}") - endif() - endforeach() - if(NOT _result) - set(_result NOTFOUND) - endif() - set(${_var} ${_result} PARENT_SCOPE) - endfunction() -endif() diff --git a/src/vrpn/cmake/Findcppcheck.cmake b/src/vrpn/cmake/Findcppcheck.cmake deleted file mode 100644 index 2dcf799a7dfe6054a17d281d7fa33196608c2a93..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/Findcppcheck.cmake +++ /dev/null @@ -1,167 +0,0 @@ -# - try to find cppcheck tool -# -# Cache Variables: -# CPPCHECK_EXECUTABLE -# -# Non-cache variables you might use in your CMakeLists.txt: -# CPPCHECK_FOUND -# CPPCHECK_POSSIBLEERROR_ARG -# CPPCHECK_UNUSEDFUNC_ARG -# CPPCHECK_STYLE_ARG -# CPPCHECK_QUIET_ARG -# CPPCHECK_INCLUDEPATH_ARG -# CPPCHECK_FAIL_REGULAR_EXPRESSION -# CPPCHECK_WARN_REGULAR_EXPRESSION -# CPPCHECK_MARK_AS_ADVANCED - whether to mark our vars as advanced even -# if we don't find this program. -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -file(TO_CMAKE_PATH "${CPPCHECK_ROOT_DIR}" CPPCHECK_ROOT_DIR) -set(CPPCHECK_ROOT_DIR - "${CPPCHECK_ROOT_DIR}" - CACHE - PATH - "Path to search for cppcheck") - -# cppcheck app bundles on Mac OS X are GUI, we want command line only -set(_oldappbundlesetting ${CMAKE_FIND_APPBUNDLE}) -set(CMAKE_FIND_APPBUNDLE NEVER) - -if(CPPCHECK_EXECUTABLE AND NOT EXISTS "${CPPCHECK_EXECUTABLE}") - set(CPPCHECK_EXECUTABLE "notfound" CACHE PATH FORCE "") -endif() - -# If we have a custom path, look there first. -if(CPPCHECK_ROOT_DIR) - find_program(CPPCHECK_EXECUTABLE - NAMES - cppcheck - cli - PATHS - "${CPPCHECK_ROOT_DIR}" - PATH_SUFFIXES - cli - NO_DEFAULT_PATH) -endif() - -find_program(CPPCHECK_EXECUTABLE NAMES cppcheck) - -# Restore original setting for appbundle finding -set(CMAKE_FIND_APPBUNDLE ${_oldappbundlesetting}) - -# Find out where our test file is -get_filename_component(_cppcheckmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) -set(_cppcheckdummyfile "${_cppcheckmoddir}/Findcppcheck.cpp") -if(NOT EXISTS "${_cppcheckdummyfile}") - message(FATAL_ERROR - "Missing file ${_cppcheckdummyfile} - should be alongside Findcppcheck.cmake, can be found at https://github.com/rpavlik/cmake-modules") -endif() - -function(_cppcheck_test_arg _resultvar _arg) - if(NOT CPPCHECK_EXECUTABLE) - set(${_resultvar} NO) - return() - endif() - execute_process(COMMAND - "${CPPCHECK_EXECUTABLE}" - "${_arg}" - "--quiet" - "${_cppcheckdummyfile}" - RESULT_VARIABLE - _cppcheck_result - OUTPUT_QUIET - ERROR_QUIET) - if("${_cppcheck_result}" EQUAL 0) - set(${_resultvar} YES PARENT_SCOPE) - else() - set(${_resultvar} NO PARENT_SCOPE) - endif() -endfunction() - -function(_cppcheck_set_arg_var _argvar _arg) - if("${${_argvar}}" STREQUAL "") - _cppcheck_test_arg(_cppcheck_arg "${_arg}") - if(_cppcheck_arg) - set(${_argvar} "${_arg}" PARENT_SCOPE) - endif() - endif() -endfunction() - -if(CPPCHECK_EXECUTABLE) - - # Check for the two types of command line arguments by just trying them - _cppcheck_set_arg_var(CPPCHECK_STYLE_ARG "--enable=style") - _cppcheck_set_arg_var(CPPCHECK_STYLE_ARG "--style") - if("${CPPCHECK_STYLE_ARG}" STREQUAL "--enable=style") - - _cppcheck_set_arg_var(CPPCHECK_UNUSEDFUNC_ARG - "--enable=unusedFunction") - _cppcheck_set_arg_var(CPPCHECK_INFORMATION_ARG "--enable=information") - _cppcheck_set_arg_var(CPPCHECK_MISSINGINCLUDE_ARG - "--enable=missingInclude") - _cppcheck_set_arg_var(CPPCHECK_POSIX_ARG "--enable=posix") - _cppcheck_set_arg_var(CPPCHECK_POSSIBLEERROR_ARG - "--enable=possibleError") - _cppcheck_set_arg_var(CPPCHECK_POSSIBLEERROR_ARG "--enable=all") - - if(MSVC) - set(CPPCHECK_TEMPLATE_ARG --template vs) - set(CPPCHECK_FAIL_REGULAR_EXPRESSION "[(]error[)]") - set(CPPCHECK_WARN_REGULAR_EXPRESSION "[(]style[)]") - elseif(CMAKE_COMPILER_IS_GNUCXX) - set(CPPCHECK_TEMPLATE_ARG --template gcc) - set(CPPCHECK_FAIL_REGULAR_EXPRESSION " error: ") - set(CPPCHECK_WARN_REGULAR_EXPRESSION " style: ") - else() - set(CPPCHECK_TEMPLATE_ARG --template gcc) - set(CPPCHECK_FAIL_REGULAR_EXPRESSION " error: ") - set(CPPCHECK_WARN_REGULAR_EXPRESSION " style: ") - endif() - elseif("${CPPCHECK_STYLE_ARG}" STREQUAL "--style") - # Old arguments - _cppcheck_set_arg_var(CPPCHECK_UNUSEDFUNC_ARG "--unused-functions") - _cppcheck_set_arg_var(CPPCHECK_POSSIBLEERROR_ARG "--all") - set(CPPCHECK_FAIL_REGULAR_EXPRESSION "error:") - set(CPPCHECK_WARN_REGULAR_EXPRESSION "[(]style[)]") - else() - # No idea - some other issue must be getting in the way - message(STATUS - "WARNING: Can't detect whether CPPCHECK wants new or old-style arguments!") - endif() - - set(CPPCHECK_QUIET_ARG "--quiet") - set(CPPCHECK_INCLUDEPATH_ARG "-I") - -endif() - -set(CPPCHECK_ALL - "${CPPCHECK_EXECUTABLE} ${CPPCHECK_POSSIBLEERROR_ARG} ${CPPCHECK_UNUSEDFUNC_ARG} ${CPPCHECK_STYLE_ARG} ${CPPCHECK_QUIET_ARG} ${CPPCHECK_INCLUDEPATH_ARG} some/include/path") - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(cppcheck - DEFAULT_MSG - CPPCHECK_ALL - CPPCHECK_EXECUTABLE - CPPCHECK_POSSIBLEERROR_ARG - CPPCHECK_UNUSEDFUNC_ARG - CPPCHECK_STYLE_ARG - CPPCHECK_INCLUDEPATH_ARG - CPPCHECK_QUIET_ARG) - -if(CPPCHECK_FOUND OR CPPCHECK_MARK_AS_ADVANCED) - mark_as_advanced(CPPCHECK_ROOT_DIR) -endif() - -mark_as_advanced(CPPCHECK_EXECUTABLE) diff --git a/src/vrpn/cmake/Findcppcheck.cpp b/src/vrpn/cmake/Findcppcheck.cpp deleted file mode 100644 index 84350db47a689d6745f3f7384d04cd78e3feb56e..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/Findcppcheck.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/** - * \file Findcppcheck.cpp - * \brief Dummy C++ source file used by CMake module Findcppcheck.cmake - * - * \author - * Ryan Pavlik, 2009-2010 - * <rpavlik@iastate.edu> - * http://academic.cleardefinition.com/ - * - */ - - - -int main(int argc, char* argv[]) { - return 0; -} diff --git a/src/vrpn/cmake/Findquatlib.cmake b/src/vrpn/cmake/Findquatlib.cmake deleted file mode 100644 index 641dfbd97c99399dc5290df19465121262ee8dd2..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/Findquatlib.cmake +++ /dev/null @@ -1,103 +0,0 @@ -# - Find quatlib -# Find the quatlib headers and libraries. -# -# QUATLIB_INCLUDE_DIRS - where to find quat.h -# QUATLIB_LIBRARIES - List of libraries when using quatlib. -# QUATLIB_FOUND - True if quatlib found. -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(TARGET quat) - # Look for the header file. - find_path(QUATLIB_INCLUDE_DIR NAMES quat.h - PATHS ${quatlib_SOURCE_DIR}) - - set(QUATLIB_LIBRARY "quat") - -else() - set(QUATLIB_ROOT_DIR - "${QUATLIB_ROOT_DIR}" - CACHE - PATH - "Root directory to search for quatlib") - if(DEFINED VRPN_ROOT_DIR AND NOT QUATLIB_ROOT_DIR) - set(QUATLIB_ROOT_DIR "${VRPN_ROOT_DIR}") - mark_as_advanced(QUATLIB_ROOT_DIR) - endif() - - if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8") - set(_libsuffixes lib64 lib) - - # 64-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _progfiles) - else() - set(_libsuffixes lib) - if(NOT "$ENV{ProgramFiles(x86)}" STREQUAL "") - # 32-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles(x86)}" _progfiles) - else() - # 32-bit dir on win32, useless to us on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _progfiles) - endif() - endif() - - # Look for the header file. - find_path(QUATLIB_INCLUDE_DIR - NAMES - quat.h - HINTS - "${QUATLIB_ROOT_DIR}" - PATH_SUFFIXES - include - PATHS - "${_progfiles}/VRPN" - "${_progfiles}/quatlib" - C:/usr/local - /usr/local) - - # Look for the library. - find_library(QUATLIB_LIBRARY - NAMES - quat.lib - libquat.a - HINTS - "${QUATLIB_ROOT_DIR}" - PATH_SUFFIXES - ${_libsuffixes} - PATHS - "${_progfiles}/VRPN" - "${_progfiles}/quatlib" - C:/usr/local - /usr/local) -endif() - -# handle the QUIETLY and REQUIRED arguments and set QUATLIB_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(quatlib - DEFAULT_MSG - QUATLIB_LIBRARY - QUATLIB_INCLUDE_DIR) - -if(QUATLIB_FOUND) - set(QUATLIB_LIBRARIES ${QUATLIB_LIBRARY}) - if(NOT WIN32) - list(APPEND QUATLIB_LIBRARIES m) - endif() - set(QUATLIB_INCLUDE_DIRS ${QUATLIB_INCLUDE_DIR}) - - mark_as_advanced(QUATLIB_ROOT_DIR) -else() - set(QUATLIB_LIBRARIES) - set(QUATLIB_INCLUDE_DIRS) -endif() - -mark_as_advanced(QUATLIB_LIBRARY QUATLIB_INCLUDE_DIR) diff --git a/src/vrpn/cmake/GetCompilerInfoString.cmake b/src/vrpn/cmake/GetCompilerInfoString.cmake deleted file mode 100644 index 1ee5b1f5a788aa8da27a8006c854fc6e7b495015..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/GetCompilerInfoString.cmake +++ /dev/null @@ -1,179 +0,0 @@ -# - Utility function to return a human-useful-only string ID'ing the compiler -# -# get_compiler_info_string(<resultvar>) -# -# and some helper functions: -# get_gcc_version(<resultvar>) -# get_vs_short_version_string(<generator> <resultvar>) -# -# You might consider using it when setting up CTest options, for example: -# include(GetCompilerInfoString) -# get_compiler_info_string(COMPILERID) -# set(CTEST_BUILD_NAME "${CMAKE_SYSTEM}-${CMAKE_SYSTEM_PROCESSOR}-${COMPILERID}") -# -# Requires these CMake modules: -# no additional modules required -# -# Original Author: -# 2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -# -# Some functions based on cmake-2.8.0 modules FindBoost.cmake and CTest.cmake -#============================================================================= -# Copyright 2006-2009 Kitware, Inc. -# Copyright 2006-2008 Andreas Schneider <mail@cynapses.org> -# Copyright 2007 Wengo -# Copyright 2007 Mike Jackson -# Copyright 2008 Andreas Pakulat <apaku@gmx.de> -# Copyright 2008-2009 Philip Lowman <philip@yhbt.com> -# Copyright 2010 Iowa State University (Ryan Pavlik <abiryan@ryand.net>) -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# CMake - Cross Platform Makefile Generator -# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the names of Kitware, Inc., the Insight Software Consortium, -# nor the names of their contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#============================================================================= - -if(__get_compiler_info_string) - return() -endif() -set(__get_compiler_info_string YES) - - -function(get_compiler_info_string _var) - set(_out) - - if(CTEST_CMAKE_GENERATOR AND NOT CMAKE_GENERATOR) - # We're running in CTest - use that generator. - set(CMAKE_GENERATOR ${CTEST_CMAKE_GENERATOR}) - endif() - - if(NOT CMAKE_CXX_COMPILER) - # Also for use in CTest scripts - include(CMakeDetermineCXXCompiler) - endif() - - if(MSVC) - # Parse version for Visual Studio - get_vs_short_version_string("${CMAKE_GENERATOR}" _verstring) - if(${CMAKE_GENERATOR} MATCHES "Win64") - set(_verstring "${_verstring}win64") - endif() - - elseif(CMAKE_COMPILER_IS_GNUCXX) - # Parse version for GCC - get_gcc_version(_gccver) - set(_verstring "gcc${_gccver}") - - else() - # Some other compiler we don't handle in more detail yet. - string(REGEX REPLACE " " "_" _verstring "${CMAKE_GENERATOR}") - set(_verstring "${CMAKE_CXX_COMPILER_ID}:generator:${_verstring}") - endif() - - # Return _verstring - set(${_var} "${_verstring}" PARENT_SCOPE) -endfunction() - -## Based on a function in FindBoost.cmake from CMake 2.8.0 -#------------------------------------------------------------------------------- -# -# Runs compiler with "-dumpversion" and parses major/minor -# version with a regex. -# -function(get_gcc_version _var) - exec_program(${CMAKE_CXX_COMPILER} - ARGS - ${CMAKE_CXX_COMPILER_ARG1} - -dumpversion - OUTPUT_VARIABLE - _compilerinfo_COMPILER_VERSION) - - string(REGEX - MATCH - "([.0-9]+)" - "\\1" - _compilerinfo_COMPILER_VERSION - "${_compilerinfo_COMPILER_VERSION}") - - set(${_var} ${_compilerinfo_COMPILER_VERSION} PARENT_SCOPE) -endfunction() - -## Based on a function in CTest.cmake from CMake 2.8.0 -#------------------------------------------------------------------------------- -# -# function to turn generator name into a version string -# like vs7 vs71 vs8 vs9 -# -function(get_vs_short_version_string _generator _var) - set(_ver_string) - if("${_generator}" MATCHES "Visual Studio") - string(REGEX - REPLACE - "Visual Studio ([0-9][0-9]?)($|.*)" - "\\1" - _vsver - "${_generator}") - if("${_generator}" MATCHES "Visual Studio 7 .NET 2003") - # handle the weird one - set(_ver_string "vs71") - else() - set(_ver_string "vs${_vsver}") - endif() - elseif(MSVC) - if(MSVC71) - set(_ver_string "vs71") - else() - foreach(_ver 6 7 8 9 10) - if(MSVC${_ver}0) - set(_ver_string "vs${_ver}") - break() - endif() - endforeach() - endif() - endif() - - if(_ver_string) - set(${_var} ${_ver_string} PARENT_SCOPE) - endif() -endfunction() diff --git a/src/vrpn/cmake/GetDefineString.cmake b/src/vrpn/cmake/GetDefineString.cmake deleted file mode 100644 index 832fea8d146bbdaf5303d785e7a24e1a2300b194..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/GetDefineString.cmake +++ /dev/null @@ -1,58 +0,0 @@ -# - Script to get the value of a preprocessor definition that is a string, -# after including the given files -# Requires that the associated source file be present: GetDefineString.cpp.in. -# -# get_define_string(NAME <define_name> [INCLUDES <files>] RESULT <variable> -# [FLAGS <compile-flags>] -# [INCLUDE_DIRS <include-dirs>] -# [DEFINES] <-Ddefinitions>) -# Original Author: -# 2014 Ryan Pavlik <ryan@sensics.com> <abiryan@ryand.net> -# -# Copyright Sensics, Inc. 2014. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - - -get_filename_component(_getdefinestring_moddir "${CMAKE_CURRENT_LIST_FILE}" PATH) - -function(get_define_string) - include(CMakeParseArguments) - cmake_parse_arguments(_gds "" "NAME;RESULT" "INCLUDES;FLAGS;INCLUDE_DIRS;DEFINES" ${ARGN}) - if(NOT _gds_NAME) - message(FATAL_ERROR "Must pass NAME to get_define_string!") - endif() - if(NOT _gds_RESULT) - message(FATAL_ERROR "Must pass RESULT to get_define_string!") - endif() - if(NOT DEFINED "${_gds_RESULT}_CHECKED" OR (NOT "${${_gds_RESULT}_CHECKED}" STREQUAL "${ARGN}")) - set(${_gds_RESULT}_CHECKED "${ARGN}" CACHE INTERNAL "" FORCE) - set(GET_DEFINE_STRING_NAME ${_gds_NAME}) - set(_INCLUDES) - if(_gds_INCLUDE_DIRS) - set(_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${_gds_INCLUDE_DIRS}") - endif() - set(GET_DEFINE_STRING_INCLUDES) - foreach(_file ${_gds_INCLUDES}) - set(GET_DEFINE_STRING_INCLUDES "${GET_DEFINE_STRING_INCLUDES}#include <${_file}>\n") - endforeach() - set(_src "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/GetDefineString${_gds_RESULT}.cpp") - set(_out "${CMAKE_CURRENT_BINARY_DIR}/GetDefineString${_gds_RESULT}.out") - configure_file("${_getdefinestring_moddir}/GetDefineString.cpp.in" "${_src}") - try_compile(_result "${CMAKE_CURRENT_BINARY_DIR}" SOURCES "${_src}" - CMAKE_FLAGS ${_INCLUDES} - COMPILE_DEFINITIONS ${_gds_DEFINES} - OUTPUT_VARIABLE OUTPUT - COPY_FILE "${_out}") - if(_result) - file(STRINGS "${_out}" _result_string REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]") - if("${_result_string}" MATCHES "INFO:define\\[([^]\"]*)\\]") - set(${_gds_RESULT}_CACHED "${CMAKE_MATCH_1}" CACHE INTERNAL "" FORCE) - endif() - else() - set(${_gds_RESULT}_CACHED NOTFOUND) - endif() - endif() - set(${_gds_RESULT} ${${_gds_RESULT}_CACHED} PARENT_SCOPE) -endfunction() \ No newline at end of file diff --git a/src/vrpn/cmake/GetDefineString.cpp.in b/src/vrpn/cmake/GetDefineString.cpp.in deleted file mode 100644 index 99cbbbc9ddcaec26a55fd95f9fb1a8b97e574f85..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/GetDefineString.cpp.in +++ /dev/null @@ -1,10 +0,0 @@ -@GET_DEFINE_STRING_INCLUDES@ - -char const * info = "INFO" ":" "define[" @GET_DEFINE_STRING_NAME@ "]"; - -int main(int argc, char * argv[]) { - int require = 0; - require += info[argc]; - (void)argv; - return require; -} \ No newline at end of file diff --git a/src/vrpn/cmake/GetDirectoryList.cmake b/src/vrpn/cmake/GetDirectoryList.cmake deleted file mode 100644 index 60f2a01365b2a918b18d28364f75ee870844b41a..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/GetDirectoryList.cmake +++ /dev/null @@ -1,49 +0,0 @@ -# - Returns a list of the parent directories of all files passed -# -# get_directory_list(<listvar> <file path> [<additional file paths>...]) -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__get_directory_list) - return() -endif() -set(__get_directory_list YES) - -function(get_directory_list _var) - # combine variable's current value with additional list items - set(_in ${ARGN}) - - if(_in) - # Initial list cleaning - list(REMOVE_DUPLICATES _in) - - # Grab the absolute path of each actual directory - set(_out) - foreach(_file ${_in}) - get_filename_component(_dir "${_file}" PATH) - if(IS_DIRECTORY "${_dir}") - get_filename_component(_dir "${_dir}" ABSOLUTE) - file(TO_CMAKE_PATH "${_dir}" _dir) - list(APPEND _out "${_dir}") - endif() - endforeach() - - if(_out) - # Clean up the output list now - list(REMOVE_DUPLICATES _out) - endif() - - # return _out - set(${_var} "${_out}" PARENT_SCOPE) - endif() -endfunction() diff --git a/src/vrpn/cmake/GetGitRevisionDescription.cmake b/src/vrpn/cmake/GetGitRevisionDescription.cmake deleted file mode 100644 index c8d27f2e8ce494c96404086ce58982239916a44c..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/GetGitRevisionDescription.cmake +++ /dev/null @@ -1,130 +0,0 @@ -# - Returns a version string from Git -# -# These functions force a re-configure on each git commit so that you can -# trust the values of the variables in your build system. -# -# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...]) -# -# Returns the refspec and sha hash of the current head revision -# -# git_describe(<var> [<additional arguments to git describe> ...]) -# -# Returns the results of git describe on the source tree, and adjusting -# the output so that it tests false if an error occurs. -# -# git_get_exact_tag(<var> [<additional arguments to git describe> ...]) -# -# Returns the results of git describe --exact-match on the source tree, -# and adjusting the output so that it tests false if there was no exact -# matching tag. -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__get_git_revision_description) - return() -endif() -set(__get_git_revision_description YES) - -# We must run the following at "include" time, not at function call time, -# to find the path to this module rather than the path to a calling list file -get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) - -function(get_git_head_revision _refspecvar _hashvar) - set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - set(GIT_DIR "${GIT_PARENT_DIR}/.git") - while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories - set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") - get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) - if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) - # We have reached the root directory, we are not in git - set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - return() - endif() - set(GIT_DIR "${GIT_PARENT_DIR}/.git") - endwhile() - # check if this is a submodule - if(NOT IS_DIRECTORY ${GIT_DIR}) - file(READ ${GIT_DIR} submodule) - string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule}) - get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) - get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE) - endif() - set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") - if(NOT EXISTS "${GIT_DATA}") - file(MAKE_DIRECTORY "${GIT_DATA}") - endif() - - if(NOT EXISTS "${GIT_DIR}/HEAD") - return() - endif() - set(HEAD_FILE "${GIT_DATA}/HEAD") - configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY) - - configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" - "${GIT_DATA}/grabRef.cmake" - @ONLY) - include("${GIT_DATA}/grabRef.cmake") - - set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) - set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) -endfunction() - -function(git_describe _var) - if(NOT GIT_FOUND) - find_package(Git QUIET) - endif() - get_git_head_revision(refspec hash) - if(NOT GIT_FOUND) - set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) - return() - endif() - if(NOT hash) - set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) - return() - endif() - - # TODO sanitize - #if((${ARGN}" MATCHES "&&") OR - # (ARGN MATCHES "||") OR - # (ARGN MATCHES "\\;")) - # message("Please report the following error to the project!") - # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") - #endif() - - #message(STATUS "Arguments to execute_process: ${ARGN}") - - execute_process(COMMAND - "${GIT_EXECUTABLE}" - describe - ${hash} - ${ARGN} - WORKING_DIRECTORY - "${CMAKE_SOURCE_DIR}" - RESULT_VARIABLE - res - OUTPUT_VARIABLE - out - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(NOT res EQUAL 0) - set(out "${out}-${res}-NOTFOUND") - endif() - - set(${_var} "${out}" PARENT_SCOPE) -endfunction() - -function(git_get_exact_tag _var) - git_describe(out --exact-match ${ARGN}) - set(${_var} "${out}" PARENT_SCOPE) -endfunction() diff --git a/src/vrpn/cmake/GetGitRevisionDescription.cmake.in b/src/vrpn/cmake/GetGitRevisionDescription.cmake.in deleted file mode 100644 index 888ce13aaba354f5d7d7946dd661963278dc8fc2..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/GetGitRevisionDescription.cmake.in +++ /dev/null @@ -1,38 +0,0 @@ -# -# Internal file for GetGitRevisionDescription.cmake -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(HEAD_HASH) - -file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) - -string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) -if(HEAD_CONTENTS MATCHES "ref") - # named branch - string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") - if(EXISTS "@GIT_DIR@/${HEAD_REF}") - configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) - elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}") - configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) - set(HEAD_HASH "${HEAD_REF}") - endif() -else() - # detached HEAD - configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) -endif() - -if(NOT HEAD_HASH) - file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) - string(STRIP "${HEAD_HASH}" HEAD_HASH) -endif() diff --git a/src/vrpn/cmake/LICENSE_1_0.txt b/src/vrpn/cmake/LICENSE_1_0.txt deleted file mode 100644 index 36b7cd93cdfbac762f5be4c6ce276df2ea6305c2..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/LICENSE_1_0.txt +++ /dev/null @@ -1,23 +0,0 @@ -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/src/vrpn/cmake/ListCombinations.cmake b/src/vrpn/cmake/ListCombinations.cmake deleted file mode 100644 index 4321f624a8d4ad8c2b4d459c3e2061ce99333172..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/ListCombinations.cmake +++ /dev/null @@ -1,53 +0,0 @@ -# - Combine lists of prefixes and suffixes in all combinations -# -# list_combinations(var PREFIXES listitems... SUFFIXES listitems...) - -# where var is the name of your desired output variable and PREFIXES -# and SUFFIXES are special arguments that indicate the start of your -# list of prefixes or suffixes respectively. -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__list_combinations) - return() -endif() -set(__list_combinations YES) - -function(list_combinations var) - # Parse arguments - set(_prefixes) - set(_suffixes) - set(_nowhere) - set(_curdest _nowhere) - foreach(_element ${ARGN}) - if("${_element}" STREQUAL "PREFIXES") - set(_curdest _prefixes) - elseif("${_element}" STREQUAL "SUFFIXES") - set(_curdest _suffixes) - else() - list(APPEND ${_curdest} "${_element}") - endif() - endforeach() - if(_nowhere) - message(STATUS "_prefixes ${_prefixes}") - message(STATUS "_prefixes ${_suffixes}") - message(STATUS "_prefixes ${_nowhere}") - message(FATAL_ERROR - "Syntax error in use of ${CMAKE_CURRENT_LIST_FILE}") - endif() - - foreach(_prefix ${_prefixes}) - foreach(_suffix ${_suffixes}) - list(APPEND _out "${_prefix}${_suffix}") - endforeach() - endforeach() - - set(${var} "${_out}" PARENT_SCOPE) -endfunction() diff --git a/src/vrpn/cmake/MSVCMultipleProcessCompile.cmake b/src/vrpn/cmake/MSVCMultipleProcessCompile.cmake deleted file mode 100644 index aad4eabded62acc0e0ecc97c9c154103176f800d..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/MSVCMultipleProcessCompile.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# - Compile with multiple processes on MSVC -# -# include(MSVCMultipleProcessCompile) -# -# Requires these CMake modules: -# ListCombinations.cmake -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(MSVC AND NOT "${MSVC_VERSION}" LESS 1400) - # Only available in VS 2005 and newer - string(TOUPPER "${CMAKE_CONFIGURATION_TYPES}" _conftypesUC) - include(ListCombinations) - list_combinations(_varnames - PREFIXES - CMAKE_C_FLAGS_ - CMAKE_CXX_FLAGS_ - SUFFIXES - ${_conftypesUC}) - foreach(_var ${_varnames}) - set(${_var} "${${_var}} /MP") - endforeach() -endif() diff --git a/src/vrpn/cmake/OptionRequires.cmake b/src/vrpn/cmake/OptionRequires.cmake deleted file mode 100644 index 662121f5796efd9215e96ef962a5e453e46561dd..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/OptionRequires.cmake +++ /dev/null @@ -1,53 +0,0 @@ -# - Add an option that depends on one or more variables being true. -# -# option_requires(<option_name> <description> <variable_name> [<variable_name>...]) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -function(option_requires name desc) - set(args ${ARGN}) - - set(OFF_BY_DEFAULT false) - list(FIND args "OFF_BY_DEFAULT" _off_found) - if(NOT _off_found EQUAL -1) - list(REMOVE_AT args ${_off_found}) - set(OFF_BY_DEFAULT true) - endif() - - set(found) - set(missing) - foreach(var ${args}) - if(${var}) - list(APPEND found ${var}) - else() - list(APPEND missing ${var}) - endif() - endforeach() - - if(NOT missing) - set(OK TRUE) - else() - set(OK FALSE) - endif() - - set(default ${OK}) - if(OFF_BY_DEFAULT) - set(default OFF) - endif() - - option(${name} "${desc}" ${default}) - - if(${name} AND (NOT OK)) - message(FATAL_ERROR - "${name} enabled but these dependencies were not valid: ${missing}") - endif() - -endfunction() diff --git a/src/vrpn/cmake/PrefixListGlob.cmake b/src/vrpn/cmake/PrefixListGlob.cmake deleted file mode 100644 index 3b1bb6460064bf62877623358d7177989ae77626..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/PrefixListGlob.cmake +++ /dev/null @@ -1,36 +0,0 @@ -# - For each given prefix in a list, glob using the prefix+pattern -# -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__prefix_list_glob) - return() -endif() -set(__prefix_list_glob YES) - -function(prefix_list_glob var pattern) - set(_out) - set(_result) - foreach(prefix ${ARGN}) - file(GLOB _globbed ${prefix}${pattern}) - if(_globbed) - list(SORT _globbed) - list(REVERSE _globbed) - list(APPEND _out ${_globbed}) - endif() - endforeach() - foreach(_name ${_out}) - get_filename_component(_name "${_name}" ABSOLUTE) - list(APPEND _result "${_name}") - endforeach() - - set(${var} "${_result}" PARENT_SCOPE) -endfunction() diff --git a/src/vrpn/cmake/ProgramFilesGlob.cmake b/src/vrpn/cmake/ProgramFilesGlob.cmake deleted file mode 100644 index 98eb924678df6c82b96cb7c87a55c0c39a5710e7..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/ProgramFilesGlob.cmake +++ /dev/null @@ -1,94 +0,0 @@ -# - Find bit-appropriate program files directories matching a given pattern -# -# Requires these CMake modules: -# CleanDirectoryList -# PrefixListGlob -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -include(PrefixListGlob) -include(CleanDirectoryList) - -if(__program_files_glob) - return() -endif() -set(__program_files_glob YES) - -function(program_files_glob var pattern) - # caution - ENV{ProgramFiles} on Win64 is adjusted to point to the arch - # of the running executable which, since CMake is 32-bit on Windows as - # I write this, will always be = $ENV{ProgramFiles(x86)}. - # Thus, we only use this environment variable if we are on a 32 machine - - # 32-bit dir on win32, useless to us on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _PROG_FILES) - - # 32-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles(x86)}" _PROG_FILES_X86) - - # 64-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _PROG_FILES_W6432) - - if(CMAKE_SIZEOF_VOID_P MATCHES "8") - # 64-bit build on win64 - set(_PROGFILESDIRS "${_PROG_FILES_W6432}") - else() - if(_PROG_FILES_W6432) - # 32-bit build on win64 - set(_PROGFILESDIRS "${_PROG_FILES_X86}") - else() - # 32-bit build on win32 - set(_PROGFILESDIRS "${_PROG_FILES}") - endif() - endif() - - prefix_list_glob(_prefixed "${pattern}" ${_PROGFILESDIRS}) - clean_directory_list(_prefixed) - set(${var} ${_prefixed} PARENT_SCOPE) -endfunction() - -function(program_files_fallback_glob var pattern) - # caution - ENV{ProgramFiles} on Win64 is adjusted to point to the arch - # of the running executable which, since CMake is 32-bit on Windows as - # I write this, will always be = $ENV{ProgramFiles(x86)}. - # Thus, we only use this environment variable if we are on a 32 machine - - # 32-bit dir on win32, useless to us on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _PROG_FILES) - - # 32-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles(x86)}" _PROG_FILES_X86) - - # 64-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _PROG_FILES_W6432) - - if(CMAKE_SIZEOF_VOID_P MATCHES "8") - # 64-bit build on win64 - # look in the "32 bit" (c:\program files (x86)\) directory as a - # fallback in case of weird/poorly written installers, like those - # that put both 64- and 32-bit libs in the same program files directory - set(_PROGFILESDIRS "${_PROG_FILES_W6432}" "${_PROG_FILES_X86}") - else() - if(_PROG_FILES_W6432) - # 32-bit build on win64 - # look in the "64 bit" (c:\program files\) directory as a fallback - # in case of old/weird/poorly written installers - set(_PROGFILESDIRS "${_PROG_FILES_X86}" "${_PROG_FILES_W6432}") - else() - # 32-bit build on win32 - set(_PROGFILESDIRS "${_PROG_FILES}") - endif() - endif() - - prefix_list_glob(_prefixed "${pattern}" ${_PROGFILESDIRS}) - clean_directory_list(_prefixed) - set(${var} ${_prefixed} PARENT_SCOPE) -endfunction() diff --git a/src/vrpn/cmake/SetDefaultBuildType.cmake b/src/vrpn/cmake/SetDefaultBuildType.cmake deleted file mode 100644 index cd29e32ac23866e6fa40439bd8df3ae001e6c4d9..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/SetDefaultBuildType.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# - Set a developer-chosen default build type -# -# Requires these CMake modules: -# no additional modules required -# -# Original Author: -# 2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -# - - -if(__set_default_build_type) - return() -endif() -set(__set_default_build_type YES) - -function(set_default_build_type _type) - #if(DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) - if("${CMAKE_GENERATOR}" MATCHES "Makefiles" AND NOT CMAKE_BUILD_TYPE) - if(NOT __DEFAULT_BUILD_TYPE_SET) - set(CMAKE_BUILD_TYPE "${_type}" CACHE STRING "" FORCE) - set(__DEFAULT_BUILD_TYPE_SET YES CACHE INTERNAL "") - endif() - endif() -endfunction() diff --git a/src/vrpn/cmake/UseBackportedModules.cmake b/src/vrpn/cmake/UseBackportedModules.cmake deleted file mode 100644 index 7ad3baac330a151ea08f1eff172e52f39c72752c..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/UseBackportedModules.cmake +++ /dev/null @@ -1,114 +0,0 @@ -# - Do a version-dependent check and auto-include backported modules dirs -# -# Name your module directories cmake-*-modules where * is the full -# (maj.min.patch) version number that they came from. You can use -# subdirectories within those directories, if you like - all directories -# inside of a cmake-*-modules dir for a newer version of CMake that what -# we're running, that contain one or more .cmake files, will be appended -# to the CMAKE_MODULE_PATH. -# -# When backporting modules, be sure to test them and follow copyright -# instructions (usually updating copyright notices) -# -# Requires these CMake modules: -# CleanDirectoryList -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(NOT CMAKE_VERSION) # defined in >=2.6.3 - set(_cmver - "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}") -else() - set(_cmver "${CMAKE_VERSION}") -endif() - -include(CleanDirectoryList) - -# No debugging output please -set(USE_BACKPORTED_MODULES_VERBOSE NO) - -get_filename_component(_moddir ${CMAKE_CURRENT_LIST_FILE} PATH) -file(GLOB _globbed "${_moddir}/cmake-*-modules") - -if(USE_BACKPORTED_MODULES_VERBOSE) - message(STATUS - "UseBackportedModules: Detected use of CMake version ${_cmver}") - message(STATUS "Checking these base directories: ${_globbed}") -endif() - -foreach(_dir ${_globbed}) - string(REGEX - MATCH - "cmake-[0-9].[0-9].[0-9]-modules" - _dirname - "${_dir}") - string(REGEX - REPLACE - "cmake-([0-9].[0-9].[0-9])-modules" - "\\1" - _ver - "${_dirname}") - string(REGEX - REPLACE - "cmake-([0-9]).([0-9]).([0-9])-modules" - "\\1_\\2_\\3" - _ver_clean - "${_dirname}") - - if(USE_BACKPORTED_MODULES_VERBOSE) - message(STATUS "${_dir}: ${_ver} ${_ver_clean}") - endif() - - if("${_cmver}" VERSION_LESS "${_ver}") - list(APPEND _upgradever "${_ver_clean}") - file(GLOB_RECURSE _modules "${_dir}/*.cmake") - - foreach(_mod ${_modules}) - get_filename_component(_path "${_mod}" PATH) - list(APPEND _paths_${_ver_clean} "${_path}") - endforeach() - - endif() -endforeach() - - -# Autoinclude files from oldest version to newest version -if(_upgradever) - set(_save_cmake_module_path ${CMAKE_MODULE_PATH}) - list(REMOVE_DUPLICATES _upgradever) - list(SORT _upgradever) - foreach(_ver_clean ${_upgradever}) - clean_directory_list(_paths_${_ver_clean}) - foreach(_dir ${_paths_${_ver_clean}}) - set(CMAKE_MODULE_PATH ${_dir} ${_save_cmake_module_path}) - include("${_dir}/autoinclude.cmake" OPTIONAL RESULT_VARIABLE _result) - if(USE_BACKPORTED_MODULES_VERBOSE) - message(STATUS "${_dir} - Autoincluded: ${_result}") - endif() - endforeach() - endforeach() - set(CMAKE_MODULE_PATH ${_save_cmake_module_path}) -endif() - -# Add the module path from newest version to oldest version -set(_added_module_path) -if(_upgradever) - list(REVERSE _upgradever) - foreach(_ver_clean ${_upgradever}) - list(APPEND _added_module_path ${_paths_${_ver_clean}}) - endforeach() -endif() - -list(APPEND CMAKE_MODULE_PATH ${_added_module_path}) - -if(USE_BACKPORTED_MODULES_VERBOSE) - message(STATUS "New module path: ${CMAKE_MODULE_PATH}") -endif() diff --git a/src/vrpn/cmake/WarningDev.cmake b/src/vrpn/cmake/WarningDev.cmake deleted file mode 100644 index 851b5f5e88c9eec3be5c5b65b4902f1b78e7e3d2..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/WarningDev.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# - Print a developer warning, using author_warning if we have cmake 2.8 -# -# warning_dev("your desired message") -# -# Original Author: -# 2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -function(warning_dev _yourmsg) - if("1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0") - # CMake version <2.8.0 - message(STATUS - "The following is a developer warning - end users may ignore it") - message(STATUS "Dev Warning: ${_yourmsg}") - else() - message(AUTHOR_WARNING "${_yourmsg}") - endif() -endfunction() diff --git a/src/vrpn/cmake/cmake-2.8.0-modules/features/SelectLibraryConfigurations.cmake b/src/vrpn/cmake/cmake-2.8.0-modules/features/SelectLibraryConfigurations.cmake deleted file mode 100644 index ee1220ccda70a335fe0f73780382df060cbb1c87..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/cmake-2.8.0-modules/features/SelectLibraryConfigurations.cmake +++ /dev/null @@ -1,108 +0,0 @@ -# select_library_configurations( basename ) -# -# This macro takes a library base name as an argument, and will choose good -# values for basename_LIBRARY, basename_LIBRARIES, basename_LIBRARY_DEBUG, and -# basename_LIBRARY_RELEASE depending on what has been found and set. If only -# basename_LIBRARY_RELEASE is defined, basename_LIBRARY, basename_LIBRARY_DEBUG, -# and basename_LIBRARY_RELEASE will be set to the release value. If only -# basename_LIBRARY_DEBUG is defined, then basename_LIBRARY, -# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value. -# -# If the generator supports configuration types, then basename_LIBRARY and -# basename_LIBRARIES will be set with debug and optimized flags specifying the -# library to be used for the given configuration. If no build type has been set -# or the generator in use does not support configuration types, then -# basename_LIBRARY and basename_LIBRARIES will take only the release values. - -#============================================================================= -# Copyright 2009 Kitware, Inc. -# Copyright 2009 Will Dicharry <wdicharry@stellarscience.com> -# Copyright 2005-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see below. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the names of Kitware, Inc., the Insight Software Consortium, -# nor the names of their contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#============================================================================= -# This macro was adapted from the FindQt4 CMake module and is maintained by Will -# Dicharry <wdicharry@stellarscience.com>. - -# Utility macro to check if one variable exists while another doesn't, and set -# one that doesn't exist to the one that exists. -macro( _set_library_name basename GOOD BAD ) - if( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} ) - set( ${basename}_LIBRARY_${BAD} ${${basename}_LIBRARY_${GOOD}} ) - set( ${basename}_LIBRARY ${${basename}_LIBRARY_${GOOD}} ) - set( ${basename}_LIBRARIES ${${basename}_LIBRARY_${GOOD}} ) - endif( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} ) -endmacro( _set_library_name ) - -macro( select_library_configurations basename ) - # if only the release version was found, set the debug to be the release - # version. - _set_library_name( ${basename} RELEASE DEBUG ) - # if only the debug version was found, set the release value to be the - # debug value. - _set_library_name( ${basename} DEBUG RELEASE ) - if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE ) - # if the generator supports configuration types or CMAKE_BUILD_TYPE - # is set, then set optimized and debug options. - if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) - set( ${basename}_LIBRARY - optimized ${${basename}_LIBRARY_RELEASE} - debug ${${basename}_LIBRARY_DEBUG} ) - set( ${basename}_LIBRARIES - optimized ${${basename}_LIBRARY_RELEASE} - debug ${${basename}_LIBRARY_DEBUG} ) - else( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) - # If there are no configuration types or build type, just use - # the release version - set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) - set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} ) - endif( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) - endif( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE ) - - set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH - "The ${basename} library" ) - - if( ${basename}_LIBRARY ) - set( ${basename}_FOUND TRUE ) - endif( ${basename}_LIBRARY ) - - mark_as_advanced( ${basename}_LIBRARY - ${basename}_LIBRARY_RELEASE - ${basename}_LIBRARY_DEBUG - ) -endmacro( select_library_configurations ) - diff --git a/src/vrpn/cmake/cmake-2.8.1-modules/patchctestbug10149/CTest.cmake b/src/vrpn/cmake/cmake-2.8.1-modules/patchctestbug10149/CTest.cmake deleted file mode 100644 index 0c5aaf4e0c4103a9b0b2402682cbe7ae35b3dbbd..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/cmake-2.8.1-modules/patchctestbug10149/CTest.cmake +++ /dev/null @@ -1,363 +0,0 @@ -# - Configure a project for testing with CTest/CDash -# Include this module in the top CMakeLists.txt file of a project to -# enable testing with CTest and dashboard submissions to CDash: -# project(MyProject) -# ... -# include(CTest) -# The module automatically creates a BUILD_TESTING option that selects -# whether to enable testing support (ON by default). After including -# the module, use code like -# if(BUILD_TESTING) -# # ... CMake code to create tests ... -# endif() -# to creating tests when testing is enabled. -# -# To enable submissions to a CDash server, create a CTestConfig.cmake -# file at the top of the project with content such as -# set(CTEST_PROJECT_NAME "MyProject") -# set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") -# set(CTEST_DROP_METHOD "http") -# set(CTEST_DROP_SITE "my.cdash.org") -# set(CTEST_DROP_LOCATION "/submit.php?project=MyProject") -# set(CTEST_DROP_SITE_CDASH TRUE) -# (the CDash server can provide the file to a project administrator -# who configures 'MyProject'). -# Settings in the config file are shared by both this CTest module and -# the CTest command-line tool's dashboard script mode (ctest -S). -# -# While building a project for submission to CDash, CTest scans the -# build output for errors and warnings and reports them with -# surrounding context from the build log. This generic approach works -# for all build tools, but does not give details about the command -# invocation that produced a given problem. One may get more detailed -# reports by adding -# set(CTEST_USE_LAUNCHERS 1) -# to the CTestConfig.cmake file. When this option is enabled, the -# CTest module tells CMake's Makefile generators to invoke every -# command in the generated build system through a CTest launcher -# program. (Currently the CTEST_USE_LAUNCHERS option is ignored on -# non-Makefile generators.) During a manual build each launcher -# transparently runs the command it wraps. During a CTest-driven -# build for submission to CDash each launcher reports detailed -# information when its command fails or warns. -# (Setting CTEST_USE_LAUNCHERS in CTestConfig.cmake is convenient, but -# also adds the launcher overhead even for manual builds. One may -# instead set it in a CTest dashboard script and add it to the CMake -# cache for the build tree.) - -#============================================================================= -# Copyright 2005-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see below. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the names of Kitware, Inc., the Insight Software Consortium, -# nor the names of their contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#============================================================================= - -option(BUILD_TESTING "Build the testing tree." ON) - -# function to turn generator name into a version string -# like vs7 vs71 vs8 vs9 -function(get_vs_version_string generator var) - string(REGEX - REPLACE - "Visual Studio ([0-9][0-9]?)($|.*)" - "\\1" - NUMBER - "${generator}") - if("${generator}" MATCHES "Visual Studio 7 .NET 2003") - set(ver_string "vs71") - else() - set(ver_string "vs${NUMBER}") - endif() - set(${var} ${ver_string} PARENT_SCOPE) -endfunction() - -if(BUILD_TESTING) - # Setup some auxilary macros - macro(set_if_not_set var val) - if(NOT DEFINED "${var}") - set("${var}" "${val}") - endif() - endmacro() - - macro(set_if_set var val) - if(NOT "${val}" MATCHES "^$") - set("${var}" "${val}") - endif() - endmacro() - - macro(set_if_set_and_not_set var val) - if(NOT "${val}" MATCHES "^$") - set_if_not_set("${var}" "${val}") - endif() - endmacro() - - # Make sure testing is enabled - enable_testing() - - if(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") - include("${PROJECT_SOURCE_DIR}/CTestConfig.cmake") - set_if_set_and_not_set(NIGHTLY_START_TIME - "${CTEST_NIGHTLY_START_TIME}") - set_if_set_and_not_set(DROP_METHOD "${CTEST_DROP_METHOD}") - set_if_set_and_not_set(DROP_SITE "${CTEST_DROP_SITE}") - set_if_set_and_not_set(DROP_SITE_USER "${CTEST_DROP_SITE_USER}") - set_if_set_and_not_set(DROP_SITE_PASSWORD - "${CTEST_DROP_SITE_PASWORD}") - set_if_set_and_not_set(DROP_SITE_MODE "${CTEST_DROP_SITE_MODE}") - set_if_set_and_not_set(DROP_LOCATION "${CTEST_DROP_LOCATION}") - set_if_set_and_not_set(TRIGGER_SITE "${CTEST_TRIGGER_SITE}") - set_if_set_and_not_set(UPDATE_TYPE "${CTEST_UPDATE_TYPE}") - endif() - - # the project can have a DartConfig.cmake file - if(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") - include("${PROJECT_SOURCE_DIR}/DartConfig.cmake") - else() - # Dashboard is opened for submissions for a 24 hour period starting at - # the specified NIGHTLY_START_TIME. Time is specified in 24 hour format. - set_if_not_set(NIGHTLY_START_TIME "00:00:00 EDT") - set_if_not_set(DROP_METHOD "http") - set_if_not_set(COMPRESS_SUBMISSION ON) - endif() - set_if_not_set(NIGHTLY_START_TIME "00:00:00 EDT") - - if(NOT UPDATE_TYPE) - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS") - set(UPDATE_TYPE cvs) - elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn") - set(UPDATE_TYPE svn) - elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr") - set(UPDATE_TYPE bzr) - elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg") - set(UPDATE_TYPE hg) - elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") - set(UPDATE_TYPE git) - endif() - endif() - - if(NOT UPDATE_TYPE) - if(NOT __CTEST_UPDATE_TYPE_COMPLAINED) - set(__CTEST_UPDATE_TYPE_COMPLAINED - 1 - CACHE - INTERNAL - "Already complained about update type.") - message(STATUS - "CTest cannot determine repository type. Please set UPDATE_TYPE to cvs, svn, bzr, hg, or git. CTest update will not work.") - endif() - endif() - - string(TOLOWER "${UPDATE_TYPE}" _update_type) - if("${_update_type}" STREQUAL "cvs") - find_program(CVSCOMMAND cvs) - set(CVS_UPDATE_OPTIONS - "-d -A -P" - CACHE - STRING - "Options passed to the cvs update command.") - set(UPDATE_COMMAND "${CVSCOMMAND}") - set(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}") - - elseif("${_update_type}" STREQUAL "svn") - find_program(SVNCOMMAND svn) - set(UPDATE_COMMAND "${SVNCOMMAND}") - set(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}") - - elseif("${_update_type}" STREQUAL "bzr") - find_program(BZRCOMMAND bzr) - set(UPDATE_COMMAND "${BZRCOMMAND}") - set(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}") - - elseif("${_update_type}" STREQUAL "hg") - find_program(HGCOMMAND hg) - set(UPDATE_COMMAND "${HGCOMMAND}") - set(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}") - - elseif("${_update_type}" STREQUAL "git") - find_program(GITCOMMAND git) - set(UPDATE_COMMAND "${GITCOMMAND}") - set(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}") - endif() - - set(DART_TESTING_TIMEOUT - 1500 - CACHE - STRING - "Maximum time allowed before CTest will kill the test.") - - find_program(MEMORYCHECK_COMMAND - NAMES - purify - valgrind - boundscheck - PATHS - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]" - DOC - "Path to the memory checking command, used for memory error detection.") - find_program(SLURM_SBATCH_COMMAND - sbatch - DOC - "Path to the SLURM sbatch executable") - find_program(SLURM_SRUN_COMMAND - srun - DOC - "Path to the SLURM srun executable") - set(MEMORYCHECK_SUPPRESSIONS_FILE - "" - CACHE - FILEPATH - "File that contains suppressions for the memory checker") - find_program(SCPCOMMAND - scp - DOC - "Path to scp command, used by CTest for submitting results to a Dart server") - find_program(COVERAGE_COMMAND - gcov - DOC - "Path to the coverage program that CTest uses for performing coverage inspection") - - # set the site name - site_name(SITE) - # set the build name - if(NOT BUILDNAME) - set(DART_COMPILER "${CMAKE_CXX_COMPILER}") - - if(NOT DART_COMPILER) - set(DART_COMPILER "${CMAKE_C_COMPILER}") - endif() - - if(NOT DART_COMPILER) - set(DART_COMPILER "unknown") - endif() - - if(WIN32) - set(DART_NAME_COMPONENT "NAME_WE") - else() - set(DART_NAME_COMPONENT "NAME") - endif() - - if(NOT BUILD_NAME_SYSTEM_NAME) - set(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}") - endif() - - if(WIN32) - set(BUILD_NAME_SYSTEM_NAME "Win32") - endif() - - if(UNIX OR BORLAND) - get_filename_component(DART_CXX_NAME - "${CMAKE_CXX_COMPILER}" - ${DART_NAME_COMPONENT}) - else() - get_filename_component(DART_CXX_NAME - "${CMAKE_BUILD_TOOL}" - ${DART_NAME_COMPONENT}) - endif() - - if(DART_CXX_NAME MATCHES "msdev") - set(DART_CXX_NAME "vs60") - endif() - - if(DART_CXX_NAME MATCHES "devenv") - get_vs_version_string("${CMAKE_GENERATOR}" DART_CXX_NAME) - endif() - - set(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}") - endif() - - # the build command - build_command(MAKECOMMAND CONFIGURATION "\${CTEST_CONFIGURATION_TYPE}") - set(MAKECOMMAND - ${MAKECOMMAND} - CACHE - STRING - "Command to build the project") - - # the default build configuration the ctest build handler will use - # if there is no -C arg given to ctest: - set(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") - if(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "") - set(DEFAULT_CTEST_CONFIGURATION_TYPE "Release") - endif() - - if(NOT "${CMAKE_GENERATOR}" MATCHES "Make") - set(CTEST_USE_LAUNCHERS 0) - endif() - - if(CTEST_USE_LAUNCHERS) - set(CTEST_LAUNCH_COMPILE - "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --") - set(CTEST_LAUNCH_LINK - "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --") - set(CTEST_LAUNCH_CUSTOM - "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --") - set_property(GLOBAL - PROPERTY - RULE_LAUNCH_COMPILE - "${CTEST_LAUNCH_COMPILE}") - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}") - set_property(GLOBAL - PROPERTY - RULE_LAUNCH_CUSTOM - "${CTEST_LAUNCH_CUSTOM}") - endif() - - mark_as_advanced(COVERAGE_COMMAND - CVSCOMMAND - SVNCOMMAND - BZRCOMMAND - HGCOMMAND - GITCOMMAND - CVS_UPDATE_OPTIONS - SVN_UPDATE_OPTIONS - BZR_UPDATE_OPTIONS - HG_UPDATE_OPTIONS - GIT_UPDATE_OPTIONS - MAKECOMMAND - MEMORYCHECK_COMMAND - MEMORYCHECK_SUPPRESSIONS_FILE - PURIFYCOMMAND - SCPCOMMAND - SLURM_SBATCH_COMMAND - SLURM_SRUN_COMMAND - SITE) - - if(NOT RUN_FROM_DART) - set(RUN_FROM_CTEST_OR_DART 1) - include(CTestTargets) - set(RUN_FROM_CTEST_OR_DART) - endif() -endif() diff --git a/src/vrpn/cmake/cmake-2.8.1-modules/patchctestbug10149/CTestScriptMode.cmake b/src/vrpn/cmake/cmake-2.8.1-modules/patchctestbug10149/CTestScriptMode.cmake deleted file mode 100644 index e6ab6341ba73fd7cc0dd4cab1154ad7c7b31472b..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/cmake-2.8.1-modules/patchctestbug10149/CTestScriptMode.cmake +++ /dev/null @@ -1,51 +0,0 @@ -# This file is read by ctest in script mode (-S) - -#============================================================================= -# Copyright 2009 Kitware, Inc. -# Copyright 2009 Alexander Neundorf <neundorf@kde.org> -# -# Distributed under the OSI-approved BSD License (the "License"); -# see below. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the names of Kitware, Inc., the Insight Software Consortium, -# nor the names of their contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#============================================================================= - -# Determine the current system, so this information can be used -# in ctest scripts -include(CMakeDetermineSystem) - -# Also load the system specific file, which sets up e.g. the search paths. -# This makes the FIND_XXX() calls work much better -include(CMakeSystemSpecificInformation) - diff --git a/src/vrpn/cmake/cmake-2.8.1-modules/patchctestbug10149/CTestTargets.cmake b/src/vrpn/cmake/cmake-2.8.1-modules/patchctestbug10149/CTestTargets.cmake deleted file mode 100644 index a964a039f039eb24d646371e99010c060e967e79..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/cmake-2.8.1-modules/patchctestbug10149/CTestTargets.cmake +++ /dev/null @@ -1,131 +0,0 @@ - -#============================================================================= -# Copyright 2005-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see below. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the names of Kitware, Inc., the Insight Software Consortium, -# nor the names of their contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#============================================================================= - -if(NOT RUN_FROM_CTEST_OR_DART) - message(FATAL_ERROR "Do not incldue CTestTargets.cmake directly") -endif() - -# make directories in the binary tree -file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary) -get_filename_component(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH) -set(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH}) -find_program(CMAKE_CTEST_COMMAND - ctest - ${CMAKE_HOST_PATH} - ${CMAKE_TARGET_PATH}) -mark_as_advanced(CMAKE_CTEST_COMMAND) - -# Use CTest -# configure files - -if(CTEST_NEW_FORMAT) - configure_file(${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in - ${PROJECT_BINARY_DIR}/CTestConfiguration.ini) -else() - configure_file(${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in - ${PROJECT_BINARY_DIR}/DartConfiguration.tcl) -endif() - -# -# Section 3: -# -# Custom targets to perform dashboard builds and submissions. -# These should NOT need to be modified from project to project. -# - -set(__conf_types "") -if(CMAKE_CONFIGURATION_TYPES) - # We need to pass the configuration type on the test command line. - set(__conf_types -C "${CMAKE_CFG_INTDIR}") -endif() - -# Add convenience targets. Do this at most once in case of nested -# projects. -define_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED - BRIEF_DOCS "Internal property used by CTestTargets module." - FULL_DOCS "Set by the CTestTargets module to track addition of testing targets.") - -get_property(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED) -if(NOT _CTEST_TARGETS_ADDED) - set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1) - - # For all generators add basic testing targets. - foreach(mode Experimental Nightly Continuous NightlyMemoryCheck) - add_custom_target(${mode} - ${CMAKE_CTEST_COMMAND} - ${__conf_types} - -D - ${mode}) - set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "") - endforeach() - - # For Makefile generators add more granular targets. - if("${CMAKE_GENERATOR}" MATCHES Make) - # Make targets for Experimental builds - foreach(mode Nightly Experimental Continuous) - foreach(testtype - Start - Update - Configure - Build - Test - Coverage - MemCheck - Submit) # missing purify - - add_custom_target(${mode}${testtype} - ${CMAKE_CTEST_COMMAND} - ${__conf_types} - -D - ${mode}${testtype}) - set_property(TARGET - ${mode}${testtype} - PROPERTY - RULE_LAUNCH_CUSTOM - "") - endforeach() - endforeach() - endif() # makefile generators - -endif() diff --git a/src/vrpn/cmake/cmake-2.8.3-modules/FixWinInstallPrefix.cmake b/src/vrpn/cmake/cmake-2.8.3-modules/FixWinInstallPrefix.cmake deleted file mode 100644 index 8169ddd6271464f44428c66e19b217ad90a95d29..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/cmake-2.8.3-modules/FixWinInstallPrefix.cmake +++ /dev/null @@ -1,77 +0,0 @@ -# - Automatically fix CMAKE_INSTALL_PREFIX to be bit-appropriate on Win -# -# This is a workaround for CMake bug #9992 in at least <=2.8.0 - see -# http://public.kitware.com/Bug/view.php?id=9992 -# -# It runs automatically when included on a Windows build (passes if(WIN32)) - -# include after setting your project name (and your module search path, -# obviously) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file ../LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(WIN32) - # caution - ENV{ProgramFiles} on Win64 is adjusted to point to the arch - # of the running executable which, since CMake is 32-bit on Windows as - # I write this, will always be = $ENV{ProgramFiles(x86)}. - # Thus, we only use this environment variable if we are on a 32 machine - - # 32-bit dir on win32, useless to us on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _PROG_FILES) - - # 32-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles(x86)}" _PROG_FILES_X86) - - # 64-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _PROG_FILES_W6432) - - if(CMAKE_SIZEOF_VOID_P MATCHES "8") - # 64-bit build on win64 - set(_PROGFILESDIR "${_PROG_FILES_W6432}") - else() - if(_PROG_FILES_W6432) - # 32-bit build on win64 - set(_PROGFILESDIR "${_PROG_FILES_X86}") - else() - # 32-bit build on win32 - set(_PROGFILESDIR "${_PROG_FILES}") - endif() - endif() - - if(NOT FIXWININSTALLPREFIX_PREFIX) - set(_needsfix yes) - elseif(NOT - "${FIXWININSTALLPREFIX_PREFIX}" - STREQUAL - "${CMAKE_INSTALL_PREFIX}") - set(_needsfix yes) - else() - set(_needsfix) - endif() - - if(_needsfix) - if("${CMAKE_INSTALL_PREFIX}" - STREQUAL - "${_PROG_FILES}/${CMAKE_PROJECT_NAME}") - # The user didn't change this yet - it's the potentially broken default - set(CMAKE_INSTALL_PREFIX - "${_PROGFILESDIR}/${CMAKE_PROJECT_NAME}" - CACHE - PATH - "Where to install the project - has been adjusted by FixWinInstallPrefix" - FORCE) - endif() - set(FIXWININSTALLPREFIX_PREFIX - "${CMAKE_INSTALL_PREFIX}" - CACHE - INTERNAL - "We've fixed the prefix.") - endif() -endif() diff --git a/src/vrpn/cmake/cmake-2.8.3-modules/autoinclude.cmake b/src/vrpn/cmake/cmake-2.8.3-modules/autoinclude.cmake deleted file mode 100644 index 64d8f62b90be741ce9ecb525fa9556cc353a60df..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/cmake-2.8.3-modules/autoinclude.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# - Autoinclude these policies automatically -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file ../LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -include(FixWinInstallPrefix) diff --git a/src/vrpn/cmake/cmake-2.8.4-modules/ImproveEclipseGCCErrors.cmake b/src/vrpn/cmake/cmake-2.8.4-modules/ImproveEclipseGCCErrors.cmake deleted file mode 100644 index 2f7f3170d62e4f347767cf1ed81c4a8eea6c9923..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/cmake-2.8.4-modules/ImproveEclipseGCCErrors.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# - Add a GCC flag so that the errors are more suitable to parsing by Eclipse -# -# include(ImproveEclipseGCCErrors) -# -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file ../LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if("${CMAKE_GENERATOR}" MATCHES "Eclipse" AND CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") -endif() diff --git a/src/vrpn/cmake/cmake-2.8.4-modules/autoinclude.cmake b/src/vrpn/cmake/cmake-2.8.4-modules/autoinclude.cmake deleted file mode 100644 index 2c98e249991fe29da3711b76580d210f95c2dcf0..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/cmake-2.8.4-modules/autoinclude.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# - Autoinclude these policies automatically -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file ../LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -include(ImproveEclipseGCCErrors) diff --git a/src/vrpn/cmake/cmake-2.8.4-modules/boost/FindBoost.cmake b/src/vrpn/cmake/cmake-2.8.4-modules/boost/FindBoost.cmake deleted file mode 100644 index 9dbfb8023ec76f3fc34bcba9aa82a8ce29280530..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/cmake-2.8.4-modules/boost/FindBoost.cmake +++ /dev/null @@ -1,1171 +0,0 @@ -# - Try to find Boost include dirs and libraries -# Usage of this module as follows: -# -# NOTE: Take note of the Boost_ADDITIONAL_VERSIONS variable below. -# Due to Boost naming conventions and limitations in CMake this find -# module is NOT future safe with respect to Boost version numbers, -# and may break. -# -# == Using Header-Only libraries from within Boost: == -# -# find_package( Boost 1.36.0 ) -# if(Boost_FOUND) -# include_directories(${Boost_INCLUDE_DIRS}) -# add_executable(foo foo.cc) -# endif() -# -# -# == Using actual libraries from within Boost: == -# -# set(Boost_USE_STATIC_LIBS ON) -# set(Boost_USE_MULTITHREADED ON) -# set(Boost_USE_STATIC_RUNTIME OFF) -# find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... ) -# -# if(Boost_FOUND) -# include_directories(${Boost_INCLUDE_DIRS}) -# add_executable(foo foo.cc) -# target_link_libraries(foo ${Boost_LIBRARIES}) -# endif() -# -# -# The components list needs to contain actual names of boost libraries only, -# such as "date_time" for "libboost_date_time". If you're using parts of -# Boost that contain header files only (e.g. foreach) you do not need to -# specify COMPONENTS. -# -# You should provide a minimum version number that should be used. If you provide this -# version number and specify the REQUIRED attribute, this module will fail if it -# can't find the specified or a later version. If you specify a version number this is -# automatically put into the considered list of version numbers and thus doesn't need -# to be specified in the Boost_ADDITIONAL_VERSIONS variable (see below). -# -# NOTE for Visual Studio Users: -# Automatic linking is used on MSVC & Borland compilers by default when -# #including things in Boost. It's important to note that setting -# Boost_USE_STATIC_LIBS to OFF is NOT enough to get you dynamic linking, -# should you need this feature. Automatic linking typically uses static -# libraries with a few exceptions (Boost.Python is one). -# -# Please see the section below near Boost_LIB_DIAGNOSTIC_DEFINITIONS for -# more details. Adding a TARGET_LINK_LIBRARIES() as shown in the example -# above appears to cause VS to link dynamically if Boost_USE_STATIC_LIBS -# gets set to OFF. It is suggested you avoid automatic linking since it -# will make your application less portable. -# -# =========== The mess that is Boost_ADDITIONAL_VERSIONS (sorry?) ============ -# -# OK, so the Boost_ADDITIONAL_VERSIONS variable can be used to specify a list of -# boost version numbers that should be taken into account when searching -# for Boost. Unfortunately boost puts the version number into the -# actual filename for the libraries, so this variable will certainly be needed -# in the future when new Boost versions are released. -# -# Currently this module searches for the following version numbers: -# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1, -# 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0, -# 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0, -# 1.45, 1.45.0, 1.46, 1.46.0 -# -# NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should -# add both 1.x and 1.x.0 as shown above. Official Boost include directories -# omit the 3rd version number from include paths if it is 0 although not all -# binary Boost releases do so. -# -# SET(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0") -# -# ===================================== ============= ======================== -# -# Variables used by this module, they can change the default behaviour and -# need to be set before calling find_package: -# -# Boost_USE_MULTITHREADED Can be set to OFF to use the non-multithreaded -# boost libraries. If not specified, defaults -# to ON. -# -# Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static -# boost libraries. Defaults to OFF. -# -# Boost_NO_SYSTEM_PATHS Set to TRUE to suppress searching in system -# paths (or other locations outside of BOOST_ROOT -# or BOOST_INCLUDEDIR). Useful when specifying -# BOOST_ROOT. Defaults to OFF. -# [Since CMake 2.8.3] -# -# Boost_USE_STATIC_RUNTIME If enabled, searches for boost libraries -# linked against a static C++ standard library -# ('s' ABI tag). This option should be set to -# ON or OFF because the default behavior -# if not specified is platform dependent -# for backwards compatibility. -# [Since CMake 2.8.3] -# -# Boost_USE_DEBUG_PYTHON If enabled, searches for boost libraries -# compiled against a special debug build of -# Python ('y' ABI tag). Defaults to OFF. -# [Since CMake 2.8.3] -# -# Boost_USE_STLPORT If enabled, searches for boost libraries -# compiled against the STLPort standard -# library ('p' ABI tag). Defaults to OFF. -# [Since CMake 2.8.3] -# -# Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS -# If enabled, searches for boost libraries -# compiled against the deprecated STLPort -# "native iostreams" feature ('n' ABI tag). -# Defaults to OFF. -# [Since CMake 2.8.3] -# -# Other Variables used by this module which you may want to set. -# -# Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching -# the boost include directory. Please see -# the documentation above regarding this -# annoying, but necessary variable :( -# -# Boost_DEBUG Set this to TRUE to enable debugging output -# of FindBoost.cmake if you are having problems. -# Please enable this before filing any bug -# reports. -# -# Boost_DETAILED_FAILURE_MSG FindBoost doesn't output detailed information -# about why it failed or how to fix the problem -# unless this is set to TRUE or the REQUIRED -# keyword is specified in find_package(). -# [Since CMake 2.8.0] -# -# Boost_COMPILER Set this to the compiler suffix used by Boost -# (e.g. "-gcc43") if FindBoost has problems finding -# the proper Boost installation -# -# Boost_THREADAPI When building boost.thread, sometimes the name of the -# library contains an additional "pthread" or "win32" -# string known as the threadapi. This can happen when -# compiling against pthreads on Windows or win32 threads -# on Cygwin. You may specify this variable and if set -# when FindBoost searches for the Boost threading library -# it will first try to match the threadapi you specify. -# For Example: libboost_thread_win32-mgw45-mt-1_43.a -# might be found if you specified "win32" here before -# falling back on libboost_thread-mgw45-mt-1_43.a. -# [Since CMake 2.8.3] -# -# Boost_REALPATH Resolves symbolic links for discovered boost libraries -# to assist with packaging. For example, instead of -# Boost_SYSTEM_LIBRARY_RELEASE being resolved to -# "/usr/lib/libboost_system.so" it would be -# "/usr/lib/libboost_system.so.1.42.0" instead. -# This does not affect linking and should not be -# enabled unless the user needs this information. -# [Since CMake 2.8.3] -# - - -# -# These last three variables are available also as environment variables: -# -# BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for -# Boost. Set this if the module has problems finding -# the proper Boost installation. To prevent falling -# back on the system paths, set Boost_NO_SYSTEM_PATHS -# to true. -# -# BOOST_INCLUDEDIR Set this to the include directory of Boost, if the -# module has problems finding the proper Boost installation -# -# BOOST_LIBRARYDIR Set this to the lib directory of Boost, if the -# module has problems finding the proper Boost installation -# -# Variables defined by this module: -# -# Boost_FOUND System has Boost, this means the include dir was -# found, as well as all the libraries specified in -# the COMPONENTS list. -# -# Boost_INCLUDE_DIRS Boost include directories: not cached -# -# Boost_INCLUDE_DIR This is almost the same as above, but this one is -# cached and may be modified by advanced users -# -# Boost_LIBRARIES Link to these to use the Boost libraries that you -# specified: not cached -# -# Boost_LIBRARY_DIRS The path to where the Boost library files are. -# -# Boost_VERSION The version number of the boost libraries that -# have been found, same as in version.hpp from Boost -# -# Boost_LIB_VERSION The version number in filename form as -# it's appended to the library filenames -# -# Boost_MAJOR_VERSION major version number of boost -# Boost_MINOR_VERSION minor version number of boost -# Boost_SUBMINOR_VERSION subminor version number of boost -# -# Boost_LIB_DIAGNOSTIC_DEFINITIONS [WIN32 Only] You can call -# add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS}) -# to have diagnostic information about Boost's -# automatic linking outputted during compilation time. -# -# For each component you specify in find_package(), the following (UPPER-CASE) -# variables are set. You can use these variables if you would like to pick and -# choose components for your targets instead of just using Boost_LIBRARIES. -# -# Boost_${COMPONENT}_FOUND True IF the Boost library "component" was found. -# -# Boost_${COMPONENT}_LIBRARY Contains the libraries for the specified Boost -# "component" (includes debug and optimized keywords -# when needed). - -#============================================================================= -# Copyright 2006-2009 Kitware, Inc. -# Copyright 2006-2008 Andreas Schneider <mail@cynapses.org> -# Copyright 2007 Wengo -# Copyright 2007 Mike Jackson -# Copyright 2008 Andreas Pakulat <apaku@gmx.de> -# Copyright 2008-2010 Philip Lowman <philip@yhbt.com> -# -# Distributed under the OSI-approved BSD License (the "License"); -# see below. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the names of Kitware, Inc., the Insight Software Consortium, -# nor the names of their contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#============================================================================= - -#------------------------------------------------------------------------------- -# FindBoost functions & macros -# -############################################ -# -# Check the existence of the libraries. -# -############################################ -# This macro was taken directly from the FindQt4.cmake file that is included -# with the CMake distribution. This is NOT my work. All work was done by the -# original authors of the FindQt4.cmake file. Only minor modifications were -# made to remove references to Qt and make this file more generally applicable -# And ELSE/ENDIF pairs were removed for readability. -######################################################################### - -MACRO (_Boost_ADJUST_LIB_VARS basename) - IF (Boost_INCLUDE_DIR ) - IF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE) - # if the generator supports configuration types then set - # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) - ELSE() - # if there are no configuration types and CMAKE_BUILD_TYPE has no value - # then just use the release libraries - SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} ) - ENDIF() - # FIXME: This probably should be set for both cases - SET(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) - ENDIF() - - # if only the release version was found, set the debug variable also to the release version - IF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG) - SET(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE}) - SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE}) - SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE}) - ENDIF() - - # if only the debug version was found, set the release variable also to the debug version - IF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE) - SET(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG}) - SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG}) - SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG}) - ENDIF() - - IF (Boost_${basename}_LIBRARY) - set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library") - - # Remove superfluous "debug" / "optimized" keywords from - # Boost_LIBRARY_DIRS - FOREACH(_boost_my_lib ${Boost_${basename}_LIBRARY}) - GET_FILENAME_COMPONENT(_boost_my_lib_path "${_boost_my_lib}" PATH) - LIST(APPEND Boost_LIBRARY_DIRS ${_boost_my_lib_path}) - ENDFOREACH() - LIST(REMOVE_DUPLICATES Boost_LIBRARY_DIRS) - - set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory") - SET(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found") - ENDIF(Boost_${basename}_LIBRARY) - - ENDIF (Boost_INCLUDE_DIR ) - # Make variables changeble to the advanced user - MARK_AS_ADVANCED( - Boost_${basename}_LIBRARY - Boost_${basename}_LIBRARY_RELEASE - Boost_${basename}_LIBRARY_DEBUG - ) -ENDMACRO (_Boost_ADJUST_LIB_VARS) - -#------------------------------------------------------------------------------- - -# -# Runs compiler with "-dumpversion" and parses major/minor -# version with a regex. -# -FUNCTION(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION) - - EXEC_PROGRAM(${CMAKE_CXX_COMPILER} - ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion - OUTPUT_VARIABLE _boost_COMPILER_VERSION - ) - STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" - _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION}) - - SET(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE) -ENDFUNCTION() - -# -# A convenience function for marking desired components -# as found or not -# -function(_Boost_MARK_COMPONENTS_FOUND _yes_or_no) - foreach(COMPONENT ${Boost_FIND_COMPONENTS}) - string(TOUPPER ${COMPONENT} UPPERCOMPONENT) - set(Boost_${UPPERCOMPONENT}_FOUND ${_yes_or_no} CACHE INTERNAL "Whether the Boost ${COMPONENT} library found" FORCE) - endforeach() -endfunction() - -# -# Take a list of libraries with "thread" in it -# and prepend duplicates with "thread_${Boost_THREADAPI}" -# at the front of the list -# -function(_Boost_PREPEND_LIST_WITH_THREADAPI _output) - set(_orig_libnames ${ARGN}) - string(REPLACE "thread" "thread_${Boost_THREADAPI}" _threadapi_libnames ${_orig_libnames}) - set(${_output} ${_threadapi_libnames} ${_orig_libnames} PARENT_SCOPE) -endfunction() - -# -# If a library is found, replace its cache entry with its REALPATH -# -function(_Boost_SWAP_WITH_REALPATH _library _docstring) - if(${_library}) - get_filename_component(_boost_filepathreal ${${_library}} REALPATH) - unset(${_library} CACHE) - set(${_library} ${_boost_filepathreal} CACHE FILEPATH "${_docstring}") - endif() -endfunction() - -# -# End functions/macros -# -#------------------------------------------------------------------------------- - - - - -IF(NOT DEFINED Boost_USE_MULTITHREADED) - SET(Boost_USE_MULTITHREADED TRUE) -ENDIF() - -if(Boost_FIND_VERSION_EXACT) - # The version may appear in a directory with or without the patch - # level, even when the patch level is non-zero. - set(_boost_TEST_VERSIONS - "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}" - "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") -else(Boost_FIND_VERSION_EXACT) - # The user has not requested an exact version. Among known - # versions, find those that are acceptable to the user request. - set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} - "1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42" - "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" - "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" - "1.34" "1.33.1" "1.33.0" "1.33") - set(_boost_TEST_VERSIONS) - if(Boost_FIND_VERSION) - set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") - # Select acceptable versions. - foreach(version ${_Boost_KNOWN_VERSIONS}) - if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}") - # This version is high enough. - list(APPEND _boost_TEST_VERSIONS "${version}") - elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99") - # This version is a short-form for the requested version with - # the patch level dropped. - list(APPEND _boost_TEST_VERSIONS "${version}") - endif() - endforeach(version) - else(Boost_FIND_VERSION) - # Any version is acceptable. - set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}") - endif(Boost_FIND_VERSION) -endif(Boost_FIND_VERSION_EXACT) - -# The reason that we failed to find Boost. This will be set to a -# user-friendly message when we fail to find some necessary piece of -# Boost. -set(Boost_ERROR_REASON) - -SET( _boost_IN_CACHE TRUE) -IF(Boost_INCLUDE_DIR) - - # On versions < 1.35, remove the System library from the considered list - # since it wasn't added until 1.35. - if(Boost_VERSION AND Boost_FIND_COMPONENTS) - if(Boost_VERSION LESS 103500) - list(REMOVE_ITEM Boost_FIND_COMPONENTS system) - endif() - endif() - - FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) - STRING(TOUPPER ${COMPONENT} COMPONENT) - IF(NOT Boost_${COMPONENT}_FOUND) - SET( _boost_IN_CACHE FALSE) - ENDIF(NOT Boost_${COMPONENT}_FOUND) - ENDFOREACH(COMPONENT) -ELSE(Boost_INCLUDE_DIR) - SET( _boost_IN_CACHE FALSE) -ENDIF(Boost_INCLUDE_DIR) - -IF (_boost_IN_CACHE) - # in cache already - SET(Boost_FOUND TRUE) - FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) - STRING(TOUPPER ${COMPONENT} COMPONENT) - _Boost_ADJUST_LIB_VARS( ${COMPONENT} ) - SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY}) - ENDFOREACH(COMPONENT) - SET(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) - IF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") - MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") - MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") - MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") - ENDIF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} " - "is already in the cache. To view debugging messages, please clear the cache.") - endif() -ELSE (_boost_IN_CACHE) - # Need to search for boost - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost not in cache") - # Output some of their choices - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost_USE_STATIC_RUNTIME = ${Boost_USE_STATIC_RUNTIME}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost_ADDITIONAL_VERSIONS = ${Boost_ADDITIONAL_VERSIONS}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}") - endif() - - IF(WIN32) - # In windows, automatic linking is performed, so you do not have - # to specify the libraries. If you are linking to a dynamic - # runtime, then you can choose to link to either a static or a - # dynamic Boost library, the default is to do a static link. You - # can alter this for a specific library "whatever" by defining - # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be - # linked dynamically. Alternatively you can force all Boost - # libraries to dynamic link by defining BOOST_ALL_DYN_LINK. - - # This feature can be disabled for Boost library "whatever" by - # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining - # BOOST_ALL_NO_LIB. - - # If you want to observe which libraries are being linked against - # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking - # code to emit a #pragma message each time a library is selected - # for linking. - SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS - "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define") - ENDIF(WIN32) - - set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM - C:/boost/include - C:/boost - "$ENV{ProgramFiles}/boost/include" - "$ENV{ProgramFiles}/boost" - /sw/local/include - ) - - # If Boost_ROOT was defined, gently correct the user - if(Boost_ROOT) - message("WARNING: Boost_ROOT was set which is incorrect and is being ignored. " - "You need to use BOOST_ROOT instead. " - "Also, we suggest setting Boost_NO_SYSTEM_PATHS.") - endif() - - # If BOOST_ROOT was defined in the environment, use it. - if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") - set(BOOST_ROOT $ENV{BOOST_ROOT}) - endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") - - # If BOOSTROOT was defined in the environment, use it. - if (NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "") - set(BOOST_ROOT $ENV{BOOSTROOT}) - endif(NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "") - - # If BOOST_INCLUDEDIR was defined in the environment, use it. - IF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" ) - set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR}) - ENDIF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" ) - - # If BOOST_LIBRARYDIR was defined in the environment, use it. - IF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" ) - set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR}) - ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" ) - - IF( BOOST_ROOT ) - file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT) - ENDIF( BOOST_ROOT ) - - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Declared as CMake or Environmental Variables:") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " BOOST_ROOT = ${BOOST_ROOT}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " BOOST_INCLUDEDIR = ${BOOST_INCLUDEDIR}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") - endif() - - if( Boost_NO_SYSTEM_PATHS) - set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH) - else() - set(_boost_INCLUDE_SEARCH_DIRS ${_boost_INCLUDE_SEARCH_DIRS_SYSTEM}) - endif() - - if( BOOST_ROOT ) - set(_boost_INCLUDE_SEARCH_DIRS - ${BOOST_ROOT}/include - ${BOOST_ROOT} - ${_boost_INCLUDE_SEARCH_DIRS}) - endif() - - # prepend BOOST_INCLUDEDIR to search path if specified - if( BOOST_INCLUDEDIR ) - file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR) - set(_boost_INCLUDE_SEARCH_DIRS - ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS}) - endif( BOOST_INCLUDEDIR ) - - # ------------------------------------------------------------------------ - # Search for Boost include DIR - # ------------------------------------------------------------------------ - # Try to find Boost by stepping backwards through the Boost versions - # we know about. - IF( NOT Boost_INCLUDE_DIR ) - # Build a list of path suffixes for each version. - SET(_boost_PATH_SUFFIXES) - FOREACH(_boost_VER ${_boost_TEST_VERSIONS}) - # Add in a path suffix, based on the required version, ideally - # we could read this from version.hpp, but for that to work we'd - # need to know the include dir already - set(_boost_BOOSTIFIED_VERSION) - - # Transform 1.35 => 1_35 and 1.36.0 => 1_36_0 - IF(_boost_VER MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+") - STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3" - _boost_BOOSTIFIED_VERSION ${_boost_VER}) - ELSEIF(_boost_VER MATCHES "[0-9]+\\.[0-9]+") - STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2" - _boost_BOOSTIFIED_VERSION ${_boost_VER}) - ENDIF() - - list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}") - list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}") - - ENDFOREACH(_boost_VER) - - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Include debugging info:") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " _boost_INCLUDE_SEARCH_DIRS = ${_boost_INCLUDE_SEARCH_DIRS}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " _boost_PATH_SUFFIXES = ${_boost_PATH_SUFFIXES}") - endif() - - # Look for a standard boost header file. - FIND_PATH(Boost_INCLUDE_DIR - NAMES boost/config.hpp - HINTS ${_boost_INCLUDE_SEARCH_DIRS} - PATH_SUFFIXES ${_boost_PATH_SUFFIXES} - ${_boost_FIND_OPTIONS} - ) - ENDIF( NOT Boost_INCLUDE_DIR ) - - # ------------------------------------------------------------------------ - # Extract version information from version.hpp - # ------------------------------------------------------------------------ - - IF(Boost_INCLUDE_DIR) - # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp - # Read the whole file: - # - SET(BOOST_VERSION 0) - SET(BOOST_LIB_VERSION "") - FILE(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS) - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp") - endif() - - STRING(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}") - STRING(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}") - - SET(Boost_LIB_VERSION ${Boost_LIB_VERSION} CACHE INTERNAL "The library version string for boost libraries") - SET(Boost_VERSION ${Boost_VERSION} CACHE INTERNAL "The version number for boost libraries") - - IF(NOT "${Boost_VERSION}" STREQUAL "0") - MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") - MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") - MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") - - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") - ENDIF(NOT "${Boost_VERSION}" STREQUAL "0") - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "version.hpp reveals boost " - "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") - endif() - ELSE(Boost_INCLUDE_DIR) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") - ENDIF(Boost_INCLUDE_DIR) - - # ------------------------------------------------------------------------ - # Suffix initialization and compiler suffix detection. - # ------------------------------------------------------------------------ - - # Setting some more suffixes for the library - SET (Boost_LIB_PREFIX "") - if ( WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) - SET (Boost_LIB_PREFIX "lib") - endif() - - if (Boost_COMPILER) - set(_boost_COMPILER ${Boost_COMPILER}) - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "using user-specified Boost_COMPILER = ${_boost_COMPILER}") - endif() - else(Boost_COMPILER) - # Attempt to guess the compiler suffix - # NOTE: this is not perfect yet, if you experience any issues - # please report them and use the Boost_COMPILER variable - # to work around the problems. - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" - OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" - OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") - if(WIN32) - set (_boost_COMPILER "-iw") - else() - set (_boost_COMPILER "-il") - endif() - elseif (MSVC90) - SET (_boost_COMPILER "-vc90") - elseif (MSVC10) - SET (_boost_COMPILER "-vc100") - elseif (MSVC80) - SET (_boost_COMPILER "-vc80") - elseif (MSVC71) - SET (_boost_COMPILER "-vc71") - elseif (MSVC70) # Good luck! - SET (_boost_COMPILER "-vc7") # yes, this is correct - elseif (MSVC60) # Good luck! - SET (_boost_COMPILER "-vc6") # yes, this is correct - elseif (BORLAND) - SET (_boost_COMPILER "-bcb") - elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro") - set(_boost_COMPILER "-sw") - elseif (MINGW) - if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) - SET(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34 - else() - _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) - SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") - endif() - elseif (UNIX) - if (CMAKE_COMPILER_IS_GNUCXX) - if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) - SET(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34 - else() - _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) - # Determine which version of GCC we have. - IF(APPLE) - IF(Boost_MINOR_VERSION) - IF(${Boost_MINOR_VERSION} GREATER 35) - # In Boost 1.36.0 and newer, the mangled compiler name used - # on Mac OS X/Darwin is "xgcc". - SET(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") - ELSE(${Boost_MINOR_VERSION} GREATER 35) - # In Boost <= 1.35.0, there is no mangled compiler name for - # the Mac OS X/Darwin version of GCC. - SET(_boost_COMPILER "") - ENDIF(${Boost_MINOR_VERSION} GREATER 35) - ELSE(Boost_MINOR_VERSION) - # We don't know the Boost version, so assume it's - # pre-1.36.0. - SET(_boost_COMPILER "") - ENDIF(Boost_MINOR_VERSION) - ELSE() - SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") - ENDIF() - endif() - endif (CMAKE_COMPILER_IS_GNUCXX) - endif() - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "guessed _boost_COMPILER = ${_boost_COMPILER}") - endif() - endif(Boost_COMPILER) - - set (_boost_MULTITHREADED "-mt") - if( NOT Boost_USE_MULTITHREADED ) - set (_boost_MULTITHREADED "") - endif() - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_MULTITHREADED = ${_boost_MULTITHREADED}") - endif() - - #====================== - # Systematically build up the Boost ABI tag - # http://boost.org/doc/libs/1_41_0/more/getting_started/windows.html#library-naming - set( _boost_RELEASE_ABI_TAG "-") - set( _boost_DEBUG_ABI_TAG "-") - # Key Use this library when: - # s linking statically to the C++ standard library and - # compiler runtime support libraries. - if(Boost_USE_STATIC_RUNTIME) - set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s") - set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}s") - endif() - # g using debug versions of the standard and runtime - # support libraries - if(WIN32) - if(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" - OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") - set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g") - endif() - endif() - # y using special debug build of python - if(Boost_USE_DEBUG_PYTHON) - set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}y") - endif() - # d using a debug version of your code - set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}d") - # p using the STLport standard library rather than the - # default one supplied with your compiler - if(Boost_USE_STLPORT) - set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}p") - set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}p") - endif() - # n using the STLport deprecated "native iostreams" feature - if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS) - set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}n") - set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}n") - endif() - - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_RELEASE_ABI_TAG = ${_boost_RELEASE_ABI_TAG}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_DEBUG_ABI_TAG = ${_boost_DEBUG_ABI_TAG}") - endif() - - # ------------------------------------------------------------------------ - # Begin finding boost libraries - # ------------------------------------------------------------------------ - - if(BOOST_ROOT) - set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS - ${BOOST_ROOT}/lib - ${BOOST_ROOT}/stage/lib) - endif() - set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS - ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS} - ${Boost_INCLUDE_DIR}/lib - ${Boost_INCLUDE_DIR}/../lib - ${Boost_INCLUDE_DIR}/stage/lib - ) - set(_boost_LIBRARY_SEARCH_DIRS_SYSTEM - C:/boost/lib - C:/boost - "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib" - "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}/lib" - "$ENV{ProgramFiles}/boost/lib" - "$ENV{ProgramFiles}/boost" - /sw/local/lib - ) - set(_boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS}) - if( Boost_NO_SYSTEM_PATHS ) - set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH) - else() - list(APPEND _boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_SYSTEM}) - endif() - - # prepend BOOST_LIBRARYDIR to search path if specified - if( BOOST_LIBRARYDIR ) - file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR) - set(_boost_LIBRARY_SEARCH_DIRS - ${BOOST_LIBRARYDIR} ${_boost_LIBRARY_SEARCH_DIRS}) - endif() - - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_LIBRARY_SEARCH_DIRS = ${_boost_LIBRARY_SEARCH_DIRS}") - endif() - - # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES - if( Boost_USE_STATIC_LIBS ) - set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - if(WIN32) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - else() - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ) - endif() - endif() - - # We want to use the tag inline below without risking double dashes - if(_boost_RELEASE_ABI_TAG) - if(${_boost_RELEASE_ABI_TAG} STREQUAL "-") - set(_boost_RELEASE_ABI_TAG "") - endif() - endif() - if(_boost_DEBUG_ABI_TAG) - if(${_boost_DEBUG_ABI_TAG} STREQUAL "-") - set(_boost_DEBUG_ABI_TAG "") - endif() - endif() - - # The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled - # on WIN32 was to: - # 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found) - # 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found) - # We maintain this behavior since changing it could break people's builds. - # To disable the ambiguous behavior, the user need only - # set Boost_USE_STATIC_RUNTIME either ON or OFF. - set(_boost_STATIC_RUNTIME_WORKAROUND false) - if(WIN32 AND Boost_USE_STATIC_LIBS) - if(NOT DEFINED Boost_USE_STATIC_RUNTIME) - set(_boost_STATIC_RUNTIME_WORKAROUND true) - endif() - endif() - - - foreach(COMPONENT ${Boost_FIND_COMPONENTS}) - string(TOUPPER ${COMPONENT} UPPERCOMPONENT) - set( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" ) - set( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" ) - set( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND") - - set( _boost_docstring_release "Boost ${COMPONENT} library (release)") - set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)") - - # - # Find RELEASE libraries - # - set(_boost_RELEASE_NAMES - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} - ${Boost_LIB_PREFIX}boost_${COMPONENT} ) - if(_boost_STATIC_RUNTIME_WORKAROUND) - set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}") - list(APPEND _boost_RELEASE_NAMES - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} ) - endif() - if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread") - _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES}) - endif() - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}") - endif() - find_library(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE - NAMES ${_boost_RELEASE_NAMES} - HINTS ${_boost_LIBRARY_SEARCH_DIRS} - ${_boost_FIND_OPTIONS} - DOC "${_boost_docstring_release}" - ) - - # - # Find DEBUG libraries - # - set(_boost_DEBUG_NAMES - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED} - ${Boost_LIB_PREFIX}boost_${COMPONENT} ) - if(_boost_STATIC_RUNTIME_WORKAROUND) - set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}") - list(APPEND _boost_DEBUG_NAMES - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} ) - endif() - if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread") - _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES}) - endif() - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}") - endif() - find_library(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG - NAMES ${_boost_DEBUG_NAMES} - HINTS ${_boost_LIBRARY_SEARCH_DIRS} - ${_boost_FIND_OPTIONS} - DOC "${_boost_docstring_debug}" - ) - - if(Boost_REALPATH) - _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "${_boost_docstring_release}") - _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "${_boost_docstring_debug}" ) - endif() - - _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) - - endforeach(COMPONENT) - - # Restore the original find library ordering - if( Boost_USE_STATIC_LIBS ) - set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) - endif() - # ------------------------------------------------------------------------ - # End finding boost libraries - # ------------------------------------------------------------------------ - - SET(Boost_INCLUDE_DIRS - ${Boost_INCLUDE_DIR} - ) - - SET(Boost_FOUND FALSE) - IF(Boost_INCLUDE_DIR) - SET( Boost_FOUND TRUE ) - - # Check the version of Boost against the requested version. - if (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) - message(SEND_ERROR "When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34") - endif (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) - if(Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) - set( Boost_FOUND FALSE ) - set(_Boost_VERSION_AGE "old") - elseif(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) - if(Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" ) - set( Boost_FOUND FALSE ) - set(_Boost_VERSION_AGE "old") - elseif(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) - if( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" ) - set( Boost_FOUND FALSE ) - set(_Boost_VERSION_AGE "old") - endif( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" ) - endif( Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" ) - endif( Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) - - if (NOT Boost_FOUND) - _Boost_MARK_COMPONENTS_FOUND(OFF) - endif() - - if (Boost_FOUND AND Boost_FIND_VERSION_EXACT) - # If the user requested an exact version of Boost, check - # that. We already know that the Boost version we have is >= the - # requested version. - set(_Boost_VERSION_AGE "new") - - # If the user didn't specify a patchlevel, it's 0. - if (NOT Boost_FIND_VERSION_PATCH) - set(Boost_FIND_VERSION_PATCH 0) - endif (NOT Boost_FIND_VERSION_PATCH) - - # We'll set Boost_FOUND true again if we have an exact version match. - set(Boost_FOUND FALSE) - _Boost_MARK_COMPONENTS_FOUND(OFF) - if(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) - if(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) - if(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" ) - set( Boost_FOUND TRUE ) - _Boost_MARK_COMPONENTS_FOUND(ON) - endif(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" ) - endif( Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) - endif( Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) - endif (Boost_FOUND AND Boost_FIND_VERSION_EXACT) - - if(NOT Boost_FOUND) - # State that we found a version of Boost that is too new or too old. - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") - if (Boost_FIND_VERSION_PATCH) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}") - endif (Boost_FIND_VERSION_PATCH) - if (NOT Boost_FIND_VERSION_EXACT) - set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)") - endif (NOT Boost_FIND_VERSION_EXACT) - set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.") - endif (NOT Boost_FOUND) - - # Always check for missing components - set(_boost_CHECKED_COMPONENT FALSE) - set(_Boost_MISSING_COMPONENTS "") - foreach(COMPONENT ${Boost_FIND_COMPONENTS}) - string(TOUPPER ${COMPONENT} COMPONENT) - set(_boost_CHECKED_COMPONENT TRUE) - if(NOT Boost_${COMPONENT}_FOUND) - string(TOLOWER ${COMPONENT} COMPONENT) - list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT}) - set( Boost_FOUND FALSE) - endif(NOT Boost_${COMPONENT}_FOUND) - endforeach(COMPONENT) - - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}") - endif() - - if (_Boost_MISSING_COMPONENTS) - # We were unable to find some libraries, so generate a sensible - # error message that lists the libraries we were unable to find. - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}\nThe following Boost libraries could not be found:\n") - foreach(COMPONENT ${_Boost_MISSING_COMPONENTS}) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON} boost_${COMPONENT}\n") - endforeach(COMPONENT) - - list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED) - list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS) - if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") - else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") - endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) - endif (_Boost_MISSING_COMPONENTS) - - IF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) - # Compatibility Code for backwards compatibility with CMake - # 2.4's FindBoost module. - - # Look for the boost library path. - # Note that the user may not have installed any libraries - # so it is quite possible the Boost_LIBRARY_PATH may not exist. - SET(_boost_LIB_DIR ${Boost_INCLUDE_DIR}) - - IF("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+") - GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) - ENDIF ("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+") - - IF("${_boost_LIB_DIR}" MATCHES "/include$") - # Strip off the trailing "/include" in the path. - GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) - ENDIF("${_boost_LIB_DIR}" MATCHES "/include$") - - IF(EXISTS "${_boost_LIB_DIR}/lib") - SET (_boost_LIB_DIR ${_boost_LIB_DIR}/lib) - ELSE(EXISTS "${_boost_LIB_DIR}/lib") - IF(EXISTS "${_boost_LIB_DIR}/stage/lib") - SET(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib) - ELSE(EXISTS "${_boost_LIB_DIR}/stage/lib") - SET(_boost_LIB_DIR "") - ENDIF(EXISTS "${_boost_LIB_DIR}/stage/lib") - ENDIF(EXISTS "${_boost_LIB_DIR}/lib") - - IF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}") - SET(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory") - ENDIF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}") - - ENDIF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) - - ELSE(Boost_INCLUDE_DIR) - SET( Boost_FOUND FALSE) - ENDIF(Boost_INCLUDE_DIR) - - IF (Boost_FOUND) - IF (NOT Boost_FIND_QUIETLY) - MESSAGE(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") - if(Boost_FIND_COMPONENTS) - message(STATUS "Found the following Boost libraries:") - endif() - ENDIF(NOT Boost_FIND_QUIETLY) - FOREACH ( COMPONENT ${Boost_FIND_COMPONENTS} ) - STRING( TOUPPER ${COMPONENT} UPPERCOMPONENT ) - IF ( Boost_${UPPERCOMPONENT}_FOUND ) - IF (NOT Boost_FIND_QUIETLY) - MESSAGE (STATUS " ${COMPONENT}") - ENDIF(NOT Boost_FIND_QUIETLY) - SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY}) - ENDIF ( Boost_${UPPERCOMPONENT}_FOUND ) - ENDFOREACH(COMPONENT) - else() - if(Boost_FIND_REQUIRED) - message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}") - else() - if(NOT Boost_FIND_QUIETLY) - # we opt not to automatically output Boost_ERROR_REASON here as - # it could be quite lengthy and somewhat imposing in it's requests - # Since Boost is not always a required dependency we'll leave this - # up to the end-user. - if(Boost_DEBUG OR Boost_DETAILED_FAILURE_MSG) - message(STATUS "Could NOT find Boost\n${Boost_ERROR_REASON}") - else() - message(STATUS "Could NOT find Boost") - endif() - endif() - endif(Boost_FIND_REQUIRED) - endif() - - # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view - MARK_AS_ADVANCED(Boost_INCLUDE_DIR - Boost_INCLUDE_DIRS - Boost_LIBRARY_DIRS - ) -ENDIF(_boost_IN_CACHE) diff --git a/src/vrpn/cmake/cmake-4.0.0-modules/RequireOutOfSourceBuild.cmake b/src/vrpn/cmake/cmake-4.0.0-modules/RequireOutOfSourceBuild.cmake deleted file mode 100644 index 9b27970b500cecfa730dbb82fc8da90c62f12117..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/cmake-4.0.0-modules/RequireOutOfSourceBuild.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# - Issue an error if the source tree is in or equal to the build tree -# -# include(RequireOutOfSourceBuild) -# -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file ../LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -get_filename_component(_src "${CMAKE_SOURCE_DIR}" ABSOLUTE) -get_filename_component(_cur_src "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) -get_filename_component(_bin "${CMAKE_BINARY_DIR}" ABSOLUTE) - -string(LENGTH "${_src}" _src_len) -string(LENGTH "${_cur_src}" _cur_src_len) -string(LENGTH "${_bin}" _bin_len) - -set(_test) - -if(NOT "${_bin_len}" GREATER "${_src_len}") - list(APPEND _test _src) - #message(STATUS "Checking ${_src}") -endif() - -if(NOT "${_bin_len}" GREATER "${_cur_src_len}") - list(APPEND _test _cur_src) - #message(STATUS "Checking ${_cur_src}") -endif() - -foreach(_var ${_test}) - string(SUBSTRING "${${_var}}" 0 ${_bin_len} _chopped) - #message(STATUS "comparing ${_bin} and ${_chopped}") - if("${_bin}" STREQUAL "${_chopped}") - get_filename_component(_parent "${CMAKE_SOURCE_DIR}/.." ABSOLUTE) - message(FATAL_ERROR - "You must set a binary directory that is different from your source directory. You might consider ${CMAKE_SOURCE_DIR}/build or ${_parent}/build-${CMAKE_PROJECT_NAME}") - endif() -endforeach() diff --git a/src/vrpn/cmake/cmake-4.0.0-modules/autoinclude.cmake b/src/vrpn/cmake/cmake-4.0.0-modules/autoinclude.cmake deleted file mode 100644 index e9206ee08a3a82b97d10fd822d5b43e688f1b10d..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/cmake-4.0.0-modules/autoinclude.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# - Autoinclude these policies automatically -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file ../LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -include(RequireOutOfSourceBuild) diff --git a/src/vrpn/cmake/ghost-fake-stl/alloc.h b/src/vrpn/cmake/ghost-fake-stl/alloc.h deleted file mode 100644 index cc8883f51f1e7afe14224757a7a7288356d89970..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/ghost-fake-stl/alloc.h +++ /dev/null @@ -1,14 +0,0 @@ -/** @file - @brief Fake header to allow GHOST 4.09 use with MSVC 2005 - - @date 2012 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -#pragma once diff --git a/src/vrpn/cmake/ghost-fake-stl/hash_map.h b/src/vrpn/cmake/ghost-fake-stl/hash_map.h deleted file mode 100644 index fcf3f0d0bb0ac6864ab492e0594e1a513ec9e28d..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/ghost-fake-stl/hash_map.h +++ /dev/null @@ -1,28 +0,0 @@ -/** @file - @brief Fake header to allow GHOST 4.09 use with MSVC 2005 - - @date 2012 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -#pragma once - -#include <hash_map> -//using stdext::hash_map; - -template<typename Key> -class hash; -template<typename Key> -class equal_to; - -template<typename Key, typename Val, typename HashFcn, typename EqualKey, typename Alloc> -class hash_map; - -template<typename Key, typename Val> -class hash_map<Key, Val, hash<Key>, equal_to<Val> > : public stdext::hash_map<Key, Val> {}; diff --git a/src/vrpn/cmake/ghost-fake-stl/iostream.h b/src/vrpn/cmake/ghost-fake-stl/iostream.h deleted file mode 100644 index 7d7195fd2f0f5146bc1e8f5e253ac9f6277a3632..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/ghost-fake-stl/iostream.h +++ /dev/null @@ -1,20 +0,0 @@ -/** @file - @brief Fake header to allow GHOST 4.09 use with MSVC 2005 - - @date 2010 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -#pragma once - -#include <iostream> -using std::istream; -using std::ostream; -using std::cerr; -using std::endl; \ No newline at end of file diff --git a/src/vrpn/cmake/ghost-fake-stl/list.h b/src/vrpn/cmake/ghost-fake-stl/list.h deleted file mode 100644 index a8b3fc24de594bb4528e1fad7376987bd404fa13..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/ghost-fake-stl/list.h +++ /dev/null @@ -1,20 +0,0 @@ -/** @file - @brief Fake header to allow GHOST 4.09 use with MSVC 2005 - - @date 2010 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -#pragma once - -#include <list> -using std::list; - -// Disable dll export that depends on the SGI STL implementation -#undef GHOST_EXTRA_TEMPLATE_DECLARATIONS \ No newline at end of file diff --git a/src/vrpn/cmake/ghost-fake-stl/pair.h b/src/vrpn/cmake/ghost-fake-stl/pair.h deleted file mode 100644 index af793b5533714134c9f414252c2490d3a836581f..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/ghost-fake-stl/pair.h +++ /dev/null @@ -1,17 +0,0 @@ -/** @file - @brief Fake header to allow GHOST 4.09 use with MSVC 2005 - - @date 2012 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -#pragma once - -#include <utility> -using std::pair; diff --git a/src/vrpn/cmake/ghost-fake-stl/set.h b/src/vrpn/cmake/ghost-fake-stl/set.h deleted file mode 100644 index 880696135280be9716e35c28c490e359dc26e73b..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/ghost-fake-stl/set.h +++ /dev/null @@ -1,19 +0,0 @@ -/** @file - @brief Fake header to allow GHOST 4.09 use with MSVC 2005 - - @date 2010 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -#pragma once - -#include <set> -#include <functional> -using std::set; -using std::less; \ No newline at end of file diff --git a/src/vrpn/cmake/ghost-fake-stl/vector.h b/src/vrpn/cmake/ghost-fake-stl/vector.h deleted file mode 100644 index 659db2d68aa755de10cbf74b9b5054ea2e9f4811..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/ghost-fake-stl/vector.h +++ /dev/null @@ -1,20 +0,0 @@ -/** @file - @brief Fake header to allow GHOST 4.09 use with MSVC 2005 - - @date 2010 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -#pragma once - -#include <vector> -using std::vector; - -// Disable dll export that depends on the SGI STL implementation -#undef GHOST_EXTRA_TEMPLATE_DECLARATIONS \ No newline at end of file diff --git a/src/vrpn/cmake/libmodbus_CMakeLists.txt b/src/vrpn/cmake/libmodbus_CMakeLists.txt deleted file mode 100644 index 00c91129196eabc2ab4d49009390fbaead71d50d..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/libmodbus_CMakeLists.txt +++ /dev/null @@ -1,178 +0,0 @@ -# This is a CMakeLists flie that will let libmodbus 3.0.5 compile -# under Visual Studio 2008. For other architectures, and Cygwin, -# just use the configure command in the source directory. -# Copy this file, along with stdin.g and config.h (rename them to -# remove the libmodbus_ part of the name) into the src/ directory -# in libmodbus, then use CMake to construct a build for the library. - -cmake_minimum_required(VERSION 2.8.3) -project(LIBMODBUS) - -#----------------------------------------------------------------------------- -# XXX Things to make better. -# -# Repeat for all other configurable headers/libraries - see below for a list -# Move the shared-library code over to CMake's normal definition -# Improve this CPack installer. - -### -# Local CMake Modules - keep this first -### -list(APPEND CMAKE_MODULE_PATH ${LIBMODBUS_SOURCE_DIR}/cmake) - -### -# On Windows 7, it does not work to install in the default location, -# which is the Program Files directory, because you have to not only have -# file permission to write there but also "run as administrator." This -# means that "make install" from a Visual Studio project fails. To get -# around that, we need to set CMAKE_INSTALL_PREFIX to something other -# than the default. However, it is a cache variable that has already been -# set. If we make a local variable, it uses this rather than the cache -# variable and never tells the poor user what happened (the GUI location -# looks standard but the files end up somewhere else). If we make it a -# non-forced cache variable, it already has a value so does not change. -# If we make it a forced cache variable, it gets overwritten every time -# and the user cannot change it on the GUI. So we have a workaround here. -# We make a cache variable that records whether we have ever forced the -# install prefix. If not, we force it. If so, we don't force it again. -# This has the effect of setting it the first time cmake is run, showing -# the change in the GUI, and also letting the user change the value in -# the GUI if they don't like what we did. If I knew how to do this only -# happen on Windows 7, I'd make the if(WIN32) more specific. -if(WIN32 AND NOT SUBPROJECT) - if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT - AND - (NOT - ONCE_SET_CMAKE_INSTALL_PREFIX)) - set(ONCE_SET_CMAKE_INSTALL_PREFIX - true - CACHE - INTERNAL - "Have we set the install prefix yet?" - FORCE) - set(CMAKE_INSTALL_PREFIX - C:/usr/local - CACHE - PATH - "Install path prefix, prepended onto install directories" - FORCE) - endif() -endif() - - -#----------------------------------------------------------------------------- -# Compiler flags we got from Hans for Windows and from Sheldon Andrews -# for other architectures. -if(MSVC) # MS-Windows Visual Studio, both 32 and 64 bits - set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows") - if(MSVC_VERSION GREATER 1310) # This compiler flag needs newer than VS.NET 2003 (7.1) - # Choose fast, possibly less accurate floating point - # See http://msdn.microsoft.com/en-us/library/e7s85ffb(v=vs.80).aspx - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:fast") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast") - endif() - - # Do not assume fixed base address (probably for DLL integration?) - # http://msdn.microsoft.com/en-us/library/w368ysh2(v=vs.80).aspx - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /FIXED:NO") -else() - # GCC compilers on 64-bit machines require -fPIC for shared libraries or libs - # linked into shared libraries. - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_SHARED_LIBRARY_C_FLAGS}") - set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") -endif() - -# Set up correct defines for Windows header compilation: -# This theoretically sets the lower-bound on operating system compatibility -# http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx -# NT4 0x0400 -# Win2k 0x0500 -# WinXP 0x0501 -# WS2003SP1/WinXPSP2 0x0502 -# Vista 0x0600 -# Win7 0x0601 -# Win8 0x0601 -if(WIN32) - set(WIN_MIN_VER 0x0500) # Default to Windows 2000 - if(MSVC AND MSVC_VERSION GREATER 1699) - # VS2012: defaults to vista+, update 1 added XP support in additional toolset. - if("${CMAKE_VS_PLATFORM_TOOLSET}" MATCHES "_xp") - set(WIN_MIN_VER 0x0501) # WinXP - else() - set(WIN_MIN_VER 0x0600) # Vista - endif() - endif() - add_definitions("-D_WIN32_WINNT=${WIN_MIN_VER}" "-DNTDDI_VERSION=${WIN_MIN_VER}0000") -endif() - -#----------------------------------------------------------------------------- -# Options that control what gets built and how. - -# Force use of our CMake-processed configuration header before the stock one. -include_directories("${PROJECT_BINARY_DIR}") - - -# Include directory needed by all of the files -include_directories(${LIBMODBUS_SOURCE_DIR}) - - -### -# Windows-specific (non-Cygwin) dependencies -### -if(WIN32 AND NOT UNIX) - # Winsock - needed for TCP support - list(APPEND EXTRA_LIBS ws2_32) -endif() - -#----------------------------------------------------------------------------- -# Build the library itself and declare what bits need to be installed - -set(LIBMODBUS_SOURCES - modbus.c - modbus-data.c - modbus-rtu.c - modbus-tcp.c -) - -set(LIBMODBUS_PUBLIC_HEADERS - modbus.h - modbus-rtu.h - modbus-tcp.h - modbus-tcp-private.h - modbus-version.h -) - -add_library(libmodbus ${LIBMODBUS_SOURCES} ${LIBMODBUS_PUBLIC_HEADERS}) -target_link_libraries(libmodbus ${EXTRA_LIBS}) -set(LIBMODBUS_LIBRARY libmodbus) - -set_property(TARGET - libmodbus - PROPERTY - PUBLIC_HEADER - ${LIBMODBUS_PUBLIC_HEADERS}) - -set_property(TARGET - libmodbus - PROPERTY - PROJECT_LABEL - "LIBMODBUS Library") - -set_property(TARGET - libmodbus - PROPERTY - FOLDER - "Library") - -install(TARGETS - libmodbus - ARCHIVE - DESTINATION - lib - PUBLIC_HEADER - DESTINATION - include -) - diff --git a/src/vrpn/cmake/libmodbus_config.h b/src/vrpn/cmake/libmodbus_config.h deleted file mode 100644 index dca08cdafd253dc3fd1b2200e0d60bab7a63bea6..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/libmodbus_config.h +++ /dev/null @@ -1,231 +0,0 @@ -/* This is a configuration file for libmodbus that will let - the library compile under Microsoft Visual Studio 2008. - Copy it along with the CMakeLists.txt file into the src/ - directory under libmodbus version 3.0.5 and then use CMake - to build. */ - -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the <arpa/inet.h> header file. */ -#define HAVE_ARPA_INET_H 1 - -/* Define to 1 if you have the declaration of `TIOCSRS485', and to 0 if you - don't. */ -#define HAVE_DECL_TIOCSRS485 0 - -/* Define to 1 if you have the declaration of `__CYGWIN__', and to 0 if you - don't. */ -#define HAVE_DECL___CYGWIN__ 1 - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the <errno.h> header file. */ -#define HAVE_ERRNO_H 1 - -/* Define to 1 if you have the <fcntl.h> header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have the `fork' function. */ -#define HAVE_FORK 1 - -/* Define to 1 if you have the `getaddrinfo' function. */ -#define HAVE_GETADDRINFO 1 - -/* Define to 1 if you have the `gettimeofday' function. */ -#define HAVE_GETTIMEOFDAY 1 - -/* Define to 1 if you have the `inet_ntoa' function. */ -#define HAVE_INET_NTOA 1 - -/* Define to 1 if you have the <inttypes.h> header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the <limits.h> header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the <linux/serial.h> header file. */ -/* #undef HAVE_LINUX_SERIAL_H */ - -/* Define to 1 if you have the <memory.h> header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `memset' function. */ -#define HAVE_MEMSET 1 - -/* Define to 1 if you have the <netdb.h> header file. */ -#define HAVE_NETDB_H 1 - -/* Define to 1 if you have the <netinet/in.h> header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the <netinet/tcp.h> header file. */ -#define HAVE_NETINET_TCP_H 1 - -/* Define to 1 if you have the `select' function. */ -#define HAVE_SELECT 1 - -/* Define to 1 if you have the `socket' function. */ -#define HAVE_SOCKET 1 - -/* Define to 1 if you have the <stdint.h> header file. */ -#define HAVE_STDINT_H 0 - -/* Define to 1 if you have the <stdlib.h> header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strerror' function. */ -#define HAVE_STRERROR 1 - -/* Define to 1 if you have the <strings.h> header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the <string.h> header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strlcpy' function. */ -#define HAVE_STRLCPY 0 - -/* Define to 1 if you have the <sys/ioctl.h> header file. */ -#define HAVE_SYS_IOCTL_H 1 - -/* Define to 1 if you have the <sys/socket.h> header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the <sys/time.h> header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the <sys/types.h> header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the <termios.h> header file. */ -#define HAVE_TERMIOS_H 1 - -/* Define to 1 if you have the <time.h> header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the <unistd.h> header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the `vfork' function. */ -#define HAVE_VFORK 1 - -/* Define to 1 if you have the <vfork.h> header file. */ -/* #undef HAVE_VFORK_H */ - -/* Define to 1 if you have the <winsock2.h> header file. */ -/* #undef HAVE_WINSOCK2_H */ - -/* Define to 1 if `fork' works. */ -#define HAVE_WORKING_FORK 1 - -/* Define to 1 if `vfork' works. */ -#define HAVE_WORKING_VFORK 1 - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#define LT_OBJDIR ".libs/" - -/* Name of package */ -#define PACKAGE "libmodbus" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "https://github.com/stephane/libmodbus/issues" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "libmodbus" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libmodbus 3.0.5" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "libmodbus" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "3.0.5" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ -#define TIME_WITH_SYS_TIME 1 - -/* Version number of package */ -#define VERSION "3.0.5" - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define to `int' if <sys/types.h> does not define. */ -/* #undef pid_t */ - -/* Define to `unsigned int' if <sys/types.h> does not define. */ -/* #undef size_t */ - -/* Define as `fork' if `vfork' does not work. */ -/* #undef vfork */ - -#ifndef STRLCPY_DEFINED -#define STRLCPY_DEFINED - -/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */ - -/* - * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> -#include <string.h> - -/* - * Copy src to string dst of size siz. At most siz-1 characters - * will be copied. Always NUL terminates (unless siz == 0). - * Returns strlen(src); if retval >= siz, truncation occurred. - */ -static size_t -strlcpy(char *dst, const char *src, size_t siz) -{ - char *d = dst; - const char *s = src; - size_t n = siz; - - /* Copy as many bytes as will fit */ - if (n != 0) { - while (--n != 0) { - if ((*d++ = *s++) == '\0') - break; - } - } - - /* Not enough room in dst, add NUL and traverse rest of src */ - if (n == 0) { - if (siz != 0) - *d = '\0'; /* NUL-terminate dst */ - while (*s++) - ; - } - - return(s - src - 1); /* count does not include NUL */ -} - -#endif - diff --git a/src/vrpn/cmake/libmodbus_stdint.h b/src/vrpn/cmake/libmodbus_stdint.h deleted file mode 100644 index d02608a5972642c7b7a13b987f21e2502a5af3ea..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/libmodbus_stdint.h +++ /dev/null @@ -1,247 +0,0 @@ -// ISO C9x compliant stdint.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// -// Copyright (c) 2006-2008 Alexander Chemeris -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. The name of the author may be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _MSC_VER // [ -#error "Use this header only with Microsoft Visual C++ compilers!" -#endif // _MSC_VER ] - -#ifndef _MSC_STDINT_H_ // [ -#define _MSC_STDINT_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#include <limits.h> - -// For Visual Studio 6 in C++ mode and for many Visual Studio versions when -// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}' -// or compiler give many errors like this: -// error C2733: second C linkage of overloaded function 'wmemchr' not allowed -#ifdef __cplusplus -extern "C" { -#endif -# include <wchar.h> -#ifdef __cplusplus -} -#endif - -// Define _W64 macros to mark types changing their size, like intptr_t. -#ifndef _W64 -# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 -# define _W64 __w64 -# else -# define _W64 -# endif -#endif - - -// 7.18.1 Integer types - -// 7.18.1.1 Exact-width integer types - -// Visual Studio 6 and Embedded Visual C++ 4 doesn't -// realize that, e.g. char has the same size as __int8 -// so we give up on __intX for them. -#if (_MSC_VER < 1300) - typedef signed char int8_t; - typedef signed short int16_t; - typedef signed int int32_t; - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; -#else - typedef signed __int8 int8_t; - typedef signed __int16 int16_t; - typedef signed __int32 int32_t; - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; -#endif -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; - - -// 7.18.1.2 Minimum-width integer types -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -typedef int64_t int_least64_t; -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -typedef uint64_t uint_least64_t; - -// 7.18.1.3 Fastest minimum-width integer types -typedef int8_t int_fast8_t; -typedef int16_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef int64_t int_fast64_t; -typedef uint8_t uint_fast8_t; -typedef uint16_t uint_fast16_t; -typedef uint32_t uint_fast32_t; -typedef uint64_t uint_fast64_t; - -// 7.18.1.4 Integer types capable of holding object pointers -#ifdef _WIN64 // [ - typedef signed __int64 intptr_t; - typedef unsigned __int64 uintptr_t; -#else // _WIN64 ][ - typedef _W64 signed int intptr_t; - typedef _W64 unsigned int uintptr_t; -#endif // _WIN64 ] - -// 7.18.1.5 Greatest-width integer types -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; - - -// 7.18.2 Limits of specified-width integer types - -#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 - -// 7.18.2.1 Limits of exact-width integer types -#define INT8_MIN ((int8_t)_I8_MIN) -#define INT8_MAX _I8_MAX -#define INT16_MIN ((int16_t)_I16_MIN) -#define INT16_MAX _I16_MAX -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX _I32_MAX -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX _I64_MAX -#define UINT8_MAX _UI8_MAX -#define UINT16_MAX _UI16_MAX -#define UINT32_MAX _UI32_MAX -#define UINT64_MAX _UI64_MAX - -// 7.18.2.2 Limits of minimum-width integer types -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MIN INT64_MIN -#define INT_LEAST64_MAX INT64_MAX -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -// 7.18.2.3 Limits of fastest minimum-width integer types -#define INT_FAST8_MIN INT8_MIN -#define INT_FAST8_MAX INT8_MAX -#define INT_FAST16_MIN INT16_MIN -#define INT_FAST16_MAX INT16_MAX -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MIN INT64_MIN -#define INT_FAST64_MAX INT64_MAX -#define UINT_FAST8_MAX UINT8_MAX -#define UINT_FAST16_MAX UINT16_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -// 7.18.2.4 Limits of integer types capable of holding object pointers -#ifdef _WIN64 // [ -# define INTPTR_MIN INT64_MIN -# define INTPTR_MAX INT64_MAX -# define UINTPTR_MAX UINT64_MAX -#else // _WIN64 ][ -# define INTPTR_MIN INT32_MIN -# define INTPTR_MAX INT32_MAX -# define UINTPTR_MAX UINT32_MAX -#endif // _WIN64 ] - -// 7.18.2.5 Limits of greatest-width integer types -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -// 7.18.3 Limits of other integer types - -#ifdef _WIN64 // [ -# define PTRDIFF_MIN _I64_MIN -# define PTRDIFF_MAX _I64_MAX -#else // _WIN64 ][ -# define PTRDIFF_MIN _I32_MIN -# define PTRDIFF_MAX _I32_MAX -#endif // _WIN64 ] - -#define SIG_ATOMIC_MIN INT_MIN -#define SIG_ATOMIC_MAX INT_MAX - -#ifndef SIZE_MAX // [ -# ifdef _WIN64 // [ -# define SIZE_MAX _UI64_MAX -# else // _WIN64 ][ -# define SIZE_MAX _UI32_MAX -# endif // _WIN64 ] -#endif // SIZE_MAX ] - -// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h> -#ifndef WCHAR_MIN // [ -# define WCHAR_MIN 0 -#endif // WCHAR_MIN ] -#ifndef WCHAR_MAX // [ -# define WCHAR_MAX _UI16_MAX -#endif // WCHAR_MAX ] - -#define WINT_MIN 0 -#define WINT_MAX _UI16_MAX - -#endif // __STDC_LIMIT_MACROS ] - - -// 7.18.4 Limits of other integer types - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 - -// 7.18.4.1 Macros for minimum-width integer constants - -#define INT8_C(val) val##i8 -#define INT16_C(val) val##i16 -#define INT32_C(val) val##i32 -#define INT64_C(val) val##i64 - -#define UINT8_C(val) val##ui8 -#define UINT16_C(val) val##ui16 -#define UINT32_C(val) val##ui32 -#define UINT64_C(val) val##ui64 - -// 7.18.4.2 Macros for greatest-width integer constants -#define INTMAX_C INT64_C -#define UINTMAX_C UINT64_C - -#endif // __STDC_CONSTANT_MACROS ] - - -#endif // _MSC_STDINT_H_ ] diff --git a/src/vrpn/cmake/nested_targets/OpenHaptics/CMakeLists.txt b/src/vrpn/cmake/nested_targets/OpenHaptics/CMakeLists.txt deleted file mode 100644 index f46daa391613dea8e349d0d123fe4eeacd10b68d..0000000000000000000000000000000000000000 --- a/src/vrpn/cmake/nested_targets/OpenHaptics/CMakeLists.txt +++ /dev/null @@ -1,95 +0,0 @@ -# - Build the OpenHaptics utility libraries as a part of your solution. -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file ../../LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(WIN32) - # Work around bug in library at least <= 3.10 - add_definitions(-DWIN32) -endif() -include_directories("${HDAPI_HDU_INCLUDE_DIR}" - "${HDAPI_INCLUDE_DIR}" - "${HLAPI_HLU_INCLUDE_DIR}" - "${HLAPI_INCLUDE_DIR}") - -if(HDAPI_HDU_LIBRARY STREQUAL "openhaptics_hdu_nested_target") - add_library(openhaptics_hdu_nested_target - STATIC - EXCLUDE_FROM_ALL - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hduBoundBox.h" - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hduError.h" - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hduGenericMatrix.h" - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hdu.h" - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hduHapticDevice.h" - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hduLine.h" - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hduLineSegment.h" - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hduMath.h" - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hduMatrix.h" - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hduPlane.h" - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hduQuaternion.h" - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hduRecord.h" - "${HDAPI_HDU_INCLUDE_DIR}/HDU/hduVector.h" - "${HDAPI_HDU_SOURCE_DIR}/hdu.cpp" - "${HDAPI_HDU_SOURCE_DIR}/hduAfx.cpp" - "${HDAPI_HDU_SOURCE_DIR}/hduAfx.h" - "${HDAPI_HDU_SOURCE_DIR}/hduDecompose.cpp" - "${HDAPI_HDU_SOURCE_DIR}/hduDecompose.h" - "${HDAPI_HDU_SOURCE_DIR}/hduError.cpp" - "${HDAPI_HDU_SOURCE_DIR}/hduHapticDevice.cpp" - "${HDAPI_HDU_SOURCE_DIR}/hduLine.cpp" - "${HDAPI_HDU_SOURCE_DIR}/hduLineSegment.cpp" - "${HDAPI_HDU_SOURCE_DIR}/hduMatrix.cpp" - "${HDAPI_HDU_SOURCE_DIR}/hduPlane.cpp" - "${HDAPI_HDU_SOURCE_DIR}/hduQuaternion.cpp" - "${HDAPI_HDU_SOURCE_DIR}/hduRecord.cpp") - target_link_libraries(openhaptics_hdu_nested_target ${HDAPI_LIBRARY}) - set_property(TARGET - openhaptics_hdu_nested_target - PROPERTY - PROJECT_LABEL - "OpenHaptics HDU Library") - - if(MSVC) - # Disable warnings - no sense in warning about Sensable's potential bugs. - set_property(TARGET - openhaptics_hdu_nested_target - PROPERTY - COMPILE_FLAGS - "/wd4189 /wd4701") - endif() -endif() - - -if(HLAPI_HLU_LIBRARY STREQUAL "openhaptics_hlu_nested_target") - add_library(openhaptics_hlu_nested_target - STATIC - EXCLUDE_FROM_ALL - "${HLAPI_HLU_INCLUDE_DIR}/HLU/hlu.h" - "${HLAPI_HLU_SOURCE_DIR}/hlu.cpp" - "${HLAPI_HLU_SOURCE_DIR}/hluAfx.cpp" - "${HLAPI_HLU_SOURCE_DIR}/hluAfx.h") - target_link_libraries(openhaptics_hlu_nested_target ${HLAPI_LIBRARY} ${HDAPI_LIBRARY}) - - set_property(TARGET - openhaptics_hlu_nested_target - PROPERTY - PROJECT_LABEL - "OpenHaptics HLU Library") - - if(MSVC) - # Disable warnings - no sense in warning about Sensable's potential bugs. - set_property(TARGET - openhaptics_hlu_nested_target - APPEND - PROPERTY - COMPILE_FLAGS - /wd4189) - endif() -endif() diff --git a/src/vrpn/demos/afm-plus-lammps/afm-plus.psf b/src/vrpn/demos/afm-plus-lammps/afm-plus.psf deleted file mode 100644 index 5550f38a3905beec123e9173049639c61592b68b..0000000000000000000000000000000000000000 --- a/src/vrpn/demos/afm-plus-lammps/afm-plus.psf +++ /dev/null @@ -1,16197 +0,0 @@ -PSF - - 1 !NTITLE - REMARKS $Id$ - REMARKS Virtual AFM demo topology - - 13671 !NATOM - 1 0 SUB SU SU 0.000000 1.0000 0 - 2 0 SUB SU SU 0.000000 1.0000 0 - 3 0 SUB SU SU 0.000000 1.0000 0 - 4 0 SUB SU SU 0.000000 1.0000 0 - 5 0 SUB SU SU 0.000000 1.0000 0 - 6 0 SUB SU SU 0.000000 1.0000 0 - 7 0 SUB SU SU 0.000000 1.0000 0 - 8 0 SUB SU SU 0.000000 1.0000 0 - 9 0 SUB SU SU 0.000000 1.0000 0 - 10 0 SUB SU SU 0.000000 1.0000 0 - 11 0 SUB SU SU 0.000000 1.0000 0 - 12 0 SUB SU SU 0.000000 1.0000 0 - 13 0 SUB SU SU 0.000000 1.0000 0 - 14 0 SUB SU SU 0.000000 1.0000 0 - 15 0 SUB SU SU 0.000000 1.0000 0 - 16 0 SUB SU SU 0.000000 1.0000 0 - 17 0 SUB SU SU 0.000000 1.0000 0 - 18 0 SUB SU SU 0.000000 1.0000 0 - 19 0 SUB SU SU 0.000000 1.0000 0 - 20 0 SUB SU SU 0.000000 1.0000 0 - 21 0 SUB SU SU 0.000000 1.0000 0 - 22 0 SUB SU SU 0.000000 1.0000 0 - 23 0 SUB SU SU 0.000000 1.0000 0 - 24 0 SUB SU SU 0.000000 1.0000 0 - 25 0 SUB SU SU 0.000000 1.0000 0 - 26 0 SUB SU SU 0.000000 1.0000 0 - 27 0 SUB SU SU 0.000000 1.0000 0 - 28 0 SUB SU SU 0.000000 1.0000 0 - 29 0 SUB SU SU 0.000000 1.0000 0 - 30 0 SUB SU SU 0.000000 1.0000 0 - 31 0 SUB SU SU 0.000000 1.0000 0 - 32 0 SUB SU SU 0.000000 1.0000 0 - 33 0 SUB SU SU 0.000000 1.0000 0 - 34 0 SUB SU SU 0.000000 1.0000 0 - 35 0 SUB SU SU 0.000000 1.0000 0 - 36 0 SUB SU SU 0.000000 1.0000 0 - 37 0 SUB SU SU 0.000000 1.0000 0 - 38 0 SUB SU SU 0.000000 1.0000 0 - 39 0 SUB SU SU 0.000000 1.0000 0 - 40 0 SUB SU SU 0.000000 1.0000 0 - 41 0 SUB SU SU 0.000000 1.0000 0 - 42 0 SUB SU SU 0.000000 1.0000 0 - 43 0 SUB SU SU 0.000000 1.0000 0 - 44 0 SUB SU SU 0.000000 1.0000 0 - 45 0 SUB SU SU 0.000000 1.0000 0 - 46 0 SUB SU SU 0.000000 1.0000 0 - 47 0 SUB SU SU 0.000000 1.0000 0 - 48 0 SUB SU SU 0.000000 1.0000 0 - 49 0 SUB SU SU 0.000000 1.0000 0 - 50 0 SUB SU SU 0.000000 1.0000 0 - 51 0 SUB SU SU 0.000000 1.0000 0 - 52 0 SUB SU SU 0.000000 1.0000 0 - 53 0 SUB SU SU 0.000000 1.0000 0 - 54 0 SUB SU SU 0.000000 1.0000 0 - 55 0 SUB SU SU 0.000000 1.0000 0 - 56 0 SUB SU SU 0.000000 1.0000 0 - 57 0 SUB SU SU 0.000000 1.0000 0 - 58 0 SUB SU SU 0.000000 1.0000 0 - 59 0 SUB SU SU 0.000000 1.0000 0 - 60 0 SUB SU SU 0.000000 1.0000 0 - 61 0 SUB SU SU 0.000000 1.0000 0 - 62 0 SUB SU SU 0.000000 1.0000 0 - 63 0 SUB SU SU 0.000000 1.0000 0 - 64 0 SUB SU SU 0.000000 1.0000 0 - 65 0 SUB SU SU 0.000000 1.0000 0 - 66 0 SUB SU SU 0.000000 1.0000 0 - 67 0 SUB SU SU 0.000000 1.0000 0 - 68 0 SUB SU SU 0.000000 1.0000 0 - 69 0 SUB SU SU 0.000000 1.0000 0 - 70 0 SUB SU SU 0.000000 1.0000 0 - 71 0 SUB SU SU 0.000000 1.0000 0 - 72 0 SUB SU SU 0.000000 1.0000 0 - 73 0 SUB SU SU 0.000000 1.0000 0 - 74 0 SUB SU SU 0.000000 1.0000 0 - 75 0 SUB SU SU 0.000000 1.0000 0 - 76 0 SUB SU SU 0.000000 1.0000 0 - 77 0 SUB SU SU 0.000000 1.0000 0 - 78 0 SUB SU SU 0.000000 1.0000 0 - 79 0 SUB SU SU 0.000000 1.0000 0 - 80 0 SUB SU SU 0.000000 1.0000 0 - 81 0 SUB SU SU 0.000000 1.0000 0 - 82 0 SUB SU SU 0.000000 1.0000 0 - 83 0 SUB SU SU 0.000000 1.0000 0 - 84 0 SUB SU SU 0.000000 1.0000 0 - 85 0 SUB SU SU 0.000000 1.0000 0 - 86 0 SUB SU SU 0.000000 1.0000 0 - 87 0 SUB SU SU 0.000000 1.0000 0 - 88 0 SUB SU SU 0.000000 1.0000 0 - 89 0 SUB SU SU 0.000000 1.0000 0 - 90 0 SUB SU SU 0.000000 1.0000 0 - 91 0 SUB SU SU 0.000000 1.0000 0 - 92 0 SUB SU SU 0.000000 1.0000 0 - 93 0 SUB SU SU 0.000000 1.0000 0 - 94 0 SUB SU SU 0.000000 1.0000 0 - 95 0 SUB SU SU 0.000000 1.0000 0 - 96 0 SUB SU SU 0.000000 1.0000 0 - 97 0 SUB SU SU 0.000000 1.0000 0 - 98 0 SUB SU SU 0.000000 1.0000 0 - 99 0 SUB SU SU 0.000000 1.0000 0 - 100 0 SUB SU SU 0.000000 1.0000 0 - 101 0 SUB SU SU 0.000000 1.0000 0 - 102 0 SUB SU SU 0.000000 1.0000 0 - 103 0 SUB SU SU 0.000000 1.0000 0 - 104 0 SUB SU SU 0.000000 1.0000 0 - 105 0 SUB SU SU 0.000000 1.0000 0 - 106 0 SUB SU SU 0.000000 1.0000 0 - 107 0 SUB SU SU 0.000000 1.0000 0 - 108 0 SUB SU SU 0.000000 1.0000 0 - 109 0 SUB SU SU 0.000000 1.0000 0 - 110 0 SUB SU SU 0.000000 1.0000 0 - 111 0 SUB SU SU 0.000000 1.0000 0 - 112 0 SUB SU SU 0.000000 1.0000 0 - 113 0 SUB SU SU 0.000000 1.0000 0 - 114 0 SUB SU SU 0.000000 1.0000 0 - 115 0 SUB SU SU 0.000000 1.0000 0 - 116 0 SUB SU SU 0.000000 1.0000 0 - 117 0 SUB SU SU 0.000000 1.0000 0 - 118 0 SUB SU SU 0.000000 1.0000 0 - 119 0 SUB SU SU 0.000000 1.0000 0 - 120 0 SUB SU SU 0.000000 1.0000 0 - 121 0 SUB SU SU 0.000000 1.0000 0 - 122 0 SUB SU SU 0.000000 1.0000 0 - 123 0 SUB SU SU 0.000000 1.0000 0 - 124 0 SUB SU SU 0.000000 1.0000 0 - 125 0 SUB SU SU 0.000000 1.0000 0 - 126 0 SUB SU SU 0.000000 1.0000 0 - 127 0 SUB SU SU 0.000000 1.0000 0 - 128 0 SUB SU SU 0.000000 1.0000 0 - 129 0 SUB SU SU 0.000000 1.0000 0 - 130 0 SUB SU SU 0.000000 1.0000 0 - 131 0 SUB SU SU 0.000000 1.0000 0 - 132 0 SUB SU SU 0.000000 1.0000 0 - 133 0 SUB SU SU 0.000000 1.0000 0 - 134 0 SUB SU SU 0.000000 1.0000 0 - 135 0 SUB SU SU 0.000000 1.0000 0 - 136 0 SUB SU SU 0.000000 1.0000 0 - 137 0 SUB SU SU 0.000000 1.0000 0 - 138 0 SUB SU SU 0.000000 1.0000 0 - 139 0 SUB SU SU 0.000000 1.0000 0 - 140 0 SUB SU SU 0.000000 1.0000 0 - 141 0 SUB SU SU 0.000000 1.0000 0 - 142 0 SUB SU SU 0.000000 1.0000 0 - 143 0 SUB SU SU 0.000000 1.0000 0 - 144 0 SUB SU SU 0.000000 1.0000 0 - 145 0 SUB SU SU 0.000000 1.0000 0 - 146 0 SUB SU SU 0.000000 1.0000 0 - 147 0 SUB SU SU 0.000000 1.0000 0 - 148 0 SUB SU SU 0.000000 1.0000 0 - 149 0 SUB SU SU 0.000000 1.0000 0 - 150 0 SUB SU SU 0.000000 1.0000 0 - 151 0 SUB SU SU 0.000000 1.0000 0 - 152 0 SUB SU SU 0.000000 1.0000 0 - 153 0 SUB SU SU 0.000000 1.0000 0 - 154 0 SUB SU SU 0.000000 1.0000 0 - 155 0 SUB SU SU 0.000000 1.0000 0 - 156 0 SUB SU SU 0.000000 1.0000 0 - 157 0 SUB SU SU 0.000000 1.0000 0 - 158 0 SUB SU SU 0.000000 1.0000 0 - 159 0 SUB SU SU 0.000000 1.0000 0 - 160 0 SUB SU SU 0.000000 1.0000 0 - 161 0 SUB SU SU 0.000000 1.0000 0 - 162 0 SUB SU SU 0.000000 1.0000 0 - 163 0 SUB SU SU 0.000000 1.0000 0 - 164 0 SUB SU SU 0.000000 1.0000 0 - 165 0 SUB SU SU 0.000000 1.0000 0 - 166 0 SUB SU SU 0.000000 1.0000 0 - 167 0 SUB SU SU 0.000000 1.0000 0 - 168 0 SUB SU SU 0.000000 1.0000 0 - 169 0 SUB SU SU 0.000000 1.0000 0 - 170 0 SUB SU SU 0.000000 1.0000 0 - 171 0 SUB SU SU 0.000000 1.0000 0 - 172 0 SUB SU SU 0.000000 1.0000 0 - 173 0 SUB SU SU 0.000000 1.0000 0 - 174 0 SUB SU SU 0.000000 1.0000 0 - 175 0 SUB SU SU 0.000000 1.0000 0 - 176 0 SUB SU SU 0.000000 1.0000 0 - 177 0 SUB SU SU 0.000000 1.0000 0 - 178 0 SUB SU SU 0.000000 1.0000 0 - 179 0 SUB SU SU 0.000000 1.0000 0 - 180 0 SUB SU SU 0.000000 1.0000 0 - 181 0 SUB SU SU 0.000000 1.0000 0 - 182 0 SUB SU SU 0.000000 1.0000 0 - 183 0 SUB SU SU 0.000000 1.0000 0 - 184 0 SUB SU SU 0.000000 1.0000 0 - 185 0 SUB SU SU 0.000000 1.0000 0 - 186 0 SUB SU SU 0.000000 1.0000 0 - 187 0 SUB SU SU 0.000000 1.0000 0 - 188 0 SUB SU SU 0.000000 1.0000 0 - 189 0 SUB SU SU 0.000000 1.0000 0 - 190 0 SUB SU SU 0.000000 1.0000 0 - 191 0 SUB SU SU 0.000000 1.0000 0 - 192 0 SUB SU SU 0.000000 1.0000 0 - 193 0 SUB SU SU 0.000000 1.0000 0 - 194 0 SUB SU SU 0.000000 1.0000 0 - 195 0 SUB SU SU 0.000000 1.0000 0 - 196 0 SUB SU SU 0.000000 1.0000 0 - 197 0 SUB SU SU 0.000000 1.0000 0 - 198 0 SUB SU SU 0.000000 1.0000 0 - 199 0 SUB SU SU 0.000000 1.0000 0 - 200 0 SUB SU SU 0.000000 1.0000 0 - 201 0 SUB SU SU 0.000000 1.0000 0 - 202 0 SUB SU SU 0.000000 1.0000 0 - 203 0 SUB SU SU 0.000000 1.0000 0 - 204 0 SUB SU SU 0.000000 1.0000 0 - 205 0 SUB SU SU 0.000000 1.0000 0 - 206 0 SUB SU SU 0.000000 1.0000 0 - 207 0 SUB SU SU 0.000000 1.0000 0 - 208 0 SUB SU SU 0.000000 1.0000 0 - 209 0 SUB SU SU 0.000000 1.0000 0 - 210 0 SUB SU SU 0.000000 1.0000 0 - 211 0 SUB SU SU 0.000000 1.0000 0 - 212 0 SUB SU SU 0.000000 1.0000 0 - 213 0 SUB SU SU 0.000000 1.0000 0 - 214 0 SUB SU SU 0.000000 1.0000 0 - 215 0 SUB SU SU 0.000000 1.0000 0 - 216 0 SUB SU SU 0.000000 1.0000 0 - 217 0 SUB SU SU 0.000000 1.0000 0 - 218 0 SUB SU SU 0.000000 1.0000 0 - 219 0 SUB SU SU 0.000000 1.0000 0 - 220 0 SUB SU SU 0.000000 1.0000 0 - 221 0 SUB SU SU 0.000000 1.0000 0 - 222 0 SUB SU SU 0.000000 1.0000 0 - 223 0 SUB SU SU 0.000000 1.0000 0 - 224 0 SUB SU SU 0.000000 1.0000 0 - 225 0 SUB SU SU 0.000000 1.0000 0 - 226 0 SUB SU SU 0.000000 1.0000 0 - 227 0 SUB SU SU 0.000000 1.0000 0 - 228 0 SUB SU SU 0.000000 1.0000 0 - 229 0 SUB SU SU 0.000000 1.0000 0 - 230 0 SUB SU SU 0.000000 1.0000 0 - 231 0 SUB SU SU 0.000000 1.0000 0 - 232 0 SUB SU SU 0.000000 1.0000 0 - 233 0 SUB SU SU 0.000000 1.0000 0 - 234 0 SUB SU SU 0.000000 1.0000 0 - 235 0 SUB SU SU 0.000000 1.0000 0 - 236 0 SUB SU SU 0.000000 1.0000 0 - 237 0 SUB SU SU 0.000000 1.0000 0 - 238 0 SUB SU SU 0.000000 1.0000 0 - 239 0 SUB SU SU 0.000000 1.0000 0 - 240 0 SUB SU SU 0.000000 1.0000 0 - 241 0 SUB SU SU 0.000000 1.0000 0 - 242 0 SUB SU SU 0.000000 1.0000 0 - 243 0 SUB SU SU 0.000000 1.0000 0 - 244 0 SUB SU SU 0.000000 1.0000 0 - 245 0 SUB SU SU 0.000000 1.0000 0 - 246 0 SUB SU SU 0.000000 1.0000 0 - 247 0 SUB SU SU 0.000000 1.0000 0 - 248 0 SUB SU SU 0.000000 1.0000 0 - 249 0 SUB SU SU 0.000000 1.0000 0 - 250 0 SUB SU SU 0.000000 1.0000 0 - 251 0 SUB SU SU 0.000000 1.0000 0 - 252 0 SUB SU SU 0.000000 1.0000 0 - 253 0 SUB SU SU 0.000000 1.0000 0 - 254 0 SUB SU SU 0.000000 1.0000 0 - 255 0 SUB SU SU 0.000000 1.0000 0 - 256 0 SUB SU SU 0.000000 1.0000 0 - 257 0 SUB SU SU 0.000000 1.0000 0 - 258 0 SUB SU SU 0.000000 1.0000 0 - 259 0 SUB SU SU 0.000000 1.0000 0 - 260 0 SUB SU SU 0.000000 1.0000 0 - 261 0 SUB SU SU 0.000000 1.0000 0 - 262 0 SUB SU SU 0.000000 1.0000 0 - 263 0 SUB SU SU 0.000000 1.0000 0 - 264 0 SUB SU SU 0.000000 1.0000 0 - 265 0 SUB SU SU 0.000000 1.0000 0 - 266 0 SUB SU SU 0.000000 1.0000 0 - 267 0 SUB SU SU 0.000000 1.0000 0 - 268 0 SUB SU SU 0.000000 1.0000 0 - 269 0 SUB SU SU 0.000000 1.0000 0 - 270 0 SUB SU SU 0.000000 1.0000 0 - 271 0 SUB SU SU 0.000000 1.0000 0 - 272 0 SUB SU SU 0.000000 1.0000 0 - 273 0 SUB SU SU 0.000000 1.0000 0 - 274 0 SUB SU SU 0.000000 1.0000 0 - 275 0 SUB SU SU 0.000000 1.0000 0 - 276 0 SUB SU SU 0.000000 1.0000 0 - 277 0 SUB SU SU 0.000000 1.0000 0 - 278 0 SUB SU SU 0.000000 1.0000 0 - 279 0 SUB SU SU 0.000000 1.0000 0 - 280 0 SUB SU SU 0.000000 1.0000 0 - 281 0 SUB SU SU 0.000000 1.0000 0 - 282 0 SUB SU SU 0.000000 1.0000 0 - 283 0 SUB SU SU 0.000000 1.0000 0 - 284 0 SUB SU SU 0.000000 1.0000 0 - 285 0 SUB SU SU 0.000000 1.0000 0 - 286 0 SUB SU SU 0.000000 1.0000 0 - 287 0 SUB SU SU 0.000000 1.0000 0 - 288 0 SUB SU SU 0.000000 1.0000 0 - 289 0 SUB SU SU 0.000000 1.0000 0 - 290 0 SUB SU SU 0.000000 1.0000 0 - 291 0 SUB SU SU 0.000000 1.0000 0 - 292 0 SUB SU SU 0.000000 1.0000 0 - 293 0 SUB SU SU 0.000000 1.0000 0 - 294 0 SUB SU SU 0.000000 1.0000 0 - 295 0 SUB SU SU 0.000000 1.0000 0 - 296 0 SUB SU SU 0.000000 1.0000 0 - 297 0 SUB SU SU 0.000000 1.0000 0 - 298 0 SUB SU SU 0.000000 1.0000 0 - 299 0 SUB SU SU 0.000000 1.0000 0 - 300 0 SUB SU SU 0.000000 1.0000 0 - 301 0 SUB SU SU 0.000000 1.0000 0 - 302 0 SUB SU SU 0.000000 1.0000 0 - 303 0 SUB SU SU 0.000000 1.0000 0 - 304 0 SUB SU SU 0.000000 1.0000 0 - 305 0 SUB SU SU 0.000000 1.0000 0 - 306 0 SUB SU SU 0.000000 1.0000 0 - 307 0 SUB SU SU 0.000000 1.0000 0 - 308 0 SUB SU SU 0.000000 1.0000 0 - 309 0 SUB SU SU 0.000000 1.0000 0 - 310 0 SUB SU SU 0.000000 1.0000 0 - 311 0 SUB SU SU 0.000000 1.0000 0 - 312 0 SUB SU SU 0.000000 1.0000 0 - 313 0 SUB SU SU 0.000000 1.0000 0 - 314 0 SUB SU SU 0.000000 1.0000 0 - 315 0 SUB SU SU 0.000000 1.0000 0 - 316 0 SUB SU SU 0.000000 1.0000 0 - 317 0 SUB SU SU 0.000000 1.0000 0 - 318 0 SUB SU SU 0.000000 1.0000 0 - 319 0 SUB SU SU 0.000000 1.0000 0 - 320 0 SUB SU SU 0.000000 1.0000 0 - 321 0 SUB SU SU 0.000000 1.0000 0 - 322 0 SUB SU SU 0.000000 1.0000 0 - 323 0 SUB SU SU 0.000000 1.0000 0 - 324 0 SUB SU SU 0.000000 1.0000 0 - 325 0 SUB SU SU 0.000000 1.0000 0 - 326 0 SUB SU SU 0.000000 1.0000 0 - 327 0 SUB SU SU 0.000000 1.0000 0 - 328 0 SUB SU SU 0.000000 1.0000 0 - 329 0 SUB SU SU 0.000000 1.0000 0 - 330 0 SUB SU SU 0.000000 1.0000 0 - 331 0 SUB SU SU 0.000000 1.0000 0 - 332 0 SUB SU SU 0.000000 1.0000 0 - 333 0 SUB SU SU 0.000000 1.0000 0 - 334 0 SUB SU SU 0.000000 1.0000 0 - 335 0 SUB SU SU 0.000000 1.0000 0 - 336 0 SUB SU SU 0.000000 1.0000 0 - 337 0 SUB SU SU 0.000000 1.0000 0 - 338 0 SUB SU SU 0.000000 1.0000 0 - 339 0 SUB SU SU 0.000000 1.0000 0 - 340 0 SUB SU SU 0.000000 1.0000 0 - 341 0 SUB SU SU 0.000000 1.0000 0 - 342 0 SUB SU SU 0.000000 1.0000 0 - 343 0 SUB SU SU 0.000000 1.0000 0 - 344 0 SUB SU SU 0.000000 1.0000 0 - 345 0 SUB SU SU 0.000000 1.0000 0 - 346 0 SUB SU SU 0.000000 1.0000 0 - 347 0 SUB SU SU 0.000000 1.0000 0 - 348 0 SUB SU SU 0.000000 1.0000 0 - 349 0 SUB SU SU 0.000000 1.0000 0 - 350 0 SUB SU SU 0.000000 1.0000 0 - 351 0 SUB SU SU 0.000000 1.0000 0 - 352 0 SUB SU SU 0.000000 1.0000 0 - 353 0 SUB SU SU 0.000000 1.0000 0 - 354 0 SUB SU SU 0.000000 1.0000 0 - 355 0 SUB SU SU 0.000000 1.0000 0 - 356 0 SUB SU SU 0.000000 1.0000 0 - 357 0 SUB SU SU 0.000000 1.0000 0 - 358 0 SUB SU SU 0.000000 1.0000 0 - 359 0 SUB SU SU 0.000000 1.0000 0 - 360 0 SUB SU SU 0.000000 1.0000 0 - 361 0 SUB SU SU 0.000000 1.0000 0 - 362 0 SUB SU SU 0.000000 1.0000 0 - 363 0 SUB SU SU 0.000000 1.0000 0 - 364 0 SUB SU SU 0.000000 1.0000 0 - 365 0 SUB SU SU 0.000000 1.0000 0 - 366 0 SUB SU SU 0.000000 1.0000 0 - 367 0 SUB SU SU 0.000000 1.0000 0 - 368 0 SUB SU SU 0.000000 1.0000 0 - 369 0 SUB SU SU 0.000000 1.0000 0 - 370 0 SUB SU SU 0.000000 1.0000 0 - 371 0 SUB SU SU 0.000000 1.0000 0 - 372 0 SUB SU SU 0.000000 1.0000 0 - 373 0 SUB SU SU 0.000000 1.0000 0 - 374 0 SUB SU SU 0.000000 1.0000 0 - 375 0 SUB SU SU 0.000000 1.0000 0 - 376 0 SUB SU SU 0.000000 1.0000 0 - 377 0 SUB SU SU 0.000000 1.0000 0 - 378 0 SUB SU SU 0.000000 1.0000 0 - 379 0 SUB SU SU 0.000000 1.0000 0 - 380 0 SUB SU SU 0.000000 1.0000 0 - 381 0 SUB SU SU 0.000000 1.0000 0 - 382 0 SUB SU SU 0.000000 1.0000 0 - 383 0 SUB SU SU 0.000000 1.0000 0 - 384 0 SUB SU SU 0.000000 1.0000 0 - 385 0 SUB SU SU 0.000000 1.0000 0 - 386 0 SUB SU SU 0.000000 1.0000 0 - 387 0 SUB SU SU 0.000000 1.0000 0 - 388 0 SUB SU SU 0.000000 1.0000 0 - 389 0 SUB SU SU 0.000000 1.0000 0 - 390 0 SUB SU SU 0.000000 1.0000 0 - 391 0 SUB SU SU 0.000000 1.0000 0 - 392 0 SUB SU SU 0.000000 1.0000 0 - 393 0 SUB SU SU 0.000000 1.0000 0 - 394 0 SUB SU SU 0.000000 1.0000 0 - 395 0 SUB SU SU 0.000000 1.0000 0 - 396 0 SUB SU SU 0.000000 1.0000 0 - 397 0 SUB SU SU 0.000000 1.0000 0 - 398 0 SUB SU SU 0.000000 1.0000 0 - 399 0 SUB SU SU 0.000000 1.0000 0 - 400 0 SUB SU SU 0.000000 1.0000 0 - 401 0 SUB SU SU 0.000000 1.0000 0 - 402 0 SUB SU SU 0.000000 1.0000 0 - 403 0 SUB SU SU 0.000000 1.0000 0 - 404 0 SUB SU SU 0.000000 1.0000 0 - 405 0 SUB SU SU 0.000000 1.0000 0 - 406 0 SUB SU SU 0.000000 1.0000 0 - 407 0 SUB SU SU 0.000000 1.0000 0 - 408 0 SUB SU SU 0.000000 1.0000 0 - 409 0 SUB SU SU 0.000000 1.0000 0 - 410 0 SUB SU SU 0.000000 1.0000 0 - 411 0 SUB SU SU 0.000000 1.0000 0 - 412 0 SUB SU SU 0.000000 1.0000 0 - 413 0 SUB SU SU 0.000000 1.0000 0 - 414 0 SUB SU SU 0.000000 1.0000 0 - 415 0 SUB SU SU 0.000000 1.0000 0 - 416 0 SUB SU SU 0.000000 1.0000 0 - 417 0 SUB SU SU 0.000000 1.0000 0 - 418 0 SUB SU SU 0.000000 1.0000 0 - 419 0 SUB SU SU 0.000000 1.0000 0 - 420 0 SUB SU SU 0.000000 1.0000 0 - 421 0 SUB SU SU 0.000000 1.0000 0 - 422 0 SUB SU SU 0.000000 1.0000 0 - 423 0 SUB SU SU 0.000000 1.0000 0 - 424 0 SUB SU SU 0.000000 1.0000 0 - 425 0 SUB SU SU 0.000000 1.0000 0 - 426 0 SUB SU SU 0.000000 1.0000 0 - 427 0 SUB SU SU 0.000000 1.0000 0 - 428 0 SUB SU SU 0.000000 1.0000 0 - 429 0 SUB SU SU 0.000000 1.0000 0 - 430 0 SUB SU SU 0.000000 1.0000 0 - 431 0 SUB SU SU 0.000000 1.0000 0 - 432 0 SUB SU SU 0.000000 1.0000 0 - 433 0 SUB SU SU 0.000000 1.0000 0 - 434 0 SUB SU SU 0.000000 1.0000 0 - 435 0 SUB SU SU 0.000000 1.0000 0 - 436 0 SUB SU SU 0.000000 1.0000 0 - 437 0 SUB SU SU 0.000000 1.0000 0 - 438 0 SUB SU SU 0.000000 1.0000 0 - 439 0 SUB SU SU 0.000000 1.0000 0 - 440 0 SUB SU SU 0.000000 1.0000 0 - 441 0 SUB SU SU 0.000000 1.0000 0 - 442 0 SUB SU SU 0.000000 1.0000 0 - 443 0 SUB SU SU 0.000000 1.0000 0 - 444 0 SUB SU SU 0.000000 1.0000 0 - 445 0 SUB SU SU 0.000000 1.0000 0 - 446 0 SUB SU SU 0.000000 1.0000 0 - 447 0 SUB SU SU 0.000000 1.0000 0 - 448 0 SUB SU SU 0.000000 1.0000 0 - 449 0 SUB SU SU 0.000000 1.0000 0 - 450 0 SUB SU SU 0.000000 1.0000 0 - 451 0 SUB SU SU 0.000000 1.0000 0 - 452 0 SUB SU SU 0.000000 1.0000 0 - 453 0 SUB SU SU 0.000000 1.0000 0 - 454 0 SUB SU SU 0.000000 1.0000 0 - 455 0 SUB SU SU 0.000000 1.0000 0 - 456 0 SUB SU SU 0.000000 1.0000 0 - 457 0 SUB SU SU 0.000000 1.0000 0 - 458 0 SUB SU SU 0.000000 1.0000 0 - 459 0 SUB SU SU 0.000000 1.0000 0 - 460 0 SUB SU SU 0.000000 1.0000 0 - 461 0 SUB SU SU 0.000000 1.0000 0 - 462 0 SUB SU SU 0.000000 1.0000 0 - 463 0 SUB SU SU 0.000000 1.0000 0 - 464 0 SUB SU SU 0.000000 1.0000 0 - 465 0 SUB SU SU 0.000000 1.0000 0 - 466 0 SUB SU SU 0.000000 1.0000 0 - 467 0 SUB SU SU 0.000000 1.0000 0 - 468 0 SUB SU SU 0.000000 1.0000 0 - 469 0 SUB SU SU 0.000000 1.0000 0 - 470 0 SUB SU SU 0.000000 1.0000 0 - 471 0 SUB SU SU 0.000000 1.0000 0 - 472 0 SUB SU SU 0.000000 1.0000 0 - 473 0 SUB SU SU 0.000000 1.0000 0 - 474 0 SUB SU SU 0.000000 1.0000 0 - 475 0 SUB SU SU 0.000000 1.0000 0 - 476 0 SUB SU SU 0.000000 1.0000 0 - 477 0 SUB SU SU 0.000000 1.0000 0 - 478 0 SUB SU SU 0.000000 1.0000 0 - 479 0 SUB SU SU 0.000000 1.0000 0 - 480 0 SUB SU SU 0.000000 1.0000 0 - 481 0 SUB SU SU 0.000000 1.0000 0 - 482 0 SUB SU SU 0.000000 1.0000 0 - 483 0 SUB SU SU 0.000000 1.0000 0 - 484 0 SUB SU SU 0.000000 1.0000 0 - 485 0 SUB SU SU 0.000000 1.0000 0 - 486 0 SUB SU SU 0.000000 1.0000 0 - 487 0 SUB SU SU 0.000000 1.0000 0 - 488 0 SUB SU SU 0.000000 1.0000 0 - 489 0 SUB SU SU 0.000000 1.0000 0 - 490 0 SUB SU SU 0.000000 1.0000 0 - 491 0 SUB SU SU 0.000000 1.0000 0 - 492 0 SUB SU SU 0.000000 1.0000 0 - 493 0 SUB SU SU 0.000000 1.0000 0 - 494 0 SUB SU SU 0.000000 1.0000 0 - 495 0 SUB SU SU 0.000000 1.0000 0 - 496 0 SUB SU SU 0.000000 1.0000 0 - 497 0 SUB SU SU 0.000000 1.0000 0 - 498 0 SUB SU SU 0.000000 1.0000 0 - 499 0 SUB SU SU 0.000000 1.0000 0 - 500 0 SUB SU SU 0.000000 1.0000 0 - 501 0 SUB SU SU 0.000000 1.0000 0 - 502 0 SUB SU SU 0.000000 1.0000 0 - 503 0 SUB SU SU 0.000000 1.0000 0 - 504 0 SUB SU SU 0.000000 1.0000 0 - 505 0 SUB SU SU 0.000000 1.0000 0 - 506 0 SUB SU SU 0.000000 1.0000 0 - 507 0 SUB SU SU 0.000000 1.0000 0 - 508 0 SUB SU SU 0.000000 1.0000 0 - 509 0 SUB SU SU 0.000000 1.0000 0 - 510 0 SUB SU SU 0.000000 1.0000 0 - 511 0 SUB SU SU 0.000000 1.0000 0 - 512 0 SUB SU SU 0.000000 1.0000 0 - 513 0 SUB SU SU 0.000000 1.0000 0 - 514 0 SUB SU SU 0.000000 1.0000 0 - 515 0 SUB SU SU 0.000000 1.0000 0 - 516 0 SUB SU SU 0.000000 1.0000 0 - 517 0 SUB SU SU 0.000000 1.0000 0 - 518 0 SUB SU SU 0.000000 1.0000 0 - 519 0 SUB SU SU 0.000000 1.0000 0 - 520 0 SUB SU SU 0.000000 1.0000 0 - 521 0 SUB SU SU 0.000000 1.0000 0 - 522 0 SUB SU SU 0.000000 1.0000 0 - 523 0 SUB SU SU 0.000000 1.0000 0 - 524 0 SUB SU SU 0.000000 1.0000 0 - 525 0 SUB SU SU 0.000000 1.0000 0 - 526 0 SUB SU SU 0.000000 1.0000 0 - 527 0 SUB SU SU 0.000000 1.0000 0 - 528 0 SUB SU SU 0.000000 1.0000 0 - 529 0 SUB SU SU 0.000000 1.0000 0 - 530 0 SUB SU SU 0.000000 1.0000 0 - 531 0 SUB SU SU 0.000000 1.0000 0 - 532 0 SUB SU SU 0.000000 1.0000 0 - 533 0 SUB SU SU 0.000000 1.0000 0 - 534 0 SUB SU SU 0.000000 1.0000 0 - 535 0 SUB SU SU 0.000000 1.0000 0 - 536 0 SUB SU SU 0.000000 1.0000 0 - 537 0 SUB SU SU 0.000000 1.0000 0 - 538 0 SUB SU SU 0.000000 1.0000 0 - 539 0 SUB SU SU 0.000000 1.0000 0 - 540 0 SUB SU SU 0.000000 1.0000 0 - 541 0 SUB SU SU 0.000000 1.0000 0 - 542 0 SUB SU SU 0.000000 1.0000 0 - 543 0 SUB SU SU 0.000000 1.0000 0 - 544 0 SUB SU SU 0.000000 1.0000 0 - 545 0 SUB SU SU 0.000000 1.0000 0 - 546 0 SUB SU SU 0.000000 1.0000 0 - 547 0 SUB SU SU 0.000000 1.0000 0 - 548 0 SUB SU SU 0.000000 1.0000 0 - 549 0 SUB SU SU 0.000000 1.0000 0 - 550 0 SUB SU SU 0.000000 1.0000 0 - 551 0 SUB SU SU 0.000000 1.0000 0 - 552 0 SUB SU SU 0.000000 1.0000 0 - 553 0 SUB SU SU 0.000000 1.0000 0 - 554 0 SUB SU SU 0.000000 1.0000 0 - 555 0 SUB SU SU 0.000000 1.0000 0 - 556 0 SUB SU SU 0.000000 1.0000 0 - 557 0 SUB SU SU 0.000000 1.0000 0 - 558 0 SUB SU SU 0.000000 1.0000 0 - 559 0 SUB SU SU 0.000000 1.0000 0 - 560 0 SUB SU SU 0.000000 1.0000 0 - 561 0 SUB SU SU 0.000000 1.0000 0 - 562 0 SUB SU SU 0.000000 1.0000 0 - 563 0 SUB SU SU 0.000000 1.0000 0 - 564 0 SUB SU SU 0.000000 1.0000 0 - 565 0 SUB SU SU 0.000000 1.0000 0 - 566 0 SUB SU SU 0.000000 1.0000 0 - 567 0 SUB SU SU 0.000000 1.0000 0 - 568 0 SUB SU SU 0.000000 1.0000 0 - 569 0 SUB SU SU 0.000000 1.0000 0 - 570 0 SUB SU SU 0.000000 1.0000 0 - 571 0 SUB SU SU 0.000000 1.0000 0 - 572 0 SUB SU SU 0.000000 1.0000 0 - 573 0 SUB SU SU 0.000000 1.0000 0 - 574 0 SUB SU SU 0.000000 1.0000 0 - 575 0 SUB SU SU 0.000000 1.0000 0 - 576 0 SUB SU SU 0.000000 1.0000 0 - 577 0 SUB SU SU 0.000000 1.0000 0 - 578 0 SUB SU SU 0.000000 1.0000 0 - 579 0 SUB SU SU 0.000000 1.0000 0 - 580 0 SUB SU SU 0.000000 1.0000 0 - 581 0 SUB SU SU 0.000000 1.0000 0 - 582 0 SUB SU SU 0.000000 1.0000 0 - 583 0 SUB SU SU 0.000000 1.0000 0 - 584 0 SUB SU SU 0.000000 1.0000 0 - 585 0 SUB SU SU 0.000000 1.0000 0 - 586 0 SUB SU SU 0.000000 1.0000 0 - 587 0 SUB SU SU 0.000000 1.0000 0 - 588 0 SUB SU SU 0.000000 1.0000 0 - 589 0 SUB SU SU 0.000000 1.0000 0 - 590 0 SUB SU SU 0.000000 1.0000 0 - 591 0 SUB SU SU 0.000000 1.0000 0 - 592 0 SUB SU SU 0.000000 1.0000 0 - 593 0 SUB SU SU 0.000000 1.0000 0 - 594 0 SUB SU SU 0.000000 1.0000 0 - 595 0 SUB SU SU 0.000000 1.0000 0 - 596 0 SUB SU SU 0.000000 1.0000 0 - 597 0 SUB SU SU 0.000000 1.0000 0 - 598 0 SUB SU SU 0.000000 1.0000 0 - 599 0 SUB SU SU 0.000000 1.0000 0 - 600 0 SUB SU SU 0.000000 1.0000 0 - 601 0 SUB SU SU 0.000000 1.0000 0 - 602 0 SUB SU SU 0.000000 1.0000 0 - 603 0 SUB SU SU 0.000000 1.0000 0 - 604 0 SUB SU SU 0.000000 1.0000 0 - 605 0 SUB SU SU 0.000000 1.0000 0 - 606 0 SUB SU SU 0.000000 1.0000 0 - 607 0 SUB SU SU 0.000000 1.0000 0 - 608 0 SUB SU SU 0.000000 1.0000 0 - 609 0 SUB SU SU 0.000000 1.0000 0 - 610 0 SUB SU SU 0.000000 1.0000 0 - 611 0 SUB SU SU 0.000000 1.0000 0 - 612 0 SUB SU SU 0.000000 1.0000 0 - 613 0 SUB SU SU 0.000000 1.0000 0 - 614 0 SUB SU SU 0.000000 1.0000 0 - 615 0 SUB SU SU 0.000000 1.0000 0 - 616 0 SUB SU SU 0.000000 1.0000 0 - 617 0 SUB SU SU 0.000000 1.0000 0 - 618 0 SUB SU SU 0.000000 1.0000 0 - 619 0 SUB SU SU 0.000000 1.0000 0 - 620 0 SUB SU SU 0.000000 1.0000 0 - 621 0 SUB SU SU 0.000000 1.0000 0 - 622 0 SUB SU SU 0.000000 1.0000 0 - 623 0 SUB SU SU 0.000000 1.0000 0 - 624 0 SUB SU SU 0.000000 1.0000 0 - 625 0 SUB SU SU 0.000000 1.0000 0 - 626 0 SUB SU SU 0.000000 1.0000 0 - 627 0 SUB SU SU 0.000000 1.0000 0 - 628 0 SUB SU SU 0.000000 1.0000 0 - 629 0 SUB SU SU 0.000000 1.0000 0 - 630 0 SUB SU SU 0.000000 1.0000 0 - 631 0 SUB SU SU 0.000000 1.0000 0 - 632 0 SUB SU SU 0.000000 1.0000 0 - 633 0 SUB SU SU 0.000000 1.0000 0 - 634 0 SUB SU SU 0.000000 1.0000 0 - 635 0 SUB SU SU 0.000000 1.0000 0 - 636 0 SUB SU SU 0.000000 1.0000 0 - 637 0 SUB SU SU 0.000000 1.0000 0 - 638 0 SUB SU SU 0.000000 1.0000 0 - 639 0 SUB SU SU 0.000000 1.0000 0 - 640 0 SUB SU SU 0.000000 1.0000 0 - 641 0 SUB SU SU 0.000000 1.0000 0 - 642 0 SUB SU SU 0.000000 1.0000 0 - 643 0 SUB SU SU 0.000000 1.0000 0 - 644 0 SUB SU SU 0.000000 1.0000 0 - 645 0 SUB SU SU 0.000000 1.0000 0 - 646 0 SUB SU SU 0.000000 1.0000 0 - 647 0 SUB SU SU 0.000000 1.0000 0 - 648 0 SUB SU SU 0.000000 1.0000 0 - 649 0 SUB SU SU 0.000000 1.0000 0 - 650 0 SUB SU SU 0.000000 1.0000 0 - 651 0 SUB SU SU 0.000000 1.0000 0 - 652 0 SUB SU SU 0.000000 1.0000 0 - 653 0 SUB SU SU 0.000000 1.0000 0 - 654 0 SUB SU SU 0.000000 1.0000 0 - 655 0 SUB SU SU 0.000000 1.0000 0 - 656 0 SUB SU SU 0.000000 1.0000 0 - 657 0 SUB SU SU 0.000000 1.0000 0 - 658 0 SUB SU SU 0.000000 1.0000 0 - 659 0 SUB SU SU 0.000000 1.0000 0 - 660 0 SUB SU SU 0.000000 1.0000 0 - 661 0 SUB SU SU 0.000000 1.0000 0 - 662 0 SUB SU SU 0.000000 1.0000 0 - 663 0 SUB SU SU 0.000000 1.0000 0 - 664 0 SUB SU SU 0.000000 1.0000 0 - 665 0 SUB SU SU 0.000000 1.0000 0 - 666 0 SUB SU SU 0.000000 1.0000 0 - 667 0 SUB SU SU 0.000000 1.0000 0 - 668 0 SUB SU SU 0.000000 1.0000 0 - 669 0 SUB SU SU 0.000000 1.0000 0 - 670 0 SUB SU SU 0.000000 1.0000 0 - 671 0 SUB SU SU 0.000000 1.0000 0 - 672 0 SUB SU SU 0.000000 1.0000 0 - 673 0 SUB SU SU 0.000000 1.0000 0 - 674 0 SUB SU SU 0.000000 1.0000 0 - 675 0 SUB SU SU 0.000000 1.0000 0 - 676 0 SUB SU SU 0.000000 1.0000 0 - 677 0 SUB SU SU 0.000000 1.0000 0 - 678 0 SUB SU SU 0.000000 1.0000 0 - 679 0 SUB SU SU 0.000000 1.0000 0 - 680 0 SUB SU SU 0.000000 1.0000 0 - 681 0 SUB SU SU 0.000000 1.0000 0 - 682 0 SUB SU SU 0.000000 1.0000 0 - 683 0 SUB SU SU 0.000000 1.0000 0 - 684 0 SUB SU SU 0.000000 1.0000 0 - 685 0 SUB SU SU 0.000000 1.0000 0 - 686 0 SUB SU SU 0.000000 1.0000 0 - 687 0 SUB SU SU 0.000000 1.0000 0 - 688 0 SUB SU SU 0.000000 1.0000 0 - 689 0 SUB SU SU 0.000000 1.0000 0 - 690 0 SUB SU SU 0.000000 1.0000 0 - 691 0 SUB SU SU 0.000000 1.0000 0 - 692 0 SUB SU SU 0.000000 1.0000 0 - 693 0 SUB SU SU 0.000000 1.0000 0 - 694 0 SUB SU SU 0.000000 1.0000 0 - 695 0 SUB SU SU 0.000000 1.0000 0 - 696 0 SUB SU SU 0.000000 1.0000 0 - 697 0 SUB SU SU 0.000000 1.0000 0 - 698 0 SUB SU SU 0.000000 1.0000 0 - 699 0 SUB SU SU 0.000000 1.0000 0 - 700 0 SUB SU SU 0.000000 1.0000 0 - 701 0 SUB SU SU 0.000000 1.0000 0 - 702 0 SUB SU SU 0.000000 1.0000 0 - 703 0 SUB SU SU 0.000000 1.0000 0 - 704 0 SUB SU SU 0.000000 1.0000 0 - 705 0 SUB SU SU 0.000000 1.0000 0 - 706 0 SUB SU SU 0.000000 1.0000 0 - 707 0 SUB SU SU 0.000000 1.0000 0 - 708 0 SUB SU SU 0.000000 1.0000 0 - 709 0 SUB SU SU 0.000000 1.0000 0 - 710 0 SUB SU SU 0.000000 1.0000 0 - 711 0 SUB SU SU 0.000000 1.0000 0 - 712 0 SUB SU SU 0.000000 1.0000 0 - 713 0 SUB SU SU 0.000000 1.0000 0 - 714 0 SUB SU SU 0.000000 1.0000 0 - 715 0 SUB SU SU 0.000000 1.0000 0 - 716 0 SUB SU SU 0.000000 1.0000 0 - 717 0 SUB SU SU 0.000000 1.0000 0 - 718 0 SUB SU SU 0.000000 1.0000 0 - 719 0 SUB SU SU 0.000000 1.0000 0 - 720 0 SUB SU SU 0.000000 1.0000 0 - 721 0 SUB SU SU 0.000000 1.0000 0 - 722 0 SUB SU SU 0.000000 1.0000 0 - 723 0 SUB SU SU 0.000000 1.0000 0 - 724 0 SUB SU SU 0.000000 1.0000 0 - 725 0 SUB SU SU 0.000000 1.0000 0 - 726 0 SUB SU SU 0.000000 1.0000 0 - 727 0 SUB SU SU 0.000000 1.0000 0 - 728 0 SUB SU SU 0.000000 1.0000 0 - 729 0 SUB SU SU 0.000000 1.0000 0 - 730 0 SUB SU SU 0.000000 1.0000 0 - 731 0 SUB SU SU 0.000000 1.0000 0 - 732 0 SUB SU SU 0.000000 1.0000 0 - 733 0 SUB SU SU 0.000000 1.0000 0 - 734 0 SUB SU SU 0.000000 1.0000 0 - 735 0 SUB SU SU 0.000000 1.0000 0 - 736 0 SUB SU SU 0.000000 1.0000 0 - 737 0 SUB SU SU 0.000000 1.0000 0 - 738 0 SUB SU SU 0.000000 1.0000 0 - 739 0 SUB SU SU 0.000000 1.0000 0 - 740 0 SUB SU SU 0.000000 1.0000 0 - 741 0 SUB SU SU 0.000000 1.0000 0 - 742 0 SUB SU SU 0.000000 1.0000 0 - 743 0 SUB SU SU 0.000000 1.0000 0 - 744 0 SUB SU SU 0.000000 1.0000 0 - 745 0 SUB SU SU 0.000000 1.0000 0 - 746 0 SUB SU SU 0.000000 1.0000 0 - 747 0 SUB SU SU 0.000000 1.0000 0 - 748 0 SUB SU SU 0.000000 1.0000 0 - 749 0 SUB SU SU 0.000000 1.0000 0 - 750 0 SUB SU SU 0.000000 1.0000 0 - 751 0 SUB SU SU 0.000000 1.0000 0 - 752 0 SUB SU SU 0.000000 1.0000 0 - 753 0 SUB SU SU 0.000000 1.0000 0 - 754 0 SUB SU SU 0.000000 1.0000 0 - 755 0 SUB SU SU 0.000000 1.0000 0 - 756 0 SUB SU SU 0.000000 1.0000 0 - 757 0 SUB SU SU 0.000000 1.0000 0 - 758 0 SUB SU SU 0.000000 1.0000 0 - 759 0 SUB SU SU 0.000000 1.0000 0 - 760 0 SUB SU SU 0.000000 1.0000 0 - 761 0 SUB SU SU 0.000000 1.0000 0 - 762 0 SUB SU SU 0.000000 1.0000 0 - 763 0 SUB SU SU 0.000000 1.0000 0 - 764 0 SUB SU SU 0.000000 1.0000 0 - 765 0 SUB SU SU 0.000000 1.0000 0 - 766 0 SUB SU SU 0.000000 1.0000 0 - 767 0 SUB SU SU 0.000000 1.0000 0 - 768 0 SUB SU SU 0.000000 1.0000 0 - 769 0 SUB SU SU 0.000000 1.0000 0 - 770 0 SUB SU SU 0.000000 1.0000 0 - 771 0 SUB SU SU 0.000000 1.0000 0 - 772 0 SUB SU SU 0.000000 1.0000 0 - 773 0 SUB SU SU 0.000000 1.0000 0 - 774 0 SUB SU SU 0.000000 1.0000 0 - 775 0 SUB SU SU 0.000000 1.0000 0 - 776 0 SUB SU SU 0.000000 1.0000 0 - 777 0 SUB SU SU 0.000000 1.0000 0 - 778 0 SUB SU SU 0.000000 1.0000 0 - 779 0 SUB SU SU 0.000000 1.0000 0 - 780 0 SUB SU SU 0.000000 1.0000 0 - 781 0 SUB SU SU 0.000000 1.0000 0 - 782 0 SUB SU SU 0.000000 1.0000 0 - 783 0 SUB SU SU 0.000000 1.0000 0 - 784 0 SUB SU SU 0.000000 1.0000 0 - 785 0 SUB SU SU 0.000000 1.0000 0 - 786 0 SUB SU SU 0.000000 1.0000 0 - 787 0 SUB SU SU 0.000000 1.0000 0 - 788 0 SUB SU SU 0.000000 1.0000 0 - 789 0 SUB SU SU 0.000000 1.0000 0 - 790 0 SUB SU SU 0.000000 1.0000 0 - 791 0 SUB SU SU 0.000000 1.0000 0 - 792 0 SUB SU SU 0.000000 1.0000 0 - 793 0 SUB SU SU 0.000000 1.0000 0 - 794 0 SUB SU SU 0.000000 1.0000 0 - 795 0 SUB SU SU 0.000000 1.0000 0 - 796 0 SUB SU SU 0.000000 1.0000 0 - 797 0 SUB SU SU 0.000000 1.0000 0 - 798 0 SUB SU SU 0.000000 1.0000 0 - 799 0 SUB SU SU 0.000000 1.0000 0 - 800 0 SUB SU SU 0.000000 1.0000 0 - 801 0 SUB SU SU 0.000000 1.0000 0 - 802 0 SUB SU SU 0.000000 1.0000 0 - 803 0 SUB SU SU 0.000000 1.0000 0 - 804 0 SUB SU SU 0.000000 1.0000 0 - 805 0 SUB SU SU 0.000000 1.0000 0 - 806 0 SUB SU SU 0.000000 1.0000 0 - 807 0 SUB SU SU 0.000000 1.0000 0 - 808 0 SUB SU SU 0.000000 1.0000 0 - 809 0 SUB SU SU 0.000000 1.0000 0 - 810 0 SUB SU SU 0.000000 1.0000 0 - 811 0 SUB SU SU 0.000000 1.0000 0 - 812 0 SUB SU SU 0.000000 1.0000 0 - 813 0 SUB SU SU 0.000000 1.0000 0 - 814 0 SUB SU SU 0.000000 1.0000 0 - 815 0 SUB SU SU 0.000000 1.0000 0 - 816 0 SUB SU SU 0.000000 1.0000 0 - 817 0 SUB SU SU 0.000000 1.0000 0 - 818 0 SUB SU SU 0.000000 1.0000 0 - 819 0 SUB SU SU 0.000000 1.0000 0 - 820 0 SUB SU SU 0.000000 1.0000 0 - 821 0 SUB SU SU 0.000000 1.0000 0 - 822 0 SUB SU SU 0.000000 1.0000 0 - 823 0 SUB SU SU 0.000000 1.0000 0 - 824 0 SUB SU SU 0.000000 1.0000 0 - 825 0 SUB SU SU 0.000000 1.0000 0 - 826 0 SUB SU SU 0.000000 1.0000 0 - 827 0 SUB SU SU 0.000000 1.0000 0 - 828 0 SUB SU SU 0.000000 1.0000 0 - 829 0 SUB SU SU 0.000000 1.0000 0 - 830 0 SUB SU SU 0.000000 1.0000 0 - 831 0 SUB SU SU 0.000000 1.0000 0 - 832 0 SUB SU SU 0.000000 1.0000 0 - 833 0 SUB SU SU 0.000000 1.0000 0 - 834 0 SUB SU SU 0.000000 1.0000 0 - 835 0 SUB SU SU 0.000000 1.0000 0 - 836 0 SUB SU SU 0.000000 1.0000 0 - 837 0 SUB SU SU 0.000000 1.0000 0 - 838 0 SUB SU SU 0.000000 1.0000 0 - 839 0 SUB SU SU 0.000000 1.0000 0 - 840 0 SUB SU SU 0.000000 1.0000 0 - 841 0 SUB SU SU 0.000000 1.0000 0 - 842 0 SUB SU SU 0.000000 1.0000 0 - 843 0 SUB SU SU 0.000000 1.0000 0 - 844 0 SUB SU SU 0.000000 1.0000 0 - 845 0 SUB SU SU 0.000000 1.0000 0 - 846 0 SUB SU SU 0.000000 1.0000 0 - 847 0 SUB SU SU 0.000000 1.0000 0 - 848 0 SUB SU SU 0.000000 1.0000 0 - 849 0 SUB SU SU 0.000000 1.0000 0 - 850 0 SUB SU SU 0.000000 1.0000 0 - 851 0 SUB SU SU 0.000000 1.0000 0 - 852 0 SUB SU SU 0.000000 1.0000 0 - 853 0 SUB SU SU 0.000000 1.0000 0 - 854 0 SUB SU SU 0.000000 1.0000 0 - 855 0 SUB SU SU 0.000000 1.0000 0 - 856 0 SUB SU SU 0.000000 1.0000 0 - 857 0 SUB SU SU 0.000000 1.0000 0 - 858 0 SUB SU SU 0.000000 1.0000 0 - 859 0 SUB SU SU 0.000000 1.0000 0 - 860 0 SUB SU SU 0.000000 1.0000 0 - 861 0 SUB SU SU 0.000000 1.0000 0 - 862 0 SUB SU SU 0.000000 1.0000 0 - 863 0 SUB SU SU 0.000000 1.0000 0 - 864 0 SUB SU SU 0.000000 1.0000 0 - 865 0 SUB SU SU 0.000000 1.0000 0 - 866 0 SUB SU SU 0.000000 1.0000 0 - 867 0 SUB SU SU 0.000000 1.0000 0 - 868 0 SUB SU SU 0.000000 1.0000 0 - 869 0 SUB SU SU 0.000000 1.0000 0 - 870 0 SUB SU SU 0.000000 1.0000 0 - 871 0 SUB SU SU 0.000000 1.0000 0 - 872 0 SUB SU SU 0.000000 1.0000 0 - 873 0 SUB SU SU 0.000000 1.0000 0 - 874 0 SUB SU SU 0.000000 1.0000 0 - 875 0 SUB SU SU 0.000000 1.0000 0 - 876 0 SUB SU SU 0.000000 1.0000 0 - 877 0 SUB SU SU 0.000000 1.0000 0 - 878 0 SUB SU SU 0.000000 1.0000 0 - 879 0 SUB SU SU 0.000000 1.0000 0 - 880 0 SUB SU SU 0.000000 1.0000 0 - 881 0 SUB SU SU 0.000000 1.0000 0 - 882 0 SUB SU SU 0.000000 1.0000 0 - 883 0 SUB SU SU 0.000000 1.0000 0 - 884 0 SUB SU SU 0.000000 1.0000 0 - 885 0 SUB SU SU 0.000000 1.0000 0 - 886 0 SUB SU SU 0.000000 1.0000 0 - 887 0 SUB SU SU 0.000000 1.0000 0 - 888 0 SUB SU SU 0.000000 1.0000 0 - 889 0 SUB SU SU 0.000000 1.0000 0 - 890 0 SUB SU SU 0.000000 1.0000 0 - 891 0 SUB SU SU 0.000000 1.0000 0 - 892 0 SUB SU SU 0.000000 1.0000 0 - 893 0 SUB SU SU 0.000000 1.0000 0 - 894 0 SUB SU SU 0.000000 1.0000 0 - 895 0 SUB SU SU 0.000000 1.0000 0 - 896 0 SUB SU SU 0.000000 1.0000 0 - 897 0 SUB SU SU 0.000000 1.0000 0 - 898 0 SUB SU SU 0.000000 1.0000 0 - 899 0 SUB SU SU 0.000000 1.0000 0 - 900 0 SUB SU SU 0.000000 1.0000 0 - 901 0 SUB SU SU 0.000000 1.0000 0 - 902 0 SUB SU SU 0.000000 1.0000 0 - 903 0 SUB SU SU 0.000000 1.0000 0 - 904 0 SUB SU SU 0.000000 1.0000 0 - 905 0 SUB SU SU 0.000000 1.0000 0 - 906 0 SUB SU SU 0.000000 1.0000 0 - 907 0 SUB SU SU 0.000000 1.0000 0 - 908 0 SUB SU SU 0.000000 1.0000 0 - 909 0 SUB SU SU 0.000000 1.0000 0 - 910 0 SUB SU SU 0.000000 1.0000 0 - 911 0 SUB SU SU 0.000000 1.0000 0 - 912 0 SUB SU SU 0.000000 1.0000 0 - 913 0 SUB SU SU 0.000000 1.0000 0 - 914 0 SUB SU SU 0.000000 1.0000 0 - 915 0 SUB SU SU 0.000000 1.0000 0 - 916 0 SUB SU SU 0.000000 1.0000 0 - 917 0 SUB SU SU 0.000000 1.0000 0 - 918 0 SUB SU SU 0.000000 1.0000 0 - 919 0 SUB SU SU 0.000000 1.0000 0 - 920 0 SUB SU SU 0.000000 1.0000 0 - 921 0 SUB SU SU 0.000000 1.0000 0 - 922 0 SUB SU SU 0.000000 1.0000 0 - 923 0 SUB SU SU 0.000000 1.0000 0 - 924 0 SUB SU SU 0.000000 1.0000 0 - 925 0 SUB SU SU 0.000000 1.0000 0 - 926 0 SUB SU SU 0.000000 1.0000 0 - 927 0 SUB SU SU 0.000000 1.0000 0 - 928 0 SUB SU SU 0.000000 1.0000 0 - 929 0 SUB SU SU 0.000000 1.0000 0 - 930 0 SUB SU SU 0.000000 1.0000 0 - 931 0 SUB SU SU 0.000000 1.0000 0 - 932 0 SUB SU SU 0.000000 1.0000 0 - 933 0 SUB SU SU 0.000000 1.0000 0 - 934 0 SUB SU SU 0.000000 1.0000 0 - 935 0 SUB SU SU 0.000000 1.0000 0 - 936 0 SUB SU SU 0.000000 1.0000 0 - 937 0 SUB SU SU 0.000000 1.0000 0 - 938 0 SUB SU SU 0.000000 1.0000 0 - 939 0 SUB SU SU 0.000000 1.0000 0 - 940 0 SUB SU SU 0.000000 1.0000 0 - 941 0 SUB SU SU 0.000000 1.0000 0 - 942 0 SUB SU SU 0.000000 1.0000 0 - 943 0 SUB SU SU 0.000000 1.0000 0 - 944 0 SUB SU SU 0.000000 1.0000 0 - 945 0 SUB SU SU 0.000000 1.0000 0 - 946 0 SUB SU SU 0.000000 1.0000 0 - 947 0 SUB SU SU 0.000000 1.0000 0 - 948 0 SUB SU SU 0.000000 1.0000 0 - 949 0 SUB SU SU 0.000000 1.0000 0 - 950 0 SUB SU SU 0.000000 1.0000 0 - 951 0 SUB SU SU 0.000000 1.0000 0 - 952 0 SUB SU SU 0.000000 1.0000 0 - 953 0 SUB SU SU 0.000000 1.0000 0 - 954 0 SUB SU SU 0.000000 1.0000 0 - 955 0 SUB SU SU 0.000000 1.0000 0 - 956 0 SUB SU SU 0.000000 1.0000 0 - 957 0 SUB SU SU 0.000000 1.0000 0 - 958 0 SUB SU SU 0.000000 1.0000 0 - 959 0 SUB SU SU 0.000000 1.0000 0 - 960 0 SUB SU SU 0.000000 1.0000 0 - 961 0 SUB SU SU 0.000000 1.0000 0 - 962 0 SUB SU SU 0.000000 1.0000 0 - 963 0 SUB SU SU 0.000000 1.0000 0 - 964 0 SUB SU SU 0.000000 1.0000 0 - 965 0 SUB SU SU 0.000000 1.0000 0 - 966 0 SUB SU SU 0.000000 1.0000 0 - 967 0 SUB SU SU 0.000000 1.0000 0 - 968 0 SUB SU SU 0.000000 1.0000 0 - 969 0 SUB SU SU 0.000000 1.0000 0 - 970 0 SUB SU SU 0.000000 1.0000 0 - 971 0 SUB SU SU 0.000000 1.0000 0 - 972 0 SUB SU SU 0.000000 1.0000 0 - 973 0 SUB SU SU 0.000000 1.0000 0 - 974 0 SUB SU SU 0.000000 1.0000 0 - 975 0 SUB SU SU 0.000000 1.0000 0 - 976 0 SUB SU SU 0.000000 1.0000 0 - 977 0 SUB SU SU 0.000000 1.0000 0 - 978 0 SUB SU SU 0.000000 1.0000 0 - 979 0 SUB SU SU 0.000000 1.0000 0 - 980 0 SUB SU SU 0.000000 1.0000 0 - 981 0 SUB SU SU 0.000000 1.0000 0 - 982 0 SUB SU SU 0.000000 1.0000 0 - 983 0 SUB SU SU 0.000000 1.0000 0 - 984 0 SUB SU SU 0.000000 1.0000 0 - 985 0 SUB SU SU 0.000000 1.0000 0 - 986 0 SUB SU SU 0.000000 1.0000 0 - 987 0 SUB SU SU 0.000000 1.0000 0 - 988 0 SUB SU SU 0.000000 1.0000 0 - 989 0 SUB SU SU 0.000000 1.0000 0 - 990 0 SUB SU SU 0.000000 1.0000 0 - 991 0 SUB SU SU 0.000000 1.0000 0 - 992 0 SUB SU SU 0.000000 1.0000 0 - 993 0 SUB SU SU 0.000000 1.0000 0 - 994 0 SUB SU SU 0.000000 1.0000 0 - 995 0 SUB SU SU 0.000000 1.0000 0 - 996 0 SUB SU SU 0.000000 1.0000 0 - 997 0 SUB SU SU 0.000000 1.0000 0 - 998 0 SUB SU SU 0.000000 1.0000 0 - 999 0 SUB SU SU 0.000000 1.0000 0 - 1000 0 SUB SU SU 0.000000 1.0000 0 - 1001 0 SUB SU SU 0.000000 1.0000 0 - 1002 0 SUB SU SU 0.000000 1.0000 0 - 1003 0 SUB SU SU 0.000000 1.0000 0 - 1004 0 SUB SU SU 0.000000 1.0000 0 - 1005 0 SUB SU SU 0.000000 1.0000 0 - 1006 0 SUB SU SU 0.000000 1.0000 0 - 1007 0 SUB SU SU 0.000000 1.0000 0 - 1008 0 SUB SU SU 0.000000 1.0000 0 - 1009 0 SUB SU SU 0.000000 1.0000 0 - 1010 0 SUB SU SU 0.000000 1.0000 0 - 1011 0 SUB SU SU 0.000000 1.0000 0 - 1012 0 SUB SU SU 0.000000 1.0000 0 - 1013 0 SUB SU SU 0.000000 1.0000 0 - 1014 0 SUB SU SU 0.000000 1.0000 0 - 1015 0 SUB SU SU 0.000000 1.0000 0 - 1016 0 SUB SU SU 0.000000 1.0000 0 - 1017 0 SUB SU SU 0.000000 1.0000 0 - 1018 0 SUB SU SU 0.000000 1.0000 0 - 1019 0 SUB SU SU 0.000000 1.0000 0 - 1020 0 SUB SU SU 0.000000 1.0000 0 - 1021 0 SUB SU SU 0.000000 1.0000 0 - 1022 0 SUB SU SU 0.000000 1.0000 0 - 1023 0 SUB SU SU 0.000000 1.0000 0 - 1024 0 SUB SU SU 0.000000 1.0000 0 - 1025 0 SUB SU SU 0.000000 1.0000 0 - 1026 0 SUB SU SU 0.000000 1.0000 0 - 1027 0 SUB SU SU 0.000000 1.0000 0 - 1028 0 SUB SU SU 0.000000 1.0000 0 - 1029 0 SUB SU SU 0.000000 1.0000 0 - 1030 0 SUB SU SU 0.000000 1.0000 0 - 1031 0 SUB SU SU 0.000000 1.0000 0 - 1032 0 SUB SU SU 0.000000 1.0000 0 - 1033 0 SUB SU SU 0.000000 1.0000 0 - 1034 0 SUB SU SU 0.000000 1.0000 0 - 1035 0 SUB SU SU 0.000000 1.0000 0 - 1036 0 SUB SU SU 0.000000 1.0000 0 - 1037 0 SUB SU SU 0.000000 1.0000 0 - 1038 0 SUB SU SU 0.000000 1.0000 0 - 1039 0 SUB SU SU 0.000000 1.0000 0 - 1040 0 SUB SU SU 0.000000 1.0000 0 - 1041 0 SUB SU SU 0.000000 1.0000 0 - 1042 0 SUB SU SU 0.000000 1.0000 0 - 1043 0 SUB SU SU 0.000000 1.0000 0 - 1044 0 SUB SU SU 0.000000 1.0000 0 - 1045 0 SUB SU SU 0.000000 1.0000 0 - 1046 0 SUB SU SU 0.000000 1.0000 0 - 1047 0 SUB SU SU 0.000000 1.0000 0 - 1048 0 SUB SU SU 0.000000 1.0000 0 - 1049 0 SUB SU SU 0.000000 1.0000 0 - 1050 0 SUB SU SU 0.000000 1.0000 0 - 1051 0 SUB SU SU 0.000000 1.0000 0 - 1052 0 SUB SU SU 0.000000 1.0000 0 - 1053 0 SUB SU SU 0.000000 1.0000 0 - 1054 0 SUB SU SU 0.000000 1.0000 0 - 1055 0 SUB SU SU 0.000000 1.0000 0 - 1056 0 SUB SU SU 0.000000 1.0000 0 - 1057 0 SUB SU SU 0.000000 1.0000 0 - 1058 0 SUB SU SU 0.000000 1.0000 0 - 1059 0 SUB SU SU 0.000000 1.0000 0 - 1060 0 SUB SU SU 0.000000 1.0000 0 - 1061 0 SUB SU SU 0.000000 1.0000 0 - 1062 0 SUB SU SU 0.000000 1.0000 0 - 1063 0 SUB SU SU 0.000000 1.0000 0 - 1064 0 SUB SU SU 0.000000 1.0000 0 - 1065 0 SUB SU SU 0.000000 1.0000 0 - 1066 0 SUB SU SU 0.000000 1.0000 0 - 1067 0 SUB SU SU 0.000000 1.0000 0 - 1068 0 SUB SU SU 0.000000 1.0000 0 - 1069 0 SUB SU SU 0.000000 1.0000 0 - 1070 0 SUB SU SU 0.000000 1.0000 0 - 1071 0 SUB SU SU 0.000000 1.0000 0 - 1072 0 SUB SU SU 0.000000 1.0000 0 - 1073 0 SUB SU SU 0.000000 1.0000 0 - 1074 0 SUB SU SU 0.000000 1.0000 0 - 1075 0 SUB SU SU 0.000000 1.0000 0 - 1076 0 SUB SU SU 0.000000 1.0000 0 - 1077 0 SUB SU SU 0.000000 1.0000 0 - 1078 0 SUB SU SU 0.000000 1.0000 0 - 1079 0 SUB SU SU 0.000000 1.0000 0 - 1080 0 SUB SU SU 0.000000 1.0000 0 - 1081 0 SUB SU SU 0.000000 1.0000 0 - 1082 0 SUB SU SU 0.000000 1.0000 0 - 1083 0 SUB SU SU 0.000000 1.0000 0 - 1084 0 SUB SU SU 0.000000 1.0000 0 - 1085 0 SUB SU SU 0.000000 1.0000 0 - 1086 0 SUB SU SU 0.000000 1.0000 0 - 1087 0 SUB SU SU 0.000000 1.0000 0 - 1088 0 SUB SU SU 0.000000 1.0000 0 - 1089 0 SUB SU SU 0.000000 1.0000 0 - 1090 0 SUB SU SU 0.000000 1.0000 0 - 1091 0 SUB SU SU 0.000000 1.0000 0 - 1092 0 SUB SU SU 0.000000 1.0000 0 - 1093 0 SUB SU SU 0.000000 1.0000 0 - 1094 0 SUB SU SU 0.000000 1.0000 0 - 1095 0 SUB SU SU 0.000000 1.0000 0 - 1096 0 SUB SU SU 0.000000 1.0000 0 - 1097 0 SUB SU SU 0.000000 1.0000 0 - 1098 0 SUB SU SU 0.000000 1.0000 0 - 1099 0 SUB SU SU 0.000000 1.0000 0 - 1100 0 SUB SU SU 0.000000 1.0000 0 - 1101 0 SUB SU SU 0.000000 1.0000 0 - 1102 0 SUB SU SU 0.000000 1.0000 0 - 1103 0 SUB SU SU 0.000000 1.0000 0 - 1104 0 SUB SU SU 0.000000 1.0000 0 - 1105 0 SUB SU SU 0.000000 1.0000 0 - 1106 0 SUB SU SU 0.000000 1.0000 0 - 1107 0 SUB SU SU 0.000000 1.0000 0 - 1108 0 SUB SU SU 0.000000 1.0000 0 - 1109 0 SUB SU SU 0.000000 1.0000 0 - 1110 0 SUB SU SU 0.000000 1.0000 0 - 1111 0 SUB SU SU 0.000000 1.0000 0 - 1112 0 SUB SU SU 0.000000 1.0000 0 - 1113 0 SUB SU SU 0.000000 1.0000 0 - 1114 0 SUB SU SU 0.000000 1.0000 0 - 1115 0 SUB SU SU 0.000000 1.0000 0 - 1116 0 SUB SU SU 0.000000 1.0000 0 - 1117 0 SUB SU SU 0.000000 1.0000 0 - 1118 0 SUB SU SU 0.000000 1.0000 0 - 1119 0 SUB SU SU 0.000000 1.0000 0 - 1120 0 SUB SU SU 0.000000 1.0000 0 - 1121 0 SUB SU SU 0.000000 1.0000 0 - 1122 0 SUB SU SU 0.000000 1.0000 0 - 1123 0 SUB SU SU 0.000000 1.0000 0 - 1124 0 SUB SU SU 0.000000 1.0000 0 - 1125 0 SUB SU SU 0.000000 1.0000 0 - 1126 0 SUB SU SU 0.000000 1.0000 0 - 1127 0 SUB SU SU 0.000000 1.0000 0 - 1128 0 SUB SU SU 0.000000 1.0000 0 - 1129 0 SUB SU SU 0.000000 1.0000 0 - 1130 0 SUB SU SU 0.000000 1.0000 0 - 1131 0 SUB SU SU 0.000000 1.0000 0 - 1132 0 SUB SU SU 0.000000 1.0000 0 - 1133 0 SUB SU SU 0.000000 1.0000 0 - 1134 0 SUB SU SU 0.000000 1.0000 0 - 1135 0 SUB SU SU 0.000000 1.0000 0 - 1136 0 SUB SU SU 0.000000 1.0000 0 - 1137 0 SUB SU SU 0.000000 1.0000 0 - 1138 0 SUB SU SU 0.000000 1.0000 0 - 1139 0 SUB SU SU 0.000000 1.0000 0 - 1140 0 SUB SU SU 0.000000 1.0000 0 - 1141 0 SUB SU SU 0.000000 1.0000 0 - 1142 0 SUB SU SU 0.000000 1.0000 0 - 1143 0 SUB SU SU 0.000000 1.0000 0 - 1144 0 SUB SU SU 0.000000 1.0000 0 - 1145 0 SUB SU SU 0.000000 1.0000 0 - 1146 0 SUB SU SU 0.000000 1.0000 0 - 1147 0 SUB SU SU 0.000000 1.0000 0 - 1148 0 SUB SU SU 0.000000 1.0000 0 - 1149 0 SUB SU SU 0.000000 1.0000 0 - 1150 0 SUB SU SU 0.000000 1.0000 0 - 1151 0 SUB SU SU 0.000000 1.0000 0 - 1152 0 SUB SU SU 0.000000 1.0000 0 - 1153 0 SUB SU SU 0.000000 1.0000 0 - 1154 0 SUB SU SU 0.000000 1.0000 0 - 1155 0 SUB SU SU 0.000000 1.0000 0 - 1156 0 SUB SU SU 0.000000 1.0000 0 - 1157 0 SUB SU SU 0.000000 1.0000 0 - 1158 0 SUB SU SU 0.000000 1.0000 0 - 1159 0 SUB SU SU 0.000000 1.0000 0 - 1160 0 SUB SU SU 0.000000 1.0000 0 - 1161 0 SUB SU SU 0.000000 1.0000 0 - 1162 0 SUB SU SU 0.000000 1.0000 0 - 1163 0 SUB SU SU 0.000000 1.0000 0 - 1164 0 SUB SU SU 0.000000 1.0000 0 - 1165 0 SUB SU SU 0.000000 1.0000 0 - 1166 0 SUB SU SU 0.000000 1.0000 0 - 1167 0 SUB SU SU 0.000000 1.0000 0 - 1168 0 SUB SU SU 0.000000 1.0000 0 - 1169 0 SUB SU SU 0.000000 1.0000 0 - 1170 0 SUB SU SU 0.000000 1.0000 0 - 1171 0 SUB SU SU 0.000000 1.0000 0 - 1172 0 SUB SU SU 0.000000 1.0000 0 - 1173 0 SUB SU SU 0.000000 1.0000 0 - 1174 0 SUB SU SU 0.000000 1.0000 0 - 1175 0 SUB SU SU 0.000000 1.0000 0 - 1176 0 SUB SU SU 0.000000 1.0000 0 - 1177 0 SUB SU SU 0.000000 1.0000 0 - 1178 0 SUB SU SU 0.000000 1.0000 0 - 1179 0 SUB SU SU 0.000000 1.0000 0 - 1180 0 SUB SU SU 0.000000 1.0000 0 - 1181 0 SUB SU SU 0.000000 1.0000 0 - 1182 0 SUB SU SU 0.000000 1.0000 0 - 1183 0 SUB SU SU 0.000000 1.0000 0 - 1184 0 SUB SU SU 0.000000 1.0000 0 - 1185 0 SUB SU SU 0.000000 1.0000 0 - 1186 0 SUB SU SU 0.000000 1.0000 0 - 1187 0 SUB SU SU 0.000000 1.0000 0 - 1188 0 SUB SU SU 0.000000 1.0000 0 - 1189 0 SUB SU SU 0.000000 1.0000 0 - 1190 0 SUB SU SU 0.000000 1.0000 0 - 1191 0 SUB SU SU 0.000000 1.0000 0 - 1192 0 SUB SU SU 0.000000 1.0000 0 - 1193 0 SUB SU SU 0.000000 1.0000 0 - 1194 0 SUB SU SU 0.000000 1.0000 0 - 1195 0 SUB SU SU 0.000000 1.0000 0 - 1196 0 SUB SU SU 0.000000 1.0000 0 - 1197 0 SUB SU SU 0.000000 1.0000 0 - 1198 0 SUB SU SU 0.000000 1.0000 0 - 1199 0 SUB SU SU 0.000000 1.0000 0 - 1200 0 SUB SU SU 0.000000 1.0000 0 - 1201 0 SUB SU SU 0.000000 1.0000 0 - 1202 0 SUB SU SU 0.000000 1.0000 0 - 1203 0 SUB SU SU 0.000000 1.0000 0 - 1204 0 SUB SU SU 0.000000 1.0000 0 - 1205 0 SUB SU SU 0.000000 1.0000 0 - 1206 0 SUB SU SU 0.000000 1.0000 0 - 1207 0 SUB SU SU 0.000000 1.0000 0 - 1208 0 SUB SU SU 0.000000 1.0000 0 - 1209 0 SUB SU SU 0.000000 1.0000 0 - 1210 0 SUB SU SU 0.000000 1.0000 0 - 1211 0 SUB SU SU 0.000000 1.0000 0 - 1212 0 SUB SU SU 0.000000 1.0000 0 - 1213 0 SUB SU SU 0.000000 1.0000 0 - 1214 0 SUB SU SU 0.000000 1.0000 0 - 1215 0 SUB SU SU 0.000000 1.0000 0 - 1216 0 SUB SU SU 0.000000 1.0000 0 - 1217 0 SUB SU SU 0.000000 1.0000 0 - 1218 0 SUB SU SU 0.000000 1.0000 0 - 1219 0 SUB SU SU 0.000000 1.0000 0 - 1220 0 SUB SU SU 0.000000 1.0000 0 - 1221 0 SUB SU SU 0.000000 1.0000 0 - 1222 0 SUB SU SU 0.000000 1.0000 0 - 1223 0 SUB SU SU 0.000000 1.0000 0 - 1224 0 SUB SU SU 0.000000 1.0000 0 - 1225 0 SUB SU SU 0.000000 1.0000 0 - 1226 0 SUB SU SU 0.000000 1.0000 0 - 1227 0 SUB SU SU 0.000000 1.0000 0 - 1228 0 SUB SU SU 0.000000 1.0000 0 - 1229 0 SUB SU SU 0.000000 1.0000 0 - 1230 0 SUB SU SU 0.000000 1.0000 0 - 1231 0 SUB SU SU 0.000000 1.0000 0 - 1232 0 SUB SU SU 0.000000 1.0000 0 - 1233 0 SUB SU SU 0.000000 1.0000 0 - 1234 0 SUB SU SU 0.000000 1.0000 0 - 1235 0 SUB SU SU 0.000000 1.0000 0 - 1236 0 SUB SU SU 0.000000 1.0000 0 - 1237 0 SUB SU SU 0.000000 1.0000 0 - 1238 0 SUB SU SU 0.000000 1.0000 0 - 1239 0 SUB SU SU 0.000000 1.0000 0 - 1240 0 SUB SU SU 0.000000 1.0000 0 - 1241 0 SUB SU SU 0.000000 1.0000 0 - 1242 0 SUB SU SU 0.000000 1.0000 0 - 1243 0 SUB SU SU 0.000000 1.0000 0 - 1244 0 SUB SU SU 0.000000 1.0000 0 - 1245 0 SUB SU SU 0.000000 1.0000 0 - 1246 0 SUB SU SU 0.000000 1.0000 0 - 1247 0 SUB SU SU 0.000000 1.0000 0 - 1248 0 SUB SU SU 0.000000 1.0000 0 - 1249 0 SUB SU SU 0.000000 1.0000 0 - 1250 0 SUB SU SU 0.000000 1.0000 0 - 1251 0 SUB SU SU 0.000000 1.0000 0 - 1252 0 SUB SU SU 0.000000 1.0000 0 - 1253 0 SUB SU SU 0.000000 1.0000 0 - 1254 0 SUB SU SU 0.000000 1.0000 0 - 1255 0 SUB SU SU 0.000000 1.0000 0 - 1256 0 SUB SU SU 0.000000 1.0000 0 - 1257 0 SUB SU SU 0.000000 1.0000 0 - 1258 0 SUB SU SU 0.000000 1.0000 0 - 1259 0 SUB SU SU 0.000000 1.0000 0 - 1260 0 SUB SU SU 0.000000 1.0000 0 - 1261 0 SUB SU SU 0.000000 1.0000 0 - 1262 0 SUB SU SU 0.000000 1.0000 0 - 1263 0 SUB SU SU 0.000000 1.0000 0 - 1264 0 SUB SU SU 0.000000 1.0000 0 - 1265 0 SUB SU SU 0.000000 1.0000 0 - 1266 0 SUB SU SU 0.000000 1.0000 0 - 1267 0 SUB SU SU 0.000000 1.0000 0 - 1268 0 SUB SU SU 0.000000 1.0000 0 - 1269 0 SUB SU SU 0.000000 1.0000 0 - 1270 0 SUB SU SU 0.000000 1.0000 0 - 1271 0 SUB SU SU 0.000000 1.0000 0 - 1272 0 SUB SU SU 0.000000 1.0000 0 - 1273 0 SUB SU SU 0.000000 1.0000 0 - 1274 0 SUB SU SU 0.000000 1.0000 0 - 1275 0 SUB SU SU 0.000000 1.0000 0 - 1276 0 SUB SU SU 0.000000 1.0000 0 - 1277 0 SUB SU SU 0.000000 1.0000 0 - 1278 0 SUB SU SU 0.000000 1.0000 0 - 1279 0 SUB SU SU 0.000000 1.0000 0 - 1280 0 SUB SU SU 0.000000 1.0000 0 - 1281 0 SUB SU SU 0.000000 1.0000 0 - 1282 0 SUB SU SU 0.000000 1.0000 0 - 1283 0 SUB SU SU 0.000000 1.0000 0 - 1284 0 SUB SU SU 0.000000 1.0000 0 - 1285 0 SUB SU SU 0.000000 1.0000 0 - 1286 0 SUB SU SU 0.000000 1.0000 0 - 1287 0 SUB SU SU 0.000000 1.0000 0 - 1288 0 SUB SU SU 0.000000 1.0000 0 - 1289 0 SUB SU SU 0.000000 1.0000 0 - 1290 0 SUB SU SU 0.000000 1.0000 0 - 1291 0 SUB SU SU 0.000000 1.0000 0 - 1292 0 SUB SU SU 0.000000 1.0000 0 - 1293 0 SUB SU SU 0.000000 1.0000 0 - 1294 0 SUB SU SU 0.000000 1.0000 0 - 1295 0 SUB SU SU 0.000000 1.0000 0 - 1296 0 SUB SU SU 0.000000 1.0000 0 - 1297 0 SUB SU SU 0.000000 1.0000 0 - 1298 0 SUB SU SU 0.000000 1.0000 0 - 1299 0 SUB SU SU 0.000000 1.0000 0 - 1300 0 SUB SU SU 0.000000 1.0000 0 - 1301 0 SUB SU SU 0.000000 1.0000 0 - 1302 0 SUB SU SU 0.000000 1.0000 0 - 1303 0 SUB SU SU 0.000000 1.0000 0 - 1304 0 SUB SU SU 0.000000 1.0000 0 - 1305 0 SUB SU SU 0.000000 1.0000 0 - 1306 0 SUB SU SU 0.000000 1.0000 0 - 1307 0 SUB SU SU 0.000000 1.0000 0 - 1308 0 SUB SU SU 0.000000 1.0000 0 - 1309 0 SUB SU SU 0.000000 1.0000 0 - 1310 0 SUB SU SU 0.000000 1.0000 0 - 1311 0 SUB SU SU 0.000000 1.0000 0 - 1312 0 SUB SU SU 0.000000 1.0000 0 - 1313 0 SUB SU SU 0.000000 1.0000 0 - 1314 0 SUB SU SU 0.000000 1.0000 0 - 1315 0 SUB SU SU 0.000000 1.0000 0 - 1316 0 SUB SU SU 0.000000 1.0000 0 - 1317 0 SUB SU SU 0.000000 1.0000 0 - 1318 0 SUB SU SU 0.000000 1.0000 0 - 1319 0 SUB SU SU 0.000000 1.0000 0 - 1320 0 SUB SU SU 0.000000 1.0000 0 - 1321 0 SUB SU SU 0.000000 1.0000 0 - 1322 0 SUB SU SU 0.000000 1.0000 0 - 1323 0 SUB SU SU 0.000000 1.0000 0 - 1324 0 SUB SU SU 0.000000 1.0000 0 - 1325 0 SUB SU SU 0.000000 1.0000 0 - 1326 0 SUB SU SU 0.000000 1.0000 0 - 1327 0 SUB SU SU 0.000000 1.0000 0 - 1328 0 SUB SU SU 0.000000 1.0000 0 - 1329 0 SUB SU SU 0.000000 1.0000 0 - 1330 0 SUB SU SU 0.000000 1.0000 0 - 1331 0 SUB SU SU 0.000000 1.0000 0 - 1332 0 SUB SU SU 0.000000 1.0000 0 - 1333 0 SUB SU SU 0.000000 1.0000 0 - 1334 0 SUB SU SU 0.000000 1.0000 0 - 1335 0 SUB SU SU 0.000000 1.0000 0 - 1336 0 SUB SU SU 0.000000 1.0000 0 - 1337 0 SUB SU SU 0.000000 1.0000 0 - 1338 0 SUB SU SU 0.000000 1.0000 0 - 1339 0 SUB SU SU 0.000000 1.0000 0 - 1340 0 SUB SU SU 0.000000 1.0000 0 - 1341 0 SUB SU SU 0.000000 1.0000 0 - 1342 0 SUB SU SU 0.000000 1.0000 0 - 1343 0 SUB SU SU 0.000000 1.0000 0 - 1344 0 SUB SU SU 0.000000 1.0000 0 - 1345 0 SUB SU SU 0.000000 1.0000 0 - 1346 0 SUB SU SU 0.000000 1.0000 0 - 1347 0 SUB SU SU 0.000000 1.0000 0 - 1348 0 SUB SU SU 0.000000 1.0000 0 - 1349 0 SUB SU SU 0.000000 1.0000 0 - 1350 0 SUB SU SU 0.000000 1.0000 0 - 1351 0 SUB SU SU 0.000000 1.0000 0 - 1352 0 SUB SU SU 0.000000 1.0000 0 - 1353 0 SUB SU SU 0.000000 1.0000 0 - 1354 0 SUB SU SU 0.000000 1.0000 0 - 1355 0 SUB SU SU 0.000000 1.0000 0 - 1356 0 SUB SU SU 0.000000 1.0000 0 - 1357 0 SUB SU SU 0.000000 1.0000 0 - 1358 0 SUB SU SU 0.000000 1.0000 0 - 1359 0 SUB SU SU 0.000000 1.0000 0 - 1360 0 SUB SU SU 0.000000 1.0000 0 - 1361 0 SUB SU SU 0.000000 1.0000 0 - 1362 0 SUB SU SU 0.000000 1.0000 0 - 1363 0 SUB SU SU 0.000000 1.0000 0 - 1364 0 SUB SU SU 0.000000 1.0000 0 - 1365 0 SUB SU SU 0.000000 1.0000 0 - 1366 0 SUB SU SU 0.000000 1.0000 0 - 1367 0 SUB SU SU 0.000000 1.0000 0 - 1368 0 SUB SU SU 0.000000 1.0000 0 - 1369 0 SUB SU SU 0.000000 1.0000 0 - 1370 0 SUB SU SU 0.000000 1.0000 0 - 1371 0 SUB SU SU 0.000000 1.0000 0 - 1372 0 SUB SU SU 0.000000 1.0000 0 - 1373 0 SUB SU SU 0.000000 1.0000 0 - 1374 0 SUB SU SU 0.000000 1.0000 0 - 1375 0 SUB SU SU 0.000000 1.0000 0 - 1376 0 SUB SU SU 0.000000 1.0000 0 - 1377 0 SUB SU SU 0.000000 1.0000 0 - 1378 0 SUB SU SU 0.000000 1.0000 0 - 1379 0 SUB SU SU 0.000000 1.0000 0 - 1380 0 SUB SU SU 0.000000 1.0000 0 - 1381 0 SUB SU SU 0.000000 1.0000 0 - 1382 0 SUB SU SU 0.000000 1.0000 0 - 1383 0 SUB SU SU 0.000000 1.0000 0 - 1384 0 SUB SU SU 0.000000 1.0000 0 - 1385 0 SUB SU SU 0.000000 1.0000 0 - 1386 0 SUB SU SU 0.000000 1.0000 0 - 1387 0 SUB SU SU 0.000000 1.0000 0 - 1388 0 SUB SU SU 0.000000 1.0000 0 - 1389 0 SUB SU SU 0.000000 1.0000 0 - 1390 0 SUB SU SU 0.000000 1.0000 0 - 1391 0 SUB SU SU 0.000000 1.0000 0 - 1392 0 SUB SU SU 0.000000 1.0000 0 - 1393 0 SUB SU SU 0.000000 1.0000 0 - 1394 0 SUB SU SU 0.000000 1.0000 0 - 1395 0 SUB SU SU 0.000000 1.0000 0 - 1396 0 SUB SU SU 0.000000 1.0000 0 - 1397 0 SUB SU SU 0.000000 1.0000 0 - 1398 0 SUB SU SU 0.000000 1.0000 0 - 1399 0 SUB SU SU 0.000000 1.0000 0 - 1400 0 SUB SU SU 0.000000 1.0000 0 - 1401 0 SUB SU SU 0.000000 1.0000 0 - 1402 0 SUB SU SU 0.000000 1.0000 0 - 1403 0 SUB SU SU 0.000000 1.0000 0 - 1404 0 SUB SU SU 0.000000 1.0000 0 - 1405 0 SUB SU SU 0.000000 1.0000 0 - 1406 0 SUB SU SU 0.000000 1.0000 0 - 1407 0 SUB SU SU 0.000000 1.0000 0 - 1408 0 SUB SU SU 0.000000 1.0000 0 - 1409 0 SUB SU SU 0.000000 1.0000 0 - 1410 0 SUB SU SU 0.000000 1.0000 0 - 1411 0 SUB SU SU 0.000000 1.0000 0 - 1412 0 SUB SU SU 0.000000 1.0000 0 - 1413 0 SUB SU SU 0.000000 1.0000 0 - 1414 0 SUB SU SU 0.000000 1.0000 0 - 1415 0 SUB SU SU 0.000000 1.0000 0 - 1416 0 SUB SU SU 0.000000 1.0000 0 - 1417 0 SUB SU SU 0.000000 1.0000 0 - 1418 0 SUB SU SU 0.000000 1.0000 0 - 1419 0 SUB SU SU 0.000000 1.0000 0 - 1420 0 SUB SU SU 0.000000 1.0000 0 - 1421 0 SUB SU SU 0.000000 1.0000 0 - 1422 0 SUB SU SU 0.000000 1.0000 0 - 1423 0 SUB SU SU 0.000000 1.0000 0 - 1424 0 SUB SU SU 0.000000 1.0000 0 - 1425 0 SUB SU SU 0.000000 1.0000 0 - 1426 0 SUB SU SU 0.000000 1.0000 0 - 1427 0 SUB SU SU 0.000000 1.0000 0 - 1428 0 SUB SU SU 0.000000 1.0000 0 - 1429 0 SUB SU SU 0.000000 1.0000 0 - 1430 0 SUB SU SU 0.000000 1.0000 0 - 1431 0 SUB SU SU 0.000000 1.0000 0 - 1432 0 SUB SU SU 0.000000 1.0000 0 - 1433 0 SUB SU SU 0.000000 1.0000 0 - 1434 0 SUB SU SU 0.000000 1.0000 0 - 1435 0 SUB SU SU 0.000000 1.0000 0 - 1436 0 SUB SU SU 0.000000 1.0000 0 - 1437 0 SUB SU SU 0.000000 1.0000 0 - 1438 0 SUB SU SU 0.000000 1.0000 0 - 1439 0 SUB SU SU 0.000000 1.0000 0 - 1440 0 SUB SU SU 0.000000 1.0000 0 - 1441 0 SUB SU SU 0.000000 1.0000 0 - 1442 0 SUB SU SU 0.000000 1.0000 0 - 1443 0 SUB SU SU 0.000000 1.0000 0 - 1444 0 SUB SU SU 0.000000 1.0000 0 - 1445 0 SUB SU SU 0.000000 1.0000 0 - 1446 0 SUB SU SU 0.000000 1.0000 0 - 1447 0 SUB SU SU 0.000000 1.0000 0 - 1448 0 SUB SU SU 0.000000 1.0000 0 - 1449 0 SUB SU SU 0.000000 1.0000 0 - 1450 0 SUB SU SU 0.000000 1.0000 0 - 1451 0 SUB SU SU 0.000000 1.0000 0 - 1452 0 SUB SU SU 0.000000 1.0000 0 - 1453 0 SUB SU SU 0.000000 1.0000 0 - 1454 0 SUB SU SU 0.000000 1.0000 0 - 1455 0 SUB SU SU 0.000000 1.0000 0 - 1456 0 SUB SU SU 0.000000 1.0000 0 - 1457 0 SUB SU SU 0.000000 1.0000 0 - 1458 0 SUB SU SU 0.000000 1.0000 0 - 1459 0 SUB SU SU 0.000000 1.0000 0 - 1460 0 SUB SU SU 0.000000 1.0000 0 - 1461 0 SUB SU SU 0.000000 1.0000 0 - 1462 0 SUB SU SU 0.000000 1.0000 0 - 1463 0 SUB SU SU 0.000000 1.0000 0 - 1464 0 SUB SU SU 0.000000 1.0000 0 - 1465 0 SUB SU SU 0.000000 1.0000 0 - 1466 0 SUB SU SU 0.000000 1.0000 0 - 1467 0 SUB SU SU 0.000000 1.0000 0 - 1468 0 SUB SU SU 0.000000 1.0000 0 - 1469 0 SUB SU SU 0.000000 1.0000 0 - 1470 0 SUB SU SU 0.000000 1.0000 0 - 1471 0 SUB SU SU 0.000000 1.0000 0 - 1472 0 SUB SU SU 0.000000 1.0000 0 - 1473 0 SUB SU SU 0.000000 1.0000 0 - 1474 0 SUB SU SU 0.000000 1.0000 0 - 1475 0 SUB SU SU 0.000000 1.0000 0 - 1476 0 SUB SU SU 0.000000 1.0000 0 - 1477 0 SUB SU SU 0.000000 1.0000 0 - 1478 0 SUB SU SU 0.000000 1.0000 0 - 1479 0 SUB SU SU 0.000000 1.0000 0 - 1480 0 SUB SU SU 0.000000 1.0000 0 - 1481 0 SUB SU SU 0.000000 1.0000 0 - 1482 0 SUB SU SU 0.000000 1.0000 0 - 1483 0 SUB SU SU 0.000000 1.0000 0 - 1484 0 SUB SU SU 0.000000 1.0000 0 - 1485 0 SUB SU SU 0.000000 1.0000 0 - 1486 0 SUB SU SU 0.000000 1.0000 0 - 1487 0 SUB SU SU 0.000000 1.0000 0 - 1488 0 SUB SU SU 0.000000 1.0000 0 - 1489 0 SUB SU SU 0.000000 1.0000 0 - 1490 0 SUB SU SU 0.000000 1.0000 0 - 1491 0 SUB SU SU 0.000000 1.0000 0 - 1492 0 SUB SU SU 0.000000 1.0000 0 - 1493 0 SUB SU SU 0.000000 1.0000 0 - 1494 0 SUB SU SU 0.000000 1.0000 0 - 1495 0 SUB SU SU 0.000000 1.0000 0 - 1496 0 SUB SU SU 0.000000 1.0000 0 - 1497 0 SUB SU SU 0.000000 1.0000 0 - 1498 0 SUB SU SU 0.000000 1.0000 0 - 1499 0 SUB SU SU 0.000000 1.0000 0 - 1500 0 SUB SU SU 0.000000 1.0000 0 - 1501 0 SUB SU SU 0.000000 1.0000 0 - 1502 0 SUB SU SU 0.000000 1.0000 0 - 1503 0 SUB SU SU 0.000000 1.0000 0 - 1504 0 SUB SU SU 0.000000 1.0000 0 - 1505 0 SUB SU SU 0.000000 1.0000 0 - 1506 0 SUB SU SU 0.000000 1.0000 0 - 1507 0 SUB SU SU 0.000000 1.0000 0 - 1508 0 SUB SU SU 0.000000 1.0000 0 - 1509 0 SUB SU SU 0.000000 1.0000 0 - 1510 0 SUB SU SU 0.000000 1.0000 0 - 1511 0 SUB SU SU 0.000000 1.0000 0 - 1512 0 SUB SU SU 0.000000 1.0000 0 - 1513 0 SUB SU SU 0.000000 1.0000 0 - 1514 0 SUB SU SU 0.000000 1.0000 0 - 1515 0 SUB SU SU 0.000000 1.0000 0 - 1516 0 SUB SU SU 0.000000 1.0000 0 - 1517 0 SUB SU SU 0.000000 1.0000 0 - 1518 0 SUB SU SU 0.000000 1.0000 0 - 1519 0 SUB SU SU 0.000000 1.0000 0 - 1520 0 SUB SU SU 0.000000 1.0000 0 - 1521 0 SUB SU SU 0.000000 1.0000 0 - 1522 0 SUB SU SU 0.000000 1.0000 0 - 1523 0 SUB SU SU 0.000000 1.0000 0 - 1524 0 SUB SU SU 0.000000 1.0000 0 - 1525 0 SUB SU SU 0.000000 1.0000 0 - 1526 0 SUB SU SU 0.000000 1.0000 0 - 1527 0 SUB SU SU 0.000000 1.0000 0 - 1528 0 SUB SU SU 0.000000 1.0000 0 - 1529 0 SUB SU SU 0.000000 1.0000 0 - 1530 0 SUB SU SU 0.000000 1.0000 0 - 1531 0 SUB SU SU 0.000000 1.0000 0 - 1532 0 SUB SU SU 0.000000 1.0000 0 - 1533 0 SUB SU SU 0.000000 1.0000 0 - 1534 0 SUB SU SU 0.000000 1.0000 0 - 1535 0 SUB SU SU 0.000000 1.0000 0 - 1536 0 SUB SU SU 0.000000 1.0000 0 - 1537 0 SUB SU SU 0.000000 1.0000 0 - 1538 0 SUB SU SU 0.000000 1.0000 0 - 1539 0 SUB SU SU 0.000000 1.0000 0 - 1540 0 SUB SU SU 0.000000 1.0000 0 - 1541 0 SUB SU SU 0.000000 1.0000 0 - 1542 0 SUB SU SU 0.000000 1.0000 0 - 1543 0 SUB SU SU 0.000000 1.0000 0 - 1544 0 SUB SU SU 0.000000 1.0000 0 - 1545 0 SUB SU SU 0.000000 1.0000 0 - 1546 0 SUB SU SU 0.000000 1.0000 0 - 1547 0 SUB SU SU 0.000000 1.0000 0 - 1548 0 SUB SU SU 0.000000 1.0000 0 - 1549 0 SUB SU SU 0.000000 1.0000 0 - 1550 0 SUB SU SU 0.000000 1.0000 0 - 1551 0 SUB SU SU 0.000000 1.0000 0 - 1552 0 SUB SU SU 0.000000 1.0000 0 - 1553 0 SUB SU SU 0.000000 1.0000 0 - 1554 0 SUB SU SU 0.000000 1.0000 0 - 1555 0 SUB SU SU 0.000000 1.0000 0 - 1556 0 SUB SU SU 0.000000 1.0000 0 - 1557 0 SUB SU SU 0.000000 1.0000 0 - 1558 0 SUB SU SU 0.000000 1.0000 0 - 1559 0 SUB SU SU 0.000000 1.0000 0 - 1560 0 SUB SU SU 0.000000 1.0000 0 - 1561 0 SUB SU SU 0.000000 1.0000 0 - 1562 0 SUB SU SU 0.000000 1.0000 0 - 1563 0 SUB SU SU 0.000000 1.0000 0 - 1564 0 SUB SU SU 0.000000 1.0000 0 - 1565 0 SUB SU SU 0.000000 1.0000 0 - 1566 0 SUB SU SU 0.000000 1.0000 0 - 1567 0 SUB SU SU 0.000000 1.0000 0 - 1568 0 SUB SU SU 0.000000 1.0000 0 - 1569 0 SUB SU SU 0.000000 1.0000 0 - 1570 0 SUB SU SU 0.000000 1.0000 0 - 1571 0 SUB SU SU 0.000000 1.0000 0 - 1572 0 SUB SU SU 0.000000 1.0000 0 - 1573 0 SUB SU SU 0.000000 1.0000 0 - 1574 0 SUB SU SU 0.000000 1.0000 0 - 1575 0 SUB SU SU 0.000000 1.0000 0 - 1576 0 SUB SU SU 0.000000 1.0000 0 - 1577 0 SUB SU SU 0.000000 1.0000 0 - 1578 0 SUB SU SU 0.000000 1.0000 0 - 1579 0 SUB SU SU 0.000000 1.0000 0 - 1580 0 SUB SU SU 0.000000 1.0000 0 - 1581 0 SUB SU SU 0.000000 1.0000 0 - 1582 0 SUB SU SU 0.000000 1.0000 0 - 1583 0 SUB SU SU 0.000000 1.0000 0 - 1584 0 SUB SU SU 0.000000 1.0000 0 - 1585 0 SUB SU SU 0.000000 1.0000 0 - 1586 0 SUB SU SU 0.000000 1.0000 0 - 1587 0 SUB SU SU 0.000000 1.0000 0 - 1588 0 SUB SU SU 0.000000 1.0000 0 - 1589 0 SUB SU SU 0.000000 1.0000 0 - 1590 0 SUB SU SU 0.000000 1.0000 0 - 1591 0 SUB SU SU 0.000000 1.0000 0 - 1592 0 SUB SU SU 0.000000 1.0000 0 - 1593 0 SUB SU SU 0.000000 1.0000 0 - 1594 0 SUB SU SU 0.000000 1.0000 0 - 1595 0 SUB SU SU 0.000000 1.0000 0 - 1596 0 SUB SU SU 0.000000 1.0000 0 - 1597 0 SUB SU SU 0.000000 1.0000 0 - 1598 0 SUB SU SU 0.000000 1.0000 0 - 1599 0 SUB SU SU 0.000000 1.0000 0 - 1600 0 SUB SU SU 0.000000 1.0000 0 - 1601 0 SUB SU SU 0.000000 1.0000 0 - 1602 0 SUB SU SU 0.000000 1.0000 0 - 1603 0 SUB SU SU 0.000000 1.0000 0 - 1604 0 SUB SU SU 0.000000 1.0000 0 - 1605 0 SUB SU SU 0.000000 1.0000 0 - 1606 0 SUB SU SU 0.000000 1.0000 0 - 1607 0 SUB SU SU 0.000000 1.0000 0 - 1608 0 SUB SU SU 0.000000 1.0000 0 - 1609 0 SUB SU SU 0.000000 1.0000 0 - 1610 0 SUB SU SU 0.000000 1.0000 0 - 1611 0 SUB SU SU 0.000000 1.0000 0 - 1612 0 SUB SU SU 0.000000 1.0000 0 - 1613 0 SUB SU SU 0.000000 1.0000 0 - 1614 0 SUB SU SU 0.000000 1.0000 0 - 1615 0 SUB SU SU 0.000000 1.0000 0 - 1616 0 SUB SU SU 0.000000 1.0000 0 - 1617 0 SUB SU SU 0.000000 1.0000 0 - 1618 0 SUB SU SU 0.000000 1.0000 0 - 1619 0 SUB SU SU 0.000000 1.0000 0 - 1620 0 SUB SU SU 0.000000 1.0000 0 - 1621 0 SUB SU SU 0.000000 1.0000 0 - 1622 0 SUB SU SU 0.000000 1.0000 0 - 1623 0 SUB SU SU 0.000000 1.0000 0 - 1624 0 SUB SU SU 0.000000 1.0000 0 - 1625 0 SUB SU SU 0.000000 1.0000 0 - 1626 0 SUB SU SU 0.000000 1.0000 0 - 1627 0 SUB SU SU 0.000000 1.0000 0 - 1628 0 SUB SU SU 0.000000 1.0000 0 - 1629 0 SUB SU SU 0.000000 1.0000 0 - 1630 0 SUB SU SU 0.000000 1.0000 0 - 1631 0 SUB SU SU 0.000000 1.0000 0 - 1632 0 SUB SU SU 0.000000 1.0000 0 - 1633 0 SUB SU SU 0.000000 1.0000 0 - 1634 0 SUB SU SU 0.000000 1.0000 0 - 1635 0 SUB SU SU 0.000000 1.0000 0 - 1636 0 SUB SU SU 0.000000 1.0000 0 - 1637 0 SUB SU SU 0.000000 1.0000 0 - 1638 0 SUB SU SU 0.000000 1.0000 0 - 1639 0 SUB SU SU 0.000000 1.0000 0 - 1640 0 SUB SU SU 0.000000 1.0000 0 - 1641 0 SUB SU SU 0.000000 1.0000 0 - 1642 0 SUB SU SU 0.000000 1.0000 0 - 1643 0 SUB SU SU 0.000000 1.0000 0 - 1644 0 SUB SU SU 0.000000 1.0000 0 - 1645 0 SUB SU SU 0.000000 1.0000 0 - 1646 0 SUB SU SU 0.000000 1.0000 0 - 1647 0 SUB SU SU 0.000000 1.0000 0 - 1648 0 SUB SU SU 0.000000 1.0000 0 - 1649 0 SUB SU SU 0.000000 1.0000 0 - 1650 0 SUB SU SU 0.000000 1.0000 0 - 1651 0 SUB SU SU 0.000000 1.0000 0 - 1652 0 SUB SU SU 0.000000 1.0000 0 - 1653 0 SUB SU SU 0.000000 1.0000 0 - 1654 0 SUB SU SU 0.000000 1.0000 0 - 1655 0 SUB SU SU 0.000000 1.0000 0 - 1656 0 SUB SU SU 0.000000 1.0000 0 - 1657 0 SUB SU SU 0.000000 1.0000 0 - 1658 0 SUB SU SU 0.000000 1.0000 0 - 1659 0 SUB SU SU 0.000000 1.0000 0 - 1660 0 SUB SU SU 0.000000 1.0000 0 - 1661 0 SUB SU SU 0.000000 1.0000 0 - 1662 0 SUB SU SU 0.000000 1.0000 0 - 1663 0 SUB SU SU 0.000000 1.0000 0 - 1664 0 SUB SU SU 0.000000 1.0000 0 - 1665 0 SUB SU SU 0.000000 1.0000 0 - 1666 0 SUB SU SU 0.000000 1.0000 0 - 1667 0 SUB SU SU 0.000000 1.0000 0 - 1668 0 SUB SU SU 0.000000 1.0000 0 - 1669 0 SUB SU SU 0.000000 1.0000 0 - 1670 0 SUB SU SU 0.000000 1.0000 0 - 1671 0 SUB SU SU 0.000000 1.0000 0 - 1672 0 SUB SU SU 0.000000 1.0000 0 - 1673 0 SUB SU SU 0.000000 1.0000 0 - 1674 0 SUB SU SU 0.000000 1.0000 0 - 1675 0 SUB SU SU 0.000000 1.0000 0 - 1676 0 SUB SU SU 0.000000 1.0000 0 - 1677 0 SUB SU SU 0.000000 1.0000 0 - 1678 0 SUB SU SU 0.000000 1.0000 0 - 1679 0 SUB SU SU 0.000000 1.0000 0 - 1680 0 SUB SU SU 0.000000 1.0000 0 - 1681 0 SUB SU SU 0.000000 1.0000 0 - 1682 0 SUB SU SU 0.000000 1.0000 0 - 1683 0 SUB SU SU 0.000000 1.0000 0 - 1684 0 SUB SU SU 0.000000 1.0000 0 - 1685 0 SUB SU SU 0.000000 1.0000 0 - 1686 0 SUB SU SU 0.000000 1.0000 0 - 1687 0 SUB SU SU 0.000000 1.0000 0 - 1688 0 SUB SU SU 0.000000 1.0000 0 - 1689 0 SUB SU SU 0.000000 1.0000 0 - 1690 0 SUB SU SU 0.000000 1.0000 0 - 1691 0 SUB SU SU 0.000000 1.0000 0 - 1692 0 SUB SU SU 0.000000 1.0000 0 - 1693 0 SUB SU SU 0.000000 1.0000 0 - 1694 0 SUB SU SU 0.000000 1.0000 0 - 1695 0 SUB SU SU 0.000000 1.0000 0 - 1696 0 SUB SU SU 0.000000 1.0000 0 - 1697 0 SUB SU SU 0.000000 1.0000 0 - 1698 0 SUB SU SU 0.000000 1.0000 0 - 1699 0 SUB SU SU 0.000000 1.0000 0 - 1700 0 SUB SU SU 0.000000 1.0000 0 - 1701 0 SUB SU SU 0.000000 1.0000 0 - 1702 0 SUB SU SU 0.000000 1.0000 0 - 1703 0 SUB SU SU 0.000000 1.0000 0 - 1704 0 SUB SU SU 0.000000 1.0000 0 - 1705 0 SUB SU SU 0.000000 1.0000 0 - 1706 0 SUB SU SU 0.000000 1.0000 0 - 1707 0 SUB SU SU 0.000000 1.0000 0 - 1708 0 SUB SU SU 0.000000 1.0000 0 - 1709 0 SUB SU SU 0.000000 1.0000 0 - 1710 0 SUB SU SU 0.000000 1.0000 0 - 1711 0 SUB SU SU 0.000000 1.0000 0 - 1712 0 SUB SU SU 0.000000 1.0000 0 - 1713 0 SUB SU SU 0.000000 1.0000 0 - 1714 0 SUB SU SU 0.000000 1.0000 0 - 1715 0 SUB SU SU 0.000000 1.0000 0 - 1716 0 SUB SU SU 0.000000 1.0000 0 - 1717 0 SUB SU SU 0.000000 1.0000 0 - 1718 0 SUB SU SU 0.000000 1.0000 0 - 1719 0 SUB SU SU 0.000000 1.0000 0 - 1720 0 SUB SU SU 0.000000 1.0000 0 - 1721 0 SUB SU SU 0.000000 1.0000 0 - 1722 0 SUB SU SU 0.000000 1.0000 0 - 1723 0 SUB SU SU 0.000000 1.0000 0 - 1724 0 SUB SU SU 0.000000 1.0000 0 - 1725 0 SUB SU SU 0.000000 1.0000 0 - 1726 0 SUB SU SU 0.000000 1.0000 0 - 1727 0 SUB SU SU 0.000000 1.0000 0 - 1728 0 SUB SU SU 0.000000 1.0000 0 - 1729 0 SUB SU SU 0.000000 1.0000 0 - 1730 0 SUB SU SU 0.000000 1.0000 0 - 1731 0 SUB SU SU 0.000000 1.0000 0 - 1732 0 SUB SU SU 0.000000 1.0000 0 - 1733 0 SUB SU SU 0.000000 1.0000 0 - 1734 0 SUB SU SU 0.000000 1.0000 0 - 1735 0 SUB SU SU 0.000000 1.0000 0 - 1736 0 SUB SU SU 0.000000 1.0000 0 - 1737 0 SUB SU SU 0.000000 1.0000 0 - 1738 0 SUB SU SU 0.000000 1.0000 0 - 1739 0 SUB SU SU 0.000000 1.0000 0 - 1740 0 SUB SU SU 0.000000 1.0000 0 - 1741 0 SUB SU SU 0.000000 1.0000 0 - 1742 0 SUB SU SU 0.000000 1.0000 0 - 1743 0 SUB SU SU 0.000000 1.0000 0 - 1744 0 SUB SU SU 0.000000 1.0000 0 - 1745 0 SUB SU SU 0.000000 1.0000 0 - 1746 0 SUB SU SU 0.000000 1.0000 0 - 1747 0 SUB SU SU 0.000000 1.0000 0 - 1748 0 SUB SU SU 0.000000 1.0000 0 - 1749 0 SUB SU SU 0.000000 1.0000 0 - 1750 0 SUB SU SU 0.000000 1.0000 0 - 1751 0 SUB SU SU 0.000000 1.0000 0 - 1752 0 SUB SU SU 0.000000 1.0000 0 - 1753 0 SUB SU SU 0.000000 1.0000 0 - 1754 0 SUB SU SU 0.000000 1.0000 0 - 1755 0 SUB SU SU 0.000000 1.0000 0 - 1756 0 SUB SU SU 0.000000 1.0000 0 - 1757 0 SUB SU SU 0.000000 1.0000 0 - 1758 0 SUB SU SU 0.000000 1.0000 0 - 1759 0 SUB SU SU 0.000000 1.0000 0 - 1760 0 SUB SU SU 0.000000 1.0000 0 - 1761 0 SUB SU SU 0.000000 1.0000 0 - 1762 0 SUB SU SU 0.000000 1.0000 0 - 1763 0 SUB SU SU 0.000000 1.0000 0 - 1764 0 SUB SU SU 0.000000 1.0000 0 - 1765 0 SUB SU SU 0.000000 1.0000 0 - 1766 0 SUB SU SU 0.000000 1.0000 0 - 1767 0 SUB SU SU 0.000000 1.0000 0 - 1768 0 SUB SU SU 0.000000 1.0000 0 - 1769 0 SUB SU SU 0.000000 1.0000 0 - 1770 0 SUB SU SU 0.000000 1.0000 0 - 1771 0 SUB SU SU 0.000000 1.0000 0 - 1772 0 SUB SU SU 0.000000 1.0000 0 - 1773 0 SUB SU SU 0.000000 1.0000 0 - 1774 0 SUB SU SU 0.000000 1.0000 0 - 1775 0 SUB SU SU 0.000000 1.0000 0 - 1776 0 SUB SU SU 0.000000 1.0000 0 - 1777 0 SUB SU SU 0.000000 1.0000 0 - 1778 0 SUB SU SU 0.000000 1.0000 0 - 1779 0 SUB SU SU 0.000000 1.0000 0 - 1780 0 SUB SU SU 0.000000 1.0000 0 - 1781 0 SUB SU SU 0.000000 1.0000 0 - 1782 0 SUB SU SU 0.000000 1.0000 0 - 1783 0 SUB SU SU 0.000000 1.0000 0 - 1784 0 SUB SU SU 0.000000 1.0000 0 - 1785 0 SUB SU SU 0.000000 1.0000 0 - 1786 0 SUB SU SU 0.000000 1.0000 0 - 1787 0 SUB SU SU 0.000000 1.0000 0 - 1788 0 SUB SU SU 0.000000 1.0000 0 - 1789 0 SUB SU SU 0.000000 1.0000 0 - 1790 0 SUB SU SU 0.000000 1.0000 0 - 1791 0 SUB SU SU 0.000000 1.0000 0 - 1792 0 SUB SU SU 0.000000 1.0000 0 - 1793 0 SUB SU SU 0.000000 1.0000 0 - 1794 0 SUB SU SU 0.000000 1.0000 0 - 1795 0 SUB SU SU 0.000000 1.0000 0 - 1796 0 SUB SU SU 0.000000 1.0000 0 - 1797 0 SUB SU SU 0.000000 1.0000 0 - 1798 0 SUB SU SU 0.000000 1.0000 0 - 1799 0 SUB SU SU 0.000000 1.0000 0 - 1800 0 SUB SU SU 0.000000 1.0000 0 - 1801 0 CS CS 0.000000 1.0000 0 - 1802 0 CS CS 0.000000 1.0000 0 - 1803 0 CS CS 0.000000 1.0000 0 - 1804 0 CS CS 0.000000 1.0000 0 - 1805 0 CS CS 0.000000 1.0000 0 - 1806 0 CS CS 0.000000 1.0000 0 - 1807 0 CS CS 0.000000 1.0000 0 - 1808 0 CS CS 0.000000 1.0000 0 - 1809 0 CS CS 0.000000 1.0000 0 - 1810 0 CS CS 0.000000 1.0000 0 - 1811 0 CS CS 0.000000 1.0000 0 - 1812 0 CS CS 0.000000 1.0000 0 - 1813 0 CS CS 0.000000 1.0000 0 - 1814 0 CS CS 0.000000 1.0000 0 - 1815 0 CS CS 0.000000 1.0000 0 - 1816 0 CS CS 0.000000 1.0000 0 - 1817 0 CS CS 0.000000 1.0000 0 - 1818 0 CS CS 0.000000 1.0000 0 - 1819 0 CS CS 0.000000 1.0000 0 - 1820 0 CS CS 0.000000 1.0000 0 - 1821 0 CS CS 0.000000 1.0000 0 - 1822 0 CS CS 0.000000 1.0000 0 - 1823 0 CS CS 0.000000 1.0000 0 - 1824 0 CS CS 0.000000 1.0000 0 - 1825 0 CS CS 0.000000 1.0000 0 - 1826 0 CS CS 0.000000 1.0000 0 - 1827 0 CS CS 0.000000 1.0000 0 - 1828 0 CS CS 0.000000 1.0000 0 - 1829 0 CS CS 0.000000 1.0000 0 - 1830 0 CS CS 0.000000 1.0000 0 - 1831 0 CS CS 0.000000 1.0000 0 - 1832 0 CS CS 0.000000 1.0000 0 - 1833 0 CS CS 0.000000 1.0000 0 - 1834 0 CS CS 0.000000 1.0000 0 - 1835 0 CS CS 0.000000 1.0000 0 - 1836 0 CS CS 0.000000 1.0000 0 - 1837 0 CS CS 0.000000 1.0000 0 - 1838 0 CS CS 0.000000 1.0000 0 - 1839 0 CS CS 0.000000 1.0000 0 - 1840 0 CS CS 0.000000 1.0000 0 - 1841 0 CS CS 0.000000 1.0000 0 - 1842 0 CS CS 0.000000 1.0000 0 - 1843 0 CS CS 0.000000 1.0000 0 - 1844 0 CS CS 0.000000 1.0000 0 - 1845 0 CS CS 0.000000 1.0000 0 - 1846 0 CS CS 0.000000 1.0000 0 - 1847 0 CS CS 0.000000 1.0000 0 - 1848 0 CS CS 0.000000 1.0000 0 - 1849 0 CS CS 0.000000 1.0000 0 - 1850 0 CS CS 0.000000 1.0000 0 - 1851 0 CS CS 0.000000 1.0000 0 - 1852 0 CS CS 0.000000 1.0000 0 - 1853 0 CS CS 0.000000 1.0000 0 - 1854 0 CS CS 0.000000 1.0000 0 - 1855 0 CS CS 0.000000 1.0000 0 - 1856 0 CS CS 0.000000 1.0000 0 - 1857 0 CS CS 0.000000 1.0000 0 - 1858 0 CS CS 0.000000 1.0000 0 - 1859 0 CS CS 0.000000 1.0000 0 - 1860 0 CS CS 0.000000 1.0000 0 - 1861 0 CS CS 0.000000 1.0000 0 - 1862 0 CS CS 0.000000 1.0000 0 - 1863 0 CS CS 0.000000 1.0000 0 - 1864 0 CS CS 0.000000 1.0000 0 - 1865 0 CS CS 0.000000 1.0000 0 - 1866 0 CS CS 0.000000 1.0000 0 - 1867 0 CS CS 0.000000 1.0000 0 - 1868 0 CS CS 0.000000 1.0000 0 - 1869 0 CS CS 0.000000 1.0000 0 - 1870 0 CS CS 0.000000 1.0000 0 - 1871 0 CS CS 0.000000 1.0000 0 - 1872 0 CS CS 0.000000 1.0000 0 - 1873 0 CS CS 0.000000 1.0000 0 - 1874 0 CS CS 0.000000 1.0000 0 - 1875 0 CS CS 0.000000 1.0000 0 - 1876 0 CS CS 0.000000 1.0000 0 - 1877 0 CS CS 0.000000 1.0000 0 - 1878 0 CS CS 0.000000 1.0000 0 - 1879 0 CS CS 0.000000 1.0000 0 - 1880 0 CS CS 0.000000 1.0000 0 - 1881 0 CS CS 0.000000 1.0000 0 - 1882 0 CS CS 0.000000 1.0000 0 - 1883 0 CS CS 0.000000 1.0000 0 - 1884 0 CS CS 0.000000 1.0000 0 - 1885 0 CS CS 0.000000 1.0000 0 - 1886 0 CS CS 0.000000 1.0000 0 - 1887 0 CS CS 0.000000 1.0000 0 - 1888 0 CS CS 0.000000 1.0000 0 - 1889 0 CS CS 0.000000 1.0000 0 - 1890 0 CS CS 0.000000 1.0000 0 - 1891 0 CS CS 0.000000 1.0000 0 - 1892 0 CS CS 0.000000 1.0000 0 - 1893 0 CS CS 0.000000 1.0000 0 - 1894 0 CS CS 0.000000 1.0000 0 - 1895 0 CS CS 0.000000 1.0000 0 - 1896 0 CS CS 0.000000 1.0000 0 - 1897 0 CS CS 0.000000 1.0000 0 - 1898 0 CS CS 0.000000 1.0000 0 - 1899 0 CS CS 0.000000 1.0000 0 - 1900 0 CS CS 0.000000 1.0000 0 - 1901 0 CS CS 0.000000 1.0000 0 - 1902 0 CS CS 0.000000 1.0000 0 - 1903 0 CS CS 0.000000 1.0000 0 - 1904 0 CS CS 0.000000 1.0000 0 - 1905 0 CS CS 0.000000 1.0000 0 - 1906 0 CS CS 0.000000 1.0000 0 - 1907 0 CS CS 0.000000 1.0000 0 - 1908 0 CS CS 0.000000 1.0000 0 - 1909 0 CS CS 0.000000 1.0000 0 - 1910 0 CS CS 0.000000 1.0000 0 - 1911 0 CS CS 0.000000 1.0000 0 - 1912 0 CS CS 0.000000 1.0000 0 - 1913 0 CS CS 0.000000 1.0000 0 - 1914 0 CS CS 0.000000 1.0000 0 - 1915 0 CS CS 0.000000 1.0000 0 - 1916 0 CS CS 0.000000 1.0000 0 - 1917 0 CS CS 0.000000 1.0000 0 - 1918 0 CS CS 0.000000 1.0000 0 - 1919 0 CS CS 0.000000 1.0000 0 - 1920 0 CS CS 0.000000 1.0000 0 - 1921 0 CS CS 0.000000 1.0000 0 - 1922 0 CS CS 0.000000 1.0000 0 - 1923 0 CS CS 0.000000 1.0000 0 - 1924 0 CS CS 0.000000 1.0000 0 - 1925 0 CS CS 0.000000 1.0000 0 - 1926 0 CS CS 0.000000 1.0000 0 - 1927 0 CS CS 0.000000 1.0000 0 - 1928 0 CS CS 0.000000 1.0000 0 - 1929 0 CS CS 0.000000 1.0000 0 - 1930 0 CS CS 0.000000 1.0000 0 - 1931 0 CS CS 0.000000 1.0000 0 - 1932 0 CS CS 0.000000 1.0000 0 - 1933 0 CS CS 0.000000 1.0000 0 - 1934 0 CS CS 0.000000 1.0000 0 - 1935 0 CS CS 0.000000 1.0000 0 - 1936 0 CS CS 0.000000 1.0000 0 - 1937 0 CS CS 0.000000 1.0000 0 - 1938 0 CS CS 0.000000 1.0000 0 - 1939 0 CS CS 0.000000 1.0000 0 - 1940 0 CS CS 0.000000 1.0000 0 - 1941 0 CS CS 0.000000 1.0000 0 - 1942 0 CS CS 0.000000 1.0000 0 - 1943 0 CS CS 0.000000 1.0000 0 - 1944 0 CS CS 0.000000 1.0000 0 - 1945 0 CS CS 0.000000 1.0000 0 - 1946 0 CS CS 0.000000 1.0000 0 - 1947 0 CS CS 0.000000 1.0000 0 - 1948 0 CS CS 0.000000 1.0000 0 - 1949 0 CS CS 0.000000 1.0000 0 - 1950 0 CS CS 0.000000 1.0000 0 - 1951 0 CS CS 0.000000 1.0000 0 - 1952 0 CS CS 0.000000 1.0000 0 - 1953 0 CS CS 0.000000 1.0000 0 - 1954 0 CS CS 0.000000 1.0000 0 - 1955 0 CS CS 0.000000 1.0000 0 - 1956 0 CS CS 0.000000 1.0000 0 - 1957 0 CS CS 0.000000 1.0000 0 - 1958 0 CS CS 0.000000 1.0000 0 - 1959 0 CS CS 0.000000 1.0000 0 - 1960 0 CS CS 0.000000 1.0000 0 - 1961 0 CS CS 0.000000 1.0000 0 - 1962 0 CS CS 0.000000 1.0000 0 - 1963 0 CS CS 0.000000 1.0000 0 - 1964 0 CS CS 0.000000 1.0000 0 - 1965 0 CS CS 0.000000 1.0000 0 - 1966 0 CS CS 0.000000 1.0000 0 - 1967 0 CS CS 0.000000 1.0000 0 - 1968 0 CS CS 0.000000 1.0000 0 - 1969 0 CS CS 0.000000 1.0000 0 - 1970 0 CS CS 0.000000 1.0000 0 - 1971 0 CS CS 0.000000 1.0000 0 - 1972 0 CS CS 0.000000 1.0000 0 - 1973 0 CS CS 0.000000 1.0000 0 - 1974 0 CS CS 0.000000 1.0000 0 - 1975 0 CS CS 0.000000 1.0000 0 - 1976 0 CS CS 0.000000 1.0000 0 - 1977 0 CS CS 0.000000 1.0000 0 - 1978 0 CS CS 0.000000 1.0000 0 - 1979 0 CS CS 0.000000 1.0000 0 - 1980 0 CS CS 0.000000 1.0000 0 - 1981 0 CS CS 0.000000 1.0000 0 - 1982 0 CS CS 0.000000 1.0000 0 - 1983 0 CS CS 0.000000 1.0000 0 - 1984 0 CS CS 0.000000 1.0000 0 - 1985 0 CS CS 0.000000 1.0000 0 - 1986 0 CS CS 0.000000 1.0000 0 - 1987 0 CS CS 0.000000 1.0000 0 - 1988 0 CS CS 0.000000 1.0000 0 - 1989 0 CS CS 0.000000 1.0000 0 - 1990 0 CS CS 0.000000 1.0000 0 - 1991 0 CS CS 0.000000 1.0000 0 - 1992 0 CS CS 0.000000 1.0000 0 - 1993 0 CS CS 0.000000 1.0000 0 - 1994 0 CS CS 0.000000 1.0000 0 - 1995 0 CS CS 0.000000 1.0000 0 - 1996 0 CS CS 0.000000 1.0000 0 - 1997 0 CS CS 0.000000 1.0000 0 - 1998 0 CS CS 0.000000 1.0000 0 - 1999 0 CS CS 0.000000 1.0000 0 - 2000 0 CS CS 0.000000 1.0000 0 - 2001 0 CS CS 0.000000 1.0000 0 - 2002 0 CS CS 0.000000 1.0000 0 - 2003 0 CS CS 0.000000 1.0000 0 - 2004 0 CS CS 0.000000 1.0000 0 - 2005 0 CS CS 0.000000 1.0000 0 - 2006 0 CS CS 0.000000 1.0000 0 - 2007 0 CS CS 0.000000 1.0000 0 - 2008 0 CS CS 0.000000 1.0000 0 - 2009 0 CS CS 0.000000 1.0000 0 - 2010 0 CS CS 0.000000 1.0000 0 - 2011 0 CS CS 0.000000 1.0000 0 - 2012 0 CS CS 0.000000 1.0000 0 - 2013 0 CS CS 0.000000 1.0000 0 - 2014 0 CS CS 0.000000 1.0000 0 - 2015 0 CS CS 0.000000 1.0000 0 - 2016 0 CS CS 0.000000 1.0000 0 - 2017 0 CS CS 0.000000 1.0000 0 - 2018 0 CS CS 0.000000 1.0000 0 - 2019 0 CS CS 0.000000 1.0000 0 - 2020 0 CS CS 0.000000 1.0000 0 - 2021 0 CS CS 0.000000 1.0000 0 - 2022 0 CS CS 0.000000 1.0000 0 - 2023 0 CS CS 0.000000 1.0000 0 - 2024 0 CS CS 0.000000 1.0000 0 - 2025 0 CS CS 0.000000 1.0000 0 - 2026 0 CS CS 0.000000 1.0000 0 - 2027 0 CS CS 0.000000 1.0000 0 - 2028 0 CS CS 0.000000 1.0000 0 - 2029 0 CS CS 0.000000 1.0000 0 - 2030 0 CS CS 0.000000 1.0000 0 - 2031 0 CS CS 0.000000 1.0000 0 - 2032 0 CS CS 0.000000 1.0000 0 - 2033 0 CS CS 0.000000 1.0000 0 - 2034 0 CS CS 0.000000 1.0000 0 - 2035 0 CS CS 0.000000 1.0000 0 - 2036 0 CS CS 0.000000 1.0000 0 - 2037 0 CS CS 0.000000 1.0000 0 - 2038 0 CS CS 0.000000 1.0000 0 - 2039 0 CS CS 0.000000 1.0000 0 - 2040 0 CS CS 0.000000 1.0000 0 - 2041 0 CS CS 0.000000 1.0000 0 - 2042 0 CS CS 0.000000 1.0000 0 - 2043 0 CS CS 0.000000 1.0000 0 - 2044 0 CS CS 0.000000 1.0000 0 - 2045 0 CS CS 0.000000 1.0000 0 - 2046 0 CS CS 0.000000 1.0000 0 - 2047 0 CS CS 0.000000 1.0000 0 - 2048 0 CS CS 0.000000 1.0000 0 - 2049 0 CS CS 0.000000 1.0000 0 - 2050 0 CS CS 0.000000 1.0000 0 - 2051 0 CS CS 0.000000 1.0000 0 - 2052 0 CS CS 0.000000 1.0000 0 - 2053 0 CS CS 0.000000 1.0000 0 - 2054 0 CS CS 0.000000 1.0000 0 - 2055 0 CS CS 0.000000 1.0000 0 - 2056 0 CS CS 0.000000 1.0000 0 - 2057 0 CS CS 0.000000 1.0000 0 - 2058 0 CS CS 0.000000 1.0000 0 - 2059 0 CS CS 0.000000 1.0000 0 - 2060 0 CS CS 0.000000 1.0000 0 - 2061 0 CS CS 0.000000 1.0000 0 - 2062 0 CS CS 0.000000 1.0000 0 - 2063 0 CS CS 0.000000 1.0000 0 - 2064 0 CS CS 0.000000 1.0000 0 - 2065 0 CS CS 0.000000 1.0000 0 - 2066 0 CS CS 0.000000 1.0000 0 - 2067 0 CS CS 0.000000 1.0000 0 - 2068 0 CS CS 0.000000 1.0000 0 - 2069 0 CS CS 0.000000 1.0000 0 - 2070 0 CS CS 0.000000 1.0000 0 - 2071 0 CS CS 0.000000 1.0000 0 - 2072 0 CS CS 0.000000 1.0000 0 - 2073 0 CS CS 0.000000 1.0000 0 - 2074 0 CS CS 0.000000 1.0000 0 - 2075 0 CS CS 0.000000 1.0000 0 - 2076 0 CS CS 0.000000 1.0000 0 - 2077 0 CS CS 0.000000 1.0000 0 - 2078 0 CS CS 0.000000 1.0000 0 - 2079 0 CS CS 0.000000 1.0000 0 - 2080 0 CS CS 0.000000 1.0000 0 - 2081 0 CS CS 0.000000 1.0000 0 - 2082 0 CS CS 0.000000 1.0000 0 - 2083 0 CS CS 0.000000 1.0000 0 - 2084 0 CS CS 0.000000 1.0000 0 - 2085 0 CS CS 0.000000 1.0000 0 - 2086 0 CS CS 0.000000 1.0000 0 - 2087 0 CS CS 0.000000 1.0000 0 - 2088 0 CS CS 0.000000 1.0000 0 - 2089 0 CS CS 0.000000 1.0000 0 - 2090 0 CS CS 0.000000 1.0000 0 - 2091 0 CS CS 0.000000 1.0000 0 - 2092 0 CS CS 0.000000 1.0000 0 - 2093 0 CS CS 0.000000 1.0000 0 - 2094 0 CS CS 0.000000 1.0000 0 - 2095 0 CS CS 0.000000 1.0000 0 - 2096 0 CS CS 0.000000 1.0000 0 - 2097 0 CS CS 0.000000 1.0000 0 - 2098 0 CS CS 0.000000 1.0000 0 - 2099 0 CS CS 0.000000 1.0000 0 - 2100 0 CS CS 0.000000 1.0000 0 - 2101 0 CS CS 0.000000 1.0000 0 - 2102 0 CS CS 0.000000 1.0000 0 - 2103 0 CS CS 0.000000 1.0000 0 - 2104 0 CS CS 0.000000 1.0000 0 - 2105 0 CS CS 0.000000 1.0000 0 - 2106 0 CS CS 0.000000 1.0000 0 - 2107 0 CS CS 0.000000 1.0000 0 - 2108 0 CS CS 0.000000 1.0000 0 - 2109 0 CS CS 0.000000 1.0000 0 - 2110 0 CS CS 0.000000 1.0000 0 - 2111 0 CS CS 0.000000 1.0000 0 - 2112 0 CS CS 0.000000 1.0000 0 - 2113 0 CS CS 0.000000 1.0000 0 - 2114 0 CS CS 0.000000 1.0000 0 - 2115 0 CS CS 0.000000 1.0000 0 - 2116 0 CS CS 0.000000 1.0000 0 - 2117 0 CS CS 0.000000 1.0000 0 - 2118 0 CS CS 0.000000 1.0000 0 - 2119 0 CS CS 0.000000 1.0000 0 - 2120 0 CS CS 0.000000 1.0000 0 - 2121 0 CS CS 0.000000 1.0000 0 - 2122 0 CS CS 0.000000 1.0000 0 - 2123 0 CS CS 0.000000 1.0000 0 - 2124 0 CS CS 0.000000 1.0000 0 - 2125 0 CS CS 0.000000 1.0000 0 - 2126 0 CS CS 0.000000 1.0000 0 - 2127 0 CS CS 0.000000 1.0000 0 - 2128 0 CS CS 0.000000 1.0000 0 - 2129 0 CS CS 0.000000 1.0000 0 - 2130 0 CS CS 0.000000 1.0000 0 - 2131 0 CS CS 0.000000 1.0000 0 - 2132 0 CS CS 0.000000 1.0000 0 - 2133 0 CS CS 0.000000 1.0000 0 - 2134 0 CS CS 0.000000 1.0000 0 - 2135 0 CS CS 0.000000 1.0000 0 - 2136 0 CS CS 0.000000 1.0000 0 - 2137 0 CS CS 0.000000 1.0000 0 - 2138 0 CS CS 0.000000 1.0000 0 - 2139 0 CS CS 0.000000 1.0000 0 - 2140 0 CS CS 0.000000 1.0000 0 - 2141 0 CS CS 0.000000 1.0000 0 - 2142 0 CS CS 0.000000 1.0000 0 - 2143 0 CS CS 0.000000 1.0000 0 - 2144 0 CS CS 0.000000 1.0000 0 - 2145 0 CS CS 0.000000 1.0000 0 - 2146 0 CS CS 0.000000 1.0000 0 - 2147 0 CS CS 0.000000 1.0000 0 - 2148 0 CS CS 0.000000 1.0000 0 - 2149 0 CS CS 0.000000 1.0000 0 - 2150 0 CS CS 0.000000 1.0000 0 - 2151 0 CS CS 0.000000 1.0000 0 - 2152 0 CS CS 0.000000 1.0000 0 - 2153 0 CS CS 0.000000 1.0000 0 - 2154 0 CS CS 0.000000 1.0000 0 - 2155 0 CS CS 0.000000 1.0000 0 - 2156 0 CS CS 0.000000 1.0000 0 - 2157 0 CS CS 0.000000 1.0000 0 - 2158 0 CS CS 0.000000 1.0000 0 - 2159 0 CS CS 0.000000 1.0000 0 - 2160 0 CS CS 0.000000 1.0000 0 - 2161 0 CS CS 0.000000 1.0000 0 - 2162 0 CS CS 0.000000 1.0000 0 - 2163 0 CS CS 0.000000 1.0000 0 - 2164 0 CS CS 0.000000 1.0000 0 - 2165 0 CS CS 0.000000 1.0000 0 - 2166 0 CS CS 0.000000 1.0000 0 - 2167 0 CS CS 0.000000 1.0000 0 - 2168 0 CS CS 0.000000 1.0000 0 - 2169 0 CS CS 0.000000 1.0000 0 - 2170 0 CS CS 0.000000 1.0000 0 - 2171 0 CS CS 0.000000 1.0000 0 - 2172 0 CS CS 0.000000 1.0000 0 - 2173 0 CS CS 0.000000 1.0000 0 - 2174 0 CS CS 0.000000 1.0000 0 - 2175 0 CS CS 0.000000 1.0000 0 - 2176 0 CS CS 0.000000 1.0000 0 - 2177 0 CS CS 0.000000 1.0000 0 - 2178 0 CS CS 0.000000 1.0000 0 - 2179 0 CS CS 0.000000 1.0000 0 - 2180 0 CS CS 0.000000 1.0000 0 - 2181 0 CS CS 0.000000 1.0000 0 - 2182 0 CS CS 0.000000 1.0000 0 - 2183 0 CS CS 0.000000 1.0000 0 - 2184 0 CS CS 0.000000 1.0000 0 - 2185 0 CS CS 0.000000 1.0000 0 - 2186 0 CS CS 0.000000 1.0000 0 - 2187 0 CS CS 0.000000 1.0000 0 - 2188 0 CS CS 0.000000 1.0000 0 - 2189 0 CS CS 0.000000 1.0000 0 - 2190 0 CS CS 0.000000 1.0000 0 - 2191 0 CS CS 0.000000 1.0000 0 - 2192 0 CS CS 0.000000 1.0000 0 - 2193 0 CS CS 0.000000 1.0000 0 - 2194 0 CS CS 0.000000 1.0000 0 - 2195 0 CS CS 0.000000 1.0000 0 - 2196 0 CS CS 0.000000 1.0000 0 - 2197 0 CS CS 0.000000 1.0000 0 - 2198 0 CS CS 0.000000 1.0000 0 - 2199 0 CS CS 0.000000 1.0000 0 - 2200 0 CS CS 0.000000 1.0000 0 - 2201 0 CS CS 0.000000 1.0000 0 - 2202 0 CS CS 0.000000 1.0000 0 - 2203 0 CS CS 0.000000 1.0000 0 - 2204 0 CS CS 0.000000 1.0000 0 - 2205 0 CS CS 0.000000 1.0000 0 - 2206 0 CS CS 0.000000 1.0000 0 - 2207 0 CS CS 0.000000 1.0000 0 - 2208 0 CS CS 0.000000 1.0000 0 - 2209 0 CS CS 0.000000 1.0000 0 - 2210 0 CS CS 0.000000 1.0000 0 - 2211 0 CS CS 0.000000 1.0000 0 - 2212 0 CS CS 0.000000 1.0000 0 - 2213 0 CS CS 0.000000 1.0000 0 - 2214 0 CS CS 0.000000 1.0000 0 - 2215 0 CS CS 0.000000 1.0000 0 - 2216 0 CS CS 0.000000 1.0000 0 - 2217 0 CS CS 0.000000 1.0000 0 - 2218 0 CS CS 0.000000 1.0000 0 - 2219 0 CS CS 0.000000 1.0000 0 - 2220 0 CS CS 0.000000 1.0000 0 - 2221 0 CS CS 0.000000 1.0000 0 - 2222 0 CS CS 0.000000 1.0000 0 - 2223 0 CS CS 0.000000 1.0000 0 - 2224 0 CS CS 0.000000 1.0000 0 - 2225 0 CS CS 0.000000 1.0000 0 - 2226 0 CS CS 0.000000 1.0000 0 - 2227 0 CS CS 0.000000 1.0000 0 - 2228 0 CS CS 0.000000 1.0000 0 - 2229 0 CS CS 0.000000 1.0000 0 - 2230 0 CS CS 0.000000 1.0000 0 - 2231 0 CS CS 0.000000 1.0000 0 - 2232 0 CS CS 0.000000 1.0000 0 - 2233 0 CS CS 0.000000 1.0000 0 - 2234 0 CS CS 0.000000 1.0000 0 - 2235 0 CS CS 0.000000 1.0000 0 - 2236 0 CS CS 0.000000 1.0000 0 - 2237 0 CS CS 0.000000 1.0000 0 - 2238 0 CS CS 0.000000 1.0000 0 - 2239 0 CS CS 0.000000 1.0000 0 - 2240 0 CS CS 0.000000 1.0000 0 - 2241 0 CS CS 0.000000 1.0000 0 - 2242 0 CS CS 0.000000 1.0000 0 - 2243 0 CS CS 0.000000 1.0000 0 - 2244 0 CS CS 0.000000 1.0000 0 - 2245 0 CS CS 0.000000 1.0000 0 - 2246 0 CS CS 0.000000 1.0000 0 - 2247 0 CS CS 0.000000 1.0000 0 - 2248 0 CS CS 0.000000 1.0000 0 - 2249 0 CS CS 0.000000 1.0000 0 - 2250 0 CS CS 0.000000 1.0000 0 - 2251 0 CS CS 0.000000 1.0000 0 - 2252 0 CS CS 0.000000 1.0000 0 - 2253 0 CS CS 0.000000 1.0000 0 - 2254 0 CS CS 0.000000 1.0000 0 - 2255 0 CS CS 0.000000 1.0000 0 - 2256 0 CS CS 0.000000 1.0000 0 - 2257 0 CS CS 0.000000 1.0000 0 - 2258 0 CS CS 0.000000 1.0000 0 - 2259 0 CS CS 0.000000 1.0000 0 - 2260 0 CS CS 0.000000 1.0000 0 - 2261 0 CS CS 0.000000 1.0000 0 - 2262 0 CS CS 0.000000 1.0000 0 - 2263 0 CS CS 0.000000 1.0000 0 - 2264 0 CS CS 0.000000 1.0000 0 - 2265 0 CS CS 0.000000 1.0000 0 - 2266 0 CS CS 0.000000 1.0000 0 - 2267 0 CS CS 0.000000 1.0000 0 - 2268 0 CS CS 0.000000 1.0000 0 - 2269 0 CS CS 0.000000 1.0000 0 - 2270 0 CS CS 0.000000 1.0000 0 - 2271 0 CS CS 0.000000 1.0000 0 - 2272 0 CS CS 0.000000 1.0000 0 - 2273 0 CS CS 0.000000 1.0000 0 - 2274 0 CS CS 0.000000 1.0000 0 - 2275 0 CS CS 0.000000 1.0000 0 - 2276 0 CS CS 0.000000 1.0000 0 - 2277 0 CS CS 0.000000 1.0000 0 - 2278 0 CS CS 0.000000 1.0000 0 - 2279 0 CS CS 0.000000 1.0000 0 - 2280 0 CS CS 0.000000 1.0000 0 - 2281 0 CS CS 0.000000 1.0000 0 - 2282 0 CS CS 0.000000 1.0000 0 - 2283 0 CS CS 0.000000 1.0000 0 - 2284 0 CS CS 0.000000 1.0000 0 - 2285 0 CS CS 0.000000 1.0000 0 - 2286 0 CS CS 0.000000 1.0000 0 - 2287 0 CS CS 0.000000 1.0000 0 - 2288 0 CS CS 0.000000 1.0000 0 - 2289 0 CS CS 0.000000 1.0000 0 - 2290 0 CS CS 0.000000 1.0000 0 - 2291 0 CS CS 0.000000 1.0000 0 - 2292 0 CS CS 0.000000 1.0000 0 - 2293 0 CS CS 0.000000 1.0000 0 - 2294 0 CS CS 0.000000 1.0000 0 - 2295 0 CS CS 0.000000 1.0000 0 - 2296 0 CS CS 0.000000 1.0000 0 - 2297 0 CS CS 0.000000 1.0000 0 - 2298 0 CS CS 0.000000 1.0000 0 - 2299 0 CS CS 0.000000 1.0000 0 - 2300 0 CS CS 0.000000 1.0000 0 - 2301 0 CS CS 0.000000 1.0000 0 - 2302 0 CS CS 0.000000 1.0000 0 - 2303 0 CS CS 0.000000 1.0000 0 - 2304 0 CS CS 0.000000 1.0000 0 - 2305 0 CS CS 0.000000 1.0000 0 - 2306 0 CS CS 0.000000 1.0000 0 - 2307 0 CS CS 0.000000 1.0000 0 - 2308 0 CS CS 0.000000 1.0000 0 - 2309 0 CS CS 0.000000 1.0000 0 - 2310 0 CS CS 0.000000 1.0000 0 - 2311 0 CS CS 0.000000 1.0000 0 - 2312 0 CS CS 0.000000 1.0000 0 - 2313 0 CS CS 0.000000 1.0000 0 - 2314 0 CS CS 0.000000 1.0000 0 - 2315 0 CS CS 0.000000 1.0000 0 - 2316 0 CS CS 0.000000 1.0000 0 - 2317 0 CS CS 0.000000 1.0000 0 - 2318 0 CS CS 0.000000 1.0000 0 - 2319 0 CS CS 0.000000 1.0000 0 - 2320 0 CS CS 0.000000 1.0000 0 - 2321 0 CS CS 0.000000 1.0000 0 - 2322 0 CS CS 0.000000 1.0000 0 - 2323 0 CS CS 0.000000 1.0000 0 - 2324 0 CS CS 0.000000 1.0000 0 - 2325 0 CS CS 0.000000 1.0000 0 - 2326 0 CS CS 0.000000 1.0000 0 - 2327 0 CS CS 0.000000 1.0000 0 - 2328 0 CS CS 0.000000 1.0000 0 - 2329 0 CS CS 0.000000 1.0000 0 - 2330 0 CS CS 0.000000 1.0000 0 - 2331 0 CS CS 0.000000 1.0000 0 - 2332 0 CS CS 0.000000 1.0000 0 - 2333 0 CS CS 0.000000 1.0000 0 - 2334 0 CS CS 0.000000 1.0000 0 - 2335 0 CS CS 0.000000 1.0000 0 - 2336 0 CS CS 0.000000 1.0000 0 - 2337 0 CS CS 0.000000 1.0000 0 - 2338 0 CS CS 0.000000 1.0000 0 - 2339 0 CS CS 0.000000 1.0000 0 - 2340 0 CS CS 0.000000 1.0000 0 - 2341 0 CS CS 0.000000 1.0000 0 - 2342 0 CS CS 0.000000 1.0000 0 - 2343 0 CS CS 0.000000 1.0000 0 - 2344 0 CS CS 0.000000 1.0000 0 - 2345 0 CS CS 0.000000 1.0000 0 - 2346 0 CS CS 0.000000 1.0000 0 - 2347 0 CS CS 0.000000 1.0000 0 - 2348 0 CS CS 0.000000 1.0000 0 - 2349 0 CS CS 0.000000 1.0000 0 - 2350 0 CS CS 0.000000 1.0000 0 - 2351 0 CS CS 0.000000 1.0000 0 - 2352 0 CS CS 0.000000 1.0000 0 - 2353 0 CS CS 0.000000 1.0000 0 - 2354 0 CS CS 0.000000 1.0000 0 - 2355 0 CS CS 0.000000 1.0000 0 - 2356 0 CS CS 0.000000 1.0000 0 - 2357 0 CS CS 0.000000 1.0000 0 - 2358 0 CS CS 0.000000 1.0000 0 - 2359 0 CS CS 0.000000 1.0000 0 - 2360 0 CS CS 0.000000 1.0000 0 - 2361 0 CS CS 0.000000 1.0000 0 - 2362 0 CS CS 0.000000 1.0000 0 - 2363 0 CS CS 0.000000 1.0000 0 - 2364 0 CS CS 0.000000 1.0000 0 - 2365 0 CS CS 0.000000 1.0000 0 - 2366 0 CS CS 0.000000 1.0000 0 - 2367 0 CS CS 0.000000 1.0000 0 - 2368 0 CS CS 0.000000 1.0000 0 - 2369 0 CS CS 0.000000 1.0000 0 - 2370 0 CS CS 0.000000 1.0000 0 - 2371 0 CS CS 0.000000 1.0000 0 - 2372 0 CS CS 0.000000 1.0000 0 - 2373 0 CS CS 0.000000 1.0000 0 - 2374 0 CS CS 0.000000 1.0000 0 - 2375 0 CS CS 0.000000 1.0000 0 - 2376 0 CS CS 0.000000 1.0000 0 - 2377 0 CS CS 0.000000 1.0000 0 - 2378 0 CS CS 0.000000 1.0000 0 - 2379 0 CS CS 0.000000 1.0000 0 - 2380 0 CS CS 0.000000 1.0000 0 - 2381 0 CS CS 0.000000 1.0000 0 - 2382 0 CS CS 0.000000 1.0000 0 - 2383 0 CS CS 0.000000 1.0000 0 - 2384 0 CS CS 0.000000 1.0000 0 - 2385 0 CS CS 0.000000 1.0000 0 - 2386 0 CS CS 0.000000 1.0000 0 - 2387 0 CS CS 0.000000 1.0000 0 - 2388 0 CS CS 0.000000 1.0000 0 - 2389 0 CS CS 0.000000 1.0000 0 - 2390 0 CS CS 0.000000 1.0000 0 - 2391 0 CS CS 0.000000 1.0000 0 - 2392 0 CS CS 0.000000 1.0000 0 - 2393 0 CS CS 0.000000 1.0000 0 - 2394 0 CS CS 0.000000 1.0000 0 - 2395 0 CS CS 0.000000 1.0000 0 - 2396 0 CS CS 0.000000 1.0000 0 - 2397 0 CS CS 0.000000 1.0000 0 - 2398 0 CS CS 0.000000 1.0000 0 - 2399 0 CS CS 0.000000 1.0000 0 - 2400 0 CS CS 0.000000 1.0000 0 - 2401 0 CS CS 0.000000 1.0000 0 - 2402 0 CS CS 0.000000 1.0000 0 - 2403 0 CS CS 0.000000 1.0000 0 - 2404 0 CS CS 0.000000 1.0000 0 - 2405 0 CS CS 0.000000 1.0000 0 - 2406 0 CS CS 0.000000 1.0000 0 - 2407 0 CS CS 0.000000 1.0000 0 - 2408 0 CS CS 0.000000 1.0000 0 - 2409 0 CS CS 0.000000 1.0000 0 - 2410 0 CS CS 0.000000 1.0000 0 - 2411 0 CS CS 0.000000 1.0000 0 - 2412 0 CS CS 0.000000 1.0000 0 - 2413 0 CS CS 0.000000 1.0000 0 - 2414 0 CS CS 0.000000 1.0000 0 - 2415 0 CS CS 0.000000 1.0000 0 - 2416 0 CS CS 0.000000 1.0000 0 - 2417 0 CS CS 0.000000 1.0000 0 - 2418 0 CS CS 0.000000 1.0000 0 - 2419 0 CS CS 0.000000 1.0000 0 - 2420 0 CS CS 0.000000 1.0000 0 - 2421 0 CS CS 0.000000 1.0000 0 - 2422 0 CS CS 0.000000 1.0000 0 - 2423 0 CS CS 0.000000 1.0000 0 - 2424 0 CS CS 0.000000 1.0000 0 - 2425 0 CS CS 0.000000 1.0000 0 - 2426 0 CS CS 0.000000 1.0000 0 - 2427 0 CS CS 0.000000 1.0000 0 - 2428 0 CS CS 0.000000 1.0000 0 - 2429 0 CS CS 0.000000 1.0000 0 - 2430 0 CS CS 0.000000 1.0000 0 - 2431 0 CS CS 0.000000 1.0000 0 - 2432 0 CS CS 0.000000 1.0000 0 - 2433 0 CS CS 0.000000 1.0000 0 - 2434 0 CS CS 0.000000 1.0000 0 - 2435 0 CS CS 0.000000 1.0000 0 - 2436 0 CS CS 0.000000 1.0000 0 - 2437 0 CS CS 0.000000 1.0000 0 - 2438 0 CS CS 0.000000 1.0000 0 - 2439 0 CS CS 0.000000 1.0000 0 - 2440 0 CS CS 0.000000 1.0000 0 - 2441 0 CS CS 0.000000 1.0000 0 - 2442 0 CS CS 0.000000 1.0000 0 - 2443 0 CS CS 0.000000 1.0000 0 - 2444 0 CS CS 0.000000 1.0000 0 - 2445 0 CS CS 0.000000 1.0000 0 - 2446 0 CS CS 0.000000 1.0000 0 - 2447 0 CS CS 0.000000 1.0000 0 - 2448 0 CS CS 0.000000 1.0000 0 - 2449 0 CS CS 0.000000 1.0000 0 - 2450 0 CS CS 0.000000 1.0000 0 - 2451 0 CS CS 0.000000 1.0000 0 - 2452 0 CS CS 0.000000 1.0000 0 - 2453 0 CS CS 0.000000 1.0000 0 - 2454 0 CS CS 0.000000 1.0000 0 - 2455 0 CS CS 0.000000 1.0000 0 - 2456 0 CS CS 0.000000 1.0000 0 - 2457 0 CS CS 0.000000 1.0000 0 - 2458 0 CS CS 0.000000 1.0000 0 - 2459 0 CS CS 0.000000 1.0000 0 - 2460 0 CS CS 0.000000 1.0000 0 - 2461 0 CS CS 0.000000 1.0000 0 - 2462 0 CS CS 0.000000 1.0000 0 - 2463 0 CS CS 0.000000 1.0000 0 - 2464 0 CS CS 0.000000 1.0000 0 - 2465 0 CS CS 0.000000 1.0000 0 - 2466 0 CS CS 0.000000 1.0000 0 - 2467 0 CS CS 0.000000 1.0000 0 - 2468 0 CS CS 0.000000 1.0000 0 - 2469 0 CS CS 0.000000 1.0000 0 - 2470 0 CS CS 0.000000 1.0000 0 - 2471 0 CS CS 0.000000 1.0000 0 - 2472 0 CS CS 0.000000 1.0000 0 - 2473 0 CS CS 0.000000 1.0000 0 - 2474 0 CS CS 0.000000 1.0000 0 - 2475 0 CS CS 0.000000 1.0000 0 - 2476 0 CS CS 0.000000 1.0000 0 - 2477 0 CS CS 0.000000 1.0000 0 - 2478 0 CS CS 0.000000 1.0000 0 - 2479 0 CS CS 0.000000 1.0000 0 - 2480 0 CS CS 0.000000 1.0000 0 - 2481 0 CS CS 0.000000 1.0000 0 - 2482 0 CS CS 0.000000 1.0000 0 - 2483 0 CS CS 0.000000 1.0000 0 - 2484 0 CS CS 0.000000 1.0000 0 - 2485 0 CS CS 0.000000 1.0000 0 - 2486 0 CS CS 0.000000 1.0000 0 - 2487 0 CS CS 0.000000 1.0000 0 - 2488 0 CS CS 0.000000 1.0000 0 - 2489 0 CS CS 0.000000 1.0000 0 - 2490 0 CS CS 0.000000 1.0000 0 - 2491 0 CS CS 0.000000 1.0000 0 - 2492 0 CS CS 0.000000 1.0000 0 - 2493 0 CS CS 0.000000 1.0000 0 - 2494 0 CS CS 0.000000 1.0000 0 - 2495 0 CS CS 0.000000 1.0000 0 - 2496 0 CS CS 0.000000 1.0000 0 - 2497 0 CS CS 0.000000 1.0000 0 - 2498 0 CS CS 0.000000 1.0000 0 - 2499 0 CS CS 0.000000 1.0000 0 - 2500 0 CS CS 0.000000 1.0000 0 - 2501 0 CS CS 0.000000 1.0000 0 - 2502 0 CS CS 0.000000 1.0000 0 - 2503 0 CS CS 0.000000 1.0000 0 - 2504 0 CS CS 0.000000 1.0000 0 - 2505 0 CS CS 0.000000 1.0000 0 - 2506 0 CS CS 0.000000 1.0000 0 - 2507 0 CS CS 0.000000 1.0000 0 - 2508 0 CS CS 0.000000 1.0000 0 - 2509 0 CS CS 0.000000 1.0000 0 - 2510 0 CS CS 0.000000 1.0000 0 - 2511 0 CS CS 0.000000 1.0000 0 - 2512 0 CS CS 0.000000 1.0000 0 - 2513 0 CS CS 0.000000 1.0000 0 - 2514 0 CS CS 0.000000 1.0000 0 - 2515 0 CS CS 0.000000 1.0000 0 - 2516 0 CS CS 0.000000 1.0000 0 - 2517 0 CS CS 0.000000 1.0000 0 - 2518 0 CS CS 0.000000 1.0000 0 - 2519 0 CS CS 0.000000 1.0000 0 - 2520 0 CS CS 0.000000 1.0000 0 - 2521 0 CS CS 0.000000 1.0000 0 - 2522 0 CS CS 0.000000 1.0000 0 - 2523 0 CS CS 0.000000 1.0000 0 - 2524 0 CS CS 0.000000 1.0000 0 - 2525 0 CS CS 0.000000 1.0000 0 - 2526 0 CS CS 0.000000 1.0000 0 - 2527 0 CS CS 0.000000 1.0000 0 - 2528 0 CS CS 0.000000 1.0000 0 - 2529 0 CS CS 0.000000 1.0000 0 - 2530 0 CS CS 0.000000 1.0000 0 - 2531 0 CS CS 0.000000 1.0000 0 - 2532 0 CS CS 0.000000 1.0000 0 - 2533 0 CS CS 0.000000 1.0000 0 - 2534 0 CS CS 0.000000 1.0000 0 - 2535 0 CS CS 0.000000 1.0000 0 - 2536 0 CS CS 0.000000 1.0000 0 - 2537 0 CS CS 0.000000 1.0000 0 - 2538 0 CS CS 0.000000 1.0000 0 - 2539 0 CS CS 0.000000 1.0000 0 - 2540 0 CS CS 0.000000 1.0000 0 - 2541 0 CS CS 0.000000 1.0000 0 - 2542 0 CS CS 0.000000 1.0000 0 - 2543 0 CS CS 0.000000 1.0000 0 - 2544 0 CS CS 0.000000 1.0000 0 - 2545 0 CS CS 0.000000 1.0000 0 - 2546 0 CS CS 0.000000 1.0000 0 - 2547 0 CS CS 0.000000 1.0000 0 - 2548 0 CS CS 0.000000 1.0000 0 - 2549 0 CS CS 0.000000 1.0000 0 - 2550 0 CS CS 0.000000 1.0000 0 - 2551 0 CS CS 0.000000 1.0000 0 - 2552 0 CS CS 0.000000 1.0000 0 - 2553 0 CS CS 0.000000 1.0000 0 - 2554 0 CS CS 0.000000 1.0000 0 - 2555 0 CS CS 0.000000 1.0000 0 - 2556 0 CS CS 0.000000 1.0000 0 - 2557 0 CS CS 0.000000 1.0000 0 - 2558 0 CS CS 0.000000 1.0000 0 - 2559 0 CS CS 0.000000 1.0000 0 - 2560 0 CS CS 0.000000 1.0000 0 - 2561 0 CS CS 0.000000 1.0000 0 - 2562 0 CS CS 0.000000 1.0000 0 - 2563 0 CS CS 0.000000 1.0000 0 - 2564 0 CS CS 0.000000 1.0000 0 - 2565 0 CS CS 0.000000 1.0000 0 - 2566 0 CS CS 0.000000 1.0000 0 - 2567 0 CS CS 0.000000 1.0000 0 - 2568 0 CS CS 0.000000 1.0000 0 - 2569 0 CS CS 0.000000 1.0000 0 - 2570 0 CS CS 0.000000 1.0000 0 - 2571 0 CS CS 0.000000 1.0000 0 - 2572 0 CS CS 0.000000 1.0000 0 - 2573 0 CS CS 0.000000 1.0000 0 - 2574 0 CS CS 0.000000 1.0000 0 - 2575 0 CS CS 0.000000 1.0000 0 - 2576 0 CS CS 0.000000 1.0000 0 - 2577 0 CS CS 0.000000 1.0000 0 - 2578 0 CS CS 0.000000 1.0000 0 - 2579 0 CS CS 0.000000 1.0000 0 - 2580 0 CS CS 0.000000 1.0000 0 - 2581 0 CS CS 0.000000 1.0000 0 - 2582 0 CS CS 0.000000 1.0000 0 - 2583 0 CS CS 0.000000 1.0000 0 - 2584 0 CS CS 0.000000 1.0000 0 - 2585 0 CS CS 0.000000 1.0000 0 - 2586 0 CS CS 0.000000 1.0000 0 - 2587 0 CS CS 0.000000 1.0000 0 - 2588 0 CS CS 0.000000 1.0000 0 - 2589 0 CS CS 0.000000 1.0000 0 - 2590 0 CS CS 0.000000 1.0000 0 - 2591 0 CS CS 0.000000 1.0000 0 - 2592 0 CS CS 0.000000 1.0000 0 - 2593 0 CS CS 0.000000 1.0000 0 - 2594 0 CS CS 0.000000 1.0000 0 - 2595 0 CS CS 0.000000 1.0000 0 - 2596 0 CS CS 0.000000 1.0000 0 - 2597 0 CS CS 0.000000 1.0000 0 - 2598 0 CS CS 0.000000 1.0000 0 - 2599 0 CS CS 0.000000 1.0000 0 - 2600 0 CS CS 0.000000 1.0000 0 - 2601 0 CS CS 0.000000 1.0000 0 - 2602 0 CS CS 0.000000 1.0000 0 - 2603 0 CS CS 0.000000 1.0000 0 - 2604 0 CS CS 0.000000 1.0000 0 - 2605 0 CS CS 0.000000 1.0000 0 - 2606 0 CS CS 0.000000 1.0000 0 - 2607 0 CS CS 0.000000 1.0000 0 - 2608 0 CS CS 0.000000 1.0000 0 - 2609 0 CS CS 0.000000 1.0000 0 - 2610 0 CS CS 0.000000 1.0000 0 - 2611 0 CS CS 0.000000 1.0000 0 - 2612 0 CS CS 0.000000 1.0000 0 - 2613 0 CS CS 0.000000 1.0000 0 - 2614 0 CS CS 0.000000 1.0000 0 - 2615 0 CS CS 0.000000 1.0000 0 - 2616 0 CS CS 0.000000 1.0000 0 - 2617 0 CS CS 0.000000 1.0000 0 - 2618 0 CS CS 0.000000 1.0000 0 - 2619 0 CS CS 0.000000 1.0000 0 - 2620 0 CS CS 0.000000 1.0000 0 - 2621 0 CS CS 0.000000 1.0000 0 - 2622 0 CS CS 0.000000 1.0000 0 - 2623 0 CS CS 0.000000 1.0000 0 - 2624 0 CS CS 0.000000 1.0000 0 - 2625 0 CS CS 0.000000 1.0000 0 - 2626 0 CS CS 0.000000 1.0000 0 - 2627 0 CS CS 0.000000 1.0000 0 - 2628 0 CS CS 0.000000 1.0000 0 - 2629 0 CS CS 0.000000 1.0000 0 - 2630 0 CS CS 0.000000 1.0000 0 - 2631 0 CS CS 0.000000 1.0000 0 - 2632 0 CS CS 0.000000 1.0000 0 - 2633 0 CS CS 0.000000 1.0000 0 - 2634 0 CS CS 0.000000 1.0000 0 - 2635 0 CS CS 0.000000 1.0000 0 - 2636 0 CS CS 0.000000 1.0000 0 - 2637 0 CS CS 0.000000 1.0000 0 - 2638 0 CS CS 0.000000 1.0000 0 - 2639 0 CS CS 0.000000 1.0000 0 - 2640 0 CS CS 0.000000 1.0000 0 - 2641 0 CS CS 0.000000 1.0000 0 - 2642 0 CS CS 0.000000 1.0000 0 - 2643 0 CS CS 0.000000 1.0000 0 - 2644 0 CS CS 0.000000 1.0000 0 - 2645 0 CS CS 0.000000 1.0000 0 - 2646 0 CS CS 0.000000 1.0000 0 - 2647 0 CS CS 0.000000 1.0000 0 - 2648 0 CS CS 0.000000 1.0000 0 - 2649 0 CS CS 0.000000 1.0000 0 - 2650 0 CS CS 0.000000 1.0000 0 - 2651 0 CS CS 0.000000 1.0000 0 - 2652 0 CS CS 0.000000 1.0000 0 - 2653 0 CS CS 0.000000 1.0000 0 - 2654 0 CS CS 0.000000 1.0000 0 - 2655 0 CS CS 0.000000 1.0000 0 - 2656 0 CS CS 0.000000 1.0000 0 - 2657 0 CS CS 0.000000 1.0000 0 - 2658 0 CS CS 0.000000 1.0000 0 - 2659 0 CS CS 0.000000 1.0000 0 - 2660 0 CS CS 0.000000 1.0000 0 - 2661 0 CS CS 0.000000 1.0000 0 - 2662 0 CS CS 0.000000 1.0000 0 - 2663 0 CS CS 0.000000 1.0000 0 - 2664 0 CS CS 0.000000 1.0000 0 - 2665 0 CS CS 0.000000 1.0000 0 - 2666 0 CS CS 0.000000 1.0000 0 - 2667 0 CS CS 0.000000 1.0000 0 - 2668 0 CS CS 0.000000 1.0000 0 - 2669 0 CS CS 0.000000 1.0000 0 - 2670 0 CS CS 0.000000 1.0000 0 - 2671 0 CS CS 0.000000 1.0000 0 - 2672 0 CS CS 0.000000 1.0000 0 - 2673 0 CS CS 0.000000 1.0000 0 - 2674 0 CS CS 0.000000 1.0000 0 - 2675 0 CS CS 0.000000 1.0000 0 - 2676 0 CS CS 0.000000 1.0000 0 - 2677 0 CS CS 0.000000 1.0000 0 - 2678 0 CS CS 0.000000 1.0000 0 - 2679 0 CS CS 0.000000 1.0000 0 - 2680 0 CS CS 0.000000 1.0000 0 - 2681 0 CS CS 0.000000 1.0000 0 - 2682 0 CS CS 0.000000 1.0000 0 - 2683 0 CS CS 0.000000 1.0000 0 - 2684 0 CS CS 0.000000 1.0000 0 - 2685 0 CS CS 0.000000 1.0000 0 - 2686 0 CS CS 0.000000 1.0000 0 - 2687 0 CS CS 0.000000 1.0000 0 - 2688 0 CS CS 0.000000 1.0000 0 - 2689 0 CS CS 0.000000 1.0000 0 - 2690 0 CS CS 0.000000 1.0000 0 - 2691 0 CS CS 0.000000 1.0000 0 - 2692 0 CS CS 0.000000 1.0000 0 - 2693 0 CS CS 0.000000 1.0000 0 - 2694 0 CS CS 0.000000 1.0000 0 - 2695 0 CS CS 0.000000 1.0000 0 - 2696 0 CS CS 0.000000 1.0000 0 - 2697 0 CS CS 0.000000 1.0000 0 - 2698 0 CS CS 0.000000 1.0000 0 - 2699 0 CS CS 0.000000 1.0000 0 - 2700 0 CS CS 0.000000 1.0000 0 - 2701 0 CS CS 0.000000 1.0000 0 - 2702 0 CS CS 0.000000 1.0000 0 - 2703 0 CS CS 0.000000 1.0000 0 - 2704 0 CS CS 0.000000 1.0000 0 - 2705 0 CS CS 0.000000 1.0000 0 - 2706 0 CS CS 0.000000 1.0000 0 - 2707 0 CS CS 0.000000 1.0000 0 - 2708 0 CS CS 0.000000 1.0000 0 - 2709 0 CS CS 0.000000 1.0000 0 - 2710 0 CS CS 0.000000 1.0000 0 - 2711 0 CS CS 0.000000 1.0000 0 - 2712 0 CS CS 0.000000 1.0000 0 - 2713 0 CS CS 0.000000 1.0000 0 - 2714 0 CS CS 0.000000 1.0000 0 - 2715 0 CS CS 0.000000 1.0000 0 - 2716 0 CS CS 0.000000 1.0000 0 - 2717 0 CS CS 0.000000 1.0000 0 - 2718 0 CS CS 0.000000 1.0000 0 - 2719 0 CS CS 0.000000 1.0000 0 - 2720 0 CS CS 0.000000 1.0000 0 - 2721 0 CS CS 0.000000 1.0000 0 - 2722 0 CS CS 0.000000 1.0000 0 - 2723 0 CS CS 0.000000 1.0000 0 - 2724 0 CS CS 0.000000 1.0000 0 - 2725 0 CS CS 0.000000 1.0000 0 - 2726 0 CS CS 0.000000 1.0000 0 - 2727 0 CS CS 0.000000 1.0000 0 - 2728 0 CS CS 0.000000 1.0000 0 - 2729 0 CS CS 0.000000 1.0000 0 - 2730 0 CS CS 0.000000 1.0000 0 - 2731 0 CS CS 0.000000 1.0000 0 - 2732 0 CS CS 0.000000 1.0000 0 - 2733 0 CS CS 0.000000 1.0000 0 - 2734 0 CS CS 0.000000 1.0000 0 - 2735 0 CS CS 0.000000 1.0000 0 - 2736 0 CS CS 0.000000 1.0000 0 - 2737 0 CS CS 0.000000 1.0000 0 - 2738 0 CS CS 0.000000 1.0000 0 - 2739 0 CS CS 0.000000 1.0000 0 - 2740 0 CS CS 0.000000 1.0000 0 - 2741 0 CS CS 0.000000 1.0000 0 - 2742 0 CS CS 0.000000 1.0000 0 - 2743 0 CS CS 0.000000 1.0000 0 - 2744 0 CS CS 0.000000 1.0000 0 - 2745 0 CS CS 0.000000 1.0000 0 - 2746 0 CS CS 0.000000 1.0000 0 - 2747 0 CS CS 0.000000 1.0000 0 - 2748 0 CS CS 0.000000 1.0000 0 - 2749 0 CS CS 0.000000 1.0000 0 - 2750 0 CS CS 0.000000 1.0000 0 - 2751 0 CS CS 0.000000 1.0000 0 - 2752 0 CS CS 0.000000 1.0000 0 - 2753 0 CS CS 0.000000 1.0000 0 - 2754 0 CS CS 0.000000 1.0000 0 - 2755 0 CS CS 0.000000 1.0000 0 - 2756 0 CS CS 0.000000 1.0000 0 - 2757 0 CS CS 0.000000 1.0000 0 - 2758 0 CS CS 0.000000 1.0000 0 - 2759 0 CS CS 0.000000 1.0000 0 - 2760 0 CS CS 0.000000 1.0000 0 - 2761 0 CS CS 0.000000 1.0000 0 - 2762 0 CS CS 0.000000 1.0000 0 - 2763 0 CS CS 0.000000 1.0000 0 - 2764 0 CS CS 0.000000 1.0000 0 - 2765 0 CS CS 0.000000 1.0000 0 - 2766 0 CS CS 0.000000 1.0000 0 - 2767 0 CS CS 0.000000 1.0000 0 - 2768 0 CS CS 0.000000 1.0000 0 - 2769 0 CS CS 0.000000 1.0000 0 - 2770 0 CS CS 0.000000 1.0000 0 - 2771 0 CS CS 0.000000 1.0000 0 - 2772 0 CS CS 0.000000 1.0000 0 - 2773 0 CS CS 0.000000 1.0000 0 - 2774 0 CS CS 0.000000 1.0000 0 - 2775 0 CS CS 0.000000 1.0000 0 - 2776 0 CS CS 0.000000 1.0000 0 - 2777 0 CS CS 0.000000 1.0000 0 - 2778 0 CS CS 0.000000 1.0000 0 - 2779 0 CS CS 0.000000 1.0000 0 - 2780 0 CS CS 0.000000 1.0000 0 - 2781 0 CS CS 0.000000 1.0000 0 - 2782 0 CS CS 0.000000 1.0000 0 - 2783 0 CS CS 0.000000 1.0000 0 - 2784 0 CS CS 0.000000 1.0000 0 - 2785 0 CS CS 0.000000 1.0000 0 - 2786 0 CS CS 0.000000 1.0000 0 - 2787 0 CS CS 0.000000 1.0000 0 - 2788 0 CS CS 0.000000 1.0000 0 - 2789 0 CS CS 0.000000 1.0000 0 - 2790 0 CS CS 0.000000 1.0000 0 - 2791 0 CS CS 0.000000 1.0000 0 - 2792 0 CS CS 0.000000 1.0000 0 - 2793 0 CS CS 0.000000 1.0000 0 - 2794 0 CS CS 0.000000 1.0000 0 - 2795 0 CS CS 0.000000 1.0000 0 - 2796 0 CS CS 0.000000 1.0000 0 - 2797 0 CS CS 0.000000 1.0000 0 - 2798 0 CS CS 0.000000 1.0000 0 - 2799 0 CS CS 0.000000 1.0000 0 - 2800 0 CS CS 0.000000 1.0000 0 - 2801 0 CS CS 0.000000 1.0000 0 - 2802 0 CS CS 0.000000 1.0000 0 - 2803 0 CS CS 0.000000 1.0000 0 - 2804 0 CS CS 0.000000 1.0000 0 - 2805 0 CS CS 0.000000 1.0000 0 - 2806 0 CS CS 0.000000 1.0000 0 - 2807 0 CS CS 0.000000 1.0000 0 - 2808 0 CS CS 0.000000 1.0000 0 - 2809 0 CS CS 0.000000 1.0000 0 - 2810 0 CS CS 0.000000 1.0000 0 - 2811 0 CS CS 0.000000 1.0000 0 - 2812 0 CS CS 0.000000 1.0000 0 - 2813 0 CS CS 0.000000 1.0000 0 - 2814 0 CS CS 0.000000 1.0000 0 - 2815 0 CS CS 0.000000 1.0000 0 - 2816 0 CS CS 0.000000 1.0000 0 - 2817 0 CS CS 0.000000 1.0000 0 - 2818 0 CS CS 0.000000 1.0000 0 - 2819 0 CS CS 0.000000 1.0000 0 - 2820 0 CS CS 0.000000 1.0000 0 - 2821 0 CS CS 0.000000 1.0000 0 - 2822 0 CS CS 0.000000 1.0000 0 - 2823 0 CS CS 0.000000 1.0000 0 - 2824 0 CS CS 0.000000 1.0000 0 - 2825 0 CS CS 0.000000 1.0000 0 - 2826 0 CS CS 0.000000 1.0000 0 - 2827 0 CS CS 0.000000 1.0000 0 - 2828 0 CS CS 0.000000 1.0000 0 - 2829 0 CS CS 0.000000 1.0000 0 - 2830 0 CS CS 0.000000 1.0000 0 - 2831 0 CS CS 0.000000 1.0000 0 - 2832 0 CS CS 0.000000 1.0000 0 - 2833 0 CS CS 0.000000 1.0000 0 - 2834 0 CS CS 0.000000 1.0000 0 - 2835 0 CS CS 0.000000 1.0000 0 - 2836 0 CS CS 0.000000 1.0000 0 - 2837 0 CS CS 0.000000 1.0000 0 - 2838 0 CS CS 0.000000 1.0000 0 - 2839 0 CS CS 0.000000 1.0000 0 - 2840 0 CS CS 0.000000 1.0000 0 - 2841 0 CS CS 0.000000 1.0000 0 - 2842 0 CS CS 0.000000 1.0000 0 - 2843 0 CS CS 0.000000 1.0000 0 - 2844 0 CS CS 0.000000 1.0000 0 - 2845 0 CS CS 0.000000 1.0000 0 - 2846 0 CS CS 0.000000 1.0000 0 - 2847 0 CS CS 0.000000 1.0000 0 - 2848 0 CS CS 0.000000 1.0000 0 - 2849 0 CS CS 0.000000 1.0000 0 - 2850 0 CS CS 0.000000 1.0000 0 - 2851 0 CS CS 0.000000 1.0000 0 - 2852 0 CS CS 0.000000 1.0000 0 - 2853 0 CS CS 0.000000 1.0000 0 - 2854 0 CS CS 0.000000 1.0000 0 - 2855 0 CS CS 0.000000 1.0000 0 - 2856 0 CS CS 0.000000 1.0000 0 - 2857 0 CS CS 0.000000 1.0000 0 - 2858 0 CS CS 0.000000 1.0000 0 - 2859 0 CS CS 0.000000 1.0000 0 - 2860 0 CS CS 0.000000 1.0000 0 - 2861 0 CS CS 0.000000 1.0000 0 - 2862 0 CS CS 0.000000 1.0000 0 - 2863 0 CS CS 0.000000 1.0000 0 - 2864 0 CS CS 0.000000 1.0000 0 - 2865 0 CS CS 0.000000 1.0000 0 - 2866 0 CS CS 0.000000 1.0000 0 - 2867 0 CS CS 0.000000 1.0000 0 - 2868 0 CS CS 0.000000 1.0000 0 - 2869 0 CS CS 0.000000 1.0000 0 - 2870 0 CS CS 0.000000 1.0000 0 - 2871 0 CS CS 0.000000 1.0000 0 - 2872 0 CS CS 0.000000 1.0000 0 - 2873 0 CS CS 0.000000 1.0000 0 - 2874 0 CS CS 0.000000 1.0000 0 - 2875 0 CS CS 0.000000 1.0000 0 - 2876 0 CS CS 0.000000 1.0000 0 - 2877 0 CS CS 0.000000 1.0000 0 - 2878 0 CS CS 0.000000 1.0000 0 - 2879 0 CS CS 0.000000 1.0000 0 - 2880 0 CS CS 0.000000 1.0000 0 - 2881 0 CS CS 0.000000 1.0000 0 - 2882 0 CS CS 0.000000 1.0000 0 - 2883 0 CS CS 0.000000 1.0000 0 - 2884 0 CS CS 0.000000 1.0000 0 - 2885 0 CS CS 0.000000 1.0000 0 - 2886 0 CS CS 0.000000 1.0000 0 - 2887 0 CS CS 0.000000 1.0000 0 - 2888 0 CS CS 0.000000 1.0000 0 - 2889 0 CS CS 0.000000 1.0000 0 - 2890 0 CS CS 0.000000 1.0000 0 - 2891 0 CS CS 0.000000 1.0000 0 - 2892 0 CS CS 0.000000 1.0000 0 - 2893 0 CS CS 0.000000 1.0000 0 - 2894 0 CS CS 0.000000 1.0000 0 - 2895 0 CS CS 0.000000 1.0000 0 - 2896 0 CS CS 0.000000 1.0000 0 - 2897 0 CS CS 0.000000 1.0000 0 - 2898 0 CS CS 0.000000 1.0000 0 - 2899 0 CS CS 0.000000 1.0000 0 - 2900 0 CS CS 0.000000 1.0000 0 - 2901 0 CS CS 0.000000 1.0000 0 - 2902 0 CS CS 0.000000 1.0000 0 - 2903 0 CS CS 0.000000 1.0000 0 - 2904 0 CS CS 0.000000 1.0000 0 - 2905 0 CS CS 0.000000 1.0000 0 - 2906 0 CS CS 0.000000 1.0000 0 - 2907 0 CS CS 0.000000 1.0000 0 - 2908 0 CS CS 0.000000 1.0000 0 - 2909 0 CS CS 0.000000 1.0000 0 - 2910 0 CS CS 0.000000 1.0000 0 - 2911 0 CS CS 0.000000 1.0000 0 - 2912 0 CS CS 0.000000 1.0000 0 - 2913 0 CS CS 0.000000 1.0000 0 - 2914 0 CS CS 0.000000 1.0000 0 - 2915 0 CS CS 0.000000 1.0000 0 - 2916 0 CS CS 0.000000 1.0000 0 - 2917 0 CS CS 0.000000 1.0000 0 - 2918 0 CS CS 0.000000 1.0000 0 - 2919 0 CS CS 0.000000 1.0000 0 - 2920 0 CS CS 0.000000 1.0000 0 - 2921 0 CS CS 0.000000 1.0000 0 - 2922 0 CS CS 0.000000 1.0000 0 - 2923 0 CS CS 0.000000 1.0000 0 - 2924 0 CS CS 0.000000 1.0000 0 - 2925 0 CS CS 0.000000 1.0000 0 - 2926 0 CS CS 0.000000 1.0000 0 - 2927 0 CS CS 0.000000 1.0000 0 - 2928 0 CS CS 0.000000 1.0000 0 - 2929 0 CS CS 0.000000 1.0000 0 - 2930 0 CS CS 0.000000 1.0000 0 - 2931 0 CS CS 0.000000 1.0000 0 - 2932 0 CS CS 0.000000 1.0000 0 - 2933 0 CS CS 0.000000 1.0000 0 - 2934 0 CS CS 0.000000 1.0000 0 - 2935 0 CS CS 0.000000 1.0000 0 - 2936 0 CS CS 0.000000 1.0000 0 - 2937 0 CS CS 0.000000 1.0000 0 - 2938 0 CS CS 0.000000 1.0000 0 - 2939 0 CS CS 0.000000 1.0000 0 - 2940 0 CS CS 0.000000 1.0000 0 - 2941 0 CS CS 0.000000 1.0000 0 - 2942 0 CS CS 0.000000 1.0000 0 - 2943 0 CS CS 0.000000 1.0000 0 - 2944 0 CS CS 0.000000 1.0000 0 - 2945 0 CS CS 0.000000 1.0000 0 - 2946 0 CS CS 0.000000 1.0000 0 - 2947 0 CS CS 0.000000 1.0000 0 - 2948 0 CS CS 0.000000 1.0000 0 - 2949 0 CS CS 0.000000 1.0000 0 - 2950 0 CS CS 0.000000 1.0000 0 - 2951 0 CS CS 0.000000 1.0000 0 - 2952 0 CS CS 0.000000 1.0000 0 - 2953 0 CS CS 0.000000 1.0000 0 - 2954 0 CS CS 0.000000 1.0000 0 - 2955 0 CS CS 0.000000 1.0000 0 - 2956 0 CS CS 0.000000 1.0000 0 - 2957 0 CS CS 0.000000 1.0000 0 - 2958 0 CS CS 0.000000 1.0000 0 - 2959 0 CS CS 0.000000 1.0000 0 - 2960 0 CS CS 0.000000 1.0000 0 - 2961 0 CS CS 0.000000 1.0000 0 - 2962 0 CS CS 0.000000 1.0000 0 - 2963 0 CS CS 0.000000 1.0000 0 - 2964 0 CS CS 0.000000 1.0000 0 - 2965 0 CS CS 0.000000 1.0000 0 - 2966 0 CS CS 0.000000 1.0000 0 - 2967 0 CS CS 0.000000 1.0000 0 - 2968 0 CS CS 0.000000 1.0000 0 - 2969 0 CS CS 0.000000 1.0000 0 - 2970 0 CS CS 0.000000 1.0000 0 - 2971 0 CS CS 0.000000 1.0000 0 - 2972 0 CS CS 0.000000 1.0000 0 - 2973 0 CS CS 0.000000 1.0000 0 - 2974 0 CS CS 0.000000 1.0000 0 - 2975 0 CS CS 0.000000 1.0000 0 - 2976 0 CS CS 0.000000 1.0000 0 - 2977 0 CS CS 0.000000 1.0000 0 - 2978 0 CS CS 0.000000 1.0000 0 - 2979 0 CS CS 0.000000 1.0000 0 - 2980 0 CS CS 0.000000 1.0000 0 - 2981 0 CS CS 0.000000 1.0000 0 - 2982 0 CS CS 0.000000 1.0000 0 - 2983 0 CS CS 0.000000 1.0000 0 - 2984 0 CS CS 0.000000 1.0000 0 - 2985 0 CS CS 0.000000 1.0000 0 - 2986 0 CS CS 0.000000 1.0000 0 - 2987 0 CS CS 0.000000 1.0000 0 - 2988 0 CS CS 0.000000 1.0000 0 - 2989 0 CS CS 0.000000 1.0000 0 - 2990 0 CS CS 0.000000 1.0000 0 - 2991 0 CS CS 0.000000 1.0000 0 - 2992 0 CS CS 0.000000 1.0000 0 - 2993 0 CS CS 0.000000 1.0000 0 - 2994 0 CS CS 0.000000 1.0000 0 - 2995 0 CS CS 0.000000 1.0000 0 - 2996 0 CS CS 0.000000 1.0000 0 - 2997 0 CS CS 0.000000 1.0000 0 - 2998 0 CS CS 0.000000 1.0000 0 - 2999 0 CS CS 0.000000 1.0000 0 - 3000 0 CS CS 0.000000 1.0000 0 - 3001 0 CS CS 0.000000 1.0000 0 - 3002 0 CS CS 0.000000 1.0000 0 - 3003 0 CS CS 0.000000 1.0000 0 - 3004 0 CS CS 0.000000 1.0000 0 - 3005 0 CS CS 0.000000 1.0000 0 - 3006 0 CS CS 0.000000 1.0000 0 - 3007 0 CS CS 0.000000 1.0000 0 - 3008 0 CS CS 0.000000 1.0000 0 - 3009 0 CS CS 0.000000 1.0000 0 - 3010 0 CS CS 0.000000 1.0000 0 - 3011 0 CS CS 0.000000 1.0000 0 - 3012 0 CS CS 0.000000 1.0000 0 - 3013 0 CS CS 0.000000 1.0000 0 - 3014 0 CS CS 0.000000 1.0000 0 - 3015 0 CS CS 0.000000 1.0000 0 - 3016 0 CS CS 0.000000 1.0000 0 - 3017 0 CS CS 0.000000 1.0000 0 - 3018 0 CS CS 0.000000 1.0000 0 - 3019 0 CS CS 0.000000 1.0000 0 - 3020 0 CS CS 0.000000 1.0000 0 - 3021 0 CS CS 0.000000 1.0000 0 - 3022 0 CS CS 0.000000 1.0000 0 - 3023 0 CS CS 0.000000 1.0000 0 - 3024 0 CS CS 0.000000 1.0000 0 - 3025 0 CS CS 0.000000 1.0000 0 - 3026 0 CS CS 0.000000 1.0000 0 - 3027 0 CS CS 0.000000 1.0000 0 - 3028 0 CS CS 0.000000 1.0000 0 - 3029 0 CS CS 0.000000 1.0000 0 - 3030 0 CS CS 0.000000 1.0000 0 - 3031 0 CS CS 0.000000 1.0000 0 - 3032 0 CS CS 0.000000 1.0000 0 - 3033 0 CS CS 0.000000 1.0000 0 - 3034 0 CS CS 0.000000 1.0000 0 - 3035 0 CS CS 0.000000 1.0000 0 - 3036 0 CS CS 0.000000 1.0000 0 - 3037 0 CS CS 0.000000 1.0000 0 - 3038 0 CS CS 0.000000 1.0000 0 - 3039 0 CS CS 0.000000 1.0000 0 - 3040 0 CS CS 0.000000 1.0000 0 - 3041 0 CS CS 0.000000 1.0000 0 - 3042 0 CS CS 0.000000 1.0000 0 - 3043 0 CS CS 0.000000 1.0000 0 - 3044 0 CS CS 0.000000 1.0000 0 - 3045 0 CS CS 0.000000 1.0000 0 - 3046 0 CS CS 0.000000 1.0000 0 - 3047 0 CS CS 0.000000 1.0000 0 - 3048 0 CS CS 0.000000 1.0000 0 - 3049 0 CS CS 0.000000 1.0000 0 - 3050 0 CS CS 0.000000 1.0000 0 - 3051 0 CS CS 0.000000 1.0000 0 - 3052 0 CS CS 0.000000 1.0000 0 - 3053 0 CS CS 0.000000 1.0000 0 - 3054 0 CS CS 0.000000 1.0000 0 - 3055 0 CS CS 0.000000 1.0000 0 - 3056 0 CS CS 0.000000 1.0000 0 - 3057 0 CS CS 0.000000 1.0000 0 - 3058 0 CS CS 0.000000 1.0000 0 - 3059 0 CS CS 0.000000 1.0000 0 - 3060 0 CS CS 0.000000 1.0000 0 - 3061 0 CS CS 0.000000 1.0000 0 - 3062 0 CS CS 0.000000 1.0000 0 - 3063 0 CS CS 0.000000 1.0000 0 - 3064 0 CS CS 0.000000 1.0000 0 - 3065 0 CS CS 0.000000 1.0000 0 - 3066 0 CS CS 0.000000 1.0000 0 - 3067 0 CS CS 0.000000 1.0000 0 - 3068 0 CS CS 0.000000 1.0000 0 - 3069 0 CS CS 0.000000 1.0000 0 - 3070 0 CS CS 0.000000 1.0000 0 - 3071 0 CS CS 0.000000 1.0000 0 - 3072 0 CS CS 0.000000 1.0000 0 - 3073 0 CS CS 0.000000 1.0000 0 - 3074 0 CS CS 0.000000 1.0000 0 - 3075 0 CS CS 0.000000 1.0000 0 - 3076 0 CS CS 0.000000 1.0000 0 - 3077 0 CS CS 0.000000 1.0000 0 - 3078 0 CS CS 0.000000 1.0000 0 - 3079 0 CS CS 0.000000 1.0000 0 - 3080 0 CS CS 0.000000 1.0000 0 - 3081 0 CS CS 0.000000 1.0000 0 - 3082 0 CS CS 0.000000 1.0000 0 - 3083 0 CS CS 0.000000 1.0000 0 - 3084 0 CS CS 0.000000 1.0000 0 - 3085 0 CS CS 0.000000 1.0000 0 - 3086 0 CS CS 0.000000 1.0000 0 - 3087 0 CS CS 0.000000 1.0000 0 - 3088 0 CS CS 0.000000 1.0000 0 - 3089 0 CS CS 0.000000 1.0000 0 - 3090 0 CS CS 0.000000 1.0000 0 - 3091 0 CS CS 0.000000 1.0000 0 - 3092 0 CS CS 0.000000 1.0000 0 - 3093 0 CS CS 0.000000 1.0000 0 - 3094 0 CS CS 0.000000 1.0000 0 - 3095 0 CS CS 0.000000 1.0000 0 - 3096 0 CS CS 0.000000 1.0000 0 - 3097 0 CS CS 0.000000 1.0000 0 - 3098 0 CS CS 0.000000 1.0000 0 - 3099 0 CS CS 0.000000 1.0000 0 - 3100 0 CS CS 0.000000 1.0000 0 - 3101 0 CS CS 0.000000 1.0000 0 - 3102 0 CS CS 0.000000 1.0000 0 - 3103 0 CS CS 0.000000 1.0000 0 - 3104 0 CS CS 0.000000 1.0000 0 - 3105 0 CS CS 0.000000 1.0000 0 - 3106 0 CS CS 0.000000 1.0000 0 - 3107 0 CS CS 0.000000 1.0000 0 - 3108 0 CS CS 0.000000 1.0000 0 - 3109 0 CS CS 0.000000 1.0000 0 - 3110 0 CS CS 0.000000 1.0000 0 - 3111 0 CS CS 0.000000 1.0000 0 - 3112 0 CS CS 0.000000 1.0000 0 - 3113 0 CS CS 0.000000 1.0000 0 - 3114 0 CS CS 0.000000 1.0000 0 - 3115 0 CS CS 0.000000 1.0000 0 - 3116 0 CS CS 0.000000 1.0000 0 - 3117 0 CS CS 0.000000 1.0000 0 - 3118 0 CS CS 0.000000 1.0000 0 - 3119 0 CS CS 0.000000 1.0000 0 - 3120 0 CS CS 0.000000 1.0000 0 - 3121 0 CS CS 0.000000 1.0000 0 - 3122 0 CS CS 0.000000 1.0000 0 - 3123 0 CS CS 0.000000 1.0000 0 - 3124 0 CS CS 0.000000 1.0000 0 - 3125 0 CS CS 0.000000 1.0000 0 - 3126 0 CS CS 0.000000 1.0000 0 - 3127 0 CS CS 0.000000 1.0000 0 - 3128 0 CS CS 0.000000 1.0000 0 - 3129 0 CS CS 0.000000 1.0000 0 - 3130 0 CS CS 0.000000 1.0000 0 - 3131 0 CS CS 0.000000 1.0000 0 - 3132 0 CS CS 0.000000 1.0000 0 - 3133 0 CS CS 0.000000 1.0000 0 - 3134 0 CS CS 0.000000 1.0000 0 - 3135 0 CS CS 0.000000 1.0000 0 - 3136 0 CS CS 0.000000 1.0000 0 - 3137 0 CS CS 0.000000 1.0000 0 - 3138 0 CS CS 0.000000 1.0000 0 - 3139 0 CS CS 0.000000 1.0000 0 - 3140 0 CS CS 0.000000 1.0000 0 - 3141 0 CS CS 0.000000 1.0000 0 - 3142 0 CS CS 0.000000 1.0000 0 - 3143 0 CS CS 0.000000 1.0000 0 - 3144 0 CS CS 0.000000 1.0000 0 - 3145 0 CS CS 0.000000 1.0000 0 - 3146 0 CS CS 0.000000 1.0000 0 - 3147 0 CS CS 0.000000 1.0000 0 - 3148 0 CS CS 0.000000 1.0000 0 - 3149 0 CS CS 0.000000 1.0000 0 - 3150 0 CS CS 0.000000 1.0000 0 - 3151 0 CS CS 0.000000 1.0000 0 - 3152 0 CS CS 0.000000 1.0000 0 - 3153 0 CS CS 0.000000 1.0000 0 - 3154 0 CS CS 0.000000 1.0000 0 - 3155 0 CS CS 0.000000 1.0000 0 - 3156 0 CS CS 0.000000 1.0000 0 - 3157 0 CS CS 0.000000 1.0000 0 - 3158 0 CS CS 0.000000 1.0000 0 - 3159 0 CS CS 0.000000 1.0000 0 - 3160 0 CS CS 0.000000 1.0000 0 - 3161 0 CS CS 0.000000 1.0000 0 - 3162 0 CS CS 0.000000 1.0000 0 - 3163 0 CS CS 0.000000 1.0000 0 - 3164 0 CS CS 0.000000 1.0000 0 - 3165 0 CS CS 0.000000 1.0000 0 - 3166 0 CS CS 0.000000 1.0000 0 - 3167 0 CS CS 0.000000 1.0000 0 - 3168 0 CS CS 0.000000 1.0000 0 - 3169 0 CS CS 0.000000 1.0000 0 - 3170 0 CS CS 0.000000 1.0000 0 - 3171 0 CS CS 0.000000 1.0000 0 - 3172 0 CS CS 0.000000 1.0000 0 - 3173 0 CS CS 0.000000 1.0000 0 - 3174 0 CS CS 0.000000 1.0000 0 - 3175 0 CS CS 0.000000 1.0000 0 - 3176 0 CS CS 0.000000 1.0000 0 - 3177 0 CS CS 0.000000 1.0000 0 - 3178 0 CS CS 0.000000 1.0000 0 - 3179 0 CS CS 0.000000 1.0000 0 - 3180 0 CS CS 0.000000 1.0000 0 - 3181 0 CS CS 0.000000 1.0000 0 - 3182 0 CS CS 0.000000 1.0000 0 - 3183 0 CS CS 0.000000 1.0000 0 - 3184 0 CS CS 0.000000 1.0000 0 - 3185 0 CS CS 0.000000 1.0000 0 - 3186 0 CS CS 0.000000 1.0000 0 - 3187 0 CS CS 0.000000 1.0000 0 - 3188 0 CS CS 0.000000 1.0000 0 - 3189 0 CS CS 0.000000 1.0000 0 - 3190 0 CS CS 0.000000 1.0000 0 - 3191 0 CS CS 0.000000 1.0000 0 - 3192 0 CS CS 0.000000 1.0000 0 - 3193 0 CS CS 0.000000 1.0000 0 - 3194 0 CS CS 0.000000 1.0000 0 - 3195 0 CS CS 0.000000 1.0000 0 - 3196 0 CS CS 0.000000 1.0000 0 - 3197 0 CS CS 0.000000 1.0000 0 - 3198 0 CS CS 0.000000 1.0000 0 - 3199 0 CS CS 0.000000 1.0000 0 - 3200 0 CS CS 0.000000 1.0000 0 - 3201 0 CS CS 0.000000 1.0000 0 - 3202 0 CS CS 0.000000 1.0000 0 - 3203 0 CS CS 0.000000 1.0000 0 - 3204 0 CS CS 0.000000 1.0000 0 - 3205 0 CS CS 0.000000 1.0000 0 - 3206 0 CS CS 0.000000 1.0000 0 - 3207 0 CS CS 0.000000 1.0000 0 - 3208 0 CS CS 0.000000 1.0000 0 - 3209 0 CS CS 0.000000 1.0000 0 - 3210 0 CS CS 0.000000 1.0000 0 - 3211 0 CS CS 0.000000 1.0000 0 - 3212 0 CS CS 0.000000 1.0000 0 - 3213 0 CS CS 0.000000 1.0000 0 - 3214 0 CS CS 0.000000 1.0000 0 - 3215 0 CS CS 0.000000 1.0000 0 - 3216 0 CS CS 0.000000 1.0000 0 - 3217 0 CS CS 0.000000 1.0000 0 - 3218 0 CS CS 0.000000 1.0000 0 - 3219 0 CS CS 0.000000 1.0000 0 - 3220 0 CS CS 0.000000 1.0000 0 - 3221 0 CS CS 0.000000 1.0000 0 - 3222 0 CS CS 0.000000 1.0000 0 - 3223 0 CS CS 0.000000 1.0000 0 - 3224 0 CS CS 0.000000 1.0000 0 - 3225 0 CS CS 0.000000 1.0000 0 - 3226 0 CS CS 0.000000 1.0000 0 - 3227 0 CS CS 0.000000 1.0000 0 - 3228 0 CS CS 0.000000 1.0000 0 - 3229 0 CS CS 0.000000 1.0000 0 - 3230 0 CS CS 0.000000 1.0000 0 - 3231 0 CS CS 0.000000 1.0000 0 - 3232 0 CS CS 0.000000 1.0000 0 - 3233 0 CS CS 0.000000 1.0000 0 - 3234 0 CS CS 0.000000 1.0000 0 - 3235 0 CS CS 0.000000 1.0000 0 - 3236 0 CS CS 0.000000 1.0000 0 - 3237 0 CS CS 0.000000 1.0000 0 - 3238 0 CS CS 0.000000 1.0000 0 - 3239 0 CS CS 0.000000 1.0000 0 - 3240 0 CS CS 0.000000 1.0000 0 - 3241 0 CS CS 0.000000 1.0000 0 - 3242 0 CS CS 0.000000 1.0000 0 - 3243 0 CS CS 0.000000 1.0000 0 - 3244 0 CS CS 0.000000 1.0000 0 - 3245 0 CS CS 0.000000 1.0000 0 - 3246 0 CS CS 0.000000 1.0000 0 - 3247 0 CS CS 0.000000 1.0000 0 - 3248 0 CS CS 0.000000 1.0000 0 - 3249 0 CS CS 0.000000 1.0000 0 - 3250 0 CS CS 0.000000 1.0000 0 - 3251 0 CS CS 0.000000 1.0000 0 - 3252 0 CS CS 0.000000 1.0000 0 - 3253 0 CS CS 0.000000 1.0000 0 - 3254 0 CS CS 0.000000 1.0000 0 - 3255 0 CS CS 0.000000 1.0000 0 - 3256 0 CS CS 0.000000 1.0000 0 - 3257 0 CS CS 0.000000 1.0000 0 - 3258 0 CS CS 0.000000 1.0000 0 - 3259 0 CS CS 0.000000 1.0000 0 - 3260 0 CS CS 0.000000 1.0000 0 - 3261 0 CS CS 0.000000 1.0000 0 - 3262 0 CS CS 0.000000 1.0000 0 - 3263 0 CS CS 0.000000 1.0000 0 - 3264 0 CS CS 0.000000 1.0000 0 - 3265 0 CS CS 0.000000 1.0000 0 - 3266 0 CS CS 0.000000 1.0000 0 - 3267 0 CS CS 0.000000 1.0000 0 - 3268 0 CS CS 0.000000 1.0000 0 - 3269 0 CS CS 0.000000 1.0000 0 - 3270 0 CS CS 0.000000 1.0000 0 - 3271 0 CS CS 0.000000 1.0000 0 - 3272 0 CS CS 0.000000 1.0000 0 - 3273 0 CS CS 0.000000 1.0000 0 - 3274 0 CS CS 0.000000 1.0000 0 - 3275 0 CS CS 0.000000 1.0000 0 - 3276 0 CS CS 0.000000 1.0000 0 - 3277 0 CS CS 0.000000 1.0000 0 - 3278 0 CS CS 0.000000 1.0000 0 - 3279 0 CS CS 0.000000 1.0000 0 - 3280 0 CS CS 0.000000 1.0000 0 - 3281 0 CS CS 0.000000 1.0000 0 - 3282 0 CS CS 0.000000 1.0000 0 - 3283 0 CS CS 0.000000 1.0000 0 - 3284 0 CS CS 0.000000 1.0000 0 - 3285 0 CS CS 0.000000 1.0000 0 - 3286 0 CS CS 0.000000 1.0000 0 - 3287 0 CS CS 0.000000 1.0000 0 - 3288 0 CS CS 0.000000 1.0000 0 - 3289 0 CS CS 0.000000 1.0000 0 - 3290 0 CS CS 0.000000 1.0000 0 - 3291 0 CS CS 0.000000 1.0000 0 - 3292 0 CS CS 0.000000 1.0000 0 - 3293 0 CS CS 0.000000 1.0000 0 - 3294 0 CS CS 0.000000 1.0000 0 - 3295 0 CS CS 0.000000 1.0000 0 - 3296 0 CS CS 0.000000 1.0000 0 - 3297 0 CS CS 0.000000 1.0000 0 - 3298 0 CS CS 0.000000 1.0000 0 - 3299 0 CS CS 0.000000 1.0000 0 - 3300 0 CS CS 0.000000 1.0000 0 - 3301 0 CS CS 0.000000 1.0000 0 - 3302 0 CS CS 0.000000 1.0000 0 - 3303 0 CS CS 0.000000 1.0000 0 - 3304 0 CS CS 0.000000 1.0000 0 - 3305 0 CS CS 0.000000 1.0000 0 - 3306 0 CS CS 0.000000 1.0000 0 - 3307 0 CS CS 0.000000 1.0000 0 - 3308 0 CS CS 0.000000 1.0000 0 - 3309 0 CS CS 0.000000 1.0000 0 - 3310 0 CS CS 0.000000 1.0000 0 - 3311 0 CS CS 0.000000 1.0000 0 - 3312 0 CS CS 0.000000 1.0000 0 - 3313 0 CS CS 0.000000 1.0000 0 - 3314 0 CS CS 0.000000 1.0000 0 - 3315 0 CS CS 0.000000 1.0000 0 - 3316 0 CS CS 0.000000 1.0000 0 - 3317 0 CS CS 0.000000 1.0000 0 - 3318 0 CS CS 0.000000 1.0000 0 - 3319 0 CS CS 0.000000 1.0000 0 - 3320 0 CS CS 0.000000 1.0000 0 - 3321 0 CS CS 0.000000 1.0000 0 - 3322 0 CS CS 0.000000 1.0000 0 - 3323 0 CS CS 0.000000 1.0000 0 - 3324 0 CS CS 0.000000 1.0000 0 - 3325 0 CS CS 0.000000 1.0000 0 - 3326 0 CS CS 0.000000 1.0000 0 - 3327 0 CS CS 0.000000 1.0000 0 - 3328 0 CS CS 0.000000 1.0000 0 - 3329 0 CS CS 0.000000 1.0000 0 - 3330 0 CS CS 0.000000 1.0000 0 - 3331 0 CS CS 0.000000 1.0000 0 - 3332 0 CS CS 0.000000 1.0000 0 - 3333 0 CS CS 0.000000 1.0000 0 - 3334 0 CS CS 0.000000 1.0000 0 - 3335 0 CS CS 0.000000 1.0000 0 - 3336 0 CS CS 0.000000 1.0000 0 - 3337 0 CS CS 0.000000 1.0000 0 - 3338 0 CS CS 0.000000 1.0000 0 - 3339 0 CS CS 0.000000 1.0000 0 - 3340 0 CS CS 0.000000 1.0000 0 - 3341 0 CS CS 0.000000 1.0000 0 - 3342 0 CS CS 0.000000 1.0000 0 - 3343 0 CS CS 0.000000 1.0000 0 - 3344 0 CS CS 0.000000 1.0000 0 - 3345 0 CS CS 0.000000 1.0000 0 - 3346 0 CS CS 0.000000 1.0000 0 - 3347 0 CS CS 0.000000 1.0000 0 - 3348 0 CS CS 0.000000 1.0000 0 - 3349 0 CS CS 0.000000 1.0000 0 - 3350 0 CS CS 0.000000 1.0000 0 - 3351 0 CS CS 0.000000 1.0000 0 - 3352 0 CS CS 0.000000 1.0000 0 - 3353 0 CS CS 0.000000 1.0000 0 - 3354 0 CS CS 0.000000 1.0000 0 - 3355 0 CS CS 0.000000 1.0000 0 - 3356 0 CS CS 0.000000 1.0000 0 - 3357 0 CS CS 0.000000 1.0000 0 - 3358 0 CS CS 0.000000 1.0000 0 - 3359 0 CS CS 0.000000 1.0000 0 - 3360 0 CS CS 0.000000 1.0000 0 - 3361 0 CS CS 0.000000 1.0000 0 - 3362 0 CS CS 0.000000 1.0000 0 - 3363 0 CS CS 0.000000 1.0000 0 - 3364 0 CS CS 0.000000 1.0000 0 - 3365 0 CS CS 0.000000 1.0000 0 - 3366 0 CS CS 0.000000 1.0000 0 - 3367 0 CS CS 0.000000 1.0000 0 - 3368 0 CS CS 0.000000 1.0000 0 - 3369 0 CS CS 0.000000 1.0000 0 - 3370 0 CS CS 0.000000 1.0000 0 - 3371 0 CS CS 0.000000 1.0000 0 - 3372 0 CS CS 0.000000 1.0000 0 - 3373 0 CS CS 0.000000 1.0000 0 - 3374 0 CS CS 0.000000 1.0000 0 - 3375 0 CS CS 0.000000 1.0000 0 - 3376 0 CS CS 0.000000 1.0000 0 - 3377 0 CS CS 0.000000 1.0000 0 - 3378 0 CS CS 0.000000 1.0000 0 - 3379 0 CS CS 0.000000 1.0000 0 - 3380 0 CS CS 0.000000 1.0000 0 - 3381 0 CS CS 0.000000 1.0000 0 - 3382 0 CS CS 0.000000 1.0000 0 - 3383 0 CS CS 0.000000 1.0000 0 - 3384 0 CS CS 0.000000 1.0000 0 - 3385 0 CS CS 0.000000 1.0000 0 - 3386 0 CS CS 0.000000 1.0000 0 - 3387 0 CS CS 0.000000 1.0000 0 - 3388 0 CS CS 0.000000 1.0000 0 - 3389 0 CS CS 0.000000 1.0000 0 - 3390 0 CS CS 0.000000 1.0000 0 - 3391 0 CS CS 0.000000 1.0000 0 - 3392 0 CS CS 0.000000 1.0000 0 - 3393 0 CS CS 0.000000 1.0000 0 - 3394 0 CS CS 0.000000 1.0000 0 - 3395 0 CS CS 0.000000 1.0000 0 - 3396 0 CS CS 0.000000 1.0000 0 - 3397 0 CS CS 0.000000 1.0000 0 - 3398 0 CS CS 0.000000 1.0000 0 - 3399 0 CS CS 0.000000 1.0000 0 - 3400 0 CS CS 0.000000 1.0000 0 - 3401 0 CS CS 0.000000 1.0000 0 - 3402 0 CS CS 0.000000 1.0000 0 - 3403 0 CS CS 0.000000 1.0000 0 - 3404 0 CS CS 0.000000 1.0000 0 - 3405 0 CS CS 0.000000 1.0000 0 - 3406 0 CS CS 0.000000 1.0000 0 - 3407 0 CS CS 0.000000 1.0000 0 - 3408 0 CS CS 0.000000 1.0000 0 - 3409 0 CS CS 0.000000 1.0000 0 - 3410 0 CS CS 0.000000 1.0000 0 - 3411 0 CS CS 0.000000 1.0000 0 - 3412 0 CS CS 0.000000 1.0000 0 - 3413 0 CS CS 0.000000 1.0000 0 - 3414 0 CS CS 0.000000 1.0000 0 - 3415 0 CS CS 0.000000 1.0000 0 - 3416 0 CS CS 0.000000 1.0000 0 - 3417 0 CS CS 0.000000 1.0000 0 - 3418 0 CS CS 0.000000 1.0000 0 - 3419 0 CS CS 0.000000 1.0000 0 - 3420 0 CS CS 0.000000 1.0000 0 - 3421 0 CS CS 0.000000 1.0000 0 - 3422 0 CS CS 0.000000 1.0000 0 - 3423 0 CS CS 0.000000 1.0000 0 - 3424 0 CS CS 0.000000 1.0000 0 - 3425 0 CS CS 0.000000 1.0000 0 - 3426 0 CS CS 0.000000 1.0000 0 - 3427 0 CS CS 0.000000 1.0000 0 - 3428 0 CS CS 0.000000 1.0000 0 - 3429 0 CS CS 0.000000 1.0000 0 - 3430 0 CS CS 0.000000 1.0000 0 - 3431 0 CS CS 0.000000 1.0000 0 - 3432 0 CS CS 0.000000 1.0000 0 - 3433 0 CS CS 0.000000 1.0000 0 - 3434 0 CS CS 0.000000 1.0000 0 - 3435 0 CS CS 0.000000 1.0000 0 - 3436 0 CS CS 0.000000 1.0000 0 - 3437 0 CS CS 0.000000 1.0000 0 - 3438 0 CS CS 0.000000 1.0000 0 - 3439 0 CS CS 0.000000 1.0000 0 - 3440 0 CS CS 0.000000 1.0000 0 - 3441 0 CS CS 0.000000 1.0000 0 - 3442 0 CS CS 0.000000 1.0000 0 - 3443 0 CS CS 0.000000 1.0000 0 - 3444 0 CS CS 0.000000 1.0000 0 - 3445 0 CS CS 0.000000 1.0000 0 - 3446 0 CS CS 0.000000 1.0000 0 - 3447 0 CS CS 0.000000 1.0000 0 - 3448 0 CS CS 0.000000 1.0000 0 - 3449 0 CS CS 0.000000 1.0000 0 - 3450 0 CS CS 0.000000 1.0000 0 - 3451 0 CS CS 0.000000 1.0000 0 - 3452 0 CS CS 0.000000 1.0000 0 - 3453 0 CS CS 0.000000 1.0000 0 - 3454 0 CS CS 0.000000 1.0000 0 - 3455 0 CS CS 0.000000 1.0000 0 - 3456 0 CS CS 0.000000 1.0000 0 - 3457 0 CS CS 0.000000 1.0000 0 - 3458 0 CS CS 0.000000 1.0000 0 - 3459 0 CS CS 0.000000 1.0000 0 - 3460 0 CS CS 0.000000 1.0000 0 - 3461 0 CS CS 0.000000 1.0000 0 - 3462 0 CS CS 0.000000 1.0000 0 - 3463 0 CS CS 0.000000 1.0000 0 - 3464 0 CS CS 0.000000 1.0000 0 - 3465 0 CS CS 0.000000 1.0000 0 - 3466 0 CS CS 0.000000 1.0000 0 - 3467 0 CS CS 0.000000 1.0000 0 - 3468 0 CS CS 0.000000 1.0000 0 - 3469 0 CS CS 0.000000 1.0000 0 - 3470 0 CS CS 0.000000 1.0000 0 - 3471 0 CS CS 0.000000 1.0000 0 - 3472 0 CS CS 0.000000 1.0000 0 - 3473 0 CS CS 0.000000 1.0000 0 - 3474 0 CS CS 0.000000 1.0000 0 - 3475 0 CS CS 0.000000 1.0000 0 - 3476 0 CS CS 0.000000 1.0000 0 - 3477 0 CS CS 0.000000 1.0000 0 - 3478 0 CS CS 0.000000 1.0000 0 - 3479 0 CS CS 0.000000 1.0000 0 - 3480 0 CS CS 0.000000 1.0000 0 - 3481 0 CS CS 0.000000 1.0000 0 - 3482 0 CS CS 0.000000 1.0000 0 - 3483 0 CS CS 0.000000 1.0000 0 - 3484 0 CS CS 0.000000 1.0000 0 - 3485 0 CS CS 0.000000 1.0000 0 - 3486 0 CS CS 0.000000 1.0000 0 - 3487 0 CS CS 0.000000 1.0000 0 - 3488 0 CS CS 0.000000 1.0000 0 - 3489 0 CS CS 0.000000 1.0000 0 - 3490 0 CS CS 0.000000 1.0000 0 - 3491 0 CS CS 0.000000 1.0000 0 - 3492 0 CS CS 0.000000 1.0000 0 - 3493 0 CS CS 0.000000 1.0000 0 - 3494 0 CS CS 0.000000 1.0000 0 - 3495 0 CS CS 0.000000 1.0000 0 - 3496 0 CS CS 0.000000 1.0000 0 - 3497 0 CS CS 0.000000 1.0000 0 - 3498 0 CS CS 0.000000 1.0000 0 - 3499 0 CS CS 0.000000 1.0000 0 - 3500 0 CS CS 0.000000 1.0000 0 - 3501 0 CS CS 0.000000 1.0000 0 - 3502 0 CS CS 0.000000 1.0000 0 - 3503 0 CS CS 0.000000 1.0000 0 - 3504 0 CS CS 0.000000 1.0000 0 - 3505 0 CS CS 0.000000 1.0000 0 - 3506 0 CS CS 0.000000 1.0000 0 - 3507 0 CS CS 0.000000 1.0000 0 - 3508 0 CS CS 0.000000 1.0000 0 - 3509 0 CS CS 0.000000 1.0000 0 - 3510 0 CS CS 0.000000 1.0000 0 - 3511 0 CS CS 0.000000 1.0000 0 - 3512 0 CS CS 0.000000 1.0000 0 - 3513 0 CS CS 0.000000 1.0000 0 - 3514 0 CS CS 0.000000 1.0000 0 - 3515 0 CS CS 0.000000 1.0000 0 - 3516 0 CS CS 0.000000 1.0000 0 - 3517 0 CS CS 0.000000 1.0000 0 - 3518 0 CS CS 0.000000 1.0000 0 - 3519 0 CS CS 0.000000 1.0000 0 - 3520 0 CS CS 0.000000 1.0000 0 - 3521 0 CS CS 0.000000 1.0000 0 - 3522 0 CS CS 0.000000 1.0000 0 - 3523 0 CS CS 0.000000 1.0000 0 - 3524 0 CS CS 0.000000 1.0000 0 - 3525 0 CS CS 0.000000 1.0000 0 - 3526 0 CS CS 0.000000 1.0000 0 - 3527 0 CS CS 0.000000 1.0000 0 - 3528 0 CS CS 0.000000 1.0000 0 - 3529 0 CS CS 0.000000 1.0000 0 - 3530 0 CS CS 0.000000 1.0000 0 - 3531 0 CS CS 0.000000 1.0000 0 - 3532 0 CS CS 0.000000 1.0000 0 - 3533 0 CS CS 0.000000 1.0000 0 - 3534 0 CS CS 0.000000 1.0000 0 - 3535 0 CS CS 0.000000 1.0000 0 - 3536 0 CS CS 0.000000 1.0000 0 - 3537 0 CS CS 0.000000 1.0000 0 - 3538 0 CS CS 0.000000 1.0000 0 - 3539 0 CS CS 0.000000 1.0000 0 - 3540 0 CS CS 0.000000 1.0000 0 - 3541 0 CS CS 0.000000 1.0000 0 - 3542 0 CS CS 0.000000 1.0000 0 - 3543 0 CS CS 0.000000 1.0000 0 - 3544 0 CS CS 0.000000 1.0000 0 - 3545 0 CS CS 0.000000 1.0000 0 - 3546 0 CS CS 0.000000 1.0000 0 - 3547 0 CS CS 0.000000 1.0000 0 - 3548 0 CS CS 0.000000 1.0000 0 - 3549 0 CS CS 0.000000 1.0000 0 - 3550 0 CS CS 0.000000 1.0000 0 - 3551 0 CS CS 0.000000 1.0000 0 - 3552 0 CS CS 0.000000 1.0000 0 - 3553 0 CS CS 0.000000 1.0000 0 - 3554 0 CS CS 0.000000 1.0000 0 - 3555 0 CS CS 0.000000 1.0000 0 - 3556 0 CS CS 0.000000 1.0000 0 - 3557 0 CS CS 0.000000 1.0000 0 - 3558 0 CS CS 0.000000 1.0000 0 - 3559 0 CS CS 0.000000 1.0000 0 - 3560 0 CS CS 0.000000 1.0000 0 - 3561 0 CS CS 0.000000 1.0000 0 - 3562 0 CS CS 0.000000 1.0000 0 - 3563 0 CS CS 0.000000 1.0000 0 - 3564 0 CS CS 0.000000 1.0000 0 - 3565 0 CS CS 0.000000 1.0000 0 - 3566 0 CS CS 0.000000 1.0000 0 - 3567 0 CS CS 0.000000 1.0000 0 - 3568 0 CS CS 0.000000 1.0000 0 - 3569 0 CS CS 0.000000 1.0000 0 - 3570 0 CS CS 0.000000 1.0000 0 - 3571 0 CS CS 0.000000 1.0000 0 - 3572 0 CS CS 0.000000 1.0000 0 - 3573 0 CS CS 0.000000 1.0000 0 - 3574 0 CS CS 0.000000 1.0000 0 - 3575 0 CS CS 0.000000 1.0000 0 - 3576 0 CS CS 0.000000 1.0000 0 - 3577 0 CS CS 0.000000 1.0000 0 - 3578 0 CS CS 0.000000 1.0000 0 - 3579 0 CS CS 0.000000 1.0000 0 - 3580 0 CS CS 0.000000 1.0000 0 - 3581 0 CS CS 0.000000 1.0000 0 - 3582 0 CS CS 0.000000 1.0000 0 - 3583 0 CS CS 0.000000 1.0000 0 - 3584 0 CS CS 0.000000 1.0000 0 - 3585 0 CS CS 0.000000 1.0000 0 - 3586 0 CS CS 0.000000 1.0000 0 - 3587 0 CS CS 0.000000 1.0000 0 - 3588 0 CS CS 0.000000 1.0000 0 - 3589 0 CS CS 0.000000 1.0000 0 - 3590 0 CS CS 0.000000 1.0000 0 - 3591 0 CS CS 0.000000 1.0000 0 - 3592 0 CS CS 0.000000 1.0000 0 - 3593 0 CS CS 0.000000 1.0000 0 - 3594 0 CS CS 0.000000 1.0000 0 - 3595 0 CS CS 0.000000 1.0000 0 - 3596 0 CS CS 0.000000 1.0000 0 - 3597 0 CS CS 0.000000 1.0000 0 - 3598 0 CS CS 0.000000 1.0000 0 - 3599 0 CS CS 0.000000 1.0000 0 - 3600 0 CS CS 0.000000 1.0000 0 - 3601 0 CS CS 0.000000 1.0000 0 - 3602 0 CS CS 0.000000 1.0000 0 - 3603 0 CS CS 0.000000 1.0000 0 - 3604 0 CS CS 0.000000 1.0000 0 - 3605 0 CS CS 0.000000 1.0000 0 - 3606 0 CS CS 0.000000 1.0000 0 - 3607 0 CS CS 0.000000 1.0000 0 - 3608 0 CS CS 0.000000 1.0000 0 - 3609 0 CS CS 0.000000 1.0000 0 - 3610 0 CS CS 0.000000 1.0000 0 - 3611 0 CS CS 0.000000 1.0000 0 - 3612 0 CS CS 0.000000 1.0000 0 - 3613 0 CS CS 0.000000 1.0000 0 - 3614 0 CS CS 0.000000 1.0000 0 - 3615 0 CS CS 0.000000 1.0000 0 - 3616 0 CS CS 0.000000 1.0000 0 - 3617 0 CS CS 0.000000 1.0000 0 - 3618 0 CS CS 0.000000 1.0000 0 - 3619 0 CS CS 0.000000 1.0000 0 - 3620 0 CS CS 0.000000 1.0000 0 - 3621 0 CS CS 0.000000 1.0000 0 - 3622 0 CS CS 0.000000 1.0000 0 - 3623 0 CS CS 0.000000 1.0000 0 - 3624 0 CS CS 0.000000 1.0000 0 - 3625 0 CS CS 0.000000 1.0000 0 - 3626 0 CS CS 0.000000 1.0000 0 - 3627 0 CS CS 0.000000 1.0000 0 - 3628 0 CS CS 0.000000 1.0000 0 - 3629 0 CS CS 0.000000 1.0000 0 - 3630 0 CS CS 0.000000 1.0000 0 - 3631 0 CS CS 0.000000 1.0000 0 - 3632 0 CS CS 0.000000 1.0000 0 - 3633 0 CS CS 0.000000 1.0000 0 - 3634 0 CS CS 0.000000 1.0000 0 - 3635 0 CS CS 0.000000 1.0000 0 - 3636 0 CS CS 0.000000 1.0000 0 - 3637 0 CS CS 0.000000 1.0000 0 - 3638 0 CS CS 0.000000 1.0000 0 - 3639 0 CS CS 0.000000 1.0000 0 - 3640 0 CS CS 0.000000 1.0000 0 - 3641 0 CS CS 0.000000 1.0000 0 - 3642 0 CS CS 0.000000 1.0000 0 - 3643 0 CS CS 0.000000 1.0000 0 - 3644 0 CS CS 0.000000 1.0000 0 - 3645 0 CS CS 0.000000 1.0000 0 - 3646 0 CS CS 0.000000 1.0000 0 - 3647 0 CS CS 0.000000 1.0000 0 - 3648 0 CS CS 0.000000 1.0000 0 - 3649 0 CS CS 0.000000 1.0000 0 - 3650 0 CS CS 0.000000 1.0000 0 - 3651 0 CS CS 0.000000 1.0000 0 - 3652 0 CS CS 0.000000 1.0000 0 - 3653 0 CS CS 0.000000 1.0000 0 - 3654 0 CS CS 0.000000 1.0000 0 - 3655 0 CS CS 0.000000 1.0000 0 - 3656 0 CS CS 0.000000 1.0000 0 - 3657 0 CS CS 0.000000 1.0000 0 - 3658 0 CS CS 0.000000 1.0000 0 - 3659 0 CS CS 0.000000 1.0000 0 - 3660 0 CS CS 0.000000 1.0000 0 - 3661 0 CS CS 0.000000 1.0000 0 - 3662 0 CS CS 0.000000 1.0000 0 - 3663 0 CS CS 0.000000 1.0000 0 - 3664 0 CS CS 0.000000 1.0000 0 - 3665 0 CS CS 0.000000 1.0000 0 - 3666 0 CS CS 0.000000 1.0000 0 - 3667 0 CS CS 0.000000 1.0000 0 - 3668 0 CS CS 0.000000 1.0000 0 - 3669 0 CS CS 0.000000 1.0000 0 - 3670 0 CS CS 0.000000 1.0000 0 - 3671 0 CS CS 0.000000 1.0000 0 - 3672 0 CS CS 0.000000 1.0000 0 - 3673 0 CS CS 0.000000 1.0000 0 - 3674 0 CS CS 0.000000 1.0000 0 - 3675 0 CS CS 0.000000 1.0000 0 - 3676 0 CS CS 0.000000 1.0000 0 - 3677 0 CS CS 0.000000 1.0000 0 - 3678 0 CS CS 0.000000 1.0000 0 - 3679 0 CS CS 0.000000 1.0000 0 - 3680 0 CS CS 0.000000 1.0000 0 - 3681 0 CS CS 0.000000 1.0000 0 - 3682 0 CS CS 0.000000 1.0000 0 - 3683 0 CS CS 0.000000 1.0000 0 - 3684 0 CS CS 0.000000 1.0000 0 - 3685 0 CS CS 0.000000 1.0000 0 - 3686 0 CS CS 0.000000 1.0000 0 - 3687 0 CS CS 0.000000 1.0000 0 - 3688 0 CS CS 0.000000 1.0000 0 - 3689 0 CS CS 0.000000 1.0000 0 - 3690 0 CS CS 0.000000 1.0000 0 - 3691 0 CS CS 0.000000 1.0000 0 - 3692 0 CS CS 0.000000 1.0000 0 - 3693 0 CS CS 0.000000 1.0000 0 - 3694 0 CS CS 0.000000 1.0000 0 - 3695 0 CS CS 0.000000 1.0000 0 - 3696 0 CS CS 0.000000 1.0000 0 - 3697 0 CS CS 0.000000 1.0000 0 - 3698 0 CS CS 0.000000 1.0000 0 - 3699 0 CS CS 0.000000 1.0000 0 - 3700 0 CS CS 0.000000 1.0000 0 - 3701 0 CS CS 0.000000 1.0000 0 - 3702 0 CS CS 0.000000 1.0000 0 - 3703 0 CS CS 0.000000 1.0000 0 - 3704 0 CS CS 0.000000 1.0000 0 - 3705 0 CS CS 0.000000 1.0000 0 - 3706 0 CS CS 0.000000 1.0000 0 - 3707 0 CS CS 0.000000 1.0000 0 - 3708 0 CS CS 0.000000 1.0000 0 - 3709 0 CS CS 0.000000 1.0000 0 - 3710 0 CS CS 0.000000 1.0000 0 - 3711 0 CS CS 0.000000 1.0000 0 - 3712 0 CS CS 0.000000 1.0000 0 - 3713 0 CS CS 0.000000 1.0000 0 - 3714 0 CS CS 0.000000 1.0000 0 - 3715 0 CS CS 0.000000 1.0000 0 - 3716 0 CS CS 0.000000 1.0000 0 - 3717 0 CS CS 0.000000 1.0000 0 - 3718 0 CS CS 0.000000 1.0000 0 - 3719 0 CS CS 0.000000 1.0000 0 - 3720 0 CS CS 0.000000 1.0000 0 - 3721 0 CS CS 0.000000 1.0000 0 - 3722 0 CS CS 0.000000 1.0000 0 - 3723 0 CS CS 0.000000 1.0000 0 - 3724 0 CS CS 0.000000 1.0000 0 - 3725 0 CS CS 0.000000 1.0000 0 - 3726 0 CS CS 0.000000 1.0000 0 - 3727 0 CS CS 0.000000 1.0000 0 - 3728 0 CS CS 0.000000 1.0000 0 - 3729 0 CS CS 0.000000 1.0000 0 - 3730 0 CS CS 0.000000 1.0000 0 - 3731 0 CS CS 0.000000 1.0000 0 - 3732 0 CS CS 0.000000 1.0000 0 - 3733 0 CS CS 0.000000 1.0000 0 - 3734 0 CS CS 0.000000 1.0000 0 - 3735 0 CS CS 0.000000 1.0000 0 - 3736 0 CS CS 0.000000 1.0000 0 - 3737 0 CS CS 0.000000 1.0000 0 - 3738 0 CS CS 0.000000 1.0000 0 - 3739 0 CS CS 0.000000 1.0000 0 - 3740 0 CS CS 0.000000 1.0000 0 - 3741 0 CS CS 0.000000 1.0000 0 - 3742 0 CS CS 0.000000 1.0000 0 - 3743 0 CS CS 0.000000 1.0000 0 - 3744 0 CS CS 0.000000 1.0000 0 - 3745 0 CS CS 0.000000 1.0000 0 - 3746 0 CS CS 0.000000 1.0000 0 - 3747 0 CS CS 0.000000 1.0000 0 - 3748 0 CS CS 0.000000 1.0000 0 - 3749 0 CS CS 0.000000 1.0000 0 - 3750 0 CS CS 0.000000 1.0000 0 - 3751 0 CS CS 0.000000 1.0000 0 - 3752 0 CS CS 0.000000 1.0000 0 - 3753 0 CS CS 0.000000 1.0000 0 - 3754 0 CS CS 0.000000 1.0000 0 - 3755 0 CS CS 0.000000 1.0000 0 - 3756 0 CS CS 0.000000 1.0000 0 - 3757 0 CS CS 0.000000 1.0000 0 - 3758 0 CS CS 0.000000 1.0000 0 - 3759 0 CS CS 0.000000 1.0000 0 - 3760 0 CS CS 0.000000 1.0000 0 - 3761 0 CS CS 0.000000 1.0000 0 - 3762 0 CS CS 0.000000 1.0000 0 - 3763 0 CS CS 0.000000 1.0000 0 - 3764 0 CS CS 0.000000 1.0000 0 - 3765 0 CS CS 0.000000 1.0000 0 - 3766 0 CS CS 0.000000 1.0000 0 - 3767 0 CS CS 0.000000 1.0000 0 - 3768 0 CS CS 0.000000 1.0000 0 - 3769 0 CS CS 0.000000 1.0000 0 - 3770 0 CS CS 0.000000 1.0000 0 - 3771 0 CS CS 0.000000 1.0000 0 - 3772 0 CS CS 0.000000 1.0000 0 - 3773 0 CS CS 0.000000 1.0000 0 - 3774 0 CS CS 0.000000 1.0000 0 - 3775 0 CS CS 0.000000 1.0000 0 - 3776 0 CS CS 0.000000 1.0000 0 - 3777 0 CS CS 0.000000 1.0000 0 - 3778 0 CS CS 0.000000 1.0000 0 - 3779 0 CS CS 0.000000 1.0000 0 - 3780 0 CS CS 0.000000 1.0000 0 - 3781 0 CS CS 0.000000 1.0000 0 - 3782 0 CS CS 0.000000 1.0000 0 - 3783 0 CS CS 0.000000 1.0000 0 - 3784 0 CS CS 0.000000 1.0000 0 - 3785 0 CS CS 0.000000 1.0000 0 - 3786 0 CS CS 0.000000 1.0000 0 - 3787 0 CS CS 0.000000 1.0000 0 - 3788 0 CS CS 0.000000 1.0000 0 - 3789 0 CS CS 0.000000 1.0000 0 - 3790 0 CS CS 0.000000 1.0000 0 - 3791 0 CS CS 0.000000 1.0000 0 - 3792 0 CS CS 0.000000 1.0000 0 - 3793 0 CS CS 0.000000 1.0000 0 - 3794 0 CS CS 0.000000 1.0000 0 - 3795 0 CS CS 0.000000 1.0000 0 - 3796 0 CS CS 0.000000 1.0000 0 - 3797 0 CS CS 0.000000 1.0000 0 - 3798 0 CS CS 0.000000 1.0000 0 - 3799 0 CS CS 0.000000 1.0000 0 - 3800 0 CS CS 0.000000 1.0000 0 - 3801 0 CS CS 0.000000 1.0000 0 - 3802 0 CS CS 0.000000 1.0000 0 - 3803 0 CS CS 0.000000 1.0000 0 - 3804 0 CS CS 0.000000 1.0000 0 - 3805 0 CS CS 0.000000 1.0000 0 - 3806 0 CS CS 0.000000 1.0000 0 - 3807 0 CS CS 0.000000 1.0000 0 - 3808 0 CS CS 0.000000 1.0000 0 - 3809 0 CS CS 0.000000 1.0000 0 - 3810 0 CS CS 0.000000 1.0000 0 - 3811 0 CS CS 0.000000 1.0000 0 - 3812 0 CS CS 0.000000 1.0000 0 - 3813 0 CS CS 0.000000 1.0000 0 - 3814 0 CS CS 0.000000 1.0000 0 - 3815 0 CS CS 0.000000 1.0000 0 - 3816 0 CS CS 0.000000 1.0000 0 - 3817 0 CS CS 0.000000 1.0000 0 - 3818 0 CS CS 0.000000 1.0000 0 - 3819 0 CS CS 0.000000 1.0000 0 - 3820 0 CS CS 0.000000 1.0000 0 - 3821 0 CS CS 0.000000 1.0000 0 - 3822 0 CS CS 0.000000 1.0000 0 - 3823 0 CS CS 0.000000 1.0000 0 - 3824 0 CS CS 0.000000 1.0000 0 - 3825 0 CS CS 0.000000 1.0000 0 - 3826 0 CS CS 0.000000 1.0000 0 - 3827 0 CS CS 0.000000 1.0000 0 - 3828 0 CS CS 0.000000 1.0000 0 - 3829 0 CS CS 0.000000 1.0000 0 - 3830 0 CS CS 0.000000 1.0000 0 - 3831 0 CS CS 0.000000 1.0000 0 - 3832 0 CS CS 0.000000 1.0000 0 - 3833 0 CS CS 0.000000 1.0000 0 - 3834 0 CS CS 0.000000 1.0000 0 - 3835 0 CS CS 0.000000 1.0000 0 - 3836 0 CS CS 0.000000 1.0000 0 - 3837 0 CS CS 0.000000 1.0000 0 - 3838 0 CS CS 0.000000 1.0000 0 - 3839 0 CS CS 0.000000 1.0000 0 - 3840 0 CS CS 0.000000 1.0000 0 - 3841 0 CS CS 0.000000 1.0000 0 - 3842 0 CS CS 0.000000 1.0000 0 - 3843 0 CS CS 0.000000 1.0000 0 - 3844 0 CS CS 0.000000 1.0000 0 - 3845 0 CS CS 0.000000 1.0000 0 - 3846 0 CS CS 0.000000 1.0000 0 - 3847 0 CS CS 0.000000 1.0000 0 - 3848 0 CS CS 0.000000 1.0000 0 - 3849 0 CS CS 0.000000 1.0000 0 - 3850 0 CS CS 0.000000 1.0000 0 - 3851 0 CS CS 0.000000 1.0000 0 - 3852 0 CS CS 0.000000 1.0000 0 - 3853 0 CS CS 0.000000 1.0000 0 - 3854 0 CS CS 0.000000 1.0000 0 - 3855 0 CS CS 0.000000 1.0000 0 - 3856 0 CS CS 0.000000 1.0000 0 - 3857 0 CS CS 0.000000 1.0000 0 - 3858 0 CS CS 0.000000 1.0000 0 - 3859 0 CS CS 0.000000 1.0000 0 - 3860 0 CS CS 0.000000 1.0000 0 - 3861 0 CS CS 0.000000 1.0000 0 - 3862 0 CS CS 0.000000 1.0000 0 - 3863 0 CS CS 0.000000 1.0000 0 - 3864 0 CS CS 0.000000 1.0000 0 - 3865 0 CS CS 0.000000 1.0000 0 - 3866 0 CS CS 0.000000 1.0000 0 - 3867 0 CS CS 0.000000 1.0000 0 - 3868 0 CS CS 0.000000 1.0000 0 - 3869 0 CS CS 0.000000 1.0000 0 - 3870 0 CS CS 0.000000 1.0000 0 - 3871 0 CS CS 0.000000 1.0000 0 - 3872 0 CS CS 0.000000 1.0000 0 - 3873 0 CS CS 0.000000 1.0000 0 - 3874 0 CS CS 0.000000 1.0000 0 - 3875 0 CS CS 0.000000 1.0000 0 - 3876 0 CS CS 0.000000 1.0000 0 - 3877 0 CS CS 0.000000 1.0000 0 - 3878 0 CS CS 0.000000 1.0000 0 - 3879 0 CS CS 0.000000 1.0000 0 - 3880 0 CS CS 0.000000 1.0000 0 - 3881 0 CS CS 0.000000 1.0000 0 - 3882 0 CS CS 0.000000 1.0000 0 - 3883 0 CS CS 0.000000 1.0000 0 - 3884 0 CS CS 0.000000 1.0000 0 - 3885 0 CS CS 0.000000 1.0000 0 - 3886 0 CS CS 0.000000 1.0000 0 - 3887 0 CS CS 0.000000 1.0000 0 - 3888 0 CS CS 0.000000 1.0000 0 - 3889 0 CS CS 0.000000 1.0000 0 - 3890 0 CS CS 0.000000 1.0000 0 - 3891 0 CS CS 0.000000 1.0000 0 - 3892 0 CS CS 0.000000 1.0000 0 - 3893 0 CS CS 0.000000 1.0000 0 - 3894 0 CS CS 0.000000 1.0000 0 - 3895 0 CS CS 0.000000 1.0000 0 - 3896 0 CS CS 0.000000 1.0000 0 - 3897 0 CS CS 0.000000 1.0000 0 - 3898 0 CS CS 0.000000 1.0000 0 - 3899 0 CS CS 0.000000 1.0000 0 - 3900 0 CS CS 0.000000 1.0000 0 - 3901 0 CS CS 0.000000 1.0000 0 - 3902 0 CS CS 0.000000 1.0000 0 - 3903 0 CS CS 0.000000 1.0000 0 - 3904 0 CS CS 0.000000 1.0000 0 - 3905 0 CS CS 0.000000 1.0000 0 - 3906 0 CS CS 0.000000 1.0000 0 - 3907 0 CS CS 0.000000 1.0000 0 - 3908 0 CS CS 0.000000 1.0000 0 - 3909 0 CS CS 0.000000 1.0000 0 - 3910 0 CS CS 0.000000 1.0000 0 - 3911 0 CS CS 0.000000 1.0000 0 - 3912 0 CS CS 0.000000 1.0000 0 - 3913 0 CS CS 0.000000 1.0000 0 - 3914 0 CS CS 0.000000 1.0000 0 - 3915 0 CS CS 0.000000 1.0000 0 - 3916 0 CS CS 0.000000 1.0000 0 - 3917 0 CS CS 0.000000 1.0000 0 - 3918 0 CS CS 0.000000 1.0000 0 - 3919 0 CS CS 0.000000 1.0000 0 - 3920 0 CS CS 0.000000 1.0000 0 - 3921 0 CS CS 0.000000 1.0000 0 - 3922 0 CS CS 0.000000 1.0000 0 - 3923 0 CS CS 0.000000 1.0000 0 - 3924 0 CS CS 0.000000 1.0000 0 - 3925 0 CS CS 0.000000 1.0000 0 - 3926 0 CS CS 0.000000 1.0000 0 - 3927 0 CS CS 0.000000 1.0000 0 - 3928 0 CS CS 0.000000 1.0000 0 - 3929 0 CS CS 0.000000 1.0000 0 - 3930 0 CS CS 0.000000 1.0000 0 - 3931 0 CS CS 0.000000 1.0000 0 - 3932 0 CS CS 0.000000 1.0000 0 - 3933 0 CS CS 0.000000 1.0000 0 - 3934 0 CS CS 0.000000 1.0000 0 - 3935 0 CS CS 0.000000 1.0000 0 - 3936 0 CS CS 0.000000 1.0000 0 - 3937 0 CS CS 0.000000 1.0000 0 - 3938 0 CS CS 0.000000 1.0000 0 - 3939 0 CS CS 0.000000 1.0000 0 - 3940 0 CS CS 0.000000 1.0000 0 - 3941 0 CS CS 0.000000 1.0000 0 - 3942 0 CS CS 0.000000 1.0000 0 - 3943 0 CS CS 0.000000 1.0000 0 - 3944 0 CS CS 0.000000 1.0000 0 - 3945 0 CS CS 0.000000 1.0000 0 - 3946 0 CS CS 0.000000 1.0000 0 - 3947 0 CS CS 0.000000 1.0000 0 - 3948 0 CS CS 0.000000 1.0000 0 - 3949 0 CS CS 0.000000 1.0000 0 - 3950 0 CS CS 0.000000 1.0000 0 - 3951 0 CS CS 0.000000 1.0000 0 - 3952 0 CS CS 0.000000 1.0000 0 - 3953 0 CS CS 0.000000 1.0000 0 - 3954 0 CS CS 0.000000 1.0000 0 - 3955 0 CS CS 0.000000 1.0000 0 - 3956 0 CS CS 0.000000 1.0000 0 - 3957 0 CS CS 0.000000 1.0000 0 - 3958 0 CS CS 0.000000 1.0000 0 - 3959 0 CS CS 0.000000 1.0000 0 - 3960 0 CS CS 0.000000 1.0000 0 - 3961 0 CS CS 0.000000 1.0000 0 - 3962 0 CS CS 0.000000 1.0000 0 - 3963 0 CS CS 0.000000 1.0000 0 - 3964 0 CS CS 0.000000 1.0000 0 - 3965 0 CS CS 0.000000 1.0000 0 - 3966 0 CS CS 0.000000 1.0000 0 - 3967 0 CS CS 0.000000 1.0000 0 - 3968 0 CS CS 0.000000 1.0000 0 - 3969 0 CS CS 0.000000 1.0000 0 - 3970 0 CS CS 0.000000 1.0000 0 - 3971 0 CS CS 0.000000 1.0000 0 - 3972 0 CS CS 0.000000 1.0000 0 - 3973 0 CS CS 0.000000 1.0000 0 - 3974 0 CS CS 0.000000 1.0000 0 - 3975 0 CS CS 0.000000 1.0000 0 - 3976 0 CS CS 0.000000 1.0000 0 - 3977 0 CS CS 0.000000 1.0000 0 - 3978 0 CS CS 0.000000 1.0000 0 - 3979 0 CS CS 0.000000 1.0000 0 - 3980 0 CS CS 0.000000 1.0000 0 - 3981 0 CS CS 0.000000 1.0000 0 - 3982 0 CS CS 0.000000 1.0000 0 - 3983 0 CS CS 0.000000 1.0000 0 - 3984 0 CS CS 0.000000 1.0000 0 - 3985 0 CS CS 0.000000 1.0000 0 - 3986 0 CS CS 0.000000 1.0000 0 - 3987 0 CS CS 0.000000 1.0000 0 - 3988 0 CS CS 0.000000 1.0000 0 - 3989 0 CS CS 0.000000 1.0000 0 - 3990 0 CS CS 0.000000 1.0000 0 - 3991 0 CS CS 0.000000 1.0000 0 - 3992 0 CS CS 0.000000 1.0000 0 - 3993 0 CS CS 0.000000 1.0000 0 - 3994 0 CS CS 0.000000 1.0000 0 - 3995 0 CS CS 0.000000 1.0000 0 - 3996 0 CS CS 0.000000 1.0000 0 - 3997 0 CS CS 0.000000 1.0000 0 - 3998 0 CS CS 0.000000 1.0000 0 - 3999 0 CS CS 0.000000 1.0000 0 - 4000 0 CS CS 0.000000 1.0000 0 - 4001 0 CS CS 0.000000 1.0000 0 - 4002 0 CS CS 0.000000 1.0000 0 - 4003 0 CS CS 0.000000 1.0000 0 - 4004 0 CS CS 0.000000 1.0000 0 - 4005 0 CS CS 0.000000 1.0000 0 - 4006 0 CS CS 0.000000 1.0000 0 - 4007 0 CS CS 0.000000 1.0000 0 - 4008 0 CS CS 0.000000 1.0000 0 - 4009 0 CS CS 0.000000 1.0000 0 - 4010 0 CS CS 0.000000 1.0000 0 - 4011 0 CS CS 0.000000 1.0000 0 - 4012 0 CS CS 0.000000 1.0000 0 - 4013 0 CS CS 0.000000 1.0000 0 - 4014 0 CS CS 0.000000 1.0000 0 - 4015 0 CS CS 0.000000 1.0000 0 - 4016 0 CS CS 0.000000 1.0000 0 - 4017 0 CS CS 0.000000 1.0000 0 - 4018 0 CS CS 0.000000 1.0000 0 - 4019 0 CS CS 0.000000 1.0000 0 - 4020 0 CS CS 0.000000 1.0000 0 - 4021 0 CS CS 0.000000 1.0000 0 - 4022 0 CS CS 0.000000 1.0000 0 - 4023 0 CS CS 0.000000 1.0000 0 - 4024 0 CS CS 0.000000 1.0000 0 - 4025 0 CS CS 0.000000 1.0000 0 - 4026 0 CS CS 0.000000 1.0000 0 - 4027 0 CS CS 0.000000 1.0000 0 - 4028 0 CS CS 0.000000 1.0000 0 - 4029 0 CS CS 0.000000 1.0000 0 - 4030 0 CS CS 0.000000 1.0000 0 - 4031 0 CS CS 0.000000 1.0000 0 - 4032 0 CS CS 0.000000 1.0000 0 - 4033 0 CS CS 0.000000 1.0000 0 - 4034 0 CS CS 0.000000 1.0000 0 - 4035 0 CS CS 0.000000 1.0000 0 - 4036 0 CS CS 0.000000 1.0000 0 - 4037 0 CS CS 0.000000 1.0000 0 - 4038 0 CS CS 0.000000 1.0000 0 - 4039 0 CS CS 0.000000 1.0000 0 - 4040 0 CS CS 0.000000 1.0000 0 - 4041 0 CS CS 0.000000 1.0000 0 - 4042 0 CS CS 0.000000 1.0000 0 - 4043 0 CS CS 0.000000 1.0000 0 - 4044 0 CS CS 0.000000 1.0000 0 - 4045 0 CS CS 0.000000 1.0000 0 - 4046 0 CS CS 0.000000 1.0000 0 - 4047 0 CS CS 0.000000 1.0000 0 - 4048 0 CS CS 0.000000 1.0000 0 - 4049 0 CS CS 0.000000 1.0000 0 - 4050 0 CS CS 0.000000 1.0000 0 - 4051 0 CS CS 0.000000 1.0000 0 - 4052 0 CS CS 0.000000 1.0000 0 - 4053 0 CS CS 0.000000 1.0000 0 - 4054 0 CS CS 0.000000 1.0000 0 - 4055 0 CS CS 0.000000 1.0000 0 - 4056 0 CS CS 0.000000 1.0000 0 - 4057 0 CS CS 0.000000 1.0000 0 - 4058 0 CS CS 0.000000 1.0000 0 - 4059 0 CS CS 0.000000 1.0000 0 - 4060 0 CS CS 0.000000 1.0000 0 - 4061 0 CS CS 0.000000 1.0000 0 - 4062 0 CS CS 0.000000 1.0000 0 - 4063 0 CS CS 0.000000 1.0000 0 - 4064 0 CS CS 0.000000 1.0000 0 - 4065 0 CS CS 0.000000 1.0000 0 - 4066 0 CS CS 0.000000 1.0000 0 - 4067 0 CS CS 0.000000 1.0000 0 - 4068 0 CS CS 0.000000 1.0000 0 - 4069 0 CS CS 0.000000 1.0000 0 - 4070 0 CS CS 0.000000 1.0000 0 - 4071 0 CS CS 0.000000 1.0000 0 - 4072 0 CS CS 0.000000 1.0000 0 - 4073 0 CS CS 0.000000 1.0000 0 - 4074 0 CS CS 0.000000 1.0000 0 - 4075 0 CS CS 0.000000 1.0000 0 - 4076 0 CS CS 0.000000 1.0000 0 - 4077 0 CS CS 0.000000 1.0000 0 - 4078 0 CS CS 0.000000 1.0000 0 - 4079 0 CS CS 0.000000 1.0000 0 - 4080 0 CS CS 0.000000 1.0000 0 - 4081 0 CS CS 0.000000 1.0000 0 - 4082 0 CS CS 0.000000 1.0000 0 - 4083 0 CS CS 0.000000 1.0000 0 - 4084 0 CS CS 0.000000 1.0000 0 - 4085 0 CS CS 0.000000 1.0000 0 - 4086 0 CS CS 0.000000 1.0000 0 - 4087 0 CS CS 0.000000 1.0000 0 - 4088 0 CS CS 0.000000 1.0000 0 - 4089 0 CS CS 0.000000 1.0000 0 - 4090 0 CS CS 0.000000 1.0000 0 - 4091 0 CS CS 0.000000 1.0000 0 - 4092 0 CS CS 0.000000 1.0000 0 - 4093 0 CS CS 0.000000 1.0000 0 - 4094 0 CS CS 0.000000 1.0000 0 - 4095 0 CS CS 0.000000 1.0000 0 - 4096 0 CS CS 0.000000 1.0000 0 - 4097 0 CS CS 0.000000 1.0000 0 - 4098 0 CS CS 0.000000 1.0000 0 - 4099 0 CS CS 0.000000 1.0000 0 - 4100 0 CS CS 0.000000 1.0000 0 - 4101 0 CS CS 0.000000 1.0000 0 - 4102 0 CS CS 0.000000 1.0000 0 - 4103 0 CS CS 0.000000 1.0000 0 - 4104 0 CS CS 0.000000 1.0000 0 - 4105 0 CS CS 0.000000 1.0000 0 - 4106 0 CS CS 0.000000 1.0000 0 - 4107 0 CS CS 0.000000 1.0000 0 - 4108 0 CS CS 0.000000 1.0000 0 - 4109 0 CS CS 0.000000 1.0000 0 - 4110 0 CS CS 0.000000 1.0000 0 - 4111 0 CS CS 0.000000 1.0000 0 - 4112 0 CS CS 0.000000 1.0000 0 - 4113 0 CS CS 0.000000 1.0000 0 - 4114 0 CS CS 0.000000 1.0000 0 - 4115 0 CS CS 0.000000 1.0000 0 - 4116 0 CS CS 0.000000 1.0000 0 - 4117 0 CS CS 0.000000 1.0000 0 - 4118 0 CS CS 0.000000 1.0000 0 - 4119 0 CS CS 0.000000 1.0000 0 - 4120 0 CS CS 0.000000 1.0000 0 - 4121 0 CS CS 0.000000 1.0000 0 - 4122 0 CS CS 0.000000 1.0000 0 - 4123 0 CS CS 0.000000 1.0000 0 - 4124 0 CS CS 0.000000 1.0000 0 - 4125 0 CS CS 0.000000 1.0000 0 - 4126 0 CS CS 0.000000 1.0000 0 - 4127 0 CS CS 0.000000 1.0000 0 - 4128 0 CS CS 0.000000 1.0000 0 - 4129 0 CS CS 0.000000 1.0000 0 - 4130 0 CS CS 0.000000 1.0000 0 - 4131 0 CS CS 0.000000 1.0000 0 - 4132 0 CS CS 0.000000 1.0000 0 - 4133 0 CS CS 0.000000 1.0000 0 - 4134 0 CS CS 0.000000 1.0000 0 - 4135 0 CS CS 0.000000 1.0000 0 - 4136 0 CS CS 0.000000 1.0000 0 - 4137 0 CS CS 0.000000 1.0000 0 - 4138 0 CS CS 0.000000 1.0000 0 - 4139 0 CS CS 0.000000 1.0000 0 - 4140 0 CS CS 0.000000 1.0000 0 - 4141 0 CS CS 0.000000 1.0000 0 - 4142 0 CS CS 0.000000 1.0000 0 - 4143 0 CS CS 0.000000 1.0000 0 - 4144 0 CS CS 0.000000 1.0000 0 - 4145 0 CS CS 0.000000 1.0000 0 - 4146 0 CS CS 0.000000 1.0000 0 - 4147 0 CS CS 0.000000 1.0000 0 - 4148 0 CS CS 0.000000 1.0000 0 - 4149 0 CS CS 0.000000 1.0000 0 - 4150 0 CS CS 0.000000 1.0000 0 - 4151 0 CS CS 0.000000 1.0000 0 - 4152 0 CS CS 0.000000 1.0000 0 - 4153 0 CS CS 0.000000 1.0000 0 - 4154 0 CS CS 0.000000 1.0000 0 - 4155 0 CS CS 0.000000 1.0000 0 - 4156 0 CS CS 0.000000 1.0000 0 - 4157 0 CS CS 0.000000 1.0000 0 - 4158 0 CS CS 0.000000 1.0000 0 - 4159 0 CS CS 0.000000 1.0000 0 - 4160 0 CS CS 0.000000 1.0000 0 - 4161 0 CS CS 0.000000 1.0000 0 - 4162 0 CS CS 0.000000 1.0000 0 - 4163 0 CS CS 0.000000 1.0000 0 - 4164 0 CS CS 0.000000 1.0000 0 - 4165 0 CS CS 0.000000 1.0000 0 - 4166 0 CS CS 0.000000 1.0000 0 - 4167 0 CS CS 0.000000 1.0000 0 - 4168 0 CS CS 0.000000 1.0000 0 - 4169 0 CS CS 0.000000 1.0000 0 - 4170 0 CS CS 0.000000 1.0000 0 - 4171 0 CS CS 0.000000 1.0000 0 - 4172 0 CS CS 0.000000 1.0000 0 - 4173 0 CS CS 0.000000 1.0000 0 - 4174 0 CS CS 0.000000 1.0000 0 - 4175 0 CS CS 0.000000 1.0000 0 - 4176 0 CS CS 0.000000 1.0000 0 - 4177 0 CS CS 0.000000 1.0000 0 - 4178 0 CS CS 0.000000 1.0000 0 - 4179 0 CS CS 0.000000 1.0000 0 - 4180 0 CS CS 0.000000 1.0000 0 - 4181 0 CS CS 0.000000 1.0000 0 - 4182 0 CS CS 0.000000 1.0000 0 - 4183 0 CS CS 0.000000 1.0000 0 - 4184 0 CS CS 0.000000 1.0000 0 - 4185 0 CS CS 0.000000 1.0000 0 - 4186 0 CS CS 0.000000 1.0000 0 - 4187 0 CS CS 0.000000 1.0000 0 - 4188 0 CS CS 0.000000 1.0000 0 - 4189 0 CS CS 0.000000 1.0000 0 - 4190 0 CS CS 0.000000 1.0000 0 - 4191 0 CS CS 0.000000 1.0000 0 - 4192 0 CS CS 0.000000 1.0000 0 - 4193 0 CS CS 0.000000 1.0000 0 - 4194 0 CS CS 0.000000 1.0000 0 - 4195 0 CS CS 0.000000 1.0000 0 - 4196 0 CS CS 0.000000 1.0000 0 - 4197 0 CS CS 0.000000 1.0000 0 - 4198 0 CS CS 0.000000 1.0000 0 - 4199 0 CS CS 0.000000 1.0000 0 - 4200 0 CS CS 0.000000 1.0000 0 - 4201 0 CS CS 0.000000 1.0000 0 - 4202 0 CS CS 0.000000 1.0000 0 - 4203 0 CS CS 0.000000 1.0000 0 - 4204 0 CS CS 0.000000 1.0000 0 - 4205 0 CS CS 0.000000 1.0000 0 - 4206 0 CS CS 0.000000 1.0000 0 - 4207 0 CS CS 0.000000 1.0000 0 - 4208 0 CS CS 0.000000 1.0000 0 - 4209 0 CS CS 0.000000 1.0000 0 - 4210 0 CS CS 0.000000 1.0000 0 - 4211 0 CS CS 0.000000 1.0000 0 - 4212 0 CS CS 0.000000 1.0000 0 - 4213 0 CS CS 0.000000 1.0000 0 - 4214 0 CS CS 0.000000 1.0000 0 - 4215 0 CS CS 0.000000 1.0000 0 - 4216 0 CS CS 0.000000 1.0000 0 - 4217 0 CS CS 0.000000 1.0000 0 - 4218 0 CS CS 0.000000 1.0000 0 - 4219 0 CS CS 0.000000 1.0000 0 - 4220 0 CS CS 0.000000 1.0000 0 - 4221 0 CS CS 0.000000 1.0000 0 - 4222 0 CS CS 0.000000 1.0000 0 - 4223 0 CS CS 0.000000 1.0000 0 - 4224 0 CS CS 0.000000 1.0000 0 - 4225 0 CS CS 0.000000 1.0000 0 - 4226 0 CS CS 0.000000 1.0000 0 - 4227 0 CS CS 0.000000 1.0000 0 - 4228 0 CS CS 0.000000 1.0000 0 - 4229 0 CS CS 0.000000 1.0000 0 - 4230 0 CS CS 0.000000 1.0000 0 - 4231 0 CS CS 0.000000 1.0000 0 - 4232 0 CS CS 0.000000 1.0000 0 - 4233 0 CS CS 0.000000 1.0000 0 - 4234 0 CS CS 0.000000 1.0000 0 - 4235 0 CS CS 0.000000 1.0000 0 - 4236 0 CS CS 0.000000 1.0000 0 - 4237 0 CS CS 0.000000 1.0000 0 - 4238 0 CS CS 0.000000 1.0000 0 - 4239 0 CS CS 0.000000 1.0000 0 - 4240 0 CS CS 0.000000 1.0000 0 - 4241 0 CS CS 0.000000 1.0000 0 - 4242 0 CS CS 0.000000 1.0000 0 - 4243 0 CS CS 0.000000 1.0000 0 - 4244 0 CS CS 0.000000 1.0000 0 - 4245 0 CS CS 0.000000 1.0000 0 - 4246 0 CS CS 0.000000 1.0000 0 - 4247 0 CS CS 0.000000 1.0000 0 - 4248 0 CS CS 0.000000 1.0000 0 - 4249 0 CS CS 0.000000 1.0000 0 - 4250 0 CS CS 0.000000 1.0000 0 - 4251 0 CS CS 0.000000 1.0000 0 - 4252 0 CS CS 0.000000 1.0000 0 - 4253 0 CS CS 0.000000 1.0000 0 - 4254 0 CS CS 0.000000 1.0000 0 - 4255 0 CS CS 0.000000 1.0000 0 - 4256 0 CS CS 0.000000 1.0000 0 - 4257 0 CS CS 0.000000 1.0000 0 - 4258 0 CS CS 0.000000 1.0000 0 - 4259 0 CS CS 0.000000 1.0000 0 - 4260 0 CS CS 0.000000 1.0000 0 - 4261 0 CS CS 0.000000 1.0000 0 - 4262 0 CS CS 0.000000 1.0000 0 - 4263 0 CS CS 0.000000 1.0000 0 - 4264 0 CS CS 0.000000 1.0000 0 - 4265 0 CS CS 0.000000 1.0000 0 - 4266 0 CS CS 0.000000 1.0000 0 - 4267 0 CS CS 0.000000 1.0000 0 - 4268 0 CS CS 0.000000 1.0000 0 - 4269 0 CS CS 0.000000 1.0000 0 - 4270 0 CS CS 0.000000 1.0000 0 - 4271 0 CS CS 0.000000 1.0000 0 - 4272 0 CS CS 0.000000 1.0000 0 - 4273 0 CS CS 0.000000 1.0000 0 - 4274 0 CS CS 0.000000 1.0000 0 - 4275 0 CS CS 0.000000 1.0000 0 - 4276 0 CS CS 0.000000 1.0000 0 - 4277 0 CS CS 0.000000 1.0000 0 - 4278 0 CS CS 0.000000 1.0000 0 - 4279 0 CS CS 0.000000 1.0000 0 - 4280 0 CS CS 0.000000 1.0000 0 - 4281 0 CS CS 0.000000 1.0000 0 - 4282 0 CS CS 0.000000 1.0000 0 - 4283 0 CS CS 0.000000 1.0000 0 - 4284 0 CS CS 0.000000 1.0000 0 - 4285 0 CS CS 0.000000 1.0000 0 - 4286 0 CS CS 0.000000 1.0000 0 - 4287 0 CS CS 0.000000 1.0000 0 - 4288 0 CS CS 0.000000 1.0000 0 - 4289 0 CS CS 0.000000 1.0000 0 - 4290 0 CS CS 0.000000 1.0000 0 - 4291 0 CS CS 0.000000 1.0000 0 - 4292 0 CS CS 0.000000 1.0000 0 - 4293 0 CS CS 0.000000 1.0000 0 - 4294 0 CS CS 0.000000 1.0000 0 - 4295 0 CS CS 0.000000 1.0000 0 - 4296 0 CS CS 0.000000 1.0000 0 - 4297 0 CS CS 0.000000 1.0000 0 - 4298 0 CS CS 0.000000 1.0000 0 - 4299 0 CS CS 0.000000 1.0000 0 - 4300 0 CS CS 0.000000 1.0000 0 - 4301 0 CS CS 0.000000 1.0000 0 - 4302 0 CS CS 0.000000 1.0000 0 - 4303 0 CS CS 0.000000 1.0000 0 - 4304 0 CS CS 0.000000 1.0000 0 - 4305 0 CS CS 0.000000 1.0000 0 - 4306 0 CS CS 0.000000 1.0000 0 - 4307 0 CS CS 0.000000 1.0000 0 - 4308 0 CS CS 0.000000 1.0000 0 - 4309 0 CS CS 0.000000 1.0000 0 - 4310 0 CS CS 0.000000 1.0000 0 - 4311 0 CS CS 0.000000 1.0000 0 - 4312 0 CS CS 0.000000 1.0000 0 - 4313 0 CS CS 0.000000 1.0000 0 - 4314 0 CS CS 0.000000 1.0000 0 - 4315 0 CS CS 0.000000 1.0000 0 - 4316 0 CS CS 0.000000 1.0000 0 - 4317 0 CS CS 0.000000 1.0000 0 - 4318 0 CS CS 0.000000 1.0000 0 - 4319 0 CS CS 0.000000 1.0000 0 - 4320 0 CS CS 0.000000 1.0000 0 - 4321 0 CS CS 0.000000 1.0000 0 - 4322 0 CS CS 0.000000 1.0000 0 - 4323 0 CS CS 0.000000 1.0000 0 - 4324 0 CS CS 0.000000 1.0000 0 - 4325 0 CS CS 0.000000 1.0000 0 - 4326 0 CS CS 0.000000 1.0000 0 - 4327 0 CS CS 0.000000 1.0000 0 - 4328 0 CS CS 0.000000 1.0000 0 - 4329 0 CS CS 0.000000 1.0000 0 - 4330 0 CS CS 0.000000 1.0000 0 - 4331 0 CS CS 0.000000 1.0000 0 - 4332 0 CS CS 0.000000 1.0000 0 - 4333 0 CS CS 0.000000 1.0000 0 - 4334 0 CS CS 0.000000 1.0000 0 - 4335 0 CS CS 0.000000 1.0000 0 - 4336 0 CS CS 0.000000 1.0000 0 - 4337 0 CS CS 0.000000 1.0000 0 - 4338 0 CS CS 0.000000 1.0000 0 - 4339 0 CS CS 0.000000 1.0000 0 - 4340 0 CS CS 0.000000 1.0000 0 - 4341 0 CS CS 0.000000 1.0000 0 - 4342 0 CS CS 0.000000 1.0000 0 - 4343 0 CS CS 0.000000 1.0000 0 - 4344 0 CS CS 0.000000 1.0000 0 - 4345 0 CS CS 0.000000 1.0000 0 - 4346 0 CS CS 0.000000 1.0000 0 - 4347 0 CS CS 0.000000 1.0000 0 - 4348 0 CS CS 0.000000 1.0000 0 - 4349 0 CS CS 0.000000 1.0000 0 - 4350 0 CS CS 0.000000 1.0000 0 - 4351 0 CS CS 0.000000 1.0000 0 - 4352 0 CS CS 0.000000 1.0000 0 - 4353 0 CS CS 0.000000 1.0000 0 - 4354 0 CS CS 0.000000 1.0000 0 - 4355 0 CS CS 0.000000 1.0000 0 - 4356 0 CS CS 0.000000 1.0000 0 - 4357 0 CS CS 0.000000 1.0000 0 - 4358 0 CS CS 0.000000 1.0000 0 - 4359 0 CS CS 0.000000 1.0000 0 - 4360 0 CS CS 0.000000 1.0000 0 - 4361 0 CS CS 0.000000 1.0000 0 - 4362 0 CS CS 0.000000 1.0000 0 - 4363 0 CS CS 0.000000 1.0000 0 - 4364 0 CS CS 0.000000 1.0000 0 - 4365 0 CS CS 0.000000 1.0000 0 - 4366 0 CS CS 0.000000 1.0000 0 - 4367 0 CS CS 0.000000 1.0000 0 - 4368 0 CS CS 0.000000 1.0000 0 - 4369 0 CS CS 0.000000 1.0000 0 - 4370 0 CS CS 0.000000 1.0000 0 - 4371 0 CS CS 0.000000 1.0000 0 - 4372 0 CS CS 0.000000 1.0000 0 - 4373 0 CS CS 0.000000 1.0000 0 - 4374 0 CS CS 0.000000 1.0000 0 - 4375 0 CS CS 0.000000 1.0000 0 - 4376 0 CS CS 0.000000 1.0000 0 - 4377 0 CS CS 0.000000 1.0000 0 - 4378 0 CS CS 0.000000 1.0000 0 - 4379 0 CS CS 0.000000 1.0000 0 - 4380 0 CS CS 0.000000 1.0000 0 - 4381 0 CS CS 0.000000 1.0000 0 - 4382 0 CS CS 0.000000 1.0000 0 - 4383 0 CS CS 0.000000 1.0000 0 - 4384 0 CS CS 0.000000 1.0000 0 - 4385 0 CS CS 0.000000 1.0000 0 - 4386 0 CS CS 0.000000 1.0000 0 - 4387 0 CS CS 0.000000 1.0000 0 - 4388 0 CS CS 0.000000 1.0000 0 - 4389 0 CS CS 0.000000 1.0000 0 - 4390 0 CS CS 0.000000 1.0000 0 - 4391 0 CS CS 0.000000 1.0000 0 - 4392 0 CS CS 0.000000 1.0000 0 - 4393 0 CS CS 0.000000 1.0000 0 - 4394 0 CS CS 0.000000 1.0000 0 - 4395 0 CS CS 0.000000 1.0000 0 - 4396 0 CS CS 0.000000 1.0000 0 - 4397 0 CS CS 0.000000 1.0000 0 - 4398 0 CS CS 0.000000 1.0000 0 - 4399 0 CS CS 0.000000 1.0000 0 - 4400 0 CS CS 0.000000 1.0000 0 - 4401 0 CS CS 0.000000 1.0000 0 - 4402 0 CS CS 0.000000 1.0000 0 - 4403 0 CS CS 0.000000 1.0000 0 - 4404 0 CS CS 0.000000 1.0000 0 - 4405 0 CS CS 0.000000 1.0000 0 - 4406 0 CS CS 0.000000 1.0000 0 - 4407 0 CS CS 0.000000 1.0000 0 - 4408 0 CS CS 0.000000 1.0000 0 - 4409 0 CS CS 0.000000 1.0000 0 - 4410 0 CS CS 0.000000 1.0000 0 - 4411 0 CS CS 0.000000 1.0000 0 - 4412 0 CS CS 0.000000 1.0000 0 - 4413 0 CS CS 0.000000 1.0000 0 - 4414 0 CS CS 0.000000 1.0000 0 - 4415 0 CS CS 0.000000 1.0000 0 - 4416 0 CS CS 0.000000 1.0000 0 - 4417 0 CS CS 0.000000 1.0000 0 - 4418 0 CS CS 0.000000 1.0000 0 - 4419 0 CS CS 0.000000 1.0000 0 - 4420 0 CS CS 0.000000 1.0000 0 - 4421 0 CS CS 0.000000 1.0000 0 - 4422 0 CS CS 0.000000 1.0000 0 - 4423 0 CS CS 0.000000 1.0000 0 - 4424 0 CS CS 0.000000 1.0000 0 - 4425 0 CS CS 0.000000 1.0000 0 - 4426 0 CS CS 0.000000 1.0000 0 - 4427 0 CS CS 0.000000 1.0000 0 - 4428 0 CS CS 0.000000 1.0000 0 - 4429 0 CS CS 0.000000 1.0000 0 - 4430 0 CS CS 0.000000 1.0000 0 - 4431 0 CS CS 0.000000 1.0000 0 - 4432 0 CS CS 0.000000 1.0000 0 - 4433 0 CS CS 0.000000 1.0000 0 - 4434 0 CS CS 0.000000 1.0000 0 - 4435 0 CS CS 0.000000 1.0000 0 - 4436 0 CS CS 0.000000 1.0000 0 - 4437 0 CS CS 0.000000 1.0000 0 - 4438 0 CS CS 0.000000 1.0000 0 - 4439 0 CS CS 0.000000 1.0000 0 - 4440 0 CS CS 0.000000 1.0000 0 - 4441 0 CS CS 0.000000 1.0000 0 - 4442 0 CS CS 0.000000 1.0000 0 - 4443 0 CS CS 0.000000 1.0000 0 - 4444 0 CS CS 0.000000 1.0000 0 - 4445 0 CS CS 0.000000 1.0000 0 - 4446 0 CS CS 0.000000 1.0000 0 - 4447 0 CS CS 0.000000 1.0000 0 - 4448 0 CS CS 0.000000 1.0000 0 - 4449 0 CS CS 0.000000 1.0000 0 - 4450 0 CS CS 0.000000 1.0000 0 - 4451 0 CS CS 0.000000 1.0000 0 - 4452 0 CS CS 0.000000 1.0000 0 - 4453 0 CS CS 0.000000 1.0000 0 - 4454 0 CS CS 0.000000 1.0000 0 - 4455 0 CS CS 0.000000 1.0000 0 - 4456 0 CS CS 0.000000 1.0000 0 - 4457 0 CS CS 0.000000 1.0000 0 - 4458 0 CS CS 0.000000 1.0000 0 - 4459 0 CS CS 0.000000 1.0000 0 - 4460 0 CS CS 0.000000 1.0000 0 - 4461 0 CS CS 0.000000 1.0000 0 - 4462 0 CS CS 0.000000 1.0000 0 - 4463 0 CS CS 0.000000 1.0000 0 - 4464 0 CS CS 0.000000 1.0000 0 - 4465 0 CS CS 0.000000 1.0000 0 - 4466 0 CS CS 0.000000 1.0000 0 - 4467 0 CS CS 0.000000 1.0000 0 - 4468 0 CS CS 0.000000 1.0000 0 - 4469 0 CS CS 0.000000 1.0000 0 - 4470 0 CS CS 0.000000 1.0000 0 - 4471 0 CS CS 0.000000 1.0000 0 - 4472 0 CS CS 0.000000 1.0000 0 - 4473 0 CS CS 0.000000 1.0000 0 - 4474 0 CS CS 0.000000 1.0000 0 - 4475 0 CS CS 0.000000 1.0000 0 - 4476 0 CS CS 0.000000 1.0000 0 - 4477 0 CS CS 0.000000 1.0000 0 - 4478 0 CS CS 0.000000 1.0000 0 - 4479 0 CS CS 0.000000 1.0000 0 - 4480 0 CS CS 0.000000 1.0000 0 - 4481 0 CS CS 0.000000 1.0000 0 - 4482 0 CS CS 0.000000 1.0000 0 - 4483 0 CS CS 0.000000 1.0000 0 - 4484 0 CS CS 0.000000 1.0000 0 - 4485 0 CS CS 0.000000 1.0000 0 - 4486 0 CS CS 0.000000 1.0000 0 - 4487 0 CS CS 0.000000 1.0000 0 - 4488 0 CS CS 0.000000 1.0000 0 - 4489 0 CS CS 0.000000 1.0000 0 - 4490 0 CS CS 0.000000 1.0000 0 - 4491 0 CS CS 0.000000 1.0000 0 - 4492 0 CS CS 0.000000 1.0000 0 - 4493 0 CS CS 0.000000 1.0000 0 - 4494 0 CS CS 0.000000 1.0000 0 - 4495 0 CS CS 0.000000 1.0000 0 - 4496 0 CS CS 0.000000 1.0000 0 - 4497 0 CS CS 0.000000 1.0000 0 - 4498 0 CS CS 0.000000 1.0000 0 - 4499 0 CS CS 0.000000 1.0000 0 - 4500 0 CS CS 0.000000 1.0000 0 - 4501 0 CS CS 0.000000 1.0000 0 - 4502 0 CS CS 0.000000 1.0000 0 - 4503 0 CS CS 0.000000 1.0000 0 - 4504 0 CS CS 0.000000 1.0000 0 - 4505 0 CS CS 0.000000 1.0000 0 - 4506 0 CS CS 0.000000 1.0000 0 - 4507 0 CS CS 0.000000 1.0000 0 - 4508 0 CS CS 0.000000 1.0000 0 - 4509 0 CS CS 0.000000 1.0000 0 - 4510 0 CS CS 0.000000 1.0000 0 - 4511 0 CS CS 0.000000 1.0000 0 - 4512 0 CS CS 0.000000 1.0000 0 - 4513 0 CS CS 0.000000 1.0000 0 - 4514 0 CS CS 0.000000 1.0000 0 - 4515 0 CS CS 0.000000 1.0000 0 - 4516 0 CS CS 0.000000 1.0000 0 - 4517 0 CS CS 0.000000 1.0000 0 - 4518 0 CS CS 0.000000 1.0000 0 - 4519 0 CS CS 0.000000 1.0000 0 - 4520 0 CS CS 0.000000 1.0000 0 - 4521 0 CS CS 0.000000 1.0000 0 - 4522 0 CS CS 0.000000 1.0000 0 - 4523 0 CS CS 0.000000 1.0000 0 - 4524 0 CS CS 0.000000 1.0000 0 - 4525 0 CS CS 0.000000 1.0000 0 - 4526 0 CS CS 0.000000 1.0000 0 - 4527 0 CS CS 0.000000 1.0000 0 - 4528 0 CS CS 0.000000 1.0000 0 - 4529 0 CS CS 0.000000 1.0000 0 - 4530 0 CS CS 0.000000 1.0000 0 - 4531 0 CS CS 0.000000 1.0000 0 - 4532 0 CS CS 0.000000 1.0000 0 - 4533 0 CS CS 0.000000 1.0000 0 - 4534 0 CS CS 0.000000 1.0000 0 - 4535 0 CS CS 0.000000 1.0000 0 - 4536 0 CS CS 0.000000 1.0000 0 - 4537 0 CS CS 0.000000 1.0000 0 - 4538 0 CS CS 0.000000 1.0000 0 - 4539 0 CS CS 0.000000 1.0000 0 - 4540 0 CS CS 0.000000 1.0000 0 - 4541 0 CS CS 0.000000 1.0000 0 - 4542 0 CS CS 0.000000 1.0000 0 - 4543 0 CS CS 0.000000 1.0000 0 - 4544 0 CS CS 0.000000 1.0000 0 - 4545 0 CS CS 0.000000 1.0000 0 - 4546 0 CS CS 0.000000 1.0000 0 - 4547 0 CS CS 0.000000 1.0000 0 - 4548 0 CS CS 0.000000 1.0000 0 - 4549 0 CS CS 0.000000 1.0000 0 - 4550 0 CS CS 0.000000 1.0000 0 - 4551 0 CS CS 0.000000 1.0000 0 - 4552 0 CS CS 0.000000 1.0000 0 - 4553 0 CS CS 0.000000 1.0000 0 - 4554 0 CS CS 0.000000 1.0000 0 - 4555 0 CS CS 0.000000 1.0000 0 - 4556 0 CS CS 0.000000 1.0000 0 - 4557 0 CS CS 0.000000 1.0000 0 - 4558 0 CS CS 0.000000 1.0000 0 - 4559 0 CS CS 0.000000 1.0000 0 - 4560 0 CS CS 0.000000 1.0000 0 - 4561 0 CS CS 0.000000 1.0000 0 - 4562 0 CS CS 0.000000 1.0000 0 - 4563 0 CS CS 0.000000 1.0000 0 - 4564 0 CS CS 0.000000 1.0000 0 - 4565 0 CS CS 0.000000 1.0000 0 - 4566 0 CS CS 0.000000 1.0000 0 - 4567 0 CS CS 0.000000 1.0000 0 - 4568 0 CS CS 0.000000 1.0000 0 - 4569 0 CS CS 0.000000 1.0000 0 - 4570 0 CS CS 0.000000 1.0000 0 - 4571 0 CS CS 0.000000 1.0000 0 - 4572 0 CS CS 0.000000 1.0000 0 - 4573 0 CS CS 0.000000 1.0000 0 - 4574 0 CS CS 0.000000 1.0000 0 - 4575 0 CS CS 0.000000 1.0000 0 - 4576 0 CS CS 0.000000 1.0000 0 - 4577 0 CS CS 0.000000 1.0000 0 - 4578 0 CS CS 0.000000 1.0000 0 - 4579 0 CS CS 0.000000 1.0000 0 - 4580 0 CS CS 0.000000 1.0000 0 - 4581 0 CS CS 0.000000 1.0000 0 - 4582 0 CS CS 0.000000 1.0000 0 - 4583 0 CS CS 0.000000 1.0000 0 - 4584 0 CS CS 0.000000 1.0000 0 - 4585 0 CS CS 0.000000 1.0000 0 - 4586 0 CS CS 0.000000 1.0000 0 - 4587 0 CS CS 0.000000 1.0000 0 - 4588 0 CS CS 0.000000 1.0000 0 - 4589 0 CS CS 0.000000 1.0000 0 - 4590 0 CS CS 0.000000 1.0000 0 - 4591 0 CS CS 0.000000 1.0000 0 - 4592 0 CS CS 0.000000 1.0000 0 - 4593 0 CS CS 0.000000 1.0000 0 - 4594 0 CS CS 0.000000 1.0000 0 - 4595 0 CS CS 0.000000 1.0000 0 - 4596 0 CS CS 0.000000 1.0000 0 - 4597 0 CS CS 0.000000 1.0000 0 - 4598 0 CS CS 0.000000 1.0000 0 - 4599 0 CS CS 0.000000 1.0000 0 - 4600 0 CS CS 0.000000 1.0000 0 - 4601 0 CS CS 0.000000 1.0000 0 - 4602 0 CS CS 0.000000 1.0000 0 - 4603 0 CS CS 0.000000 1.0000 0 - 4604 0 CS CS 0.000000 1.0000 0 - 4605 0 CS CS 0.000000 1.0000 0 - 4606 0 CS CS 0.000000 1.0000 0 - 4607 0 CS CS 0.000000 1.0000 0 - 4608 0 CS CS 0.000000 1.0000 0 - 4609 0 CS CS 0.000000 1.0000 0 - 4610 0 CS CS 0.000000 1.0000 0 - 4611 0 CS CS 0.000000 1.0000 0 - 4612 0 CS CS 0.000000 1.0000 0 - 4613 0 CS CS 0.000000 1.0000 0 - 4614 0 CS CS 0.000000 1.0000 0 - 4615 0 CS CS 0.000000 1.0000 0 - 4616 0 CS CS 0.000000 1.0000 0 - 4617 0 CS CS 0.000000 1.0000 0 - 4618 0 CS CS 0.000000 1.0000 0 - 4619 0 CS CS 0.000000 1.0000 0 - 4620 0 CS CS 0.000000 1.0000 0 - 4621 0 CS CS 0.000000 1.0000 0 - 4622 0 CS CS 0.000000 1.0000 0 - 4623 0 CS CS 0.000000 1.0000 0 - 4624 0 CS CS 0.000000 1.0000 0 - 4625 0 CS CS 0.000000 1.0000 0 - 4626 0 CS CS 0.000000 1.0000 0 - 4627 0 CS CS 0.000000 1.0000 0 - 4628 0 CS CS 0.000000 1.0000 0 - 4629 0 CS CS 0.000000 1.0000 0 - 4630 0 CS CS 0.000000 1.0000 0 - 4631 0 CS CS 0.000000 1.0000 0 - 4632 0 CS CS 0.000000 1.0000 0 - 4633 0 CS CS 0.000000 1.0000 0 - 4634 0 CS CS 0.000000 1.0000 0 - 4635 0 CS CS 0.000000 1.0000 0 - 4636 0 CS CS 0.000000 1.0000 0 - 4637 0 CS CS 0.000000 1.0000 0 - 4638 0 CS CS 0.000000 1.0000 0 - 4639 0 CS CS 0.000000 1.0000 0 - 4640 0 CS CS 0.000000 1.0000 0 - 4641 0 CS CS 0.000000 1.0000 0 - 4642 0 CS CS 0.000000 1.0000 0 - 4643 0 CS CS 0.000000 1.0000 0 - 4644 0 CS CS 0.000000 1.0000 0 - 4645 0 CS CS 0.000000 1.0000 0 - 4646 0 CS CS 0.000000 1.0000 0 - 4647 0 CS CS 0.000000 1.0000 0 - 4648 0 CS CS 0.000000 1.0000 0 - 4649 0 CS CS 0.000000 1.0000 0 - 4650 0 CS CS 0.000000 1.0000 0 - 4651 0 CS CS 0.000000 1.0000 0 - 4652 0 CS CS 0.000000 1.0000 0 - 4653 0 CS CS 0.000000 1.0000 0 - 4654 0 CS CS 0.000000 1.0000 0 - 4655 0 CS CS 0.000000 1.0000 0 - 4656 0 CS CS 0.000000 1.0000 0 - 4657 0 CS CS 0.000000 1.0000 0 - 4658 0 CS CS 0.000000 1.0000 0 - 4659 0 CS CS 0.000000 1.0000 0 - 4660 0 CS CS 0.000000 1.0000 0 - 4661 0 CS CS 0.000000 1.0000 0 - 4662 0 CS CS 0.000000 1.0000 0 - 4663 0 CS CS 0.000000 1.0000 0 - 4664 0 CS CS 0.000000 1.0000 0 - 4665 0 CS CS 0.000000 1.0000 0 - 4666 0 CS CS 0.000000 1.0000 0 - 4667 0 CS CS 0.000000 1.0000 0 - 4668 0 CS CS 0.000000 1.0000 0 - 4669 0 CS CS 0.000000 1.0000 0 - 4670 0 CS CS 0.000000 1.0000 0 - 4671 0 CS CS 0.000000 1.0000 0 - 4672 0 CS CS 0.000000 1.0000 0 - 4673 0 CS CS 0.000000 1.0000 0 - 4674 0 CS CS 0.000000 1.0000 0 - 4675 0 CS CS 0.000000 1.0000 0 - 4676 0 CS CS 0.000000 1.0000 0 - 4677 0 CS CS 0.000000 1.0000 0 - 4678 0 CS CS 0.000000 1.0000 0 - 4679 0 CS CS 0.000000 1.0000 0 - 4680 0 CS CS 0.000000 1.0000 0 - 4681 0 CS CS 0.000000 1.0000 0 - 4682 0 CS CS 0.000000 1.0000 0 - 4683 0 CS CS 0.000000 1.0000 0 - 4684 0 CS CS 0.000000 1.0000 0 - 4685 0 CS CS 0.000000 1.0000 0 - 4686 0 CS CS 0.000000 1.0000 0 - 4687 0 CS CS 0.000000 1.0000 0 - 4688 0 CS CS 0.000000 1.0000 0 - 4689 0 CS CS 0.000000 1.0000 0 - 4690 0 CS CS 0.000000 1.0000 0 - 4691 0 CS CS 0.000000 1.0000 0 - 4692 0 CS CS 0.000000 1.0000 0 - 4693 0 CS CS 0.000000 1.0000 0 - 4694 0 CS CS 0.000000 1.0000 0 - 4695 0 CS CS 0.000000 1.0000 0 - 4696 0 CS CS 0.000000 1.0000 0 - 4697 0 CS CS 0.000000 1.0000 0 - 4698 0 CS CS 0.000000 1.0000 0 - 4699 0 CS CS 0.000000 1.0000 0 - 4700 0 CS CS 0.000000 1.0000 0 - 4701 0 CS CS 0.000000 1.0000 0 - 4702 0 CS CS 0.000000 1.0000 0 - 4703 0 CS CS 0.000000 1.0000 0 - 4704 0 CS CS 0.000000 1.0000 0 - 4705 0 CS CS 0.000000 1.0000 0 - 4706 0 CS CS 0.000000 1.0000 0 - 4707 0 CS CS 0.000000 1.0000 0 - 4708 0 CS CS 0.000000 1.0000 0 - 4709 0 CS CS 0.000000 1.0000 0 - 4710 0 CS CS 0.000000 1.0000 0 - 4711 0 CS CS 0.000000 1.0000 0 - 4712 0 CS CS 0.000000 1.0000 0 - 4713 0 CS CS 0.000000 1.0000 0 - 4714 0 CS CS 0.000000 1.0000 0 - 4715 0 CS CS 0.000000 1.0000 0 - 4716 0 CS CS 0.000000 1.0000 0 - 4717 0 CS CS 0.000000 1.0000 0 - 4718 0 CS CS 0.000000 1.0000 0 - 4719 0 CS CS 0.000000 1.0000 0 - 4720 0 CS CS 0.000000 1.0000 0 - 4721 0 CS CS 0.000000 1.0000 0 - 4722 0 CS CS 0.000000 1.0000 0 - 4723 0 CS CS 0.000000 1.0000 0 - 4724 0 CS CS 0.000000 1.0000 0 - 4725 0 CS CS 0.000000 1.0000 0 - 4726 0 CS CS 0.000000 1.0000 0 - 4727 0 CS CS 0.000000 1.0000 0 - 4728 0 CS CS 0.000000 1.0000 0 - 4729 0 CS CS 0.000000 1.0000 0 - 4730 0 CS CS 0.000000 1.0000 0 - 4731 0 CS CS 0.000000 1.0000 0 - 4732 0 CS CS 0.000000 1.0000 0 - 4733 0 CS CS 0.000000 1.0000 0 - 4734 0 CS CS 0.000000 1.0000 0 - 4735 0 CS CS 0.000000 1.0000 0 - 4736 0 CS CS 0.000000 1.0000 0 - 4737 0 CS CS 0.000000 1.0000 0 - 4738 0 CS CS 0.000000 1.0000 0 - 4739 0 CS CS 0.000000 1.0000 0 - 4740 0 CS CS 0.000000 1.0000 0 - 4741 0 CS CS 0.000000 1.0000 0 - 4742 0 CS CS 0.000000 1.0000 0 - 4743 0 CS CS 0.000000 1.0000 0 - 4744 0 CS CS 0.000000 1.0000 0 - 4745 0 CS CS 0.000000 1.0000 0 - 4746 0 CS CS 0.000000 1.0000 0 - 4747 0 CS CS 0.000000 1.0000 0 - 4748 0 CS CS 0.000000 1.0000 0 - 4749 0 CS CS 0.000000 1.0000 0 - 4750 0 CS CS 0.000000 1.0000 0 - 4751 0 CS CS 0.000000 1.0000 0 - 4752 0 CS CS 0.000000 1.0000 0 - 4753 0 CS CS 0.000000 1.0000 0 - 4754 0 CS CS 0.000000 1.0000 0 - 4755 0 CS CS 0.000000 1.0000 0 - 4756 0 CS CS 0.000000 1.0000 0 - 4757 0 CS CS 0.000000 1.0000 0 - 4758 0 CS CS 0.000000 1.0000 0 - 4759 0 CS CS 0.000000 1.0000 0 - 4760 0 CS CS 0.000000 1.0000 0 - 4761 0 CS CS 0.000000 1.0000 0 - 4762 0 CS CS 0.000000 1.0000 0 - 4763 0 CS CS 0.000000 1.0000 0 - 4764 0 CS CS 0.000000 1.0000 0 - 4765 0 CS CS 0.000000 1.0000 0 - 4766 0 CS CS 0.000000 1.0000 0 - 4767 0 CS CS 0.000000 1.0000 0 - 4768 0 CS CS 0.000000 1.0000 0 - 4769 0 CS CS 0.000000 1.0000 0 - 4770 0 CS CS 0.000000 1.0000 0 - 4771 0 CS CS 0.000000 1.0000 0 - 4772 0 CS CS 0.000000 1.0000 0 - 4773 0 CS CS 0.000000 1.0000 0 - 4774 0 CS CS 0.000000 1.0000 0 - 4775 0 CS CS 0.000000 1.0000 0 - 4776 0 CS CS 0.000000 1.0000 0 - 4777 0 CS CS 0.000000 1.0000 0 - 4778 0 CS CS 0.000000 1.0000 0 - 4779 0 CS CS 0.000000 1.0000 0 - 4780 0 CS CS 0.000000 1.0000 0 - 4781 0 CS CS 0.000000 1.0000 0 - 4782 0 CS CS 0.000000 1.0000 0 - 4783 0 CS CS 0.000000 1.0000 0 - 4784 0 CS CS 0.000000 1.0000 0 - 4785 0 CS CS 0.000000 1.0000 0 - 4786 0 CS CS 0.000000 1.0000 0 - 4787 0 CS CS 0.000000 1.0000 0 - 4788 0 CS CS 0.000000 1.0000 0 - 4789 0 CS CS 0.000000 1.0000 0 - 4790 0 CS CS 0.000000 1.0000 0 - 4791 0 CS CS 0.000000 1.0000 0 - 4792 0 CS CS 0.000000 1.0000 0 - 4793 0 CS CS 0.000000 1.0000 0 - 4794 0 CS CS 0.000000 1.0000 0 - 4795 0 CS CS 0.000000 1.0000 0 - 4796 0 CS CS 0.000000 1.0000 0 - 4797 0 CS CS 0.000000 1.0000 0 - 4798 0 CS CS 0.000000 1.0000 0 - 4799 0 CS CS 0.000000 1.0000 0 - 4800 0 CS CS 0.000000 1.0000 0 - 4801 0 CS CS 0.000000 1.0000 0 - 4802 0 CS CS 0.000000 1.0000 0 - 4803 0 CS CS 0.000000 1.0000 0 - 4804 0 CS CS 0.000000 1.0000 0 - 4805 0 CS CS 0.000000 1.0000 0 - 4806 0 CS CS 0.000000 1.0000 0 - 4807 0 CS CS 0.000000 1.0000 0 - 4808 0 CS CS 0.000000 1.0000 0 - 4809 0 CS CS 0.000000 1.0000 0 - 4810 0 CS CS 0.000000 1.0000 0 - 4811 0 CS CS 0.000000 1.0000 0 - 4812 0 CS CS 0.000000 1.0000 0 - 4813 0 CS CS 0.000000 1.0000 0 - 4814 0 CS CS 0.000000 1.0000 0 - 4815 0 CS CS 0.000000 1.0000 0 - 4816 0 CS CS 0.000000 1.0000 0 - 4817 0 CS CS 0.000000 1.0000 0 - 4818 0 CS CS 0.000000 1.0000 0 - 4819 0 CS CS 0.000000 1.0000 0 - 4820 0 CS CS 0.000000 1.0000 0 - 4821 0 CS CS 0.000000 1.0000 0 - 4822 0 CS CS 0.000000 1.0000 0 - 4823 0 CS CS 0.000000 1.0000 0 - 4824 0 CS CS 0.000000 1.0000 0 - 4825 0 CS CS 0.000000 1.0000 0 - 4826 0 CS CS 0.000000 1.0000 0 - 4827 0 CS CS 0.000000 1.0000 0 - 4828 0 CS CS 0.000000 1.0000 0 - 4829 0 CS CS 0.000000 1.0000 0 - 4830 0 CS CS 0.000000 1.0000 0 - 4831 0 CS CS 0.000000 1.0000 0 - 4832 0 CS CS 0.000000 1.0000 0 - 4833 0 CS CS 0.000000 1.0000 0 - 4834 0 CS CS 0.000000 1.0000 0 - 4835 0 CS CS 0.000000 1.0000 0 - 4836 0 CS CS 0.000000 1.0000 0 - 4837 0 CS CS 0.000000 1.0000 0 - 4838 0 CS CS 0.000000 1.0000 0 - 4839 0 CS CS 0.000000 1.0000 0 - 4840 0 CS CS 0.000000 1.0000 0 - 4841 0 CS CS 0.000000 1.0000 0 - 4842 0 CS CS 0.000000 1.0000 0 - 4843 0 CS CS 0.000000 1.0000 0 - 4844 0 CS CS 0.000000 1.0000 0 - 4845 0 CS CS 0.000000 1.0000 0 - 4846 0 CS CS 0.000000 1.0000 0 - 4847 0 CS CS 0.000000 1.0000 0 - 4848 0 CS CS 0.000000 1.0000 0 - 4849 0 CS CS 0.000000 1.0000 0 - 4850 0 CS CS 0.000000 1.0000 0 - 4851 0 CS CS 0.000000 1.0000 0 - 4852 0 CS CS 0.000000 1.0000 0 - 4853 0 CS CS 0.000000 1.0000 0 - 4854 0 CS CS 0.000000 1.0000 0 - 4855 0 CS CS 0.000000 1.0000 0 - 4856 0 CS CS 0.000000 1.0000 0 - 4857 0 CS CS 0.000000 1.0000 0 - 4858 0 CS CS 0.000000 1.0000 0 - 4859 0 CS CS 0.000000 1.0000 0 - 4860 0 CS CS 0.000000 1.0000 0 - 4861 0 CS CS 0.000000 1.0000 0 - 4862 0 CS CS 0.000000 1.0000 0 - 4863 0 CS CS 0.000000 1.0000 0 - 4864 0 CS CS 0.000000 1.0000 0 - 4865 0 CS CS 0.000000 1.0000 0 - 4866 0 CS CS 0.000000 1.0000 0 - 4867 0 CS CS 0.000000 1.0000 0 - 4868 0 CS CS 0.000000 1.0000 0 - 4869 0 CS CS 0.000000 1.0000 0 - 4870 0 CS CS 0.000000 1.0000 0 - 4871 0 CS CS 0.000000 1.0000 0 - 4872 0 CS CS 0.000000 1.0000 0 - 4873 0 CS CS 0.000000 1.0000 0 - 4874 0 CS CS 0.000000 1.0000 0 - 4875 0 CS CS 0.000000 1.0000 0 - 4876 0 CS CS 0.000000 1.0000 0 - 4877 0 CS CS 0.000000 1.0000 0 - 4878 0 CS CS 0.000000 1.0000 0 - 4879 0 CS CS 0.000000 1.0000 0 - 4880 0 CS CS 0.000000 1.0000 0 - 4881 0 CS CS 0.000000 1.0000 0 - 4882 0 CS CS 0.000000 1.0000 0 - 4883 0 CS CS 0.000000 1.0000 0 - 4884 0 CS CS 0.000000 1.0000 0 - 4885 0 CS CS 0.000000 1.0000 0 - 4886 0 CS CS 0.000000 1.0000 0 - 4887 0 CS CS 0.000000 1.0000 0 - 4888 0 CS CS 0.000000 1.0000 0 - 4889 0 CS CS 0.000000 1.0000 0 - 4890 0 CS CS 0.000000 1.0000 0 - 4891 0 CS CS 0.000000 1.0000 0 - 4892 0 CS CS 0.000000 1.0000 0 - 4893 0 CS CS 0.000000 1.0000 0 - 4894 0 CS CS 0.000000 1.0000 0 - 4895 0 CS CS 0.000000 1.0000 0 - 4896 0 CS CS 0.000000 1.0000 0 - 4897 0 CS CS 0.000000 1.0000 0 - 4898 0 CS CS 0.000000 1.0000 0 - 4899 0 CS CS 0.000000 1.0000 0 - 4900 0 CS CS 0.000000 1.0000 0 - 4901 0 CS CS 0.000000 1.0000 0 - 4902 0 CS CS 0.000000 1.0000 0 - 4903 0 CS CS 0.000000 1.0000 0 - 4904 0 CS CS 0.000000 1.0000 0 - 4905 0 CS CS 0.000000 1.0000 0 - 4906 0 CS CS 0.000000 1.0000 0 - 4907 0 CS CS 0.000000 1.0000 0 - 4908 0 CS CS 0.000000 1.0000 0 - 4909 0 CS CS 0.000000 1.0000 0 - 4910 0 CS CS 0.000000 1.0000 0 - 4911 0 CS CS 0.000000 1.0000 0 - 4912 0 CS CS 0.000000 1.0000 0 - 4913 0 CS CS 0.000000 1.0000 0 - 4914 0 CS CS 0.000000 1.0000 0 - 4915 0 CS CS 0.000000 1.0000 0 - 4916 0 CS CS 0.000000 1.0000 0 - 4917 0 CS CS 0.000000 1.0000 0 - 4918 0 CS CS 0.000000 1.0000 0 - 4919 0 CS CS 0.000000 1.0000 0 - 4920 0 CS CS 0.000000 1.0000 0 - 4921 0 CS CS 0.000000 1.0000 0 - 4922 0 CS CS 0.000000 1.0000 0 - 4923 0 CS CS 0.000000 1.0000 0 - 4924 0 CS CS 0.000000 1.0000 0 - 4925 0 CS CS 0.000000 1.0000 0 - 4926 0 CS CS 0.000000 1.0000 0 - 4927 0 CS CS 0.000000 1.0000 0 - 4928 0 CS CS 0.000000 1.0000 0 - 4929 0 CS CS 0.000000 1.0000 0 - 4930 0 CS CS 0.000000 1.0000 0 - 4931 0 CS CS 0.000000 1.0000 0 - 4932 0 CS CS 0.000000 1.0000 0 - 4933 0 CS CS 0.000000 1.0000 0 - 4934 0 CS CS 0.000000 1.0000 0 - 4935 0 CS CS 0.000000 1.0000 0 - 4936 0 CS CS 0.000000 1.0000 0 - 4937 0 CS CS 0.000000 1.0000 0 - 4938 0 CS CS 0.000000 1.0000 0 - 4939 0 CS CS 0.000000 1.0000 0 - 4940 0 CS CS 0.000000 1.0000 0 - 4941 0 CS CS 0.000000 1.0000 0 - 4942 0 CS CS 0.000000 1.0000 0 - 4943 0 CS CS 0.000000 1.0000 0 - 4944 0 CS CS 0.000000 1.0000 0 - 4945 0 CS CS 0.000000 1.0000 0 - 4946 0 CS CS 0.000000 1.0000 0 - 4947 0 CS CS 0.000000 1.0000 0 - 4948 0 CS CS 0.000000 1.0000 0 - 4949 0 CS CS 0.000000 1.0000 0 - 4950 0 CS CS 0.000000 1.0000 0 - 4951 0 CS CS 0.000000 1.0000 0 - 4952 0 CS CS 0.000000 1.0000 0 - 4953 0 CS CS 0.000000 1.0000 0 - 4954 0 CS CS 0.000000 1.0000 0 - 4955 0 CS CS 0.000000 1.0000 0 - 4956 0 CS CS 0.000000 1.0000 0 - 4957 0 CS CS 0.000000 1.0000 0 - 4958 0 CS CS 0.000000 1.0000 0 - 4959 0 CS CS 0.000000 1.0000 0 - 4960 0 CS CS 0.000000 1.0000 0 - 4961 0 CS CS 0.000000 1.0000 0 - 4962 0 CS CS 0.000000 1.0000 0 - 4963 0 CS CS 0.000000 1.0000 0 - 4964 0 CS CS 0.000000 1.0000 0 - 4965 0 CS CS 0.000000 1.0000 0 - 4966 0 CS CS 0.000000 1.0000 0 - 4967 0 CS CS 0.000000 1.0000 0 - 4968 0 CS CS 0.000000 1.0000 0 - 4969 0 CS CS 0.000000 1.0000 0 - 4970 0 CS CS 0.000000 1.0000 0 - 4971 0 CS CS 0.000000 1.0000 0 - 4972 0 CS CS 0.000000 1.0000 0 - 4973 0 CS CS 0.000000 1.0000 0 - 4974 0 CS CS 0.000000 1.0000 0 - 4975 0 CS CS 0.000000 1.0000 0 - 4976 0 CS CS 0.000000 1.0000 0 - 4977 0 CS CS 0.000000 1.0000 0 - 4978 0 CS CS 0.000000 1.0000 0 - 4979 0 CS CS 0.000000 1.0000 0 - 4980 0 CS CS 0.000000 1.0000 0 - 4981 0 CS CS 0.000000 1.0000 0 - 4982 0 CS CS 0.000000 1.0000 0 - 4983 0 CS CS 0.000000 1.0000 0 - 4984 0 CS CS 0.000000 1.0000 0 - 4985 0 CS CS 0.000000 1.0000 0 - 4986 0 CS CS 0.000000 1.0000 0 - 4987 0 CS CS 0.000000 1.0000 0 - 4988 0 CS CS 0.000000 1.0000 0 - 4989 0 CS CS 0.000000 1.0000 0 - 4990 0 CS CS 0.000000 1.0000 0 - 4991 0 CS CS 0.000000 1.0000 0 - 4992 0 CS CS 0.000000 1.0000 0 - 4993 0 CS CS 0.000000 1.0000 0 - 4994 0 CS CS 0.000000 1.0000 0 - 4995 0 CS CS 0.000000 1.0000 0 - 4996 0 CS CS 0.000000 1.0000 0 - 4997 0 CS CS 0.000000 1.0000 0 - 4998 0 CS CS 0.000000 1.0000 0 - 4999 0 CS CS 0.000000 1.0000 0 - 5000 0 CS CS 0.000000 1.0000 0 - 5001 0 CS CS 0.000000 1.0000 0 - 5002 0 CS CS 0.000000 1.0000 0 - 5003 0 OS OS 0.000000 5.0000 0 - 5004 0 OS OS 0.000000 5.0000 0 - 5005 0 OS OS 0.000000 5.0000 0 - 5006 0 OS OS 0.000000 5.0000 0 - 5007 0 OS OS 0.000000 5.0000 0 - 5008 0 OS OS 0.000000 5.0000 0 - 5009 0 OS OS 0.000000 5.0000 0 - 5010 0 OS OS 0.000000 5.0000 0 - 5011 0 OS OS 0.000000 5.0000 0 - 5012 0 OS OS 0.000000 5.0000 0 - 5013 0 OS OS 0.000000 5.0000 0 - 5014 0 OS OS 0.000000 5.0000 0 - 5015 0 OS OS 0.000000 5.0000 0 - 5016 0 OS OS 0.000000 5.0000 0 - 5017 0 OS OS 0.000000 5.0000 0 - 5018 0 OS OS 0.000000 5.0000 0 - 5019 0 OS OS 0.000000 5.0000 0 - 5020 0 OS OS 0.000000 5.0000 0 - 5021 0 OS OS 0.000000 5.0000 0 - 5022 0 OS OS 0.000000 5.0000 0 - 5023 0 OS OS 0.000000 5.0000 0 - 5024 0 OS OS 0.000000 5.0000 0 - 5025 0 OS OS 0.000000 5.0000 0 - 5026 0 OS OS 0.000000 5.0000 0 - 5027 0 OS OS 0.000000 5.0000 0 - 5028 0 OS OS 0.000000 5.0000 0 - 5029 0 OS OS 0.000000 5.0000 0 - 5030 0 OS OS 0.000000 5.0000 0 - 5031 0 OS OS 0.000000 5.0000 0 - 5032 0 OS OS 0.000000 5.0000 0 - 5033 0 OS OS 0.000000 5.0000 0 - 5034 0 OS OS 0.000000 5.0000 0 - 5035 0 OS OS 0.000000 5.0000 0 - 5036 0 OS OS 0.000000 5.0000 0 - 5037 0 OS OS 0.000000 5.0000 0 - 5038 0 OS OS 0.000000 5.0000 0 - 5039 0 OS OS 0.000000 5.0000 0 - 5040 0 OS OS 0.000000 5.0000 0 - 5041 0 OS OS 0.000000 5.0000 0 - 5042 0 OS OS 0.000000 5.0000 0 - 5043 0 OS OS 0.000000 5.0000 0 - 5044 0 OS OS 0.000000 5.0000 0 - 5045 0 OS OS 0.000000 5.0000 0 - 5046 0 OS OS 0.000000 5.0000 0 - 5047 0 OS OS 0.000000 5.0000 0 - 5048 0 OS OS 0.000000 5.0000 0 - 5049 0 OS OS 0.000000 5.0000 0 - 5050 0 OS OS 0.000000 5.0000 0 - 5051 0 OS OS 0.000000 5.0000 0 - 5052 0 OS OS 0.000000 5.0000 0 - 5053 0 OS OS 0.000000 5.0000 0 - 5054 0 OS OS 0.000000 5.0000 0 - 5055 0 OS OS 0.000000 5.0000 0 - 5056 0 OS OS 0.000000 5.0000 0 - 5057 0 OS OS 0.000000 5.0000 0 - 5058 0 OS OS 0.000000 5.0000 0 - 5059 0 OS OS 0.000000 5.0000 0 - 5060 0 OS OS 0.000000 5.0000 0 - 5061 0 OS OS 0.000000 5.0000 0 - 5062 0 OS OS 0.000000 5.0000 0 - 5063 0 OS OS 0.000000 5.0000 0 - 5064 0 OS OS 0.000000 5.0000 0 - 5065 0 OS OS 0.000000 5.0000 0 - 5066 0 OS OS 0.000000 5.0000 0 - 5067 0 OS OS 0.000000 5.0000 0 - 5068 0 OS OS 0.000000 5.0000 0 - 5069 0 OS OS 0.000000 5.0000 0 - 5070 0 OS OS 0.000000 5.0000 0 - 5071 0 OS OS 0.000000 5.0000 0 - 5072 0 OS OS 0.000000 5.0000 0 - 5073 0 OS OS 0.000000 5.0000 0 - 5074 0 OS OS 0.000000 5.0000 0 - 5075 0 OS OS 0.000000 5.0000 0 - 5076 0 OS OS 0.000000 5.0000 0 - 5077 0 OS OS 0.000000 5.0000 0 - 5078 0 OS OS 0.000000 5.0000 0 - 5079 0 OS OS 0.000000 5.0000 0 - 5080 0 OS OS 0.000000 5.0000 0 - 5081 0 OS OS 0.000000 5.0000 0 - 5082 0 OS OS 0.000000 5.0000 0 - 5083 0 OS OS 0.000000 5.0000 0 - 5084 0 OS OS 0.000000 5.0000 0 - 5085 0 OS OS 0.000000 5.0000 0 - 5086 0 OS OS 0.000000 5.0000 0 - 5087 0 OS OS 0.000000 5.0000 0 - 5088 0 OS OS 0.000000 5.0000 0 - 5089 0 OS OS 0.000000 5.0000 0 - 5090 0 OS OS 0.000000 5.0000 0 - 5091 0 OS OS 0.000000 5.0000 0 - 5092 0 OS OS 0.000000 5.0000 0 - 5093 0 OS OS 0.000000 5.0000 0 - 5094 0 OS OS 0.000000 5.0000 0 - 5095 0 OS OS 0.000000 5.0000 0 - 5096 0 OS OS 0.000000 5.0000 0 - 5097 0 OS OS 0.000000 5.0000 0 - 5098 0 OS OS 0.000000 5.0000 0 - 5099 0 OS OS 0.000000 5.0000 0 - 5100 0 OS OS 0.000000 5.0000 0 - 5101 0 OS OS 0.000000 5.0000 0 - 5102 0 OS OS 0.000000 5.0000 0 - 5103 0 OS OS 0.000000 5.0000 0 - 5104 0 OS OS 0.000000 5.0000 0 - 5105 0 OS OS 0.000000 5.0000 0 - 5106 0 OS OS 0.000000 5.0000 0 - 5107 0 OS OS 0.000000 5.0000 0 - 5108 0 OS OS 0.000000 5.0000 0 - 5109 0 OS OS 0.000000 5.0000 0 - 5110 0 OS OS 0.000000 5.0000 0 - 5111 0 OS OS 0.000000 5.0000 0 - 5112 0 OS OS 0.000000 5.0000 0 - 5113 0 OS OS 0.000000 5.0000 0 - 5114 0 OS OS 0.000000 5.0000 0 - 5115 0 OS OS 0.000000 5.0000 0 - 5116 0 OS OS 0.000000 5.0000 0 - 5117 0 OS OS 0.000000 5.0000 0 - 5118 0 OS OS 0.000000 5.0000 0 - 5119 0 OS OS 0.000000 5.0000 0 - 5120 0 OS OS 0.000000 5.0000 0 - 5121 0 OS OS 0.000000 5.0000 0 - 5122 0 OS OS 0.000000 5.0000 0 - 5123 0 OS OS 0.000000 5.0000 0 - 5124 0 OS OS 0.000000 5.0000 0 - 5125 0 OS OS 0.000000 5.0000 0 - 5126 0 OS OS 0.000000 5.0000 0 - 5127 0 OS OS 0.000000 5.0000 0 - 5128 0 OS OS 0.000000 5.0000 0 - 5129 0 OS OS 0.000000 5.0000 0 - 5130 0 OS OS 0.000000 5.0000 0 - 5131 0 OS OS 0.000000 5.0000 0 - 5132 0 OS OS 0.000000 5.0000 0 - 5133 0 OS OS 0.000000 5.0000 0 - 5134 0 OS OS 0.000000 5.0000 0 - 5135 0 OS OS 0.000000 5.0000 0 - 5136 0 OS OS 0.000000 5.0000 0 - 5137 0 OS OS 0.000000 5.0000 0 - 5138 0 OS OS 0.000000 5.0000 0 - 5139 0 OS OS 0.000000 5.0000 0 - 5140 0 OS OS 0.000000 5.0000 0 - 5141 0 OS OS 0.000000 5.0000 0 - 5142 0 OS OS 0.000000 5.0000 0 - 5143 0 OS OS 0.000000 5.0000 0 - 5144 0 OS OS 0.000000 5.0000 0 - 5145 0 OS OS 0.000000 5.0000 0 - 5146 0 OS OS 0.000000 5.0000 0 - 5147 0 OS OS 0.000000 5.0000 0 - 5148 0 OS OS 0.000000 5.0000 0 - 5149 0 OS OS 0.000000 5.0000 0 - 5150 0 OS OS 0.000000 5.0000 0 - 5151 0 OS OS 0.000000 5.0000 0 - 5152 0 OS OS 0.000000 5.0000 0 - 5153 0 OS OS 0.000000 5.0000 0 - 5154 0 OS OS 0.000000 5.0000 0 - 5155 0 OS OS 0.000000 5.0000 0 - 5156 0 OS OS 0.000000 5.0000 0 - 5157 0 OS OS 0.000000 5.0000 0 - 5158 0 OS OS 0.000000 5.0000 0 - 5159 0 OS OS 0.000000 5.0000 0 - 5160 0 OS OS 0.000000 5.0000 0 - 5161 0 OS OS 0.000000 5.0000 0 - 5162 0 OS OS 0.000000 5.0000 0 - 5163 0 OS OS 0.000000 5.0000 0 - 5164 0 OS OS 0.000000 5.0000 0 - 5165 0 OS OS 0.000000 5.0000 0 - 5166 0 OS OS 0.000000 5.0000 0 - 5167 0 OS OS 0.000000 5.0000 0 - 5168 0 OS OS 0.000000 5.0000 0 - 5169 0 OS OS 0.000000 5.0000 0 - 5170 0 OS OS 0.000000 5.0000 0 - 5171 0 OS OS 0.000000 5.0000 0 - 5172 0 OS OS 0.000000 5.0000 0 - 5173 0 OS OS 0.000000 5.0000 0 - 5174 0 OS OS 0.000000 5.0000 0 - 5175 0 OS OS 0.000000 5.0000 0 - 5176 0 OS OS 0.000000 5.0000 0 - 5177 0 OS OS 0.000000 5.0000 0 - 5178 0 OS OS 0.000000 5.0000 0 - 5179 0 OS OS 0.000000 5.0000 0 - 5180 0 OS OS 0.000000 5.0000 0 - 5181 0 OS OS 0.000000 5.0000 0 - 5182 0 OS OS 0.000000 5.0000 0 - 5183 0 OS OS 0.000000 5.0000 0 - 5184 0 OS OS 0.000000 5.0000 0 - 5185 0 OS OS 0.000000 5.0000 0 - 5186 0 OS OS 0.000000 5.0000 0 - 5187 0 OS OS 0.000000 5.0000 0 - 5188 0 OS OS 0.000000 5.0000 0 - 5189 0 OS OS 0.000000 5.0000 0 - 5190 0 OS OS 0.000000 5.0000 0 - 5191 0 OS OS 0.000000 5.0000 0 - 5192 0 OS OS 0.000000 5.0000 0 - 5193 0 OS OS 0.000000 5.0000 0 - 5194 0 OS OS 0.000000 5.0000 0 - 5195 0 OS OS 0.000000 5.0000 0 - 5196 0 OS OS 0.000000 5.0000 0 - 5197 0 OS OS 0.000000 5.0000 0 - 5198 0 OS OS 0.000000 5.0000 0 - 5199 0 OS OS 0.000000 5.0000 0 - 5200 0 OS OS 0.000000 5.0000 0 - 5201 0 OS OS 0.000000 5.0000 0 - 5202 0 OS OS 0.000000 5.0000 0 - 5203 0 OS OS 0.000000 5.0000 0 - 5204 0 OS OS 0.000000 5.0000 0 - 5205 0 OS OS 0.000000 5.0000 0 - 5206 0 OS OS 0.000000 5.0000 0 - 5207 0 OS OS 0.000000 5.0000 0 - 5208 0 OS OS 0.000000 5.0000 0 - 5209 0 OS OS 0.000000 5.0000 0 - 5210 0 OS OS 0.000000 5.0000 0 - 5211 0 OS OS 0.000000 5.0000 0 - 5212 0 OS OS 0.000000 5.0000 0 - 5213 0 OS OS 0.000000 5.0000 0 - 5214 0 OS OS 0.000000 5.0000 0 - 5215 0 OS OS 0.000000 5.0000 0 - 5216 0 OS OS 0.000000 5.0000 0 - 5217 0 OS OS 0.000000 5.0000 0 - 5218 0 OS OS 0.000000 5.0000 0 - 5219 0 OS OS 0.000000 5.0000 0 - 5220 0 OS OS 0.000000 5.0000 0 - 5221 0 OS OS 0.000000 5.0000 0 - 5222 0 OS OS 0.000000 5.0000 0 - 5223 0 OS OS 0.000000 5.0000 0 - 5224 0 OS OS 0.000000 5.0000 0 - 5225 0 OS OS 0.000000 5.0000 0 - 5226 0 OS OS 0.000000 5.0000 0 - 5227 0 OS OS 0.000000 5.0000 0 - 5228 0 OS OS 0.000000 5.0000 0 - 5229 0 OS OS 0.000000 5.0000 0 - 5230 0 OS OS 0.000000 5.0000 0 - 5231 0 OS OS 0.000000 5.0000 0 - 5232 0 OS OS 0.000000 5.0000 0 - 5233 0 OS OS 0.000000 5.0000 0 - 5234 0 OS OS 0.000000 5.0000 0 - 5235 0 OS OS 0.000000 5.0000 0 - 5236 0 OS OS 0.000000 5.0000 0 - 5237 0 OS OS 0.000000 5.0000 0 - 5238 0 OS OS 0.000000 5.0000 0 - 5239 0 OS OS 0.000000 5.0000 0 - 5240 0 OS OS 0.000000 5.0000 0 - 5241 0 OS OS 0.000000 5.0000 0 - 5242 0 OS OS 0.000000 5.0000 0 - 5243 0 OS OS 0.000000 5.0000 0 - 5244 0 OS OS 0.000000 5.0000 0 - 5245 0 OS OS 0.000000 5.0000 0 - 5246 0 OS OS 0.000000 5.0000 0 - 5247 0 OS OS 0.000000 5.0000 0 - 5248 0 OS OS 0.000000 5.0000 0 - 5249 0 OS OS 0.000000 5.0000 0 - 5250 0 OS OS 0.000000 5.0000 0 - 5251 0 OS OS 0.000000 5.0000 0 - 5252 0 OS OS 0.000000 5.0000 0 - 5253 0 OS OS 0.000000 5.0000 0 - 5254 0 OS OS 0.000000 5.0000 0 - 5255 0 OS OS 0.000000 5.0000 0 - 5256 0 OS OS 0.000000 5.0000 0 - 5257 0 OS OS 0.000000 5.0000 0 - 5258 0 OS OS 0.000000 5.0000 0 - 5259 0 OS OS 0.000000 5.0000 0 - 5260 0 OS OS 0.000000 5.0000 0 - 5261 0 OS OS 0.000000 5.0000 0 - 5262 0 OS OS 0.000000 5.0000 0 - 5263 0 OS OS 0.000000 5.0000 0 - 5264 0 OS OS 0.000000 5.0000 0 - 5265 0 OS OS 0.000000 5.0000 0 - 5266 0 OS OS 0.000000 5.0000 0 - 5267 0 OS OS 0.000000 5.0000 0 - 5268 0 OS OS 0.000000 5.0000 0 - 5269 0 OS OS 0.000000 5.0000 0 - 5270 0 OS OS 0.000000 5.0000 0 - 5271 0 OS OS 0.000000 5.0000 0 - 5272 0 OS OS 0.000000 5.0000 0 - 5273 0 OS OS 0.000000 5.0000 0 - 5274 0 OS OS 0.000000 5.0000 0 - 5275 0 OS OS 0.000000 5.0000 0 - 5276 0 OS OS 0.000000 5.0000 0 - 5277 0 OS OS 0.000000 5.0000 0 - 5278 0 OS OS 0.000000 5.0000 0 - 5279 0 OS OS 0.000000 5.0000 0 - 5280 0 OS OS 0.000000 5.0000 0 - 5281 0 OS OS 0.000000 5.0000 0 - 5282 0 OS OS 0.000000 5.0000 0 - 5283 0 OS OS 0.000000 5.0000 0 - 5284 0 OS OS 0.000000 5.0000 0 - 5285 0 OS OS 0.000000 5.0000 0 - 5286 0 OS OS 0.000000 5.0000 0 - 5287 0 OS OS 0.000000 5.0000 0 - 5288 0 OS OS 0.000000 5.0000 0 - 5289 0 OS OS 0.000000 5.0000 0 - 5290 0 OS OS 0.000000 5.0000 0 - 5291 0 OS OS 0.000000 5.0000 0 - 5292 0 OS OS 0.000000 5.0000 0 - 5293 0 OS OS 0.000000 5.0000 0 - 5294 0 OS OS 0.000000 5.0000 0 - 5295 0 OS OS 0.000000 5.0000 0 - 5296 0 OS OS 0.000000 5.0000 0 - 5297 0 OS OS 0.000000 5.0000 0 - 5298 0 OS OS 0.000000 5.0000 0 - 5299 0 OS OS 0.000000 5.0000 0 - 5300 0 OS OS 0.000000 5.0000 0 - 5301 0 OS OS 0.000000 5.0000 0 - 5302 0 OS OS 0.000000 5.0000 0 - 5303 0 OS OS 0.000000 5.0000 0 - 5304 0 OS OS 0.000000 5.0000 0 - 5305 0 OS OS 0.000000 5.0000 0 - 5306 0 OS OS 0.000000 5.0000 0 - 5307 0 OS OS 0.000000 5.0000 0 - 5308 0 OS OS 0.000000 5.0000 0 - 5309 0 OS OS 0.000000 5.0000 0 - 5310 0 OS OS 0.000000 5.0000 0 - 5311 0 OS OS 0.000000 5.0000 0 - 5312 0 OS OS 0.000000 5.0000 0 - 5313 0 OS OS 0.000000 5.0000 0 - 5314 0 OS OS 0.000000 5.0000 0 - 5315 0 OS OS 0.000000 5.0000 0 - 5316 0 OS OS 0.000000 5.0000 0 - 5317 0 OS OS 0.000000 5.0000 0 - 5318 0 OS OS 0.000000 5.0000 0 - 5319 0 OS OS 0.000000 5.0000 0 - 5320 0 OS OS 0.000000 5.0000 0 - 5321 0 OS OS 0.000000 5.0000 0 - 5322 0 OS OS 0.000000 5.0000 0 - 5323 0 OS OS 0.000000 5.0000 0 - 5324 0 OS OS 0.000000 5.0000 0 - 5325 0 OS OS 0.000000 5.0000 0 - 5326 0 OS OS 0.000000 5.0000 0 - 5327 0 OS OS 0.000000 5.0000 0 - 5328 0 OS OS 0.000000 5.0000 0 - 5329 0 OS OS 0.000000 5.0000 0 - 5330 0 OS OS 0.000000 5.0000 0 - 5331 0 OS OS 0.000000 5.0000 0 - 5332 0 OS OS 0.000000 5.0000 0 - 5333 0 OS OS 0.000000 5.0000 0 - 5334 0 OS OS 0.000000 5.0000 0 - 5335 0 OS OS 0.000000 5.0000 0 - 5336 0 OS OS 0.000000 5.0000 0 - 5337 0 OS OS 0.000000 5.0000 0 - 5338 0 OS OS 0.000000 5.0000 0 - 5339 0 OS OS 0.000000 5.0000 0 - 5340 0 OS OS 0.000000 5.0000 0 - 5341 0 OS OS 0.000000 5.0000 0 - 5342 0 OS OS 0.000000 5.0000 0 - 5343 0 OS OS 0.000000 5.0000 0 - 5344 0 OS OS 0.000000 5.0000 0 - 5345 0 OS OS 0.000000 5.0000 0 - 5346 0 OS OS 0.000000 5.0000 0 - 5347 0 OS OS 0.000000 5.0000 0 - 5348 0 OS OS 0.000000 5.0000 0 - 5349 0 OS OS 0.000000 5.0000 0 - 5350 0 OS OS 0.000000 5.0000 0 - 5351 0 OS OS 0.000000 5.0000 0 - 5352 0 OS OS 0.000000 5.0000 0 - 5353 0 OS OS 0.000000 5.0000 0 - 5354 0 OS OS 0.000000 5.0000 0 - 5355 0 OS OS 0.000000 5.0000 0 - 5356 0 OS OS 0.000000 5.0000 0 - 5357 0 OS OS 0.000000 5.0000 0 - 5358 0 OS OS 0.000000 5.0000 0 - 5359 0 OS OS 0.000000 5.0000 0 - 5360 0 OS OS 0.000000 5.0000 0 - 5361 0 OS OS 0.000000 5.0000 0 - 5362 0 OS OS 0.000000 5.0000 0 - 5363 0 OS OS 0.000000 5.0000 0 - 5364 0 OS OS 0.000000 5.0000 0 - 5365 0 OS OS 0.000000 5.0000 0 - 5366 0 OS OS 0.000000 5.0000 0 - 5367 0 OS OS 0.000000 5.0000 0 - 5368 0 OS OS 0.000000 5.0000 0 - 5369 0 OS OS 0.000000 5.0000 0 - 5370 0 OS OS 0.000000 5.0000 0 - 5371 0 OS OS 0.000000 5.0000 0 - 5372 0 OS OS 0.000000 5.0000 0 - 5373 0 OS OS 0.000000 5.0000 0 - 5374 0 OS OS 0.000000 5.0000 0 - 5375 0 OS OS 0.000000 5.0000 0 - 5376 0 OS OS 0.000000 5.0000 0 - 5377 0 OS OS 0.000000 5.0000 0 - 5378 0 OS OS 0.000000 5.0000 0 - 5379 0 OS OS 0.000000 5.0000 0 - 5380 0 OS OS 0.000000 5.0000 0 - 5381 0 OS OS 0.000000 5.0000 0 - 5382 0 OS OS 0.000000 5.0000 0 - 5383 0 OS OS 0.000000 5.0000 0 - 5384 0 OS OS 0.000000 5.0000 0 - 5385 0 OS OS 0.000000 5.0000 0 - 5386 0 OS OS 0.000000 5.0000 0 - 5387 0 OS OS 0.000000 5.0000 0 - 5388 0 OS OS 0.000000 5.0000 0 - 5389 0 OS OS 0.000000 5.0000 0 - 5390 0 OS OS 0.000000 5.0000 0 - 5391 0 OS OS 0.000000 5.0000 0 - 5392 0 OS OS 0.000000 5.0000 0 - 5393 0 OS OS 0.000000 5.0000 0 - 5394 0 OS OS 0.000000 5.0000 0 - 5395 0 OS OS 0.000000 5.0000 0 - 5396 0 OS OS 0.000000 5.0000 0 - 5397 0 OS OS 0.000000 5.0000 0 - 5398 0 OS OS 0.000000 5.0000 0 - 5399 0 OS OS 0.000000 5.0000 0 - 5400 0 OS OS 0.000000 5.0000 0 - 5401 0 OS OS 0.000000 5.0000 0 - 5402 0 OS OS 0.000000 5.0000 0 - 5403 0 OS OS 0.000000 5.0000 0 - 5404 0 OS OS 0.000000 5.0000 0 - 5405 0 OS OS 0.000000 5.0000 0 - 5406 0 OS OS 0.000000 5.0000 0 - 5407 0 OS OS 0.000000 5.0000 0 - 5408 0 OS OS 0.000000 5.0000 0 - 5409 0 OS OS 0.000000 5.0000 0 - 5410 0 OS OS 0.000000 5.0000 0 - 5411 0 OS OS 0.000000 5.0000 0 - 5412 0 OS OS 0.000000 5.0000 0 - 5413 0 OS OS 0.000000 5.0000 0 - 5414 0 OS OS 0.000000 5.0000 0 - 5415 0 OS OS 0.000000 5.0000 0 - 5416 0 OS OS 0.000000 5.0000 0 - 5417 0 OS OS 0.000000 5.0000 0 - 5418 0 OS OS 0.000000 5.0000 0 - 5419 0 OS OS 0.000000 5.0000 0 - 5420 0 OS OS 0.000000 5.0000 0 - 5421 0 OS OS 0.000000 5.0000 0 - 5422 0 OS OS 0.000000 5.0000 0 - 5423 0 OS OS 0.000000 5.0000 0 - 5424 0 OS OS 0.000000 5.0000 0 - 5425 0 OS OS 0.000000 5.0000 0 - 5426 0 OS OS 0.000000 5.0000 0 - 5427 0 OS OS 0.000000 5.0000 0 - 5428 0 OS OS 0.000000 5.0000 0 - 5429 0 OS OS 0.000000 5.0000 0 - 5430 0 OS OS 0.000000 5.0000 0 - 5431 0 OS OS 0.000000 5.0000 0 - 5432 0 OS OS 0.000000 5.0000 0 - 5433 0 OS OS 0.000000 5.0000 0 - 5434 0 OS OS 0.000000 5.0000 0 - 5435 0 OS OS 0.000000 5.0000 0 - 5436 0 OS OS 0.000000 5.0000 0 - 5437 0 OS OS 0.000000 5.0000 0 - 5438 0 OS OS 0.000000 5.0000 0 - 5439 0 OS OS 0.000000 5.0000 0 - 5440 0 OS OS 0.000000 5.0000 0 - 5441 0 OS OS 0.000000 5.0000 0 - 5442 0 OS OS 0.000000 5.0000 0 - 5443 0 OS OS 0.000000 5.0000 0 - 5444 0 OS OS 0.000000 5.0000 0 - 5445 0 OS OS 0.000000 5.0000 0 - 5446 0 OS OS 0.000000 5.0000 0 - 5447 0 OS OS 0.000000 5.0000 0 - 5448 0 OS OS 0.000000 5.0000 0 - 5449 0 OS OS 0.000000 5.0000 0 - 5450 0 OS OS 0.000000 5.0000 0 - 5451 0 OS OS 0.000000 5.0000 0 - 5452 0 OS OS 0.000000 5.0000 0 - 5453 0 OS OS 0.000000 5.0000 0 - 5454 0 OS OS 0.000000 5.0000 0 - 5455 0 OS OS 0.000000 5.0000 0 - 5456 0 OS OS 0.000000 5.0000 0 - 5457 0 OS OS 0.000000 5.0000 0 - 5458 0 OS OS 0.000000 5.0000 0 - 5459 0 OS OS 0.000000 5.0000 0 - 5460 0 OS OS 0.000000 5.0000 0 - 5461 0 OS OS 0.000000 5.0000 0 - 5462 0 OS OS 0.000000 5.0000 0 - 5463 0 OS OS 0.000000 5.0000 0 - 5464 0 OS OS 0.000000 5.0000 0 - 5465 0 OS OS 0.000000 5.0000 0 - 5466 0 OS OS 0.000000 5.0000 0 - 5467 0 OS OS 0.000000 5.0000 0 - 5468 0 OS OS 0.000000 5.0000 0 - 5469 0 OS OS 0.000000 5.0000 0 - 5470 0 OS OS 0.000000 5.0000 0 - 5471 0 OS OS 0.000000 5.0000 0 - 5472 0 OS OS 0.000000 5.0000 0 - 5473 0 OS OS 0.000000 5.0000 0 - 5474 0 OS OS 0.000000 5.0000 0 - 5475 0 OS OS 0.000000 5.0000 0 - 5476 0 OS OS 0.000000 5.0000 0 - 5477 0 OS OS 0.000000 5.0000 0 - 5478 0 OS OS 0.000000 5.0000 0 - 5479 0 OS OS 0.000000 5.0000 0 - 5480 0 OS OS 0.000000 5.0000 0 - 5481 0 OS OS 0.000000 5.0000 0 - 5482 0 OS OS 0.000000 5.0000 0 - 5483 0 OS OS 0.000000 5.0000 0 - 5484 0 OS OS 0.000000 5.0000 0 - 5485 0 OS OS 0.000000 5.0000 0 - 5486 0 OS OS 0.000000 5.0000 0 - 5487 0 OS OS 0.000000 5.0000 0 - 5488 0 OS OS 0.000000 5.0000 0 - 5489 0 OS OS 0.000000 5.0000 0 - 5490 0 OS OS 0.000000 5.0000 0 - 5491 0 OS OS 0.000000 5.0000 0 - 5492 0 OS OS 0.000000 5.0000 0 - 5493 0 OS OS 0.000000 5.0000 0 - 5494 0 OS OS 0.000000 5.0000 0 - 5495 0 OS OS 0.000000 5.0000 0 - 5496 0 OS OS 0.000000 5.0000 0 - 5497 0 OS OS 0.000000 5.0000 0 - 5498 0 OS OS 0.000000 5.0000 0 - 5499 0 OS OS 0.000000 5.0000 0 - 5500 0 OS OS 0.000000 5.0000 0 - 5501 0 OS OS 0.000000 5.0000 0 - 5502 0 OS OS 0.000000 5.0000 0 - 5503 0 OS OS 0.000000 5.0000 0 - 5504 0 OS OS 0.000000 5.0000 0 - 5505 0 OS OS 0.000000 5.0000 0 - 5506 0 OS OS 0.000000 5.0000 0 - 5507 0 OS OS 0.000000 5.0000 0 - 5508 0 OS OS 0.000000 5.0000 0 - 5509 0 OS OS 0.000000 5.0000 0 - 5510 0 OS OS 0.000000 5.0000 0 - 5511 0 OS OS 0.000000 5.0000 0 - 5512 0 OS OS 0.000000 5.0000 0 - 5513 0 OS OS 0.000000 5.0000 0 - 5514 0 OS OS 0.000000 5.0000 0 - 5515 0 OS OS 0.000000 5.0000 0 - 5516 0 OS OS 0.000000 5.0000 0 - 5517 0 OS OS 0.000000 5.0000 0 - 5518 0 OS OS 0.000000 5.0000 0 - 5519 0 OS OS 0.000000 5.0000 0 - 5520 0 OS OS 0.000000 5.0000 0 - 5521 0 OS OS 0.000000 5.0000 0 - 5522 0 OS OS 0.000000 5.0000 0 - 5523 0 OS OS 0.000000 5.0000 0 - 5524 0 OS OS 0.000000 5.0000 0 - 5525 0 OS OS 0.000000 5.0000 0 - 5526 0 OS OS 0.000000 5.0000 0 - 5527 0 OS OS 0.000000 5.0000 0 - 5528 0 OS OS 0.000000 5.0000 0 - 5529 0 OS OS 0.000000 5.0000 0 - 5530 0 OS OS 0.000000 5.0000 0 - 5531 0 OS OS 0.000000 5.0000 0 - 5532 0 OS OS 0.000000 5.0000 0 - 5533 0 OS OS 0.000000 5.0000 0 - 5534 0 OS OS 0.000000 5.0000 0 - 5535 0 OS OS 0.000000 5.0000 0 - 5536 0 OS OS 0.000000 5.0000 0 - 5537 0 OS OS 0.000000 5.0000 0 - 5538 0 OS OS 0.000000 5.0000 0 - 5539 0 OS OS 0.000000 5.0000 0 - 5540 0 OS OS 0.000000 5.0000 0 - 5541 0 OS OS 0.000000 5.0000 0 - 5542 0 OS OS 0.000000 5.0000 0 - 5543 0 OS OS 0.000000 5.0000 0 - 5544 0 OS OS 0.000000 5.0000 0 - 5545 0 OS OS 0.000000 5.0000 0 - 5546 0 OS OS 0.000000 5.0000 0 - 5547 0 OS OS 0.000000 5.0000 0 - 5548 0 OS OS 0.000000 5.0000 0 - 5549 0 OS OS 0.000000 5.0000 0 - 5550 0 OS OS 0.000000 5.0000 0 - 5551 0 OS OS 0.000000 5.0000 0 - 5552 0 OS OS 0.000000 5.0000 0 - 5553 0 OS OS 0.000000 5.0000 0 - 5554 0 OS OS 0.000000 5.0000 0 - 5555 0 OS OS 0.000000 5.0000 0 - 5556 0 OS OS 0.000000 5.0000 0 - 5557 0 OS OS 0.000000 5.0000 0 - 5558 0 OS OS 0.000000 5.0000 0 - 5559 0 OS OS 0.000000 5.0000 0 - 5560 0 OS OS 0.000000 5.0000 0 - 5561 0 OS OS 0.000000 5.0000 0 - 5562 0 OS OS 0.000000 5.0000 0 - 5563 0 OS OS 0.000000 5.0000 0 - 5564 0 OS OS 0.000000 5.0000 0 - 5565 0 OS OS 0.000000 5.0000 0 - 5566 0 OS OS 0.000000 5.0000 0 - 5567 0 OS OS 0.000000 5.0000 0 - 5568 0 OS OS 0.000000 5.0000 0 - 5569 0 OS OS 0.000000 5.0000 0 - 5570 0 OS OS 0.000000 5.0000 0 - 5571 0 OS OS 0.000000 5.0000 0 - 5572 0 OS OS 0.000000 5.0000 0 - 5573 0 OS OS 0.000000 5.0000 0 - 5574 0 OS OS 0.000000 5.0000 0 - 5575 0 OS OS 0.000000 5.0000 0 - 5576 0 OS OS 0.000000 5.0000 0 - 5577 0 OS OS 0.000000 5.0000 0 - 5578 0 OS OS 0.000000 5.0000 0 - 5579 0 OS OS 0.000000 5.0000 0 - 5580 0 OS OS 0.000000 5.0000 0 - 5581 0 OS OS 0.000000 5.0000 0 - 5582 0 OS OS 0.000000 5.0000 0 - 5583 0 OS OS 0.000000 5.0000 0 - 5584 0 OS OS 0.000000 5.0000 0 - 5585 0 OS OS 0.000000 5.0000 0 - 5586 0 OS OS 0.000000 5.0000 0 - 5587 0 OS OS 0.000000 5.0000 0 - 5588 0 OS OS 0.000000 5.0000 0 - 5589 0 OS OS 0.000000 5.0000 0 - 5590 0 OS OS 0.000000 5.0000 0 - 5591 0 OS OS 0.000000 5.0000 0 - 5592 0 OS OS 0.000000 5.0000 0 - 5593 0 OS OS 0.000000 5.0000 0 - 5594 0 OS OS 0.000000 5.0000 0 - 5595 0 OS OS 0.000000 5.0000 0 - 5596 0 OS OS 0.000000 5.0000 0 - 5597 0 OS OS 0.000000 5.0000 0 - 5598 0 OS OS 0.000000 5.0000 0 - 5599 0 OS OS 0.000000 5.0000 0 - 5600 0 OS OS 0.000000 5.0000 0 - 5601 0 OS OS 0.000000 5.0000 0 - 5602 0 OS OS 0.000000 5.0000 0 - 5603 0 OS OS 0.000000 5.0000 0 - 5604 0 OS OS 0.000000 5.0000 0 - 5605 0 OS OS 0.000000 5.0000 0 - 5606 0 OS OS 0.000000 5.0000 0 - 5607 0 OS OS 0.000000 5.0000 0 - 5608 0 OS OS 0.000000 5.0000 0 - 5609 0 OS OS 0.000000 5.0000 0 - 5610 0 OS OS 0.000000 5.0000 0 - 5611 0 OS OS 0.000000 5.0000 0 - 5612 0 OS OS 0.000000 5.0000 0 - 5613 0 OS OS 0.000000 5.0000 0 - 5614 0 OS OS 0.000000 5.0000 0 - 5615 0 OS OS 0.000000 5.0000 0 - 5616 0 OS OS 0.000000 5.0000 0 - 5617 0 OS OS 0.000000 5.0000 0 - 5618 0 OS OS 0.000000 5.0000 0 - 5619 0 OS OS 0.000000 5.0000 0 - 5620 0 OS OS 0.000000 5.0000 0 - 5621 0 OS OS 0.000000 5.0000 0 - 5622 0 OS OS 0.000000 5.0000 0 - 5623 0 OS OS 0.000000 5.0000 0 - 5624 0 OS OS 0.000000 5.0000 0 - 5625 0 OS OS 0.000000 5.0000 0 - 5626 0 OS OS 0.000000 5.0000 0 - 5627 0 OS OS 0.000000 5.0000 0 - 5628 0 OS OS 0.000000 5.0000 0 - 5629 0 OS OS 0.000000 5.0000 0 - 5630 0 OS OS 0.000000 5.0000 0 - 5631 0 OS OS 0.000000 5.0000 0 - 5632 0 OS OS 0.000000 5.0000 0 - 5633 0 OS OS 0.000000 5.0000 0 - 5634 0 OS OS 0.000000 5.0000 0 - 5635 0 OS OS 0.000000 5.0000 0 - 5636 0 OS OS 0.000000 5.0000 0 - 5637 0 OS OS 0.000000 5.0000 0 - 5638 0 OS OS 0.000000 5.0000 0 - 5639 0 OS OS 0.000000 5.0000 0 - 5640 0 OS OS 0.000000 5.0000 0 - 5641 0 OS OS 0.000000 5.0000 0 - 5642 0 OS OS 0.000000 5.0000 0 - 5643 0 OS OS 0.000000 5.0000 0 - 5644 0 OS OS 0.000000 5.0000 0 - 5645 0 OS OS 0.000000 5.0000 0 - 5646 0 OS OS 0.000000 5.0000 0 - 5647 0 OS OS 0.000000 5.0000 0 - 5648 0 OS OS 0.000000 5.0000 0 - 5649 0 OS OS 0.000000 5.0000 0 - 5650 0 OS OS 0.000000 5.0000 0 - 5651 0 OS OS 0.000000 5.0000 0 - 5652 0 OS OS 0.000000 5.0000 0 - 5653 0 OS OS 0.000000 5.0000 0 - 5654 0 OS OS 0.000000 5.0000 0 - 5655 0 OS OS 0.000000 5.0000 0 - 5656 0 OS OS 0.000000 5.0000 0 - 5657 0 OS OS 0.000000 5.0000 0 - 5658 0 OS OS 0.000000 5.0000 0 - 5659 0 OS OS 0.000000 5.0000 0 - 5660 0 OS OS 0.000000 5.0000 0 - 5661 0 OS OS 0.000000 5.0000 0 - 5662 0 OS OS 0.000000 5.0000 0 - 5663 0 OS OS 0.000000 5.0000 0 - 5664 0 OS OS 0.000000 5.0000 0 - 5665 0 OS OS 0.000000 5.0000 0 - 5666 0 OS OS 0.000000 5.0000 0 - 5667 0 OS OS 0.000000 5.0000 0 - 5668 0 OS OS 0.000000 5.0000 0 - 5669 0 OS OS 0.000000 5.0000 0 - 5670 0 OS OS 0.000000 5.0000 0 - 5671 0 OS OS 0.000000 5.0000 0 - 5672 0 OS OS 0.000000 5.0000 0 - 5673 0 OS OS 0.000000 5.0000 0 - 5674 0 OS OS 0.000000 5.0000 0 - 5675 0 OS OS 0.000000 5.0000 0 - 5676 0 OS OS 0.000000 5.0000 0 - 5677 0 OS OS 0.000000 5.0000 0 - 5678 0 OS OS 0.000000 5.0000 0 - 5679 0 OS OS 0.000000 5.0000 0 - 5680 0 OS OS 0.000000 5.0000 0 - 5681 0 OS OS 0.000000 5.0000 0 - 5682 0 OS OS 0.000000 5.0000 0 - 5683 0 OS OS 0.000000 5.0000 0 - 5684 0 OS OS 0.000000 5.0000 0 - 5685 0 OS OS 0.000000 5.0000 0 - 5686 0 OS OS 0.000000 5.0000 0 - 5687 0 OS OS 0.000000 5.0000 0 - 5688 0 OS OS 0.000000 5.0000 0 - 5689 0 OS OS 0.000000 5.0000 0 - 5690 0 OS OS 0.000000 5.0000 0 - 5691 0 OS OS 0.000000 5.0000 0 - 5692 0 OS OS 0.000000 5.0000 0 - 5693 0 OS OS 0.000000 5.0000 0 - 5694 0 OS OS 0.000000 5.0000 0 - 5695 0 OS OS 0.000000 5.0000 0 - 5696 0 OS OS 0.000000 5.0000 0 - 5697 0 OS OS 0.000000 5.0000 0 - 5698 0 OS OS 0.000000 5.0000 0 - 5699 0 OS OS 0.000000 5.0000 0 - 5700 0 OS OS 0.000000 5.0000 0 - 5701 0 OS OS 0.000000 5.0000 0 - 5702 0 OS OS 0.000000 5.0000 0 - 5703 0 OS OS 0.000000 5.0000 0 - 5704 0 OS OS 0.000000 5.0000 0 - 5705 0 OS OS 0.000000 5.0000 0 - 5706 0 OS OS 0.000000 5.0000 0 - 5707 0 OS OS 0.000000 5.0000 0 - 5708 0 OS OS 0.000000 5.0000 0 - 5709 0 OS OS 0.000000 5.0000 0 - 5710 0 OS OS 0.000000 5.0000 0 - 5711 0 OS OS 0.000000 5.0000 0 - 5712 0 OS OS 0.000000 5.0000 0 - 5713 0 OS OS 0.000000 5.0000 0 - 5714 0 OS OS 0.000000 5.0000 0 - 5715 0 OS OS 0.000000 5.0000 0 - 5716 0 OS OS 0.000000 5.0000 0 - 5717 0 OS OS 0.000000 5.0000 0 - 5718 0 OS OS 0.000000 5.0000 0 - 5719 0 OS OS 0.000000 5.0000 0 - 5720 0 OS OS 0.000000 5.0000 0 - 5721 0 OS OS 0.000000 5.0000 0 - 5722 0 OS OS 0.000000 5.0000 0 - 5723 0 OS OS 0.000000 5.0000 0 - 5724 0 OS OS 0.000000 5.0000 0 - 5725 0 OS OS 0.000000 5.0000 0 - 5726 0 OS OS 0.000000 5.0000 0 - 5727 0 OS OS 0.000000 5.0000 0 - 5728 0 OS OS 0.000000 5.0000 0 - 5729 0 OS OS 0.000000 5.0000 0 - 5730 0 OS OS 0.000000 5.0000 0 - 5731 0 OS OS 0.000000 5.0000 0 - 5732 0 OS OS 0.000000 5.0000 0 - 5733 0 OS OS 0.000000 5.0000 0 - 5734 0 OS OS 0.000000 5.0000 0 - 5735 0 OS OS 0.000000 5.0000 0 - 5736 0 OS OS 0.000000 5.0000 0 - 5737 0 OS OS 0.000000 5.0000 0 - 5738 0 OS OS 0.000000 5.0000 0 - 5739 0 OS OS 0.000000 5.0000 0 - 5740 0 OS OS 0.000000 5.0000 0 - 5741 0 OS OS 0.000000 5.0000 0 - 5742 0 OS OS 0.000000 5.0000 0 - 5743 0 OS OS 0.000000 5.0000 0 - 5744 0 OS OS 0.000000 5.0000 0 - 5745 0 OS OS 0.000000 5.0000 0 - 5746 0 OS OS 0.000000 5.0000 0 - 5747 0 OS OS 0.000000 5.0000 0 - 5748 0 OS OS 0.000000 5.0000 0 - 5749 0 OS OS 0.000000 5.0000 0 - 5750 0 OS OS 0.000000 5.0000 0 - 5751 0 OS OS 0.000000 5.0000 0 - 5752 0 OS OS 0.000000 5.0000 0 - 5753 0 OS OS 0.000000 5.0000 0 - 5754 0 OS OS 0.000000 5.0000 0 - 5755 0 OS OS 0.000000 5.0000 0 - 5756 0 OS OS 0.000000 5.0000 0 - 5757 0 OS OS 0.000000 5.0000 0 - 5758 0 OS OS 0.000000 5.0000 0 - 5759 0 OS OS 0.000000 5.0000 0 - 5760 0 OS OS 0.000000 5.0000 0 - 5761 0 OS OS 0.000000 5.0000 0 - 5762 0 OS OS 0.000000 5.0000 0 - 5763 0 OS OS 0.000000 5.0000 0 - 5764 0 OS OS 0.000000 5.0000 0 - 5765 0 OS OS 0.000000 5.0000 0 - 5766 0 OS OS 0.000000 5.0000 0 - 5767 0 OS OS 0.000000 5.0000 0 - 5768 0 OS OS 0.000000 5.0000 0 - 5769 0 OS OS 0.000000 5.0000 0 - 5770 0 OS OS 0.000000 5.0000 0 - 5771 0 OS OS 0.000000 5.0000 0 - 5772 0 OS OS 0.000000 5.0000 0 - 5773 0 OS OS 0.000000 5.0000 0 - 5774 0 OS OS 0.000000 5.0000 0 - 5775 0 OS OS 0.000000 5.0000 0 - 5776 0 OS OS 0.000000 5.0000 0 - 5777 0 OS OS 0.000000 5.0000 0 - 5778 0 OS OS 0.000000 5.0000 0 - 5779 0 OS OS 0.000000 5.0000 0 - 5780 0 OS OS 0.000000 5.0000 0 - 5781 0 OS OS 0.000000 5.0000 0 - 5782 0 OS OS 0.000000 5.0000 0 - 5783 0 OS OS 0.000000 5.0000 0 - 5784 0 OS OS 0.000000 5.0000 0 - 5785 0 OS OS 0.000000 5.0000 0 - 5786 0 OS OS 0.000000 5.0000 0 - 5787 0 OS OS 0.000000 5.0000 0 - 5788 0 OS OS 0.000000 5.0000 0 - 5789 0 OS OS 0.000000 5.0000 0 - 5790 0 OS OS 0.000000 5.0000 0 - 5791 0 OS OS 0.000000 5.0000 0 - 5792 0 OS OS 0.000000 5.0000 0 - 5793 0 OS OS 0.000000 5.0000 0 - 5794 0 OS OS 0.000000 5.0000 0 - 5795 0 OS OS 0.000000 5.0000 0 - 5796 0 OS OS 0.000000 5.0000 0 - 5797 0 OS OS 0.000000 5.0000 0 - 5798 0 OS OS 0.000000 5.0000 0 - 5799 0 OS OS 0.000000 5.0000 0 - 5800 0 OS OS 0.000000 5.0000 0 - 5801 0 OS OS 0.000000 5.0000 0 - 5802 0 OS OS 0.000000 5.0000 0 - 5803 0 OS OS 0.000000 5.0000 0 - 5804 0 OS OS 0.000000 5.0000 0 - 5805 0 OS OS 0.000000 5.0000 0 - 5806 0 OS OS 0.000000 5.0000 0 - 5807 0 OS OS 0.000000 5.0000 0 - 5808 0 OS OS 0.000000 5.0000 0 - 5809 0 OS OS 0.000000 5.0000 0 - 5810 0 OS OS 0.000000 5.0000 0 - 5811 0 OS OS 0.000000 5.0000 0 - 5812 0 OS OS 0.000000 5.0000 0 - 5813 0 OS OS 0.000000 5.0000 0 - 5814 0 OS OS 0.000000 5.0000 0 - 5815 0 OS OS 0.000000 5.0000 0 - 5816 0 OS OS 0.000000 5.0000 0 - 5817 0 OS OS 0.000000 5.0000 0 - 5818 0 OS OS 0.000000 5.0000 0 - 5819 0 OS OS 0.000000 5.0000 0 - 5820 0 OS OS 0.000000 5.0000 0 - 5821 0 OS OS 0.000000 5.0000 0 - 5822 0 OS OS 0.000000 5.0000 0 - 5823 0 OS OS 0.000000 5.0000 0 - 5824 0 OS OS 0.000000 5.0000 0 - 5825 0 OS OS 0.000000 5.0000 0 - 5826 0 OS OS 0.000000 5.0000 0 - 5827 0 OS OS 0.000000 5.0000 0 - 5828 0 OS OS 0.000000 5.0000 0 - 5829 0 OS OS 0.000000 5.0000 0 - 5830 0 OS OS 0.000000 5.0000 0 - 5831 0 OS OS 0.000000 5.0000 0 - 5832 0 OS OS 0.000000 5.0000 0 - 5833 0 OS OS 0.000000 5.0000 0 - 5834 0 OS OS 0.000000 5.0000 0 - 5835 0 OS OS 0.000000 5.0000 0 - 5836 0 OS OS 0.000000 5.0000 0 - 5837 0 OS OS 0.000000 5.0000 0 - 5838 0 OS OS 0.000000 5.0000 0 - 5839 0 OS OS 0.000000 5.0000 0 - 5840 0 OS OS 0.000000 5.0000 0 - 5841 0 OS OS 0.000000 5.0000 0 - 5842 0 OS OS 0.000000 5.0000 0 - 5843 0 OS OS 0.000000 5.0000 0 - 5844 0 OS OS 0.000000 5.0000 0 - 5845 0 OS OS 0.000000 5.0000 0 - 5846 0 OS OS 0.000000 5.0000 0 - 5847 0 OS OS 0.000000 5.0000 0 - 5848 0 OS OS 0.000000 5.0000 0 - 5849 0 OS OS 0.000000 5.0000 0 - 5850 0 OS OS 0.000000 5.0000 0 - 5851 0 OS OS 0.000000 5.0000 0 - 5852 0 OS OS 0.000000 5.0000 0 - 5853 0 OS OS 0.000000 5.0000 0 - 5854 0 OS OS 0.000000 5.0000 0 - 5855 0 OS OS 0.000000 5.0000 0 - 5856 0 OS OS 0.000000 5.0000 0 - 5857 0 OS OS 0.000000 5.0000 0 - 5858 0 OS OS 0.000000 5.0000 0 - 5859 0 OS OS 0.000000 5.0000 0 - 5860 0 OS OS 0.000000 5.0000 0 - 5861 0 OS OS 0.000000 5.0000 0 - 5862 0 OS OS 0.000000 5.0000 0 - 5863 0 OS OS 0.000000 5.0000 0 - 5864 0 OS OS 0.000000 5.0000 0 - 5865 0 OS OS 0.000000 5.0000 0 - 5866 0 OS OS 0.000000 5.0000 0 - 5867 0 OS OS 0.000000 5.0000 0 - 5868 0 OS OS 0.000000 5.0000 0 - 5869 0 OS OS 0.000000 5.0000 0 - 5870 0 OS OS 0.000000 5.0000 0 - 5871 0 OS OS 0.000000 5.0000 0 - 5872 0 OS OS 0.000000 5.0000 0 - 5873 0 OS OS 0.000000 5.0000 0 - 5874 0 OS OS 0.000000 5.0000 0 - 5875 0 OS OS 0.000000 5.0000 0 - 5876 0 OS OS 0.000000 5.0000 0 - 5877 0 OS OS 0.000000 5.0000 0 - 5878 0 OS OS 0.000000 5.0000 0 - 5879 0 OS OS 0.000000 5.0000 0 - 5880 0 OS OS 0.000000 5.0000 0 - 5881 0 OS OS 0.000000 5.0000 0 - 5882 0 OS OS 0.000000 5.0000 0 - 5883 0 OS OS 0.000000 5.0000 0 - 5884 0 OS OS 0.000000 5.0000 0 - 5885 0 OS OS 0.000000 5.0000 0 - 5886 0 OS OS 0.000000 5.0000 0 - 5887 0 OS OS 0.000000 5.0000 0 - 5888 0 OS OS 0.000000 5.0000 0 - 5889 0 OS OS 0.000000 5.0000 0 - 5890 0 OS OS 0.000000 5.0000 0 - 5891 0 OS OS 0.000000 5.0000 0 - 5892 0 OS OS 0.000000 5.0000 0 - 5893 0 OS OS 0.000000 5.0000 0 - 5894 0 OS OS 0.000000 5.0000 0 - 5895 0 OS OS 0.000000 5.0000 0 - 5896 0 OS OS 0.000000 5.0000 0 - 5897 0 OS OS 0.000000 5.0000 0 - 5898 0 OS OS 0.000000 5.0000 0 - 5899 0 OS OS 0.000000 5.0000 0 - 5900 0 OS OS 0.000000 5.0000 0 - 5901 0 OS OS 0.000000 5.0000 0 - 5902 0 OS OS 0.000000 5.0000 0 - 5903 0 OS OS 0.000000 5.0000 0 - 5904 0 OS OS 0.000000 5.0000 0 - 5905 0 OS OS 0.000000 5.0000 0 - 5906 0 OS OS 0.000000 5.0000 0 - 5907 0 OS OS 0.000000 5.0000 0 - 5908 0 OS OS 0.000000 5.0000 0 - 5909 0 OS OS 0.000000 5.0000 0 - 5910 0 OS OS 0.000000 5.0000 0 - 5911 0 OS OS 0.000000 5.0000 0 - 5912 0 OS OS 0.000000 5.0000 0 - 5913 0 OS OS 0.000000 5.0000 0 - 5914 0 OS OS 0.000000 5.0000 0 - 5915 0 OS OS 0.000000 5.0000 0 - 5916 0 OS OS 0.000000 5.0000 0 - 5917 0 OS OS 0.000000 5.0000 0 - 5918 0 OS OS 0.000000 5.0000 0 - 5919 0 OS OS 0.000000 5.0000 0 - 5920 0 OS OS 0.000000 5.0000 0 - 5921 0 OS OS 0.000000 5.0000 0 - 5922 0 OS OS 0.000000 5.0000 0 - 5923 0 OS OS 0.000000 5.0000 0 - 5924 0 OS OS 0.000000 5.0000 0 - 5925 0 OS OS 0.000000 5.0000 0 - 5926 0 OS OS 0.000000 5.0000 0 - 5927 0 OS OS 0.000000 5.0000 0 - 5928 0 OS OS 0.000000 5.0000 0 - 5929 0 OS OS 0.000000 5.0000 0 - 5930 0 OS OS 0.000000 5.0000 0 - 5931 0 OS OS 0.000000 5.0000 0 - 5932 0 OS OS 0.000000 5.0000 0 - 5933 0 OS OS 0.000000 5.0000 0 - 5934 0 OS OS 0.000000 5.0000 0 - 5935 0 OS OS 0.000000 5.0000 0 - 5936 0 OS OS 0.000000 5.0000 0 - 5937 0 OS OS 0.000000 5.0000 0 - 5938 0 OS OS 0.000000 5.0000 0 - 5939 0 OS OS 0.000000 5.0000 0 - 5940 0 OS OS 0.000000 5.0000 0 - 5941 0 OS OS 0.000000 5.0000 0 - 5942 0 OS OS 0.000000 5.0000 0 - 5943 0 OS OS 0.000000 5.0000 0 - 5944 0 OS OS 0.000000 5.0000 0 - 5945 0 OS OS 0.000000 5.0000 0 - 5946 0 OS OS 0.000000 5.0000 0 - 5947 0 OS OS 0.000000 5.0000 0 - 5948 0 OS OS 0.000000 5.0000 0 - 5949 0 OS OS 0.000000 5.0000 0 - 5950 0 OS OS 0.000000 5.0000 0 - 5951 0 OS OS 0.000000 5.0000 0 - 5952 0 OS OS 0.000000 5.0000 0 - 5953 0 OS OS 0.000000 5.0000 0 - 5954 0 OS OS 0.000000 5.0000 0 - 5955 0 OS OS 0.000000 5.0000 0 - 5956 0 OS OS 0.000000 5.0000 0 - 5957 0 OS OS 0.000000 5.0000 0 - 5958 0 OS OS 0.000000 5.0000 0 - 5959 0 OS OS 0.000000 5.0000 0 - 5960 0 OS OS 0.000000 5.0000 0 - 5961 0 OS OS 0.000000 5.0000 0 - 5962 0 OS OS 0.000000 5.0000 0 - 5963 0 OS OS 0.000000 5.0000 0 - 5964 0 OS OS 0.000000 5.0000 0 - 5965 0 OS OS 0.000000 5.0000 0 - 5966 0 OS OS 0.000000 5.0000 0 - 5967 0 OS OS 0.000000 5.0000 0 - 5968 0 OS OS 0.000000 5.0000 0 - 5969 0 OS OS 0.000000 5.0000 0 - 5970 0 OS OS 0.000000 5.0000 0 - 5971 0 OS OS 0.000000 5.0000 0 - 5972 0 OS OS 0.000000 5.0000 0 - 5973 0 OS OS 0.000000 5.0000 0 - 5974 0 OS OS 0.000000 5.0000 0 - 5975 0 OS OS 0.000000 5.0000 0 - 5976 0 OS OS 0.000000 5.0000 0 - 5977 0 OS OS 0.000000 5.0000 0 - 5978 0 OS OS 0.000000 5.0000 0 - 5979 0 OS OS 0.000000 5.0000 0 - 5980 0 OS OS 0.000000 5.0000 0 - 5981 0 OS OS 0.000000 5.0000 0 - 5982 0 OS OS 0.000000 5.0000 0 - 5983 0 OS OS 0.000000 5.0000 0 - 5984 0 OS OS 0.000000 5.0000 0 - 5985 0 OS OS 0.000000 5.0000 0 - 5986 0 OS OS 0.000000 5.0000 0 - 5987 0 OS OS 0.000000 5.0000 0 - 5988 0 OS OS 0.000000 5.0000 0 - 5989 0 OS OS 0.000000 5.0000 0 - 5990 0 OS OS 0.000000 5.0000 0 - 5991 0 OS OS 0.000000 5.0000 0 - 5992 0 OS OS 0.000000 5.0000 0 - 5993 0 OS OS 0.000000 5.0000 0 - 5994 0 OS OS 0.000000 5.0000 0 - 5995 0 OS OS 0.000000 5.0000 0 - 5996 0 OS OS 0.000000 5.0000 0 - 5997 0 OS OS 0.000000 5.0000 0 - 5998 0 OS OS 0.000000 5.0000 0 - 5999 0 OS OS 0.000000 5.0000 0 - 6000 0 OS OS 0.000000 5.0000 0 - 6001 0 OS OS 0.000000 5.0000 0 - 6002 0 OS OS 0.000000 5.0000 0 - 6003 0 OS OS 0.000000 5.0000 0 - 6004 0 OS OS 0.000000 5.0000 0 - 6005 0 OS OS 0.000000 5.0000 0 - 6006 0 OS OS 0.000000 5.0000 0 - 6007 0 OS OS 0.000000 5.0000 0 - 6008 0 OS OS 0.000000 5.0000 0 - 6009 0 OS OS 0.000000 5.0000 0 - 6010 0 OS OS 0.000000 5.0000 0 - 6011 0 OS OS 0.000000 5.0000 0 - 6012 0 OS OS 0.000000 5.0000 0 - 6013 0 OS OS 0.000000 5.0000 0 - 6014 0 OS OS 0.000000 5.0000 0 - 6015 0 OS OS 0.000000 5.0000 0 - 6016 0 OS OS 0.000000 5.0000 0 - 6017 0 OS OS 0.000000 5.0000 0 - 6018 0 OS OS 0.000000 5.0000 0 - 6019 0 OS OS 0.000000 5.0000 0 - 6020 0 OS OS 0.000000 5.0000 0 - 6021 0 OS OS 0.000000 5.0000 0 - 6022 0 OS OS 0.000000 5.0000 0 - 6023 0 OS OS 0.000000 5.0000 0 - 6024 0 OS OS 0.000000 5.0000 0 - 6025 0 OS OS 0.000000 5.0000 0 - 6026 0 OS OS 0.000000 5.0000 0 - 6027 0 OS OS 0.000000 5.0000 0 - 6028 0 OS OS 0.000000 5.0000 0 - 6029 0 OS OS 0.000000 5.0000 0 - 6030 0 OS OS 0.000000 5.0000 0 - 6031 0 OS OS 0.000000 5.0000 0 - 6032 0 OS OS 0.000000 5.0000 0 - 6033 0 OS OS 0.000000 5.0000 0 - 6034 0 OS OS 0.000000 5.0000 0 - 6035 0 OS OS 0.000000 5.0000 0 - 6036 0 OS OS 0.000000 5.0000 0 - 6037 0 OS OS 0.000000 5.0000 0 - 6038 0 OS OS 0.000000 5.0000 0 - 6039 0 OS OS 0.000000 5.0000 0 - 6040 0 OS OS 0.000000 5.0000 0 - 6041 0 OS OS 0.000000 5.0000 0 - 6042 0 OS OS 0.000000 5.0000 0 - 6043 0 OS OS 0.000000 5.0000 0 - 6044 0 OS OS 0.000000 5.0000 0 - 6045 0 OS OS 0.000000 5.0000 0 - 6046 0 OS OS 0.000000 5.0000 0 - 6047 0 OS OS 0.000000 5.0000 0 - 6048 0 OS OS 0.000000 5.0000 0 - 6049 0 OS OS 0.000000 5.0000 0 - 6050 0 OS OS 0.000000 5.0000 0 - 6051 0 OS OS 0.000000 5.0000 0 - 6052 0 OS OS 0.000000 5.0000 0 - 6053 0 OS OS 0.000000 5.0000 0 - 6054 0 OS OS 0.000000 5.0000 0 - 6055 0 OS OS 0.000000 5.0000 0 - 6056 0 OS OS 0.000000 5.0000 0 - 6057 0 OS OS 0.000000 5.0000 0 - 6058 0 OS OS 0.000000 5.0000 0 - 6059 0 OS OS 0.000000 5.0000 0 - 6060 0 OS OS 0.000000 5.0000 0 - 6061 0 OS OS 0.000000 5.0000 0 - 6062 0 OS OS 0.000000 5.0000 0 - 6063 0 OS OS 0.000000 5.0000 0 - 6064 0 OS OS 0.000000 5.0000 0 - 6065 0 OS OS 0.000000 5.0000 0 - 6066 0 OS OS 0.000000 5.0000 0 - 6067 0 OS OS 0.000000 5.0000 0 - 6068 0 OS OS 0.000000 5.0000 0 - 6069 0 OS OS 0.000000 5.0000 0 - 6070 0 OS OS 0.000000 5.0000 0 - 6071 0 OS OS 0.000000 5.0000 0 - 6072 0 OS OS 0.000000 5.0000 0 - 6073 0 OS OS 0.000000 5.0000 0 - 6074 0 OS OS 0.000000 5.0000 0 - 6075 0 OS OS 0.000000 5.0000 0 - 6076 0 OS OS 0.000000 5.0000 0 - 6077 0 OS OS 0.000000 5.0000 0 - 6078 0 OS OS 0.000000 5.0000 0 - 6079 0 OS OS 0.000000 5.0000 0 - 6080 0 OS OS 0.000000 5.0000 0 - 6081 0 OS OS 0.000000 5.0000 0 - 6082 0 OS OS 0.000000 5.0000 0 - 6083 0 OS OS 0.000000 5.0000 0 - 6084 0 OS OS 0.000000 5.0000 0 - 6085 0 OS OS 0.000000 5.0000 0 - 6086 0 OS OS 0.000000 5.0000 0 - 6087 0 OS OS 0.000000 5.0000 0 - 6088 0 OS OS 0.000000 5.0000 0 - 6089 0 OS OS 0.000000 5.0000 0 - 6090 0 OS OS 0.000000 5.0000 0 - 6091 0 OS OS 0.000000 5.0000 0 - 6092 0 OS OS 0.000000 5.0000 0 - 6093 0 OS OS 0.000000 5.0000 0 - 6094 0 OS OS 0.000000 5.0000 0 - 6095 0 OS OS 0.000000 5.0000 0 - 6096 0 OS OS 0.000000 5.0000 0 - 6097 0 OS OS 0.000000 5.0000 0 - 6098 0 OS OS 0.000000 5.0000 0 - 6099 0 OS OS 0.000000 5.0000 0 - 6100 0 OS OS 0.000000 5.0000 0 - 6101 0 OS OS 0.000000 5.0000 0 - 6102 0 OS OS 0.000000 5.0000 0 - 6103 0 OS OS 0.000000 5.0000 0 - 6104 0 OS OS 0.000000 5.0000 0 - 6105 0 OS OS 0.000000 5.0000 0 - 6106 0 OS OS 0.000000 5.0000 0 - 6107 0 OS OS 0.000000 5.0000 0 - 6108 0 OS OS 0.000000 5.0000 0 - 6109 0 OS OS 0.000000 5.0000 0 - 6110 0 OS OS 0.000000 5.0000 0 - 6111 0 OS OS 0.000000 5.0000 0 - 6112 0 OS OS 0.000000 5.0000 0 - 6113 0 OS OS 0.000000 5.0000 0 - 6114 0 OS OS 0.000000 5.0000 0 - 6115 0 OS OS 0.000000 5.0000 0 - 6116 0 OS OS 0.000000 5.0000 0 - 6117 0 OS OS 0.000000 5.0000 0 - 6118 0 OS OS 0.000000 5.0000 0 - 6119 0 OS OS 0.000000 5.0000 0 - 6120 0 OS OS 0.000000 5.0000 0 - 6121 0 OS OS 0.000000 5.0000 0 - 6122 0 OS OS 0.000000 5.0000 0 - 6123 0 OS OS 0.000000 5.0000 0 - 6124 0 OS OS 0.000000 5.0000 0 - 6125 0 OS OS 0.000000 5.0000 0 - 6126 0 OS OS 0.000000 5.0000 0 - 6127 0 OS OS 0.000000 5.0000 0 - 6128 0 OS OS 0.000000 5.0000 0 - 6129 0 OS OS 0.000000 5.0000 0 - 6130 0 OS OS 0.000000 5.0000 0 - 6131 0 OS OS 0.000000 5.0000 0 - 6132 0 OS OS 0.000000 5.0000 0 - 6133 0 OS OS 0.000000 5.0000 0 - 6134 0 OS OS 0.000000 5.0000 0 - 6135 0 OS OS 0.000000 5.0000 0 - 6136 0 OS OS 0.000000 5.0000 0 - 6137 0 OS OS 0.000000 5.0000 0 - 6138 0 OS OS 0.000000 5.0000 0 - 6139 0 OS OS 0.000000 5.0000 0 - 6140 0 OS OS 0.000000 5.0000 0 - 6141 0 OS OS 0.000000 5.0000 0 - 6142 0 OS OS 0.000000 5.0000 0 - 6143 0 OS OS 0.000000 5.0000 0 - 6144 0 OS OS 0.000000 5.0000 0 - 6145 0 OS OS 0.000000 5.0000 0 - 6146 0 OS OS 0.000000 5.0000 0 - 6147 0 OS OS 0.000000 5.0000 0 - 6148 0 OS OS 0.000000 5.0000 0 - 6149 0 OS OS 0.000000 5.0000 0 - 6150 0 OS OS 0.000000 5.0000 0 - 6151 0 OS OS 0.000000 5.0000 0 - 6152 0 OS OS 0.000000 5.0000 0 - 6153 0 OS OS 0.000000 5.0000 0 - 6154 0 OS OS 0.000000 5.0000 0 - 6155 0 OS OS 0.000000 5.0000 0 - 6156 0 OS OS 0.000000 5.0000 0 - 6157 0 OS OS 0.000000 5.0000 0 - 6158 0 OS OS 0.000000 5.0000 0 - 6159 0 OS OS 0.000000 5.0000 0 - 6160 0 OS OS 0.000000 5.0000 0 - 6161 0 OS OS 0.000000 5.0000 0 - 6162 0 OS OS 0.000000 5.0000 0 - 6163 0 OS OS 0.000000 5.0000 0 - 6164 0 OS OS 0.000000 5.0000 0 - 6165 0 OS OS 0.000000 5.0000 0 - 6166 0 OS OS 0.000000 5.0000 0 - 6167 0 OS OS 0.000000 5.0000 0 - 6168 0 OS OS 0.000000 5.0000 0 - 6169 0 OS OS 0.000000 5.0000 0 - 6170 0 OS OS 0.000000 5.0000 0 - 6171 0 OS OS 0.000000 5.0000 0 - 6172 0 OS OS 0.000000 5.0000 0 - 6173 0 OS OS 0.000000 5.0000 0 - 6174 0 OS OS 0.000000 5.0000 0 - 6175 0 OS OS 0.000000 5.0000 0 - 6176 0 OS OS 0.000000 5.0000 0 - 6177 0 OS OS 0.000000 5.0000 0 - 6178 0 OS OS 0.000000 5.0000 0 - 6179 0 OS OS 0.000000 5.0000 0 - 6180 0 OS OS 0.000000 5.0000 0 - 6181 0 OS OS 0.000000 5.0000 0 - 6182 0 OS OS 0.000000 5.0000 0 - 6183 0 OS OS 0.000000 5.0000 0 - 6184 0 OS OS 0.000000 5.0000 0 - 6185 0 OS OS 0.000000 5.0000 0 - 6186 0 OS OS 0.000000 5.0000 0 - 6187 0 OS OS 0.000000 5.0000 0 - 6188 0 OS OS 0.000000 5.0000 0 - 6189 0 OS OS 0.000000 5.0000 0 - 6190 0 OS OS 0.000000 5.0000 0 - 6191 0 OS OS 0.000000 5.0000 0 - 6192 0 OS OS 0.000000 5.0000 0 - 6193 0 OS OS 0.000000 5.0000 0 - 6194 0 OS OS 0.000000 5.0000 0 - 6195 0 OS OS 0.000000 5.0000 0 - 6196 0 OS OS 0.000000 5.0000 0 - 6197 0 OS OS 0.000000 5.0000 0 - 6198 0 OS OS 0.000000 5.0000 0 - 6199 0 OS OS 0.000000 5.0000 0 - 6200 0 OS OS 0.000000 5.0000 0 - 6201 0 OS OS 0.000000 5.0000 0 - 6202 0 OS OS 0.000000 5.0000 0 - 6203 0 OS OS 0.000000 5.0000 0 - 6204 0 OS OS 0.000000 5.0000 0 - 6205 0 OS OS 0.000000 5.0000 0 - 6206 0 OS OS 0.000000 5.0000 0 - 6207 0 OS OS 0.000000 5.0000 0 - 6208 0 OS OS 0.000000 5.0000 0 - 6209 0 OS OS 0.000000 5.0000 0 - 6210 0 OS OS 0.000000 5.0000 0 - 6211 0 OS OS 0.000000 5.0000 0 - 6212 0 OS OS 0.000000 5.0000 0 - 6213 0 OS OS 0.000000 5.0000 0 - 6214 0 OS OS 0.000000 5.0000 0 - 6215 0 OS OS 0.000000 5.0000 0 - 6216 0 OS OS 0.000000 5.0000 0 - 6217 0 OS OS 0.000000 5.0000 0 - 6218 0 OS OS 0.000000 5.0000 0 - 6219 0 OS OS 0.000000 5.0000 0 - 6220 0 OS OS 0.000000 5.0000 0 - 6221 0 OS OS 0.000000 5.0000 0 - 6222 0 OS OS 0.000000 5.0000 0 - 6223 0 OS OS 0.000000 5.0000 0 - 6224 0 OS OS 0.000000 5.0000 0 - 6225 0 OS OS 0.000000 5.0000 0 - 6226 0 OS OS 0.000000 5.0000 0 - 6227 0 OS OS 0.000000 5.0000 0 - 6228 0 OS OS 0.000000 5.0000 0 - 6229 0 OS OS 0.000000 5.0000 0 - 6230 0 OS OS 0.000000 5.0000 0 - 6231 0 OS OS 0.000000 5.0000 0 - 6232 0 OS OS 0.000000 5.0000 0 - 6233 0 OS OS 0.000000 5.0000 0 - 6234 0 OS OS 0.000000 5.0000 0 - 6235 0 OS OS 0.000000 5.0000 0 - 6236 0 OS OS 0.000000 5.0000 0 - 6237 0 OS OS 0.000000 5.0000 0 - 6238 0 OS OS 0.000000 5.0000 0 - 6239 0 OS OS 0.000000 5.0000 0 - 6240 0 OS OS 0.000000 5.0000 0 - 6241 0 OS OS 0.000000 5.0000 0 - 6242 0 OS OS 0.000000 5.0000 0 - 6243 0 OS OS 0.000000 5.0000 0 - 6244 0 OS OS 0.000000 5.0000 0 - 6245 0 OS OS 0.000000 5.0000 0 - 6246 0 OS OS 0.000000 5.0000 0 - 6247 0 OS OS 0.000000 5.0000 0 - 6248 0 OS OS 0.000000 5.0000 0 - 6249 0 OS OS 0.000000 5.0000 0 - 6250 0 OS OS 0.000000 5.0000 0 - 6251 0 OS OS 0.000000 5.0000 0 - 6252 0 OS OS 0.000000 5.0000 0 - 6253 0 OS OS 0.000000 5.0000 0 - 6254 0 OS OS 0.000000 5.0000 0 - 6255 0 OS OS 0.000000 5.0000 0 - 6256 0 OS OS 0.000000 5.0000 0 - 6257 0 OS OS 0.000000 5.0000 0 - 6258 0 OS OS 0.000000 5.0000 0 - 6259 0 OS OS 0.000000 5.0000 0 - 6260 0 OS OS 0.000000 5.0000 0 - 6261 0 OS OS 0.000000 5.0000 0 - 6262 0 OS OS 0.000000 5.0000 0 - 6263 0 OS OS 0.000000 5.0000 0 - 6264 0 OS OS 0.000000 5.0000 0 - 6265 0 OS OS 0.000000 5.0000 0 - 6266 0 OS OS 0.000000 5.0000 0 - 6267 0 OS OS 0.000000 5.0000 0 - 6268 0 OS OS 0.000000 5.0000 0 - 6269 0 OS OS 0.000000 5.0000 0 - 6270 0 OS OS 0.000000 5.0000 0 - 6271 0 OS OS 0.000000 5.0000 0 - 6272 0 OS OS 0.000000 5.0000 0 - 6273 0 OS OS 0.000000 5.0000 0 - 6274 0 OS OS 0.000000 5.0000 0 - 6275 0 OS OS 0.000000 5.0000 0 - 6276 0 OS OS 0.000000 5.0000 0 - 6277 0 OS OS 0.000000 5.0000 0 - 6278 0 OS OS 0.000000 5.0000 0 - 6279 0 OS OS 0.000000 5.0000 0 - 6280 0 OS OS 0.000000 5.0000 0 - 6281 0 OS OS 0.000000 5.0000 0 - 6282 0 OS OS 0.000000 5.0000 0 - 6283 0 OS OS 0.000000 5.0000 0 - 6284 0 OS OS 0.000000 5.0000 0 - 6285 0 OS OS 0.000000 5.0000 0 - 6286 0 OS OS 0.000000 5.0000 0 - 6287 0 OS OS 0.000000 5.0000 0 - 6288 0 OS OS 0.000000 5.0000 0 - 6289 0 OS OS 0.000000 5.0000 0 - 6290 0 OS OS 0.000000 5.0000 0 - 6291 0 OS OS 0.000000 5.0000 0 - 6292 0 OS OS 0.000000 5.0000 0 - 6293 0 OS OS 0.000000 5.0000 0 - 6294 0 OS OS 0.000000 5.0000 0 - 6295 0 OS OS 0.000000 5.0000 0 - 6296 0 OS OS 0.000000 5.0000 0 - 6297 0 OS OS 0.000000 5.0000 0 - 6298 0 OS OS 0.000000 5.0000 0 - 6299 0 OS OS 0.000000 5.0000 0 - 6300 0 OS OS 0.000000 5.0000 0 - 6301 0 OS OS 0.000000 5.0000 0 - 6302 0 OS OS 0.000000 5.0000 0 - 6303 0 OS OS 0.000000 5.0000 0 - 6304 0 OS OS 0.000000 5.0000 0 - 6305 0 OS OS 0.000000 5.0000 0 - 6306 0 OS OS 0.000000 5.0000 0 - 6307 0 OS OS 0.000000 5.0000 0 - 6308 0 OS OS 0.000000 5.0000 0 - 6309 0 OS OS 0.000000 5.0000 0 - 6310 0 OS OS 0.000000 5.0000 0 - 6311 0 OS OS 0.000000 5.0000 0 - 6312 0 OS OS 0.000000 5.0000 0 - 6313 0 OS OS 0.000000 5.0000 0 - 6314 0 OS OS 0.000000 5.0000 0 - 6315 0 OS OS 0.000000 5.0000 0 - 6316 0 OS OS 0.000000 5.0000 0 - 6317 0 OS OS 0.000000 5.0000 0 - 6318 0 OS OS 0.000000 5.0000 0 - 6319 0 OS OS 0.000000 5.0000 0 - 6320 0 OS OS 0.000000 5.0000 0 - 6321 0 OS OS 0.000000 5.0000 0 - 6322 0 OS OS 0.000000 5.0000 0 - 6323 0 OS OS 0.000000 5.0000 0 - 6324 0 OS OS 0.000000 5.0000 0 - 6325 0 OS OS 0.000000 5.0000 0 - 6326 0 OS OS 0.000000 5.0000 0 - 6327 0 OS OS 0.000000 5.0000 0 - 6328 0 OS OS 0.000000 5.0000 0 - 6329 0 OS OS 0.000000 5.0000 0 - 6330 0 OS OS 0.000000 5.0000 0 - 6331 0 OS OS 0.000000 5.0000 0 - 6332 0 OS OS 0.000000 5.0000 0 - 6333 0 OS OS 0.000000 5.0000 0 - 6334 0 OS OS 0.000000 5.0000 0 - 6335 0 OS OS 0.000000 5.0000 0 - 6336 0 OS OS 0.000000 5.0000 0 - 6337 0 OS OS 0.000000 5.0000 0 - 6338 0 OS OS 0.000000 5.0000 0 - 6339 0 OS OS 0.000000 5.0000 0 - 6340 0 OS OS 0.000000 5.0000 0 - 6341 0 OS OS 0.000000 5.0000 0 - 6342 0 OS OS 0.000000 5.0000 0 - 6343 0 OS OS 0.000000 5.0000 0 - 6344 0 OS OS 0.000000 5.0000 0 - 6345 0 OS OS 0.000000 5.0000 0 - 6346 0 OS OS 0.000000 5.0000 0 - 6347 0 OS OS 0.000000 5.0000 0 - 6348 0 OS OS 0.000000 5.0000 0 - 6349 0 OS OS 0.000000 5.0000 0 - 6350 0 OS OS 0.000000 5.0000 0 - 6351 0 OS OS 0.000000 5.0000 0 - 6352 0 OS OS 0.000000 5.0000 0 - 6353 0 OS OS 0.000000 5.0000 0 - 6354 0 OS OS 0.000000 5.0000 0 - 6355 0 OS OS 0.000000 5.0000 0 - 6356 0 OS OS 0.000000 5.0000 0 - 6357 0 OS OS 0.000000 5.0000 0 - 6358 0 OS OS 0.000000 5.0000 0 - 6359 0 OS OS 0.000000 5.0000 0 - 6360 0 OS OS 0.000000 5.0000 0 - 6361 0 OS OS 0.000000 5.0000 0 - 6362 0 OS OS 0.000000 5.0000 0 - 6363 0 OS OS 0.000000 5.0000 0 - 6364 0 OS OS 0.000000 5.0000 0 - 6365 0 OS OS 0.000000 5.0000 0 - 6366 0 OS OS 0.000000 5.0000 0 - 6367 0 OS OS 0.000000 5.0000 0 - 6368 0 OS OS 0.000000 5.0000 0 - 6369 0 OS OS 0.000000 5.0000 0 - 6370 0 OS OS 0.000000 5.0000 0 - 6371 0 OS OS 0.000000 5.0000 0 - 6372 0 OS OS 0.000000 5.0000 0 - 6373 0 OS OS 0.000000 5.0000 0 - 6374 0 OS OS 0.000000 5.0000 0 - 6375 0 OS OS 0.000000 5.0000 0 - 6376 0 OS OS 0.000000 5.0000 0 - 6377 0 OS OS 0.000000 5.0000 0 - 6378 0 OS OS 0.000000 5.0000 0 - 6379 0 OS OS 0.000000 5.0000 0 - 6380 0 OS OS 0.000000 5.0000 0 - 6381 0 OS OS 0.000000 5.0000 0 - 6382 0 OS OS 0.000000 5.0000 0 - 6383 0 OS OS 0.000000 5.0000 0 - 6384 0 OS OS 0.000000 5.0000 0 - 6385 0 OS OS 0.000000 5.0000 0 - 6386 0 OS OS 0.000000 5.0000 0 - 6387 0 OS OS 0.000000 5.0000 0 - 6388 0 OS OS 0.000000 5.0000 0 - 6389 0 OS OS 0.000000 5.0000 0 - 6390 0 OS OS 0.000000 5.0000 0 - 6391 0 OS OS 0.000000 5.0000 0 - 6392 0 OS OS 0.000000 5.0000 0 - 6393 0 OS OS 0.000000 5.0000 0 - 6394 0 OS OS 0.000000 5.0000 0 - 6395 0 OS OS 0.000000 5.0000 0 - 6396 0 OS OS 0.000000 5.0000 0 - 6397 0 OS OS 0.000000 5.0000 0 - 6398 0 OS OS 0.000000 5.0000 0 - 6399 0 OS OS 0.000000 5.0000 0 - 6400 0 OS OS 0.000000 5.0000 0 - 6401 0 OS OS 0.000000 5.0000 0 - 6402 0 OS OS 0.000000 5.0000 0 - 6403 0 OS OS 0.000000 5.0000 0 - 6404 0 OS OS 0.000000 5.0000 0 - 6405 0 OS OS 0.000000 5.0000 0 - 6406 0 OS OS 0.000000 5.0000 0 - 6407 0 OS OS 0.000000 5.0000 0 - 6408 0 OS OS 0.000000 5.0000 0 - 6409 0 OS OS 0.000000 5.0000 0 - 6410 0 OS OS 0.000000 5.0000 0 - 6411 0 OS OS 0.000000 5.0000 0 - 6412 0 OS OS 0.000000 5.0000 0 - 6413 0 OS OS 0.000000 5.0000 0 - 6414 0 OS OS 0.000000 5.0000 0 - 6415 0 OS OS 0.000000 5.0000 0 - 6416 0 OS OS 0.000000 5.0000 0 - 6417 0 OS OS 0.000000 5.0000 0 - 6418 0 OS OS 0.000000 5.0000 0 - 6419 0 OS OS 0.000000 5.0000 0 - 6420 0 OS OS 0.000000 5.0000 0 - 6421 0 OS OS 0.000000 5.0000 0 - 6422 0 OS OS 0.000000 5.0000 0 - 6423 0 OS OS 0.000000 5.0000 0 - 6424 0 OS OS 0.000000 5.0000 0 - 6425 0 OS OS 0.000000 5.0000 0 - 6426 0 OS OS 0.000000 5.0000 0 - 6427 0 OS OS 0.000000 5.0000 0 - 6428 0 OS OS 0.000000 5.0000 0 - 6429 0 OS OS 0.000000 5.0000 0 - 6430 0 OS OS 0.000000 5.0000 0 - 6431 0 OS OS 0.000000 5.0000 0 - 6432 0 OS OS 0.000000 5.0000 0 - 6433 0 OS OS 0.000000 5.0000 0 - 6434 0 OS OS 0.000000 5.0000 0 - 6435 0 OS OS 0.000000 5.0000 0 - 6436 0 OS OS 0.000000 5.0000 0 - 6437 0 OS OS 0.000000 5.0000 0 - 6438 0 OS OS 0.000000 5.0000 0 - 6439 0 OS OS 0.000000 5.0000 0 - 6440 0 OS OS 0.000000 5.0000 0 - 6441 0 OS OS 0.000000 5.0000 0 - 6442 0 OS OS 0.000000 5.0000 0 - 6443 0 OS OS 0.000000 5.0000 0 - 6444 0 OS OS 0.000000 5.0000 0 - 6445 0 OS OS 0.000000 5.0000 0 - 6446 0 OS OS 0.000000 5.0000 0 - 6447 0 OS OS 0.000000 5.0000 0 - 6448 0 OS OS 0.000000 5.0000 0 - 6449 0 OS OS 0.000000 5.0000 0 - 6450 0 OS OS 0.000000 5.0000 0 - 6451 0 OS OS 0.000000 5.0000 0 - 6452 0 OS OS 0.000000 5.0000 0 - 6453 0 OS OS 0.000000 5.0000 0 - 6454 0 OS OS 0.000000 5.0000 0 - 6455 0 OS OS 0.000000 5.0000 0 - 6456 0 OS OS 0.000000 5.0000 0 - 6457 0 OS OS 0.000000 5.0000 0 - 6458 0 OS OS 0.000000 5.0000 0 - 6459 0 OS OS 0.000000 5.0000 0 - 6460 0 OS OS 0.000000 5.0000 0 - 6461 0 OS OS 0.000000 5.0000 0 - 6462 0 OS OS 0.000000 5.0000 0 - 6463 0 OS OS 0.000000 5.0000 0 - 6464 0 OS OS 0.000000 5.0000 0 - 6465 0 OS OS 0.000000 5.0000 0 - 6466 0 OS OS 0.000000 5.0000 0 - 6467 0 OS OS 0.000000 5.0000 0 - 6468 0 OS OS 0.000000 5.0000 0 - 6469 0 OS OS 0.000000 5.0000 0 - 6470 0 OS OS 0.000000 5.0000 0 - 6471 0 OS OS 0.000000 5.0000 0 - 6472 0 OS OS 0.000000 5.0000 0 - 6473 0 OS OS 0.000000 5.0000 0 - 6474 0 OS OS 0.000000 5.0000 0 - 6475 0 OS OS 0.000000 5.0000 0 - 6476 0 OS OS 0.000000 5.0000 0 - 6477 0 OS OS 0.000000 5.0000 0 - 6478 0 OS OS 0.000000 5.0000 0 - 6479 0 OS OS 0.000000 5.0000 0 - 6480 0 OS OS 0.000000 5.0000 0 - 6481 0 OS OS 0.000000 5.0000 0 - 6482 0 OS OS 0.000000 5.0000 0 - 6483 0 OS OS 0.000000 5.0000 0 - 6484 0 OS OS 0.000000 5.0000 0 - 6485 0 OS OS 0.000000 5.0000 0 - 6486 0 OS OS 0.000000 5.0000 0 - 6487 0 OS OS 0.000000 5.0000 0 - 6488 0 OS OS 0.000000 5.0000 0 - 6489 0 OS OS 0.000000 5.0000 0 - 6490 0 OS OS 0.000000 5.0000 0 - 6491 0 OS OS 0.000000 5.0000 0 - 6492 0 OS OS 0.000000 5.0000 0 - 6493 0 OS OS 0.000000 5.0000 0 - 6494 0 OS OS 0.000000 5.0000 0 - 6495 0 OS OS 0.000000 5.0000 0 - 6496 0 OS OS 0.000000 5.0000 0 - 6497 0 OS OS 0.000000 5.0000 0 - 6498 0 OS OS 0.000000 5.0000 0 - 6499 0 OS OS 0.000000 5.0000 0 - 6500 0 OS OS 0.000000 5.0000 0 - 6501 0 OS OS 0.000000 5.0000 0 - 6502 0 OS OS 0.000000 5.0000 0 - 6503 0 OS OS 0.000000 5.0000 0 - 6504 0 OS OS 0.000000 5.0000 0 - 6505 0 OS OS 0.000000 5.0000 0 - 6506 0 OS OS 0.000000 5.0000 0 - 6507 0 OS OS 0.000000 5.0000 0 - 6508 0 OS OS 0.000000 5.0000 0 - 6509 0 OS OS 0.000000 5.0000 0 - 6510 0 OS OS 0.000000 5.0000 0 - 6511 0 OS OS 0.000000 5.0000 0 - 6512 0 OS OS 0.000000 5.0000 0 - 6513 0 OS OS 0.000000 5.0000 0 - 6514 0 OS OS 0.000000 5.0000 0 - 6515 0 OS OS 0.000000 5.0000 0 - 6516 0 OS OS 0.000000 5.0000 0 - 6517 0 OS OS 0.000000 5.0000 0 - 6518 0 OS OS 0.000000 5.0000 0 - 6519 0 OS OS 0.000000 5.0000 0 - 6520 0 OS OS 0.000000 5.0000 0 - 6521 0 OS OS 0.000000 5.0000 0 - 6522 0 OS OS 0.000000 5.0000 0 - 6523 0 OS OS 0.000000 5.0000 0 - 6524 0 OS OS 0.000000 5.0000 0 - 6525 0 OS OS 0.000000 5.0000 0 - 6526 0 OS OS 0.000000 5.0000 0 - 6527 0 OS OS 0.000000 5.0000 0 - 6528 0 OS OS 0.000000 5.0000 0 - 6529 0 OS OS 0.000000 5.0000 0 - 6530 0 OS OS 0.000000 5.0000 0 - 6531 0 OS OS 0.000000 5.0000 0 - 6532 0 OS OS 0.000000 5.0000 0 - 6533 0 OS OS 0.000000 5.0000 0 - 6534 0 OS OS 0.000000 5.0000 0 - 6535 0 OS OS 0.000000 5.0000 0 - 6536 0 OS OS 0.000000 5.0000 0 - 6537 0 OS OS 0.000000 5.0000 0 - 6538 0 OS OS 0.000000 5.0000 0 - 6539 0 OS OS 0.000000 5.0000 0 - 6540 0 OS OS 0.000000 5.0000 0 - 6541 0 OS OS 0.000000 5.0000 0 - 6542 0 OS OS 0.000000 5.0000 0 - 6543 0 OS OS 0.000000 5.0000 0 - 6544 0 OS OS 0.000000 5.0000 0 - 6545 0 OS OS 0.000000 5.0000 0 - 6546 0 OS OS 0.000000 5.0000 0 - 6547 0 OS OS 0.000000 5.0000 0 - 6548 0 OS OS 0.000000 5.0000 0 - 6549 0 OS OS 0.000000 5.0000 0 - 6550 0 OS OS 0.000000 5.0000 0 - 6551 0 OS OS 0.000000 5.0000 0 - 6552 0 OS OS 0.000000 5.0000 0 - 6553 0 OS OS 0.000000 5.0000 0 - 6554 0 OS OS 0.000000 5.0000 0 - 6555 0 OS OS 0.000000 5.0000 0 - 6556 0 OS OS 0.000000 5.0000 0 - 6557 0 OS OS 0.000000 5.0000 0 - 6558 0 OS OS 0.000000 5.0000 0 - 6559 0 OS OS 0.000000 5.0000 0 - 6560 0 OS OS 0.000000 5.0000 0 - 6561 0 OS OS 0.000000 5.0000 0 - 6562 0 OS OS 0.000000 5.0000 0 - 6563 0 OS OS 0.000000 5.0000 0 - 6564 0 OS OS 0.000000 5.0000 0 - 6565 0 OS OS 0.000000 5.0000 0 - 6566 0 OS OS 0.000000 5.0000 0 - 6567 0 OS OS 0.000000 5.0000 0 - 6568 0 OS OS 0.000000 5.0000 0 - 6569 0 OS OS 0.000000 5.0000 0 - 6570 0 OS OS 0.000000 5.0000 0 - 6571 0 OS OS 0.000000 5.0000 0 - 6572 0 OS OS 0.000000 5.0000 0 - 6573 0 OS OS 0.000000 5.0000 0 - 6574 0 OS OS 0.000000 5.0000 0 - 6575 0 OS OS 0.000000 5.0000 0 - 6576 0 OS OS 0.000000 5.0000 0 - 6577 0 OS OS 0.000000 5.0000 0 - 6578 0 OS OS 0.000000 5.0000 0 - 6579 0 OS OS 0.000000 5.0000 0 - 6580 0 OS OS 0.000000 5.0000 0 - 6581 0 OS OS 0.000000 5.0000 0 - 6582 0 OS OS 0.000000 5.0000 0 - 6583 0 OS OS 0.000000 5.0000 0 - 6584 0 OS OS 0.000000 5.0000 0 - 6585 0 OS OS 0.000000 5.0000 0 - 6586 0 OS OS 0.000000 5.0000 0 - 6587 0 OS OS 0.000000 5.0000 0 - 6588 0 OS OS 0.000000 5.0000 0 - 6589 0 OS OS 0.000000 5.0000 0 - 6590 0 OS OS 0.000000 5.0000 0 - 6591 0 OS OS 0.000000 5.0000 0 - 6592 0 OS OS 0.000000 5.0000 0 - 6593 0 OS OS 0.000000 5.0000 0 - 6594 0 OS OS 0.000000 5.0000 0 - 6595 0 OS OS 0.000000 5.0000 0 - 6596 0 OS OS 0.000000 5.0000 0 - 6597 0 OS OS 0.000000 5.0000 0 - 6598 0 OS OS 0.000000 5.0000 0 - 6599 0 OS OS 0.000000 5.0000 0 - 6600 0 OS OS 0.000000 5.0000 0 - 6601 0 OS OS 0.000000 5.0000 0 - 6602 0 OS OS 0.000000 5.0000 0 - 6603 0 OS OS 0.000000 5.0000 0 - 6604 0 OS OS 0.000000 5.0000 0 - 6605 0 OS OS 0.000000 5.0000 0 - 6606 0 OS OS 0.000000 5.0000 0 - 6607 0 OS OS 0.000000 5.0000 0 - 6608 0 OS OS 0.000000 5.0000 0 - 6609 0 OS OS 0.000000 5.0000 0 - 6610 0 OS OS 0.000000 5.0000 0 - 6611 0 OS OS 0.000000 5.0000 0 - 6612 0 OS OS 0.000000 5.0000 0 - 6613 0 OS OS 0.000000 5.0000 0 - 6614 0 OS OS 0.000000 5.0000 0 - 6615 0 OS OS 0.000000 5.0000 0 - 6616 0 OS OS 0.000000 5.0000 0 - 6617 0 OS OS 0.000000 5.0000 0 - 6618 0 OS OS 0.000000 5.0000 0 - 6619 0 OS OS 0.000000 5.0000 0 - 6620 0 OS OS 0.000000 5.0000 0 - 6621 0 OS OS 0.000000 5.0000 0 - 6622 0 OS OS 0.000000 5.0000 0 - 6623 0 OS OS 0.000000 5.0000 0 - 6624 0 OS OS 0.000000 5.0000 0 - 6625 0 OS OS 0.000000 5.0000 0 - 6626 0 OS OS 0.000000 5.0000 0 - 6627 0 OS OS 0.000000 5.0000 0 - 6628 0 OS OS 0.000000 5.0000 0 - 6629 0 OS OS 0.000000 5.0000 0 - 6630 0 OS OS 0.000000 5.0000 0 - 6631 0 OS OS 0.000000 5.0000 0 - 6632 0 OS OS 0.000000 5.0000 0 - 6633 0 OS OS 0.000000 5.0000 0 - 6634 0 OS OS 0.000000 5.0000 0 - 6635 0 OS OS 0.000000 5.0000 0 - 6636 0 OS OS 0.000000 5.0000 0 - 6637 0 OS OS 0.000000 5.0000 0 - 6638 0 OS OS 0.000000 5.0000 0 - 6639 0 OS OS 0.000000 5.0000 0 - 6640 0 OS OS 0.000000 5.0000 0 - 6641 0 OS OS 0.000000 5.0000 0 - 6642 0 OS OS 0.000000 5.0000 0 - 6643 0 OS OS 0.000000 5.0000 0 - 6644 0 OS OS 0.000000 5.0000 0 - 6645 0 OS OS 0.000000 5.0000 0 - 6646 0 OS OS 0.000000 5.0000 0 - 6647 0 OS OS 0.000000 5.0000 0 - 6648 0 OS OS 0.000000 5.0000 0 - 6649 0 OS OS 0.000000 5.0000 0 - 6650 0 OS OS 0.000000 5.0000 0 - 6651 0 OS OS 0.000000 5.0000 0 - 6652 0 OS OS 0.000000 5.0000 0 - 6653 0 OS OS 0.000000 5.0000 0 - 6654 0 OS OS 0.000000 5.0000 0 - 6655 0 OS OS 0.000000 5.0000 0 - 6656 0 OS OS 0.000000 5.0000 0 - 6657 0 OS OS 0.000000 5.0000 0 - 6658 0 OS OS 0.000000 5.0000 0 - 6659 0 OS OS 0.000000 5.0000 0 - 6660 0 OS OS 0.000000 5.0000 0 - 6661 0 OS OS 0.000000 5.0000 0 - 6662 0 OS OS 0.000000 5.0000 0 - 6663 0 OS OS 0.000000 5.0000 0 - 6664 0 OS OS 0.000000 5.0000 0 - 6665 0 OS OS 0.000000 5.0000 0 - 6666 0 OS OS 0.000000 5.0000 0 - 6667 0 OS OS 0.000000 5.0000 0 - 6668 0 OS OS 0.000000 5.0000 0 - 6669 0 OS OS 0.000000 5.0000 0 - 6670 0 OS OS 0.000000 5.0000 0 - 6671 0 OS OS 0.000000 5.0000 0 - 6672 0 OS OS 0.000000 5.0000 0 - 6673 0 OS OS 0.000000 5.0000 0 - 6674 0 OS OS 0.000000 5.0000 0 - 6675 0 OS OS 0.000000 5.0000 0 - 6676 0 OS OS 0.000000 5.0000 0 - 6677 0 OS OS 0.000000 5.0000 0 - 6678 0 OS OS 0.000000 5.0000 0 - 6679 0 OS OS 0.000000 5.0000 0 - 6680 0 OS OS 0.000000 5.0000 0 - 6681 0 OS OS 0.000000 5.0000 0 - 6682 0 OS OS 0.000000 5.0000 0 - 6683 0 OS OS 0.000000 5.0000 0 - 6684 0 OS OS 0.000000 5.0000 0 - 6685 0 OS OS 0.000000 5.0000 0 - 6686 0 OS OS 0.000000 5.0000 0 - 6687 0 OS OS 0.000000 5.0000 0 - 6688 0 OS OS 0.000000 5.0000 0 - 6689 0 OS OS 0.000000 5.0000 0 - 6690 0 OS OS 0.000000 5.0000 0 - 6691 0 OS OS 0.000000 5.0000 0 - 6692 0 OS OS 0.000000 5.0000 0 - 6693 0 OS OS 0.000000 5.0000 0 - 6694 0 OS OS 0.000000 5.0000 0 - 6695 0 OS OS 0.000000 5.0000 0 - 6696 0 OS OS 0.000000 5.0000 0 - 6697 0 OS OS 0.000000 5.0000 0 - 6698 0 OS OS 0.000000 5.0000 0 - 6699 0 OS OS 0.000000 5.0000 0 - 6700 0 OS OS 0.000000 5.0000 0 - 6701 0 OS OS 0.000000 5.0000 0 - 6702 0 OS OS 0.000000 5.0000 0 - 6703 0 OS OS 0.000000 5.0000 0 - 6704 0 OS OS 0.000000 5.0000 0 - 6705 0 OS OS 0.000000 5.0000 0 - 6706 0 OS OS 0.000000 5.0000 0 - 6707 0 OS OS 0.000000 5.0000 0 - 6708 0 OS OS 0.000000 5.0000 0 - 6709 0 OS OS 0.000000 5.0000 0 - 6710 0 OS OS 0.000000 5.0000 0 - 6711 0 OS OS 0.000000 5.0000 0 - 6712 0 OS OS 0.000000 5.0000 0 - 6713 0 OS OS 0.000000 5.0000 0 - 6714 0 OS OS 0.000000 5.0000 0 - 6715 0 OS OS 0.000000 5.0000 0 - 6716 0 OS OS 0.000000 5.0000 0 - 6717 0 OS OS 0.000000 5.0000 0 - 6718 0 OS OS 0.000000 5.0000 0 - 6719 0 OS OS 0.000000 5.0000 0 - 6720 0 OS OS 0.000000 5.0000 0 - 6721 0 OS OS 0.000000 5.0000 0 - 6722 0 OS OS 0.000000 5.0000 0 - 6723 0 OS OS 0.000000 5.0000 0 - 6724 0 OS OS 0.000000 5.0000 0 - 6725 0 OS OS 0.000000 5.0000 0 - 6726 0 OS OS 0.000000 5.0000 0 - 6727 0 OS OS 0.000000 5.0000 0 - 6728 0 OS OS 0.000000 5.0000 0 - 6729 0 OS OS 0.000000 5.0000 0 - 6730 0 OS OS 0.000000 5.0000 0 - 6731 0 OS OS 0.000000 5.0000 0 - 6732 0 OS OS 0.000000 5.0000 0 - 6733 0 OS OS 0.000000 5.0000 0 - 6734 0 OS OS 0.000000 5.0000 0 - 6735 0 OS OS 0.000000 5.0000 0 - 6736 0 OS OS 0.000000 5.0000 0 - 6737 0 OS OS 0.000000 5.0000 0 - 6738 0 OS OS 0.000000 5.0000 0 - 6739 0 OS OS 0.000000 5.0000 0 - 6740 0 OS OS 0.000000 5.0000 0 - 6741 0 OS OS 0.000000 5.0000 0 - 6742 0 OS OS 0.000000 5.0000 0 - 6743 0 OS OS 0.000000 5.0000 0 - 6744 0 OS OS 0.000000 5.0000 0 - 6745 0 OS OS 0.000000 5.0000 0 - 6746 0 OS OS 0.000000 5.0000 0 - 6747 0 OS OS 0.000000 5.0000 0 - 6748 0 OS OS 0.000000 5.0000 0 - 6749 0 OS OS 0.000000 5.0000 0 - 6750 0 OS OS 0.000000 5.0000 0 - 6751 0 OS OS 0.000000 5.0000 0 - 6752 0 OS OS 0.000000 5.0000 0 - 6753 0 OS OS 0.000000 5.0000 0 - 6754 0 OS OS 0.000000 5.0000 0 - 6755 0 OS OS 0.000000 5.0000 0 - 6756 0 OS OS 0.000000 5.0000 0 - 6757 0 OS OS 0.000000 5.0000 0 - 6758 0 OS OS 0.000000 5.0000 0 - 6759 0 OS OS 0.000000 5.0000 0 - 6760 0 OS OS 0.000000 5.0000 0 - 6761 0 OS OS 0.000000 5.0000 0 - 6762 0 OS OS 0.000000 5.0000 0 - 6763 0 OS OS 0.000000 5.0000 0 - 6764 0 OS OS 0.000000 5.0000 0 - 6765 0 OS OS 0.000000 5.0000 0 - 6766 0 OS OS 0.000000 5.0000 0 - 6767 0 OS OS 0.000000 5.0000 0 - 6768 0 OS OS 0.000000 5.0000 0 - 6769 0 OS OS 0.000000 5.0000 0 - 6770 0 OS OS 0.000000 5.0000 0 - 6771 0 OS OS 0.000000 5.0000 0 - 6772 0 OS OS 0.000000 5.0000 0 - 6773 0 OS OS 0.000000 5.0000 0 - 6774 0 OS OS 0.000000 5.0000 0 - 6775 0 OS OS 0.000000 5.0000 0 - 6776 0 OS OS 0.000000 5.0000 0 - 6777 0 OS OS 0.000000 5.0000 0 - 6778 0 OS OS 0.000000 5.0000 0 - 6779 0 OS OS 0.000000 5.0000 0 - 6780 0 OS OS 0.000000 5.0000 0 - 6781 0 OS OS 0.000000 5.0000 0 - 6782 0 OS OS 0.000000 5.0000 0 - 6783 0 OS OS 0.000000 5.0000 0 - 6784 0 OS OS 0.000000 5.0000 0 - 6785 0 OS OS 0.000000 5.0000 0 - 6786 0 OS OS 0.000000 5.0000 0 - 6787 0 OS OS 0.000000 5.0000 0 - 6788 0 OS OS 0.000000 5.0000 0 - 6789 0 OS OS 0.000000 5.0000 0 - 6790 0 OS OS 0.000000 5.0000 0 - 6791 0 OS OS 0.000000 5.0000 0 - 6792 0 OS OS 0.000000 5.0000 0 - 6793 0 OS OS 0.000000 5.0000 0 - 6794 0 OS OS 0.000000 5.0000 0 - 6795 0 OS OS 0.000000 5.0000 0 - 6796 0 OS OS 0.000000 5.0000 0 - 6797 0 OS OS 0.000000 5.0000 0 - 6798 0 OS OS 0.000000 5.0000 0 - 6799 0 OS OS 0.000000 5.0000 0 - 6800 0 OS OS 0.000000 5.0000 0 - 6801 0 OS OS 0.000000 5.0000 0 - 6802 0 OS OS 0.000000 5.0000 0 - 6803 0 OS OS 0.000000 5.0000 0 - 6804 0 OS OS 0.000000 5.0000 0 - 6805 0 OS OS 0.000000 5.0000 0 - 6806 0 OS OS 0.000000 5.0000 0 - 6807 0 OS OS 0.000000 5.0000 0 - 6808 0 OS OS 0.000000 5.0000 0 - 6809 0 OS OS 0.000000 5.0000 0 - 6810 0 OS OS 0.000000 5.0000 0 - 6811 0 OS OS 0.000000 5.0000 0 - 6812 0 OS OS 0.000000 5.0000 0 - 6813 0 OS OS 0.000000 5.0000 0 - 6814 0 OS OS 0.000000 5.0000 0 - 6815 0 OS OS 0.000000 5.0000 0 - 6816 0 OS OS 0.000000 5.0000 0 - 6817 0 OS OS 0.000000 5.0000 0 - 6818 0 OS OS 0.000000 5.0000 0 - 6819 0 OS OS 0.000000 5.0000 0 - 6820 0 OS OS 0.000000 5.0000 0 - 6821 0 OS OS 0.000000 5.0000 0 - 6822 0 OS OS 0.000000 5.0000 0 - 6823 0 OS OS 0.000000 5.0000 0 - 6824 0 OS OS 0.000000 5.0000 0 - 6825 0 OS OS 0.000000 5.0000 0 - 6826 0 OS OS 0.000000 5.0000 0 - 6827 0 OS OS 0.000000 5.0000 0 - 6828 0 OS OS 0.000000 5.0000 0 - 6829 0 OS OS 0.000000 5.0000 0 - 6830 0 OS OS 0.000000 5.0000 0 - 6831 0 OS OS 0.000000 5.0000 0 - 6832 0 OS OS 0.000000 5.0000 0 - 6833 0 OS OS 0.000000 5.0000 0 - 6834 0 OS OS 0.000000 5.0000 0 - 6835 0 OS OS 0.000000 5.0000 0 - 6836 0 OS OS 0.000000 5.0000 0 - 6837 0 OS OS 0.000000 5.0000 0 - 6838 0 OS OS 0.000000 5.0000 0 - 6839 0 OS OS 0.000000 5.0000 0 - 6840 0 OS OS 0.000000 5.0000 0 - 6841 0 OS OS 0.000000 5.0000 0 - 6842 0 OS OS 0.000000 5.0000 0 - 6843 0 OS OS 0.000000 5.0000 0 - 6844 0 OS OS 0.000000 5.0000 0 - 6845 0 OS OS 0.000000 5.0000 0 - 6846 0 OS OS 0.000000 5.0000 0 - 6847 0 OS OS 0.000000 5.0000 0 - 6848 0 OS OS 0.000000 5.0000 0 - 6849 0 OS OS 0.000000 5.0000 0 - 6850 0 OS OS 0.000000 5.0000 0 - 6851 0 OS OS 0.000000 5.0000 0 - 6852 0 OS OS 0.000000 5.0000 0 - 6853 0 OS OS 0.000000 5.0000 0 - 6854 0 OS OS 0.000000 5.0000 0 - 6855 0 OS OS 0.000000 5.0000 0 - 6856 0 OS OS 0.000000 5.0000 0 - 6857 0 OS OS 0.000000 5.0000 0 - 6858 0 OS OS 0.000000 5.0000 0 - 6859 0 OS OS 0.000000 5.0000 0 - 6860 0 OS OS 0.000000 5.0000 0 - 6861 0 OS OS 0.000000 5.0000 0 - 6862 0 OS OS 0.000000 5.0000 0 - 6863 0 OS OS 0.000000 5.0000 0 - 6864 0 OS OS 0.000000 5.0000 0 - 6865 0 OS OS 0.000000 5.0000 0 - 6866 0 OS OS 0.000000 5.0000 0 - 6867 0 OS OS 0.000000 5.0000 0 - 6868 0 OS OS 0.000000 5.0000 0 - 6869 0 OS OS 0.000000 5.0000 0 - 6870 0 OS OS 0.000000 5.0000 0 - 6871 0 OS OS 0.000000 5.0000 0 - 6872 0 OS OS 0.000000 5.0000 0 - 6873 0 OS OS 0.000000 5.0000 0 - 6874 0 OS OS 0.000000 5.0000 0 - 6875 0 OS OS 0.000000 5.0000 0 - 6876 0 OS OS 0.000000 5.0000 0 - 6877 0 OS OS 0.000000 5.0000 0 - 6878 0 OS OS 0.000000 5.0000 0 - 6879 0 OS OS 0.000000 5.0000 0 - 6880 0 OS OS 0.000000 5.0000 0 - 6881 0 OS OS 0.000000 5.0000 0 - 6882 0 OS OS 0.000000 5.0000 0 - 6883 0 OS OS 0.000000 5.0000 0 - 6884 0 OS OS 0.000000 5.0000 0 - 6885 0 OS OS 0.000000 5.0000 0 - 6886 0 OS OS 0.000000 5.0000 0 - 6887 0 OS OS 0.000000 5.0000 0 - 6888 0 OS OS 0.000000 5.0000 0 - 6889 0 OS OS 0.000000 5.0000 0 - 6890 0 OS OS 0.000000 5.0000 0 - 6891 0 OS OS 0.000000 5.0000 0 - 6892 0 OS OS 0.000000 5.0000 0 - 6893 0 OS OS 0.000000 5.0000 0 - 6894 0 OS OS 0.000000 5.0000 0 - 6895 0 OS OS 0.000000 5.0000 0 - 6896 0 OS OS 0.000000 5.0000 0 - 6897 0 OS OS 0.000000 5.0000 0 - 6898 0 OS OS 0.000000 5.0000 0 - 6899 0 OS OS 0.000000 5.0000 0 - 6900 0 OS OS 0.000000 5.0000 0 - 6901 0 OS OS 0.000000 5.0000 0 - 6902 0 OS OS 0.000000 5.0000 0 - 6903 0 OS OS 0.000000 5.0000 0 - 6904 0 OS OS 0.000000 5.0000 0 - 6905 0 OS OS 0.000000 5.0000 0 - 6906 0 OS OS 0.000000 5.0000 0 - 6907 0 OS OS 0.000000 5.0000 0 - 6908 0 OS OS 0.000000 5.0000 0 - 6909 0 OS OS 0.000000 5.0000 0 - 6910 0 OS OS 0.000000 5.0000 0 - 6911 0 OS OS 0.000000 5.0000 0 - 6912 0 OS OS 0.000000 5.0000 0 - 6913 0 OS OS 0.000000 5.0000 0 - 6914 0 OS OS 0.000000 5.0000 0 - 6915 0 OS OS 0.000000 5.0000 0 - 6916 0 OS OS 0.000000 5.0000 0 - 6917 0 OS OS 0.000000 5.0000 0 - 6918 0 OS OS 0.000000 5.0000 0 - 6919 0 OS OS 0.000000 5.0000 0 - 6920 0 OS OS 0.000000 5.0000 0 - 6921 0 OS OS 0.000000 5.0000 0 - 6922 0 OS OS 0.000000 5.0000 0 - 6923 0 OS OS 0.000000 5.0000 0 - 6924 0 OS OS 0.000000 5.0000 0 - 6925 0 OS OS 0.000000 5.0000 0 - 6926 0 OS OS 0.000000 5.0000 0 - 6927 0 OS OS 0.000000 5.0000 0 - 6928 0 OS OS 0.000000 5.0000 0 - 6929 0 OS OS 0.000000 5.0000 0 - 6930 0 OS OS 0.000000 5.0000 0 - 6931 0 OS OS 0.000000 5.0000 0 - 6932 0 OS OS 0.000000 5.0000 0 - 6933 0 OS OS 0.000000 5.0000 0 - 6934 0 OS OS 0.000000 5.0000 0 - 6935 0 OS OS 0.000000 5.0000 0 - 6936 0 OS OS 0.000000 5.0000 0 - 6937 0 OS OS 0.000000 5.0000 0 - 6938 0 OS OS 0.000000 5.0000 0 - 6939 0 OS OS 0.000000 5.0000 0 - 6940 0 OS OS 0.000000 5.0000 0 - 6941 0 OS OS 0.000000 5.0000 0 - 6942 0 OS OS 0.000000 5.0000 0 - 6943 0 OS OS 0.000000 5.0000 0 - 6944 0 OS OS 0.000000 5.0000 0 - 6945 0 OS OS 0.000000 5.0000 0 - 6946 0 OS OS 0.000000 5.0000 0 - 6947 0 OS OS 0.000000 5.0000 0 - 6948 0 OS OS 0.000000 5.0000 0 - 6949 0 OS OS 0.000000 5.0000 0 - 6950 0 OS OS 0.000000 5.0000 0 - 6951 0 OS OS 0.000000 5.0000 0 - 6952 0 OS OS 0.000000 5.0000 0 - 6953 0 OS OS 0.000000 5.0000 0 - 6954 0 OS OS 0.000000 5.0000 0 - 6955 0 OS OS 0.000000 5.0000 0 - 6956 0 OS OS 0.000000 5.0000 0 - 6957 0 OS OS 0.000000 5.0000 0 - 6958 0 OS OS 0.000000 5.0000 0 - 6959 0 OS OS 0.000000 5.0000 0 - 6960 0 OS OS 0.000000 5.0000 0 - 6961 0 OS OS 0.000000 5.0000 0 - 6962 0 OS OS 0.000000 5.0000 0 - 6963 0 OS OS 0.000000 5.0000 0 - 6964 0 OS OS 0.000000 5.0000 0 - 6965 0 OS OS 0.000000 5.0000 0 - 6966 0 OS OS 0.000000 5.0000 0 - 6967 0 OS OS 0.000000 5.0000 0 - 6968 0 OS OS 0.000000 5.0000 0 - 6969 0 OS OS 0.000000 5.0000 0 - 6970 0 OS OS 0.000000 5.0000 0 - 6971 0 OS OS 0.000000 5.0000 0 - 6972 0 OS OS 0.000000 5.0000 0 - 6973 0 OS OS 0.000000 5.0000 0 - 6974 0 OS OS 0.000000 5.0000 0 - 6975 0 OS OS 0.000000 5.0000 0 - 6976 0 OS OS 0.000000 5.0000 0 - 6977 0 OS OS 0.000000 5.0000 0 - 6978 0 OS OS 0.000000 5.0000 0 - 6979 0 OS OS 0.000000 5.0000 0 - 6980 0 OS OS 0.000000 5.0000 0 - 6981 0 OS OS 0.000000 5.0000 0 - 6982 0 OS OS 0.000000 5.0000 0 - 6983 0 OS OS 0.000000 5.0000 0 - 6984 0 OS OS 0.000000 5.0000 0 - 6985 0 OS OS 0.000000 5.0000 0 - 6986 0 OS OS 0.000000 5.0000 0 - 6987 0 OS OS 0.000000 5.0000 0 - 6988 0 OS OS 0.000000 5.0000 0 - 6989 0 OS OS 0.000000 5.0000 0 - 6990 0 OS OS 0.000000 5.0000 0 - 6991 0 OS OS 0.000000 5.0000 0 - 6992 0 OS OS 0.000000 5.0000 0 - 6993 0 OS OS 0.000000 5.0000 0 - 6994 0 OS OS 0.000000 5.0000 0 - 6995 0 OS OS 0.000000 5.0000 0 - 6996 0 OS OS 0.000000 5.0000 0 - 6997 0 OS OS 0.000000 5.0000 0 - 6998 0 OS OS 0.000000 5.0000 0 - 6999 0 OS OS 0.000000 5.0000 0 - 7000 0 OS OS 0.000000 5.0000 0 - 7001 0 OS OS 0.000000 5.0000 0 - 7002 0 OS OS 0.000000 5.0000 0 - 7003 0 OS OS 0.000000 5.0000 0 - 7004 0 OS OS 0.000000 5.0000 0 - 7005 0 OS OS 0.000000 5.0000 0 - 7006 0 OS OS 0.000000 5.0000 0 - 7007 0 OS OS 0.000000 5.0000 0 - 7008 0 OS OS 0.000000 5.0000 0 - 7009 0 OS OS 0.000000 5.0000 0 - 7010 0 OS OS 0.000000 5.0000 0 - 7011 0 OS OS 0.000000 5.0000 0 - 7012 0 OS OS 0.000000 5.0000 0 - 7013 0 OS OS 0.000000 5.0000 0 - 7014 0 OS OS 0.000000 5.0000 0 - 7015 0 OS OS 0.000000 5.0000 0 - 7016 0 OS OS 0.000000 5.0000 0 - 7017 0 OS OS 0.000000 5.0000 0 - 7018 0 OS OS 0.000000 5.0000 0 - 7019 0 OS OS 0.000000 5.0000 0 - 7020 0 OS OS 0.000000 5.0000 0 - 7021 0 OS OS 0.000000 5.0000 0 - 7022 0 OS OS 0.000000 5.0000 0 - 7023 0 OS OS 0.000000 5.0000 0 - 7024 0 OS OS 0.000000 5.0000 0 - 7025 0 OS OS 0.000000 5.0000 0 - 7026 0 OS OS 0.000000 5.0000 0 - 7027 0 OS OS 0.000000 5.0000 0 - 7028 0 OS OS 0.000000 5.0000 0 - 7029 0 OS OS 0.000000 5.0000 0 - 7030 0 OS OS 0.000000 5.0000 0 - 7031 0 OS OS 0.000000 5.0000 0 - 7032 0 OS OS 0.000000 5.0000 0 - 7033 0 OS OS 0.000000 5.0000 0 - 7034 0 OS OS 0.000000 5.0000 0 - 7035 0 OS OS 0.000000 5.0000 0 - 7036 0 OS OS 0.000000 5.0000 0 - 7037 0 OS OS 0.000000 5.0000 0 - 7038 0 OS OS 0.000000 5.0000 0 - 7039 0 OS OS 0.000000 5.0000 0 - 7040 0 OS OS 0.000000 5.0000 0 - 7041 0 OS OS 0.000000 5.0000 0 - 7042 0 OS OS 0.000000 5.0000 0 - 7043 0 OS OS 0.000000 5.0000 0 - 7044 0 OS OS 0.000000 5.0000 0 - 7045 0 OS OS 0.000000 5.0000 0 - 7046 0 OS OS 0.000000 5.0000 0 - 7047 0 OS OS 0.000000 5.0000 0 - 7048 0 OS OS 0.000000 5.0000 0 - 7049 0 OS OS 0.000000 5.0000 0 - 7050 0 OS OS 0.000000 5.0000 0 - 7051 0 OS OS 0.000000 5.0000 0 - 7052 0 OS OS 0.000000 5.0000 0 - 7053 0 OS OS 0.000000 5.0000 0 - 7054 0 OS OS 0.000000 5.0000 0 - 7055 0 OS OS 0.000000 5.0000 0 - 7056 0 OS OS 0.000000 5.0000 0 - 7057 0 OS OS 0.000000 5.0000 0 - 7058 0 OS OS 0.000000 5.0000 0 - 7059 0 OS OS 0.000000 5.0000 0 - 7060 0 OS OS 0.000000 5.0000 0 - 7061 0 OS OS 0.000000 5.0000 0 - 7062 0 OS OS 0.000000 5.0000 0 - 7063 0 OS OS 0.000000 5.0000 0 - 7064 0 OS OS 0.000000 5.0000 0 - 7065 0 OS OS 0.000000 5.0000 0 - 7066 0 OS OS 0.000000 5.0000 0 - 7067 0 OS OS 0.000000 5.0000 0 - 7068 0 OS OS 0.000000 5.0000 0 - 7069 0 OS OS 0.000000 5.0000 0 - 7070 0 OS OS 0.000000 5.0000 0 - 7071 0 OS OS 0.000000 5.0000 0 - 7072 0 OS OS 0.000000 5.0000 0 - 7073 0 OS OS 0.000000 5.0000 0 - 7074 0 OS OS 0.000000 5.0000 0 - 7075 0 OS OS 0.000000 5.0000 0 - 7076 0 OS OS 0.000000 5.0000 0 - 7077 0 OS OS 0.000000 5.0000 0 - 7078 0 OS OS 0.000000 5.0000 0 - 7079 0 OS OS 0.000000 5.0000 0 - 7080 0 OS OS 0.000000 5.0000 0 - 7081 0 OS OS 0.000000 5.0000 0 - 7082 0 OS OS 0.000000 5.0000 0 - 7083 0 OS OS 0.000000 5.0000 0 - 7084 0 OS OS 0.000000 5.0000 0 - 7085 0 OS OS 0.000000 5.0000 0 - 7086 0 OS OS 0.000000 5.0000 0 - 7087 0 OS OS 0.000000 5.0000 0 - 7088 0 OS OS 0.000000 5.0000 0 - 7089 0 OS OS 0.000000 5.0000 0 - 7090 0 OS OS 0.000000 5.0000 0 - 7091 0 OS OS 0.000000 5.0000 0 - 7092 0 OS OS 0.000000 5.0000 0 - 7093 0 OS OS 0.000000 5.0000 0 - 7094 0 OS OS 0.000000 5.0000 0 - 7095 0 OS OS 0.000000 5.0000 0 - 7096 0 OS OS 0.000000 5.0000 0 - 7097 0 OS OS 0.000000 5.0000 0 - 7098 0 OS OS 0.000000 5.0000 0 - 7099 0 OS OS 0.000000 5.0000 0 - 7100 0 OS OS 0.000000 5.0000 0 - 7101 0 OS OS 0.000000 5.0000 0 - 7102 0 OS OS 0.000000 5.0000 0 - 7103 0 OS OS 0.000000 5.0000 0 - 7104 0 OS OS 0.000000 5.0000 0 - 7105 0 OS OS 0.000000 5.0000 0 - 7106 0 OS OS 0.000000 5.0000 0 - 7107 0 OS OS 0.000000 5.0000 0 - 7108 0 OS OS 0.000000 5.0000 0 - 7109 0 OS OS 0.000000 5.0000 0 - 7110 0 OS OS 0.000000 5.0000 0 - 7111 0 OS OS 0.000000 5.0000 0 - 7112 0 OS OS 0.000000 5.0000 0 - 7113 0 OS OS 0.000000 5.0000 0 - 7114 0 OS OS 0.000000 5.0000 0 - 7115 0 OS OS 0.000000 5.0000 0 - 7116 0 OS OS 0.000000 5.0000 0 - 7117 0 OS OS 0.000000 5.0000 0 - 7118 0 OS OS 0.000000 5.0000 0 - 7119 0 OS OS 0.000000 5.0000 0 - 7120 0 OS OS 0.000000 5.0000 0 - 7121 0 OS OS 0.000000 5.0000 0 - 7122 0 OS OS 0.000000 5.0000 0 - 7123 0 OS OS 0.000000 5.0000 0 - 7124 0 OS OS 0.000000 5.0000 0 - 7125 0 OS OS 0.000000 5.0000 0 - 7126 0 OS OS 0.000000 5.0000 0 - 7127 0 OS OS 0.000000 5.0000 0 - 7128 0 OS OS 0.000000 5.0000 0 - 7129 0 OS OS 0.000000 5.0000 0 - 7130 0 OS OS 0.000000 5.0000 0 - 7131 0 OS OS 0.000000 5.0000 0 - 7132 0 OS OS 0.000000 5.0000 0 - 7133 0 OS OS 0.000000 5.0000 0 - 7134 0 OS OS 0.000000 5.0000 0 - 7135 0 OS OS 0.000000 5.0000 0 - 7136 0 OS OS 0.000000 5.0000 0 - 7137 0 OS OS 0.000000 5.0000 0 - 7138 0 OS OS 0.000000 5.0000 0 - 7139 0 OS OS 0.000000 5.0000 0 - 7140 0 OS OS 0.000000 5.0000 0 - 7141 0 OS OS 0.000000 5.0000 0 - 7142 0 OS OS 0.000000 5.0000 0 - 7143 0 OS OS 0.000000 5.0000 0 - 7144 0 OS OS 0.000000 5.0000 0 - 7145 0 OS OS 0.000000 5.0000 0 - 7146 0 OS OS 0.000000 5.0000 0 - 7147 0 OS OS 0.000000 5.0000 0 - 7148 0 OS OS 0.000000 5.0000 0 - 7149 0 OS OS 0.000000 5.0000 0 - 7150 0 OS OS 0.000000 5.0000 0 - 7151 0 OS OS 0.000000 5.0000 0 - 7152 0 OS OS 0.000000 5.0000 0 - 7153 0 OS OS 0.000000 5.0000 0 - 7154 0 OS OS 0.000000 5.0000 0 - 7155 0 OS OS 0.000000 5.0000 0 - 7156 0 OS OS 0.000000 5.0000 0 - 7157 0 OS OS 0.000000 5.0000 0 - 7158 0 OS OS 0.000000 5.0000 0 - 7159 0 OS OS 0.000000 5.0000 0 - 7160 0 OS OS 0.000000 5.0000 0 - 7161 0 OS OS 0.000000 5.0000 0 - 7162 0 OS OS 0.000000 5.0000 0 - 7163 0 OS OS 0.000000 5.0000 0 - 7164 0 OS OS 0.000000 5.0000 0 - 7165 0 OS OS 0.000000 5.0000 0 - 7166 0 OS OS 0.000000 5.0000 0 - 7167 0 OS OS 0.000000 5.0000 0 - 7168 0 OS OS 0.000000 5.0000 0 - 7169 0 OS OS 0.000000 5.0000 0 - 7170 0 OS OS 0.000000 5.0000 0 - 7171 0 OS OS 0.000000 5.0000 0 - 7172 0 OS OS 0.000000 5.0000 0 - 7173 0 OS OS 0.000000 5.0000 0 - 7174 0 OS OS 0.000000 5.0000 0 - 7175 0 OS OS 0.000000 5.0000 0 - 7176 0 OS OS 0.000000 5.0000 0 - 7177 0 OS OS 0.000000 5.0000 0 - 7178 0 OS OS 0.000000 5.0000 0 - 7179 0 OS OS 0.000000 5.0000 0 - 7180 0 OS OS 0.000000 5.0000 0 - 7181 0 OS OS 0.000000 5.0000 0 - 7182 0 OS OS 0.000000 5.0000 0 - 7183 0 OS OS 0.000000 5.0000 0 - 7184 0 OS OS 0.000000 5.0000 0 - 7185 0 OS OS 0.000000 5.0000 0 - 7186 0 OS OS 0.000000 5.0000 0 - 7187 0 OS OS 0.000000 5.0000 0 - 7188 0 OS OS 0.000000 5.0000 0 - 7189 0 OS OS 0.000000 5.0000 0 - 7190 0 OS OS 0.000000 5.0000 0 - 7191 0 OS OS 0.000000 5.0000 0 - 7192 0 OS OS 0.000000 5.0000 0 - 7193 0 OS OS 0.000000 5.0000 0 - 7194 0 OS OS 0.000000 5.0000 0 - 7195 0 OS OS 0.000000 5.0000 0 - 7196 0 OS OS 0.000000 5.0000 0 - 7197 0 OS OS 0.000000 5.0000 0 - 7198 0 OS OS 0.000000 5.0000 0 - 7199 0 OS OS 0.000000 5.0000 0 - 7200 0 OS OS 0.000000 5.0000 0 - 7201 0 OS OS 0.000000 5.0000 0 - 7202 0 OS OS 0.000000 5.0000 0 - 7203 0 OS OS 0.000000 5.0000 0 - 7204 0 OS OS 0.000000 5.0000 0 - 7205 0 OS OS 0.000000 5.0000 0 - 7206 0 OS OS 0.000000 5.0000 0 - 7207 0 OS OS 0.000000 5.0000 0 - 7208 0 OS OS 0.000000 5.0000 0 - 7209 0 OS OS 0.000000 5.0000 0 - 7210 0 OS OS 0.000000 5.0000 0 - 7211 0 OS OS 0.000000 5.0000 0 - 7212 0 OS OS 0.000000 5.0000 0 - 7213 0 OS OS 0.000000 5.0000 0 - 7214 0 OS OS 0.000000 5.0000 0 - 7215 0 OS OS 0.000000 5.0000 0 - 7216 0 OS OS 0.000000 5.0000 0 - 7217 0 OS OS 0.000000 5.0000 0 - 7218 0 OS OS 0.000000 5.0000 0 - 7219 0 OS OS 0.000000 5.0000 0 - 7220 0 OS OS 0.000000 5.0000 0 - 7221 0 OS OS 0.000000 5.0000 0 - 7222 0 OS OS 0.000000 5.0000 0 - 7223 0 OS OS 0.000000 5.0000 0 - 7224 0 OS OS 0.000000 5.0000 0 - 7225 0 OS OS 0.000000 5.0000 0 - 7226 0 OS OS 0.000000 5.0000 0 - 7227 0 OS OS 0.000000 5.0000 0 - 7228 0 OS OS 0.000000 5.0000 0 - 7229 0 OS OS 0.000000 5.0000 0 - 7230 0 OS OS 0.000000 5.0000 0 - 7231 0 OS OS 0.000000 5.0000 0 - 7232 0 OS OS 0.000000 5.0000 0 - 7233 0 OS OS 0.000000 5.0000 0 - 7234 0 OS OS 0.000000 5.0000 0 - 7235 0 OS OS 0.000000 5.0000 0 - 7236 0 OS OS 0.000000 5.0000 0 - 7237 0 OS OS 0.000000 5.0000 0 - 7238 0 OS OS 0.000000 5.0000 0 - 7239 0 OS OS 0.000000 5.0000 0 - 7240 0 OS OS 0.000000 5.0000 0 - 7241 0 OS OS 0.000000 5.0000 0 - 7242 0 OS OS 0.000000 5.0000 0 - 7243 0 OS OS 0.000000 5.0000 0 - 7244 0 OS OS 0.000000 5.0000 0 - 7245 0 OS OS 0.000000 5.0000 0 - 7246 0 OS OS 0.000000 5.0000 0 - 7247 0 OS OS 0.000000 5.0000 0 - 7248 0 OS OS 0.000000 5.0000 0 - 7249 0 OS OS 0.000000 5.0000 0 - 7250 0 OS OS 0.000000 5.0000 0 - 7251 0 OS OS 0.000000 5.0000 0 - 7252 0 OS OS 0.000000 5.0000 0 - 7253 0 OS OS 0.000000 5.0000 0 - 7254 0 OS OS 0.000000 5.0000 0 - 7255 0 OS OS 0.000000 5.0000 0 - 7256 0 OS OS 0.000000 5.0000 0 - 7257 0 OS OS 0.000000 5.0000 0 - 7258 0 OS OS 0.000000 5.0000 0 - 7259 0 OS OS 0.000000 5.0000 0 - 7260 0 OS OS 0.000000 5.0000 0 - 7261 0 OS OS 0.000000 5.0000 0 - 7262 0 OS OS 0.000000 5.0000 0 - 7263 0 OS OS 0.000000 5.0000 0 - 7264 0 OS OS 0.000000 5.0000 0 - 7265 0 OS OS 0.000000 5.0000 0 - 7266 0 OS OS 0.000000 5.0000 0 - 7267 0 OS OS 0.000000 5.0000 0 - 7268 0 OS OS 0.000000 5.0000 0 - 7269 0 OS OS 0.000000 5.0000 0 - 7270 0 OS OS 0.000000 5.0000 0 - 7271 0 OS OS 0.000000 5.0000 0 - 7272 0 OS OS 0.000000 5.0000 0 - 7273 0 OS OS 0.000000 5.0000 0 - 7274 0 OS OS 0.000000 5.0000 0 - 7275 0 OS OS 0.000000 5.0000 0 - 7276 0 OS OS 0.000000 5.0000 0 - 7277 0 OS OS 0.000000 5.0000 0 - 7278 0 OS OS 0.000000 5.0000 0 - 7279 0 OS OS 0.000000 5.0000 0 - 7280 0 OS OS 0.000000 5.0000 0 - 7281 0 OS OS 0.000000 5.0000 0 - 7282 0 OS OS 0.000000 5.0000 0 - 7283 0 OS OS 0.000000 5.0000 0 - 7284 0 OS OS 0.000000 5.0000 0 - 7285 0 OS OS 0.000000 5.0000 0 - 7286 0 OS OS 0.000000 5.0000 0 - 7287 0 OS OS 0.000000 5.0000 0 - 7288 0 OS OS 0.000000 5.0000 0 - 7289 0 OS OS 0.000000 5.0000 0 - 7290 0 OS OS 0.000000 5.0000 0 - 7291 0 OS OS 0.000000 5.0000 0 - 7292 0 OS OS 0.000000 5.0000 0 - 7293 0 OS OS 0.000000 5.0000 0 - 7294 0 OS OS 0.000000 5.0000 0 - 7295 0 OS OS 0.000000 5.0000 0 - 7296 0 OS OS 0.000000 5.0000 0 - 7297 0 OS OS 0.000000 5.0000 0 - 7298 0 OS OS 0.000000 5.0000 0 - 7299 0 OS OS 0.000000 5.0000 0 - 7300 0 OS OS 0.000000 5.0000 0 - 7301 0 OS OS 0.000000 5.0000 0 - 7302 0 OS OS 0.000000 5.0000 0 - 7303 0 OS OS 0.000000 5.0000 0 - 7304 0 OS OS 0.000000 5.0000 0 - 7305 0 OS OS 0.000000 5.0000 0 - 7306 0 OS OS 0.000000 5.0000 0 - 7307 0 OS OS 0.000000 5.0000 0 - 7308 0 OS OS 0.000000 5.0000 0 - 7309 0 OS OS 0.000000 5.0000 0 - 7310 0 OS OS 0.000000 5.0000 0 - 7311 0 OS OS 0.000000 5.0000 0 - 7312 0 OS OS 0.000000 5.0000 0 - 7313 0 OS OS 0.000000 5.0000 0 - 7314 0 OS OS 0.000000 5.0000 0 - 7315 0 OS OS 0.000000 5.0000 0 - 7316 0 OS OS 0.000000 5.0000 0 - 7317 0 OS OS 0.000000 5.0000 0 - 7318 0 OS OS 0.000000 5.0000 0 - 7319 0 OS OS 0.000000 5.0000 0 - 7320 0 OS OS 0.000000 5.0000 0 - 7321 0 OS OS 0.000000 5.0000 0 - 7322 0 OS OS 0.000000 5.0000 0 - 7323 0 OS OS 0.000000 5.0000 0 - 7324 0 OS OS 0.000000 5.0000 0 - 7325 0 OS OS 0.000000 5.0000 0 - 7326 0 OS OS 0.000000 5.0000 0 - 7327 0 OS OS 0.000000 5.0000 0 - 7328 0 OS OS 0.000000 5.0000 0 - 7329 0 OS OS 0.000000 5.0000 0 - 7330 0 OS OS 0.000000 5.0000 0 - 7331 0 OS OS 0.000000 5.0000 0 - 7332 0 OS OS 0.000000 5.0000 0 - 7333 0 OS OS 0.000000 5.0000 0 - 7334 0 OS OS 0.000000 5.0000 0 - 7335 0 OS OS 0.000000 5.0000 0 - 7336 0 OS OS 0.000000 5.0000 0 - 7337 0 OS OS 0.000000 5.0000 0 - 7338 0 OS OS 0.000000 5.0000 0 - 7339 0 OS OS 0.000000 5.0000 0 - 7340 0 OS OS 0.000000 5.0000 0 - 7341 0 OS OS 0.000000 5.0000 0 - 7342 0 OS OS 0.000000 5.0000 0 - 7343 0 OS OS 0.000000 5.0000 0 - 7344 0 OS OS 0.000000 5.0000 0 - 7345 0 OS OS 0.000000 5.0000 0 - 7346 0 OS OS 0.000000 5.0000 0 - 7347 0 OS OS 0.000000 5.0000 0 - 7348 0 OS OS 0.000000 5.0000 0 - 7349 0 OS OS 0.000000 5.0000 0 - 7350 0 OS OS 0.000000 5.0000 0 - 7351 0 OS OS 0.000000 5.0000 0 - 7352 0 OS OS 0.000000 5.0000 0 - 7353 0 OS OS 0.000000 5.0000 0 - 7354 0 OS OS 0.000000 5.0000 0 - 7355 0 OS OS 0.000000 5.0000 0 - 7356 0 OS OS 0.000000 5.0000 0 - 7357 0 OS OS 0.000000 5.0000 0 - 7358 0 OS OS 0.000000 5.0000 0 - 7359 0 OS OS 0.000000 5.0000 0 - 7360 0 OS OS 0.000000 5.0000 0 - 7361 0 OS OS 0.000000 5.0000 0 - 7362 0 OS OS 0.000000 5.0000 0 - 7363 0 OS OS 0.000000 5.0000 0 - 7364 0 OS OS 0.000000 5.0000 0 - 7365 0 OS OS 0.000000 5.0000 0 - 7366 0 OS OS 0.000000 5.0000 0 - 7367 0 OS OS 0.000000 5.0000 0 - 7368 0 OS OS 0.000000 5.0000 0 - 7369 0 OS OS 0.000000 5.0000 0 - 7370 0 OS OS 0.000000 5.0000 0 - 7371 0 OS OS 0.000000 5.0000 0 - 7372 0 OS OS 0.000000 5.0000 0 - 7373 0 OS OS 0.000000 5.0000 0 - 7374 0 OS OS 0.000000 5.0000 0 - 7375 0 OS OS 0.000000 5.0000 0 - 7376 0 OS OS 0.000000 5.0000 0 - 7377 0 OS OS 0.000000 5.0000 0 - 7378 0 OS OS 0.000000 5.0000 0 - 7379 0 OS OS 0.000000 5.0000 0 - 7380 0 OS OS 0.000000 5.0000 0 - 7381 0 OS OS 0.000000 5.0000 0 - 7382 0 OS OS 0.000000 5.0000 0 - 7383 0 OS OS 0.000000 5.0000 0 - 7384 0 OS OS 0.000000 5.0000 0 - 7385 0 OS OS 0.000000 5.0000 0 - 7386 0 OS OS 0.000000 5.0000 0 - 7387 0 OS OS 0.000000 5.0000 0 - 7388 0 OS OS 0.000000 5.0000 0 - 7389 0 OS OS 0.000000 5.0000 0 - 7390 0 OS OS 0.000000 5.0000 0 - 7391 0 OS OS 0.000000 5.0000 0 - 7392 0 OS OS 0.000000 5.0000 0 - 7393 0 OS OS 0.000000 5.0000 0 - 7394 0 OS OS 0.000000 5.0000 0 - 7395 0 OS OS 0.000000 5.0000 0 - 7396 0 OS OS 0.000000 5.0000 0 - 7397 0 OS OS 0.000000 5.0000 0 - 7398 0 OS OS 0.000000 5.0000 0 - 7399 0 OS OS 0.000000 5.0000 0 - 7400 0 OS OS 0.000000 5.0000 0 - 7401 0 OS OS 0.000000 5.0000 0 - 7402 0 OS OS 0.000000 5.0000 0 - 7403 0 OS OS 0.000000 5.0000 0 - 7404 0 OS OS 0.000000 5.0000 0 - 7405 0 OS OS 0.000000 5.0000 0 - 7406 0 OS OS 0.000000 5.0000 0 - 7407 0 OS OS 0.000000 5.0000 0 - 7408 0 OS OS 0.000000 5.0000 0 - 7409 0 OS OS 0.000000 5.0000 0 - 7410 0 OS OS 0.000000 5.0000 0 - 7411 0 OS OS 0.000000 5.0000 0 - 7412 0 OS OS 0.000000 5.0000 0 - 7413 0 OS OS 0.000000 5.0000 0 - 7414 0 OS OS 0.000000 5.0000 0 - 7415 0 OS OS 0.000000 5.0000 0 - 7416 0 OS OS 0.000000 5.0000 0 - 7417 0 OS OS 0.000000 5.0000 0 - 7418 0 OS OS 0.000000 5.0000 0 - 7419 0 OS OS 0.000000 5.0000 0 - 7420 0 OS OS 0.000000 5.0000 0 - 7421 0 OS OS 0.000000 5.0000 0 - 7422 0 OS OS 0.000000 5.0000 0 - 7423 0 OS OS 0.000000 5.0000 0 - 7424 0 OS OS 0.000000 5.0000 0 - 7425 0 OS OS 0.000000 5.0000 0 - 7426 0 OS OS 0.000000 5.0000 0 - 7427 0 OS OS 0.000000 5.0000 0 - 7428 0 OS OS 0.000000 5.0000 0 - 7429 0 OS OS 0.000000 5.0000 0 - 7430 0 OS OS 0.000000 5.0000 0 - 7431 0 OS OS 0.000000 5.0000 0 - 7432 0 OS OS 0.000000 5.0000 0 - 7433 0 OS OS 0.000000 5.0000 0 - 7434 0 OS OS 0.000000 5.0000 0 - 7435 0 OS OS 0.000000 5.0000 0 - 7436 0 OS OS 0.000000 5.0000 0 - 7437 0 OS OS 0.000000 5.0000 0 - 7438 0 OS OS 0.000000 5.0000 0 - 7439 0 OS OS 0.000000 5.0000 0 - 7440 0 OS OS 0.000000 5.0000 0 - 7441 0 OS OS 0.000000 5.0000 0 - 7442 0 OS OS 0.000000 5.0000 0 - 7443 0 OS OS 0.000000 5.0000 0 - 7444 0 OS OS 0.000000 5.0000 0 - 7445 0 OS OS 0.000000 5.0000 0 - 7446 0 OS OS 0.000000 5.0000 0 - 7447 0 OS OS 0.000000 5.0000 0 - 7448 0 OS OS 0.000000 5.0000 0 - 7449 0 OS OS 0.000000 5.0000 0 - 7450 0 OS OS 0.000000 5.0000 0 - 7451 0 OS OS 0.000000 5.0000 0 - 7452 0 OS OS 0.000000 5.0000 0 - 7453 0 OS OS 0.000000 5.0000 0 - 7454 0 OS OS 0.000000 5.0000 0 - 7455 0 OS OS 0.000000 5.0000 0 - 7456 0 OS OS 0.000000 5.0000 0 - 7457 0 OS OS 0.000000 5.0000 0 - 7458 0 OS OS 0.000000 5.0000 0 - 7459 0 OS OS 0.000000 5.0000 0 - 7460 0 OS OS 0.000000 5.0000 0 - 7461 0 OS OS 0.000000 5.0000 0 - 7462 0 OS OS 0.000000 5.0000 0 - 7463 0 OS OS 0.000000 5.0000 0 - 7464 0 OS OS 0.000000 5.0000 0 - 7465 0 OS OS 0.000000 5.0000 0 - 7466 0 OS OS 0.000000 5.0000 0 - 7467 0 OS OS 0.000000 5.0000 0 - 7468 0 OS OS 0.000000 5.0000 0 - 7469 0 OS OS 0.000000 5.0000 0 - 7470 0 OS OS 0.000000 5.0000 0 - 7471 0 OS OS 0.000000 5.0000 0 - 7472 0 OS OS 0.000000 5.0000 0 - 7473 0 OS OS 0.000000 5.0000 0 - 7474 0 OS OS 0.000000 5.0000 0 - 7475 0 OS OS 0.000000 5.0000 0 - 7476 0 OS OS 0.000000 5.0000 0 - 7477 0 OS OS 0.000000 5.0000 0 - 7478 0 OS OS 0.000000 5.0000 0 - 7479 0 OS OS 0.000000 5.0000 0 - 7480 0 OS OS 0.000000 5.0000 0 - 7481 0 OS OS 0.000000 5.0000 0 - 7482 0 OS OS 0.000000 5.0000 0 - 7483 0 OS OS 0.000000 5.0000 0 - 7484 0 OS OS 0.000000 5.0000 0 - 7485 0 OS OS 0.000000 5.0000 0 - 7486 0 OS OS 0.000000 5.0000 0 - 7487 0 OS OS 0.000000 5.0000 0 - 7488 0 OS OS 0.000000 5.0000 0 - 7489 0 OS OS 0.000000 5.0000 0 - 7490 0 OS OS 0.000000 5.0000 0 - 7491 0 OS OS 0.000000 5.0000 0 - 7492 0 OS OS 0.000000 5.0000 0 - 7493 0 OS OS 0.000000 5.0000 0 - 7494 0 OS OS 0.000000 5.0000 0 - 7495 0 OS OS 0.000000 5.0000 0 - 7496 0 OS OS 0.000000 5.0000 0 - 7497 0 OS OS 0.000000 5.0000 0 - 7498 0 OS OS 0.000000 5.0000 0 - 7499 0 OS OS 0.000000 5.0000 0 - 7500 0 OS OS 0.000000 5.0000 0 - 7501 0 OS OS 0.000000 5.0000 0 - 7502 0 OS OS 0.000000 5.0000 0 - 7503 0 OS OS 0.000000 5.0000 0 - 7504 0 OS OS 0.000000 5.0000 0 - 7505 0 OS OS 0.000000 5.0000 0 - 7506 0 OS OS 0.000000 5.0000 0 - 7507 0 OS OS 0.000000 5.0000 0 - 7508 0 OS OS 0.000000 5.0000 0 - 7509 0 OS OS 0.000000 5.0000 0 - 7510 0 OS OS 0.000000 5.0000 0 - 7511 0 OS OS 0.000000 5.0000 0 - 7512 0 OS OS 0.000000 5.0000 0 - 7513 0 OS OS 0.000000 5.0000 0 - 7514 0 OS OS 0.000000 5.0000 0 - 7515 0 OS OS 0.000000 5.0000 0 - 7516 0 OS OS 0.000000 5.0000 0 - 7517 0 OS OS 0.000000 5.0000 0 - 7518 0 OS OS 0.000000 5.0000 0 - 7519 0 OS OS 0.000000 5.0000 0 - 7520 0 OS OS 0.000000 5.0000 0 - 7521 0 OS OS 0.000000 5.0000 0 - 7522 0 OS OS 0.000000 5.0000 0 - 7523 0 OS OS 0.000000 5.0000 0 - 7524 0 OS OS 0.000000 5.0000 0 - 7525 0 OS OS 0.000000 5.0000 0 - 7526 0 OS OS 0.000000 5.0000 0 - 7527 0 OS OS 0.000000 5.0000 0 - 7528 0 OS OS 0.000000 5.0000 0 - 7529 0 OS OS 0.000000 5.0000 0 - 7530 0 OS OS 0.000000 5.0000 0 - 7531 0 OS OS 0.000000 5.0000 0 - 7532 0 OS OS 0.000000 5.0000 0 - 7533 0 OS OS 0.000000 5.0000 0 - 7534 0 OS OS 0.000000 5.0000 0 - 7535 0 OS OS 0.000000 5.0000 0 - 7536 0 OS OS 0.000000 5.0000 0 - 7537 0 OS OS 0.000000 5.0000 0 - 7538 0 OS OS 0.000000 5.0000 0 - 7539 0 OS OS 0.000000 5.0000 0 - 7540 0 OS OS 0.000000 5.0000 0 - 7541 0 OS OS 0.000000 5.0000 0 - 7542 0 OS OS 0.000000 5.0000 0 - 7543 0 OS OS 0.000000 5.0000 0 - 7544 0 OS OS 0.000000 5.0000 0 - 7545 0 OS OS 0.000000 5.0000 0 - 7546 0 OS OS 0.000000 5.0000 0 - 7547 0 OS OS 0.000000 5.0000 0 - 7548 0 OS OS 0.000000 5.0000 0 - 7549 0 OS OS 0.000000 5.0000 0 - 7550 0 OS OS 0.000000 5.0000 0 - 7551 0 OS OS 0.000000 5.0000 0 - 7552 0 OS OS 0.000000 5.0000 0 - 7553 0 OS OS 0.000000 5.0000 0 - 7554 0 OS OS 0.000000 5.0000 0 - 7555 0 OS OS 0.000000 5.0000 0 - 7556 0 OS OS 0.000000 5.0000 0 - 7557 0 OS OS 0.000000 5.0000 0 - 7558 0 OS OS 0.000000 5.0000 0 - 7559 0 OS OS 0.000000 5.0000 0 - 7560 0 OS OS 0.000000 5.0000 0 - 7561 0 OS OS 0.000000 5.0000 0 - 7562 0 OS OS 0.000000 5.0000 0 - 7563 0 OS OS 0.000000 5.0000 0 - 7564 0 OS OS 0.000000 5.0000 0 - 7565 0 OS OS 0.000000 5.0000 0 - 7566 0 OS OS 0.000000 5.0000 0 - 7567 0 OS OS 0.000000 5.0000 0 - 7568 0 OS OS 0.000000 5.0000 0 - 7569 0 OS OS 0.000000 5.0000 0 - 7570 0 OS OS 0.000000 5.0000 0 - 7571 0 OS OS 0.000000 5.0000 0 - 7572 0 OS OS 0.000000 5.0000 0 - 7573 0 OS OS 0.000000 5.0000 0 - 7574 0 OS OS 0.000000 5.0000 0 - 7575 0 OS OS 0.000000 5.0000 0 - 7576 0 OS OS 0.000000 5.0000 0 - 7577 0 OS OS 0.000000 5.0000 0 - 7578 0 OS OS 0.000000 5.0000 0 - 7579 0 OS OS 0.000000 5.0000 0 - 7580 0 OS OS 0.000000 5.0000 0 - 7581 0 OS OS 0.000000 5.0000 0 - 7582 0 OS OS 0.000000 5.0000 0 - 7583 0 OS OS 0.000000 5.0000 0 - 7584 0 OS OS 0.000000 5.0000 0 - 7585 0 OS OS 0.000000 5.0000 0 - 7586 0 OS OS 0.000000 5.0000 0 - 7587 0 OS OS 0.000000 5.0000 0 - 7588 0 OS OS 0.000000 5.0000 0 - 7589 0 OS OS 0.000000 5.0000 0 - 7590 0 OS OS 0.000000 5.0000 0 - 7591 0 OS OS 0.000000 5.0000 0 - 7592 0 OS OS 0.000000 5.0000 0 - 7593 0 OS OS 0.000000 5.0000 0 - 7594 0 OS OS 0.000000 5.0000 0 - 7595 0 OS OS 0.000000 5.0000 0 - 7596 0 OS OS 0.000000 5.0000 0 - 7597 0 OS OS 0.000000 5.0000 0 - 7598 0 OS OS 0.000000 5.0000 0 - 7599 0 OS OS 0.000000 5.0000 0 - 7600 0 OS OS 0.000000 5.0000 0 - 7601 0 OS OS 0.000000 5.0000 0 - 7602 0 OS OS 0.000000 5.0000 0 - 7603 0 OS OS 0.000000 5.0000 0 - 7604 0 OS OS 0.000000 5.0000 0 - 7605 0 OS OS 0.000000 5.0000 0 - 7606 0 OS OS 0.000000 5.0000 0 - 7607 0 OS OS 0.000000 5.0000 0 - 7608 0 OS OS 0.000000 5.0000 0 - 7609 0 OS OS 0.000000 5.0000 0 - 7610 0 OS OS 0.000000 5.0000 0 - 7611 0 OS OS 0.000000 5.0000 0 - 7612 0 OS OS 0.000000 5.0000 0 - 7613 0 OS OS 0.000000 5.0000 0 - 7614 0 OS OS 0.000000 5.0000 0 - 7615 0 OS OS 0.000000 5.0000 0 - 7616 0 OS OS 0.000000 5.0000 0 - 7617 0 OS OS 0.000000 5.0000 0 - 7618 0 OS OS 0.000000 5.0000 0 - 7619 0 OS OS 0.000000 5.0000 0 - 7620 0 OS OS 0.000000 5.0000 0 - 7621 0 OS OS 0.000000 5.0000 0 - 7622 0 OS OS 0.000000 5.0000 0 - 7623 0 OS OS 0.000000 5.0000 0 - 7624 0 OS OS 0.000000 5.0000 0 - 7625 0 OS OS 0.000000 5.0000 0 - 7626 0 OS OS 0.000000 5.0000 0 - 7627 0 OS OS 0.000000 5.0000 0 - 7628 0 OS OS 0.000000 5.0000 0 - 7629 0 OS OS 0.000000 5.0000 0 - 7630 0 OS OS 0.000000 5.0000 0 - 7631 0 OS OS 0.000000 5.0000 0 - 7632 0 OS OS 0.000000 5.0000 0 - 7633 0 OS OS 0.000000 5.0000 0 - 7634 0 OS OS 0.000000 5.0000 0 - 7635 0 OS OS 0.000000 5.0000 0 - 7636 0 OS OS 0.000000 5.0000 0 - 7637 0 OS OS 0.000000 5.0000 0 - 7638 0 OS OS 0.000000 5.0000 0 - 7639 0 OS OS 0.000000 5.0000 0 - 7640 0 OS OS 0.000000 5.0000 0 - 7641 0 OS OS 0.000000 5.0000 0 - 7642 0 OS OS 0.000000 5.0000 0 - 7643 0 OS OS 0.000000 5.0000 0 - 7644 0 OS OS 0.000000 5.0000 0 - 7645 0 OS OS 0.000000 5.0000 0 - 7646 0 OS OS 0.000000 5.0000 0 - 7647 0 OS OS 0.000000 5.0000 0 - 7648 0 OS OS 0.000000 5.0000 0 - 7649 0 OS OS 0.000000 5.0000 0 - 7650 0 OS OS 0.000000 5.0000 0 - 7651 0 OS OS 0.000000 5.0000 0 - 7652 0 OS OS 0.000000 5.0000 0 - 7653 0 OS OS 0.000000 5.0000 0 - 7654 0 OS OS 0.000000 5.0000 0 - 7655 0 OS OS 0.000000 5.0000 0 - 7656 0 OS OS 0.000000 5.0000 0 - 7657 0 OS OS 0.000000 5.0000 0 - 7658 0 OS OS 0.000000 5.0000 0 - 7659 0 OS OS 0.000000 5.0000 0 - 7660 0 OS OS 0.000000 5.0000 0 - 7661 0 OS OS 0.000000 5.0000 0 - 7662 0 OS OS 0.000000 5.0000 0 - 7663 0 OS OS 0.000000 5.0000 0 - 7664 0 OS OS 0.000000 5.0000 0 - 7665 0 OS OS 0.000000 5.0000 0 - 7666 0 OS OS 0.000000 5.0000 0 - 7667 0 OS OS 0.000000 5.0000 0 - 7668 0 OS OS 0.000000 5.0000 0 - 7669 0 OS OS 0.000000 5.0000 0 - 7670 0 OS OS 0.000000 5.0000 0 - 7671 0 OS OS 0.000000 5.0000 0 - 7672 0 OS OS 0.000000 5.0000 0 - 7673 0 OS OS 0.000000 5.0000 0 - 7674 0 OS OS 0.000000 5.0000 0 - 7675 0 OS OS 0.000000 5.0000 0 - 7676 0 OS OS 0.000000 5.0000 0 - 7677 0 OS OS 0.000000 5.0000 0 - 7678 0 OS OS 0.000000 5.0000 0 - 7679 0 OS OS 0.000000 5.0000 0 - 7680 0 OS OS 0.000000 5.0000 0 - 7681 0 OS OS 0.000000 5.0000 0 - 7682 0 OS OS 0.000000 5.0000 0 - 7683 0 OS OS 0.000000 5.0000 0 - 7684 0 OS OS 0.000000 5.0000 0 - 7685 0 OS OS 0.000000 5.0000 0 - 7686 0 OS OS 0.000000 5.0000 0 - 7687 0 OS OS 0.000000 5.0000 0 - 7688 0 OS OS 0.000000 5.0000 0 - 7689 0 OS OS 0.000000 5.0000 0 - 7690 0 OS OS 0.000000 5.0000 0 - 7691 0 OS OS 0.000000 5.0000 0 - 7692 0 OS OS 0.000000 5.0000 0 - 7693 0 OS OS 0.000000 5.0000 0 - 7694 0 OS OS 0.000000 5.0000 0 - 7695 0 OS OS 0.000000 5.0000 0 - 7696 0 OS OS 0.000000 5.0000 0 - 7697 0 OS OS 0.000000 5.0000 0 - 7698 0 OS OS 0.000000 5.0000 0 - 7699 0 OS OS 0.000000 5.0000 0 - 7700 0 OS OS 0.000000 5.0000 0 - 7701 0 OS OS 0.000000 5.0000 0 - 7702 0 OS OS 0.000000 5.0000 0 - 7703 0 OS OS 0.000000 5.0000 0 - 7704 0 OS OS 0.000000 5.0000 0 - 7705 0 OS OS 0.000000 5.0000 0 - 7706 0 OS OS 0.000000 5.0000 0 - 7707 0 OS OS 0.000000 5.0000 0 - 7708 0 OS OS 0.000000 5.0000 0 - 7709 0 OS OS 0.000000 5.0000 0 - 7710 0 OS OS 0.000000 5.0000 0 - 7711 0 OS OS 0.000000 5.0000 0 - 7712 0 OS OS 0.000000 5.0000 0 - 7713 0 OS OS 0.000000 5.0000 0 - 7714 0 OS OS 0.000000 5.0000 0 - 7715 0 OS OS 0.000000 5.0000 0 - 7716 0 OS OS 0.000000 5.0000 0 - 7717 0 OS OS 0.000000 5.0000 0 - 7718 0 OS OS 0.000000 5.0000 0 - 7719 0 OS OS 0.000000 5.0000 0 - 7720 0 OS OS 0.000000 5.0000 0 - 7721 0 OS OS 0.000000 5.0000 0 - 7722 0 OS OS 0.000000 5.0000 0 - 7723 0 OS OS 0.000000 5.0000 0 - 7724 0 OS OS 0.000000 5.0000 0 - 7725 0 OS OS 0.000000 5.0000 0 - 7726 0 OS OS 0.000000 5.0000 0 - 7727 0 OS OS 0.000000 5.0000 0 - 7728 0 OS OS 0.000000 5.0000 0 - 7729 0 OS OS 0.000000 5.0000 0 - 7730 0 OS OS 0.000000 5.0000 0 - 7731 0 OS OS 0.000000 5.0000 0 - 7732 0 OS OS 0.000000 5.0000 0 - 7733 0 OS OS 0.000000 5.0000 0 - 7734 0 OS OS 0.000000 5.0000 0 - 7735 0 OS OS 0.000000 5.0000 0 - 7736 0 OS OS 0.000000 5.0000 0 - 7737 0 OS OS 0.000000 5.0000 0 - 7738 0 OS OS 0.000000 5.0000 0 - 7739 0 OS OS 0.000000 5.0000 0 - 7740 0 OS OS 0.000000 5.0000 0 - 7741 0 OS OS 0.000000 5.0000 0 - 7742 0 OS OS 0.000000 5.0000 0 - 7743 0 OS OS 0.000000 5.0000 0 - 7744 0 OS OS 0.000000 5.0000 0 - 7745 0 OS OS 0.000000 5.0000 0 - 7746 0 OS OS 0.000000 5.0000 0 - 7747 0 OS OS 0.000000 5.0000 0 - 7748 0 OS OS 0.000000 5.0000 0 - 7749 0 OS OS 0.000000 5.0000 0 - 7750 0 OS OS 0.000000 5.0000 0 - 7751 0 OS OS 0.000000 5.0000 0 - 7752 0 OS OS 0.000000 5.0000 0 - 7753 0 OS OS 0.000000 5.0000 0 - 7754 0 OS OS 0.000000 5.0000 0 - 7755 0 OS OS 0.000000 5.0000 0 - 7756 0 OS OS 0.000000 5.0000 0 - 7757 0 OS OS 0.000000 5.0000 0 - 7758 0 OS OS 0.000000 5.0000 0 - 7759 0 OS OS 0.000000 5.0000 0 - 7760 0 OS OS 0.000000 5.0000 0 - 7761 0 OS OS 0.000000 5.0000 0 - 7762 0 OS OS 0.000000 5.0000 0 - 7763 0 OS OS 0.000000 5.0000 0 - 7764 0 OS OS 0.000000 5.0000 0 - 7765 0 OS OS 0.000000 5.0000 0 - 7766 0 OS OS 0.000000 5.0000 0 - 7767 0 OS OS 0.000000 5.0000 0 - 7768 0 OS OS 0.000000 5.0000 0 - 7769 0 OS OS 0.000000 5.0000 0 - 7770 0 OS OS 0.000000 5.0000 0 - 7771 0 OS OS 0.000000 5.0000 0 - 7772 0 OS OS 0.000000 5.0000 0 - 7773 0 OS OS 0.000000 5.0000 0 - 7774 0 OS OS 0.000000 5.0000 0 - 7775 0 OS OS 0.000000 5.0000 0 - 7776 0 OS OS 0.000000 5.0000 0 - 7777 0 OS OS 0.000000 5.0000 0 - 7778 0 OS OS 0.000000 5.0000 0 - 7779 0 OS OS 0.000000 5.0000 0 - 7780 0 OS OS 0.000000 5.0000 0 - 7781 0 OS OS 0.000000 5.0000 0 - 7782 0 OS OS 0.000000 5.0000 0 - 7783 0 OS OS 0.000000 5.0000 0 - 7784 0 OS OS 0.000000 5.0000 0 - 7785 0 OS OS 0.000000 5.0000 0 - 7786 0 OS OS 0.000000 5.0000 0 - 7787 0 OS OS 0.000000 5.0000 0 - 7788 0 OS OS 0.000000 5.0000 0 - 7789 0 OS OS 0.000000 5.0000 0 - 7790 0 OS OS 0.000000 5.0000 0 - 7791 0 OS OS 0.000000 5.0000 0 - 7792 0 OS OS 0.000000 5.0000 0 - 7793 0 OS OS 0.000000 5.0000 0 - 7794 0 OS OS 0.000000 5.0000 0 - 7795 0 OS OS 0.000000 5.0000 0 - 7796 0 OS OS 0.000000 5.0000 0 - 7797 0 OS OS 0.000000 5.0000 0 - 7798 0 OS OS 0.000000 5.0000 0 - 7799 0 OS OS 0.000000 5.0000 0 - 7800 0 OS OS 0.000000 5.0000 0 - 7801 0 OS OS 0.000000 5.0000 0 - 7802 0 OS OS 0.000000 5.0000 0 - 7803 0 OS OS 0.000000 5.0000 0 - 7804 0 OS OS 0.000000 5.0000 0 - 7805 0 OS OS 0.000000 5.0000 0 - 7806 0 OS OS 0.000000 5.0000 0 - 7807 0 OS OS 0.000000 5.0000 0 - 7808 0 OS OS 0.000000 5.0000 0 - 7809 0 OS OS 0.000000 5.0000 0 - 7810 0 OS OS 0.000000 5.0000 0 - 7811 0 OS OS 0.000000 5.0000 0 - 7812 0 OS OS 0.000000 5.0000 0 - 7813 0 OS OS 0.000000 5.0000 0 - 7814 0 OS OS 0.000000 5.0000 0 - 7815 0 OS OS 0.000000 5.0000 0 - 7816 0 OS OS 0.000000 5.0000 0 - 7817 0 OS OS 0.000000 5.0000 0 - 7818 0 OS OS 0.000000 5.0000 0 - 7819 0 OS OS 0.000000 5.0000 0 - 7820 0 OS OS 0.000000 5.0000 0 - 7821 0 OS OS 0.000000 5.0000 0 - 7822 0 OS OS 0.000000 5.0000 0 - 7823 0 OS OS 0.000000 5.0000 0 - 7824 0 OS OS 0.000000 5.0000 0 - 7825 0 OS OS 0.000000 5.0000 0 - 7826 0 OS OS 0.000000 5.0000 0 - 7827 0 OS OS 0.000000 5.0000 0 - 7828 0 OS OS 0.000000 5.0000 0 - 7829 0 OS OS 0.000000 5.0000 0 - 7830 0 OS OS 0.000000 5.0000 0 - 7831 0 OS OS 0.000000 5.0000 0 - 7832 0 OS OS 0.000000 5.0000 0 - 7833 0 OS OS 0.000000 5.0000 0 - 7834 0 OS OS 0.000000 5.0000 0 - 7835 0 OS OS 0.000000 5.0000 0 - 7836 0 OS OS 0.000000 5.0000 0 - 7837 0 OS OS 0.000000 5.0000 0 - 7838 0 OS OS 0.000000 5.0000 0 - 7839 0 OS OS 0.000000 5.0000 0 - 7840 0 OS OS 0.000000 5.0000 0 - 7841 0 OS OS 0.000000 5.0000 0 - 7842 0 OS OS 0.000000 5.0000 0 - 7843 0 OS OS 0.000000 5.0000 0 - 7844 0 OS OS 0.000000 5.0000 0 - 7845 0 OS OS 0.000000 5.0000 0 - 7846 0 OS OS 0.000000 5.0000 0 - 7847 0 OS OS 0.000000 5.0000 0 - 7848 0 OS OS 0.000000 5.0000 0 - 7849 0 OS OS 0.000000 5.0000 0 - 7850 0 OS OS 0.000000 5.0000 0 - 7851 0 OS OS 0.000000 5.0000 0 - 7852 0 OS OS 0.000000 5.0000 0 - 7853 0 OS OS 0.000000 5.0000 0 - 7854 0 OS OS 0.000000 5.0000 0 - 7855 0 OS OS 0.000000 5.0000 0 - 7856 0 OS OS 0.000000 5.0000 0 - 7857 0 OS OS 0.000000 5.0000 0 - 7858 0 OS OS 0.000000 5.0000 0 - 7859 0 OS OS 0.000000 5.0000 0 - 7860 0 OS OS 0.000000 5.0000 0 - 7861 0 OS OS 0.000000 5.0000 0 - 7862 0 OS OS 0.000000 5.0000 0 - 7863 0 OS OS 0.000000 5.0000 0 - 7864 0 OS OS 0.000000 5.0000 0 - 7865 0 OS OS 0.000000 5.0000 0 - 7866 0 OS OS 0.000000 5.0000 0 - 7867 0 OS OS 0.000000 5.0000 0 - 7868 0 OS OS 0.000000 5.0000 0 - 7869 0 OS OS 0.000000 5.0000 0 - 7870 0 OS OS 0.000000 5.0000 0 - 7871 0 OS OS 0.000000 5.0000 0 - 7872 0 OS OS 0.000000 5.0000 0 - 7873 0 OS OS 0.000000 5.0000 0 - 7874 0 OS OS 0.000000 5.0000 0 - 7875 0 OS OS 0.000000 5.0000 0 - 7876 0 OS OS 0.000000 5.0000 0 - 7877 0 OS OS 0.000000 5.0000 0 - 7878 0 OS OS 0.000000 5.0000 0 - 7879 0 OS OS 0.000000 5.0000 0 - 7880 0 OS OS 0.000000 5.0000 0 - 7881 0 OS OS 0.000000 5.0000 0 - 7882 0 OS OS 0.000000 5.0000 0 - 7883 0 OS OS 0.000000 5.0000 0 - 7884 0 OS OS 0.000000 5.0000 0 - 7885 0 OS OS 0.000000 5.0000 0 - 7886 0 OS OS 0.000000 5.0000 0 - 7887 0 OS OS 0.000000 5.0000 0 - 7888 0 OS OS 0.000000 5.0000 0 - 7889 0 OS OS 0.000000 5.0000 0 - 7890 0 OS OS 0.000000 5.0000 0 - 7891 0 OS OS 0.000000 5.0000 0 - 7892 0 OS OS 0.000000 5.0000 0 - 7893 0 OS OS 0.000000 5.0000 0 - 7894 0 OS OS 0.000000 5.0000 0 - 7895 0 OS OS 0.000000 5.0000 0 - 7896 0 OS OS 0.000000 5.0000 0 - 7897 0 OS OS 0.000000 5.0000 0 - 7898 0 OS OS 0.000000 5.0000 0 - 7899 0 OS OS 0.000000 5.0000 0 - 7900 0 OS OS 0.000000 5.0000 0 - 7901 0 OS OS 0.000000 5.0000 0 - 7902 0 OS OS 0.000000 5.0000 0 - 7903 0 OS OS 0.000000 5.0000 0 - 7904 0 OS OS 0.000000 5.0000 0 - 7905 0 OS OS 0.000000 5.0000 0 - 7906 0 OS OS 0.000000 5.0000 0 - 7907 0 OS OS 0.000000 5.0000 0 - 7908 0 OS OS 0.000000 5.0000 0 - 7909 0 OS OS 0.000000 5.0000 0 - 7910 0 OS OS 0.000000 5.0000 0 - 7911 0 OS OS 0.000000 5.0000 0 - 7912 0 OS OS 0.000000 5.0000 0 - 7913 0 OS OS 0.000000 5.0000 0 - 7914 0 OS OS 0.000000 5.0000 0 - 7915 0 OS OS 0.000000 5.0000 0 - 7916 0 OS OS 0.000000 5.0000 0 - 7917 0 OS OS 0.000000 5.0000 0 - 7918 0 OS OS 0.000000 5.0000 0 - 7919 0 OS OS 0.000000 5.0000 0 - 7920 0 OS OS 0.000000 5.0000 0 - 7921 0 OS OS 0.000000 5.0000 0 - 7922 0 OS OS 0.000000 5.0000 0 - 7923 0 OS OS 0.000000 5.0000 0 - 7924 0 OS OS 0.000000 5.0000 0 - 7925 0 OS OS 0.000000 5.0000 0 - 7926 0 OS OS 0.000000 5.0000 0 - 7927 0 OS OS 0.000000 5.0000 0 - 7928 0 OS OS 0.000000 5.0000 0 - 7929 0 OS OS 0.000000 5.0000 0 - 7930 0 OS OS 0.000000 5.0000 0 - 7931 0 OS OS 0.000000 5.0000 0 - 7932 0 OS OS 0.000000 5.0000 0 - 7933 0 OS OS 0.000000 5.0000 0 - 7934 0 OS OS 0.000000 5.0000 0 - 7935 0 OS OS 0.000000 5.0000 0 - 7936 0 OS OS 0.000000 5.0000 0 - 7937 0 OS OS 0.000000 5.0000 0 - 7938 0 OS OS 0.000000 5.0000 0 - 7939 0 OS OS 0.000000 5.0000 0 - 7940 0 OS OS 0.000000 5.0000 0 - 7941 0 OS OS 0.000000 5.0000 0 - 7942 0 OS OS 0.000000 5.0000 0 - 7943 0 OS OS 0.000000 5.0000 0 - 7944 0 OS OS 0.000000 5.0000 0 - 7945 0 OS OS 0.000000 5.0000 0 - 7946 0 OS OS 0.000000 5.0000 0 - 7947 0 OS OS 0.000000 5.0000 0 - 7948 0 OS OS 0.000000 5.0000 0 - 7949 0 OS OS 0.000000 5.0000 0 - 7950 0 OS OS 0.000000 5.0000 0 - 7951 0 OS OS 0.000000 5.0000 0 - 7952 0 OS OS 0.000000 5.0000 0 - 7953 0 OS OS 0.000000 5.0000 0 - 7954 0 OS OS 0.000000 5.0000 0 - 7955 0 OS OS 0.000000 5.0000 0 - 7956 0 OS OS 0.000000 5.0000 0 - 7957 0 OS OS 0.000000 5.0000 0 - 7958 0 OS OS 0.000000 5.0000 0 - 7959 0 OS OS 0.000000 5.0000 0 - 7960 0 OS OS 0.000000 5.0000 0 - 7961 0 OS OS 0.000000 5.0000 0 - 7962 0 OS OS 0.000000 5.0000 0 - 7963 0 OS OS 0.000000 5.0000 0 - 7964 0 OS OS 0.000000 5.0000 0 - 7965 0 OS OS 0.000000 5.0000 0 - 7966 0 OS OS 0.000000 5.0000 0 - 7967 0 OS OS 0.000000 5.0000 0 - 7968 0 OS OS 0.000000 5.0000 0 - 7969 0 OS OS 0.000000 5.0000 0 - 7970 0 OS OS 0.000000 5.0000 0 - 7971 0 OS OS 0.000000 5.0000 0 - 7972 0 OS OS 0.000000 5.0000 0 - 7973 0 OS OS 0.000000 5.0000 0 - 7974 0 OS OS 0.000000 5.0000 0 - 7975 0 OS OS 0.000000 5.0000 0 - 7976 0 OS OS 0.000000 5.0000 0 - 7977 0 OS OS 0.000000 5.0000 0 - 7978 0 OS OS 0.000000 5.0000 0 - 7979 0 OS OS 0.000000 5.0000 0 - 7980 0 OS OS 0.000000 5.0000 0 - 7981 0 OS OS 0.000000 5.0000 0 - 7982 0 OS OS 0.000000 5.0000 0 - 7983 0 OS OS 0.000000 5.0000 0 - 7984 0 OS OS 0.000000 5.0000 0 - 7985 0 OS OS 0.000000 5.0000 0 - 7986 0 OS OS 0.000000 5.0000 0 - 7987 0 OS OS 0.000000 5.0000 0 - 7988 0 OS OS 0.000000 5.0000 0 - 7989 0 OS OS 0.000000 5.0000 0 - 7990 0 OS OS 0.000000 5.0000 0 - 7991 0 OS OS 0.000000 5.0000 0 - 7992 0 OS OS 0.000000 5.0000 0 - 7993 0 OS OS 0.000000 5.0000 0 - 7994 0 OS OS 0.000000 5.0000 0 - 7995 0 OS OS 0.000000 5.0000 0 - 7996 0 OS OS 0.000000 5.0000 0 - 7997 0 OS OS 0.000000 5.0000 0 - 7998 0 OS OS 0.000000 5.0000 0 - 7999 0 OS OS 0.000000 5.0000 0 - 8000 0 OS OS 0.000000 5.0000 0 - 8001 0 OS OS 0.000000 5.0000 0 - 8002 0 OS OS 0.000000 5.0000 0 - 8003 0 OS OS 0.000000 5.0000 0 - 8004 0 OS OS 0.000000 5.0000 0 - 8005 0 OS OS 0.000000 5.0000 0 - 8006 0 OS OS 0.000000 5.0000 0 - 8007 0 OS OS 0.000000 5.0000 0 - 8008 0 OS OS 0.000000 5.0000 0 - 8009 0 OS OS 0.000000 5.0000 0 - 8010 0 OS OS 0.000000 5.0000 0 - 8011 0 OS OS 0.000000 5.0000 0 - 8012 0 OS OS 0.000000 5.0000 0 - 8013 0 OS OS 0.000000 5.0000 0 - 8014 0 OS OS 0.000000 5.0000 0 - 8015 0 OS OS 0.000000 5.0000 0 - 8016 0 OS OS 0.000000 5.0000 0 - 8017 0 OS OS 0.000000 5.0000 0 - 8018 0 OS OS 0.000000 5.0000 0 - 8019 0 OS OS 0.000000 5.0000 0 - 8020 0 OS OS 0.000000 5.0000 0 - 8021 0 OS OS 0.000000 5.0000 0 - 8022 0 OS OS 0.000000 5.0000 0 - 8023 0 OS OS 0.000000 5.0000 0 - 8024 0 OS OS 0.000000 5.0000 0 - 8025 0 OS OS 0.000000 5.0000 0 - 8026 0 OS OS 0.000000 5.0000 0 - 8027 0 OS OS 0.000000 5.0000 0 - 8028 0 OS OS 0.000000 5.0000 0 - 8029 0 OS OS 0.000000 5.0000 0 - 8030 0 OS OS 0.000000 5.0000 0 - 8031 0 OS OS 0.000000 5.0000 0 - 8032 0 OS OS 0.000000 5.0000 0 - 8033 0 OS OS 0.000000 5.0000 0 - 8034 0 OS OS 0.000000 5.0000 0 - 8035 0 OS OS 0.000000 5.0000 0 - 8036 0 OS OS 0.000000 5.0000 0 - 8037 0 OS OS 0.000000 5.0000 0 - 8038 0 OS OS 0.000000 5.0000 0 - 8039 0 OS OS 0.000000 5.0000 0 - 8040 0 OS OS 0.000000 5.0000 0 - 8041 0 OS OS 0.000000 5.0000 0 - 8042 0 OS OS 0.000000 5.0000 0 - 8043 0 OS OS 0.000000 5.0000 0 - 8044 0 OS OS 0.000000 5.0000 0 - 8045 0 OS OS 0.000000 5.0000 0 - 8046 0 OS OS 0.000000 5.0000 0 - 8047 0 OS OS 0.000000 5.0000 0 - 8048 0 OS OS 0.000000 5.0000 0 - 8049 0 OS OS 0.000000 5.0000 0 - 8050 0 OS OS 0.000000 5.0000 0 - 8051 0 OS OS 0.000000 5.0000 0 - 8052 0 OS OS 0.000000 5.0000 0 - 8053 0 NS NS 0.000000 25.0000 0 - 8054 0 NS NS 0.000000 25.0000 0 - 8055 0 NS NS 0.000000 25.0000 0 - 8056 0 NS NS 0.000000 25.0000 0 - 8057 0 NS NS 0.000000 25.0000 0 - 8058 0 NS NS 0.000000 25.0000 0 - 8059 0 NS NS 0.000000 25.0000 0 - 8060 0 NS NS 0.000000 25.0000 0 - 8061 0 NS NS 0.000000 25.0000 0 - 8062 0 NS NS 0.000000 25.0000 0 - 8063 0 NS NS 0.000000 25.0000 0 - 8064 0 NS NS 0.000000 25.0000 0 - 8065 0 NS NS 0.000000 25.0000 0 - 8066 0 NS NS 0.000000 25.0000 0 - 8067 0 NS NS 0.000000 25.0000 0 - 8068 0 NS NS 0.000000 25.0000 0 - 8069 0 NS NS 0.000000 25.0000 0 - 8070 0 NS NS 0.000000 25.0000 0 - 8071 0 NS NS 0.000000 25.0000 0 - 8072 0 NS NS 0.000000 25.0000 0 - 8073 0 NS NS 0.000000 25.0000 0 - 8074 0 NS NS 0.000000 25.0000 0 - 8075 0 NS NS 0.000000 25.0000 0 - 8076 0 NS NS 0.000000 25.0000 0 - 8077 0 NS NS 0.000000 25.0000 0 - 8078 0 NS NS 0.000000 25.0000 0 - 8079 0 NS NS 0.000000 25.0000 0 - 8080 0 NS NS 0.000000 25.0000 0 - 8081 0 NS NS 0.000000 25.0000 0 - 8082 0 NS NS 0.000000 25.0000 0 - 8083 0 NS NS 0.000000 25.0000 0 - 8084 0 NS NS 0.000000 25.0000 0 - 8085 0 NS NS 0.000000 25.0000 0 - 8086 0 NS NS 0.000000 25.0000 0 - 8087 0 NS NS 0.000000 25.0000 0 - 8088 0 NS NS 0.000000 25.0000 0 - 8089 0 NS NS 0.000000 25.0000 0 - 8090 0 NS NS 0.000000 25.0000 0 - 8091 0 NS NS 0.000000 25.0000 0 - 8092 0 NS NS 0.000000 25.0000 0 - 8093 0 NS NS 0.000000 25.0000 0 - 8094 0 NS NS 0.000000 25.0000 0 - 8095 0 NS NS 0.000000 25.0000 0 - 8096 0 NS NS 0.000000 25.0000 0 - 8097 0 NS NS 0.000000 25.0000 0 - 8098 0 NS NS 0.000000 25.0000 0 - 8099 0 NS NS 0.000000 25.0000 0 - 8100 0 NS NS 0.000000 25.0000 0 - 8101 0 NS NS 0.000000 25.0000 0 - 8102 0 NS NS 0.000000 25.0000 0 - 8103 0 NS NS 0.000000 25.0000 0 - 8104 0 NS NS 0.000000 25.0000 0 - 8105 0 NS NS 0.000000 25.0000 0 - 8106 0 NS NS 0.000000 25.0000 0 - 8107 0 NS NS 0.000000 25.0000 0 - 8108 0 NS NS 0.000000 25.0000 0 - 8109 0 NS NS 0.000000 25.0000 0 - 8110 0 NS NS 0.000000 25.0000 0 - 8111 0 NS NS 0.000000 25.0000 0 - 8112 0 NS NS 0.000000 25.0000 0 - 8113 0 NS NS 0.000000 25.0000 0 - 8114 0 NS NS 0.000000 25.0000 0 - 8115 0 NS NS 0.000000 25.0000 0 - 8116 0 NS NS 0.000000 25.0000 0 - 8117 0 NS NS 0.000000 25.0000 0 - 8118 0 NS NS 0.000000 25.0000 0 - 8119 0 NS NS 0.000000 25.0000 0 - 8120 0 NS NS 0.000000 25.0000 0 - 8121 0 NS NS 0.000000 25.0000 0 - 8122 0 NS NS 0.000000 25.0000 0 - 8123 0 NS NS 0.000000 25.0000 0 - 8124 0 NS NS 0.000000 25.0000 0 - 8125 0 NS NS 0.000000 25.0000 0 - 8126 0 NS NS 0.000000 25.0000 0 - 8127 0 NS NS 0.000000 25.0000 0 - 8128 0 NS NS 0.000000 25.0000 0 - 8129 0 NS NS 0.000000 25.0000 0 - 8130 0 NS NS 0.000000 25.0000 0 - 8131 0 NS NS 0.000000 25.0000 0 - 8132 0 NS NS 0.000000 25.0000 0 - 8133 0 NS NS 0.000000 25.0000 0 - 8134 0 NS NS 0.000000 25.0000 0 - 8135 0 NS NS 0.000000 25.0000 0 - 8136 0 NS NS 0.000000 25.0000 0 - 8137 0 NS NS 0.000000 25.0000 0 - 8138 0 NS NS 0.000000 25.0000 0 - 8139 0 NS NS 0.000000 25.0000 0 - 8140 0 NS NS 0.000000 25.0000 0 - 8141 0 NS NS 0.000000 25.0000 0 - 8142 0 NS NS 0.000000 25.0000 0 - 8143 0 NS NS 0.000000 25.0000 0 - 8144 0 NS NS 0.000000 25.0000 0 - 8145 0 NS NS 0.000000 25.0000 0 - 8146 0 NS NS 0.000000 25.0000 0 - 8147 0 NS NS 0.000000 25.0000 0 - 8148 0 NS NS 0.000000 25.0000 0 - 8149 0 NS NS 0.000000 25.0000 0 - 8150 0 NS NS 0.000000 25.0000 0 - 8151 0 NS NS 0.000000 25.0000 0 - 8152 0 NS NS 0.000000 25.0000 0 - 8153 0 NS NS 0.000000 25.0000 0 - 8154 0 NS NS 0.000000 25.0000 0 - 8155 0 NS NS 0.000000 25.0000 0 - 8156 0 NS NS 0.000000 25.0000 0 - 8157 0 NS NS 0.000000 25.0000 0 - 8158 0 NS NS 0.000000 25.0000 0 - 8159 0 NS NS 0.000000 25.0000 0 - 8160 0 NS NS 0.000000 25.0000 0 - 8161 0 NS NS 0.000000 25.0000 0 - 8162 0 NS NS 0.000000 25.0000 0 - 8163 0 NS NS 0.000000 25.0000 0 - 8164 0 NS NS 0.000000 25.0000 0 - 8165 0 NS NS 0.000000 25.0000 0 - 8166 0 NS NS 0.000000 25.0000 0 - 8167 0 NS NS 0.000000 25.0000 0 - 8168 0 NS NS 0.000000 25.0000 0 - 8169 0 NS NS 0.000000 25.0000 0 - 8170 0 NS NS 0.000000 25.0000 0 - 8171 0 NS NS 0.000000 25.0000 0 - 8172 0 NS NS 0.000000 25.0000 0 - 8173 0 NS NS 0.000000 25.0000 0 - 8174 0 NS NS 0.000000 25.0000 0 - 8175 0 NS NS 0.000000 25.0000 0 - 8176 0 NS NS 0.000000 25.0000 0 - 8177 0 NS NS 0.000000 25.0000 0 - 8178 0 NS NS 0.000000 25.0000 0 - 8179 0 NS NS 0.000000 25.0000 0 - 8180 0 NS NS 0.000000 25.0000 0 - 8181 0 NS NS 0.000000 25.0000 0 - 8182 0 NS NS 0.000000 25.0000 0 - 8183 0 NS NS 0.000000 25.0000 0 - 8184 0 NS NS 0.000000 25.0000 0 - 8185 0 NS NS 0.000000 25.0000 0 - 8186 0 NS NS 0.000000 25.0000 0 - 8187 0 NS NS 0.000000 25.0000 0 - 8188 0 NS NS 0.000000 25.0000 0 - 8189 0 NS NS 0.000000 25.0000 0 - 8190 0 NS NS 0.000000 25.0000 0 - 8191 0 NS NS 0.000000 25.0000 0 - 8192 0 NS NS 0.000000 25.0000 0 - 8193 0 NS NS 0.000000 25.0000 0 - 8194 0 NS NS 0.000000 25.0000 0 - 8195 0 NS NS 0.000000 25.0000 0 - 8196 0 NS NS 0.000000 25.0000 0 - 8197 0 NS NS 0.000000 25.0000 0 - 8198 0 NS NS 0.000000 25.0000 0 - 8199 0 NS NS 0.000000 25.0000 0 - 8200 0 NS NS 0.000000 25.0000 0 - 8201 0 NS NS 0.000000 25.0000 0 - 8202 0 NS NS 0.000000 25.0000 0 - 8203 0 NS NS 0.000000 25.0000 0 - 8204 0 NS NS 0.000000 25.0000 0 - 8205 0 NS NS 0.000000 25.0000 0 - 8206 0 NS NS 0.000000 25.0000 0 - 8207 0 NS NS 0.000000 25.0000 0 - 8208 0 NS NS 0.000000 25.0000 0 - 8209 0 NS NS 0.000000 25.0000 0 - 8210 0 NS NS 0.000000 25.0000 0 - 8211 0 NS NS 0.000000 25.0000 0 - 8212 0 NS NS 0.000000 25.0000 0 - 8213 0 NS NS 0.000000 25.0000 0 - 8214 0 NS NS 0.000000 25.0000 0 - 8215 0 NS NS 0.000000 25.0000 0 - 8216 0 NS NS 0.000000 25.0000 0 - 8217 0 NS NS 0.000000 25.0000 0 - 8218 0 NS NS 0.000000 25.0000 0 - 8219 0 NS NS 0.000000 25.0000 0 - 8220 0 NS NS 0.000000 25.0000 0 - 8221 0 NS NS 0.000000 25.0000 0 - 8222 0 NS NS 0.000000 25.0000 0 - 8223 0 NS NS 0.000000 25.0000 0 - 8224 0 NS NS 0.000000 25.0000 0 - 8225 0 NS NS 0.000000 25.0000 0 - 8226 0 NS NS 0.000000 25.0000 0 - 8227 0 NS NS 0.000000 25.0000 0 - 8228 0 NS NS 0.000000 25.0000 0 - 8229 0 NS NS 0.000000 25.0000 0 - 8230 0 NS NS 0.000000 25.0000 0 - 8231 0 NS NS 0.000000 25.0000 0 - 8232 0 NS NS 0.000000 25.0000 0 - 8233 0 NS NS 0.000000 25.0000 0 - 8234 0 NS NS 0.000000 25.0000 0 - 8235 0 NS NS 0.000000 25.0000 0 - 8236 0 NS NS 0.000000 25.0000 0 - 8237 0 NS NS 0.000000 25.0000 0 - 8238 0 NS NS 0.000000 25.0000 0 - 8239 0 NS NS 0.000000 25.0000 0 - 8240 0 NS NS 0.000000 25.0000 0 - 8241 0 NS NS 0.000000 25.0000 0 - 8242 0 NS NS 0.000000 25.0000 0 - 8243 0 NS NS 0.000000 25.0000 0 - 8244 0 NS NS 0.000000 25.0000 0 - 8245 0 NS NS 0.000000 25.0000 0 - 8246 0 NS NS 0.000000 25.0000 0 - 8247 0 NS NS 0.000000 25.0000 0 - 8248 0 NS NS 0.000000 25.0000 0 - 8249 0 NS NS 0.000000 25.0000 0 - 8250 0 NS NS 0.000000 25.0000 0 - 8251 0 NS NS 0.000000 25.0000 0 - 8252 0 NS NS 0.000000 25.0000 0 - 8253 0 NS NS 0.000000 25.0000 0 - 8254 0 NS NS 0.000000 25.0000 0 - 8255 0 NS NS 0.000000 25.0000 0 - 8256 0 NS NS 0.000000 25.0000 0 - 8257 0 NS NS 0.000000 25.0000 0 - 8258 0 NS NS 0.000000 25.0000 0 - 8259 0 NS NS 0.000000 25.0000 0 - 8260 0 NS NS 0.000000 25.0000 0 - 8261 0 NS NS 0.000000 25.0000 0 - 8262 0 NS NS 0.000000 25.0000 0 - 8263 0 NS NS 0.000000 25.0000 0 - 8264 0 NS NS 0.000000 25.0000 0 - 8265 0 NS NS 0.000000 25.0000 0 - 8266 0 NS NS 0.000000 25.0000 0 - 8267 0 NS NS 0.000000 25.0000 0 - 8268 0 NS NS 0.000000 25.0000 0 - 8269 0 NS NS 0.000000 25.0000 0 - 8270 0 NS NS 0.000000 25.0000 0 - 8271 0 NS NS 0.000000 25.0000 0 - 8272 0 NS NS 0.000000 25.0000 0 - 8273 0 NS NS 0.000000 25.0000 0 - 8274 0 NS NS 0.000000 25.0000 0 - 8275 0 NS NS 0.000000 25.0000 0 - 8276 0 NS NS 0.000000 25.0000 0 - 8277 0 NS NS 0.000000 25.0000 0 - 8278 0 NS NS 0.000000 25.0000 0 - 8279 0 NS NS 0.000000 25.0000 0 - 8280 0 NS NS 0.000000 25.0000 0 - 8281 0 NS NS 0.000000 25.0000 0 - 8282 0 NS NS 0.000000 25.0000 0 - 8283 0 NS NS 0.000000 25.0000 0 - 8284 0 NS NS 0.000000 25.0000 0 - 8285 0 NS NS 0.000000 25.0000 0 - 8286 0 NS NS 0.000000 25.0000 0 - 8287 0 NS NS 0.000000 25.0000 0 - 8288 0 NS NS 0.000000 25.0000 0 - 8289 0 NS NS 0.000000 25.0000 0 - 8290 0 NS NS 0.000000 25.0000 0 - 8291 0 NS NS 0.000000 25.0000 0 - 8292 0 NS NS 0.000000 25.0000 0 - 8293 0 NS NS 0.000000 25.0000 0 - 8294 0 NS NS 0.000000 25.0000 0 - 8295 0 NS NS 0.000000 25.0000 0 - 8296 0 NS NS 0.000000 25.0000 0 - 8297 0 NS NS 0.000000 25.0000 0 - 8298 0 NS NS 0.000000 25.0000 0 - 8299 0 NS NS 0.000000 25.0000 0 - 8300 0 NS NS 0.000000 25.0000 0 - 8301 0 NS NS 0.000000 25.0000 0 - 8302 0 NS NS 0.000000 25.0000 0 - 8303 0 NS NS 0.000000 25.0000 0 - 8304 0 NS NS 0.000000 25.0000 0 - 8305 0 NS NS 0.000000 25.0000 0 - 8306 0 NS NS 0.000000 25.0000 0 - 8307 0 NS NS 0.000000 25.0000 0 - 8308 0 NS NS 0.000000 25.0000 0 - 8309 0 NS NS 0.000000 25.0000 0 - 8310 0 NS NS 0.000000 25.0000 0 - 8311 0 NS NS 0.000000 25.0000 0 - 8312 0 NS NS 0.000000 25.0000 0 - 8313 0 NS NS 0.000000 25.0000 0 - 8314 0 NS NS 0.000000 25.0000 0 - 8315 0 NS NS 0.000000 25.0000 0 - 8316 0 NS NS 0.000000 25.0000 0 - 8317 0 NS NS 0.000000 25.0000 0 - 8318 0 NS NS 0.000000 25.0000 0 - 8319 0 NS NS 0.000000 25.0000 0 - 8320 0 NS NS 0.000000 25.0000 0 - 8321 0 NS NS 0.000000 25.0000 0 - 8322 0 NS NS 0.000000 25.0000 0 - 8323 0 NS NS 0.000000 25.0000 0 - 8324 0 NS NS 0.000000 25.0000 0 - 8325 0 NS NS 0.000000 25.0000 0 - 8326 0 NS NS 0.000000 25.0000 0 - 8327 0 NS NS 0.000000 25.0000 0 - 8328 0 NS NS 0.000000 25.0000 0 - 8329 0 NS NS 0.000000 25.0000 0 - 8330 0 NS NS 0.000000 25.0000 0 - 8331 0 NS NS 0.000000 25.0000 0 - 8332 0 NS NS 0.000000 25.0000 0 - 8333 0 NS NS 0.000000 25.0000 0 - 8334 0 NS NS 0.000000 25.0000 0 - 8335 0 NS NS 0.000000 25.0000 0 - 8336 0 NS NS 0.000000 25.0000 0 - 8337 0 NS NS 0.000000 25.0000 0 - 8338 0 NS NS 0.000000 25.0000 0 - 8339 0 NS NS 0.000000 25.0000 0 - 8340 0 NS NS 0.000000 25.0000 0 - 8341 0 NS NS 0.000000 25.0000 0 - 8342 0 NS NS 0.000000 25.0000 0 - 8343 0 NS NS 0.000000 25.0000 0 - 8344 0 NS NS 0.000000 25.0000 0 - 8345 0 NS NS 0.000000 25.0000 0 - 8346 0 NS NS 0.000000 25.0000 0 - 8347 0 NS NS 0.000000 25.0000 0 - 8348 0 NS NS 0.000000 25.0000 0 - 8349 0 NS NS 0.000000 25.0000 0 - 8350 0 NS NS 0.000000 25.0000 0 - 8351 0 NS NS 0.000000 25.0000 0 - 8352 0 NS NS 0.000000 25.0000 0 - 8353 0 NS NS 0.000000 25.0000 0 - 8354 0 NS NS 0.000000 25.0000 0 - 8355 0 NS NS 0.000000 25.0000 0 - 8356 0 NS NS 0.000000 25.0000 0 - 8357 0 NS NS 0.000000 25.0000 0 - 8358 0 NS NS 0.000000 25.0000 0 - 8359 0 NS NS 0.000000 25.0000 0 - 8360 0 NS NS 0.000000 25.0000 0 - 8361 0 NS NS 0.000000 25.0000 0 - 8362 0 NS NS 0.000000 25.0000 0 - 8363 0 NS NS 0.000000 25.0000 0 - 8364 0 NS NS 0.000000 25.0000 0 - 8365 0 NS NS 0.000000 25.0000 0 - 8366 0 NS NS 0.000000 25.0000 0 - 8367 0 NS NS 0.000000 25.0000 0 - 8368 0 NS NS 0.000000 25.0000 0 - 8369 0 NS NS 0.000000 25.0000 0 - 8370 0 NS NS 0.000000 25.0000 0 - 8371 0 NS NS 0.000000 25.0000 0 - 8372 0 NS NS 0.000000 25.0000 0 - 8373 0 NS NS 0.000000 25.0000 0 - 8374 0 NS NS 0.000000 25.0000 0 - 8375 0 NS NS 0.000000 25.0000 0 - 8376 0 NS NS 0.000000 25.0000 0 - 8377 0 NS NS 0.000000 25.0000 0 - 8378 0 NS NS 0.000000 25.0000 0 - 8379 0 NS NS 0.000000 25.0000 0 - 8380 0 NS NS 0.000000 25.0000 0 - 8381 0 NS NS 0.000000 25.0000 0 - 8382 0 NS NS 0.000000 25.0000 0 - 8383 0 NS NS 0.000000 25.0000 0 - 8384 0 NS NS 0.000000 25.0000 0 - 8385 0 NS NS 0.000000 25.0000 0 - 8386 0 NS NS 0.000000 25.0000 0 - 8387 0 NS NS 0.000000 25.0000 0 - 8388 0 NS NS 0.000000 25.0000 0 - 8389 0 NS NS 0.000000 25.0000 0 - 8390 0 NS NS 0.000000 25.0000 0 - 8391 0 NS NS 0.000000 25.0000 0 - 8392 0 NS NS 0.000000 25.0000 0 - 8393 0 NS NS 0.000000 25.0000 0 - 8394 0 NS NS 0.000000 25.0000 0 - 8395 0 NS NS 0.000000 25.0000 0 - 8396 0 NS NS 0.000000 25.0000 0 - 8397 0 NS NS 0.000000 25.0000 0 - 8398 0 NS NS 0.000000 25.0000 0 - 8399 0 NS NS 0.000000 25.0000 0 - 8400 0 NS NS 0.000000 25.0000 0 - 8401 0 NS NS 0.000000 25.0000 0 - 8402 0 NS NS 0.000000 25.0000 0 - 8403 0 NS NS 0.000000 25.0000 0 - 8404 0 NS NS 0.000000 25.0000 0 - 8405 0 NS NS 0.000000 25.0000 0 - 8406 0 NS NS 0.000000 25.0000 0 - 8407 0 NS NS 0.000000 25.0000 0 - 8408 0 NS NS 0.000000 25.0000 0 - 8409 0 NS NS 0.000000 25.0000 0 - 8410 0 NS NS 0.000000 25.0000 0 - 8411 0 NS NS 0.000000 25.0000 0 - 8412 0 NS NS 0.000000 25.0000 0 - 8413 0 NS NS 0.000000 25.0000 0 - 8414 0 NS NS 0.000000 25.0000 0 - 8415 0 NS NS 0.000000 25.0000 0 - 8416 0 NS NS 0.000000 25.0000 0 - 8417 0 NS NS 0.000000 25.0000 0 - 8418 0 NS NS 0.000000 25.0000 0 - 8419 0 NS NS 0.000000 25.0000 0 - 8420 0 NS NS 0.000000 25.0000 0 - 8421 0 NS NS 0.000000 25.0000 0 - 8422 0 NS NS 0.000000 25.0000 0 - 8423 0 NS NS 0.000000 25.0000 0 - 8424 0 NS NS 0.000000 25.0000 0 - 8425 0 NS NS 0.000000 25.0000 0 - 8426 0 NS NS 0.000000 25.0000 0 - 8427 0 NS NS 0.000000 25.0000 0 - 8428 0 NS NS 0.000000 25.0000 0 - 8429 0 NS NS 0.000000 25.0000 0 - 8430 0 NS NS 0.000000 25.0000 0 - 8431 0 NS NS 0.000000 25.0000 0 - 8432 0 NS NS 0.000000 25.0000 0 - 8433 0 NS NS 0.000000 25.0000 0 - 8434 0 NS NS 0.000000 25.0000 0 - 8435 0 NS NS 0.000000 25.0000 0 - 8436 0 NS NS 0.000000 25.0000 0 - 8437 0 NS NS 0.000000 25.0000 0 - 8438 0 NS NS 0.000000 25.0000 0 - 8439 0 NS NS 0.000000 25.0000 0 - 8440 0 NS NS 0.000000 25.0000 0 - 8441 0 NS NS 0.000000 25.0000 0 - 8442 0 NS NS 0.000000 25.0000 0 - 8443 0 NS NS 0.000000 25.0000 0 - 8444 0 NS NS 0.000000 25.0000 0 - 8445 0 NS NS 0.000000 25.0000 0 - 8446 0 NS NS 0.000000 25.0000 0 - 8447 0 NS NS 0.000000 25.0000 0 - 8448 0 NS NS 0.000000 25.0000 0 - 8449 0 NS NS 0.000000 25.0000 0 - 8450 0 NS NS 0.000000 25.0000 0 - 8451 0 NS NS 0.000000 25.0000 0 - 8452 0 NS NS 0.000000 25.0000 0 - 8453 0 NS NS 0.000000 25.0000 0 - 8454 0 NS NS 0.000000 25.0000 0 - 8455 0 NS NS 0.000000 25.0000 0 - 8456 0 NS NS 0.000000 25.0000 0 - 8457 0 NS NS 0.000000 25.0000 0 - 8458 0 NS NS 0.000000 25.0000 0 - 8459 0 NS NS 0.000000 25.0000 0 - 8460 0 NS NS 0.000000 25.0000 0 - 8461 0 NS NS 0.000000 25.0000 0 - 8462 0 NS NS 0.000000 25.0000 0 - 8463 0 NS NS 0.000000 25.0000 0 - 8464 0 NS NS 0.000000 25.0000 0 - 8465 0 NS NS 0.000000 25.0000 0 - 8466 0 NS NS 0.000000 25.0000 0 - 8467 0 NS NS 0.000000 25.0000 0 - 8468 0 NS NS 0.000000 25.0000 0 - 8469 0 NS NS 0.000000 25.0000 0 - 8470 0 NS NS 0.000000 25.0000 0 - 8471 0 NS NS 0.000000 25.0000 0 - 8472 0 NS NS 0.000000 25.0000 0 - 8473 0 NS NS 0.000000 25.0000 0 - 8474 0 NS NS 0.000000 25.0000 0 - 8475 0 NS NS 0.000000 25.0000 0 - 8476 0 NS NS 0.000000 25.0000 0 - 8477 0 NS NS 0.000000 25.0000 0 - 8478 0 NS NS 0.000000 25.0000 0 - 8479 0 NS NS 0.000000 25.0000 0 - 8480 0 NS NS 0.000000 25.0000 0 - 8481 0 NS NS 0.000000 25.0000 0 - 8482 0 NS NS 0.000000 25.0000 0 - 8483 0 NS NS 0.000000 25.0000 0 - 8484 0 NS NS 0.000000 25.0000 0 - 8485 0 NS NS 0.000000 25.0000 0 - 8486 0 NS NS 0.000000 25.0000 0 - 8487 0 NS NS 0.000000 25.0000 0 - 8488 0 NS NS 0.000000 25.0000 0 - 8489 0 NS NS 0.000000 25.0000 0 - 8490 0 NS NS 0.000000 25.0000 0 - 8491 0 NS NS 0.000000 25.0000 0 - 8492 0 NS NS 0.000000 25.0000 0 - 8493 0 NS NS 0.000000 25.0000 0 - 8494 0 NS NS 0.000000 25.0000 0 - 8495 0 NS NS 0.000000 25.0000 0 - 8496 0 NS NS 0.000000 25.0000 0 - 8497 0 NS NS 0.000000 25.0000 0 - 8498 0 NS NS 0.000000 25.0000 0 - 8499 0 NS NS 0.000000 25.0000 0 - 8500 0 NS NS 0.000000 25.0000 0 - 8501 0 NS NS 0.000000 25.0000 0 - 8502 0 NS NS 0.000000 25.0000 0 - 8503 0 NS NS 0.000000 25.0000 0 - 8504 0 NS NS 0.000000 25.0000 0 - 8505 0 NS NS 0.000000 25.0000 0 - 8506 0 NS NS 0.000000 25.0000 0 - 8507 0 NS NS 0.000000 25.0000 0 - 8508 0 NS NS 0.000000 25.0000 0 - 8509 0 NS NS 0.000000 25.0000 0 - 8510 0 NS NS 0.000000 25.0000 0 - 8511 0 NS NS 0.000000 25.0000 0 - 8512 0 NS NS 0.000000 25.0000 0 - 8513 0 NS NS 0.000000 25.0000 0 - 8514 0 NS NS 0.000000 25.0000 0 - 8515 0 NS NS 0.000000 25.0000 0 - 8516 0 NS NS 0.000000 25.0000 0 - 8517 0 NS NS 0.000000 25.0000 0 - 8518 0 NS NS 0.000000 25.0000 0 - 8519 0 NS NS 0.000000 25.0000 0 - 8520 0 NS NS 0.000000 25.0000 0 - 8521 0 NS NS 0.000000 25.0000 0 - 8522 0 NS NS 0.000000 25.0000 0 - 8523 0 NS NS 0.000000 25.0000 0 - 8524 0 NS NS 0.000000 25.0000 0 - 8525 0 NS NS 0.000000 25.0000 0 - 8526 0 NS NS 0.000000 25.0000 0 - 8527 0 NS NS 0.000000 25.0000 0 - 8528 0 NS NS 0.000000 25.0000 0 - 8529 0 NS NS 0.000000 25.0000 0 - 8530 0 NS NS 0.000000 25.0000 0 - 8531 0 NS NS 0.000000 25.0000 0 - 8532 0 NS NS 0.000000 25.0000 0 - 8533 0 NS NS 0.000000 25.0000 0 - 8534 0 NS NS 0.000000 25.0000 0 - 8535 0 NS NS 0.000000 25.0000 0 - 8536 0 NS NS 0.000000 25.0000 0 - 8537 0 NS NS 0.000000 25.0000 0 - 8538 0 NS NS 0.000000 25.0000 0 - 8539 0 NS NS 0.000000 25.0000 0 - 8540 0 NS NS 0.000000 25.0000 0 - 8541 0 NS NS 0.000000 25.0000 0 - 8542 0 NS NS 0.000000 25.0000 0 - 8543 0 NS NS 0.000000 25.0000 0 - 8544 0 NS NS 0.000000 25.0000 0 - 8545 0 NS NS 0.000000 25.0000 0 - 8546 0 NS NS 0.000000 25.0000 0 - 8547 0 NS NS 0.000000 25.0000 0 - 8548 0 NS NS 0.000000 25.0000 0 - 8549 0 NS NS 0.000000 25.0000 0 - 8550 0 NS NS 0.000000 25.0000 0 - 8551 0 NS NS 0.000000 25.0000 0 - 8552 0 NS NS 0.000000 25.0000 0 - 8553 0 NS NS 0.000000 25.0000 0 - 8554 0 NS NS 0.000000 25.0000 0 - 8555 0 NS NS 0.000000 25.0000 0 - 8556 0 NS NS 0.000000 25.0000 0 - 8557 0 NS NS 0.000000 25.0000 0 - 8558 0 NS NS 0.000000 25.0000 0 - 8559 0 NS NS 0.000000 25.0000 0 - 8560 0 NS NS 0.000000 25.0000 0 - 8561 0 NS NS 0.000000 25.0000 0 - 8562 0 NS NS 0.000000 25.0000 0 - 8563 0 NS NS 0.000000 25.0000 0 - 8564 0 NS NS 0.000000 25.0000 0 - 8565 0 NS NS 0.000000 25.0000 0 - 8566 0 NS NS 0.000000 25.0000 0 - 8567 0 NS NS 0.000000 25.0000 0 - 8568 0 NS NS 0.000000 25.0000 0 - 8569 0 NS NS 0.000000 25.0000 0 - 8570 0 NS NS 0.000000 25.0000 0 - 8571 0 NS NS 0.000000 25.0000 0 - 8572 0 NS NS 0.000000 25.0000 0 - 8573 0 NS NS 0.000000 25.0000 0 - 8574 0 NS NS 0.000000 25.0000 0 - 8575 0 NS NS 0.000000 25.0000 0 - 8576 0 NS NS 0.000000 25.0000 0 - 8577 0 NS NS 0.000000 25.0000 0 - 8578 0 NS NS 0.000000 25.0000 0 - 8579 0 NS NS 0.000000 25.0000 0 - 8580 0 NS NS 0.000000 25.0000 0 - 8581 0 NS NS 0.000000 25.0000 0 - 8582 0 NS NS 0.000000 25.0000 0 - 8583 0 NS NS 0.000000 25.0000 0 - 8584 0 NS NS 0.000000 25.0000 0 - 8585 0 NS NS 0.000000 25.0000 0 - 8586 0 NS NS 0.000000 25.0000 0 - 8587 0 NS NS 0.000000 25.0000 0 - 8588 0 NS NS 0.000000 25.0000 0 - 8589 0 NS NS 0.000000 25.0000 0 - 8590 0 NS NS 0.000000 25.0000 0 - 8591 0 NS NS 0.000000 25.0000 0 - 8592 0 NS NS 0.000000 25.0000 0 - 8593 0 NS NS 0.000000 25.0000 0 - 8594 0 NS NS 0.000000 25.0000 0 - 8595 0 NS NS 0.000000 25.0000 0 - 8596 0 NS NS 0.000000 25.0000 0 - 8597 0 NS NS 0.000000 25.0000 0 - 8598 0 NS NS 0.000000 25.0000 0 - 8599 0 NS NS 0.000000 25.0000 0 - 8600 0 NS NS 0.000000 25.0000 0 - 8601 0 NS NS 0.000000 25.0000 0 - 8602 0 NS NS 0.000000 25.0000 0 - 8603 0 NS NS 0.000000 25.0000 0 - 8604 0 NS NS 0.000000 25.0000 0 - 8605 0 NS NS 0.000000 25.0000 0 - 8606 0 NS NS 0.000000 25.0000 0 - 8607 0 NS NS 0.000000 25.0000 0 - 8608 0 NS NS 0.000000 25.0000 0 - 8609 0 NS NS 0.000000 25.0000 0 - 8610 0 NS NS 0.000000 25.0000 0 - 8611 0 NS NS 0.000000 25.0000 0 - 8612 0 NS NS 0.000000 25.0000 0 - 8613 0 NS NS 0.000000 25.0000 0 - 8614 0 NS NS 0.000000 25.0000 0 - 8615 0 NS NS 0.000000 25.0000 0 - 8616 0 NS NS 0.000000 25.0000 0 - 8617 0 NS NS 0.000000 25.0000 0 - 8618 0 NS NS 0.000000 25.0000 0 - 8619 0 NS NS 0.000000 25.0000 0 - 8620 0 NS NS 0.000000 25.0000 0 - 8621 0 NS NS 0.000000 25.0000 0 - 8622 0 NS NS 0.000000 25.0000 0 - 8623 0 NS NS 0.000000 25.0000 0 - 8624 0 NS NS 0.000000 25.0000 0 - 8625 0 NS NS 0.000000 25.0000 0 - 8626 0 NS NS 0.000000 25.0000 0 - 8627 0 NS NS 0.000000 25.0000 0 - 8628 0 NS NS 0.000000 25.0000 0 - 8629 0 NS NS 0.000000 25.0000 0 - 8630 0 NS NS 0.000000 25.0000 0 - 8631 0 NS NS 0.000000 25.0000 0 - 8632 0 NS NS 0.000000 25.0000 0 - 8633 0 NS NS 0.000000 25.0000 0 - 8634 0 NS NS 0.000000 25.0000 0 - 8635 0 NS NS 0.000000 25.0000 0 - 8636 0 NS NS 0.000000 25.0000 0 - 8637 0 NS NS 0.000000 25.0000 0 - 8638 0 NS NS 0.000000 25.0000 0 - 8639 0 NS NS 0.000000 25.0000 0 - 8640 0 NS NS 0.000000 25.0000 0 - 8641 0 NS NS 0.000000 25.0000 0 - 8642 0 NS NS 0.000000 25.0000 0 - 8643 0 NS NS 0.000000 25.0000 0 - 8644 0 NS NS 0.000000 25.0000 0 - 8645 0 NS NS 0.000000 25.0000 0 - 8646 0 NS NS 0.000000 25.0000 0 - 8647 0 NS NS 0.000000 25.0000 0 - 8648 0 NS NS 0.000000 25.0000 0 - 8649 0 NS NS 0.000000 25.0000 0 - 8650 0 NS NS 0.000000 25.0000 0 - 8651 0 NS NS 0.000000 25.0000 0 - 8652 0 NS NS 0.000000 25.0000 0 - 8653 0 NS NS 0.000000 25.0000 0 - 8654 0 NS NS 0.000000 25.0000 0 - 8655 0 NS NS 0.000000 25.0000 0 - 8656 0 NS NS 0.000000 25.0000 0 - 8657 0 NS NS 0.000000 25.0000 0 - 8658 0 NS NS 0.000000 25.0000 0 - 8659 0 NS NS 0.000000 25.0000 0 - 8660 0 NS NS 0.000000 25.0000 0 - 8661 0 NS NS 0.000000 25.0000 0 - 8662 0 NS NS 0.000000 25.0000 0 - 8663 0 NS NS 0.000000 25.0000 0 - 8664 0 NS NS 0.000000 25.0000 0 - 8665 0 NS NS 0.000000 25.0000 0 - 8666 0 NS NS 0.000000 25.0000 0 - 8667 0 NS NS 0.000000 25.0000 0 - 8668 0 NS NS 0.000000 25.0000 0 - 8669 0 NS NS 0.000000 25.0000 0 - 8670 0 NS NS 0.000000 25.0000 0 - 8671 0 NS NS 0.000000 25.0000 0 - 8672 0 NS NS 0.000000 25.0000 0 - 8673 0 NS NS 0.000000 25.0000 0 - 8674 0 NS NS 0.000000 25.0000 0 - 8675 0 NS NS 0.000000 25.0000 0 - 8676 0 NS NS 0.000000 25.0000 0 - 8677 0 NS NS 0.000000 25.0000 0 - 8678 0 NS NS 0.000000 25.0000 0 - 8679 0 NS NS 0.000000 25.0000 0 - 8680 0 NS NS 0.000000 25.0000 0 - 8681 0 NS NS 0.000000 25.0000 0 - 8682 0 NS NS 0.000000 25.0000 0 - 8683 0 NS NS 0.000000 25.0000 0 - 8684 0 NS NS 0.000000 25.0000 0 - 8685 0 NS NS 0.000000 25.0000 0 - 8686 0 NS NS 0.000000 25.0000 0 - 8687 0 NS NS 0.000000 25.0000 0 - 8688 0 NS NS 0.000000 25.0000 0 - 8689 0 NS NS 0.000000 25.0000 0 - 8690 0 NS NS 0.000000 25.0000 0 - 8691 0 NS NS 0.000000 25.0000 0 - 8692 0 NS NS 0.000000 25.0000 0 - 8693 0 NS NS 0.000000 25.0000 0 - 8694 0 NS NS 0.000000 25.0000 0 - 8695 0 NS NS 0.000000 25.0000 0 - 8696 0 NS NS 0.000000 25.0000 0 - 8697 0 NS NS 0.000000 25.0000 0 - 8698 0 NS NS 0.000000 25.0000 0 - 8699 0 NS NS 0.000000 25.0000 0 - 8700 0 NS NS 0.000000 25.0000 0 - 8701 0 NS NS 0.000000 25.0000 0 - 8702 0 NS NS 0.000000 25.0000 0 - 8703 0 NS NS 0.000000 25.0000 0 - 8704 0 NS NS 0.000000 25.0000 0 - 8705 0 NS NS 0.000000 25.0000 0 - 8706 0 NS NS 0.000000 25.0000 0 - 8707 0 NS NS 0.000000 25.0000 0 - 8708 0 NS NS 0.000000 25.0000 0 - 8709 0 NS NS 0.000000 25.0000 0 - 8710 0 NS NS 0.000000 25.0000 0 - 8711 0 NS NS 0.000000 25.0000 0 - 8712 0 NS NS 0.000000 25.0000 0 - 8713 0 NS NS 0.000000 25.0000 0 - 8714 0 NS NS 0.000000 25.0000 0 - 8715 0 NS NS 0.000000 25.0000 0 - 8716 0 NS NS 0.000000 25.0000 0 - 8717 0 NS NS 0.000000 25.0000 0 - 8718 0 NS NS 0.000000 25.0000 0 - 8719 0 NS NS 0.000000 25.0000 0 - 8720 0 NS NS 0.000000 25.0000 0 - 8721 0 NS NS 0.000000 25.0000 0 - 8722 0 NS NS 0.000000 25.0000 0 - 8723 0 NS NS 0.000000 25.0000 0 - 8724 0 NS NS 0.000000 25.0000 0 - 8725 0 NS NS 0.000000 25.0000 0 - 8726 0 NS NS 0.000000 25.0000 0 - 8727 0 NS NS 0.000000 25.0000 0 - 8728 0 NS NS 0.000000 25.0000 0 - 8729 0 NS NS 0.000000 25.0000 0 - 8730 0 NS NS 0.000000 25.0000 0 - 8731 0 NS NS 0.000000 25.0000 0 - 8732 0 NS NS 0.000000 25.0000 0 - 8733 0 NS NS 0.000000 25.0000 0 - 8734 0 NS NS 0.000000 25.0000 0 - 8735 0 NS NS 0.000000 25.0000 0 - 8736 0 NS NS 0.000000 25.0000 0 - 8737 0 NS NS 0.000000 25.0000 0 - 8738 0 NS NS 0.000000 25.0000 0 - 8739 0 NS NS 0.000000 25.0000 0 - 8740 0 NS NS 0.000000 25.0000 0 - 8741 0 NS NS 0.000000 25.0000 0 - 8742 0 NS NS 0.000000 25.0000 0 - 8743 0 NS NS 0.000000 25.0000 0 - 8744 0 NS NS 0.000000 25.0000 0 - 8745 0 NS NS 0.000000 25.0000 0 - 8746 0 NS NS 0.000000 25.0000 0 - 8747 0 NS NS 0.000000 25.0000 0 - 8748 0 NS NS 0.000000 25.0000 0 - 8749 0 NS NS 0.000000 25.0000 0 - 8750 0 NS NS 0.000000 25.0000 0 - 8751 0 NS NS 0.000000 25.0000 0 - 8752 0 NS NS 0.000000 25.0000 0 - 8753 0 NS NS 0.000000 25.0000 0 - 8754 0 NS NS 0.000000 25.0000 0 - 8755 0 NS NS 0.000000 25.0000 0 - 8756 0 NS NS 0.000000 25.0000 0 - 8757 0 NS NS 0.000000 25.0000 0 - 8758 0 NS NS 0.000000 25.0000 0 - 8759 0 NS NS 0.000000 25.0000 0 - 8760 0 NS NS 0.000000 25.0000 0 - 8761 0 NS NS 0.000000 25.0000 0 - 8762 0 NS NS 0.000000 25.0000 0 - 8763 0 NS NS 0.000000 25.0000 0 - 8764 0 NS NS 0.000000 25.0000 0 - 8765 0 NS NS 0.000000 25.0000 0 - 8766 0 NS NS 0.000000 25.0000 0 - 8767 0 NS NS 0.000000 25.0000 0 - 8768 0 NS NS 0.000000 25.0000 0 - 8769 0 NS NS 0.000000 25.0000 0 - 8770 0 NS NS 0.000000 25.0000 0 - 8771 0 NS NS 0.000000 25.0000 0 - 8772 0 NS NS 0.000000 25.0000 0 - 8773 0 NS NS 0.000000 25.0000 0 - 8774 0 NS NS 0.000000 25.0000 0 - 8775 0 NS NS 0.000000 25.0000 0 - 8776 0 NS NS 0.000000 25.0000 0 - 8777 0 NS NS 0.000000 25.0000 0 - 8778 0 NS NS 0.000000 25.0000 0 - 8779 0 NS NS 0.000000 25.0000 0 - 8780 0 NS NS 0.000000 25.0000 0 - 8781 0 NS NS 0.000000 25.0000 0 - 8782 0 NS NS 0.000000 25.0000 0 - 8783 0 NS NS 0.000000 25.0000 0 - 8784 0 NS NS 0.000000 25.0000 0 - 8785 0 NS NS 0.000000 25.0000 0 - 8786 0 NS NS 0.000000 25.0000 0 - 8787 0 NS NS 0.000000 25.0000 0 - 8788 0 NS NS 0.000000 25.0000 0 - 8789 0 NS NS 0.000000 25.0000 0 - 8790 0 NS NS 0.000000 25.0000 0 - 8791 0 NS NS 0.000000 25.0000 0 - 8792 0 NS NS 0.000000 25.0000 0 - 8793 0 NS NS 0.000000 25.0000 0 - 8794 0 NS NS 0.000000 25.0000 0 - 8795 0 NS NS 0.000000 25.0000 0 - 8796 0 NS NS 0.000000 25.0000 0 - 8797 0 NS NS 0.000000 25.0000 0 - 8798 0 NS NS 0.000000 25.0000 0 - 8799 0 NS NS 0.000000 25.0000 0 - 8800 0 NS NS 0.000000 25.0000 0 - 8801 0 NS NS 0.000000 25.0000 0 - 8802 0 NS NS 0.000000 25.0000 0 - 8803 0 NS NS 0.000000 25.0000 0 - 8804 0 NS NS 0.000000 25.0000 0 - 8805 0 NS NS 0.000000 25.0000 0 - 8806 0 NS NS 0.000000 25.0000 0 - 8807 0 NS NS 0.000000 25.0000 0 - 8808 0 NS NS 0.000000 25.0000 0 - 8809 0 NS NS 0.000000 25.0000 0 - 8810 0 NS NS 0.000000 25.0000 0 - 8811 0 NS NS 0.000000 25.0000 0 - 8812 0 NS NS 0.000000 25.0000 0 - 8813 0 NS NS 0.000000 25.0000 0 - 8814 0 NS NS 0.000000 25.0000 0 - 8815 0 NS NS 0.000000 25.0000 0 - 8816 0 NS NS 0.000000 25.0000 0 - 8817 0 NS NS 0.000000 25.0000 0 - 8818 0 NS NS 0.000000 25.0000 0 - 8819 0 NS NS 0.000000 25.0000 0 - 8820 0 NS NS 0.000000 25.0000 0 - 8821 0 NS NS 0.000000 25.0000 0 - 8822 0 NS NS 0.000000 25.0000 0 - 8823 0 NS NS 0.000000 25.0000 0 - 8824 0 NS NS 0.000000 25.0000 0 - 8825 0 NS NS 0.000000 25.0000 0 - 8826 0 NS NS 0.000000 25.0000 0 - 8827 0 NS NS 0.000000 25.0000 0 - 8828 0 NS NS 0.000000 25.0000 0 - 8829 0 NS NS 0.000000 25.0000 0 - 8830 0 NS NS 0.000000 25.0000 0 - 8831 0 NS NS 0.000000 25.0000 0 - 8832 0 NS NS 0.000000 25.0000 0 - 8833 0 NS NS 0.000000 25.0000 0 - 8834 0 NS NS 0.000000 25.0000 0 - 8835 0 NS NS 0.000000 25.0000 0 - 8836 0 NS NS 0.000000 25.0000 0 - 8837 0 NS NS 0.000000 25.0000 0 - 8838 0 NS NS 0.000000 25.0000 0 - 8839 0 NS NS 0.000000 25.0000 0 - 8840 0 NS NS 0.000000 25.0000 0 - 8841 0 NS NS 0.000000 25.0000 0 - 8842 0 NS NS 0.000000 25.0000 0 - 8843 0 NS NS 0.000000 25.0000 0 - 8844 0 NS NS 0.000000 25.0000 0 - 8845 0 NS NS 0.000000 25.0000 0 - 8846 0 NS NS 0.000000 25.0000 0 - 8847 0 NS NS 0.000000 25.0000 0 - 8848 0 NS NS 0.000000 25.0000 0 - 8849 0 NS NS 0.000000 25.0000 0 - 8850 0 NS NS 0.000000 25.0000 0 - 8851 0 NS NS 0.000000 25.0000 0 - 8852 0 NS NS 0.000000 25.0000 0 - 8853 0 NS NS 0.000000 25.0000 0 - 8854 0 NS NS 0.000000 25.0000 0 - 8855 0 NS NS 0.000000 25.0000 0 - 8856 0 NS NS 0.000000 25.0000 0 - 8857 0 NS NS 0.000000 25.0000 0 - 8858 0 NS NS 0.000000 25.0000 0 - 8859 0 NS NS 0.000000 25.0000 0 - 8860 0 NS NS 0.000000 25.0000 0 - 8861 0 NS NS 0.000000 25.0000 0 - 8862 0 NS NS 0.000000 25.0000 0 - 8863 0 NS NS 0.000000 25.0000 0 - 8864 0 NS NS 0.000000 25.0000 0 - 8865 0 NS NS 0.000000 25.0000 0 - 8866 0 NS NS 0.000000 25.0000 0 - 8867 0 NS NS 0.000000 25.0000 0 - 8868 0 NS NS 0.000000 25.0000 0 - 8869 0 NS NS 0.000000 25.0000 0 - 8870 0 NS NS 0.000000 25.0000 0 - 8871 0 NS NS 0.000000 25.0000 0 - 8872 0 NS NS 0.000000 25.0000 0 - 8873 0 NS NS 0.000000 25.0000 0 - 8874 0 NS NS 0.000000 25.0000 0 - 8875 0 NS NS 0.000000 25.0000 0 - 8876 0 NS NS 0.000000 25.0000 0 - 8877 0 NS NS 0.000000 25.0000 0 - 8878 0 NS NS 0.000000 25.0000 0 - 8879 0 NS NS 0.000000 25.0000 0 - 8880 0 NS NS 0.000000 25.0000 0 - 8881 0 NS NS 0.000000 25.0000 0 - 8882 0 NS NS 0.000000 25.0000 0 - 8883 0 NS NS 0.000000 25.0000 0 - 8884 0 NS NS 0.000000 25.0000 0 - 8885 0 NS NS 0.000000 25.0000 0 - 8886 0 NS NS 0.000000 25.0000 0 - 8887 0 NS NS 0.000000 25.0000 0 - 8888 0 NS NS 0.000000 25.0000 0 - 8889 0 NS NS 0.000000 25.0000 0 - 8890 0 NS NS 0.000000 25.0000 0 - 8891 0 NS NS 0.000000 25.0000 0 - 8892 0 NS NS 0.000000 25.0000 0 - 8893 0 NS NS 0.000000 25.0000 0 - 8894 0 NS NS 0.000000 25.0000 0 - 8895 0 NS NS 0.000000 25.0000 0 - 8896 0 NS NS 0.000000 25.0000 0 - 8897 0 NS NS 0.000000 25.0000 0 - 8898 0 NS NS 0.000000 25.0000 0 - 8899 0 NS NS 0.000000 25.0000 0 - 8900 0 NS NS 0.000000 25.0000 0 - 8901 0 NS NS 0.000000 25.0000 0 - 8902 0 NS NS 0.000000 25.0000 0 - 8903 0 NS NS 0.000000 25.0000 0 - 8904 0 NS NS 0.000000 25.0000 0 - 8905 0 NS NS 0.000000 25.0000 0 - 8906 0 NS NS 0.000000 25.0000 0 - 8907 0 NS NS 0.000000 25.0000 0 - 8908 0 NS NS 0.000000 25.0000 0 - 8909 0 NS NS 0.000000 25.0000 0 - 8910 0 NS NS 0.000000 25.0000 0 - 8911 0 NS NS 0.000000 25.0000 0 - 8912 0 NS NS 0.000000 25.0000 0 - 8913 0 NS NS 0.000000 25.0000 0 - 8914 0 NS NS 0.000000 25.0000 0 - 8915 0 NS NS 0.000000 25.0000 0 - 8916 0 NS NS 0.000000 25.0000 0 - 8917 0 NS NS 0.000000 25.0000 0 - 8918 0 NS NS 0.000000 25.0000 0 - 8919 0 NS NS 0.000000 25.0000 0 - 8920 0 NS NS 0.000000 25.0000 0 - 8921 0 NS NS 0.000000 25.0000 0 - 8922 0 NS NS 0.000000 25.0000 0 - 8923 0 NS NS 0.000000 25.0000 0 - 8924 0 NS NS 0.000000 25.0000 0 - 8925 0 NS NS 0.000000 25.0000 0 - 8926 0 NS NS 0.000000 25.0000 0 - 8927 0 NS NS 0.000000 25.0000 0 - 8928 0 NS NS 0.000000 25.0000 0 - 8929 0 NS NS 0.000000 25.0000 0 - 8930 0 NS NS 0.000000 25.0000 0 - 8931 0 NS NS 0.000000 25.0000 0 - 8932 0 NS NS 0.000000 25.0000 0 - 8933 0 NS NS 0.000000 25.0000 0 - 8934 0 NS NS 0.000000 25.0000 0 - 8935 0 NS NS 0.000000 25.0000 0 - 8936 0 NS NS 0.000000 25.0000 0 - 8937 0 NS NS 0.000000 25.0000 0 - 8938 0 NS NS 0.000000 25.0000 0 - 8939 0 NS NS 0.000000 25.0000 0 - 8940 0 NS NS 0.000000 25.0000 0 - 8941 0 NS NS 0.000000 25.0000 0 - 8942 0 NS NS 0.000000 25.0000 0 - 8943 0 NS NS 0.000000 25.0000 0 - 8944 0 NS NS 0.000000 25.0000 0 - 8945 0 NS NS 0.000000 25.0000 0 - 8946 0 NS NS 0.000000 25.0000 0 - 8947 0 NS NS 0.000000 25.0000 0 - 8948 0 NS NS 0.000000 25.0000 0 - 8949 0 NS NS 0.000000 25.0000 0 - 8950 0 NS NS 0.000000 25.0000 0 - 8951 0 NS NS 0.000000 25.0000 0 - 8952 0 NS NS 0.000000 25.0000 0 - 8953 0 NS NS 0.000000 25.0000 0 - 8954 0 NS NS 0.000000 25.0000 0 - 8955 0 NS NS 0.000000 25.0000 0 - 8956 0 NS NS 0.000000 25.0000 0 - 8957 0 NS NS 0.000000 25.0000 0 - 8958 0 NS NS 0.000000 25.0000 0 - 8959 0 NS NS 0.000000 25.0000 0 - 8960 0 NS NS 0.000000 25.0000 0 - 8961 0 NS NS 0.000000 25.0000 0 - 8962 0 NS NS 0.000000 25.0000 0 - 8963 0 NS NS 0.000000 25.0000 0 - 8964 0 NS NS 0.000000 25.0000 0 - 8965 0 NS NS 0.000000 25.0000 0 - 8966 0 NS NS 0.000000 25.0000 0 - 8967 0 NS NS 0.000000 25.0000 0 - 8968 0 NS NS 0.000000 25.0000 0 - 8969 0 NS NS 0.000000 25.0000 0 - 8970 0 NS NS 0.000000 25.0000 0 - 8971 0 NS NS 0.000000 25.0000 0 - 8972 0 NS NS 0.000000 25.0000 0 - 8973 0 NS NS 0.000000 25.0000 0 - 8974 0 NS NS 0.000000 25.0000 0 - 8975 0 NS NS 0.000000 25.0000 0 - 8976 0 NS NS 0.000000 25.0000 0 - 8977 0 NS NS 0.000000 25.0000 0 - 8978 0 NS NS 0.000000 25.0000 0 - 8979 0 NS NS 0.000000 25.0000 0 - 8980 0 NS NS 0.000000 25.0000 0 - 8981 0 NS NS 0.000000 25.0000 0 - 8982 0 NS NS 0.000000 25.0000 0 - 8983 0 NS NS 0.000000 25.0000 0 - 8984 0 NS NS 0.000000 25.0000 0 - 8985 0 NS NS 0.000000 25.0000 0 - 8986 0 NS NS 0.000000 25.0000 0 - 8987 0 NS NS 0.000000 25.0000 0 - 8988 0 NS NS 0.000000 25.0000 0 - 8989 0 NS NS 0.000000 25.0000 0 - 8990 0 NS NS 0.000000 25.0000 0 - 8991 0 NS NS 0.000000 25.0000 0 - 8992 0 NS NS 0.000000 25.0000 0 - 8993 0 NS NS 0.000000 25.0000 0 - 8994 0 NS NS 0.000000 25.0000 0 - 8995 0 NS NS 0.000000 25.0000 0 - 8996 0 NS NS 0.000000 25.0000 0 - 8997 0 NS NS 0.000000 25.0000 0 - 8998 0 NS NS 0.000000 25.0000 0 - 8999 0 NS NS 0.000000 25.0000 0 - 9000 0 NS NS 0.000000 25.0000 0 - 9001 0 NS NS 0.000000 25.0000 0 - 9002 0 NS NS 0.000000 25.0000 0 - 9003 0 NS NS 0.000000 25.0000 0 - 9004 0 NS NS 0.000000 25.0000 0 - 9005 0 NS NS 0.000000 25.0000 0 - 9006 0 NS NS 0.000000 25.0000 0 - 9007 0 NS NS 0.000000 25.0000 0 - 9008 0 NS NS 0.000000 25.0000 0 - 9009 0 NS NS 0.000000 25.0000 0 - 9010 0 NS NS 0.000000 25.0000 0 - 9011 0 NS NS 0.000000 25.0000 0 - 9012 0 NS NS 0.000000 25.0000 0 - 9013 0 NS NS 0.000000 25.0000 0 - 9014 0 NS NS 0.000000 25.0000 0 - 9015 0 NS NS 0.000000 25.0000 0 - 9016 0 NS NS 0.000000 25.0000 0 - 9017 0 NS NS 0.000000 25.0000 0 - 9018 0 NS NS 0.000000 25.0000 0 - 9019 0 NS NS 0.000000 25.0000 0 - 9020 0 NS NS 0.000000 25.0000 0 - 9021 0 NS NS 0.000000 25.0000 0 - 9022 0 NS NS 0.000000 25.0000 0 - 9023 0 NS NS 0.000000 25.0000 0 - 9024 0 NS NS 0.000000 25.0000 0 - 9025 0 NS NS 0.000000 25.0000 0 - 9026 0 NS NS 0.000000 25.0000 0 - 9027 0 NS NS 0.000000 25.0000 0 - 9028 0 NS NS 0.000000 25.0000 0 - 9029 0 NS NS 0.000000 25.0000 0 - 9030 0 NS NS 0.000000 25.0000 0 - 9031 0 NS NS 0.000000 25.0000 0 - 9032 0 NS NS 0.000000 25.0000 0 - 9033 0 NS NS 0.000000 25.0000 0 - 9034 0 NS NS 0.000000 25.0000 0 - 9035 0 NS NS 0.000000 25.0000 0 - 9036 0 NS NS 0.000000 25.0000 0 - 9037 0 NS NS 0.000000 25.0000 0 - 9038 0 NS NS 0.000000 25.0000 0 - 9039 0 NS NS 0.000000 25.0000 0 - 9040 0 NS NS 0.000000 25.0000 0 - 9041 0 NS NS 0.000000 25.0000 0 - 9042 0 NS NS 0.000000 25.0000 0 - 9043 0 NS NS 0.000000 25.0000 0 - 9044 0 NS NS 0.000000 25.0000 0 - 9045 0 NS NS 0.000000 25.0000 0 - 9046 0 NS NS 0.000000 25.0000 0 - 9047 0 NS NS 0.000000 25.0000 0 - 9048 0 NS NS 0.000000 25.0000 0 - 9049 0 NS NS 0.000000 25.0000 0 - 9050 0 NS NS 0.000000 25.0000 0 - 9051 0 NS NS 0.000000 25.0000 0 - 9052 0 NS NS 0.000000 25.0000 0 - 9053 0 NS NS 0.000000 25.0000 0 - 9054 0 NS NS 0.000000 25.0000 0 - 9055 0 NS NS 0.000000 25.0000 0 - 9056 0 NS NS 0.000000 25.0000 0 - 9057 0 NS NS 0.000000 25.0000 0 - 9058 0 NS NS 0.000000 25.0000 0 - 9059 0 NS NS 0.000000 25.0000 0 - 9060 0 NS NS 0.000000 25.0000 0 - 9061 0 NS NS 0.000000 25.0000 0 - 9062 0 NS NS 0.000000 25.0000 0 - 9063 0 NS NS 0.000000 25.0000 0 - 9064 0 NS NS 0.000000 25.0000 0 - 9065 0 NS NS 0.000000 25.0000 0 - 9066 0 NS NS 0.000000 25.0000 0 - 9067 0 NS NS 0.000000 25.0000 0 - 9068 0 NS NS 0.000000 25.0000 0 - 9069 0 NS NS 0.000000 25.0000 0 - 9070 0 NS NS 0.000000 25.0000 0 - 9071 0 NS NS 0.000000 25.0000 0 - 9072 0 NS NS 0.000000 25.0000 0 - 9073 0 NS NS 0.000000 25.0000 0 - 9074 0 NS NS 0.000000 25.0000 0 - 9075 0 NS NS 0.000000 25.0000 0 - 9076 0 NS NS 0.000000 25.0000 0 - 9077 0 NS NS 0.000000 25.0000 0 - 9078 0 NS NS 0.000000 25.0000 0 - 9079 0 NS NS 0.000000 25.0000 0 - 9080 0 NS NS 0.000000 25.0000 0 - 9081 0 NS NS 0.000000 25.0000 0 - 9082 0 NS NS 0.000000 25.0000 0 - 9083 0 NS NS 0.000000 25.0000 0 - 9084 0 NS NS 0.000000 25.0000 0 - 9085 0 NS NS 0.000000 25.0000 0 - 9086 0 NS NS 0.000000 25.0000 0 - 9087 0 NS NS 0.000000 25.0000 0 - 9088 0 NS NS 0.000000 25.0000 0 - 9089 0 NS NS 0.000000 25.0000 0 - 9090 0 NS NS 0.000000 25.0000 0 - 9091 0 NS NS 0.000000 25.0000 0 - 9092 0 NS NS 0.000000 25.0000 0 - 9093 0 NS NS 0.000000 25.0000 0 - 9094 0 NS NS 0.000000 25.0000 0 - 9095 0 NS NS 0.000000 25.0000 0 - 9096 0 NS NS 0.000000 25.0000 0 - 9097 0 NS NS 0.000000 25.0000 0 - 9098 0 NS NS 0.000000 25.0000 0 - 9099 0 NS NS 0.000000 25.0000 0 - 9100 0 NS NS 0.000000 25.0000 0 - 9101 0 NS NS 0.000000 25.0000 0 - 9102 0 NS NS 0.000000 25.0000 0 - 9103 0 NS NS 0.000000 25.0000 0 - 9104 0 NS NS 0.000000 25.0000 0 - 9105 0 NS NS 0.000000 25.0000 0 - 9106 0 NS NS 0.000000 25.0000 0 - 9107 0 NS NS 0.000000 25.0000 0 - 9108 0 NS NS 0.000000 25.0000 0 - 9109 0 NS NS 0.000000 25.0000 0 - 9110 0 NS NS 0.000000 25.0000 0 - 9111 0 NS NS 0.000000 25.0000 0 - 9112 0 NS NS 0.000000 25.0000 0 - 9113 0 NS NS 0.000000 25.0000 0 - 9114 0 NS NS 0.000000 25.0000 0 - 9115 0 NS NS 0.000000 25.0000 0 - 9116 0 NS NS 0.000000 25.0000 0 - 9117 0 NS NS 0.000000 25.0000 0 - 9118 0 NS NS 0.000000 25.0000 0 - 9119 0 NS NS 0.000000 25.0000 0 - 9120 0 NS NS 0.000000 25.0000 0 - 9121 0 NS NS 0.000000 25.0000 0 - 9122 0 NS NS 0.000000 25.0000 0 - 9123 0 NS NS 0.000000 25.0000 0 - 9124 0 NS NS 0.000000 25.0000 0 - 9125 0 NS NS 0.000000 25.0000 0 - 9126 0 NS NS 0.000000 25.0000 0 - 9127 0 NS NS 0.000000 25.0000 0 - 9128 0 NS NS 0.000000 25.0000 0 - 9129 0 NS NS 0.000000 25.0000 0 - 9130 0 NS NS 0.000000 25.0000 0 - 9131 0 NS NS 0.000000 25.0000 0 - 9132 0 NS NS 0.000000 25.0000 0 - 9133 0 NS NS 0.000000 25.0000 0 - 9134 0 NS NS 0.000000 25.0000 0 - 9135 0 NS NS 0.000000 25.0000 0 - 9136 0 NS NS 0.000000 25.0000 0 - 9137 0 NS NS 0.000000 25.0000 0 - 9138 0 NS NS 0.000000 25.0000 0 - 9139 0 NS NS 0.000000 25.0000 0 - 9140 0 NS NS 0.000000 25.0000 0 - 9141 0 NS NS 0.000000 25.0000 0 - 9142 0 NS NS 0.000000 25.0000 0 - 9143 0 NS NS 0.000000 25.0000 0 - 9144 0 NS NS 0.000000 25.0000 0 - 9145 0 NS NS 0.000000 25.0000 0 - 9146 0 NS NS 0.000000 25.0000 0 - 9147 0 NS NS 0.000000 25.0000 0 - 9148 0 NS NS 0.000000 25.0000 0 - 9149 0 NS NS 0.000000 25.0000 0 - 9150 0 NS NS 0.000000 25.0000 0 - 9151 0 NS NS 0.000000 25.0000 0 - 9152 0 NS NS 0.000000 25.0000 0 - 9153 0 NS NS 0.000000 25.0000 0 - 9154 0 NS NS 0.000000 25.0000 0 - 9155 0 NS NS 0.000000 25.0000 0 - 9156 0 NS NS 0.000000 25.0000 0 - 9157 0 NS NS 0.000000 25.0000 0 - 9158 0 NS NS 0.000000 25.0000 0 - 9159 0 NS NS 0.000000 25.0000 0 - 9160 0 NS NS 0.000000 25.0000 0 - 9161 0 NS NS 0.000000 25.0000 0 - 9162 0 NS NS 0.000000 25.0000 0 - 9163 0 NS NS 0.000000 25.0000 0 - 9164 0 NS NS 0.000000 25.0000 0 - 9165 0 NS NS 0.000000 25.0000 0 - 9166 0 NS NS 0.000000 25.0000 0 - 9167 0 NS NS 0.000000 25.0000 0 - 9168 0 NS NS 0.000000 25.0000 0 - 9169 0 NS NS 0.000000 25.0000 0 - 9170 0 NS NS 0.000000 25.0000 0 - 9171 0 NS NS 0.000000 25.0000 0 - 9172 0 NS NS 0.000000 25.0000 0 - 9173 0 NS NS 0.000000 25.0000 0 - 9174 0 NS NS 0.000000 25.0000 0 - 9175 0 NS NS 0.000000 25.0000 0 - 9176 0 NS NS 0.000000 25.0000 0 - 9177 0 NS NS 0.000000 25.0000 0 - 9178 0 NS NS 0.000000 25.0000 0 - 9179 0 NS NS 0.000000 25.0000 0 - 9180 0 NS NS 0.000000 25.0000 0 - 9181 0 NS NS 0.000000 25.0000 0 - 9182 0 NS NS 0.000000 25.0000 0 - 9183 0 NS NS 0.000000 25.0000 0 - 9184 0 NS NS 0.000000 25.0000 0 - 9185 0 NS NS 0.000000 25.0000 0 - 9186 0 NS NS 0.000000 25.0000 0 - 9187 0 NS NS 0.000000 25.0000 0 - 9188 0 NS NS 0.000000 25.0000 0 - 9189 0 NS NS 0.000000 25.0000 0 - 9190 0 NS NS 0.000000 25.0000 0 - 9191 0 NS NS 0.000000 25.0000 0 - 9192 0 NS NS 0.000000 25.0000 0 - 9193 0 NS NS 0.000000 25.0000 0 - 9194 0 NS NS 0.000000 25.0000 0 - 9195 0 NS NS 0.000000 25.0000 0 - 9196 0 NS NS 0.000000 25.0000 0 - 9197 0 NS NS 0.000000 25.0000 0 - 9198 0 NS NS 0.000000 25.0000 0 - 9199 0 NS NS 0.000000 25.0000 0 - 9200 0 NS NS 0.000000 25.0000 0 - 9201 0 NS NS 0.000000 25.0000 0 - 9202 0 NS NS 0.000000 25.0000 0 - 9203 0 NS NS 0.000000 25.0000 0 - 9204 0 NS NS 0.000000 25.0000 0 - 9205 0 NS NS 0.000000 25.0000 0 - 9206 0 NS NS 0.000000 25.0000 0 - 9207 0 NS NS 0.000000 25.0000 0 - 9208 0 NS NS 0.000000 25.0000 0 - 9209 0 NS NS 0.000000 25.0000 0 - 9210 0 NS NS 0.000000 25.0000 0 - 9211 0 NS NS 0.000000 25.0000 0 - 9212 0 NS NS 0.000000 25.0000 0 - 9213 0 NS NS 0.000000 25.0000 0 - 9214 0 NS NS 0.000000 25.0000 0 - 9215 0 NS NS 0.000000 25.0000 0 - 9216 0 NS NS 0.000000 25.0000 0 - 9217 0 NS NS 0.000000 25.0000 0 - 9218 0 NS NS 0.000000 25.0000 0 - 9219 0 NS NS 0.000000 25.0000 0 - 9220 0 NS NS 0.000000 25.0000 0 - 9221 0 NS NS 0.000000 25.0000 0 - 9222 0 NS NS 0.000000 25.0000 0 - 9223 0 NS NS 0.000000 25.0000 0 - 9224 0 NS NS 0.000000 25.0000 0 - 9225 0 NS NS 0.000000 25.0000 0 - 9226 0 NS NS 0.000000 25.0000 0 - 9227 0 NS NS 0.000000 25.0000 0 - 9228 0 NS NS 0.000000 25.0000 0 - 9229 0 NS NS 0.000000 25.0000 0 - 9230 0 NS NS 0.000000 25.0000 0 - 9231 0 NS NS 0.000000 25.0000 0 - 9232 0 NS NS 0.000000 25.0000 0 - 9233 0 NS NS 0.000000 25.0000 0 - 9234 0 NS NS 0.000000 25.0000 0 - 9235 0 NS NS 0.000000 25.0000 0 - 9236 0 NS NS 0.000000 25.0000 0 - 9237 0 NS NS 0.000000 25.0000 0 - 9238 0 NS NS 0.000000 25.0000 0 - 9239 0 NS NS 0.000000 25.0000 0 - 9240 0 NS NS 0.000000 25.0000 0 - 9241 0 NS NS 0.000000 25.0000 0 - 9242 0 NS NS 0.000000 25.0000 0 - 9243 0 NS NS 0.000000 25.0000 0 - 9244 0 NS NS 0.000000 25.0000 0 - 9245 0 NS NS 0.000000 25.0000 0 - 9246 0 NS NS 0.000000 25.0000 0 - 9247 0 NS NS 0.000000 25.0000 0 - 9248 0 NS NS 0.000000 25.0000 0 - 9249 0 NS NS 0.000000 25.0000 0 - 9250 0 NS NS 0.000000 25.0000 0 - 9251 0 NS NS 0.000000 25.0000 0 - 9252 0 NS NS 0.000000 25.0000 0 - 9253 0 NS NS 0.000000 25.0000 0 - 9254 0 NS NS 0.000000 25.0000 0 - 9255 0 NS NS 0.000000 25.0000 0 - 9256 0 NS NS 0.000000 25.0000 0 - 9257 0 NS NS 0.000000 25.0000 0 - 9258 0 NS NS 0.000000 25.0000 0 - 9259 0 NS NS 0.000000 25.0000 0 - 9260 0 NS NS 0.000000 25.0000 0 - 9261 0 NS NS 0.000000 25.0000 0 - 9262 0 NS NS 0.000000 25.0000 0 - 9263 0 NS NS 0.000000 25.0000 0 - 9264 0 NS NS 0.000000 25.0000 0 - 9265 0 NS NS 0.000000 25.0000 0 - 9266 0 NS NS 0.000000 25.0000 0 - 9267 0 NS NS 0.000000 25.0000 0 - 9268 0 NS NS 0.000000 25.0000 0 - 9269 0 NS NS 0.000000 25.0000 0 - 9270 0 NS NS 0.000000 25.0000 0 - 9271 0 NS NS 0.000000 25.0000 0 - 9272 0 NS NS 0.000000 25.0000 0 - 9273 0 NS NS 0.000000 25.0000 0 - 9274 0 NS NS 0.000000 25.0000 0 - 9275 0 NS NS 0.000000 25.0000 0 - 9276 0 NS NS 0.000000 25.0000 0 - 9277 0 NS NS 0.000000 25.0000 0 - 9278 0 NS NS 0.000000 25.0000 0 - 9279 0 NS NS 0.000000 25.0000 0 - 9280 0 NS NS 0.000000 25.0000 0 - 9281 0 NS NS 0.000000 25.0000 0 - 9282 0 NS NS 0.000000 25.0000 0 - 9283 0 NS NS 0.000000 25.0000 0 - 9284 0 NS NS 0.000000 25.0000 0 - 9285 0 NS NS 0.000000 25.0000 0 - 9286 0 NS NS 0.000000 25.0000 0 - 9287 0 NS NS 0.000000 25.0000 0 - 9288 0 NS NS 0.000000 25.0000 0 - 9289 0 NS NS 0.000000 25.0000 0 - 9290 0 NS NS 0.000000 25.0000 0 - 9291 0 NS NS 0.000000 25.0000 0 - 9292 0 NS NS 0.000000 25.0000 0 - 9293 0 NS NS 0.000000 25.0000 0 - 9294 0 NS NS 0.000000 25.0000 0 - 9295 0 NS NS 0.000000 25.0000 0 - 9296 0 NS NS 0.000000 25.0000 0 - 9297 0 NS NS 0.000000 25.0000 0 - 9298 0 NS NS 0.000000 25.0000 0 - 9299 0 NS NS 0.000000 25.0000 0 - 9300 0 NS NS 0.000000 25.0000 0 - 9301 0 NS NS 0.000000 25.0000 0 - 9302 0 NS NS 0.000000 25.0000 0 - 9303 0 NS NS 0.000000 25.0000 0 - 9304 0 NS NS 0.000000 25.0000 0 - 9305 0 NS NS 0.000000 25.0000 0 - 9306 0 NS NS 0.000000 25.0000 0 - 9307 0 NS NS 0.000000 25.0000 0 - 9308 0 NS NS 0.000000 25.0000 0 - 9309 0 NS NS 0.000000 25.0000 0 - 9310 0 NS NS 0.000000 25.0000 0 - 9311 0 NS NS 0.000000 25.0000 0 - 9312 0 NS NS 0.000000 25.0000 0 - 9313 0 NS NS 0.000000 25.0000 0 - 9314 0 NS NS 0.000000 25.0000 0 - 9315 0 NS NS 0.000000 25.0000 0 - 9316 0 NS NS 0.000000 25.0000 0 - 9317 0 NS NS 0.000000 25.0000 0 - 9318 0 NS NS 0.000000 25.0000 0 - 9319 0 NS NS 0.000000 25.0000 0 - 9320 0 NS NS 0.000000 25.0000 0 - 9321 0 NS NS 0.000000 25.0000 0 - 9322 0 NS NS 0.000000 25.0000 0 - 9323 0 NS NS 0.000000 25.0000 0 - 9324 0 NS NS 0.000000 25.0000 0 - 9325 0 NS NS 0.000000 25.0000 0 - 9326 0 NS NS 0.000000 25.0000 0 - 9327 0 NS NS 0.000000 25.0000 0 - 9328 0 NS NS 0.000000 25.0000 0 - 9329 0 NS NS 0.000000 25.0000 0 - 9330 0 NS NS 0.000000 25.0000 0 - 9331 0 NS NS 0.000000 25.0000 0 - 9332 0 NS NS 0.000000 25.0000 0 - 9333 0 NS NS 0.000000 25.0000 0 - 9334 0 NS NS 0.000000 25.0000 0 - 9335 0 NS NS 0.000000 25.0000 0 - 9336 0 NS NS 0.000000 25.0000 0 - 9337 0 NS NS 0.000000 25.0000 0 - 9338 0 NS NS 0.000000 25.0000 0 - 9339 0 NS NS 0.000000 25.0000 0 - 9340 0 NS NS 0.000000 25.0000 0 - 9341 0 NS NS 0.000000 25.0000 0 - 9342 0 NS NS 0.000000 25.0000 0 - 9343 0 NS NS 0.000000 25.0000 0 - 9344 0 NS NS 0.000000 25.0000 0 - 9345 0 NS NS 0.000000 25.0000 0 - 9346 0 NS NS 0.000000 25.0000 0 - 9347 0 NS NS 0.000000 25.0000 0 - 9348 0 NS NS 0.000000 25.0000 0 - 9349 0 NS NS 0.000000 25.0000 0 - 9350 0 NS NS 0.000000 25.0000 0 - 9351 0 NS NS 0.000000 25.0000 0 - 9352 0 NS NS 0.000000 25.0000 0 - 9353 0 NS NS 0.000000 25.0000 0 - 9354 0 NS NS 0.000000 25.0000 0 - 9355 0 NS NS 0.000000 25.0000 0 - 9356 0 NS NS 0.000000 25.0000 0 - 9357 0 NS NS 0.000000 25.0000 0 - 9358 0 NS NS 0.000000 25.0000 0 - 9359 0 NS NS 0.000000 25.0000 0 - 9360 0 NS NS 0.000000 25.0000 0 - 9361 0 NS NS 0.000000 25.0000 0 - 9362 0 NS NS 0.000000 25.0000 0 - 9363 0 NS NS 0.000000 25.0000 0 - 9364 0 NS NS 0.000000 25.0000 0 - 9365 0 NS NS 0.000000 25.0000 0 - 9366 0 NS NS 0.000000 25.0000 0 - 9367 0 NS NS 0.000000 25.0000 0 - 9368 0 NS NS 0.000000 25.0000 0 - 9369 0 NS NS 0.000000 25.0000 0 - 9370 0 NS NS 0.000000 25.0000 0 - 9371 0 NS NS 0.000000 25.0000 0 - 9372 0 NS NS 0.000000 25.0000 0 - 9373 0 NS NS 0.000000 25.0000 0 - 9374 0 NS NS 0.000000 25.0000 0 - 9375 0 NS NS 0.000000 25.0000 0 - 9376 0 NS NS 0.000000 25.0000 0 - 9377 0 NS NS 0.000000 25.0000 0 - 9378 0 NS NS 0.000000 25.0000 0 - 9379 0 NS NS 0.000000 25.0000 0 - 9380 0 NS NS 0.000000 25.0000 0 - 9381 0 NS NS 0.000000 25.0000 0 - 9382 0 NS NS 0.000000 25.0000 0 - 9383 0 NS NS 0.000000 25.0000 0 - 9384 0 NS NS 0.000000 25.0000 0 - 9385 0 NS NS 0.000000 25.0000 0 - 9386 0 NS NS 0.000000 25.0000 0 - 9387 0 NS NS 0.000000 25.0000 0 - 9388 0 NS NS 0.000000 25.0000 0 - 9389 0 NS NS 0.000000 25.0000 0 - 9390 0 NS NS 0.000000 25.0000 0 - 9391 0 NS NS 0.000000 25.0000 0 - 9392 0 NS NS 0.000000 25.0000 0 - 9393 0 NS NS 0.000000 25.0000 0 - 9394 0 NS NS 0.000000 25.0000 0 - 9395 0 NS NS 0.000000 25.0000 0 - 9396 0 NS NS 0.000000 25.0000 0 - 9397 0 NS NS 0.000000 25.0000 0 - 9398 0 NS NS 0.000000 25.0000 0 - 9399 0 NS NS 0.000000 25.0000 0 - 9400 0 NS NS 0.000000 25.0000 0 - 9401 0 NS NS 0.000000 25.0000 0 - 9402 0 NS NS 0.000000 25.0000 0 - 9403 0 NS NS 0.000000 25.0000 0 - 9404 0 NS NS 0.000000 25.0000 0 - 9405 0 NS NS 0.000000 25.0000 0 - 9406 0 NS NS 0.000000 25.0000 0 - 9407 0 NS NS 0.000000 25.0000 0 - 9408 0 NS NS 0.000000 25.0000 0 - 9409 0 NS NS 0.000000 25.0000 0 - 9410 0 NS NS 0.000000 25.0000 0 - 9411 0 NS NS 0.000000 25.0000 0 - 9412 0 NS NS 0.000000 25.0000 0 - 9413 0 NS NS 0.000000 25.0000 0 - 9414 0 NS NS 0.000000 25.0000 0 - 9415 0 NS NS 0.000000 25.0000 0 - 9416 0 NS NS 0.000000 25.0000 0 - 9417 0 NS NS 0.000000 25.0000 0 - 9418 0 NS NS 0.000000 25.0000 0 - 9419 0 NS NS 0.000000 25.0000 0 - 9420 0 NS NS 0.000000 25.0000 0 - 9421 0 NS NS 0.000000 25.0000 0 - 9422 0 NS NS 0.000000 25.0000 0 - 9423 0 NS NS 0.000000 25.0000 0 - 9424 0 NS NS 0.000000 25.0000 0 - 9425 0 NS NS 0.000000 25.0000 0 - 9426 0 NS NS 0.000000 25.0000 0 - 9427 0 NS NS 0.000000 25.0000 0 - 9428 0 NS NS 0.000000 25.0000 0 - 9429 0 NS NS 0.000000 25.0000 0 - 9430 0 NS NS 0.000000 25.0000 0 - 9431 0 NS NS 0.000000 25.0000 0 - 9432 0 NS NS 0.000000 25.0000 0 - 9433 0 NS NS 0.000000 25.0000 0 - 9434 0 NS NS 0.000000 25.0000 0 - 9435 0 NS NS 0.000000 25.0000 0 - 9436 0 NS NS 0.000000 25.0000 0 - 9437 0 NS NS 0.000000 25.0000 0 - 9438 0 NS NS 0.000000 25.0000 0 - 9439 0 NS NS 0.000000 25.0000 0 - 9440 0 NS NS 0.000000 25.0000 0 - 9441 0 NS NS 0.000000 25.0000 0 - 9442 0 NS NS 0.000000 25.0000 0 - 9443 0 NS NS 0.000000 25.0000 0 - 9444 0 NS NS 0.000000 25.0000 0 - 9445 0 NS NS 0.000000 25.0000 0 - 9446 0 NS NS 0.000000 25.0000 0 - 9447 0 NS NS 0.000000 25.0000 0 - 9448 0 NS NS 0.000000 25.0000 0 - 9449 0 NS NS 0.000000 25.0000 0 - 9450 0 NS NS 0.000000 25.0000 0 - 9451 0 NS NS 0.000000 25.0000 0 - 9452 0 NS NS 0.000000 25.0000 0 - 9453 0 NS NS 0.000000 25.0000 0 - 9454 0 NS NS 0.000000 25.0000 0 - 9455 0 NS NS 0.000000 25.0000 0 - 9456 0 NS NS 0.000000 25.0000 0 - 9457 0 NS NS 0.000000 25.0000 0 - 9458 0 NS NS 0.000000 25.0000 0 - 9459 0 NS NS 0.000000 25.0000 0 - 9460 0 NS NS 0.000000 25.0000 0 - 9461 0 NS NS 0.000000 25.0000 0 - 9462 0 NS NS 0.000000 25.0000 0 - 9463 0 NS NS 0.000000 25.0000 0 - 9464 0 NS NS 0.000000 25.0000 0 - 9465 0 NS NS 0.000000 25.0000 0 - 9466 0 NS NS 0.000000 25.0000 0 - 9467 0 NS NS 0.000000 25.0000 0 - 9468 0 NS NS 0.000000 25.0000 0 - 9469 0 NS NS 0.000000 25.0000 0 - 9470 0 NS NS 0.000000 25.0000 0 - 9471 0 NS NS 0.000000 25.0000 0 - 9472 0 NS NS 0.000000 25.0000 0 - 9473 0 NS NS 0.000000 25.0000 0 - 9474 0 NS NS 0.000000 25.0000 0 - 9475 0 NS NS 0.000000 25.0000 0 - 9476 0 NS NS 0.000000 25.0000 0 - 9477 0 NS NS 0.000000 25.0000 0 - 9478 0 NS NS 0.000000 25.0000 0 - 9479 0 NS NS 0.000000 25.0000 0 - 9480 0 NS NS 0.000000 25.0000 0 - 9481 0 NS NS 0.000000 25.0000 0 - 9482 0 NS NS 0.000000 25.0000 0 - 9483 0 NS NS 0.000000 25.0000 0 - 9484 0 NS NS 0.000000 25.0000 0 - 9485 0 NS NS 0.000000 25.0000 0 - 9486 0 NS NS 0.000000 25.0000 0 - 9487 0 NS NS 0.000000 25.0000 0 - 9488 0 NS NS 0.000000 25.0000 0 - 9489 0 NS NS 0.000000 25.0000 0 - 9490 0 NS NS 0.000000 25.0000 0 - 9491 0 NS NS 0.000000 25.0000 0 - 9492 0 NS NS 0.000000 25.0000 0 - 9493 0 NS NS 0.000000 25.0000 0 - 9494 0 NS NS 0.000000 25.0000 0 - 9495 0 NS NS 0.000000 25.0000 0 - 9496 0 NS NS 0.000000 25.0000 0 - 9497 0 NS NS 0.000000 25.0000 0 - 9498 0 NS NS 0.000000 25.0000 0 - 9499 0 NS NS 0.000000 25.0000 0 - 9500 0 NS NS 0.000000 25.0000 0 - 9501 0 NS NS 0.000000 25.0000 0 - 9502 0 NS NS 0.000000 25.0000 0 - 9503 0 NS NS 0.000000 25.0000 0 - 9504 0 NS NS 0.000000 25.0000 0 - 9505 0 NS NS 0.000000 25.0000 0 - 9506 0 NS NS 0.000000 25.0000 0 - 9507 0 NS NS 0.000000 25.0000 0 - 9508 0 NS NS 0.000000 25.0000 0 - 9509 0 NS NS 0.000000 25.0000 0 - 9510 0 NS NS 0.000000 25.0000 0 - 9511 0 NS NS 0.000000 25.0000 0 - 9512 0 NS NS 0.000000 25.0000 0 - 9513 0 NS NS 0.000000 25.0000 0 - 9514 0 NS NS 0.000000 25.0000 0 - 9515 0 NS NS 0.000000 25.0000 0 - 9516 0 NS NS 0.000000 25.0000 0 - 9517 0 NS NS 0.000000 25.0000 0 - 9518 0 NS NS 0.000000 25.0000 0 - 9519 0 NS NS 0.000000 25.0000 0 - 9520 0 NS NS 0.000000 25.0000 0 - 9521 0 NS NS 0.000000 25.0000 0 - 9522 0 NS NS 0.000000 25.0000 0 - 9523 0 NS NS 0.000000 25.0000 0 - 9524 0 NS NS 0.000000 25.0000 0 - 9525 0 NS NS 0.000000 25.0000 0 - 9526 0 NS NS 0.000000 25.0000 0 - 9527 0 NS NS 0.000000 25.0000 0 - 9528 0 NS NS 0.000000 25.0000 0 - 9529 0 NS NS 0.000000 25.0000 0 - 9530 0 NS NS 0.000000 25.0000 0 - 9531 0 NS NS 0.000000 25.0000 0 - 9532 0 NS NS 0.000000 25.0000 0 - 9533 0 NS NS 0.000000 25.0000 0 - 9534 0 NS NS 0.000000 25.0000 0 - 9535 0 NS NS 0.000000 25.0000 0 - 9536 0 NS NS 0.000000 25.0000 0 - 9537 0 NS NS 0.000000 25.0000 0 - 9538 0 NS NS 0.000000 25.0000 0 - 9539 0 NS NS 0.000000 25.0000 0 - 9540 0 NS NS 0.000000 25.0000 0 - 9541 0 NS NS 0.000000 25.0000 0 - 9542 0 NS NS 0.000000 25.0000 0 - 9543 0 NS NS 0.000000 25.0000 0 - 9544 0 NS NS 0.000000 25.0000 0 - 9545 0 NS NS 0.000000 25.0000 0 - 9546 0 NS NS 0.000000 25.0000 0 - 9547 0 NS NS 0.000000 25.0000 0 - 9548 0 NS NS 0.000000 25.0000 0 - 9549 0 NS NS 0.000000 25.0000 0 - 9550 0 NS NS 0.000000 25.0000 0 - 9551 0 NS NS 0.000000 25.0000 0 - 9552 0 NS NS 0.000000 25.0000 0 - 9553 0 NS NS 0.000000 25.0000 0 - 9554 0 NS NS 0.000000 25.0000 0 - 9555 0 NS NS 0.000000 25.0000 0 - 9556 0 NS NS 0.000000 25.0000 0 - 9557 0 NS NS 0.000000 25.0000 0 - 9558 0 NS NS 0.000000 25.0000 0 - 9559 0 NS NS 0.000000 25.0000 0 - 9560 0 NS NS 0.000000 25.0000 0 - 9561 0 NS NS 0.000000 25.0000 0 - 9562 0 NS NS 0.000000 25.0000 0 - 9563 0 NS NS 0.000000 25.0000 0 - 9564 0 NS NS 0.000000 25.0000 0 - 9565 0 NS NS 0.000000 25.0000 0 - 9566 0 NS NS 0.000000 25.0000 0 - 9567 0 NS NS 0.000000 25.0000 0 - 9568 0 NS NS 0.000000 25.0000 0 - 9569 0 NS NS 0.000000 25.0000 0 - 9570 0 NS NS 0.000000 25.0000 0 - 9571 0 NS NS 0.000000 25.0000 0 - 9572 0 NS NS 0.000000 25.0000 0 - 9573 0 NS NS 0.000000 25.0000 0 - 9574 0 NS NS 0.000000 25.0000 0 - 9575 0 NS NS 0.000000 25.0000 0 - 9576 0 NS NS 0.000000 25.0000 0 - 9577 0 NS NS 0.000000 25.0000 0 - 9578 0 NS NS 0.000000 25.0000 0 - 9579 0 NS NS 0.000000 25.0000 0 - 9580 0 NS NS 0.000000 25.0000 0 - 9581 0 NS NS 0.000000 25.0000 0 - 9582 0 NS NS 0.000000 25.0000 0 - 9583 0 NS NS 0.000000 25.0000 0 - 9584 0 NS NS 0.000000 25.0000 0 - 9585 0 NS NS 0.000000 25.0000 0 - 9586 0 NS NS 0.000000 25.0000 0 - 9587 0 NS NS 0.000000 25.0000 0 - 9588 0 NS NS 0.000000 25.0000 0 - 9589 0 NS NS 0.000000 25.0000 0 - 9590 0 NS NS 0.000000 25.0000 0 - 9591 0 NS NS 0.000000 25.0000 0 - 9592 0 NS NS 0.000000 25.0000 0 - 9593 0 NS NS 0.000000 25.0000 0 - 9594 0 NS NS 0.000000 25.0000 0 - 9595 0 NS NS 0.000000 25.0000 0 - 9596 0 NS NS 0.000000 25.0000 0 - 9597 0 NS NS 0.000000 25.0000 0 - 9598 0 NS NS 0.000000 25.0000 0 - 9599 0 NS NS 0.000000 25.0000 0 - 9600 0 NS NS 0.000000 25.0000 0 - 9601 0 NS NS 0.000000 25.0000 0 - 9602 0 NS NS 0.000000 25.0000 0 - 9603 0 NS NS 0.000000 25.0000 0 - 9604 0 NS NS 0.000000 25.0000 0 - 9605 0 NS NS 0.000000 25.0000 0 - 9606 0 NS NS 0.000000 25.0000 0 - 9607 0 NS NS 0.000000 25.0000 0 - 9608 0 NS NS 0.000000 25.0000 0 - 9609 0 NS NS 0.000000 25.0000 0 - 9610 0 NS NS 0.000000 25.0000 0 - 9611 0 NS NS 0.000000 25.0000 0 - 9612 0 NS NS 0.000000 25.0000 0 - 9613 0 NS NS 0.000000 25.0000 0 - 9614 0 NS NS 0.000000 25.0000 0 - 9615 0 NS NS 0.000000 25.0000 0 - 9616 0 NS NS 0.000000 25.0000 0 - 9617 0 NS NS 0.000000 25.0000 0 - 9618 0 NS NS 0.000000 25.0000 0 - 9619 0 NS NS 0.000000 25.0000 0 - 9620 0 NS NS 0.000000 25.0000 0 - 9621 0 NS NS 0.000000 25.0000 0 - 9622 0 NS NS 0.000000 25.0000 0 - 9623 0 NS NS 0.000000 25.0000 0 - 9624 0 NS NS 0.000000 25.0000 0 - 9625 0 NS NS 0.000000 25.0000 0 - 9626 0 NS NS 0.000000 25.0000 0 - 9627 0 NS NS 0.000000 25.0000 0 - 9628 0 NS NS 0.000000 25.0000 0 - 9629 0 NS NS 0.000000 25.0000 0 - 9630 0 NS NS 0.000000 25.0000 0 - 9631 0 NS NS 0.000000 25.0000 0 - 9632 0 NS NS 0.000000 25.0000 0 - 9633 0 NS NS 0.000000 25.0000 0 - 9634 0 NS NS 0.000000 25.0000 0 - 9635 0 NS NS 0.000000 25.0000 0 - 9636 0 NS NS 0.000000 25.0000 0 - 9637 0 NS NS 0.000000 25.0000 0 - 9638 0 NS NS 0.000000 25.0000 0 - 9639 0 NS NS 0.000000 25.0000 0 - 9640 0 NS NS 0.000000 25.0000 0 - 9641 0 NS NS 0.000000 25.0000 0 - 9642 0 NS NS 0.000000 25.0000 0 - 9643 0 NS NS 0.000000 25.0000 0 - 9644 0 NS NS 0.000000 25.0000 0 - 9645 0 NS NS 0.000000 25.0000 0 - 9646 0 NS NS 0.000000 25.0000 0 - 9647 0 NS NS 0.000000 25.0000 0 - 9648 0 NS NS 0.000000 25.0000 0 - 9649 0 NS NS 0.000000 25.0000 0 - 9650 0 NS NS 0.000000 25.0000 0 - 9651 0 NS NS 0.000000 25.0000 0 - 9652 0 NS NS 0.000000 25.0000 0 - 9653 0 NS NS 0.000000 25.0000 0 - 9654 0 NS NS 0.000000 25.0000 0 - 9655 0 NS NS 0.000000 25.0000 0 - 9656 0 NS NS 0.000000 25.0000 0 - 9657 0 NS NS 0.000000 25.0000 0 - 9658 0 NS NS 0.000000 25.0000 0 - 9659 0 NS NS 0.000000 25.0000 0 - 9660 0 NS NS 0.000000 25.0000 0 - 9661 0 NS NS 0.000000 25.0000 0 - 9662 0 NS NS 0.000000 25.0000 0 - 9663 0 NS NS 0.000000 25.0000 0 - 9664 0 NS NS 0.000000 25.0000 0 - 9665 0 NS NS 0.000000 25.0000 0 - 9666 0 NS NS 0.000000 25.0000 0 - 9667 0 NS NS 0.000000 25.0000 0 - 9668 0 NS NS 0.000000 25.0000 0 - 9669 0 NS NS 0.000000 25.0000 0 - 9670 0 NS NS 0.000000 25.0000 0 - 9671 0 NS NS 0.000000 25.0000 0 - 9672 0 NS NS 0.000000 25.0000 0 - 9673 0 NS NS 0.000000 25.0000 0 - 9674 0 NS NS 0.000000 25.0000 0 - 9675 0 NS NS 0.000000 25.0000 0 - 9676 0 NS NS 0.000000 25.0000 0 - 9677 0 NS NS 0.000000 25.0000 0 - 9678 0 NS NS 0.000000 25.0000 0 - 9679 0 NS NS 0.000000 25.0000 0 - 9680 0 NS NS 0.000000 25.0000 0 - 9681 0 NS NS 0.000000 25.0000 0 - 9682 0 NS NS 0.000000 25.0000 0 - 9683 0 NS NS 0.000000 25.0000 0 - 9684 0 NS NS 0.000000 25.0000 0 - 9685 0 NS NS 0.000000 25.0000 0 - 9686 0 NS NS 0.000000 25.0000 0 - 9687 0 NS NS 0.000000 25.0000 0 - 9688 0 NS NS 0.000000 25.0000 0 - 9689 0 NS NS 0.000000 25.0000 0 - 9690 0 NS NS 0.000000 25.0000 0 - 9691 0 NS NS 0.000000 25.0000 0 - 9692 0 NS NS 0.000000 25.0000 0 - 9693 0 NS NS 0.000000 25.0000 0 - 9694 0 NS NS 0.000000 25.0000 0 - 9695 0 NS NS 0.000000 25.0000 0 - 9696 0 NS NS 0.000000 25.0000 0 - 9697 0 NS NS 0.000000 25.0000 0 - 9698 0 NS NS 0.000000 25.0000 0 - 9699 0 NS NS 0.000000 25.0000 0 - 9700 0 NS NS 0.000000 25.0000 0 - 9701 0 NS NS 0.000000 25.0000 0 - 9702 0 NS NS 0.000000 25.0000 0 - 9703 0 NS NS 0.000000 25.0000 0 - 9704 0 NS NS 0.000000 25.0000 0 - 9705 0 NS NS 0.000000 25.0000 0 - 9706 0 NS NS 0.000000 25.0000 0 - 9707 0 NS NS 0.000000 25.0000 0 - 9708 0 NS NS 0.000000 25.0000 0 - 9709 0 NS NS 0.000000 25.0000 0 - 9710 0 NS NS 0.000000 25.0000 0 - 9711 0 NS NS 0.000000 25.0000 0 - 9712 0 NS NS 0.000000 25.0000 0 - 9713 0 NS NS 0.000000 25.0000 0 - 9714 0 NS NS 0.000000 25.0000 0 - 9715 0 NS NS 0.000000 25.0000 0 - 9716 0 NS NS 0.000000 25.0000 0 - 9717 0 NS NS 0.000000 25.0000 0 - 9718 0 NS NS 0.000000 25.0000 0 - 9719 0 NS NS 0.000000 25.0000 0 - 9720 0 NS NS 0.000000 25.0000 0 - 9721 0 NS NS 0.000000 25.0000 0 - 9722 0 NS NS 0.000000 25.0000 0 - 9723 0 NS NS 0.000000 25.0000 0 - 9724 0 NS NS 0.000000 25.0000 0 - 9725 0 NS NS 0.000000 25.0000 0 - 9726 0 NS NS 0.000000 25.0000 0 - 9727 0 NS NS 0.000000 25.0000 0 - 9728 0 NS NS 0.000000 25.0000 0 - 9729 0 NS NS 0.000000 25.0000 0 - 9730 0 NS NS 0.000000 25.0000 0 - 9731 0 NS NS 0.000000 25.0000 0 - 9732 0 NS NS 0.000000 25.0000 0 - 9733 0 NS NS 0.000000 25.0000 0 - 9734 0 NS NS 0.000000 25.0000 0 - 9735 0 NS NS 0.000000 25.0000 0 - 9736 0 NS NS 0.000000 25.0000 0 - 9737 0 NS NS 0.000000 25.0000 0 - 9738 0 NS NS 0.000000 25.0000 0 - 9739 0 NS NS 0.000000 25.0000 0 - 9740 0 NS NS 0.000000 25.0000 0 - 9741 0 NS NS 0.000000 25.0000 0 - 9742 0 NS NS 0.000000 25.0000 0 - 9743 0 NS NS 0.000000 25.0000 0 - 9744 0 NS NS 0.000000 25.0000 0 - 9745 0 NS NS 0.000000 25.0000 0 - 9746 0 NS NS 0.000000 25.0000 0 - 9747 0 NS NS 0.000000 25.0000 0 - 9748 0 NS NS 0.000000 25.0000 0 - 9749 0 NS NS 0.000000 25.0000 0 - 9750 0 NS NS 0.000000 25.0000 0 - 9751 0 NS NS 0.000000 25.0000 0 - 9752 0 NS NS 0.000000 25.0000 0 - 9753 0 NS NS 0.000000 25.0000 0 - 9754 0 NS NS 0.000000 25.0000 0 - 9755 0 NS NS 0.000000 25.0000 0 - 9756 0 NS NS 0.000000 25.0000 0 - 9757 0 NS NS 0.000000 25.0000 0 - 9758 0 NS NS 0.000000 25.0000 0 - 9759 0 NS NS 0.000000 25.0000 0 - 9760 0 NS NS 0.000000 25.0000 0 - 9761 0 NS NS 0.000000 25.0000 0 - 9762 0 NS NS 0.000000 25.0000 0 - 9763 0 NS NS 0.000000 25.0000 0 - 9764 0 NS NS 0.000000 25.0000 0 - 9765 0 NS NS 0.000000 25.0000 0 - 9766 0 NS NS 0.000000 25.0000 0 - 9767 0 NS NS 0.000000 25.0000 0 - 9768 0 NS NS 0.000000 25.0000 0 - 9769 0 NS NS 0.000000 25.0000 0 - 9770 0 NS NS 0.000000 25.0000 0 - 9771 0 NS NS 0.000000 25.0000 0 - 9772 0 NS NS 0.000000 25.0000 0 - 9773 0 NS NS 0.000000 25.0000 0 - 9774 0 NS NS 0.000000 25.0000 0 - 9775 0 NS NS 0.000000 25.0000 0 - 9776 0 NS NS 0.000000 25.0000 0 - 9777 0 NS NS 0.000000 25.0000 0 - 9778 0 NS NS 0.000000 25.0000 0 - 9779 0 NS NS 0.000000 25.0000 0 - 9780 0 NS NS 0.000000 25.0000 0 - 9781 0 NS NS 0.000000 25.0000 0 - 9782 0 NS NS 0.000000 25.0000 0 - 9783 0 NS NS 0.000000 25.0000 0 - 9784 0 NS NS 0.000000 25.0000 0 - 9785 0 NS NS 0.000000 25.0000 0 - 9786 0 NS NS 0.000000 25.0000 0 - 9787 0 NS NS 0.000000 25.0000 0 - 9788 0 NS NS 0.000000 25.0000 0 - 9789 0 NS NS 0.000000 25.0000 0 - 9790 0 NS NS 0.000000 25.0000 0 - 9791 0 NS NS 0.000000 25.0000 0 - 9792 0 NS NS 0.000000 25.0000 0 - 9793 0 NS NS 0.000000 25.0000 0 - 9794 0 NS NS 0.000000 25.0000 0 - 9795 0 NS NS 0.000000 25.0000 0 - 9796 0 NS NS 0.000000 25.0000 0 - 9797 0 NS NS 0.000000 25.0000 0 - 9798 0 NS NS 0.000000 25.0000 0 - 9799 0 NS NS 0.000000 25.0000 0 - 9800 0 NS NS 0.000000 25.0000 0 - 9801 0 NS NS 0.000000 25.0000 0 - 9802 0 NS NS 0.000000 25.0000 0 - 9803 0 NS NS 0.000000 25.0000 0 - 9804 0 NS NS 0.000000 25.0000 0 - 9805 0 NS NS 0.000000 25.0000 0 - 9806 0 NS NS 0.000000 25.0000 0 - 9807 0 NS NS 0.000000 25.0000 0 - 9808 0 NS NS 0.000000 25.0000 0 - 9809 0 NS NS 0.000000 25.0000 0 - 9810 0 NS NS 0.000000 25.0000 0 - 9811 0 NS NS 0.000000 25.0000 0 - 9812 0 NS NS 0.000000 25.0000 0 - 9813 0 NS NS 0.000000 25.0000 0 - 9814 0 NS NS 0.000000 25.0000 0 - 9815 0 NS NS 0.000000 25.0000 0 - 9816 0 NS NS 0.000000 25.0000 0 - 9817 0 NS NS 0.000000 25.0000 0 - 9818 0 NS NS 0.000000 25.0000 0 - 9819 0 NS NS 0.000000 25.0000 0 - 9820 0 NS NS 0.000000 25.0000 0 - 9821 0 NS NS 0.000000 25.0000 0 - 9822 0 NS NS 0.000000 25.0000 0 - 9823 0 NS NS 0.000000 25.0000 0 - 9824 0 NS NS 0.000000 25.0000 0 - 9825 0 NS NS 0.000000 25.0000 0 - 9826 0 NS NS 0.000000 25.0000 0 - 9827 0 NS NS 0.000000 25.0000 0 - 9828 0 NS NS 0.000000 25.0000 0 - 9829 0 NS NS 0.000000 25.0000 0 - 9830 0 NS NS 0.000000 25.0000 0 - 9831 0 NS NS 0.000000 25.0000 0 - 9832 0 NS NS 0.000000 25.0000 0 - 9833 0 NS NS 0.000000 25.0000 0 - 9834 0 NS NS 0.000000 25.0000 0 - 9835 0 NS NS 0.000000 25.0000 0 - 9836 0 NS NS 0.000000 25.0000 0 - 9837 0 NS NS 0.000000 25.0000 0 - 9838 0 NS NS 0.000000 25.0000 0 - 9839 0 NS NS 0.000000 25.0000 0 - 9840 0 NS NS 0.000000 25.0000 0 - 9841 0 NS NS 0.000000 25.0000 0 - 9842 0 NS NS 0.000000 25.0000 0 - 9843 0 NS NS 0.000000 25.0000 0 - 9844 0 NS NS 0.000000 25.0000 0 - 9845 0 NS NS 0.000000 25.0000 0 - 9846 0 NS NS 0.000000 25.0000 0 - 9847 0 NS NS 0.000000 25.0000 0 - 9848 0 NS NS 0.000000 25.0000 0 - 9849 0 NS NS 0.000000 25.0000 0 - 9850 0 NS NS 0.000000 25.0000 0 - 9851 0 NS NS 0.000000 25.0000 0 - 9852 0 NS NS 0.000000 25.0000 0 - 9853 0 NS NS 0.000000 25.0000 0 - 9854 0 NS NS 0.000000 25.0000 0 - 9855 0 NS NS 0.000000 25.0000 0 - 9856 0 NS NS 0.000000 25.0000 0 - 9857 0 NS NS 0.000000 25.0000 0 - 9858 0 NS NS 0.000000 25.0000 0 - 9859 0 NS NS 0.000000 25.0000 0 - 9860 0 NS NS 0.000000 25.0000 0 - 9861 0 NS NS 0.000000 25.0000 0 - 9862 0 NS NS 0.000000 25.0000 0 - 9863 0 NS NS 0.000000 25.0000 0 - 9864 0 NS NS 0.000000 25.0000 0 - 9865 0 NS NS 0.000000 25.0000 0 - 9866 0 NS NS 0.000000 25.0000 0 - 9867 0 NS NS 0.000000 25.0000 0 - 9868 0 NS NS 0.000000 25.0000 0 - 9869 0 NS NS 0.000000 25.0000 0 - 9870 0 NS NS 0.000000 25.0000 0 - 9871 0 NS NS 0.000000 25.0000 0 - 9872 0 NS NS 0.000000 25.0000 0 - 9873 0 NS NS 0.000000 25.0000 0 - 9874 0 NS NS 0.000000 25.0000 0 - 9875 0 NS NS 0.000000 25.0000 0 - 9876 0 NS NS 0.000000 25.0000 0 - 9877 0 NS NS 0.000000 25.0000 0 - 9878 0 NS NS 0.000000 25.0000 0 - 9879 0 NS NS 0.000000 25.0000 0 - 9880 0 NS NS 0.000000 25.0000 0 - 9881 0 NS NS 0.000000 25.0000 0 - 9882 0 NS NS 0.000000 25.0000 0 - 9883 0 NS NS 0.000000 25.0000 0 - 9884 0 NS NS 0.000000 25.0000 0 - 9885 0 NS NS 0.000000 25.0000 0 - 9886 0 NS NS 0.000000 25.0000 0 - 9887 0 NS NS 0.000000 25.0000 0 - 9888 0 NS NS 0.000000 25.0000 0 - 9889 0 NS NS 0.000000 25.0000 0 - 9890 0 NS NS 0.000000 25.0000 0 - 9891 0 NS NS 0.000000 25.0000 0 - 9892 0 NS NS 0.000000 25.0000 0 - 9893 0 NS NS 0.000000 25.0000 0 - 9894 0 NS NS 0.000000 25.0000 0 - 9895 0 NS NS 0.000000 25.0000 0 - 9896 0 NS NS 0.000000 25.0000 0 - 9897 0 NS NS 0.000000 25.0000 0 - 9898 0 NS NS 0.000000 25.0000 0 - 9899 0 NS NS 0.000000 25.0000 0 - 9900 0 NS NS 0.000000 25.0000 0 - 9901 0 NS NS 0.000000 25.0000 0 - 9902 0 NS NS 0.000000 25.0000 0 - 9903 0 NS NS 0.000000 25.0000 0 - 9904 0 NS NS 0.000000 25.0000 0 - 9905 0 NS NS 0.000000 25.0000 0 - 9906 0 NS NS 0.000000 25.0000 0 - 9907 0 NS NS 0.000000 25.0000 0 - 9908 0 NS NS 0.000000 25.0000 0 - 9909 0 NS NS 0.000000 25.0000 0 - 9910 0 NS NS 0.000000 25.0000 0 - 9911 0 NS NS 0.000000 25.0000 0 - 9912 0 NS NS 0.000000 25.0000 0 - 9913 0 NS NS 0.000000 25.0000 0 - 9914 0 NS NS 0.000000 25.0000 0 - 9915 0 NS NS 0.000000 25.0000 0 - 9916 0 NS NS 0.000000 25.0000 0 - 9917 0 NS NS 0.000000 25.0000 0 - 9918 0 NS NS 0.000000 25.0000 0 - 9919 0 NS NS 0.000000 25.0000 0 - 9920 0 NS NS 0.000000 25.0000 0 - 9921 0 NS NS 0.000000 25.0000 0 - 9922 0 NS NS 0.000000 25.0000 0 - 9923 0 NS NS 0.000000 25.0000 0 - 9924 0 NS NS 0.000000 25.0000 0 - 9925 0 NS NS 0.000000 25.0000 0 - 9926 0 NS NS 0.000000 25.0000 0 - 9927 0 NS NS 0.000000 25.0000 0 - 9928 0 NS NS 0.000000 25.0000 0 - 9929 0 NS NS 0.000000 25.0000 0 - 9930 0 NS NS 0.000000 25.0000 0 - 9931 0 NS NS 0.000000 25.0000 0 - 9932 0 NS NS 0.000000 25.0000 0 - 9933 0 NS NS 0.000000 25.0000 0 - 9934 0 NS NS 0.000000 25.0000 0 - 9935 0 NS NS 0.000000 25.0000 0 - 9936 0 NS NS 0.000000 25.0000 0 - 9937 0 NS NS 0.000000 25.0000 0 - 9938 0 NS NS 0.000000 25.0000 0 - 9939 0 NS NS 0.000000 25.0000 0 - 9940 0 NS NS 0.000000 25.0000 0 - 9941 0 NS NS 0.000000 25.0000 0 - 9942 0 NS NS 0.000000 25.0000 0 - 9943 0 NS NS 0.000000 25.0000 0 - 9944 0 NS NS 0.000000 25.0000 0 - 9945 0 NS NS 0.000000 25.0000 0 - 9946 0 NS NS 0.000000 25.0000 0 - 9947 0 NS NS 0.000000 25.0000 0 - 9948 0 NS NS 0.000000 25.0000 0 - 9949 0 NS NS 0.000000 25.0000 0 - 9950 0 NS NS 0.000000 25.0000 0 - 9951 0 NS NS 0.000000 25.0000 0 - 9952 0 NS NS 0.000000 25.0000 0 - 9953 0 NS NS 0.000000 25.0000 0 - 9954 0 NS NS 0.000000 25.0000 0 - 9955 0 NS NS 0.000000 25.0000 0 - 9956 0 NS NS 0.000000 25.0000 0 - 9957 0 NS NS 0.000000 25.0000 0 - 9958 0 NS NS 0.000000 25.0000 0 - 9959 0 NS NS 0.000000 25.0000 0 - 9960 0 NS NS 0.000000 25.0000 0 - 9961 0 NS NS 0.000000 25.0000 0 - 9962 0 NS NS 0.000000 25.0000 0 - 9963 0 NS NS 0.000000 25.0000 0 - 9964 0 NS NS 0.000000 25.0000 0 - 9965 0 NS NS 0.000000 25.0000 0 - 9966 0 NS NS 0.000000 25.0000 0 - 9967 0 NS NS 0.000000 25.0000 0 - 9968 0 NS NS 0.000000 25.0000 0 - 9969 0 NS NS 0.000000 25.0000 0 - 9970 0 NS NS 0.000000 25.0000 0 - 9971 0 NS NS 0.000000 25.0000 0 - 9972 0 NS NS 0.000000 25.0000 0 - 9973 0 NS NS 0.000000 25.0000 0 - 9974 0 NS NS 0.000000 25.0000 0 - 9975 0 NS NS 0.000000 25.0000 0 - 9976 0 NS NS 0.000000 25.0000 0 - 9977 0 NS NS 0.000000 25.0000 0 - 9978 0 NS NS 0.000000 25.0000 0 - 9979 0 NS NS 0.000000 25.0000 0 - 9980 0 NS NS 0.000000 25.0000 0 - 9981 0 NS NS 0.000000 25.0000 0 - 9982 0 NS NS 0.000000 25.0000 0 - 9983 0 NS NS 0.000000 25.0000 0 - 9984 0 NS NS 0.000000 25.0000 0 - 9985 0 NS NS 0.000000 25.0000 0 - 9986 0 NS NS 0.000000 25.0000 0 - 9987 0 NS NS 0.000000 25.0000 0 - 9988 0 NS NS 0.000000 25.0000 0 - 9989 0 NS NS 0.000000 25.0000 0 - 9990 0 NS NS 0.000000 25.0000 0 - 9991 0 NS NS 0.000000 25.0000 0 - 9992 0 NS NS 0.000000 25.0000 0 - 9993 0 NS NS 0.000000 25.0000 0 - 9994 0 NS NS 0.000000 25.0000 0 - 9995 0 NS NS 0.000000 25.0000 0 - 9996 0 NS NS 0.000000 25.0000 0 - 9997 0 NS NS 0.000000 25.0000 0 - 9998 0 NS NS 0.000000 25.0000 0 - 9999 0 NS NS 0.000000 25.0000 0 - 10000 0 NS NS 0.000000 25.0000 0 - 10001 0 NS NS 0.000000 25.0000 0 - 10002 0 NS NS 0.000000 25.0000 0 - 10003 0 NS NS 0.000000 25.0000 0 - 10004 0 NS NS 0.000000 25.0000 0 - 10005 0 NS NS 0.000000 25.0000 0 - 10006 0 NS NS 0.000000 25.0000 0 - 10007 0 NS NS 0.000000 25.0000 0 - 10008 0 NS NS 0.000000 25.0000 0 - 10009 0 NS NS 0.000000 25.0000 0 - 10010 0 NS NS 0.000000 25.0000 0 - 10011 0 NS NS 0.000000 25.0000 0 - 10012 0 NS NS 0.000000 25.0000 0 - 10013 0 NS NS 0.000000 25.0000 0 - 10014 0 NS NS 0.000000 25.0000 0 - 10015 0 NS NS 0.000000 25.0000 0 - 10016 0 NS NS 0.000000 25.0000 0 - 10017 0 NS NS 0.000000 25.0000 0 - 10018 0 NS NS 0.000000 25.0000 0 - 10019 0 NS NS 0.000000 25.0000 0 - 10020 0 NS NS 0.000000 25.0000 0 - 10021 0 NS NS 0.000000 25.0000 0 - 10022 0 NS NS 0.000000 25.0000 0 - 10023 0 NS NS 0.000000 25.0000 0 - 10024 0 NS NS 0.000000 25.0000 0 - 10025 0 NS NS 0.000000 25.0000 0 - 10026 0 NS NS 0.000000 25.0000 0 - 10027 0 NS NS 0.000000 25.0000 0 - 10028 0 NS NS 0.000000 25.0000 0 - 10029 0 NS NS 0.000000 25.0000 0 - 10030 0 NS NS 0.000000 25.0000 0 - 10031 0 NS NS 0.000000 25.0000 0 - 10032 0 NS NS 0.000000 25.0000 0 - 10033 0 NS NS 0.000000 25.0000 0 - 10034 0 NS NS 0.000000 25.0000 0 - 10035 0 NS NS 0.000000 25.0000 0 - 10036 0 NS NS 0.000000 25.0000 0 - 10037 0 NS NS 0.000000 25.0000 0 - 10038 0 NS NS 0.000000 25.0000 0 - 10039 0 NS NS 0.000000 25.0000 0 - 10040 0 NS NS 0.000000 25.0000 0 - 10041 0 NS NS 0.000000 25.0000 0 - 10042 0 NS NS 0.000000 25.0000 0 - 10043 0 NS NS 0.000000 25.0000 0 - 10044 0 NS NS 0.000000 25.0000 0 - 10045 0 NS NS 0.000000 25.0000 0 - 10046 0 NS NS 0.000000 25.0000 0 - 10047 0 NS NS 0.000000 25.0000 0 - 10048 0 NS NS 0.000000 25.0000 0 - 10049 0 NS NS 0.000000 25.0000 0 - 10050 0 NS NS 0.000000 25.0000 0 - 10051 0 NS NS 0.000000 25.0000 0 - 10052 0 NS NS 0.000000 25.0000 0 - 10053 0 NS NS 0.000000 25.0000 0 - 10054 0 NS NS 0.000000 25.0000 0 - 10055 0 NS NS 0.000000 25.0000 0 - 10056 0 NS NS 0.000000 25.0000 0 - 10057 0 NS NS 0.000000 25.0000 0 - 10058 0 NS NS 0.000000 25.0000 0 - 10059 0 NS NS 0.000000 25.0000 0 - 10060 0 NS NS 0.000000 25.0000 0 - 10061 0 NS NS 0.000000 25.0000 0 - 10062 0 NS NS 0.000000 25.0000 0 - 10063 0 NS NS 0.000000 25.0000 0 - 10064 0 NS NS 0.000000 25.0000 0 - 10065 0 NS NS 0.000000 25.0000 0 - 10066 0 NS NS 0.000000 25.0000 0 - 10067 0 NS NS 0.000000 25.0000 0 - 10068 0 NS NS 0.000000 25.0000 0 - 10069 0 NS NS 0.000000 25.0000 0 - 10070 0 NS NS 0.000000 25.0000 0 - 10071 0 NS NS 0.000000 25.0000 0 - 10072 0 NS NS 0.000000 25.0000 0 - 10073 0 NS NS 0.000000 25.0000 0 - 10074 0 NS NS 0.000000 25.0000 0 - 10075 0 NS NS 0.000000 25.0000 0 - 10076 0 NS NS 0.000000 25.0000 0 - 10077 0 NS NS 0.000000 25.0000 0 - 10078 0 NS NS 0.000000 25.0000 0 - 10079 0 NS NS 0.000000 25.0000 0 - 10080 0 NS NS 0.000000 25.0000 0 - 10081 0 NS NS 0.000000 25.0000 0 - 10082 0 NS NS 0.000000 25.0000 0 - 10083 0 NS NS 0.000000 25.0000 0 - 10084 0 NS NS 0.000000 25.0000 0 - 10085 0 NS NS 0.000000 25.0000 0 - 10086 0 NS NS 0.000000 25.0000 0 - 10087 0 NS NS 0.000000 25.0000 0 - 10088 0 NS NS 0.000000 25.0000 0 - 10089 0 NS NS 0.000000 25.0000 0 - 10090 0 NS NS 0.000000 25.0000 0 - 10091 0 NS NS 0.000000 25.0000 0 - 10092 0 NS NS 0.000000 25.0000 0 - 10093 0 NS NS 0.000000 25.0000 0 - 10094 0 NS NS 0.000000 25.0000 0 - 10095 0 NS NS 0.000000 25.0000 0 - 10096 0 NS NS 0.000000 25.0000 0 - 10097 0 NS NS 0.000000 25.0000 0 - 10098 0 NS NS 0.000000 25.0000 0 - 10099 0 NS NS 0.000000 25.0000 0 - 10100 0 NS NS 0.000000 25.0000 0 - 10101 0 NS NS 0.000000 25.0000 0 - 10102 0 NS NS 0.000000 25.0000 0 - 10103 0 NS NS 0.000000 25.0000 0 - 10104 0 NS NS 0.000000 25.0000 0 - 10105 0 NS NS 0.000000 25.0000 0 - 10106 0 NS NS 0.000000 25.0000 0 - 10107 0 NS NS 0.000000 25.0000 0 - 10108 0 NS NS 0.000000 25.0000 0 - 10109 0 NS NS 0.000000 25.0000 0 - 10110 0 NS NS 0.000000 25.0000 0 - 10111 0 NS NS 0.000000 25.0000 0 - 10112 0 NS NS 0.000000 25.0000 0 - 10113 0 NS NS 0.000000 25.0000 0 - 10114 0 NS NS 0.000000 25.0000 0 - 10115 0 NS NS 0.000000 25.0000 0 - 10116 0 NS NS 0.000000 25.0000 0 - 10117 0 NS NS 0.000000 25.0000 0 - 10118 0 NS NS 0.000000 25.0000 0 - 10119 0 NS NS 0.000000 25.0000 0 - 10120 0 NS NS 0.000000 25.0000 0 - 10121 0 NS NS 0.000000 25.0000 0 - 10122 0 NS NS 0.000000 25.0000 0 - 10123 0 NS NS 0.000000 25.0000 0 - 10124 0 NS NS 0.000000 25.0000 0 - 10125 0 NS NS 0.000000 25.0000 0 - 10126 0 NS NS 0.000000 25.0000 0 - 10127 0 NS NS 0.000000 25.0000 0 - 10128 0 NS NS 0.000000 25.0000 0 - 10129 0 NS NS 0.000000 25.0000 0 - 10130 0 NS NS 0.000000 25.0000 0 - 10131 0 NS NS 0.000000 25.0000 0 - 10132 0 NS NS 0.000000 25.0000 0 - 10133 0 NS NS 0.000000 25.0000 0 - 10134 0 NS NS 0.000000 25.0000 0 - 10135 0 NS NS 0.000000 25.0000 0 - 10136 0 NS NS 0.000000 25.0000 0 - 10137 0 NS NS 0.000000 25.0000 0 - 10138 0 NS NS 0.000000 25.0000 0 - 10139 0 NS NS 0.000000 25.0000 0 - 10140 0 NS NS 0.000000 25.0000 0 - 10141 0 NS NS 0.000000 25.0000 0 - 10142 0 NS NS 0.000000 25.0000 0 - 10143 0 NS NS 0.000000 25.0000 0 - 10144 0 NS NS 0.000000 25.0000 0 - 10145 0 NS NS 0.000000 25.0000 0 - 10146 0 NS NS 0.000000 25.0000 0 - 10147 0 NS NS 0.000000 25.0000 0 - 10148 0 NS NS 0.000000 25.0000 0 - 10149 0 NS NS 0.000000 25.0000 0 - 10150 0 NS NS 0.000000 25.0000 0 - 10151 0 NS NS 0.000000 25.0000 0 - 10152 0 NS NS 0.000000 25.0000 0 - 10153 0 NS NS 0.000000 25.0000 0 - 10154 0 NS NS 0.000000 25.0000 0 - 10155 0 NS NS 0.000000 25.0000 0 - 10156 0 NS NS 0.000000 25.0000 0 - 10157 0 NS NS 0.000000 25.0000 0 - 10158 0 NS NS 0.000000 25.0000 0 - 10159 0 NS NS 0.000000 25.0000 0 - 10160 0 NS NS 0.000000 25.0000 0 - 10161 0 NS NS 0.000000 25.0000 0 - 10162 0 NS NS 0.000000 25.0000 0 - 10163 0 NS NS 0.000000 25.0000 0 - 10164 0 NS NS 0.000000 25.0000 0 - 10165 0 NS NS 0.000000 25.0000 0 - 10166 0 NS NS 0.000000 25.0000 0 - 10167 0 NS NS 0.000000 25.0000 0 - 10168 0 NS NS 0.000000 25.0000 0 - 10169 0 NS NS 0.000000 25.0000 0 - 10170 0 NS NS 0.000000 25.0000 0 - 10171 0 NS NS 0.000000 25.0000 0 - 10172 0 NS NS 0.000000 25.0000 0 - 10173 0 NS NS 0.000000 25.0000 0 - 10174 0 NS NS 0.000000 25.0000 0 - 10175 0 NS NS 0.000000 25.0000 0 - 10176 0 NS NS 0.000000 25.0000 0 - 10177 0 NS NS 0.000000 25.0000 0 - 10178 0 NS NS 0.000000 25.0000 0 - 10179 0 NS NS 0.000000 25.0000 0 - 10180 0 NS NS 0.000000 25.0000 0 - 10181 0 NS NS 0.000000 25.0000 0 - 10182 0 NS NS 0.000000 25.0000 0 - 10183 0 NS NS 0.000000 25.0000 0 - 10184 0 NS NS 0.000000 25.0000 0 - 10185 0 NS NS 0.000000 25.0000 0 - 10186 0 NS NS 0.000000 25.0000 0 - 10187 0 NS NS 0.000000 25.0000 0 - 10188 0 NS NS 0.000000 25.0000 0 - 10189 0 NS NS 0.000000 25.0000 0 - 10190 0 NS NS 0.000000 25.0000 0 - 10191 0 NS NS 0.000000 25.0000 0 - 10192 0 NS NS 0.000000 25.0000 0 - 10193 0 NS NS 0.000000 25.0000 0 - 10194 0 NS NS 0.000000 25.0000 0 - 10195 0 NS NS 0.000000 25.0000 0 - 10196 0 NS NS 0.000000 25.0000 0 - 10197 0 NS NS 0.000000 25.0000 0 - 10198 0 NS NS 0.000000 25.0000 0 - 10199 0 NS NS 0.000000 25.0000 0 - 10200 0 NS NS 0.000000 25.0000 0 - 10201 0 NS NS 0.000000 25.0000 0 - 10202 0 NS NS 0.000000 25.0000 0 - 10203 0 NS NS 0.000000 25.0000 0 - 10204 0 NS NS 0.000000 25.0000 0 - 10205 0 NS NS 0.000000 25.0000 0 - 10206 0 NS NS 0.000000 25.0000 0 - 10207 0 NS NS 0.000000 25.0000 0 - 10208 0 NS NS 0.000000 25.0000 0 - 10209 0 NS NS 0.000000 25.0000 0 - 10210 0 NS NS 0.000000 25.0000 0 - 10211 0 NS NS 0.000000 25.0000 0 - 10212 0 NS NS 0.000000 25.0000 0 - 10213 0 NS NS 0.000000 25.0000 0 - 10214 0 NS NS 0.000000 25.0000 0 - 10215 0 NS NS 0.000000 25.0000 0 - 10216 0 NS NS 0.000000 25.0000 0 - 10217 0 NS NS 0.000000 25.0000 0 - 10218 0 NS NS 0.000000 25.0000 0 - 10219 0 NS NS 0.000000 25.0000 0 - 10220 0 NS NS 0.000000 25.0000 0 - 10221 0 NS NS 0.000000 25.0000 0 - 10222 0 NS NS 0.000000 25.0000 0 - 10223 0 NS NS 0.000000 25.0000 0 - 10224 0 NS NS 0.000000 25.0000 0 - 10225 0 NS NS 0.000000 25.0000 0 - 10226 0 NS NS 0.000000 25.0000 0 - 10227 0 NS NS 0.000000 25.0000 0 - 10228 0 NS NS 0.000000 25.0000 0 - 10229 0 NS NS 0.000000 25.0000 0 - 10230 0 NS NS 0.000000 25.0000 0 - 10231 0 NS NS 0.000000 25.0000 0 - 10232 0 NS NS 0.000000 25.0000 0 - 10233 0 NS NS 0.000000 25.0000 0 - 10234 0 NS NS 0.000000 25.0000 0 - 10235 0 NS NS 0.000000 25.0000 0 - 10236 0 NS NS 0.000000 25.0000 0 - 10237 0 NS NS 0.000000 25.0000 0 - 10238 0 NS NS 0.000000 25.0000 0 - 10239 0 NS NS 0.000000 25.0000 0 - 10240 0 NS NS 0.000000 25.0000 0 - 10241 0 NS NS 0.000000 25.0000 0 - 10242 0 NS NS 0.000000 25.0000 0 - 10243 0 NS NS 0.000000 25.0000 0 - 10244 0 NS NS 0.000000 25.0000 0 - 10245 0 NS NS 0.000000 25.0000 0 - 10246 0 NS NS 0.000000 25.0000 0 - 10247 0 NS NS 0.000000 25.0000 0 - 10248 0 NS NS 0.000000 25.0000 0 - 10249 0 NS NS 0.000000 25.0000 0 - 10250 0 NS NS 0.000000 25.0000 0 - 10251 0 NS NS 0.000000 25.0000 0 - 10252 0 NS NS 0.000000 25.0000 0 - 10253 0 NS NS 0.000000 25.0000 0 - 10254 0 NS NS 0.000000 25.0000 0 - 10255 0 NS NS 0.000000 25.0000 0 - 10256 0 NS NS 0.000000 25.0000 0 - 10257 0 NS NS 0.000000 25.0000 0 - 10258 0 NS NS 0.000000 25.0000 0 - 10259 0 NS NS 0.000000 25.0000 0 - 10260 0 NS NS 0.000000 25.0000 0 - 10261 0 NS NS 0.000000 25.0000 0 - 10262 0 NS NS 0.000000 25.0000 0 - 10263 0 NS NS 0.000000 25.0000 0 - 10264 0 NS NS 0.000000 25.0000 0 - 10265 0 NS NS 0.000000 25.0000 0 - 10266 0 NS NS 0.000000 25.0000 0 - 10267 0 NS NS 0.000000 25.0000 0 - 10268 0 NS NS 0.000000 25.0000 0 - 10269 0 NS NS 0.000000 25.0000 0 - 10270 0 NS NS 0.000000 25.0000 0 - 10271 0 NS NS 0.000000 25.0000 0 - 10272 0 NS NS 0.000000 25.0000 0 - 10273 0 NS NS 0.000000 25.0000 0 - 10274 0 NS NS 0.000000 25.0000 0 - 10275 0 NS NS 0.000000 25.0000 0 - 10276 0 NS NS 0.000000 25.0000 0 - 10277 0 NS NS 0.000000 25.0000 0 - 10278 0 NS NS 0.000000 25.0000 0 - 10279 0 NS NS 0.000000 25.0000 0 - 10280 0 NS NS 0.000000 25.0000 0 - 10281 0 NS NS 0.000000 25.0000 0 - 10282 0 NS NS 0.000000 25.0000 0 - 10283 0 NS NS 0.000000 25.0000 0 - 10284 0 NS NS 0.000000 25.0000 0 - 10285 0 NS NS 0.000000 25.0000 0 - 10286 0 NS NS 0.000000 25.0000 0 - 10287 0 NS NS 0.000000 25.0000 0 - 10288 0 NS NS 0.000000 25.0000 0 - 10289 0 NS NS 0.000000 25.0000 0 - 10290 0 NS NS 0.000000 25.0000 0 - 10291 0 NS NS 0.000000 25.0000 0 - 10292 0 NS NS 0.000000 25.0000 0 - 10293 0 NS NS 0.000000 25.0000 0 - 10294 0 NS NS 0.000000 25.0000 0 - 10295 0 NS NS 0.000000 25.0000 0 - 10296 0 NS NS 0.000000 25.0000 0 - 10297 0 NS NS 0.000000 25.0000 0 - 10298 0 NS NS 0.000000 25.0000 0 - 10299 0 NS NS 0.000000 25.0000 0 - 10300 0 NS NS 0.000000 25.0000 0 - 10301 0 NS NS 0.000000 25.0000 0 - 10302 0 NS NS 0.000000 25.0000 0 - 10303 0 NS NS 0.000000 25.0000 0 - 10304 0 NS NS 0.000000 25.0000 0 - 10305 0 NS NS 0.000000 25.0000 0 - 10306 0 NS NS 0.000000 25.0000 0 - 10307 0 NS NS 0.000000 25.0000 0 - 10308 0 NS NS 0.000000 25.0000 0 - 10309 0 NS NS 0.000000 25.0000 0 - 10310 0 NS NS 0.000000 25.0000 0 - 10311 0 NS NS 0.000000 25.0000 0 - 10312 0 NS NS 0.000000 25.0000 0 - 10313 0 NS NS 0.000000 25.0000 0 - 10314 0 NS NS 0.000000 25.0000 0 - 10315 0 NS NS 0.000000 25.0000 0 - 10316 0 NS NS 0.000000 25.0000 0 - 10317 0 NS NS 0.000000 25.0000 0 - 10318 0 NS NS 0.000000 25.0000 0 - 10319 0 NS NS 0.000000 25.0000 0 - 10320 0 NS NS 0.000000 25.0000 0 - 10321 0 NS NS 0.000000 25.0000 0 - 10322 0 NS NS 0.000000 25.0000 0 - 10323 0 NS NS 0.000000 25.0000 0 - 10324 0 NS NS 0.000000 25.0000 0 - 10325 0 NS NS 0.000000 25.0000 0 - 10326 0 NS NS 0.000000 25.0000 0 - 10327 0 NS NS 0.000000 25.0000 0 - 10328 0 NS NS 0.000000 25.0000 0 - 10329 0 NS NS 0.000000 25.0000 0 - 10330 0 NS NS 0.000000 25.0000 0 - 10331 0 NS NS 0.000000 25.0000 0 - 10332 0 NS NS 0.000000 25.0000 0 - 10333 0 NS NS 0.000000 25.0000 0 - 10334 0 NS NS 0.000000 25.0000 0 - 10335 0 NS NS 0.000000 25.0000 0 - 10336 0 NS NS 0.000000 25.0000 0 - 10337 0 NS NS 0.000000 25.0000 0 - 10338 0 NS NS 0.000000 25.0000 0 - 10339 0 NS NS 0.000000 25.0000 0 - 10340 0 NS NS 0.000000 25.0000 0 - 10341 0 NS NS 0.000000 25.0000 0 - 10342 0 NS NS 0.000000 25.0000 0 - 10343 0 NS NS 0.000000 25.0000 0 - 10344 0 NS NS 0.000000 25.0000 0 - 10345 0 NS NS 0.000000 25.0000 0 - 10346 0 NS NS 0.000000 25.0000 0 - 10347 0 NS NS 0.000000 25.0000 0 - 10348 0 NS NS 0.000000 25.0000 0 - 10349 0 NS NS 0.000000 25.0000 0 - 10350 0 NS NS 0.000000 25.0000 0 - 10351 0 NS NS 0.000000 25.0000 0 - 10352 0 NS NS 0.000000 25.0000 0 - 10353 0 NS NS 0.000000 25.0000 0 - 10354 0 NS NS 0.000000 25.0000 0 - 10355 0 NS NS 0.000000 25.0000 0 - 10356 0 NS NS 0.000000 25.0000 0 - 10357 0 NS NS 0.000000 25.0000 0 - 10358 0 NS NS 0.000000 25.0000 0 - 10359 0 NS NS 0.000000 25.0000 0 - 10360 0 NS NS 0.000000 25.0000 0 - 10361 0 NS NS 0.000000 25.0000 0 - 10362 0 NS NS 0.000000 25.0000 0 - 10363 0 NS NS 0.000000 25.0000 0 - 10364 0 NS NS 0.000000 25.0000 0 - 10365 0 NS NS 0.000000 25.0000 0 - 10366 0 NS NS 0.000000 25.0000 0 - 10367 0 NS NS 0.000000 25.0000 0 - 10368 0 NS NS 0.000000 25.0000 0 - 10369 0 NS NS 0.000000 25.0000 0 - 10370 0 NS NS 0.000000 25.0000 0 - 10371 0 NS NS 0.000000 25.0000 0 - 10372 0 NS NS 0.000000 25.0000 0 - 10373 0 NS NS 0.000000 25.0000 0 - 10374 0 NS NS 0.000000 25.0000 0 - 10375 0 NS NS 0.000000 25.0000 0 - 10376 0 NS NS 0.000000 25.0000 0 - 10377 0 NS NS 0.000000 25.0000 0 - 10378 0 NS NS 0.000000 25.0000 0 - 10379 0 NS NS 0.000000 25.0000 0 - 10380 0 NS NS 0.000000 25.0000 0 - 10381 0 NS NS 0.000000 25.0000 0 - 10382 0 NS NS 0.000000 25.0000 0 - 10383 0 NS NS 0.000000 25.0000 0 - 10384 0 NS NS 0.000000 25.0000 0 - 10385 0 NS NS 0.000000 25.0000 0 - 10386 0 NS NS 0.000000 25.0000 0 - 10387 0 NS NS 0.000000 25.0000 0 - 10388 0 NS NS 0.000000 25.0000 0 - 10389 0 NS NS 0.000000 25.0000 0 - 10390 0 NS NS 0.000000 25.0000 0 - 10391 0 NS NS 0.000000 25.0000 0 - 10392 0 NS NS 0.000000 25.0000 0 - 10393 0 NS NS 0.000000 25.0000 0 - 10394 0 NS NS 0.000000 25.0000 0 - 10395 0 NS NS 0.000000 25.0000 0 - 10396 0 NS NS 0.000000 25.0000 0 - 10397 0 NS NS 0.000000 25.0000 0 - 10398 0 NS NS 0.000000 25.0000 0 - 10399 0 NS NS 0.000000 25.0000 0 - 10400 0 NS NS 0.000000 25.0000 0 - 10401 0 NS NS 0.000000 25.0000 0 - 10402 0 NS NS 0.000000 25.0000 0 - 10403 0 NS NS 0.000000 25.0000 0 - 10404 0 NS NS 0.000000 25.0000 0 - 10405 0 NS NS 0.000000 25.0000 0 - 10406 0 NS NS 0.000000 25.0000 0 - 10407 0 NS NS 0.000000 25.0000 0 - 10408 0 NS NS 0.000000 25.0000 0 - 10409 0 NS NS 0.000000 25.0000 0 - 10410 0 NS NS 0.000000 25.0000 0 - 10411 0 NS NS 0.000000 25.0000 0 - 10412 0 NS NS 0.000000 25.0000 0 - 10413 0 NS NS 0.000000 25.0000 0 - 10414 0 NS NS 0.000000 25.0000 0 - 10415 0 NS NS 0.000000 25.0000 0 - 10416 0 NS NS 0.000000 25.0000 0 - 10417 0 NS NS 0.000000 25.0000 0 - 10418 0 NS NS 0.000000 25.0000 0 - 10419 0 NS NS 0.000000 25.0000 0 - 10420 0 NS NS 0.000000 25.0000 0 - 10421 0 NS NS 0.000000 25.0000 0 - 10422 0 NS NS 0.000000 25.0000 0 - 10423 0 NS NS 0.000000 25.0000 0 - 10424 0 NS NS 0.000000 25.0000 0 - 10425 0 NS NS 0.000000 25.0000 0 - 10426 0 NS NS 0.000000 25.0000 0 - 10427 0 NS NS 0.000000 25.0000 0 - 10428 0 NS NS 0.000000 25.0000 0 - 10429 0 NS NS 0.000000 25.0000 0 - 10430 0 NS NS 0.000000 25.0000 0 - 10431 0 NS NS 0.000000 25.0000 0 - 10432 0 NS NS 0.000000 25.0000 0 - 10433 0 NS NS 0.000000 25.0000 0 - 10434 0 NS NS 0.000000 25.0000 0 - 10435 0 NS NS 0.000000 25.0000 0 - 10436 0 NS NS 0.000000 25.0000 0 - 10437 0 NS NS 0.000000 25.0000 0 - 10438 0 NS NS 0.000000 25.0000 0 - 10439 0 NS NS 0.000000 25.0000 0 - 10440 0 NS NS 0.000000 25.0000 0 - 10441 0 NS NS 0.000000 25.0000 0 - 10442 0 NS NS 0.000000 25.0000 0 - 10443 0 NS NS 0.000000 25.0000 0 - 10444 0 NS NS 0.000000 25.0000 0 - 10445 0 NS NS 0.000000 25.0000 0 - 10446 0 NS NS 0.000000 25.0000 0 - 10447 0 NS NS 0.000000 25.0000 0 - 10448 0 NS NS 0.000000 25.0000 0 - 10449 0 NS NS 0.000000 25.0000 0 - 10450 0 NS NS 0.000000 25.0000 0 - 10451 0 NS NS 0.000000 25.0000 0 - 10452 0 NS NS 0.000000 25.0000 0 - 10453 0 NS NS 0.000000 25.0000 0 - 10454 0 NS NS 0.000000 25.0000 0 - 10455 0 NS NS 0.000000 25.0000 0 - 10456 0 NS NS 0.000000 25.0000 0 - 10457 0 NS NS 0.000000 25.0000 0 - 10458 0 NS NS 0.000000 25.0000 0 - 10459 0 NS NS 0.000000 25.0000 0 - 10460 0 NS NS 0.000000 25.0000 0 - 10461 0 NS NS 0.000000 25.0000 0 - 10462 0 NS NS 0.000000 25.0000 0 - 10463 0 NS NS 0.000000 25.0000 0 - 10464 0 NS NS 0.000000 25.0000 0 - 10465 0 NS NS 0.000000 25.0000 0 - 10466 0 NS NS 0.000000 25.0000 0 - 10467 0 NS NS 0.000000 25.0000 0 - 10468 0 NS NS 0.000000 25.0000 0 - 10469 0 NS NS 0.000000 25.0000 0 - 10470 0 NS NS 0.000000 25.0000 0 - 10471 0 NS NS 0.000000 25.0000 0 - 10472 0 NS NS 0.000000 25.0000 0 - 10473 0 NS NS 0.000000 25.0000 0 - 10474 0 NS NS 0.000000 25.0000 0 - 10475 0 NS NS 0.000000 25.0000 0 - 10476 0 NS NS 0.000000 25.0000 0 - 10477 0 NS NS 0.000000 25.0000 0 - 10478 0 NS NS 0.000000 25.0000 0 - 10479 0 NS NS 0.000000 25.0000 0 - 10480 0 NS NS 0.000000 25.0000 0 - 10481 0 NS NS 0.000000 25.0000 0 - 10482 0 NS NS 0.000000 25.0000 0 - 10483 0 NS NS 0.000000 25.0000 0 - 10484 0 NS NS 0.000000 25.0000 0 - 10485 0 NS NS 0.000000 25.0000 0 - 10486 0 NS NS 0.000000 25.0000 0 - 10487 0 NS NS 0.000000 25.0000 0 - 10488 0 NS NS 0.000000 25.0000 0 - 10489 0 NS NS 0.000000 25.0000 0 - 10490 0 NS NS 0.000000 25.0000 0 - 10491 0 NS NS 0.000000 25.0000 0 - 10492 0 NS NS 0.000000 25.0000 0 - 10493 0 NS NS 0.000000 25.0000 0 - 10494 0 NS NS 0.000000 25.0000 0 - 10495 0 NS NS 0.000000 25.0000 0 - 10496 0 NS NS 0.000000 25.0000 0 - 10497 0 NS NS 0.000000 25.0000 0 - 10498 0 NS NS 0.000000 25.0000 0 - 10499 0 NS NS 0.000000 25.0000 0 - 10500 0 NS NS 0.000000 25.0000 0 - 10501 0 NS NS 0.000000 25.0000 0 - 10502 0 NS NS 0.000000 25.0000 0 - 10503 0 NS NS 0.000000 25.0000 0 - 10504 0 NS NS 0.000000 25.0000 0 - 10505 0 NS NS 0.000000 25.0000 0 - 10506 0 NS NS 0.000000 25.0000 0 - 10507 0 NS NS 0.000000 25.0000 0 - 10508 0 NS NS 0.000000 25.0000 0 - 10509 0 NS NS 0.000000 25.0000 0 - 10510 0 NS NS 0.000000 25.0000 0 - 10511 0 NS NS 0.000000 25.0000 0 - 10512 0 NS NS 0.000000 25.0000 0 - 10513 0 NS NS 0.000000 25.0000 0 - 10514 0 NS NS 0.000000 25.0000 0 - 10515 0 NS NS 0.000000 25.0000 0 - 10516 0 NS NS 0.000000 25.0000 0 - 10517 0 NS NS 0.000000 25.0000 0 - 10518 0 NS NS 0.000000 25.0000 0 - 10519 0 NS NS 0.000000 25.0000 0 - 10520 0 NS NS 0.000000 25.0000 0 - 10521 0 NS NS 0.000000 25.0000 0 - 10522 0 NS NS 0.000000 25.0000 0 - 10523 0 NS NS 0.000000 25.0000 0 - 10524 0 NS NS 0.000000 25.0000 0 - 10525 0 NS NS 0.000000 25.0000 0 - 10526 0 NS NS 0.000000 25.0000 0 - 10527 0 NS NS 0.000000 25.0000 0 - 10528 0 NS NS 0.000000 25.0000 0 - 10529 0 NS NS 0.000000 25.0000 0 - 10530 0 NS NS 0.000000 25.0000 0 - 10531 0 NS NS 0.000000 25.0000 0 - 10532 0 NS NS 0.000000 25.0000 0 - 10533 0 NS NS 0.000000 25.0000 0 - 10534 0 NS NS 0.000000 25.0000 0 - 10535 0 NS NS 0.000000 25.0000 0 - 10536 0 NS NS 0.000000 25.0000 0 - 10537 0 NS NS 0.000000 25.0000 0 - 10538 0 NS NS 0.000000 25.0000 0 - 10539 0 NS NS 0.000000 25.0000 0 - 10540 0 NS NS 0.000000 25.0000 0 - 10541 0 NS NS 0.000000 25.0000 0 - 10542 0 NS NS 0.000000 25.0000 0 - 10543 0 NS NS 0.000000 25.0000 0 - 10544 0 NS NS 0.000000 25.0000 0 - 10545 0 NS NS 0.000000 25.0000 0 - 10546 0 NS NS 0.000000 25.0000 0 - 10547 0 NS NS 0.000000 25.0000 0 - 10548 0 NS NS 0.000000 25.0000 0 - 10549 0 NS NS 0.000000 25.0000 0 - 10550 0 NS NS 0.000000 25.0000 0 - 10551 0 NS NS 0.000000 25.0000 0 - 10552 0 NS NS 0.000000 25.0000 0 - 10553 0 NS NS 0.000000 25.0000 0 - 10554 0 NS NS 0.000000 25.0000 0 - 10555 0 NS NS 0.000000 25.0000 0 - 10556 0 NS NS 0.000000 25.0000 0 - 10557 0 NS NS 0.000000 25.0000 0 - 10558 0 NS NS 0.000000 25.0000 0 - 10559 0 NS NS 0.000000 25.0000 0 - 10560 0 NS NS 0.000000 25.0000 0 - 10561 0 NS NS 0.000000 25.0000 0 - 10562 0 NS NS 0.000000 25.0000 0 - 10563 0 NS NS 0.000000 25.0000 0 - 10564 0 NS NS 0.000000 25.0000 0 - 10565 0 NS NS 0.000000 25.0000 0 - 10566 0 NS NS 0.000000 25.0000 0 - 10567 0 NS NS 0.000000 25.0000 0 - 10568 0 NS NS 0.000000 25.0000 0 - 10569 0 NS NS 0.000000 25.0000 0 - 10570 0 NS NS 0.000000 25.0000 0 - 10571 0 NS NS 0.000000 25.0000 0 - 10572 0 NS NS 0.000000 25.0000 0 - 10573 0 NS NS 0.000000 25.0000 0 - 10574 0 NS NS 0.000000 25.0000 0 - 10575 0 NS NS 0.000000 25.0000 0 - 10576 0 NS NS 0.000000 25.0000 0 - 10577 0 NS NS 0.000000 25.0000 0 - 10578 0 NS NS 0.000000 25.0000 0 - 10579 0 NS NS 0.000000 25.0000 0 - 10580 0 NS NS 0.000000 25.0000 0 - 10581 0 NS NS 0.000000 25.0000 0 - 10582 0 NS NS 0.000000 25.0000 0 - 10583 0 NS NS 0.000000 25.0000 0 - 10584 0 NS NS 0.000000 25.0000 0 - 10585 0 NS NS 0.000000 25.0000 0 - 10586 0 NS NS 0.000000 25.0000 0 - 10587 0 NS NS 0.000000 25.0000 0 - 10588 0 NS NS 0.000000 25.0000 0 - 10589 0 NS NS 0.000000 25.0000 0 - 10590 0 NS NS 0.000000 25.0000 0 - 10591 0 NS NS 0.000000 25.0000 0 - 10592 0 NS NS 0.000000 25.0000 0 - 10593 0 NS NS 0.000000 25.0000 0 - 10594 0 NS NS 0.000000 25.0000 0 - 10595 0 NS NS 0.000000 25.0000 0 - 10596 0 NS NS 0.000000 25.0000 0 - 10597 0 NS NS 0.000000 25.0000 0 - 10598 0 NS NS 0.000000 25.0000 0 - 10599 0 NS NS 0.000000 25.0000 0 - 10600 0 NS NS 0.000000 25.0000 0 - 10601 0 NS NS 0.000000 25.0000 0 - 10602 0 NS NS 0.000000 25.0000 0 - 10603 0 NS NS 0.000000 25.0000 0 - 10604 0 NS NS 0.000000 25.0000 0 - 10605 0 NS NS 0.000000 25.0000 0 - 10606 0 NS NS 0.000000 25.0000 0 - 10607 0 NS NS 0.000000 25.0000 0 - 10608 0 NS NS 0.000000 25.0000 0 - 10609 0 NS NS 0.000000 25.0000 0 - 10610 0 NS NS 0.000000 25.0000 0 - 10611 0 NS NS 0.000000 25.0000 0 - 10612 0 NS NS 0.000000 25.0000 0 - 10613 0 NS NS 0.000000 25.0000 0 - 10614 0 NS NS 0.000000 25.0000 0 - 10615 0 NS NS 0.000000 25.0000 0 - 10616 0 NS NS 0.000000 25.0000 0 - 10617 0 NS NS 0.000000 25.0000 0 - 10618 0 NS NS 0.000000 25.0000 0 - 10619 0 NS NS 0.000000 25.0000 0 - 10620 0 NS NS 0.000000 25.0000 0 - 10621 0 NS NS 0.000000 25.0000 0 - 10622 0 NS NS 0.000000 25.0000 0 - 10623 0 NS NS 0.000000 25.0000 0 - 10624 0 NS NS 0.000000 25.0000 0 - 10625 0 NS NS 0.000000 25.0000 0 - 10626 0 NS NS 0.000000 25.0000 0 - 10627 0 NS NS 0.000000 25.0000 0 - 10628 0 NS NS 0.000000 25.0000 0 - 10629 0 NS NS 0.000000 25.0000 0 - 10630 0 NS NS 0.000000 25.0000 0 - 10631 0 NS NS 0.000000 25.0000 0 - 10632 0 NS NS 0.000000 25.0000 0 - 10633 0 NS NS 0.000000 25.0000 0 - 10634 0 NS NS 0.000000 25.0000 0 - 10635 0 NS NS 0.000000 25.0000 0 - 10636 0 NS NS 0.000000 25.0000 0 - 10637 0 NS NS 0.000000 25.0000 0 - 10638 0 NS NS 0.000000 25.0000 0 - 10639 0 NS NS 0.000000 25.0000 0 - 10640 0 NS NS 0.000000 25.0000 0 - 10641 0 NS NS 0.000000 25.0000 0 - 10642 0 NS NS 0.000000 25.0000 0 - 10643 0 NS NS 0.000000 25.0000 0 - 10644 0 NS NS 0.000000 25.0000 0 - 10645 0 NS NS 0.000000 25.0000 0 - 10646 0 NS NS 0.000000 25.0000 0 - 10647 0 NS NS 0.000000 25.0000 0 - 10648 0 NS NS 0.000000 25.0000 0 - 10649 0 NS NS 0.000000 25.0000 0 - 10650 0 NS NS 0.000000 25.0000 0 - 10651 0 NS NS 0.000000 25.0000 0 - 10652 0 NS NS 0.000000 25.0000 0 - 10653 0 NS NS 0.000000 25.0000 0 - 10654 0 NS NS 0.000000 25.0000 0 - 10655 0 NS NS 0.000000 25.0000 0 - 10656 0 NS NS 0.000000 25.0000 0 - 10657 0 NS NS 0.000000 25.0000 0 - 10658 0 NS NS 0.000000 25.0000 0 - 10659 0 NS NS 0.000000 25.0000 0 - 10660 0 NS NS 0.000000 25.0000 0 - 10661 0 NS NS 0.000000 25.0000 0 - 10662 0 NS NS 0.000000 25.0000 0 - 10663 0 NS NS 0.000000 25.0000 0 - 10664 0 NS NS 0.000000 25.0000 0 - 10665 0 NS NS 0.000000 25.0000 0 - 10666 0 NS NS 0.000000 25.0000 0 - 10667 0 NS NS 0.000000 25.0000 0 - 10668 0 NS NS 0.000000 25.0000 0 - 10669 0 NS NS 0.000000 25.0000 0 - 10670 0 NS NS 0.000000 25.0000 0 - 10671 0 NS NS 0.000000 25.0000 0 - 10672 0 NS NS 0.000000 25.0000 0 - 10673 0 NS NS 0.000000 25.0000 0 - 10674 0 NS NS 0.000000 25.0000 0 - 10675 0 NS NS 0.000000 25.0000 0 - 10676 0 NS NS 0.000000 25.0000 0 - 10677 0 NS NS 0.000000 25.0000 0 - 10678 0 NS NS 0.000000 25.0000 0 - 10679 0 NS NS 0.000000 25.0000 0 - 10680 0 NS NS 0.000000 25.0000 0 - 10681 0 NS NS 0.000000 25.0000 0 - 10682 0 NS NS 0.000000 25.0000 0 - 10683 0 NS NS 0.000000 25.0000 0 - 10684 0 NS NS 0.000000 25.0000 0 - 10685 0 NS NS 0.000000 25.0000 0 - 10686 0 NS NS 0.000000 25.0000 0 - 10687 0 NS NS 0.000000 25.0000 0 - 10688 0 NS NS 0.000000 25.0000 0 - 10689 0 NS NS 0.000000 25.0000 0 - 10690 0 NS NS 0.000000 25.0000 0 - 10691 0 NS NS 0.000000 25.0000 0 - 10692 0 NS NS 0.000000 25.0000 0 - 10693 0 NS NS 0.000000 25.0000 0 - 10694 0 NS NS 0.000000 25.0000 0 - 10695 0 NS NS 0.000000 25.0000 0 - 10696 0 NS NS 0.000000 25.0000 0 - 10697 0 NS NS 0.000000 25.0000 0 - 10698 0 NS NS 0.000000 25.0000 0 - 10699 0 NS NS 0.000000 25.0000 0 - 10700 0 NS NS 0.000000 25.0000 0 - 10701 0 NS NS 0.000000 25.0000 0 - 10702 0 NS NS 0.000000 25.0000 0 - 10703 0 NS NS 0.000000 25.0000 0 - 10704 0 NS NS 0.000000 25.0000 0 - 10705 0 NS NS 0.000000 25.0000 0 - 10706 0 NS NS 0.000000 25.0000 0 - 10707 0 NS NS 0.000000 25.0000 0 - 10708 0 NS NS 0.000000 25.0000 0 - 10709 0 NS NS 0.000000 25.0000 0 - 10710 0 NS NS 0.000000 25.0000 0 - 10711 0 NS NS 0.000000 25.0000 0 - 10712 0 NS NS 0.000000 25.0000 0 - 10713 0 NS NS 0.000000 25.0000 0 - 10714 0 NS NS 0.000000 25.0000 0 - 10715 0 NS NS 0.000000 25.0000 0 - 10716 0 NS NS 0.000000 25.0000 0 - 10717 0 NS NS 0.000000 25.0000 0 - 10718 0 NS NS 0.000000 25.0000 0 - 10719 0 NS NS 0.000000 25.0000 0 - 10720 0 NS NS 0.000000 25.0000 0 - 10721 0 NS NS 0.000000 25.0000 0 - 10722 0 NS NS 0.000000 25.0000 0 - 10723 0 NS NS 0.000000 25.0000 0 - 10724 0 NS NS 0.000000 25.0000 0 - 10725 0 NS NS 0.000000 25.0000 0 - 10726 0 NS NS 0.000000 25.0000 0 - 10727 0 NS NS 0.000000 25.0000 0 - 10728 0 NS NS 0.000000 25.0000 0 - 10729 0 NS NS 0.000000 25.0000 0 - 10730 0 NS NS 0.000000 25.0000 0 - 10731 0 NS NS 0.000000 25.0000 0 - 10732 0 NS NS 0.000000 25.0000 0 - 10733 0 NS NS 0.000000 25.0000 0 - 10734 0 NS NS 0.000000 25.0000 0 - 10735 0 NS NS 0.000000 25.0000 0 - 10736 0 NS NS 0.000000 25.0000 0 - 10737 0 NS NS 0.000000 25.0000 0 - 10738 0 NS NS 0.000000 25.0000 0 - 10739 0 NS NS 0.000000 25.0000 0 - 10740 0 NS NS 0.000000 25.0000 0 - 10741 0 NS NS 0.000000 25.0000 0 - 10742 0 NS NS 0.000000 25.0000 0 - 10743 0 NS NS 0.000000 25.0000 0 - 10744 0 NS NS 0.000000 25.0000 0 - 10745 0 NS NS 0.000000 25.0000 0 - 10746 0 NS NS 0.000000 25.0000 0 - 10747 0 NS NS 0.000000 25.0000 0 - 10748 0 NS NS 0.000000 25.0000 0 - 10749 0 NS NS 0.000000 25.0000 0 - 10750 0 NS NS 0.000000 25.0000 0 - 10751 0 NS NS 0.000000 25.0000 0 - 10752 0 NS NS 0.000000 25.0000 0 - 10753 0 NS NS 0.000000 25.0000 0 - 10754 0 NS NS 0.000000 25.0000 0 - 10755 0 NS NS 0.000000 25.0000 0 - 10756 0 NS NS 0.000000 25.0000 0 - 10757 0 NS NS 0.000000 25.0000 0 - 10758 0 NS NS 0.000000 25.0000 0 - 10759 0 NS NS 0.000000 25.0000 0 - 10760 0 NS NS 0.000000 25.0000 0 - 10761 0 NS NS 0.000000 25.0000 0 - 10762 0 NS NS 0.000000 25.0000 0 - 10763 0 NS NS 0.000000 25.0000 0 - 10764 0 NS NS 0.000000 25.0000 0 - 10765 0 NS NS 0.000000 25.0000 0 - 10766 0 NS NS 0.000000 25.0000 0 - 10767 0 NS NS 0.000000 25.0000 0 - 10768 0 NS NS 0.000000 25.0000 0 - 10769 0 NS NS 0.000000 25.0000 0 - 10770 0 NS NS 0.000000 25.0000 0 - 10771 0 NS NS 0.000000 25.0000 0 - 10772 0 NS NS 0.000000 25.0000 0 - 10773 0 NS NS 0.000000 25.0000 0 - 10774 0 NS NS 0.000000 25.0000 0 - 10775 0 NS NS 0.000000 25.0000 0 - 10776 0 NS NS 0.000000 25.0000 0 - 10777 0 NS NS 0.000000 25.0000 0 - 10778 0 NS NS 0.000000 25.0000 0 - 10779 0 NS NS 0.000000 25.0000 0 - 10780 0 NS NS 0.000000 25.0000 0 - 10781 0 NS NS 0.000000 25.0000 0 - 10782 0 NS NS 0.000000 25.0000 0 - 10783 0 NS NS 0.000000 25.0000 0 - 10784 0 NS NS 0.000000 25.0000 0 - 10785 0 NS NS 0.000000 25.0000 0 - 10786 0 NS NS 0.000000 25.0000 0 - 10787 0 NS NS 0.000000 25.0000 0 - 10788 0 NS NS 0.000000 25.0000 0 - 10789 0 NS NS 0.000000 25.0000 0 - 10790 0 NS NS 0.000000 25.0000 0 - 10791 0 NS NS 0.000000 25.0000 0 - 10792 0 NS NS 0.000000 25.0000 0 - 10793 0 NS NS 0.000000 25.0000 0 - 10794 0 NS NS 0.000000 25.0000 0 - 10795 0 NS NS 0.000000 25.0000 0 - 10796 0 NS NS 0.000000 25.0000 0 - 10797 0 NS NS 0.000000 25.0000 0 - 10798 0 NS NS 0.000000 25.0000 0 - 10799 0 NS NS 0.000000 25.0000 0 - 10800 0 NS NS 0.000000 25.0000 0 - 10801 0 NS NS 0.000000 25.0000 0 - 10802 0 NS NS 0.000000 25.0000 0 - 10803 0 NS NS 0.000000 25.0000 0 - 10804 0 NS NS 0.000000 25.0000 0 - 10805 0 NS NS 0.000000 25.0000 0 - 10806 0 NS NS 0.000000 25.0000 0 - 10807 0 NS NS 0.000000 25.0000 0 - 10808 0 NS NS 0.000000 25.0000 0 - 10809 0 NS NS 0.000000 25.0000 0 - 10810 0 NS NS 0.000000 25.0000 0 - 10811 0 NS NS 0.000000 25.0000 0 - 10812 0 NS NS 0.000000 25.0000 0 - 10813 0 NS NS 0.000000 25.0000 0 - 10814 0 NS NS 0.000000 25.0000 0 - 10815 0 NS NS 0.000000 25.0000 0 - 10816 0 NS NS 0.000000 25.0000 0 - 10817 0 NS NS 0.000000 25.0000 0 - 10818 0 NS NS 0.000000 25.0000 0 - 10819 0 NS NS 0.000000 25.0000 0 - 10820 0 NS NS 0.000000 25.0000 0 - 10821 0 NS NS 0.000000 25.0000 0 - 10822 0 NS NS 0.000000 25.0000 0 - 10823 0 NS NS 0.000000 25.0000 0 - 10824 0 NS NS 0.000000 25.0000 0 - 10825 0 NS NS 0.000000 25.0000 0 - 10826 0 NS NS 0.000000 25.0000 0 - 10827 0 NS NS 0.000000 25.0000 0 - 10828 0 NS NS 0.000000 25.0000 0 - 10829 0 NS NS 0.000000 25.0000 0 - 10830 0 NS NS 0.000000 25.0000 0 - 10831 0 NS NS 0.000000 25.0000 0 - 10832 0 NS NS 0.000000 25.0000 0 - 10833 0 NS NS 0.000000 25.0000 0 - 10834 0 NS NS 0.000000 25.0000 0 - 10835 0 NS NS 0.000000 25.0000 0 - 10836 0 NS NS 0.000000 25.0000 0 - 10837 0 NS NS 0.000000 25.0000 0 - 10838 0 NS NS 0.000000 25.0000 0 - 10839 0 NS NS 0.000000 25.0000 0 - 10840 0 NS NS 0.000000 25.0000 0 - 10841 0 NS NS 0.000000 25.0000 0 - 10842 0 NS NS 0.000000 25.0000 0 - 10843 0 NS NS 0.000000 25.0000 0 - 10844 0 NS NS 0.000000 25.0000 0 - 10845 0 NS NS 0.000000 25.0000 0 - 10846 0 NS NS 0.000000 25.0000 0 - 10847 0 NS NS 0.000000 25.0000 0 - 10848 0 NS NS 0.000000 25.0000 0 - 10849 0 NS NS 0.000000 25.0000 0 - 10850 0 NS NS 0.000000 25.0000 0 - 10851 0 NS NS 0.000000 25.0000 0 - 10852 0 NS NS 0.000000 25.0000 0 - 10853 0 NS NS 0.000000 25.0000 0 - 10854 0 NS NS 0.000000 25.0000 0 - 10855 0 NS NS 0.000000 25.0000 0 - 10856 0 NS NS 0.000000 25.0000 0 - 10857 0 NS NS 0.000000 25.0000 0 - 10858 0 NS NS 0.000000 25.0000 0 - 10859 0 NS NS 0.000000 25.0000 0 - 10860 0 NS NS 0.000000 25.0000 0 - 10861 0 NS NS 0.000000 25.0000 0 - 10862 0 NS NS 0.000000 25.0000 0 - 10863 0 NS NS 0.000000 25.0000 0 - 10864 0 NS NS 0.000000 25.0000 0 - 10865 0 NS NS 0.000000 25.0000 0 - 10866 0 NS NS 0.000000 25.0000 0 - 10867 0 NS NS 0.000000 25.0000 0 - 10868 0 NS NS 0.000000 25.0000 0 - 10869 0 NS NS 0.000000 25.0000 0 - 10870 0 NS NS 0.000000 25.0000 0 - 10871 0 NS NS 0.000000 25.0000 0 - 10872 0 NS NS 0.000000 25.0000 0 - 10873 0 NS NS 0.000000 25.0000 0 - 10874 0 NS NS 0.000000 25.0000 0 - 10875 0 NS NS 0.000000 25.0000 0 - 10876 0 NS NS 0.000000 25.0000 0 - 10877 0 NS NS 0.000000 25.0000 0 - 10878 0 NS NS 0.000000 25.0000 0 - 10879 0 NS NS 0.000000 25.0000 0 - 10880 0 NS NS 0.000000 25.0000 0 - 10881 0 NS NS 0.000000 25.0000 0 - 10882 0 NS NS 0.000000 25.0000 0 - 10883 0 NS NS 0.000000 25.0000 0 - 10884 0 NS NS 0.000000 25.0000 0 - 10885 0 NS NS 0.000000 25.0000 0 - 10886 0 NS NS 0.000000 25.0000 0 - 10887 0 NS NS 0.000000 25.0000 0 - 10888 0 NS NS 0.000000 25.0000 0 - 10889 0 NS NS 0.000000 25.0000 0 - 10890 0 NS NS 0.000000 25.0000 0 - 10891 0 NS NS 0.000000 25.0000 0 - 10892 0 NS NS 0.000000 25.0000 0 - 10893 0 NS NS 0.000000 25.0000 0 - 10894 0 NS NS 0.000000 25.0000 0 - 10895 0 NS NS 0.000000 25.0000 0 - 10896 0 NS NS 0.000000 25.0000 0 - 10897 0 NS NS 0.000000 25.0000 0 - 10898 0 NS NS 0.000000 25.0000 0 - 10899 0 NS NS 0.000000 25.0000 0 - 10900 0 NS NS 0.000000 25.0000 0 - 10901 0 NS NS 0.000000 25.0000 0 - 10902 0 NS NS 0.000000 25.0000 0 - 10903 0 NS NS 0.000000 25.0000 0 - 10904 0 NS NS 0.000000 25.0000 0 - 10905 0 NS NS 0.000000 25.0000 0 - 10906 0 NS NS 0.000000 25.0000 0 - 10907 0 NS NS 0.000000 25.0000 0 - 10908 0 NS NS 0.000000 25.0000 0 - 10909 0 NS NS 0.000000 25.0000 0 - 10910 0 NS NS 0.000000 25.0000 0 - 10911 0 NS NS 0.000000 25.0000 0 - 10912 0 NS NS 0.000000 25.0000 0 - 10913 0 NS NS 0.000000 25.0000 0 - 10914 0 NS NS 0.000000 25.0000 0 - 10915 0 NS NS 0.000000 25.0000 0 - 10916 0 NS NS 0.000000 25.0000 0 - 10917 0 NS NS 0.000000 25.0000 0 - 10918 0 NS NS 0.000000 25.0000 0 - 10919 0 NS NS 0.000000 25.0000 0 - 10920 0 NS NS 0.000000 25.0000 0 - 10921 0 NS NS 0.000000 25.0000 0 - 10922 0 NS NS 0.000000 25.0000 0 - 10923 0 NS NS 0.000000 25.0000 0 - 10924 0 NS NS 0.000000 25.0000 0 - 10925 0 NS NS 0.000000 25.0000 0 - 10926 0 NS NS 0.000000 25.0000 0 - 10927 0 NS NS 0.000000 25.0000 0 - 10928 0 NS NS 0.000000 25.0000 0 - 10929 0 NS NS 0.000000 25.0000 0 - 10930 0 NS NS 0.000000 25.0000 0 - 10931 0 NS NS 0.000000 25.0000 0 - 10932 0 NS NS 0.000000 25.0000 0 - 10933 0 NS NS 0.000000 25.0000 0 - 10934 0 NS NS 0.000000 25.0000 0 - 10935 0 NS NS 0.000000 25.0000 0 - 10936 0 NS NS 0.000000 25.0000 0 - 10937 0 NS NS 0.000000 25.0000 0 - 10938 0 NS NS 0.000000 25.0000 0 - 10939 0 NS NS 0.000000 25.0000 0 - 10940 0 NS NS 0.000000 25.0000 0 - 10941 0 NS NS 0.000000 25.0000 0 - 10942 0 NS NS 0.000000 25.0000 0 - 10943 0 NS NS 0.000000 25.0000 0 - 10944 0 NS NS 0.000000 25.0000 0 - 10945 0 NS NS 0.000000 25.0000 0 - 10946 0 NS NS 0.000000 25.0000 0 - 10947 0 NS NS 0.000000 25.0000 0 - 10948 0 NS NS 0.000000 25.0000 0 - 10949 0 NS NS 0.000000 25.0000 0 - 10950 0 NS NS 0.000000 25.0000 0 - 10951 0 NS NS 0.000000 25.0000 0 - 10952 0 NS NS 0.000000 25.0000 0 - 10953 0 NS NS 0.000000 25.0000 0 - 10954 0 NS NS 0.000000 25.0000 0 - 10955 0 NS NS 0.000000 25.0000 0 - 10956 0 NS NS 0.000000 25.0000 0 - 10957 0 NS NS 0.000000 25.0000 0 - 10958 0 NS NS 0.000000 25.0000 0 - 10959 0 NS NS 0.000000 25.0000 0 - 10960 0 NS NS 0.000000 25.0000 0 - 10961 0 NS NS 0.000000 25.0000 0 - 10962 0 NS NS 0.000000 25.0000 0 - 10963 0 NS NS 0.000000 25.0000 0 - 10964 0 NS NS 0.000000 25.0000 0 - 10965 0 NS NS 0.000000 25.0000 0 - 10966 0 NS NS 0.000000 25.0000 0 - 10967 0 NS NS 0.000000 25.0000 0 - 10968 0 NS NS 0.000000 25.0000 0 - 10969 0 NS NS 0.000000 25.0000 0 - 10970 0 NS NS 0.000000 25.0000 0 - 10971 0 NS NS 0.000000 25.0000 0 - 10972 0 NS NS 0.000000 25.0000 0 - 10973 0 NS NS 0.000000 25.0000 0 - 10974 0 NS NS 0.000000 25.0000 0 - 10975 0 NS NS 0.000000 25.0000 0 - 10976 0 NS NS 0.000000 25.0000 0 - 10977 0 NS NS 0.000000 25.0000 0 - 10978 0 NS NS 0.000000 25.0000 0 - 10979 0 NS NS 0.000000 25.0000 0 - 10980 0 NS NS 0.000000 25.0000 0 - 10981 0 NS NS 0.000000 25.0000 0 - 10982 0 NS NS 0.000000 25.0000 0 - 10983 0 NS NS 0.000000 25.0000 0 - 10984 0 NS NS 0.000000 25.0000 0 - 10985 0 NS NS 0.000000 25.0000 0 - 10986 0 NS NS 0.000000 25.0000 0 - 10987 0 NS NS 0.000000 25.0000 0 - 10988 0 NS NS 0.000000 25.0000 0 - 10989 0 NS NS 0.000000 25.0000 0 - 10990 0 NS NS 0.000000 25.0000 0 - 10991 0 NS NS 0.000000 25.0000 0 - 10992 0 NS NS 0.000000 25.0000 0 - 10993 0 NS NS 0.000000 25.0000 0 - 10994 0 NS NS 0.000000 25.0000 0 - 10995 0 NS NS 0.000000 25.0000 0 - 10996 0 NS NS 0.000000 25.0000 0 - 10997 0 NS NS 0.000000 25.0000 0 - 10998 0 NS NS 0.000000 25.0000 0 - 10999 0 NS NS 0.000000 25.0000 0 - 11000 0 NS NS 0.000000 25.0000 0 - 11001 0 NS NS 0.000000 25.0000 0 - 11002 0 NS NS 0.000000 25.0000 0 - 11003 0 NS NS 0.000000 25.0000 0 - 11004 0 NS NS 0.000000 25.0000 0 - 11005 0 NS NS 0.000000 25.0000 0 - 11006 0 NS NS 0.000000 25.0000 0 - 11007 0 NS NS 0.000000 25.0000 0 - 11008 0 NS NS 0.000000 25.0000 0 - 11009 0 NS NS 0.000000 25.0000 0 - 11010 0 NS NS 0.000000 25.0000 0 - 11011 0 NS NS 0.000000 25.0000 0 - 11012 0 NS NS 0.000000 25.0000 0 - 11013 0 NS NS 0.000000 25.0000 0 - 11014 0 NS NS 0.000000 25.0000 0 - 11015 0 NS NS 0.000000 25.0000 0 - 11016 0 NS NS 0.000000 25.0000 0 - 11017 0 NS NS 0.000000 25.0000 0 - 11018 0 NS NS 0.000000 25.0000 0 - 11019 0 NS NS 0.000000 25.0000 0 - 11020 0 NS NS 0.000000 25.0000 0 - 11021 0 NS NS 0.000000 25.0000 0 - 11022 0 NS NS 0.000000 25.0000 0 - 11023 0 NS NS 0.000000 25.0000 0 - 11024 0 NS NS 0.000000 25.0000 0 - 11025 0 NS NS 0.000000 25.0000 0 - 11026 0 NS NS 0.000000 25.0000 0 - 11027 0 NS NS 0.000000 25.0000 0 - 11028 0 NS NS 0.000000 25.0000 0 - 11029 0 NS NS 0.000000 25.0000 0 - 11030 0 NS NS 0.000000 25.0000 0 - 11031 0 NS NS 0.000000 25.0000 0 - 11032 0 NS NS 0.000000 25.0000 0 - 11033 0 NS NS 0.000000 25.0000 0 - 11034 0 NS NS 0.000000 25.0000 0 - 11035 0 NS NS 0.000000 25.0000 0 - 11036 0 NS NS 0.000000 25.0000 0 - 11037 0 NS NS 0.000000 25.0000 0 - 11038 0 NS NS 0.000000 25.0000 0 - 11039 0 NS NS 0.000000 25.0000 0 - 11040 0 NS NS 0.000000 25.0000 0 - 11041 0 NS NS 0.000000 25.0000 0 - 11042 0 NS NS 0.000000 25.0000 0 - 11043 0 NS NS 0.000000 25.0000 0 - 11044 0 NS NS 0.000000 25.0000 0 - 11045 0 NS NS 0.000000 25.0000 0 - 11046 0 NS NS 0.000000 25.0000 0 - 11047 0 NS NS 0.000000 25.0000 0 - 11048 0 NS NS 0.000000 25.0000 0 - 11049 0 NS NS 0.000000 25.0000 0 - 11050 0 NS NS 0.000000 25.0000 0 - 11051 0 NS NS 0.000000 25.0000 0 - 11052 0 NS NS 0.000000 25.0000 0 - 11053 0 NS NS 0.000000 25.0000 0 - 11054 0 NS NS 0.000000 25.0000 0 - 11055 0 NS NS 0.000000 25.0000 0 - 11056 0 NS NS 0.000000 25.0000 0 - 11057 0 NS NS 0.000000 25.0000 0 - 11058 0 NS NS 0.000000 25.0000 0 - 11059 0 NS NS 0.000000 25.0000 0 - 11060 0 NS NS 0.000000 25.0000 0 - 11061 0 NS NS 0.000000 25.0000 0 - 11062 0 NS NS 0.000000 25.0000 0 - 11063 0 NS NS 0.000000 25.0000 0 - 11064 0 NS NS 0.000000 25.0000 0 - 11065 0 NS NS 0.000000 25.0000 0 - 11066 0 NS NS 0.000000 25.0000 0 - 11067 0 NS NS 0.000000 25.0000 0 - 11068 0 NS NS 0.000000 25.0000 0 - 11069 0 NS NS 0.000000 25.0000 0 - 11070 0 NS NS 0.000000 25.0000 0 - 11071 0 NS NS 0.000000 25.0000 0 - 11072 0 NS NS 0.000000 25.0000 0 - 11073 0 NS NS 0.000000 25.0000 0 - 11074 0 NS NS 0.000000 25.0000 0 - 11075 0 NS NS 0.000000 25.0000 0 - 11076 0 NS NS 0.000000 25.0000 0 - 11077 0 NS NS 0.000000 25.0000 0 - 11078 0 NS NS 0.000000 25.0000 0 - 11079 0 NS NS 0.000000 25.0000 0 - 11080 0 NS NS 0.000000 25.0000 0 - 11081 0 NS NS 0.000000 25.0000 0 - 11082 0 NS NS 0.000000 25.0000 0 - 11083 0 NS NS 0.000000 25.0000 0 - 11084 0 NS NS 0.000000 25.0000 0 - 11085 0 NS NS 0.000000 25.0000 0 - 11086 0 NS NS 0.000000 25.0000 0 - 11087 0 NS NS 0.000000 25.0000 0 - 11088 0 NS NS 0.000000 25.0000 0 - 11089 0 NS NS 0.000000 25.0000 0 - 11090 0 NS NS 0.000000 25.0000 0 - 11091 0 NS NS 0.000000 25.0000 0 - 11092 0 NS NS 0.000000 25.0000 0 - 11093 0 NS NS 0.000000 25.0000 0 - 11094 0 NS NS 0.000000 25.0000 0 - 11095 0 NS NS 0.000000 25.0000 0 - 11096 0 NS NS 0.000000 25.0000 0 - 11097 0 NS NS 0.000000 25.0000 0 - 11098 0 NS NS 0.000000 25.0000 0 - 11099 0 NS NS 0.000000 25.0000 0 - 11100 0 NS NS 0.000000 25.0000 0 - 11101 0 NS NS 0.000000 25.0000 0 - 11102 0 NS NS 0.000000 25.0000 0 - 11103 0 NS NS 0.000000 25.0000 0 - 11104 0 NS NS 0.000000 25.0000 0 - 11105 0 NS NS 0.000000 25.0000 0 - 11106 0 NS NS 0.000000 25.0000 0 - 11107 0 NS NS 0.000000 25.0000 0 - 11108 0 NS NS 0.000000 25.0000 0 - 11109 0 NS NS 0.000000 25.0000 0 - 11110 0 NS NS 0.000000 25.0000 0 - 11111 0 NS NS 0.000000 25.0000 0 - 11112 0 NS NS 0.000000 25.0000 0 - 11113 0 NS NS 0.000000 25.0000 0 - 11114 0 NS NS 0.000000 25.0000 0 - 11115 0 NS NS 0.000000 25.0000 0 - 11116 0 NS NS 0.000000 25.0000 0 - 11117 0 NS NS 0.000000 25.0000 0 - 11118 0 NS NS 0.000000 25.0000 0 - 11119 0 NS NS 0.000000 25.0000 0 - 11120 0 NS NS 0.000000 25.0000 0 - 11121 0 NS NS 0.000000 25.0000 0 - 11122 0 NS NS 0.000000 25.0000 0 - 11123 0 NS NS 0.000000 25.0000 0 - 11124 0 NS NS 0.000000 25.0000 0 - 11125 0 NS NS 0.000000 25.0000 0 - 11126 0 NS NS 0.000000 25.0000 0 - 11127 0 NS NS 0.000000 25.0000 0 - 11128 0 NS NS 0.000000 25.0000 0 - 11129 0 NS NS 0.000000 25.0000 0 - 11130 0 NS NS 0.000000 25.0000 0 - 11131 0 NS NS 0.000000 25.0000 0 - 11132 0 NS NS 0.000000 25.0000 0 - 11133 0 NS NS 0.000000 25.0000 0 - 11134 0 NS NS 0.000000 25.0000 0 - 11135 0 NS NS 0.000000 25.0000 0 - 11136 0 NS NS 0.000000 25.0000 0 - 11137 0 NS NS 0.000000 25.0000 0 - 11138 0 NS NS 0.000000 25.0000 0 - 11139 0 NS NS 0.000000 25.0000 0 - 11140 0 NS NS 0.000000 25.0000 0 - 11141 0 NS NS 0.000000 25.0000 0 - 11142 0 NS NS 0.000000 25.0000 0 - 11143 0 NS NS 0.000000 25.0000 0 - 11144 0 NS NS 0.000000 25.0000 0 - 11145 0 NS NS 0.000000 25.0000 0 - 11146 0 NS NS 0.000000 25.0000 0 - 11147 0 NS NS 0.000000 25.0000 0 - 11148 0 NS NS 0.000000 25.0000 0 - 11149 0 NS NS 0.000000 25.0000 0 - 11150 0 NS NS 0.000000 25.0000 0 - 11151 0 NS NS 0.000000 25.0000 0 - 11152 0 NS NS 0.000000 25.0000 0 - 11153 0 NS NS 0.000000 25.0000 0 - 11154 0 NS NS 0.000000 25.0000 0 - 11155 0 NS NS 0.000000 25.0000 0 - 11156 0 NS NS 0.000000 25.0000 0 - 11157 0 NS NS 0.000000 25.0000 0 - 11158 0 NS NS 0.000000 25.0000 0 - 11159 0 NS NS 0.000000 25.0000 0 - 11160 0 NS NS 0.000000 25.0000 0 - 11161 0 NS NS 0.000000 25.0000 0 - 11162 0 NS NS 0.000000 25.0000 0 - 11163 0 NS NS 0.000000 25.0000 0 - 11164 0 NS NS 0.000000 25.0000 0 - 11165 0 NS NS 0.000000 25.0000 0 - 11166 0 NS NS 0.000000 25.0000 0 - 11167 0 NS NS 0.000000 25.0000 0 - 11168 0 NS NS 0.000000 25.0000 0 - 11169 0 NS NS 0.000000 25.0000 0 - 11170 0 NS NS 0.000000 25.0000 0 - 11171 0 NS NS 0.000000 25.0000 0 - 11172 0 NS NS 0.000000 25.0000 0 - 11173 0 NS NS 0.000000 25.0000 0 - 11174 0 NS NS 0.000000 25.0000 0 - 11175 0 NS NS 0.000000 25.0000 0 - 11176 0 NS NS 0.000000 25.0000 0 - 11177 0 NS NS 0.000000 25.0000 0 - 11178 0 NS NS 0.000000 25.0000 0 - 11179 0 NS NS 0.000000 25.0000 0 - 11180 0 NS NS 0.000000 25.0000 0 - 11181 0 NS NS 0.000000 25.0000 0 - 11182 0 NS NS 0.000000 25.0000 0 - 11183 0 NS NS 0.000000 25.0000 0 - 11184 0 NS NS 0.000000 25.0000 0 - 11185 0 NS NS 0.000000 25.0000 0 - 11186 0 NS NS 0.000000 25.0000 0 - 11187 0 NS NS 0.000000 25.0000 0 - 11188 0 NS NS 0.000000 25.0000 0 - 11189 0 NS NS 0.000000 25.0000 0 - 11190 0 NS NS 0.000000 25.0000 0 - 11191 0 NS NS 0.000000 25.0000 0 - 11192 0 NS NS 0.000000 25.0000 0 - 11193 0 NS NS 0.000000 25.0000 0 - 11194 0 NS NS 0.000000 25.0000 0 - 11195 0 NS NS 0.000000 25.0000 0 - 11196 0 NS NS 0.000000 25.0000 0 - 11197 0 NS NS 0.000000 25.0000 0 - 11198 0 NS NS 0.000000 25.0000 0 - 11199 0 NS NS 0.000000 25.0000 0 - 11200 0 NS NS 0.000000 25.0000 0 - 11201 0 NS NS 0.000000 25.0000 0 - 11202 0 NS NS 0.000000 25.0000 0 - 11203 0 NS NS 0.000000 25.0000 0 - 11204 0 NS NS 0.000000 25.0000 0 - 11205 0 NS NS 0.000000 25.0000 0 - 11206 0 NS NS 0.000000 25.0000 0 - 11207 0 NS NS 0.000000 25.0000 0 - 11208 0 NS NS 0.000000 25.0000 0 - 11209 0 NS NS 0.000000 25.0000 0 - 11210 0 NS NS 0.000000 25.0000 0 - 11211 0 NS NS 0.000000 25.0000 0 - 11212 0 NS NS 0.000000 25.0000 0 - 11213 0 NS NS 0.000000 25.0000 0 - 11214 0 NS NS 0.000000 25.0000 0 - 11215 0 NS NS 0.000000 25.0000 0 - 11216 0 NS NS 0.000000 25.0000 0 - 11217 0 NS NS 0.000000 25.0000 0 - 11218 0 NS NS 0.000000 25.0000 0 - 11219 0 NS NS 0.000000 25.0000 0 - 11220 0 NS NS 0.000000 25.0000 0 - 11221 0 NS NS 0.000000 25.0000 0 - 11222 0 NS NS 0.000000 25.0000 0 - 11223 0 NS NS 0.000000 25.0000 0 - 11224 0 NS NS 0.000000 25.0000 0 - 11225 0 NS NS 0.000000 25.0000 0 - 11226 0 NS NS 0.000000 25.0000 0 - 11227 0 NS NS 0.000000 25.0000 0 - 11228 0 NS NS 0.000000 25.0000 0 - 11229 0 NS NS 0.000000 25.0000 0 - 11230 0 NS NS 0.000000 25.0000 0 - 11231 0 NS NS 0.000000 25.0000 0 - 11232 0 NS NS 0.000000 25.0000 0 - 11233 0 NS NS 0.000000 25.0000 0 - 11234 0 NS NS 0.000000 25.0000 0 - 11235 0 NS NS 0.000000 25.0000 0 - 11236 0 NS NS 0.000000 25.0000 0 - 11237 0 NS NS 0.000000 25.0000 0 - 11238 0 NS NS 0.000000 25.0000 0 - 11239 0 NS NS 0.000000 25.0000 0 - 11240 0 NS NS 0.000000 25.0000 0 - 11241 0 NS NS 0.000000 25.0000 0 - 11242 0 NS NS 0.000000 25.0000 0 - 11243 0 NS NS 0.000000 25.0000 0 - 11244 0 NS NS 0.000000 25.0000 0 - 11245 0 NS NS 0.000000 25.0000 0 - 11246 0 NS NS 0.000000 25.0000 0 - 11247 0 NS NS 0.000000 25.0000 0 - 11248 0 NS NS 0.000000 25.0000 0 - 11249 0 NS NS 0.000000 25.0000 0 - 11250 0 NS NS 0.000000 25.0000 0 - 11251 0 NS NS 0.000000 25.0000 0 - 11252 0 NS NS 0.000000 25.0000 0 - 11253 0 NS NS 0.000000 25.0000 0 - 11254 0 NS NS 0.000000 25.0000 0 - 11255 0 NS NS 0.000000 25.0000 0 - 11256 0 NS NS 0.000000 25.0000 0 - 11257 0 NS NS 0.000000 25.0000 0 - 11258 0 NS NS 0.000000 25.0000 0 - 11259 0 NS NS 0.000000 25.0000 0 - 11260 0 NS NS 0.000000 25.0000 0 - 11261 0 NS NS 0.000000 25.0000 0 - 11262 0 NS NS 0.000000 25.0000 0 - 11263 0 NS NS 0.000000 25.0000 0 - 11264 0 NS NS 0.000000 25.0000 0 - 11265 0 NS NS 0.000000 25.0000 0 - 11266 0 NS NS 0.000000 25.0000 0 - 11267 0 NS NS 0.000000 25.0000 0 - 11268 0 NS NS 0.000000 25.0000 0 - 11269 0 NS NS 0.000000 25.0000 0 - 11270 0 NS NS 0.000000 25.0000 0 - 11271 0 NS NS 0.000000 25.0000 0 - 11272 0 NS NS 0.000000 25.0000 0 - 11273 0 NS NS 0.000000 25.0000 0 - 11274 0 NS NS 0.000000 25.0000 0 - 11275 0 NS NS 0.000000 25.0000 0 - 11276 0 NS NS 0.000000 25.0000 0 - 11277 0 NS NS 0.000000 25.0000 0 - 11278 0 NS NS 0.000000 25.0000 0 - 11279 0 NS NS 0.000000 25.0000 0 - 11280 0 NS NS 0.000000 25.0000 0 - 11281 0 NS NS 0.000000 25.0000 0 - 11282 0 NS NS 0.000000 25.0000 0 - 11283 0 NS NS 0.000000 25.0000 0 - 11284 0 NS NS 0.000000 25.0000 0 - 11285 0 NS NS 0.000000 25.0000 0 - 11286 0 NS NS 0.000000 25.0000 0 - 11287 0 NS NS 0.000000 25.0000 0 - 11288 0 NS NS 0.000000 25.0000 0 - 11289 0 NS NS 0.000000 25.0000 0 - 11290 0 NS NS 0.000000 25.0000 0 - 11291 0 NS NS 0.000000 25.0000 0 - 11292 0 NS NS 0.000000 25.0000 0 - 11293 0 NS NS 0.000000 25.0000 0 - 11294 0 NS NS 0.000000 25.0000 0 - 11295 0 NS NS 0.000000 25.0000 0 - 11296 0 NS NS 0.000000 25.0000 0 - 11297 0 NS NS 0.000000 25.0000 0 - 11298 0 NS NS 0.000000 25.0000 0 - 11299 0 NS NS 0.000000 25.0000 0 - 11300 0 NS NS 0.000000 25.0000 0 - 11301 0 NS NS 0.000000 25.0000 0 - 11302 0 NS NS 0.000000 25.0000 0 - 11303 0 NS NS 0.000000 25.0000 0 - 11304 0 NS NS 0.000000 25.0000 0 - 11305 0 NS NS 0.000000 25.0000 0 - 11306 0 NS NS 0.000000 25.0000 0 - 11307 0 NS NS 0.000000 25.0000 0 - 11308 0 NS NS 0.000000 25.0000 0 - 11309 0 NS NS 0.000000 25.0000 0 - 11310 0 NS NS 0.000000 25.0000 0 - 11311 0 NS NS 0.000000 25.0000 0 - 11312 0 NS NS 0.000000 25.0000 0 - 11313 0 NS NS 0.000000 25.0000 0 - 11314 0 NS NS 0.000000 25.0000 0 - 11315 0 NS NS 0.000000 25.0000 0 - 11316 0 NS NS 0.000000 25.0000 0 - 11317 0 NS NS 0.000000 25.0000 0 - 11318 0 NS NS 0.000000 25.0000 0 - 11319 0 NS NS 0.000000 25.0000 0 - 11320 0 NS NS 0.000000 25.0000 0 - 11321 0 NS NS 0.000000 25.0000 0 - 11322 0 NS NS 0.000000 25.0000 0 - 11323 0 NS NS 0.000000 25.0000 0 - 11324 0 NS NS 0.000000 25.0000 0 - 11325 0 NS NS 0.000000 25.0000 0 - 11326 0 NS NS 0.000000 25.0000 0 - 11327 0 NS NS 0.000000 25.0000 0 - 11328 0 NS NS 0.000000 25.0000 0 - 11329 0 NS NS 0.000000 25.0000 0 - 11330 0 NS NS 0.000000 25.0000 0 - 11331 0 NS NS 0.000000 25.0000 0 - 11332 0 NS NS 0.000000 25.0000 0 - 11333 0 NS NS 0.000000 25.0000 0 - 11334 0 NS NS 0.000000 25.0000 0 - 11335 0 NS NS 0.000000 25.0000 0 - 11336 0 NS NS 0.000000 25.0000 0 - 11337 0 NS NS 0.000000 25.0000 0 - 11338 0 NS NS 0.000000 25.0000 0 - 11339 0 NS NS 0.000000 25.0000 0 - 11340 0 NS NS 0.000000 25.0000 0 - 11341 0 NS NS 0.000000 25.0000 0 - 11342 0 NS NS 0.000000 25.0000 0 - 11343 0 NS NS 0.000000 25.0000 0 - 11344 0 NS NS 0.000000 25.0000 0 - 11345 0 NS NS 0.000000 25.0000 0 - 11346 0 NS NS 0.000000 25.0000 0 - 11347 0 NS NS 0.000000 25.0000 0 - 11348 0 NS NS 0.000000 25.0000 0 - 11349 0 NS NS 0.000000 25.0000 0 - 11350 0 NS NS 0.000000 25.0000 0 - 11351 0 NS NS 0.000000 25.0000 0 - 11352 0 NS NS 0.000000 25.0000 0 - 11353 0 NS NS 0.000000 25.0000 0 - 11354 0 NS NS 0.000000 25.0000 0 - 11355 0 NS NS 0.000000 25.0000 0 - 11356 0 NS NS 0.000000 25.0000 0 - 11357 0 NS NS 0.000000 25.0000 0 - 11358 0 NS NS 0.000000 25.0000 0 - 11359 0 NS NS 0.000000 25.0000 0 - 11360 0 NS NS 0.000000 25.0000 0 - 11361 0 NS NS 0.000000 25.0000 0 - 11362 0 NS NS 0.000000 25.0000 0 - 11363 0 NS NS 0.000000 25.0000 0 - 11364 0 NS NS 0.000000 25.0000 0 - 11365 0 NS NS 0.000000 25.0000 0 - 11366 0 NS NS 0.000000 25.0000 0 - 11367 0 NS NS 0.000000 25.0000 0 - 11368 0 NS NS 0.000000 25.0000 0 - 11369 0 NS NS 0.000000 25.0000 0 - 11370 0 NS NS 0.000000 25.0000 0 - 11371 0 NS NS 0.000000 25.0000 0 - 11372 0 NS NS 0.000000 25.0000 0 - 11373 0 NS NS 0.000000 25.0000 0 - 11374 0 NS NS 0.000000 25.0000 0 - 11375 0 NS NS 0.000000 25.0000 0 - 11376 0 NS NS 0.000000 25.0000 0 - 11377 0 NS NS 0.000000 25.0000 0 - 11378 0 NS NS 0.000000 25.0000 0 - 11379 0 NS NS 0.000000 25.0000 0 - 11380 0 NS NS 0.000000 25.0000 0 - 11381 0 NS NS 0.000000 25.0000 0 - 11382 0 NS NS 0.000000 25.0000 0 - 11383 0 NS NS 0.000000 25.0000 0 - 11384 0 NS NS 0.000000 25.0000 0 - 11385 0 NS NS 0.000000 25.0000 0 - 11386 0 NS NS 0.000000 25.0000 0 - 11387 0 NS NS 0.000000 25.0000 0 - 11388 0 NS NS 0.000000 25.0000 0 - 11389 0 NS NS 0.000000 25.0000 0 - 11390 0 NS NS 0.000000 25.0000 0 - 11391 0 NS NS 0.000000 25.0000 0 - 11392 0 NS NS 0.000000 25.0000 0 - 11393 0 NS NS 0.000000 25.0000 0 - 11394 0 NS NS 0.000000 25.0000 0 - 11395 0 NS NS 0.000000 25.0000 0 - 11396 0 NS NS 0.000000 25.0000 0 - 11397 0 NS NS 0.000000 25.0000 0 - 11398 0 NS NS 0.000000 25.0000 0 - 11399 0 NS NS 0.000000 25.0000 0 - 11400 0 NS NS 0.000000 25.0000 0 - 11401 0 NS NS 0.000000 25.0000 0 - 11402 0 NS NS 0.000000 25.0000 0 - 11403 0 NS NS 0.000000 25.0000 0 - 11404 0 NS NS 0.000000 25.0000 0 - 11405 0 NS NS 0.000000 25.0000 0 - 11406 0 NS NS 0.000000 25.0000 0 - 11407 0 NS NS 0.000000 25.0000 0 - 11408 0 NS NS 0.000000 25.0000 0 - 11409 0 NS NS 0.000000 25.0000 0 - 11410 0 NS NS 0.000000 25.0000 0 - 11411 0 NS NS 0.000000 25.0000 0 - 11412 0 NS NS 0.000000 25.0000 0 - 11413 0 NS NS 0.000000 25.0000 0 - 11414 0 NS NS 0.000000 25.0000 0 - 11415 0 NS NS 0.000000 25.0000 0 - 11416 0 NS NS 0.000000 25.0000 0 - 11417 0 NS NS 0.000000 25.0000 0 - 11418 0 NS NS 0.000000 25.0000 0 - 11419 0 NS NS 0.000000 25.0000 0 - 11420 0 NS NS 0.000000 25.0000 0 - 11421 0 NS NS 0.000000 25.0000 0 - 11422 0 NS NS 0.000000 25.0000 0 - 11423 0 NS NS 0.000000 25.0000 0 - 11424 0 NS NS 0.000000 25.0000 0 - 11425 0 NS NS 0.000000 25.0000 0 - 11426 0 NS NS 0.000000 25.0000 0 - 11427 0 NS NS 0.000000 25.0000 0 - 11428 0 NS NS 0.000000 25.0000 0 - 11429 0 NS NS 0.000000 25.0000 0 - 11430 0 NS NS 0.000000 25.0000 0 - 11431 0 NS NS 0.000000 25.0000 0 - 11432 0 NS NS 0.000000 25.0000 0 - 11433 0 NS NS 0.000000 25.0000 0 - 11434 0 NS NS 0.000000 25.0000 0 - 11435 0 NS NS 0.000000 25.0000 0 - 11436 0 NS NS 0.000000 25.0000 0 - 11437 0 NS NS 0.000000 25.0000 0 - 11438 0 NS NS 0.000000 25.0000 0 - 11439 0 NS NS 0.000000 25.0000 0 - 11440 0 NS NS 0.000000 25.0000 0 - 11441 0 NS NS 0.000000 25.0000 0 - 11442 0 NS NS 0.000000 25.0000 0 - 11443 0 NS NS 0.000000 25.0000 0 - 11444 0 NS NS 0.000000 25.0000 0 - 11445 0 NS NS 0.000000 25.0000 0 - 11446 0 NS NS 0.000000 25.0000 0 - 11447 0 NS NS 0.000000 25.0000 0 - 11448 0 NS NS 0.000000 25.0000 0 - 11449 0 NS NS 0.000000 25.0000 0 - 11450 0 NS NS 0.000000 25.0000 0 - 11451 0 NS NS 0.000000 25.0000 0 - 11452 0 NS NS 0.000000 25.0000 0 - 11453 0 NS NS 0.000000 25.0000 0 - 11454 0 NS NS 0.000000 25.0000 0 - 11455 0 NS NS 0.000000 25.0000 0 - 11456 0 NS NS 0.000000 25.0000 0 - 11457 0 NS NS 0.000000 25.0000 0 - 11458 0 NS NS 0.000000 25.0000 0 - 11459 0 NS NS 0.000000 25.0000 0 - 11460 0 NS NS 0.000000 25.0000 0 - 11461 0 NS NS 0.000000 25.0000 0 - 11462 0 NS NS 0.000000 25.0000 0 - 11463 0 NS NS 0.000000 25.0000 0 - 11464 0 NS NS 0.000000 25.0000 0 - 11465 0 NS NS 0.000000 25.0000 0 - 11466 0 NS NS 0.000000 25.0000 0 - 11467 0 NS NS 0.000000 25.0000 0 - 11468 0 NS NS 0.000000 25.0000 0 - 11469 0 NS NS 0.000000 25.0000 0 - 11470 0 NS NS 0.000000 25.0000 0 - 11471 0 NS NS 0.000000 25.0000 0 - 11472 0 NS NS 0.000000 25.0000 0 - 11473 0 NS NS 0.000000 25.0000 0 - 11474 0 NS NS 0.000000 25.0000 0 - 11475 0 NS NS 0.000000 25.0000 0 - 11476 0 NS NS 0.000000 25.0000 0 - 11477 0 NS NS 0.000000 25.0000 0 - 11478 0 NS NS 0.000000 25.0000 0 - 11479 0 NS NS 0.000000 25.0000 0 - 11480 0 NS NS 0.000000 25.0000 0 - 11481 0 NS NS 0.000000 25.0000 0 - 11482 0 NS NS 0.000000 25.0000 0 - 11483 0 NS NS 0.000000 25.0000 0 - 11484 0 NS NS 0.000000 25.0000 0 - 11485 0 NS NS 0.000000 25.0000 0 - 11486 0 NS NS 0.000000 25.0000 0 - 11487 0 NS NS 0.000000 25.0000 0 - 11488 0 NS NS 0.000000 25.0000 0 - 11489 0 NS NS 0.000000 25.0000 0 - 11490 0 NS NS 0.000000 25.0000 0 - 11491 0 NS NS 0.000000 25.0000 0 - 11492 0 NS NS 0.000000 25.0000 0 - 11493 0 NS NS 0.000000 25.0000 0 - 11494 0 NS NS 0.000000 25.0000 0 - 11495 0 NS NS 0.000000 25.0000 0 - 11496 0 NS NS 0.000000 25.0000 0 - 11497 0 NS NS 0.000000 25.0000 0 - 11498 0 NS NS 0.000000 25.0000 0 - 11499 0 NS NS 0.000000 25.0000 0 - 11500 0 NS NS 0.000000 25.0000 0 - 11501 0 NS NS 0.000000 25.0000 0 - 11502 0 NS NS 0.000000 25.0000 0 - 11503 0 NS NS 0.000000 25.0000 0 - 11504 0 NS NS 0.000000 25.0000 0 - 11505 0 NS NS 0.000000 25.0000 0 - 11506 0 NS NS 0.000000 25.0000 0 - 11507 0 NS NS 0.000000 25.0000 0 - 11508 0 NS NS 0.000000 25.0000 0 - 11509 0 NS NS 0.000000 25.0000 0 - 11510 0 NS NS 0.000000 25.0000 0 - 11511 0 NS NS 0.000000 25.0000 0 - 11512 0 NS NS 0.000000 25.0000 0 - 11513 0 NS NS 0.000000 25.0000 0 - 11514 0 NS NS 0.000000 25.0000 0 - 11515 0 NS NS 0.000000 25.0000 0 - 11516 0 NS NS 0.000000 25.0000 0 - 11517 0 NS NS 0.000000 25.0000 0 - 11518 0 NS NS 0.000000 25.0000 0 - 11519 0 NS NS 0.000000 25.0000 0 - 11520 0 NS NS 0.000000 25.0000 0 - 11521 0 NS NS 0.000000 25.0000 0 - 11522 0 NS NS 0.000000 25.0000 0 - 11523 0 NS NS 0.000000 25.0000 0 - 11524 0 NS NS 0.000000 25.0000 0 - 11525 0 NS NS 0.000000 25.0000 0 - 11526 0 NS NS 0.000000 25.0000 0 - 11527 0 NS NS 0.000000 25.0000 0 - 11528 0 NS NS 0.000000 25.0000 0 - 11529 0 NS NS 0.000000 25.0000 0 - 11530 0 NS NS 0.000000 25.0000 0 - 11531 0 NS NS 0.000000 25.0000 0 - 11532 0 NS NS 0.000000 25.0000 0 - 11533 0 NS NS 0.000000 25.0000 0 - 11534 0 NS NS 0.000000 25.0000 0 - 11535 0 NS NS 0.000000 25.0000 0 - 11536 0 NS NS 0.000000 25.0000 0 - 11537 0 NS NS 0.000000 25.0000 0 - 11538 0 NS NS 0.000000 25.0000 0 - 11539 0 NS NS 0.000000 25.0000 0 - 11540 0 NS NS 0.000000 25.0000 0 - 11541 0 NS NS 0.000000 25.0000 0 - 11542 0 NS NS 0.000000 25.0000 0 - 11543 0 NS NS 0.000000 25.0000 0 - 11544 0 NS NS 0.000000 25.0000 0 - 11545 0 NS NS 0.000000 25.0000 0 - 11546 0 NS NS 0.000000 25.0000 0 - 11547 0 NS NS 0.000000 25.0000 0 - 11548 0 NS NS 0.000000 25.0000 0 - 11549 0 NS NS 0.000000 25.0000 0 - 11550 0 NS NS 0.000000 25.0000 0 - 11551 0 NS NS 0.000000 25.0000 0 - 11552 0 NS NS 0.000000 25.0000 0 - 11553 0 NS NS 0.000000 25.0000 0 - 11554 0 NS NS 0.000000 25.0000 0 - 11555 0 NS NS 0.000000 25.0000 0 - 11556 0 NS NS 0.000000 25.0000 0 - 11557 0 NS NS 0.000000 25.0000 0 - 11558 0 NS NS 0.000000 25.0000 0 - 11559 0 NS NS 0.000000 25.0000 0 - 11560 0 NS NS 0.000000 25.0000 0 - 11561 0 NS NS 0.000000 25.0000 0 - 11562 0 NS NS 0.000000 25.0000 0 - 11563 0 NS NS 0.000000 25.0000 0 - 11564 0 NS NS 0.000000 25.0000 0 - 11565 0 NS NS 0.000000 25.0000 0 - 11566 0 NS NS 0.000000 25.0000 0 - 11567 0 NS NS 0.000000 25.0000 0 - 11568 0 NS NS 0.000000 25.0000 0 - 11569 0 NS NS 0.000000 25.0000 0 - 11570 0 NS NS 0.000000 25.0000 0 - 11571 0 NS NS 0.000000 25.0000 0 - 11572 0 NS NS 0.000000 25.0000 0 - 11573 0 NS NS 0.000000 25.0000 0 - 11574 0 NS NS 0.000000 25.0000 0 - 11575 0 NS NS 0.000000 25.0000 0 - 11576 0 NS NS 0.000000 25.0000 0 - 11577 0 NS NS 0.000000 25.0000 0 - 11578 0 NS NS 0.000000 25.0000 0 - 11579 0 NS NS 0.000000 25.0000 0 - 11580 0 NS NS 0.000000 25.0000 0 - 11581 0 NS NS 0.000000 25.0000 0 - 11582 0 NS NS 0.000000 25.0000 0 - 11583 0 NS NS 0.000000 25.0000 0 - 11584 0 NS NS 0.000000 25.0000 0 - 11585 0 NS NS 0.000000 25.0000 0 - 11586 0 NS NS 0.000000 25.0000 0 - 11587 0 NS NS 0.000000 25.0000 0 - 11588 0 NS NS 0.000000 25.0000 0 - 11589 0 NS NS 0.000000 25.0000 0 - 11590 0 NS NS 0.000000 25.0000 0 - 11591 0 NS NS 0.000000 25.0000 0 - 11592 0 NS NS 0.000000 25.0000 0 - 11593 0 NS NS 0.000000 25.0000 0 - 11594 0 NS NS 0.000000 25.0000 0 - 11595 0 NS NS 0.000000 25.0000 0 - 11596 0 NS NS 0.000000 25.0000 0 - 11597 0 NS NS 0.000000 25.0000 0 - 11598 0 NS NS 0.000000 25.0000 0 - 11599 0 NS NS 0.000000 25.0000 0 - 11600 0 NS NS 0.000000 25.0000 0 - 11601 0 NS NS 0.000000 25.0000 0 - 11602 0 NS NS 0.000000 25.0000 0 - 11603 0 NS NS 0.000000 25.0000 0 - 11604 0 NS NS 0.000000 25.0000 0 - 11605 0 NS NS 0.000000 25.0000 0 - 11606 0 NS NS 0.000000 25.0000 0 - 11607 0 NS NS 0.000000 25.0000 0 - 11608 0 NS NS 0.000000 25.0000 0 - 11609 0 NS NS 0.000000 25.0000 0 - 11610 0 NS NS 0.000000 25.0000 0 - 11611 0 NS NS 0.000000 25.0000 0 - 11612 0 NS NS 0.000000 25.0000 0 - 11613 0 NS NS 0.000000 25.0000 0 - 11614 0 NS NS 0.000000 25.0000 0 - 11615 0 NS NS 0.000000 25.0000 0 - 11616 0 NS NS 0.000000 25.0000 0 - 11617 0 NS NS 0.000000 25.0000 0 - 11618 0 NS NS 0.000000 25.0000 0 - 11619 0 NS NS 0.000000 25.0000 0 - 11620 0 NS NS 0.000000 25.0000 0 - 11621 0 NS NS 0.000000 25.0000 0 - 11622 0 NS NS 0.000000 25.0000 0 - 11623 0 NS NS 0.000000 25.0000 0 - 11624 0 NS NS 0.000000 25.0000 0 - 11625 0 NS NS 0.000000 25.0000 0 - 11626 0 NS NS 0.000000 25.0000 0 - 11627 0 NS NS 0.000000 25.0000 0 - 11628 0 NS NS 0.000000 25.0000 0 - 11629 0 NS NS 0.000000 25.0000 0 - 11630 0 NS NS 0.000000 25.0000 0 - 11631 0 NS NS 0.000000 25.0000 0 - 11632 0 NS NS 0.000000 25.0000 0 - 11633 0 NS NS 0.000000 25.0000 0 - 11634 0 NS NS 0.000000 25.0000 0 - 11635 0 NS NS 0.000000 25.0000 0 - 11636 0 NS NS 0.000000 25.0000 0 - 11637 0 NS NS 0.000000 25.0000 0 - 11638 0 NS NS 0.000000 25.0000 0 - 11639 0 NS NS 0.000000 25.0000 0 - 11640 0 NS NS 0.000000 25.0000 0 - 11641 0 NS NS 0.000000 25.0000 0 - 11642 0 NS NS 0.000000 25.0000 0 - 11643 0 NS NS 0.000000 25.0000 0 - 11644 0 NS NS 0.000000 25.0000 0 - 11645 0 NS NS 0.000000 25.0000 0 - 11646 0 NS NS 0.000000 25.0000 0 - 11647 0 NS NS 0.000000 25.0000 0 - 11648 0 NS NS 0.000000 25.0000 0 - 11649 0 NS NS 0.000000 25.0000 0 - 11650 0 NS NS 0.000000 25.0000 0 - 11651 0 NS NS 0.000000 25.0000 0 - 11652 0 NS NS 0.000000 25.0000 0 - 11653 0 NS NS 0.000000 25.0000 0 - 11654 0 NS NS 0.000000 25.0000 0 - 11655 0 NS NS 0.000000 25.0000 0 - 11656 0 NS NS 0.000000 25.0000 0 - 11657 0 NS NS 0.000000 25.0000 0 - 11658 0 NS NS 0.000000 25.0000 0 - 11659 0 NS NS 0.000000 25.0000 0 - 11660 0 NS NS 0.000000 25.0000 0 - 11661 0 NS NS 0.000000 25.0000 0 - 11662 0 NS NS 0.000000 25.0000 0 - 11663 0 NS NS 0.000000 25.0000 0 - 11664 0 NS NS 0.000000 25.0000 0 - 11665 0 NS NS 0.000000 25.0000 0 - 11666 0 NS NS 0.000000 25.0000 0 - 11667 0 NS NS 0.000000 25.0000 0 - 11668 0 NS NS 0.000000 25.0000 0 - 11669 0 NS NS 0.000000 25.0000 0 - 11670 0 NS NS 0.000000 25.0000 0 - 11671 0 NS NS 0.000000 25.0000 0 - 11672 0 NS NS 0.000000 25.0000 0 - 11673 0 NS NS 0.000000 25.0000 0 - 11674 0 NS NS 0.000000 25.0000 0 - 11675 0 NS NS 0.000000 25.0000 0 - 11676 0 NS NS 0.000000 25.0000 0 - 11677 0 NS NS 0.000000 25.0000 0 - 11678 0 NS NS 0.000000 25.0000 0 - 11679 0 NS NS 0.000000 25.0000 0 - 11680 0 NS NS 0.000000 25.0000 0 - 11681 0 NS NS 0.000000 25.0000 0 - 11682 0 NS NS 0.000000 25.0000 0 - 11683 0 NS NS 0.000000 25.0000 0 - 11684 0 NS NS 0.000000 25.0000 0 - 11685 0 NS NS 0.000000 25.0000 0 - 11686 0 NS NS 0.000000 25.0000 0 - 11687 0 NS NS 0.000000 25.0000 0 - 11688 0 NS NS 0.000000 25.0000 0 - 11689 0 NS NS 0.000000 25.0000 0 - 11690 0 NS NS 0.000000 25.0000 0 - 11691 0 NS NS 0.000000 25.0000 0 - 11692 0 NS NS 0.000000 25.0000 0 - 11693 0 NS NS 0.000000 25.0000 0 - 11694 0 NS NS 0.000000 25.0000 0 - 11695 0 NS NS 0.000000 25.0000 0 - 11696 0 NS NS 0.000000 25.0000 0 - 11697 0 NS NS 0.000000 25.0000 0 - 11698 0 NS NS 0.000000 25.0000 0 - 11699 0 NS NS 0.000000 25.0000 0 - 11700 0 NS NS 0.000000 25.0000 0 - 11701 0 NS NS 0.000000 25.0000 0 - 11702 0 NS NS 0.000000 25.0000 0 - 11703 0 NS NS 0.000000 25.0000 0 - 11704 0 NS NS 0.000000 25.0000 0 - 11705 0 NS NS 0.000000 25.0000 0 - 11706 0 NS NS 0.000000 25.0000 0 - 11707 0 NS NS 0.000000 25.0000 0 - 11708 0 NS NS 0.000000 25.0000 0 - 11709 0 NS NS 0.000000 25.0000 0 - 11710 0 NS NS 0.000000 25.0000 0 - 11711 0 NS NS 0.000000 25.0000 0 - 11712 0 NS NS 0.000000 25.0000 0 - 11713 0 NS NS 0.000000 25.0000 0 - 11714 0 NS NS 0.000000 25.0000 0 - 11715 0 NS NS 0.000000 25.0000 0 - 11716 0 NS NS 0.000000 25.0000 0 - 11717 0 NS NS 0.000000 25.0000 0 - 11718 0 NS NS 0.000000 25.0000 0 - 11719 0 NS NS 0.000000 25.0000 0 - 11720 0 NS NS 0.000000 25.0000 0 - 11721 0 NS NS 0.000000 25.0000 0 - 11722 0 NS NS 0.000000 25.0000 0 - 11723 0 NS NS 0.000000 25.0000 0 - 11724 0 NS NS 0.000000 25.0000 0 - 11725 0 NS NS 0.000000 25.0000 0 - 11726 0 NS NS 0.000000 25.0000 0 - 11727 0 NS NS 0.000000 25.0000 0 - 11728 0 NS NS 0.000000 25.0000 0 - 11729 0 NS NS 0.000000 25.0000 0 - 11730 0 NS NS 0.000000 25.0000 0 - 11731 0 NS NS 0.000000 25.0000 0 - 11732 0 NS NS 0.000000 25.0000 0 - 11733 0 NS NS 0.000000 25.0000 0 - 11734 0 NS NS 0.000000 25.0000 0 - 11735 0 NS NS 0.000000 25.0000 0 - 11736 0 NS NS 0.000000 25.0000 0 - 11737 0 NS NS 0.000000 25.0000 0 - 11738 0 NS NS 0.000000 25.0000 0 - 11739 0 NS NS 0.000000 25.0000 0 - 11740 0 NS NS 0.000000 25.0000 0 - 11741 0 NS NS 0.000000 25.0000 0 - 11742 0 NS NS 0.000000 25.0000 0 - 11743 0 NS NS 0.000000 25.0000 0 - 11744 0 NS NS 0.000000 25.0000 0 - 11745 0 NS NS 0.000000 25.0000 0 - 11746 0 NS NS 0.000000 25.0000 0 - 11747 0 NS NS 0.000000 25.0000 0 - 11748 0 NS NS 0.000000 25.0000 0 - 11749 0 NS NS 0.000000 25.0000 0 - 11750 0 NS NS 0.000000 25.0000 0 - 11751 0 NS NS 0.000000 25.0000 0 - 11752 0 NS NS 0.000000 25.0000 0 - 11753 0 NS NS 0.000000 25.0000 0 - 11754 0 NS NS 0.000000 25.0000 0 - 11755 0 NS NS 0.000000 25.0000 0 - 11756 0 NS NS 0.000000 25.0000 0 - 11757 0 NS NS 0.000000 25.0000 0 - 11758 0 NS NS 0.000000 25.0000 0 - 11759 0 NS NS 0.000000 25.0000 0 - 11760 0 NS NS 0.000000 25.0000 0 - 11761 0 NS NS 0.000000 25.0000 0 - 11762 0 NS NS 0.000000 25.0000 0 - 11763 0 NS NS 0.000000 25.0000 0 - 11764 0 NS NS 0.000000 25.0000 0 - 11765 0 NS NS 0.000000 25.0000 0 - 11766 0 NS NS 0.000000 25.0000 0 - 11767 0 NS NS 0.000000 25.0000 0 - 11768 0 NS NS 0.000000 25.0000 0 - 11769 0 NS NS 0.000000 25.0000 0 - 11770 0 NS NS 0.000000 25.0000 0 - 11771 0 NS NS 0.000000 25.0000 0 - 11772 0 NS NS 0.000000 25.0000 0 - 11773 0 NS NS 0.000000 25.0000 0 - 11774 0 NS NS 0.000000 25.0000 0 - 11775 0 NS NS 0.000000 25.0000 0 - 11776 0 NS NS 0.000000 25.0000 0 - 11777 0 NS NS 0.000000 25.0000 0 - 11778 0 NS NS 0.000000 25.0000 0 - 11779 0 NS NS 0.000000 25.0000 0 - 11780 0 NS NS 0.000000 25.0000 0 - 11781 0 NS NS 0.000000 25.0000 0 - 11782 0 NS NS 0.000000 25.0000 0 - 11783 0 NS NS 0.000000 25.0000 0 - 11784 0 NS NS 0.000000 25.0000 0 - 11785 0 NS NS 0.000000 25.0000 0 - 11786 0 NS NS 0.000000 25.0000 0 - 11787 0 NS NS 0.000000 25.0000 0 - 11788 0 NS NS 0.000000 25.0000 0 - 11789 0 NS NS 0.000000 25.0000 0 - 11790 0 NS NS 0.000000 25.0000 0 - 11791 0 NS NS 0.000000 25.0000 0 - 11792 0 NS NS 0.000000 25.0000 0 - 11793 0 NS NS 0.000000 25.0000 0 - 11794 0 NS NS 0.000000 25.0000 0 - 11795 0 NS NS 0.000000 25.0000 0 - 11796 0 NS NS 0.000000 25.0000 0 - 11797 0 NS NS 0.000000 25.0000 0 - 11798 0 NS NS 0.000000 25.0000 0 - 11799 0 NS NS 0.000000 25.0000 0 - 11800 0 NS NS 0.000000 25.0000 0 - 11801 0 NS NS 0.000000 25.0000 0 - 11802 0 NS NS 0.000000 25.0000 0 - 11803 0 NS NS 0.000000 25.0000 0 - 11804 0 NS NS 0.000000 25.0000 0 - 11805 0 NS NS 0.000000 25.0000 0 - 11806 0 NS NS 0.000000 25.0000 0 - 11807 0 NS NS 0.000000 25.0000 0 - 11808 0 NS NS 0.000000 25.0000 0 - 11809 0 NS NS 0.000000 25.0000 0 - 11810 0 NS NS 0.000000 25.0000 0 - 11811 0 NS NS 0.000000 25.0000 0 - 11812 0 NS NS 0.000000 25.0000 0 - 11813 0 NS NS 0.000000 25.0000 0 - 11814 0 NS NS 0.000000 25.0000 0 - 11815 0 NS NS 0.000000 25.0000 0 - 11816 0 NS NS 0.000000 25.0000 0 - 11817 0 NS NS 0.000000 25.0000 0 - 11818 0 NS NS 0.000000 25.0000 0 - 11819 0 NS NS 0.000000 25.0000 0 - 11820 0 NS NS 0.000000 25.0000 0 - 11821 0 NS NS 0.000000 25.0000 0 - 11822 0 NS NS 0.000000 25.0000 0 - 11823 0 NS NS 0.000000 25.0000 0 - 11824 0 NS NS 0.000000 25.0000 0 - 11825 0 NS NS 0.000000 25.0000 0 - 11826 0 NS NS 0.000000 25.0000 0 - 11827 0 NS NS 0.000000 25.0000 0 - 11828 0 NS NS 0.000000 25.0000 0 - 11829 0 NS NS 0.000000 25.0000 0 - 11830 0 NS NS 0.000000 25.0000 0 - 11831 0 NS NS 0.000000 25.0000 0 - 11832 0 NS NS 0.000000 25.0000 0 - 11833 0 NS NS 0.000000 25.0000 0 - 11834 0 NS NS 0.000000 25.0000 0 - 11835 0 NS NS 0.000000 25.0000 0 - 11836 0 NS NS 0.000000 25.0000 0 - 11837 0 NS NS 0.000000 25.0000 0 - 11838 0 NS NS 0.000000 25.0000 0 - 11839 0 NS NS 0.000000 25.0000 0 - 11840 0 NS NS 0.000000 25.0000 0 - 11841 0 NS NS 0.000000 25.0000 0 - 11842 0 NS NS 0.000000 25.0000 0 - 11843 0 NS NS 0.000000 25.0000 0 - 11844 0 NS NS 0.000000 25.0000 0 - 11845 0 NS NS 0.000000 25.0000 0 - 11846 0 NS NS 0.000000 25.0000 0 - 11847 0 NS NS 0.000000 25.0000 0 - 11848 0 NS NS 0.000000 25.0000 0 - 11849 0 NS NS 0.000000 25.0000 0 - 11850 0 NS NS 0.000000 25.0000 0 - 11851 0 NS NS 0.000000 25.0000 0 - 11852 0 NS NS 0.000000 25.0000 0 - 11853 0 NS NS 0.000000 25.0000 0 - 11854 0 NS NS 0.000000 25.0000 0 - 11855 0 NS NS 0.000000 25.0000 0 - 11856 0 NS NS 0.000000 25.0000 0 - 11857 0 NS NS 0.000000 25.0000 0 - 11858 0 NS NS 0.000000 25.0000 0 - 11859 0 NS NS 0.000000 25.0000 0 - 11860 0 NS NS 0.000000 25.0000 0 - 11861 0 NS NS 0.000000 25.0000 0 - 11862 0 NS NS 0.000000 25.0000 0 - 11863 0 NS NS 0.000000 25.0000 0 - 11864 0 NS NS 0.000000 25.0000 0 - 11865 0 NS NS 0.000000 25.0000 0 - 11866 0 NS NS 0.000000 25.0000 0 - 11867 0 NS NS 0.000000 25.0000 0 - 11868 0 NS NS 0.000000 25.0000 0 - 11869 0 NS NS 0.000000 25.0000 0 - 11870 0 NS NS 0.000000 25.0000 0 - 11871 0 NS NS 0.000000 25.0000 0 - 11872 0 NS NS 0.000000 25.0000 0 - 11873 0 NS NS 0.000000 25.0000 0 - 11874 0 NS NS 0.000000 25.0000 0 - 11875 0 NS NS 0.000000 25.0000 0 - 11876 0 NS NS 0.000000 25.0000 0 - 11877 0 NS NS 0.000000 25.0000 0 - 11878 0 NS NS 0.000000 25.0000 0 - 11879 0 NS NS 0.000000 25.0000 0 - 11880 0 NS NS 0.000000 25.0000 0 - 11881 0 NS NS 0.000000 25.0000 0 - 11882 0 NS NS 0.000000 25.0000 0 - 11883 0 NS NS 0.000000 25.0000 0 - 11884 0 NS NS 0.000000 25.0000 0 - 11885 0 NS NS 0.000000 25.0000 0 - 11886 0 NS NS 0.000000 25.0000 0 - 11887 0 NS NS 0.000000 25.0000 0 - 11888 0 NS NS 0.000000 25.0000 0 - 11889 0 NS NS 0.000000 25.0000 0 - 11890 0 NS NS 0.000000 25.0000 0 - 11891 0 NS NS 0.000000 25.0000 0 - 11892 0 NS NS 0.000000 25.0000 0 - 11893 0 NS NS 0.000000 25.0000 0 - 11894 0 NS NS 0.000000 25.0000 0 - 11895 0 NS NS 0.000000 25.0000 0 - 11896 0 NS NS 0.000000 25.0000 0 - 11897 0 NS NS 0.000000 25.0000 0 - 11898 0 NS NS 0.000000 25.0000 0 - 11899 0 NS NS 0.000000 25.0000 0 - 11900 0 NS NS 0.000000 25.0000 0 - 11901 0 NS NS 0.000000 25.0000 0 - 11902 0 NS NS 0.000000 25.0000 0 - 11903 0 NS NS 0.000000 25.0000 0 - 11904 0 NS NS 0.000000 25.0000 0 - 11905 0 NS NS 0.000000 25.0000 0 - 11906 0 NS NS 0.000000 25.0000 0 - 11907 0 NS NS 0.000000 25.0000 0 - 11908 0 NS NS 0.000000 25.0000 0 - 11909 0 NS NS 0.000000 25.0000 0 - 11910 0 NS NS 0.000000 25.0000 0 - 11911 0 NS NS 0.000000 25.0000 0 - 11912 0 NS NS 0.000000 25.0000 0 - 11913 0 NS NS 0.000000 25.0000 0 - 11914 0 NS NS 0.000000 25.0000 0 - 11915 0 NS NS 0.000000 25.0000 0 - 11916 0 NS NS 0.000000 25.0000 0 - 11917 0 NS NS 0.000000 25.0000 0 - 11918 0 NS NS 0.000000 25.0000 0 - 11919 0 NS NS 0.000000 25.0000 0 - 11920 0 NS NS 0.000000 25.0000 0 - 11921 0 NS NS 0.000000 25.0000 0 - 11922 0 NS NS 0.000000 25.0000 0 - 11923 0 NS NS 0.000000 25.0000 0 - 11924 0 NS NS 0.000000 25.0000 0 - 11925 0 NS NS 0.000000 25.0000 0 - 11926 0 NS NS 0.000000 25.0000 0 - 11927 0 NS NS 0.000000 25.0000 0 - 11928 0 NS NS 0.000000 25.0000 0 - 11929 0 NS NS 0.000000 25.0000 0 - 11930 0 NS NS 0.000000 25.0000 0 - 11931 0 NS NS 0.000000 25.0000 0 - 11932 0 NS NS 0.000000 25.0000 0 - 11933 0 NS NS 0.000000 25.0000 0 - 11934 0 NS NS 0.000000 25.0000 0 - 11935 0 NS NS 0.000000 25.0000 0 - 11936 0 NS NS 0.000000 25.0000 0 - 11937 0 NS NS 0.000000 25.0000 0 - 11938 0 NS NS 0.000000 25.0000 0 - 11939 0 NS NS 0.000000 25.0000 0 - 11940 0 NS NS 0.000000 25.0000 0 - 11941 0 NS NS 0.000000 25.0000 0 - 11942 0 NS NS 0.000000 25.0000 0 - 11943 0 NS NS 0.000000 25.0000 0 - 11944 0 NS NS 0.000000 25.0000 0 - 11945 0 NS NS 0.000000 25.0000 0 - 11946 0 NS NS 0.000000 25.0000 0 - 11947 0 NS NS 0.000000 25.0000 0 - 11948 0 NS NS 0.000000 25.0000 0 - 11949 0 NS NS 0.000000 25.0000 0 - 11950 0 NS NS 0.000000 25.0000 0 - 11951 0 NS NS 0.000000 25.0000 0 - 11952 0 NS NS 0.000000 25.0000 0 - 11953 0 NS NS 0.000000 25.0000 0 - 11954 0 NS NS 0.000000 25.0000 0 - 11955 0 NS NS 0.000000 25.0000 0 - 11956 0 NS NS 0.000000 25.0000 0 - 11957 0 NS NS 0.000000 25.0000 0 - 11958 0 NS NS 0.000000 25.0000 0 - 11959 0 NS NS 0.000000 25.0000 0 - 11960 0 NS NS 0.000000 25.0000 0 - 11961 0 NS NS 0.000000 25.0000 0 - 11962 0 NS NS 0.000000 25.0000 0 - 11963 0 NS NS 0.000000 25.0000 0 - 11964 0 NS NS 0.000000 25.0000 0 - 11965 0 NS NS 0.000000 25.0000 0 - 11966 0 NS NS 0.000000 25.0000 0 - 11967 0 NS NS 0.000000 25.0000 0 - 11968 0 NS NS 0.000000 25.0000 0 - 11969 0 NS NS 0.000000 25.0000 0 - 11970 0 NS NS 0.000000 25.0000 0 - 11971 0 NS NS 0.000000 25.0000 0 - 11972 0 NS NS 0.000000 25.0000 0 - 11973 0 NS NS 0.000000 25.0000 0 - 11974 0 NS NS 0.000000 25.0000 0 - 11975 0 NS NS 0.000000 25.0000 0 - 11976 0 NS NS 0.000000 25.0000 0 - 11977 0 NS NS 0.000000 25.0000 0 - 11978 0 NS NS 0.000000 25.0000 0 - 11979 0 NS NS 0.000000 25.0000 0 - 11980 0 NS NS 0.000000 25.0000 0 - 11981 0 NS NS 0.000000 25.0000 0 - 11982 0 NS NS 0.000000 25.0000 0 - 11983 0 NS NS 0.000000 25.0000 0 - 11984 0 NS NS 0.000000 25.0000 0 - 11985 0 NS NS 0.000000 25.0000 0 - 11986 0 NS NS 0.000000 25.0000 0 - 11987 0 NS NS 0.000000 25.0000 0 - 11988 0 NS NS 0.000000 25.0000 0 - 11989 0 NS NS 0.000000 25.0000 0 - 11990 0 NS NS 0.000000 25.0000 0 - 11991 0 NS NS 0.000000 25.0000 0 - 11992 0 NS NS 0.000000 25.0000 0 - 11993 0 NS NS 0.000000 25.0000 0 - 11994 0 NS NS 0.000000 25.0000 0 - 11995 0 NS NS 0.000000 25.0000 0 - 11996 0 NS NS 0.000000 25.0000 0 - 11997 0 NS NS 0.000000 25.0000 0 - 11998 0 NS NS 0.000000 25.0000 0 - 11999 0 NS NS 0.000000 25.0000 0 - 12000 0 NS NS 0.000000 25.0000 0 - 12001 0 NS NS 0.000000 25.0000 0 - 12002 0 NS NS 0.000000 25.0000 0 - 12003 0 NS NS 0.000000 25.0000 0 - 12004 0 NS NS 0.000000 25.0000 0 - 12005 0 NS NS 0.000000 25.0000 0 - 12006 0 NS NS 0.000000 25.0000 0 - 12007 0 NS NS 0.000000 25.0000 0 - 12008 0 NS NS 0.000000 25.0000 0 - 12009 0 NS NS 0.000000 25.0000 0 - 12010 0 NS NS 0.000000 25.0000 0 - 12011 0 NS NS 0.000000 25.0000 0 - 12012 0 NS NS 0.000000 25.0000 0 - 12013 0 NS NS 0.000000 25.0000 0 - 12014 0 NS NS 0.000000 25.0000 0 - 12015 0 NS NS 0.000000 25.0000 0 - 12016 0 NS NS 0.000000 25.0000 0 - 12017 0 NS NS 0.000000 25.0000 0 - 12018 0 NS NS 0.000000 25.0000 0 - 12019 0 NS NS 0.000000 25.0000 0 - 12020 0 NS NS 0.000000 25.0000 0 - 12021 0 NS NS 0.000000 25.0000 0 - 12022 0 NS NS 0.000000 25.0000 0 - 12023 0 NS NS 0.000000 25.0000 0 - 12024 0 NS NS 0.000000 25.0000 0 - 12025 0 OS OS 0.000000 5.0000 0 - 12026 0 OS OS 0.000000 5.0000 0 - 12027 0 OS OS 0.000000 5.0000 0 - 12028 0 OS OS 0.000000 5.0000 0 - 12029 0 OS OS 0.000000 5.0000 0 - 12030 0 OS OS 0.000000 5.0000 0 - 12031 0 OS OS 0.000000 5.0000 0 - 12032 0 OS OS 0.000000 5.0000 0 - 12033 0 OS OS 0.000000 5.0000 0 - 12034 0 OS OS 0.000000 5.0000 0 - 12035 0 OS OS 0.000000 5.0000 0 - 12036 0 OS OS 0.000000 5.0000 0 - 12037 0 OS OS 0.000000 5.0000 0 - 12038 0 OS OS 0.000000 5.0000 0 - 12039 0 OS OS 0.000000 5.0000 0 - 12040 0 OS OS 0.000000 5.0000 0 - 12041 0 OS OS 0.000000 5.0000 0 - 12042 0 OS OS 0.000000 5.0000 0 - 12043 0 OS OS 0.000000 5.0000 0 - 12044 0 OS OS 0.000000 5.0000 0 - 12045 0 OS OS 0.000000 5.0000 0 - 12046 0 OS OS 0.000000 5.0000 0 - 12047 0 OS OS 0.000000 5.0000 0 - 12048 0 OS OS 0.000000 5.0000 0 - 12049 0 OS OS 0.000000 5.0000 0 - 12050 0 OS OS 0.000000 5.0000 0 - 12051 0 OS OS 0.000000 5.0000 0 - 12052 0 OS OS 0.000000 5.0000 0 - 12053 0 OS OS 0.000000 5.0000 0 - 12054 0 OS OS 0.000000 5.0000 0 - 12055 0 OS OS 0.000000 5.0000 0 - 12056 0 OS OS 0.000000 5.0000 0 - 12057 0 OS OS 0.000000 5.0000 0 - 12058 0 OS OS 0.000000 5.0000 0 - 12059 0 OS OS 0.000000 5.0000 0 - 12060 0 OS OS 0.000000 5.0000 0 - 12061 0 OS OS 0.000000 5.0000 0 - 12062 0 OS OS 0.000000 5.0000 0 - 12063 0 OS OS 0.000000 5.0000 0 - 12064 0 OS OS 0.000000 5.0000 0 - 12065 0 OS OS 0.000000 5.0000 0 - 12066 0 OS OS 0.000000 5.0000 0 - 12067 0 OS OS 0.000000 5.0000 0 - 12068 0 OS OS 0.000000 5.0000 0 - 12069 0 OS OS 0.000000 5.0000 0 - 12070 0 OS OS 0.000000 5.0000 0 - 12071 0 OS OS 0.000000 5.0000 0 - 12072 0 OS OS 0.000000 5.0000 0 - 12073 0 OS OS 0.000000 5.0000 0 - 12074 0 OS OS 0.000000 5.0000 0 - 12075 0 OS OS 0.000000 5.0000 0 - 12076 0 OS OS 0.000000 5.0000 0 - 12077 0 OS OS 0.000000 5.0000 0 - 12078 0 OS OS 0.000000 5.0000 0 - 12079 0 OS OS 0.000000 5.0000 0 - 12080 0 OS OS 0.000000 5.0000 0 - 12081 0 OS OS 0.000000 5.0000 0 - 12082 0 OS OS 0.000000 5.0000 0 - 12083 0 OS OS 0.000000 5.0000 0 - 12084 0 OS OS 0.000000 5.0000 0 - 12085 0 OS OS 0.000000 5.0000 0 - 12086 0 OS OS 0.000000 5.0000 0 - 12087 0 OS OS 0.000000 5.0000 0 - 12088 0 OS OS 0.000000 5.0000 0 - 12089 0 OS OS 0.000000 5.0000 0 - 12090 0 OS OS 0.000000 5.0000 0 - 12091 0 OS OS 0.000000 5.0000 0 - 12092 0 OS OS 0.000000 5.0000 0 - 12093 0 OS OS 0.000000 5.0000 0 - 12094 0 OS OS 0.000000 5.0000 0 - 12095 0 OS OS 0.000000 5.0000 0 - 12096 0 OS OS 0.000000 5.0000 0 - 12097 0 OS OS 0.000000 5.0000 0 - 12098 0 OS OS 0.000000 5.0000 0 - 12099 0 OS OS 0.000000 5.0000 0 - 12100 0 OS OS 0.000000 5.0000 0 - 12101 0 OS OS 0.000000 5.0000 0 - 12102 0 OS OS 0.000000 5.0000 0 - 12103 0 OS OS 0.000000 5.0000 0 - 12104 0 OS OS 0.000000 5.0000 0 - 12105 0 OS OS 0.000000 5.0000 0 - 12106 0 OS OS 0.000000 5.0000 0 - 12107 0 OS OS 0.000000 5.0000 0 - 12108 0 OS OS 0.000000 5.0000 0 - 12109 0 OS OS 0.000000 5.0000 0 - 12110 0 OS OS 0.000000 5.0000 0 - 12111 0 OS OS 0.000000 5.0000 0 - 12112 0 OS OS 0.000000 5.0000 0 - 12113 0 OS OS 0.000000 5.0000 0 - 12114 0 OS OS 0.000000 5.0000 0 - 12115 0 OS OS 0.000000 5.0000 0 - 12116 0 OS OS 0.000000 5.0000 0 - 12117 0 OS OS 0.000000 5.0000 0 - 12118 0 OS OS 0.000000 5.0000 0 - 12119 0 OS OS 0.000000 5.0000 0 - 12120 0 OS OS 0.000000 5.0000 0 - 12121 0 OS OS 0.000000 5.0000 0 - 12122 0 OS OS 0.000000 5.0000 0 - 12123 0 OS OS 0.000000 5.0000 0 - 12124 0 OS OS 0.000000 5.0000 0 - 12125 0 OS OS 0.000000 5.0000 0 - 12126 0 OS OS 0.000000 5.0000 0 - 12127 0 OS OS 0.000000 5.0000 0 - 12128 0 OS OS 0.000000 5.0000 0 - 12129 0 OS OS 0.000000 5.0000 0 - 12130 0 OS OS 0.000000 5.0000 0 - 12131 0 OS OS 0.000000 5.0000 0 - 12132 0 OS OS 0.000000 5.0000 0 - 12133 0 OS OS 0.000000 5.0000 0 - 12134 0 OS OS 0.000000 5.0000 0 - 12135 0 OS OS 0.000000 5.0000 0 - 12136 0 OS OS 0.000000 5.0000 0 - 12137 0 OS OS 0.000000 5.0000 0 - 12138 0 OS OS 0.000000 5.0000 0 - 12139 0 OS OS 0.000000 5.0000 0 - 12140 0 OS OS 0.000000 5.0000 0 - 12141 0 OS OS 0.000000 5.0000 0 - 12142 0 OS OS 0.000000 5.0000 0 - 12143 0 OS OS 0.000000 5.0000 0 - 12144 0 OS OS 0.000000 5.0000 0 - 12145 0 OS OS 0.000000 5.0000 0 - 12146 0 OS OS 0.000000 5.0000 0 - 12147 0 OS OS 0.000000 5.0000 0 - 12148 0 OS OS 0.000000 5.0000 0 - 12149 0 OS OS 0.000000 5.0000 0 - 12150 0 OS OS 0.000000 5.0000 0 - 12151 0 OS OS 0.000000 5.0000 0 - 12152 0 OS OS 0.000000 5.0000 0 - 12153 0 OS OS 0.000000 5.0000 0 - 12154 0 OS OS 0.000000 5.0000 0 - 12155 0 OS OS 0.000000 5.0000 0 - 12156 0 OS OS 0.000000 5.0000 0 - 12157 0 OS OS 0.000000 5.0000 0 - 12158 0 OS OS 0.000000 5.0000 0 - 12159 0 OS OS 0.000000 5.0000 0 - 12160 0 OS OS 0.000000 5.0000 0 - 12161 0 OS OS 0.000000 5.0000 0 - 12162 0 OS OS 0.000000 5.0000 0 - 12163 0 OS OS 0.000000 5.0000 0 - 12164 0 OS OS 0.000000 5.0000 0 - 12165 0 OS OS 0.000000 5.0000 0 - 12166 0 OS OS 0.000000 5.0000 0 - 12167 0 OS OS 0.000000 5.0000 0 - 12168 0 OS OS 0.000000 5.0000 0 - 12169 0 OS OS 0.000000 5.0000 0 - 12170 0 OS OS 0.000000 5.0000 0 - 12171 0 OS OS 0.000000 5.0000 0 - 12172 0 OS OS 0.000000 5.0000 0 - 12173 0 OS OS 0.000000 5.0000 0 - 12174 0 OS OS 0.000000 5.0000 0 - 12175 0 OS OS 0.000000 5.0000 0 - 12176 0 OS OS 0.000000 5.0000 0 - 12177 0 OS OS 0.000000 5.0000 0 - 12178 0 OS OS 0.000000 5.0000 0 - 12179 0 OS OS 0.000000 5.0000 0 - 12180 0 OS OS 0.000000 5.0000 0 - 12181 0 OS OS 0.000000 5.0000 0 - 12182 0 OS OS 0.000000 5.0000 0 - 12183 0 OS OS 0.000000 5.0000 0 - 12184 0 OS OS 0.000000 5.0000 0 - 12185 0 OS OS 0.000000 5.0000 0 - 12186 0 OS OS 0.000000 5.0000 0 - 12187 0 OS OS 0.000000 5.0000 0 - 12188 0 OS OS 0.000000 5.0000 0 - 12189 0 OS OS 0.000000 5.0000 0 - 12190 0 OS OS 0.000000 5.0000 0 - 12191 0 OS OS 0.000000 5.0000 0 - 12192 0 OS OS 0.000000 5.0000 0 - 12193 0 OS OS 0.000000 5.0000 0 - 12194 0 OS OS 0.000000 5.0000 0 - 12195 0 OS OS 0.000000 5.0000 0 - 12196 0 OS OS 0.000000 5.0000 0 - 12197 0 OS OS 0.000000 5.0000 0 - 12198 0 OS OS 0.000000 5.0000 0 - 12199 0 OS OS 0.000000 5.0000 0 - 12200 0 OS OS 0.000000 5.0000 0 - 12201 0 OS OS 0.000000 5.0000 0 - 12202 0 OS OS 0.000000 5.0000 0 - 12203 0 OS OS 0.000000 5.0000 0 - 12204 0 OS OS 0.000000 5.0000 0 - 12205 0 OS OS 0.000000 5.0000 0 - 12206 0 OS OS 0.000000 5.0000 0 - 12207 0 OS OS 0.000000 5.0000 0 - 12208 0 OS OS 0.000000 5.0000 0 - 12209 0 OS OS 0.000000 5.0000 0 - 12210 0 OS OS 0.000000 5.0000 0 - 12211 0 OS OS 0.000000 5.0000 0 - 12212 0 OS OS 0.000000 5.0000 0 - 12213 0 OS OS 0.000000 5.0000 0 - 12214 0 OS OS 0.000000 5.0000 0 - 12215 0 OS OS 0.000000 5.0000 0 - 12216 0 OS OS 0.000000 5.0000 0 - 12217 0 OS OS 0.000000 5.0000 0 - 12218 0 OS OS 0.000000 5.0000 0 - 12219 0 OS OS 0.000000 5.0000 0 - 12220 0 OS OS 0.000000 5.0000 0 - 12221 0 OS OS 0.000000 5.0000 0 - 12222 0 OS OS 0.000000 5.0000 0 - 12223 0 OS OS 0.000000 5.0000 0 - 12224 0 OS OS 0.000000 5.0000 0 - 12225 0 OS OS 0.000000 5.0000 0 - 12226 0 OS OS 0.000000 5.0000 0 - 12227 0 OS OS 0.000000 5.0000 0 - 12228 0 OS OS 0.000000 5.0000 0 - 12229 0 OS OS 0.000000 5.0000 0 - 12230 0 OS OS 0.000000 5.0000 0 - 12231 0 OS OS 0.000000 5.0000 0 - 12232 0 OS OS 0.000000 5.0000 0 - 12233 0 OS OS 0.000000 5.0000 0 - 12234 0 OS OS 0.000000 5.0000 0 - 12235 0 OS OS 0.000000 5.0000 0 - 12236 0 OS OS 0.000000 5.0000 0 - 12237 0 OS OS 0.000000 5.0000 0 - 12238 0 OS OS 0.000000 5.0000 0 - 12239 0 OS OS 0.000000 5.0000 0 - 12240 0 OS OS 0.000000 5.0000 0 - 12241 0 OS OS 0.000000 5.0000 0 - 12242 0 OS OS 0.000000 5.0000 0 - 12243 0 OS OS 0.000000 5.0000 0 - 12244 0 OS OS 0.000000 5.0000 0 - 12245 0 OS OS 0.000000 5.0000 0 - 12246 0 OS OS 0.000000 5.0000 0 - 12247 0 OS OS 0.000000 5.0000 0 - 12248 0 OS OS 0.000000 5.0000 0 - 12249 0 OS OS 0.000000 5.0000 0 - 12250 0 OS OS 0.000000 5.0000 0 - 12251 0 OS OS 0.000000 5.0000 0 - 12252 0 OS OS 0.000000 5.0000 0 - 12253 0 OS OS 0.000000 5.0000 0 - 12254 0 OS OS 0.000000 5.0000 0 - 12255 0 OS OS 0.000000 5.0000 0 - 12256 0 OS OS 0.000000 5.0000 0 - 12257 0 OS OS 0.000000 5.0000 0 - 12258 0 OS OS 0.000000 5.0000 0 - 12259 0 OS OS 0.000000 5.0000 0 - 12260 0 OS OS 0.000000 5.0000 0 - 12261 0 OS OS 0.000000 5.0000 0 - 12262 0 OS OS 0.000000 5.0000 0 - 12263 0 OS OS 0.000000 5.0000 0 - 12264 0 OS OS 0.000000 5.0000 0 - 12265 0 OS OS 0.000000 5.0000 0 - 12266 0 OS OS 0.000000 5.0000 0 - 12267 0 OS OS 0.000000 5.0000 0 - 12268 0 OS OS 0.000000 5.0000 0 - 12269 0 OS OS 0.000000 5.0000 0 - 12270 0 OS OS 0.000000 5.0000 0 - 12271 0 OS OS 0.000000 5.0000 0 - 12272 0 OS OS 0.000000 5.0000 0 - 12273 0 OS OS 0.000000 5.0000 0 - 12274 0 OS OS 0.000000 5.0000 0 - 12275 0 OS OS 0.000000 5.0000 0 - 12276 0 OS OS 0.000000 5.0000 0 - 12277 0 OS OS 0.000000 5.0000 0 - 12278 0 OS OS 0.000000 5.0000 0 - 12279 0 OS OS 0.000000 5.0000 0 - 12280 0 OS OS 0.000000 5.0000 0 - 12281 0 OS OS 0.000000 5.0000 0 - 12282 0 OS OS 0.000000 5.0000 0 - 12283 0 OS OS 0.000000 5.0000 0 - 12284 0 OS OS 0.000000 5.0000 0 - 12285 0 OS OS 0.000000 5.0000 0 - 12286 0 OS OS 0.000000 5.0000 0 - 12287 0 OS OS 0.000000 5.0000 0 - 12288 0 OS OS 0.000000 5.0000 0 - 12289 0 OS OS 0.000000 5.0000 0 - 12290 0 OS OS 0.000000 5.0000 0 - 12291 0 OS OS 0.000000 5.0000 0 - 12292 0 OS OS 0.000000 5.0000 0 - 12293 0 OS OS 0.000000 5.0000 0 - 12294 0 OS OS 0.000000 5.0000 0 - 12295 0 OS OS 0.000000 5.0000 0 - 12296 0 OS OS 0.000000 5.0000 0 - 12297 0 OS OS 0.000000 5.0000 0 - 12298 0 OS OS 0.000000 5.0000 0 - 12299 0 OS OS 0.000000 5.0000 0 - 12300 0 OS OS 0.000000 5.0000 0 - 12301 0 OS OS 0.000000 5.0000 0 - 12302 0 OS OS 0.000000 5.0000 0 - 12303 0 OS OS 0.000000 5.0000 0 - 12304 0 OS OS 0.000000 5.0000 0 - 12305 0 OS OS 0.000000 5.0000 0 - 12306 0 OS OS 0.000000 5.0000 0 - 12307 0 OS OS 0.000000 5.0000 0 - 12308 0 OS OS 0.000000 5.0000 0 - 12309 0 OS OS 0.000000 5.0000 0 - 12310 0 OS OS 0.000000 5.0000 0 - 12311 0 OS OS 0.000000 5.0000 0 - 12312 0 OS OS 0.000000 5.0000 0 - 12313 0 OS OS 0.000000 5.0000 0 - 12314 0 OS OS 0.000000 5.0000 0 - 12315 0 OS OS 0.000000 5.0000 0 - 12316 0 OS OS 0.000000 5.0000 0 - 12317 0 OS OS 0.000000 5.0000 0 - 12318 0 OS OS 0.000000 5.0000 0 - 12319 0 OS OS 0.000000 5.0000 0 - 12320 0 OS OS 0.000000 5.0000 0 - 12321 0 OS OS 0.000000 5.0000 0 - 12322 0 OS OS 0.000000 5.0000 0 - 12323 0 OS OS 0.000000 5.0000 0 - 12324 0 OS OS 0.000000 5.0000 0 - 12325 0 OS OS 0.000000 5.0000 0 - 12326 0 OS OS 0.000000 5.0000 0 - 12327 0 OS OS 0.000000 5.0000 0 - 12328 0 OS OS 0.000000 5.0000 0 - 12329 0 OS OS 0.000000 5.0000 0 - 12330 0 OS OS 0.000000 5.0000 0 - 12331 0 OS OS 0.000000 5.0000 0 - 12332 0 OS OS 0.000000 5.0000 0 - 12333 0 OS OS 0.000000 5.0000 0 - 12334 0 OS OS 0.000000 5.0000 0 - 12335 0 OS OS 0.000000 5.0000 0 - 12336 0 OS OS 0.000000 5.0000 0 - 12337 0 OS OS 0.000000 5.0000 0 - 12338 0 OS OS 0.000000 5.0000 0 - 12339 0 OS OS 0.000000 5.0000 0 - 12340 0 OS OS 0.000000 5.0000 0 - 12341 0 OS OS 0.000000 5.0000 0 - 12342 0 OS OS 0.000000 5.0000 0 - 12343 0 OS OS 0.000000 5.0000 0 - 12344 0 OS OS 0.000000 5.0000 0 - 12345 0 OS OS 0.000000 5.0000 0 - 12346 0 OS OS 0.000000 5.0000 0 - 12347 0 OS OS 0.000000 5.0000 0 - 12348 0 OS OS 0.000000 5.0000 0 - 12349 0 OS OS 0.000000 5.0000 0 - 12350 0 OS OS 0.000000 5.0000 0 - 12351 0 OS OS 0.000000 5.0000 0 - 12352 0 OS OS 0.000000 5.0000 0 - 12353 0 OS OS 0.000000 5.0000 0 - 12354 0 OS OS 0.000000 5.0000 0 - 12355 0 OS OS 0.000000 5.0000 0 - 12356 0 OS OS 0.000000 5.0000 0 - 12357 0 OS OS 0.000000 5.0000 0 - 12358 0 OS OS 0.000000 5.0000 0 - 12359 0 OS OS 0.000000 5.0000 0 - 12360 0 OS OS 0.000000 5.0000 0 - 12361 0 OS OS 0.000000 5.0000 0 - 12362 0 OS OS 0.000000 5.0000 0 - 12363 0 OS OS 0.000000 5.0000 0 - 12364 0 OS OS 0.000000 5.0000 0 - 12365 0 OS OS 0.000000 5.0000 0 - 12366 0 OS OS 0.000000 5.0000 0 - 12367 0 OS OS 0.000000 5.0000 0 - 12368 0 OS OS 0.000000 5.0000 0 - 12369 0 OS OS 0.000000 5.0000 0 - 12370 0 OS OS 0.000000 5.0000 0 - 12371 0 OS OS 0.000000 5.0000 0 - 12372 0 OS OS 0.000000 5.0000 0 - 12373 0 OS OS 0.000000 5.0000 0 - 12374 0 OS OS 0.000000 5.0000 0 - 12375 0 OS OS 0.000000 5.0000 0 - 12376 0 OS OS 0.000000 5.0000 0 - 12377 0 OS OS 0.000000 5.0000 0 - 12378 0 OS OS 0.000000 5.0000 0 - 12379 0 OS OS 0.000000 5.0000 0 - 12380 0 OS OS 0.000000 5.0000 0 - 12381 0 OS OS 0.000000 5.0000 0 - 12382 0 OS OS 0.000000 5.0000 0 - 12383 0 OS OS 0.000000 5.0000 0 - 12384 0 OS OS 0.000000 5.0000 0 - 12385 0 OS OS 0.000000 5.0000 0 - 12386 0 OS OS 0.000000 5.0000 0 - 12387 0 OS OS 0.000000 5.0000 0 - 12388 0 OS OS 0.000000 5.0000 0 - 12389 0 OS OS 0.000000 5.0000 0 - 12390 0 OS OS 0.000000 5.0000 0 - 12391 0 OS OS 0.000000 5.0000 0 - 12392 0 OS OS 0.000000 5.0000 0 - 12393 0 OS OS 0.000000 5.0000 0 - 12394 0 OS OS 0.000000 5.0000 0 - 12395 0 OS OS 0.000000 5.0000 0 - 12396 0 OS OS 0.000000 5.0000 0 - 12397 0 OS OS 0.000000 5.0000 0 - 12398 0 OS OS 0.000000 5.0000 0 - 12399 0 OS OS 0.000000 5.0000 0 - 12400 0 OS OS 0.000000 5.0000 0 - 12401 0 OS OS 0.000000 5.0000 0 - 12402 0 OS OS 0.000000 5.0000 0 - 12403 0 OS OS 0.000000 5.0000 0 - 12404 0 OS OS 0.000000 5.0000 0 - 12405 0 OS OS 0.000000 5.0000 0 - 12406 0 OS OS 0.000000 5.0000 0 - 12407 0 OS OS 0.000000 5.0000 0 - 12408 0 OS OS 0.000000 5.0000 0 - 12409 0 OS OS 0.000000 5.0000 0 - 12410 0 OS OS 0.000000 5.0000 0 - 12411 0 OS OS 0.000000 5.0000 0 - 12412 0 OS OS 0.000000 5.0000 0 - 12413 0 OS OS 0.000000 5.0000 0 - 12414 0 OS OS 0.000000 5.0000 0 - 12415 0 OS OS 0.000000 5.0000 0 - 12416 0 OS OS 0.000000 5.0000 0 - 12417 0 OS OS 0.000000 5.0000 0 - 12418 0 OS OS 0.000000 5.0000 0 - 12419 0 OS OS 0.000000 5.0000 0 - 12420 0 OS OS 0.000000 5.0000 0 - 12421 0 OS OS 0.000000 5.0000 0 - 12422 0 OS OS 0.000000 5.0000 0 - 12423 0 OS OS 0.000000 5.0000 0 - 12424 0 OS OS 0.000000 5.0000 0 - 12425 0 OS OS 0.000000 5.0000 0 - 12426 0 OS OS 0.000000 5.0000 0 - 12427 0 OS OS 0.000000 5.0000 0 - 12428 0 OS OS 0.000000 5.0000 0 - 12429 0 OS OS 0.000000 5.0000 0 - 12430 0 OS OS 0.000000 5.0000 0 - 12431 0 OS OS 0.000000 5.0000 0 - 12432 0 OS OS 0.000000 5.0000 0 - 12433 0 OS OS 0.000000 5.0000 0 - 12434 0 OS OS 0.000000 5.0000 0 - 12435 0 OS OS 0.000000 5.0000 0 - 12436 0 OS OS 0.000000 5.0000 0 - 12437 0 OS OS 0.000000 5.0000 0 - 12438 0 OS OS 0.000000 5.0000 0 - 12439 0 OS OS 0.000000 5.0000 0 - 12440 0 OS OS 0.000000 5.0000 0 - 12441 0 OS OS 0.000000 5.0000 0 - 12442 0 OS OS 0.000000 5.0000 0 - 12443 0 OS OS 0.000000 5.0000 0 - 12444 0 OS OS 0.000000 5.0000 0 - 12445 0 OS OS 0.000000 5.0000 0 - 12446 0 OS OS 0.000000 5.0000 0 - 12447 0 OS OS 0.000000 5.0000 0 - 12448 0 OS OS 0.000000 5.0000 0 - 12449 0 OS OS 0.000000 5.0000 0 - 12450 0 OS OS 0.000000 5.0000 0 - 12451 0 OS OS 0.000000 5.0000 0 - 12452 0 OS OS 0.000000 5.0000 0 - 12453 0 OS OS 0.000000 5.0000 0 - 12454 0 OS OS 0.000000 5.0000 0 - 12455 0 OS OS 0.000000 5.0000 0 - 12456 0 OS OS 0.000000 5.0000 0 - 12457 0 OS OS 0.000000 5.0000 0 - 12458 0 OS OS 0.000000 5.0000 0 - 12459 0 OS OS 0.000000 5.0000 0 - 12460 0 OS OS 0.000000 5.0000 0 - 12461 0 OS OS 0.000000 5.0000 0 - 12462 0 OS OS 0.000000 5.0000 0 - 12463 0 OS OS 0.000000 5.0000 0 - 12464 0 OS OS 0.000000 5.0000 0 - 12465 0 OS OS 0.000000 5.0000 0 - 12466 0 OS OS 0.000000 5.0000 0 - 12467 0 OS OS 0.000000 5.0000 0 - 12468 0 OS OS 0.000000 5.0000 0 - 12469 0 OS OS 0.000000 5.0000 0 - 12470 0 OS OS 0.000000 5.0000 0 - 12471 0 OS OS 0.000000 5.0000 0 - 12472 0 OS OS 0.000000 5.0000 0 - 12473 0 OS OS 0.000000 5.0000 0 - 12474 0 OS OS 0.000000 5.0000 0 - 12475 0 OS OS 0.000000 5.0000 0 - 12476 0 OS OS 0.000000 5.0000 0 - 12477 0 OS OS 0.000000 5.0000 0 - 12478 0 OS OS 0.000000 5.0000 0 - 12479 0 OS OS 0.000000 5.0000 0 - 12480 0 OS OS 0.000000 5.0000 0 - 12481 0 OS OS 0.000000 5.0000 0 - 12482 0 OS OS 0.000000 5.0000 0 - 12483 0 OS OS 0.000000 5.0000 0 - 12484 0 OS OS 0.000000 5.0000 0 - 12485 0 OS OS 0.000000 5.0000 0 - 12486 0 OS OS 0.000000 5.0000 0 - 12487 0 OS OS 0.000000 5.0000 0 - 12488 0 OS OS 0.000000 5.0000 0 - 12489 0 OS OS 0.000000 5.0000 0 - 12490 0 OS OS 0.000000 5.0000 0 - 12491 0 OS OS 0.000000 5.0000 0 - 12492 0 OS OS 0.000000 5.0000 0 - 12493 0 OS OS 0.000000 5.0000 0 - 12494 0 OS OS 0.000000 5.0000 0 - 12495 0 OS OS 0.000000 5.0000 0 - 12496 0 OS OS 0.000000 5.0000 0 - 12497 0 OS OS 0.000000 5.0000 0 - 12498 0 OS OS 0.000000 5.0000 0 - 12499 0 OS OS 0.000000 5.0000 0 - 12500 0 OS OS 0.000000 5.0000 0 - 12501 0 OS OS 0.000000 5.0000 0 - 12502 0 OS OS 0.000000 5.0000 0 - 12503 0 OS OS 0.000000 5.0000 0 - 12504 0 OS OS 0.000000 5.0000 0 - 12505 0 OS OS 0.000000 5.0000 0 - 12506 0 OS OS 0.000000 5.0000 0 - 12507 0 OS OS 0.000000 5.0000 0 - 12508 0 OS OS 0.000000 5.0000 0 - 12509 0 OS OS 0.000000 5.0000 0 - 12510 0 OS OS 0.000000 5.0000 0 - 12511 0 OS OS 0.000000 5.0000 0 - 12512 0 OS OS 0.000000 5.0000 0 - 12513 0 OS OS 0.000000 5.0000 0 - 12514 0 OS OS 0.000000 5.0000 0 - 12515 0 OS OS 0.000000 5.0000 0 - 12516 0 OS OS 0.000000 5.0000 0 - 12517 0 OS OS 0.000000 5.0000 0 - 12518 0 OS OS 0.000000 5.0000 0 - 12519 0 OS OS 0.000000 5.0000 0 - 12520 0 OS OS 0.000000 5.0000 0 - 12521 0 OS OS 0.000000 5.0000 0 - 12522 0 OS OS 0.000000 5.0000 0 - 12523 0 OS OS 0.000000 5.0000 0 - 12524 0 OS OS 0.000000 5.0000 0 - 12525 0 OS OS 0.000000 5.0000 0 - 12526 0 OS OS 0.000000 5.0000 0 - 12527 0 OS OS 0.000000 5.0000 0 - 12528 0 OS OS 0.000000 5.0000 0 - 12529 0 OS OS 0.000000 5.0000 0 - 12530 0 OS OS 0.000000 5.0000 0 - 12531 0 OS OS 0.000000 5.0000 0 - 12532 0 OS OS 0.000000 5.0000 0 - 12533 0 OS OS 0.000000 5.0000 0 - 12534 0 OS OS 0.000000 5.0000 0 - 12535 0 OS OS 0.000000 5.0000 0 - 12536 0 OS OS 0.000000 5.0000 0 - 12537 0 OS OS 0.000000 5.0000 0 - 12538 0 OS OS 0.000000 5.0000 0 - 12539 0 OS OS 0.000000 5.0000 0 - 12540 0 OS OS 0.000000 5.0000 0 - 12541 0 OS OS 0.000000 5.0000 0 - 12542 0 OS OS 0.000000 5.0000 0 - 12543 0 OS OS 0.000000 5.0000 0 - 12544 0 OS OS 0.000000 5.0000 0 - 12545 0 OS OS 0.000000 5.0000 0 - 12546 0 OS OS 0.000000 5.0000 0 - 12547 0 OS OS 0.000000 5.0000 0 - 12548 0 OS OS 0.000000 5.0000 0 - 12549 0 OS OS 0.000000 5.0000 0 - 12550 0 OS OS 0.000000 5.0000 0 - 12551 0 OS OS 0.000000 5.0000 0 - 12552 0 OS OS 0.000000 5.0000 0 - 12553 0 OS OS 0.000000 5.0000 0 - 12554 0 OS OS 0.000000 5.0000 0 - 12555 0 OS OS 0.000000 5.0000 0 - 12556 0 OS OS 0.000000 5.0000 0 - 12557 0 OS OS 0.000000 5.0000 0 - 12558 0 OS OS 0.000000 5.0000 0 - 12559 0 OS OS 0.000000 5.0000 0 - 12560 0 OS OS 0.000000 5.0000 0 - 12561 0 OS OS 0.000000 5.0000 0 - 12562 0 OS OS 0.000000 5.0000 0 - 12563 0 OS OS 0.000000 5.0000 0 - 12564 0 OS OS 0.000000 5.0000 0 - 12565 0 OS OS 0.000000 5.0000 0 - 12566 0 OS OS 0.000000 5.0000 0 - 12567 0 OS OS 0.000000 5.0000 0 - 12568 0 OS OS 0.000000 5.0000 0 - 12569 0 OS OS 0.000000 5.0000 0 - 12570 0 OS OS 0.000000 5.0000 0 - 12571 0 OS OS 0.000000 5.0000 0 - 12572 0 OS OS 0.000000 5.0000 0 - 12573 0 OS OS 0.000000 5.0000 0 - 12574 0 OS OS 0.000000 5.0000 0 - 12575 0 OS OS 0.000000 5.0000 0 - 12576 0 OS OS 0.000000 5.0000 0 - 12577 0 OS OS 0.000000 5.0000 0 - 12578 0 OS OS 0.000000 5.0000 0 - 12579 0 OS OS 0.000000 5.0000 0 - 12580 0 OS OS 0.000000 5.0000 0 - 12581 0 OS OS 0.000000 5.0000 0 - 12582 0 OS OS 0.000000 5.0000 0 - 12583 0 OS OS 0.000000 5.0000 0 - 12584 0 OS OS 0.000000 5.0000 0 - 12585 0 OS OS 0.000000 5.0000 0 - 12586 0 OS OS 0.000000 5.0000 0 - 12587 0 OS OS 0.000000 5.0000 0 - 12588 0 OS OS 0.000000 5.0000 0 - 12589 0 OS OS 0.000000 5.0000 0 - 12590 0 OS OS 0.000000 5.0000 0 - 12591 0 OS OS 0.000000 5.0000 0 - 12592 0 OS OS 0.000000 5.0000 0 - 12593 0 OS OS 0.000000 5.0000 0 - 12594 0 OS OS 0.000000 5.0000 0 - 12595 0 OS OS 0.000000 5.0000 0 - 12596 0 OS OS 0.000000 5.0000 0 - 12597 0 OS OS 0.000000 5.0000 0 - 12598 0 OS OS 0.000000 5.0000 0 - 12599 0 OS OS 0.000000 5.0000 0 - 12600 0 OS OS 0.000000 5.0000 0 - 12601 0 OS OS 0.000000 5.0000 0 - 12602 0 OS OS 0.000000 5.0000 0 - 12603 0 OS OS 0.000000 5.0000 0 - 12604 0 OS OS 0.000000 5.0000 0 - 12605 0 OS OS 0.000000 5.0000 0 - 12606 0 OS OS 0.000000 5.0000 0 - 12607 0 OS OS 0.000000 5.0000 0 - 12608 0 OS OS 0.000000 5.0000 0 - 12609 0 OS OS 0.000000 5.0000 0 - 12610 0 OS OS 0.000000 5.0000 0 - 12611 0 OS OS 0.000000 5.0000 0 - 12612 0 OS OS 0.000000 5.0000 0 - 12613 0 OS OS 0.000000 5.0000 0 - 12614 0 OS OS 0.000000 5.0000 0 - 12615 0 OS OS 0.000000 5.0000 0 - 12616 0 OS OS 0.000000 5.0000 0 - 12617 0 OS OS 0.000000 5.0000 0 - 12618 0 OS OS 0.000000 5.0000 0 - 12619 0 OS OS 0.000000 5.0000 0 - 12620 0 OS OS 0.000000 5.0000 0 - 12621 0 OS OS 0.000000 5.0000 0 - 12622 0 OS OS 0.000000 5.0000 0 - 12623 0 OS OS 0.000000 5.0000 0 - 12624 0 OS OS 0.000000 5.0000 0 - 12625 0 OS OS 0.000000 5.0000 0 - 12626 0 OS OS 0.000000 5.0000 0 - 12627 0 OS OS 0.000000 5.0000 0 - 12628 0 OS OS 0.000000 5.0000 0 - 12629 0 OS OS 0.000000 5.0000 0 - 12630 0 OS OS 0.000000 5.0000 0 - 12631 0 OS OS 0.000000 5.0000 0 - 12632 0 OS OS 0.000000 5.0000 0 - 12633 0 OS OS 0.000000 5.0000 0 - 12634 0 OS OS 0.000000 5.0000 0 - 12635 0 OS OS 0.000000 5.0000 0 - 12636 0 OS OS 0.000000 5.0000 0 - 12637 0 OS OS 0.000000 5.0000 0 - 12638 0 OS OS 0.000000 5.0000 0 - 12639 0 OS OS 0.000000 5.0000 0 - 12640 0 OS OS 0.000000 5.0000 0 - 12641 0 OS OS 0.000000 5.0000 0 - 12642 0 OS OS 0.000000 5.0000 0 - 12643 0 OS OS 0.000000 5.0000 0 - 12644 0 OS OS 0.000000 5.0000 0 - 12645 0 OS OS 0.000000 5.0000 0 - 12646 0 OS OS 0.000000 5.0000 0 - 12647 0 OS OS 0.000000 5.0000 0 - 12648 0 OS OS 0.000000 5.0000 0 - 12649 0 OS OS 0.000000 5.0000 0 - 12650 0 OS OS 0.000000 5.0000 0 - 12651 0 OS OS 0.000000 5.0000 0 - 12652 0 OS OS 0.000000 5.0000 0 - 12653 0 OS OS 0.000000 5.0000 0 - 12654 0 OS OS 0.000000 5.0000 0 - 12655 0 OS OS 0.000000 5.0000 0 - 12656 0 OS OS 0.000000 5.0000 0 - 12657 0 OS OS 0.000000 5.0000 0 - 12658 0 OS OS 0.000000 5.0000 0 - 12659 0 OS OS 0.000000 5.0000 0 - 12660 0 OS OS 0.000000 5.0000 0 - 12661 0 OS OS 0.000000 5.0000 0 - 12662 0 OS OS 0.000000 5.0000 0 - 12663 0 OS OS 0.000000 5.0000 0 - 12664 0 OS OS 0.000000 5.0000 0 - 12665 0 OS OS 0.000000 5.0000 0 - 12666 0 OS OS 0.000000 5.0000 0 - 12667 0 OS OS 0.000000 5.0000 0 - 12668 0 OS OS 0.000000 5.0000 0 - 12669 0 OS OS 0.000000 5.0000 0 - 12670 0 OS OS 0.000000 5.0000 0 - 12671 0 OS OS 0.000000 5.0000 0 - 12672 0 OS OS 0.000000 5.0000 0 - 12673 0 OS OS 0.000000 5.0000 0 - 12674 0 OS OS 0.000000 5.0000 0 - 12675 0 OS OS 0.000000 5.0000 0 - 12676 0 OS OS 0.000000 5.0000 0 - 12677 0 OS OS 0.000000 5.0000 0 - 12678 0 OS OS 0.000000 5.0000 0 - 12679 0 OS OS 0.000000 5.0000 0 - 12680 0 OS OS 0.000000 5.0000 0 - 12681 0 OS OS 0.000000 5.0000 0 - 12682 0 OS OS 0.000000 5.0000 0 - 12683 0 OS OS 0.000000 5.0000 0 - 12684 0 OS OS 0.000000 5.0000 0 - 12685 0 OS OS 0.000000 5.0000 0 - 12686 0 OS OS 0.000000 5.0000 0 - 12687 0 OS OS 0.000000 5.0000 0 - 12688 0 OS OS 0.000000 5.0000 0 - 12689 0 OS OS 0.000000 5.0000 0 - 12690 0 OS OS 0.000000 5.0000 0 - 12691 0 OS OS 0.000000 5.0000 0 - 12692 0 OS OS 0.000000 5.0000 0 - 12693 0 OS OS 0.000000 5.0000 0 - 12694 0 OS OS 0.000000 5.0000 0 - 12695 0 OS OS 0.000000 5.0000 0 - 12696 0 OS OS 0.000000 5.0000 0 - 12697 0 OS OS 0.000000 5.0000 0 - 12698 0 OS OS 0.000000 5.0000 0 - 12699 0 OS OS 0.000000 5.0000 0 - 12700 0 OS OS 0.000000 5.0000 0 - 12701 0 OS OS 0.000000 5.0000 0 - 12702 0 OS OS 0.000000 5.0000 0 - 12703 0 OS OS 0.000000 5.0000 0 - 12704 0 OS OS 0.000000 5.0000 0 - 12705 0 OS OS 0.000000 5.0000 0 - 12706 0 OS OS 0.000000 5.0000 0 - 12707 0 OS OS 0.000000 5.0000 0 - 12708 0 OS OS 0.000000 5.0000 0 - 12709 0 OS OS 0.000000 5.0000 0 - 12710 0 OS OS 0.000000 5.0000 0 - 12711 0 OS OS 0.000000 5.0000 0 - 12712 0 OS OS 0.000000 5.0000 0 - 12713 0 OS OS 0.000000 5.0000 0 - 12714 0 OS OS 0.000000 5.0000 0 - 12715 0 OS OS 0.000000 5.0000 0 - 12716 0 OS OS 0.000000 5.0000 0 - 12717 0 OS OS 0.000000 5.0000 0 - 12718 0 OS OS 0.000000 5.0000 0 - 12719 0 OS OS 0.000000 5.0000 0 - 12720 0 OS OS 0.000000 5.0000 0 - 12721 0 OS OS 0.000000 5.0000 0 - 12722 0 OS OS 0.000000 5.0000 0 - 12723 0 OS OS 0.000000 5.0000 0 - 12724 0 OS OS 0.000000 5.0000 0 - 12725 0 OS OS 0.000000 5.0000 0 - 12726 0 OS OS 0.000000 5.0000 0 - 12727 0 OS OS 0.000000 5.0000 0 - 12728 0 OS OS 0.000000 5.0000 0 - 12729 0 OS OS 0.000000 5.0000 0 - 12730 0 OS OS 0.000000 5.0000 0 - 12731 0 OS OS 0.000000 5.0000 0 - 12732 0 OS OS 0.000000 5.0000 0 - 12733 0 OS OS 0.000000 5.0000 0 - 12734 0 OS OS 0.000000 5.0000 0 - 12735 0 OS OS 0.000000 5.0000 0 - 12736 0 OS OS 0.000000 5.0000 0 - 12737 0 OS OS 0.000000 5.0000 0 - 12738 0 OS OS 0.000000 5.0000 0 - 12739 0 OS OS 0.000000 5.0000 0 - 12740 0 OS OS 0.000000 5.0000 0 - 12741 0 OS OS 0.000000 5.0000 0 - 12742 0 OS OS 0.000000 5.0000 0 - 12743 0 OS OS 0.000000 5.0000 0 - 12744 0 OS OS 0.000000 5.0000 0 - 12745 0 OS OS 0.000000 5.0000 0 - 12746 0 OS OS 0.000000 5.0000 0 - 12747 0 OS OS 0.000000 5.0000 0 - 12748 0 OS OS 0.000000 5.0000 0 - 12749 0 OS OS 0.000000 5.0000 0 - 12750 0 OS OS 0.000000 5.0000 0 - 12751 0 OS OS 0.000000 5.0000 0 - 12752 0 OS OS 0.000000 5.0000 0 - 12753 0 OS OS 0.000000 5.0000 0 - 12754 0 OS OS 0.000000 5.0000 0 - 12755 0 OS OS 0.000000 5.0000 0 - 12756 0 OS OS 0.000000 5.0000 0 - 12757 0 OS OS 0.000000 5.0000 0 - 12758 0 OS OS 0.000000 5.0000 0 - 12759 0 OS OS 0.000000 5.0000 0 - 12760 0 OS OS 0.000000 5.0000 0 - 12761 0 OS OS 0.000000 5.0000 0 - 12762 0 OS OS 0.000000 5.0000 0 - 12763 0 OS OS 0.000000 5.0000 0 - 12764 0 OS OS 0.000000 5.0000 0 - 12765 0 OS OS 0.000000 5.0000 0 - 12766 0 OS OS 0.000000 5.0000 0 - 12767 0 OS OS 0.000000 5.0000 0 - 12768 0 OS OS 0.000000 5.0000 0 - 12769 0 OS OS 0.000000 5.0000 0 - 12770 0 OS OS 0.000000 5.0000 0 - 12771 0 OS OS 0.000000 5.0000 0 - 12772 0 OS OS 0.000000 5.0000 0 - 12773 0 OS OS 0.000000 5.0000 0 - 12774 0 OS OS 0.000000 5.0000 0 - 12775 0 OS OS 0.000000 5.0000 0 - 12776 0 OS OS 0.000000 5.0000 0 - 12777 0 OS OS 0.000000 5.0000 0 - 12778 0 OS OS 0.000000 5.0000 0 - 12779 0 OS OS 0.000000 5.0000 0 - 12780 0 OS OS 0.000000 5.0000 0 - 12781 0 OS OS 0.000000 5.0000 0 - 12782 0 OS OS 0.000000 5.0000 0 - 12783 0 OS OS 0.000000 5.0000 0 - 12784 0 OS OS 0.000000 5.0000 0 - 12785 0 OS OS 0.000000 5.0000 0 - 12786 0 OS OS 0.000000 5.0000 0 - 12787 0 OS OS 0.000000 5.0000 0 - 12788 0 OS OS 0.000000 5.0000 0 - 12789 0 OS OS 0.000000 5.0000 0 - 12790 0 OS OS 0.000000 5.0000 0 - 12791 0 OS OS 0.000000 5.0000 0 - 12792 0 OS OS 0.000000 5.0000 0 - 12793 0 OS OS 0.000000 5.0000 0 - 12794 0 OS OS 0.000000 5.0000 0 - 12795 0 OS OS 0.000000 5.0000 0 - 12796 0 OS OS 0.000000 5.0000 0 - 12797 0 OS OS 0.000000 5.0000 0 - 12798 0 OS OS 0.000000 5.0000 0 - 12799 0 OS OS 0.000000 5.0000 0 - 12800 0 OS OS 0.000000 5.0000 0 - 12801 0 OS OS 0.000000 5.0000 0 - 12802 0 OS OS 0.000000 5.0000 0 - 12803 0 OS OS 0.000000 5.0000 0 - 12804 0 OS OS 0.000000 5.0000 0 - 12805 0 OS OS 0.000000 5.0000 0 - 12806 0 OS OS 0.000000 5.0000 0 - 12807 0 OS OS 0.000000 5.0000 0 - 12808 0 OS OS 0.000000 5.0000 0 - 12809 0 OS OS 0.000000 5.0000 0 - 12810 0 OS OS 0.000000 5.0000 0 - 12811 0 OS OS 0.000000 5.0000 0 - 12812 0 OS OS 0.000000 5.0000 0 - 12813 0 OS OS 0.000000 5.0000 0 - 12814 0 OS OS 0.000000 5.0000 0 - 12815 0 OS OS 0.000000 5.0000 0 - 12816 0 OS OS 0.000000 5.0000 0 - 12817 0 OS OS 0.000000 5.0000 0 - 12818 0 OS OS 0.000000 5.0000 0 - 12819 0 OS OS 0.000000 5.0000 0 - 12820 0 OS OS 0.000000 5.0000 0 - 12821 0 OS OS 0.000000 5.0000 0 - 12822 0 OS OS 0.000000 5.0000 0 - 12823 0 OS OS 0.000000 5.0000 0 - 12824 0 OS OS 0.000000 5.0000 0 - 12825 0 OS OS 0.000000 5.0000 0 - 12826 0 OS OS 0.000000 5.0000 0 - 12827 0 OS OS 0.000000 5.0000 0 - 12828 0 OS OS 0.000000 5.0000 0 - 12829 0 OS OS 0.000000 5.0000 0 - 12830 0 OS OS 0.000000 5.0000 0 - 12831 0 OS OS 0.000000 5.0000 0 - 12832 0 OS OS 0.000000 5.0000 0 - 12833 0 OS OS 0.000000 5.0000 0 - 12834 0 OS OS 0.000000 5.0000 0 - 12835 0 OS OS 0.000000 5.0000 0 - 12836 0 OS OS 0.000000 5.0000 0 - 12837 0 OS OS 0.000000 5.0000 0 - 12838 0 OS OS 0.000000 5.0000 0 - 12839 0 OS OS 0.000000 5.0000 0 - 12840 0 OS OS 0.000000 5.0000 0 - 12841 0 OS OS 0.000000 5.0000 0 - 12842 0 OS OS 0.000000 5.0000 0 - 12843 0 OS OS 0.000000 5.0000 0 - 12844 0 OS OS 0.000000 5.0000 0 - 12845 0 OS OS 0.000000 5.0000 0 - 12846 0 OS OS 0.000000 5.0000 0 - 12847 0 OS OS 0.000000 5.0000 0 - 12848 0 OS OS 0.000000 5.0000 0 - 12849 0 OS OS 0.000000 5.0000 0 - 12850 0 OS OS 0.000000 5.0000 0 - 12851 0 OS OS 0.000000 5.0000 0 - 12852 0 OS OS 0.000000 5.0000 0 - 12853 0 OS OS 0.000000 5.0000 0 - 12854 0 OS OS 0.000000 5.0000 0 - 12855 0 OS OS 0.000000 5.0000 0 - 12856 0 OS OS 0.000000 5.0000 0 - 12857 0 OS OS 0.000000 5.0000 0 - 12858 0 OS OS 0.000000 5.0000 0 - 12859 0 OS OS 0.000000 5.0000 0 - 12860 0 OS OS 0.000000 5.0000 0 - 12861 0 OS OS 0.000000 5.0000 0 - 12862 0 OS OS 0.000000 5.0000 0 - 12863 0 OS OS 0.000000 5.0000 0 - 12864 0 OS OS 0.000000 5.0000 0 - 12865 0 OS OS 0.000000 5.0000 0 - 12866 0 OS OS 0.000000 5.0000 0 - 12867 0 OS OS 0.000000 5.0000 0 - 12868 0 OS OS 0.000000 5.0000 0 - 12869 0 OS OS 0.000000 5.0000 0 - 12870 0 OS OS 0.000000 5.0000 0 - 12871 0 OS OS 0.000000 5.0000 0 - 12872 0 OS OS 0.000000 5.0000 0 - 12873 0 OS OS 0.000000 5.0000 0 - 12874 0 OS OS 0.000000 5.0000 0 - 12875 0 OS OS 0.000000 5.0000 0 - 12876 0 OS OS 0.000000 5.0000 0 - 12877 0 OS OS 0.000000 5.0000 0 - 12878 0 OS OS 0.000000 5.0000 0 - 12879 0 OS OS 0.000000 5.0000 0 - 12880 0 OS OS 0.000000 5.0000 0 - 12881 0 OS OS 0.000000 5.0000 0 - 12882 0 OS OS 0.000000 5.0000 0 - 12883 0 OS OS 0.000000 5.0000 0 - 12884 0 OS OS 0.000000 5.0000 0 - 12885 0 OS OS 0.000000 5.0000 0 - 12886 0 OS OS 0.000000 5.0000 0 - 12887 0 OS OS 0.000000 5.0000 0 - 12888 0 OS OS 0.000000 5.0000 0 - 12889 0 OS OS 0.000000 5.0000 0 - 12890 0 OS OS 0.000000 5.0000 0 - 12891 0 OS OS 0.000000 5.0000 0 - 12892 0 OS OS 0.000000 5.0000 0 - 12893 0 OS OS 0.000000 5.0000 0 - 12894 0 OS OS 0.000000 5.0000 0 - 12895 0 OS OS 0.000000 5.0000 0 - 12896 0 OS OS 0.000000 5.0000 0 - 12897 0 OS OS 0.000000 5.0000 0 - 12898 0 OS OS 0.000000 5.0000 0 - 12899 0 OS OS 0.000000 5.0000 0 - 12900 0 OS OS 0.000000 5.0000 0 - 12901 0 OS OS 0.000000 5.0000 0 - 12902 0 OS OS 0.000000 5.0000 0 - 12903 0 OS OS 0.000000 5.0000 0 - 12904 0 OS OS 0.000000 5.0000 0 - 12905 0 OS OS 0.000000 5.0000 0 - 12906 0 OS OS 0.000000 5.0000 0 - 12907 0 OS OS 0.000000 5.0000 0 - 12908 0 OS OS 0.000000 5.0000 0 - 12909 0 OS OS 0.000000 5.0000 0 - 12910 0 OS OS 0.000000 5.0000 0 - 12911 0 OS OS 0.000000 5.0000 0 - 12912 0 OS OS 0.000000 5.0000 0 - 12913 0 OS OS 0.000000 5.0000 0 - 12914 0 OS OS 0.000000 5.0000 0 - 12915 0 OS OS 0.000000 5.0000 0 - 12916 0 OS OS 0.000000 5.0000 0 - 12917 0 OS OS 0.000000 5.0000 0 - 12918 0 OS OS 0.000000 5.0000 0 - 12919 0 OS OS 0.000000 5.0000 0 - 12920 0 OS OS 0.000000 5.0000 0 - 12921 0 OS OS 0.000000 5.0000 0 - 12922 0 OS OS 0.000000 5.0000 0 - 12923 0 OS OS 0.000000 5.0000 0 - 12924 0 OS OS 0.000000 5.0000 0 - 12925 0 OS OS 0.000000 5.0000 0 - 12926 0 OS OS 0.000000 5.0000 0 - 12927 0 OS OS 0.000000 5.0000 0 - 12928 0 OS OS 0.000000 5.0000 0 - 12929 0 OS OS 0.000000 5.0000 0 - 12930 0 OS OS 0.000000 5.0000 0 - 12931 0 OS OS 0.000000 5.0000 0 - 12932 0 OS OS 0.000000 5.0000 0 - 12933 0 OS OS 0.000000 5.0000 0 - 12934 0 OS OS 0.000000 5.0000 0 - 12935 0 OS OS 0.000000 5.0000 0 - 12936 0 OS OS 0.000000 5.0000 0 - 12937 0 OS OS 0.000000 5.0000 0 - 12938 0 OS OS 0.000000 5.0000 0 - 12939 0 OS OS 0.000000 5.0000 0 - 12940 0 OS OS 0.000000 5.0000 0 - 12941 0 OS OS 0.000000 5.0000 0 - 12942 0 OS OS 0.000000 5.0000 0 - 12943 0 OS OS 0.000000 5.0000 0 - 12944 0 OS OS 0.000000 5.0000 0 - 12945 0 OS OS 0.000000 5.0000 0 - 12946 0 OS OS 0.000000 5.0000 0 - 12947 0 OS OS 0.000000 5.0000 0 - 12948 0 OS OS 0.000000 5.0000 0 - 12949 0 OS OS 0.000000 5.0000 0 - 12950 0 OS OS 0.000000 5.0000 0 - 12951 0 OS OS 0.000000 5.0000 0 - 12952 0 OS OS 0.000000 5.0000 0 - 12953 0 OS OS 0.000000 5.0000 0 - 12954 0 OS OS 0.000000 5.0000 0 - 12955 0 OS OS 0.000000 5.0000 0 - 12956 0 OS OS 0.000000 5.0000 0 - 12957 0 OS OS 0.000000 5.0000 0 - 12958 0 OS OS 0.000000 5.0000 0 - 12959 0 OS OS 0.000000 5.0000 0 - 12960 0 OS OS 0.000000 5.0000 0 - 12961 0 OS OS 0.000000 5.0000 0 - 12962 0 OS OS 0.000000 5.0000 0 - 12963 0 OS OS 0.000000 5.0000 0 - 12964 0 OS OS 0.000000 5.0000 0 - 12965 0 OS OS 0.000000 5.0000 0 - 12966 0 OS OS 0.000000 5.0000 0 - 12967 0 OS OS 0.000000 5.0000 0 - 12968 0 OS OS 0.000000 5.0000 0 - 12969 0 OS OS 0.000000 5.0000 0 - 12970 0 OS OS 0.000000 5.0000 0 - 12971 0 OS OS 0.000000 5.0000 0 - 12972 0 OS OS 0.000000 5.0000 0 - 12973 0 OS OS 0.000000 5.0000 0 - 12974 0 OS OS 0.000000 5.0000 0 - 12975 0 OS OS 0.000000 5.0000 0 - 12976 0 OS OS 0.000000 5.0000 0 - 12977 0 OS OS 0.000000 5.0000 0 - 12978 0 OS OS 0.000000 5.0000 0 - 12979 0 OS OS 0.000000 5.0000 0 - 12980 0 OS OS 0.000000 5.0000 0 - 12981 0 OS OS 0.000000 5.0000 0 - 12982 0 OS OS 0.000000 5.0000 0 - 12983 0 OS OS 0.000000 5.0000 0 - 12984 0 OS OS 0.000000 5.0000 0 - 12985 0 OS OS 0.000000 5.0000 0 - 12986 0 OS OS 0.000000 5.0000 0 - 12987 0 OS OS 0.000000 5.0000 0 - 12988 0 OS OS 0.000000 5.0000 0 - 12989 0 OS OS 0.000000 5.0000 0 - 12990 0 OS OS 0.000000 5.0000 0 - 12991 0 OS OS 0.000000 5.0000 0 - 12992 0 OS OS 0.000000 5.0000 0 - 12993 0 OS OS 0.000000 5.0000 0 - 12994 0 OS OS 0.000000 5.0000 0 - 12995 0 OS OS 0.000000 5.0000 0 - 12996 0 OS OS 0.000000 5.0000 0 - 12997 0 OS OS 0.000000 5.0000 0 - 12998 0 OS OS 0.000000 5.0000 0 - 12999 0 OS OS 0.000000 5.0000 0 - 13000 0 OS OS 0.000000 5.0000 0 - 13001 0 OS OS 0.000000 5.0000 0 - 13002 0 OS OS 0.000000 5.0000 0 - 13003 0 OS OS 0.000000 5.0000 0 - 13004 0 OS OS 0.000000 5.0000 0 - 13005 0 OS OS 0.000000 5.0000 0 - 13006 0 OS OS 0.000000 5.0000 0 - 13007 0 OS OS 0.000000 5.0000 0 - 13008 0 OS OS 0.000000 5.0000 0 - 13009 0 OS OS 0.000000 5.0000 0 - 13010 0 OS OS 0.000000 5.0000 0 - 13011 0 OS OS 0.000000 5.0000 0 - 13012 0 OS OS 0.000000 5.0000 0 - 13013 0 OS OS 0.000000 5.0000 0 - 13014 0 OS OS 0.000000 5.0000 0 - 13015 0 OS OS 0.000000 5.0000 0 - 13016 0 OS OS 0.000000 5.0000 0 - 13017 0 OS OS 0.000000 5.0000 0 - 13018 0 OS OS 0.000000 5.0000 0 - 13019 0 OS OS 0.000000 5.0000 0 - 13020 0 OS OS 0.000000 5.0000 0 - 13021 0 OS OS 0.000000 5.0000 0 - 13022 0 OS OS 0.000000 5.0000 0 - 13023 0 OS OS 0.000000 5.0000 0 - 13024 0 OS OS 0.000000 5.0000 0 - 13025 0 OS OS 0.000000 5.0000 0 - 13026 0 OS OS 0.000000 5.0000 0 - 13027 0 OS OS 0.000000 5.0000 0 - 13028 0 OS OS 0.000000 5.0000 0 - 13029 0 OS OS 0.000000 5.0000 0 - 13030 0 OS OS 0.000000 5.0000 0 - 13031 0 OS OS 0.000000 5.0000 0 - 13032 0 OS OS 0.000000 5.0000 0 - 13033 0 OS OS 0.000000 5.0000 0 - 13034 0 OS OS 0.000000 5.0000 0 - 13035 0 OS OS 0.000000 5.0000 0 - 13036 0 OS OS 0.000000 5.0000 0 - 13037 0 OS OS 0.000000 5.0000 0 - 13038 0 OS OS 0.000000 5.0000 0 - 13039 0 OS OS 0.000000 5.0000 0 - 13040 0 OS OS 0.000000 5.0000 0 - 13041 0 OS OS 0.000000 5.0000 0 - 13042 0 OS OS 0.000000 5.0000 0 - 13043 0 OS OS 0.000000 5.0000 0 - 13044 0 OS OS 0.000000 5.0000 0 - 13045 0 OS OS 0.000000 5.0000 0 - 13046 0 OS OS 0.000000 5.0000 0 - 13047 0 OS OS 0.000000 5.0000 0 - 13048 0 OS OS 0.000000 5.0000 0 - 13049 0 OS OS 0.000000 5.0000 0 - 13050 0 OS OS 0.000000 5.0000 0 - 13051 0 OS OS 0.000000 5.0000 0 - 13052 0 OS OS 0.000000 5.0000 0 - 13053 0 OS OS 0.000000 5.0000 0 - 13054 0 OS OS 0.000000 5.0000 0 - 13055 0 OS OS 0.000000 5.0000 0 - 13056 0 OS OS 0.000000 5.0000 0 - 13057 0 OS OS 0.000000 5.0000 0 - 13058 0 OS OS 0.000000 5.0000 0 - 13059 0 OS OS 0.000000 5.0000 0 - 13060 0 OS OS 0.000000 5.0000 0 - 13061 0 OS OS 0.000000 5.0000 0 - 13062 0 OS OS 0.000000 5.0000 0 - 13063 0 OS OS 0.000000 5.0000 0 - 13064 0 OS OS 0.000000 5.0000 0 - 13065 0 OS OS 0.000000 5.0000 0 - 13066 0 OS OS 0.000000 5.0000 0 - 13067 0 OS OS 0.000000 5.0000 0 - 13068 0 OS OS 0.000000 5.0000 0 - 13069 0 OS OS 0.000000 5.0000 0 - 13070 0 OS OS 0.000000 5.0000 0 - 13071 0 OS OS 0.000000 5.0000 0 - 13072 0 OS OS 0.000000 5.0000 0 - 13073 0 OS OS 0.000000 5.0000 0 - 13074 0 OS OS 0.000000 5.0000 0 - 13075 0 OS OS 0.000000 5.0000 0 - 13076 0 OS OS 0.000000 5.0000 0 - 13077 0 OS OS 0.000000 5.0000 0 - 13078 0 OS OS 0.000000 5.0000 0 - 13079 0 OS OS 0.000000 5.0000 0 - 13080 0 OS OS 0.000000 5.0000 0 - 13081 0 OS OS 0.000000 5.0000 0 - 13082 0 OS OS 0.000000 5.0000 0 - 13083 0 OS OS 0.000000 5.0000 0 - 13084 0 OS OS 0.000000 5.0000 0 - 13085 0 OS OS 0.000000 5.0000 0 - 13086 0 OS OS 0.000000 5.0000 0 - 13087 0 OS OS 0.000000 5.0000 0 - 13088 0 OS OS 0.000000 5.0000 0 - 13089 0 OS OS 0.000000 5.0000 0 - 13090 0 OS OS 0.000000 5.0000 0 - 13091 0 OS OS 0.000000 5.0000 0 - 13092 0 OS OS 0.000000 5.0000 0 - 13093 0 OS OS 0.000000 5.0000 0 - 13094 0 OS OS 0.000000 5.0000 0 - 13095 0 OS OS 0.000000 5.0000 0 - 13096 0 OS OS 0.000000 5.0000 0 - 13097 0 OS OS 0.000000 5.0000 0 - 13098 0 OS OS 0.000000 5.0000 0 - 13099 0 OS OS 0.000000 5.0000 0 - 13100 0 OS OS 0.000000 5.0000 0 - 13101 0 OS OS 0.000000 5.0000 0 - 13102 0 OS OS 0.000000 5.0000 0 - 13103 0 OS OS 0.000000 5.0000 0 - 13104 0 OS OS 0.000000 5.0000 0 - 13105 0 OS OS 0.000000 5.0000 0 - 13106 0 OS OS 0.000000 5.0000 0 - 13107 0 OS OS 0.000000 5.0000 0 - 13108 0 OS OS 0.000000 5.0000 0 - 13109 0 OS OS 0.000000 5.0000 0 - 13110 0 OS OS 0.000000 5.0000 0 - 13111 0 OS OS 0.000000 5.0000 0 - 13112 0 OS OS 0.000000 5.0000 0 - 13113 0 OS OS 0.000000 5.0000 0 - 13114 0 OS OS 0.000000 5.0000 0 - 13115 0 OS OS 0.000000 5.0000 0 - 13116 0 OS OS 0.000000 5.0000 0 - 13117 0 OS OS 0.000000 5.0000 0 - 13118 0 OS OS 0.000000 5.0000 0 - 13119 0 OS OS 0.000000 5.0000 0 - 13120 0 OS OS 0.000000 5.0000 0 - 13121 0 OS OS 0.000000 5.0000 0 - 13122 0 OS OS 0.000000 5.0000 0 - 13123 0 OS OS 0.000000 5.0000 0 - 13124 0 OS OS 0.000000 5.0000 0 - 13125 0 OS OS 0.000000 5.0000 0 - 13126 0 OS OS 0.000000 5.0000 0 - 13127 0 OS OS 0.000000 5.0000 0 - 13128 0 OS OS 0.000000 5.0000 0 - 13129 0 OS OS 0.000000 5.0000 0 - 13130 0 OS OS 0.000000 5.0000 0 - 13131 0 OS OS 0.000000 5.0000 0 - 13132 0 OS OS 0.000000 5.0000 0 - 13133 0 OS OS 0.000000 5.0000 0 - 13134 0 OS OS 0.000000 5.0000 0 - 13135 0 OS OS 0.000000 5.0000 0 - 13136 0 OS OS 0.000000 5.0000 0 - 13137 0 OS OS 0.000000 5.0000 0 - 13138 0 OS OS 0.000000 5.0000 0 - 13139 0 OS OS 0.000000 5.0000 0 - 13140 0 OS OS 0.000000 5.0000 0 - 13141 0 OS OS 0.000000 5.0000 0 - 13142 0 OS OS 0.000000 5.0000 0 - 13143 0 OS OS 0.000000 5.0000 0 - 13144 0 OS OS 0.000000 5.0000 0 - 13145 0 OS OS 0.000000 5.0000 0 - 13146 0 OS OS 0.000000 5.0000 0 - 13147 0 OS OS 0.000000 5.0000 0 - 13148 0 OS OS 0.000000 5.0000 0 - 13149 0 OS OS 0.000000 5.0000 0 - 13150 0 OS OS 0.000000 5.0000 0 - 13151 0 OS OS 0.000000 5.0000 0 - 13152 0 OS OS 0.000000 5.0000 0 - 13153 0 OS OS 0.000000 5.0000 0 - 13154 0 OS OS 0.000000 5.0000 0 - 13155 0 OS OS 0.000000 5.0000 0 - 13156 0 OS OS 0.000000 5.0000 0 - 13157 0 OS OS 0.000000 5.0000 0 - 13158 0 OS OS 0.000000 5.0000 0 - 13159 0 OS OS 0.000000 5.0000 0 - 13160 0 OS OS 0.000000 5.0000 0 - 13161 0 OS OS 0.000000 5.0000 0 - 13162 0 OS OS 0.000000 5.0000 0 - 13163 0 OS OS 0.000000 5.0000 0 - 13164 0 OS OS 0.000000 5.0000 0 - 13165 0 OS OS 0.000000 5.0000 0 - 13166 0 OS OS 0.000000 5.0000 0 - 13167 0 OS OS 0.000000 5.0000 0 - 13168 0 OS OS 0.000000 5.0000 0 - 13169 0 OS OS 0.000000 5.0000 0 - 13170 0 OS OS 0.000000 5.0000 0 - 13171 0 OS OS 0.000000 5.0000 0 - 13172 0 OS OS 0.000000 5.0000 0 - 13173 0 OS OS 0.000000 5.0000 0 - 13174 0 OS OS 0.000000 5.0000 0 - 13175 0 OS OS 0.000000 5.0000 0 - 13176 0 OS OS 0.000000 5.0000 0 - 13177 0 OS OS 0.000000 5.0000 0 - 13178 0 OS OS 0.000000 5.0000 0 - 13179 0 OS OS 0.000000 5.0000 0 - 13180 0 OS OS 0.000000 5.0000 0 - 13181 0 OS OS 0.000000 5.0000 0 - 13182 0 OS OS 0.000000 5.0000 0 - 13183 0 OS OS 0.000000 5.0000 0 - 13184 0 OS OS 0.000000 5.0000 0 - 13185 0 OS OS 0.000000 5.0000 0 - 13186 0 OS OS 0.000000 5.0000 0 - 13187 0 OS OS 0.000000 5.0000 0 - 13188 0 OS OS 0.000000 5.0000 0 - 13189 0 OS OS 0.000000 5.0000 0 - 13190 0 OS OS 0.000000 5.0000 0 - 13191 0 OS OS 0.000000 5.0000 0 - 13192 0 OS OS 0.000000 5.0000 0 - 13193 0 OS OS 0.000000 5.0000 0 - 13194 0 OS OS 0.000000 5.0000 0 - 13195 0 OS OS 0.000000 5.0000 0 - 13196 0 OS OS 0.000000 5.0000 0 - 13197 0 OS OS 0.000000 5.0000 0 - 13198 0 OS OS 0.000000 5.0000 0 - 13199 0 OS OS 0.000000 5.0000 0 - 13200 0 OS OS 0.000000 5.0000 0 - 13201 0 OS OS 0.000000 5.0000 0 - 13202 0 OS OS 0.000000 5.0000 0 - 13203 0 OS OS 0.000000 5.0000 0 - 13204 0 OS OS 0.000000 5.0000 0 - 13205 0 OS OS 0.000000 5.0000 0 - 13206 0 OS OS 0.000000 5.0000 0 - 13207 0 OS OS 0.000000 5.0000 0 - 13208 0 OS OS 0.000000 5.0000 0 - 13209 0 OS OS 0.000000 5.0000 0 - 13210 0 OS OS 0.000000 5.0000 0 - 13211 0 OS OS 0.000000 5.0000 0 - 13212 0 OS OS 0.000000 5.0000 0 - 13213 0 OS OS 0.000000 5.0000 0 - 13214 0 OS OS 0.000000 5.0000 0 - 13215 0 OS OS 0.000000 5.0000 0 - 13216 0 OS OS 0.000000 5.0000 0 - 13217 0 OS OS 0.000000 5.0000 0 - 13218 0 OS OS 0.000000 5.0000 0 - 13219 0 OS OS 0.000000 5.0000 0 - 13220 0 OS OS 0.000000 5.0000 0 - 13221 0 OS OS 0.000000 5.0000 0 - 13222 0 OS OS 0.000000 5.0000 0 - 13223 0 OS OS 0.000000 5.0000 0 - 13224 0 OS OS 0.000000 5.0000 0 - 13225 0 OS OS 0.000000 5.0000 0 - 13226 0 OS OS 0.000000 5.0000 0 - 13227 0 OS OS 0.000000 5.0000 0 - 13228 0 OS OS 0.000000 5.0000 0 - 13229 0 OS OS 0.000000 5.0000 0 - 13230 0 ZN 5 0.000000 0.0020 0 - 13231 0 ZN 5 0.000000 0.0020 0 - 13232 0 ZN 5 0.000000 0.0020 0 - 13233 0 ZN 5 0.000000 0.0020 0 - 13234 0 ZN 5 0.000000 0.0020 0 - 13235 0 ZN 5 0.000000 0.0020 0 - 13236 0 ZN 5 0.000000 0.0020 0 - 13237 0 ZN 5 0.000000 0.0020 0 - 13238 0 ZN 5 0.000000 0.0020 0 - 13239 0 ZN 5 0.000000 0.0020 0 - 13240 0 ZN 5 0.000000 0.0020 0 - 13241 0 ZN 5 0.000000 0.0020 0 - 13242 0 ZN 5 0.000000 0.0020 0 - 13243 0 ZN 5 0.000000 0.0020 0 - 13244 0 ZN 5 0.000000 0.0020 0 - 13245 0 ZN 5 0.000000 0.0020 0 - 13246 0 ZN 5 0.000000 0.0020 0 - 13247 0 ZN 5 0.000000 0.0020 0 - 13248 0 ZN 5 0.000000 0.0020 0 - 13249 0 ZN 5 0.000000 0.0020 0 - 13250 0 ZN 5 0.000000 0.0020 0 - 13251 0 ZN 5 0.000000 0.0020 0 - 13252 0 ZN 5 0.000000 0.0020 0 - 13253 0 ZN 5 0.000000 0.0020 0 - 13254 0 ZN 5 0.000000 0.0020 0 - 13255 0 ZN 5 0.000000 0.0020 0 - 13256 0 ZN 5 0.000000 0.0020 0 - 13257 0 ZN 5 0.000000 0.0020 0 - 13258 0 ZN 5 0.000000 0.0020 0 - 13259 0 ZN 5 0.000000 0.0020 0 - 13260 0 ZN 5 0.000000 0.0020 0 - 13261 0 ZN 5 0.000000 0.0020 0 - 13262 0 ZN 5 0.000000 0.0020 0 - 13263 0 ZN 5 0.000000 0.0020 0 - 13264 0 ZN 5 0.000000 0.0020 0 - 13265 0 ZN 5 0.000000 0.0020 0 - 13266 0 ZN 5 0.000000 0.0020 0 - 13267 0 ZN 5 0.000000 0.0020 0 - 13268 0 ZN 5 0.000000 0.0020 0 - 13269 0 ZN 5 0.000000 0.0020 0 - 13270 0 ZN 5 0.000000 0.0020 0 - 13271 0 ZN 5 0.000000 0.0020 0 - 13272 0 ZN 5 0.000000 0.0020 0 - 13273 0 ZN 5 0.000000 0.0020 0 - 13274 0 ZN 5 0.000000 0.0020 0 - 13275 0 ZN 5 0.000000 0.0020 0 - 13276 0 ZN 5 0.000000 0.0020 0 - 13277 0 ZN 5 0.000000 0.0020 0 - 13278 0 ZN 5 0.000000 0.0020 0 - 13279 0 ZN 5 0.000000 0.0020 0 - 13280 0 ZN 5 0.000000 0.0020 0 - 13281 0 ZN 5 0.000000 0.0020 0 - 13282 0 ZN 5 0.000000 0.0020 0 - 13283 0 ZN 5 0.000000 0.0020 0 - 13284 0 ZN 5 0.000000 0.0020 0 - 13285 0 ZN 5 0.000000 0.0020 0 - 13286 0 ZN 5 0.000000 0.0020 0 - 13287 0 ZN 5 0.000000 0.0020 0 - 13288 0 ZN 5 0.000000 0.0020 0 - 13289 0 ZN 5 0.000000 0.0020 0 - 13290 0 ZN 5 0.000000 0.0020 0 - 13291 0 ZN 5 0.000000 0.0020 0 - 13292 0 ZN 5 0.000000 0.0020 0 - 13293 0 ZN 5 0.000000 0.0020 0 - 13294 0 ZN 5 0.000000 0.0020 0 - 13295 0 ZN 5 0.000000 0.0020 0 - 13296 0 ZN 5 0.000000 0.0020 0 - 13297 0 ZN 5 0.000000 0.0020 0 - 13298 0 ZN 5 0.000000 0.0020 0 - 13299 0 ZN 5 0.000000 0.0020 0 - 13300 0 ZN 5 0.000000 0.0020 0 - 13301 0 ZN 5 0.000000 0.0020 0 - 13302 0 ZN 5 0.000000 0.0020 0 - 13303 0 ZN 5 0.000000 0.0020 0 - 13304 0 ZN 5 0.000000 0.0020 0 - 13305 0 ZN 5 0.000000 0.0020 0 - 13306 0 ZN 5 0.000000 0.0020 0 - 13307 0 ZN 5 0.000000 0.0020 0 - 13308 0 ZN 5 0.000000 0.0020 0 - 13309 0 ZN 5 0.000000 0.0020 0 - 13310 0 ZN 5 0.000000 0.0020 0 - 13311 0 ZN 5 0.000000 0.0020 0 - 13312 0 ZN 5 0.000000 0.0020 0 - 13313 0 ZN 5 0.000000 0.0020 0 - 13314 0 ZN 5 0.000000 0.0020 0 - 13315 0 ZN 5 0.000000 0.0020 0 - 13316 0 ZN 5 0.000000 0.0020 0 - 13317 0 ZN 5 0.000000 0.0020 0 - 13318 0 ZN 5 0.000000 0.0020 0 - 13319 0 ZN 5 0.000000 0.0020 0 - 13320 0 ZN 5 0.000000 0.0020 0 - 13321 0 ZN 5 0.000000 0.0020 0 - 13322 0 ZN 5 0.000000 0.0020 0 - 13323 0 ZN 5 0.000000 0.0020 0 - 13324 0 ZN 5 0.000000 0.0020 0 - 13325 0 ZN 5 0.000000 0.0020 0 - 13326 0 ZN 5 0.000000 0.0020 0 - 13327 0 ZN 5 0.000000 0.0020 0 - 13328 0 ZN 5 0.000000 0.0020 0 - 13329 0 ZN 5 0.000000 0.0020 0 - 13330 0 ZN 5 0.000000 0.0020 0 - 13331 0 ZN 5 0.000000 0.0020 0 - 13332 0 ZN 5 0.000000 0.0020 0 - 13333 0 ZN 5 0.000000 0.0020 0 - 13334 0 ZN 5 0.000000 0.0020 0 - 13335 0 ZN 5 0.000000 0.0020 0 - 13336 0 ZN 5 0.000000 0.0020 0 - 13337 0 ZN 5 0.000000 0.0020 0 - 13338 0 ZN 5 0.000000 0.0020 0 - 13339 0 ZN 5 0.000000 0.0020 0 - 13340 0 ZN 5 0.000000 0.0020 0 - 13341 0 PS 5 0.000000 0.0020 0 - 13342 0 ZN 5 0.000000 0.0020 0 - 13343 0 ZN 5 0.000000 0.0020 0 - 13344 0 ZN 5 0.000000 0.0020 0 - 13345 0 ZN 5 0.000000 0.0020 0 - 13346 0 ZN 5 0.000000 0.0020 0 - 13347 0 ZN 5 0.000000 0.0020 0 - 13348 0 ZN 5 0.000000 0.0020 0 - 13349 0 ZN 5 0.000000 0.0020 0 - 13350 0 ZN 5 0.000000 0.0020 0 - 13351 0 ZN 5 0.000000 0.0020 0 - 13352 0 ZN 5 0.000000 0.0020 0 - 13353 0 ZN 5 0.000000 0.0020 0 - 13354 0 ZN 5 0.000000 0.0020 0 - 13355 0 ZN 5 0.000000 0.0020 0 - 13356 0 ZN 5 0.000000 0.0020 0 - 13357 0 ZN 5 0.000000 0.0020 0 - 13358 0 ZN 5 0.000000 0.0020 0 - 13359 0 ZN 5 0.000000 0.0020 0 - 13360 0 ZN 5 0.000000 0.0020 0 - 13361 0 ZN 5 0.000000 0.0020 0 - 13362 0 ZN 5 0.000000 0.0020 0 - 13363 0 ZN 5 0.000000 0.0020 0 - 13364 0 ZN 5 0.000000 0.0020 0 - 13365 0 ZN 5 0.000000 0.0020 0 - 13366 0 ZN 5 0.000000 0.0020 0 - 13367 0 ZN 5 0.000000 0.0020 0 - 13368 0 ZN 5 0.000000 0.0020 0 - 13369 0 ZN 5 0.000000 0.0020 0 - 13370 0 ZN 5 0.000000 0.0020 0 - 13371 0 ZN 5 0.000000 0.0020 0 - 13372 0 ZN 5 0.000000 0.0020 0 - 13373 0 ZN 5 0.000000 0.0020 0 - 13374 0 ZN 5 0.000000 0.0020 0 - 13375 0 ZN 5 0.000000 0.0020 0 - 13376 0 ZN 5 0.000000 0.0020 0 - 13377 0 ZN 5 0.000000 0.0020 0 - 13378 0 ZN 5 0.000000 0.0020 0 - 13379 0 ZN 5 0.000000 0.0020 0 - 13380 0 ZN 5 0.000000 0.0020 0 - 13381 0 ZN 5 0.000000 0.0020 0 - 13382 0 ZN 5 0.000000 0.0020 0 - 13383 0 ZN 5 0.000000 0.0020 0 - 13384 0 ZN 5 0.000000 0.0020 0 - 13385 0 ZN 5 0.000000 0.0020 0 - 13386 0 ZN 5 0.000000 0.0020 0 - 13387 0 ZN 5 0.000000 0.0020 0 - 13388 0 ZN 5 0.000000 0.0020 0 - 13389 0 ZN 5 0.000000 0.0020 0 - 13390 0 ZN 5 0.000000 0.0020 0 - 13391 0 ZN 5 0.000000 0.0020 0 - 13392 0 ZN 5 0.000000 0.0020 0 - 13393 0 ZN 5 0.000000 0.0020 0 - 13394 0 ZN 5 0.000000 0.0020 0 - 13395 0 ZN 5 0.000000 0.0020 0 - 13396 0 ZN 5 0.000000 0.0020 0 - 13397 0 ZN 5 0.000000 0.0020 0 - 13398 0 ZN 5 0.000000 0.0020 0 - 13399 0 ZN 5 0.000000 0.0020 0 - 13400 0 ZN 5 0.000000 0.0020 0 - 13401 0 ZN 5 0.000000 0.0020 0 - 13402 0 ZN 5 0.000000 0.0020 0 - 13403 0 ZN 5 0.000000 0.0020 0 - 13404 0 ZN 5 0.000000 0.0020 0 - 13405 0 ZN 5 0.000000 0.0020 0 - 13406 0 ZN 5 0.000000 0.0020 0 - 13407 0 ZN 5 0.000000 0.0020 0 - 13408 0 ZN 5 0.000000 0.0020 0 - 13409 0 ZN 5 0.000000 0.0020 0 - 13410 0 ZN 5 0.000000 0.0020 0 - 13411 0 ZN 5 0.000000 0.0020 0 - 13412 0 ZN 5 0.000000 0.0020 0 - 13413 0 ZN 5 0.000000 0.0020 0 - 13414 0 ZN 5 0.000000 0.0020 0 - 13415 0 ZN 5 0.000000 0.0020 0 - 13416 0 ZN 5 0.000000 0.0020 0 - 13417 0 ZN 5 0.000000 0.0020 0 - 13418 0 ZN 5 0.000000 0.0020 0 - 13419 0 ZN 5 0.000000 0.0020 0 - 13420 0 ZN 5 0.000000 0.0020 0 - 13421 0 ZN 5 0.000000 0.0020 0 - 13422 0 ZN 5 0.000000 0.0020 0 - 13423 0 ZN 5 0.000000 0.0020 0 - 13424 0 ZN 5 0.000000 0.0020 0 - 13425 0 ZN 5 0.000000 0.0020 0 - 13426 0 ZN 5 0.000000 0.0020 0 - 13427 0 ZN 5 0.000000 0.0020 0 - 13428 0 ZN 5 0.000000 0.0020 0 - 13429 0 ZN 5 0.000000 0.0020 0 - 13430 0 ZN 5 0.000000 0.0020 0 - 13431 0 ZN 5 0.000000 0.0020 0 - 13432 0 ZN 5 0.000000 0.0020 0 - 13433 0 ZN 5 0.000000 0.0020 0 - 13434 0 ZN 5 0.000000 0.0020 0 - 13435 0 ZN 5 0.000000 0.0020 0 - 13436 0 ZN 5 0.000000 0.0020 0 - 13437 0 ZN 5 0.000000 0.0020 0 - 13438 0 ZN 5 0.000000 0.0020 0 - 13439 0 ZN 5 0.000000 0.0020 0 - 13440 0 ZN 5 0.000000 0.0020 0 - 13441 0 ZN 5 0.000000 0.0020 0 - 13442 0 ZN 5 0.000000 0.0020 0 - 13443 0 ZN 5 0.000000 0.0020 0 - 13444 0 ZN 5 0.000000 0.0020 0 - 13445 0 ZN 5 0.000000 0.0020 0 - 13446 0 ZN 5 0.000000 0.0020 0 - 13447 0 ZN 5 0.000000 0.0020 0 - 13448 0 ZN 5 0.000000 0.0020 0 - 13449 0 ZN 5 0.000000 0.0020 0 - 13450 0 ZN 5 0.000000 0.0020 0 - 13451 0 ZN 5 0.000000 0.0020 0 - 13452 0 ZN 5 0.000000 0.0020 0 - 13453 0 ZN 5 0.000000 0.0020 0 - 13454 0 ZN 5 0.000000 0.0020 0 - 13455 0 ZN 5 0.000000 0.0020 0 - 13456 0 ZN 5 0.000000 0.0020 0 - 13457 0 ZN 5 0.000000 0.0020 0 - 13458 0 ZN 5 0.000000 0.0020 0 - 13459 0 ZN 5 0.000000 0.0020 0 - 13460 0 ZN 5 0.000000 0.0020 0 - 13461 0 ZN 5 0.000000 0.0020 0 - 13462 0 ZN 5 0.000000 0.0020 0 - 13463 0 ZN 5 0.000000 0.0020 0 - 13464 0 ZN 5 0.000000 0.0020 0 - 13465 0 ZN 5 0.000000 0.0020 0 - 13466 0 ZN 5 0.000000 0.0020 0 - 13467 0 ZN 5 0.000000 0.0020 0 - 13468 0 ZN 5 0.000000 0.0020 0 - 13469 0 ZN 5 0.000000 0.0020 0 - 13470 0 ZN 5 0.000000 0.0020 0 - 13471 0 ZN 5 0.000000 0.0020 0 - 13472 0 ZN 5 0.000000 0.0020 0 - 13473 0 ZN 5 0.000000 0.0020 0 - 13474 0 ZN 5 0.000000 0.0020 0 - 13475 0 ZN 5 0.000000 0.0020 0 - 13476 0 ZN 5 0.000000 0.0020 0 - 13477 0 ZN 5 0.000000 0.0020 0 - 13478 0 ZN 5 0.000000 0.0020 0 - 13479 0 ZN 5 0.000000 0.0020 0 - 13480 0 ZN 5 0.000000 0.0020 0 - 13481 0 ZN 5 0.000000 0.0020 0 - 13482 0 ZN 5 0.000000 0.0020 0 - 13483 0 ZN 5 0.000000 0.0020 0 - 13484 0 ZN 5 0.000000 0.0020 0 - 13485 0 ZN 5 0.000000 0.0020 0 - 13486 0 ZN 5 0.000000 0.0020 0 - 13487 0 ZN 5 0.000000 0.0020 0 - 13488 0 ZN 5 0.000000 0.0020 0 - 13489 0 ZN 5 0.000000 0.0020 0 - 13490 0 ZN 5 0.000000 0.0020 0 - 13491 0 ZN 5 0.000000 0.0020 0 - 13492 1 HS HS 0.000000 12.0100 0 - 13493 1 HS HS 0.000000 12.0100 0 - 13494 1 HS HS 0.000000 12.0100 0 - 13495 1 HS HS 0.000000 12.0100 0 - 13496 1 HS HS 0.000000 12.0100 0 - 13497 1 HS HS 0.000000 12.0100 0 - 13498 1 HS HS 0.000000 12.0100 0 - 13499 1 HS HS 0.000000 12.0100 0 - 13500 1 HS HS 0.000000 12.0100 0 - 13501 1 HS HS 0.000000 12.0100 0 - 13502 1 HS HS 0.000000 12.0100 0 - 13503 1 HS HS 0.000000 12.0100 0 - 13504 1 HS HS 0.000000 12.0100 0 - 13505 1 HS HS 0.000000 12.0100 0 - 13506 1 HS HS 0.000000 12.0100 0 - 13507 1 HS HS 0.000000 12.0100 0 - 13508 1 HS HS 0.000000 12.0100 0 - 13509 1 HS HS 0.000000 12.0100 0 - 13510 1 HS HS 0.000000 12.0100 0 - 13511 1 HS HS 0.000000 12.0100 0 - 13512 1 HS HS 0.000000 12.0100 0 - 13513 1 HS HS 0.000000 12.0100 0 - 13514 1 HS HS 0.000000 12.0100 0 - 13515 1 HS HS 0.000000 12.0100 0 - 13516 1 HS HS 0.000000 12.0100 0 - 13517 1 HS HS 0.000000 12.0100 0 - 13518 1 HS HS 0.000000 12.0100 0 - 13519 1 HS HS 0.000000 12.0100 0 - 13520 1 HS HS 0.000000 12.0100 0 - 13521 1 HS HS 0.000000 12.0100 0 - 13522 1 HS HS 0.000000 12.0100 0 - 13523 1 HS HS 0.000000 12.0100 0 - 13524 1 HS HS 0.000000 12.0100 0 - 13525 1 HS HS 0.000000 12.0100 0 - 13526 1 HS HS 0.000000 12.0100 0 - 13527 1 HS HS 0.000000 12.0100 0 - 13528 1 HS HS 0.000000 12.0100 0 - 13529 1 HS HS 0.000000 12.0100 0 - 13530 1 HS HS 0.000000 12.0100 0 - 13531 1 HS HS 0.000000 12.0100 0 - 13532 1 HS HS 0.000000 12.0100 0 - 13533 1 HS HS 0.000000 12.0100 0 - 13534 1 HS HS 0.000000 12.0100 0 - 13535 1 HS HS 0.000000 12.0100 0 - 13536 1 HS HS 0.000000 12.0100 0 - 13537 1 HS HS 0.000000 12.0100 0 - 13538 1 HS HS 0.000000 12.0100 0 - 13539 1 HS HS 0.000000 12.0100 0 - 13540 1 HS HS 0.000000 12.0100 0 - 13541 1 HS HS 0.000000 12.0100 0 - 13542 1 HS HS 0.000000 12.0100 0 - 13543 1 HS HS 0.000000 12.0100 0 - 13544 1 HS HS 0.000000 12.0100 0 - 13545 1 HS HS 0.000000 12.0100 0 - 13546 1 HS HS 0.000000 12.0100 0 - 13547 1 HS HS 0.000000 12.0100 0 - 13548 1 HS HS 0.000000 12.0100 0 - 13549 1 HS HS 0.000000 12.0100 0 - 13550 1 HS HS 0.000000 12.0100 0 - 13551 1 HS HS 0.000000 12.0100 0 - 13552 2 HS HS 0.000000 12.0100 0 - 13553 2 HS HS 0.000000 12.0100 0 - 13554 2 HS HS 0.000000 12.0100 0 - 13555 2 HS HS 0.000000 12.0100 0 - 13556 2 HS HS 0.000000 12.0100 0 - 13557 2 HS HS 0.000000 12.0100 0 - 13558 2 HS HS 0.000000 12.0100 0 - 13559 2 HS HS 0.000000 12.0100 0 - 13560 2 HS HS 0.000000 12.0100 0 - 13561 2 HS HS 0.000000 12.0100 0 - 13562 2 HS HS 0.000000 12.0100 0 - 13563 2 HS HS 0.000000 12.0100 0 - 13564 2 HS HS 0.000000 12.0100 0 - 13565 2 HS HS 0.000000 12.0100 0 - 13566 2 HS HS 0.000000 12.0100 0 - 13567 2 HS HS 0.000000 12.0100 0 - 13568 2 HS HS 0.000000 12.0100 0 - 13569 2 HS HS 0.000000 12.0100 0 - 13570 2 HS HS 0.000000 12.0100 0 - 13571 2 HS HS 0.000000 12.0100 0 - 13572 2 HS HS 0.000000 12.0100 0 - 13573 2 HS HS 0.000000 12.0100 0 - 13574 2 HS HS 0.000000 12.0100 0 - 13575 2 HS HS 0.000000 12.0100 0 - 13576 2 HS HS 0.000000 12.0100 0 - 13577 2 HS HS 0.000000 12.0100 0 - 13578 2 HS HS 0.000000 12.0100 0 - 13579 2 HS HS 0.000000 12.0100 0 - 13580 2 HS HS 0.000000 12.0100 0 - 13581 2 HS HS 0.000000 12.0100 0 - 13582 2 HS HS 0.000000 12.0100 0 - 13583 2 HS HS 0.000000 12.0100 0 - 13584 2 HS HS 0.000000 12.0100 0 - 13585 2 HS HS 0.000000 12.0100 0 - 13586 2 HS HS 0.000000 12.0100 0 - 13587 2 HS HS 0.000000 12.0100 0 - 13588 2 HS HS 0.000000 12.0100 0 - 13589 2 HS HS 0.000000 12.0100 0 - 13590 2 HS HS 0.000000 12.0100 0 - 13591 2 HS HS 0.000000 12.0100 0 - 13592 2 HS HS 0.000000 12.0100 0 - 13593 2 HS HS 0.000000 12.0100 0 - 13594 2 HS HS 0.000000 12.0100 0 - 13595 2 HS HS 0.000000 12.0100 0 - 13596 2 HS HS 0.000000 12.0100 0 - 13597 2 HS HS 0.000000 12.0100 0 - 13598 2 HS HS 0.000000 12.0100 0 - 13599 2 HS HS 0.000000 12.0100 0 - 13600 2 HS HS 0.000000 12.0100 0 - 13601 2 HS HS 0.000000 12.0100 0 - 13602 2 HS HS 0.000000 12.0100 0 - 13603 2 HS HS 0.000000 12.0100 0 - 13604 2 HS HS 0.000000 12.0100 0 - 13605 2 HS HS 0.000000 12.0100 0 - 13606 2 HS HS 0.000000 12.0100 0 - 13607 2 HS HS 0.000000 12.0100 0 - 13608 2 HS HS 0.000000 12.0100 0 - 13609 2 HS HS 0.000000 12.0100 0 - 13610 2 HS HS 0.000000 12.0100 0 - 13611 2 HS HS 0.000000 12.0100 0 - 13612 3 HS HS 0.000000 12.0100 0 - 13613 3 HS HS 0.000000 12.0100 0 - 13614 3 HS HS 0.000000 12.0100 0 - 13615 3 HS HS 0.000000 12.0100 0 - 13616 3 HS HS 0.000000 12.0100 0 - 13617 3 HS HS 0.000000 12.0100 0 - 13618 3 HS HS 0.000000 12.0100 0 - 13619 3 HS HS 0.000000 12.0100 0 - 13620 3 HS HS 0.000000 12.0100 0 - 13621 3 HS HS 0.000000 12.0100 0 - 13622 3 HS HS 0.000000 12.0100 0 - 13623 3 HS HS 0.000000 12.0100 0 - 13624 3 HS HS 0.000000 12.0100 0 - 13625 3 HS HS 0.000000 12.0100 0 - 13626 3 HS HS 0.000000 12.0100 0 - 13627 3 HS HS 0.000000 12.0100 0 - 13628 3 HS HS 0.000000 12.0100 0 - 13629 3 HS HS 0.000000 12.0100 0 - 13630 3 HS HS 0.000000 12.0100 0 - 13631 3 HS HS 0.000000 12.0100 0 - 13632 3 HS HS 0.000000 12.0100 0 - 13633 3 HS HS 0.000000 12.0100 0 - 13634 3 HS HS 0.000000 12.0100 0 - 13635 3 HS HS 0.000000 12.0100 0 - 13636 3 HS HS 0.000000 12.0100 0 - 13637 3 HS HS 0.000000 12.0100 0 - 13638 3 HS HS 0.000000 12.0100 0 - 13639 3 HS HS 0.000000 12.0100 0 - 13640 3 HS HS 0.000000 12.0100 0 - 13641 3 HS HS 0.000000 12.0100 0 - 13642 3 HS HS 0.000000 12.0100 0 - 13643 3 HS HS 0.000000 12.0100 0 - 13644 3 HS HS 0.000000 12.0100 0 - 13645 3 HS HS 0.000000 12.0100 0 - 13646 3 HS HS 0.000000 12.0100 0 - 13647 3 HS HS 0.000000 12.0100 0 - 13648 3 HS HS 0.000000 12.0100 0 - 13649 3 HS HS 0.000000 12.0100 0 - 13650 3 HS HS 0.000000 12.0100 0 - 13651 3 HS HS 0.000000 12.0100 0 - 13652 3 HS HS 0.000000 12.0100 0 - 13653 3 HS HS 0.000000 12.0100 0 - 13654 3 HS HS 0.000000 12.0100 0 - 13655 3 HS HS 0.000000 12.0100 0 - 13656 3 HS HS 0.000000 12.0100 0 - 13657 3 HS HS 0.000000 12.0100 0 - 13658 3 HS HS 0.000000 12.0100 0 - 13659 3 HS HS 0.000000 12.0100 0 - 13660 3 HS HS 0.000000 12.0100 0 - 13661 3 HS HS 0.000000 12.0100 0 - 13662 3 HS HS 0.000000 12.0100 0 - 13663 3 HS HS 0.000000 12.0100 0 - 13664 3 HS HS 0.000000 12.0100 0 - 13665 3 HS HS 0.000000 12.0100 0 - 13666 3 HS HS 0.000000 12.0100 0 - 13667 3 HS HS 0.000000 12.0100 0 - 13668 3 HS HS 0.000000 12.0100 0 - 13669 3 HS HS 0.000000 12.0100 0 - 13670 3 HS HS 0.000000 12.0100 0 - 13671 3 HS HS 0.000000 12.0100 0 - - 270 !NBOND: bonds - 13492 13493 13492 13498 13492 13496 13493 13494 - 13493 13499 13494 13495 13494 13500 13495 13501 - 13495 13496 13496 13497 13497 13507 13497 13508 - 13498 13510 13498 13509 13499 13511 13499 13502 - 13500 13504 13500 13503 13501 13505 13501 13506 - 13502 13503 13502 13515 13503 13516 13504 13505 - 13504 13517 13505 13518 13506 13507 13506 13519 - 13507 13520 13508 13509 13508 13521 13509 13513 - 13510 13511 13510 13512 13511 13514 13512 13513 - 13512 13522 13513 13530 13514 13515 13514 13523 - 13515 13524 13516 13517 13516 13525 13517 13526 - 13518 13519 13518 13527 13519 13529 13520 13521 - 13520 13528 13521 13531 13522 13523 13522 13535 - 13523 13532 13524 13525 13524 13533 13525 13540 - 13526 13541 13526 13527 13527 13539 13528 13537 - 13528 13529 13529 13538 13530 13534 13530 13531 - 13531 13536 13532 13533 13532 13542 13533 13546 - 13534 13535 13534 13543 13535 13542 13536 13537 - 13536 13543 13537 13544 13538 13539 13538 13544 - 13539 13545 13540 13541 13540 13546 13541 13545 - 13542 13550 13543 13551 13544 13547 13545 13548 - 13546 13549 13547 13548 13547 13551 13548 13549 - 13549 13550 13550 13551 13552 13553 13552 13558 - 13552 13556 13553 13554 13553 13559 13554 13555 - 13554 13560 13555 13561 13555 13556 13556 13557 - 13557 13567 13557 13568 13558 13570 13558 13569 - 13559 13571 13559 13562 13560 13564 13560 13563 - 13561 13565 13561 13566 13562 13563 13562 13575 - 13563 13576 13564 13565 13564 13577 13565 13578 - 13566 13567 13566 13579 13567 13580 13568 13569 - 13568 13581 13569 13573 13570 13571 13570 13572 - 13571 13574 13572 13573 13572 13582 13573 13590 - 13574 13575 13574 13583 13575 13584 13576 13577 - 13576 13585 13577 13586 13578 13579 13578 13587 - 13579 13589 13580 13581 13580 13588 13581 13591 - 13582 13583 13582 13595 13583 13592 13584 13585 - 13584 13593 13585 13600 13586 13601 13586 13587 - 13587 13599 13588 13597 13588 13589 13589 13598 - 13590 13594 13590 13591 13591 13596 13592 13593 - 13592 13602 13593 13606 13594 13595 13594 13603 - 13595 13602 13596 13597 13596 13603 13597 13604 - 13598 13599 13598 13604 13599 13605 13600 13601 - 13600 13606 13601 13605 13602 13610 13603 13611 - 13604 13607 13605 13608 13606 13609 13607 13608 - 13607 13611 13608 13609 13609 13610 13610 13611 - 13612 13618 13612 13616 13612 13613 13613 13614 - 13613 13619 13614 13615 13614 13620 13615 13621 - 13615 13616 13616 13617 13617 13628 13617 13627 - 13618 13630 13618 13629 13619 13622 13619 13631 - 13620 13623 13620 13624 13621 13625 13621 13626 - 13622 13623 13622 13635 13623 13636 13624 13637 - 13624 13625 13625 13638 13626 13639 13626 13627 - 13627 13640 13628 13629 13628 13641 13629 13633 - 13630 13631 13630 13632 13631 13634 13632 13642 - 13632 13633 13633 13650 13634 13635 13634 13643 - 13635 13644 13636 13645 13636 13637 13637 13646 - 13638 13647 13638 13639 13639 13649 13640 13641 - 13640 13648 13641 13651 13642 13643 13642 13655 - 13643 13652 13644 13653 13644 13645 13645 13660 - 13646 13661 13646 13647 13647 13659 13648 13657 - 13648 13649 13649 13658 13650 13654 13650 13651 - 13651 13656 13652 13653 13652 13662 13653 13666 - 13654 13655 13654 13663 13655 13662 13656 13657 - 13656 13663 13657 13664 13658 13659 13658 13664 - 13659 13665 13660 13661 13660 13666 13661 13665 - 13662 13670 13663 13671 13664 13667 13665 13668 - 13666 13669 13667 13671 13667 13668 13668 13669 - 13669 13670 13670 13671 - - 540 !NTHETA: angles - 13493 13492 13498 13493 13492 13496 13496 13492 13498 - 13492 13493 13494 13492 13493 13499 13494 13493 13499 - 13493 13494 13495 13493 13494 13500 13495 13494 13500 - 13494 13495 13501 13494 13495 13496 13496 13495 13501 - 13492 13496 13495 13492 13496 13497 13495 13496 13497 - 13496 13497 13507 13496 13497 13508 13507 13497 13508 - 13492 13498 13510 13492 13498 13509 13509 13498 13510 - 13493 13499 13511 13493 13499 13502 13502 13499 13511 - 13494 13500 13504 13494 13500 13503 13503 13500 13504 - 13495 13501 13505 13495 13501 13506 13505 13501 13506 - 13499 13502 13503 13499 13502 13515 13503 13502 13515 - 13500 13503 13502 13500 13503 13516 13502 13503 13516 - 13500 13504 13505 13500 13504 13517 13505 13504 13517 - 13501 13505 13504 13501 13505 13518 13504 13505 13518 - 13501 13506 13507 13501 13506 13519 13507 13506 13519 - 13497 13507 13506 13497 13507 13520 13506 13507 13520 - 13497 13508 13509 13497 13508 13521 13509 13508 13521 - 13498 13509 13508 13498 13509 13513 13508 13509 13513 - 13498 13510 13511 13498 13510 13512 13511 13510 13512 - 13499 13511 13510 13499 13511 13514 13510 13511 13514 - 13510 13512 13513 13510 13512 13522 13513 13512 13522 - 13509 13513 13512 13509 13513 13530 13512 13513 13530 - 13511 13514 13515 13511 13514 13523 13515 13514 13523 - 13502 13515 13514 13502 13515 13524 13514 13515 13524 - 13503 13516 13517 13503 13516 13525 13517 13516 13525 - 13504 13517 13516 13504 13517 13526 13516 13517 13526 - 13505 13518 13519 13505 13518 13527 13519 13518 13527 - 13506 13519 13518 13506 13519 13529 13518 13519 13529 - 13507 13520 13521 13507 13520 13528 13521 13520 13528 - 13508 13521 13520 13508 13521 13531 13520 13521 13531 - 13512 13522 13523 13512 13522 13535 13523 13522 13535 - 13514 13523 13522 13514 13523 13532 13522 13523 13532 - 13515 13524 13525 13515 13524 13533 13525 13524 13533 - 13516 13525 13524 13516 13525 13540 13524 13525 13540 - 13517 13526 13541 13517 13526 13527 13527 13526 13541 - 13518 13527 13526 13518 13527 13539 13526 13527 13539 - 13520 13528 13537 13520 13528 13529 13529 13528 13537 - 13519 13529 13528 13519 13529 13538 13528 13529 13538 - 13513 13530 13534 13513 13530 13531 13531 13530 13534 - 13521 13531 13530 13521 13531 13536 13530 13531 13536 - 13523 13532 13533 13523 13532 13542 13533 13532 13542 - 13524 13533 13532 13524 13533 13546 13532 13533 13546 - 13530 13534 13535 13530 13534 13543 13535 13534 13543 - 13522 13535 13534 13522 13535 13542 13534 13535 13542 - 13531 13536 13537 13531 13536 13543 13537 13536 13543 - 13528 13537 13536 13528 13537 13544 13536 13537 13544 - 13529 13538 13539 13529 13538 13544 13539 13538 13544 - 13527 13539 13538 13527 13539 13545 13538 13539 13545 - 13525 13540 13541 13525 13540 13546 13541 13540 13546 - 13526 13541 13540 13526 13541 13545 13540 13541 13545 - 13532 13542 13535 13532 13542 13550 13535 13542 13550 - 13534 13543 13536 13534 13543 13551 13536 13543 13551 - 13537 13544 13538 13537 13544 13547 13538 13544 13547 - 13539 13545 13541 13539 13545 13548 13541 13545 13548 - 13533 13546 13540 13533 13546 13549 13540 13546 13549 - 13544 13547 13548 13544 13547 13551 13548 13547 13551 - 13545 13548 13547 13545 13548 13549 13547 13548 13549 - 13546 13549 13548 13546 13549 13550 13548 13549 13550 - 13542 13550 13549 13542 13550 13551 13549 13550 13551 - 13543 13551 13547 13543 13551 13550 13547 13551 13550 - 13553 13552 13558 13553 13552 13556 13556 13552 13558 - 13552 13553 13554 13552 13553 13559 13554 13553 13559 - 13553 13554 13555 13553 13554 13560 13555 13554 13560 - 13554 13555 13561 13554 13555 13556 13556 13555 13561 - 13552 13556 13555 13552 13556 13557 13555 13556 13557 - 13556 13557 13567 13556 13557 13568 13567 13557 13568 - 13552 13558 13570 13552 13558 13569 13569 13558 13570 - 13553 13559 13571 13553 13559 13562 13562 13559 13571 - 13554 13560 13564 13554 13560 13563 13563 13560 13564 - 13555 13561 13565 13555 13561 13566 13565 13561 13566 - 13559 13562 13563 13559 13562 13575 13563 13562 13575 - 13560 13563 13562 13560 13563 13576 13562 13563 13576 - 13560 13564 13565 13560 13564 13577 13565 13564 13577 - 13561 13565 13564 13561 13565 13578 13564 13565 13578 - 13561 13566 13567 13561 13566 13579 13567 13566 13579 - 13557 13567 13566 13557 13567 13580 13566 13567 13580 - 13557 13568 13569 13557 13568 13581 13569 13568 13581 - 13558 13569 13568 13558 13569 13573 13568 13569 13573 - 13558 13570 13571 13558 13570 13572 13571 13570 13572 - 13559 13571 13570 13559 13571 13574 13570 13571 13574 - 13570 13572 13573 13570 13572 13582 13573 13572 13582 - 13569 13573 13572 13569 13573 13590 13572 13573 13590 - 13571 13574 13575 13571 13574 13583 13575 13574 13583 - 13562 13575 13574 13562 13575 13584 13574 13575 13584 - 13563 13576 13577 13563 13576 13585 13577 13576 13585 - 13564 13577 13576 13564 13577 13586 13576 13577 13586 - 13565 13578 13579 13565 13578 13587 13579 13578 13587 - 13566 13579 13578 13566 13579 13589 13578 13579 13589 - 13567 13580 13581 13567 13580 13588 13581 13580 13588 - 13568 13581 13580 13568 13581 13591 13580 13581 13591 - 13572 13582 13583 13572 13582 13595 13583 13582 13595 - 13574 13583 13582 13574 13583 13592 13582 13583 13592 - 13575 13584 13585 13575 13584 13593 13585 13584 13593 - 13576 13585 13584 13576 13585 13600 13584 13585 13600 - 13577 13586 13601 13577 13586 13587 13587 13586 13601 - 13578 13587 13586 13578 13587 13599 13586 13587 13599 - 13580 13588 13597 13580 13588 13589 13589 13588 13597 - 13579 13589 13588 13579 13589 13598 13588 13589 13598 - 13573 13590 13594 13573 13590 13591 13591 13590 13594 - 13581 13591 13590 13581 13591 13596 13590 13591 13596 - 13583 13592 13593 13583 13592 13602 13593 13592 13602 - 13584 13593 13592 13584 13593 13606 13592 13593 13606 - 13590 13594 13595 13590 13594 13603 13595 13594 13603 - 13582 13595 13594 13582 13595 13602 13594 13595 13602 - 13591 13596 13597 13591 13596 13603 13597 13596 13603 - 13588 13597 13596 13588 13597 13604 13596 13597 13604 - 13589 13598 13599 13589 13598 13604 13599 13598 13604 - 13587 13599 13598 13587 13599 13605 13598 13599 13605 - 13585 13600 13601 13585 13600 13606 13601 13600 13606 - 13586 13601 13600 13586 13601 13605 13600 13601 13605 - 13592 13602 13595 13592 13602 13610 13595 13602 13610 - 13594 13603 13596 13594 13603 13611 13596 13603 13611 - 13597 13604 13598 13597 13604 13607 13598 13604 13607 - 13599 13605 13601 13599 13605 13608 13601 13605 13608 - 13593 13606 13600 13593 13606 13609 13600 13606 13609 - 13604 13607 13608 13604 13607 13611 13608 13607 13611 - 13605 13608 13607 13605 13608 13609 13607 13608 13609 - 13606 13609 13608 13606 13609 13610 13608 13609 13610 - 13602 13610 13609 13602 13610 13611 13609 13610 13611 - 13603 13611 13607 13603 13611 13610 13607 13611 13610 - 13616 13612 13618 13613 13612 13618 13613 13612 13616 - 13612 13613 13614 13612 13613 13619 13614 13613 13619 - 13613 13614 13615 13613 13614 13620 13615 13614 13620 - 13614 13615 13621 13614 13615 13616 13616 13615 13621 - 13612 13616 13615 13612 13616 13617 13615 13616 13617 - 13616 13617 13628 13616 13617 13627 13627 13617 13628 - 13612 13618 13630 13612 13618 13629 13629 13618 13630 - 13613 13619 13622 13613 13619 13631 13622 13619 13631 - 13614 13620 13623 13614 13620 13624 13623 13620 13624 - 13615 13621 13625 13615 13621 13626 13625 13621 13626 - 13619 13622 13623 13619 13622 13635 13623 13622 13635 - 13620 13623 13622 13620 13623 13636 13622 13623 13636 - 13620 13624 13637 13620 13624 13625 13625 13624 13637 - 13621 13625 13624 13621 13625 13638 13624 13625 13638 - 13621 13626 13639 13621 13626 13627 13627 13626 13639 - 13617 13627 13626 13617 13627 13640 13626 13627 13640 - 13617 13628 13629 13617 13628 13641 13629 13628 13641 - 13618 13629 13628 13618 13629 13633 13628 13629 13633 - 13618 13630 13631 13618 13630 13632 13631 13630 13632 - 13619 13631 13630 13619 13631 13634 13630 13631 13634 - 13630 13632 13642 13630 13632 13633 13633 13632 13642 - 13629 13633 13632 13629 13633 13650 13632 13633 13650 - 13631 13634 13635 13631 13634 13643 13635 13634 13643 - 13622 13635 13634 13622 13635 13644 13634 13635 13644 - 13623 13636 13645 13623 13636 13637 13637 13636 13645 - 13624 13637 13636 13624 13637 13646 13636 13637 13646 - 13625 13638 13647 13625 13638 13639 13639 13638 13647 - 13626 13639 13638 13626 13639 13649 13638 13639 13649 - 13627 13640 13641 13627 13640 13648 13641 13640 13648 - 13628 13641 13640 13628 13641 13651 13640 13641 13651 - 13632 13642 13643 13632 13642 13655 13643 13642 13655 - 13634 13643 13642 13634 13643 13652 13642 13643 13652 - 13635 13644 13653 13635 13644 13645 13645 13644 13653 - 13636 13645 13644 13636 13645 13660 13644 13645 13660 - 13637 13646 13661 13637 13646 13647 13647 13646 13661 - 13638 13647 13646 13638 13647 13659 13646 13647 13659 - 13640 13648 13657 13640 13648 13649 13649 13648 13657 - 13639 13649 13648 13639 13649 13658 13648 13649 13658 - 13633 13650 13654 13633 13650 13651 13651 13650 13654 - 13641 13651 13650 13641 13651 13656 13650 13651 13656 - 13643 13652 13653 13643 13652 13662 13653 13652 13662 - 13644 13653 13652 13644 13653 13666 13652 13653 13666 - 13650 13654 13655 13650 13654 13663 13655 13654 13663 - 13642 13655 13654 13642 13655 13662 13654 13655 13662 - 13651 13656 13657 13651 13656 13663 13657 13656 13663 - 13648 13657 13656 13648 13657 13664 13656 13657 13664 - 13649 13658 13659 13649 13658 13664 13659 13658 13664 - 13647 13659 13658 13647 13659 13665 13658 13659 13665 - 13645 13660 13661 13645 13660 13666 13661 13660 13666 - 13646 13661 13660 13646 13661 13665 13660 13661 13665 - 13652 13662 13655 13652 13662 13670 13655 13662 13670 - 13654 13663 13656 13654 13663 13671 13656 13663 13671 - 13657 13664 13658 13657 13664 13667 13658 13664 13667 - 13659 13665 13661 13659 13665 13668 13661 13665 13668 - 13653 13666 13660 13653 13666 13669 13660 13666 13669 - 13664 13667 13671 13664 13667 13668 13668 13667 13671 - 13665 13668 13667 13665 13668 13669 13667 13668 13669 - 13666 13669 13668 13666 13669 13670 13668 13669 13670 - 13662 13670 13669 13662 13670 13671 13669 13670 13671 - 13663 13671 13667 13663 13671 13670 13667 13671 13670 - - 1080 !NPHI: dihedrals - 13498 13492 13493 13494 13498 13492 13493 13499 - 13496 13492 13493 13494 13496 13492 13493 13499 - 13493 13492 13498 13510 13493 13492 13498 13509 - 13496 13492 13498 13510 13496 13492 13498 13509 - 13493 13492 13496 13495 13493 13492 13496 13497 - 13498 13492 13496 13495 13498 13492 13496 13497 - 13492 13493 13494 13495 13492 13493 13494 13500 - 13499 13493 13494 13495 13499 13493 13494 13500 - 13492 13493 13499 13511 13492 13493 13499 13502 - 13494 13493 13499 13511 13494 13493 13499 13502 - 13493 13494 13495 13501 13493 13494 13495 13496 - 13500 13494 13495 13501 13500 13494 13495 13496 - 13493 13494 13500 13504 13493 13494 13500 13503 - 13495 13494 13500 13504 13495 13494 13500 13503 - 13494 13495 13501 13505 13494 13495 13501 13506 - 13496 13495 13501 13505 13496 13495 13501 13506 - 13494 13495 13496 13492 13494 13495 13496 13497 - 13501 13495 13496 13492 13501 13495 13496 13497 - 13492 13496 13497 13507 13492 13496 13497 13508 - 13495 13496 13497 13507 13495 13496 13497 13508 - 13496 13497 13507 13506 13496 13497 13507 13520 - 13508 13497 13507 13506 13508 13497 13507 13520 - 13496 13497 13508 13509 13496 13497 13508 13521 - 13507 13497 13508 13509 13507 13497 13508 13521 - 13492 13498 13510 13511 13492 13498 13510 13512 - 13509 13498 13510 13511 13509 13498 13510 13512 - 13492 13498 13509 13508 13492 13498 13509 13513 - 13510 13498 13509 13508 13510 13498 13509 13513 - 13493 13499 13511 13510 13493 13499 13511 13514 - 13502 13499 13511 13510 13502 13499 13511 13514 - 13493 13499 13502 13503 13493 13499 13502 13515 - 13511 13499 13502 13503 13511 13499 13502 13515 - 13494 13500 13504 13505 13494 13500 13504 13517 - 13503 13500 13504 13505 13503 13500 13504 13517 - 13494 13500 13503 13502 13494 13500 13503 13516 - 13504 13500 13503 13502 13504 13500 13503 13516 - 13495 13501 13505 13504 13495 13501 13505 13518 - 13506 13501 13505 13504 13506 13501 13505 13518 - 13495 13501 13506 13507 13495 13501 13506 13519 - 13505 13501 13506 13507 13505 13501 13506 13519 - 13499 13502 13503 13500 13499 13502 13503 13516 - 13515 13502 13503 13500 13515 13502 13503 13516 - 13499 13502 13515 13514 13499 13502 13515 13524 - 13503 13502 13515 13514 13503 13502 13515 13524 - 13500 13503 13516 13517 13500 13503 13516 13525 - 13502 13503 13516 13517 13502 13503 13516 13525 - 13500 13504 13505 13501 13500 13504 13505 13518 - 13517 13504 13505 13501 13517 13504 13505 13518 - 13500 13504 13517 13516 13500 13504 13517 13526 - 13505 13504 13517 13516 13505 13504 13517 13526 - 13501 13505 13518 13519 13501 13505 13518 13527 - 13504 13505 13518 13519 13504 13505 13518 13527 - 13501 13506 13507 13497 13501 13506 13507 13520 - 13519 13506 13507 13497 13519 13506 13507 13520 - 13501 13506 13519 13518 13501 13506 13519 13529 - 13507 13506 13519 13518 13507 13506 13519 13529 - 13497 13507 13520 13521 13497 13507 13520 13528 - 13506 13507 13520 13521 13506 13507 13520 13528 - 13497 13508 13509 13498 13497 13508 13509 13513 - 13521 13508 13509 13498 13521 13508 13509 13513 - 13497 13508 13521 13520 13497 13508 13521 13531 - 13509 13508 13521 13520 13509 13508 13521 13531 - 13498 13509 13513 13512 13498 13509 13513 13530 - 13508 13509 13513 13512 13508 13509 13513 13530 - 13498 13510 13511 13499 13498 13510 13511 13514 - 13512 13510 13511 13499 13512 13510 13511 13514 - 13498 13510 13512 13513 13498 13510 13512 13522 - 13511 13510 13512 13513 13511 13510 13512 13522 - 13499 13511 13514 13515 13499 13511 13514 13523 - 13510 13511 13514 13515 13510 13511 13514 13523 - 13510 13512 13513 13509 13510 13512 13513 13530 - 13522 13512 13513 13509 13522 13512 13513 13530 - 13510 13512 13522 13523 13510 13512 13522 13535 - 13513 13512 13522 13523 13513 13512 13522 13535 - 13509 13513 13530 13534 13509 13513 13530 13531 - 13512 13513 13530 13534 13512 13513 13530 13531 - 13511 13514 13515 13502 13511 13514 13515 13524 - 13523 13514 13515 13502 13523 13514 13515 13524 - 13511 13514 13523 13522 13511 13514 13523 13532 - 13515 13514 13523 13522 13515 13514 13523 13532 - 13502 13515 13524 13525 13502 13515 13524 13533 - 13514 13515 13524 13525 13514 13515 13524 13533 - 13503 13516 13517 13504 13503 13516 13517 13526 - 13525 13516 13517 13504 13525 13516 13517 13526 - 13503 13516 13525 13524 13503 13516 13525 13540 - 13517 13516 13525 13524 13517 13516 13525 13540 - 13504 13517 13526 13541 13504 13517 13526 13527 - 13516 13517 13526 13541 13516 13517 13526 13527 - 13505 13518 13519 13506 13505 13518 13519 13529 - 13527 13518 13519 13506 13527 13518 13519 13529 - 13505 13518 13527 13526 13505 13518 13527 13539 - 13519 13518 13527 13526 13519 13518 13527 13539 - 13506 13519 13529 13528 13506 13519 13529 13538 - 13518 13519 13529 13528 13518 13519 13529 13538 - 13507 13520 13521 13508 13507 13520 13521 13531 - 13528 13520 13521 13508 13528 13520 13521 13531 - 13507 13520 13528 13537 13507 13520 13528 13529 - 13521 13520 13528 13537 13521 13520 13528 13529 - 13508 13521 13531 13530 13508 13521 13531 13536 - 13520 13521 13531 13530 13520 13521 13531 13536 - 13512 13522 13523 13514 13512 13522 13523 13532 - 13535 13522 13523 13514 13535 13522 13523 13532 - 13512 13522 13535 13534 13512 13522 13535 13542 - 13523 13522 13535 13534 13523 13522 13535 13542 - 13514 13523 13532 13533 13514 13523 13532 13542 - 13522 13523 13532 13533 13522 13523 13532 13542 - 13515 13524 13525 13516 13515 13524 13525 13540 - 13533 13524 13525 13516 13533 13524 13525 13540 - 13515 13524 13533 13532 13515 13524 13533 13546 - 13525 13524 13533 13532 13525 13524 13533 13546 - 13516 13525 13540 13541 13516 13525 13540 13546 - 13524 13525 13540 13541 13524 13525 13540 13546 - 13517 13526 13541 13540 13517 13526 13541 13545 - 13527 13526 13541 13540 13527 13526 13541 13545 - 13517 13526 13527 13518 13517 13526 13527 13539 - 13541 13526 13527 13518 13541 13526 13527 13539 - 13518 13527 13539 13538 13518 13527 13539 13545 - 13526 13527 13539 13538 13526 13527 13539 13545 - 13520 13528 13537 13536 13520 13528 13537 13544 - 13529 13528 13537 13536 13529 13528 13537 13544 - 13520 13528 13529 13519 13520 13528 13529 13538 - 13537 13528 13529 13519 13537 13528 13529 13538 - 13519 13529 13538 13539 13519 13529 13538 13544 - 13528 13529 13538 13539 13528 13529 13538 13544 - 13513 13530 13534 13535 13513 13530 13534 13543 - 13531 13530 13534 13535 13531 13530 13534 13543 - 13513 13530 13531 13521 13513 13530 13531 13536 - 13534 13530 13531 13521 13534 13530 13531 13536 - 13521 13531 13536 13537 13521 13531 13536 13543 - 13530 13531 13536 13537 13530 13531 13536 13543 - 13523 13532 13533 13524 13523 13532 13533 13546 - 13542 13532 13533 13524 13542 13532 13533 13546 - 13523 13532 13542 13535 13523 13532 13542 13550 - 13533 13532 13542 13535 13533 13532 13542 13550 - 13524 13533 13546 13540 13524 13533 13546 13549 - 13532 13533 13546 13540 13532 13533 13546 13549 - 13530 13534 13535 13522 13530 13534 13535 13542 - 13543 13534 13535 13522 13543 13534 13535 13542 - 13530 13534 13543 13536 13530 13534 13543 13551 - 13535 13534 13543 13536 13535 13534 13543 13551 - 13522 13535 13542 13532 13522 13535 13542 13550 - 13534 13535 13542 13532 13534 13535 13542 13550 - 13531 13536 13537 13528 13531 13536 13537 13544 - 13543 13536 13537 13528 13543 13536 13537 13544 - 13531 13536 13543 13534 13531 13536 13543 13551 - 13537 13536 13543 13534 13537 13536 13543 13551 - 13528 13537 13544 13538 13528 13537 13544 13547 - 13536 13537 13544 13538 13536 13537 13544 13547 - 13529 13538 13539 13527 13529 13538 13539 13545 - 13544 13538 13539 13527 13544 13538 13539 13545 - 13529 13538 13544 13537 13529 13538 13544 13547 - 13539 13538 13544 13537 13539 13538 13544 13547 - 13527 13539 13545 13541 13527 13539 13545 13548 - 13538 13539 13545 13541 13538 13539 13545 13548 - 13525 13540 13541 13526 13525 13540 13541 13545 - 13546 13540 13541 13526 13546 13540 13541 13545 - 13525 13540 13546 13533 13525 13540 13546 13549 - 13541 13540 13546 13533 13541 13540 13546 13549 - 13526 13541 13545 13539 13526 13541 13545 13548 - 13540 13541 13545 13539 13540 13541 13545 13548 - 13532 13542 13550 13549 13532 13542 13550 13551 - 13535 13542 13550 13549 13535 13542 13550 13551 - 13534 13543 13551 13547 13534 13543 13551 13550 - 13536 13543 13551 13547 13536 13543 13551 13550 - 13537 13544 13547 13548 13537 13544 13547 13551 - 13538 13544 13547 13548 13538 13544 13547 13551 - 13539 13545 13548 13547 13539 13545 13548 13549 - 13541 13545 13548 13547 13541 13545 13548 13549 - 13533 13546 13549 13548 13533 13546 13549 13550 - 13540 13546 13549 13548 13540 13546 13549 13550 - 13544 13547 13548 13545 13544 13547 13548 13549 - 13551 13547 13548 13545 13551 13547 13548 13549 - 13544 13547 13551 13543 13544 13547 13551 13550 - 13548 13547 13551 13543 13548 13547 13551 13550 - 13545 13548 13549 13546 13545 13548 13549 13550 - 13547 13548 13549 13546 13547 13548 13549 13550 - 13546 13549 13550 13542 13546 13549 13550 13551 - 13548 13549 13550 13542 13548 13549 13550 13551 - 13542 13550 13551 13543 13542 13550 13551 13547 - 13549 13550 13551 13543 13549 13550 13551 13547 - 13558 13552 13553 13554 13558 13552 13553 13559 - 13556 13552 13553 13554 13556 13552 13553 13559 - 13553 13552 13558 13570 13553 13552 13558 13569 - 13556 13552 13558 13570 13556 13552 13558 13569 - 13553 13552 13556 13555 13553 13552 13556 13557 - 13558 13552 13556 13555 13558 13552 13556 13557 - 13552 13553 13554 13555 13552 13553 13554 13560 - 13559 13553 13554 13555 13559 13553 13554 13560 - 13552 13553 13559 13571 13552 13553 13559 13562 - 13554 13553 13559 13571 13554 13553 13559 13562 - 13553 13554 13555 13561 13553 13554 13555 13556 - 13560 13554 13555 13561 13560 13554 13555 13556 - 13553 13554 13560 13564 13553 13554 13560 13563 - 13555 13554 13560 13564 13555 13554 13560 13563 - 13554 13555 13561 13565 13554 13555 13561 13566 - 13556 13555 13561 13565 13556 13555 13561 13566 - 13554 13555 13556 13552 13554 13555 13556 13557 - 13561 13555 13556 13552 13561 13555 13556 13557 - 13552 13556 13557 13567 13552 13556 13557 13568 - 13555 13556 13557 13567 13555 13556 13557 13568 - 13556 13557 13567 13566 13556 13557 13567 13580 - 13568 13557 13567 13566 13568 13557 13567 13580 - 13556 13557 13568 13569 13556 13557 13568 13581 - 13567 13557 13568 13569 13567 13557 13568 13581 - 13552 13558 13570 13571 13552 13558 13570 13572 - 13569 13558 13570 13571 13569 13558 13570 13572 - 13552 13558 13569 13568 13552 13558 13569 13573 - 13570 13558 13569 13568 13570 13558 13569 13573 - 13553 13559 13571 13570 13553 13559 13571 13574 - 13562 13559 13571 13570 13562 13559 13571 13574 - 13553 13559 13562 13563 13553 13559 13562 13575 - 13571 13559 13562 13563 13571 13559 13562 13575 - 13554 13560 13564 13565 13554 13560 13564 13577 - 13563 13560 13564 13565 13563 13560 13564 13577 - 13554 13560 13563 13562 13554 13560 13563 13576 - 13564 13560 13563 13562 13564 13560 13563 13576 - 13555 13561 13565 13564 13555 13561 13565 13578 - 13566 13561 13565 13564 13566 13561 13565 13578 - 13555 13561 13566 13567 13555 13561 13566 13579 - 13565 13561 13566 13567 13565 13561 13566 13579 - 13559 13562 13563 13560 13559 13562 13563 13576 - 13575 13562 13563 13560 13575 13562 13563 13576 - 13559 13562 13575 13574 13559 13562 13575 13584 - 13563 13562 13575 13574 13563 13562 13575 13584 - 13560 13563 13576 13577 13560 13563 13576 13585 - 13562 13563 13576 13577 13562 13563 13576 13585 - 13560 13564 13565 13561 13560 13564 13565 13578 - 13577 13564 13565 13561 13577 13564 13565 13578 - 13560 13564 13577 13576 13560 13564 13577 13586 - 13565 13564 13577 13576 13565 13564 13577 13586 - 13561 13565 13578 13579 13561 13565 13578 13587 - 13564 13565 13578 13579 13564 13565 13578 13587 - 13561 13566 13567 13557 13561 13566 13567 13580 - 13579 13566 13567 13557 13579 13566 13567 13580 - 13561 13566 13579 13578 13561 13566 13579 13589 - 13567 13566 13579 13578 13567 13566 13579 13589 - 13557 13567 13580 13581 13557 13567 13580 13588 - 13566 13567 13580 13581 13566 13567 13580 13588 - 13557 13568 13569 13558 13557 13568 13569 13573 - 13581 13568 13569 13558 13581 13568 13569 13573 - 13557 13568 13581 13580 13557 13568 13581 13591 - 13569 13568 13581 13580 13569 13568 13581 13591 - 13558 13569 13573 13572 13558 13569 13573 13590 - 13568 13569 13573 13572 13568 13569 13573 13590 - 13558 13570 13571 13559 13558 13570 13571 13574 - 13572 13570 13571 13559 13572 13570 13571 13574 - 13558 13570 13572 13573 13558 13570 13572 13582 - 13571 13570 13572 13573 13571 13570 13572 13582 - 13559 13571 13574 13575 13559 13571 13574 13583 - 13570 13571 13574 13575 13570 13571 13574 13583 - 13570 13572 13573 13569 13570 13572 13573 13590 - 13582 13572 13573 13569 13582 13572 13573 13590 - 13570 13572 13582 13583 13570 13572 13582 13595 - 13573 13572 13582 13583 13573 13572 13582 13595 - 13569 13573 13590 13594 13569 13573 13590 13591 - 13572 13573 13590 13594 13572 13573 13590 13591 - 13571 13574 13575 13562 13571 13574 13575 13584 - 13583 13574 13575 13562 13583 13574 13575 13584 - 13571 13574 13583 13582 13571 13574 13583 13592 - 13575 13574 13583 13582 13575 13574 13583 13592 - 13562 13575 13584 13585 13562 13575 13584 13593 - 13574 13575 13584 13585 13574 13575 13584 13593 - 13563 13576 13577 13564 13563 13576 13577 13586 - 13585 13576 13577 13564 13585 13576 13577 13586 - 13563 13576 13585 13584 13563 13576 13585 13600 - 13577 13576 13585 13584 13577 13576 13585 13600 - 13564 13577 13586 13601 13564 13577 13586 13587 - 13576 13577 13586 13601 13576 13577 13586 13587 - 13565 13578 13579 13566 13565 13578 13579 13589 - 13587 13578 13579 13566 13587 13578 13579 13589 - 13565 13578 13587 13586 13565 13578 13587 13599 - 13579 13578 13587 13586 13579 13578 13587 13599 - 13566 13579 13589 13588 13566 13579 13589 13598 - 13578 13579 13589 13588 13578 13579 13589 13598 - 13567 13580 13581 13568 13567 13580 13581 13591 - 13588 13580 13581 13568 13588 13580 13581 13591 - 13567 13580 13588 13597 13567 13580 13588 13589 - 13581 13580 13588 13597 13581 13580 13588 13589 - 13568 13581 13591 13590 13568 13581 13591 13596 - 13580 13581 13591 13590 13580 13581 13591 13596 - 13572 13582 13583 13574 13572 13582 13583 13592 - 13595 13582 13583 13574 13595 13582 13583 13592 - 13572 13582 13595 13594 13572 13582 13595 13602 - 13583 13582 13595 13594 13583 13582 13595 13602 - 13574 13583 13592 13593 13574 13583 13592 13602 - 13582 13583 13592 13593 13582 13583 13592 13602 - 13575 13584 13585 13576 13575 13584 13585 13600 - 13593 13584 13585 13576 13593 13584 13585 13600 - 13575 13584 13593 13592 13575 13584 13593 13606 - 13585 13584 13593 13592 13585 13584 13593 13606 - 13576 13585 13600 13601 13576 13585 13600 13606 - 13584 13585 13600 13601 13584 13585 13600 13606 - 13577 13586 13601 13600 13577 13586 13601 13605 - 13587 13586 13601 13600 13587 13586 13601 13605 - 13577 13586 13587 13578 13577 13586 13587 13599 - 13601 13586 13587 13578 13601 13586 13587 13599 - 13578 13587 13599 13598 13578 13587 13599 13605 - 13586 13587 13599 13598 13586 13587 13599 13605 - 13580 13588 13597 13596 13580 13588 13597 13604 - 13589 13588 13597 13596 13589 13588 13597 13604 - 13580 13588 13589 13579 13580 13588 13589 13598 - 13597 13588 13589 13579 13597 13588 13589 13598 - 13579 13589 13598 13599 13579 13589 13598 13604 - 13588 13589 13598 13599 13588 13589 13598 13604 - 13573 13590 13594 13595 13573 13590 13594 13603 - 13591 13590 13594 13595 13591 13590 13594 13603 - 13573 13590 13591 13581 13573 13590 13591 13596 - 13594 13590 13591 13581 13594 13590 13591 13596 - 13581 13591 13596 13597 13581 13591 13596 13603 - 13590 13591 13596 13597 13590 13591 13596 13603 - 13583 13592 13593 13584 13583 13592 13593 13606 - 13602 13592 13593 13584 13602 13592 13593 13606 - 13583 13592 13602 13595 13583 13592 13602 13610 - 13593 13592 13602 13595 13593 13592 13602 13610 - 13584 13593 13606 13600 13584 13593 13606 13609 - 13592 13593 13606 13600 13592 13593 13606 13609 - 13590 13594 13595 13582 13590 13594 13595 13602 - 13603 13594 13595 13582 13603 13594 13595 13602 - 13590 13594 13603 13596 13590 13594 13603 13611 - 13595 13594 13603 13596 13595 13594 13603 13611 - 13582 13595 13602 13592 13582 13595 13602 13610 - 13594 13595 13602 13592 13594 13595 13602 13610 - 13591 13596 13597 13588 13591 13596 13597 13604 - 13603 13596 13597 13588 13603 13596 13597 13604 - 13591 13596 13603 13594 13591 13596 13603 13611 - 13597 13596 13603 13594 13597 13596 13603 13611 - 13588 13597 13604 13598 13588 13597 13604 13607 - 13596 13597 13604 13598 13596 13597 13604 13607 - 13589 13598 13599 13587 13589 13598 13599 13605 - 13604 13598 13599 13587 13604 13598 13599 13605 - 13589 13598 13604 13597 13589 13598 13604 13607 - 13599 13598 13604 13597 13599 13598 13604 13607 - 13587 13599 13605 13601 13587 13599 13605 13608 - 13598 13599 13605 13601 13598 13599 13605 13608 - 13585 13600 13601 13586 13585 13600 13601 13605 - 13606 13600 13601 13586 13606 13600 13601 13605 - 13585 13600 13606 13593 13585 13600 13606 13609 - 13601 13600 13606 13593 13601 13600 13606 13609 - 13586 13601 13605 13599 13586 13601 13605 13608 - 13600 13601 13605 13599 13600 13601 13605 13608 - 13592 13602 13610 13609 13592 13602 13610 13611 - 13595 13602 13610 13609 13595 13602 13610 13611 - 13594 13603 13611 13607 13594 13603 13611 13610 - 13596 13603 13611 13607 13596 13603 13611 13610 - 13597 13604 13607 13608 13597 13604 13607 13611 - 13598 13604 13607 13608 13598 13604 13607 13611 - 13599 13605 13608 13607 13599 13605 13608 13609 - 13601 13605 13608 13607 13601 13605 13608 13609 - 13593 13606 13609 13608 13593 13606 13609 13610 - 13600 13606 13609 13608 13600 13606 13609 13610 - 13604 13607 13608 13605 13604 13607 13608 13609 - 13611 13607 13608 13605 13611 13607 13608 13609 - 13604 13607 13611 13603 13604 13607 13611 13610 - 13608 13607 13611 13603 13608 13607 13611 13610 - 13605 13608 13609 13606 13605 13608 13609 13610 - 13607 13608 13609 13606 13607 13608 13609 13610 - 13606 13609 13610 13602 13606 13609 13610 13611 - 13608 13609 13610 13602 13608 13609 13610 13611 - 13602 13610 13611 13603 13602 13610 13611 13607 - 13609 13610 13611 13603 13609 13610 13611 13607 - 13616 13612 13618 13630 13616 13612 13618 13629 - 13613 13612 13618 13630 13613 13612 13618 13629 - 13618 13612 13616 13615 13618 13612 13616 13617 - 13613 13612 13616 13615 13613 13612 13616 13617 - 13618 13612 13613 13614 13618 13612 13613 13619 - 13616 13612 13613 13614 13616 13612 13613 13619 - 13612 13613 13614 13615 13612 13613 13614 13620 - 13619 13613 13614 13615 13619 13613 13614 13620 - 13612 13613 13619 13622 13612 13613 13619 13631 - 13614 13613 13619 13622 13614 13613 13619 13631 - 13613 13614 13615 13621 13613 13614 13615 13616 - 13620 13614 13615 13621 13620 13614 13615 13616 - 13613 13614 13620 13623 13613 13614 13620 13624 - 13615 13614 13620 13623 13615 13614 13620 13624 - 13614 13615 13621 13625 13614 13615 13621 13626 - 13616 13615 13621 13625 13616 13615 13621 13626 - 13614 13615 13616 13612 13614 13615 13616 13617 - 13621 13615 13616 13612 13621 13615 13616 13617 - 13612 13616 13617 13628 13612 13616 13617 13627 - 13615 13616 13617 13628 13615 13616 13617 13627 - 13616 13617 13628 13629 13616 13617 13628 13641 - 13627 13617 13628 13629 13627 13617 13628 13641 - 13616 13617 13627 13626 13616 13617 13627 13640 - 13628 13617 13627 13626 13628 13617 13627 13640 - 13612 13618 13630 13631 13612 13618 13630 13632 - 13629 13618 13630 13631 13629 13618 13630 13632 - 13612 13618 13629 13628 13612 13618 13629 13633 - 13630 13618 13629 13628 13630 13618 13629 13633 - 13613 13619 13622 13623 13613 13619 13622 13635 - 13631 13619 13622 13623 13631 13619 13622 13635 - 13613 13619 13631 13630 13613 13619 13631 13634 - 13622 13619 13631 13630 13622 13619 13631 13634 - 13614 13620 13623 13622 13614 13620 13623 13636 - 13624 13620 13623 13622 13624 13620 13623 13636 - 13614 13620 13624 13637 13614 13620 13624 13625 - 13623 13620 13624 13637 13623 13620 13624 13625 - 13615 13621 13625 13624 13615 13621 13625 13638 - 13626 13621 13625 13624 13626 13621 13625 13638 - 13615 13621 13626 13639 13615 13621 13626 13627 - 13625 13621 13626 13639 13625 13621 13626 13627 - 13619 13622 13623 13620 13619 13622 13623 13636 - 13635 13622 13623 13620 13635 13622 13623 13636 - 13619 13622 13635 13634 13619 13622 13635 13644 - 13623 13622 13635 13634 13623 13622 13635 13644 - 13620 13623 13636 13645 13620 13623 13636 13637 - 13622 13623 13636 13645 13622 13623 13636 13637 - 13620 13624 13637 13636 13620 13624 13637 13646 - 13625 13624 13637 13636 13625 13624 13637 13646 - 13620 13624 13625 13621 13620 13624 13625 13638 - 13637 13624 13625 13621 13637 13624 13625 13638 - 13621 13625 13638 13647 13621 13625 13638 13639 - 13624 13625 13638 13647 13624 13625 13638 13639 - 13621 13626 13639 13638 13621 13626 13639 13649 - 13627 13626 13639 13638 13627 13626 13639 13649 - 13621 13626 13627 13617 13621 13626 13627 13640 - 13639 13626 13627 13617 13639 13626 13627 13640 - 13617 13627 13640 13641 13617 13627 13640 13648 - 13626 13627 13640 13641 13626 13627 13640 13648 - 13617 13628 13629 13618 13617 13628 13629 13633 - 13641 13628 13629 13618 13641 13628 13629 13633 - 13617 13628 13641 13640 13617 13628 13641 13651 - 13629 13628 13641 13640 13629 13628 13641 13651 - 13618 13629 13633 13632 13618 13629 13633 13650 - 13628 13629 13633 13632 13628 13629 13633 13650 - 13618 13630 13631 13619 13618 13630 13631 13634 - 13632 13630 13631 13619 13632 13630 13631 13634 - 13618 13630 13632 13642 13618 13630 13632 13633 - 13631 13630 13632 13642 13631 13630 13632 13633 - 13619 13631 13634 13635 13619 13631 13634 13643 - 13630 13631 13634 13635 13630 13631 13634 13643 - 13630 13632 13642 13643 13630 13632 13642 13655 - 13633 13632 13642 13643 13633 13632 13642 13655 - 13630 13632 13633 13629 13630 13632 13633 13650 - 13642 13632 13633 13629 13642 13632 13633 13650 - 13629 13633 13650 13654 13629 13633 13650 13651 - 13632 13633 13650 13654 13632 13633 13650 13651 - 13631 13634 13635 13622 13631 13634 13635 13644 - 13643 13634 13635 13622 13643 13634 13635 13644 - 13631 13634 13643 13642 13631 13634 13643 13652 - 13635 13634 13643 13642 13635 13634 13643 13652 - 13622 13635 13644 13653 13622 13635 13644 13645 - 13634 13635 13644 13653 13634 13635 13644 13645 - 13623 13636 13645 13644 13623 13636 13645 13660 - 13637 13636 13645 13644 13637 13636 13645 13660 - 13623 13636 13637 13624 13623 13636 13637 13646 - 13645 13636 13637 13624 13645 13636 13637 13646 - 13624 13637 13646 13661 13624 13637 13646 13647 - 13636 13637 13646 13661 13636 13637 13646 13647 - 13625 13638 13647 13646 13625 13638 13647 13659 - 13639 13638 13647 13646 13639 13638 13647 13659 - 13625 13638 13639 13626 13625 13638 13639 13649 - 13647 13638 13639 13626 13647 13638 13639 13649 - 13626 13639 13649 13648 13626 13639 13649 13658 - 13638 13639 13649 13648 13638 13639 13649 13658 - 13627 13640 13641 13628 13627 13640 13641 13651 - 13648 13640 13641 13628 13648 13640 13641 13651 - 13627 13640 13648 13657 13627 13640 13648 13649 - 13641 13640 13648 13657 13641 13640 13648 13649 - 13628 13641 13651 13650 13628 13641 13651 13656 - 13640 13641 13651 13650 13640 13641 13651 13656 - 13632 13642 13643 13634 13632 13642 13643 13652 - 13655 13642 13643 13634 13655 13642 13643 13652 - 13632 13642 13655 13654 13632 13642 13655 13662 - 13643 13642 13655 13654 13643 13642 13655 13662 - 13634 13643 13652 13653 13634 13643 13652 13662 - 13642 13643 13652 13653 13642 13643 13652 13662 - 13635 13644 13653 13652 13635 13644 13653 13666 - 13645 13644 13653 13652 13645 13644 13653 13666 - 13635 13644 13645 13636 13635 13644 13645 13660 - 13653 13644 13645 13636 13653 13644 13645 13660 - 13636 13645 13660 13661 13636 13645 13660 13666 - 13644 13645 13660 13661 13644 13645 13660 13666 - 13637 13646 13661 13660 13637 13646 13661 13665 - 13647 13646 13661 13660 13647 13646 13661 13665 - 13637 13646 13647 13638 13637 13646 13647 13659 - 13661 13646 13647 13638 13661 13646 13647 13659 - 13638 13647 13659 13658 13638 13647 13659 13665 - 13646 13647 13659 13658 13646 13647 13659 13665 - 13640 13648 13657 13656 13640 13648 13657 13664 - 13649 13648 13657 13656 13649 13648 13657 13664 - 13640 13648 13649 13639 13640 13648 13649 13658 - 13657 13648 13649 13639 13657 13648 13649 13658 - 13639 13649 13658 13659 13639 13649 13658 13664 - 13648 13649 13658 13659 13648 13649 13658 13664 - 13633 13650 13654 13655 13633 13650 13654 13663 - 13651 13650 13654 13655 13651 13650 13654 13663 - 13633 13650 13651 13641 13633 13650 13651 13656 - 13654 13650 13651 13641 13654 13650 13651 13656 - 13641 13651 13656 13657 13641 13651 13656 13663 - 13650 13651 13656 13657 13650 13651 13656 13663 - 13643 13652 13653 13644 13643 13652 13653 13666 - 13662 13652 13653 13644 13662 13652 13653 13666 - 13643 13652 13662 13655 13643 13652 13662 13670 - 13653 13652 13662 13655 13653 13652 13662 13670 - 13644 13653 13666 13660 13644 13653 13666 13669 - 13652 13653 13666 13660 13652 13653 13666 13669 - 13650 13654 13655 13642 13650 13654 13655 13662 - 13663 13654 13655 13642 13663 13654 13655 13662 - 13650 13654 13663 13656 13650 13654 13663 13671 - 13655 13654 13663 13656 13655 13654 13663 13671 - 13642 13655 13662 13652 13642 13655 13662 13670 - 13654 13655 13662 13652 13654 13655 13662 13670 - 13651 13656 13657 13648 13651 13656 13657 13664 - 13663 13656 13657 13648 13663 13656 13657 13664 - 13651 13656 13663 13654 13651 13656 13663 13671 - 13657 13656 13663 13654 13657 13656 13663 13671 - 13648 13657 13664 13658 13648 13657 13664 13667 - 13656 13657 13664 13658 13656 13657 13664 13667 - 13649 13658 13659 13647 13649 13658 13659 13665 - 13664 13658 13659 13647 13664 13658 13659 13665 - 13649 13658 13664 13657 13649 13658 13664 13667 - 13659 13658 13664 13657 13659 13658 13664 13667 - 13647 13659 13665 13661 13647 13659 13665 13668 - 13658 13659 13665 13661 13658 13659 13665 13668 - 13645 13660 13661 13646 13645 13660 13661 13665 - 13666 13660 13661 13646 13666 13660 13661 13665 - 13645 13660 13666 13653 13645 13660 13666 13669 - 13661 13660 13666 13653 13661 13660 13666 13669 - 13646 13661 13665 13659 13646 13661 13665 13668 - 13660 13661 13665 13659 13660 13661 13665 13668 - 13652 13662 13670 13669 13652 13662 13670 13671 - 13655 13662 13670 13669 13655 13662 13670 13671 - 13654 13663 13671 13667 13654 13663 13671 13670 - 13656 13663 13671 13667 13656 13663 13671 13670 - 13657 13664 13667 13671 13657 13664 13667 13668 - 13658 13664 13667 13671 13658 13664 13667 13668 - 13659 13665 13668 13667 13659 13665 13668 13669 - 13661 13665 13668 13667 13661 13665 13668 13669 - 13653 13666 13669 13668 13653 13666 13669 13670 - 13660 13666 13669 13668 13660 13666 13669 13670 - 13664 13667 13671 13663 13664 13667 13671 13670 - 13668 13667 13671 13663 13668 13667 13671 13670 - 13664 13667 13668 13665 13664 13667 13668 13669 - 13671 13667 13668 13665 13671 13667 13668 13669 - 13665 13668 13669 13666 13665 13668 13669 13670 - 13667 13668 13669 13666 13667 13668 13669 13670 - 13666 13669 13670 13662 13666 13669 13670 13671 - 13668 13669 13670 13662 13668 13669 13670 13671 - 13662 13670 13671 13663 13662 13670 13671 13667 - 13669 13670 13671 13663 13669 13670 13671 13667 - - 0 !NIMPHI: impropers - - - 0 !NDON: donors - - - 0 !NACC: acceptors - - - 0 !NNB - - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 - - 1 0 !NGRP - 0 0 0 - diff --git a/src/vrpn/demos/afm-plus-lammps/afm-plus_imd.vmd b/src/vrpn/demos/afm-plus-lammps/afm-plus_imd.vmd deleted file mode 100644 index 5c374926a4a4782ce99fae50ded9b09927c359eb..0000000000000000000000000000000000000000 --- a/src/vrpn/demos/afm-plus-lammps/afm-plus_imd.vmd +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/tclsh -# $Id$ - -display distance -2.000000 -display projection Perspective -display nearclip set 0.000100 -display farclip set 30.000000 -display depthcue off -display backgroundgradiend on -if {0} { - display rendermode GLSL -} else { - display rendermode Normal -} - - -set thismol [ mol new afm-plus.psf type psf first 0 last -1 step 1 filebonds 1 autobonds 1 waitfor all ] -mol delrep 0 top -mol representation VDW 0.500000 16.000000 -mol color Name -mol selection {name SU NS CS OS HS} -mol material Glossy -mol addrep top -mol selection {name ZN PS} -mol material AOEdgy -mol addrep top -mol rename top {Simulated AFM Experiment} - -draw delete all -draw material Glass3 -#draw material Chalky -draw color white -draw triangle {-26.0 -26.0 -26.0} { 26.0 -26.0 -26.0} { 26.0 0.0 -26.0} -draw triangle {-26.0 -26.0 -26.0} {-26.0 0.0 -26.0} { 26.0 0.0 -26.0} -draw triangle {-26.0 -26.0 26.0} { 26.0 -26.0 26.0} { 26.0 0.0 26.0} -draw triangle {-26.0 -26.0 26.0} {-26.0 0.0 26.0} { 26.0 0.0 26.0} -draw triangle { 26.0 -26.0 -26.0} { 26.0 -26.0 26.0} { 26.0 0.0 26.0} -draw triangle { 26.0 -26.0 -26.0} { 26.0 0.0 -26.0} { 26.0 0.0 26.0} - -imd connect localhost 6789 - -display resize 1024 768 -rotate y by 90 -translate by 0.0 -0.5 0.0 - -after idle { - play falcon.tcl -} diff --git a/src/vrpn/demos/afm-plus-lammps/data.afm-plus b/src/vrpn/demos/afm-plus-lammps/data.afm-plus deleted file mode 100644 index b9107ddc000e68cb520de2e6530183bab90053b3..0000000000000000000000000000000000000000 --- a/src/vrpn/demos/afm-plus-lammps/data.afm-plus +++ /dev/null @@ -1,14504 +0,0 @@ -LAMMPS data file. CGCMM style. $Id$ - 13671 atoms - 270 bonds - 540 angles - 0 impropers - 6 atom types - 1 bond types - 1 angle types - 0 dihedral types - 0 improper types - -25.00 25.00 xlo xhi - -25.00 25.00 ylo yhi - -25.00 25.00 zlo zhi - - Atoms - -1 1 1 -24.662121 -24.662121 -24.662121 # 1 -2 2 1 -23.840050 -24.662121 -23.840050 # 1 -3 3 1 -23.017979 -24.662121 -24.662121 # 1 -4 4 1 -22.195910 -24.662121 -23.840050 # 1 -5 5 1 -21.373838 -24.662121 -24.662121 # 1 -6 6 1 -20.551767 -24.662121 -23.840050 # 1 -7 7 1 -19.729696 -24.662121 -24.662121 # 1 -8 8 1 -18.907625 -24.662121 -23.840050 # 1 -9 9 1 -18.085556 -24.662121 -24.662121 # 1 -10 10 1 -17.263485 -24.662121 -23.840050 # 1 -11 11 1 -16.441414 -24.662121 -24.662121 # 1 -12 12 1 -15.619343 -24.662121 -23.840050 # 1 -13 13 1 -14.797273 -24.662121 -24.662121 # 1 -14 14 1 -13.975202 -24.662121 -23.840050 # 1 -15 15 1 -13.153131 -24.662121 -24.662121 # 1 -16 16 1 -12.331060 -24.662121 -23.840050 # 1 -17 17 1 -11.508989 -24.662121 -24.662121 # 1 -18 18 1 -10.686919 -24.662121 -23.840050 # 1 -19 19 1 -9.864848 -24.662121 -24.662121 # 1 -20 20 1 -9.042778 -24.662121 -23.840050 # 1 -21 21 1 -24.662121 -24.662121 -23.017979 # 1 -22 22 1 -23.840050 -24.662121 -22.195910 # 1 -23 23 1 -23.017979 -24.662121 -23.017979 # 1 -24 24 1 -22.195910 -24.662121 -22.195910 # 1 -25 25 1 -21.373838 -24.662121 -23.017979 # 1 -26 26 1 -20.551767 -24.662121 -22.195910 # 1 -27 27 1 -19.729696 -24.662121 -23.017979 # 1 -28 28 1 -18.907625 -24.662121 -22.195910 # 1 -29 29 1 -18.085556 -24.662121 -23.017979 # 1 -30 30 1 -17.263485 -24.662121 -22.195910 # 1 -31 31 1 -16.441414 -24.662121 -23.017979 # 1 -32 32 1 -15.619343 -24.662121 -22.195910 # 1 -33 33 1 -14.797273 -24.662121 -23.017979 # 1 -34 34 1 -13.975202 -24.662121 -22.195910 # 1 -35 35 1 -13.153131 -24.662121 -23.017979 # 1 -36 36 1 -12.331060 -24.662121 -22.195910 # 1 -37 37 1 -11.508989 -24.662121 -23.017979 # 1 -38 38 1 -10.686919 -24.662121 -22.195910 # 1 -39 39 1 -9.864848 -24.662121 -23.017979 # 1 -40 40 1 -9.042778 -24.662121 -22.195910 # 1 -41 41 1 -24.662121 -24.662121 -21.373838 # 1 -42 42 1 -23.840050 -24.662121 -20.551767 # 1 -43 43 1 -23.017979 -24.662121 -21.373838 # 1 -44 44 1 -22.195910 -24.662121 -20.551767 # 1 -45 45 1 -21.373838 -24.662121 -21.373838 # 1 -46 46 1 -20.551767 -24.662121 -20.551767 # 1 -47 47 1 -19.729696 -24.662121 -21.373838 # 1 -48 48 1 -18.907625 -24.662121 -20.551767 # 1 -49 49 1 -18.085556 -24.662121 -21.373838 # 1 -50 50 1 -17.263485 -24.662121 -20.551767 # 1 -51 51 1 -16.441414 -24.662121 -21.373838 # 1 -52 52 1 -15.619343 -24.662121 -20.551767 # 1 -53 53 1 -14.797273 -24.662121 -21.373838 # 1 -54 54 1 -13.975202 -24.662121 -20.551767 # 1 -55 55 1 -13.153131 -24.662121 -21.373838 # 1 -56 56 1 -12.331060 -24.662121 -20.551767 # 1 -57 57 1 -11.508989 -24.662121 -21.373838 # 1 -58 58 1 -10.686919 -24.662121 -20.551767 # 1 -59 59 1 -9.864848 -24.662121 -21.373838 # 1 -60 60 1 -9.042778 -24.662121 -20.551767 # 1 -61 61 1 -24.662121 -24.662121 -19.729696 # 1 -62 62 1 -23.840050 -24.662121 -18.907625 # 1 -63 63 1 -23.017979 -24.662121 -19.729696 # 1 -64 64 1 -22.195910 -24.662121 -18.907625 # 1 -65 65 1 -21.373838 -24.662121 -19.729696 # 1 -66 66 1 -20.551767 -24.662121 -18.907625 # 1 -67 67 1 -19.729696 -24.662121 -19.729696 # 1 -68 68 1 -18.907625 -24.662121 -18.907625 # 1 -69 69 1 -18.085556 -24.662121 -19.729696 # 1 -70 70 1 -17.263485 -24.662121 -18.907625 # 1 -71 71 1 -16.441414 -24.662121 -19.729696 # 1 -72 72 1 -15.619343 -24.662121 -18.907625 # 1 -73 73 1 -14.797273 -24.662121 -19.729696 # 1 -74 74 1 -13.975202 -24.662121 -18.907625 # 1 -75 75 1 -13.153131 -24.662121 -19.729696 # 1 -76 76 1 -12.331060 -24.662121 -18.907625 # 1 -77 77 1 -11.508989 -24.662121 -19.729696 # 1 -78 78 1 -10.686919 -24.662121 -18.907625 # 1 -79 79 1 -9.864848 -24.662121 -19.729696 # 1 -80 80 1 -9.042778 -24.662121 -18.907625 # 1 -81 81 1 -24.662121 -24.662121 -18.085556 # 1 -82 82 1 -23.840050 -24.662121 -17.263485 # 1 -83 83 1 -23.017979 -24.662121 -18.085556 # 1 -84 84 1 -22.195910 -24.662121 -17.263485 # 1 -85 85 1 -21.373838 -24.662121 -18.085556 # 1 -86 86 1 -20.551767 -24.662121 -17.263485 # 1 -87 87 1 -19.729696 -24.662121 -18.085556 # 1 -88 88 1 -18.907625 -24.662121 -17.263485 # 1 -89 89 1 -18.085556 -24.662121 -18.085556 # 1 -90 90 1 -17.263485 -24.662121 -17.263485 # 1 -91 91 1 -16.441414 -24.662121 -18.085556 # 1 -92 92 1 -15.619343 -24.662121 -17.263485 # 1 -93 93 1 -14.797273 -24.662121 -18.085556 # 1 -94 94 1 -13.975202 -24.662121 -17.263485 # 1 -95 95 1 -13.153131 -24.662121 -18.085556 # 1 -96 96 1 -12.331060 -24.662121 -17.263485 # 1 -97 97 1 -11.508989 -24.662121 -18.085556 # 1 -98 98 1 -10.686919 -24.662121 -17.263485 # 1 -99 99 1 -9.864848 -24.662121 -18.085556 # 1 -100 100 1 -9.042778 -24.662121 -17.263485 # 1 -101 101 1 -24.662121 -24.662121 -16.441414 # 1 -102 102 1 -23.840050 -24.662121 -15.619343 # 1 -103 103 1 -23.017979 -24.662121 -16.441414 # 1 -104 104 1 -22.195910 -24.662121 -15.619343 # 1 -105 105 1 -21.373838 -24.662121 -16.441414 # 1 -106 106 1 -20.551767 -24.662121 -15.619343 # 1 -107 107 1 -19.729696 -24.662121 -16.441414 # 1 -108 108 1 -18.907625 -24.662121 -15.619343 # 1 -109 109 1 -18.085556 -24.662121 -16.441414 # 1 -110 110 1 -17.263485 -24.662121 -15.619343 # 1 -111 111 1 -16.441414 -24.662121 -16.441414 # 1 -112 112 1 -15.619343 -24.662121 -15.619343 # 1 -113 113 1 -14.797273 -24.662121 -16.441414 # 1 -114 114 1 -13.975202 -24.662121 -15.619343 # 1 -115 115 1 -13.153131 -24.662121 -16.441414 # 1 -116 116 1 -12.331060 -24.662121 -15.619343 # 1 -117 117 1 -11.508989 -24.662121 -16.441414 # 1 -118 118 1 -10.686919 -24.662121 -15.619343 # 1 -119 119 1 -9.864848 -24.662121 -16.441414 # 1 -120 120 1 -9.042778 -24.662121 -15.619343 # 1 -121 121 1 -24.662121 -24.662121 -14.797273 # 1 -122 122 1 -23.840050 -24.662121 -13.975202 # 1 -123 123 1 -23.017979 -24.662121 -14.797273 # 1 -124 124 1 -22.195910 -24.662121 -13.975202 # 1 -125 125 1 -21.373838 -24.662121 -14.797273 # 1 -126 126 1 -20.551767 -24.662121 -13.975202 # 1 -127 127 1 -19.729696 -24.662121 -14.797273 # 1 -128 128 1 -18.907625 -24.662121 -13.975202 # 1 -129 129 1 -18.085556 -24.662121 -14.797273 # 1 -130 130 1 -17.263485 -24.662121 -13.975202 # 1 -131 131 1 -16.441414 -24.662121 -14.797273 # 1 -132 132 1 -15.619343 -24.662121 -13.975202 # 1 -133 133 1 -14.797273 -24.662121 -14.797273 # 1 -134 134 1 -13.975202 -24.662121 -13.975202 # 1 -135 135 1 -13.153131 -24.662121 -14.797273 # 1 -136 136 1 -12.331060 -24.662121 -13.975202 # 1 -137 137 1 -11.508989 -24.662121 -14.797273 # 1 -138 138 1 -10.686919 -24.662121 -13.975202 # 1 -139 139 1 -9.864848 -24.662121 -14.797273 # 1 -140 140 1 -9.042778 -24.662121 -13.975202 # 1 -141 141 1 -24.662121 -24.662121 -13.153131 # 1 -142 142 1 -23.840050 -24.662121 -12.331060 # 1 -143 143 1 -23.017979 -24.662121 -13.153131 # 1 -144 144 1 -22.195910 -24.662121 -12.331060 # 1 -145 145 1 -21.373838 -24.662121 -13.153131 # 1 -146 146 1 -20.551767 -24.662121 -12.331060 # 1 -147 147 1 -19.729696 -24.662121 -13.153131 # 1 -148 148 1 -18.907625 -24.662121 -12.331060 # 1 -149 149 1 -18.085556 -24.662121 -13.153131 # 1 -150 150 1 -17.263485 -24.662121 -12.331060 # 1 -151 151 1 -16.441414 -24.662121 -13.153131 # 1 -152 152 1 -15.619343 -24.662121 -12.331060 # 1 -153 153 1 -14.797273 -24.662121 -13.153131 # 1 -154 154 1 -13.975202 -24.662121 -12.331060 # 1 -155 155 1 -13.153131 -24.662121 -13.153131 # 1 -156 156 1 -12.331060 -24.662121 -12.331060 # 1 -157 157 1 -11.508989 -24.662121 -13.153131 # 1 -158 158 1 -10.686919 -24.662121 -12.331060 # 1 -159 159 1 -9.864848 -24.662121 -13.153131 # 1 -160 160 1 -9.042778 -24.662121 -12.331060 # 1 -161 161 1 -24.662121 -24.662121 -11.508989 # 1 -162 162 1 -23.840050 -24.662121 -10.686919 # 1 -163 163 1 -23.017979 -24.662121 -11.508989 # 1 -164 164 1 -22.195910 -24.662121 -10.686919 # 1 -165 165 1 -21.373838 -24.662121 -11.508989 # 1 -166 166 1 -20.551767 -24.662121 -10.686919 # 1 -167 167 1 -19.729696 -24.662121 -11.508989 # 1 -168 168 1 -18.907625 -24.662121 -10.686919 # 1 -169 169 1 -18.085556 -24.662121 -11.508989 # 1 -170 170 1 -17.263485 -24.662121 -10.686919 # 1 -171 171 1 -16.441414 -24.662121 -11.508989 # 1 -172 172 1 -15.619343 -24.662121 -10.686919 # 1 -173 173 1 -14.797273 -24.662121 -11.508989 # 1 -174 174 1 -13.975202 -24.662121 -10.686919 # 1 -175 175 1 -13.153131 -24.662121 -11.508989 # 1 -176 176 1 -12.331060 -24.662121 -10.686919 # 1 -177 177 1 -11.508989 -24.662121 -11.508989 # 1 -178 178 1 -10.686919 -24.662121 -10.686919 # 1 -179 179 1 -9.864848 -24.662121 -11.508989 # 1 -180 180 1 -9.042778 -24.662121 -10.686919 # 1 -181 181 1 -24.662121 -24.662121 -9.864848 # 1 -182 182 1 -23.840050 -24.662121 -9.042778 # 1 -183 183 1 -23.017979 -24.662121 -9.864848 # 1 -184 184 1 -22.195910 -24.662121 -9.042778 # 1 -185 185 1 -21.373838 -24.662121 -9.864848 # 1 -186 186 1 -20.551767 -24.662121 -9.042778 # 1 -187 187 1 -19.729696 -24.662121 -9.864848 # 1 -188 188 1 -18.907625 -24.662121 -9.042778 # 1 -189 189 1 -18.085556 -24.662121 -9.864848 # 1 -190 190 1 -17.263485 -24.662121 -9.042778 # 1 -191 191 1 -16.441414 -24.662121 -9.864848 # 1 -192 192 1 -15.619343 -24.662121 -9.042778 # 1 -193 193 1 -14.797273 -24.662121 -9.864848 # 1 -194 194 1 -13.975202 -24.662121 -9.042778 # 1 -195 195 1 -13.153131 -24.662121 -9.864848 # 1 -196 196 1 -12.331060 -24.662121 -9.042778 # 1 -197 197 1 -11.508989 -24.662121 -9.864848 # 1 -198 198 1 -10.686919 -24.662121 -9.042778 # 1 -199 199 1 -9.864848 -24.662121 -9.864848 # 1 -200 200 1 -9.042778 -24.662121 -9.042778 # 1 -201 201 1 -24.662121 -24.662121 -8.220707 # 1 -202 202 1 -23.840050 -24.662121 -7.398636 # 1 -203 203 1 -23.017979 -24.662121 -8.220707 # 1 -204 204 1 -22.195910 -24.662121 -7.398636 # 1 -205 205 1 -21.373838 -24.662121 -8.220707 # 1 -206 206 1 -20.551767 -24.662121 -7.398636 # 1 -207 207 1 -19.729696 -24.662121 -8.220707 # 1 -208 208 1 -18.907625 -24.662121 -7.398636 # 1 -209 209 1 -18.085556 -24.662121 -8.220707 # 1 -210 210 1 -17.263485 -24.662121 -7.398636 # 1 -211 211 1 -16.441414 -24.662121 -8.220707 # 1 -212 212 1 -15.619343 -24.662121 -7.398636 # 1 -213 213 1 -14.797273 -24.662121 -8.220707 # 1 -214 214 1 -13.975202 -24.662121 -7.398636 # 1 -215 215 1 -13.153131 -24.662121 -8.220707 # 1 -216 216 1 -12.331060 -24.662121 -7.398636 # 1 -217 217 1 -11.508989 -24.662121 -8.220707 # 1 -218 218 1 -10.686919 -24.662121 -7.398636 # 1 -219 219 1 -9.864848 -24.662121 -8.220707 # 1 -220 220 1 -9.042778 -24.662121 -7.398636 # 1 -221 221 1 -24.662121 -24.662121 -6.576566 # 1 -222 222 1 -23.840050 -24.662121 -5.754495 # 1 -223 223 1 -23.017979 -24.662121 -6.576566 # 1 -224 224 1 -22.195910 -24.662121 -5.754495 # 1 -225 225 1 -21.373838 -24.662121 -6.576566 # 1 -226 226 1 -20.551767 -24.662121 -5.754495 # 1 -227 227 1 -19.729696 -24.662121 -6.576566 # 1 -228 228 1 -18.907625 -24.662121 -5.754495 # 1 -229 229 1 -18.085556 -24.662121 -6.576566 # 1 -230 230 1 -17.263485 -24.662121 -5.754495 # 1 -231 231 1 -16.441414 -24.662121 -6.576566 # 1 -232 232 1 -15.619343 -24.662121 -5.754495 # 1 -233 233 1 -14.797273 -24.662121 -6.576566 # 1 -234 234 1 -13.975202 -24.662121 -5.754495 # 1 -235 235 1 -13.153131 -24.662121 -6.576566 # 1 -236 236 1 -12.331060 -24.662121 -5.754495 # 1 -237 237 1 -11.508989 -24.662121 -6.576566 # 1 -238 238 1 -10.686919 -24.662121 -5.754495 # 1 -239 239 1 -9.864848 -24.662121 -6.576566 # 1 -240 240 1 -9.042778 -24.662121 -5.754495 # 1 -241 241 1 -24.662121 -24.662121 -4.932424 # 1 -242 242 1 -23.840050 -24.662121 -4.110353 # 1 -243 243 1 -23.017979 -24.662121 -4.932424 # 1 -244 244 1 -22.195910 -24.662121 -4.110353 # 1 -245 245 1 -21.373838 -24.662121 -4.932424 # 1 -246 246 1 -20.551767 -24.662121 -4.110353 # 1 -247 247 1 -19.729696 -24.662121 -4.932424 # 1 -248 248 1 -18.907625 -24.662121 -4.110353 # 1 -249 249 1 -18.085556 -24.662121 -4.932424 # 1 -250 250 1 -17.263485 -24.662121 -4.110353 # 1 -251 251 1 -16.441414 -24.662121 -4.932424 # 1 -252 252 1 -15.619343 -24.662121 -4.110353 # 1 -253 253 1 -14.797273 -24.662121 -4.932424 # 1 -254 254 1 -13.975202 -24.662121 -4.110353 # 1 -255 255 1 -13.153131 -24.662121 -4.932424 # 1 -256 256 1 -12.331060 -24.662121 -4.110353 # 1 -257 257 1 -11.508989 -24.662121 -4.932424 # 1 -258 258 1 -10.686919 -24.662121 -4.110353 # 1 -259 259 1 -9.864848 -24.662121 -4.932424 # 1 -260 260 1 -9.042778 -24.662121 -4.110353 # 1 -261 261 1 -24.662121 -24.662121 -3.288283 # 1 -262 262 1 -23.840050 -24.662121 -2.466212 # 1 -263 263 1 -23.017979 -24.662121 -3.288283 # 1 -264 264 1 -22.195910 -24.662121 -2.466212 # 1 -265 265 1 -21.373838 -24.662121 -3.288283 # 1 -266 266 1 -20.551767 -24.662121 -2.466212 # 1 -267 267 1 -19.729696 -24.662121 -3.288283 # 1 -268 268 1 -18.907625 -24.662121 -2.466212 # 1 -269 269 1 -18.085556 -24.662121 -3.288283 # 1 -270 270 1 -17.263485 -24.662121 -2.466212 # 1 -271 271 1 -16.441414 -24.662121 -3.288283 # 1 -272 272 1 -15.619343 -24.662121 -2.466212 # 1 -273 273 1 -14.797273 -24.662121 -3.288283 # 1 -274 274 1 -13.975202 -24.662121 -2.466212 # 1 -275 275 1 -13.153131 -24.662121 -3.288283 # 1 -276 276 1 -12.331060 -24.662121 -2.466212 # 1 -277 277 1 -11.508989 -24.662121 -3.288283 # 1 -278 278 1 -10.686919 -24.662121 -2.466212 # 1 -279 279 1 -9.864848 -24.662121 -3.288283 # 1 -280 280 1 -9.042778 -24.662121 -2.466212 # 1 -281 281 1 -24.662121 -24.662121 -1.644141 # 1 -282 282 1 -23.840050 -24.662121 -0.822071 # 1 -283 283 1 -23.017979 -24.662121 -1.644141 # 1 -284 284 1 -22.195910 -24.662121 -0.822071 # 1 -285 285 1 -21.373838 -24.662121 -1.644141 # 1 -286 286 1 -20.551767 -24.662121 -0.822071 # 1 -287 287 1 -19.729696 -24.662121 -1.644141 # 1 -288 288 1 -18.907625 -24.662121 -0.822071 # 1 -289 289 1 -18.085556 -24.662121 -1.644141 # 1 -290 290 1 -17.263485 -24.662121 -0.822071 # 1 -291 291 1 -16.441414 -24.662121 -1.644141 # 1 -292 292 1 -15.619343 -24.662121 -0.822071 # 1 -293 293 1 -14.797273 -24.662121 -1.644141 # 1 -294 294 1 -13.975202 -24.662121 -0.822071 # 1 -295 295 1 -13.153131 -24.662121 -1.644141 # 1 -296 296 1 -12.331060 -24.662121 -0.822071 # 1 -297 297 1 -11.508989 -24.662121 -1.644141 # 1 -298 298 1 -10.686919 -24.662121 -0.822071 # 1 -299 299 1 -9.864848 -24.662121 -1.644141 # 1 -300 300 1 -9.042778 -24.662121 -0.822071 # 1 -301 301 1 -24.662121 -24.662121 0.000000 # 1 -302 302 1 -23.840050 -24.662121 0.822071 # 1 -303 303 1 -23.017979 -24.662121 0.000000 # 1 -304 304 1 -22.195910 -24.662121 0.822071 # 1 -305 305 1 -21.373838 -24.662121 0.000000 # 1 -306 306 1 -20.551767 -24.662121 0.822071 # 1 -307 307 1 -19.729696 -24.662121 0.000000 # 1 -308 308 1 -18.907625 -24.662121 0.822071 # 1 -309 309 1 -18.085556 -24.662121 0.000000 # 1 -310 310 1 -17.263485 -24.662121 0.822071 # 1 -311 311 1 -16.441414 -24.662121 0.000000 # 1 -312 312 1 -15.619343 -24.662121 0.822071 # 1 -313 313 1 -14.797273 -24.662121 0.000000 # 1 -314 314 1 -13.975202 -24.662121 0.822071 # 1 -315 315 1 -13.153131 -24.662121 0.000000 # 1 -316 316 1 -12.331060 -24.662121 0.822071 # 1 -317 317 1 -11.508989 -24.662121 0.000000 # 1 -318 318 1 -10.686919 -24.662121 0.822071 # 1 -319 319 1 -9.864848 -24.662121 0.000000 # 1 -320 320 1 -9.042778 -24.662121 0.822071 # 1 -321 321 1 -24.662121 -24.662121 1.644141 # 1 -322 322 1 -23.840050 -24.662121 2.466212 # 1 -323 323 1 -23.017979 -24.662121 1.644141 # 1 -324 324 1 -22.195910 -24.662121 2.466212 # 1 -325 325 1 -21.373838 -24.662121 1.644141 # 1 -326 326 1 -20.551767 -24.662121 2.466212 # 1 -327 327 1 -19.729696 -24.662121 1.644141 # 1 -328 328 1 -18.907625 -24.662121 2.466212 # 1 -329 329 1 -18.085556 -24.662121 1.644141 # 1 -330 330 1 -17.263485 -24.662121 2.466212 # 1 -331 331 1 -16.441414 -24.662121 1.644141 # 1 -332 332 1 -15.619343 -24.662121 2.466212 # 1 -333 333 1 -14.797273 -24.662121 1.644141 # 1 -334 334 1 -13.975202 -24.662121 2.466212 # 1 -335 335 1 -13.153131 -24.662121 1.644141 # 1 -336 336 1 -12.331060 -24.662121 2.466212 # 1 -337 337 1 -11.508989 -24.662121 1.644141 # 1 -338 338 1 -10.686919 -24.662121 2.466212 # 1 -339 339 1 -9.864848 -24.662121 1.644141 # 1 -340 340 1 -9.042778 -24.662121 2.466212 # 1 -341 341 1 -24.662121 -24.662121 3.288283 # 1 -342 342 1 -23.840050 -24.662121 4.110353 # 1 -343 343 1 -23.017979 -24.662121 3.288283 # 1 -344 344 1 -22.195910 -24.662121 4.110353 # 1 -345 345 1 -21.373838 -24.662121 3.288283 # 1 -346 346 1 -20.551767 -24.662121 4.110353 # 1 -347 347 1 -19.729696 -24.662121 3.288283 # 1 -348 348 1 -18.907625 -24.662121 4.110353 # 1 -349 349 1 -18.085556 -24.662121 3.288283 # 1 -350 350 1 -17.263485 -24.662121 4.110353 # 1 -351 351 1 -16.441414 -24.662121 3.288283 # 1 -352 352 1 -15.619343 -24.662121 4.110353 # 1 -353 353 1 -14.797273 -24.662121 3.288283 # 1 -354 354 1 -13.975202 -24.662121 4.110353 # 1 -355 355 1 -13.153131 -24.662121 3.288283 # 1 -356 356 1 -12.331060 -24.662121 4.110353 # 1 -357 357 1 -11.508989 -24.662121 3.288283 # 1 -358 358 1 -10.686919 -24.662121 4.110353 # 1 -359 359 1 -9.864848 -24.662121 3.288283 # 1 -360 360 1 -9.042778 -24.662121 4.110353 # 1 -361 361 1 -24.662121 -24.662121 4.932424 # 1 -362 362 1 -23.840050 -24.662121 5.754495 # 1 -363 363 1 -23.017979 -24.662121 4.932424 # 1 -364 364 1 -22.195910 -24.662121 5.754495 # 1 -365 365 1 -21.373838 -24.662121 4.932424 # 1 -366 366 1 -20.551767 -24.662121 5.754495 # 1 -367 367 1 -19.729696 -24.662121 4.932424 # 1 -368 368 1 -18.907625 -24.662121 5.754495 # 1 -369 369 1 -18.085556 -24.662121 4.932424 # 1 -370 370 1 -17.263485 -24.662121 5.754495 # 1 -371 371 1 -16.441414 -24.662121 4.932424 # 1 -372 372 1 -15.619343 -24.662121 5.754495 # 1 -373 373 1 -14.797273 -24.662121 4.932424 # 1 -374 374 1 -13.975202 -24.662121 5.754495 # 1 -375 375 1 -13.153131 -24.662121 4.932424 # 1 -376 376 1 -12.331060 -24.662121 5.754495 # 1 -377 377 1 -11.508989 -24.662121 4.932424 # 1 -378 378 1 -10.686919 -24.662121 5.754495 # 1 -379 379 1 -9.864848 -24.662121 4.932424 # 1 -380 380 1 -9.042778 -24.662121 5.754495 # 1 -381 381 1 -24.662121 -24.662121 6.576566 # 1 -382 382 1 -23.840050 -24.662121 7.398636 # 1 -383 383 1 -23.017979 -24.662121 6.576566 # 1 -384 384 1 -22.195910 -24.662121 7.398636 # 1 -385 385 1 -21.373838 -24.662121 6.576566 # 1 -386 386 1 -20.551767 -24.662121 7.398636 # 1 -387 387 1 -19.729696 -24.662121 6.576566 # 1 -388 388 1 -18.907625 -24.662121 7.398636 # 1 -389 389 1 -18.085556 -24.662121 6.576566 # 1 -390 390 1 -17.263485 -24.662121 7.398636 # 1 -391 391 1 -16.441414 -24.662121 6.576566 # 1 -392 392 1 -15.619343 -24.662121 7.398636 # 1 -393 393 1 -14.797273 -24.662121 6.576566 # 1 -394 394 1 -13.975202 -24.662121 7.398636 # 1 -395 395 1 -13.153131 -24.662121 6.576566 # 1 -396 396 1 -12.331060 -24.662121 7.398636 # 1 -397 397 1 -11.508989 -24.662121 6.576566 # 1 -398 398 1 -10.686919 -24.662121 7.398636 # 1 -399 399 1 -9.864848 -24.662121 6.576566 # 1 -400 400 1 -9.042778 -24.662121 7.398636 # 1 -401 401 1 -24.662121 -24.662121 8.220707 # 1 -402 402 1 -23.840050 -24.662121 9.042778 # 1 -403 403 1 -23.017979 -24.662121 8.220707 # 1 -404 404 1 -22.195910 -24.662121 9.042778 # 1 -405 405 1 -21.373838 -24.662121 8.220707 # 1 -406 406 1 -20.551767 -24.662121 9.042778 # 1 -407 407 1 -19.729696 -24.662121 8.220707 # 1 -408 408 1 -18.907625 -24.662121 9.042778 # 1 -409 409 1 -18.085556 -24.662121 8.220707 # 1 -410 410 1 -17.263485 -24.662121 9.042778 # 1 -411 411 1 -16.441414 -24.662121 8.220707 # 1 -412 412 1 -15.619343 -24.662121 9.042778 # 1 -413 413 1 -14.797273 -24.662121 8.220707 # 1 -414 414 1 -13.975202 -24.662121 9.042778 # 1 -415 415 1 -13.153131 -24.662121 8.220707 # 1 -416 416 1 -12.331060 -24.662121 9.042778 # 1 -417 417 1 -11.508989 -24.662121 8.220707 # 1 -418 418 1 -10.686919 -24.662121 9.042778 # 1 -419 419 1 -9.864848 -24.662121 8.220707 # 1 -420 420 1 -9.042778 -24.662121 9.042778 # 1 -421 421 1 -24.662121 -24.662121 9.864848 # 1 -422 422 1 -23.840050 -24.662121 10.686919 # 1 -423 423 1 -23.017979 -24.662121 9.864848 # 1 -424 424 1 -22.195910 -24.662121 10.686919 # 1 -425 425 1 -21.373838 -24.662121 9.864848 # 1 -426 426 1 -20.551767 -24.662121 10.686919 # 1 -427 427 1 -19.729696 -24.662121 9.864848 # 1 -428 428 1 -18.907625 -24.662121 10.686919 # 1 -429 429 1 -18.085556 -24.662121 9.864848 # 1 -430 430 1 -17.263485 -24.662121 10.686919 # 1 -431 431 1 -16.441414 -24.662121 9.864848 # 1 -432 432 1 -15.619343 -24.662121 10.686919 # 1 -433 433 1 -14.797273 -24.662121 9.864848 # 1 -434 434 1 -13.975202 -24.662121 10.686919 # 1 -435 435 1 -13.153131 -24.662121 9.864848 # 1 -436 436 1 -12.331060 -24.662121 10.686919 # 1 -437 437 1 -11.508989 -24.662121 9.864848 # 1 -438 438 1 -10.686919 -24.662121 10.686919 # 1 -439 439 1 -9.864848 -24.662121 9.864848 # 1 -440 440 1 -9.042778 -24.662121 10.686919 # 1 -441 441 1 -24.662121 -24.662121 11.508989 # 1 -442 442 1 -23.840050 -24.662121 12.331060 # 1 -443 443 1 -23.017979 -24.662121 11.508989 # 1 -444 444 1 -22.195910 -24.662121 12.331060 # 1 -445 445 1 -21.373838 -24.662121 11.508989 # 1 -446 446 1 -20.551767 -24.662121 12.331060 # 1 -447 447 1 -19.729696 -24.662121 11.508989 # 1 -448 448 1 -18.907625 -24.662121 12.331060 # 1 -449 449 1 -18.085556 -24.662121 11.508989 # 1 -450 450 1 -17.263485 -24.662121 12.331060 # 1 -451 451 1 -16.441414 -24.662121 11.508989 # 1 -452 452 1 -15.619343 -24.662121 12.331060 # 1 -453 453 1 -14.797273 -24.662121 11.508989 # 1 -454 454 1 -13.975202 -24.662121 12.331060 # 1 -455 455 1 -13.153131 -24.662121 11.508989 # 1 -456 456 1 -12.331060 -24.662121 12.331060 # 1 -457 457 1 -11.508989 -24.662121 11.508989 # 1 -458 458 1 -10.686919 -24.662121 12.331060 # 1 -459 459 1 -9.864848 -24.662121 11.508989 # 1 -460 460 1 -9.042778 -24.662121 12.331060 # 1 -461 461 1 -24.662121 -24.662121 13.153131 # 1 -462 462 1 -23.840050 -24.662121 13.975202 # 1 -463 463 1 -23.017979 -24.662121 13.153131 # 1 -464 464 1 -22.195910 -24.662121 13.975202 # 1 -465 465 1 -21.373838 -24.662121 13.153131 # 1 -466 466 1 -20.551767 -24.662121 13.975202 # 1 -467 467 1 -19.729696 -24.662121 13.153131 # 1 -468 468 1 -18.907625 -24.662121 13.975202 # 1 -469 469 1 -18.085556 -24.662121 13.153131 # 1 -470 470 1 -17.263485 -24.662121 13.975202 # 1 -471 471 1 -16.441414 -24.662121 13.153131 # 1 -472 472 1 -15.619343 -24.662121 13.975202 # 1 -473 473 1 -14.797273 -24.662121 13.153131 # 1 -474 474 1 -13.975202 -24.662121 13.975202 # 1 -475 475 1 -13.153131 -24.662121 13.153131 # 1 -476 476 1 -12.331060 -24.662121 13.975202 # 1 -477 477 1 -11.508989 -24.662121 13.153131 # 1 -478 478 1 -10.686919 -24.662121 13.975202 # 1 -479 479 1 -9.864848 -24.662121 13.153131 # 1 -480 480 1 -9.042778 -24.662121 13.975202 # 1 -481 481 1 -24.662121 -24.662121 14.797273 # 1 -482 482 1 -23.840050 -24.662121 15.619343 # 1 -483 483 1 -23.017979 -24.662121 14.797273 # 1 -484 484 1 -22.195910 -24.662121 15.619343 # 1 -485 485 1 -21.373838 -24.662121 14.797273 # 1 -486 486 1 -20.551767 -24.662121 15.619343 # 1 -487 487 1 -19.729696 -24.662121 14.797273 # 1 -488 488 1 -18.907625 -24.662121 15.619343 # 1 -489 489 1 -18.085556 -24.662121 14.797273 # 1 -490 490 1 -17.263485 -24.662121 15.619343 # 1 -491 491 1 -16.441414 -24.662121 14.797273 # 1 -492 492 1 -15.619343 -24.662121 15.619343 # 1 -493 493 1 -14.797273 -24.662121 14.797273 # 1 -494 494 1 -13.975202 -24.662121 15.619343 # 1 -495 495 1 -13.153131 -24.662121 14.797273 # 1 -496 496 1 -12.331060 -24.662121 15.619343 # 1 -497 497 1 -11.508989 -24.662121 14.797273 # 1 -498 498 1 -10.686919 -24.662121 15.619343 # 1 -499 499 1 -9.864848 -24.662121 14.797273 # 1 -500 500 1 -9.042778 -24.662121 15.619343 # 1 -501 501 1 -24.662121 -24.662121 16.441414 # 1 -502 502 1 -23.840050 -24.662121 17.263485 # 1 -503 503 1 -23.017979 -24.662121 16.441414 # 1 -504 504 1 -22.195910 -24.662121 17.263485 # 1 -505 505 1 -21.373838 -24.662121 16.441414 # 1 -506 506 1 -20.551767 -24.662121 17.263485 # 1 -507 507 1 -19.729696 -24.662121 16.441414 # 1 -508 508 1 -18.907625 -24.662121 17.263485 # 1 -509 509 1 -18.085556 -24.662121 16.441414 # 1 -510 510 1 -17.263485 -24.662121 17.263485 # 1 -511 511 1 -16.441414 -24.662121 16.441414 # 1 -512 512 1 -15.619343 -24.662121 17.263485 # 1 -513 513 1 -14.797273 -24.662121 16.441414 # 1 -514 514 1 -13.975202 -24.662121 17.263485 # 1 -515 515 1 -13.153131 -24.662121 16.441414 # 1 -516 516 1 -12.331060 -24.662121 17.263485 # 1 -517 517 1 -11.508989 -24.662121 16.441414 # 1 -518 518 1 -10.686919 -24.662121 17.263485 # 1 -519 519 1 -9.864848 -24.662121 16.441414 # 1 -520 520 1 -9.042778 -24.662121 17.263485 # 1 -521 521 1 -24.662121 -24.662121 18.085556 # 1 -522 522 1 -23.840050 -24.662121 18.907625 # 1 -523 523 1 -23.017979 -24.662121 18.085556 # 1 -524 524 1 -22.195910 -24.662121 18.907625 # 1 -525 525 1 -21.373838 -24.662121 18.085556 # 1 -526 526 1 -20.551767 -24.662121 18.907625 # 1 -527 527 1 -19.729696 -24.662121 18.085556 # 1 -528 528 1 -18.907625 -24.662121 18.907625 # 1 -529 529 1 -18.085556 -24.662121 18.085556 # 1 -530 530 1 -17.263485 -24.662121 18.907625 # 1 -531 531 1 -16.441414 -24.662121 18.085556 # 1 -532 532 1 -15.619343 -24.662121 18.907625 # 1 -533 533 1 -14.797273 -24.662121 18.085556 # 1 -534 534 1 -13.975202 -24.662121 18.907625 # 1 -535 535 1 -13.153131 -24.662121 18.085556 # 1 -536 536 1 -12.331060 -24.662121 18.907625 # 1 -537 537 1 -11.508989 -24.662121 18.085556 # 1 -538 538 1 -10.686919 -24.662121 18.907625 # 1 -539 539 1 -9.864848 -24.662121 18.085556 # 1 -540 540 1 -9.042778 -24.662121 18.907625 # 1 -541 541 1 -24.662121 -24.662121 19.729696 # 1 -542 542 1 -23.840050 -24.662121 20.551767 # 1 -543 543 1 -23.017979 -24.662121 19.729696 # 1 -544 544 1 -22.195910 -24.662121 20.551767 # 1 -545 545 1 -21.373838 -24.662121 19.729696 # 1 -546 546 1 -20.551767 -24.662121 20.551767 # 1 -547 547 1 -19.729696 -24.662121 19.729696 # 1 -548 548 1 -18.907625 -24.662121 20.551767 # 1 -549 549 1 -18.085556 -24.662121 19.729696 # 1 -550 550 1 -17.263485 -24.662121 20.551767 # 1 -551 551 1 -16.441414 -24.662121 19.729696 # 1 -552 552 1 -15.619343 -24.662121 20.551767 # 1 -553 553 1 -14.797273 -24.662121 19.729696 # 1 -554 554 1 -13.975202 -24.662121 20.551767 # 1 -555 555 1 -13.153131 -24.662121 19.729696 # 1 -556 556 1 -12.331060 -24.662121 20.551767 # 1 -557 557 1 -11.508989 -24.662121 19.729696 # 1 -558 558 1 -10.686919 -24.662121 20.551767 # 1 -559 559 1 -9.864848 -24.662121 19.729696 # 1 -560 560 1 -9.042778 -24.662121 20.551767 # 1 -561 561 1 -24.662121 -24.662121 21.373838 # 1 -562 562 1 -23.840050 -24.662121 22.195910 # 1 -563 563 1 -23.017979 -24.662121 21.373838 # 1 -564 564 1 -22.195910 -24.662121 22.195910 # 1 -565 565 1 -21.373838 -24.662121 21.373838 # 1 -566 566 1 -20.551767 -24.662121 22.195910 # 1 -567 567 1 -19.729696 -24.662121 21.373838 # 1 -568 568 1 -18.907625 -24.662121 22.195910 # 1 -569 569 1 -18.085556 -24.662121 21.373838 # 1 -570 570 1 -17.263485 -24.662121 22.195910 # 1 -571 571 1 -16.441414 -24.662121 21.373838 # 1 -572 572 1 -15.619343 -24.662121 22.195910 # 1 -573 573 1 -14.797273 -24.662121 21.373838 # 1 -574 574 1 -13.975202 -24.662121 22.195910 # 1 -575 575 1 -13.153131 -24.662121 21.373838 # 1 -576 576 1 -12.331060 -24.662121 22.195910 # 1 -577 577 1 -11.508989 -24.662121 21.373838 # 1 -578 578 1 -10.686919 -24.662121 22.195910 # 1 -579 579 1 -9.864848 -24.662121 21.373838 # 1 -580 580 1 -9.042778 -24.662121 22.195910 # 1 -581 581 1 -24.662121 -24.662121 23.017979 # 1 -582 582 1 -23.840050 -24.662121 23.840050 # 1 -583 583 1 -23.017979 -24.662121 23.017979 # 1 -584 584 1 -22.195910 -24.662121 23.840050 # 1 -585 585 1 -21.373838 -24.662121 23.017979 # 1 -586 586 1 -20.551767 -24.662121 23.840050 # 1 -587 587 1 -19.729696 -24.662121 23.017979 # 1 -588 588 1 -18.907625 -24.662121 23.840050 # 1 -589 589 1 -18.085556 -24.662121 23.017979 # 1 -590 590 1 -17.263485 -24.662121 23.840050 # 1 -591 591 1 -16.441414 -24.662121 23.017979 # 1 -592 592 1 -15.619343 -24.662121 23.840050 # 1 -593 593 1 -14.797273 -24.662121 23.017979 # 1 -594 594 1 -13.975202 -24.662121 23.840050 # 1 -595 595 1 -13.153131 -24.662121 23.017979 # 1 -596 596 1 -12.331060 -24.662121 23.840050 # 1 -597 597 1 -11.508989 -24.662121 23.017979 # 1 -598 598 1 -10.686919 -24.662121 23.840050 # 1 -599 599 1 -9.864848 -24.662121 23.017979 # 1 -600 600 1 -9.042778 -24.662121 23.840050 # 1 -601 601 1 -8.220707 -24.662121 -24.662121 # 1 -602 602 1 -7.398636 -24.662121 -23.840050 # 1 -603 603 1 -6.576566 -24.662121 -24.662121 # 1 -604 604 1 -5.754495 -24.662121 -23.840050 # 1 -605 605 1 -4.932424 -24.662121 -24.662121 # 1 -606 606 1 -4.110353 -24.662121 -23.840050 # 1 -607 607 1 -3.288283 -24.662121 -24.662121 # 1 -608 608 1 -2.466212 -24.662121 -23.840050 # 1 -609 609 1 -1.644141 -24.662121 -24.662121 # 1 -610 610 1 -0.822071 -24.662121 -23.840050 # 1 -611 611 1 0.000000 -24.662121 -24.662121 # 1 -612 612 1 0.822071 -24.662121 -23.840050 # 1 -613 613 1 1.644141 -24.662121 -24.662121 # 1 -614 614 1 2.466212 -24.662121 -23.840050 # 1 -615 615 1 3.288283 -24.662121 -24.662121 # 1 -616 616 1 4.110353 -24.662121 -23.840050 # 1 -617 617 1 4.932424 -24.662121 -24.662121 # 1 -618 618 1 5.754495 -24.662121 -23.840050 # 1 -619 619 1 6.576566 -24.662121 -24.662121 # 1 -620 620 1 7.398636 -24.662121 -23.840050 # 1 -621 621 1 8.220707 -24.662121 -24.662121 # 1 -622 622 1 -8.220707 -24.662121 -23.017979 # 1 -623 623 1 -7.398636 -24.662121 -22.195910 # 1 -624 624 1 -6.576566 -24.662121 -23.017979 # 1 -625 625 1 -5.754495 -24.662121 -22.195910 # 1 -626 626 1 -4.932424 -24.662121 -23.017979 # 1 -627 627 1 -4.110353 -24.662121 -22.195910 # 1 -628 628 1 -3.288283 -24.662121 -23.017979 # 1 -629 629 1 -2.466212 -24.662121 -22.195910 # 1 -630 630 1 -1.644141 -24.662121 -23.017979 # 1 -631 631 1 -0.822071 -24.662121 -22.195910 # 1 -632 632 1 0.000000 -24.662121 -23.017979 # 1 -633 633 1 0.822071 -24.662121 -22.195910 # 1 -634 634 1 1.644141 -24.662121 -23.017979 # 1 -635 635 1 2.466212 -24.662121 -22.195910 # 1 -636 636 1 3.288283 -24.662121 -23.017979 # 1 -637 637 1 4.110353 -24.662121 -22.195910 # 1 -638 638 1 4.932424 -24.662121 -23.017979 # 1 -639 639 1 5.754495 -24.662121 -22.195910 # 1 -640 640 1 6.576566 -24.662121 -23.017979 # 1 -641 641 1 7.398636 -24.662121 -22.195910 # 1 -642 642 1 8.220707 -24.662121 -23.017979 # 1 -643 643 1 -8.220707 -24.662121 -21.373838 # 1 -644 644 1 -7.398636 -24.662121 -20.551767 # 1 -645 645 1 -6.576566 -24.662121 -21.373838 # 1 -646 646 1 -5.754495 -24.662121 -20.551767 # 1 -647 647 1 -4.932424 -24.662121 -21.373838 # 1 -648 648 1 -4.110353 -24.662121 -20.551767 # 1 -649 649 1 -3.288283 -24.662121 -21.373838 # 1 -650 650 1 -2.466212 -24.662121 -20.551767 # 1 -651 651 1 -1.644141 -24.662121 -21.373838 # 1 -652 652 1 -0.822071 -24.662121 -20.551767 # 1 -653 653 1 0.000000 -24.662121 -21.373838 # 1 -654 654 1 0.822071 -24.662121 -20.551767 # 1 -655 655 1 1.644141 -24.662121 -21.373838 # 1 -656 656 1 2.466212 -24.662121 -20.551767 # 1 -657 657 1 3.288283 -24.662121 -21.373838 # 1 -658 658 1 4.110353 -24.662121 -20.551767 # 1 -659 659 1 4.932424 -24.662121 -21.373838 # 1 -660 660 1 5.754495 -24.662121 -20.551767 # 1 -661 661 1 6.576566 -24.662121 -21.373838 # 1 -662 662 1 7.398636 -24.662121 -20.551767 # 1 -663 663 1 8.220707 -24.662121 -21.373838 # 1 -664 664 1 -8.220707 -24.662121 -19.729696 # 1 -665 665 1 -7.398636 -24.662121 -18.907625 # 1 -666 666 1 -6.576566 -24.662121 -19.729696 # 1 -667 667 1 -5.754495 -24.662121 -18.907625 # 1 -668 668 1 -4.932424 -24.662121 -19.729696 # 1 -669 669 1 -4.110353 -24.662121 -18.907625 # 1 -670 670 1 -3.288283 -24.662121 -19.729696 # 1 -671 671 1 -2.466212 -24.662121 -18.907625 # 1 -672 672 1 -1.644141 -24.662121 -19.729696 # 1 -673 673 1 -0.822071 -24.662121 -18.907625 # 1 -674 674 1 0.000000 -24.662121 -19.729696 # 1 -675 675 1 0.822071 -24.662121 -18.907625 # 1 -676 676 1 1.644141 -24.662121 -19.729696 # 1 -677 677 1 2.466212 -24.662121 -18.907625 # 1 -678 678 1 3.288283 -24.662121 -19.729696 # 1 -679 679 1 4.110353 -24.662121 -18.907625 # 1 -680 680 1 4.932424 -24.662121 -19.729696 # 1 -681 681 1 5.754495 -24.662121 -18.907625 # 1 -682 682 1 6.576566 -24.662121 -19.729696 # 1 -683 683 1 7.398636 -24.662121 -18.907625 # 1 -684 684 1 8.220707 -24.662121 -19.729696 # 1 -685 685 1 -8.220707 -24.662121 -18.085556 # 1 -686 686 1 -7.398636 -24.662121 -17.263485 # 1 -687 687 1 -6.576566 -24.662121 -18.085556 # 1 -688 688 1 -5.754495 -24.662121 -17.263485 # 1 -689 689 1 -4.932424 -24.662121 -18.085556 # 1 -690 690 1 -4.110353 -24.662121 -17.263485 # 1 -691 691 1 -3.288283 -24.662121 -18.085556 # 1 -692 692 1 -2.466212 -24.662121 -17.263485 # 1 -693 693 1 -1.644141 -24.662121 -18.085556 # 1 -694 694 1 -0.822071 -24.662121 -17.263485 # 1 -695 695 1 0.000000 -24.662121 -18.085556 # 1 -696 696 1 0.822071 -24.662121 -17.263485 # 1 -697 697 1 1.644141 -24.662121 -18.085556 # 1 -698 698 1 2.466212 -24.662121 -17.263485 # 1 -699 699 1 3.288283 -24.662121 -18.085556 # 1 -700 700 1 4.110353 -24.662121 -17.263485 # 1 -701 701 1 4.932424 -24.662121 -18.085556 # 1 -702 702 1 5.754495 -24.662121 -17.263485 # 1 -703 703 1 6.576566 -24.662121 -18.085556 # 1 -704 704 1 7.398636 -24.662121 -17.263485 # 1 -705 705 1 8.220707 -24.662121 -18.085556 # 1 -706 706 1 -8.220707 -24.662121 -16.441414 # 1 -707 707 1 -7.398636 -24.662121 -15.619343 # 1 -708 708 1 -6.576566 -24.662121 -16.441414 # 1 -709 709 1 -5.754495 -24.662121 -15.619343 # 1 -710 710 1 -4.932424 -24.662121 -16.441414 # 1 -711 711 1 -4.110353 -24.662121 -15.619343 # 1 -712 712 1 -3.288283 -24.662121 -16.441414 # 1 -713 713 1 -2.466212 -24.662121 -15.619343 # 1 -714 714 1 -1.644141 -24.662121 -16.441414 # 1 -715 715 1 -0.822071 -24.662121 -15.619343 # 1 -716 716 1 0.000000 -24.662121 -16.441414 # 1 -717 717 1 0.822071 -24.662121 -15.619343 # 1 -718 718 1 1.644141 -24.662121 -16.441414 # 1 -719 719 1 2.466212 -24.662121 -15.619343 # 1 -720 720 1 3.288283 -24.662121 -16.441414 # 1 -721 721 1 4.110353 -24.662121 -15.619343 # 1 -722 722 1 4.932424 -24.662121 -16.441414 # 1 -723 723 1 5.754495 -24.662121 -15.619343 # 1 -724 724 1 6.576566 -24.662121 -16.441414 # 1 -725 725 1 7.398636 -24.662121 -15.619343 # 1 -726 726 1 8.220707 -24.662121 -16.441414 # 1 -727 727 1 -8.220707 -24.662121 -14.797273 # 1 -728 728 1 -7.398636 -24.662121 -13.975202 # 1 -729 729 1 -6.576566 -24.662121 -14.797273 # 1 -730 730 1 -5.754495 -24.662121 -13.975202 # 1 -731 731 1 -4.932424 -24.662121 -14.797273 # 1 -732 732 1 -4.110353 -24.662121 -13.975202 # 1 -733 733 1 -3.288283 -24.662121 -14.797273 # 1 -734 734 1 -2.466212 -24.662121 -13.975202 # 1 -735 735 1 -1.644141 -24.662121 -14.797273 # 1 -736 736 1 -0.822071 -24.662121 -13.975202 # 1 -737 737 1 0.000000 -24.662121 -14.797273 # 1 -738 738 1 0.822071 -24.662121 -13.975202 # 1 -739 739 1 1.644141 -24.662121 -14.797273 # 1 -740 740 1 2.466212 -24.662121 -13.975202 # 1 -741 741 1 3.288283 -24.662121 -14.797273 # 1 -742 742 1 4.110353 -24.662121 -13.975202 # 1 -743 743 1 4.932424 -24.662121 -14.797273 # 1 -744 744 1 5.754495 -24.662121 -13.975202 # 1 -745 745 1 6.576566 -24.662121 -14.797273 # 1 -746 746 1 7.398636 -24.662121 -13.975202 # 1 -747 747 1 8.220707 -24.662121 -14.797273 # 1 -748 748 1 -8.220707 -24.662121 -13.153131 # 1 -749 749 1 -7.398636 -24.662121 -12.331060 # 1 -750 750 1 -6.576566 -24.662121 -13.153131 # 1 -751 751 1 -5.754495 -24.662121 -12.331060 # 1 -752 752 1 -4.932424 -24.662121 -13.153131 # 1 -753 753 1 -4.110353 -24.662121 -12.331060 # 1 -754 754 1 -3.288283 -24.662121 -13.153131 # 1 -755 755 1 -2.466212 -24.662121 -12.331060 # 1 -756 756 1 -1.644141 -24.662121 -13.153131 # 1 -757 757 1 -0.822071 -24.662121 -12.331060 # 1 -758 758 1 0.000000 -24.662121 -13.153131 # 1 -759 759 1 0.822071 -24.662121 -12.331060 # 1 -760 760 1 1.644141 -24.662121 -13.153131 # 1 -761 761 1 2.466212 -24.662121 -12.331060 # 1 -762 762 1 3.288283 -24.662121 -13.153131 # 1 -763 763 1 4.110353 -24.662121 -12.331060 # 1 -764 764 1 4.932424 -24.662121 -13.153131 # 1 -765 765 1 5.754495 -24.662121 -12.331060 # 1 -766 766 1 6.576566 -24.662121 -13.153131 # 1 -767 767 1 7.398636 -24.662121 -12.331060 # 1 -768 768 1 8.220707 -24.662121 -13.153131 # 1 -769 769 1 -8.220707 -24.662121 -11.508989 # 1 -770 770 1 -7.398636 -24.662121 -10.686919 # 1 -771 771 1 -6.576566 -24.662121 -11.508989 # 1 -772 772 1 -5.754495 -24.662121 -10.686919 # 1 -773 773 1 -4.932424 -24.662121 -11.508989 # 1 -774 774 1 -4.110353 -24.662121 -10.686919 # 1 -775 775 1 -3.288283 -24.662121 -11.508989 # 1 -776 776 1 -2.466212 -24.662121 -10.686919 # 1 -777 777 1 -1.644141 -24.662121 -11.508989 # 1 -778 778 1 -0.822071 -24.662121 -10.686919 # 1 -779 779 1 0.000000 -24.662121 -11.508989 # 1 -780 780 1 0.822071 -24.662121 -10.686919 # 1 -781 781 1 1.644141 -24.662121 -11.508989 # 1 -782 782 1 2.466212 -24.662121 -10.686919 # 1 -783 783 1 3.288283 -24.662121 -11.508989 # 1 -784 784 1 4.110353 -24.662121 -10.686919 # 1 -785 785 1 4.932424 -24.662121 -11.508989 # 1 -786 786 1 5.754495 -24.662121 -10.686919 # 1 -787 787 1 6.576566 -24.662121 -11.508989 # 1 -788 788 1 7.398636 -24.662121 -10.686919 # 1 -789 789 1 8.220707 -24.662121 -11.508989 # 1 -790 790 1 -8.220707 -24.662121 -9.864848 # 1 -791 791 1 -7.398636 -24.662121 -9.042778 # 1 -792 792 1 -6.576566 -24.662121 -9.864848 # 1 -793 793 1 -5.754495 -24.662121 -9.042778 # 1 -794 794 1 -4.932424 -24.662121 -9.864848 # 1 -795 795 1 -4.110353 -24.662121 -9.042778 # 1 -796 796 1 -3.288283 -24.662121 -9.864848 # 1 -797 797 1 -2.466212 -24.662121 -9.042778 # 1 -798 798 1 -1.644141 -24.662121 -9.864848 # 1 -799 799 1 -0.822071 -24.662121 -9.042778 # 1 -800 800 1 0.000000 -24.662121 -9.864848 # 1 -801 801 1 0.822071 -24.662121 -9.042778 # 1 -802 802 1 1.644141 -24.662121 -9.864848 # 1 -803 803 1 2.466212 -24.662121 -9.042778 # 1 -804 804 1 3.288283 -24.662121 -9.864848 # 1 -805 805 1 4.110353 -24.662121 -9.042778 # 1 -806 806 1 4.932424 -24.662121 -9.864848 # 1 -807 807 1 5.754495 -24.662121 -9.042778 # 1 -808 808 1 6.576566 -24.662121 -9.864848 # 1 -809 809 1 7.398636 -24.662121 -9.042778 # 1 -810 810 1 8.220707 -24.662121 -9.864848 # 1 -811 811 1 -8.220707 -24.662121 -8.220707 # 1 -812 812 1 -7.398636 -24.662121 -7.398636 # 1 -813 813 1 -6.576566 -24.662121 -8.220707 # 1 -814 814 1 -5.754495 -24.662121 -7.398636 # 1 -815 815 1 -4.932424 -24.662121 -8.220707 # 1 -816 816 1 -4.110353 -24.662121 -7.398636 # 1 -817 817 1 -3.288283 -24.662121 -8.220707 # 1 -818 818 1 -2.466212 -24.662121 -7.398636 # 1 -819 819 1 -1.644141 -24.662121 -8.220707 # 1 -820 820 1 -0.822071 -24.662121 -7.398636 # 1 -821 821 1 0.000000 -24.662121 -8.220707 # 1 -822 822 1 0.822071 -24.662121 -7.398636 # 1 -823 823 1 1.644141 -24.662121 -8.220707 # 1 -824 824 1 2.466212 -24.662121 -7.398636 # 1 -825 825 1 3.288283 -24.662121 -8.220707 # 1 -826 826 1 4.110353 -24.662121 -7.398636 # 1 -827 827 1 4.932424 -24.662121 -8.220707 # 1 -828 828 1 5.754495 -24.662121 -7.398636 # 1 -829 829 1 6.576566 -24.662121 -8.220707 # 1 -830 830 1 7.398636 -24.662121 -7.398636 # 1 -831 831 1 8.220707 -24.662121 -8.220707 # 1 -832 832 1 -8.220707 -24.662121 -6.576566 # 1 -833 833 1 -7.398636 -24.662121 -5.754495 # 1 -834 834 1 -6.576566 -24.662121 -6.576566 # 1 -835 835 1 -5.754495 -24.662121 -5.754495 # 1 -836 836 1 -4.932424 -24.662121 -6.576566 # 1 -837 837 1 -4.110353 -24.662121 -5.754495 # 1 -838 838 1 -3.288283 -24.662121 -6.576566 # 1 -839 839 1 -2.466212 -24.662121 -5.754495 # 1 -840 840 1 -1.644141 -24.662121 -6.576566 # 1 -841 841 1 -0.822071 -24.662121 -5.754495 # 1 -842 842 1 0.000000 -24.662121 -6.576566 # 1 -843 843 1 0.822071 -24.662121 -5.754495 # 1 -844 844 1 1.644141 -24.662121 -6.576566 # 1 -845 845 1 2.466212 -24.662121 -5.754495 # 1 -846 846 1 3.288283 -24.662121 -6.576566 # 1 -847 847 1 4.110353 -24.662121 -5.754495 # 1 -848 848 1 4.932424 -24.662121 -6.576566 # 1 -849 849 1 5.754495 -24.662121 -5.754495 # 1 -850 850 1 6.576566 -24.662121 -6.576566 # 1 -851 851 1 7.398636 -24.662121 -5.754495 # 1 -852 852 1 8.220707 -24.662121 -6.576566 # 1 -853 853 1 -8.220707 -24.662121 -4.932424 # 1 -854 854 1 -7.398636 -24.662121 -4.110353 # 1 -855 855 1 -6.576566 -24.662121 -4.932424 # 1 -856 856 1 -5.754495 -24.662121 -4.110353 # 1 -857 857 1 -4.932424 -24.662121 -4.932424 # 1 -858 858 1 -4.110353 -24.662121 -4.110353 # 1 -859 859 1 -3.288283 -24.662121 -4.932424 # 1 -860 860 1 -2.466212 -24.662121 -4.110353 # 1 -861 861 1 -1.644141 -24.662121 -4.932424 # 1 -862 862 1 -0.822071 -24.662121 -4.110353 # 1 -863 863 1 0.000000 -24.662121 -4.932424 # 1 -864 864 1 0.822071 -24.662121 -4.110353 # 1 -865 865 1 1.644141 -24.662121 -4.932424 # 1 -866 866 1 2.466212 -24.662121 -4.110353 # 1 -867 867 1 3.288283 -24.662121 -4.932424 # 1 -868 868 1 4.110353 -24.662121 -4.110353 # 1 -869 869 1 4.932424 -24.662121 -4.932424 # 1 -870 870 1 5.754495 -24.662121 -4.110353 # 1 -871 871 1 6.576566 -24.662121 -4.932424 # 1 -872 872 1 7.398636 -24.662121 -4.110353 # 1 -873 873 1 8.220707 -24.662121 -4.932424 # 1 -874 874 1 -8.220707 -24.662121 -3.288283 # 1 -875 875 1 -7.398636 -24.662121 -2.466212 # 1 -876 876 1 -6.576566 -24.662121 -3.288283 # 1 -877 877 1 -5.754495 -24.662121 -2.466212 # 1 -878 878 1 -4.932424 -24.662121 -3.288283 # 1 -879 879 1 -4.110353 -24.662121 -2.466212 # 1 -880 880 1 -3.288283 -24.662121 -3.288283 # 1 -881 881 1 -2.466212 -24.662121 -2.466212 # 1 -882 882 1 -1.644141 -24.662121 -3.288283 # 1 -883 883 1 -0.822071 -24.662121 -2.466212 # 1 -884 884 1 0.000000 -24.662121 -3.288283 # 1 -885 885 1 0.822071 -24.662121 -2.466212 # 1 -886 886 1 1.644141 -24.662121 -3.288283 # 1 -887 887 1 2.466212 -24.662121 -2.466212 # 1 -888 888 1 3.288283 -24.662121 -3.288283 # 1 -889 889 1 4.110353 -24.662121 -2.466212 # 1 -890 890 1 4.932424 -24.662121 -3.288283 # 1 -891 891 1 5.754495 -24.662121 -2.466212 # 1 -892 892 1 6.576566 -24.662121 -3.288283 # 1 -893 893 1 7.398636 -24.662121 -2.466212 # 1 -894 894 1 8.220707 -24.662121 -3.288283 # 1 -895 895 1 -8.220707 -24.662121 -1.644141 # 1 -896 896 1 -7.398636 -24.662121 -0.822071 # 1 -897 897 1 -6.576566 -24.662121 -1.644141 # 1 -898 898 1 -5.754495 -24.662121 -0.822071 # 1 -899 899 1 -4.932424 -24.662121 -1.644141 # 1 -900 900 1 -4.110353 -24.662121 -0.822071 # 1 -901 901 1 -3.288283 -24.662121 -1.644141 # 1 -902 902 1 -2.466212 -24.662121 -0.822071 # 1 -903 903 1 -1.644141 -24.662121 -1.644141 # 1 -904 904 1 -0.822071 -24.662121 -0.822071 # 1 -905 905 1 0.000000 -24.662121 -1.644141 # 1 -906 906 1 0.822071 -24.662121 -0.822071 # 1 -907 907 1 1.644141 -24.662121 -1.644141 # 1 -908 908 1 2.466212 -24.662121 -0.822071 # 1 -909 909 1 3.288283 -24.662121 -1.644141 # 1 -910 910 1 4.110353 -24.662121 -0.822071 # 1 -911 911 1 4.932424 -24.662121 -1.644141 # 1 -912 912 1 5.754495 -24.662121 -0.822071 # 1 -913 913 1 6.576566 -24.662121 -1.644141 # 1 -914 914 1 7.398636 -24.662121 -0.822071 # 1 -915 915 1 8.220707 -24.662121 -1.644141 # 1 -916 916 1 -8.220707 -24.662121 0.000000 # 1 -917 917 1 -7.398636 -24.662121 0.822071 # 1 -918 918 1 -6.576566 -24.662121 0.000000 # 1 -919 919 1 -5.754495 -24.662121 0.822071 # 1 -920 920 1 -4.932424 -24.662121 0.000000 # 1 -921 921 1 -4.110353 -24.662121 0.822071 # 1 -922 922 1 -3.288283 -24.662121 0.000000 # 1 -923 923 1 -2.466212 -24.662121 0.822071 # 1 -924 924 1 -1.644141 -24.662121 0.000000 # 1 -925 925 1 -0.822071 -24.662121 0.822071 # 1 -926 926 1 0.000000 -24.662121 0.000000 # 1 -927 927 1 0.822071 -24.662121 0.822071 # 1 -928 928 1 1.644141 -24.662121 0.000000 # 1 -929 929 1 2.466212 -24.662121 0.822071 # 1 -930 930 1 3.288283 -24.662121 0.000000 # 1 -931 931 1 4.110353 -24.662121 0.822071 # 1 -932 932 1 4.932424 -24.662121 0.000000 # 1 -933 933 1 5.754495 -24.662121 0.822071 # 1 -934 934 1 6.576566 -24.662121 0.000000 # 1 -935 935 1 7.398636 -24.662121 0.822071 # 1 -936 936 1 8.220707 -24.662121 0.000000 # 1 -937 937 1 -8.220707 -24.662121 1.644141 # 1 -938 938 1 -7.398636 -24.662121 2.466212 # 1 -939 939 1 -6.576566 -24.662121 1.644141 # 1 -940 940 1 -5.754495 -24.662121 2.466212 # 1 -941 941 1 -4.932424 -24.662121 1.644141 # 1 -942 942 1 -4.110353 -24.662121 2.466212 # 1 -943 943 1 -3.288283 -24.662121 1.644141 # 1 -944 944 1 -2.466212 -24.662121 2.466212 # 1 -945 945 1 -1.644141 -24.662121 1.644141 # 1 -946 946 1 -0.822071 -24.662121 2.466212 # 1 -947 947 1 0.000000 -24.662121 1.644141 # 1 -948 948 1 0.822071 -24.662121 2.466212 # 1 -949 949 1 1.644141 -24.662121 1.644141 # 1 -950 950 1 2.466212 -24.662121 2.466212 # 1 -951 951 1 3.288283 -24.662121 1.644141 # 1 -952 952 1 4.110353 -24.662121 2.466212 # 1 -953 953 1 4.932424 -24.662121 1.644141 # 1 -954 954 1 5.754495 -24.662121 2.466212 # 1 -955 955 1 6.576566 -24.662121 1.644141 # 1 -956 956 1 7.398636 -24.662121 2.466212 # 1 -957 957 1 8.220707 -24.662121 1.644141 # 1 -958 958 1 -8.220707 -24.662121 3.288283 # 1 -959 959 1 -7.398636 -24.662121 4.110353 # 1 -960 960 1 -6.576566 -24.662121 3.288283 # 1 -961 961 1 -5.754495 -24.662121 4.110353 # 1 -962 962 1 -4.932424 -24.662121 3.288283 # 1 -963 963 1 -4.110353 -24.662121 4.110353 # 1 -964 964 1 -3.288283 -24.662121 3.288283 # 1 -965 965 1 -2.466212 -24.662121 4.110353 # 1 -966 966 1 -1.644141 -24.662121 3.288283 # 1 -967 967 1 -0.822071 -24.662121 4.110353 # 1 -968 968 1 0.000000 -24.662121 3.288283 # 1 -969 969 1 0.822071 -24.662121 4.110353 # 1 -970 970 1 1.644141 -24.662121 3.288283 # 1 -971 971 1 2.466212 -24.662121 4.110353 # 1 -972 972 1 3.288283 -24.662121 3.288283 # 1 -973 973 1 4.110353 -24.662121 4.110353 # 1 -974 974 1 4.932424 -24.662121 3.288283 # 1 -975 975 1 5.754495 -24.662121 4.110353 # 1 -976 976 1 6.576566 -24.662121 3.288283 # 1 -977 977 1 7.398636 -24.662121 4.110353 # 1 -978 978 1 8.220707 -24.662121 3.288283 # 1 -979 979 1 -8.220707 -24.662121 4.932424 # 1 -980 980 1 -7.398636 -24.662121 5.754495 # 1 -981 981 1 -6.576566 -24.662121 4.932424 # 1 -982 982 1 -5.754495 -24.662121 5.754495 # 1 -983 983 1 -4.932424 -24.662121 4.932424 # 1 -984 984 1 -4.110353 -24.662121 5.754495 # 1 -985 985 1 -3.288283 -24.662121 4.932424 # 1 -986 986 1 -2.466212 -24.662121 5.754495 # 1 -987 987 1 -1.644141 -24.662121 4.932424 # 1 -988 988 1 -0.822071 -24.662121 5.754495 # 1 -989 989 1 0.000000 -24.662121 4.932424 # 1 -990 990 1 0.822071 -24.662121 5.754495 # 1 -991 991 1 1.644141 -24.662121 4.932424 # 1 -992 992 1 2.466212 -24.662121 5.754495 # 1 -993 993 1 3.288283 -24.662121 4.932424 # 1 -994 994 1 4.110353 -24.662121 5.754495 # 1 -995 995 1 4.932424 -24.662121 4.932424 # 1 -996 996 1 5.754495 -24.662121 5.754495 # 1 -997 997 1 6.576566 -24.662121 4.932424 # 1 -998 998 1 7.398636 -24.662121 5.754495 # 1 -999 999 1 8.220707 -24.662121 4.932424 # 1 -1000 1000 1 -8.220707 -24.662121 6.576566 # 1 -1001 1001 1 -7.398636 -24.662121 7.398636 # 1 -1002 1002 1 -6.576566 -24.662121 6.576566 # 1 -1003 1003 1 -5.754495 -24.662121 7.398636 # 1 -1004 1004 1 -4.932424 -24.662121 6.576566 # 1 -1005 1005 1 -4.110353 -24.662121 7.398636 # 1 -1006 1006 1 -3.288283 -24.662121 6.576566 # 1 -1007 1007 1 -2.466212 -24.662121 7.398636 # 1 -1008 1008 1 -1.644141 -24.662121 6.576566 # 1 -1009 1009 1 -0.822071 -24.662121 7.398636 # 1 -1010 1010 1 0.000000 -24.662121 6.576566 # 1 -1011 1011 1 0.822071 -24.662121 7.398636 # 1 -1012 1012 1 1.644141 -24.662121 6.576566 # 1 -1013 1013 1 2.466212 -24.662121 7.398636 # 1 -1014 1014 1 3.288283 -24.662121 6.576566 # 1 -1015 1015 1 4.110353 -24.662121 7.398636 # 1 -1016 1016 1 4.932424 -24.662121 6.576566 # 1 -1017 1017 1 5.754495 -24.662121 7.398636 # 1 -1018 1018 1 6.576566 -24.662121 6.576566 # 1 -1019 1019 1 7.398636 -24.662121 7.398636 # 1 -1020 1020 1 8.220707 -24.662121 6.576566 # 1 -1021 1021 1 -8.220707 -24.662121 8.220707 # 1 -1022 1022 1 -7.398636 -24.662121 9.042778 # 1 -1023 1023 1 -6.576566 -24.662121 8.220707 # 1 -1024 1024 1 -5.754495 -24.662121 9.042778 # 1 -1025 1025 1 -4.932424 -24.662121 8.220707 # 1 -1026 1026 1 -4.110353 -24.662121 9.042778 # 1 -1027 1027 1 -3.288283 -24.662121 8.220707 # 1 -1028 1028 1 -2.466212 -24.662121 9.042778 # 1 -1029 1029 1 -1.644141 -24.662121 8.220707 # 1 -1030 1030 1 -0.822071 -24.662121 9.042778 # 1 -1031 1031 1 0.000000 -24.662121 8.220707 # 1 -1032 1032 1 0.822071 -24.662121 9.042778 # 1 -1033 1033 1 1.644141 -24.662121 8.220707 # 1 -1034 1034 1 2.466212 -24.662121 9.042778 # 1 -1035 1035 1 3.288283 -24.662121 8.220707 # 1 -1036 1036 1 4.110353 -24.662121 9.042778 # 1 -1037 1037 1 4.932424 -24.662121 8.220707 # 1 -1038 1038 1 5.754495 -24.662121 9.042778 # 1 -1039 1039 1 6.576566 -24.662121 8.220707 # 1 -1040 1040 1 7.398636 -24.662121 9.042778 # 1 -1041 1041 1 8.220707 -24.662121 8.220707 # 1 -1042 1042 1 -8.220707 -24.662121 9.864848 # 1 -1043 1043 1 -7.398636 -24.662121 10.686919 # 1 -1044 1044 1 -6.576566 -24.662121 9.864848 # 1 -1045 1045 1 -5.754495 -24.662121 10.686919 # 1 -1046 1046 1 -4.932424 -24.662121 9.864848 # 1 -1047 1047 1 -4.110353 -24.662121 10.686919 # 1 -1048 1048 1 -3.288283 -24.662121 9.864848 # 1 -1049 1049 1 -2.466212 -24.662121 10.686919 # 1 -1050 1050 1 -1.644141 -24.662121 9.864848 # 1 -1051 1051 1 -0.822071 -24.662121 10.686919 # 1 -1052 1052 1 0.000000 -24.662121 9.864848 # 1 -1053 1053 1 0.822071 -24.662121 10.686919 # 1 -1054 1054 1 1.644141 -24.662121 9.864848 # 1 -1055 1055 1 2.466212 -24.662121 10.686919 # 1 -1056 1056 1 3.288283 -24.662121 9.864848 # 1 -1057 1057 1 4.110353 -24.662121 10.686919 # 1 -1058 1058 1 4.932424 -24.662121 9.864848 # 1 -1059 1059 1 5.754495 -24.662121 10.686919 # 1 -1060 1060 1 6.576566 -24.662121 9.864848 # 1 -1061 1061 1 7.398636 -24.662121 10.686919 # 1 -1062 1062 1 8.220707 -24.662121 9.864848 # 1 -1063 1063 1 -8.220707 -24.662121 11.508989 # 1 -1064 1064 1 -7.398636 -24.662121 12.331060 # 1 -1065 1065 1 -6.576566 -24.662121 11.508989 # 1 -1066 1066 1 -5.754495 -24.662121 12.331060 # 1 -1067 1067 1 -4.932424 -24.662121 11.508989 # 1 -1068 1068 1 -4.110353 -24.662121 12.331060 # 1 -1069 1069 1 -3.288283 -24.662121 11.508989 # 1 -1070 1070 1 -2.466212 -24.662121 12.331060 # 1 -1071 1071 1 -1.644141 -24.662121 11.508989 # 1 -1072 1072 1 -0.822071 -24.662121 12.331060 # 1 -1073 1073 1 0.000000 -24.662121 11.508989 # 1 -1074 1074 1 0.822071 -24.662121 12.331060 # 1 -1075 1075 1 1.644141 -24.662121 11.508989 # 1 -1076 1076 1 2.466212 -24.662121 12.331060 # 1 -1077 1077 1 3.288283 -24.662121 11.508989 # 1 -1078 1078 1 4.110353 -24.662121 12.331060 # 1 -1079 1079 1 4.932424 -24.662121 11.508989 # 1 -1080 1080 1 5.754495 -24.662121 12.331060 # 1 -1081 1081 1 6.576566 -24.662121 11.508989 # 1 -1082 1082 1 7.398636 -24.662121 12.331060 # 1 -1083 1083 1 8.220707 -24.662121 11.508989 # 1 -1084 1084 1 -8.220707 -24.662121 13.153131 # 1 -1085 1085 1 -7.398636 -24.662121 13.975202 # 1 -1086 1086 1 -6.576566 -24.662121 13.153131 # 1 -1087 1087 1 -5.754495 -24.662121 13.975202 # 1 -1088 1088 1 -4.932424 -24.662121 13.153131 # 1 -1089 1089 1 -4.110353 -24.662121 13.975202 # 1 -1090 1090 1 -3.288283 -24.662121 13.153131 # 1 -1091 1091 1 -2.466212 -24.662121 13.975202 # 1 -1092 1092 1 -1.644141 -24.662121 13.153131 # 1 -1093 1093 1 -0.822071 -24.662121 13.975202 # 1 -1094 1094 1 0.000000 -24.662121 13.153131 # 1 -1095 1095 1 0.822071 -24.662121 13.975202 # 1 -1096 1096 1 1.644141 -24.662121 13.153131 # 1 -1097 1097 1 2.466212 -24.662121 13.975202 # 1 -1098 1098 1 3.288283 -24.662121 13.153131 # 1 -1099 1099 1 4.110353 -24.662121 13.975202 # 1 -1100 1100 1 4.932424 -24.662121 13.153131 # 1 -1101 1101 1 5.754495 -24.662121 13.975202 # 1 -1102 1102 1 6.576566 -24.662121 13.153131 # 1 -1103 1103 1 7.398636 -24.662121 13.975202 # 1 -1104 1104 1 8.220707 -24.662121 13.153131 # 1 -1105 1105 1 -8.220707 -24.662121 14.797273 # 1 -1106 1106 1 -7.398636 -24.662121 15.619343 # 1 -1107 1107 1 -6.576566 -24.662121 14.797273 # 1 -1108 1108 1 -5.754495 -24.662121 15.619343 # 1 -1109 1109 1 -4.932424 -24.662121 14.797273 # 1 -1110 1110 1 -4.110353 -24.662121 15.619343 # 1 -1111 1111 1 -3.288283 -24.662121 14.797273 # 1 -1112 1112 1 -2.466212 -24.662121 15.619343 # 1 -1113 1113 1 -1.644141 -24.662121 14.797273 # 1 -1114 1114 1 -0.822071 -24.662121 15.619343 # 1 -1115 1115 1 0.000000 -24.662121 14.797273 # 1 -1116 1116 1 0.822071 -24.662121 15.619343 # 1 -1117 1117 1 1.644141 -24.662121 14.797273 # 1 -1118 1118 1 2.466212 -24.662121 15.619343 # 1 -1119 1119 1 3.288283 -24.662121 14.797273 # 1 -1120 1120 1 4.110353 -24.662121 15.619343 # 1 -1121 1121 1 4.932424 -24.662121 14.797273 # 1 -1122 1122 1 5.754495 -24.662121 15.619343 # 1 -1123 1123 1 6.576566 -24.662121 14.797273 # 1 -1124 1124 1 7.398636 -24.662121 15.619343 # 1 -1125 1125 1 8.220707 -24.662121 14.797273 # 1 -1126 1126 1 -8.220707 -24.662121 16.441414 # 1 -1127 1127 1 -7.398636 -24.662121 17.263485 # 1 -1128 1128 1 -6.576566 -24.662121 16.441414 # 1 -1129 1129 1 -5.754495 -24.662121 17.263485 # 1 -1130 1130 1 -4.932424 -24.662121 16.441414 # 1 -1131 1131 1 -4.110353 -24.662121 17.263485 # 1 -1132 1132 1 -3.288283 -24.662121 16.441414 # 1 -1133 1133 1 -2.466212 -24.662121 17.263485 # 1 -1134 1134 1 -1.644141 -24.662121 16.441414 # 1 -1135 1135 1 -0.822071 -24.662121 17.263485 # 1 -1136 1136 1 0.000000 -24.662121 16.441414 # 1 -1137 1137 1 0.822071 -24.662121 17.263485 # 1 -1138 1138 1 1.644141 -24.662121 16.441414 # 1 -1139 1139 1 2.466212 -24.662121 17.263485 # 1 -1140 1140 1 3.288283 -24.662121 16.441414 # 1 -1141 1141 1 4.110353 -24.662121 17.263485 # 1 -1142 1142 1 4.932424 -24.662121 16.441414 # 1 -1143 1143 1 5.754495 -24.662121 17.263485 # 1 -1144 1144 1 6.576566 -24.662121 16.441414 # 1 -1145 1145 1 7.398636 -24.662121 17.263485 # 1 -1146 1146 1 8.220707 -24.662121 16.441414 # 1 -1147 1147 1 -8.220707 -24.662121 18.085556 # 1 -1148 1148 1 -7.398636 -24.662121 18.907625 # 1 -1149 1149 1 -6.576566 -24.662121 18.085556 # 1 -1150 1150 1 -5.754495 -24.662121 18.907625 # 1 -1151 1151 1 -4.932424 -24.662121 18.085556 # 1 -1152 1152 1 -4.110353 -24.662121 18.907625 # 1 -1153 1153 1 -3.288283 -24.662121 18.085556 # 1 -1154 1154 1 -2.466212 -24.662121 18.907625 # 1 -1155 1155 1 -1.644141 -24.662121 18.085556 # 1 -1156 1156 1 -0.822071 -24.662121 18.907625 # 1 -1157 1157 1 0.000000 -24.662121 18.085556 # 1 -1158 1158 1 0.822071 -24.662121 18.907625 # 1 -1159 1159 1 1.644141 -24.662121 18.085556 # 1 -1160 1160 1 2.466212 -24.662121 18.907625 # 1 -1161 1161 1 3.288283 -24.662121 18.085556 # 1 -1162 1162 1 4.110353 -24.662121 18.907625 # 1 -1163 1163 1 4.932424 -24.662121 18.085556 # 1 -1164 1164 1 5.754495 -24.662121 18.907625 # 1 -1165 1165 1 6.576566 -24.662121 18.085556 # 1 -1166 1166 1 7.398636 -24.662121 18.907625 # 1 -1167 1167 1 8.220707 -24.662121 18.085556 # 1 -1168 1168 1 -8.220707 -24.662121 19.729696 # 1 -1169 1169 1 -7.398636 -24.662121 20.551767 # 1 -1170 1170 1 -6.576566 -24.662121 19.729696 # 1 -1171 1171 1 -5.754495 -24.662121 20.551767 # 1 -1172 1172 1 -4.932424 -24.662121 19.729696 # 1 -1173 1173 1 -4.110353 -24.662121 20.551767 # 1 -1174 1174 1 -3.288283 -24.662121 19.729696 # 1 -1175 1175 1 -2.466212 -24.662121 20.551767 # 1 -1176 1176 1 -1.644141 -24.662121 19.729696 # 1 -1177 1177 1 -0.822071 -24.662121 20.551767 # 1 -1178 1178 1 0.000000 -24.662121 19.729696 # 1 -1179 1179 1 0.822071 -24.662121 20.551767 # 1 -1180 1180 1 1.644141 -24.662121 19.729696 # 1 -1181 1181 1 2.466212 -24.662121 20.551767 # 1 -1182 1182 1 3.288283 -24.662121 19.729696 # 1 -1183 1183 1 4.110353 -24.662121 20.551767 # 1 -1184 1184 1 4.932424 -24.662121 19.729696 # 1 -1185 1185 1 5.754495 -24.662121 20.551767 # 1 -1186 1186 1 6.576566 -24.662121 19.729696 # 1 -1187 1187 1 7.398636 -24.662121 20.551767 # 1 -1188 1188 1 8.220707 -24.662121 19.729696 # 1 -1189 1189 1 -8.220707 -24.662121 21.373838 # 1 -1190 1190 1 -7.398636 -24.662121 22.195910 # 1 -1191 1191 1 -6.576566 -24.662121 21.373838 # 1 -1192 1192 1 -5.754495 -24.662121 22.195910 # 1 -1193 1193 1 -4.932424 -24.662121 21.373838 # 1 -1194 1194 1 -4.110353 -24.662121 22.195910 # 1 -1195 1195 1 -3.288283 -24.662121 21.373838 # 1 -1196 1196 1 -2.466212 -24.662121 22.195910 # 1 -1197 1197 1 -1.644141 -24.662121 21.373838 # 1 -1198 1198 1 -0.822071 -24.662121 22.195910 # 1 -1199 1199 1 0.000000 -24.662121 21.373838 # 1 -1200 1200 1 0.822071 -24.662121 22.195910 # 1 -1201 1201 1 1.644141 -24.662121 21.373838 # 1 -1202 1202 1 2.466212 -24.662121 22.195910 # 1 -1203 1203 1 3.288283 -24.662121 21.373838 # 1 -1204 1204 1 4.110353 -24.662121 22.195910 # 1 -1205 1205 1 4.932424 -24.662121 21.373838 # 1 -1206 1206 1 5.754495 -24.662121 22.195910 # 1 -1207 1207 1 6.576566 -24.662121 21.373838 # 1 -1208 1208 1 7.398636 -24.662121 22.195910 # 1 -1209 1209 1 8.220707 -24.662121 21.373838 # 1 -1210 1210 1 -8.220707 -24.662121 23.017979 # 1 -1211 1211 1 -7.398636 -24.662121 23.840050 # 1 -1212 1212 1 -6.576566 -24.662121 23.017979 # 1 -1213 1213 1 -5.754495 -24.662121 23.840050 # 1 -1214 1214 1 -4.932424 -24.662121 23.017979 # 1 -1215 1215 1 -4.110353 -24.662121 23.840050 # 1 -1216 1216 1 -3.288283 -24.662121 23.017979 # 1 -1217 1217 1 -2.466212 -24.662121 23.840050 # 1 -1218 1218 1 -1.644141 -24.662121 23.017979 # 1 -1219 1219 1 -0.822071 -24.662121 23.840050 # 1 -1220 1220 1 0.000000 -24.662121 23.017979 # 1 -1221 1221 1 0.822071 -24.662121 23.840050 # 1 -1222 1222 1 1.644141 -24.662121 23.017979 # 1 -1223 1223 1 2.466212 -24.662121 23.840050 # 1 -1224 1224 1 3.288283 -24.662121 23.017979 # 1 -1225 1225 1 4.110353 -24.662121 23.840050 # 1 -1226 1226 1 4.932424 -24.662121 23.017979 # 1 -1227 1227 1 5.754495 -24.662121 23.840050 # 1 -1228 1228 1 6.576566 -24.662121 23.017979 # 1 -1229 1229 1 7.398636 -24.662121 23.840050 # 1 -1230 1230 1 8.220707 -24.662121 23.017979 # 1 -1231 1231 1 9.042778 -24.662121 -23.840050 # 1 -1232 1232 1 9.864848 -24.662121 -24.662121 # 1 -1233 1233 1 10.686919 -24.662121 -23.840050 # 1 -1234 1234 1 11.508989 -24.662121 -24.662121 # 1 -1235 1235 1 12.331060 -24.662121 -23.840050 # 1 -1236 1236 1 13.153131 -24.662121 -24.662121 # 1 -1237 1237 1 13.975202 -24.662121 -23.840050 # 1 -1238 1238 1 14.797273 -24.662121 -24.662121 # 1 -1239 1239 1 15.619343 -24.662121 -23.840050 # 1 -1240 1240 1 16.441414 -24.662121 -24.662121 # 1 -1241 1241 1 17.263485 -24.662121 -23.840050 # 1 -1242 1242 1 18.085556 -24.662121 -24.662121 # 1 -1243 1243 1 18.907625 -24.662121 -23.840050 # 1 -1244 1244 1 19.729696 -24.662121 -24.662121 # 1 -1245 1245 1 20.551767 -24.662121 -23.840050 # 1 -1246 1246 1 21.373838 -24.662121 -24.662121 # 1 -1247 1247 1 22.195910 -24.662121 -23.840050 # 1 -1248 1248 1 23.017979 -24.662121 -24.662121 # 1 -1249 1249 1 23.840050 -24.662121 -23.840050 # 1 -1250 1250 1 9.042778 -24.662121 -22.195910 # 1 -1251 1251 1 9.864848 -24.662121 -23.017979 # 1 -1252 1252 1 10.686919 -24.662121 -22.195910 # 1 -1253 1253 1 11.508989 -24.662121 -23.017979 # 1 -1254 1254 1 12.331060 -24.662121 -22.195910 # 1 -1255 1255 1 13.153131 -24.662121 -23.017979 # 1 -1256 1256 1 13.975202 -24.662121 -22.195910 # 1 -1257 1257 1 14.797273 -24.662121 -23.017979 # 1 -1258 1258 1 15.619343 -24.662121 -22.195910 # 1 -1259 1259 1 16.441414 -24.662121 -23.017979 # 1 -1260 1260 1 17.263485 -24.662121 -22.195910 # 1 -1261 1261 1 18.085556 -24.662121 -23.017979 # 1 -1262 1262 1 18.907625 -24.662121 -22.195910 # 1 -1263 1263 1 19.729696 -24.662121 -23.017979 # 1 -1264 1264 1 20.551767 -24.662121 -22.195910 # 1 -1265 1265 1 21.373838 -24.662121 -23.017979 # 1 -1266 1266 1 22.195910 -24.662121 -22.195910 # 1 -1267 1267 1 23.017979 -24.662121 -23.017979 # 1 -1268 1268 1 23.840050 -24.662121 -22.195910 # 1 -1269 1269 1 9.042778 -24.662121 -20.551767 # 1 -1270 1270 1 9.864848 -24.662121 -21.373838 # 1 -1271 1271 1 10.686919 -24.662121 -20.551767 # 1 -1272 1272 1 11.508989 -24.662121 -21.373838 # 1 -1273 1273 1 12.331060 -24.662121 -20.551767 # 1 -1274 1274 1 13.153131 -24.662121 -21.373838 # 1 -1275 1275 1 13.975202 -24.662121 -20.551767 # 1 -1276 1276 1 14.797273 -24.662121 -21.373838 # 1 -1277 1277 1 15.619343 -24.662121 -20.551767 # 1 -1278 1278 1 16.441414 -24.662121 -21.373838 # 1 -1279 1279 1 17.263485 -24.662121 -20.551767 # 1 -1280 1280 1 18.085556 -24.662121 -21.373838 # 1 -1281 1281 1 18.907625 -24.662121 -20.551767 # 1 -1282 1282 1 19.729696 -24.662121 -21.373838 # 1 -1283 1283 1 20.551767 -24.662121 -20.551767 # 1 -1284 1284 1 21.373838 -24.662121 -21.373838 # 1 -1285 1285 1 22.195910 -24.662121 -20.551767 # 1 -1286 1286 1 23.017979 -24.662121 -21.373838 # 1 -1287 1287 1 23.840050 -24.662121 -20.551767 # 1 -1288 1288 1 9.042778 -24.662121 -18.907625 # 1 -1289 1289 1 9.864848 -24.662121 -19.729696 # 1 -1290 1290 1 10.686919 -24.662121 -18.907625 # 1 -1291 1291 1 11.508989 -24.662121 -19.729696 # 1 -1292 1292 1 12.331060 -24.662121 -18.907625 # 1 -1293 1293 1 13.153131 -24.662121 -19.729696 # 1 -1294 1294 1 13.975202 -24.662121 -18.907625 # 1 -1295 1295 1 14.797273 -24.662121 -19.729696 # 1 -1296 1296 1 15.619343 -24.662121 -18.907625 # 1 -1297 1297 1 16.441414 -24.662121 -19.729696 # 1 -1298 1298 1 17.263485 -24.662121 -18.907625 # 1 -1299 1299 1 18.085556 -24.662121 -19.729696 # 1 -1300 1300 1 18.907625 -24.662121 -18.907625 # 1 -1301 1301 1 19.729696 -24.662121 -19.729696 # 1 -1302 1302 1 20.551767 -24.662121 -18.907625 # 1 -1303 1303 1 21.373838 -24.662121 -19.729696 # 1 -1304 1304 1 22.195910 -24.662121 -18.907625 # 1 -1305 1305 1 23.017979 -24.662121 -19.729696 # 1 -1306 1306 1 23.840050 -24.662121 -18.907625 # 1 -1307 1307 1 9.042778 -24.662121 -17.263485 # 1 -1308 1308 1 9.864848 -24.662121 -18.085556 # 1 -1309 1309 1 10.686919 -24.662121 -17.263485 # 1 -1310 1310 1 11.508989 -24.662121 -18.085556 # 1 -1311 1311 1 12.331060 -24.662121 -17.263485 # 1 -1312 1312 1 13.153131 -24.662121 -18.085556 # 1 -1313 1313 1 13.975202 -24.662121 -17.263485 # 1 -1314 1314 1 14.797273 -24.662121 -18.085556 # 1 -1315 1315 1 15.619343 -24.662121 -17.263485 # 1 -1316 1316 1 16.441414 -24.662121 -18.085556 # 1 -1317 1317 1 17.263485 -24.662121 -17.263485 # 1 -1318 1318 1 18.085556 -24.662121 -18.085556 # 1 -1319 1319 1 18.907625 -24.662121 -17.263485 # 1 -1320 1320 1 19.729696 -24.662121 -18.085556 # 1 -1321 1321 1 20.551767 -24.662121 -17.263485 # 1 -1322 1322 1 21.373838 -24.662121 -18.085556 # 1 -1323 1323 1 22.195910 -24.662121 -17.263485 # 1 -1324 1324 1 23.017979 -24.662121 -18.085556 # 1 -1325 1325 1 23.840050 -24.662121 -17.263485 # 1 -1326 1326 1 9.042778 -24.662121 -15.619343 # 1 -1327 1327 1 9.864848 -24.662121 -16.441414 # 1 -1328 1328 1 10.686919 -24.662121 -15.619343 # 1 -1329 1329 1 11.508989 -24.662121 -16.441414 # 1 -1330 1330 1 12.331060 -24.662121 -15.619343 # 1 -1331 1331 1 13.153131 -24.662121 -16.441414 # 1 -1332 1332 1 13.975202 -24.662121 -15.619343 # 1 -1333 1333 1 14.797273 -24.662121 -16.441414 # 1 -1334 1334 1 15.619343 -24.662121 -15.619343 # 1 -1335 1335 1 16.441414 -24.662121 -16.441414 # 1 -1336 1336 1 17.263485 -24.662121 -15.619343 # 1 -1337 1337 1 18.085556 -24.662121 -16.441414 # 1 -1338 1338 1 18.907625 -24.662121 -15.619343 # 1 -1339 1339 1 19.729696 -24.662121 -16.441414 # 1 -1340 1340 1 20.551767 -24.662121 -15.619343 # 1 -1341 1341 1 21.373838 -24.662121 -16.441414 # 1 -1342 1342 1 22.195910 -24.662121 -15.619343 # 1 -1343 1343 1 23.017979 -24.662121 -16.441414 # 1 -1344 1344 1 23.840050 -24.662121 -15.619343 # 1 -1345 1345 1 9.042778 -24.662121 -13.975202 # 1 -1346 1346 1 9.864848 -24.662121 -14.797273 # 1 -1347 1347 1 10.686919 -24.662121 -13.975202 # 1 -1348 1348 1 11.508989 -24.662121 -14.797273 # 1 -1349 1349 1 12.331060 -24.662121 -13.975202 # 1 -1350 1350 1 13.153131 -24.662121 -14.797273 # 1 -1351 1351 1 13.975202 -24.662121 -13.975202 # 1 -1352 1352 1 14.797273 -24.662121 -14.797273 # 1 -1353 1353 1 15.619343 -24.662121 -13.975202 # 1 -1354 1354 1 16.441414 -24.662121 -14.797273 # 1 -1355 1355 1 17.263485 -24.662121 -13.975202 # 1 -1356 1356 1 18.085556 -24.662121 -14.797273 # 1 -1357 1357 1 18.907625 -24.662121 -13.975202 # 1 -1358 1358 1 19.729696 -24.662121 -14.797273 # 1 -1359 1359 1 20.551767 -24.662121 -13.975202 # 1 -1360 1360 1 21.373838 -24.662121 -14.797273 # 1 -1361 1361 1 22.195910 -24.662121 -13.975202 # 1 -1362 1362 1 23.017979 -24.662121 -14.797273 # 1 -1363 1363 1 23.840050 -24.662121 -13.975202 # 1 -1364 1364 1 9.042778 -24.662121 -12.331060 # 1 -1365 1365 1 9.864848 -24.662121 -13.153131 # 1 -1366 1366 1 10.686919 -24.662121 -12.331060 # 1 -1367 1367 1 11.508989 -24.662121 -13.153131 # 1 -1368 1368 1 12.331060 -24.662121 -12.331060 # 1 -1369 1369 1 13.153131 -24.662121 -13.153131 # 1 -1370 1370 1 13.975202 -24.662121 -12.331060 # 1 -1371 1371 1 14.797273 -24.662121 -13.153131 # 1 -1372 1372 1 15.619343 -24.662121 -12.331060 # 1 -1373 1373 1 16.441414 -24.662121 -13.153131 # 1 -1374 1374 1 17.263485 -24.662121 -12.331060 # 1 -1375 1375 1 18.085556 -24.662121 -13.153131 # 1 -1376 1376 1 18.907625 -24.662121 -12.331060 # 1 -1377 1377 1 19.729696 -24.662121 -13.153131 # 1 -1378 1378 1 20.551767 -24.662121 -12.331060 # 1 -1379 1379 1 21.373838 -24.662121 -13.153131 # 1 -1380 1380 1 22.195910 -24.662121 -12.331060 # 1 -1381 1381 1 23.017979 -24.662121 -13.153131 # 1 -1382 1382 1 23.840050 -24.662121 -12.331060 # 1 -1383 1383 1 9.042778 -24.662121 -10.686919 # 1 -1384 1384 1 9.864848 -24.662121 -11.508989 # 1 -1385 1385 1 10.686919 -24.662121 -10.686919 # 1 -1386 1386 1 11.508989 -24.662121 -11.508989 # 1 -1387 1387 1 12.331060 -24.662121 -10.686919 # 1 -1388 1388 1 13.153131 -24.662121 -11.508989 # 1 -1389 1389 1 13.975202 -24.662121 -10.686919 # 1 -1390 1390 1 14.797273 -24.662121 -11.508989 # 1 -1391 1391 1 15.619343 -24.662121 -10.686919 # 1 -1392 1392 1 16.441414 -24.662121 -11.508989 # 1 -1393 1393 1 17.263485 -24.662121 -10.686919 # 1 -1394 1394 1 18.085556 -24.662121 -11.508989 # 1 -1395 1395 1 18.907625 -24.662121 -10.686919 # 1 -1396 1396 1 19.729696 -24.662121 -11.508989 # 1 -1397 1397 1 20.551767 -24.662121 -10.686919 # 1 -1398 1398 1 21.373838 -24.662121 -11.508989 # 1 -1399 1399 1 22.195910 -24.662121 -10.686919 # 1 -1400 1400 1 23.017979 -24.662121 -11.508989 # 1 -1401 1401 1 23.840050 -24.662121 -10.686919 # 1 -1402 1402 1 9.042778 -24.662121 -9.042778 # 1 -1403 1403 1 9.864848 -24.662121 -9.864848 # 1 -1404 1404 1 10.686919 -24.662121 -9.042778 # 1 -1405 1405 1 11.508989 -24.662121 -9.864848 # 1 -1406 1406 1 12.331060 -24.662121 -9.042778 # 1 -1407 1407 1 13.153131 -24.662121 -9.864848 # 1 -1408 1408 1 13.975202 -24.662121 -9.042778 # 1 -1409 1409 1 14.797273 -24.662121 -9.864848 # 1 -1410 1410 1 15.619343 -24.662121 -9.042778 # 1 -1411 1411 1 16.441414 -24.662121 -9.864848 # 1 -1412 1412 1 17.263485 -24.662121 -9.042778 # 1 -1413 1413 1 18.085556 -24.662121 -9.864848 # 1 -1414 1414 1 18.907625 -24.662121 -9.042778 # 1 -1415 1415 1 19.729696 -24.662121 -9.864848 # 1 -1416 1416 1 20.551767 -24.662121 -9.042778 # 1 -1417 1417 1 21.373838 -24.662121 -9.864848 # 1 -1418 1418 1 22.195910 -24.662121 -9.042778 # 1 -1419 1419 1 23.017979 -24.662121 -9.864848 # 1 -1420 1420 1 23.840050 -24.662121 -9.042778 # 1 -1421 1421 1 9.042778 -24.662121 -7.398636 # 1 -1422 1422 1 9.864848 -24.662121 -8.220707 # 1 -1423 1423 1 10.686919 -24.662121 -7.398636 # 1 -1424 1424 1 11.508989 -24.662121 -8.220707 # 1 -1425 1425 1 12.331060 -24.662121 -7.398636 # 1 -1426 1426 1 13.153131 -24.662121 -8.220707 # 1 -1427 1427 1 13.975202 -24.662121 -7.398636 # 1 -1428 1428 1 14.797273 -24.662121 -8.220707 # 1 -1429 1429 1 15.619343 -24.662121 -7.398636 # 1 -1430 1430 1 16.441414 -24.662121 -8.220707 # 1 -1431 1431 1 17.263485 -24.662121 -7.398636 # 1 -1432 1432 1 18.085556 -24.662121 -8.220707 # 1 -1433 1433 1 18.907625 -24.662121 -7.398636 # 1 -1434 1434 1 19.729696 -24.662121 -8.220707 # 1 -1435 1435 1 20.551767 -24.662121 -7.398636 # 1 -1436 1436 1 21.373838 -24.662121 -8.220707 # 1 -1437 1437 1 22.195910 -24.662121 -7.398636 # 1 -1438 1438 1 23.017979 -24.662121 -8.220707 # 1 -1439 1439 1 23.840050 -24.662121 -7.398636 # 1 -1440 1440 1 9.042778 -24.662121 -5.754495 # 1 -1441 1441 1 9.864848 -24.662121 -6.576566 # 1 -1442 1442 1 10.686919 -24.662121 -5.754495 # 1 -1443 1443 1 11.508989 -24.662121 -6.576566 # 1 -1444 1444 1 12.331060 -24.662121 -5.754495 # 1 -1445 1445 1 13.153131 -24.662121 -6.576566 # 1 -1446 1446 1 13.975202 -24.662121 -5.754495 # 1 -1447 1447 1 14.797273 -24.662121 -6.576566 # 1 -1448 1448 1 15.619343 -24.662121 -5.754495 # 1 -1449 1449 1 16.441414 -24.662121 -6.576566 # 1 -1450 1450 1 17.263485 -24.662121 -5.754495 # 1 -1451 1451 1 18.085556 -24.662121 -6.576566 # 1 -1452 1452 1 18.907625 -24.662121 -5.754495 # 1 -1453 1453 1 19.729696 -24.662121 -6.576566 # 1 -1454 1454 1 20.551767 -24.662121 -5.754495 # 1 -1455 1455 1 21.373838 -24.662121 -6.576566 # 1 -1456 1456 1 22.195910 -24.662121 -5.754495 # 1 -1457 1457 1 23.017979 -24.662121 -6.576566 # 1 -1458 1458 1 23.840050 -24.662121 -5.754495 # 1 -1459 1459 1 9.042778 -24.662121 -4.110353 # 1 -1460 1460 1 9.864848 -24.662121 -4.932424 # 1 -1461 1461 1 10.686919 -24.662121 -4.110353 # 1 -1462 1462 1 11.508989 -24.662121 -4.932424 # 1 -1463 1463 1 12.331060 -24.662121 -4.110353 # 1 -1464 1464 1 13.153131 -24.662121 -4.932424 # 1 -1465 1465 1 13.975202 -24.662121 -4.110353 # 1 -1466 1466 1 14.797273 -24.662121 -4.932424 # 1 -1467 1467 1 15.619343 -24.662121 -4.110353 # 1 -1468 1468 1 16.441414 -24.662121 -4.932424 # 1 -1469 1469 1 17.263485 -24.662121 -4.110353 # 1 -1470 1470 1 18.085556 -24.662121 -4.932424 # 1 -1471 1471 1 18.907625 -24.662121 -4.110353 # 1 -1472 1472 1 19.729696 -24.662121 -4.932424 # 1 -1473 1473 1 20.551767 -24.662121 -4.110353 # 1 -1474 1474 1 21.373838 -24.662121 -4.932424 # 1 -1475 1475 1 22.195910 -24.662121 -4.110353 # 1 -1476 1476 1 23.017979 -24.662121 -4.932424 # 1 -1477 1477 1 23.840050 -24.662121 -4.110353 # 1 -1478 1478 1 9.042778 -24.662121 -2.466212 # 1 -1479 1479 1 9.864848 -24.662121 -3.288283 # 1 -1480 1480 1 10.686919 -24.662121 -2.466212 # 1 -1481 1481 1 11.508989 -24.662121 -3.288283 # 1 -1482 1482 1 12.331060 -24.662121 -2.466212 # 1 -1483 1483 1 13.153131 -24.662121 -3.288283 # 1 -1484 1484 1 13.975202 -24.662121 -2.466212 # 1 -1485 1485 1 14.797273 -24.662121 -3.288283 # 1 -1486 1486 1 15.619343 -24.662121 -2.466212 # 1 -1487 1487 1 16.441414 -24.662121 -3.288283 # 1 -1488 1488 1 17.263485 -24.662121 -2.466212 # 1 -1489 1489 1 18.085556 -24.662121 -3.288283 # 1 -1490 1490 1 18.907625 -24.662121 -2.466212 # 1 -1491 1491 1 19.729696 -24.662121 -3.288283 # 1 -1492 1492 1 20.551767 -24.662121 -2.466212 # 1 -1493 1493 1 21.373838 -24.662121 -3.288283 # 1 -1494 1494 1 22.195910 -24.662121 -2.466212 # 1 -1495 1495 1 23.017979 -24.662121 -3.288283 # 1 -1496 1496 1 23.840050 -24.662121 -2.466212 # 1 -1497 1497 1 9.042778 -24.662121 -0.822071 # 1 -1498 1498 1 9.864848 -24.662121 -1.644141 # 1 -1499 1499 1 10.686919 -24.662121 -0.822071 # 1 -1500 1500 1 11.508989 -24.662121 -1.644141 # 1 -1501 1501 1 12.331060 -24.662121 -0.822071 # 1 -1502 1502 1 13.153131 -24.662121 -1.644141 # 1 -1503 1503 1 13.975202 -24.662121 -0.822071 # 1 -1504 1504 1 14.797273 -24.662121 -1.644141 # 1 -1505 1505 1 15.619343 -24.662121 -0.822071 # 1 -1506 1506 1 16.441414 -24.662121 -1.644141 # 1 -1507 1507 1 17.263485 -24.662121 -0.822071 # 1 -1508 1508 1 18.085556 -24.662121 -1.644141 # 1 -1509 1509 1 18.907625 -24.662121 -0.822071 # 1 -1510 1510 1 19.729696 -24.662121 -1.644141 # 1 -1511 1511 1 20.551767 -24.662121 -0.822071 # 1 -1512 1512 1 21.373838 -24.662121 -1.644141 # 1 -1513 1513 1 22.195910 -24.662121 -0.822071 # 1 -1514 1514 1 23.017979 -24.662121 -1.644141 # 1 -1515 1515 1 23.840050 -24.662121 -0.822071 # 1 -1516 1516 1 9.042778 -24.662121 0.822071 # 1 -1517 1517 1 9.864848 -24.662121 0.000000 # 1 -1518 1518 1 10.686919 -24.662121 0.822071 # 1 -1519 1519 1 11.508989 -24.662121 0.000000 # 1 -1520 1520 1 12.331060 -24.662121 0.822071 # 1 -1521 1521 1 13.153131 -24.662121 0.000000 # 1 -1522 1522 1 13.975202 -24.662121 0.822071 # 1 -1523 1523 1 14.797273 -24.662121 0.000000 # 1 -1524 1524 1 15.619343 -24.662121 0.822071 # 1 -1525 1525 1 16.441414 -24.662121 0.000000 # 1 -1526 1526 1 17.263485 -24.662121 0.822071 # 1 -1527 1527 1 18.085556 -24.662121 0.000000 # 1 -1528 1528 1 18.907625 -24.662121 0.822071 # 1 -1529 1529 1 19.729696 -24.662121 0.000000 # 1 -1530 1530 1 20.551767 -24.662121 0.822071 # 1 -1531 1531 1 21.373838 -24.662121 0.000000 # 1 -1532 1532 1 22.195910 -24.662121 0.822071 # 1 -1533 1533 1 23.017979 -24.662121 0.000000 # 1 -1534 1534 1 23.840050 -24.662121 0.822071 # 1 -1535 1535 1 9.042778 -24.662121 2.466212 # 1 -1536 1536 1 9.864848 -24.662121 1.644141 # 1 -1537 1537 1 10.686919 -24.662121 2.466212 # 1 -1538 1538 1 11.508989 -24.662121 1.644141 # 1 -1539 1539 1 12.331060 -24.662121 2.466212 # 1 -1540 1540 1 13.153131 -24.662121 1.644141 # 1 -1541 1541 1 13.975202 -24.662121 2.466212 # 1 -1542 1542 1 14.797273 -24.662121 1.644141 # 1 -1543 1543 1 15.619343 -24.662121 2.466212 # 1 -1544 1544 1 16.441414 -24.662121 1.644141 # 1 -1545 1545 1 17.263485 -24.662121 2.466212 # 1 -1546 1546 1 18.085556 -24.662121 1.644141 # 1 -1547 1547 1 18.907625 -24.662121 2.466212 # 1 -1548 1548 1 19.729696 -24.662121 1.644141 # 1 -1549 1549 1 20.551767 -24.662121 2.466212 # 1 -1550 1550 1 21.373838 -24.662121 1.644141 # 1 -1551 1551 1 22.195910 -24.662121 2.466212 # 1 -1552 1552 1 23.017979 -24.662121 1.644141 # 1 -1553 1553 1 23.840050 -24.662121 2.466212 # 1 -1554 1554 1 9.042778 -24.662121 4.110353 # 1 -1555 1555 1 9.864848 -24.662121 3.288283 # 1 -1556 1556 1 10.686919 -24.662121 4.110353 # 1 -1557 1557 1 11.508989 -24.662121 3.288283 # 1 -1558 1558 1 12.331060 -24.662121 4.110353 # 1 -1559 1559 1 13.153131 -24.662121 3.288283 # 1 -1560 1560 1 13.975202 -24.662121 4.110353 # 1 -1561 1561 1 14.797273 -24.662121 3.288283 # 1 -1562 1562 1 15.619343 -24.662121 4.110353 # 1 -1563 1563 1 16.441414 -24.662121 3.288283 # 1 -1564 1564 1 17.263485 -24.662121 4.110353 # 1 -1565 1565 1 18.085556 -24.662121 3.288283 # 1 -1566 1566 1 18.907625 -24.662121 4.110353 # 1 -1567 1567 1 19.729696 -24.662121 3.288283 # 1 -1568 1568 1 20.551767 -24.662121 4.110353 # 1 -1569 1569 1 21.373838 -24.662121 3.288283 # 1 -1570 1570 1 22.195910 -24.662121 4.110353 # 1 -1571 1571 1 23.017979 -24.662121 3.288283 # 1 -1572 1572 1 23.840050 -24.662121 4.110353 # 1 -1573 1573 1 9.042778 -24.662121 5.754495 # 1 -1574 1574 1 9.864848 -24.662121 4.932424 # 1 -1575 1575 1 10.686919 -24.662121 5.754495 # 1 -1576 1576 1 11.508989 -24.662121 4.932424 # 1 -1577 1577 1 12.331060 -24.662121 5.754495 # 1 -1578 1578 1 13.153131 -24.662121 4.932424 # 1 -1579 1579 1 13.975202 -24.662121 5.754495 # 1 -1580 1580 1 14.797273 -24.662121 4.932424 # 1 -1581 1581 1 15.619343 -24.662121 5.754495 # 1 -1582 1582 1 16.441414 -24.662121 4.932424 # 1 -1583 1583 1 17.263485 -24.662121 5.754495 # 1 -1584 1584 1 18.085556 -24.662121 4.932424 # 1 -1585 1585 1 18.907625 -24.662121 5.754495 # 1 -1586 1586 1 19.729696 -24.662121 4.932424 # 1 -1587 1587 1 20.551767 -24.662121 5.754495 # 1 -1588 1588 1 21.373838 -24.662121 4.932424 # 1 -1589 1589 1 22.195910 -24.662121 5.754495 # 1 -1590 1590 1 23.017979 -24.662121 4.932424 # 1 -1591 1591 1 23.840050 -24.662121 5.754495 # 1 -1592 1592 1 9.042778 -24.662121 7.398636 # 1 -1593 1593 1 9.864848 -24.662121 6.576566 # 1 -1594 1594 1 10.686919 -24.662121 7.398636 # 1 -1595 1595 1 11.508989 -24.662121 6.576566 # 1 -1596 1596 1 12.331060 -24.662121 7.398636 # 1 -1597 1597 1 13.153131 -24.662121 6.576566 # 1 -1598 1598 1 13.975202 -24.662121 7.398636 # 1 -1599 1599 1 14.797273 -24.662121 6.576566 # 1 -1600 1600 1 15.619343 -24.662121 7.398636 # 1 -1601 1601 1 16.441414 -24.662121 6.576566 # 1 -1602 1602 1 17.263485 -24.662121 7.398636 # 1 -1603 1603 1 18.085556 -24.662121 6.576566 # 1 -1604 1604 1 18.907625 -24.662121 7.398636 # 1 -1605 1605 1 19.729696 -24.662121 6.576566 # 1 -1606 1606 1 20.551767 -24.662121 7.398636 # 1 -1607 1607 1 21.373838 -24.662121 6.576566 # 1 -1608 1608 1 22.195910 -24.662121 7.398636 # 1 -1609 1609 1 23.017979 -24.662121 6.576566 # 1 -1610 1610 1 23.840050 -24.662121 7.398636 # 1 -1611 1611 1 9.042778 -24.662121 9.042778 # 1 -1612 1612 1 9.864848 -24.662121 8.220707 # 1 -1613 1613 1 10.686919 -24.662121 9.042778 # 1 -1614 1614 1 11.508989 -24.662121 8.220707 # 1 -1615 1615 1 12.331060 -24.662121 9.042778 # 1 -1616 1616 1 13.153131 -24.662121 8.220707 # 1 -1617 1617 1 13.975202 -24.662121 9.042778 # 1 -1618 1618 1 14.797273 -24.662121 8.220707 # 1 -1619 1619 1 15.619343 -24.662121 9.042778 # 1 -1620 1620 1 16.441414 -24.662121 8.220707 # 1 -1621 1621 1 17.263485 -24.662121 9.042778 # 1 -1622 1622 1 18.085556 -24.662121 8.220707 # 1 -1623 1623 1 18.907625 -24.662121 9.042778 # 1 -1624 1624 1 19.729696 -24.662121 8.220707 # 1 -1625 1625 1 20.551767 -24.662121 9.042778 # 1 -1626 1626 1 21.373838 -24.662121 8.220707 # 1 -1627 1627 1 22.195910 -24.662121 9.042778 # 1 -1628 1628 1 23.017979 -24.662121 8.220707 # 1 -1629 1629 1 23.840050 -24.662121 9.042778 # 1 -1630 1630 1 9.042778 -24.662121 10.686919 # 1 -1631 1631 1 9.864848 -24.662121 9.864848 # 1 -1632 1632 1 10.686919 -24.662121 10.686919 # 1 -1633 1633 1 11.508989 -24.662121 9.864848 # 1 -1634 1634 1 12.331060 -24.662121 10.686919 # 1 -1635 1635 1 13.153131 -24.662121 9.864848 # 1 -1636 1636 1 13.975202 -24.662121 10.686919 # 1 -1637 1637 1 14.797273 -24.662121 9.864848 # 1 -1638 1638 1 15.619343 -24.662121 10.686919 # 1 -1639 1639 1 16.441414 -24.662121 9.864848 # 1 -1640 1640 1 17.263485 -24.662121 10.686919 # 1 -1641 1641 1 18.085556 -24.662121 9.864848 # 1 -1642 1642 1 18.907625 -24.662121 10.686919 # 1 -1643 1643 1 19.729696 -24.662121 9.864848 # 1 -1644 1644 1 20.551767 -24.662121 10.686919 # 1 -1645 1645 1 21.373838 -24.662121 9.864848 # 1 -1646 1646 1 22.195910 -24.662121 10.686919 # 1 -1647 1647 1 23.017979 -24.662121 9.864848 # 1 -1648 1648 1 23.840050 -24.662121 10.686919 # 1 -1649 1649 1 9.042778 -24.662121 12.331060 # 1 -1650 1650 1 9.864848 -24.662121 11.508989 # 1 -1651 1651 1 10.686919 -24.662121 12.331060 # 1 -1652 1652 1 11.508989 -24.662121 11.508989 # 1 -1653 1653 1 12.331060 -24.662121 12.331060 # 1 -1654 1654 1 13.153131 -24.662121 11.508989 # 1 -1655 1655 1 13.975202 -24.662121 12.331060 # 1 -1656 1656 1 14.797273 -24.662121 11.508989 # 1 -1657 1657 1 15.619343 -24.662121 12.331060 # 1 -1658 1658 1 16.441414 -24.662121 11.508989 # 1 -1659 1659 1 17.263485 -24.662121 12.331060 # 1 -1660 1660 1 18.085556 -24.662121 11.508989 # 1 -1661 1661 1 18.907625 -24.662121 12.331060 # 1 -1662 1662 1 19.729696 -24.662121 11.508989 # 1 -1663 1663 1 20.551767 -24.662121 12.331060 # 1 -1664 1664 1 21.373838 -24.662121 11.508989 # 1 -1665 1665 1 22.195910 -24.662121 12.331060 # 1 -1666 1666 1 23.017979 -24.662121 11.508989 # 1 -1667 1667 1 23.840050 -24.662121 12.331060 # 1 -1668 1668 1 9.042778 -24.662121 13.975202 # 1 -1669 1669 1 9.864848 -24.662121 13.153131 # 1 -1670 1670 1 10.686919 -24.662121 13.975202 # 1 -1671 1671 1 11.508989 -24.662121 13.153131 # 1 -1672 1672 1 12.331060 -24.662121 13.975202 # 1 -1673 1673 1 13.153131 -24.662121 13.153131 # 1 -1674 1674 1 13.975202 -24.662121 13.975202 # 1 -1675 1675 1 14.797273 -24.662121 13.153131 # 1 -1676 1676 1 15.619343 -24.662121 13.975202 # 1 -1677 1677 1 16.441414 -24.662121 13.153131 # 1 -1678 1678 1 17.263485 -24.662121 13.975202 # 1 -1679 1679 1 18.085556 -24.662121 13.153131 # 1 -1680 1680 1 18.907625 -24.662121 13.975202 # 1 -1681 1681 1 19.729696 -24.662121 13.153131 # 1 -1682 1682 1 20.551767 -24.662121 13.975202 # 1 -1683 1683 1 21.373838 -24.662121 13.153131 # 1 -1684 1684 1 22.195910 -24.662121 13.975202 # 1 -1685 1685 1 23.017979 -24.662121 13.153131 # 1 -1686 1686 1 23.840050 -24.662121 13.975202 # 1 -1687 1687 1 9.042778 -24.662121 15.619343 # 1 -1688 1688 1 9.864848 -24.662121 14.797273 # 1 -1689 1689 1 10.686919 -24.662121 15.619343 # 1 -1690 1690 1 11.508989 -24.662121 14.797273 # 1 -1691 1691 1 12.331060 -24.662121 15.619343 # 1 -1692 1692 1 13.153131 -24.662121 14.797273 # 1 -1693 1693 1 13.975202 -24.662121 15.619343 # 1 -1694 1694 1 14.797273 -24.662121 14.797273 # 1 -1695 1695 1 15.619343 -24.662121 15.619343 # 1 -1696 1696 1 16.441414 -24.662121 14.797273 # 1 -1697 1697 1 17.263485 -24.662121 15.619343 # 1 -1698 1698 1 18.085556 -24.662121 14.797273 # 1 -1699 1699 1 18.907625 -24.662121 15.619343 # 1 -1700 1700 1 19.729696 -24.662121 14.797273 # 1 -1701 1701 1 20.551767 -24.662121 15.619343 # 1 -1702 1702 1 21.373838 -24.662121 14.797273 # 1 -1703 1703 1 22.195910 -24.662121 15.619343 # 1 -1704 1704 1 23.017979 -24.662121 14.797273 # 1 -1705 1705 1 23.840050 -24.662121 15.619343 # 1 -1706 1706 1 9.042778 -24.662121 17.263485 # 1 -1707 1707 1 9.864848 -24.662121 16.441414 # 1 -1708 1708 1 10.686919 -24.662121 17.263485 # 1 -1709 1709 1 11.508989 -24.662121 16.441414 # 1 -1710 1710 1 12.331060 -24.662121 17.263485 # 1 -1711 1711 1 13.153131 -24.662121 16.441414 # 1 -1712 1712 1 13.975202 -24.662121 17.263485 # 1 -1713 1713 1 14.797273 -24.662121 16.441414 # 1 -1714 1714 1 15.619343 -24.662121 17.263485 # 1 -1715 1715 1 16.441414 -24.662121 16.441414 # 1 -1716 1716 1 17.263485 -24.662121 17.263485 # 1 -1717 1717 1 18.085556 -24.662121 16.441414 # 1 -1718 1718 1 18.907625 -24.662121 17.263485 # 1 -1719 1719 1 19.729696 -24.662121 16.441414 # 1 -1720 1720 1 20.551767 -24.662121 17.263485 # 1 -1721 1721 1 21.373838 -24.662121 16.441414 # 1 -1722 1722 1 22.195910 -24.662121 17.263485 # 1 -1723 1723 1 23.017979 -24.662121 16.441414 # 1 -1724 1724 1 23.840050 -24.662121 17.263485 # 1 -1725 1725 1 9.042778 -24.662121 18.907625 # 1 -1726 1726 1 9.864848 -24.662121 18.085556 # 1 -1727 1727 1 10.686919 -24.662121 18.907625 # 1 -1728 1728 1 11.508989 -24.662121 18.085556 # 1 -1729 1729 1 12.331060 -24.662121 18.907625 # 1 -1730 1730 1 13.153131 -24.662121 18.085556 # 1 -1731 1731 1 13.975202 -24.662121 18.907625 # 1 -1732 1732 1 14.797273 -24.662121 18.085556 # 1 -1733 1733 1 15.619343 -24.662121 18.907625 # 1 -1734 1734 1 16.441414 -24.662121 18.085556 # 1 -1735 1735 1 17.263485 -24.662121 18.907625 # 1 -1736 1736 1 18.085556 -24.662121 18.085556 # 1 -1737 1737 1 18.907625 -24.662121 18.907625 # 1 -1738 1738 1 19.729696 -24.662121 18.085556 # 1 -1739 1739 1 20.551767 -24.662121 18.907625 # 1 -1740 1740 1 21.373838 -24.662121 18.085556 # 1 -1741 1741 1 22.195910 -24.662121 18.907625 # 1 -1742 1742 1 23.017979 -24.662121 18.085556 # 1 -1743 1743 1 23.840050 -24.662121 18.907625 # 1 -1744 1744 1 9.042778 -24.662121 20.551767 # 1 -1745 1745 1 9.864848 -24.662121 19.729696 # 1 -1746 1746 1 10.686919 -24.662121 20.551767 # 1 -1747 1747 1 11.508989 -24.662121 19.729696 # 1 -1748 1748 1 12.331060 -24.662121 20.551767 # 1 -1749 1749 1 13.153131 -24.662121 19.729696 # 1 -1750 1750 1 13.975202 -24.662121 20.551767 # 1 -1751 1751 1 14.797273 -24.662121 19.729696 # 1 -1752 1752 1 15.619343 -24.662121 20.551767 # 1 -1753 1753 1 16.441414 -24.662121 19.729696 # 1 -1754 1754 1 17.263485 -24.662121 20.551767 # 1 -1755 1755 1 18.085556 -24.662121 19.729696 # 1 -1756 1756 1 18.907625 -24.662121 20.551767 # 1 -1757 1757 1 19.729696 -24.662121 19.729696 # 1 -1758 1758 1 20.551767 -24.662121 20.551767 # 1 -1759 1759 1 21.373838 -24.662121 19.729696 # 1 -1760 1760 1 22.195910 -24.662121 20.551767 # 1 -1761 1761 1 23.017979 -24.662121 19.729696 # 1 -1762 1762 1 23.840050 -24.662121 20.551767 # 1 -1763 1763 1 9.042778 -24.662121 22.195910 # 1 -1764 1764 1 9.864848 -24.662121 21.373838 # 1 -1765 1765 1 10.686919 -24.662121 22.195910 # 1 -1766 1766 1 11.508989 -24.662121 21.373838 # 1 -1767 1767 1 12.331060 -24.662121 22.195910 # 1 -1768 1768 1 13.153131 -24.662121 21.373838 # 1 -1769 1769 1 13.975202 -24.662121 22.195910 # 1 -1770 1770 1 14.797273 -24.662121 21.373838 # 1 -1771 1771 1 15.619343 -24.662121 22.195910 # 1 -1772 1772 1 16.441414 -24.662121 21.373838 # 1 -1773 1773 1 17.263485 -24.662121 22.195910 # 1 -1774 1774 1 18.085556 -24.662121 21.373838 # 1 -1775 1775 1 18.907625 -24.662121 22.195910 # 1 -1776 1776 1 19.729696 -24.662121 21.373838 # 1 -1777 1777 1 20.551767 -24.662121 22.195910 # 1 -1778 1778 1 21.373838 -24.662121 21.373838 # 1 -1779 1779 1 22.195910 -24.662121 22.195910 # 1 -1780 1780 1 23.017979 -24.662121 21.373838 # 1 -1781 1781 1 23.840050 -24.662121 22.195910 # 1 -1782 1782 1 9.042778 -24.662121 23.840050 # 1 -1783 1783 1 9.864848 -24.662121 23.017979 # 1 -1784 1784 1 10.686919 -24.662121 23.840050 # 1 -1785 1785 1 11.508989 -24.662121 23.017979 # 1 -1786 1786 1 12.331060 -24.662121 23.840050 # 1 -1787 1787 1 13.153131 -24.662121 23.017979 # 1 -1788 1788 1 13.975202 -24.662121 23.840050 # 1 -1789 1789 1 14.797273 -24.662121 23.017979 # 1 -1790 1790 1 15.619343 -24.662121 23.840050 # 1 -1791 1791 1 16.441414 -24.662121 23.017979 # 1 -1792 1792 1 17.263485 -24.662121 23.840050 # 1 -1793 1793 1 18.085556 -24.662121 23.017979 # 1 -1794 1794 1 18.907625 -24.662121 23.840050 # 1 -1795 1795 1 19.729696 -24.662121 23.017979 # 1 -1796 1796 1 20.551767 -24.662121 23.840050 # 1 -1797 1797 1 21.373838 -24.662121 23.017979 # 1 -1798 1798 1 22.195910 -24.662121 23.840050 # 1 -1799 1799 1 23.017979 -24.662121 23.017979 # 1 -1800 1800 1 23.840050 -24.662121 23.840050 # 1 -1801 1801 2 -23.840050 -23.840050 -24.662121 # 2 -1802 1802 2 -24.662121 -23.840050 -23.840050 # 2 -1803 1803 2 -22.195910 -23.840050 -24.662121 # 2 -1804 1804 2 -23.017979 -23.840050 -23.840050 # 2 -1805 1805 2 -20.551767 -23.840050 -24.662121 # 2 -1806 1806 2 -21.373838 -23.840050 -23.840050 # 2 -1807 1807 2 -18.907625 -23.840050 -24.662121 # 2 -1808 1808 2 -19.729696 -23.840050 -23.840050 # 2 -1809 1809 2 -17.263485 -23.840050 -24.662121 # 2 -1810 1810 2 -18.085556 -23.840050 -23.840050 # 2 -1811 1811 2 -15.619343 -23.840050 -24.662121 # 2 -1812 1812 2 -16.441414 -23.840050 -23.840050 # 2 -1813 1813 2 -13.975202 -23.840050 -24.662121 # 2 -1814 1814 2 -14.797273 -23.840050 -23.840050 # 2 -1815 1815 2 -12.331060 -23.840050 -24.662121 # 2 -1816 1816 2 -13.153131 -23.840050 -23.840050 # 2 -1817 1817 2 -10.686919 -23.840050 -24.662121 # 2 -1818 1818 2 -11.508989 -23.840050 -23.840050 # 2 -1819 1819 2 -9.042778 -23.840050 -24.662121 # 2 -1820 1820 2 -9.864848 -23.840050 -23.840050 # 2 -1821 1821 2 -24.662121 -23.017979 -24.662121 # 2 -1822 1822 2 -23.840050 -22.195910 -24.662121 # 2 -1823 1823 2 -23.840050 -23.017979 -23.840050 # 2 -1824 1824 2 -24.662121 -22.195910 -23.840050 # 2 -1825 1825 2 -23.017979 -23.017979 -24.662121 # 2 -1826 1826 2 -22.195910 -22.195910 -24.662121 # 2 -1827 1827 2 -22.195910 -23.017979 -23.840050 # 2 -1828 1828 2 -23.017979 -22.195910 -23.840050 # 2 -1829 1829 2 -21.373838 -23.017979 -24.662121 # 2 -1830 1830 2 -20.551767 -22.195910 -24.662121 # 2 -1831 1831 2 -20.551767 -23.017979 -23.840050 # 2 -1832 1832 2 -21.373838 -22.195910 -23.840050 # 2 -1833 1833 2 -19.729696 -23.017979 -24.662121 # 2 -1834 1834 2 -18.907625 -22.195910 -24.662121 # 2 -1835 1835 2 -18.907625 -23.017979 -23.840050 # 2 -1836 1836 2 -19.729696 -22.195910 -23.840050 # 2 -1837 1837 2 -18.085556 -23.017979 -24.662121 # 2 -1838 1838 2 -17.263485 -22.195910 -24.662121 # 2 -1839 1839 2 -17.263485 -23.017979 -23.840050 # 2 -1840 1840 2 -18.085556 -22.195910 -23.840050 # 2 -1841 1841 2 -16.441414 -23.017979 -24.662121 # 2 -1842 1842 2 -15.619343 -22.195910 -24.662121 # 2 -1843 1843 2 -15.619343 -23.017979 -23.840050 # 2 -1844 1844 2 -16.441414 -22.195910 -23.840050 # 2 -1845 1845 2 -14.797273 -23.017979 -24.662121 # 2 -1846 1846 2 -13.975202 -22.195910 -24.662121 # 2 -1847 1847 2 -13.975202 -23.017979 -23.840050 # 2 -1848 1848 2 -14.797273 -22.195910 -23.840050 # 2 -1849 1849 2 -13.153131 -23.017979 -24.662121 # 2 -1850 1850 2 -12.331060 -22.195910 -24.662121 # 2 -1851 1851 2 -12.331060 -23.017979 -23.840050 # 2 -1852 1852 2 -13.153131 -22.195910 -23.840050 # 2 -1853 1853 2 -11.508989 -23.017979 -24.662121 # 2 -1854 1854 2 -10.686919 -22.195910 -24.662121 # 2 -1855 1855 2 -10.686919 -23.017979 -23.840050 # 2 -1856 1856 2 -11.508989 -22.195910 -23.840050 # 2 -1857 1857 2 -9.864848 -23.017979 -24.662121 # 2 -1858 1858 2 -9.042778 -22.195910 -24.662121 # 2 -1859 1859 2 -9.042778 -23.017979 -23.840050 # 2 -1860 1860 2 -9.864848 -22.195910 -23.840050 # 2 -1861 1861 2 -24.662121 -21.373838 -24.662121 # 2 -1862 1862 2 -23.840050 -20.551767 -24.662121 # 2 -1863 1863 2 -23.840050 -21.373838 -23.840050 # 2 -1864 1864 2 -24.662121 -20.551767 -23.840050 # 2 -1865 1865 2 -23.017979 -21.373838 -24.662121 # 2 -1866 1866 2 -22.195910 -20.551767 -24.662121 # 2 -1867 1867 2 -22.195910 -21.373838 -23.840050 # 2 -1868 1868 2 -23.017979 -20.551767 -23.840050 # 2 -1869 1869 2 -21.373838 -21.373838 -24.662121 # 2 -1870 1870 2 -20.551767 -20.551767 -24.662121 # 2 -1871 1871 2 -20.551767 -21.373838 -23.840050 # 2 -1872 1872 2 -21.373838 -20.551767 -23.840050 # 2 -1873 1873 2 -19.729696 -21.373838 -24.662121 # 2 -1874 1874 2 -18.907625 -20.551767 -24.662121 # 2 -1875 1875 2 -18.907625 -21.373838 -23.840050 # 2 -1876 1876 2 -19.729696 -20.551767 -23.840050 # 2 -1877 1877 2 -18.085556 -21.373838 -24.662121 # 2 -1878 1878 2 -17.263485 -20.551767 -24.662121 # 2 -1879 1879 2 -17.263485 -21.373838 -23.840050 # 2 -1880 1880 2 -18.085556 -20.551767 -23.840050 # 2 -1881 1881 2 -16.441414 -21.373838 -24.662121 # 2 -1882 1882 2 -15.619343 -20.551767 -24.662121 # 2 -1883 1883 2 -15.619343 -21.373838 -23.840050 # 2 -1884 1884 2 -16.441414 -20.551767 -23.840050 # 2 -1885 1885 2 -14.797273 -21.373838 -24.662121 # 2 -1886 1886 2 -13.975202 -20.551767 -24.662121 # 2 -1887 1887 2 -13.975202 -21.373838 -23.840050 # 2 -1888 1888 2 -14.797273 -20.551767 -23.840050 # 2 -1889 1889 2 -13.153131 -21.373838 -24.662121 # 2 -1890 1890 2 -12.331060 -20.551767 -24.662121 # 2 -1891 1891 2 -12.331060 -21.373838 -23.840050 # 2 -1892 1892 2 -13.153131 -20.551767 -23.840050 # 2 -1893 1893 2 -11.508989 -21.373838 -24.662121 # 2 -1894 1894 2 -10.686919 -20.551767 -24.662121 # 2 -1895 1895 2 -10.686919 -21.373838 -23.840050 # 2 -1896 1896 2 -11.508989 -20.551767 -23.840050 # 2 -1897 1897 2 -9.864848 -21.373838 -24.662121 # 2 -1898 1898 2 -9.042778 -20.551767 -24.662121 # 2 -1899 1899 2 -9.042778 -21.373838 -23.840050 # 2 -1900 1900 2 -9.864848 -20.551767 -23.840050 # 2 -1901 1901 2 -23.840050 -23.840050 -23.017979 # 2 -1902 1902 2 -24.662121 -23.840050 -22.195910 # 2 -1903 1903 2 -22.195910 -23.840050 -23.017979 # 2 -1904 1904 2 -23.017979 -23.840050 -22.195910 # 2 -1905 1905 2 -20.551767 -23.840050 -23.017979 # 2 -1906 1906 2 -21.373838 -23.840050 -22.195910 # 2 -1907 1907 2 -18.907625 -23.840050 -23.017979 # 2 -1908 1908 2 -19.729696 -23.840050 -22.195910 # 2 -1909 1909 2 -17.263485 -23.840050 -23.017979 # 2 -1910 1910 2 -18.085556 -23.840050 -22.195910 # 2 -1911 1911 2 -15.619343 -23.840050 -23.017979 # 2 -1912 1912 2 -16.441414 -23.840050 -22.195910 # 2 -1913 1913 2 -13.975202 -23.840050 -23.017979 # 2 -1914 1914 2 -14.797273 -23.840050 -22.195910 # 2 -1915 1915 2 -12.331060 -23.840050 -23.017979 # 2 -1916 1916 2 -13.153131 -23.840050 -22.195910 # 2 -1917 1917 2 -10.686919 -23.840050 -23.017979 # 2 -1918 1918 2 -11.508989 -23.840050 -22.195910 # 2 -1919 1919 2 -9.042778 -23.840050 -23.017979 # 2 -1920 1920 2 -9.864848 -23.840050 -22.195910 # 2 -1921 1921 2 -24.662121 -23.017979 -23.017979 # 2 -1922 1922 2 -23.840050 -22.195910 -23.017979 # 2 -1923 1923 2 -23.840050 -23.017979 -22.195910 # 2 -1924 1924 2 -24.662121 -22.195910 -22.195910 # 2 -1925 1925 2 -23.017979 -23.017979 -23.017979 # 2 -1926 1926 2 -22.195910 -22.195910 -23.017979 # 2 -1927 1927 2 -22.195910 -23.017979 -22.195910 # 2 -1928 1928 2 -23.017979 -22.195910 -22.195910 # 2 -1929 1929 2 -21.373838 -23.017979 -23.017979 # 2 -1930 1930 2 -20.551767 -22.195910 -23.017979 # 2 -1931 1931 2 -20.551767 -23.017979 -22.195910 # 2 -1932 1932 2 -21.373838 -22.195910 -22.195910 # 2 -1933 1933 2 -19.729696 -23.017979 -23.017979 # 2 -1934 1934 2 -18.907625 -22.195910 -23.017979 # 2 -1935 1935 2 -18.907625 -23.017979 -22.195910 # 2 -1936 1936 2 -19.729696 -22.195910 -22.195910 # 2 -1937 1937 2 -18.085556 -23.017979 -23.017979 # 2 -1938 1938 2 -17.263485 -22.195910 -23.017979 # 2 -1939 1939 2 -17.263485 -23.017979 -22.195910 # 2 -1940 1940 2 -18.085556 -22.195910 -22.195910 # 2 -1941 1941 2 -16.441414 -23.017979 -23.017979 # 2 -1942 1942 2 -15.619343 -22.195910 -23.017979 # 2 -1943 1943 2 -15.619343 -23.017979 -22.195910 # 2 -1944 1944 2 -16.441414 -22.195910 -22.195910 # 2 -1945 1945 2 -14.797273 -23.017979 -23.017979 # 2 -1946 1946 2 -13.975202 -22.195910 -23.017979 # 2 -1947 1947 2 -13.975202 -23.017979 -22.195910 # 2 -1948 1948 2 -14.797273 -22.195910 -22.195910 # 2 -1949 1949 2 -13.153131 -23.017979 -23.017979 # 2 -1950 1950 2 -12.331060 -22.195910 -23.017979 # 2 -1951 1951 2 -12.331060 -23.017979 -22.195910 # 2 -1952 1952 2 -13.153131 -22.195910 -22.195910 # 2 -1953 1953 2 -11.508989 -23.017979 -23.017979 # 2 -1954 1954 2 -10.686919 -22.195910 -23.017979 # 2 -1955 1955 2 -10.686919 -23.017979 -22.195910 # 2 -1956 1956 2 -11.508989 -22.195910 -22.195910 # 2 -1957 1957 2 -9.864848 -23.017979 -23.017979 # 2 -1958 1958 2 -9.042778 -22.195910 -23.017979 # 2 -1959 1959 2 -9.042778 -23.017979 -22.195910 # 2 -1960 1960 2 -9.864848 -22.195910 -22.195910 # 2 -1961 1961 2 -24.662121 -21.373838 -23.017979 # 2 -1962 1962 2 -23.840050 -20.551767 -23.017979 # 2 -1963 1963 2 -23.840050 -21.373838 -22.195910 # 2 -1964 1964 2 -24.662121 -20.551767 -22.195910 # 2 -1965 1965 2 -23.017979 -21.373838 -23.017979 # 2 -1966 1966 2 -22.195910 -20.551767 -23.017979 # 2 -1967 1967 2 -22.195910 -21.373838 -22.195910 # 2 -1968 1968 2 -23.017979 -20.551767 -22.195910 # 2 -1969 1969 2 -21.373838 -21.373838 -23.017979 # 2 -1970 1970 2 -20.551767 -20.551767 -23.017979 # 2 -1971 1971 2 -20.551767 -21.373838 -22.195910 # 2 -1972 1972 2 -21.373838 -20.551767 -22.195910 # 2 -1973 1973 2 -19.729696 -21.373838 -23.017979 # 2 -1974 1974 2 -18.907625 -20.551767 -23.017979 # 2 -1975 1975 2 -18.907625 -21.373838 -22.195910 # 2 -1976 1976 2 -19.729696 -20.551767 -22.195910 # 2 -1977 1977 2 -18.085556 -21.373838 -23.017979 # 2 -1978 1978 2 -17.263485 -20.551767 -23.017979 # 2 -1979 1979 2 -17.263485 -21.373838 -22.195910 # 2 -1980 1980 2 -18.085556 -20.551767 -22.195910 # 2 -1981 1981 2 -16.441414 -21.373838 -23.017979 # 2 -1982 1982 2 -15.619343 -20.551767 -23.017979 # 2 -1983 1983 2 -15.619343 -21.373838 -22.195910 # 2 -1984 1984 2 -16.441414 -20.551767 -22.195910 # 2 -1985 1985 2 -14.797273 -21.373838 -23.017979 # 2 -1986 1986 2 -13.975202 -20.551767 -23.017979 # 2 -1987 1987 2 -13.975202 -21.373838 -22.195910 # 2 -1988 1988 2 -14.797273 -20.551767 -22.195910 # 2 -1989 1989 2 -13.153131 -21.373838 -23.017979 # 2 -1990 1990 2 -12.331060 -20.551767 -23.017979 # 2 -1991 1991 2 -12.331060 -21.373838 -22.195910 # 2 -1992 1992 2 -13.153131 -20.551767 -22.195910 # 2 -1993 1993 2 -11.508989 -21.373838 -23.017979 # 2 -1994 1994 2 -10.686919 -20.551767 -23.017979 # 2 -1995 1995 2 -10.686919 -21.373838 -22.195910 # 2 -1996 1996 2 -11.508989 -20.551767 -22.195910 # 2 -1997 1997 2 -9.864848 -21.373838 -23.017979 # 2 -1998 1998 2 -9.042778 -20.551767 -23.017979 # 2 -1999 1999 2 -9.042778 -21.373838 -22.195910 # 2 -2000 2000 2 -9.864848 -20.551767 -22.195910 # 2 -2001 2001 2 -23.840050 -23.840050 -21.373838 # 2 -2002 2002 2 -24.662121 -23.840050 -20.551767 # 2 -2003 2003 2 -22.195910 -23.840050 -21.373838 # 2 -2004 2004 2 -23.017979 -23.840050 -20.551767 # 2 -2005 2005 2 -20.551767 -23.840050 -21.373838 # 2 -2006 2006 2 -21.373838 -23.840050 -20.551767 # 2 -2007 2007 2 -18.907625 -23.840050 -21.373838 # 2 -2008 2008 2 -19.729696 -23.840050 -20.551767 # 2 -2009 2009 2 -17.263485 -23.840050 -21.373838 # 2 -2010 2010 2 -18.085556 -23.840050 -20.551767 # 2 -2011 2011 2 -15.619343 -23.840050 -21.373838 # 2 -2012 2012 2 -16.441414 -23.840050 -20.551767 # 2 -2013 2013 2 -13.975202 -23.840050 -21.373838 # 2 -2014 2014 2 -14.797273 -23.840050 -20.551767 # 2 -2015 2015 2 -12.331060 -23.840050 -21.373838 # 2 -2016 2016 2 -13.153131 -23.840050 -20.551767 # 2 -2017 2017 2 -10.686919 -23.840050 -21.373838 # 2 -2018 2018 2 -11.508989 -23.840050 -20.551767 # 2 -2019 2019 2 -9.042778 -23.840050 -21.373838 # 2 -2020 2020 2 -9.864848 -23.840050 -20.551767 # 2 -2021 2021 2 -24.662121 -23.017979 -21.373838 # 2 -2022 2022 2 -23.840050 -22.195910 -21.373838 # 2 -2023 2023 2 -23.840050 -23.017979 -20.551767 # 2 -2024 2024 2 -24.662121 -22.195910 -20.551767 # 2 -2025 2025 2 -23.017979 -23.017979 -21.373838 # 2 -2026 2026 2 -22.195910 -22.195910 -21.373838 # 2 -2027 2027 2 -22.195910 -23.017979 -20.551767 # 2 -2028 2028 2 -23.017979 -22.195910 -20.551767 # 2 -2029 2029 2 -21.373838 -23.017979 -21.373838 # 2 -2030 2030 2 -20.551767 -22.195910 -21.373838 # 2 -2031 2031 2 -20.551767 -23.017979 -20.551767 # 2 -2032 2032 2 -21.373838 -22.195910 -20.551767 # 2 -2033 2033 2 -19.729696 -23.017979 -21.373838 # 2 -2034 2034 2 -18.907625 -22.195910 -21.373838 # 2 -2035 2035 2 -18.907625 -23.017979 -20.551767 # 2 -2036 2036 2 -19.729696 -22.195910 -20.551767 # 2 -2037 2037 2 -18.085556 -23.017979 -21.373838 # 2 -2038 2038 2 -17.263485 -22.195910 -21.373838 # 2 -2039 2039 2 -17.263485 -23.017979 -20.551767 # 2 -2040 2040 2 -18.085556 -22.195910 -20.551767 # 2 -2041 2041 2 -16.441414 -23.017979 -21.373838 # 2 -2042 2042 2 -15.619343 -22.195910 -21.373838 # 2 -2043 2043 2 -15.619343 -23.017979 -20.551767 # 2 -2044 2044 2 -16.441414 -22.195910 -20.551767 # 2 -2045 2045 2 -14.797273 -23.017979 -21.373838 # 2 -2046 2046 2 -13.975202 -22.195910 -21.373838 # 2 -2047 2047 2 -13.975202 -23.017979 -20.551767 # 2 -2048 2048 2 -14.797273 -22.195910 -20.551767 # 2 -2049 2049 2 -13.153131 -23.017979 -21.373838 # 2 -2050 2050 2 -12.331060 -22.195910 -21.373838 # 2 -2051 2051 2 -12.331060 -23.017979 -20.551767 # 2 -2052 2052 2 -13.153131 -22.195910 -20.551767 # 2 -2053 2053 2 -11.508989 -23.017979 -21.373838 # 2 -2054 2054 2 -10.686919 -22.195910 -21.373838 # 2 -2055 2055 2 -10.686919 -23.017979 -20.551767 # 2 -2056 2056 2 -11.508989 -22.195910 -20.551767 # 2 -2057 2057 2 -9.864848 -23.017979 -21.373838 # 2 -2058 2058 2 -9.042778 -22.195910 -21.373838 # 2 -2059 2059 2 -9.042778 -23.017979 -20.551767 # 2 -2060 2060 2 -9.864848 -22.195910 -20.551767 # 2 -2061 2061 2 -24.662121 -21.373838 -21.373838 # 2 -2062 2062 2 -23.840050 -20.551767 -21.373838 # 2 -2063 2063 2 -23.840050 -21.373838 -20.551767 # 2 -2064 2064 2 -24.662121 -20.551767 -20.551767 # 2 -2065 2065 2 -23.017979 -21.373838 -21.373838 # 2 -2066 2066 2 -22.195910 -20.551767 -21.373838 # 2 -2067 2067 2 -22.195910 -21.373838 -20.551767 # 2 -2068 2068 2 -23.017979 -20.551767 -20.551767 # 2 -2069 2069 2 -21.373838 -21.373838 -21.373838 # 2 -2070 2070 2 -20.551767 -20.551767 -21.373838 # 2 -2071 2071 2 -20.551767 -21.373838 -20.551767 # 2 -2072 2072 2 -21.373838 -20.551767 -20.551767 # 2 -2073 2073 2 -19.729696 -21.373838 -21.373838 # 2 -2074 2074 2 -18.907625 -20.551767 -21.373838 # 2 -2075 2075 2 -18.907625 -21.373838 -20.551767 # 2 -2076 2076 2 -19.729696 -20.551767 -20.551767 # 2 -2077 2077 2 -18.085556 -21.373838 -21.373838 # 2 -2078 2078 2 -17.263485 -20.551767 -21.373838 # 2 -2079 2079 2 -17.263485 -21.373838 -20.551767 # 2 -2080 2080 2 -18.085556 -20.551767 -20.551767 # 2 -2081 2081 2 -16.441414 -21.373838 -21.373838 # 2 -2082 2082 2 -15.619343 -20.551767 -21.373838 # 2 -2083 2083 2 -15.619343 -21.373838 -20.551767 # 2 -2084 2084 2 -16.441414 -20.551767 -20.551767 # 2 -2085 2085 2 -14.797273 -21.373838 -21.373838 # 2 -2086 2086 2 -13.975202 -20.551767 -21.373838 # 2 -2087 2087 2 -13.975202 -21.373838 -20.551767 # 2 -2088 2088 2 -14.797273 -20.551767 -20.551767 # 2 -2089 2089 2 -13.153131 -21.373838 -21.373838 # 2 -2090 2090 2 -12.331060 -20.551767 -21.373838 # 2 -2091 2091 2 -12.331060 -21.373838 -20.551767 # 2 -2092 2092 2 -13.153131 -20.551767 -20.551767 # 2 -2093 2093 2 -11.508989 -21.373838 -21.373838 # 2 -2094 2094 2 -10.686919 -20.551767 -21.373838 # 2 -2095 2095 2 -10.686919 -21.373838 -20.551767 # 2 -2096 2096 2 -11.508989 -20.551767 -20.551767 # 2 -2097 2097 2 -9.864848 -21.373838 -21.373838 # 2 -2098 2098 2 -9.042778 -20.551767 -21.373838 # 2 -2099 2099 2 -9.042778 -21.373838 -20.551767 # 2 -2100 2100 2 -9.864848 -20.551767 -20.551767 # 2 -2101 2101 2 -23.840050 -23.840050 -19.729696 # 2 -2102 2102 2 -24.662121 -23.840050 -18.907625 # 2 -2103 2103 2 -22.195910 -23.840050 -19.729696 # 2 -2104 2104 2 -23.017979 -23.840050 -18.907625 # 2 -2105 2105 2 -20.551767 -23.840050 -19.729696 # 2 -2106 2106 2 -21.373838 -23.840050 -18.907625 # 2 -2107 2107 2 -18.907625 -23.840050 -19.729696 # 2 -2108 2108 2 -19.729696 -23.840050 -18.907625 # 2 -2109 2109 2 -17.263485 -23.840050 -19.729696 # 2 -2110 2110 2 -18.085556 -23.840050 -18.907625 # 2 -2111 2111 2 -15.619343 -23.840050 -19.729696 # 2 -2112 2112 2 -16.441414 -23.840050 -18.907625 # 2 -2113 2113 2 -13.975202 -23.840050 -19.729696 # 2 -2114 2114 2 -14.797273 -23.840050 -18.907625 # 2 -2115 2115 2 -12.331060 -23.840050 -19.729696 # 2 -2116 2116 2 -13.153131 -23.840050 -18.907625 # 2 -2117 2117 2 -10.686919 -23.840050 -19.729696 # 2 -2118 2118 2 -11.508989 -23.840050 -18.907625 # 2 -2119 2119 2 -9.042778 -23.840050 -19.729696 # 2 -2120 2120 2 -9.864848 -23.840050 -18.907625 # 2 -2121 2121 2 -24.662121 -23.017979 -19.729696 # 2 -2122 2122 2 -23.840050 -22.195910 -19.729696 # 2 -2123 2123 2 -23.840050 -23.017979 -18.907625 # 2 -2124 2124 2 -24.662121 -22.195910 -18.907625 # 2 -2125 2125 2 -23.017979 -23.017979 -19.729696 # 2 -2126 2126 2 -22.195910 -22.195910 -19.729696 # 2 -2127 2127 2 -22.195910 -23.017979 -18.907625 # 2 -2128 2128 2 -23.017979 -22.195910 -18.907625 # 2 -2129 2129 2 -21.373838 -23.017979 -19.729696 # 2 -2130 2130 2 -20.551767 -22.195910 -19.729696 # 2 -2131 2131 2 -20.551767 -23.017979 -18.907625 # 2 -2132 2132 2 -21.373838 -22.195910 -18.907625 # 2 -2133 2133 2 -19.729696 -23.017979 -19.729696 # 2 -2134 2134 2 -18.907625 -22.195910 -19.729696 # 2 -2135 2135 2 -18.907625 -23.017979 -18.907625 # 2 -2136 2136 2 -19.729696 -22.195910 -18.907625 # 2 -2137 2137 2 -18.085556 -23.017979 -19.729696 # 2 -2138 2138 2 -17.263485 -22.195910 -19.729696 # 2 -2139 2139 2 -17.263485 -23.017979 -18.907625 # 2 -2140 2140 2 -18.085556 -22.195910 -18.907625 # 2 -2141 2141 2 -16.441414 -23.017979 -19.729696 # 2 -2142 2142 2 -15.619343 -22.195910 -19.729696 # 2 -2143 2143 2 -15.619343 -23.017979 -18.907625 # 2 -2144 2144 2 -16.441414 -22.195910 -18.907625 # 2 -2145 2145 2 -14.797273 -23.017979 -19.729696 # 2 -2146 2146 2 -13.975202 -22.195910 -19.729696 # 2 -2147 2147 2 -13.975202 -23.017979 -18.907625 # 2 -2148 2148 2 -14.797273 -22.195910 -18.907625 # 2 -2149 2149 2 -13.153131 -23.017979 -19.729696 # 2 -2150 2150 2 -12.331060 -22.195910 -19.729696 # 2 -2151 2151 2 -12.331060 -23.017979 -18.907625 # 2 -2152 2152 2 -13.153131 -22.195910 -18.907625 # 2 -2153 2153 2 -11.508989 -23.017979 -19.729696 # 2 -2154 2154 2 -10.686919 -22.195910 -19.729696 # 2 -2155 2155 2 -10.686919 -23.017979 -18.907625 # 2 -2156 2156 2 -11.508989 -22.195910 -18.907625 # 2 -2157 2157 2 -9.864848 -23.017979 -19.729696 # 2 -2158 2158 2 -9.042778 -22.195910 -19.729696 # 2 -2159 2159 2 -9.042778 -23.017979 -18.907625 # 2 -2160 2160 2 -9.864848 -22.195910 -18.907625 # 2 -2161 2161 2 -24.662121 -21.373838 -19.729696 # 2 -2162 2162 2 -23.840050 -20.551767 -19.729696 # 2 -2163 2163 2 -23.840050 -21.373838 -18.907625 # 2 -2164 2164 2 -24.662121 -20.551767 -18.907625 # 2 -2165 2165 2 -23.017979 -21.373838 -19.729696 # 2 -2166 2166 2 -22.195910 -20.551767 -19.729696 # 2 -2167 2167 2 -22.195910 -21.373838 -18.907625 # 2 -2168 2168 2 -23.017979 -20.551767 -18.907625 # 2 -2169 2169 2 -21.373838 -21.373838 -19.729696 # 2 -2170 2170 2 -20.551767 -20.551767 -19.729696 # 2 -2171 2171 2 -20.551767 -21.373838 -18.907625 # 2 -2172 2172 2 -21.373838 -20.551767 -18.907625 # 2 -2173 2173 2 -19.729696 -21.373838 -19.729696 # 2 -2174 2174 2 -18.907625 -20.551767 -19.729696 # 2 -2175 2175 2 -18.907625 -21.373838 -18.907625 # 2 -2176 2176 2 -19.729696 -20.551767 -18.907625 # 2 -2177 2177 2 -18.085556 -21.373838 -19.729696 # 2 -2178 2178 2 -17.263485 -20.551767 -19.729696 # 2 -2179 2179 2 -17.263485 -21.373838 -18.907625 # 2 -2180 2180 2 -18.085556 -20.551767 -18.907625 # 2 -2181 2181 2 -16.441414 -21.373838 -19.729696 # 2 -2182 2182 2 -15.619343 -20.551767 -19.729696 # 2 -2183 2183 2 -15.619343 -21.373838 -18.907625 # 2 -2184 2184 2 -16.441414 -20.551767 -18.907625 # 2 -2185 2185 2 -14.797273 -21.373838 -19.729696 # 2 -2186 2186 2 -13.975202 -20.551767 -19.729696 # 2 -2187 2187 2 -13.975202 -21.373838 -18.907625 # 2 -2188 2188 2 -14.797273 -20.551767 -18.907625 # 2 -2189 2189 2 -13.153131 -21.373838 -19.729696 # 2 -2190 2190 2 -12.331060 -20.551767 -19.729696 # 2 -2191 2191 2 -12.331060 -21.373838 -18.907625 # 2 -2192 2192 2 -13.153131 -20.551767 -18.907625 # 2 -2193 2193 2 -11.508989 -21.373838 -19.729696 # 2 -2194 2194 2 -10.686919 -20.551767 -19.729696 # 2 -2195 2195 2 -10.686919 -21.373838 -18.907625 # 2 -2196 2196 2 -11.508989 -20.551767 -18.907625 # 2 -2197 2197 2 -9.864848 -21.373838 -19.729696 # 2 -2198 2198 2 -9.042778 -20.551767 -19.729696 # 2 -2199 2199 2 -9.042778 -21.373838 -18.907625 # 2 -2200 2200 2 -9.864848 -20.551767 -18.907625 # 2 -2201 2201 2 -23.840050 -23.840050 -18.085556 # 2 -2202 2202 2 -24.662121 -23.840050 -17.263485 # 2 -2203 2203 2 -22.195910 -23.840050 -18.085556 # 2 -2204 2204 2 -23.017979 -23.840050 -17.263485 # 2 -2205 2205 2 -20.551767 -23.840050 -18.085556 # 2 -2206 2206 2 -21.373838 -23.840050 -17.263485 # 2 -2207 2207 2 -18.907625 -23.840050 -18.085556 # 2 -2208 2208 2 -19.729696 -23.840050 -17.263485 # 2 -2209 2209 2 -17.263485 -23.840050 -18.085556 # 2 -2210 2210 2 -18.085556 -23.840050 -17.263485 # 2 -2211 2211 2 -15.619343 -23.840050 -18.085556 # 2 -2212 2212 2 -16.441414 -23.840050 -17.263485 # 2 -2213 2213 2 -13.975202 -23.840050 -18.085556 # 2 -2214 2214 2 -14.797273 -23.840050 -17.263485 # 2 -2215 2215 2 -12.331060 -23.840050 -18.085556 # 2 -2216 2216 2 -13.153131 -23.840050 -17.263485 # 2 -2217 2217 2 -10.686919 -23.840050 -18.085556 # 2 -2218 2218 2 -11.508989 -23.840050 -17.263485 # 2 -2219 2219 2 -9.042778 -23.840050 -18.085556 # 2 -2220 2220 2 -9.864848 -23.840050 -17.263485 # 2 -2221 2221 2 -24.662121 -23.017979 -18.085556 # 2 -2222 2222 2 -23.840050 -22.195910 -18.085556 # 2 -2223 2223 2 -23.840050 -23.017979 -17.263485 # 2 -2224 2224 2 -24.662121 -22.195910 -17.263485 # 2 -2225 2225 2 -23.017979 -23.017979 -18.085556 # 2 -2226 2226 2 -22.195910 -22.195910 -18.085556 # 2 -2227 2227 2 -22.195910 -23.017979 -17.263485 # 2 -2228 2228 2 -23.017979 -22.195910 -17.263485 # 2 -2229 2229 2 -21.373838 -23.017979 -18.085556 # 2 -2230 2230 2 -20.551767 -22.195910 -18.085556 # 2 -2231 2231 2 -20.551767 -23.017979 -17.263485 # 2 -2232 2232 2 -21.373838 -22.195910 -17.263485 # 2 -2233 2233 2 -19.729696 -23.017979 -18.085556 # 2 -2234 2234 2 -18.907625 -22.195910 -18.085556 # 2 -2235 2235 2 -18.907625 -23.017979 -17.263485 # 2 -2236 2236 2 -19.729696 -22.195910 -17.263485 # 2 -2237 2237 2 -18.085556 -23.017979 -18.085556 # 2 -2238 2238 2 -17.263485 -22.195910 -18.085556 # 2 -2239 2239 2 -17.263485 -23.017979 -17.263485 # 2 -2240 2240 2 -18.085556 -22.195910 -17.263485 # 2 -2241 2241 2 -16.441414 -23.017979 -18.085556 # 2 -2242 2242 2 -15.619343 -22.195910 -18.085556 # 2 -2243 2243 2 -15.619343 -23.017979 -17.263485 # 2 -2244 2244 2 -16.441414 -22.195910 -17.263485 # 2 -2245 2245 2 -14.797273 -23.017979 -18.085556 # 2 -2246 2246 2 -13.975202 -22.195910 -18.085556 # 2 -2247 2247 2 -13.975202 -23.017979 -17.263485 # 2 -2248 2248 2 -14.797273 -22.195910 -17.263485 # 2 -2249 2249 2 -13.153131 -23.017979 -18.085556 # 2 -2250 2250 2 -12.331060 -22.195910 -18.085556 # 2 -2251 2251 2 -12.331060 -23.017979 -17.263485 # 2 -2252 2252 2 -13.153131 -22.195910 -17.263485 # 2 -2253 2253 2 -11.508989 -23.017979 -18.085556 # 2 -2254 2254 2 -10.686919 -22.195910 -18.085556 # 2 -2255 2255 2 -10.686919 -23.017979 -17.263485 # 2 -2256 2256 2 -11.508989 -22.195910 -17.263485 # 2 -2257 2257 2 -9.864848 -23.017979 -18.085556 # 2 -2258 2258 2 -9.042778 -22.195910 -18.085556 # 2 -2259 2259 2 -9.042778 -23.017979 -17.263485 # 2 -2260 2260 2 -9.864848 -22.195910 -17.263485 # 2 -2261 2261 2 -24.662121 -21.373838 -18.085556 # 2 -2262 2262 2 -23.840050 -20.551767 -18.085556 # 2 -2263 2263 2 -23.840050 -21.373838 -17.263485 # 2 -2264 2264 2 -24.662121 -20.551767 -17.263485 # 2 -2265 2265 2 -23.017979 -21.373838 -18.085556 # 2 -2266 2266 2 -22.195910 -20.551767 -18.085556 # 2 -2267 2267 2 -22.195910 -21.373838 -17.263485 # 2 -2268 2268 2 -23.017979 -20.551767 -17.263485 # 2 -2269 2269 2 -21.373838 -21.373838 -18.085556 # 2 -2270 2270 2 -20.551767 -20.551767 -18.085556 # 2 -2271 2271 2 -20.551767 -21.373838 -17.263485 # 2 -2272 2272 2 -21.373838 -20.551767 -17.263485 # 2 -2273 2273 2 -19.729696 -21.373838 -18.085556 # 2 -2274 2274 2 -18.907625 -20.551767 -18.085556 # 2 -2275 2275 2 -18.907625 -21.373838 -17.263485 # 2 -2276 2276 2 -19.729696 -20.551767 -17.263485 # 2 -2277 2277 2 -18.085556 -21.373838 -18.085556 # 2 -2278 2278 2 -17.263485 -20.551767 -18.085556 # 2 -2279 2279 2 -17.263485 -21.373838 -17.263485 # 2 -2280 2280 2 -18.085556 -20.551767 -17.263485 # 2 -2281 2281 2 -16.441414 -21.373838 -18.085556 # 2 -2282 2282 2 -15.619343 -20.551767 -18.085556 # 2 -2283 2283 2 -15.619343 -21.373838 -17.263485 # 2 -2284 2284 2 -16.441414 -20.551767 -17.263485 # 2 -2285 2285 2 -14.797273 -21.373838 -18.085556 # 2 -2286 2286 2 -13.975202 -20.551767 -18.085556 # 2 -2287 2287 2 -13.975202 -21.373838 -17.263485 # 2 -2288 2288 2 -14.797273 -20.551767 -17.263485 # 2 -2289 2289 2 -13.153131 -21.373838 -18.085556 # 2 -2290 2290 2 -12.331060 -20.551767 -18.085556 # 2 -2291 2291 2 -12.331060 -21.373838 -17.263485 # 2 -2292 2292 2 -13.153131 -20.551767 -17.263485 # 2 -2293 2293 2 -11.508989 -21.373838 -18.085556 # 2 -2294 2294 2 -10.686919 -20.551767 -18.085556 # 2 -2295 2295 2 -10.686919 -21.373838 -17.263485 # 2 -2296 2296 2 -11.508989 -20.551767 -17.263485 # 2 -2297 2297 2 -9.864848 -21.373838 -18.085556 # 2 -2298 2298 2 -9.042778 -20.551767 -18.085556 # 2 -2299 2299 2 -9.042778 -21.373838 -17.263485 # 2 -2300 2300 2 -9.864848 -20.551767 -17.263485 # 2 -2301 2301 2 -23.840050 -23.840050 -16.441414 # 2 -2302 2302 2 -24.662121 -23.840050 -15.619343 # 2 -2303 2303 2 -22.195910 -23.840050 -16.441414 # 2 -2304 2304 2 -23.017979 -23.840050 -15.619343 # 2 -2305 2305 2 -20.551767 -23.840050 -16.441414 # 2 -2306 2306 2 -21.373838 -23.840050 -15.619343 # 2 -2307 2307 2 -18.907625 -23.840050 -16.441414 # 2 -2308 2308 2 -19.729696 -23.840050 -15.619343 # 2 -2309 2309 2 -17.263485 -23.840050 -16.441414 # 2 -2310 2310 2 -18.085556 -23.840050 -15.619343 # 2 -2311 2311 2 -15.619343 -23.840050 -16.441414 # 2 -2312 2312 2 -16.441414 -23.840050 -15.619343 # 2 -2313 2313 2 -13.975202 -23.840050 -16.441414 # 2 -2314 2314 2 -14.797273 -23.840050 -15.619343 # 2 -2315 2315 2 -12.331060 -23.840050 -16.441414 # 2 -2316 2316 2 -13.153131 -23.840050 -15.619343 # 2 -2317 2317 2 -10.686919 -23.840050 -16.441414 # 2 -2318 2318 2 -11.508989 -23.840050 -15.619343 # 2 -2319 2319 2 -9.042778 -23.840050 -16.441414 # 2 -2320 2320 2 -9.864848 -23.840050 -15.619343 # 2 -2321 2321 2 -24.662121 -23.017979 -16.441414 # 2 -2322 2322 2 -23.840050 -22.195910 -16.441414 # 2 -2323 2323 2 -23.840050 -23.017979 -15.619343 # 2 -2324 2324 2 -24.662121 -22.195910 -15.619343 # 2 -2325 2325 2 -23.017979 -23.017979 -16.441414 # 2 -2326 2326 2 -22.195910 -22.195910 -16.441414 # 2 -2327 2327 2 -22.195910 -23.017979 -15.619343 # 2 -2328 2328 2 -23.017979 -22.195910 -15.619343 # 2 -2329 2329 2 -21.373838 -23.017979 -16.441414 # 2 -2330 2330 2 -20.551767 -22.195910 -16.441414 # 2 -2331 2331 2 -20.551767 -23.017979 -15.619343 # 2 -2332 2332 2 -21.373838 -22.195910 -15.619343 # 2 -2333 2333 2 -19.729696 -23.017979 -16.441414 # 2 -2334 2334 2 -18.907625 -22.195910 -16.441414 # 2 -2335 2335 2 -18.907625 -23.017979 -15.619343 # 2 -2336 2336 2 -19.729696 -22.195910 -15.619343 # 2 -2337 2337 2 -18.085556 -23.017979 -16.441414 # 2 -2338 2338 2 -17.263485 -22.195910 -16.441414 # 2 -2339 2339 2 -17.263485 -23.017979 -15.619343 # 2 -2340 2340 2 -18.085556 -22.195910 -15.619343 # 2 -2341 2341 2 -16.441414 -23.017979 -16.441414 # 2 -2342 2342 2 -15.619343 -22.195910 -16.441414 # 2 -2343 2343 2 -15.619343 -23.017979 -15.619343 # 2 -2344 2344 2 -16.441414 -22.195910 -15.619343 # 2 -2345 2345 2 -14.797273 -23.017979 -16.441414 # 2 -2346 2346 2 -13.975202 -22.195910 -16.441414 # 2 -2347 2347 2 -13.975202 -23.017979 -15.619343 # 2 -2348 2348 2 -14.797273 -22.195910 -15.619343 # 2 -2349 2349 2 -13.153131 -23.017979 -16.441414 # 2 -2350 2350 2 -12.331060 -22.195910 -16.441414 # 2 -2351 2351 2 -12.331060 -23.017979 -15.619343 # 2 -2352 2352 2 -13.153131 -22.195910 -15.619343 # 2 -2353 2353 2 -11.508989 -23.017979 -16.441414 # 2 -2354 2354 2 -10.686919 -22.195910 -16.441414 # 2 -2355 2355 2 -10.686919 -23.017979 -15.619343 # 2 -2356 2356 2 -11.508989 -22.195910 -15.619343 # 2 -2357 2357 2 -9.864848 -23.017979 -16.441414 # 2 -2358 2358 2 -9.042778 -22.195910 -16.441414 # 2 -2359 2359 2 -9.042778 -23.017979 -15.619343 # 2 -2360 2360 2 -9.864848 -22.195910 -15.619343 # 2 -2361 2361 2 -24.662121 -21.373838 -16.441414 # 2 -2362 2362 2 -23.840050 -20.551767 -16.441414 # 2 -2363 2363 2 -23.840050 -21.373838 -15.619343 # 2 -2364 2364 2 -24.662121 -20.551767 -15.619343 # 2 -2365 2365 2 -23.017979 -21.373838 -16.441414 # 2 -2366 2366 2 -22.195910 -20.551767 -16.441414 # 2 -2367 2367 2 -22.195910 -21.373838 -15.619343 # 2 -2368 2368 2 -23.017979 -20.551767 -15.619343 # 2 -2369 2369 2 -21.373838 -21.373838 -16.441414 # 2 -2370 2370 2 -20.551767 -20.551767 -16.441414 # 2 -2371 2371 2 -20.551767 -21.373838 -15.619343 # 2 -2372 2372 2 -21.373838 -20.551767 -15.619343 # 2 -2373 2373 2 -19.729696 -21.373838 -16.441414 # 2 -2374 2374 2 -18.907625 -20.551767 -16.441414 # 2 -2375 2375 2 -18.907625 -21.373838 -15.619343 # 2 -2376 2376 2 -19.729696 -20.551767 -15.619343 # 2 -2377 2377 2 -18.085556 -21.373838 -16.441414 # 2 -2378 2378 2 -17.263485 -20.551767 -16.441414 # 2 -2379 2379 2 -17.263485 -21.373838 -15.619343 # 2 -2380 2380 2 -18.085556 -20.551767 -15.619343 # 2 -2381 2381 2 -16.441414 -21.373838 -16.441414 # 2 -2382 2382 2 -15.619343 -20.551767 -16.441414 # 2 -2383 2383 2 -15.619343 -21.373838 -15.619343 # 2 -2384 2384 2 -16.441414 -20.551767 -15.619343 # 2 -2385 2385 2 -14.797273 -21.373838 -16.441414 # 2 -2386 2386 2 -13.975202 -20.551767 -16.441414 # 2 -2387 2387 2 -13.975202 -21.373838 -15.619343 # 2 -2388 2388 2 -14.797273 -20.551767 -15.619343 # 2 -2389 2389 2 -13.153131 -21.373838 -16.441414 # 2 -2390 2390 2 -12.331060 -20.551767 -16.441414 # 2 -2391 2391 2 -12.331060 -21.373838 -15.619343 # 2 -2392 2392 2 -13.153131 -20.551767 -15.619343 # 2 -2393 2393 2 -11.508989 -21.373838 -16.441414 # 2 -2394 2394 2 -10.686919 -20.551767 -16.441414 # 2 -2395 2395 2 -10.686919 -21.373838 -15.619343 # 2 -2396 2396 2 -11.508989 -20.551767 -15.619343 # 2 -2397 2397 2 -9.864848 -21.373838 -16.441414 # 2 -2398 2398 2 -9.042778 -20.551767 -16.441414 # 2 -2399 2399 2 -9.042778 -21.373838 -15.619343 # 2 -2400 2400 2 -9.864848 -20.551767 -15.619343 # 2 -2401 2401 2 -23.840050 -23.840050 -14.797273 # 2 -2402 2402 2 -24.662121 -23.840050 -13.975202 # 2 -2403 2403 2 -22.195910 -23.840050 -14.797273 # 2 -2404 2404 2 -23.017979 -23.840050 -13.975202 # 2 -2405 2405 2 -20.551767 -23.840050 -14.797273 # 2 -2406 2406 2 -21.373838 -23.840050 -13.975202 # 2 -2407 2407 2 -18.907625 -23.840050 -14.797273 # 2 -2408 2408 2 -19.729696 -23.840050 -13.975202 # 2 -2409 2409 2 -17.263485 -23.840050 -14.797273 # 2 -2410 2410 2 -18.085556 -23.840050 -13.975202 # 2 -2411 2411 2 -15.619343 -23.840050 -14.797273 # 2 -2412 2412 2 -16.441414 -23.840050 -13.975202 # 2 -2413 2413 2 -13.975202 -23.840050 -14.797273 # 2 -2414 2414 2 -14.797273 -23.840050 -13.975202 # 2 -2415 2415 2 -12.331060 -23.840050 -14.797273 # 2 -2416 2416 2 -13.153131 -23.840050 -13.975202 # 2 -2417 2417 2 -10.686919 -23.840050 -14.797273 # 2 -2418 2418 2 -11.508989 -23.840050 -13.975202 # 2 -2419 2419 2 -9.042778 -23.840050 -14.797273 # 2 -2420 2420 2 -9.864848 -23.840050 -13.975202 # 2 -2421 2421 2 -24.662121 -23.017979 -14.797273 # 2 -2422 2422 2 -23.840050 -22.195910 -14.797273 # 2 -2423 2423 2 -23.840050 -23.017979 -13.975202 # 2 -2424 2424 2 -24.662121 -22.195910 -13.975202 # 2 -2425 2425 2 -23.017979 -23.017979 -14.797273 # 2 -2426 2426 2 -22.195910 -22.195910 -14.797273 # 2 -2427 2427 2 -22.195910 -23.017979 -13.975202 # 2 -2428 2428 2 -23.017979 -22.195910 -13.975202 # 2 -2429 2429 2 -21.373838 -23.017979 -14.797273 # 2 -2430 2430 2 -20.551767 -22.195910 -14.797273 # 2 -2431 2431 2 -20.551767 -23.017979 -13.975202 # 2 -2432 2432 2 -21.373838 -22.195910 -13.975202 # 2 -2433 2433 2 -19.729696 -23.017979 -14.797273 # 2 -2434 2434 2 -18.907625 -22.195910 -14.797273 # 2 -2435 2435 2 -18.907625 -23.017979 -13.975202 # 2 -2436 2436 2 -19.729696 -22.195910 -13.975202 # 2 -2437 2437 2 -18.085556 -23.017979 -14.797273 # 2 -2438 2438 2 -17.263485 -22.195910 -14.797273 # 2 -2439 2439 2 -17.263485 -23.017979 -13.975202 # 2 -2440 2440 2 -18.085556 -22.195910 -13.975202 # 2 -2441 2441 2 -16.441414 -23.017979 -14.797273 # 2 -2442 2442 2 -15.619343 -22.195910 -14.797273 # 2 -2443 2443 2 -15.619343 -23.017979 -13.975202 # 2 -2444 2444 2 -16.441414 -22.195910 -13.975202 # 2 -2445 2445 2 -14.797273 -23.017979 -14.797273 # 2 -2446 2446 2 -13.975202 -22.195910 -14.797273 # 2 -2447 2447 2 -13.975202 -23.017979 -13.975202 # 2 -2448 2448 2 -14.797273 -22.195910 -13.975202 # 2 -2449 2449 2 -13.153131 -23.017979 -14.797273 # 2 -2450 2450 2 -12.331060 -22.195910 -14.797273 # 2 -2451 2451 2 -12.331060 -23.017979 -13.975202 # 2 -2452 2452 2 -13.153131 -22.195910 -13.975202 # 2 -2453 2453 2 -11.508989 -23.017979 -14.797273 # 2 -2454 2454 2 -10.686919 -22.195910 -14.797273 # 2 -2455 2455 2 -10.686919 -23.017979 -13.975202 # 2 -2456 2456 2 -11.508989 -22.195910 -13.975202 # 2 -2457 2457 2 -9.864848 -23.017979 -14.797273 # 2 -2458 2458 2 -9.042778 -22.195910 -14.797273 # 2 -2459 2459 2 -9.042778 -23.017979 -13.975202 # 2 -2460 2460 2 -9.864848 -22.195910 -13.975202 # 2 -2461 2461 2 -24.662121 -21.373838 -14.797273 # 2 -2462 2462 2 -23.840050 -20.551767 -14.797273 # 2 -2463 2463 2 -23.840050 -21.373838 -13.975202 # 2 -2464 2464 2 -24.662121 -20.551767 -13.975202 # 2 -2465 2465 2 -23.017979 -21.373838 -14.797273 # 2 -2466 2466 2 -22.195910 -20.551767 -14.797273 # 2 -2467 2467 2 -22.195910 -21.373838 -13.975202 # 2 -2468 2468 2 -23.017979 -20.551767 -13.975202 # 2 -2469 2469 2 -21.373838 -21.373838 -14.797273 # 2 -2470 2470 2 -20.551767 -20.551767 -14.797273 # 2 -2471 2471 2 -20.551767 -21.373838 -13.975202 # 2 -2472 2472 2 -21.373838 -20.551767 -13.975202 # 2 -2473 2473 2 -19.729696 -21.373838 -14.797273 # 2 -2474 2474 2 -18.907625 -20.551767 -14.797273 # 2 -2475 2475 2 -18.907625 -21.373838 -13.975202 # 2 -2476 2476 2 -19.729696 -20.551767 -13.975202 # 2 -2477 2477 2 -18.085556 -21.373838 -14.797273 # 2 -2478 2478 2 -17.263485 -20.551767 -14.797273 # 2 -2479 2479 2 -17.263485 -21.373838 -13.975202 # 2 -2480 2480 2 -18.085556 -20.551767 -13.975202 # 2 -2481 2481 2 -16.441414 -21.373838 -14.797273 # 2 -2482 2482 2 -15.619343 -20.551767 -14.797273 # 2 -2483 2483 2 -15.619343 -21.373838 -13.975202 # 2 -2484 2484 2 -16.441414 -20.551767 -13.975202 # 2 -2485 2485 2 -14.797273 -21.373838 -14.797273 # 2 -2486 2486 2 -13.975202 -20.551767 -14.797273 # 2 -2487 2487 2 -13.975202 -21.373838 -13.975202 # 2 -2488 2488 2 -14.797273 -20.551767 -13.975202 # 2 -2489 2489 2 -13.153131 -21.373838 -14.797273 # 2 -2490 2490 2 -12.331060 -20.551767 -14.797273 # 2 -2491 2491 2 -12.331060 -21.373838 -13.975202 # 2 -2492 2492 2 -13.153131 -20.551767 -13.975202 # 2 -2493 2493 2 -11.508989 -21.373838 -14.797273 # 2 -2494 2494 2 -10.686919 -20.551767 -14.797273 # 2 -2495 2495 2 -10.686919 -21.373838 -13.975202 # 2 -2496 2496 2 -11.508989 -20.551767 -13.975202 # 2 -2497 2497 2 -9.864848 -21.373838 -14.797273 # 2 -2498 2498 2 -9.042778 -20.551767 -14.797273 # 2 -2499 2499 2 -9.042778 -21.373838 -13.975202 # 2 -2500 2500 2 -9.864848 -20.551767 -13.975202 # 2 -2501 2501 2 -23.840050 -23.840050 -13.153131 # 2 -2502 2502 2 -24.662121 -23.840050 -12.331060 # 2 -2503 2503 2 -22.195910 -23.840050 -13.153131 # 2 -2504 2504 2 -23.017979 -23.840050 -12.331060 # 2 -2505 2505 2 -20.551767 -23.840050 -13.153131 # 2 -2506 2506 2 -21.373838 -23.840050 -12.331060 # 2 -2507 2507 2 -18.907625 -23.840050 -13.153131 # 2 -2508 2508 2 -19.729696 -23.840050 -12.331060 # 2 -2509 2509 2 -17.263485 -23.840050 -13.153131 # 2 -2510 2510 2 -18.085556 -23.840050 -12.331060 # 2 -2511 2511 2 -15.619343 -23.840050 -13.153131 # 2 -2512 2512 2 -16.441414 -23.840050 -12.331060 # 2 -2513 2513 2 -13.975202 -23.840050 -13.153131 # 2 -2514 2514 2 -14.797273 -23.840050 -12.331060 # 2 -2515 2515 2 -12.331060 -23.840050 -13.153131 # 2 -2516 2516 2 -13.153131 -23.840050 -12.331060 # 2 -2517 2517 2 -10.686919 -23.840050 -13.153131 # 2 -2518 2518 2 -11.508989 -23.840050 -12.331060 # 2 -2519 2519 2 -9.042778 -23.840050 -13.153131 # 2 -2520 2520 2 -9.864848 -23.840050 -12.331060 # 2 -2521 2521 2 -24.662121 -23.017979 -13.153131 # 2 -2522 2522 2 -23.840050 -22.195910 -13.153131 # 2 -2523 2523 2 -23.840050 -23.017979 -12.331060 # 2 -2524 2524 2 -24.662121 -22.195910 -12.331060 # 2 -2525 2525 2 -23.017979 -23.017979 -13.153131 # 2 -2526 2526 2 -22.195910 -22.195910 -13.153131 # 2 -2527 2527 2 -22.195910 -23.017979 -12.331060 # 2 -2528 2528 2 -23.017979 -22.195910 -12.331060 # 2 -2529 2529 2 -21.373838 -23.017979 -13.153131 # 2 -2530 2530 2 -20.551767 -22.195910 -13.153131 # 2 -2531 2531 2 -20.551767 -23.017979 -12.331060 # 2 -2532 2532 2 -21.373838 -22.195910 -12.331060 # 2 -2533 2533 2 -19.729696 -23.017979 -13.153131 # 2 -2534 2534 2 -18.907625 -22.195910 -13.153131 # 2 -2535 2535 2 -18.907625 -23.017979 -12.331060 # 2 -2536 2536 2 -19.729696 -22.195910 -12.331060 # 2 -2537 2537 2 -18.085556 -23.017979 -13.153131 # 2 -2538 2538 2 -17.263485 -22.195910 -13.153131 # 2 -2539 2539 2 -17.263485 -23.017979 -12.331060 # 2 -2540 2540 2 -18.085556 -22.195910 -12.331060 # 2 -2541 2541 2 -16.441414 -23.017979 -13.153131 # 2 -2542 2542 2 -15.619343 -22.195910 -13.153131 # 2 -2543 2543 2 -15.619343 -23.017979 -12.331060 # 2 -2544 2544 2 -16.441414 -22.195910 -12.331060 # 2 -2545 2545 2 -14.797273 -23.017979 -13.153131 # 2 -2546 2546 2 -13.975202 -22.195910 -13.153131 # 2 -2547 2547 2 -13.975202 -23.017979 -12.331060 # 2 -2548 2548 2 -14.797273 -22.195910 -12.331060 # 2 -2549 2549 2 -13.153131 -23.017979 -13.153131 # 2 -2550 2550 2 -12.331060 -22.195910 -13.153131 # 2 -2551 2551 2 -12.331060 -23.017979 -12.331060 # 2 -2552 2552 2 -13.153131 -22.195910 -12.331060 # 2 -2553 2553 2 -11.508989 -23.017979 -13.153131 # 2 -2554 2554 2 -10.686919 -22.195910 -13.153131 # 2 -2555 2555 2 -10.686919 -23.017979 -12.331060 # 2 -2556 2556 2 -11.508989 -22.195910 -12.331060 # 2 -2557 2557 2 -9.864848 -23.017979 -13.153131 # 2 -2558 2558 2 -9.042778 -22.195910 -13.153131 # 2 -2559 2559 2 -9.042778 -23.017979 -12.331060 # 2 -2560 2560 2 -9.864848 -22.195910 -12.331060 # 2 -2561 2561 2 -24.662121 -21.373838 -13.153131 # 2 -2562 2562 2 -23.840050 -20.551767 -13.153131 # 2 -2563 2563 2 -23.840050 -21.373838 -12.331060 # 2 -2564 2564 2 -24.662121 -20.551767 -12.331060 # 2 -2565 2565 2 -23.017979 -21.373838 -13.153131 # 2 -2566 2566 2 -22.195910 -20.551767 -13.153131 # 2 -2567 2567 2 -22.195910 -21.373838 -12.331060 # 2 -2568 2568 2 -23.017979 -20.551767 -12.331060 # 2 -2569 2569 2 -21.373838 -21.373838 -13.153131 # 2 -2570 2570 2 -20.551767 -20.551767 -13.153131 # 2 -2571 2571 2 -20.551767 -21.373838 -12.331060 # 2 -2572 2572 2 -21.373838 -20.551767 -12.331060 # 2 -2573 2573 2 -19.729696 -21.373838 -13.153131 # 2 -2574 2574 2 -18.907625 -20.551767 -13.153131 # 2 -2575 2575 2 -18.907625 -21.373838 -12.331060 # 2 -2576 2576 2 -19.729696 -20.551767 -12.331060 # 2 -2577 2577 2 -18.085556 -21.373838 -13.153131 # 2 -2578 2578 2 -17.263485 -20.551767 -13.153131 # 2 -2579 2579 2 -17.263485 -21.373838 -12.331060 # 2 -2580 2580 2 -18.085556 -20.551767 -12.331060 # 2 -2581 2581 2 -16.441414 -21.373838 -13.153131 # 2 -2582 2582 2 -15.619343 -20.551767 -13.153131 # 2 -2583 2583 2 -15.619343 -21.373838 -12.331060 # 2 -2584 2584 2 -16.441414 -20.551767 -12.331060 # 2 -2585 2585 2 -14.797273 -21.373838 -13.153131 # 2 -2586 2586 2 -13.975202 -20.551767 -13.153131 # 2 -2587 2587 2 -13.975202 -21.373838 -12.331060 # 2 -2588 2588 2 -14.797273 -20.551767 -12.331060 # 2 -2589 2589 2 -13.153131 -21.373838 -13.153131 # 2 -2590 2590 2 -12.331060 -20.551767 -13.153131 # 2 -2591 2591 2 -12.331060 -21.373838 -12.331060 # 2 -2592 2592 2 -13.153131 -20.551767 -12.331060 # 2 -2593 2593 2 -11.508989 -21.373838 -13.153131 # 2 -2594 2594 2 -10.686919 -20.551767 -13.153131 # 2 -2595 2595 2 -10.686919 -21.373838 -12.331060 # 2 -2596 2596 2 -11.508989 -20.551767 -12.331060 # 2 -2597 2597 2 -9.864848 -21.373838 -13.153131 # 2 -2598 2598 2 -9.042778 -20.551767 -13.153131 # 2 -2599 2599 2 -9.042778 -21.373838 -12.331060 # 2 -2600 2600 2 -9.864848 -20.551767 -12.331060 # 2 -2601 2601 2 -23.840050 -23.840050 -11.508989 # 2 -2602 2602 2 -24.662121 -23.840050 -10.686919 # 2 -2603 2603 2 -22.195910 -23.840050 -11.508989 # 2 -2604 2604 2 -23.017979 -23.840050 -10.686919 # 2 -2605 2605 2 -20.551767 -23.840050 -11.508989 # 2 -2606 2606 2 -21.373838 -23.840050 -10.686919 # 2 -2607 2607 2 -18.907625 -23.840050 -11.508989 # 2 -2608 2608 2 -19.729696 -23.840050 -10.686919 # 2 -2609 2609 2 -17.263485 -23.840050 -11.508989 # 2 -2610 2610 2 -18.085556 -23.840050 -10.686919 # 2 -2611 2611 2 -15.619343 -23.840050 -11.508989 # 2 -2612 2612 2 -16.441414 -23.840050 -10.686919 # 2 -2613 2613 2 -13.975202 -23.840050 -11.508989 # 2 -2614 2614 2 -14.797273 -23.840050 -10.686919 # 2 -2615 2615 2 -12.331060 -23.840050 -11.508989 # 2 -2616 2616 2 -13.153131 -23.840050 -10.686919 # 2 -2617 2617 2 -10.686919 -23.840050 -11.508989 # 2 -2618 2618 2 -11.508989 -23.840050 -10.686919 # 2 -2619 2619 2 -9.042778 -23.840050 -11.508989 # 2 -2620 2620 2 -9.864848 -23.840050 -10.686919 # 2 -2621 2621 2 -24.662121 -23.017979 -11.508989 # 2 -2622 2622 2 -23.840050 -22.195910 -11.508989 # 2 -2623 2623 2 -23.840050 -23.017979 -10.686919 # 2 -2624 2624 2 -24.662121 -22.195910 -10.686919 # 2 -2625 2625 2 -23.017979 -23.017979 -11.508989 # 2 -2626 2626 2 -22.195910 -22.195910 -11.508989 # 2 -2627 2627 2 -22.195910 -23.017979 -10.686919 # 2 -2628 2628 2 -23.017979 -22.195910 -10.686919 # 2 -2629 2629 2 -21.373838 -23.017979 -11.508989 # 2 -2630 2630 2 -20.551767 -22.195910 -11.508989 # 2 -2631 2631 2 -20.551767 -23.017979 -10.686919 # 2 -2632 2632 2 -21.373838 -22.195910 -10.686919 # 2 -2633 2633 2 -19.729696 -23.017979 -11.508989 # 2 -2634 2634 2 -18.907625 -22.195910 -11.508989 # 2 -2635 2635 2 -18.907625 -23.017979 -10.686919 # 2 -2636 2636 2 -19.729696 -22.195910 -10.686919 # 2 -2637 2637 2 -18.085556 -23.017979 -11.508989 # 2 -2638 2638 2 -17.263485 -22.195910 -11.508989 # 2 -2639 2639 2 -17.263485 -23.017979 -10.686919 # 2 -2640 2640 2 -18.085556 -22.195910 -10.686919 # 2 -2641 2641 2 -16.441414 -23.017979 -11.508989 # 2 -2642 2642 2 -15.619343 -22.195910 -11.508989 # 2 -2643 2643 2 -15.619343 -23.017979 -10.686919 # 2 -2644 2644 2 -16.441414 -22.195910 -10.686919 # 2 -2645 2645 2 -14.797273 -23.017979 -11.508989 # 2 -2646 2646 2 -13.975202 -22.195910 -11.508989 # 2 -2647 2647 2 -13.975202 -23.017979 -10.686919 # 2 -2648 2648 2 -14.797273 -22.195910 -10.686919 # 2 -2649 2649 2 -13.153131 -23.017979 -11.508989 # 2 -2650 2650 2 -12.331060 -22.195910 -11.508989 # 2 -2651 2651 2 -12.331060 -23.017979 -10.686919 # 2 -2652 2652 2 -13.153131 -22.195910 -10.686919 # 2 -2653 2653 2 -11.508989 -23.017979 -11.508989 # 2 -2654 2654 2 -10.686919 -22.195910 -11.508989 # 2 -2655 2655 2 -10.686919 -23.017979 -10.686919 # 2 -2656 2656 2 -11.508989 -22.195910 -10.686919 # 2 -2657 2657 2 -9.864848 -23.017979 -11.508989 # 2 -2658 2658 2 -9.042778 -22.195910 -11.508989 # 2 -2659 2659 2 -9.042778 -23.017979 -10.686919 # 2 -2660 2660 2 -9.864848 -22.195910 -10.686919 # 2 -2661 2661 2 -24.662121 -21.373838 -11.508989 # 2 -2662 2662 2 -23.840050 -20.551767 -11.508989 # 2 -2663 2663 2 -23.840050 -21.373838 -10.686919 # 2 -2664 2664 2 -24.662121 -20.551767 -10.686919 # 2 -2665 2665 2 -23.017979 -21.373838 -11.508989 # 2 -2666 2666 2 -22.195910 -20.551767 -11.508989 # 2 -2667 2667 2 -22.195910 -21.373838 -10.686919 # 2 -2668 2668 2 -23.017979 -20.551767 -10.686919 # 2 -2669 2669 2 -21.373838 -21.373838 -11.508989 # 2 -2670 2670 2 -20.551767 -20.551767 -11.508989 # 2 -2671 2671 2 -20.551767 -21.373838 -10.686919 # 2 -2672 2672 2 -21.373838 -20.551767 -10.686919 # 2 -2673 2673 2 -19.729696 -21.373838 -11.508989 # 2 -2674 2674 2 -18.907625 -20.551767 -11.508989 # 2 -2675 2675 2 -18.907625 -21.373838 -10.686919 # 2 -2676 2676 2 -19.729696 -20.551767 -10.686919 # 2 -2677 2677 2 -18.085556 -21.373838 -11.508989 # 2 -2678 2678 2 -17.263485 -20.551767 -11.508989 # 2 -2679 2679 2 -17.263485 -21.373838 -10.686919 # 2 -2680 2680 2 -18.085556 -20.551767 -10.686919 # 2 -2681 2681 2 -16.441414 -21.373838 -11.508989 # 2 -2682 2682 2 -15.619343 -20.551767 -11.508989 # 2 -2683 2683 2 -15.619343 -21.373838 -10.686919 # 2 -2684 2684 2 -16.441414 -20.551767 -10.686919 # 2 -2685 2685 2 -14.797273 -21.373838 -11.508989 # 2 -2686 2686 2 -13.975202 -20.551767 -11.508989 # 2 -2687 2687 2 -13.975202 -21.373838 -10.686919 # 2 -2688 2688 2 -14.797273 -20.551767 -10.686919 # 2 -2689 2689 2 -13.153131 -21.373838 -11.508989 # 2 -2690 2690 2 -12.331060 -20.551767 -11.508989 # 2 -2691 2691 2 -12.331060 -21.373838 -10.686919 # 2 -2692 2692 2 -13.153131 -20.551767 -10.686919 # 2 -2693 2693 2 -11.508989 -21.373838 -11.508989 # 2 -2694 2694 2 -10.686919 -20.551767 -11.508989 # 2 -2695 2695 2 -10.686919 -21.373838 -10.686919 # 2 -2696 2696 2 -11.508989 -20.551767 -10.686919 # 2 -2697 2697 2 -9.864848 -21.373838 -11.508989 # 2 -2698 2698 2 -9.042778 -20.551767 -11.508989 # 2 -2699 2699 2 -9.042778 -21.373838 -10.686919 # 2 -2700 2700 2 -9.864848 -20.551767 -10.686919 # 2 -2701 2701 2 -23.840050 -23.840050 -9.864848 # 2 -2702 2702 2 -24.662121 -23.840050 -9.042778 # 2 -2703 2703 2 -22.195910 -23.840050 -9.864848 # 2 -2704 2704 2 -23.017979 -23.840050 -9.042778 # 2 -2705 2705 2 -20.551767 -23.840050 -9.864848 # 2 -2706 2706 2 -21.373838 -23.840050 -9.042778 # 2 -2707 2707 2 -18.907625 -23.840050 -9.864848 # 2 -2708 2708 2 -19.729696 -23.840050 -9.042778 # 2 -2709 2709 2 -17.263485 -23.840050 -9.864848 # 2 -2710 2710 2 -18.085556 -23.840050 -9.042778 # 2 -2711 2711 2 -15.619343 -23.840050 -9.864848 # 2 -2712 2712 2 -16.441414 -23.840050 -9.042778 # 2 -2713 2713 2 -13.975202 -23.840050 -9.864848 # 2 -2714 2714 2 -14.797273 -23.840050 -9.042778 # 2 -2715 2715 2 -12.331060 -23.840050 -9.864848 # 2 -2716 2716 2 -13.153131 -23.840050 -9.042778 # 2 -2717 2717 2 -10.686919 -23.840050 -9.864848 # 2 -2718 2718 2 -11.508989 -23.840050 -9.042778 # 2 -2719 2719 2 -9.042778 -23.840050 -9.864848 # 2 -2720 2720 2 -9.864848 -23.840050 -9.042778 # 2 -2721 2721 2 -24.662121 -23.017979 -9.864848 # 2 -2722 2722 2 -23.840050 -22.195910 -9.864848 # 2 -2723 2723 2 -23.840050 -23.017979 -9.042778 # 2 -2724 2724 2 -24.662121 -22.195910 -9.042778 # 2 -2725 2725 2 -23.017979 -23.017979 -9.864848 # 2 -2726 2726 2 -22.195910 -22.195910 -9.864848 # 2 -2727 2727 2 -22.195910 -23.017979 -9.042778 # 2 -2728 2728 2 -23.017979 -22.195910 -9.042778 # 2 -2729 2729 2 -21.373838 -23.017979 -9.864848 # 2 -2730 2730 2 -20.551767 -22.195910 -9.864848 # 2 -2731 2731 2 -20.551767 -23.017979 -9.042778 # 2 -2732 2732 2 -21.373838 -22.195910 -9.042778 # 2 -2733 2733 2 -19.729696 -23.017979 -9.864848 # 2 -2734 2734 2 -18.907625 -22.195910 -9.864848 # 2 -2735 2735 2 -18.907625 -23.017979 -9.042778 # 2 -2736 2736 2 -19.729696 -22.195910 -9.042778 # 2 -2737 2737 2 -18.085556 -23.017979 -9.864848 # 2 -2738 2738 2 -17.263485 -22.195910 -9.864848 # 2 -2739 2739 2 -17.263485 -23.017979 -9.042778 # 2 -2740 2740 2 -18.085556 -22.195910 -9.042778 # 2 -2741 2741 2 -16.441414 -23.017979 -9.864848 # 2 -2742 2742 2 -15.619343 -22.195910 -9.864848 # 2 -2743 2743 2 -15.619343 -23.017979 -9.042778 # 2 -2744 2744 2 -16.441414 -22.195910 -9.042778 # 2 -2745 2745 2 -14.797273 -23.017979 -9.864848 # 2 -2746 2746 2 -13.975202 -22.195910 -9.864848 # 2 -2747 2747 2 -13.975202 -23.017979 -9.042778 # 2 -2748 2748 2 -14.797273 -22.195910 -9.042778 # 2 -2749 2749 2 -13.153131 -23.017979 -9.864848 # 2 -2750 2750 2 -12.331060 -22.195910 -9.864848 # 2 -2751 2751 2 -12.331060 -23.017979 -9.042778 # 2 -2752 2752 2 -13.153131 -22.195910 -9.042778 # 2 -2753 2753 2 -11.508989 -23.017979 -9.864848 # 2 -2754 2754 2 -10.686919 -22.195910 -9.864848 # 2 -2755 2755 2 -10.686919 -23.017979 -9.042778 # 2 -2756 2756 2 -11.508989 -22.195910 -9.042778 # 2 -2757 2757 2 -9.864848 -23.017979 -9.864848 # 2 -2758 2758 2 -9.042778 -22.195910 -9.864848 # 2 -2759 2759 2 -9.042778 -23.017979 -9.042778 # 2 -2760 2760 2 -9.864848 -22.195910 -9.042778 # 2 -2761 2761 2 -24.662121 -21.373838 -9.864848 # 2 -2762 2762 2 -23.840050 -20.551767 -9.864848 # 2 -2763 2763 2 -23.840050 -21.373838 -9.042778 # 2 -2764 2764 2 -24.662121 -20.551767 -9.042778 # 2 -2765 2765 2 -23.017979 -21.373838 -9.864848 # 2 -2766 2766 2 -22.195910 -20.551767 -9.864848 # 2 -2767 2767 2 -22.195910 -21.373838 -9.042778 # 2 -2768 2768 2 -23.017979 -20.551767 -9.042778 # 2 -2769 2769 2 -21.373838 -21.373838 -9.864848 # 2 -2770 2770 2 -20.551767 -20.551767 -9.864848 # 2 -2771 2771 2 -20.551767 -21.373838 -9.042778 # 2 -2772 2772 2 -21.373838 -20.551767 -9.042778 # 2 -2773 2773 2 -19.729696 -21.373838 -9.864848 # 2 -2774 2774 2 -18.907625 -20.551767 -9.864848 # 2 -2775 2775 2 -18.907625 -21.373838 -9.042778 # 2 -2776 2776 2 -19.729696 -20.551767 -9.042778 # 2 -2777 2777 2 -18.085556 -21.373838 -9.864848 # 2 -2778 2778 2 -17.263485 -20.551767 -9.864848 # 2 -2779 2779 2 -17.263485 -21.373838 -9.042778 # 2 -2780 2780 2 -18.085556 -20.551767 -9.042778 # 2 -2781 2781 2 -16.441414 -21.373838 -9.864848 # 2 -2782 2782 2 -15.619343 -20.551767 -9.864848 # 2 -2783 2783 2 -15.619343 -21.373838 -9.042778 # 2 -2784 2784 2 -16.441414 -20.551767 -9.042778 # 2 -2785 2785 2 -14.797273 -21.373838 -9.864848 # 2 -2786 2786 2 -13.975202 -20.551767 -9.864848 # 2 -2787 2787 2 -13.975202 -21.373838 -9.042778 # 2 -2788 2788 2 -14.797273 -20.551767 -9.042778 # 2 -2789 2789 2 -13.153131 -21.373838 -9.864848 # 2 -2790 2790 2 -12.331060 -20.551767 -9.864848 # 2 -2791 2791 2 -12.331060 -21.373838 -9.042778 # 2 -2792 2792 2 -13.153131 -20.551767 -9.042778 # 2 -2793 2793 2 -11.508989 -21.373838 -9.864848 # 2 -2794 2794 2 -10.686919 -20.551767 -9.864848 # 2 -2795 2795 2 -10.686919 -21.373838 -9.042778 # 2 -2796 2796 2 -11.508989 -20.551767 -9.042778 # 2 -2797 2797 2 -9.864848 -21.373838 -9.864848 # 2 -2798 2798 2 -9.042778 -20.551767 -9.864848 # 2 -2799 2799 2 -9.042778 -21.373838 -9.042778 # 2 -2800 2800 2 -9.864848 -20.551767 -9.042778 # 2 -2801 2801 2 -23.840050 -23.840050 -8.220707 # 2 -2802 2802 2 -22.195910 -23.840050 -8.220707 # 2 -2803 2803 2 -20.551767 -23.840050 -8.220707 # 2 -2804 2804 2 -18.907625 -23.840050 -8.220707 # 2 -2805 2805 2 -17.263485 -23.840050 -8.220707 # 2 -2806 2806 2 -15.619343 -23.840050 -8.220707 # 2 -2807 2807 2 -13.975202 -23.840050 -8.220707 # 2 -2808 2808 2 -12.331060 -23.840050 -8.220707 # 2 -2809 2809 2 -10.686919 -23.840050 -8.220707 # 2 -2810 2810 2 -9.042778 -23.840050 -8.220707 # 2 -2811 2811 2 -24.662121 -23.017979 -8.220707 # 2 -2812 2812 2 -23.840050 -22.195910 -8.220707 # 2 -2813 2813 2 -23.017979 -23.017979 -8.220707 # 2 -2814 2814 2 -22.195910 -22.195910 -8.220707 # 2 -2815 2815 2 -21.373838 -23.017979 -8.220707 # 2 -2816 2816 2 -20.551767 -22.195910 -8.220707 # 2 -2817 2817 2 -19.729696 -23.017979 -8.220707 # 2 -2818 2818 2 -18.907625 -22.195910 -8.220707 # 2 -2819 2819 2 -18.085556 -23.017979 -8.220707 # 2 -2820 2820 2 -17.263485 -22.195910 -8.220707 # 2 -2821 2821 2 -16.441414 -23.017979 -8.220707 # 2 -2822 2822 2 -15.619343 -22.195910 -8.220707 # 2 -2823 2823 2 -14.797273 -23.017979 -8.220707 # 2 -2824 2824 2 -13.975202 -22.195910 -8.220707 # 2 -2825 2825 2 -13.153131 -23.017979 -8.220707 # 2 -2826 2826 2 -12.331060 -22.195910 -8.220707 # 2 -2827 2827 2 -11.508989 -23.017979 -8.220707 # 2 -2828 2828 2 -10.686919 -22.195910 -8.220707 # 2 -2829 2829 2 -9.864848 -23.017979 -8.220707 # 2 -2830 2830 2 -9.042778 -22.195910 -8.220707 # 2 -2831 2831 2 -24.662121 -21.373838 -8.220707 # 2 -2832 2832 2 -23.840050 -20.551767 -8.220707 # 2 -2833 2833 2 -23.017979 -21.373838 -8.220707 # 2 -2834 2834 2 -22.195910 -20.551767 -8.220707 # 2 -2835 2835 2 -21.373838 -21.373838 -8.220707 # 2 -2836 2836 2 -20.551767 -20.551767 -8.220707 # 2 -2837 2837 2 -19.729696 -21.373838 -8.220707 # 2 -2838 2838 2 -18.907625 -20.551767 -8.220707 # 2 -2839 2839 2 -18.085556 -21.373838 -8.220707 # 2 -2840 2840 2 -17.263485 -20.551767 -8.220707 # 2 -2841 2841 2 -16.441414 -21.373838 -8.220707 # 2 -2842 2842 2 -15.619343 -20.551767 -8.220707 # 2 -2843 2843 2 -14.797273 -21.373838 -8.220707 # 2 -2844 2844 2 -13.975202 -20.551767 -8.220707 # 2 -2845 2845 2 -13.153131 -21.373838 -8.220707 # 2 -2846 2846 2 -12.331060 -20.551767 -8.220707 # 2 -2847 2847 2 -11.508989 -21.373838 -8.220707 # 2 -2848 2848 2 -10.686919 -20.551767 -8.220707 # 2 -2849 2849 2 -9.864848 -21.373838 -8.220707 # 2 -2850 2850 2 -9.042778 -20.551767 -8.220707 # 2 -2851 2851 2 -7.398636 -23.840050 -24.662121 # 2 -2852 2852 2 -8.220707 -23.840050 -23.840050 # 2 -2853 2853 2 -5.754495 -23.840050 -24.662121 # 2 -2854 2854 2 -6.576566 -23.840050 -23.840050 # 2 -2855 2855 2 -4.110353 -23.840050 -24.662121 # 2 -2856 2856 2 -4.932424 -23.840050 -23.840050 # 2 -2857 2857 2 -2.466212 -23.840050 -24.662121 # 2 -2858 2858 2 -3.288283 -23.840050 -23.840050 # 2 -2859 2859 2 -0.822071 -23.840050 -24.662121 # 2 -2860 2860 2 -1.644141 -23.840050 -23.840050 # 2 -2861 2861 2 0.822071 -23.840050 -24.662121 # 2 -2862 2862 2 0.000000 -23.840050 -23.840050 # 2 -2863 2863 2 2.466212 -23.840050 -24.662121 # 2 -2864 2864 2 1.644141 -23.840050 -23.840050 # 2 -2865 2865 2 4.110353 -23.840050 -24.662121 # 2 -2866 2866 2 3.288283 -23.840050 -23.840050 # 2 -2867 2867 2 5.754495 -23.840050 -24.662121 # 2 -2868 2868 2 4.932424 -23.840050 -23.840050 # 2 -2869 2869 2 7.398636 -23.840050 -24.662121 # 2 -2870 2870 2 6.576566 -23.840050 -23.840050 # 2 -2871 2871 2 8.220707 -23.840050 -23.840050 # 2 -2872 2872 2 -8.220707 -23.017979 -24.662121 # 2 -2873 2873 2 -7.398636 -22.195910 -24.662121 # 2 -2874 2874 2 -7.398636 -23.017979 -23.840050 # 2 -2875 2875 2 -8.220707 -22.195910 -23.840050 # 2 -2876 2876 2 -6.576566 -23.017979 -24.662121 # 2 -2877 2877 2 -5.754495 -22.195910 -24.662121 # 2 -2878 2878 2 -5.754495 -23.017979 -23.840050 # 2 -2879 2879 2 -6.576566 -22.195910 -23.840050 # 2 -2880 2880 2 -4.932424 -23.017979 -24.662121 # 2 -2881 2881 2 -4.110353 -22.195910 -24.662121 # 2 -2882 2882 2 -4.110353 -23.017979 -23.840050 # 2 -2883 2883 2 -4.932424 -22.195910 -23.840050 # 2 -2884 2884 2 -3.288283 -23.017979 -24.662121 # 2 -2885 2885 2 -2.466212 -22.195910 -24.662121 # 2 -2886 2886 2 -2.466212 -23.017979 -23.840050 # 2 -2887 2887 2 -3.288283 -22.195910 -23.840050 # 2 -2888 2888 2 -1.644141 -23.017979 -24.662121 # 2 -2889 2889 2 -0.822071 -22.195910 -24.662121 # 2 -2890 2890 2 -0.822071 -23.017979 -23.840050 # 2 -2891 2891 2 -1.644141 -22.195910 -23.840050 # 2 -2892 2892 2 0.000000 -23.017979 -24.662121 # 2 -2893 2893 2 0.822071 -22.195910 -24.662121 # 2 -2894 2894 2 0.822071 -23.017979 -23.840050 # 2 -2895 2895 2 0.000000 -22.195910 -23.840050 # 2 -2896 2896 2 1.644141 -23.017979 -24.662121 # 2 -2897 2897 2 2.466212 -22.195910 -24.662121 # 2 -2898 2898 2 2.466212 -23.017979 -23.840050 # 2 -2899 2899 2 1.644141 -22.195910 -23.840050 # 2 -2900 2900 2 3.288283 -23.017979 -24.662121 # 2 -2901 2901 2 4.110353 -22.195910 -24.662121 # 2 -2902 2902 2 4.110353 -23.017979 -23.840050 # 2 -2903 2903 2 3.288283 -22.195910 -23.840050 # 2 -2904 2904 2 4.932424 -23.017979 -24.662121 # 2 -2905 2905 2 5.754495 -22.195910 -24.662121 # 2 -2906 2906 2 5.754495 -23.017979 -23.840050 # 2 -2907 2907 2 4.932424 -22.195910 -23.840050 # 2 -2908 2908 2 6.576566 -23.017979 -24.662121 # 2 -2909 2909 2 7.398636 -22.195910 -24.662121 # 2 -2910 2910 2 7.398636 -23.017979 -23.840050 # 2 -2911 2911 2 6.576566 -22.195910 -23.840050 # 2 -2912 2912 2 8.220707 -23.017979 -24.662121 # 2 -2913 2913 2 8.220707 -22.195910 -23.840050 # 2 -2914 2914 2 -8.220707 -21.373838 -24.662121 # 2 -2915 2915 2 -7.398636 -20.551767 -24.662121 # 2 -2916 2916 2 -7.398636 -21.373838 -23.840050 # 2 -2917 2917 2 -8.220707 -20.551767 -23.840050 # 2 -2918 2918 2 -6.576566 -21.373838 -24.662121 # 2 -2919 2919 2 -5.754495 -20.551767 -24.662121 # 2 -2920 2920 2 -5.754495 -21.373838 -23.840050 # 2 -2921 2921 2 -6.576566 -20.551767 -23.840050 # 2 -2922 2922 2 -4.932424 -21.373838 -24.662121 # 2 -2923 2923 2 -4.110353 -20.551767 -24.662121 # 2 -2924 2924 2 -4.110353 -21.373838 -23.840050 # 2 -2925 2925 2 -4.932424 -20.551767 -23.840050 # 2 -2926 2926 2 -3.288283 -21.373838 -24.662121 # 2 -2927 2927 2 -2.466212 -20.551767 -24.662121 # 2 -2928 2928 2 -2.466212 -21.373838 -23.840050 # 2 -2929 2929 2 -3.288283 -20.551767 -23.840050 # 2 -2930 2930 2 -1.644141 -21.373838 -24.662121 # 2 -2931 2931 2 -0.822071 -20.551767 -24.662121 # 2 -2932 2932 2 -0.822071 -21.373838 -23.840050 # 2 -2933 2933 2 -1.644141 -20.551767 -23.840050 # 2 -2934 2934 2 0.000000 -21.373838 -24.662121 # 2 -2935 2935 2 0.822071 -20.551767 -24.662121 # 2 -2936 2936 2 0.822071 -21.373838 -23.840050 # 2 -2937 2937 2 0.000000 -20.551767 -23.840050 # 2 -2938 2938 2 1.644141 -21.373838 -24.662121 # 2 -2939 2939 2 2.466212 -20.551767 -24.662121 # 2 -2940 2940 2 2.466212 -21.373838 -23.840050 # 2 -2941 2941 2 1.644141 -20.551767 -23.840050 # 2 -2942 2942 2 3.288283 -21.373838 -24.662121 # 2 -2943 2943 2 4.110353 -20.551767 -24.662121 # 2 -2944 2944 2 4.110353 -21.373838 -23.840050 # 2 -2945 2945 2 3.288283 -20.551767 -23.840050 # 2 -2946 2946 2 4.932424 -21.373838 -24.662121 # 2 -2947 2947 2 5.754495 -20.551767 -24.662121 # 2 -2948 2948 2 5.754495 -21.373838 -23.840050 # 2 -2949 2949 2 4.932424 -20.551767 -23.840050 # 2 -2950 2950 2 6.576566 -21.373838 -24.662121 # 2 -2951 2951 2 7.398636 -20.551767 -24.662121 # 2 -2952 2952 2 7.398636 -21.373838 -23.840050 # 2 -2953 2953 2 6.576566 -20.551767 -23.840050 # 2 -2954 2954 2 8.220707 -21.373838 -24.662121 # 2 -2955 2955 2 8.220707 -20.551767 -23.840050 # 2 -2956 2956 2 -7.398636 -23.840050 -23.017979 # 2 -2957 2957 2 -8.220707 -23.840050 -22.195910 # 2 -2958 2958 2 -5.754495 -23.840050 -23.017979 # 2 -2959 2959 2 -6.576566 -23.840050 -22.195910 # 2 -2960 2960 2 -4.110353 -23.840050 -23.017979 # 2 -2961 2961 2 -4.932424 -23.840050 -22.195910 # 2 -2962 2962 2 -2.466212 -23.840050 -23.017979 # 2 -2963 2963 2 -3.288283 -23.840050 -22.195910 # 2 -2964 2964 2 -0.822071 -23.840050 -23.017979 # 2 -2965 2965 2 -1.644141 -23.840050 -22.195910 # 2 -2966 2966 2 0.822071 -23.840050 -23.017979 # 2 -2967 2967 2 0.000000 -23.840050 -22.195910 # 2 -2968 2968 2 2.466212 -23.840050 -23.017979 # 2 -2969 2969 2 1.644141 -23.840050 -22.195910 # 2 -2970 2970 2 4.110353 -23.840050 -23.017979 # 2 -2971 2971 2 3.288283 -23.840050 -22.195910 # 2 -2972 2972 2 5.754495 -23.840050 -23.017979 # 2 -2973 2973 2 4.932424 -23.840050 -22.195910 # 2 -2974 2974 2 7.398636 -23.840050 -23.017979 # 2 -2975 2975 2 6.576566 -23.840050 -22.195910 # 2 -2976 2976 2 8.220707 -23.840050 -22.195910 # 2 -2977 2977 2 -8.220707 -23.017979 -23.017979 # 2 -2978 2978 2 -7.398636 -22.195910 -23.017979 # 2 -2979 2979 2 -7.398636 -23.017979 -22.195910 # 2 -2980 2980 2 -8.220707 -22.195910 -22.195910 # 2 -2981 2981 2 -6.576566 -23.017979 -23.017979 # 2 -2982 2982 2 -5.754495 -22.195910 -23.017979 # 2 -2983 2983 2 -5.754495 -23.017979 -22.195910 # 2 -2984 2984 2 -6.576566 -22.195910 -22.195910 # 2 -2985 2985 2 -4.932424 -23.017979 -23.017979 # 2 -2986 2986 2 -4.110353 -22.195910 -23.017979 # 2 -2987 2987 2 -4.110353 -23.017979 -22.195910 # 2 -2988 2988 2 -4.932424 -22.195910 -22.195910 # 2 -2989 2989 2 -3.288283 -23.017979 -23.017979 # 2 -2990 2990 2 -2.466212 -22.195910 -23.017979 # 2 -2991 2991 2 -2.466212 -23.017979 -22.195910 # 2 -2992 2992 2 -3.288283 -22.195910 -22.195910 # 2 -2993 2993 2 -1.644141 -23.017979 -23.017979 # 2 -2994 2994 2 -0.822071 -22.195910 -23.017979 # 2 -2995 2995 2 -0.822071 -23.017979 -22.195910 # 2 -2996 2996 2 -1.644141 -22.195910 -22.195910 # 2 -2997 2997 2 0.000000 -23.017979 -23.017979 # 2 -2998 2998 2 0.822071 -22.195910 -23.017979 # 2 -2999 2999 2 0.822071 -23.017979 -22.195910 # 2 -3000 3000 2 0.000000 -22.195910 -22.195910 # 2 -3001 3001 2 1.644141 -23.017979 -23.017979 # 2 -3002 3002 2 2.466212 -22.195910 -23.017979 # 2 -3003 3003 2 2.466212 -23.017979 -22.195910 # 2 -3004 3004 2 1.644141 -22.195910 -22.195910 # 2 -3005 3005 2 3.288283 -23.017979 -23.017979 # 2 -3006 3006 2 4.110353 -22.195910 -23.017979 # 2 -3007 3007 2 4.110353 -23.017979 -22.195910 # 2 -3008 3008 2 3.288283 -22.195910 -22.195910 # 2 -3009 3009 2 4.932424 -23.017979 -23.017979 # 2 -3010 3010 2 5.754495 -22.195910 -23.017979 # 2 -3011 3011 2 5.754495 -23.017979 -22.195910 # 2 -3012 3012 2 4.932424 -22.195910 -22.195910 # 2 -3013 3013 2 6.576566 -23.017979 -23.017979 # 2 -3014 3014 2 7.398636 -22.195910 -23.017979 # 2 -3015 3015 2 7.398636 -23.017979 -22.195910 # 2 -3016 3016 2 6.576566 -22.195910 -22.195910 # 2 -3017 3017 2 8.220707 -23.017979 -23.017979 # 2 -3018 3018 2 8.220707 -22.195910 -22.195910 # 2 -3019 3019 2 -8.220707 -21.373838 -23.017979 # 2 -3020 3020 2 -7.398636 -20.551767 -23.017979 # 2 -3021 3021 2 -7.398636 -21.373838 -22.195910 # 2 -3022 3022 2 -8.220707 -20.551767 -22.195910 # 2 -3023 3023 2 -6.576566 -21.373838 -23.017979 # 2 -3024 3024 2 -5.754495 -20.551767 -23.017979 # 2 -3025 3025 2 -5.754495 -21.373838 -22.195910 # 2 -3026 3026 2 -6.576566 -20.551767 -22.195910 # 2 -3027 3027 2 -4.932424 -21.373838 -23.017979 # 2 -3028 3028 2 -4.110353 -20.551767 -23.017979 # 2 -3029 3029 2 -4.110353 -21.373838 -22.195910 # 2 -3030 3030 2 -4.932424 -20.551767 -22.195910 # 2 -3031 3031 2 -3.288283 -21.373838 -23.017979 # 2 -3032 3032 2 -2.466212 -20.551767 -23.017979 # 2 -3033 3033 2 -2.466212 -21.373838 -22.195910 # 2 -3034 3034 2 -3.288283 -20.551767 -22.195910 # 2 -3035 3035 2 -1.644141 -21.373838 -23.017979 # 2 -3036 3036 2 -0.822071 -20.551767 -23.017979 # 2 -3037 3037 2 -0.822071 -21.373838 -22.195910 # 2 -3038 3038 2 -1.644141 -20.551767 -22.195910 # 2 -3039 3039 2 0.000000 -21.373838 -23.017979 # 2 -3040 3040 2 0.822071 -20.551767 -23.017979 # 2 -3041 3041 2 0.822071 -21.373838 -22.195910 # 2 -3042 3042 2 0.000000 -20.551767 -22.195910 # 2 -3043 3043 2 1.644141 -21.373838 -23.017979 # 2 -3044 3044 2 2.466212 -20.551767 -23.017979 # 2 -3045 3045 2 2.466212 -21.373838 -22.195910 # 2 -3046 3046 2 1.644141 -20.551767 -22.195910 # 2 -3047 3047 2 3.288283 -21.373838 -23.017979 # 2 -3048 3048 2 4.110353 -20.551767 -23.017979 # 2 -3049 3049 2 4.110353 -21.373838 -22.195910 # 2 -3050 3050 2 3.288283 -20.551767 -22.195910 # 2 -3051 3051 2 4.932424 -21.373838 -23.017979 # 2 -3052 3052 2 5.754495 -20.551767 -23.017979 # 2 -3053 3053 2 5.754495 -21.373838 -22.195910 # 2 -3054 3054 2 4.932424 -20.551767 -22.195910 # 2 -3055 3055 2 6.576566 -21.373838 -23.017979 # 2 -3056 3056 2 7.398636 -20.551767 -23.017979 # 2 -3057 3057 2 7.398636 -21.373838 -22.195910 # 2 -3058 3058 2 6.576566 -20.551767 -22.195910 # 2 -3059 3059 2 8.220707 -21.373838 -23.017979 # 2 -3060 3060 2 8.220707 -20.551767 -22.195910 # 2 -3061 3061 2 -7.398636 -23.840050 -21.373838 # 2 -3062 3062 2 -8.220707 -23.840050 -20.551767 # 2 -3063 3063 2 -5.754495 -23.840050 -21.373838 # 2 -3064 3064 2 -6.576566 -23.840050 -20.551767 # 2 -3065 3065 2 -4.110353 -23.840050 -21.373838 # 2 -3066 3066 2 -4.932424 -23.840050 -20.551767 # 2 -3067 3067 2 -2.466212 -23.840050 -21.373838 # 2 -3068 3068 2 -3.288283 -23.840050 -20.551767 # 2 -3069 3069 2 -0.822071 -23.840050 -21.373838 # 2 -3070 3070 2 -1.644141 -23.840050 -20.551767 # 2 -3071 3071 2 0.822071 -23.840050 -21.373838 # 2 -3072 3072 2 0.000000 -23.840050 -20.551767 # 2 -3073 3073 2 2.466212 -23.840050 -21.373838 # 2 -3074 3074 2 1.644141 -23.840050 -20.551767 # 2 -3075 3075 2 4.110353 -23.840050 -21.373838 # 2 -3076 3076 2 3.288283 -23.840050 -20.551767 # 2 -3077 3077 2 5.754495 -23.840050 -21.373838 # 2 -3078 3078 2 4.932424 -23.840050 -20.551767 # 2 -3079 3079 2 7.398636 -23.840050 -21.373838 # 2 -3080 3080 2 6.576566 -23.840050 -20.551767 # 2 -3081 3081 2 8.220707 -23.840050 -20.551767 # 2 -3082 3082 2 -8.220707 -23.017979 -21.373838 # 2 -3083 3083 2 -7.398636 -22.195910 -21.373838 # 2 -3084 3084 2 -7.398636 -23.017979 -20.551767 # 2 -3085 3085 2 -8.220707 -22.195910 -20.551767 # 2 -3086 3086 2 -6.576566 -23.017979 -21.373838 # 2 -3087 3087 2 -5.754495 -22.195910 -21.373838 # 2 -3088 3088 2 -5.754495 -23.017979 -20.551767 # 2 -3089 3089 2 -6.576566 -22.195910 -20.551767 # 2 -3090 3090 2 -4.932424 -23.017979 -21.373838 # 2 -3091 3091 2 -4.110353 -22.195910 -21.373838 # 2 -3092 3092 2 -4.110353 -23.017979 -20.551767 # 2 -3093 3093 2 -4.932424 -22.195910 -20.551767 # 2 -3094 3094 2 -3.288283 -23.017979 -21.373838 # 2 -3095 3095 2 -2.466212 -22.195910 -21.373838 # 2 -3096 3096 2 -2.466212 -23.017979 -20.551767 # 2 -3097 3097 2 -3.288283 -22.195910 -20.551767 # 2 -3098 3098 2 -1.644141 -23.017979 -21.373838 # 2 -3099 3099 2 -0.822071 -22.195910 -21.373838 # 2 -3100 3100 2 -0.822071 -23.017979 -20.551767 # 2 -3101 3101 2 -1.644141 -22.195910 -20.551767 # 2 -3102 3102 2 0.000000 -23.017979 -21.373838 # 2 -3103 3103 2 0.822071 -22.195910 -21.373838 # 2 -3104 3104 2 0.822071 -23.017979 -20.551767 # 2 -3105 3105 2 0.000000 -22.195910 -20.551767 # 2 -3106 3106 2 1.644141 -23.017979 -21.373838 # 2 -3107 3107 2 2.466212 -22.195910 -21.373838 # 2 -3108 3108 2 2.466212 -23.017979 -20.551767 # 2 -3109 3109 2 1.644141 -22.195910 -20.551767 # 2 -3110 3110 2 3.288283 -23.017979 -21.373838 # 2 -3111 3111 2 4.110353 -22.195910 -21.373838 # 2 -3112 3112 2 4.110353 -23.017979 -20.551767 # 2 -3113 3113 2 3.288283 -22.195910 -20.551767 # 2 -3114 3114 2 4.932424 -23.017979 -21.373838 # 2 -3115 3115 2 5.754495 -22.195910 -21.373838 # 2 -3116 3116 2 5.754495 -23.017979 -20.551767 # 2 -3117 3117 2 4.932424 -22.195910 -20.551767 # 2 -3118 3118 2 6.576566 -23.017979 -21.373838 # 2 -3119 3119 2 7.398636 -22.195910 -21.373838 # 2 -3120 3120 2 7.398636 -23.017979 -20.551767 # 2 -3121 3121 2 6.576566 -22.195910 -20.551767 # 2 -3122 3122 2 8.220707 -23.017979 -21.373838 # 2 -3123 3123 2 8.220707 -22.195910 -20.551767 # 2 -3124 3124 2 -8.220707 -21.373838 -21.373838 # 2 -3125 3125 2 -7.398636 -20.551767 -21.373838 # 2 -3126 3126 2 -7.398636 -21.373838 -20.551767 # 2 -3127 3127 2 -8.220707 -20.551767 -20.551767 # 2 -3128 3128 2 -6.576566 -21.373838 -21.373838 # 2 -3129 3129 2 -5.754495 -20.551767 -21.373838 # 2 -3130 3130 2 -5.754495 -21.373838 -20.551767 # 2 -3131 3131 2 -6.576566 -20.551767 -20.551767 # 2 -3132 3132 2 -4.932424 -21.373838 -21.373838 # 2 -3133 3133 2 -4.110353 -20.551767 -21.373838 # 2 -3134 3134 2 -4.110353 -21.373838 -20.551767 # 2 -3135 3135 2 -4.932424 -20.551767 -20.551767 # 2 -3136 3136 2 -3.288283 -21.373838 -21.373838 # 2 -3137 3137 2 -2.466212 -20.551767 -21.373838 # 2 -3138 3138 2 -2.466212 -21.373838 -20.551767 # 2 -3139 3139 2 -3.288283 -20.551767 -20.551767 # 2 -3140 3140 2 -1.644141 -21.373838 -21.373838 # 2 -3141 3141 2 -0.822071 -20.551767 -21.373838 # 2 -3142 3142 2 -0.822071 -21.373838 -20.551767 # 2 -3143 3143 2 -1.644141 -20.551767 -20.551767 # 2 -3144 3144 2 0.000000 -21.373838 -21.373838 # 2 -3145 3145 2 0.822071 -20.551767 -21.373838 # 2 -3146 3146 2 0.822071 -21.373838 -20.551767 # 2 -3147 3147 2 0.000000 -20.551767 -20.551767 # 2 -3148 3148 2 1.644141 -21.373838 -21.373838 # 2 -3149 3149 2 2.466212 -20.551767 -21.373838 # 2 -3150 3150 2 2.466212 -21.373838 -20.551767 # 2 -3151 3151 2 1.644141 -20.551767 -20.551767 # 2 -3152 3152 2 3.288283 -21.373838 -21.373838 # 2 -3153 3153 2 4.110353 -20.551767 -21.373838 # 2 -3154 3154 2 4.110353 -21.373838 -20.551767 # 2 -3155 3155 2 3.288283 -20.551767 -20.551767 # 2 -3156 3156 2 4.932424 -21.373838 -21.373838 # 2 -3157 3157 2 5.754495 -20.551767 -21.373838 # 2 -3158 3158 2 5.754495 -21.373838 -20.551767 # 2 -3159 3159 2 4.932424 -20.551767 -20.551767 # 2 -3160 3160 2 6.576566 -21.373838 -21.373838 # 2 -3161 3161 2 7.398636 -20.551767 -21.373838 # 2 -3162 3162 2 7.398636 -21.373838 -20.551767 # 2 -3163 3163 2 6.576566 -20.551767 -20.551767 # 2 -3164 3164 2 8.220707 -21.373838 -21.373838 # 2 -3165 3165 2 8.220707 -20.551767 -20.551767 # 2 -3166 3166 2 -7.398636 -23.840050 -19.729696 # 2 -3167 3167 2 -8.220707 -23.840050 -18.907625 # 2 -3168 3168 2 -5.754495 -23.840050 -19.729696 # 2 -3169 3169 2 -6.576566 -23.840050 -18.907625 # 2 -3170 3170 2 -4.110353 -23.840050 -19.729696 # 2 -3171 3171 2 -4.932424 -23.840050 -18.907625 # 2 -3172 3172 2 -2.466212 -23.840050 -19.729696 # 2 -3173 3173 2 -3.288283 -23.840050 -18.907625 # 2 -3174 3174 2 -0.822071 -23.840050 -19.729696 # 2 -3175 3175 2 -1.644141 -23.840050 -18.907625 # 2 -3176 3176 2 0.822071 -23.840050 -19.729696 # 2 -3177 3177 2 0.000000 -23.840050 -18.907625 # 2 -3178 3178 2 2.466212 -23.840050 -19.729696 # 2 -3179 3179 2 1.644141 -23.840050 -18.907625 # 2 -3180 3180 2 4.110353 -23.840050 -19.729696 # 2 -3181 3181 2 3.288283 -23.840050 -18.907625 # 2 -3182 3182 2 5.754495 -23.840050 -19.729696 # 2 -3183 3183 2 4.932424 -23.840050 -18.907625 # 2 -3184 3184 2 7.398636 -23.840050 -19.729696 # 2 -3185 3185 2 6.576566 -23.840050 -18.907625 # 2 -3186 3186 2 8.220707 -23.840050 -18.907625 # 2 -3187 3187 2 -8.220707 -23.017979 -19.729696 # 2 -3188 3188 2 -7.398636 -22.195910 -19.729696 # 2 -3189 3189 2 -7.398636 -23.017979 -18.907625 # 2 -3190 3190 2 -8.220707 -22.195910 -18.907625 # 2 -3191 3191 2 -6.576566 -23.017979 -19.729696 # 2 -3192 3192 2 -5.754495 -22.195910 -19.729696 # 2 -3193 3193 2 -5.754495 -23.017979 -18.907625 # 2 -3194 3194 2 -6.576566 -22.195910 -18.907625 # 2 -3195 3195 2 -4.932424 -23.017979 -19.729696 # 2 -3196 3196 2 -4.110353 -22.195910 -19.729696 # 2 -3197 3197 2 -4.110353 -23.017979 -18.907625 # 2 -3198 3198 2 -4.932424 -22.195910 -18.907625 # 2 -3199 3199 2 -3.288283 -23.017979 -19.729696 # 2 -3200 3200 2 -2.466212 -22.195910 -19.729696 # 2 -3201 3201 2 -2.466212 -23.017979 -18.907625 # 2 -3202 3202 2 -3.288283 -22.195910 -18.907625 # 2 -3203 3203 2 -1.644141 -23.017979 -19.729696 # 2 -3204 3204 2 -0.822071 -22.195910 -19.729696 # 2 -3205 3205 2 -0.822071 -23.017979 -18.907625 # 2 -3206 3206 2 -1.644141 -22.195910 -18.907625 # 2 -3207 3207 2 0.000000 -23.017979 -19.729696 # 2 -3208 3208 2 0.822071 -22.195910 -19.729696 # 2 -3209 3209 2 0.822071 -23.017979 -18.907625 # 2 -3210 3210 2 0.000000 -22.195910 -18.907625 # 2 -3211 3211 2 1.644141 -23.017979 -19.729696 # 2 -3212 3212 2 2.466212 -22.195910 -19.729696 # 2 -3213 3213 2 2.466212 -23.017979 -18.907625 # 2 -3214 3214 2 1.644141 -22.195910 -18.907625 # 2 -3215 3215 2 3.288283 -23.017979 -19.729696 # 2 -3216 3216 2 4.110353 -22.195910 -19.729696 # 2 -3217 3217 2 4.110353 -23.017979 -18.907625 # 2 -3218 3218 2 3.288283 -22.195910 -18.907625 # 2 -3219 3219 2 4.932424 -23.017979 -19.729696 # 2 -3220 3220 2 5.754495 -22.195910 -19.729696 # 2 -3221 3221 2 5.754495 -23.017979 -18.907625 # 2 -3222 3222 2 4.932424 -22.195910 -18.907625 # 2 -3223 3223 2 6.576566 -23.017979 -19.729696 # 2 -3224 3224 2 7.398636 -22.195910 -19.729696 # 2 -3225 3225 2 7.398636 -23.017979 -18.907625 # 2 -3226 3226 2 6.576566 -22.195910 -18.907625 # 2 -3227 3227 2 8.220707 -23.017979 -19.729696 # 2 -3228 3228 2 8.220707 -22.195910 -18.907625 # 2 -3229 3229 2 -8.220707 -21.373838 -19.729696 # 2 -3230 3230 2 -7.398636 -20.551767 -19.729696 # 2 -3231 3231 2 -7.398636 -21.373838 -18.907625 # 2 -3232 3232 2 -8.220707 -20.551767 -18.907625 # 2 -3233 3233 2 -6.576566 -21.373838 -19.729696 # 2 -3234 3234 2 -5.754495 -20.551767 -19.729696 # 2 -3235 3235 2 -5.754495 -21.373838 -18.907625 # 2 -3236 3236 2 -6.576566 -20.551767 -18.907625 # 2 -3237 3237 2 -4.932424 -21.373838 -19.729696 # 2 -3238 3238 2 -4.110353 -20.551767 -19.729696 # 2 -3239 3239 2 -4.110353 -21.373838 -18.907625 # 2 -3240 3240 2 -4.932424 -20.551767 -18.907625 # 2 -3241 3241 2 -3.288283 -21.373838 -19.729696 # 2 -3242 3242 2 -2.466212 -20.551767 -19.729696 # 2 -3243 3243 2 -2.466212 -21.373838 -18.907625 # 2 -3244 3244 2 -3.288283 -20.551767 -18.907625 # 2 -3245 3245 2 -1.644141 -21.373838 -19.729696 # 2 -3246 3246 2 -0.822071 -20.551767 -19.729696 # 2 -3247 3247 2 -0.822071 -21.373838 -18.907625 # 2 -3248 3248 2 -1.644141 -20.551767 -18.907625 # 2 -3249 3249 2 0.000000 -21.373838 -19.729696 # 2 -3250 3250 2 0.822071 -20.551767 -19.729696 # 2 -3251 3251 2 0.822071 -21.373838 -18.907625 # 2 -3252 3252 2 0.000000 -20.551767 -18.907625 # 2 -3253 3253 2 1.644141 -21.373838 -19.729696 # 2 -3254 3254 2 2.466212 -20.551767 -19.729696 # 2 -3255 3255 2 2.466212 -21.373838 -18.907625 # 2 -3256 3256 2 1.644141 -20.551767 -18.907625 # 2 -3257 3257 2 3.288283 -21.373838 -19.729696 # 2 -3258 3258 2 4.110353 -20.551767 -19.729696 # 2 -3259 3259 2 4.110353 -21.373838 -18.907625 # 2 -3260 3260 2 3.288283 -20.551767 -18.907625 # 2 -3261 3261 2 4.932424 -21.373838 -19.729696 # 2 -3262 3262 2 5.754495 -20.551767 -19.729696 # 2 -3263 3263 2 5.754495 -21.373838 -18.907625 # 2 -3264 3264 2 4.932424 -20.551767 -18.907625 # 2 -3265 3265 2 6.576566 -21.373838 -19.729696 # 2 -3266 3266 2 7.398636 -20.551767 -19.729696 # 2 -3267 3267 2 7.398636 -21.373838 -18.907625 # 2 -3268 3268 2 6.576566 -20.551767 -18.907625 # 2 -3269 3269 2 8.220707 -21.373838 -19.729696 # 2 -3270 3270 2 8.220707 -20.551767 -18.907625 # 2 -3271 3271 2 -7.398636 -23.840050 -18.085556 # 2 -3272 3272 2 -8.220707 -23.840050 -17.263485 # 2 -3273 3273 2 -5.754495 -23.840050 -18.085556 # 2 -3274 3274 2 -6.576566 -23.840050 -17.263485 # 2 -3275 3275 2 -4.110353 -23.840050 -18.085556 # 2 -3276 3276 2 -4.932424 -23.840050 -17.263485 # 2 -3277 3277 2 -2.466212 -23.840050 -18.085556 # 2 -3278 3278 2 -3.288283 -23.840050 -17.263485 # 2 -3279 3279 2 -0.822071 -23.840050 -18.085556 # 2 -3280 3280 2 -1.644141 -23.840050 -17.263485 # 2 -3281 3281 2 0.822071 -23.840050 -18.085556 # 2 -3282 3282 2 0.000000 -23.840050 -17.263485 # 2 -3283 3283 2 2.466212 -23.840050 -18.085556 # 2 -3284 3284 2 1.644141 -23.840050 -17.263485 # 2 -3285 3285 2 4.110353 -23.840050 -18.085556 # 2 -3286 3286 2 3.288283 -23.840050 -17.263485 # 2 -3287 3287 2 5.754495 -23.840050 -18.085556 # 2 -3288 3288 2 4.932424 -23.840050 -17.263485 # 2 -3289 3289 2 7.398636 -23.840050 -18.085556 # 2 -3290 3290 2 6.576566 -23.840050 -17.263485 # 2 -3291 3291 2 8.220707 -23.840050 -17.263485 # 2 -3292 3292 2 -8.220707 -23.017979 -18.085556 # 2 -3293 3293 2 -7.398636 -22.195910 -18.085556 # 2 -3294 3294 2 -7.398636 -23.017979 -17.263485 # 2 -3295 3295 2 -8.220707 -22.195910 -17.263485 # 2 -3296 3296 2 -6.576566 -23.017979 -18.085556 # 2 -3297 3297 2 -5.754495 -22.195910 -18.085556 # 2 -3298 3298 2 -5.754495 -23.017979 -17.263485 # 2 -3299 3299 2 -6.576566 -22.195910 -17.263485 # 2 -3300 3300 2 -4.932424 -23.017979 -18.085556 # 2 -3301 3301 2 -4.110353 -22.195910 -18.085556 # 2 -3302 3302 2 -4.110353 -23.017979 -17.263485 # 2 -3303 3303 2 -4.932424 -22.195910 -17.263485 # 2 -3304 3304 2 -3.288283 -23.017979 -18.085556 # 2 -3305 3305 2 -2.466212 -22.195910 -18.085556 # 2 -3306 3306 2 -2.466212 -23.017979 -17.263485 # 2 -3307 3307 2 -3.288283 -22.195910 -17.263485 # 2 -3308 3308 2 -1.644141 -23.017979 -18.085556 # 2 -3309 3309 2 -0.822071 -22.195910 -18.085556 # 2 -3310 3310 2 -0.822071 -23.017979 -17.263485 # 2 -3311 3311 2 -1.644141 -22.195910 -17.263485 # 2 -3312 3312 2 0.000000 -23.017979 -18.085556 # 2 -3313 3313 2 0.822071 -22.195910 -18.085556 # 2 -3314 3314 2 0.822071 -23.017979 -17.263485 # 2 -3315 3315 2 0.000000 -22.195910 -17.263485 # 2 -3316 3316 2 1.644141 -23.017979 -18.085556 # 2 -3317 3317 2 2.466212 -22.195910 -18.085556 # 2 -3318 3318 2 2.466212 -23.017979 -17.263485 # 2 -3319 3319 2 1.644141 -22.195910 -17.263485 # 2 -3320 3320 2 3.288283 -23.017979 -18.085556 # 2 -3321 3321 2 4.110353 -22.195910 -18.085556 # 2 -3322 3322 2 4.110353 -23.017979 -17.263485 # 2 -3323 3323 2 3.288283 -22.195910 -17.263485 # 2 -3324 3324 2 4.932424 -23.017979 -18.085556 # 2 -3325 3325 2 5.754495 -22.195910 -18.085556 # 2 -3326 3326 2 5.754495 -23.017979 -17.263485 # 2 -3327 3327 2 4.932424 -22.195910 -17.263485 # 2 -3328 3328 2 6.576566 -23.017979 -18.085556 # 2 -3329 3329 2 7.398636 -22.195910 -18.085556 # 2 -3330 3330 2 7.398636 -23.017979 -17.263485 # 2 -3331 3331 2 6.576566 -22.195910 -17.263485 # 2 -3332 3332 2 8.220707 -23.017979 -18.085556 # 2 -3333 3333 2 8.220707 -22.195910 -17.263485 # 2 -3334 3334 2 -8.220707 -21.373838 -18.085556 # 2 -3335 3335 2 -7.398636 -20.551767 -18.085556 # 2 -3336 3336 2 -7.398636 -21.373838 -17.263485 # 2 -3337 3337 2 -8.220707 -20.551767 -17.263485 # 2 -3338 3338 2 -6.576566 -21.373838 -18.085556 # 2 -3339 3339 2 -5.754495 -20.551767 -18.085556 # 2 -3340 3340 2 -5.754495 -21.373838 -17.263485 # 2 -3341 3341 2 -6.576566 -20.551767 -17.263485 # 2 -3342 3342 2 -4.932424 -21.373838 -18.085556 # 2 -3343 3343 2 -4.110353 -20.551767 -18.085556 # 2 -3344 3344 2 -4.110353 -21.373838 -17.263485 # 2 -3345 3345 2 -4.932424 -20.551767 -17.263485 # 2 -3346 3346 2 -3.288283 -21.373838 -18.085556 # 2 -3347 3347 2 -2.466212 -20.551767 -18.085556 # 2 -3348 3348 2 -2.466212 -21.373838 -17.263485 # 2 -3349 3349 2 -3.288283 -20.551767 -17.263485 # 2 -3350 3350 2 -1.644141 -21.373838 -18.085556 # 2 -3351 3351 2 -0.822071 -20.551767 -18.085556 # 2 -3352 3352 2 -0.822071 -21.373838 -17.263485 # 2 -3353 3353 2 -1.644141 -20.551767 -17.263485 # 2 -3354 3354 2 0.000000 -21.373838 -18.085556 # 2 -3355 3355 2 0.822071 -20.551767 -18.085556 # 2 -3356 3356 2 0.822071 -21.373838 -17.263485 # 2 -3357 3357 2 0.000000 -20.551767 -17.263485 # 2 -3358 3358 2 1.644141 -21.373838 -18.085556 # 2 -3359 3359 2 2.466212 -20.551767 -18.085556 # 2 -3360 3360 2 2.466212 -21.373838 -17.263485 # 2 -3361 3361 2 1.644141 -20.551767 -17.263485 # 2 -3362 3362 2 3.288283 -21.373838 -18.085556 # 2 -3363 3363 2 4.110353 -20.551767 -18.085556 # 2 -3364 3364 2 4.110353 -21.373838 -17.263485 # 2 -3365 3365 2 3.288283 -20.551767 -17.263485 # 2 -3366 3366 2 4.932424 -21.373838 -18.085556 # 2 -3367 3367 2 5.754495 -20.551767 -18.085556 # 2 -3368 3368 2 5.754495 -21.373838 -17.263485 # 2 -3369 3369 2 4.932424 -20.551767 -17.263485 # 2 -3370 3370 2 6.576566 -21.373838 -18.085556 # 2 -3371 3371 2 7.398636 -20.551767 -18.085556 # 2 -3372 3372 2 7.398636 -21.373838 -17.263485 # 2 -3373 3373 2 6.576566 -20.551767 -17.263485 # 2 -3374 3374 2 8.220707 -21.373838 -18.085556 # 2 -3375 3375 2 8.220707 -20.551767 -17.263485 # 2 -3376 3376 2 -7.398636 -23.840050 -16.441414 # 2 -3377 3377 2 -8.220707 -23.840050 -15.619343 # 2 -3378 3378 2 -5.754495 -23.840050 -16.441414 # 2 -3379 3379 2 -6.576566 -23.840050 -15.619343 # 2 -3380 3380 2 -4.110353 -23.840050 -16.441414 # 2 -3381 3381 2 -4.932424 -23.840050 -15.619343 # 2 -3382 3382 2 -2.466212 -23.840050 -16.441414 # 2 -3383 3383 2 -3.288283 -23.840050 -15.619343 # 2 -3384 3384 2 -0.822071 -23.840050 -16.441414 # 2 -3385 3385 2 -1.644141 -23.840050 -15.619343 # 2 -3386 3386 2 0.822071 -23.840050 -16.441414 # 2 -3387 3387 2 0.000000 -23.840050 -15.619343 # 2 -3388 3388 2 2.466212 -23.840050 -16.441414 # 2 -3389 3389 2 1.644141 -23.840050 -15.619343 # 2 -3390 3390 2 4.110353 -23.840050 -16.441414 # 2 -3391 3391 2 3.288283 -23.840050 -15.619343 # 2 -3392 3392 2 5.754495 -23.840050 -16.441414 # 2 -3393 3393 2 4.932424 -23.840050 -15.619343 # 2 -3394 3394 2 7.398636 -23.840050 -16.441414 # 2 -3395 3395 2 6.576566 -23.840050 -15.619343 # 2 -3396 3396 2 8.220707 -23.840050 -15.619343 # 2 -3397 3397 2 -8.220707 -23.017979 -16.441414 # 2 -3398 3398 2 -7.398636 -22.195910 -16.441414 # 2 -3399 3399 2 -7.398636 -23.017979 -15.619343 # 2 -3400 3400 2 -8.220707 -22.195910 -15.619343 # 2 -3401 3401 2 -6.576566 -23.017979 -16.441414 # 2 -3402 3402 2 -5.754495 -22.195910 -16.441414 # 2 -3403 3403 2 -5.754495 -23.017979 -15.619343 # 2 -3404 3404 2 -6.576566 -22.195910 -15.619343 # 2 -3405 3405 2 -4.932424 -23.017979 -16.441414 # 2 -3406 3406 2 -4.110353 -22.195910 -16.441414 # 2 -3407 3407 2 -4.110353 -23.017979 -15.619343 # 2 -3408 3408 2 -4.932424 -22.195910 -15.619343 # 2 -3409 3409 2 -3.288283 -23.017979 -16.441414 # 2 -3410 3410 2 -2.466212 -22.195910 -16.441414 # 2 -3411 3411 2 -2.466212 -23.017979 -15.619343 # 2 -3412 3412 2 -3.288283 -22.195910 -15.619343 # 2 -3413 3413 2 -1.644141 -23.017979 -16.441414 # 2 -3414 3414 2 -0.822071 -22.195910 -16.441414 # 2 -3415 3415 2 -0.822071 -23.017979 -15.619343 # 2 -3416 3416 2 -1.644141 -22.195910 -15.619343 # 2 -3417 3417 2 0.000000 -23.017979 -16.441414 # 2 -3418 3418 2 0.822071 -22.195910 -16.441414 # 2 -3419 3419 2 0.822071 -23.017979 -15.619343 # 2 -3420 3420 2 0.000000 -22.195910 -15.619343 # 2 -3421 3421 2 1.644141 -23.017979 -16.441414 # 2 -3422 3422 2 2.466212 -22.195910 -16.441414 # 2 -3423 3423 2 2.466212 -23.017979 -15.619343 # 2 -3424 3424 2 1.644141 -22.195910 -15.619343 # 2 -3425 3425 2 3.288283 -23.017979 -16.441414 # 2 -3426 3426 2 4.110353 -22.195910 -16.441414 # 2 -3427 3427 2 4.110353 -23.017979 -15.619343 # 2 -3428 3428 2 3.288283 -22.195910 -15.619343 # 2 -3429 3429 2 4.932424 -23.017979 -16.441414 # 2 -3430 3430 2 5.754495 -22.195910 -16.441414 # 2 -3431 3431 2 5.754495 -23.017979 -15.619343 # 2 -3432 3432 2 4.932424 -22.195910 -15.619343 # 2 -3433 3433 2 6.576566 -23.017979 -16.441414 # 2 -3434 3434 2 7.398636 -22.195910 -16.441414 # 2 -3435 3435 2 7.398636 -23.017979 -15.619343 # 2 -3436 3436 2 6.576566 -22.195910 -15.619343 # 2 -3437 3437 2 8.220707 -23.017979 -16.441414 # 2 -3438 3438 2 8.220707 -22.195910 -15.619343 # 2 -3439 3439 2 -8.220707 -21.373838 -16.441414 # 2 -3440 3440 2 -7.398636 -20.551767 -16.441414 # 2 -3441 3441 2 -7.398636 -21.373838 -15.619343 # 2 -3442 3442 2 -8.220707 -20.551767 -15.619343 # 2 -3443 3443 2 -6.576566 -21.373838 -16.441414 # 2 -3444 3444 2 -5.754495 -20.551767 -16.441414 # 2 -3445 3445 2 -5.754495 -21.373838 -15.619343 # 2 -3446 3446 2 -6.576566 -20.551767 -15.619343 # 2 -3447 3447 2 -4.932424 -21.373838 -16.441414 # 2 -3448 3448 2 -4.110353 -20.551767 -16.441414 # 2 -3449 3449 2 -4.110353 -21.373838 -15.619343 # 2 -3450 3450 2 -4.932424 -20.551767 -15.619343 # 2 -3451 3451 2 -3.288283 -21.373838 -16.441414 # 2 -3452 3452 2 -2.466212 -20.551767 -16.441414 # 2 -3453 3453 2 -2.466212 -21.373838 -15.619343 # 2 -3454 3454 2 -3.288283 -20.551767 -15.619343 # 2 -3455 3455 2 -1.644141 -21.373838 -16.441414 # 2 -3456 3456 2 -0.822071 -20.551767 -16.441414 # 2 -3457 3457 2 -0.822071 -21.373838 -15.619343 # 2 -3458 3458 2 -1.644141 -20.551767 -15.619343 # 2 -3459 3459 2 0.000000 -21.373838 -16.441414 # 2 -3460 3460 2 0.822071 -20.551767 -16.441414 # 2 -3461 3461 2 0.822071 -21.373838 -15.619343 # 2 -3462 3462 2 0.000000 -20.551767 -15.619343 # 2 -3463 3463 2 1.644141 -21.373838 -16.441414 # 2 -3464 3464 2 2.466212 -20.551767 -16.441414 # 2 -3465 3465 2 2.466212 -21.373838 -15.619343 # 2 -3466 3466 2 1.644141 -20.551767 -15.619343 # 2 -3467 3467 2 3.288283 -21.373838 -16.441414 # 2 -3468 3468 2 4.110353 -20.551767 -16.441414 # 2 -3469 3469 2 4.110353 -21.373838 -15.619343 # 2 -3470 3470 2 3.288283 -20.551767 -15.619343 # 2 -3471 3471 2 4.932424 -21.373838 -16.441414 # 2 -3472 3472 2 5.754495 -20.551767 -16.441414 # 2 -3473 3473 2 5.754495 -21.373838 -15.619343 # 2 -3474 3474 2 4.932424 -20.551767 -15.619343 # 2 -3475 3475 2 6.576566 -21.373838 -16.441414 # 2 -3476 3476 2 7.398636 -20.551767 -16.441414 # 2 -3477 3477 2 7.398636 -21.373838 -15.619343 # 2 -3478 3478 2 6.576566 -20.551767 -15.619343 # 2 -3479 3479 2 8.220707 -21.373838 -16.441414 # 2 -3480 3480 2 8.220707 -20.551767 -15.619343 # 2 -3481 3481 2 -7.398636 -23.840050 -14.797273 # 2 -3482 3482 2 -8.220707 -23.840050 -13.975202 # 2 -3483 3483 2 -5.754495 -23.840050 -14.797273 # 2 -3484 3484 2 -6.576566 -23.840050 -13.975202 # 2 -3485 3485 2 -4.110353 -23.840050 -14.797273 # 2 -3486 3486 2 -4.932424 -23.840050 -13.975202 # 2 -3487 3487 2 -2.466212 -23.840050 -14.797273 # 2 -3488 3488 2 -3.288283 -23.840050 -13.975202 # 2 -3489 3489 2 -0.822071 -23.840050 -14.797273 # 2 -3490 3490 2 -1.644141 -23.840050 -13.975202 # 2 -3491 3491 2 0.822071 -23.840050 -14.797273 # 2 -3492 3492 2 0.000000 -23.840050 -13.975202 # 2 -3493 3493 2 2.466212 -23.840050 -14.797273 # 2 -3494 3494 2 1.644141 -23.840050 -13.975202 # 2 -3495 3495 2 4.110353 -23.840050 -14.797273 # 2 -3496 3496 2 3.288283 -23.840050 -13.975202 # 2 -3497 3497 2 5.754495 -23.840050 -14.797273 # 2 -3498 3498 2 4.932424 -23.840050 -13.975202 # 2 -3499 3499 2 7.398636 -23.840050 -14.797273 # 2 -3500 3500 2 6.576566 -23.840050 -13.975202 # 2 -3501 3501 2 8.220707 -23.840050 -13.975202 # 2 -3502 3502 2 -8.220707 -23.017979 -14.797273 # 2 -3503 3503 2 -7.398636 -22.195910 -14.797273 # 2 -3504 3504 2 -7.398636 -23.017979 -13.975202 # 2 -3505 3505 2 -8.220707 -22.195910 -13.975202 # 2 -3506 3506 2 -6.576566 -23.017979 -14.797273 # 2 -3507 3507 2 -5.754495 -22.195910 -14.797273 # 2 -3508 3508 2 -5.754495 -23.017979 -13.975202 # 2 -3509 3509 2 -6.576566 -22.195910 -13.975202 # 2 -3510 3510 2 -4.932424 -23.017979 -14.797273 # 2 -3511 3511 2 -4.110353 -22.195910 -14.797273 # 2 -3512 3512 2 -4.110353 -23.017979 -13.975202 # 2 -3513 3513 2 -4.932424 -22.195910 -13.975202 # 2 -3514 3514 2 -3.288283 -23.017979 -14.797273 # 2 -3515 3515 2 -2.466212 -22.195910 -14.797273 # 2 -3516 3516 2 -2.466212 -23.017979 -13.975202 # 2 -3517 3517 2 -3.288283 -22.195910 -13.975202 # 2 -3518 3518 2 -1.644141 -23.017979 -14.797273 # 2 -3519 3519 2 -0.822071 -22.195910 -14.797273 # 2 -3520 3520 2 -0.822071 -23.017979 -13.975202 # 2 -3521 3521 2 -1.644141 -22.195910 -13.975202 # 2 -3522 3522 2 0.000000 -23.017979 -14.797273 # 2 -3523 3523 2 0.822071 -22.195910 -14.797273 # 2 -3524 3524 2 0.822071 -23.017979 -13.975202 # 2 -3525 3525 2 0.000000 -22.195910 -13.975202 # 2 -3526 3526 2 1.644141 -23.017979 -14.797273 # 2 -3527 3527 2 2.466212 -22.195910 -14.797273 # 2 -3528 3528 2 2.466212 -23.017979 -13.975202 # 2 -3529 3529 2 1.644141 -22.195910 -13.975202 # 2 -3530 3530 2 3.288283 -23.017979 -14.797273 # 2 -3531 3531 2 4.110353 -22.195910 -14.797273 # 2 -3532 3532 2 4.110353 -23.017979 -13.975202 # 2 -3533 3533 2 3.288283 -22.195910 -13.975202 # 2 -3534 3534 2 4.932424 -23.017979 -14.797273 # 2 -3535 3535 2 5.754495 -22.195910 -14.797273 # 2 -3536 3536 2 5.754495 -23.017979 -13.975202 # 2 -3537 3537 2 4.932424 -22.195910 -13.975202 # 2 -3538 3538 2 6.576566 -23.017979 -14.797273 # 2 -3539 3539 2 7.398636 -22.195910 -14.797273 # 2 -3540 3540 2 7.398636 -23.017979 -13.975202 # 2 -3541 3541 2 6.576566 -22.195910 -13.975202 # 2 -3542 3542 2 8.220707 -23.017979 -14.797273 # 2 -3543 3543 2 8.220707 -22.195910 -13.975202 # 2 -3544 3544 2 -8.220707 -21.373838 -14.797273 # 2 -3545 3545 2 -7.398636 -20.551767 -14.797273 # 2 -3546 3546 2 -7.398636 -21.373838 -13.975202 # 2 -3547 3547 2 -8.220707 -20.551767 -13.975202 # 2 -3548 3548 2 -6.576566 -21.373838 -14.797273 # 2 -3549 3549 2 -5.754495 -20.551767 -14.797273 # 2 -3550 3550 2 -5.754495 -21.373838 -13.975202 # 2 -3551 3551 2 -6.576566 -20.551767 -13.975202 # 2 -3552 3552 2 -4.932424 -21.373838 -14.797273 # 2 -3553 3553 2 -4.110353 -20.551767 -14.797273 # 2 -3554 3554 2 -4.110353 -21.373838 -13.975202 # 2 -3555 3555 2 -4.932424 -20.551767 -13.975202 # 2 -3556 3556 2 -3.288283 -21.373838 -14.797273 # 2 -3557 3557 2 -2.466212 -20.551767 -14.797273 # 2 -3558 3558 2 -2.466212 -21.373838 -13.975202 # 2 -3559 3559 2 -3.288283 -20.551767 -13.975202 # 2 -3560 3560 2 -1.644141 -21.373838 -14.797273 # 2 -3561 3561 2 -0.822071 -20.551767 -14.797273 # 2 -3562 3562 2 -0.822071 -21.373838 -13.975202 # 2 -3563 3563 2 -1.644141 -20.551767 -13.975202 # 2 -3564 3564 2 0.000000 -21.373838 -14.797273 # 2 -3565 3565 2 0.822071 -20.551767 -14.797273 # 2 -3566 3566 2 0.822071 -21.373838 -13.975202 # 2 -3567 3567 2 0.000000 -20.551767 -13.975202 # 2 -3568 3568 2 1.644141 -21.373838 -14.797273 # 2 -3569 3569 2 2.466212 -20.551767 -14.797273 # 2 -3570 3570 2 2.466212 -21.373838 -13.975202 # 2 -3571 3571 2 1.644141 -20.551767 -13.975202 # 2 -3572 3572 2 3.288283 -21.373838 -14.797273 # 2 -3573 3573 2 4.110353 -20.551767 -14.797273 # 2 -3574 3574 2 4.110353 -21.373838 -13.975202 # 2 -3575 3575 2 3.288283 -20.551767 -13.975202 # 2 -3576 3576 2 4.932424 -21.373838 -14.797273 # 2 -3577 3577 2 5.754495 -20.551767 -14.797273 # 2 -3578 3578 2 5.754495 -21.373838 -13.975202 # 2 -3579 3579 2 4.932424 -20.551767 -13.975202 # 2 -3580 3580 2 6.576566 -21.373838 -14.797273 # 2 -3581 3581 2 7.398636 -20.551767 -14.797273 # 2 -3582 3582 2 7.398636 -21.373838 -13.975202 # 2 -3583 3583 2 6.576566 -20.551767 -13.975202 # 2 -3584 3584 2 8.220707 -21.373838 -14.797273 # 2 -3585 3585 2 8.220707 -20.551767 -13.975202 # 2 -3586 3586 2 -7.398636 -23.840050 -13.153131 # 2 -3587 3587 2 -8.220707 -23.840050 -12.331060 # 2 -3588 3588 2 -5.754495 -23.840050 -13.153131 # 2 -3589 3589 2 -6.576566 -23.840050 -12.331060 # 2 -3590 3590 2 -4.110353 -23.840050 -13.153131 # 2 -3591 3591 2 -4.932424 -23.840050 -12.331060 # 2 -3592 3592 2 -2.466212 -23.840050 -13.153131 # 2 -3593 3593 2 -3.288283 -23.840050 -12.331060 # 2 -3594 3594 2 -0.822071 -23.840050 -13.153131 # 2 -3595 3595 2 -1.644141 -23.840050 -12.331060 # 2 -3596 3596 2 0.822071 -23.840050 -13.153131 # 2 -3597 3597 2 0.000000 -23.840050 -12.331060 # 2 -3598 3598 2 2.466212 -23.840050 -13.153131 # 2 -3599 3599 2 1.644141 -23.840050 -12.331060 # 2 -3600 3600 2 4.110353 -23.840050 -13.153131 # 2 -3601 3601 2 3.288283 -23.840050 -12.331060 # 2 -3602 3602 2 5.754495 -23.840050 -13.153131 # 2 -3603 3603 2 4.932424 -23.840050 -12.331060 # 2 -3604 3604 2 7.398636 -23.840050 -13.153131 # 2 -3605 3605 2 6.576566 -23.840050 -12.331060 # 2 -3606 3606 2 8.220707 -23.840050 -12.331060 # 2 -3607 3607 2 -8.220707 -23.017979 -13.153131 # 2 -3608 3608 2 -7.398636 -22.195910 -13.153131 # 2 -3609 3609 2 -7.398636 -23.017979 -12.331060 # 2 -3610 3610 2 -8.220707 -22.195910 -12.331060 # 2 -3611 3611 2 -6.576566 -23.017979 -13.153131 # 2 -3612 3612 2 -5.754495 -22.195910 -13.153131 # 2 -3613 3613 2 -5.754495 -23.017979 -12.331060 # 2 -3614 3614 2 -6.576566 -22.195910 -12.331060 # 2 -3615 3615 2 -4.932424 -23.017979 -13.153131 # 2 -3616 3616 2 -4.110353 -22.195910 -13.153131 # 2 -3617 3617 2 -4.110353 -23.017979 -12.331060 # 2 -3618 3618 2 -4.932424 -22.195910 -12.331060 # 2 -3619 3619 2 -3.288283 -23.017979 -13.153131 # 2 -3620 3620 2 -2.466212 -22.195910 -13.153131 # 2 -3621 3621 2 -2.466212 -23.017979 -12.331060 # 2 -3622 3622 2 -3.288283 -22.195910 -12.331060 # 2 -3623 3623 2 -1.644141 -23.017979 -13.153131 # 2 -3624 3624 2 -0.822071 -22.195910 -13.153131 # 2 -3625 3625 2 -0.822071 -23.017979 -12.331060 # 2 -3626 3626 2 -1.644141 -22.195910 -12.331060 # 2 -3627 3627 2 0.000000 -23.017979 -13.153131 # 2 -3628 3628 2 0.822071 -22.195910 -13.153131 # 2 -3629 3629 2 0.822071 -23.017979 -12.331060 # 2 -3630 3630 2 0.000000 -22.195910 -12.331060 # 2 -3631 3631 2 1.644141 -23.017979 -13.153131 # 2 -3632 3632 2 2.466212 -22.195910 -13.153131 # 2 -3633 3633 2 2.466212 -23.017979 -12.331060 # 2 -3634 3634 2 1.644141 -22.195910 -12.331060 # 2 -3635 3635 2 3.288283 -23.017979 -13.153131 # 2 -3636 3636 2 4.110353 -22.195910 -13.153131 # 2 -3637 3637 2 4.110353 -23.017979 -12.331060 # 2 -3638 3638 2 3.288283 -22.195910 -12.331060 # 2 -3639 3639 2 4.932424 -23.017979 -13.153131 # 2 -3640 3640 2 5.754495 -22.195910 -13.153131 # 2 -3641 3641 2 5.754495 -23.017979 -12.331060 # 2 -3642 3642 2 4.932424 -22.195910 -12.331060 # 2 -3643 3643 2 6.576566 -23.017979 -13.153131 # 2 -3644 3644 2 7.398636 -22.195910 -13.153131 # 2 -3645 3645 2 7.398636 -23.017979 -12.331060 # 2 -3646 3646 2 6.576566 -22.195910 -12.331060 # 2 -3647 3647 2 8.220707 -23.017979 -13.153131 # 2 -3648 3648 2 8.220707 -22.195910 -12.331060 # 2 -3649 3649 2 -8.220707 -21.373838 -13.153131 # 2 -3650 3650 2 -7.398636 -20.551767 -13.153131 # 2 -3651 3651 2 -7.398636 -21.373838 -12.331060 # 2 -3652 3652 2 -8.220707 -20.551767 -12.331060 # 2 -3653 3653 2 -6.576566 -21.373838 -13.153131 # 2 -3654 3654 2 -5.754495 -20.551767 -13.153131 # 2 -3655 3655 2 -5.754495 -21.373838 -12.331060 # 2 -3656 3656 2 -6.576566 -20.551767 -12.331060 # 2 -3657 3657 2 -4.932424 -21.373838 -13.153131 # 2 -3658 3658 2 -4.110353 -20.551767 -13.153131 # 2 -3659 3659 2 -4.110353 -21.373838 -12.331060 # 2 -3660 3660 2 -4.932424 -20.551767 -12.331060 # 2 -3661 3661 2 -3.288283 -21.373838 -13.153131 # 2 -3662 3662 2 -2.466212 -20.551767 -13.153131 # 2 -3663 3663 2 -2.466212 -21.373838 -12.331060 # 2 -3664 3664 2 -3.288283 -20.551767 -12.331060 # 2 -3665 3665 2 -1.644141 -21.373838 -13.153131 # 2 -3666 3666 2 -0.822071 -20.551767 -13.153131 # 2 -3667 3667 2 -0.822071 -21.373838 -12.331060 # 2 -3668 3668 2 -1.644141 -20.551767 -12.331060 # 2 -3669 3669 2 0.000000 -21.373838 -13.153131 # 2 -3670 3670 2 0.822071 -20.551767 -13.153131 # 2 -3671 3671 2 0.822071 -21.373838 -12.331060 # 2 -3672 3672 2 0.000000 -20.551767 -12.331060 # 2 -3673 3673 2 1.644141 -21.373838 -13.153131 # 2 -3674 3674 2 2.466212 -20.551767 -13.153131 # 2 -3675 3675 2 2.466212 -21.373838 -12.331060 # 2 -3676 3676 2 1.644141 -20.551767 -12.331060 # 2 -3677 3677 2 3.288283 -21.373838 -13.153131 # 2 -3678 3678 2 4.110353 -20.551767 -13.153131 # 2 -3679 3679 2 4.110353 -21.373838 -12.331060 # 2 -3680 3680 2 3.288283 -20.551767 -12.331060 # 2 -3681 3681 2 4.932424 -21.373838 -13.153131 # 2 -3682 3682 2 5.754495 -20.551767 -13.153131 # 2 -3683 3683 2 5.754495 -21.373838 -12.331060 # 2 -3684 3684 2 4.932424 -20.551767 -12.331060 # 2 -3685 3685 2 6.576566 -21.373838 -13.153131 # 2 -3686 3686 2 7.398636 -20.551767 -13.153131 # 2 -3687 3687 2 7.398636 -21.373838 -12.331060 # 2 -3688 3688 2 6.576566 -20.551767 -12.331060 # 2 -3689 3689 2 8.220707 -21.373838 -13.153131 # 2 -3690 3690 2 8.220707 -20.551767 -12.331060 # 2 -3691 3691 2 -7.398636 -23.840050 -11.508989 # 2 -3692 3692 2 -8.220707 -23.840050 -10.686919 # 2 -3693 3693 2 -5.754495 -23.840050 -11.508989 # 2 -3694 3694 2 -6.576566 -23.840050 -10.686919 # 2 -3695 3695 2 -4.110353 -23.840050 -11.508989 # 2 -3696 3696 2 -4.932424 -23.840050 -10.686919 # 2 -3697 3697 2 -2.466212 -23.840050 -11.508989 # 2 -3698 3698 2 -3.288283 -23.840050 -10.686919 # 2 -3699 3699 2 -0.822071 -23.840050 -11.508989 # 2 -3700 3700 2 -1.644141 -23.840050 -10.686919 # 2 -3701 3701 2 0.822071 -23.840050 -11.508989 # 2 -3702 3702 2 0.000000 -23.840050 -10.686919 # 2 -3703 3703 2 2.466212 -23.840050 -11.508989 # 2 -3704 3704 2 1.644141 -23.840050 -10.686919 # 2 -3705 3705 2 4.110353 -23.840050 -11.508989 # 2 -3706 3706 2 3.288283 -23.840050 -10.686919 # 2 -3707 3707 2 5.754495 -23.840050 -11.508989 # 2 -3708 3708 2 4.932424 -23.840050 -10.686919 # 2 -3709 3709 2 7.398636 -23.840050 -11.508989 # 2 -3710 3710 2 6.576566 -23.840050 -10.686919 # 2 -3711 3711 2 8.220707 -23.840050 -10.686919 # 2 -3712 3712 2 -8.220707 -23.017979 -11.508989 # 2 -3713 3713 2 -7.398636 -22.195910 -11.508989 # 2 -3714 3714 2 -7.398636 -23.017979 -10.686919 # 2 -3715 3715 2 -8.220707 -22.195910 -10.686919 # 2 -3716 3716 2 -6.576566 -23.017979 -11.508989 # 2 -3717 3717 2 -5.754495 -22.195910 -11.508989 # 2 -3718 3718 2 -5.754495 -23.017979 -10.686919 # 2 -3719 3719 2 -6.576566 -22.195910 -10.686919 # 2 -3720 3720 2 -4.932424 -23.017979 -11.508989 # 2 -3721 3721 2 -4.110353 -22.195910 -11.508989 # 2 -3722 3722 2 -4.110353 -23.017979 -10.686919 # 2 -3723 3723 2 -4.932424 -22.195910 -10.686919 # 2 -3724 3724 2 -3.288283 -23.017979 -11.508989 # 2 -3725 3725 2 -2.466212 -22.195910 -11.508989 # 2 -3726 3726 2 -2.466212 -23.017979 -10.686919 # 2 -3727 3727 2 -3.288283 -22.195910 -10.686919 # 2 -3728 3728 2 -1.644141 -23.017979 -11.508989 # 2 -3729 3729 2 -0.822071 -22.195910 -11.508989 # 2 -3730 3730 2 -0.822071 -23.017979 -10.686919 # 2 -3731 3731 2 -1.644141 -22.195910 -10.686919 # 2 -3732 3732 2 0.000000 -23.017979 -11.508989 # 2 -3733 3733 2 0.822071 -22.195910 -11.508989 # 2 -3734 3734 2 0.822071 -23.017979 -10.686919 # 2 -3735 3735 2 0.000000 -22.195910 -10.686919 # 2 -3736 3736 2 1.644141 -23.017979 -11.508989 # 2 -3737 3737 2 2.466212 -22.195910 -11.508989 # 2 -3738 3738 2 2.466212 -23.017979 -10.686919 # 2 -3739 3739 2 1.644141 -22.195910 -10.686919 # 2 -3740 3740 2 3.288283 -23.017979 -11.508989 # 2 -3741 3741 2 4.110353 -22.195910 -11.508989 # 2 -3742 3742 2 4.110353 -23.017979 -10.686919 # 2 -3743 3743 2 3.288283 -22.195910 -10.686919 # 2 -3744 3744 2 4.932424 -23.017979 -11.508989 # 2 -3745 3745 2 5.754495 -22.195910 -11.508989 # 2 -3746 3746 2 5.754495 -23.017979 -10.686919 # 2 -3747 3747 2 4.932424 -22.195910 -10.686919 # 2 -3748 3748 2 6.576566 -23.017979 -11.508989 # 2 -3749 3749 2 7.398636 -22.195910 -11.508989 # 2 -3750 3750 2 7.398636 -23.017979 -10.686919 # 2 -3751 3751 2 6.576566 -22.195910 -10.686919 # 2 -3752 3752 2 8.220707 -23.017979 -11.508989 # 2 -3753 3753 2 8.220707 -22.195910 -10.686919 # 2 -3754 3754 2 -8.220707 -21.373838 -11.508989 # 2 -3755 3755 2 -7.398636 -20.551767 -11.508989 # 2 -3756 3756 2 -7.398636 -21.373838 -10.686919 # 2 -3757 3757 2 -8.220707 -20.551767 -10.686919 # 2 -3758 3758 2 -6.576566 -21.373838 -11.508989 # 2 -3759 3759 2 -5.754495 -20.551767 -11.508989 # 2 -3760 3760 2 -5.754495 -21.373838 -10.686919 # 2 -3761 3761 2 -6.576566 -20.551767 -10.686919 # 2 -3762 3762 2 -4.932424 -21.373838 -11.508989 # 2 -3763 3763 2 -4.110353 -20.551767 -11.508989 # 2 -3764 3764 2 -4.110353 -21.373838 -10.686919 # 2 -3765 3765 2 -4.932424 -20.551767 -10.686919 # 2 -3766 3766 2 -3.288283 -21.373838 -11.508989 # 2 -3767 3767 2 -2.466212 -20.551767 -11.508989 # 2 -3768 3768 2 -2.466212 -21.373838 -10.686919 # 2 -3769 3769 2 -3.288283 -20.551767 -10.686919 # 2 -3770 3770 2 -1.644141 -21.373838 -11.508989 # 2 -3771 3771 2 -0.822071 -20.551767 -11.508989 # 2 -3772 3772 2 -0.822071 -21.373838 -10.686919 # 2 -3773 3773 2 -1.644141 -20.551767 -10.686919 # 2 -3774 3774 2 0.000000 -21.373838 -11.508989 # 2 -3775 3775 2 0.822071 -20.551767 -11.508989 # 2 -3776 3776 2 0.822071 -21.373838 -10.686919 # 2 -3777 3777 2 0.000000 -20.551767 -10.686919 # 2 -3778 3778 2 1.644141 -21.373838 -11.508989 # 2 -3779 3779 2 2.466212 -20.551767 -11.508989 # 2 -3780 3780 2 2.466212 -21.373838 -10.686919 # 2 -3781 3781 2 1.644141 -20.551767 -10.686919 # 2 -3782 3782 2 3.288283 -21.373838 -11.508989 # 2 -3783 3783 2 4.110353 -20.551767 -11.508989 # 2 -3784 3784 2 4.110353 -21.373838 -10.686919 # 2 -3785 3785 2 3.288283 -20.551767 -10.686919 # 2 -3786 3786 2 4.932424 -21.373838 -11.508989 # 2 -3787 3787 2 5.754495 -20.551767 -11.508989 # 2 -3788 3788 2 5.754495 -21.373838 -10.686919 # 2 -3789 3789 2 4.932424 -20.551767 -10.686919 # 2 -3790 3790 2 6.576566 -21.373838 -11.508989 # 2 -3791 3791 2 7.398636 -20.551767 -11.508989 # 2 -3792 3792 2 7.398636 -21.373838 -10.686919 # 2 -3793 3793 2 6.576566 -20.551767 -10.686919 # 2 -3794 3794 2 8.220707 -21.373838 -11.508989 # 2 -3795 3795 2 8.220707 -20.551767 -10.686919 # 2 -3796 3796 2 -7.398636 -23.840050 -9.864848 # 2 -3797 3797 2 -8.220707 -23.840050 -9.042778 # 2 -3798 3798 2 -5.754495 -23.840050 -9.864848 # 2 -3799 3799 2 -6.576566 -23.840050 -9.042778 # 2 -3800 3800 2 -4.110353 -23.840050 -9.864848 # 2 -3801 3801 2 -4.932424 -23.840050 -9.042778 # 2 -3802 3802 2 -2.466212 -23.840050 -9.864848 # 2 -3803 3803 2 -3.288283 -23.840050 -9.042778 # 2 -3804 3804 2 -0.822071 -23.840050 -9.864848 # 2 -3805 3805 2 -1.644141 -23.840050 -9.042778 # 2 -3806 3806 2 0.822071 -23.840050 -9.864848 # 2 -3807 3807 2 0.000000 -23.840050 -9.042778 # 2 -3808 3808 2 2.466212 -23.840050 -9.864848 # 2 -3809 3809 2 1.644141 -23.840050 -9.042778 # 2 -3810 3810 2 4.110353 -23.840050 -9.864848 # 2 -3811 3811 2 3.288283 -23.840050 -9.042778 # 2 -3812 3812 2 5.754495 -23.840050 -9.864848 # 2 -3813 3813 2 4.932424 -23.840050 -9.042778 # 2 -3814 3814 2 7.398636 -23.840050 -9.864848 # 2 -3815 3815 2 6.576566 -23.840050 -9.042778 # 2 -3816 3816 2 8.220707 -23.840050 -9.042778 # 2 -3817 3817 2 -8.220707 -23.017979 -9.864848 # 2 -3818 3818 2 -7.398636 -22.195910 -9.864848 # 2 -3819 3819 2 -7.398636 -23.017979 -9.042778 # 2 -3820 3820 2 -8.220707 -22.195910 -9.042778 # 2 -3821 3821 2 -6.576566 -23.017979 -9.864848 # 2 -3822 3822 2 -5.754495 -22.195910 -9.864848 # 2 -3823 3823 2 -5.754495 -23.017979 -9.042778 # 2 -3824 3824 2 -6.576566 -22.195910 -9.042778 # 2 -3825 3825 2 -4.932424 -23.017979 -9.864848 # 2 -3826 3826 2 -4.110353 -22.195910 -9.864848 # 2 -3827 3827 2 -4.110353 -23.017979 -9.042778 # 2 -3828 3828 2 -4.932424 -22.195910 -9.042778 # 2 -3829 3829 2 -3.288283 -23.017979 -9.864848 # 2 -3830 3830 2 -2.466212 -22.195910 -9.864848 # 2 -3831 3831 2 -2.466212 -23.017979 -9.042778 # 2 -3832 3832 2 -3.288283 -22.195910 -9.042778 # 2 -3833 3833 2 -1.644141 -23.017979 -9.864848 # 2 -3834 3834 2 -0.822071 -22.195910 -9.864848 # 2 -3835 3835 2 -0.822071 -23.017979 -9.042778 # 2 -3836 3836 2 -1.644141 -22.195910 -9.042778 # 2 -3837 3837 2 0.000000 -23.017979 -9.864848 # 2 -3838 3838 2 0.822071 -22.195910 -9.864848 # 2 -3839 3839 2 0.822071 -23.017979 -9.042778 # 2 -3840 3840 2 0.000000 -22.195910 -9.042778 # 2 -3841 3841 2 1.644141 -23.017979 -9.864848 # 2 -3842 3842 2 2.466212 -22.195910 -9.864848 # 2 -3843 3843 2 2.466212 -23.017979 -9.042778 # 2 -3844 3844 2 1.644141 -22.195910 -9.042778 # 2 -3845 3845 2 3.288283 -23.017979 -9.864848 # 2 -3846 3846 2 4.110353 -22.195910 -9.864848 # 2 -3847 3847 2 4.110353 -23.017979 -9.042778 # 2 -3848 3848 2 3.288283 -22.195910 -9.042778 # 2 -3849 3849 2 4.932424 -23.017979 -9.864848 # 2 -3850 3850 2 5.754495 -22.195910 -9.864848 # 2 -3851 3851 2 5.754495 -23.017979 -9.042778 # 2 -3852 3852 2 4.932424 -22.195910 -9.042778 # 2 -3853 3853 2 6.576566 -23.017979 -9.864848 # 2 -3854 3854 2 7.398636 -22.195910 -9.864848 # 2 -3855 3855 2 7.398636 -23.017979 -9.042778 # 2 -3856 3856 2 6.576566 -22.195910 -9.042778 # 2 -3857 3857 2 8.220707 -23.017979 -9.864848 # 2 -3858 3858 2 8.220707 -22.195910 -9.042778 # 2 -3859 3859 2 -8.220707 -21.373838 -9.864848 # 2 -3860 3860 2 -7.398636 -20.551767 -9.864848 # 2 -3861 3861 2 -7.398636 -21.373838 -9.042778 # 2 -3862 3862 2 -8.220707 -20.551767 -9.042778 # 2 -3863 3863 2 -6.576566 -21.373838 -9.864848 # 2 -3864 3864 2 -5.754495 -20.551767 -9.864848 # 2 -3865 3865 2 -5.754495 -21.373838 -9.042778 # 2 -3866 3866 2 -6.576566 -20.551767 -9.042778 # 2 -3867 3867 2 -4.932424 -21.373838 -9.864848 # 2 -3868 3868 2 -4.110353 -20.551767 -9.864848 # 2 -3869 3869 2 -4.110353 -21.373838 -9.042778 # 2 -3870 3870 2 -4.932424 -20.551767 -9.042778 # 2 -3871 3871 2 -3.288283 -21.373838 -9.864848 # 2 -3872 3872 2 -2.466212 -20.551767 -9.864848 # 2 -3873 3873 2 -2.466212 -21.373838 -9.042778 # 2 -3874 3874 2 -3.288283 -20.551767 -9.042778 # 2 -3875 3875 2 -1.644141 -21.373838 -9.864848 # 2 -3876 3876 2 -0.822071 -20.551767 -9.864848 # 2 -3877 3877 2 -0.822071 -21.373838 -9.042778 # 2 -3878 3878 2 -1.644141 -20.551767 -9.042778 # 2 -3879 3879 2 0.000000 -21.373838 -9.864848 # 2 -3880 3880 2 0.822071 -20.551767 -9.864848 # 2 -3881 3881 2 0.822071 -21.373838 -9.042778 # 2 -3882 3882 2 0.000000 -20.551767 -9.042778 # 2 -3883 3883 2 1.644141 -21.373838 -9.864848 # 2 -3884 3884 2 2.466212 -20.551767 -9.864848 # 2 -3885 3885 2 2.466212 -21.373838 -9.042778 # 2 -3886 3886 2 1.644141 -20.551767 -9.042778 # 2 -3887 3887 2 3.288283 -21.373838 -9.864848 # 2 -3888 3888 2 4.110353 -20.551767 -9.864848 # 2 -3889 3889 2 4.110353 -21.373838 -9.042778 # 2 -3890 3890 2 3.288283 -20.551767 -9.042778 # 2 -3891 3891 2 4.932424 -21.373838 -9.864848 # 2 -3892 3892 2 5.754495 -20.551767 -9.864848 # 2 -3893 3893 2 5.754495 -21.373838 -9.042778 # 2 -3894 3894 2 4.932424 -20.551767 -9.042778 # 2 -3895 3895 2 6.576566 -21.373838 -9.864848 # 2 -3896 3896 2 7.398636 -20.551767 -9.864848 # 2 -3897 3897 2 7.398636 -21.373838 -9.042778 # 2 -3898 3898 2 6.576566 -20.551767 -9.042778 # 2 -3899 3899 2 8.220707 -21.373838 -9.864848 # 2 -3900 3900 2 8.220707 -20.551767 -9.042778 # 2 -3901 3901 2 -7.398636 -23.840050 -8.220707 # 2 -3902 3902 2 -5.754495 -23.840050 -8.220707 # 2 -3903 3903 2 -4.110353 -23.840050 -8.220707 # 2 -3904 3904 2 -2.466212 -23.840050 -8.220707 # 2 -3905 3905 2 -0.822071 -23.840050 -8.220707 # 2 -3906 3906 2 0.822071 -23.840050 -8.220707 # 2 -3907 3907 2 2.466212 -23.840050 -8.220707 # 2 -3908 3908 2 4.110353 -23.840050 -8.220707 # 2 -3909 3909 2 5.754495 -23.840050 -8.220707 # 2 -3910 3910 2 7.398636 -23.840050 -8.220707 # 2 -3911 3911 2 -8.220707 -23.017979 -8.220707 # 2 -3912 3912 2 -7.398636 -22.195910 -8.220707 # 2 -3913 3913 2 -6.576566 -23.017979 -8.220707 # 2 -3914 3914 2 -5.754495 -22.195910 -8.220707 # 2 -3915 3915 2 -4.932424 -23.017979 -8.220707 # 2 -3916 3916 2 -4.110353 -22.195910 -8.220707 # 2 -3917 3917 2 -3.288283 -23.017979 -8.220707 # 2 -3918 3918 2 -2.466212 -22.195910 -8.220707 # 2 -3919 3919 2 -1.644141 -23.017979 -8.220707 # 2 -3920 3920 2 -0.822071 -22.195910 -8.220707 # 2 -3921 3921 2 0.000000 -23.017979 -8.220707 # 2 -3922 3922 2 0.822071 -22.195910 -8.220707 # 2 -3923 3923 2 1.644141 -23.017979 -8.220707 # 2 -3924 3924 2 2.466212 -22.195910 -8.220707 # 2 -3925 3925 2 3.288283 -23.017979 -8.220707 # 2 -3926 3926 2 4.110353 -22.195910 -8.220707 # 2 -3927 3927 2 4.932424 -23.017979 -8.220707 # 2 -3928 3928 2 5.754495 -22.195910 -8.220707 # 2 -3929 3929 2 6.576566 -23.017979 -8.220707 # 2 -3930 3930 2 7.398636 -22.195910 -8.220707 # 2 -3931 3931 2 8.220707 -23.017979 -8.220707 # 2 -3932 3932 2 -8.220707 -21.373838 -8.220707 # 2 -3933 3933 2 -7.398636 -20.551767 -8.220707 # 2 -3934 3934 2 -6.576566 -21.373838 -8.220707 # 2 -3935 3935 2 -5.754495 -20.551767 -8.220707 # 2 -3936 3936 2 -4.932424 -21.373838 -8.220707 # 2 -3937 3937 2 -4.110353 -20.551767 -8.220707 # 2 -3938 3938 2 -3.288283 -21.373838 -8.220707 # 2 -3939 3939 2 -2.466212 -20.551767 -8.220707 # 2 -3940 3940 2 -1.644141 -21.373838 -8.220707 # 2 -3941 3941 2 -0.822071 -20.551767 -8.220707 # 2 -3942 3942 2 0.000000 -21.373838 -8.220707 # 2 -3943 3943 2 0.822071 -20.551767 -8.220707 # 2 -3944 3944 2 1.644141 -21.373838 -8.220707 # 2 -3945 3945 2 2.466212 -20.551767 -8.220707 # 2 -3946 3946 2 3.288283 -21.373838 -8.220707 # 2 -3947 3947 2 4.110353 -20.551767 -8.220707 # 2 -3948 3948 2 4.932424 -21.373838 -8.220707 # 2 -3949 3949 2 5.754495 -20.551767 -8.220707 # 2 -3950 3950 2 6.576566 -21.373838 -8.220707 # 2 -3951 3951 2 7.398636 -20.551767 -8.220707 # 2 -3952 3952 2 8.220707 -21.373838 -8.220707 # 2 -3953 3953 2 9.042778 -23.840050 -24.662121 # 2 -3954 3954 2 10.686919 -23.840050 -24.662121 # 2 -3955 3955 2 9.864848 -23.840050 -23.840050 # 2 -3956 3956 2 12.331060 -23.840050 -24.662121 # 2 -3957 3957 2 11.508989 -23.840050 -23.840050 # 2 -3958 3958 2 13.975202 -23.840050 -24.662121 # 2 -3959 3959 2 13.153131 -23.840050 -23.840050 # 2 -3960 3960 2 15.619343 -23.840050 -24.662121 # 2 -3961 3961 2 14.797273 -23.840050 -23.840050 # 2 -3962 3962 2 17.263485 -23.840050 -24.662121 # 2 -3963 3963 2 16.441414 -23.840050 -23.840050 # 2 -3964 3964 2 18.907625 -23.840050 -24.662121 # 2 -3965 3965 2 18.085556 -23.840050 -23.840050 # 2 -3966 3966 2 20.551767 -23.840050 -24.662121 # 2 -3967 3967 2 19.729696 -23.840050 -23.840050 # 2 -3968 3968 2 22.195910 -23.840050 -24.662121 # 2 -3969 3969 2 21.373838 -23.840050 -23.840050 # 2 -3970 3970 2 23.840050 -23.840050 -24.662121 # 2 -3971 3971 2 23.017979 -23.840050 -23.840050 # 2 -3972 3972 2 24.662121 -23.840050 -23.840050 # 2 -3973 3973 2 9.042778 -22.195910 -24.662121 # 2 -3974 3974 2 9.042778 -23.017979 -23.840050 # 2 -3975 3975 2 9.864848 -23.017979 -24.662121 # 2 -3976 3976 2 10.686919 -22.195910 -24.662121 # 2 -3977 3977 2 10.686919 -23.017979 -23.840050 # 2 -3978 3978 2 9.864848 -22.195910 -23.840050 # 2 -3979 3979 2 11.508989 -23.017979 -24.662121 # 2 -3980 3980 2 12.331060 -22.195910 -24.662121 # 2 -3981 3981 2 12.331060 -23.017979 -23.840050 # 2 -3982 3982 2 11.508989 -22.195910 -23.840050 # 2 -3983 3983 2 13.153131 -23.017979 -24.662121 # 2 -3984 3984 2 13.975202 -22.195910 -24.662121 # 2 -3985 3985 2 13.975202 -23.017979 -23.840050 # 2 -3986 3986 2 13.153131 -22.195910 -23.840050 # 2 -3987 3987 2 14.797273 -23.017979 -24.662121 # 2 -3988 3988 2 15.619343 -22.195910 -24.662121 # 2 -3989 3989 2 15.619343 -23.017979 -23.840050 # 2 -3990 3990 2 14.797273 -22.195910 -23.840050 # 2 -3991 3991 2 16.441414 -23.017979 -24.662121 # 2 -3992 3992 2 17.263485 -22.195910 -24.662121 # 2 -3993 3993 2 17.263485 -23.017979 -23.840050 # 2 -3994 3994 2 16.441414 -22.195910 -23.840050 # 2 -3995 3995 2 18.085556 -23.017979 -24.662121 # 2 -3996 3996 2 18.907625 -22.195910 -24.662121 # 2 -3997 3997 2 18.907625 -23.017979 -23.840050 # 2 -3998 3998 2 18.085556 -22.195910 -23.840050 # 2 -3999 3999 2 19.729696 -23.017979 -24.662121 # 2 -4000 4000 2 20.551767 -22.195910 -24.662121 # 2 -4001 4001 2 20.551767 -23.017979 -23.840050 # 2 -4002 4002 2 19.729696 -22.195910 -23.840050 # 2 -4003 4003 2 21.373838 -23.017979 -24.662121 # 2 -4004 4004 2 22.195910 -22.195910 -24.662121 # 2 -4005 4005 2 22.195910 -23.017979 -23.840050 # 2 -4006 4006 2 21.373838 -22.195910 -23.840050 # 2 -4007 4007 2 23.017979 -23.017979 -24.662121 # 2 -4008 4008 2 23.840050 -22.195910 -24.662121 # 2 -4009 4009 2 23.840050 -23.017979 -23.840050 # 2 -4010 4010 2 23.017979 -22.195910 -23.840050 # 2 -4011 4011 2 24.662121 -23.017979 -24.662121 # 2 -4012 4012 2 24.662121 -22.195910 -23.840050 # 2 -4013 4013 2 9.042778 -20.551767 -24.662121 # 2 -4014 4014 2 9.042778 -21.373838 -23.840050 # 2 -4015 4015 2 9.864848 -21.373838 -24.662121 # 2 -4016 4016 2 10.686919 -20.551767 -24.662121 # 2 -4017 4017 2 10.686919 -21.373838 -23.840050 # 2 -4018 4018 2 9.864848 -20.551767 -23.840050 # 2 -4019 4019 2 11.508989 -21.373838 -24.662121 # 2 -4020 4020 2 12.331060 -20.551767 -24.662121 # 2 -4021 4021 2 12.331060 -21.373838 -23.840050 # 2 -4022 4022 2 11.508989 -20.551767 -23.840050 # 2 -4023 4023 2 13.153131 -21.373838 -24.662121 # 2 -4024 4024 2 13.975202 -20.551767 -24.662121 # 2 -4025 4025 2 13.975202 -21.373838 -23.840050 # 2 -4026 4026 2 13.153131 -20.551767 -23.840050 # 2 -4027 4027 2 14.797273 -21.373838 -24.662121 # 2 -4028 4028 2 15.619343 -20.551767 -24.662121 # 2 -4029 4029 2 15.619343 -21.373838 -23.840050 # 2 -4030 4030 2 14.797273 -20.551767 -23.840050 # 2 -4031 4031 2 16.441414 -21.373838 -24.662121 # 2 -4032 4032 2 17.263485 -20.551767 -24.662121 # 2 -4033 4033 2 17.263485 -21.373838 -23.840050 # 2 -4034 4034 2 16.441414 -20.551767 -23.840050 # 2 -4035 4035 2 18.085556 -21.373838 -24.662121 # 2 -4036 4036 2 18.907625 -20.551767 -24.662121 # 2 -4037 4037 2 18.907625 -21.373838 -23.840050 # 2 -4038 4038 2 18.085556 -20.551767 -23.840050 # 2 -4039 4039 2 19.729696 -21.373838 -24.662121 # 2 -4040 4040 2 20.551767 -20.551767 -24.662121 # 2 -4041 4041 2 20.551767 -21.373838 -23.840050 # 2 -4042 4042 2 19.729696 -20.551767 -23.840050 # 2 -4043 4043 2 21.373838 -21.373838 -24.662121 # 2 -4044 4044 2 22.195910 -20.551767 -24.662121 # 2 -4045 4045 2 22.195910 -21.373838 -23.840050 # 2 -4046 4046 2 21.373838 -20.551767 -23.840050 # 2 -4047 4047 2 23.017979 -21.373838 -24.662121 # 2 -4048 4048 2 23.840050 -20.551767 -24.662121 # 2 -4049 4049 2 23.840050 -21.373838 -23.840050 # 2 -4050 4050 2 23.017979 -20.551767 -23.840050 # 2 -4051 4051 2 24.662121 -21.373838 -24.662121 # 2 -4052 4052 2 24.662121 -20.551767 -23.840050 # 2 -4053 4053 2 9.042778 -23.840050 -23.017979 # 2 -4054 4054 2 10.686919 -23.840050 -23.017979 # 2 -4055 4055 2 9.864848 -23.840050 -22.195910 # 2 -4056 4056 2 12.331060 -23.840050 -23.017979 # 2 -4057 4057 2 11.508989 -23.840050 -22.195910 # 2 -4058 4058 2 13.975202 -23.840050 -23.017979 # 2 -4059 4059 2 13.153131 -23.840050 -22.195910 # 2 -4060 4060 2 15.619343 -23.840050 -23.017979 # 2 -4061 4061 2 14.797273 -23.840050 -22.195910 # 2 -4062 4062 2 17.263485 -23.840050 -23.017979 # 2 -4063 4063 2 16.441414 -23.840050 -22.195910 # 2 -4064 4064 2 18.907625 -23.840050 -23.017979 # 2 -4065 4065 2 18.085556 -23.840050 -22.195910 # 2 -4066 4066 2 20.551767 -23.840050 -23.017979 # 2 -4067 4067 2 19.729696 -23.840050 -22.195910 # 2 -4068 4068 2 22.195910 -23.840050 -23.017979 # 2 -4069 4069 2 21.373838 -23.840050 -22.195910 # 2 -4070 4070 2 23.840050 -23.840050 -23.017979 # 2 -4071 4071 2 23.017979 -23.840050 -22.195910 # 2 -4072 4072 2 24.662121 -23.840050 -22.195910 # 2 -4073 4073 2 9.042778 -22.195910 -23.017979 # 2 -4074 4074 2 9.042778 -23.017979 -22.195910 # 2 -4075 4075 2 9.864848 -23.017979 -23.017979 # 2 -4076 4076 2 10.686919 -22.195910 -23.017979 # 2 -4077 4077 2 10.686919 -23.017979 -22.195910 # 2 -4078 4078 2 9.864848 -22.195910 -22.195910 # 2 -4079 4079 2 11.508989 -23.017979 -23.017979 # 2 -4080 4080 2 12.331060 -22.195910 -23.017979 # 2 -4081 4081 2 12.331060 -23.017979 -22.195910 # 2 -4082 4082 2 11.508989 -22.195910 -22.195910 # 2 -4083 4083 2 13.153131 -23.017979 -23.017979 # 2 -4084 4084 2 13.975202 -22.195910 -23.017979 # 2 -4085 4085 2 13.975202 -23.017979 -22.195910 # 2 -4086 4086 2 13.153131 -22.195910 -22.195910 # 2 -4087 4087 2 14.797273 -23.017979 -23.017979 # 2 -4088 4088 2 15.619343 -22.195910 -23.017979 # 2 -4089 4089 2 15.619343 -23.017979 -22.195910 # 2 -4090 4090 2 14.797273 -22.195910 -22.195910 # 2 -4091 4091 2 16.441414 -23.017979 -23.017979 # 2 -4092 4092 2 17.263485 -22.195910 -23.017979 # 2 -4093 4093 2 17.263485 -23.017979 -22.195910 # 2 -4094 4094 2 16.441414 -22.195910 -22.195910 # 2 -4095 4095 2 18.085556 -23.017979 -23.017979 # 2 -4096 4096 2 18.907625 -22.195910 -23.017979 # 2 -4097 4097 2 18.907625 -23.017979 -22.195910 # 2 -4098 4098 2 18.085556 -22.195910 -22.195910 # 2 -4099 4099 2 19.729696 -23.017979 -23.017979 # 2 -4100 4100 2 20.551767 -22.195910 -23.017979 # 2 -4101 4101 2 20.551767 -23.017979 -22.195910 # 2 -4102 4102 2 19.729696 -22.195910 -22.195910 # 2 -4103 4103 2 21.373838 -23.017979 -23.017979 # 2 -4104 4104 2 22.195910 -22.195910 -23.017979 # 2 -4105 4105 2 22.195910 -23.017979 -22.195910 # 2 -4106 4106 2 21.373838 -22.195910 -22.195910 # 2 -4107 4107 2 23.017979 -23.017979 -23.017979 # 2 -4108 4108 2 23.840050 -22.195910 -23.017979 # 2 -4109 4109 2 23.840050 -23.017979 -22.195910 # 2 -4110 4110 2 23.017979 -22.195910 -22.195910 # 2 -4111 4111 2 24.662121 -23.017979 -23.017979 # 2 -4112 4112 2 24.662121 -22.195910 -22.195910 # 2 -4113 4113 2 9.042778 -20.551767 -23.017979 # 2 -4114 4114 2 9.042778 -21.373838 -22.195910 # 2 -4115 4115 2 9.864848 -21.373838 -23.017979 # 2 -4116 4116 2 10.686919 -20.551767 -23.017979 # 2 -4117 4117 2 10.686919 -21.373838 -22.195910 # 2 -4118 4118 2 9.864848 -20.551767 -22.195910 # 2 -4119 4119 2 11.508989 -21.373838 -23.017979 # 2 -4120 4120 2 12.331060 -20.551767 -23.017979 # 2 -4121 4121 2 12.331060 -21.373838 -22.195910 # 2 -4122 4122 2 11.508989 -20.551767 -22.195910 # 2 -4123 4123 2 13.153131 -21.373838 -23.017979 # 2 -4124 4124 2 13.975202 -20.551767 -23.017979 # 2 -4125 4125 2 13.975202 -21.373838 -22.195910 # 2 -4126 4126 2 13.153131 -20.551767 -22.195910 # 2 -4127 4127 2 14.797273 -21.373838 -23.017979 # 2 -4128 4128 2 15.619343 -20.551767 -23.017979 # 2 -4129 4129 2 15.619343 -21.373838 -22.195910 # 2 -4130 4130 2 14.797273 -20.551767 -22.195910 # 2 -4131 4131 2 16.441414 -21.373838 -23.017979 # 2 -4132 4132 2 17.263485 -20.551767 -23.017979 # 2 -4133 4133 2 17.263485 -21.373838 -22.195910 # 2 -4134 4134 2 16.441414 -20.551767 -22.195910 # 2 -4135 4135 2 18.085556 -21.373838 -23.017979 # 2 -4136 4136 2 18.907625 -20.551767 -23.017979 # 2 -4137 4137 2 18.907625 -21.373838 -22.195910 # 2 -4138 4138 2 18.085556 -20.551767 -22.195910 # 2 -4139 4139 2 19.729696 -21.373838 -23.017979 # 2 -4140 4140 2 20.551767 -20.551767 -23.017979 # 2 -4141 4141 2 20.551767 -21.373838 -22.195910 # 2 -4142 4142 2 19.729696 -20.551767 -22.195910 # 2 -4143 4143 2 21.373838 -21.373838 -23.017979 # 2 -4144 4144 2 22.195910 -20.551767 -23.017979 # 2 -4145 4145 2 22.195910 -21.373838 -22.195910 # 2 -4146 4146 2 21.373838 -20.551767 -22.195910 # 2 -4147 4147 2 23.017979 -21.373838 -23.017979 # 2 -4148 4148 2 23.840050 -20.551767 -23.017979 # 2 -4149 4149 2 23.840050 -21.373838 -22.195910 # 2 -4150 4150 2 23.017979 -20.551767 -22.195910 # 2 -4151 4151 2 24.662121 -21.373838 -23.017979 # 2 -4152 4152 2 24.662121 -20.551767 -22.195910 # 2 -4153 4153 2 9.042778 -23.840050 -21.373838 # 2 -4154 4154 2 10.686919 -23.840050 -21.373838 # 2 -4155 4155 2 9.864848 -23.840050 -20.551767 # 2 -4156 4156 2 12.331060 -23.840050 -21.373838 # 2 -4157 4157 2 11.508989 -23.840050 -20.551767 # 2 -4158 4158 2 13.975202 -23.840050 -21.373838 # 2 -4159 4159 2 13.153131 -23.840050 -20.551767 # 2 -4160 4160 2 15.619343 -23.840050 -21.373838 # 2 -4161 4161 2 14.797273 -23.840050 -20.551767 # 2 -4162 4162 2 17.263485 -23.840050 -21.373838 # 2 -4163 4163 2 16.441414 -23.840050 -20.551767 # 2 -4164 4164 2 18.907625 -23.840050 -21.373838 # 2 -4165 4165 2 18.085556 -23.840050 -20.551767 # 2 -4166 4166 2 20.551767 -23.840050 -21.373838 # 2 -4167 4167 2 19.729696 -23.840050 -20.551767 # 2 -4168 4168 2 22.195910 -23.840050 -21.373838 # 2 -4169 4169 2 21.373838 -23.840050 -20.551767 # 2 -4170 4170 2 23.840050 -23.840050 -21.373838 # 2 -4171 4171 2 23.017979 -23.840050 -20.551767 # 2 -4172 4172 2 24.662121 -23.840050 -20.551767 # 2 -4173 4173 2 9.042778 -22.195910 -21.373838 # 2 -4174 4174 2 9.042778 -23.017979 -20.551767 # 2 -4175 4175 2 9.864848 -23.017979 -21.373838 # 2 -4176 4176 2 10.686919 -22.195910 -21.373838 # 2 -4177 4177 2 10.686919 -23.017979 -20.551767 # 2 -4178 4178 2 9.864848 -22.195910 -20.551767 # 2 -4179 4179 2 11.508989 -23.017979 -21.373838 # 2 -4180 4180 2 12.331060 -22.195910 -21.373838 # 2 -4181 4181 2 12.331060 -23.017979 -20.551767 # 2 -4182 4182 2 11.508989 -22.195910 -20.551767 # 2 -4183 4183 2 13.153131 -23.017979 -21.373838 # 2 -4184 4184 2 13.975202 -22.195910 -21.373838 # 2 -4185 4185 2 13.975202 -23.017979 -20.551767 # 2 -4186 4186 2 13.153131 -22.195910 -20.551767 # 2 -4187 4187 2 14.797273 -23.017979 -21.373838 # 2 -4188 4188 2 15.619343 -22.195910 -21.373838 # 2 -4189 4189 2 15.619343 -23.017979 -20.551767 # 2 -4190 4190 2 14.797273 -22.195910 -20.551767 # 2 -4191 4191 2 16.441414 -23.017979 -21.373838 # 2 -4192 4192 2 17.263485 -22.195910 -21.373838 # 2 -4193 4193 2 17.263485 -23.017979 -20.551767 # 2 -4194 4194 2 16.441414 -22.195910 -20.551767 # 2 -4195 4195 2 18.085556 -23.017979 -21.373838 # 2 -4196 4196 2 18.907625 -22.195910 -21.373838 # 2 -4197 4197 2 18.907625 -23.017979 -20.551767 # 2 -4198 4198 2 18.085556 -22.195910 -20.551767 # 2 -4199 4199 2 19.729696 -23.017979 -21.373838 # 2 -4200 4200 2 20.551767 -22.195910 -21.373838 # 2 -4201 4201 2 20.551767 -23.017979 -20.551767 # 2 -4202 4202 2 19.729696 -22.195910 -20.551767 # 2 -4203 4203 2 21.373838 -23.017979 -21.373838 # 2 -4204 4204 2 22.195910 -22.195910 -21.373838 # 2 -4205 4205 2 22.195910 -23.017979 -20.551767 # 2 -4206 4206 2 21.373838 -22.195910 -20.551767 # 2 -4207 4207 2 23.017979 -23.017979 -21.373838 # 2 -4208 4208 2 23.840050 -22.195910 -21.373838 # 2 -4209 4209 2 23.840050 -23.017979 -20.551767 # 2 -4210 4210 2 23.017979 -22.195910 -20.551767 # 2 -4211 4211 2 24.662121 -23.017979 -21.373838 # 2 -4212 4212 2 24.662121 -22.195910 -20.551767 # 2 -4213 4213 2 9.042778 -20.551767 -21.373838 # 2 -4214 4214 2 9.042778 -21.373838 -20.551767 # 2 -4215 4215 2 9.864848 -21.373838 -21.373838 # 2 -4216 4216 2 10.686919 -20.551767 -21.373838 # 2 -4217 4217 2 10.686919 -21.373838 -20.551767 # 2 -4218 4218 2 9.864848 -20.551767 -20.551767 # 2 -4219 4219 2 11.508989 -21.373838 -21.373838 # 2 -4220 4220 2 12.331060 -20.551767 -21.373838 # 2 -4221 4221 2 12.331060 -21.373838 -20.551767 # 2 -4222 4222 2 11.508989 -20.551767 -20.551767 # 2 -4223 4223 2 13.153131 -21.373838 -21.373838 # 2 -4224 4224 2 13.975202 -20.551767 -21.373838 # 2 -4225 4225 2 13.975202 -21.373838 -20.551767 # 2 -4226 4226 2 13.153131 -20.551767 -20.551767 # 2 -4227 4227 2 14.797273 -21.373838 -21.373838 # 2 -4228 4228 2 15.619343 -20.551767 -21.373838 # 2 -4229 4229 2 15.619343 -21.373838 -20.551767 # 2 -4230 4230 2 14.797273 -20.551767 -20.551767 # 2 -4231 4231 2 16.441414 -21.373838 -21.373838 # 2 -4232 4232 2 17.263485 -20.551767 -21.373838 # 2 -4233 4233 2 17.263485 -21.373838 -20.551767 # 2 -4234 4234 2 16.441414 -20.551767 -20.551767 # 2 -4235 4235 2 18.085556 -21.373838 -21.373838 # 2 -4236 4236 2 18.907625 -20.551767 -21.373838 # 2 -4237 4237 2 18.907625 -21.373838 -20.551767 # 2 -4238 4238 2 18.085556 -20.551767 -20.551767 # 2 -4239 4239 2 19.729696 -21.373838 -21.373838 # 2 -4240 4240 2 20.551767 -20.551767 -21.373838 # 2 -4241 4241 2 20.551767 -21.373838 -20.551767 # 2 -4242 4242 2 19.729696 -20.551767 -20.551767 # 2 -4243 4243 2 21.373838 -21.373838 -21.373838 # 2 -4244 4244 2 22.195910 -20.551767 -21.373838 # 2 -4245 4245 2 22.195910 -21.373838 -20.551767 # 2 -4246 4246 2 21.373838 -20.551767 -20.551767 # 2 -4247 4247 2 23.017979 -21.373838 -21.373838 # 2 -4248 4248 2 23.840050 -20.551767 -21.373838 # 2 -4249 4249 2 23.840050 -21.373838 -20.551767 # 2 -4250 4250 2 23.017979 -20.551767 -20.551767 # 2 -4251 4251 2 24.662121 -21.373838 -21.373838 # 2 -4252 4252 2 24.662121 -20.551767 -20.551767 # 2 -4253 4253 2 9.042778 -23.840050 -19.729696 # 2 -4254 4254 2 10.686919 -23.840050 -19.729696 # 2 -4255 4255 2 9.864848 -23.840050 -18.907625 # 2 -4256 4256 2 12.331060 -23.840050 -19.729696 # 2 -4257 4257 2 11.508989 -23.840050 -18.907625 # 2 -4258 4258 2 13.975202 -23.840050 -19.729696 # 2 -4259 4259 2 13.153131 -23.840050 -18.907625 # 2 -4260 4260 2 15.619343 -23.840050 -19.729696 # 2 -4261 4261 2 14.797273 -23.840050 -18.907625 # 2 -4262 4262 2 17.263485 -23.840050 -19.729696 # 2 -4263 4263 2 16.441414 -23.840050 -18.907625 # 2 -4264 4264 2 18.907625 -23.840050 -19.729696 # 2 -4265 4265 2 18.085556 -23.840050 -18.907625 # 2 -4266 4266 2 20.551767 -23.840050 -19.729696 # 2 -4267 4267 2 19.729696 -23.840050 -18.907625 # 2 -4268 4268 2 22.195910 -23.840050 -19.729696 # 2 -4269 4269 2 21.373838 -23.840050 -18.907625 # 2 -4270 4270 2 23.840050 -23.840050 -19.729696 # 2 -4271 4271 2 23.017979 -23.840050 -18.907625 # 2 -4272 4272 2 24.662121 -23.840050 -18.907625 # 2 -4273 4273 2 9.042778 -22.195910 -19.729696 # 2 -4274 4274 2 9.042778 -23.017979 -18.907625 # 2 -4275 4275 2 9.864848 -23.017979 -19.729696 # 2 -4276 4276 2 10.686919 -22.195910 -19.729696 # 2 -4277 4277 2 10.686919 -23.017979 -18.907625 # 2 -4278 4278 2 9.864848 -22.195910 -18.907625 # 2 -4279 4279 2 11.508989 -23.017979 -19.729696 # 2 -4280 4280 2 12.331060 -22.195910 -19.729696 # 2 -4281 4281 2 12.331060 -23.017979 -18.907625 # 2 -4282 4282 2 11.508989 -22.195910 -18.907625 # 2 -4283 4283 2 13.153131 -23.017979 -19.729696 # 2 -4284 4284 2 13.975202 -22.195910 -19.729696 # 2 -4285 4285 2 13.975202 -23.017979 -18.907625 # 2 -4286 4286 2 13.153131 -22.195910 -18.907625 # 2 -4287 4287 2 14.797273 -23.017979 -19.729696 # 2 -4288 4288 2 15.619343 -22.195910 -19.729696 # 2 -4289 4289 2 15.619343 -23.017979 -18.907625 # 2 -4290 4290 2 14.797273 -22.195910 -18.907625 # 2 -4291 4291 2 16.441414 -23.017979 -19.729696 # 2 -4292 4292 2 17.263485 -22.195910 -19.729696 # 2 -4293 4293 2 17.263485 -23.017979 -18.907625 # 2 -4294 4294 2 16.441414 -22.195910 -18.907625 # 2 -4295 4295 2 18.085556 -23.017979 -19.729696 # 2 -4296 4296 2 18.907625 -22.195910 -19.729696 # 2 -4297 4297 2 18.907625 -23.017979 -18.907625 # 2 -4298 4298 2 18.085556 -22.195910 -18.907625 # 2 -4299 4299 2 19.729696 -23.017979 -19.729696 # 2 -4300 4300 2 20.551767 -22.195910 -19.729696 # 2 -4301 4301 2 20.551767 -23.017979 -18.907625 # 2 -4302 4302 2 19.729696 -22.195910 -18.907625 # 2 -4303 4303 2 21.373838 -23.017979 -19.729696 # 2 -4304 4304 2 22.195910 -22.195910 -19.729696 # 2 -4305 4305 2 22.195910 -23.017979 -18.907625 # 2 -4306 4306 2 21.373838 -22.195910 -18.907625 # 2 -4307 4307 2 23.017979 -23.017979 -19.729696 # 2 -4308 4308 2 23.840050 -22.195910 -19.729696 # 2 -4309 4309 2 23.840050 -23.017979 -18.907625 # 2 -4310 4310 2 23.017979 -22.195910 -18.907625 # 2 -4311 4311 2 24.662121 -23.017979 -19.729696 # 2 -4312 4312 2 24.662121 -22.195910 -18.907625 # 2 -4313 4313 2 9.042778 -20.551767 -19.729696 # 2 -4314 4314 2 9.042778 -21.373838 -18.907625 # 2 -4315 4315 2 9.864848 -21.373838 -19.729696 # 2 -4316 4316 2 10.686919 -20.551767 -19.729696 # 2 -4317 4317 2 10.686919 -21.373838 -18.907625 # 2 -4318 4318 2 9.864848 -20.551767 -18.907625 # 2 -4319 4319 2 11.508989 -21.373838 -19.729696 # 2 -4320 4320 2 12.331060 -20.551767 -19.729696 # 2 -4321 4321 2 12.331060 -21.373838 -18.907625 # 2 -4322 4322 2 11.508989 -20.551767 -18.907625 # 2 -4323 4323 2 13.153131 -21.373838 -19.729696 # 2 -4324 4324 2 13.975202 -20.551767 -19.729696 # 2 -4325 4325 2 13.975202 -21.373838 -18.907625 # 2 -4326 4326 2 13.153131 -20.551767 -18.907625 # 2 -4327 4327 2 14.797273 -21.373838 -19.729696 # 2 -4328 4328 2 15.619343 -20.551767 -19.729696 # 2 -4329 4329 2 15.619343 -21.373838 -18.907625 # 2 -4330 4330 2 14.797273 -20.551767 -18.907625 # 2 -4331 4331 2 16.441414 -21.373838 -19.729696 # 2 -4332 4332 2 17.263485 -20.551767 -19.729696 # 2 -4333 4333 2 17.263485 -21.373838 -18.907625 # 2 -4334 4334 2 16.441414 -20.551767 -18.907625 # 2 -4335 4335 2 18.085556 -21.373838 -19.729696 # 2 -4336 4336 2 18.907625 -20.551767 -19.729696 # 2 -4337 4337 2 18.907625 -21.373838 -18.907625 # 2 -4338 4338 2 18.085556 -20.551767 -18.907625 # 2 -4339 4339 2 19.729696 -21.373838 -19.729696 # 2 -4340 4340 2 20.551767 -20.551767 -19.729696 # 2 -4341 4341 2 20.551767 -21.373838 -18.907625 # 2 -4342 4342 2 19.729696 -20.551767 -18.907625 # 2 -4343 4343 2 21.373838 -21.373838 -19.729696 # 2 -4344 4344 2 22.195910 -20.551767 -19.729696 # 2 -4345 4345 2 22.195910 -21.373838 -18.907625 # 2 -4346 4346 2 21.373838 -20.551767 -18.907625 # 2 -4347 4347 2 23.017979 -21.373838 -19.729696 # 2 -4348 4348 2 23.840050 -20.551767 -19.729696 # 2 -4349 4349 2 23.840050 -21.373838 -18.907625 # 2 -4350 4350 2 23.017979 -20.551767 -18.907625 # 2 -4351 4351 2 24.662121 -21.373838 -19.729696 # 2 -4352 4352 2 24.662121 -20.551767 -18.907625 # 2 -4353 4353 2 9.042778 -23.840050 -18.085556 # 2 -4354 4354 2 10.686919 -23.840050 -18.085556 # 2 -4355 4355 2 9.864848 -23.840050 -17.263485 # 2 -4356 4356 2 12.331060 -23.840050 -18.085556 # 2 -4357 4357 2 11.508989 -23.840050 -17.263485 # 2 -4358 4358 2 13.975202 -23.840050 -18.085556 # 2 -4359 4359 2 13.153131 -23.840050 -17.263485 # 2 -4360 4360 2 15.619343 -23.840050 -18.085556 # 2 -4361 4361 2 14.797273 -23.840050 -17.263485 # 2 -4362 4362 2 17.263485 -23.840050 -18.085556 # 2 -4363 4363 2 16.441414 -23.840050 -17.263485 # 2 -4364 4364 2 18.907625 -23.840050 -18.085556 # 2 -4365 4365 2 18.085556 -23.840050 -17.263485 # 2 -4366 4366 2 20.551767 -23.840050 -18.085556 # 2 -4367 4367 2 19.729696 -23.840050 -17.263485 # 2 -4368 4368 2 22.195910 -23.840050 -18.085556 # 2 -4369 4369 2 21.373838 -23.840050 -17.263485 # 2 -4370 4370 2 23.840050 -23.840050 -18.085556 # 2 -4371 4371 2 23.017979 -23.840050 -17.263485 # 2 -4372 4372 2 24.662121 -23.840050 -17.263485 # 2 -4373 4373 2 9.042778 -22.195910 -18.085556 # 2 -4374 4374 2 9.042778 -23.017979 -17.263485 # 2 -4375 4375 2 9.864848 -23.017979 -18.085556 # 2 -4376 4376 2 10.686919 -22.195910 -18.085556 # 2 -4377 4377 2 10.686919 -23.017979 -17.263485 # 2 -4378 4378 2 9.864848 -22.195910 -17.263485 # 2 -4379 4379 2 11.508989 -23.017979 -18.085556 # 2 -4380 4380 2 12.331060 -22.195910 -18.085556 # 2 -4381 4381 2 12.331060 -23.017979 -17.263485 # 2 -4382 4382 2 11.508989 -22.195910 -17.263485 # 2 -4383 4383 2 13.153131 -23.017979 -18.085556 # 2 -4384 4384 2 13.975202 -22.195910 -18.085556 # 2 -4385 4385 2 13.975202 -23.017979 -17.263485 # 2 -4386 4386 2 13.153131 -22.195910 -17.263485 # 2 -4387 4387 2 14.797273 -23.017979 -18.085556 # 2 -4388 4388 2 15.619343 -22.195910 -18.085556 # 2 -4389 4389 2 15.619343 -23.017979 -17.263485 # 2 -4390 4390 2 14.797273 -22.195910 -17.263485 # 2 -4391 4391 2 16.441414 -23.017979 -18.085556 # 2 -4392 4392 2 17.263485 -22.195910 -18.085556 # 2 -4393 4393 2 17.263485 -23.017979 -17.263485 # 2 -4394 4394 2 16.441414 -22.195910 -17.263485 # 2 -4395 4395 2 18.085556 -23.017979 -18.085556 # 2 -4396 4396 2 18.907625 -22.195910 -18.085556 # 2 -4397 4397 2 18.907625 -23.017979 -17.263485 # 2 -4398 4398 2 18.085556 -22.195910 -17.263485 # 2 -4399 4399 2 19.729696 -23.017979 -18.085556 # 2 -4400 4400 2 20.551767 -22.195910 -18.085556 # 2 -4401 4401 2 20.551767 -23.017979 -17.263485 # 2 -4402 4402 2 19.729696 -22.195910 -17.263485 # 2 -4403 4403 2 21.373838 -23.017979 -18.085556 # 2 -4404 4404 2 22.195910 -22.195910 -18.085556 # 2 -4405 4405 2 22.195910 -23.017979 -17.263485 # 2 -4406 4406 2 21.373838 -22.195910 -17.263485 # 2 -4407 4407 2 23.017979 -23.017979 -18.085556 # 2 -4408 4408 2 23.840050 -22.195910 -18.085556 # 2 -4409 4409 2 23.840050 -23.017979 -17.263485 # 2 -4410 4410 2 23.017979 -22.195910 -17.263485 # 2 -4411 4411 2 24.662121 -23.017979 -18.085556 # 2 -4412 4412 2 24.662121 -22.195910 -17.263485 # 2 -4413 4413 2 9.042778 -20.551767 -18.085556 # 2 -4414 4414 2 9.042778 -21.373838 -17.263485 # 2 -4415 4415 2 9.864848 -21.373838 -18.085556 # 2 -4416 4416 2 10.686919 -20.551767 -18.085556 # 2 -4417 4417 2 10.686919 -21.373838 -17.263485 # 2 -4418 4418 2 9.864848 -20.551767 -17.263485 # 2 -4419 4419 2 11.508989 -21.373838 -18.085556 # 2 -4420 4420 2 12.331060 -20.551767 -18.085556 # 2 -4421 4421 2 12.331060 -21.373838 -17.263485 # 2 -4422 4422 2 11.508989 -20.551767 -17.263485 # 2 -4423 4423 2 13.153131 -21.373838 -18.085556 # 2 -4424 4424 2 13.975202 -20.551767 -18.085556 # 2 -4425 4425 2 13.975202 -21.373838 -17.263485 # 2 -4426 4426 2 13.153131 -20.551767 -17.263485 # 2 -4427 4427 2 14.797273 -21.373838 -18.085556 # 2 -4428 4428 2 15.619343 -20.551767 -18.085556 # 2 -4429 4429 2 15.619343 -21.373838 -17.263485 # 2 -4430 4430 2 14.797273 -20.551767 -17.263485 # 2 -4431 4431 2 16.441414 -21.373838 -18.085556 # 2 -4432 4432 2 17.263485 -20.551767 -18.085556 # 2 -4433 4433 2 17.263485 -21.373838 -17.263485 # 2 -4434 4434 2 16.441414 -20.551767 -17.263485 # 2 -4435 4435 2 18.085556 -21.373838 -18.085556 # 2 -4436 4436 2 18.907625 -20.551767 -18.085556 # 2 -4437 4437 2 18.907625 -21.373838 -17.263485 # 2 -4438 4438 2 18.085556 -20.551767 -17.263485 # 2 -4439 4439 2 19.729696 -21.373838 -18.085556 # 2 -4440 4440 2 20.551767 -20.551767 -18.085556 # 2 -4441 4441 2 20.551767 -21.373838 -17.263485 # 2 -4442 4442 2 19.729696 -20.551767 -17.263485 # 2 -4443 4443 2 21.373838 -21.373838 -18.085556 # 2 -4444 4444 2 22.195910 -20.551767 -18.085556 # 2 -4445 4445 2 22.195910 -21.373838 -17.263485 # 2 -4446 4446 2 21.373838 -20.551767 -17.263485 # 2 -4447 4447 2 23.017979 -21.373838 -18.085556 # 2 -4448 4448 2 23.840050 -20.551767 -18.085556 # 2 -4449 4449 2 23.840050 -21.373838 -17.263485 # 2 -4450 4450 2 23.017979 -20.551767 -17.263485 # 2 -4451 4451 2 24.662121 -21.373838 -18.085556 # 2 -4452 4452 2 24.662121 -20.551767 -17.263485 # 2 -4453 4453 2 9.042778 -23.840050 -16.441414 # 2 -4454 4454 2 10.686919 -23.840050 -16.441414 # 2 -4455 4455 2 9.864848 -23.840050 -15.619343 # 2 -4456 4456 2 12.331060 -23.840050 -16.441414 # 2 -4457 4457 2 11.508989 -23.840050 -15.619343 # 2 -4458 4458 2 13.975202 -23.840050 -16.441414 # 2 -4459 4459 2 13.153131 -23.840050 -15.619343 # 2 -4460 4460 2 15.619343 -23.840050 -16.441414 # 2 -4461 4461 2 14.797273 -23.840050 -15.619343 # 2 -4462 4462 2 17.263485 -23.840050 -16.441414 # 2 -4463 4463 2 16.441414 -23.840050 -15.619343 # 2 -4464 4464 2 18.907625 -23.840050 -16.441414 # 2 -4465 4465 2 18.085556 -23.840050 -15.619343 # 2 -4466 4466 2 20.551767 -23.840050 -16.441414 # 2 -4467 4467 2 19.729696 -23.840050 -15.619343 # 2 -4468 4468 2 22.195910 -23.840050 -16.441414 # 2 -4469 4469 2 21.373838 -23.840050 -15.619343 # 2 -4470 4470 2 23.840050 -23.840050 -16.441414 # 2 -4471 4471 2 23.017979 -23.840050 -15.619343 # 2 -4472 4472 2 24.662121 -23.840050 -15.619343 # 2 -4473 4473 2 9.042778 -22.195910 -16.441414 # 2 -4474 4474 2 9.042778 -23.017979 -15.619343 # 2 -4475 4475 2 9.864848 -23.017979 -16.441414 # 2 -4476 4476 2 10.686919 -22.195910 -16.441414 # 2 -4477 4477 2 10.686919 -23.017979 -15.619343 # 2 -4478 4478 2 9.864848 -22.195910 -15.619343 # 2 -4479 4479 2 11.508989 -23.017979 -16.441414 # 2 -4480 4480 2 12.331060 -22.195910 -16.441414 # 2 -4481 4481 2 12.331060 -23.017979 -15.619343 # 2 -4482 4482 2 11.508989 -22.195910 -15.619343 # 2 -4483 4483 2 13.153131 -23.017979 -16.441414 # 2 -4484 4484 2 13.975202 -22.195910 -16.441414 # 2 -4485 4485 2 13.975202 -23.017979 -15.619343 # 2 -4486 4486 2 13.153131 -22.195910 -15.619343 # 2 -4487 4487 2 14.797273 -23.017979 -16.441414 # 2 -4488 4488 2 15.619343 -22.195910 -16.441414 # 2 -4489 4489 2 15.619343 -23.017979 -15.619343 # 2 -4490 4490 2 14.797273 -22.195910 -15.619343 # 2 -4491 4491 2 16.441414 -23.017979 -16.441414 # 2 -4492 4492 2 17.263485 -22.195910 -16.441414 # 2 -4493 4493 2 17.263485 -23.017979 -15.619343 # 2 -4494 4494 2 16.441414 -22.195910 -15.619343 # 2 -4495 4495 2 18.085556 -23.017979 -16.441414 # 2 -4496 4496 2 18.907625 -22.195910 -16.441414 # 2 -4497 4497 2 18.907625 -23.017979 -15.619343 # 2 -4498 4498 2 18.085556 -22.195910 -15.619343 # 2 -4499 4499 2 19.729696 -23.017979 -16.441414 # 2 -4500 4500 2 20.551767 -22.195910 -16.441414 # 2 -4501 4501 2 20.551767 -23.017979 -15.619343 # 2 -4502 4502 2 19.729696 -22.195910 -15.619343 # 2 -4503 4503 2 21.373838 -23.017979 -16.441414 # 2 -4504 4504 2 22.195910 -22.195910 -16.441414 # 2 -4505 4505 2 22.195910 -23.017979 -15.619343 # 2 -4506 4506 2 21.373838 -22.195910 -15.619343 # 2 -4507 4507 2 23.017979 -23.017979 -16.441414 # 2 -4508 4508 2 23.840050 -22.195910 -16.441414 # 2 -4509 4509 2 23.840050 -23.017979 -15.619343 # 2 -4510 4510 2 23.017979 -22.195910 -15.619343 # 2 -4511 4511 2 24.662121 -23.017979 -16.441414 # 2 -4512 4512 2 24.662121 -22.195910 -15.619343 # 2 -4513 4513 2 9.042778 -20.551767 -16.441414 # 2 -4514 4514 2 9.042778 -21.373838 -15.619343 # 2 -4515 4515 2 9.864848 -21.373838 -16.441414 # 2 -4516 4516 2 10.686919 -20.551767 -16.441414 # 2 -4517 4517 2 10.686919 -21.373838 -15.619343 # 2 -4518 4518 2 9.864848 -20.551767 -15.619343 # 2 -4519 4519 2 11.508989 -21.373838 -16.441414 # 2 -4520 4520 2 12.331060 -20.551767 -16.441414 # 2 -4521 4521 2 12.331060 -21.373838 -15.619343 # 2 -4522 4522 2 11.508989 -20.551767 -15.619343 # 2 -4523 4523 2 13.153131 -21.373838 -16.441414 # 2 -4524 4524 2 13.975202 -20.551767 -16.441414 # 2 -4525 4525 2 13.975202 -21.373838 -15.619343 # 2 -4526 4526 2 13.153131 -20.551767 -15.619343 # 2 -4527 4527 2 14.797273 -21.373838 -16.441414 # 2 -4528 4528 2 15.619343 -20.551767 -16.441414 # 2 -4529 4529 2 15.619343 -21.373838 -15.619343 # 2 -4530 4530 2 14.797273 -20.551767 -15.619343 # 2 -4531 4531 2 16.441414 -21.373838 -16.441414 # 2 -4532 4532 2 17.263485 -20.551767 -16.441414 # 2 -4533 4533 2 17.263485 -21.373838 -15.619343 # 2 -4534 4534 2 16.441414 -20.551767 -15.619343 # 2 -4535 4535 2 18.085556 -21.373838 -16.441414 # 2 -4536 4536 2 18.907625 -20.551767 -16.441414 # 2 -4537 4537 2 18.907625 -21.373838 -15.619343 # 2 -4538 4538 2 18.085556 -20.551767 -15.619343 # 2 -4539 4539 2 19.729696 -21.373838 -16.441414 # 2 -4540 4540 2 20.551767 -20.551767 -16.441414 # 2 -4541 4541 2 20.551767 -21.373838 -15.619343 # 2 -4542 4542 2 19.729696 -20.551767 -15.619343 # 2 -4543 4543 2 21.373838 -21.373838 -16.441414 # 2 -4544 4544 2 22.195910 -20.551767 -16.441414 # 2 -4545 4545 2 22.195910 -21.373838 -15.619343 # 2 -4546 4546 2 21.373838 -20.551767 -15.619343 # 2 -4547 4547 2 23.017979 -21.373838 -16.441414 # 2 -4548 4548 2 23.840050 -20.551767 -16.441414 # 2 -4549 4549 2 23.840050 -21.373838 -15.619343 # 2 -4550 4550 2 23.017979 -20.551767 -15.619343 # 2 -4551 4551 2 24.662121 -21.373838 -16.441414 # 2 -4552 4552 2 24.662121 -20.551767 -15.619343 # 2 -4553 4553 2 9.042778 -23.840050 -14.797273 # 2 -4554 4554 2 10.686919 -23.840050 -14.797273 # 2 -4555 4555 2 9.864848 -23.840050 -13.975202 # 2 -4556 4556 2 12.331060 -23.840050 -14.797273 # 2 -4557 4557 2 11.508989 -23.840050 -13.975202 # 2 -4558 4558 2 13.975202 -23.840050 -14.797273 # 2 -4559 4559 2 13.153131 -23.840050 -13.975202 # 2 -4560 4560 2 15.619343 -23.840050 -14.797273 # 2 -4561 4561 2 14.797273 -23.840050 -13.975202 # 2 -4562 4562 2 17.263485 -23.840050 -14.797273 # 2 -4563 4563 2 16.441414 -23.840050 -13.975202 # 2 -4564 4564 2 18.907625 -23.840050 -14.797273 # 2 -4565 4565 2 18.085556 -23.840050 -13.975202 # 2 -4566 4566 2 20.551767 -23.840050 -14.797273 # 2 -4567 4567 2 19.729696 -23.840050 -13.975202 # 2 -4568 4568 2 22.195910 -23.840050 -14.797273 # 2 -4569 4569 2 21.373838 -23.840050 -13.975202 # 2 -4570 4570 2 23.840050 -23.840050 -14.797273 # 2 -4571 4571 2 23.017979 -23.840050 -13.975202 # 2 -4572 4572 2 24.662121 -23.840050 -13.975202 # 2 -4573 4573 2 9.042778 -22.195910 -14.797273 # 2 -4574 4574 2 9.042778 -23.017979 -13.975202 # 2 -4575 4575 2 9.864848 -23.017979 -14.797273 # 2 -4576 4576 2 10.686919 -22.195910 -14.797273 # 2 -4577 4577 2 10.686919 -23.017979 -13.975202 # 2 -4578 4578 2 9.864848 -22.195910 -13.975202 # 2 -4579 4579 2 11.508989 -23.017979 -14.797273 # 2 -4580 4580 2 12.331060 -22.195910 -14.797273 # 2 -4581 4581 2 12.331060 -23.017979 -13.975202 # 2 -4582 4582 2 11.508989 -22.195910 -13.975202 # 2 -4583 4583 2 13.153131 -23.017979 -14.797273 # 2 -4584 4584 2 13.975202 -22.195910 -14.797273 # 2 -4585 4585 2 13.975202 -23.017979 -13.975202 # 2 -4586 4586 2 13.153131 -22.195910 -13.975202 # 2 -4587 4587 2 14.797273 -23.017979 -14.797273 # 2 -4588 4588 2 15.619343 -22.195910 -14.797273 # 2 -4589 4589 2 15.619343 -23.017979 -13.975202 # 2 -4590 4590 2 14.797273 -22.195910 -13.975202 # 2 -4591 4591 2 16.441414 -23.017979 -14.797273 # 2 -4592 4592 2 17.263485 -22.195910 -14.797273 # 2 -4593 4593 2 17.263485 -23.017979 -13.975202 # 2 -4594 4594 2 16.441414 -22.195910 -13.975202 # 2 -4595 4595 2 18.085556 -23.017979 -14.797273 # 2 -4596 4596 2 18.907625 -22.195910 -14.797273 # 2 -4597 4597 2 18.907625 -23.017979 -13.975202 # 2 -4598 4598 2 18.085556 -22.195910 -13.975202 # 2 -4599 4599 2 19.729696 -23.017979 -14.797273 # 2 -4600 4600 2 20.551767 -22.195910 -14.797273 # 2 -4601 4601 2 20.551767 -23.017979 -13.975202 # 2 -4602 4602 2 19.729696 -22.195910 -13.975202 # 2 -4603 4603 2 21.373838 -23.017979 -14.797273 # 2 -4604 4604 2 22.195910 -22.195910 -14.797273 # 2 -4605 4605 2 22.195910 -23.017979 -13.975202 # 2 -4606 4606 2 21.373838 -22.195910 -13.975202 # 2 -4607 4607 2 23.017979 -23.017979 -14.797273 # 2 -4608 4608 2 23.840050 -22.195910 -14.797273 # 2 -4609 4609 2 23.840050 -23.017979 -13.975202 # 2 -4610 4610 2 23.017979 -22.195910 -13.975202 # 2 -4611 4611 2 24.662121 -23.017979 -14.797273 # 2 -4612 4612 2 24.662121 -22.195910 -13.975202 # 2 -4613 4613 2 9.042778 -20.551767 -14.797273 # 2 -4614 4614 2 9.042778 -21.373838 -13.975202 # 2 -4615 4615 2 9.864848 -21.373838 -14.797273 # 2 -4616 4616 2 10.686919 -20.551767 -14.797273 # 2 -4617 4617 2 10.686919 -21.373838 -13.975202 # 2 -4618 4618 2 9.864848 -20.551767 -13.975202 # 2 -4619 4619 2 11.508989 -21.373838 -14.797273 # 2 -4620 4620 2 12.331060 -20.551767 -14.797273 # 2 -4621 4621 2 12.331060 -21.373838 -13.975202 # 2 -4622 4622 2 11.508989 -20.551767 -13.975202 # 2 -4623 4623 2 13.153131 -21.373838 -14.797273 # 2 -4624 4624 2 13.975202 -20.551767 -14.797273 # 2 -4625 4625 2 13.975202 -21.373838 -13.975202 # 2 -4626 4626 2 13.153131 -20.551767 -13.975202 # 2 -4627 4627 2 14.797273 -21.373838 -14.797273 # 2 -4628 4628 2 15.619343 -20.551767 -14.797273 # 2 -4629 4629 2 15.619343 -21.373838 -13.975202 # 2 -4630 4630 2 14.797273 -20.551767 -13.975202 # 2 -4631 4631 2 16.441414 -21.373838 -14.797273 # 2 -4632 4632 2 17.263485 -20.551767 -14.797273 # 2 -4633 4633 2 17.263485 -21.373838 -13.975202 # 2 -4634 4634 2 16.441414 -20.551767 -13.975202 # 2 -4635 4635 2 18.085556 -21.373838 -14.797273 # 2 -4636 4636 2 18.907625 -20.551767 -14.797273 # 2 -4637 4637 2 18.907625 -21.373838 -13.975202 # 2 -4638 4638 2 18.085556 -20.551767 -13.975202 # 2 -4639 4639 2 19.729696 -21.373838 -14.797273 # 2 -4640 4640 2 20.551767 -20.551767 -14.797273 # 2 -4641 4641 2 20.551767 -21.373838 -13.975202 # 2 -4642 4642 2 19.729696 -20.551767 -13.975202 # 2 -4643 4643 2 21.373838 -21.373838 -14.797273 # 2 -4644 4644 2 22.195910 -20.551767 -14.797273 # 2 -4645 4645 2 22.195910 -21.373838 -13.975202 # 2 -4646 4646 2 21.373838 -20.551767 -13.975202 # 2 -4647 4647 2 23.017979 -21.373838 -14.797273 # 2 -4648 4648 2 23.840050 -20.551767 -14.797273 # 2 -4649 4649 2 23.840050 -21.373838 -13.975202 # 2 -4650 4650 2 23.017979 -20.551767 -13.975202 # 2 -4651 4651 2 24.662121 -21.373838 -14.797273 # 2 -4652 4652 2 24.662121 -20.551767 -13.975202 # 2 -4653 4653 2 9.042778 -23.840050 -13.153131 # 2 -4654 4654 2 10.686919 -23.840050 -13.153131 # 2 -4655 4655 2 9.864848 -23.840050 -12.331060 # 2 -4656 4656 2 12.331060 -23.840050 -13.153131 # 2 -4657 4657 2 11.508989 -23.840050 -12.331060 # 2 -4658 4658 2 13.975202 -23.840050 -13.153131 # 2 -4659 4659 2 13.153131 -23.840050 -12.331060 # 2 -4660 4660 2 15.619343 -23.840050 -13.153131 # 2 -4661 4661 2 14.797273 -23.840050 -12.331060 # 2 -4662 4662 2 17.263485 -23.840050 -13.153131 # 2 -4663 4663 2 16.441414 -23.840050 -12.331060 # 2 -4664 4664 2 18.907625 -23.840050 -13.153131 # 2 -4665 4665 2 18.085556 -23.840050 -12.331060 # 2 -4666 4666 2 20.551767 -23.840050 -13.153131 # 2 -4667 4667 2 19.729696 -23.840050 -12.331060 # 2 -4668 4668 2 22.195910 -23.840050 -13.153131 # 2 -4669 4669 2 21.373838 -23.840050 -12.331060 # 2 -4670 4670 2 23.840050 -23.840050 -13.153131 # 2 -4671 4671 2 23.017979 -23.840050 -12.331060 # 2 -4672 4672 2 24.662121 -23.840050 -12.331060 # 2 -4673 4673 2 9.042778 -22.195910 -13.153131 # 2 -4674 4674 2 9.042778 -23.017979 -12.331060 # 2 -4675 4675 2 9.864848 -23.017979 -13.153131 # 2 -4676 4676 2 10.686919 -22.195910 -13.153131 # 2 -4677 4677 2 10.686919 -23.017979 -12.331060 # 2 -4678 4678 2 9.864848 -22.195910 -12.331060 # 2 -4679 4679 2 11.508989 -23.017979 -13.153131 # 2 -4680 4680 2 12.331060 -22.195910 -13.153131 # 2 -4681 4681 2 12.331060 -23.017979 -12.331060 # 2 -4682 4682 2 11.508989 -22.195910 -12.331060 # 2 -4683 4683 2 13.153131 -23.017979 -13.153131 # 2 -4684 4684 2 13.975202 -22.195910 -13.153131 # 2 -4685 4685 2 13.975202 -23.017979 -12.331060 # 2 -4686 4686 2 13.153131 -22.195910 -12.331060 # 2 -4687 4687 2 14.797273 -23.017979 -13.153131 # 2 -4688 4688 2 15.619343 -22.195910 -13.153131 # 2 -4689 4689 2 15.619343 -23.017979 -12.331060 # 2 -4690 4690 2 14.797273 -22.195910 -12.331060 # 2 -4691 4691 2 16.441414 -23.017979 -13.153131 # 2 -4692 4692 2 17.263485 -22.195910 -13.153131 # 2 -4693 4693 2 17.263485 -23.017979 -12.331060 # 2 -4694 4694 2 16.441414 -22.195910 -12.331060 # 2 -4695 4695 2 18.085556 -23.017979 -13.153131 # 2 -4696 4696 2 18.907625 -22.195910 -13.153131 # 2 -4697 4697 2 18.907625 -23.017979 -12.331060 # 2 -4698 4698 2 18.085556 -22.195910 -12.331060 # 2 -4699 4699 2 19.729696 -23.017979 -13.153131 # 2 -4700 4700 2 20.551767 -22.195910 -13.153131 # 2 -4701 4701 2 20.551767 -23.017979 -12.331060 # 2 -4702 4702 2 19.729696 -22.195910 -12.331060 # 2 -4703 4703 2 21.373838 -23.017979 -13.153131 # 2 -4704 4704 2 22.195910 -22.195910 -13.153131 # 2 -4705 4705 2 22.195910 -23.017979 -12.331060 # 2 -4706 4706 2 21.373838 -22.195910 -12.331060 # 2 -4707 4707 2 23.017979 -23.017979 -13.153131 # 2 -4708 4708 2 23.840050 -22.195910 -13.153131 # 2 -4709 4709 2 23.840050 -23.017979 -12.331060 # 2 -4710 4710 2 23.017979 -22.195910 -12.331060 # 2 -4711 4711 2 24.662121 -23.017979 -13.153131 # 2 -4712 4712 2 24.662121 -22.195910 -12.331060 # 2 -4713 4713 2 9.042778 -20.551767 -13.153131 # 2 -4714 4714 2 9.042778 -21.373838 -12.331060 # 2 -4715 4715 2 9.864848 -21.373838 -13.153131 # 2 -4716 4716 2 10.686919 -20.551767 -13.153131 # 2 -4717 4717 2 10.686919 -21.373838 -12.331060 # 2 -4718 4718 2 9.864848 -20.551767 -12.331060 # 2 -4719 4719 2 11.508989 -21.373838 -13.153131 # 2 -4720 4720 2 12.331060 -20.551767 -13.153131 # 2 -4721 4721 2 12.331060 -21.373838 -12.331060 # 2 -4722 4722 2 11.508989 -20.551767 -12.331060 # 2 -4723 4723 2 13.153131 -21.373838 -13.153131 # 2 -4724 4724 2 13.975202 -20.551767 -13.153131 # 2 -4725 4725 2 13.975202 -21.373838 -12.331060 # 2 -4726 4726 2 13.153131 -20.551767 -12.331060 # 2 -4727 4727 2 14.797273 -21.373838 -13.153131 # 2 -4728 4728 2 15.619343 -20.551767 -13.153131 # 2 -4729 4729 2 15.619343 -21.373838 -12.331060 # 2 -4730 4730 2 14.797273 -20.551767 -12.331060 # 2 -4731 4731 2 16.441414 -21.373838 -13.153131 # 2 -4732 4732 2 17.263485 -20.551767 -13.153131 # 2 -4733 4733 2 17.263485 -21.373838 -12.331060 # 2 -4734 4734 2 16.441414 -20.551767 -12.331060 # 2 -4735 4735 2 18.085556 -21.373838 -13.153131 # 2 -4736 4736 2 18.907625 -20.551767 -13.153131 # 2 -4737 4737 2 18.907625 -21.373838 -12.331060 # 2 -4738 4738 2 18.085556 -20.551767 -12.331060 # 2 -4739 4739 2 19.729696 -21.373838 -13.153131 # 2 -4740 4740 2 20.551767 -20.551767 -13.153131 # 2 -4741 4741 2 20.551767 -21.373838 -12.331060 # 2 -4742 4742 2 19.729696 -20.551767 -12.331060 # 2 -4743 4743 2 21.373838 -21.373838 -13.153131 # 2 -4744 4744 2 22.195910 -20.551767 -13.153131 # 2 -4745 4745 2 22.195910 -21.373838 -12.331060 # 2 -4746 4746 2 21.373838 -20.551767 -12.331060 # 2 -4747 4747 2 23.017979 -21.373838 -13.153131 # 2 -4748 4748 2 23.840050 -20.551767 -13.153131 # 2 -4749 4749 2 23.840050 -21.373838 -12.331060 # 2 -4750 4750 2 23.017979 -20.551767 -12.331060 # 2 -4751 4751 2 24.662121 -21.373838 -13.153131 # 2 -4752 4752 2 24.662121 -20.551767 -12.331060 # 2 -4753 4753 2 9.042778 -23.840050 -11.508989 # 2 -4754 4754 2 10.686919 -23.840050 -11.508989 # 2 -4755 4755 2 9.864848 -23.840050 -10.686919 # 2 -4756 4756 2 12.331060 -23.840050 -11.508989 # 2 -4757 4757 2 11.508989 -23.840050 -10.686919 # 2 -4758 4758 2 13.975202 -23.840050 -11.508989 # 2 -4759 4759 2 13.153131 -23.840050 -10.686919 # 2 -4760 4760 2 15.619343 -23.840050 -11.508989 # 2 -4761 4761 2 14.797273 -23.840050 -10.686919 # 2 -4762 4762 2 17.263485 -23.840050 -11.508989 # 2 -4763 4763 2 16.441414 -23.840050 -10.686919 # 2 -4764 4764 2 18.907625 -23.840050 -11.508989 # 2 -4765 4765 2 18.085556 -23.840050 -10.686919 # 2 -4766 4766 2 20.551767 -23.840050 -11.508989 # 2 -4767 4767 2 19.729696 -23.840050 -10.686919 # 2 -4768 4768 2 22.195910 -23.840050 -11.508989 # 2 -4769 4769 2 21.373838 -23.840050 -10.686919 # 2 -4770 4770 2 23.840050 -23.840050 -11.508989 # 2 -4771 4771 2 23.017979 -23.840050 -10.686919 # 2 -4772 4772 2 24.662121 -23.840050 -10.686919 # 2 -4773 4773 2 9.042778 -22.195910 -11.508989 # 2 -4774 4774 2 9.042778 -23.017979 -10.686919 # 2 -4775 4775 2 9.864848 -23.017979 -11.508989 # 2 -4776 4776 2 10.686919 -22.195910 -11.508989 # 2 -4777 4777 2 10.686919 -23.017979 -10.686919 # 2 -4778 4778 2 9.864848 -22.195910 -10.686919 # 2 -4779 4779 2 11.508989 -23.017979 -11.508989 # 2 -4780 4780 2 12.331060 -22.195910 -11.508989 # 2 -4781 4781 2 12.331060 -23.017979 -10.686919 # 2 -4782 4782 2 11.508989 -22.195910 -10.686919 # 2 -4783 4783 2 13.153131 -23.017979 -11.508989 # 2 -4784 4784 2 13.975202 -22.195910 -11.508989 # 2 -4785 4785 2 13.975202 -23.017979 -10.686919 # 2 -4786 4786 2 13.153131 -22.195910 -10.686919 # 2 -4787 4787 2 14.797273 -23.017979 -11.508989 # 2 -4788 4788 2 15.619343 -22.195910 -11.508989 # 2 -4789 4789 2 15.619343 -23.017979 -10.686919 # 2 -4790 4790 2 14.797273 -22.195910 -10.686919 # 2 -4791 4791 2 16.441414 -23.017979 -11.508989 # 2 -4792 4792 2 17.263485 -22.195910 -11.508989 # 2 -4793 4793 2 17.263485 -23.017979 -10.686919 # 2 -4794 4794 2 16.441414 -22.195910 -10.686919 # 2 -4795 4795 2 18.085556 -23.017979 -11.508989 # 2 -4796 4796 2 18.907625 -22.195910 -11.508989 # 2 -4797 4797 2 18.907625 -23.017979 -10.686919 # 2 -4798 4798 2 18.085556 -22.195910 -10.686919 # 2 -4799 4799 2 19.729696 -23.017979 -11.508989 # 2 -4800 4800 2 20.551767 -22.195910 -11.508989 # 2 -4801 4801 2 20.551767 -23.017979 -10.686919 # 2 -4802 4802 2 19.729696 -22.195910 -10.686919 # 2 -4803 4803 2 21.373838 -23.017979 -11.508989 # 2 -4804 4804 2 22.195910 -22.195910 -11.508989 # 2 -4805 4805 2 22.195910 -23.017979 -10.686919 # 2 -4806 4806 2 21.373838 -22.195910 -10.686919 # 2 -4807 4807 2 23.017979 -23.017979 -11.508989 # 2 -4808 4808 2 23.840050 -22.195910 -11.508989 # 2 -4809 4809 2 23.840050 -23.017979 -10.686919 # 2 -4810 4810 2 23.017979 -22.195910 -10.686919 # 2 -4811 4811 2 24.662121 -23.017979 -11.508989 # 2 -4812 4812 2 24.662121 -22.195910 -10.686919 # 2 -4813 4813 2 9.042778 -20.551767 -11.508989 # 2 -4814 4814 2 9.042778 -21.373838 -10.686919 # 2 -4815 4815 2 9.864848 -21.373838 -11.508989 # 2 -4816 4816 2 10.686919 -20.551767 -11.508989 # 2 -4817 4817 2 10.686919 -21.373838 -10.686919 # 2 -4818 4818 2 9.864848 -20.551767 -10.686919 # 2 -4819 4819 2 11.508989 -21.373838 -11.508989 # 2 -4820 4820 2 12.331060 -20.551767 -11.508989 # 2 -4821 4821 2 12.331060 -21.373838 -10.686919 # 2 -4822 4822 2 11.508989 -20.551767 -10.686919 # 2 -4823 4823 2 13.153131 -21.373838 -11.508989 # 2 -4824 4824 2 13.975202 -20.551767 -11.508989 # 2 -4825 4825 2 13.975202 -21.373838 -10.686919 # 2 -4826 4826 2 13.153131 -20.551767 -10.686919 # 2 -4827 4827 2 14.797273 -21.373838 -11.508989 # 2 -4828 4828 2 15.619343 -20.551767 -11.508989 # 2 -4829 4829 2 15.619343 -21.373838 -10.686919 # 2 -4830 4830 2 14.797273 -20.551767 -10.686919 # 2 -4831 4831 2 16.441414 -21.373838 -11.508989 # 2 -4832 4832 2 17.263485 -20.551767 -11.508989 # 2 -4833 4833 2 17.263485 -21.373838 -10.686919 # 2 -4834 4834 2 16.441414 -20.551767 -10.686919 # 2 -4835 4835 2 18.085556 -21.373838 -11.508989 # 2 -4836 4836 2 18.907625 -20.551767 -11.508989 # 2 -4837 4837 2 18.907625 -21.373838 -10.686919 # 2 -4838 4838 2 18.085556 -20.551767 -10.686919 # 2 -4839 4839 2 19.729696 -21.373838 -11.508989 # 2 -4840 4840 2 20.551767 -20.551767 -11.508989 # 2 -4841 4841 2 20.551767 -21.373838 -10.686919 # 2 -4842 4842 2 19.729696 -20.551767 -10.686919 # 2 -4843 4843 2 21.373838 -21.373838 -11.508989 # 2 -4844 4844 2 22.195910 -20.551767 -11.508989 # 2 -4845 4845 2 22.195910 -21.373838 -10.686919 # 2 -4846 4846 2 21.373838 -20.551767 -10.686919 # 2 -4847 4847 2 23.017979 -21.373838 -11.508989 # 2 -4848 4848 2 23.840050 -20.551767 -11.508989 # 2 -4849 4849 2 23.840050 -21.373838 -10.686919 # 2 -4850 4850 2 23.017979 -20.551767 -10.686919 # 2 -4851 4851 2 24.662121 -21.373838 -11.508989 # 2 -4852 4852 2 24.662121 -20.551767 -10.686919 # 2 -4853 4853 2 9.042778 -23.840050 -9.864848 # 2 -4854 4854 2 10.686919 -23.840050 -9.864848 # 2 -4855 4855 2 9.864848 -23.840050 -9.042778 # 2 -4856 4856 2 12.331060 -23.840050 -9.864848 # 2 -4857 4857 2 11.508989 -23.840050 -9.042778 # 2 -4858 4858 2 13.975202 -23.840050 -9.864848 # 2 -4859 4859 2 13.153131 -23.840050 -9.042778 # 2 -4860 4860 2 15.619343 -23.840050 -9.864848 # 2 -4861 4861 2 14.797273 -23.840050 -9.042778 # 2 -4862 4862 2 17.263485 -23.840050 -9.864848 # 2 -4863 4863 2 16.441414 -23.840050 -9.042778 # 2 -4864 4864 2 18.907625 -23.840050 -9.864848 # 2 -4865 4865 2 18.085556 -23.840050 -9.042778 # 2 -4866 4866 2 20.551767 -23.840050 -9.864848 # 2 -4867 4867 2 19.729696 -23.840050 -9.042778 # 2 -4868 4868 2 22.195910 -23.840050 -9.864848 # 2 -4869 4869 2 21.373838 -23.840050 -9.042778 # 2 -4870 4870 2 23.840050 -23.840050 -9.864848 # 2 -4871 4871 2 23.017979 -23.840050 -9.042778 # 2 -4872 4872 2 24.662121 -23.840050 -9.042778 # 2 -4873 4873 2 9.042778 -22.195910 -9.864848 # 2 -4874 4874 2 9.042778 -23.017979 -9.042778 # 2 -4875 4875 2 9.864848 -23.017979 -9.864848 # 2 -4876 4876 2 10.686919 -22.195910 -9.864848 # 2 -4877 4877 2 10.686919 -23.017979 -9.042778 # 2 -4878 4878 2 9.864848 -22.195910 -9.042778 # 2 -4879 4879 2 11.508989 -23.017979 -9.864848 # 2 -4880 4880 2 12.331060 -22.195910 -9.864848 # 2 -4881 4881 2 12.331060 -23.017979 -9.042778 # 2 -4882 4882 2 11.508989 -22.195910 -9.042778 # 2 -4883 4883 2 13.153131 -23.017979 -9.864848 # 2 -4884 4884 2 13.975202 -22.195910 -9.864848 # 2 -4885 4885 2 13.975202 -23.017979 -9.042778 # 2 -4886 4886 2 13.153131 -22.195910 -9.042778 # 2 -4887 4887 2 14.797273 -23.017979 -9.864848 # 2 -4888 4888 2 15.619343 -22.195910 -9.864848 # 2 -4889 4889 2 15.619343 -23.017979 -9.042778 # 2 -4890 4890 2 14.797273 -22.195910 -9.042778 # 2 -4891 4891 2 16.441414 -23.017979 -9.864848 # 2 -4892 4892 2 17.263485 -22.195910 -9.864848 # 2 -4893 4893 2 17.263485 -23.017979 -9.042778 # 2 -4894 4894 2 16.441414 -22.195910 -9.042778 # 2 -4895 4895 2 18.085556 -23.017979 -9.864848 # 2 -4896 4896 2 18.907625 -22.195910 -9.864848 # 2 -4897 4897 2 18.907625 -23.017979 -9.042778 # 2 -4898 4898 2 18.085556 -22.195910 -9.042778 # 2 -4899 4899 2 19.729696 -23.017979 -9.864848 # 2 -4900 4900 2 20.551767 -22.195910 -9.864848 # 2 -4901 4901 2 20.551767 -23.017979 -9.042778 # 2 -4902 4902 2 19.729696 -22.195910 -9.042778 # 2 -4903 4903 2 21.373838 -23.017979 -9.864848 # 2 -4904 4904 2 22.195910 -22.195910 -9.864848 # 2 -4905 4905 2 22.195910 -23.017979 -9.042778 # 2 -4906 4906 2 21.373838 -22.195910 -9.042778 # 2 -4907 4907 2 23.017979 -23.017979 -9.864848 # 2 -4908 4908 2 23.840050 -22.195910 -9.864848 # 2 -4909 4909 2 23.840050 -23.017979 -9.042778 # 2 -4910 4910 2 23.017979 -22.195910 -9.042778 # 2 -4911 4911 2 24.662121 -23.017979 -9.864848 # 2 -4912 4912 2 24.662121 -22.195910 -9.042778 # 2 -4913 4913 2 9.042778 -20.551767 -9.864848 # 2 -4914 4914 2 9.042778 -21.373838 -9.042778 # 2 -4915 4915 2 9.864848 -21.373838 -9.864848 # 2 -4916 4916 2 10.686919 -20.551767 -9.864848 # 2 -4917 4917 2 10.686919 -21.373838 -9.042778 # 2 -4918 4918 2 9.864848 -20.551767 -9.042778 # 2 -4919 4919 2 11.508989 -21.373838 -9.864848 # 2 -4920 4920 2 12.331060 -20.551767 -9.864848 # 2 -4921 4921 2 12.331060 -21.373838 -9.042778 # 2 -4922 4922 2 11.508989 -20.551767 -9.042778 # 2 -4923 4923 2 13.153131 -21.373838 -9.864848 # 2 -4924 4924 2 13.975202 -20.551767 -9.864848 # 2 -4925 4925 2 13.975202 -21.373838 -9.042778 # 2 -4926 4926 2 13.153131 -20.551767 -9.042778 # 2 -4927 4927 2 14.797273 -21.373838 -9.864848 # 2 -4928 4928 2 15.619343 -20.551767 -9.864848 # 2 -4929 4929 2 15.619343 -21.373838 -9.042778 # 2 -4930 4930 2 14.797273 -20.551767 -9.042778 # 2 -4931 4931 2 16.441414 -21.373838 -9.864848 # 2 -4932 4932 2 17.263485 -20.551767 -9.864848 # 2 -4933 4933 2 17.263485 -21.373838 -9.042778 # 2 -4934 4934 2 16.441414 -20.551767 -9.042778 # 2 -4935 4935 2 18.085556 -21.373838 -9.864848 # 2 -4936 4936 2 18.907625 -20.551767 -9.864848 # 2 -4937 4937 2 18.907625 -21.373838 -9.042778 # 2 -4938 4938 2 18.085556 -20.551767 -9.042778 # 2 -4939 4939 2 19.729696 -21.373838 -9.864848 # 2 -4940 4940 2 20.551767 -20.551767 -9.864848 # 2 -4941 4941 2 20.551767 -21.373838 -9.042778 # 2 -4942 4942 2 19.729696 -20.551767 -9.042778 # 2 -4943 4943 2 21.373838 -21.373838 -9.864848 # 2 -4944 4944 2 22.195910 -20.551767 -9.864848 # 2 -4945 4945 2 22.195910 -21.373838 -9.042778 # 2 -4946 4946 2 21.373838 -20.551767 -9.042778 # 2 -4947 4947 2 23.017979 -21.373838 -9.864848 # 2 -4948 4948 2 23.840050 -20.551767 -9.864848 # 2 -4949 4949 2 23.840050 -21.373838 -9.042778 # 2 -4950 4950 2 23.017979 -20.551767 -9.042778 # 2 -4951 4951 2 24.662121 -21.373838 -9.864848 # 2 -4952 4952 2 24.662121 -20.551767 -9.042778 # 2 -4953 4953 2 9.042778 -23.840050 -8.220707 # 2 -4954 4954 2 10.686919 -23.840050 -8.220707 # 2 -4955 4955 2 12.331060 -23.840050 -8.220707 # 2 -4956 4956 2 13.975202 -23.840050 -8.220707 # 2 -4957 4957 2 15.619343 -23.840050 -8.220707 # 2 -4958 4958 2 17.263485 -23.840050 -8.220707 # 2 -4959 4959 2 18.907625 -23.840050 -8.220707 # 2 -4960 4960 2 20.551767 -23.840050 -8.220707 # 2 -4961 4961 2 22.195910 -23.840050 -8.220707 # 2 -4962 4962 2 23.840050 -23.840050 -8.220707 # 2 -4963 4963 2 9.042778 -22.195910 -8.220707 # 2 -4964 4964 2 9.864848 -23.017979 -8.220707 # 2 -4965 4965 2 10.686919 -22.195910 -8.220707 # 2 -4966 4966 2 11.508989 -23.017979 -8.220707 # 2 -4967 4967 2 12.331060 -22.195910 -8.220707 # 2 -4968 4968 2 13.153131 -23.017979 -8.220707 # 2 -4969 4969 2 13.975202 -22.195910 -8.220707 # 2 -4970 4970 2 14.797273 -23.017979 -8.220707 # 2 -4971 4971 2 15.619343 -22.195910 -8.220707 # 2 -4972 4972 2 16.441414 -23.017979 -8.220707 # 2 -4973 4973 2 17.263485 -22.195910 -8.220707 # 2 -4974 4974 2 18.085556 -23.017979 -8.220707 # 2 -4975 4975 2 18.907625 -22.195910 -8.220707 # 2 -4976 4976 2 19.729696 -23.017979 -8.220707 # 2 -4977 4977 2 20.551767 -22.195910 -8.220707 # 2 -4978 4978 2 21.373838 -23.017979 -8.220707 # 2 -4979 4979 2 22.195910 -22.195910 -8.220707 # 2 -4980 4980 2 23.017979 -23.017979 -8.220707 # 2 -4981 4981 2 23.840050 -22.195910 -8.220707 # 2 -4982 4982 2 24.662121 -23.017979 -8.220707 # 2 -4983 4983 2 9.042778 -20.551767 -8.220707 # 2 -4984 4984 2 9.864848 -21.373838 -8.220707 # 2 -4985 4985 2 10.686919 -20.551767 -8.220707 # 2 -4986 4986 2 11.508989 -21.373838 -8.220707 # 2 -4987 4987 2 12.331060 -20.551767 -8.220707 # 2 -4988 4988 2 13.153131 -21.373838 -8.220707 # 2 -4989 4989 2 13.975202 -20.551767 -8.220707 # 2 -4990 4990 2 14.797273 -21.373838 -8.220707 # 2 -4991 4991 2 15.619343 -20.551767 -8.220707 # 2 -4992 4992 2 16.441414 -21.373838 -8.220707 # 2 -4993 4993 2 17.263485 -20.551767 -8.220707 # 2 -4994 4994 2 18.085556 -21.373838 -8.220707 # 2 -4995 4995 2 18.907625 -20.551767 -8.220707 # 2 -4996 4996 2 19.729696 -21.373838 -8.220707 # 2 -4997 4997 2 20.551767 -20.551767 -8.220707 # 2 -4998 4998 2 21.373838 -21.373838 -8.220707 # 2 -4999 4999 2 22.195910 -20.551767 -8.220707 # 2 -5000 5000 2 23.017979 -21.373838 -8.220707 # 2 -5001 5001 2 23.840050 -20.551767 -8.220707 # 2 -5002 5002 2 24.662121 -21.373838 -8.220707 # 2 -5003 5003 3 -24.662121 -23.840050 -7.398636 # 3 -5004 5004 3 -23.017979 -23.840050 -7.398636 # 3 -5005 5005 3 -21.373838 -23.840050 -7.398636 # 3 -5006 5006 3 -19.729696 -23.840050 -7.398636 # 3 -5007 5007 3 -18.085556 -23.840050 -7.398636 # 3 -5008 5008 3 -16.441414 -23.840050 -7.398636 # 3 -5009 5009 3 -14.797273 -23.840050 -7.398636 # 3 -5010 5010 3 -13.153131 -23.840050 -7.398636 # 3 -5011 5011 3 -11.508989 -23.840050 -7.398636 # 3 -5012 5012 3 -9.864848 -23.840050 -7.398636 # 3 -5013 5013 3 -23.840050 -23.017979 -7.398636 # 3 -5014 5014 3 -24.662121 -22.195910 -7.398636 # 3 -5015 5015 3 -22.195910 -23.017979 -7.398636 # 3 -5016 5016 3 -23.017979 -22.195910 -7.398636 # 3 -5017 5017 3 -20.551767 -23.017979 -7.398636 # 3 -5018 5018 3 -21.373838 -22.195910 -7.398636 # 3 -5019 5019 3 -18.907625 -23.017979 -7.398636 # 3 -5020 5020 3 -19.729696 -22.195910 -7.398636 # 3 -5021 5021 3 -17.263485 -23.017979 -7.398636 # 3 -5022 5022 3 -18.085556 -22.195910 -7.398636 # 3 -5023 5023 3 -15.619343 -23.017979 -7.398636 # 3 -5024 5024 3 -16.441414 -22.195910 -7.398636 # 3 -5025 5025 3 -13.975202 -23.017979 -7.398636 # 3 -5026 5026 3 -14.797273 -22.195910 -7.398636 # 3 -5027 5027 3 -12.331060 -23.017979 -7.398636 # 3 -5028 5028 3 -13.153131 -22.195910 -7.398636 # 3 -5029 5029 3 -10.686919 -23.017979 -7.398636 # 3 -5030 5030 3 -11.508989 -22.195910 -7.398636 # 3 -5031 5031 3 -9.042778 -23.017979 -7.398636 # 3 -5032 5032 3 -9.864848 -22.195910 -7.398636 # 3 -5033 5033 3 -23.840050 -21.373838 -7.398636 # 3 -5034 5034 3 -24.662121 -20.551767 -7.398636 # 3 -5035 5035 3 -22.195910 -21.373838 -7.398636 # 3 -5036 5036 3 -23.017979 -20.551767 -7.398636 # 3 -5037 5037 3 -20.551767 -21.373838 -7.398636 # 3 -5038 5038 3 -21.373838 -20.551767 -7.398636 # 3 -5039 5039 3 -18.907625 -21.373838 -7.398636 # 3 -5040 5040 3 -19.729696 -20.551767 -7.398636 # 3 -5041 5041 3 -17.263485 -21.373838 -7.398636 # 3 -5042 5042 3 -18.085556 -20.551767 -7.398636 # 3 -5043 5043 3 -15.619343 -21.373838 -7.398636 # 3 -5044 5044 3 -16.441414 -20.551767 -7.398636 # 3 -5045 5045 3 -13.975202 -21.373838 -7.398636 # 3 -5046 5046 3 -14.797273 -20.551767 -7.398636 # 3 -5047 5047 3 -12.331060 -21.373838 -7.398636 # 3 -5048 5048 3 -13.153131 -20.551767 -7.398636 # 3 -5049 5049 3 -10.686919 -21.373838 -7.398636 # 3 -5050 5050 3 -11.508989 -20.551767 -7.398636 # 3 -5051 5051 3 -9.042778 -21.373838 -7.398636 # 3 -5052 5052 3 -9.864848 -20.551767 -7.398636 # 3 -5053 5053 3 -23.840050 -23.840050 -6.576566 # 3 -5054 5054 3 -24.662121 -23.840050 -5.754495 # 3 -5055 5055 3 -22.195910 -23.840050 -6.576566 # 3 -5056 5056 3 -23.017979 -23.840050 -5.754495 # 3 -5057 5057 3 -20.551767 -23.840050 -6.576566 # 3 -5058 5058 3 -21.373838 -23.840050 -5.754495 # 3 -5059 5059 3 -18.907625 -23.840050 -6.576566 # 3 -5060 5060 3 -19.729696 -23.840050 -5.754495 # 3 -5061 5061 3 -17.263485 -23.840050 -6.576566 # 3 -5062 5062 3 -18.085556 -23.840050 -5.754495 # 3 -5063 5063 3 -15.619343 -23.840050 -6.576566 # 3 -5064 5064 3 -16.441414 -23.840050 -5.754495 # 3 -5065 5065 3 -13.975202 -23.840050 -6.576566 # 3 -5066 5066 3 -14.797273 -23.840050 -5.754495 # 3 -5067 5067 3 -12.331060 -23.840050 -6.576566 # 3 -5068 5068 3 -13.153131 -23.840050 -5.754495 # 3 -5069 5069 3 -10.686919 -23.840050 -6.576566 # 3 -5070 5070 3 -11.508989 -23.840050 -5.754495 # 3 -5071 5071 3 -9.042778 -23.840050 -6.576566 # 3 -5072 5072 3 -9.864848 -23.840050 -5.754495 # 3 -5073 5073 3 -24.662121 -23.017979 -6.576566 # 3 -5074 5074 3 -23.840050 -22.195910 -6.576566 # 3 -5075 5075 3 -23.840050 -23.017979 -5.754495 # 3 -5076 5076 3 -24.662121 -22.195910 -5.754495 # 3 -5077 5077 3 -23.017979 -23.017979 -6.576566 # 3 -5078 5078 3 -22.195910 -22.195910 -6.576566 # 3 -5079 5079 3 -22.195910 -23.017979 -5.754495 # 3 -5080 5080 3 -23.017979 -22.195910 -5.754495 # 3 -5081 5081 3 -21.373838 -23.017979 -6.576566 # 3 -5082 5082 3 -20.551767 -22.195910 -6.576566 # 3 -5083 5083 3 -20.551767 -23.017979 -5.754495 # 3 -5084 5084 3 -21.373838 -22.195910 -5.754495 # 3 -5085 5085 3 -19.729696 -23.017979 -6.576566 # 3 -5086 5086 3 -18.907625 -22.195910 -6.576566 # 3 -5087 5087 3 -18.907625 -23.017979 -5.754495 # 3 -5088 5088 3 -19.729696 -22.195910 -5.754495 # 3 -5089 5089 3 -18.085556 -23.017979 -6.576566 # 3 -5090 5090 3 -17.263485 -22.195910 -6.576566 # 3 -5091 5091 3 -17.263485 -23.017979 -5.754495 # 3 -5092 5092 3 -18.085556 -22.195910 -5.754495 # 3 -5093 5093 3 -16.441414 -23.017979 -6.576566 # 3 -5094 5094 3 -15.619343 -22.195910 -6.576566 # 3 -5095 5095 3 -15.619343 -23.017979 -5.754495 # 3 -5096 5096 3 -16.441414 -22.195910 -5.754495 # 3 -5097 5097 3 -14.797273 -23.017979 -6.576566 # 3 -5098 5098 3 -13.975202 -22.195910 -6.576566 # 3 -5099 5099 3 -13.975202 -23.017979 -5.754495 # 3 -5100 5100 3 -14.797273 -22.195910 -5.754495 # 3 -5101 5101 3 -13.153131 -23.017979 -6.576566 # 3 -5102 5102 3 -12.331060 -22.195910 -6.576566 # 3 -5103 5103 3 -12.331060 -23.017979 -5.754495 # 3 -5104 5104 3 -13.153131 -22.195910 -5.754495 # 3 -5105 5105 3 -11.508989 -23.017979 -6.576566 # 3 -5106 5106 3 -10.686919 -22.195910 -6.576566 # 3 -5107 5107 3 -10.686919 -23.017979 -5.754495 # 3 -5108 5108 3 -11.508989 -22.195910 -5.754495 # 3 -5109 5109 3 -9.864848 -23.017979 -6.576566 # 3 -5110 5110 3 -9.042778 -22.195910 -6.576566 # 3 -5111 5111 3 -9.042778 -23.017979 -5.754495 # 3 -5112 5112 3 -9.864848 -22.195910 -5.754495 # 3 -5113 5113 3 -24.662121 -21.373838 -6.576566 # 3 -5114 5114 3 -23.840050 -20.551767 -6.576566 # 3 -5115 5115 3 -23.840050 -21.373838 -5.754495 # 3 -5116 5116 3 -24.662121 -20.551767 -5.754495 # 3 -5117 5117 3 -23.017979 -21.373838 -6.576566 # 3 -5118 5118 3 -22.195910 -20.551767 -6.576566 # 3 -5119 5119 3 -22.195910 -21.373838 -5.754495 # 3 -5120 5120 3 -23.017979 -20.551767 -5.754495 # 3 -5121 5121 3 -21.373838 -21.373838 -6.576566 # 3 -5122 5122 3 -20.551767 -20.551767 -6.576566 # 3 -5123 5123 3 -20.551767 -21.373838 -5.754495 # 3 -5124 5124 3 -21.373838 -20.551767 -5.754495 # 3 -5125 5125 3 -19.729696 -21.373838 -6.576566 # 3 -5126 5126 3 -18.907625 -20.551767 -6.576566 # 3 -5127 5127 3 -18.907625 -21.373838 -5.754495 # 3 -5128 5128 3 -19.729696 -20.551767 -5.754495 # 3 -5129 5129 3 -18.085556 -21.373838 -6.576566 # 3 -5130 5130 3 -17.263485 -20.551767 -6.576566 # 3 -5131 5131 3 -17.263485 -21.373838 -5.754495 # 3 -5132 5132 3 -18.085556 -20.551767 -5.754495 # 3 -5133 5133 3 -16.441414 -21.373838 -6.576566 # 3 -5134 5134 3 -15.619343 -20.551767 -6.576566 # 3 -5135 5135 3 -15.619343 -21.373838 -5.754495 # 3 -5136 5136 3 -16.441414 -20.551767 -5.754495 # 3 -5137 5137 3 -14.797273 -21.373838 -6.576566 # 3 -5138 5138 3 -13.975202 -20.551767 -6.576566 # 3 -5139 5139 3 -13.975202 -21.373838 -5.754495 # 3 -5140 5140 3 -14.797273 -20.551767 -5.754495 # 3 -5141 5141 3 -13.153131 -21.373838 -6.576566 # 3 -5142 5142 3 -12.331060 -20.551767 -6.576566 # 3 -5143 5143 3 -12.331060 -21.373838 -5.754495 # 3 -5144 5144 3 -13.153131 -20.551767 -5.754495 # 3 -5145 5145 3 -11.508989 -21.373838 -6.576566 # 3 -5146 5146 3 -10.686919 -20.551767 -6.576566 # 3 -5147 5147 3 -10.686919 -21.373838 -5.754495 # 3 -5148 5148 3 -11.508989 -20.551767 -5.754495 # 3 -5149 5149 3 -9.864848 -21.373838 -6.576566 # 3 -5150 5150 3 -9.042778 -20.551767 -6.576566 # 3 -5151 5151 3 -9.042778 -21.373838 -5.754495 # 3 -5152 5152 3 -9.864848 -20.551767 -5.754495 # 3 -5153 5153 3 -23.840050 -23.840050 -4.932424 # 3 -5154 5154 3 -24.662121 -23.840050 -4.110353 # 3 -5155 5155 3 -22.195910 -23.840050 -4.932424 # 3 -5156 5156 3 -23.017979 -23.840050 -4.110353 # 3 -5157 5157 3 -20.551767 -23.840050 -4.932424 # 3 -5158 5158 3 -21.373838 -23.840050 -4.110353 # 3 -5159 5159 3 -18.907625 -23.840050 -4.932424 # 3 -5160 5160 3 -19.729696 -23.840050 -4.110353 # 3 -5161 5161 3 -17.263485 -23.840050 -4.932424 # 3 -5162 5162 3 -18.085556 -23.840050 -4.110353 # 3 -5163 5163 3 -15.619343 -23.840050 -4.932424 # 3 -5164 5164 3 -16.441414 -23.840050 -4.110353 # 3 -5165 5165 3 -13.975202 -23.840050 -4.932424 # 3 -5166 5166 3 -14.797273 -23.840050 -4.110353 # 3 -5167 5167 3 -12.331060 -23.840050 -4.932424 # 3 -5168 5168 3 -13.153131 -23.840050 -4.110353 # 3 -5169 5169 3 -10.686919 -23.840050 -4.932424 # 3 -5170 5170 3 -11.508989 -23.840050 -4.110353 # 3 -5171 5171 3 -9.042778 -23.840050 -4.932424 # 3 -5172 5172 3 -9.864848 -23.840050 -4.110353 # 3 -5173 5173 3 -24.662121 -23.017979 -4.932424 # 3 -5174 5174 3 -23.840050 -22.195910 -4.932424 # 3 -5175 5175 3 -23.840050 -23.017979 -4.110353 # 3 -5176 5176 3 -24.662121 -22.195910 -4.110353 # 3 -5177 5177 3 -23.017979 -23.017979 -4.932424 # 3 -5178 5178 3 -22.195910 -22.195910 -4.932424 # 3 -5179 5179 3 -22.195910 -23.017979 -4.110353 # 3 -5180 5180 3 -23.017979 -22.195910 -4.110353 # 3 -5181 5181 3 -21.373838 -23.017979 -4.932424 # 3 -5182 5182 3 -20.551767 -22.195910 -4.932424 # 3 -5183 5183 3 -20.551767 -23.017979 -4.110353 # 3 -5184 5184 3 -21.373838 -22.195910 -4.110353 # 3 -5185 5185 3 -19.729696 -23.017979 -4.932424 # 3 -5186 5186 3 -18.907625 -22.195910 -4.932424 # 3 -5187 5187 3 -18.907625 -23.017979 -4.110353 # 3 -5188 5188 3 -19.729696 -22.195910 -4.110353 # 3 -5189 5189 3 -18.085556 -23.017979 -4.932424 # 3 -5190 5190 3 -17.263485 -22.195910 -4.932424 # 3 -5191 5191 3 -17.263485 -23.017979 -4.110353 # 3 -5192 5192 3 -18.085556 -22.195910 -4.110353 # 3 -5193 5193 3 -16.441414 -23.017979 -4.932424 # 3 -5194 5194 3 -15.619343 -22.195910 -4.932424 # 3 -5195 5195 3 -15.619343 -23.017979 -4.110353 # 3 -5196 5196 3 -16.441414 -22.195910 -4.110353 # 3 -5197 5197 3 -14.797273 -23.017979 -4.932424 # 3 -5198 5198 3 -13.975202 -22.195910 -4.932424 # 3 -5199 5199 3 -13.975202 -23.017979 -4.110353 # 3 -5200 5200 3 -14.797273 -22.195910 -4.110353 # 3 -5201 5201 3 -13.153131 -23.017979 -4.932424 # 3 -5202 5202 3 -12.331060 -22.195910 -4.932424 # 3 -5203 5203 3 -12.331060 -23.017979 -4.110353 # 3 -5204 5204 3 -13.153131 -22.195910 -4.110353 # 3 -5205 5205 3 -11.508989 -23.017979 -4.932424 # 3 -5206 5206 3 -10.686919 -22.195910 -4.932424 # 3 -5207 5207 3 -10.686919 -23.017979 -4.110353 # 3 -5208 5208 3 -11.508989 -22.195910 -4.110353 # 3 -5209 5209 3 -9.864848 -23.017979 -4.932424 # 3 -5210 5210 3 -9.042778 -22.195910 -4.932424 # 3 -5211 5211 3 -9.042778 -23.017979 -4.110353 # 3 -5212 5212 3 -9.864848 -22.195910 -4.110353 # 3 -5213 5213 3 -24.662121 -21.373838 -4.932424 # 3 -5214 5214 3 -23.840050 -20.551767 -4.932424 # 3 -5215 5215 3 -23.840050 -21.373838 -4.110353 # 3 -5216 5216 3 -24.662121 -20.551767 -4.110353 # 3 -5217 5217 3 -23.017979 -21.373838 -4.932424 # 3 -5218 5218 3 -22.195910 -20.551767 -4.932424 # 3 -5219 5219 3 -22.195910 -21.373838 -4.110353 # 3 -5220 5220 3 -23.017979 -20.551767 -4.110353 # 3 -5221 5221 3 -21.373838 -21.373838 -4.932424 # 3 -5222 5222 3 -20.551767 -20.551767 -4.932424 # 3 -5223 5223 3 -20.551767 -21.373838 -4.110353 # 3 -5224 5224 3 -21.373838 -20.551767 -4.110353 # 3 -5225 5225 3 -19.729696 -21.373838 -4.932424 # 3 -5226 5226 3 -18.907625 -20.551767 -4.932424 # 3 -5227 5227 3 -18.907625 -21.373838 -4.110353 # 3 -5228 5228 3 -19.729696 -20.551767 -4.110353 # 3 -5229 5229 3 -18.085556 -21.373838 -4.932424 # 3 -5230 5230 3 -17.263485 -20.551767 -4.932424 # 3 -5231 5231 3 -17.263485 -21.373838 -4.110353 # 3 -5232 5232 3 -18.085556 -20.551767 -4.110353 # 3 -5233 5233 3 -16.441414 -21.373838 -4.932424 # 3 -5234 5234 3 -15.619343 -20.551767 -4.932424 # 3 -5235 5235 3 -15.619343 -21.373838 -4.110353 # 3 -5236 5236 3 -16.441414 -20.551767 -4.110353 # 3 -5237 5237 3 -14.797273 -21.373838 -4.932424 # 3 -5238 5238 3 -13.975202 -20.551767 -4.932424 # 3 -5239 5239 3 -13.975202 -21.373838 -4.110353 # 3 -5240 5240 3 -14.797273 -20.551767 -4.110353 # 3 -5241 5241 3 -13.153131 -21.373838 -4.932424 # 3 -5242 5242 3 -12.331060 -20.551767 -4.932424 # 3 -5243 5243 3 -12.331060 -21.373838 -4.110353 # 3 -5244 5244 3 -13.153131 -20.551767 -4.110353 # 3 -5245 5245 3 -11.508989 -21.373838 -4.932424 # 3 -5246 5246 3 -10.686919 -20.551767 -4.932424 # 3 -5247 5247 3 -10.686919 -21.373838 -4.110353 # 3 -5248 5248 3 -11.508989 -20.551767 -4.110353 # 3 -5249 5249 3 -9.864848 -21.373838 -4.932424 # 3 -5250 5250 3 -9.042778 -20.551767 -4.932424 # 3 -5251 5251 3 -9.042778 -21.373838 -4.110353 # 3 -5252 5252 3 -9.864848 -20.551767 -4.110353 # 3 -5253 5253 3 -23.840050 -23.840050 -3.288283 # 3 -5254 5254 3 -24.662121 -23.840050 -2.466212 # 3 -5255 5255 3 -22.195910 -23.840050 -3.288283 # 3 -5256 5256 3 -23.017979 -23.840050 -2.466212 # 3 -5257 5257 3 -20.551767 -23.840050 -3.288283 # 3 -5258 5258 3 -21.373838 -23.840050 -2.466212 # 3 -5259 5259 3 -18.907625 -23.840050 -3.288283 # 3 -5260 5260 3 -19.729696 -23.840050 -2.466212 # 3 -5261 5261 3 -17.263485 -23.840050 -3.288283 # 3 -5262 5262 3 -18.085556 -23.840050 -2.466212 # 3 -5263 5263 3 -15.619343 -23.840050 -3.288283 # 3 -5264 5264 3 -16.441414 -23.840050 -2.466212 # 3 -5265 5265 3 -13.975202 -23.840050 -3.288283 # 3 -5266 5266 3 -14.797273 -23.840050 -2.466212 # 3 -5267 5267 3 -12.331060 -23.840050 -3.288283 # 3 -5268 5268 3 -13.153131 -23.840050 -2.466212 # 3 -5269 5269 3 -10.686919 -23.840050 -3.288283 # 3 -5270 5270 3 -11.508989 -23.840050 -2.466212 # 3 -5271 5271 3 -9.042778 -23.840050 -3.288283 # 3 -5272 5272 3 -9.864848 -23.840050 -2.466212 # 3 -5273 5273 3 -24.662121 -23.017979 -3.288283 # 3 -5274 5274 3 -23.840050 -22.195910 -3.288283 # 3 -5275 5275 3 -23.840050 -23.017979 -2.466212 # 3 -5276 5276 3 -24.662121 -22.195910 -2.466212 # 3 -5277 5277 3 -23.017979 -23.017979 -3.288283 # 3 -5278 5278 3 -22.195910 -22.195910 -3.288283 # 3 -5279 5279 3 -22.195910 -23.017979 -2.466212 # 3 -5280 5280 3 -23.017979 -22.195910 -2.466212 # 3 -5281 5281 3 -21.373838 -23.017979 -3.288283 # 3 -5282 5282 3 -20.551767 -22.195910 -3.288283 # 3 -5283 5283 3 -20.551767 -23.017979 -2.466212 # 3 -5284 5284 3 -21.373838 -22.195910 -2.466212 # 3 -5285 5285 3 -19.729696 -23.017979 -3.288283 # 3 -5286 5286 3 -18.907625 -22.195910 -3.288283 # 3 -5287 5287 3 -18.907625 -23.017979 -2.466212 # 3 -5288 5288 3 -19.729696 -22.195910 -2.466212 # 3 -5289 5289 3 -18.085556 -23.017979 -3.288283 # 3 -5290 5290 3 -17.263485 -22.195910 -3.288283 # 3 -5291 5291 3 -17.263485 -23.017979 -2.466212 # 3 -5292 5292 3 -18.085556 -22.195910 -2.466212 # 3 -5293 5293 3 -16.441414 -23.017979 -3.288283 # 3 -5294 5294 3 -15.619343 -22.195910 -3.288283 # 3 -5295 5295 3 -15.619343 -23.017979 -2.466212 # 3 -5296 5296 3 -16.441414 -22.195910 -2.466212 # 3 -5297 5297 3 -14.797273 -23.017979 -3.288283 # 3 -5298 5298 3 -13.975202 -22.195910 -3.288283 # 3 -5299 5299 3 -13.975202 -23.017979 -2.466212 # 3 -5300 5300 3 -14.797273 -22.195910 -2.466212 # 3 -5301 5301 3 -13.153131 -23.017979 -3.288283 # 3 -5302 5302 3 -12.331060 -22.195910 -3.288283 # 3 -5303 5303 3 -12.331060 -23.017979 -2.466212 # 3 -5304 5304 3 -13.153131 -22.195910 -2.466212 # 3 -5305 5305 3 -11.508989 -23.017979 -3.288283 # 3 -5306 5306 3 -10.686919 -22.195910 -3.288283 # 3 -5307 5307 3 -10.686919 -23.017979 -2.466212 # 3 -5308 5308 3 -11.508989 -22.195910 -2.466212 # 3 -5309 5309 3 -9.864848 -23.017979 -3.288283 # 3 -5310 5310 3 -9.042778 -22.195910 -3.288283 # 3 -5311 5311 3 -9.042778 -23.017979 -2.466212 # 3 -5312 5312 3 -9.864848 -22.195910 -2.466212 # 3 -5313 5313 3 -24.662121 -21.373838 -3.288283 # 3 -5314 5314 3 -23.840050 -20.551767 -3.288283 # 3 -5315 5315 3 -23.840050 -21.373838 -2.466212 # 3 -5316 5316 3 -24.662121 -20.551767 -2.466212 # 3 -5317 5317 3 -23.017979 -21.373838 -3.288283 # 3 -5318 5318 3 -22.195910 -20.551767 -3.288283 # 3 -5319 5319 3 -22.195910 -21.373838 -2.466212 # 3 -5320 5320 3 -23.017979 -20.551767 -2.466212 # 3 -5321 5321 3 -21.373838 -21.373838 -3.288283 # 3 -5322 5322 3 -20.551767 -20.551767 -3.288283 # 3 -5323 5323 3 -20.551767 -21.373838 -2.466212 # 3 -5324 5324 3 -21.373838 -20.551767 -2.466212 # 3 -5325 5325 3 -19.729696 -21.373838 -3.288283 # 3 -5326 5326 3 -18.907625 -20.551767 -3.288283 # 3 -5327 5327 3 -18.907625 -21.373838 -2.466212 # 3 -5328 5328 3 -19.729696 -20.551767 -2.466212 # 3 -5329 5329 3 -18.085556 -21.373838 -3.288283 # 3 -5330 5330 3 -17.263485 -20.551767 -3.288283 # 3 -5331 5331 3 -17.263485 -21.373838 -2.466212 # 3 -5332 5332 3 -18.085556 -20.551767 -2.466212 # 3 -5333 5333 3 -16.441414 -21.373838 -3.288283 # 3 -5334 5334 3 -15.619343 -20.551767 -3.288283 # 3 -5335 5335 3 -15.619343 -21.373838 -2.466212 # 3 -5336 5336 3 -16.441414 -20.551767 -2.466212 # 3 -5337 5337 3 -14.797273 -21.373838 -3.288283 # 3 -5338 5338 3 -13.975202 -20.551767 -3.288283 # 3 -5339 5339 3 -13.975202 -21.373838 -2.466212 # 3 -5340 5340 3 -14.797273 -20.551767 -2.466212 # 3 -5341 5341 3 -13.153131 -21.373838 -3.288283 # 3 -5342 5342 3 -12.331060 -20.551767 -3.288283 # 3 -5343 5343 3 -12.331060 -21.373838 -2.466212 # 3 -5344 5344 3 -13.153131 -20.551767 -2.466212 # 3 -5345 5345 3 -11.508989 -21.373838 -3.288283 # 3 -5346 5346 3 -10.686919 -20.551767 -3.288283 # 3 -5347 5347 3 -10.686919 -21.373838 -2.466212 # 3 -5348 5348 3 -11.508989 -20.551767 -2.466212 # 3 -5349 5349 3 -9.864848 -21.373838 -3.288283 # 3 -5350 5350 3 -9.042778 -20.551767 -3.288283 # 3 -5351 5351 3 -9.042778 -21.373838 -2.466212 # 3 -5352 5352 3 -9.864848 -20.551767 -2.466212 # 3 -5353 5353 3 -23.840050 -23.840050 -1.644141 # 3 -5354 5354 3 -24.662121 -23.840050 -0.822071 # 3 -5355 5355 3 -22.195910 -23.840050 -1.644141 # 3 -5356 5356 3 -23.017979 -23.840050 -0.822071 # 3 -5357 5357 3 -20.551767 -23.840050 -1.644141 # 3 -5358 5358 3 -21.373838 -23.840050 -0.822071 # 3 -5359 5359 3 -18.907625 -23.840050 -1.644141 # 3 -5360 5360 3 -19.729696 -23.840050 -0.822071 # 3 -5361 5361 3 -17.263485 -23.840050 -1.644141 # 3 -5362 5362 3 -18.085556 -23.840050 -0.822071 # 3 -5363 5363 3 -15.619343 -23.840050 -1.644141 # 3 -5364 5364 3 -16.441414 -23.840050 -0.822071 # 3 -5365 5365 3 -13.975202 -23.840050 -1.644141 # 3 -5366 5366 3 -14.797273 -23.840050 -0.822071 # 3 -5367 5367 3 -12.331060 -23.840050 -1.644141 # 3 -5368 5368 3 -13.153131 -23.840050 -0.822071 # 3 -5369 5369 3 -10.686919 -23.840050 -1.644141 # 3 -5370 5370 3 -11.508989 -23.840050 -0.822071 # 3 -5371 5371 3 -9.042778 -23.840050 -1.644141 # 3 -5372 5372 3 -9.864848 -23.840050 -0.822071 # 3 -5373 5373 3 -24.662121 -23.017979 -1.644141 # 3 -5374 5374 3 -23.840050 -22.195910 -1.644141 # 3 -5375 5375 3 -23.840050 -23.017979 -0.822071 # 3 -5376 5376 3 -24.662121 -22.195910 -0.822071 # 3 -5377 5377 3 -23.017979 -23.017979 -1.644141 # 3 -5378 5378 3 -22.195910 -22.195910 -1.644141 # 3 -5379 5379 3 -22.195910 -23.017979 -0.822071 # 3 -5380 5380 3 -23.017979 -22.195910 -0.822071 # 3 -5381 5381 3 -21.373838 -23.017979 -1.644141 # 3 -5382 5382 3 -20.551767 -22.195910 -1.644141 # 3 -5383 5383 3 -20.551767 -23.017979 -0.822071 # 3 -5384 5384 3 -21.373838 -22.195910 -0.822071 # 3 -5385 5385 3 -19.729696 -23.017979 -1.644141 # 3 -5386 5386 3 -18.907625 -22.195910 -1.644141 # 3 -5387 5387 3 -18.907625 -23.017979 -0.822071 # 3 -5388 5388 3 -19.729696 -22.195910 -0.822071 # 3 -5389 5389 3 -18.085556 -23.017979 -1.644141 # 3 -5390 5390 3 -17.263485 -22.195910 -1.644141 # 3 -5391 5391 3 -17.263485 -23.017979 -0.822071 # 3 -5392 5392 3 -18.085556 -22.195910 -0.822071 # 3 -5393 5393 3 -16.441414 -23.017979 -1.644141 # 3 -5394 5394 3 -15.619343 -22.195910 -1.644141 # 3 -5395 5395 3 -15.619343 -23.017979 -0.822071 # 3 -5396 5396 3 -16.441414 -22.195910 -0.822071 # 3 -5397 5397 3 -14.797273 -23.017979 -1.644141 # 3 -5398 5398 3 -13.975202 -22.195910 -1.644141 # 3 -5399 5399 3 -13.975202 -23.017979 -0.822071 # 3 -5400 5400 3 -14.797273 -22.195910 -0.822071 # 3 -5401 5401 3 -13.153131 -23.017979 -1.644141 # 3 -5402 5402 3 -12.331060 -22.195910 -1.644141 # 3 -5403 5403 3 -12.331060 -23.017979 -0.822071 # 3 -5404 5404 3 -13.153131 -22.195910 -0.822071 # 3 -5405 5405 3 -11.508989 -23.017979 -1.644141 # 3 -5406 5406 3 -10.686919 -22.195910 -1.644141 # 3 -5407 5407 3 -10.686919 -23.017979 -0.822071 # 3 -5408 5408 3 -11.508989 -22.195910 -0.822071 # 3 -5409 5409 3 -9.864848 -23.017979 -1.644141 # 3 -5410 5410 3 -9.042778 -22.195910 -1.644141 # 3 -5411 5411 3 -9.042778 -23.017979 -0.822071 # 3 -5412 5412 3 -9.864848 -22.195910 -0.822071 # 3 -5413 5413 3 -24.662121 -21.373838 -1.644141 # 3 -5414 5414 3 -23.840050 -20.551767 -1.644141 # 3 -5415 5415 3 -23.840050 -21.373838 -0.822071 # 3 -5416 5416 3 -24.662121 -20.551767 -0.822071 # 3 -5417 5417 3 -23.017979 -21.373838 -1.644141 # 3 -5418 5418 3 -22.195910 -20.551767 -1.644141 # 3 -5419 5419 3 -22.195910 -21.373838 -0.822071 # 3 -5420 5420 3 -23.017979 -20.551767 -0.822071 # 3 -5421 5421 3 -21.373838 -21.373838 -1.644141 # 3 -5422 5422 3 -20.551767 -20.551767 -1.644141 # 3 -5423 5423 3 -20.551767 -21.373838 -0.822071 # 3 -5424 5424 3 -21.373838 -20.551767 -0.822071 # 3 -5425 5425 3 -19.729696 -21.373838 -1.644141 # 3 -5426 5426 3 -18.907625 -20.551767 -1.644141 # 3 -5427 5427 3 -18.907625 -21.373838 -0.822071 # 3 -5428 5428 3 -19.729696 -20.551767 -0.822071 # 3 -5429 5429 3 -18.085556 -21.373838 -1.644141 # 3 -5430 5430 3 -17.263485 -20.551767 -1.644141 # 3 -5431 5431 3 -17.263485 -21.373838 -0.822071 # 3 -5432 5432 3 -18.085556 -20.551767 -0.822071 # 3 -5433 5433 3 -16.441414 -21.373838 -1.644141 # 3 -5434 5434 3 -15.619343 -20.551767 -1.644141 # 3 -5435 5435 3 -15.619343 -21.373838 -0.822071 # 3 -5436 5436 3 -16.441414 -20.551767 -0.822071 # 3 -5437 5437 3 -14.797273 -21.373838 -1.644141 # 3 -5438 5438 3 -13.975202 -20.551767 -1.644141 # 3 -5439 5439 3 -13.975202 -21.373838 -0.822071 # 3 -5440 5440 3 -14.797273 -20.551767 -0.822071 # 3 -5441 5441 3 -13.153131 -21.373838 -1.644141 # 3 -5442 5442 3 -12.331060 -20.551767 -1.644141 # 3 -5443 5443 3 -12.331060 -21.373838 -0.822071 # 3 -5444 5444 3 -13.153131 -20.551767 -0.822071 # 3 -5445 5445 3 -11.508989 -21.373838 -1.644141 # 3 -5446 5446 3 -10.686919 -20.551767 -1.644141 # 3 -5447 5447 3 -10.686919 -21.373838 -0.822071 # 3 -5448 5448 3 -11.508989 -20.551767 -0.822071 # 3 -5449 5449 3 -9.864848 -21.373838 -1.644141 # 3 -5450 5450 3 -9.042778 -20.551767 -1.644141 # 3 -5451 5451 3 -9.042778 -21.373838 -0.822071 # 3 -5452 5452 3 -9.864848 -20.551767 -0.822071 # 3 -5453 5453 3 -23.840050 -23.840050 0.000000 # 3 -5454 5454 3 -24.662121 -23.840050 0.822071 # 3 -5455 5455 3 -22.195910 -23.840050 0.000000 # 3 -5456 5456 3 -23.017979 -23.840050 0.822071 # 3 -5457 5457 3 -20.551767 -23.840050 0.000000 # 3 -5458 5458 3 -21.373838 -23.840050 0.822071 # 3 -5459 5459 3 -18.907625 -23.840050 0.000000 # 3 -5460 5460 3 -19.729696 -23.840050 0.822071 # 3 -5461 5461 3 -17.263485 -23.840050 0.000000 # 3 -5462 5462 3 -18.085556 -23.840050 0.822071 # 3 -5463 5463 3 -15.619343 -23.840050 0.000000 # 3 -5464 5464 3 -16.441414 -23.840050 0.822071 # 3 -5465 5465 3 -13.975202 -23.840050 0.000000 # 3 -5466 5466 3 -14.797273 -23.840050 0.822071 # 3 -5467 5467 3 -12.331060 -23.840050 0.000000 # 3 -5468 5468 3 -13.153131 -23.840050 0.822071 # 3 -5469 5469 3 -10.686919 -23.840050 0.000000 # 3 -5470 5470 3 -11.508989 -23.840050 0.822071 # 3 -5471 5471 3 -9.042778 -23.840050 0.000000 # 3 -5472 5472 3 -9.864848 -23.840050 0.822071 # 3 -5473 5473 3 -24.662121 -23.017979 0.000000 # 3 -5474 5474 3 -23.840050 -22.195910 0.000000 # 3 -5475 5475 3 -23.840050 -23.017979 0.822071 # 3 -5476 5476 3 -24.662121 -22.195910 0.822071 # 3 -5477 5477 3 -23.017979 -23.017979 0.000000 # 3 -5478 5478 3 -22.195910 -22.195910 0.000000 # 3 -5479 5479 3 -22.195910 -23.017979 0.822071 # 3 -5480 5480 3 -23.017979 -22.195910 0.822071 # 3 -5481 5481 3 -21.373838 -23.017979 0.000000 # 3 -5482 5482 3 -20.551767 -22.195910 0.000000 # 3 -5483 5483 3 -20.551767 -23.017979 0.822071 # 3 -5484 5484 3 -21.373838 -22.195910 0.822071 # 3 -5485 5485 3 -19.729696 -23.017979 0.000000 # 3 -5486 5486 3 -18.907625 -22.195910 0.000000 # 3 -5487 5487 3 -18.907625 -23.017979 0.822071 # 3 -5488 5488 3 -19.729696 -22.195910 0.822071 # 3 -5489 5489 3 -18.085556 -23.017979 0.000000 # 3 -5490 5490 3 -17.263485 -22.195910 0.000000 # 3 -5491 5491 3 -17.263485 -23.017979 0.822071 # 3 -5492 5492 3 -18.085556 -22.195910 0.822071 # 3 -5493 5493 3 -16.441414 -23.017979 0.000000 # 3 -5494 5494 3 -15.619343 -22.195910 0.000000 # 3 -5495 5495 3 -15.619343 -23.017979 0.822071 # 3 -5496 5496 3 -16.441414 -22.195910 0.822071 # 3 -5497 5497 3 -14.797273 -23.017979 0.000000 # 3 -5498 5498 3 -13.975202 -22.195910 0.000000 # 3 -5499 5499 3 -13.975202 -23.017979 0.822071 # 3 -5500 5500 3 -14.797273 -22.195910 0.822071 # 3 -5501 5501 3 -13.153131 -23.017979 0.000000 # 3 -5502 5502 3 -12.331060 -22.195910 0.000000 # 3 -5503 5503 3 -12.331060 -23.017979 0.822071 # 3 -5504 5504 3 -13.153131 -22.195910 0.822071 # 3 -5505 5505 3 -11.508989 -23.017979 0.000000 # 3 -5506 5506 3 -10.686919 -22.195910 0.000000 # 3 -5507 5507 3 -10.686919 -23.017979 0.822071 # 3 -5508 5508 3 -11.508989 -22.195910 0.822071 # 3 -5509 5509 3 -9.864848 -23.017979 0.000000 # 3 -5510 5510 3 -9.042778 -22.195910 0.000000 # 3 -5511 5511 3 -9.042778 -23.017979 0.822071 # 3 -5512 5512 3 -9.864848 -22.195910 0.822071 # 3 -5513 5513 3 -24.662121 -21.373838 0.000000 # 3 -5514 5514 3 -23.840050 -20.551767 0.000000 # 3 -5515 5515 3 -23.840050 -21.373838 0.822071 # 3 -5516 5516 3 -24.662121 -20.551767 0.822071 # 3 -5517 5517 3 -23.017979 -21.373838 0.000000 # 3 -5518 5518 3 -22.195910 -20.551767 0.000000 # 3 -5519 5519 3 -22.195910 -21.373838 0.822071 # 3 -5520 5520 3 -23.017979 -20.551767 0.822071 # 3 -5521 5521 3 -21.373838 -21.373838 0.000000 # 3 -5522 5522 3 -20.551767 -20.551767 0.000000 # 3 -5523 5523 3 -20.551767 -21.373838 0.822071 # 3 -5524 5524 3 -21.373838 -20.551767 0.822071 # 3 -5525 5525 3 -19.729696 -21.373838 0.000000 # 3 -5526 5526 3 -18.907625 -20.551767 0.000000 # 3 -5527 5527 3 -18.907625 -21.373838 0.822071 # 3 -5528 5528 3 -19.729696 -20.551767 0.822071 # 3 -5529 5529 3 -18.085556 -21.373838 0.000000 # 3 -5530 5530 3 -17.263485 -20.551767 0.000000 # 3 -5531 5531 3 -17.263485 -21.373838 0.822071 # 3 -5532 5532 3 -18.085556 -20.551767 0.822071 # 3 -5533 5533 3 -16.441414 -21.373838 0.000000 # 3 -5534 5534 3 -15.619343 -20.551767 0.000000 # 3 -5535 5535 3 -15.619343 -21.373838 0.822071 # 3 -5536 5536 3 -16.441414 -20.551767 0.822071 # 3 -5537 5537 3 -14.797273 -21.373838 0.000000 # 3 -5538 5538 3 -13.975202 -20.551767 0.000000 # 3 -5539 5539 3 -13.975202 -21.373838 0.822071 # 3 -5540 5540 3 -14.797273 -20.551767 0.822071 # 3 -5541 5541 3 -13.153131 -21.373838 0.000000 # 3 -5542 5542 3 -12.331060 -20.551767 0.000000 # 3 -5543 5543 3 -12.331060 -21.373838 0.822071 # 3 -5544 5544 3 -13.153131 -20.551767 0.822071 # 3 -5545 5545 3 -11.508989 -21.373838 0.000000 # 3 -5546 5546 3 -10.686919 -20.551767 0.000000 # 3 -5547 5547 3 -10.686919 -21.373838 0.822071 # 3 -5548 5548 3 -11.508989 -20.551767 0.822071 # 3 -5549 5549 3 -9.864848 -21.373838 0.000000 # 3 -5550 5550 3 -9.042778 -20.551767 0.000000 # 3 -5551 5551 3 -9.042778 -21.373838 0.822071 # 3 -5552 5552 3 -9.864848 -20.551767 0.822071 # 3 -5553 5553 3 -23.840050 -23.840050 1.644141 # 3 -5554 5554 3 -24.662121 -23.840050 2.466212 # 3 -5555 5555 3 -22.195910 -23.840050 1.644141 # 3 -5556 5556 3 -23.017979 -23.840050 2.466212 # 3 -5557 5557 3 -20.551767 -23.840050 1.644141 # 3 -5558 5558 3 -21.373838 -23.840050 2.466212 # 3 -5559 5559 3 -18.907625 -23.840050 1.644141 # 3 -5560 5560 3 -19.729696 -23.840050 2.466212 # 3 -5561 5561 3 -17.263485 -23.840050 1.644141 # 3 -5562 5562 3 -18.085556 -23.840050 2.466212 # 3 -5563 5563 3 -15.619343 -23.840050 1.644141 # 3 -5564 5564 3 -16.441414 -23.840050 2.466212 # 3 -5565 5565 3 -13.975202 -23.840050 1.644141 # 3 -5566 5566 3 -14.797273 -23.840050 2.466212 # 3 -5567 5567 3 -12.331060 -23.840050 1.644141 # 3 -5568 5568 3 -13.153131 -23.840050 2.466212 # 3 -5569 5569 3 -10.686919 -23.840050 1.644141 # 3 -5570 5570 3 -11.508989 -23.840050 2.466212 # 3 -5571 5571 3 -9.042778 -23.840050 1.644141 # 3 -5572 5572 3 -9.864848 -23.840050 2.466212 # 3 -5573 5573 3 -24.662121 -23.017979 1.644141 # 3 -5574 5574 3 -23.840050 -22.195910 1.644141 # 3 -5575 5575 3 -23.840050 -23.017979 2.466212 # 3 -5576 5576 3 -24.662121 -22.195910 2.466212 # 3 -5577 5577 3 -23.017979 -23.017979 1.644141 # 3 -5578 5578 3 -22.195910 -22.195910 1.644141 # 3 -5579 5579 3 -22.195910 -23.017979 2.466212 # 3 -5580 5580 3 -23.017979 -22.195910 2.466212 # 3 -5581 5581 3 -21.373838 -23.017979 1.644141 # 3 -5582 5582 3 -20.551767 -22.195910 1.644141 # 3 -5583 5583 3 -20.551767 -23.017979 2.466212 # 3 -5584 5584 3 -21.373838 -22.195910 2.466212 # 3 -5585 5585 3 -19.729696 -23.017979 1.644141 # 3 -5586 5586 3 -18.907625 -22.195910 1.644141 # 3 -5587 5587 3 -18.907625 -23.017979 2.466212 # 3 -5588 5588 3 -19.729696 -22.195910 2.466212 # 3 -5589 5589 3 -18.085556 -23.017979 1.644141 # 3 -5590 5590 3 -17.263485 -22.195910 1.644141 # 3 -5591 5591 3 -17.263485 -23.017979 2.466212 # 3 -5592 5592 3 -18.085556 -22.195910 2.466212 # 3 -5593 5593 3 -16.441414 -23.017979 1.644141 # 3 -5594 5594 3 -15.619343 -22.195910 1.644141 # 3 -5595 5595 3 -15.619343 -23.017979 2.466212 # 3 -5596 5596 3 -16.441414 -22.195910 2.466212 # 3 -5597 5597 3 -14.797273 -23.017979 1.644141 # 3 -5598 5598 3 -13.975202 -22.195910 1.644141 # 3 -5599 5599 3 -13.975202 -23.017979 2.466212 # 3 -5600 5600 3 -14.797273 -22.195910 2.466212 # 3 -5601 5601 3 -13.153131 -23.017979 1.644141 # 3 -5602 5602 3 -12.331060 -22.195910 1.644141 # 3 -5603 5603 3 -12.331060 -23.017979 2.466212 # 3 -5604 5604 3 -13.153131 -22.195910 2.466212 # 3 -5605 5605 3 -11.508989 -23.017979 1.644141 # 3 -5606 5606 3 -10.686919 -22.195910 1.644141 # 3 -5607 5607 3 -10.686919 -23.017979 2.466212 # 3 -5608 5608 3 -11.508989 -22.195910 2.466212 # 3 -5609 5609 3 -9.864848 -23.017979 1.644141 # 3 -5610 5610 3 -9.042778 -22.195910 1.644141 # 3 -5611 5611 3 -9.042778 -23.017979 2.466212 # 3 -5612 5612 3 -9.864848 -22.195910 2.466212 # 3 -5613 5613 3 -24.662121 -21.373838 1.644141 # 3 -5614 5614 3 -23.840050 -20.551767 1.644141 # 3 -5615 5615 3 -23.840050 -21.373838 2.466212 # 3 -5616 5616 3 -24.662121 -20.551767 2.466212 # 3 -5617 5617 3 -23.017979 -21.373838 1.644141 # 3 -5618 5618 3 -22.195910 -20.551767 1.644141 # 3 -5619 5619 3 -22.195910 -21.373838 2.466212 # 3 -5620 5620 3 -23.017979 -20.551767 2.466212 # 3 -5621 5621 3 -21.373838 -21.373838 1.644141 # 3 -5622 5622 3 -20.551767 -20.551767 1.644141 # 3 -5623 5623 3 -20.551767 -21.373838 2.466212 # 3 -5624 5624 3 -21.373838 -20.551767 2.466212 # 3 -5625 5625 3 -19.729696 -21.373838 1.644141 # 3 -5626 5626 3 -18.907625 -20.551767 1.644141 # 3 -5627 5627 3 -18.907625 -21.373838 2.466212 # 3 -5628 5628 3 -19.729696 -20.551767 2.466212 # 3 -5629 5629 3 -18.085556 -21.373838 1.644141 # 3 -5630 5630 3 -17.263485 -20.551767 1.644141 # 3 -5631 5631 3 -17.263485 -21.373838 2.466212 # 3 -5632 5632 3 -18.085556 -20.551767 2.466212 # 3 -5633 5633 3 -16.441414 -21.373838 1.644141 # 3 -5634 5634 3 -15.619343 -20.551767 1.644141 # 3 -5635 5635 3 -15.619343 -21.373838 2.466212 # 3 -5636 5636 3 -16.441414 -20.551767 2.466212 # 3 -5637 5637 3 -14.797273 -21.373838 1.644141 # 3 -5638 5638 3 -13.975202 -20.551767 1.644141 # 3 -5639 5639 3 -13.975202 -21.373838 2.466212 # 3 -5640 5640 3 -14.797273 -20.551767 2.466212 # 3 -5641 5641 3 -13.153131 -21.373838 1.644141 # 3 -5642 5642 3 -12.331060 -20.551767 1.644141 # 3 -5643 5643 3 -12.331060 -21.373838 2.466212 # 3 -5644 5644 3 -13.153131 -20.551767 2.466212 # 3 -5645 5645 3 -11.508989 -21.373838 1.644141 # 3 -5646 5646 3 -10.686919 -20.551767 1.644141 # 3 -5647 5647 3 -10.686919 -21.373838 2.466212 # 3 -5648 5648 3 -11.508989 -20.551767 2.466212 # 3 -5649 5649 3 -9.864848 -21.373838 1.644141 # 3 -5650 5650 3 -9.042778 -20.551767 1.644141 # 3 -5651 5651 3 -9.042778 -21.373838 2.466212 # 3 -5652 5652 3 -9.864848 -20.551767 2.466212 # 3 -5653 5653 3 -23.840050 -23.840050 3.288283 # 3 -5654 5654 3 -24.662121 -23.840050 4.110353 # 3 -5655 5655 3 -22.195910 -23.840050 3.288283 # 3 -5656 5656 3 -23.017979 -23.840050 4.110353 # 3 -5657 5657 3 -20.551767 -23.840050 3.288283 # 3 -5658 5658 3 -21.373838 -23.840050 4.110353 # 3 -5659 5659 3 -18.907625 -23.840050 3.288283 # 3 -5660 5660 3 -19.729696 -23.840050 4.110353 # 3 -5661 5661 3 -17.263485 -23.840050 3.288283 # 3 -5662 5662 3 -18.085556 -23.840050 4.110353 # 3 -5663 5663 3 -15.619343 -23.840050 3.288283 # 3 -5664 5664 3 -16.441414 -23.840050 4.110353 # 3 -5665 5665 3 -13.975202 -23.840050 3.288283 # 3 -5666 5666 3 -14.797273 -23.840050 4.110353 # 3 -5667 5667 3 -12.331060 -23.840050 3.288283 # 3 -5668 5668 3 -13.153131 -23.840050 4.110353 # 3 -5669 5669 3 -10.686919 -23.840050 3.288283 # 3 -5670 5670 3 -11.508989 -23.840050 4.110353 # 3 -5671 5671 3 -9.042778 -23.840050 3.288283 # 3 -5672 5672 3 -9.864848 -23.840050 4.110353 # 3 -5673 5673 3 -24.662121 -23.017979 3.288283 # 3 -5674 5674 3 -23.840050 -22.195910 3.288283 # 3 -5675 5675 3 -23.840050 -23.017979 4.110353 # 3 -5676 5676 3 -24.662121 -22.195910 4.110353 # 3 -5677 5677 3 -23.017979 -23.017979 3.288283 # 3 -5678 5678 3 -22.195910 -22.195910 3.288283 # 3 -5679 5679 3 -22.195910 -23.017979 4.110353 # 3 -5680 5680 3 -23.017979 -22.195910 4.110353 # 3 -5681 5681 3 -21.373838 -23.017979 3.288283 # 3 -5682 5682 3 -20.551767 -22.195910 3.288283 # 3 -5683 5683 3 -20.551767 -23.017979 4.110353 # 3 -5684 5684 3 -21.373838 -22.195910 4.110353 # 3 -5685 5685 3 -19.729696 -23.017979 3.288283 # 3 -5686 5686 3 -18.907625 -22.195910 3.288283 # 3 -5687 5687 3 -18.907625 -23.017979 4.110353 # 3 -5688 5688 3 -19.729696 -22.195910 4.110353 # 3 -5689 5689 3 -18.085556 -23.017979 3.288283 # 3 -5690 5690 3 -17.263485 -22.195910 3.288283 # 3 -5691 5691 3 -17.263485 -23.017979 4.110353 # 3 -5692 5692 3 -18.085556 -22.195910 4.110353 # 3 -5693 5693 3 -16.441414 -23.017979 3.288283 # 3 -5694 5694 3 -15.619343 -22.195910 3.288283 # 3 -5695 5695 3 -15.619343 -23.017979 4.110353 # 3 -5696 5696 3 -16.441414 -22.195910 4.110353 # 3 -5697 5697 3 -14.797273 -23.017979 3.288283 # 3 -5698 5698 3 -13.975202 -22.195910 3.288283 # 3 -5699 5699 3 -13.975202 -23.017979 4.110353 # 3 -5700 5700 3 -14.797273 -22.195910 4.110353 # 3 -5701 5701 3 -13.153131 -23.017979 3.288283 # 3 -5702 5702 3 -12.331060 -22.195910 3.288283 # 3 -5703 5703 3 -12.331060 -23.017979 4.110353 # 3 -5704 5704 3 -13.153131 -22.195910 4.110353 # 3 -5705 5705 3 -11.508989 -23.017979 3.288283 # 3 -5706 5706 3 -10.686919 -22.195910 3.288283 # 3 -5707 5707 3 -10.686919 -23.017979 4.110353 # 3 -5708 5708 3 -11.508989 -22.195910 4.110353 # 3 -5709 5709 3 -9.864848 -23.017979 3.288283 # 3 -5710 5710 3 -9.042778 -22.195910 3.288283 # 3 -5711 5711 3 -9.042778 -23.017979 4.110353 # 3 -5712 5712 3 -9.864848 -22.195910 4.110353 # 3 -5713 5713 3 -24.662121 -21.373838 3.288283 # 3 -5714 5714 3 -23.840050 -20.551767 3.288283 # 3 -5715 5715 3 -23.840050 -21.373838 4.110353 # 3 -5716 5716 3 -24.662121 -20.551767 4.110353 # 3 -5717 5717 3 -23.017979 -21.373838 3.288283 # 3 -5718 5718 3 -22.195910 -20.551767 3.288283 # 3 -5719 5719 3 -22.195910 -21.373838 4.110353 # 3 -5720 5720 3 -23.017979 -20.551767 4.110353 # 3 -5721 5721 3 -21.373838 -21.373838 3.288283 # 3 -5722 5722 3 -20.551767 -20.551767 3.288283 # 3 -5723 5723 3 -20.551767 -21.373838 4.110353 # 3 -5724 5724 3 -21.373838 -20.551767 4.110353 # 3 -5725 5725 3 -19.729696 -21.373838 3.288283 # 3 -5726 5726 3 -18.907625 -20.551767 3.288283 # 3 -5727 5727 3 -18.907625 -21.373838 4.110353 # 3 -5728 5728 3 -19.729696 -20.551767 4.110353 # 3 -5729 5729 3 -18.085556 -21.373838 3.288283 # 3 -5730 5730 3 -17.263485 -20.551767 3.288283 # 3 -5731 5731 3 -17.263485 -21.373838 4.110353 # 3 -5732 5732 3 -18.085556 -20.551767 4.110353 # 3 -5733 5733 3 -16.441414 -21.373838 3.288283 # 3 -5734 5734 3 -15.619343 -20.551767 3.288283 # 3 -5735 5735 3 -15.619343 -21.373838 4.110353 # 3 -5736 5736 3 -16.441414 -20.551767 4.110353 # 3 -5737 5737 3 -14.797273 -21.373838 3.288283 # 3 -5738 5738 3 -13.975202 -20.551767 3.288283 # 3 -5739 5739 3 -13.975202 -21.373838 4.110353 # 3 -5740 5740 3 -14.797273 -20.551767 4.110353 # 3 -5741 5741 3 -13.153131 -21.373838 3.288283 # 3 -5742 5742 3 -12.331060 -20.551767 3.288283 # 3 -5743 5743 3 -12.331060 -21.373838 4.110353 # 3 -5744 5744 3 -13.153131 -20.551767 4.110353 # 3 -5745 5745 3 -11.508989 -21.373838 3.288283 # 3 -5746 5746 3 -10.686919 -20.551767 3.288283 # 3 -5747 5747 3 -10.686919 -21.373838 4.110353 # 3 -5748 5748 3 -11.508989 -20.551767 4.110353 # 3 -5749 5749 3 -9.864848 -21.373838 3.288283 # 3 -5750 5750 3 -9.042778 -20.551767 3.288283 # 3 -5751 5751 3 -9.042778 -21.373838 4.110353 # 3 -5752 5752 3 -9.864848 -20.551767 4.110353 # 3 -5753 5753 3 -23.840050 -23.840050 4.932424 # 3 -5754 5754 3 -24.662121 -23.840050 5.754495 # 3 -5755 5755 3 -22.195910 -23.840050 4.932424 # 3 -5756 5756 3 -23.017979 -23.840050 5.754495 # 3 -5757 5757 3 -20.551767 -23.840050 4.932424 # 3 -5758 5758 3 -21.373838 -23.840050 5.754495 # 3 -5759 5759 3 -18.907625 -23.840050 4.932424 # 3 -5760 5760 3 -19.729696 -23.840050 5.754495 # 3 -5761 5761 3 -17.263485 -23.840050 4.932424 # 3 -5762 5762 3 -18.085556 -23.840050 5.754495 # 3 -5763 5763 3 -15.619343 -23.840050 4.932424 # 3 -5764 5764 3 -16.441414 -23.840050 5.754495 # 3 -5765 5765 3 -13.975202 -23.840050 4.932424 # 3 -5766 5766 3 -14.797273 -23.840050 5.754495 # 3 -5767 5767 3 -12.331060 -23.840050 4.932424 # 3 -5768 5768 3 -13.153131 -23.840050 5.754495 # 3 -5769 5769 3 -10.686919 -23.840050 4.932424 # 3 -5770 5770 3 -11.508989 -23.840050 5.754495 # 3 -5771 5771 3 -9.042778 -23.840050 4.932424 # 3 -5772 5772 3 -9.864848 -23.840050 5.754495 # 3 -5773 5773 3 -24.662121 -23.017979 4.932424 # 3 -5774 5774 3 -23.840050 -22.195910 4.932424 # 3 -5775 5775 3 -23.840050 -23.017979 5.754495 # 3 -5776 5776 3 -24.662121 -22.195910 5.754495 # 3 -5777 5777 3 -23.017979 -23.017979 4.932424 # 3 -5778 5778 3 -22.195910 -22.195910 4.932424 # 3 -5779 5779 3 -22.195910 -23.017979 5.754495 # 3 -5780 5780 3 -23.017979 -22.195910 5.754495 # 3 -5781 5781 3 -21.373838 -23.017979 4.932424 # 3 -5782 5782 3 -20.551767 -22.195910 4.932424 # 3 -5783 5783 3 -20.551767 -23.017979 5.754495 # 3 -5784 5784 3 -21.373838 -22.195910 5.754495 # 3 -5785 5785 3 -19.729696 -23.017979 4.932424 # 3 -5786 5786 3 -18.907625 -22.195910 4.932424 # 3 -5787 5787 3 -18.907625 -23.017979 5.754495 # 3 -5788 5788 3 -19.729696 -22.195910 5.754495 # 3 -5789 5789 3 -18.085556 -23.017979 4.932424 # 3 -5790 5790 3 -17.263485 -22.195910 4.932424 # 3 -5791 5791 3 -17.263485 -23.017979 5.754495 # 3 -5792 5792 3 -18.085556 -22.195910 5.754495 # 3 -5793 5793 3 -16.441414 -23.017979 4.932424 # 3 -5794 5794 3 -15.619343 -22.195910 4.932424 # 3 -5795 5795 3 -15.619343 -23.017979 5.754495 # 3 -5796 5796 3 -16.441414 -22.195910 5.754495 # 3 -5797 5797 3 -14.797273 -23.017979 4.932424 # 3 -5798 5798 3 -13.975202 -22.195910 4.932424 # 3 -5799 5799 3 -13.975202 -23.017979 5.754495 # 3 -5800 5800 3 -14.797273 -22.195910 5.754495 # 3 -5801 5801 3 -13.153131 -23.017979 4.932424 # 3 -5802 5802 3 -12.331060 -22.195910 4.932424 # 3 -5803 5803 3 -12.331060 -23.017979 5.754495 # 3 -5804 5804 3 -13.153131 -22.195910 5.754495 # 3 -5805 5805 3 -11.508989 -23.017979 4.932424 # 3 -5806 5806 3 -10.686919 -22.195910 4.932424 # 3 -5807 5807 3 -10.686919 -23.017979 5.754495 # 3 -5808 5808 3 -11.508989 -22.195910 5.754495 # 3 -5809 5809 3 -9.864848 -23.017979 4.932424 # 3 -5810 5810 3 -9.042778 -22.195910 4.932424 # 3 -5811 5811 3 -9.042778 -23.017979 5.754495 # 3 -5812 5812 3 -9.864848 -22.195910 5.754495 # 3 -5813 5813 3 -24.662121 -21.373838 4.932424 # 3 -5814 5814 3 -23.840050 -20.551767 4.932424 # 3 -5815 5815 3 -23.840050 -21.373838 5.754495 # 3 -5816 5816 3 -24.662121 -20.551767 5.754495 # 3 -5817 5817 3 -23.017979 -21.373838 4.932424 # 3 -5818 5818 3 -22.195910 -20.551767 4.932424 # 3 -5819 5819 3 -22.195910 -21.373838 5.754495 # 3 -5820 5820 3 -23.017979 -20.551767 5.754495 # 3 -5821 5821 3 -21.373838 -21.373838 4.932424 # 3 -5822 5822 3 -20.551767 -20.551767 4.932424 # 3 -5823 5823 3 -20.551767 -21.373838 5.754495 # 3 -5824 5824 3 -21.373838 -20.551767 5.754495 # 3 -5825 5825 3 -19.729696 -21.373838 4.932424 # 3 -5826 5826 3 -18.907625 -20.551767 4.932424 # 3 -5827 5827 3 -18.907625 -21.373838 5.754495 # 3 -5828 5828 3 -19.729696 -20.551767 5.754495 # 3 -5829 5829 3 -18.085556 -21.373838 4.932424 # 3 -5830 5830 3 -17.263485 -20.551767 4.932424 # 3 -5831 5831 3 -17.263485 -21.373838 5.754495 # 3 -5832 5832 3 -18.085556 -20.551767 5.754495 # 3 -5833 5833 3 -16.441414 -21.373838 4.932424 # 3 -5834 5834 3 -15.619343 -20.551767 4.932424 # 3 -5835 5835 3 -15.619343 -21.373838 5.754495 # 3 -5836 5836 3 -16.441414 -20.551767 5.754495 # 3 -5837 5837 3 -14.797273 -21.373838 4.932424 # 3 -5838 5838 3 -13.975202 -20.551767 4.932424 # 3 -5839 5839 3 -13.975202 -21.373838 5.754495 # 3 -5840 5840 3 -14.797273 -20.551767 5.754495 # 3 -5841 5841 3 -13.153131 -21.373838 4.932424 # 3 -5842 5842 3 -12.331060 -20.551767 4.932424 # 3 -5843 5843 3 -12.331060 -21.373838 5.754495 # 3 -5844 5844 3 -13.153131 -20.551767 5.754495 # 3 -5845 5845 3 -11.508989 -21.373838 4.932424 # 3 -5846 5846 3 -10.686919 -20.551767 4.932424 # 3 -5847 5847 3 -10.686919 -21.373838 5.754495 # 3 -5848 5848 3 -11.508989 -20.551767 5.754495 # 3 -5849 5849 3 -9.864848 -21.373838 4.932424 # 3 -5850 5850 3 -9.042778 -20.551767 4.932424 # 3 -5851 5851 3 -9.042778 -21.373838 5.754495 # 3 -5852 5852 3 -9.864848 -20.551767 5.754495 # 3 -5853 5853 3 -23.840050 -23.840050 6.576566 # 3 -5854 5854 3 -24.662121 -23.840050 7.398636 # 3 -5855 5855 3 -22.195910 -23.840050 6.576566 # 3 -5856 5856 3 -23.017979 -23.840050 7.398636 # 3 -5857 5857 3 -20.551767 -23.840050 6.576566 # 3 -5858 5858 3 -21.373838 -23.840050 7.398636 # 3 -5859 5859 3 -18.907625 -23.840050 6.576566 # 3 -5860 5860 3 -19.729696 -23.840050 7.398636 # 3 -5861 5861 3 -17.263485 -23.840050 6.576566 # 3 -5862 5862 3 -18.085556 -23.840050 7.398636 # 3 -5863 5863 3 -15.619343 -23.840050 6.576566 # 3 -5864 5864 3 -16.441414 -23.840050 7.398636 # 3 -5865 5865 3 -13.975202 -23.840050 6.576566 # 3 -5866 5866 3 -14.797273 -23.840050 7.398636 # 3 -5867 5867 3 -12.331060 -23.840050 6.576566 # 3 -5868 5868 3 -13.153131 -23.840050 7.398636 # 3 -5869 5869 3 -10.686919 -23.840050 6.576566 # 3 -5870 5870 3 -11.508989 -23.840050 7.398636 # 3 -5871 5871 3 -9.042778 -23.840050 6.576566 # 3 -5872 5872 3 -9.864848 -23.840050 7.398636 # 3 -5873 5873 3 -24.662121 -23.017979 6.576566 # 3 -5874 5874 3 -23.840050 -22.195910 6.576566 # 3 -5875 5875 3 -23.840050 -23.017979 7.398636 # 3 -5876 5876 3 -24.662121 -22.195910 7.398636 # 3 -5877 5877 3 -23.017979 -23.017979 6.576566 # 3 -5878 5878 3 -22.195910 -22.195910 6.576566 # 3 -5879 5879 3 -22.195910 -23.017979 7.398636 # 3 -5880 5880 3 -23.017979 -22.195910 7.398636 # 3 -5881 5881 3 -21.373838 -23.017979 6.576566 # 3 -5882 5882 3 -20.551767 -22.195910 6.576566 # 3 -5883 5883 3 -20.551767 -23.017979 7.398636 # 3 -5884 5884 3 -21.373838 -22.195910 7.398636 # 3 -5885 5885 3 -19.729696 -23.017979 6.576566 # 3 -5886 5886 3 -18.907625 -22.195910 6.576566 # 3 -5887 5887 3 -18.907625 -23.017979 7.398636 # 3 -5888 5888 3 -19.729696 -22.195910 7.398636 # 3 -5889 5889 3 -18.085556 -23.017979 6.576566 # 3 -5890 5890 3 -17.263485 -22.195910 6.576566 # 3 -5891 5891 3 -17.263485 -23.017979 7.398636 # 3 -5892 5892 3 -18.085556 -22.195910 7.398636 # 3 -5893 5893 3 -16.441414 -23.017979 6.576566 # 3 -5894 5894 3 -15.619343 -22.195910 6.576566 # 3 -5895 5895 3 -15.619343 -23.017979 7.398636 # 3 -5896 5896 3 -16.441414 -22.195910 7.398636 # 3 -5897 5897 3 -14.797273 -23.017979 6.576566 # 3 -5898 5898 3 -13.975202 -22.195910 6.576566 # 3 -5899 5899 3 -13.975202 -23.017979 7.398636 # 3 -5900 5900 3 -14.797273 -22.195910 7.398636 # 3 -5901 5901 3 -13.153131 -23.017979 6.576566 # 3 -5902 5902 3 -12.331060 -22.195910 6.576566 # 3 -5903 5903 3 -12.331060 -23.017979 7.398636 # 3 -5904 5904 3 -13.153131 -22.195910 7.398636 # 3 -5905 5905 3 -11.508989 -23.017979 6.576566 # 3 -5906 5906 3 -10.686919 -22.195910 6.576566 # 3 -5907 5907 3 -10.686919 -23.017979 7.398636 # 3 -5908 5908 3 -11.508989 -22.195910 7.398636 # 3 -5909 5909 3 -9.864848 -23.017979 6.576566 # 3 -5910 5910 3 -9.042778 -22.195910 6.576566 # 3 -5911 5911 3 -9.042778 -23.017979 7.398636 # 3 -5912 5912 3 -9.864848 -22.195910 7.398636 # 3 -5913 5913 3 -24.662121 -21.373838 6.576566 # 3 -5914 5914 3 -23.840050 -20.551767 6.576566 # 3 -5915 5915 3 -23.840050 -21.373838 7.398636 # 3 -5916 5916 3 -24.662121 -20.551767 7.398636 # 3 -5917 5917 3 -23.017979 -21.373838 6.576566 # 3 -5918 5918 3 -22.195910 -20.551767 6.576566 # 3 -5919 5919 3 -22.195910 -21.373838 7.398636 # 3 -5920 5920 3 -23.017979 -20.551767 7.398636 # 3 -5921 5921 3 -21.373838 -21.373838 6.576566 # 3 -5922 5922 3 -20.551767 -20.551767 6.576566 # 3 -5923 5923 3 -20.551767 -21.373838 7.398636 # 3 -5924 5924 3 -21.373838 -20.551767 7.398636 # 3 -5925 5925 3 -19.729696 -21.373838 6.576566 # 3 -5926 5926 3 -18.907625 -20.551767 6.576566 # 3 -5927 5927 3 -18.907625 -21.373838 7.398636 # 3 -5928 5928 3 -19.729696 -20.551767 7.398636 # 3 -5929 5929 3 -18.085556 -21.373838 6.576566 # 3 -5930 5930 3 -17.263485 -20.551767 6.576566 # 3 -5931 5931 3 -17.263485 -21.373838 7.398636 # 3 -5932 5932 3 -18.085556 -20.551767 7.398636 # 3 -5933 5933 3 -16.441414 -21.373838 6.576566 # 3 -5934 5934 3 -15.619343 -20.551767 6.576566 # 3 -5935 5935 3 -15.619343 -21.373838 7.398636 # 3 -5936 5936 3 -16.441414 -20.551767 7.398636 # 3 -5937 5937 3 -14.797273 -21.373838 6.576566 # 3 -5938 5938 3 -13.975202 -20.551767 6.576566 # 3 -5939 5939 3 -13.975202 -21.373838 7.398636 # 3 -5940 5940 3 -14.797273 -20.551767 7.398636 # 3 -5941 5941 3 -13.153131 -21.373838 6.576566 # 3 -5942 5942 3 -12.331060 -20.551767 6.576566 # 3 -5943 5943 3 -12.331060 -21.373838 7.398636 # 3 -5944 5944 3 -13.153131 -20.551767 7.398636 # 3 -5945 5945 3 -11.508989 -21.373838 6.576566 # 3 -5946 5946 3 -10.686919 -20.551767 6.576566 # 3 -5947 5947 3 -10.686919 -21.373838 7.398636 # 3 -5948 5948 3 -11.508989 -20.551767 7.398636 # 3 -5949 5949 3 -9.864848 -21.373838 6.576566 # 3 -5950 5950 3 -9.042778 -20.551767 6.576566 # 3 -5951 5951 3 -9.042778 -21.373838 7.398636 # 3 -5952 5952 3 -9.864848 -20.551767 7.398636 # 3 -5953 5953 3 -23.840050 -23.840050 8.220707 # 3 -5954 5954 3 -22.195910 -23.840050 8.220707 # 3 -5955 5955 3 -20.551767 -23.840050 8.220707 # 3 -5956 5956 3 -18.907625 -23.840050 8.220707 # 3 -5957 5957 3 -17.263485 -23.840050 8.220707 # 3 -5958 5958 3 -15.619343 -23.840050 8.220707 # 3 -5959 5959 3 -13.975202 -23.840050 8.220707 # 3 -5960 5960 3 -12.331060 -23.840050 8.220707 # 3 -5961 5961 3 -10.686919 -23.840050 8.220707 # 3 -5962 5962 3 -9.042778 -23.840050 8.220707 # 3 -5963 5963 3 -24.662121 -23.017979 8.220707 # 3 -5964 5964 3 -23.840050 -22.195910 8.220707 # 3 -5965 5965 3 -23.017979 -23.017979 8.220707 # 3 -5966 5966 3 -22.195910 -22.195910 8.220707 # 3 -5967 5967 3 -21.373838 -23.017979 8.220707 # 3 -5968 5968 3 -20.551767 -22.195910 8.220707 # 3 -5969 5969 3 -19.729696 -23.017979 8.220707 # 3 -5970 5970 3 -18.907625 -22.195910 8.220707 # 3 -5971 5971 3 -18.085556 -23.017979 8.220707 # 3 -5972 5972 3 -17.263485 -22.195910 8.220707 # 3 -5973 5973 3 -16.441414 -23.017979 8.220707 # 3 -5974 5974 3 -15.619343 -22.195910 8.220707 # 3 -5975 5975 3 -14.797273 -23.017979 8.220707 # 3 -5976 5976 3 -13.975202 -22.195910 8.220707 # 3 -5977 5977 3 -13.153131 -23.017979 8.220707 # 3 -5978 5978 3 -12.331060 -22.195910 8.220707 # 3 -5979 5979 3 -11.508989 -23.017979 8.220707 # 3 -5980 5980 3 -10.686919 -22.195910 8.220707 # 3 -5981 5981 3 -9.864848 -23.017979 8.220707 # 3 -5982 5982 3 -9.042778 -22.195910 8.220707 # 3 -5983 5983 3 -24.662121 -21.373838 8.220707 # 3 -5984 5984 3 -23.840050 -20.551767 8.220707 # 3 -5985 5985 3 -23.017979 -21.373838 8.220707 # 3 -5986 5986 3 -22.195910 -20.551767 8.220707 # 3 -5987 5987 3 -21.373838 -21.373838 8.220707 # 3 -5988 5988 3 -20.551767 -20.551767 8.220707 # 3 -5989 5989 3 -19.729696 -21.373838 8.220707 # 3 -5990 5990 3 -18.907625 -20.551767 8.220707 # 3 -5991 5991 3 -18.085556 -21.373838 8.220707 # 3 -5992 5992 3 -17.263485 -20.551767 8.220707 # 3 -5993 5993 3 -16.441414 -21.373838 8.220707 # 3 -5994 5994 3 -15.619343 -20.551767 8.220707 # 3 -5995 5995 3 -14.797273 -21.373838 8.220707 # 3 -5996 5996 3 -13.975202 -20.551767 8.220707 # 3 -5997 5997 3 -13.153131 -21.373838 8.220707 # 3 -5998 5998 3 -12.331060 -20.551767 8.220707 # 3 -5999 5999 3 -11.508989 -21.373838 8.220707 # 3 -6000 6000 3 -10.686919 -20.551767 8.220707 # 3 -6001 6001 3 -9.864848 -21.373838 8.220707 # 3 -6002 6002 3 -9.042778 -20.551767 8.220707 # 3 -6003 6003 3 -8.220707 -23.840050 -7.398636 # 3 -6004 6004 3 -6.576566 -23.840050 -7.398636 # 3 -6005 6005 3 -4.932424 -23.840050 -7.398636 # 3 -6006 6006 3 -3.288283 -23.840050 -7.398636 # 3 -6007 6007 3 -1.644141 -23.840050 -7.398636 # 3 -6008 6008 3 0.000000 -23.840050 -7.398636 # 3 -6009 6009 3 1.644141 -23.840050 -7.398636 # 3 -6010 6010 3 3.288283 -23.840050 -7.398636 # 3 -6011 6011 3 4.932424 -23.840050 -7.398636 # 3 -6012 6012 3 6.576566 -23.840050 -7.398636 # 3 -6013 6013 3 8.220707 -23.840050 -7.398636 # 3 -6014 6014 3 -7.398636 -23.017979 -7.398636 # 3 -6015 6015 3 -8.220707 -22.195910 -7.398636 # 3 -6016 6016 3 -5.754495 -23.017979 -7.398636 # 3 -6017 6017 3 -6.576566 -22.195910 -7.398636 # 3 -6018 6018 3 -4.110353 -23.017979 -7.398636 # 3 -6019 6019 3 -4.932424 -22.195910 -7.398636 # 3 -6020 6020 3 -2.466212 -23.017979 -7.398636 # 3 -6021 6021 3 -3.288283 -22.195910 -7.398636 # 3 -6022 6022 3 -0.822071 -23.017979 -7.398636 # 3 -6023 6023 3 -1.644141 -22.195910 -7.398636 # 3 -6024 6024 3 0.822071 -23.017979 -7.398636 # 3 -6025 6025 3 0.000000 -22.195910 -7.398636 # 3 -6026 6026 3 2.466212 -23.017979 -7.398636 # 3 -6027 6027 3 1.644141 -22.195910 -7.398636 # 3 -6028 6028 3 4.110353 -23.017979 -7.398636 # 3 -6029 6029 3 3.288283 -22.195910 -7.398636 # 3 -6030 6030 3 5.754495 -23.017979 -7.398636 # 3 -6031 6031 3 4.932424 -22.195910 -7.398636 # 3 -6032 6032 3 7.398636 -23.017979 -7.398636 # 3 -6033 6033 3 6.576566 -22.195910 -7.398636 # 3 -6034 6034 3 8.220707 -22.195910 -7.398636 # 3 -6035 6035 3 -7.398636 -21.373838 -7.398636 # 3 -6036 6036 3 -8.220707 -20.551767 -7.398636 # 3 -6037 6037 3 -5.754495 -21.373838 -7.398636 # 3 -6038 6038 3 -6.576566 -20.551767 -7.398636 # 3 -6039 6039 3 -4.110353 -21.373838 -7.398636 # 3 -6040 6040 3 -4.932424 -20.551767 -7.398636 # 3 -6041 6041 3 -2.466212 -21.373838 -7.398636 # 3 -6042 6042 3 -3.288283 -20.551767 -7.398636 # 3 -6043 6043 3 -0.822071 -21.373838 -7.398636 # 3 -6044 6044 3 -1.644141 -20.551767 -7.398636 # 3 -6045 6045 3 0.822071 -21.373838 -7.398636 # 3 -6046 6046 3 0.000000 -20.551767 -7.398636 # 3 -6047 6047 3 2.466212 -21.373838 -7.398636 # 3 -6048 6048 3 1.644141 -20.551767 -7.398636 # 3 -6049 6049 3 4.110353 -21.373838 -7.398636 # 3 -6050 6050 3 3.288283 -20.551767 -7.398636 # 3 -6051 6051 3 5.754495 -21.373838 -7.398636 # 3 -6052 6052 3 4.932424 -20.551767 -7.398636 # 3 -6053 6053 3 7.398636 -21.373838 -7.398636 # 3 -6054 6054 3 6.576566 -20.551767 -7.398636 # 3 -6055 6055 3 8.220707 -20.551767 -7.398636 # 3 -6056 6056 3 -7.398636 -23.840050 -6.576566 # 3 -6057 6057 3 -8.220707 -23.840050 -5.754495 # 3 -6058 6058 3 -5.754495 -23.840050 -6.576566 # 3 -6059 6059 3 -6.576566 -23.840050 -5.754495 # 3 -6060 6060 3 -4.110353 -23.840050 -6.576566 # 3 -6061 6061 3 -4.932424 -23.840050 -5.754495 # 3 -6062 6062 3 -2.466212 -23.840050 -6.576566 # 3 -6063 6063 3 -3.288283 -23.840050 -5.754495 # 3 -6064 6064 3 -0.822071 -23.840050 -6.576566 # 3 -6065 6065 3 -1.644141 -23.840050 -5.754495 # 3 -6066 6066 3 0.822071 -23.840050 -6.576566 # 3 -6067 6067 3 0.000000 -23.840050 -5.754495 # 3 -6068 6068 3 2.466212 -23.840050 -6.576566 # 3 -6069 6069 3 1.644141 -23.840050 -5.754495 # 3 -6070 6070 3 4.110353 -23.840050 -6.576566 # 3 -6071 6071 3 3.288283 -23.840050 -5.754495 # 3 -6072 6072 3 5.754495 -23.840050 -6.576566 # 3 -6073 6073 3 4.932424 -23.840050 -5.754495 # 3 -6074 6074 3 7.398636 -23.840050 -6.576566 # 3 -6075 6075 3 6.576566 -23.840050 -5.754495 # 3 -6076 6076 3 8.220707 -23.840050 -5.754495 # 3 -6077 6077 3 -8.220707 -23.017979 -6.576566 # 3 -6078 6078 3 -7.398636 -22.195910 -6.576566 # 3 -6079 6079 3 -7.398636 -23.017979 -5.754495 # 3 -6080 6080 3 -8.220707 -22.195910 -5.754495 # 3 -6081 6081 3 -6.576566 -23.017979 -6.576566 # 3 -6082 6082 3 -5.754495 -22.195910 -6.576566 # 3 -6083 6083 3 -5.754495 -23.017979 -5.754495 # 3 -6084 6084 3 -6.576566 -22.195910 -5.754495 # 3 -6085 6085 3 -4.932424 -23.017979 -6.576566 # 3 -6086 6086 3 -4.110353 -22.195910 -6.576566 # 3 -6087 6087 3 -4.110353 -23.017979 -5.754495 # 3 -6088 6088 3 -4.932424 -22.195910 -5.754495 # 3 -6089 6089 3 -3.288283 -23.017979 -6.576566 # 3 -6090 6090 3 -2.466212 -22.195910 -6.576566 # 3 -6091 6091 3 -2.466212 -23.017979 -5.754495 # 3 -6092 6092 3 -3.288283 -22.195910 -5.754495 # 3 -6093 6093 3 -1.644141 -23.017979 -6.576566 # 3 -6094 6094 3 -0.822071 -22.195910 -6.576566 # 3 -6095 6095 3 -0.822071 -23.017979 -5.754495 # 3 -6096 6096 3 -1.644141 -22.195910 -5.754495 # 3 -6097 6097 3 0.000000 -23.017979 -6.576566 # 3 -6098 6098 3 0.822071 -22.195910 -6.576566 # 3 -6099 6099 3 0.822071 -23.017979 -5.754495 # 3 -6100 6100 3 0.000000 -22.195910 -5.754495 # 3 -6101 6101 3 1.644141 -23.017979 -6.576566 # 3 -6102 6102 3 2.466212 -22.195910 -6.576566 # 3 -6103 6103 3 2.466212 -23.017979 -5.754495 # 3 -6104 6104 3 1.644141 -22.195910 -5.754495 # 3 -6105 6105 3 3.288283 -23.017979 -6.576566 # 3 -6106 6106 3 4.110353 -22.195910 -6.576566 # 3 -6107 6107 3 4.110353 -23.017979 -5.754495 # 3 -6108 6108 3 3.288283 -22.195910 -5.754495 # 3 -6109 6109 3 4.932424 -23.017979 -6.576566 # 3 -6110 6110 3 5.754495 -22.195910 -6.576566 # 3 -6111 6111 3 5.754495 -23.017979 -5.754495 # 3 -6112 6112 3 4.932424 -22.195910 -5.754495 # 3 -6113 6113 3 6.576566 -23.017979 -6.576566 # 3 -6114 6114 3 7.398636 -22.195910 -6.576566 # 3 -6115 6115 3 7.398636 -23.017979 -5.754495 # 3 -6116 6116 3 6.576566 -22.195910 -5.754495 # 3 -6117 6117 3 8.220707 -23.017979 -6.576566 # 3 -6118 6118 3 8.220707 -22.195910 -5.754495 # 3 -6119 6119 3 -8.220707 -21.373838 -6.576566 # 3 -6120 6120 3 -7.398636 -20.551767 -6.576566 # 3 -6121 6121 3 -7.398636 -21.373838 -5.754495 # 3 -6122 6122 3 -8.220707 -20.551767 -5.754495 # 3 -6123 6123 3 -6.576566 -21.373838 -6.576566 # 3 -6124 6124 3 -5.754495 -20.551767 -6.576566 # 3 -6125 6125 3 -5.754495 -21.373838 -5.754495 # 3 -6126 6126 3 -6.576566 -20.551767 -5.754495 # 3 -6127 6127 3 -4.932424 -21.373838 -6.576566 # 3 -6128 6128 3 -4.110353 -20.551767 -6.576566 # 3 -6129 6129 3 -4.110353 -21.373838 -5.754495 # 3 -6130 6130 3 -4.932424 -20.551767 -5.754495 # 3 -6131 6131 3 -3.288283 -21.373838 -6.576566 # 3 -6132 6132 3 -2.466212 -20.551767 -6.576566 # 3 -6133 6133 3 -2.466212 -21.373838 -5.754495 # 3 -6134 6134 3 -3.288283 -20.551767 -5.754495 # 3 -6135 6135 3 -1.644141 -21.373838 -6.576566 # 3 -6136 6136 3 -0.822071 -20.551767 -6.576566 # 3 -6137 6137 3 -0.822071 -21.373838 -5.754495 # 3 -6138 6138 3 -1.644141 -20.551767 -5.754495 # 3 -6139 6139 3 0.000000 -21.373838 -6.576566 # 3 -6140 6140 3 0.822071 -20.551767 -6.576566 # 3 -6141 6141 3 0.822071 -21.373838 -5.754495 # 3 -6142 6142 3 0.000000 -20.551767 -5.754495 # 3 -6143 6143 3 1.644141 -21.373838 -6.576566 # 3 -6144 6144 3 2.466212 -20.551767 -6.576566 # 3 -6145 6145 3 2.466212 -21.373838 -5.754495 # 3 -6146 6146 3 1.644141 -20.551767 -5.754495 # 3 -6147 6147 3 3.288283 -21.373838 -6.576566 # 3 -6148 6148 3 4.110353 -20.551767 -6.576566 # 3 -6149 6149 3 4.110353 -21.373838 -5.754495 # 3 -6150 6150 3 3.288283 -20.551767 -5.754495 # 3 -6151 6151 3 4.932424 -21.373838 -6.576566 # 3 -6152 6152 3 5.754495 -20.551767 -6.576566 # 3 -6153 6153 3 5.754495 -21.373838 -5.754495 # 3 -6154 6154 3 4.932424 -20.551767 -5.754495 # 3 -6155 6155 3 6.576566 -21.373838 -6.576566 # 3 -6156 6156 3 7.398636 -20.551767 -6.576566 # 3 -6157 6157 3 7.398636 -21.373838 -5.754495 # 3 -6158 6158 3 6.576566 -20.551767 -5.754495 # 3 -6159 6159 3 8.220707 -21.373838 -6.576566 # 3 -6160 6160 3 8.220707 -20.551767 -5.754495 # 3 -6161 6161 3 -7.398636 -23.840050 -4.932424 # 3 -6162 6162 3 -8.220707 -23.840050 -4.110353 # 3 -6163 6163 3 -5.754495 -23.840050 -4.932424 # 3 -6164 6164 3 -6.576566 -23.840050 -4.110353 # 3 -6165 6165 3 -4.110353 -23.840050 -4.932424 # 3 -6166 6166 3 -4.932424 -23.840050 -4.110353 # 3 -6167 6167 3 -2.466212 -23.840050 -4.932424 # 3 -6168 6168 3 -3.288283 -23.840050 -4.110353 # 3 -6169 6169 3 -0.822071 -23.840050 -4.932424 # 3 -6170 6170 3 -1.644141 -23.840050 -4.110353 # 3 -6171 6171 3 0.822071 -23.840050 -4.932424 # 3 -6172 6172 3 0.000000 -23.840050 -4.110353 # 3 -6173 6173 3 2.466212 -23.840050 -4.932424 # 3 -6174 6174 3 1.644141 -23.840050 -4.110353 # 3 -6175 6175 3 4.110353 -23.840050 -4.932424 # 3 -6176 6176 3 3.288283 -23.840050 -4.110353 # 3 -6177 6177 3 5.754495 -23.840050 -4.932424 # 3 -6178 6178 3 4.932424 -23.840050 -4.110353 # 3 -6179 6179 3 7.398636 -23.840050 -4.932424 # 3 -6180 6180 3 6.576566 -23.840050 -4.110353 # 3 -6181 6181 3 8.220707 -23.840050 -4.110353 # 3 -6182 6182 3 -8.220707 -23.017979 -4.932424 # 3 -6183 6183 3 -7.398636 -22.195910 -4.932424 # 3 -6184 6184 3 -7.398636 -23.017979 -4.110353 # 3 -6185 6185 3 -8.220707 -22.195910 -4.110353 # 3 -6186 6186 3 -6.576566 -23.017979 -4.932424 # 3 -6187 6187 3 -5.754495 -22.195910 -4.932424 # 3 -6188 6188 3 -5.754495 -23.017979 -4.110353 # 3 -6189 6189 3 -6.576566 -22.195910 -4.110353 # 3 -6190 6190 3 -4.932424 -23.017979 -4.932424 # 3 -6191 6191 3 -4.110353 -22.195910 -4.932424 # 3 -6192 6192 3 -4.110353 -23.017979 -4.110353 # 3 -6193 6193 3 -4.932424 -22.195910 -4.110353 # 3 -6194 6194 3 -3.288283 -23.017979 -4.932424 # 3 -6195 6195 3 -2.466212 -22.195910 -4.932424 # 3 -6196 6196 3 -2.466212 -23.017979 -4.110353 # 3 -6197 6197 3 -3.288283 -22.195910 -4.110353 # 3 -6198 6198 3 -1.644141 -23.017979 -4.932424 # 3 -6199 6199 3 -0.822071 -22.195910 -4.932424 # 3 -6200 6200 3 -0.822071 -23.017979 -4.110353 # 3 -6201 6201 3 -1.644141 -22.195910 -4.110353 # 3 -6202 6202 3 0.000000 -23.017979 -4.932424 # 3 -6203 6203 3 0.822071 -22.195910 -4.932424 # 3 -6204 6204 3 0.822071 -23.017979 -4.110353 # 3 -6205 6205 3 0.000000 -22.195910 -4.110353 # 3 -6206 6206 3 1.644141 -23.017979 -4.932424 # 3 -6207 6207 3 2.466212 -22.195910 -4.932424 # 3 -6208 6208 3 2.466212 -23.017979 -4.110353 # 3 -6209 6209 3 1.644141 -22.195910 -4.110353 # 3 -6210 6210 3 3.288283 -23.017979 -4.932424 # 3 -6211 6211 3 4.110353 -22.195910 -4.932424 # 3 -6212 6212 3 4.110353 -23.017979 -4.110353 # 3 -6213 6213 3 3.288283 -22.195910 -4.110353 # 3 -6214 6214 3 4.932424 -23.017979 -4.932424 # 3 -6215 6215 3 5.754495 -22.195910 -4.932424 # 3 -6216 6216 3 5.754495 -23.017979 -4.110353 # 3 -6217 6217 3 4.932424 -22.195910 -4.110353 # 3 -6218 6218 3 6.576566 -23.017979 -4.932424 # 3 -6219 6219 3 7.398636 -22.195910 -4.932424 # 3 -6220 6220 3 7.398636 -23.017979 -4.110353 # 3 -6221 6221 3 6.576566 -22.195910 -4.110353 # 3 -6222 6222 3 8.220707 -23.017979 -4.932424 # 3 -6223 6223 3 8.220707 -22.195910 -4.110353 # 3 -6224 6224 3 -8.220707 -21.373838 -4.932424 # 3 -6225 6225 3 -7.398636 -20.551767 -4.932424 # 3 -6226 6226 3 -7.398636 -21.373838 -4.110353 # 3 -6227 6227 3 -8.220707 -20.551767 -4.110353 # 3 -6228 6228 3 -6.576566 -21.373838 -4.932424 # 3 -6229 6229 3 -5.754495 -20.551767 -4.932424 # 3 -6230 6230 3 -5.754495 -21.373838 -4.110353 # 3 -6231 6231 3 -6.576566 -20.551767 -4.110353 # 3 -6232 6232 3 -4.932424 -21.373838 -4.932424 # 3 -6233 6233 3 -4.110353 -20.551767 -4.932424 # 3 -6234 6234 3 -4.110353 -21.373838 -4.110353 # 3 -6235 6235 3 -4.932424 -20.551767 -4.110353 # 3 -6236 6236 3 -3.288283 -21.373838 -4.932424 # 3 -6237 6237 3 -2.466212 -20.551767 -4.932424 # 3 -6238 6238 3 -2.466212 -21.373838 -4.110353 # 3 -6239 6239 3 -3.288283 -20.551767 -4.110353 # 3 -6240 6240 3 -1.644141 -21.373838 -4.932424 # 3 -6241 6241 3 -0.822071 -20.551767 -4.932424 # 3 -6242 6242 3 -0.822071 -21.373838 -4.110353 # 3 -6243 6243 3 -1.644141 -20.551767 -4.110353 # 3 -6244 6244 3 0.000000 -21.373838 -4.932424 # 3 -6245 6245 3 0.822071 -20.551767 -4.932424 # 3 -6246 6246 3 0.822071 -21.373838 -4.110353 # 3 -6247 6247 3 0.000000 -20.551767 -4.110353 # 3 -6248 6248 3 1.644141 -21.373838 -4.932424 # 3 -6249 6249 3 2.466212 -20.551767 -4.932424 # 3 -6250 6250 3 2.466212 -21.373838 -4.110353 # 3 -6251 6251 3 1.644141 -20.551767 -4.110353 # 3 -6252 6252 3 3.288283 -21.373838 -4.932424 # 3 -6253 6253 3 4.110353 -20.551767 -4.932424 # 3 -6254 6254 3 4.110353 -21.373838 -4.110353 # 3 -6255 6255 3 3.288283 -20.551767 -4.110353 # 3 -6256 6256 3 4.932424 -21.373838 -4.932424 # 3 -6257 6257 3 5.754495 -20.551767 -4.932424 # 3 -6258 6258 3 5.754495 -21.373838 -4.110353 # 3 -6259 6259 3 4.932424 -20.551767 -4.110353 # 3 -6260 6260 3 6.576566 -21.373838 -4.932424 # 3 -6261 6261 3 7.398636 -20.551767 -4.932424 # 3 -6262 6262 3 7.398636 -21.373838 -4.110353 # 3 -6263 6263 3 6.576566 -20.551767 -4.110353 # 3 -6264 6264 3 8.220707 -21.373838 -4.932424 # 3 -6265 6265 3 8.220707 -20.551767 -4.110353 # 3 -6266 6266 3 -7.398636 -23.840050 -3.288283 # 3 -6267 6267 3 -8.220707 -23.840050 -2.466212 # 3 -6268 6268 3 -5.754495 -23.840050 -3.288283 # 3 -6269 6269 3 -6.576566 -23.840050 -2.466212 # 3 -6270 6270 3 -4.110353 -23.840050 -3.288283 # 3 -6271 6271 3 -4.932424 -23.840050 -2.466212 # 3 -6272 6272 3 -2.466212 -23.840050 -3.288283 # 3 -6273 6273 3 -3.288283 -23.840050 -2.466212 # 3 -6274 6274 3 -0.822071 -23.840050 -3.288283 # 3 -6275 6275 3 -1.644141 -23.840050 -2.466212 # 3 -6276 6276 3 0.822071 -23.840050 -3.288283 # 3 -6277 6277 3 0.000000 -23.840050 -2.466212 # 3 -6278 6278 3 2.466212 -23.840050 -3.288283 # 3 -6279 6279 3 1.644141 -23.840050 -2.466212 # 3 -6280 6280 3 4.110353 -23.840050 -3.288283 # 3 -6281 6281 3 3.288283 -23.840050 -2.466212 # 3 -6282 6282 3 5.754495 -23.840050 -3.288283 # 3 -6283 6283 3 4.932424 -23.840050 -2.466212 # 3 -6284 6284 3 7.398636 -23.840050 -3.288283 # 3 -6285 6285 3 6.576566 -23.840050 -2.466212 # 3 -6286 6286 3 8.220707 -23.840050 -2.466212 # 3 -6287 6287 3 -8.220707 -23.017979 -3.288283 # 3 -6288 6288 3 -7.398636 -22.195910 -3.288283 # 3 -6289 6289 3 -7.398636 -23.017979 -2.466212 # 3 -6290 6290 3 -8.220707 -22.195910 -2.466212 # 3 -6291 6291 3 -6.576566 -23.017979 -3.288283 # 3 -6292 6292 3 -5.754495 -22.195910 -3.288283 # 3 -6293 6293 3 -5.754495 -23.017979 -2.466212 # 3 -6294 6294 3 -6.576566 -22.195910 -2.466212 # 3 -6295 6295 3 -4.932424 -23.017979 -3.288283 # 3 -6296 6296 3 -4.110353 -22.195910 -3.288283 # 3 -6297 6297 3 -4.110353 -23.017979 -2.466212 # 3 -6298 6298 3 -4.932424 -22.195910 -2.466212 # 3 -6299 6299 3 -3.288283 -23.017979 -3.288283 # 3 -6300 6300 3 -2.466212 -22.195910 -3.288283 # 3 -6301 6301 3 -2.466212 -23.017979 -2.466212 # 3 -6302 6302 3 -3.288283 -22.195910 -2.466212 # 3 -6303 6303 3 -1.644141 -23.017979 -3.288283 # 3 -6304 6304 3 -0.822071 -22.195910 -3.288283 # 3 -6305 6305 3 -0.822071 -23.017979 -2.466212 # 3 -6306 6306 3 -1.644141 -22.195910 -2.466212 # 3 -6307 6307 3 0.000000 -23.017979 -3.288283 # 3 -6308 6308 3 0.822071 -22.195910 -3.288283 # 3 -6309 6309 3 0.822071 -23.017979 -2.466212 # 3 -6310 6310 3 0.000000 -22.195910 -2.466212 # 3 -6311 6311 3 1.644141 -23.017979 -3.288283 # 3 -6312 6312 3 2.466212 -22.195910 -3.288283 # 3 -6313 6313 3 2.466212 -23.017979 -2.466212 # 3 -6314 6314 3 1.644141 -22.195910 -2.466212 # 3 -6315 6315 3 3.288283 -23.017979 -3.288283 # 3 -6316 6316 3 4.110353 -22.195910 -3.288283 # 3 -6317 6317 3 4.110353 -23.017979 -2.466212 # 3 -6318 6318 3 3.288283 -22.195910 -2.466212 # 3 -6319 6319 3 4.932424 -23.017979 -3.288283 # 3 -6320 6320 3 5.754495 -22.195910 -3.288283 # 3 -6321 6321 3 5.754495 -23.017979 -2.466212 # 3 -6322 6322 3 4.932424 -22.195910 -2.466212 # 3 -6323 6323 3 6.576566 -23.017979 -3.288283 # 3 -6324 6324 3 7.398636 -22.195910 -3.288283 # 3 -6325 6325 3 7.398636 -23.017979 -2.466212 # 3 -6326 6326 3 6.576566 -22.195910 -2.466212 # 3 -6327 6327 3 8.220707 -23.017979 -3.288283 # 3 -6328 6328 3 8.220707 -22.195910 -2.466212 # 3 -6329 6329 3 -8.220707 -21.373838 -3.288283 # 3 -6330 6330 3 -7.398636 -20.551767 -3.288283 # 3 -6331 6331 3 -7.398636 -21.373838 -2.466212 # 3 -6332 6332 3 -8.220707 -20.551767 -2.466212 # 3 -6333 6333 3 -6.576566 -21.373838 -3.288283 # 3 -6334 6334 3 -5.754495 -20.551767 -3.288283 # 3 -6335 6335 3 -5.754495 -21.373838 -2.466212 # 3 -6336 6336 3 -6.576566 -20.551767 -2.466212 # 3 -6337 6337 3 -4.932424 -21.373838 -3.288283 # 3 -6338 6338 3 -4.110353 -20.551767 -3.288283 # 3 -6339 6339 3 -4.110353 -21.373838 -2.466212 # 3 -6340 6340 3 -4.932424 -20.551767 -2.466212 # 3 -6341 6341 3 -3.288283 -21.373838 -3.288283 # 3 -6342 6342 3 -2.466212 -20.551767 -3.288283 # 3 -6343 6343 3 -2.466212 -21.373838 -2.466212 # 3 -6344 6344 3 -3.288283 -20.551767 -2.466212 # 3 -6345 6345 3 -1.644141 -21.373838 -3.288283 # 3 -6346 6346 3 -0.822071 -20.551767 -3.288283 # 3 -6347 6347 3 -0.822071 -21.373838 -2.466212 # 3 -6348 6348 3 -1.644141 -20.551767 -2.466212 # 3 -6349 6349 3 0.000000 -21.373838 -3.288283 # 3 -6350 6350 3 0.822071 -20.551767 -3.288283 # 3 -6351 6351 3 0.822071 -21.373838 -2.466212 # 3 -6352 6352 3 0.000000 -20.551767 -2.466212 # 3 -6353 6353 3 1.644141 -21.373838 -3.288283 # 3 -6354 6354 3 2.466212 -20.551767 -3.288283 # 3 -6355 6355 3 2.466212 -21.373838 -2.466212 # 3 -6356 6356 3 1.644141 -20.551767 -2.466212 # 3 -6357 6357 3 3.288283 -21.373838 -3.288283 # 3 -6358 6358 3 4.110353 -20.551767 -3.288283 # 3 -6359 6359 3 4.110353 -21.373838 -2.466212 # 3 -6360 6360 3 3.288283 -20.551767 -2.466212 # 3 -6361 6361 3 4.932424 -21.373838 -3.288283 # 3 -6362 6362 3 5.754495 -20.551767 -3.288283 # 3 -6363 6363 3 5.754495 -21.373838 -2.466212 # 3 -6364 6364 3 4.932424 -20.551767 -2.466212 # 3 -6365 6365 3 6.576566 -21.373838 -3.288283 # 3 -6366 6366 3 7.398636 -20.551767 -3.288283 # 3 -6367 6367 3 7.398636 -21.373838 -2.466212 # 3 -6368 6368 3 6.576566 -20.551767 -2.466212 # 3 -6369 6369 3 8.220707 -21.373838 -3.288283 # 3 -6370 6370 3 8.220707 -20.551767 -2.466212 # 3 -6371 6371 3 -7.398636 -23.840050 -1.644141 # 3 -6372 6372 3 -8.220707 -23.840050 -0.822071 # 3 -6373 6373 3 -5.754495 -23.840050 -1.644141 # 3 -6374 6374 3 -6.576566 -23.840050 -0.822071 # 3 -6375 6375 3 -4.110353 -23.840050 -1.644141 # 3 -6376 6376 3 -4.932424 -23.840050 -0.822071 # 3 -6377 6377 3 -2.466212 -23.840050 -1.644141 # 3 -6378 6378 3 -3.288283 -23.840050 -0.822071 # 3 -6379 6379 3 -0.822071 -23.840050 -1.644141 # 3 -6380 6380 3 -1.644141 -23.840050 -0.822071 # 3 -6381 6381 3 0.822071 -23.840050 -1.644141 # 3 -6382 6382 3 0.000000 -23.840050 -0.822071 # 3 -6383 6383 3 2.466212 -23.840050 -1.644141 # 3 -6384 6384 3 1.644141 -23.840050 -0.822071 # 3 -6385 6385 3 4.110353 -23.840050 -1.644141 # 3 -6386 6386 3 3.288283 -23.840050 -0.822071 # 3 -6387 6387 3 5.754495 -23.840050 -1.644141 # 3 -6388 6388 3 4.932424 -23.840050 -0.822071 # 3 -6389 6389 3 7.398636 -23.840050 -1.644141 # 3 -6390 6390 3 6.576566 -23.840050 -0.822071 # 3 -6391 6391 3 8.220707 -23.840050 -0.822071 # 3 -6392 6392 3 -8.220707 -23.017979 -1.644141 # 3 -6393 6393 3 -7.398636 -22.195910 -1.644141 # 3 -6394 6394 3 -7.398636 -23.017979 -0.822071 # 3 -6395 6395 3 -8.220707 -22.195910 -0.822071 # 3 -6396 6396 3 -6.576566 -23.017979 -1.644141 # 3 -6397 6397 3 -5.754495 -22.195910 -1.644141 # 3 -6398 6398 3 -5.754495 -23.017979 -0.822071 # 3 -6399 6399 3 -6.576566 -22.195910 -0.822071 # 3 -6400 6400 3 -4.932424 -23.017979 -1.644141 # 3 -6401 6401 3 -4.110353 -22.195910 -1.644141 # 3 -6402 6402 3 -4.110353 -23.017979 -0.822071 # 3 -6403 6403 3 -4.932424 -22.195910 -0.822071 # 3 -6404 6404 3 -3.288283 -23.017979 -1.644141 # 3 -6405 6405 3 -2.466212 -22.195910 -1.644141 # 3 -6406 6406 3 -2.466212 -23.017979 -0.822071 # 3 -6407 6407 3 -3.288283 -22.195910 -0.822071 # 3 -6408 6408 3 -1.644141 -23.017979 -1.644141 # 3 -6409 6409 3 -0.822071 -22.195910 -1.644141 # 3 -6410 6410 3 -0.822071 -23.017979 -0.822071 # 3 -6411 6411 3 -1.644141 -22.195910 -0.822071 # 3 -6412 6412 3 0.000000 -23.017979 -1.644141 # 3 -6413 6413 3 0.822071 -22.195910 -1.644141 # 3 -6414 6414 3 0.822071 -23.017979 -0.822071 # 3 -6415 6415 3 0.000000 -22.195910 -0.822071 # 3 -6416 6416 3 1.644141 -23.017979 -1.644141 # 3 -6417 6417 3 2.466212 -22.195910 -1.644141 # 3 -6418 6418 3 2.466212 -23.017979 -0.822071 # 3 -6419 6419 3 1.644141 -22.195910 -0.822071 # 3 -6420 6420 3 3.288283 -23.017979 -1.644141 # 3 -6421 6421 3 4.110353 -22.195910 -1.644141 # 3 -6422 6422 3 4.110353 -23.017979 -0.822071 # 3 -6423 6423 3 3.288283 -22.195910 -0.822071 # 3 -6424 6424 3 4.932424 -23.017979 -1.644141 # 3 -6425 6425 3 5.754495 -22.195910 -1.644141 # 3 -6426 6426 3 5.754495 -23.017979 -0.822071 # 3 -6427 6427 3 4.932424 -22.195910 -0.822071 # 3 -6428 6428 3 6.576566 -23.017979 -1.644141 # 3 -6429 6429 3 7.398636 -22.195910 -1.644141 # 3 -6430 6430 3 7.398636 -23.017979 -0.822071 # 3 -6431 6431 3 6.576566 -22.195910 -0.822071 # 3 -6432 6432 3 8.220707 -23.017979 -1.644141 # 3 -6433 6433 3 8.220707 -22.195910 -0.822071 # 3 -6434 6434 3 -8.220707 -21.373838 -1.644141 # 3 -6435 6435 3 -7.398636 -20.551767 -1.644141 # 3 -6436 6436 3 -7.398636 -21.373838 -0.822071 # 3 -6437 6437 3 -8.220707 -20.551767 -0.822071 # 3 -6438 6438 3 -6.576566 -21.373838 -1.644141 # 3 -6439 6439 3 -5.754495 -20.551767 -1.644141 # 3 -6440 6440 3 -5.754495 -21.373838 -0.822071 # 3 -6441 6441 3 -6.576566 -20.551767 -0.822071 # 3 -6442 6442 3 -4.932424 -21.373838 -1.644141 # 3 -6443 6443 3 -4.110353 -20.551767 -1.644141 # 3 -6444 6444 3 -4.110353 -21.373838 -0.822071 # 3 -6445 6445 3 -4.932424 -20.551767 -0.822071 # 3 -6446 6446 3 -3.288283 -21.373838 -1.644141 # 3 -6447 6447 3 -2.466212 -20.551767 -1.644141 # 3 -6448 6448 3 -2.466212 -21.373838 -0.822071 # 3 -6449 6449 3 -3.288283 -20.551767 -0.822071 # 3 -6450 6450 3 -1.644141 -21.373838 -1.644141 # 3 -6451 6451 3 -0.822071 -20.551767 -1.644141 # 3 -6452 6452 3 -0.822071 -21.373838 -0.822071 # 3 -6453 6453 3 -1.644141 -20.551767 -0.822071 # 3 -6454 6454 3 0.000000 -21.373838 -1.644141 # 3 -6455 6455 3 0.822071 -20.551767 -1.644141 # 3 -6456 6456 3 0.822071 -21.373838 -0.822071 # 3 -6457 6457 3 0.000000 -20.551767 -0.822071 # 3 -6458 6458 3 1.644141 -21.373838 -1.644141 # 3 -6459 6459 3 2.466212 -20.551767 -1.644141 # 3 -6460 6460 3 2.466212 -21.373838 -0.822071 # 3 -6461 6461 3 1.644141 -20.551767 -0.822071 # 3 -6462 6462 3 3.288283 -21.373838 -1.644141 # 3 -6463 6463 3 4.110353 -20.551767 -1.644141 # 3 -6464 6464 3 4.110353 -21.373838 -0.822071 # 3 -6465 6465 3 3.288283 -20.551767 -0.822071 # 3 -6466 6466 3 4.932424 -21.373838 -1.644141 # 3 -6467 6467 3 5.754495 -20.551767 -1.644141 # 3 -6468 6468 3 5.754495 -21.373838 -0.822071 # 3 -6469 6469 3 4.932424 -20.551767 -0.822071 # 3 -6470 6470 3 6.576566 -21.373838 -1.644141 # 3 -6471 6471 3 7.398636 -20.551767 -1.644141 # 3 -6472 6472 3 7.398636 -21.373838 -0.822071 # 3 -6473 6473 3 6.576566 -20.551767 -0.822071 # 3 -6474 6474 3 8.220707 -21.373838 -1.644141 # 3 -6475 6475 3 8.220707 -20.551767 -0.822071 # 3 -6476 6476 3 -7.398636 -23.840050 0.000000 # 3 -6477 6477 3 -8.220707 -23.840050 0.822071 # 3 -6478 6478 3 -5.754495 -23.840050 0.000000 # 3 -6479 6479 3 -6.576566 -23.840050 0.822071 # 3 -6480 6480 3 -4.110353 -23.840050 0.000000 # 3 -6481 6481 3 -4.932424 -23.840050 0.822071 # 3 -6482 6482 3 -2.466212 -23.840050 0.000000 # 3 -6483 6483 3 -3.288283 -23.840050 0.822071 # 3 -6484 6484 3 -0.822071 -23.840050 0.000000 # 3 -6485 6485 3 -1.644141 -23.840050 0.822071 # 3 -6486 6486 3 0.822071 -23.840050 0.000000 # 3 -6487 6487 3 0.000000 -23.840050 0.822071 # 3 -6488 6488 3 2.466212 -23.840050 0.000000 # 3 -6489 6489 3 1.644141 -23.840050 0.822071 # 3 -6490 6490 3 4.110353 -23.840050 0.000000 # 3 -6491 6491 3 3.288283 -23.840050 0.822071 # 3 -6492 6492 3 5.754495 -23.840050 0.000000 # 3 -6493 6493 3 4.932424 -23.840050 0.822071 # 3 -6494 6494 3 7.398636 -23.840050 0.000000 # 3 -6495 6495 3 6.576566 -23.840050 0.822071 # 3 -6496 6496 3 8.220707 -23.840050 0.822071 # 3 -6497 6497 3 -8.220707 -23.017979 0.000000 # 3 -6498 6498 3 -7.398636 -22.195910 0.000000 # 3 -6499 6499 3 -7.398636 -23.017979 0.822071 # 3 -6500 6500 3 -8.220707 -22.195910 0.822071 # 3 -6501 6501 3 -6.576566 -23.017979 0.000000 # 3 -6502 6502 3 -5.754495 -22.195910 0.000000 # 3 -6503 6503 3 -5.754495 -23.017979 0.822071 # 3 -6504 6504 3 -6.576566 -22.195910 0.822071 # 3 -6505 6505 3 -4.932424 -23.017979 0.000000 # 3 -6506 6506 3 -4.110353 -22.195910 0.000000 # 3 -6507 6507 3 -4.110353 -23.017979 0.822071 # 3 -6508 6508 3 -4.932424 -22.195910 0.822071 # 3 -6509 6509 3 -3.288283 -23.017979 0.000000 # 3 -6510 6510 3 -2.466212 -22.195910 0.000000 # 3 -6511 6511 3 -2.466212 -23.017979 0.822071 # 3 -6512 6512 3 -3.288283 -22.195910 0.822071 # 3 -6513 6513 3 -1.644141 -23.017979 0.000000 # 3 -6514 6514 3 -0.822071 -22.195910 0.000000 # 3 -6515 6515 3 -0.822071 -23.017979 0.822071 # 3 -6516 6516 3 -1.644141 -22.195910 0.822071 # 3 -6517 6517 3 0.000000 -23.017979 0.000000 # 3 -6518 6518 3 0.822071 -22.195910 0.000000 # 3 -6519 6519 3 0.822071 -23.017979 0.822071 # 3 -6520 6520 3 0.000000 -22.195910 0.822071 # 3 -6521 6521 3 1.644141 -23.017979 0.000000 # 3 -6522 6522 3 2.466212 -22.195910 0.000000 # 3 -6523 6523 3 2.466212 -23.017979 0.822071 # 3 -6524 6524 3 1.644141 -22.195910 0.822071 # 3 -6525 6525 3 3.288283 -23.017979 0.000000 # 3 -6526 6526 3 4.110353 -22.195910 0.000000 # 3 -6527 6527 3 4.110353 -23.017979 0.822071 # 3 -6528 6528 3 3.288283 -22.195910 0.822071 # 3 -6529 6529 3 4.932424 -23.017979 0.000000 # 3 -6530 6530 3 5.754495 -22.195910 0.000000 # 3 -6531 6531 3 5.754495 -23.017979 0.822071 # 3 -6532 6532 3 4.932424 -22.195910 0.822071 # 3 -6533 6533 3 6.576566 -23.017979 0.000000 # 3 -6534 6534 3 7.398636 -22.195910 0.000000 # 3 -6535 6535 3 7.398636 -23.017979 0.822071 # 3 -6536 6536 3 6.576566 -22.195910 0.822071 # 3 -6537 6537 3 8.220707 -23.017979 0.000000 # 3 -6538 6538 3 8.220707 -22.195910 0.822071 # 3 -6539 6539 3 -8.220707 -21.373838 0.000000 # 3 -6540 6540 3 -7.398636 -20.551767 0.000000 # 3 -6541 6541 3 -7.398636 -21.373838 0.822071 # 3 -6542 6542 3 -8.220707 -20.551767 0.822071 # 3 -6543 6543 3 -6.576566 -21.373838 0.000000 # 3 -6544 6544 3 -5.754495 -20.551767 0.000000 # 3 -6545 6545 3 -5.754495 -21.373838 0.822071 # 3 -6546 6546 3 -6.576566 -20.551767 0.822071 # 3 -6547 6547 3 -4.932424 -21.373838 0.000000 # 3 -6548 6548 3 -4.110353 -20.551767 0.000000 # 3 -6549 6549 3 -4.110353 -21.373838 0.822071 # 3 -6550 6550 3 -4.932424 -20.551767 0.822071 # 3 -6551 6551 3 -3.288283 -21.373838 0.000000 # 3 -6552 6552 3 -2.466212 -20.551767 0.000000 # 3 -6553 6553 3 -2.466212 -21.373838 0.822071 # 3 -6554 6554 3 -3.288283 -20.551767 0.822071 # 3 -6555 6555 3 -1.644141 -21.373838 0.000000 # 3 -6556 6556 3 -0.822071 -20.551767 0.000000 # 3 -6557 6557 3 -0.822071 -21.373838 0.822071 # 3 -6558 6558 3 -1.644141 -20.551767 0.822071 # 3 -6559 6559 3 0.000000 -21.373838 0.000000 # 3 -6560 6560 3 0.822071 -20.551767 0.000000 # 3 -6561 6561 3 0.822071 -21.373838 0.822071 # 3 -6562 6562 3 0.000000 -20.551767 0.822071 # 3 -6563 6563 3 1.644141 -21.373838 0.000000 # 3 -6564 6564 3 2.466212 -20.551767 0.000000 # 3 -6565 6565 3 2.466212 -21.373838 0.822071 # 3 -6566 6566 3 1.644141 -20.551767 0.822071 # 3 -6567 6567 3 3.288283 -21.373838 0.000000 # 3 -6568 6568 3 4.110353 -20.551767 0.000000 # 3 -6569 6569 3 4.110353 -21.373838 0.822071 # 3 -6570 6570 3 3.288283 -20.551767 0.822071 # 3 -6571 6571 3 4.932424 -21.373838 0.000000 # 3 -6572 6572 3 5.754495 -20.551767 0.000000 # 3 -6573 6573 3 5.754495 -21.373838 0.822071 # 3 -6574 6574 3 4.932424 -20.551767 0.822071 # 3 -6575 6575 3 6.576566 -21.373838 0.000000 # 3 -6576 6576 3 7.398636 -20.551767 0.000000 # 3 -6577 6577 3 7.398636 -21.373838 0.822071 # 3 -6578 6578 3 6.576566 -20.551767 0.822071 # 3 -6579 6579 3 8.220707 -21.373838 0.000000 # 3 -6580 6580 3 8.220707 -20.551767 0.822071 # 3 -6581 6581 3 -7.398636 -23.840050 1.644141 # 3 -6582 6582 3 -8.220707 -23.840050 2.466212 # 3 -6583 6583 3 -5.754495 -23.840050 1.644141 # 3 -6584 6584 3 -6.576566 -23.840050 2.466212 # 3 -6585 6585 3 -4.110353 -23.840050 1.644141 # 3 -6586 6586 3 -4.932424 -23.840050 2.466212 # 3 -6587 6587 3 -2.466212 -23.840050 1.644141 # 3 -6588 6588 3 -3.288283 -23.840050 2.466212 # 3 -6589 6589 3 -0.822071 -23.840050 1.644141 # 3 -6590 6590 3 -1.644141 -23.840050 2.466212 # 3 -6591 6591 3 0.822071 -23.840050 1.644141 # 3 -6592 6592 3 0.000000 -23.840050 2.466212 # 3 -6593 6593 3 2.466212 -23.840050 1.644141 # 3 -6594 6594 3 1.644141 -23.840050 2.466212 # 3 -6595 6595 3 4.110353 -23.840050 1.644141 # 3 -6596 6596 3 3.288283 -23.840050 2.466212 # 3 -6597 6597 3 5.754495 -23.840050 1.644141 # 3 -6598 6598 3 4.932424 -23.840050 2.466212 # 3 -6599 6599 3 7.398636 -23.840050 1.644141 # 3 -6600 6600 3 6.576566 -23.840050 2.466212 # 3 -6601 6601 3 8.220707 -23.840050 2.466212 # 3 -6602 6602 3 -8.220707 -23.017979 1.644141 # 3 -6603 6603 3 -7.398636 -22.195910 1.644141 # 3 -6604 6604 3 -7.398636 -23.017979 2.466212 # 3 -6605 6605 3 -8.220707 -22.195910 2.466212 # 3 -6606 6606 3 -6.576566 -23.017979 1.644141 # 3 -6607 6607 3 -5.754495 -22.195910 1.644141 # 3 -6608 6608 3 -5.754495 -23.017979 2.466212 # 3 -6609 6609 3 -6.576566 -22.195910 2.466212 # 3 -6610 6610 3 -4.932424 -23.017979 1.644141 # 3 -6611 6611 3 -4.110353 -22.195910 1.644141 # 3 -6612 6612 3 -4.110353 -23.017979 2.466212 # 3 -6613 6613 3 -4.932424 -22.195910 2.466212 # 3 -6614 6614 3 -3.288283 -23.017979 1.644141 # 3 -6615 6615 3 -2.466212 -22.195910 1.644141 # 3 -6616 6616 3 -2.466212 -23.017979 2.466212 # 3 -6617 6617 3 -3.288283 -22.195910 2.466212 # 3 -6618 6618 3 -1.644141 -23.017979 1.644141 # 3 -6619 6619 3 -0.822071 -22.195910 1.644141 # 3 -6620 6620 3 -0.822071 -23.017979 2.466212 # 3 -6621 6621 3 -1.644141 -22.195910 2.466212 # 3 -6622 6622 3 0.000000 -23.017979 1.644141 # 3 -6623 6623 3 0.822071 -22.195910 1.644141 # 3 -6624 6624 3 0.822071 -23.017979 2.466212 # 3 -6625 6625 3 0.000000 -22.195910 2.466212 # 3 -6626 6626 3 1.644141 -23.017979 1.644141 # 3 -6627 6627 3 2.466212 -22.195910 1.644141 # 3 -6628 6628 3 2.466212 -23.017979 2.466212 # 3 -6629 6629 3 1.644141 -22.195910 2.466212 # 3 -6630 6630 3 3.288283 -23.017979 1.644141 # 3 -6631 6631 3 4.110353 -22.195910 1.644141 # 3 -6632 6632 3 4.110353 -23.017979 2.466212 # 3 -6633 6633 3 3.288283 -22.195910 2.466212 # 3 -6634 6634 3 4.932424 -23.017979 1.644141 # 3 -6635 6635 3 5.754495 -22.195910 1.644141 # 3 -6636 6636 3 5.754495 -23.017979 2.466212 # 3 -6637 6637 3 4.932424 -22.195910 2.466212 # 3 -6638 6638 3 6.576566 -23.017979 1.644141 # 3 -6639 6639 3 7.398636 -22.195910 1.644141 # 3 -6640 6640 3 7.398636 -23.017979 2.466212 # 3 -6641 6641 3 6.576566 -22.195910 2.466212 # 3 -6642 6642 3 8.220707 -23.017979 1.644141 # 3 -6643 6643 3 8.220707 -22.195910 2.466212 # 3 -6644 6644 3 -8.220707 -21.373838 1.644141 # 3 -6645 6645 3 -7.398636 -20.551767 1.644141 # 3 -6646 6646 3 -7.398636 -21.373838 2.466212 # 3 -6647 6647 3 -8.220707 -20.551767 2.466212 # 3 -6648 6648 3 -6.576566 -21.373838 1.644141 # 3 -6649 6649 3 -5.754495 -20.551767 1.644141 # 3 -6650 6650 3 -5.754495 -21.373838 2.466212 # 3 -6651 6651 3 -6.576566 -20.551767 2.466212 # 3 -6652 6652 3 -4.932424 -21.373838 1.644141 # 3 -6653 6653 3 -4.110353 -20.551767 1.644141 # 3 -6654 6654 3 -4.110353 -21.373838 2.466212 # 3 -6655 6655 3 -4.932424 -20.551767 2.466212 # 3 -6656 6656 3 -3.288283 -21.373838 1.644141 # 3 -6657 6657 3 -2.466212 -20.551767 1.644141 # 3 -6658 6658 3 -2.466212 -21.373838 2.466212 # 3 -6659 6659 3 -3.288283 -20.551767 2.466212 # 3 -6660 6660 3 -1.644141 -21.373838 1.644141 # 3 -6661 6661 3 -0.822071 -20.551767 1.644141 # 3 -6662 6662 3 -0.822071 -21.373838 2.466212 # 3 -6663 6663 3 -1.644141 -20.551767 2.466212 # 3 -6664 6664 3 0.000000 -21.373838 1.644141 # 3 -6665 6665 3 0.822071 -20.551767 1.644141 # 3 -6666 6666 3 0.822071 -21.373838 2.466212 # 3 -6667 6667 3 0.000000 -20.551767 2.466212 # 3 -6668 6668 3 1.644141 -21.373838 1.644141 # 3 -6669 6669 3 2.466212 -20.551767 1.644141 # 3 -6670 6670 3 2.466212 -21.373838 2.466212 # 3 -6671 6671 3 1.644141 -20.551767 2.466212 # 3 -6672 6672 3 3.288283 -21.373838 1.644141 # 3 -6673 6673 3 4.110353 -20.551767 1.644141 # 3 -6674 6674 3 4.110353 -21.373838 2.466212 # 3 -6675 6675 3 3.288283 -20.551767 2.466212 # 3 -6676 6676 3 4.932424 -21.373838 1.644141 # 3 -6677 6677 3 5.754495 -20.551767 1.644141 # 3 -6678 6678 3 5.754495 -21.373838 2.466212 # 3 -6679 6679 3 4.932424 -20.551767 2.466212 # 3 -6680 6680 3 6.576566 -21.373838 1.644141 # 3 -6681 6681 3 7.398636 -20.551767 1.644141 # 3 -6682 6682 3 7.398636 -21.373838 2.466212 # 3 -6683 6683 3 6.576566 -20.551767 2.466212 # 3 -6684 6684 3 8.220707 -21.373838 1.644141 # 3 -6685 6685 3 8.220707 -20.551767 2.466212 # 3 -6686 6686 3 -7.398636 -23.840050 3.288283 # 3 -6687 6687 3 -8.220707 -23.840050 4.110353 # 3 -6688 6688 3 -5.754495 -23.840050 3.288283 # 3 -6689 6689 3 -6.576566 -23.840050 4.110353 # 3 -6690 6690 3 -4.110353 -23.840050 3.288283 # 3 -6691 6691 3 -4.932424 -23.840050 4.110353 # 3 -6692 6692 3 -2.466212 -23.840050 3.288283 # 3 -6693 6693 3 -3.288283 -23.840050 4.110353 # 3 -6694 6694 3 -0.822071 -23.840050 3.288283 # 3 -6695 6695 3 -1.644141 -23.840050 4.110353 # 3 -6696 6696 3 0.822071 -23.840050 3.288283 # 3 -6697 6697 3 0.000000 -23.840050 4.110353 # 3 -6698 6698 3 2.466212 -23.840050 3.288283 # 3 -6699 6699 3 1.644141 -23.840050 4.110353 # 3 -6700 6700 3 4.110353 -23.840050 3.288283 # 3 -6701 6701 3 3.288283 -23.840050 4.110353 # 3 -6702 6702 3 5.754495 -23.840050 3.288283 # 3 -6703 6703 3 4.932424 -23.840050 4.110353 # 3 -6704 6704 3 7.398636 -23.840050 3.288283 # 3 -6705 6705 3 6.576566 -23.840050 4.110353 # 3 -6706 6706 3 8.220707 -23.840050 4.110353 # 3 -6707 6707 3 -8.220707 -23.017979 3.288283 # 3 -6708 6708 3 -7.398636 -22.195910 3.288283 # 3 -6709 6709 3 -7.398636 -23.017979 4.110353 # 3 -6710 6710 3 -8.220707 -22.195910 4.110353 # 3 -6711 6711 3 -6.576566 -23.017979 3.288283 # 3 -6712 6712 3 -5.754495 -22.195910 3.288283 # 3 -6713 6713 3 -5.754495 -23.017979 4.110353 # 3 -6714 6714 3 -6.576566 -22.195910 4.110353 # 3 -6715 6715 3 -4.932424 -23.017979 3.288283 # 3 -6716 6716 3 -4.110353 -22.195910 3.288283 # 3 -6717 6717 3 -4.110353 -23.017979 4.110353 # 3 -6718 6718 3 -4.932424 -22.195910 4.110353 # 3 -6719 6719 3 -3.288283 -23.017979 3.288283 # 3 -6720 6720 3 -2.466212 -22.195910 3.288283 # 3 -6721 6721 3 -2.466212 -23.017979 4.110353 # 3 -6722 6722 3 -3.288283 -22.195910 4.110353 # 3 -6723 6723 3 -1.644141 -23.017979 3.288283 # 3 -6724 6724 3 -0.822071 -22.195910 3.288283 # 3 -6725 6725 3 -0.822071 -23.017979 4.110353 # 3 -6726 6726 3 -1.644141 -22.195910 4.110353 # 3 -6727 6727 3 0.000000 -23.017979 3.288283 # 3 -6728 6728 3 0.822071 -22.195910 3.288283 # 3 -6729 6729 3 0.822071 -23.017979 4.110353 # 3 -6730 6730 3 0.000000 -22.195910 4.110353 # 3 -6731 6731 3 1.644141 -23.017979 3.288283 # 3 -6732 6732 3 2.466212 -22.195910 3.288283 # 3 -6733 6733 3 2.466212 -23.017979 4.110353 # 3 -6734 6734 3 1.644141 -22.195910 4.110353 # 3 -6735 6735 3 3.288283 -23.017979 3.288283 # 3 -6736 6736 3 4.110353 -22.195910 3.288283 # 3 -6737 6737 3 4.110353 -23.017979 4.110353 # 3 -6738 6738 3 3.288283 -22.195910 4.110353 # 3 -6739 6739 3 4.932424 -23.017979 3.288283 # 3 -6740 6740 3 5.754495 -22.195910 3.288283 # 3 -6741 6741 3 5.754495 -23.017979 4.110353 # 3 -6742 6742 3 4.932424 -22.195910 4.110353 # 3 -6743 6743 3 6.576566 -23.017979 3.288283 # 3 -6744 6744 3 7.398636 -22.195910 3.288283 # 3 -6745 6745 3 7.398636 -23.017979 4.110353 # 3 -6746 6746 3 6.576566 -22.195910 4.110353 # 3 -6747 6747 3 8.220707 -23.017979 3.288283 # 3 -6748 6748 3 8.220707 -22.195910 4.110353 # 3 -6749 6749 3 -8.220707 -21.373838 3.288283 # 3 -6750 6750 3 -7.398636 -20.551767 3.288283 # 3 -6751 6751 3 -7.398636 -21.373838 4.110353 # 3 -6752 6752 3 -8.220707 -20.551767 4.110353 # 3 -6753 6753 3 -6.576566 -21.373838 3.288283 # 3 -6754 6754 3 -5.754495 -20.551767 3.288283 # 3 -6755 6755 3 -5.754495 -21.373838 4.110353 # 3 -6756 6756 3 -6.576566 -20.551767 4.110353 # 3 -6757 6757 3 -4.932424 -21.373838 3.288283 # 3 -6758 6758 3 -4.110353 -20.551767 3.288283 # 3 -6759 6759 3 -4.110353 -21.373838 4.110353 # 3 -6760 6760 3 -4.932424 -20.551767 4.110353 # 3 -6761 6761 3 -3.288283 -21.373838 3.288283 # 3 -6762 6762 3 -2.466212 -20.551767 3.288283 # 3 -6763 6763 3 -2.466212 -21.373838 4.110353 # 3 -6764 6764 3 -3.288283 -20.551767 4.110353 # 3 -6765 6765 3 -1.644141 -21.373838 3.288283 # 3 -6766 6766 3 -0.822071 -20.551767 3.288283 # 3 -6767 6767 3 -0.822071 -21.373838 4.110353 # 3 -6768 6768 3 -1.644141 -20.551767 4.110353 # 3 -6769 6769 3 0.000000 -21.373838 3.288283 # 3 -6770 6770 3 0.822071 -20.551767 3.288283 # 3 -6771 6771 3 0.822071 -21.373838 4.110353 # 3 -6772 6772 3 0.000000 -20.551767 4.110353 # 3 -6773 6773 3 1.644141 -21.373838 3.288283 # 3 -6774 6774 3 2.466212 -20.551767 3.288283 # 3 -6775 6775 3 2.466212 -21.373838 4.110353 # 3 -6776 6776 3 1.644141 -20.551767 4.110353 # 3 -6777 6777 3 3.288283 -21.373838 3.288283 # 3 -6778 6778 3 4.110353 -20.551767 3.288283 # 3 -6779 6779 3 4.110353 -21.373838 4.110353 # 3 -6780 6780 3 3.288283 -20.551767 4.110353 # 3 -6781 6781 3 4.932424 -21.373838 3.288283 # 3 -6782 6782 3 5.754495 -20.551767 3.288283 # 3 -6783 6783 3 5.754495 -21.373838 4.110353 # 3 -6784 6784 3 4.932424 -20.551767 4.110353 # 3 -6785 6785 3 6.576566 -21.373838 3.288283 # 3 -6786 6786 3 7.398636 -20.551767 3.288283 # 3 -6787 6787 3 7.398636 -21.373838 4.110353 # 3 -6788 6788 3 6.576566 -20.551767 4.110353 # 3 -6789 6789 3 8.220707 -21.373838 3.288283 # 3 -6790 6790 3 8.220707 -20.551767 4.110353 # 3 -6791 6791 3 -7.398636 -23.840050 4.932424 # 3 -6792 6792 3 -8.220707 -23.840050 5.754495 # 3 -6793 6793 3 -5.754495 -23.840050 4.932424 # 3 -6794 6794 3 -6.576566 -23.840050 5.754495 # 3 -6795 6795 3 -4.110353 -23.840050 4.932424 # 3 -6796 6796 3 -4.932424 -23.840050 5.754495 # 3 -6797 6797 3 -2.466212 -23.840050 4.932424 # 3 -6798 6798 3 -3.288283 -23.840050 5.754495 # 3 -6799 6799 3 -0.822071 -23.840050 4.932424 # 3 -6800 6800 3 -1.644141 -23.840050 5.754495 # 3 -6801 6801 3 0.822071 -23.840050 4.932424 # 3 -6802 6802 3 0.000000 -23.840050 5.754495 # 3 -6803 6803 3 2.466212 -23.840050 4.932424 # 3 -6804 6804 3 1.644141 -23.840050 5.754495 # 3 -6805 6805 3 4.110353 -23.840050 4.932424 # 3 -6806 6806 3 3.288283 -23.840050 5.754495 # 3 -6807 6807 3 5.754495 -23.840050 4.932424 # 3 -6808 6808 3 4.932424 -23.840050 5.754495 # 3 -6809 6809 3 7.398636 -23.840050 4.932424 # 3 -6810 6810 3 6.576566 -23.840050 5.754495 # 3 -6811 6811 3 8.220707 -23.840050 5.754495 # 3 -6812 6812 3 -8.220707 -23.017979 4.932424 # 3 -6813 6813 3 -7.398636 -22.195910 4.932424 # 3 -6814 6814 3 -7.398636 -23.017979 5.754495 # 3 -6815 6815 3 -8.220707 -22.195910 5.754495 # 3 -6816 6816 3 -6.576566 -23.017979 4.932424 # 3 -6817 6817 3 -5.754495 -22.195910 4.932424 # 3 -6818 6818 3 -5.754495 -23.017979 5.754495 # 3 -6819 6819 3 -6.576566 -22.195910 5.754495 # 3 -6820 6820 3 -4.932424 -23.017979 4.932424 # 3 -6821 6821 3 -4.110353 -22.195910 4.932424 # 3 -6822 6822 3 -4.110353 -23.017979 5.754495 # 3 -6823 6823 3 -4.932424 -22.195910 5.754495 # 3 -6824 6824 3 -3.288283 -23.017979 4.932424 # 3 -6825 6825 3 -2.466212 -22.195910 4.932424 # 3 -6826 6826 3 -2.466212 -23.017979 5.754495 # 3 -6827 6827 3 -3.288283 -22.195910 5.754495 # 3 -6828 6828 3 -1.644141 -23.017979 4.932424 # 3 -6829 6829 3 -0.822071 -22.195910 4.932424 # 3 -6830 6830 3 -0.822071 -23.017979 5.754495 # 3 -6831 6831 3 -1.644141 -22.195910 5.754495 # 3 -6832 6832 3 0.000000 -23.017979 4.932424 # 3 -6833 6833 3 0.822071 -22.195910 4.932424 # 3 -6834 6834 3 0.822071 -23.017979 5.754495 # 3 -6835 6835 3 0.000000 -22.195910 5.754495 # 3 -6836 6836 3 1.644141 -23.017979 4.932424 # 3 -6837 6837 3 2.466212 -22.195910 4.932424 # 3 -6838 6838 3 2.466212 -23.017979 5.754495 # 3 -6839 6839 3 1.644141 -22.195910 5.754495 # 3 -6840 6840 3 3.288283 -23.017979 4.932424 # 3 -6841 6841 3 4.110353 -22.195910 4.932424 # 3 -6842 6842 3 4.110353 -23.017979 5.754495 # 3 -6843 6843 3 3.288283 -22.195910 5.754495 # 3 -6844 6844 3 4.932424 -23.017979 4.932424 # 3 -6845 6845 3 5.754495 -22.195910 4.932424 # 3 -6846 6846 3 5.754495 -23.017979 5.754495 # 3 -6847 6847 3 4.932424 -22.195910 5.754495 # 3 -6848 6848 3 6.576566 -23.017979 4.932424 # 3 -6849 6849 3 7.398636 -22.195910 4.932424 # 3 -6850 6850 3 7.398636 -23.017979 5.754495 # 3 -6851 6851 3 6.576566 -22.195910 5.754495 # 3 -6852 6852 3 8.220707 -23.017979 4.932424 # 3 -6853 6853 3 8.220707 -22.195910 5.754495 # 3 -6854 6854 3 -8.220707 -21.373838 4.932424 # 3 -6855 6855 3 -7.398636 -20.551767 4.932424 # 3 -6856 6856 3 -7.398636 -21.373838 5.754495 # 3 -6857 6857 3 -8.220707 -20.551767 5.754495 # 3 -6858 6858 3 -6.576566 -21.373838 4.932424 # 3 -6859 6859 3 -5.754495 -20.551767 4.932424 # 3 -6860 6860 3 -5.754495 -21.373838 5.754495 # 3 -6861 6861 3 -6.576566 -20.551767 5.754495 # 3 -6862 6862 3 -4.932424 -21.373838 4.932424 # 3 -6863 6863 3 -4.110353 -20.551767 4.932424 # 3 -6864 6864 3 -4.110353 -21.373838 5.754495 # 3 -6865 6865 3 -4.932424 -20.551767 5.754495 # 3 -6866 6866 3 -3.288283 -21.373838 4.932424 # 3 -6867 6867 3 -2.466212 -20.551767 4.932424 # 3 -6868 6868 3 -2.466212 -21.373838 5.754495 # 3 -6869 6869 3 -3.288283 -20.551767 5.754495 # 3 -6870 6870 3 -1.644141 -21.373838 4.932424 # 3 -6871 6871 3 -0.822071 -20.551767 4.932424 # 3 -6872 6872 3 -0.822071 -21.373838 5.754495 # 3 -6873 6873 3 -1.644141 -20.551767 5.754495 # 3 -6874 6874 3 0.000000 -21.373838 4.932424 # 3 -6875 6875 3 0.822071 -20.551767 4.932424 # 3 -6876 6876 3 0.822071 -21.373838 5.754495 # 3 -6877 6877 3 0.000000 -20.551767 5.754495 # 3 -6878 6878 3 1.644141 -21.373838 4.932424 # 3 -6879 6879 3 2.466212 -20.551767 4.932424 # 3 -6880 6880 3 2.466212 -21.373838 5.754495 # 3 -6881 6881 3 1.644141 -20.551767 5.754495 # 3 -6882 6882 3 3.288283 -21.373838 4.932424 # 3 -6883 6883 3 4.110353 -20.551767 4.932424 # 3 -6884 6884 3 4.110353 -21.373838 5.754495 # 3 -6885 6885 3 3.288283 -20.551767 5.754495 # 3 -6886 6886 3 4.932424 -21.373838 4.932424 # 3 -6887 6887 3 5.754495 -20.551767 4.932424 # 3 -6888 6888 3 5.754495 -21.373838 5.754495 # 3 -6889 6889 3 4.932424 -20.551767 5.754495 # 3 -6890 6890 3 6.576566 -21.373838 4.932424 # 3 -6891 6891 3 7.398636 -20.551767 4.932424 # 3 -6892 6892 3 7.398636 -21.373838 5.754495 # 3 -6893 6893 3 6.576566 -20.551767 5.754495 # 3 -6894 6894 3 8.220707 -21.373838 4.932424 # 3 -6895 6895 3 8.220707 -20.551767 5.754495 # 3 -6896 6896 3 -7.398636 -23.840050 6.576566 # 3 -6897 6897 3 -8.220707 -23.840050 7.398636 # 3 -6898 6898 3 -5.754495 -23.840050 6.576566 # 3 -6899 6899 3 -6.576566 -23.840050 7.398636 # 3 -6900 6900 3 -4.110353 -23.840050 6.576566 # 3 -6901 6901 3 -4.932424 -23.840050 7.398636 # 3 -6902 6902 3 -2.466212 -23.840050 6.576566 # 3 -6903 6903 3 -3.288283 -23.840050 7.398636 # 3 -6904 6904 3 -0.822071 -23.840050 6.576566 # 3 -6905 6905 3 -1.644141 -23.840050 7.398636 # 3 -6906 6906 3 0.822071 -23.840050 6.576566 # 3 -6907 6907 3 0.000000 -23.840050 7.398636 # 3 -6908 6908 3 2.466212 -23.840050 6.576566 # 3 -6909 6909 3 1.644141 -23.840050 7.398636 # 3 -6910 6910 3 4.110353 -23.840050 6.576566 # 3 -6911 6911 3 3.288283 -23.840050 7.398636 # 3 -6912 6912 3 5.754495 -23.840050 6.576566 # 3 -6913 6913 3 4.932424 -23.840050 7.398636 # 3 -6914 6914 3 7.398636 -23.840050 6.576566 # 3 -6915 6915 3 6.576566 -23.840050 7.398636 # 3 -6916 6916 3 8.220707 -23.840050 7.398636 # 3 -6917 6917 3 -8.220707 -23.017979 6.576566 # 3 -6918 6918 3 -7.398636 -22.195910 6.576566 # 3 -6919 6919 3 -7.398636 -23.017979 7.398636 # 3 -6920 6920 3 -8.220707 -22.195910 7.398636 # 3 -6921 6921 3 -6.576566 -23.017979 6.576566 # 3 -6922 6922 3 -5.754495 -22.195910 6.576566 # 3 -6923 6923 3 -5.754495 -23.017979 7.398636 # 3 -6924 6924 3 -6.576566 -22.195910 7.398636 # 3 -6925 6925 3 -4.932424 -23.017979 6.576566 # 3 -6926 6926 3 -4.110353 -22.195910 6.576566 # 3 -6927 6927 3 -4.110353 -23.017979 7.398636 # 3 -6928 6928 3 -4.932424 -22.195910 7.398636 # 3 -6929 6929 3 -3.288283 -23.017979 6.576566 # 3 -6930 6930 3 -2.466212 -22.195910 6.576566 # 3 -6931 6931 3 -2.466212 -23.017979 7.398636 # 3 -6932 6932 3 -3.288283 -22.195910 7.398636 # 3 -6933 6933 3 -1.644141 -23.017979 6.576566 # 3 -6934 6934 3 -0.822071 -22.195910 6.576566 # 3 -6935 6935 3 -0.822071 -23.017979 7.398636 # 3 -6936 6936 3 -1.644141 -22.195910 7.398636 # 3 -6937 6937 3 0.000000 -23.017979 6.576566 # 3 -6938 6938 3 0.822071 -22.195910 6.576566 # 3 -6939 6939 3 0.822071 -23.017979 7.398636 # 3 -6940 6940 3 0.000000 -22.195910 7.398636 # 3 -6941 6941 3 1.644141 -23.017979 6.576566 # 3 -6942 6942 3 2.466212 -22.195910 6.576566 # 3 -6943 6943 3 2.466212 -23.017979 7.398636 # 3 -6944 6944 3 1.644141 -22.195910 7.398636 # 3 -6945 6945 3 3.288283 -23.017979 6.576566 # 3 -6946 6946 3 4.110353 -22.195910 6.576566 # 3 -6947 6947 3 4.110353 -23.017979 7.398636 # 3 -6948 6948 3 3.288283 -22.195910 7.398636 # 3 -6949 6949 3 4.932424 -23.017979 6.576566 # 3 -6950 6950 3 5.754495 -22.195910 6.576566 # 3 -6951 6951 3 5.754495 -23.017979 7.398636 # 3 -6952 6952 3 4.932424 -22.195910 7.398636 # 3 -6953 6953 3 6.576566 -23.017979 6.576566 # 3 -6954 6954 3 7.398636 -22.195910 6.576566 # 3 -6955 6955 3 7.398636 -23.017979 7.398636 # 3 -6956 6956 3 6.576566 -22.195910 7.398636 # 3 -6957 6957 3 8.220707 -23.017979 6.576566 # 3 -6958 6958 3 8.220707 -22.195910 7.398636 # 3 -6959 6959 3 -8.220707 -21.373838 6.576566 # 3 -6960 6960 3 -7.398636 -20.551767 6.576566 # 3 -6961 6961 3 -7.398636 -21.373838 7.398636 # 3 -6962 6962 3 -8.220707 -20.551767 7.398636 # 3 -6963 6963 3 -6.576566 -21.373838 6.576566 # 3 -6964 6964 3 -5.754495 -20.551767 6.576566 # 3 -6965 6965 3 -5.754495 -21.373838 7.398636 # 3 -6966 6966 3 -6.576566 -20.551767 7.398636 # 3 -6967 6967 3 -4.932424 -21.373838 6.576566 # 3 -6968 6968 3 -4.110353 -20.551767 6.576566 # 3 -6969 6969 3 -4.110353 -21.373838 7.398636 # 3 -6970 6970 3 -4.932424 -20.551767 7.398636 # 3 -6971 6971 3 -3.288283 -21.373838 6.576566 # 3 -6972 6972 3 -2.466212 -20.551767 6.576566 # 3 -6973 6973 3 -2.466212 -21.373838 7.398636 # 3 -6974 6974 3 -3.288283 -20.551767 7.398636 # 3 -6975 6975 3 -1.644141 -21.373838 6.576566 # 3 -6976 6976 3 -0.822071 -20.551767 6.576566 # 3 -6977 6977 3 -0.822071 -21.373838 7.398636 # 3 -6978 6978 3 -1.644141 -20.551767 7.398636 # 3 -6979 6979 3 0.000000 -21.373838 6.576566 # 3 -6980 6980 3 0.822071 -20.551767 6.576566 # 3 -6981 6981 3 0.822071 -21.373838 7.398636 # 3 -6982 6982 3 0.000000 -20.551767 7.398636 # 3 -6983 6983 3 1.644141 -21.373838 6.576566 # 3 -6984 6984 3 2.466212 -20.551767 6.576566 # 3 -6985 6985 3 2.466212 -21.373838 7.398636 # 3 -6986 6986 3 1.644141 -20.551767 7.398636 # 3 -6987 6987 3 3.288283 -21.373838 6.576566 # 3 -6988 6988 3 4.110353 -20.551767 6.576566 # 3 -6989 6989 3 4.110353 -21.373838 7.398636 # 3 -6990 6990 3 3.288283 -20.551767 7.398636 # 3 -6991 6991 3 4.932424 -21.373838 6.576566 # 3 -6992 6992 3 5.754495 -20.551767 6.576566 # 3 -6993 6993 3 5.754495 -21.373838 7.398636 # 3 -6994 6994 3 4.932424 -20.551767 7.398636 # 3 -6995 6995 3 6.576566 -21.373838 6.576566 # 3 -6996 6996 3 7.398636 -20.551767 6.576566 # 3 -6997 6997 3 7.398636 -21.373838 7.398636 # 3 -6998 6998 3 6.576566 -20.551767 7.398636 # 3 -6999 6999 3 8.220707 -21.373838 6.576566 # 3 -7000 7000 3 8.220707 -20.551767 7.398636 # 3 -7001 7001 3 -7.398636 -23.840050 8.220707 # 3 -7002 7002 3 -5.754495 -23.840050 8.220707 # 3 -7003 7003 3 -4.110353 -23.840050 8.220707 # 3 -7004 7004 3 -2.466212 -23.840050 8.220707 # 3 -7005 7005 3 -0.822071 -23.840050 8.220707 # 3 -7006 7006 3 0.822071 -23.840050 8.220707 # 3 -7007 7007 3 2.466212 -23.840050 8.220707 # 3 -7008 7008 3 4.110353 -23.840050 8.220707 # 3 -7009 7009 3 5.754495 -23.840050 8.220707 # 3 -7010 7010 3 7.398636 -23.840050 8.220707 # 3 -7011 7011 3 -8.220707 -23.017979 8.220707 # 3 -7012 7012 3 -7.398636 -22.195910 8.220707 # 3 -7013 7013 3 -6.576566 -23.017979 8.220707 # 3 -7014 7014 3 -5.754495 -22.195910 8.220707 # 3 -7015 7015 3 -4.932424 -23.017979 8.220707 # 3 -7016 7016 3 -4.110353 -22.195910 8.220707 # 3 -7017 7017 3 -3.288283 -23.017979 8.220707 # 3 -7018 7018 3 -2.466212 -22.195910 8.220707 # 3 -7019 7019 3 -1.644141 -23.017979 8.220707 # 3 -7020 7020 3 -0.822071 -22.195910 8.220707 # 3 -7021 7021 3 0.000000 -23.017979 8.220707 # 3 -7022 7022 3 0.822071 -22.195910 8.220707 # 3 -7023 7023 3 1.644141 -23.017979 8.220707 # 3 -7024 7024 3 2.466212 -22.195910 8.220707 # 3 -7025 7025 3 3.288283 -23.017979 8.220707 # 3 -7026 7026 3 4.110353 -22.195910 8.220707 # 3 -7027 7027 3 4.932424 -23.017979 8.220707 # 3 -7028 7028 3 5.754495 -22.195910 8.220707 # 3 -7029 7029 3 6.576566 -23.017979 8.220707 # 3 -7030 7030 3 7.398636 -22.195910 8.220707 # 3 -7031 7031 3 8.220707 -23.017979 8.220707 # 3 -7032 7032 3 -8.220707 -21.373838 8.220707 # 3 -7033 7033 3 -7.398636 -20.551767 8.220707 # 3 -7034 7034 3 -6.576566 -21.373838 8.220707 # 3 -7035 7035 3 -5.754495 -20.551767 8.220707 # 3 -7036 7036 3 -4.932424 -21.373838 8.220707 # 3 -7037 7037 3 -4.110353 -20.551767 8.220707 # 3 -7038 7038 3 -3.288283 -21.373838 8.220707 # 3 -7039 7039 3 -2.466212 -20.551767 8.220707 # 3 -7040 7040 3 -1.644141 -21.373838 8.220707 # 3 -7041 7041 3 -0.822071 -20.551767 8.220707 # 3 -7042 7042 3 0.000000 -21.373838 8.220707 # 3 -7043 7043 3 0.822071 -20.551767 8.220707 # 3 -7044 7044 3 1.644141 -21.373838 8.220707 # 3 -7045 7045 3 2.466212 -20.551767 8.220707 # 3 -7046 7046 3 3.288283 -21.373838 8.220707 # 3 -7047 7047 3 4.110353 -20.551767 8.220707 # 3 -7048 7048 3 4.932424 -21.373838 8.220707 # 3 -7049 7049 3 5.754495 -20.551767 8.220707 # 3 -7050 7050 3 6.576566 -21.373838 8.220707 # 3 -7051 7051 3 7.398636 -20.551767 8.220707 # 3 -7052 7052 3 8.220707 -21.373838 8.220707 # 3 -7053 7053 3 9.864848 -23.840050 -7.398636 # 3 -7054 7054 3 11.508989 -23.840050 -7.398636 # 3 -7055 7055 3 13.153131 -23.840050 -7.398636 # 3 -7056 7056 3 14.797273 -23.840050 -7.398636 # 3 -7057 7057 3 16.441414 -23.840050 -7.398636 # 3 -7058 7058 3 18.085556 -23.840050 -7.398636 # 3 -7059 7059 3 19.729696 -23.840050 -7.398636 # 3 -7060 7060 3 21.373838 -23.840050 -7.398636 # 3 -7061 7061 3 23.017979 -23.840050 -7.398636 # 3 -7062 7062 3 24.662121 -23.840050 -7.398636 # 3 -7063 7063 3 9.042778 -23.017979 -7.398636 # 3 -7064 7064 3 10.686919 -23.017979 -7.398636 # 3 -7065 7065 3 9.864848 -22.195910 -7.398636 # 3 -7066 7066 3 12.331060 -23.017979 -7.398636 # 3 -7067 7067 3 11.508989 -22.195910 -7.398636 # 3 -7068 7068 3 13.975202 -23.017979 -7.398636 # 3 -7069 7069 3 13.153131 -22.195910 -7.398636 # 3 -7070 7070 3 15.619343 -23.017979 -7.398636 # 3 -7071 7071 3 14.797273 -22.195910 -7.398636 # 3 -7072 7072 3 17.263485 -23.017979 -7.398636 # 3 -7073 7073 3 16.441414 -22.195910 -7.398636 # 3 -7074 7074 3 18.907625 -23.017979 -7.398636 # 3 -7075 7075 3 18.085556 -22.195910 -7.398636 # 3 -7076 7076 3 20.551767 -23.017979 -7.398636 # 3 -7077 7077 3 19.729696 -22.195910 -7.398636 # 3 -7078 7078 3 22.195910 -23.017979 -7.398636 # 3 -7079 7079 3 21.373838 -22.195910 -7.398636 # 3 -7080 7080 3 23.840050 -23.017979 -7.398636 # 3 -7081 7081 3 23.017979 -22.195910 -7.398636 # 3 -7082 7082 3 24.662121 -22.195910 -7.398636 # 3 -7083 7083 3 9.042778 -21.373838 -7.398636 # 3 -7084 7084 3 10.686919 -21.373838 -7.398636 # 3 -7085 7085 3 9.864848 -20.551767 -7.398636 # 3 -7086 7086 3 12.331060 -21.373838 -7.398636 # 3 -7087 7087 3 11.508989 -20.551767 -7.398636 # 3 -7088 7088 3 13.975202 -21.373838 -7.398636 # 3 -7089 7089 3 13.153131 -20.551767 -7.398636 # 3 -7090 7090 3 15.619343 -21.373838 -7.398636 # 3 -7091 7091 3 14.797273 -20.551767 -7.398636 # 3 -7092 7092 3 17.263485 -21.373838 -7.398636 # 3 -7093 7093 3 16.441414 -20.551767 -7.398636 # 3 -7094 7094 3 18.907625 -21.373838 -7.398636 # 3 -7095 7095 3 18.085556 -20.551767 -7.398636 # 3 -7096 7096 3 20.551767 -21.373838 -7.398636 # 3 -7097 7097 3 19.729696 -20.551767 -7.398636 # 3 -7098 7098 3 22.195910 -21.373838 -7.398636 # 3 -7099 7099 3 21.373838 -20.551767 -7.398636 # 3 -7100 7100 3 23.840050 -21.373838 -7.398636 # 3 -7101 7101 3 23.017979 -20.551767 -7.398636 # 3 -7102 7102 3 24.662121 -20.551767 -7.398636 # 3 -7103 7103 3 9.042778 -23.840050 -6.576566 # 3 -7104 7104 3 10.686919 -23.840050 -6.576566 # 3 -7105 7105 3 9.864848 -23.840050 -5.754495 # 3 -7106 7106 3 12.331060 -23.840050 -6.576566 # 3 -7107 7107 3 11.508989 -23.840050 -5.754495 # 3 -7108 7108 3 13.975202 -23.840050 -6.576566 # 3 -7109 7109 3 13.153131 -23.840050 -5.754495 # 3 -7110 7110 3 15.619343 -23.840050 -6.576566 # 3 -7111 7111 3 14.797273 -23.840050 -5.754495 # 3 -7112 7112 3 17.263485 -23.840050 -6.576566 # 3 -7113 7113 3 16.441414 -23.840050 -5.754495 # 3 -7114 7114 3 18.907625 -23.840050 -6.576566 # 3 -7115 7115 3 18.085556 -23.840050 -5.754495 # 3 -7116 7116 3 20.551767 -23.840050 -6.576566 # 3 -7117 7117 3 19.729696 -23.840050 -5.754495 # 3 -7118 7118 3 22.195910 -23.840050 -6.576566 # 3 -7119 7119 3 21.373838 -23.840050 -5.754495 # 3 -7120 7120 3 23.840050 -23.840050 -6.576566 # 3 -7121 7121 3 23.017979 -23.840050 -5.754495 # 3 -7122 7122 3 24.662121 -23.840050 -5.754495 # 3 -7123 7123 3 9.042778 -22.195910 -6.576566 # 3 -7124 7124 3 9.042778 -23.017979 -5.754495 # 3 -7125 7125 3 9.864848 -23.017979 -6.576566 # 3 -7126 7126 3 10.686919 -22.195910 -6.576566 # 3 -7127 7127 3 10.686919 -23.017979 -5.754495 # 3 -7128 7128 3 9.864848 -22.195910 -5.754495 # 3 -7129 7129 3 11.508989 -23.017979 -6.576566 # 3 -7130 7130 3 12.331060 -22.195910 -6.576566 # 3 -7131 7131 3 12.331060 -23.017979 -5.754495 # 3 -7132 7132 3 11.508989 -22.195910 -5.754495 # 3 -7133 7133 3 13.153131 -23.017979 -6.576566 # 3 -7134 7134 3 13.975202 -22.195910 -6.576566 # 3 -7135 7135 3 13.975202 -23.017979 -5.754495 # 3 -7136 7136 3 13.153131 -22.195910 -5.754495 # 3 -7137 7137 3 14.797273 -23.017979 -6.576566 # 3 -7138 7138 3 15.619343 -22.195910 -6.576566 # 3 -7139 7139 3 15.619343 -23.017979 -5.754495 # 3 -7140 7140 3 14.797273 -22.195910 -5.754495 # 3 -7141 7141 3 16.441414 -23.017979 -6.576566 # 3 -7142 7142 3 17.263485 -22.195910 -6.576566 # 3 -7143 7143 3 17.263485 -23.017979 -5.754495 # 3 -7144 7144 3 16.441414 -22.195910 -5.754495 # 3 -7145 7145 3 18.085556 -23.017979 -6.576566 # 3 -7146 7146 3 18.907625 -22.195910 -6.576566 # 3 -7147 7147 3 18.907625 -23.017979 -5.754495 # 3 -7148 7148 3 18.085556 -22.195910 -5.754495 # 3 -7149 7149 3 19.729696 -23.017979 -6.576566 # 3 -7150 7150 3 20.551767 -22.195910 -6.576566 # 3 -7151 7151 3 20.551767 -23.017979 -5.754495 # 3 -7152 7152 3 19.729696 -22.195910 -5.754495 # 3 -7153 7153 3 21.373838 -23.017979 -6.576566 # 3 -7154 7154 3 22.195910 -22.195910 -6.576566 # 3 -7155 7155 3 22.195910 -23.017979 -5.754495 # 3 -7156 7156 3 21.373838 -22.195910 -5.754495 # 3 -7157 7157 3 23.017979 -23.017979 -6.576566 # 3 -7158 7158 3 23.840050 -22.195910 -6.576566 # 3 -7159 7159 3 23.840050 -23.017979 -5.754495 # 3 -7160 7160 3 23.017979 -22.195910 -5.754495 # 3 -7161 7161 3 24.662121 -23.017979 -6.576566 # 3 -7162 7162 3 24.662121 -22.195910 -5.754495 # 3 -7163 7163 3 9.042778 -20.551767 -6.576566 # 3 -7164 7164 3 9.042778 -21.373838 -5.754495 # 3 -7165 7165 3 9.864848 -21.373838 -6.576566 # 3 -7166 7166 3 10.686919 -20.551767 -6.576566 # 3 -7167 7167 3 10.686919 -21.373838 -5.754495 # 3 -7168 7168 3 9.864848 -20.551767 -5.754495 # 3 -7169 7169 3 11.508989 -21.373838 -6.576566 # 3 -7170 7170 3 12.331060 -20.551767 -6.576566 # 3 -7171 7171 3 12.331060 -21.373838 -5.754495 # 3 -7172 7172 3 11.508989 -20.551767 -5.754495 # 3 -7173 7173 3 13.153131 -21.373838 -6.576566 # 3 -7174 7174 3 13.975202 -20.551767 -6.576566 # 3 -7175 7175 3 13.975202 -21.373838 -5.754495 # 3 -7176 7176 3 13.153131 -20.551767 -5.754495 # 3 -7177 7177 3 14.797273 -21.373838 -6.576566 # 3 -7178 7178 3 15.619343 -20.551767 -6.576566 # 3 -7179 7179 3 15.619343 -21.373838 -5.754495 # 3 -7180 7180 3 14.797273 -20.551767 -5.754495 # 3 -7181 7181 3 16.441414 -21.373838 -6.576566 # 3 -7182 7182 3 17.263485 -20.551767 -6.576566 # 3 -7183 7183 3 17.263485 -21.373838 -5.754495 # 3 -7184 7184 3 16.441414 -20.551767 -5.754495 # 3 -7185 7185 3 18.085556 -21.373838 -6.576566 # 3 -7186 7186 3 18.907625 -20.551767 -6.576566 # 3 -7187 7187 3 18.907625 -21.373838 -5.754495 # 3 -7188 7188 3 18.085556 -20.551767 -5.754495 # 3 -7189 7189 3 19.729696 -21.373838 -6.576566 # 3 -7190 7190 3 20.551767 -20.551767 -6.576566 # 3 -7191 7191 3 20.551767 -21.373838 -5.754495 # 3 -7192 7192 3 19.729696 -20.551767 -5.754495 # 3 -7193 7193 3 21.373838 -21.373838 -6.576566 # 3 -7194 7194 3 22.195910 -20.551767 -6.576566 # 3 -7195 7195 3 22.195910 -21.373838 -5.754495 # 3 -7196 7196 3 21.373838 -20.551767 -5.754495 # 3 -7197 7197 3 23.017979 -21.373838 -6.576566 # 3 -7198 7198 3 23.840050 -20.551767 -6.576566 # 3 -7199 7199 3 23.840050 -21.373838 -5.754495 # 3 -7200 7200 3 23.017979 -20.551767 -5.754495 # 3 -7201 7201 3 24.662121 -21.373838 -6.576566 # 3 -7202 7202 3 24.662121 -20.551767 -5.754495 # 3 -7203 7203 3 9.042778 -23.840050 -4.932424 # 3 -7204 7204 3 10.686919 -23.840050 -4.932424 # 3 -7205 7205 3 9.864848 -23.840050 -4.110353 # 3 -7206 7206 3 12.331060 -23.840050 -4.932424 # 3 -7207 7207 3 11.508989 -23.840050 -4.110353 # 3 -7208 7208 3 13.975202 -23.840050 -4.932424 # 3 -7209 7209 3 13.153131 -23.840050 -4.110353 # 3 -7210 7210 3 15.619343 -23.840050 -4.932424 # 3 -7211 7211 3 14.797273 -23.840050 -4.110353 # 3 -7212 7212 3 17.263485 -23.840050 -4.932424 # 3 -7213 7213 3 16.441414 -23.840050 -4.110353 # 3 -7214 7214 3 18.907625 -23.840050 -4.932424 # 3 -7215 7215 3 18.085556 -23.840050 -4.110353 # 3 -7216 7216 3 20.551767 -23.840050 -4.932424 # 3 -7217 7217 3 19.729696 -23.840050 -4.110353 # 3 -7218 7218 3 22.195910 -23.840050 -4.932424 # 3 -7219 7219 3 21.373838 -23.840050 -4.110353 # 3 -7220 7220 3 23.840050 -23.840050 -4.932424 # 3 -7221 7221 3 23.017979 -23.840050 -4.110353 # 3 -7222 7222 3 24.662121 -23.840050 -4.110353 # 3 -7223 7223 3 9.042778 -22.195910 -4.932424 # 3 -7224 7224 3 9.042778 -23.017979 -4.110353 # 3 -7225 7225 3 9.864848 -23.017979 -4.932424 # 3 -7226 7226 3 10.686919 -22.195910 -4.932424 # 3 -7227 7227 3 10.686919 -23.017979 -4.110353 # 3 -7228 7228 3 9.864848 -22.195910 -4.110353 # 3 -7229 7229 3 11.508989 -23.017979 -4.932424 # 3 -7230 7230 3 12.331060 -22.195910 -4.932424 # 3 -7231 7231 3 12.331060 -23.017979 -4.110353 # 3 -7232 7232 3 11.508989 -22.195910 -4.110353 # 3 -7233 7233 3 13.153131 -23.017979 -4.932424 # 3 -7234 7234 3 13.975202 -22.195910 -4.932424 # 3 -7235 7235 3 13.975202 -23.017979 -4.110353 # 3 -7236 7236 3 13.153131 -22.195910 -4.110353 # 3 -7237 7237 3 14.797273 -23.017979 -4.932424 # 3 -7238 7238 3 15.619343 -22.195910 -4.932424 # 3 -7239 7239 3 15.619343 -23.017979 -4.110353 # 3 -7240 7240 3 14.797273 -22.195910 -4.110353 # 3 -7241 7241 3 16.441414 -23.017979 -4.932424 # 3 -7242 7242 3 17.263485 -22.195910 -4.932424 # 3 -7243 7243 3 17.263485 -23.017979 -4.110353 # 3 -7244 7244 3 16.441414 -22.195910 -4.110353 # 3 -7245 7245 3 18.085556 -23.017979 -4.932424 # 3 -7246 7246 3 18.907625 -22.195910 -4.932424 # 3 -7247 7247 3 18.907625 -23.017979 -4.110353 # 3 -7248 7248 3 18.085556 -22.195910 -4.110353 # 3 -7249 7249 3 19.729696 -23.017979 -4.932424 # 3 -7250 7250 3 20.551767 -22.195910 -4.932424 # 3 -7251 7251 3 20.551767 -23.017979 -4.110353 # 3 -7252 7252 3 19.729696 -22.195910 -4.110353 # 3 -7253 7253 3 21.373838 -23.017979 -4.932424 # 3 -7254 7254 3 22.195910 -22.195910 -4.932424 # 3 -7255 7255 3 22.195910 -23.017979 -4.110353 # 3 -7256 7256 3 21.373838 -22.195910 -4.110353 # 3 -7257 7257 3 23.017979 -23.017979 -4.932424 # 3 -7258 7258 3 23.840050 -22.195910 -4.932424 # 3 -7259 7259 3 23.840050 -23.017979 -4.110353 # 3 -7260 7260 3 23.017979 -22.195910 -4.110353 # 3 -7261 7261 3 24.662121 -23.017979 -4.932424 # 3 -7262 7262 3 24.662121 -22.195910 -4.110353 # 3 -7263 7263 3 9.042778 -20.551767 -4.932424 # 3 -7264 7264 3 9.042778 -21.373838 -4.110353 # 3 -7265 7265 3 9.864848 -21.373838 -4.932424 # 3 -7266 7266 3 10.686919 -20.551767 -4.932424 # 3 -7267 7267 3 10.686919 -21.373838 -4.110353 # 3 -7268 7268 3 9.864848 -20.551767 -4.110353 # 3 -7269 7269 3 11.508989 -21.373838 -4.932424 # 3 -7270 7270 3 12.331060 -20.551767 -4.932424 # 3 -7271 7271 3 12.331060 -21.373838 -4.110353 # 3 -7272 7272 3 11.508989 -20.551767 -4.110353 # 3 -7273 7273 3 13.153131 -21.373838 -4.932424 # 3 -7274 7274 3 13.975202 -20.551767 -4.932424 # 3 -7275 7275 3 13.975202 -21.373838 -4.110353 # 3 -7276 7276 3 13.153131 -20.551767 -4.110353 # 3 -7277 7277 3 14.797273 -21.373838 -4.932424 # 3 -7278 7278 3 15.619343 -20.551767 -4.932424 # 3 -7279 7279 3 15.619343 -21.373838 -4.110353 # 3 -7280 7280 3 14.797273 -20.551767 -4.110353 # 3 -7281 7281 3 16.441414 -21.373838 -4.932424 # 3 -7282 7282 3 17.263485 -20.551767 -4.932424 # 3 -7283 7283 3 17.263485 -21.373838 -4.110353 # 3 -7284 7284 3 16.441414 -20.551767 -4.110353 # 3 -7285 7285 3 18.085556 -21.373838 -4.932424 # 3 -7286 7286 3 18.907625 -20.551767 -4.932424 # 3 -7287 7287 3 18.907625 -21.373838 -4.110353 # 3 -7288 7288 3 18.085556 -20.551767 -4.110353 # 3 -7289 7289 3 19.729696 -21.373838 -4.932424 # 3 -7290 7290 3 20.551767 -20.551767 -4.932424 # 3 -7291 7291 3 20.551767 -21.373838 -4.110353 # 3 -7292 7292 3 19.729696 -20.551767 -4.110353 # 3 -7293 7293 3 21.373838 -21.373838 -4.932424 # 3 -7294 7294 3 22.195910 -20.551767 -4.932424 # 3 -7295 7295 3 22.195910 -21.373838 -4.110353 # 3 -7296 7296 3 21.373838 -20.551767 -4.110353 # 3 -7297 7297 3 23.017979 -21.373838 -4.932424 # 3 -7298 7298 3 23.840050 -20.551767 -4.932424 # 3 -7299 7299 3 23.840050 -21.373838 -4.110353 # 3 -7300 7300 3 23.017979 -20.551767 -4.110353 # 3 -7301 7301 3 24.662121 -21.373838 -4.932424 # 3 -7302 7302 3 24.662121 -20.551767 -4.110353 # 3 -7303 7303 3 9.042778 -23.840050 -3.288283 # 3 -7304 7304 3 10.686919 -23.840050 -3.288283 # 3 -7305 7305 3 9.864848 -23.840050 -2.466212 # 3 -7306 7306 3 12.331060 -23.840050 -3.288283 # 3 -7307 7307 3 11.508989 -23.840050 -2.466212 # 3 -7308 7308 3 13.975202 -23.840050 -3.288283 # 3 -7309 7309 3 13.153131 -23.840050 -2.466212 # 3 -7310 7310 3 15.619343 -23.840050 -3.288283 # 3 -7311 7311 3 14.797273 -23.840050 -2.466212 # 3 -7312 7312 3 17.263485 -23.840050 -3.288283 # 3 -7313 7313 3 16.441414 -23.840050 -2.466212 # 3 -7314 7314 3 18.907625 -23.840050 -3.288283 # 3 -7315 7315 3 18.085556 -23.840050 -2.466212 # 3 -7316 7316 3 20.551767 -23.840050 -3.288283 # 3 -7317 7317 3 19.729696 -23.840050 -2.466212 # 3 -7318 7318 3 22.195910 -23.840050 -3.288283 # 3 -7319 7319 3 21.373838 -23.840050 -2.466212 # 3 -7320 7320 3 23.840050 -23.840050 -3.288283 # 3 -7321 7321 3 23.017979 -23.840050 -2.466212 # 3 -7322 7322 3 24.662121 -23.840050 -2.466212 # 3 -7323 7323 3 9.042778 -22.195910 -3.288283 # 3 -7324 7324 3 9.042778 -23.017979 -2.466212 # 3 -7325 7325 3 9.864848 -23.017979 -3.288283 # 3 -7326 7326 3 10.686919 -22.195910 -3.288283 # 3 -7327 7327 3 10.686919 -23.017979 -2.466212 # 3 -7328 7328 3 9.864848 -22.195910 -2.466212 # 3 -7329 7329 3 11.508989 -23.017979 -3.288283 # 3 -7330 7330 3 12.331060 -22.195910 -3.288283 # 3 -7331 7331 3 12.331060 -23.017979 -2.466212 # 3 -7332 7332 3 11.508989 -22.195910 -2.466212 # 3 -7333 7333 3 13.153131 -23.017979 -3.288283 # 3 -7334 7334 3 13.975202 -22.195910 -3.288283 # 3 -7335 7335 3 13.975202 -23.017979 -2.466212 # 3 -7336 7336 3 13.153131 -22.195910 -2.466212 # 3 -7337 7337 3 14.797273 -23.017979 -3.288283 # 3 -7338 7338 3 15.619343 -22.195910 -3.288283 # 3 -7339 7339 3 15.619343 -23.017979 -2.466212 # 3 -7340 7340 3 14.797273 -22.195910 -2.466212 # 3 -7341 7341 3 16.441414 -23.017979 -3.288283 # 3 -7342 7342 3 17.263485 -22.195910 -3.288283 # 3 -7343 7343 3 17.263485 -23.017979 -2.466212 # 3 -7344 7344 3 16.441414 -22.195910 -2.466212 # 3 -7345 7345 3 18.085556 -23.017979 -3.288283 # 3 -7346 7346 3 18.907625 -22.195910 -3.288283 # 3 -7347 7347 3 18.907625 -23.017979 -2.466212 # 3 -7348 7348 3 18.085556 -22.195910 -2.466212 # 3 -7349 7349 3 19.729696 -23.017979 -3.288283 # 3 -7350 7350 3 20.551767 -22.195910 -3.288283 # 3 -7351 7351 3 20.551767 -23.017979 -2.466212 # 3 -7352 7352 3 19.729696 -22.195910 -2.466212 # 3 -7353 7353 3 21.373838 -23.017979 -3.288283 # 3 -7354 7354 3 22.195910 -22.195910 -3.288283 # 3 -7355 7355 3 22.195910 -23.017979 -2.466212 # 3 -7356 7356 3 21.373838 -22.195910 -2.466212 # 3 -7357 7357 3 23.017979 -23.017979 -3.288283 # 3 -7358 7358 3 23.840050 -22.195910 -3.288283 # 3 -7359 7359 3 23.840050 -23.017979 -2.466212 # 3 -7360 7360 3 23.017979 -22.195910 -2.466212 # 3 -7361 7361 3 24.662121 -23.017979 -3.288283 # 3 -7362 7362 3 24.662121 -22.195910 -2.466212 # 3 -7363 7363 3 9.042778 -20.551767 -3.288283 # 3 -7364 7364 3 9.042778 -21.373838 -2.466212 # 3 -7365 7365 3 9.864848 -21.373838 -3.288283 # 3 -7366 7366 3 10.686919 -20.551767 -3.288283 # 3 -7367 7367 3 10.686919 -21.373838 -2.466212 # 3 -7368 7368 3 9.864848 -20.551767 -2.466212 # 3 -7369 7369 3 11.508989 -21.373838 -3.288283 # 3 -7370 7370 3 12.331060 -20.551767 -3.288283 # 3 -7371 7371 3 12.331060 -21.373838 -2.466212 # 3 -7372 7372 3 11.508989 -20.551767 -2.466212 # 3 -7373 7373 3 13.153131 -21.373838 -3.288283 # 3 -7374 7374 3 13.975202 -20.551767 -3.288283 # 3 -7375 7375 3 13.975202 -21.373838 -2.466212 # 3 -7376 7376 3 13.153131 -20.551767 -2.466212 # 3 -7377 7377 3 14.797273 -21.373838 -3.288283 # 3 -7378 7378 3 15.619343 -20.551767 -3.288283 # 3 -7379 7379 3 15.619343 -21.373838 -2.466212 # 3 -7380 7380 3 14.797273 -20.551767 -2.466212 # 3 -7381 7381 3 16.441414 -21.373838 -3.288283 # 3 -7382 7382 3 17.263485 -20.551767 -3.288283 # 3 -7383 7383 3 17.263485 -21.373838 -2.466212 # 3 -7384 7384 3 16.441414 -20.551767 -2.466212 # 3 -7385 7385 3 18.085556 -21.373838 -3.288283 # 3 -7386 7386 3 18.907625 -20.551767 -3.288283 # 3 -7387 7387 3 18.907625 -21.373838 -2.466212 # 3 -7388 7388 3 18.085556 -20.551767 -2.466212 # 3 -7389 7389 3 19.729696 -21.373838 -3.288283 # 3 -7390 7390 3 20.551767 -20.551767 -3.288283 # 3 -7391 7391 3 20.551767 -21.373838 -2.466212 # 3 -7392 7392 3 19.729696 -20.551767 -2.466212 # 3 -7393 7393 3 21.373838 -21.373838 -3.288283 # 3 -7394 7394 3 22.195910 -20.551767 -3.288283 # 3 -7395 7395 3 22.195910 -21.373838 -2.466212 # 3 -7396 7396 3 21.373838 -20.551767 -2.466212 # 3 -7397 7397 3 23.017979 -21.373838 -3.288283 # 3 -7398 7398 3 23.840050 -20.551767 -3.288283 # 3 -7399 7399 3 23.840050 -21.373838 -2.466212 # 3 -7400 7400 3 23.017979 -20.551767 -2.466212 # 3 -7401 7401 3 24.662121 -21.373838 -3.288283 # 3 -7402 7402 3 24.662121 -20.551767 -2.466212 # 3 -7403 7403 3 9.042778 -23.840050 -1.644141 # 3 -7404 7404 3 10.686919 -23.840050 -1.644141 # 3 -7405 7405 3 9.864848 -23.840050 -0.822071 # 3 -7406 7406 3 12.331060 -23.840050 -1.644141 # 3 -7407 7407 3 11.508989 -23.840050 -0.822071 # 3 -7408 7408 3 13.975202 -23.840050 -1.644141 # 3 -7409 7409 3 13.153131 -23.840050 -0.822071 # 3 -7410 7410 3 15.619343 -23.840050 -1.644141 # 3 -7411 7411 3 14.797273 -23.840050 -0.822071 # 3 -7412 7412 3 17.263485 -23.840050 -1.644141 # 3 -7413 7413 3 16.441414 -23.840050 -0.822071 # 3 -7414 7414 3 18.907625 -23.840050 -1.644141 # 3 -7415 7415 3 18.085556 -23.840050 -0.822071 # 3 -7416 7416 3 20.551767 -23.840050 -1.644141 # 3 -7417 7417 3 19.729696 -23.840050 -0.822071 # 3 -7418 7418 3 22.195910 -23.840050 -1.644141 # 3 -7419 7419 3 21.373838 -23.840050 -0.822071 # 3 -7420 7420 3 23.840050 -23.840050 -1.644141 # 3 -7421 7421 3 23.017979 -23.840050 -0.822071 # 3 -7422 7422 3 24.662121 -23.840050 -0.822071 # 3 -7423 7423 3 9.042778 -22.195910 -1.644141 # 3 -7424 7424 3 9.042778 -23.017979 -0.822071 # 3 -7425 7425 3 9.864848 -23.017979 -1.644141 # 3 -7426 7426 3 10.686919 -22.195910 -1.644141 # 3 -7427 7427 3 10.686919 -23.017979 -0.822071 # 3 -7428 7428 3 9.864848 -22.195910 -0.822071 # 3 -7429 7429 3 11.508989 -23.017979 -1.644141 # 3 -7430 7430 3 12.331060 -22.195910 -1.644141 # 3 -7431 7431 3 12.331060 -23.017979 -0.822071 # 3 -7432 7432 3 11.508989 -22.195910 -0.822071 # 3 -7433 7433 3 13.153131 -23.017979 -1.644141 # 3 -7434 7434 3 13.975202 -22.195910 -1.644141 # 3 -7435 7435 3 13.975202 -23.017979 -0.822071 # 3 -7436 7436 3 13.153131 -22.195910 -0.822071 # 3 -7437 7437 3 14.797273 -23.017979 -1.644141 # 3 -7438 7438 3 15.619343 -22.195910 -1.644141 # 3 -7439 7439 3 15.619343 -23.017979 -0.822071 # 3 -7440 7440 3 14.797273 -22.195910 -0.822071 # 3 -7441 7441 3 16.441414 -23.017979 -1.644141 # 3 -7442 7442 3 17.263485 -22.195910 -1.644141 # 3 -7443 7443 3 17.263485 -23.017979 -0.822071 # 3 -7444 7444 3 16.441414 -22.195910 -0.822071 # 3 -7445 7445 3 18.085556 -23.017979 -1.644141 # 3 -7446 7446 3 18.907625 -22.195910 -1.644141 # 3 -7447 7447 3 18.907625 -23.017979 -0.822071 # 3 -7448 7448 3 18.085556 -22.195910 -0.822071 # 3 -7449 7449 3 19.729696 -23.017979 -1.644141 # 3 -7450 7450 3 20.551767 -22.195910 -1.644141 # 3 -7451 7451 3 20.551767 -23.017979 -0.822071 # 3 -7452 7452 3 19.729696 -22.195910 -0.822071 # 3 -7453 7453 3 21.373838 -23.017979 -1.644141 # 3 -7454 7454 3 22.195910 -22.195910 -1.644141 # 3 -7455 7455 3 22.195910 -23.017979 -0.822071 # 3 -7456 7456 3 21.373838 -22.195910 -0.822071 # 3 -7457 7457 3 23.017979 -23.017979 -1.644141 # 3 -7458 7458 3 23.840050 -22.195910 -1.644141 # 3 -7459 7459 3 23.840050 -23.017979 -0.822071 # 3 -7460 7460 3 23.017979 -22.195910 -0.822071 # 3 -7461 7461 3 24.662121 -23.017979 -1.644141 # 3 -7462 7462 3 24.662121 -22.195910 -0.822071 # 3 -7463 7463 3 9.042778 -20.551767 -1.644141 # 3 -7464 7464 3 9.042778 -21.373838 -0.822071 # 3 -7465 7465 3 9.864848 -21.373838 -1.644141 # 3 -7466 7466 3 10.686919 -20.551767 -1.644141 # 3 -7467 7467 3 10.686919 -21.373838 -0.822071 # 3 -7468 7468 3 9.864848 -20.551767 -0.822071 # 3 -7469 7469 3 11.508989 -21.373838 -1.644141 # 3 -7470 7470 3 12.331060 -20.551767 -1.644141 # 3 -7471 7471 3 12.331060 -21.373838 -0.822071 # 3 -7472 7472 3 11.508989 -20.551767 -0.822071 # 3 -7473 7473 3 13.153131 -21.373838 -1.644141 # 3 -7474 7474 3 13.975202 -20.551767 -1.644141 # 3 -7475 7475 3 13.975202 -21.373838 -0.822071 # 3 -7476 7476 3 13.153131 -20.551767 -0.822071 # 3 -7477 7477 3 14.797273 -21.373838 -1.644141 # 3 -7478 7478 3 15.619343 -20.551767 -1.644141 # 3 -7479 7479 3 15.619343 -21.373838 -0.822071 # 3 -7480 7480 3 14.797273 -20.551767 -0.822071 # 3 -7481 7481 3 16.441414 -21.373838 -1.644141 # 3 -7482 7482 3 17.263485 -20.551767 -1.644141 # 3 -7483 7483 3 17.263485 -21.373838 -0.822071 # 3 -7484 7484 3 16.441414 -20.551767 -0.822071 # 3 -7485 7485 3 18.085556 -21.373838 -1.644141 # 3 -7486 7486 3 18.907625 -20.551767 -1.644141 # 3 -7487 7487 3 18.907625 -21.373838 -0.822071 # 3 -7488 7488 3 18.085556 -20.551767 -0.822071 # 3 -7489 7489 3 19.729696 -21.373838 -1.644141 # 3 -7490 7490 3 20.551767 -20.551767 -1.644141 # 3 -7491 7491 3 20.551767 -21.373838 -0.822071 # 3 -7492 7492 3 19.729696 -20.551767 -0.822071 # 3 -7493 7493 3 21.373838 -21.373838 -1.644141 # 3 -7494 7494 3 22.195910 -20.551767 -1.644141 # 3 -7495 7495 3 22.195910 -21.373838 -0.822071 # 3 -7496 7496 3 21.373838 -20.551767 -0.822071 # 3 -7497 7497 3 23.017979 -21.373838 -1.644141 # 3 -7498 7498 3 23.840050 -20.551767 -1.644141 # 3 -7499 7499 3 23.840050 -21.373838 -0.822071 # 3 -7500 7500 3 23.017979 -20.551767 -0.822071 # 3 -7501 7501 3 24.662121 -21.373838 -1.644141 # 3 -7502 7502 3 24.662121 -20.551767 -0.822071 # 3 -7503 7503 3 9.042778 -23.840050 0.000000 # 3 -7504 7504 3 10.686919 -23.840050 0.000000 # 3 -7505 7505 3 9.864848 -23.840050 0.822071 # 3 -7506 7506 3 12.331060 -23.840050 0.000000 # 3 -7507 7507 3 11.508989 -23.840050 0.822071 # 3 -7508 7508 3 13.975202 -23.840050 0.000000 # 3 -7509 7509 3 13.153131 -23.840050 0.822071 # 3 -7510 7510 3 15.619343 -23.840050 0.000000 # 3 -7511 7511 3 14.797273 -23.840050 0.822071 # 3 -7512 7512 3 17.263485 -23.840050 0.000000 # 3 -7513 7513 3 16.441414 -23.840050 0.822071 # 3 -7514 7514 3 18.907625 -23.840050 0.000000 # 3 -7515 7515 3 18.085556 -23.840050 0.822071 # 3 -7516 7516 3 20.551767 -23.840050 0.000000 # 3 -7517 7517 3 19.729696 -23.840050 0.822071 # 3 -7518 7518 3 22.195910 -23.840050 0.000000 # 3 -7519 7519 3 21.373838 -23.840050 0.822071 # 3 -7520 7520 3 23.840050 -23.840050 0.000000 # 3 -7521 7521 3 23.017979 -23.840050 0.822071 # 3 -7522 7522 3 24.662121 -23.840050 0.822071 # 3 -7523 7523 3 9.042778 -22.195910 0.000000 # 3 -7524 7524 3 9.042778 -23.017979 0.822071 # 3 -7525 7525 3 9.864848 -23.017979 0.000000 # 3 -7526 7526 3 10.686919 -22.195910 0.000000 # 3 -7527 7527 3 10.686919 -23.017979 0.822071 # 3 -7528 7528 3 9.864848 -22.195910 0.822071 # 3 -7529 7529 3 11.508989 -23.017979 0.000000 # 3 -7530 7530 3 12.331060 -22.195910 0.000000 # 3 -7531 7531 3 12.331060 -23.017979 0.822071 # 3 -7532 7532 3 11.508989 -22.195910 0.822071 # 3 -7533 7533 3 13.153131 -23.017979 0.000000 # 3 -7534 7534 3 13.975202 -22.195910 0.000000 # 3 -7535 7535 3 13.975202 -23.017979 0.822071 # 3 -7536 7536 3 13.153131 -22.195910 0.822071 # 3 -7537 7537 3 14.797273 -23.017979 0.000000 # 3 -7538 7538 3 15.619343 -22.195910 0.000000 # 3 -7539 7539 3 15.619343 -23.017979 0.822071 # 3 -7540 7540 3 14.797273 -22.195910 0.822071 # 3 -7541 7541 3 16.441414 -23.017979 0.000000 # 3 -7542 7542 3 17.263485 -22.195910 0.000000 # 3 -7543 7543 3 17.263485 -23.017979 0.822071 # 3 -7544 7544 3 16.441414 -22.195910 0.822071 # 3 -7545 7545 3 18.085556 -23.017979 0.000000 # 3 -7546 7546 3 18.907625 -22.195910 0.000000 # 3 -7547 7547 3 18.907625 -23.017979 0.822071 # 3 -7548 7548 3 18.085556 -22.195910 0.822071 # 3 -7549 7549 3 19.729696 -23.017979 0.000000 # 3 -7550 7550 3 20.551767 -22.195910 0.000000 # 3 -7551 7551 3 20.551767 -23.017979 0.822071 # 3 -7552 7552 3 19.729696 -22.195910 0.822071 # 3 -7553 7553 3 21.373838 -23.017979 0.000000 # 3 -7554 7554 3 22.195910 -22.195910 0.000000 # 3 -7555 7555 3 22.195910 -23.017979 0.822071 # 3 -7556 7556 3 21.373838 -22.195910 0.822071 # 3 -7557 7557 3 23.017979 -23.017979 0.000000 # 3 -7558 7558 3 23.840050 -22.195910 0.000000 # 3 -7559 7559 3 23.840050 -23.017979 0.822071 # 3 -7560 7560 3 23.017979 -22.195910 0.822071 # 3 -7561 7561 3 24.662121 -23.017979 0.000000 # 3 -7562 7562 3 24.662121 -22.195910 0.822071 # 3 -7563 7563 3 9.042778 -20.551767 0.000000 # 3 -7564 7564 3 9.042778 -21.373838 0.822071 # 3 -7565 7565 3 9.864848 -21.373838 0.000000 # 3 -7566 7566 3 10.686919 -20.551767 0.000000 # 3 -7567 7567 3 10.686919 -21.373838 0.822071 # 3 -7568 7568 3 9.864848 -20.551767 0.822071 # 3 -7569 7569 3 11.508989 -21.373838 0.000000 # 3 -7570 7570 3 12.331060 -20.551767 0.000000 # 3 -7571 7571 3 12.331060 -21.373838 0.822071 # 3 -7572 7572 3 11.508989 -20.551767 0.822071 # 3 -7573 7573 3 13.153131 -21.373838 0.000000 # 3 -7574 7574 3 13.975202 -20.551767 0.000000 # 3 -7575 7575 3 13.975202 -21.373838 0.822071 # 3 -7576 7576 3 13.153131 -20.551767 0.822071 # 3 -7577 7577 3 14.797273 -21.373838 0.000000 # 3 -7578 7578 3 15.619343 -20.551767 0.000000 # 3 -7579 7579 3 15.619343 -21.373838 0.822071 # 3 -7580 7580 3 14.797273 -20.551767 0.822071 # 3 -7581 7581 3 16.441414 -21.373838 0.000000 # 3 -7582 7582 3 17.263485 -20.551767 0.000000 # 3 -7583 7583 3 17.263485 -21.373838 0.822071 # 3 -7584 7584 3 16.441414 -20.551767 0.822071 # 3 -7585 7585 3 18.085556 -21.373838 0.000000 # 3 -7586 7586 3 18.907625 -20.551767 0.000000 # 3 -7587 7587 3 18.907625 -21.373838 0.822071 # 3 -7588 7588 3 18.085556 -20.551767 0.822071 # 3 -7589 7589 3 19.729696 -21.373838 0.000000 # 3 -7590 7590 3 20.551767 -20.551767 0.000000 # 3 -7591 7591 3 20.551767 -21.373838 0.822071 # 3 -7592 7592 3 19.729696 -20.551767 0.822071 # 3 -7593 7593 3 21.373838 -21.373838 0.000000 # 3 -7594 7594 3 22.195910 -20.551767 0.000000 # 3 -7595 7595 3 22.195910 -21.373838 0.822071 # 3 -7596 7596 3 21.373838 -20.551767 0.822071 # 3 -7597 7597 3 23.017979 -21.373838 0.000000 # 3 -7598 7598 3 23.840050 -20.551767 0.000000 # 3 -7599 7599 3 23.840050 -21.373838 0.822071 # 3 -7600 7600 3 23.017979 -20.551767 0.822071 # 3 -7601 7601 3 24.662121 -21.373838 0.000000 # 3 -7602 7602 3 24.662121 -20.551767 0.822071 # 3 -7603 7603 3 9.042778 -23.840050 1.644141 # 3 -7604 7604 3 10.686919 -23.840050 1.644141 # 3 -7605 7605 3 9.864848 -23.840050 2.466212 # 3 -7606 7606 3 12.331060 -23.840050 1.644141 # 3 -7607 7607 3 11.508989 -23.840050 2.466212 # 3 -7608 7608 3 13.975202 -23.840050 1.644141 # 3 -7609 7609 3 13.153131 -23.840050 2.466212 # 3 -7610 7610 3 15.619343 -23.840050 1.644141 # 3 -7611 7611 3 14.797273 -23.840050 2.466212 # 3 -7612 7612 3 17.263485 -23.840050 1.644141 # 3 -7613 7613 3 16.441414 -23.840050 2.466212 # 3 -7614 7614 3 18.907625 -23.840050 1.644141 # 3 -7615 7615 3 18.085556 -23.840050 2.466212 # 3 -7616 7616 3 20.551767 -23.840050 1.644141 # 3 -7617 7617 3 19.729696 -23.840050 2.466212 # 3 -7618 7618 3 22.195910 -23.840050 1.644141 # 3 -7619 7619 3 21.373838 -23.840050 2.466212 # 3 -7620 7620 3 23.840050 -23.840050 1.644141 # 3 -7621 7621 3 23.017979 -23.840050 2.466212 # 3 -7622 7622 3 24.662121 -23.840050 2.466212 # 3 -7623 7623 3 9.042778 -22.195910 1.644141 # 3 -7624 7624 3 9.042778 -23.017979 2.466212 # 3 -7625 7625 3 9.864848 -23.017979 1.644141 # 3 -7626 7626 3 10.686919 -22.195910 1.644141 # 3 -7627 7627 3 10.686919 -23.017979 2.466212 # 3 -7628 7628 3 9.864848 -22.195910 2.466212 # 3 -7629 7629 3 11.508989 -23.017979 1.644141 # 3 -7630 7630 3 12.331060 -22.195910 1.644141 # 3 -7631 7631 3 12.331060 -23.017979 2.466212 # 3 -7632 7632 3 11.508989 -22.195910 2.466212 # 3 -7633 7633 3 13.153131 -23.017979 1.644141 # 3 -7634 7634 3 13.975202 -22.195910 1.644141 # 3 -7635 7635 3 13.975202 -23.017979 2.466212 # 3 -7636 7636 3 13.153131 -22.195910 2.466212 # 3 -7637 7637 3 14.797273 -23.017979 1.644141 # 3 -7638 7638 3 15.619343 -22.195910 1.644141 # 3 -7639 7639 3 15.619343 -23.017979 2.466212 # 3 -7640 7640 3 14.797273 -22.195910 2.466212 # 3 -7641 7641 3 16.441414 -23.017979 1.644141 # 3 -7642 7642 3 17.263485 -22.195910 1.644141 # 3 -7643 7643 3 17.263485 -23.017979 2.466212 # 3 -7644 7644 3 16.441414 -22.195910 2.466212 # 3 -7645 7645 3 18.085556 -23.017979 1.644141 # 3 -7646 7646 3 18.907625 -22.195910 1.644141 # 3 -7647 7647 3 18.907625 -23.017979 2.466212 # 3 -7648 7648 3 18.085556 -22.195910 2.466212 # 3 -7649 7649 3 19.729696 -23.017979 1.644141 # 3 -7650 7650 3 20.551767 -22.195910 1.644141 # 3 -7651 7651 3 20.551767 -23.017979 2.466212 # 3 -7652 7652 3 19.729696 -22.195910 2.466212 # 3 -7653 7653 3 21.373838 -23.017979 1.644141 # 3 -7654 7654 3 22.195910 -22.195910 1.644141 # 3 -7655 7655 3 22.195910 -23.017979 2.466212 # 3 -7656 7656 3 21.373838 -22.195910 2.466212 # 3 -7657 7657 3 23.017979 -23.017979 1.644141 # 3 -7658 7658 3 23.840050 -22.195910 1.644141 # 3 -7659 7659 3 23.840050 -23.017979 2.466212 # 3 -7660 7660 3 23.017979 -22.195910 2.466212 # 3 -7661 7661 3 24.662121 -23.017979 1.644141 # 3 -7662 7662 3 24.662121 -22.195910 2.466212 # 3 -7663 7663 3 9.042778 -20.551767 1.644141 # 3 -7664 7664 3 9.042778 -21.373838 2.466212 # 3 -7665 7665 3 9.864848 -21.373838 1.644141 # 3 -7666 7666 3 10.686919 -20.551767 1.644141 # 3 -7667 7667 3 10.686919 -21.373838 2.466212 # 3 -7668 7668 3 9.864848 -20.551767 2.466212 # 3 -7669 7669 3 11.508989 -21.373838 1.644141 # 3 -7670 7670 3 12.331060 -20.551767 1.644141 # 3 -7671 7671 3 12.331060 -21.373838 2.466212 # 3 -7672 7672 3 11.508989 -20.551767 2.466212 # 3 -7673 7673 3 13.153131 -21.373838 1.644141 # 3 -7674 7674 3 13.975202 -20.551767 1.644141 # 3 -7675 7675 3 13.975202 -21.373838 2.466212 # 3 -7676 7676 3 13.153131 -20.551767 2.466212 # 3 -7677 7677 3 14.797273 -21.373838 1.644141 # 3 -7678 7678 3 15.619343 -20.551767 1.644141 # 3 -7679 7679 3 15.619343 -21.373838 2.466212 # 3 -7680 7680 3 14.797273 -20.551767 2.466212 # 3 -7681 7681 3 16.441414 -21.373838 1.644141 # 3 -7682 7682 3 17.263485 -20.551767 1.644141 # 3 -7683 7683 3 17.263485 -21.373838 2.466212 # 3 -7684 7684 3 16.441414 -20.551767 2.466212 # 3 -7685 7685 3 18.085556 -21.373838 1.644141 # 3 -7686 7686 3 18.907625 -20.551767 1.644141 # 3 -7687 7687 3 18.907625 -21.373838 2.466212 # 3 -7688 7688 3 18.085556 -20.551767 2.466212 # 3 -7689 7689 3 19.729696 -21.373838 1.644141 # 3 -7690 7690 3 20.551767 -20.551767 1.644141 # 3 -7691 7691 3 20.551767 -21.373838 2.466212 # 3 -7692 7692 3 19.729696 -20.551767 2.466212 # 3 -7693 7693 3 21.373838 -21.373838 1.644141 # 3 -7694 7694 3 22.195910 -20.551767 1.644141 # 3 -7695 7695 3 22.195910 -21.373838 2.466212 # 3 -7696 7696 3 21.373838 -20.551767 2.466212 # 3 -7697 7697 3 23.017979 -21.373838 1.644141 # 3 -7698 7698 3 23.840050 -20.551767 1.644141 # 3 -7699 7699 3 23.840050 -21.373838 2.466212 # 3 -7700 7700 3 23.017979 -20.551767 2.466212 # 3 -7701 7701 3 24.662121 -21.373838 1.644141 # 3 -7702 7702 3 24.662121 -20.551767 2.466212 # 3 -7703 7703 3 9.042778 -23.840050 3.288283 # 3 -7704 7704 3 10.686919 -23.840050 3.288283 # 3 -7705 7705 3 9.864848 -23.840050 4.110353 # 3 -7706 7706 3 12.331060 -23.840050 3.288283 # 3 -7707 7707 3 11.508989 -23.840050 4.110353 # 3 -7708 7708 3 13.975202 -23.840050 3.288283 # 3 -7709 7709 3 13.153131 -23.840050 4.110353 # 3 -7710 7710 3 15.619343 -23.840050 3.288283 # 3 -7711 7711 3 14.797273 -23.840050 4.110353 # 3 -7712 7712 3 17.263485 -23.840050 3.288283 # 3 -7713 7713 3 16.441414 -23.840050 4.110353 # 3 -7714 7714 3 18.907625 -23.840050 3.288283 # 3 -7715 7715 3 18.085556 -23.840050 4.110353 # 3 -7716 7716 3 20.551767 -23.840050 3.288283 # 3 -7717 7717 3 19.729696 -23.840050 4.110353 # 3 -7718 7718 3 22.195910 -23.840050 3.288283 # 3 -7719 7719 3 21.373838 -23.840050 4.110353 # 3 -7720 7720 3 23.840050 -23.840050 3.288283 # 3 -7721 7721 3 23.017979 -23.840050 4.110353 # 3 -7722 7722 3 24.662121 -23.840050 4.110353 # 3 -7723 7723 3 9.042778 -22.195910 3.288283 # 3 -7724 7724 3 9.042778 -23.017979 4.110353 # 3 -7725 7725 3 9.864848 -23.017979 3.288283 # 3 -7726 7726 3 10.686919 -22.195910 3.288283 # 3 -7727 7727 3 10.686919 -23.017979 4.110353 # 3 -7728 7728 3 9.864848 -22.195910 4.110353 # 3 -7729 7729 3 11.508989 -23.017979 3.288283 # 3 -7730 7730 3 12.331060 -22.195910 3.288283 # 3 -7731 7731 3 12.331060 -23.017979 4.110353 # 3 -7732 7732 3 11.508989 -22.195910 4.110353 # 3 -7733 7733 3 13.153131 -23.017979 3.288283 # 3 -7734 7734 3 13.975202 -22.195910 3.288283 # 3 -7735 7735 3 13.975202 -23.017979 4.110353 # 3 -7736 7736 3 13.153131 -22.195910 4.110353 # 3 -7737 7737 3 14.797273 -23.017979 3.288283 # 3 -7738 7738 3 15.619343 -22.195910 3.288283 # 3 -7739 7739 3 15.619343 -23.017979 4.110353 # 3 -7740 7740 3 14.797273 -22.195910 4.110353 # 3 -7741 7741 3 16.441414 -23.017979 3.288283 # 3 -7742 7742 3 17.263485 -22.195910 3.288283 # 3 -7743 7743 3 17.263485 -23.017979 4.110353 # 3 -7744 7744 3 16.441414 -22.195910 4.110353 # 3 -7745 7745 3 18.085556 -23.017979 3.288283 # 3 -7746 7746 3 18.907625 -22.195910 3.288283 # 3 -7747 7747 3 18.907625 -23.017979 4.110353 # 3 -7748 7748 3 18.085556 -22.195910 4.110353 # 3 -7749 7749 3 19.729696 -23.017979 3.288283 # 3 -7750 7750 3 20.551767 -22.195910 3.288283 # 3 -7751 7751 3 20.551767 -23.017979 4.110353 # 3 -7752 7752 3 19.729696 -22.195910 4.110353 # 3 -7753 7753 3 21.373838 -23.017979 3.288283 # 3 -7754 7754 3 22.195910 -22.195910 3.288283 # 3 -7755 7755 3 22.195910 -23.017979 4.110353 # 3 -7756 7756 3 21.373838 -22.195910 4.110353 # 3 -7757 7757 3 23.017979 -23.017979 3.288283 # 3 -7758 7758 3 23.840050 -22.195910 3.288283 # 3 -7759 7759 3 23.840050 -23.017979 4.110353 # 3 -7760 7760 3 23.017979 -22.195910 4.110353 # 3 -7761 7761 3 24.662121 -23.017979 3.288283 # 3 -7762 7762 3 24.662121 -22.195910 4.110353 # 3 -7763 7763 3 9.042778 -20.551767 3.288283 # 3 -7764 7764 3 9.042778 -21.373838 4.110353 # 3 -7765 7765 3 9.864848 -21.373838 3.288283 # 3 -7766 7766 3 10.686919 -20.551767 3.288283 # 3 -7767 7767 3 10.686919 -21.373838 4.110353 # 3 -7768 7768 3 9.864848 -20.551767 4.110353 # 3 -7769 7769 3 11.508989 -21.373838 3.288283 # 3 -7770 7770 3 12.331060 -20.551767 3.288283 # 3 -7771 7771 3 12.331060 -21.373838 4.110353 # 3 -7772 7772 3 11.508989 -20.551767 4.110353 # 3 -7773 7773 3 13.153131 -21.373838 3.288283 # 3 -7774 7774 3 13.975202 -20.551767 3.288283 # 3 -7775 7775 3 13.975202 -21.373838 4.110353 # 3 -7776 7776 3 13.153131 -20.551767 4.110353 # 3 -7777 7777 3 14.797273 -21.373838 3.288283 # 3 -7778 7778 3 15.619343 -20.551767 3.288283 # 3 -7779 7779 3 15.619343 -21.373838 4.110353 # 3 -7780 7780 3 14.797273 -20.551767 4.110353 # 3 -7781 7781 3 16.441414 -21.373838 3.288283 # 3 -7782 7782 3 17.263485 -20.551767 3.288283 # 3 -7783 7783 3 17.263485 -21.373838 4.110353 # 3 -7784 7784 3 16.441414 -20.551767 4.110353 # 3 -7785 7785 3 18.085556 -21.373838 3.288283 # 3 -7786 7786 3 18.907625 -20.551767 3.288283 # 3 -7787 7787 3 18.907625 -21.373838 4.110353 # 3 -7788 7788 3 18.085556 -20.551767 4.110353 # 3 -7789 7789 3 19.729696 -21.373838 3.288283 # 3 -7790 7790 3 20.551767 -20.551767 3.288283 # 3 -7791 7791 3 20.551767 -21.373838 4.110353 # 3 -7792 7792 3 19.729696 -20.551767 4.110353 # 3 -7793 7793 3 21.373838 -21.373838 3.288283 # 3 -7794 7794 3 22.195910 -20.551767 3.288283 # 3 -7795 7795 3 22.195910 -21.373838 4.110353 # 3 -7796 7796 3 21.373838 -20.551767 4.110353 # 3 -7797 7797 3 23.017979 -21.373838 3.288283 # 3 -7798 7798 3 23.840050 -20.551767 3.288283 # 3 -7799 7799 3 23.840050 -21.373838 4.110353 # 3 -7800 7800 3 23.017979 -20.551767 4.110353 # 3 -7801 7801 3 24.662121 -21.373838 3.288283 # 3 -7802 7802 3 24.662121 -20.551767 4.110353 # 3 -7803 7803 3 9.042778 -23.840050 4.932424 # 3 -7804 7804 3 10.686919 -23.840050 4.932424 # 3 -7805 7805 3 9.864848 -23.840050 5.754495 # 3 -7806 7806 3 12.331060 -23.840050 4.932424 # 3 -7807 7807 3 11.508989 -23.840050 5.754495 # 3 -7808 7808 3 13.975202 -23.840050 4.932424 # 3 -7809 7809 3 13.153131 -23.840050 5.754495 # 3 -7810 7810 3 15.619343 -23.840050 4.932424 # 3 -7811 7811 3 14.797273 -23.840050 5.754495 # 3 -7812 7812 3 17.263485 -23.840050 4.932424 # 3 -7813 7813 3 16.441414 -23.840050 5.754495 # 3 -7814 7814 3 18.907625 -23.840050 4.932424 # 3 -7815 7815 3 18.085556 -23.840050 5.754495 # 3 -7816 7816 3 20.551767 -23.840050 4.932424 # 3 -7817 7817 3 19.729696 -23.840050 5.754495 # 3 -7818 7818 3 22.195910 -23.840050 4.932424 # 3 -7819 7819 3 21.373838 -23.840050 5.754495 # 3 -7820 7820 3 23.840050 -23.840050 4.932424 # 3 -7821 7821 3 23.017979 -23.840050 5.754495 # 3 -7822 7822 3 24.662121 -23.840050 5.754495 # 3 -7823 7823 3 9.042778 -22.195910 4.932424 # 3 -7824 7824 3 9.042778 -23.017979 5.754495 # 3 -7825 7825 3 9.864848 -23.017979 4.932424 # 3 -7826 7826 3 10.686919 -22.195910 4.932424 # 3 -7827 7827 3 10.686919 -23.017979 5.754495 # 3 -7828 7828 3 9.864848 -22.195910 5.754495 # 3 -7829 7829 3 11.508989 -23.017979 4.932424 # 3 -7830 7830 3 12.331060 -22.195910 4.932424 # 3 -7831 7831 3 12.331060 -23.017979 5.754495 # 3 -7832 7832 3 11.508989 -22.195910 5.754495 # 3 -7833 7833 3 13.153131 -23.017979 4.932424 # 3 -7834 7834 3 13.975202 -22.195910 4.932424 # 3 -7835 7835 3 13.975202 -23.017979 5.754495 # 3 -7836 7836 3 13.153131 -22.195910 5.754495 # 3 -7837 7837 3 14.797273 -23.017979 4.932424 # 3 -7838 7838 3 15.619343 -22.195910 4.932424 # 3 -7839 7839 3 15.619343 -23.017979 5.754495 # 3 -7840 7840 3 14.797273 -22.195910 5.754495 # 3 -7841 7841 3 16.441414 -23.017979 4.932424 # 3 -7842 7842 3 17.263485 -22.195910 4.932424 # 3 -7843 7843 3 17.263485 -23.017979 5.754495 # 3 -7844 7844 3 16.441414 -22.195910 5.754495 # 3 -7845 7845 3 18.085556 -23.017979 4.932424 # 3 -7846 7846 3 18.907625 -22.195910 4.932424 # 3 -7847 7847 3 18.907625 -23.017979 5.754495 # 3 -7848 7848 3 18.085556 -22.195910 5.754495 # 3 -7849 7849 3 19.729696 -23.017979 4.932424 # 3 -7850 7850 3 20.551767 -22.195910 4.932424 # 3 -7851 7851 3 20.551767 -23.017979 5.754495 # 3 -7852 7852 3 19.729696 -22.195910 5.754495 # 3 -7853 7853 3 21.373838 -23.017979 4.932424 # 3 -7854 7854 3 22.195910 -22.195910 4.932424 # 3 -7855 7855 3 22.195910 -23.017979 5.754495 # 3 -7856 7856 3 21.373838 -22.195910 5.754495 # 3 -7857 7857 3 23.017979 -23.017979 4.932424 # 3 -7858 7858 3 23.840050 -22.195910 4.932424 # 3 -7859 7859 3 23.840050 -23.017979 5.754495 # 3 -7860 7860 3 23.017979 -22.195910 5.754495 # 3 -7861 7861 3 24.662121 -23.017979 4.932424 # 3 -7862 7862 3 24.662121 -22.195910 5.754495 # 3 -7863 7863 3 9.042778 -20.551767 4.932424 # 3 -7864 7864 3 9.042778 -21.373838 5.754495 # 3 -7865 7865 3 9.864848 -21.373838 4.932424 # 3 -7866 7866 3 10.686919 -20.551767 4.932424 # 3 -7867 7867 3 10.686919 -21.373838 5.754495 # 3 -7868 7868 3 9.864848 -20.551767 5.754495 # 3 -7869 7869 3 11.508989 -21.373838 4.932424 # 3 -7870 7870 3 12.331060 -20.551767 4.932424 # 3 -7871 7871 3 12.331060 -21.373838 5.754495 # 3 -7872 7872 3 11.508989 -20.551767 5.754495 # 3 -7873 7873 3 13.153131 -21.373838 4.932424 # 3 -7874 7874 3 13.975202 -20.551767 4.932424 # 3 -7875 7875 3 13.975202 -21.373838 5.754495 # 3 -7876 7876 3 13.153131 -20.551767 5.754495 # 3 -7877 7877 3 14.797273 -21.373838 4.932424 # 3 -7878 7878 3 15.619343 -20.551767 4.932424 # 3 -7879 7879 3 15.619343 -21.373838 5.754495 # 3 -7880 7880 3 14.797273 -20.551767 5.754495 # 3 -7881 7881 3 16.441414 -21.373838 4.932424 # 3 -7882 7882 3 17.263485 -20.551767 4.932424 # 3 -7883 7883 3 17.263485 -21.373838 5.754495 # 3 -7884 7884 3 16.441414 -20.551767 5.754495 # 3 -7885 7885 3 18.085556 -21.373838 4.932424 # 3 -7886 7886 3 18.907625 -20.551767 4.932424 # 3 -7887 7887 3 18.907625 -21.373838 5.754495 # 3 -7888 7888 3 18.085556 -20.551767 5.754495 # 3 -7889 7889 3 19.729696 -21.373838 4.932424 # 3 -7890 7890 3 20.551767 -20.551767 4.932424 # 3 -7891 7891 3 20.551767 -21.373838 5.754495 # 3 -7892 7892 3 19.729696 -20.551767 5.754495 # 3 -7893 7893 3 21.373838 -21.373838 4.932424 # 3 -7894 7894 3 22.195910 -20.551767 4.932424 # 3 -7895 7895 3 22.195910 -21.373838 5.754495 # 3 -7896 7896 3 21.373838 -20.551767 5.754495 # 3 -7897 7897 3 23.017979 -21.373838 4.932424 # 3 -7898 7898 3 23.840050 -20.551767 4.932424 # 3 -7899 7899 3 23.840050 -21.373838 5.754495 # 3 -7900 7900 3 23.017979 -20.551767 5.754495 # 3 -7901 7901 3 24.662121 -21.373838 4.932424 # 3 -7902 7902 3 24.662121 -20.551767 5.754495 # 3 -7903 7903 3 9.042778 -23.840050 6.576566 # 3 -7904 7904 3 10.686919 -23.840050 6.576566 # 3 -7905 7905 3 9.864848 -23.840050 7.398636 # 3 -7906 7906 3 12.331060 -23.840050 6.576566 # 3 -7907 7907 3 11.508989 -23.840050 7.398636 # 3 -7908 7908 3 13.975202 -23.840050 6.576566 # 3 -7909 7909 3 13.153131 -23.840050 7.398636 # 3 -7910 7910 3 15.619343 -23.840050 6.576566 # 3 -7911 7911 3 14.797273 -23.840050 7.398636 # 3 -7912 7912 3 17.263485 -23.840050 6.576566 # 3 -7913 7913 3 16.441414 -23.840050 7.398636 # 3 -7914 7914 3 18.907625 -23.840050 6.576566 # 3 -7915 7915 3 18.085556 -23.840050 7.398636 # 3 -7916 7916 3 20.551767 -23.840050 6.576566 # 3 -7917 7917 3 19.729696 -23.840050 7.398636 # 3 -7918 7918 3 22.195910 -23.840050 6.576566 # 3 -7919 7919 3 21.373838 -23.840050 7.398636 # 3 -7920 7920 3 23.840050 -23.840050 6.576566 # 3 -7921 7921 3 23.017979 -23.840050 7.398636 # 3 -7922 7922 3 24.662121 -23.840050 7.398636 # 3 -7923 7923 3 9.042778 -22.195910 6.576566 # 3 -7924 7924 3 9.042778 -23.017979 7.398636 # 3 -7925 7925 3 9.864848 -23.017979 6.576566 # 3 -7926 7926 3 10.686919 -22.195910 6.576566 # 3 -7927 7927 3 10.686919 -23.017979 7.398636 # 3 -7928 7928 3 9.864848 -22.195910 7.398636 # 3 -7929 7929 3 11.508989 -23.017979 6.576566 # 3 -7930 7930 3 12.331060 -22.195910 6.576566 # 3 -7931 7931 3 12.331060 -23.017979 7.398636 # 3 -7932 7932 3 11.508989 -22.195910 7.398636 # 3 -7933 7933 3 13.153131 -23.017979 6.576566 # 3 -7934 7934 3 13.975202 -22.195910 6.576566 # 3 -7935 7935 3 13.975202 -23.017979 7.398636 # 3 -7936 7936 3 13.153131 -22.195910 7.398636 # 3 -7937 7937 3 14.797273 -23.017979 6.576566 # 3 -7938 7938 3 15.619343 -22.195910 6.576566 # 3 -7939 7939 3 15.619343 -23.017979 7.398636 # 3 -7940 7940 3 14.797273 -22.195910 7.398636 # 3 -7941 7941 3 16.441414 -23.017979 6.576566 # 3 -7942 7942 3 17.263485 -22.195910 6.576566 # 3 -7943 7943 3 17.263485 -23.017979 7.398636 # 3 -7944 7944 3 16.441414 -22.195910 7.398636 # 3 -7945 7945 3 18.085556 -23.017979 6.576566 # 3 -7946 7946 3 18.907625 -22.195910 6.576566 # 3 -7947 7947 3 18.907625 -23.017979 7.398636 # 3 -7948 7948 3 18.085556 -22.195910 7.398636 # 3 -7949 7949 3 19.729696 -23.017979 6.576566 # 3 -7950 7950 3 20.551767 -22.195910 6.576566 # 3 -7951 7951 3 20.551767 -23.017979 7.398636 # 3 -7952 7952 3 19.729696 -22.195910 7.398636 # 3 -7953 7953 3 21.373838 -23.017979 6.576566 # 3 -7954 7954 3 22.195910 -22.195910 6.576566 # 3 -7955 7955 3 22.195910 -23.017979 7.398636 # 3 -7956 7956 3 21.373838 -22.195910 7.398636 # 3 -7957 7957 3 23.017979 -23.017979 6.576566 # 3 -7958 7958 3 23.840050 -22.195910 6.576566 # 3 -7959 7959 3 23.840050 -23.017979 7.398636 # 3 -7960 7960 3 23.017979 -22.195910 7.398636 # 3 -7961 7961 3 24.662121 -23.017979 6.576566 # 3 -7962 7962 3 24.662121 -22.195910 7.398636 # 3 -7963 7963 3 9.042778 -20.551767 6.576566 # 3 -7964 7964 3 9.042778 -21.373838 7.398636 # 3 -7965 7965 3 9.864848 -21.373838 6.576566 # 3 -7966 7966 3 10.686919 -20.551767 6.576566 # 3 -7967 7967 3 10.686919 -21.373838 7.398636 # 3 -7968 7968 3 9.864848 -20.551767 7.398636 # 3 -7969 7969 3 11.508989 -21.373838 6.576566 # 3 -7970 7970 3 12.331060 -20.551767 6.576566 # 3 -7971 7971 3 12.331060 -21.373838 7.398636 # 3 -7972 7972 3 11.508989 -20.551767 7.398636 # 3 -7973 7973 3 13.153131 -21.373838 6.576566 # 3 -7974 7974 3 13.975202 -20.551767 6.576566 # 3 -7975 7975 3 13.975202 -21.373838 7.398636 # 3 -7976 7976 3 13.153131 -20.551767 7.398636 # 3 -7977 7977 3 14.797273 -21.373838 6.576566 # 3 -7978 7978 3 15.619343 -20.551767 6.576566 # 3 -7979 7979 3 15.619343 -21.373838 7.398636 # 3 -7980 7980 3 14.797273 -20.551767 7.398636 # 3 -7981 7981 3 16.441414 -21.373838 6.576566 # 3 -7982 7982 3 17.263485 -20.551767 6.576566 # 3 -7983 7983 3 17.263485 -21.373838 7.398636 # 3 -7984 7984 3 16.441414 -20.551767 7.398636 # 3 -7985 7985 3 18.085556 -21.373838 6.576566 # 3 -7986 7986 3 18.907625 -20.551767 6.576566 # 3 -7987 7987 3 18.907625 -21.373838 7.398636 # 3 -7988 7988 3 18.085556 -20.551767 7.398636 # 3 -7989 7989 3 19.729696 -21.373838 6.576566 # 3 -7990 7990 3 20.551767 -20.551767 6.576566 # 3 -7991 7991 3 20.551767 -21.373838 7.398636 # 3 -7992 7992 3 19.729696 -20.551767 7.398636 # 3 -7993 7993 3 21.373838 -21.373838 6.576566 # 3 -7994 7994 3 22.195910 -20.551767 6.576566 # 3 -7995 7995 3 22.195910 -21.373838 7.398636 # 3 -7996 7996 3 21.373838 -20.551767 7.398636 # 3 -7997 7997 3 23.017979 -21.373838 6.576566 # 3 -7998 7998 3 23.840050 -20.551767 6.576566 # 3 -7999 7999 3 23.840050 -21.373838 7.398636 # 3 -8000 8000 3 23.017979 -20.551767 7.398636 # 3 -8001 8001 3 24.662121 -21.373838 6.576566 # 3 -8002 8002 3 24.662121 -20.551767 7.398636 # 3 -8003 8003 3 9.042778 -23.840050 8.220707 # 3 -8004 8004 3 10.686919 -23.840050 8.220707 # 3 -8005 8005 3 12.331060 -23.840050 8.220707 # 3 -8006 8006 3 13.975202 -23.840050 8.220707 # 3 -8007 8007 3 15.619343 -23.840050 8.220707 # 3 -8008 8008 3 17.263485 -23.840050 8.220707 # 3 -8009 8009 3 18.907625 -23.840050 8.220707 # 3 -8010 8010 3 20.551767 -23.840050 8.220707 # 3 -8011 8011 3 22.195910 -23.840050 8.220707 # 3 -8012 8012 3 23.840050 -23.840050 8.220707 # 3 -8013 8013 3 9.042778 -22.195910 8.220707 # 3 -8014 8014 3 9.864848 -23.017979 8.220707 # 3 -8015 8015 3 10.686919 -22.195910 8.220707 # 3 -8016 8016 3 11.508989 -23.017979 8.220707 # 3 -8017 8017 3 12.331060 -22.195910 8.220707 # 3 -8018 8018 3 13.153131 -23.017979 8.220707 # 3 -8019 8019 3 13.975202 -22.195910 8.220707 # 3 -8020 8020 3 14.797273 -23.017979 8.220707 # 3 -8021 8021 3 15.619343 -22.195910 8.220707 # 3 -8022 8022 3 16.441414 -23.017979 8.220707 # 3 -8023 8023 3 17.263485 -22.195910 8.220707 # 3 -8024 8024 3 18.085556 -23.017979 8.220707 # 3 -8025 8025 3 18.907625 -22.195910 8.220707 # 3 -8026 8026 3 19.729696 -23.017979 8.220707 # 3 -8027 8027 3 20.551767 -22.195910 8.220707 # 3 -8028 8028 3 21.373838 -23.017979 8.220707 # 3 -8029 8029 3 22.195910 -22.195910 8.220707 # 3 -8030 8030 3 23.017979 -23.017979 8.220707 # 3 -8031 8031 3 23.840050 -22.195910 8.220707 # 3 -8032 8032 3 24.662121 -23.017979 8.220707 # 3 -8033 8033 3 9.042778 -20.551767 8.220707 # 3 -8034 8034 3 9.864848 -21.373838 8.220707 # 3 -8035 8035 3 10.686919 -20.551767 8.220707 # 3 -8036 8036 3 11.508989 -21.373838 8.220707 # 3 -8037 8037 3 12.331060 -20.551767 8.220707 # 3 -8038 8038 3 13.153131 -21.373838 8.220707 # 3 -8039 8039 3 13.975202 -20.551767 8.220707 # 3 -8040 8040 3 14.797273 -21.373838 8.220707 # 3 -8041 8041 3 15.619343 -20.551767 8.220707 # 3 -8042 8042 3 16.441414 -21.373838 8.220707 # 3 -8043 8043 3 17.263485 -20.551767 8.220707 # 3 -8044 8044 3 18.085556 -21.373838 8.220707 # 3 -8045 8045 3 18.907625 -20.551767 8.220707 # 3 -8046 8046 3 19.729696 -21.373838 8.220707 # 3 -8047 8047 3 20.551767 -20.551767 8.220707 # 3 -8048 8048 3 21.373838 -21.373838 8.220707 # 3 -8049 8049 3 22.195910 -20.551767 8.220707 # 3 -8050 8050 3 23.017979 -21.373838 8.220707 # 3 -8051 8051 3 23.840050 -20.551767 8.220707 # 3 -8052 8052 3 24.662121 -21.373838 8.220707 # 3 -8053 8053 4 -24.662121 -23.840050 9.042778 # 4 -8054 8054 4 -23.017979 -23.840050 9.042778 # 4 -8055 8055 4 -21.373838 -23.840050 9.042778 # 4 -8056 8056 4 -19.729696 -23.840050 9.042778 # 4 -8057 8057 4 -18.085556 -23.840050 9.042778 # 4 -8058 8058 4 -16.441414 -23.840050 9.042778 # 4 -8059 8059 4 -14.797273 -23.840050 9.042778 # 4 -8060 8060 4 -13.153131 -23.840050 9.042778 # 4 -8061 8061 4 -11.508989 -23.840050 9.042778 # 4 -8062 8062 4 -9.864848 -23.840050 9.042778 # 4 -8063 8063 4 -23.840050 -23.017979 9.042778 # 4 -8064 8064 4 -24.662121 -22.195910 9.042778 # 4 -8065 8065 4 -22.195910 -23.017979 9.042778 # 4 -8066 8066 4 -23.017979 -22.195910 9.042778 # 4 -8067 8067 4 -20.551767 -23.017979 9.042778 # 4 -8068 8068 4 -21.373838 -22.195910 9.042778 # 4 -8069 8069 4 -18.907625 -23.017979 9.042778 # 4 -8070 8070 4 -19.729696 -22.195910 9.042778 # 4 -8071 8071 4 -17.263485 -23.017979 9.042778 # 4 -8072 8072 4 -18.085556 -22.195910 9.042778 # 4 -8073 8073 4 -15.619343 -23.017979 9.042778 # 4 -8074 8074 4 -16.441414 -22.195910 9.042778 # 4 -8075 8075 4 -13.975202 -23.017979 9.042778 # 4 -8076 8076 4 -14.797273 -22.195910 9.042778 # 4 -8077 8077 4 -12.331060 -23.017979 9.042778 # 4 -8078 8078 4 -13.153131 -22.195910 9.042778 # 4 -8079 8079 4 -10.686919 -23.017979 9.042778 # 4 -8080 8080 4 -11.508989 -22.195910 9.042778 # 4 -8081 8081 4 -9.042778 -23.017979 9.042778 # 4 -8082 8082 4 -9.864848 -22.195910 9.042778 # 4 -8083 8083 4 -23.840050 -21.373838 9.042778 # 4 -8084 8084 4 -24.662121 -20.551767 9.042778 # 4 -8085 8085 4 -22.195910 -21.373838 9.042778 # 4 -8086 8086 4 -23.017979 -20.551767 9.042778 # 4 -8087 8087 4 -20.551767 -21.373838 9.042778 # 4 -8088 8088 4 -21.373838 -20.551767 9.042778 # 4 -8089 8089 4 -18.907625 -21.373838 9.042778 # 4 -8090 8090 4 -19.729696 -20.551767 9.042778 # 4 -8091 8091 4 -17.263485 -21.373838 9.042778 # 4 -8092 8092 4 -18.085556 -20.551767 9.042778 # 4 -8093 8093 4 -15.619343 -21.373838 9.042778 # 4 -8094 8094 4 -16.441414 -20.551767 9.042778 # 4 -8095 8095 4 -13.975202 -21.373838 9.042778 # 4 -8096 8096 4 -14.797273 -20.551767 9.042778 # 4 -8097 8097 4 -12.331060 -21.373838 9.042778 # 4 -8098 8098 4 -13.153131 -20.551767 9.042778 # 4 -8099 8099 4 -10.686919 -21.373838 9.042778 # 4 -8100 8100 4 -11.508989 -20.551767 9.042778 # 4 -8101 8101 4 -9.042778 -21.373838 9.042778 # 4 -8102 8102 4 -9.864848 -20.551767 9.042778 # 4 -8103 8103 4 -23.840050 -23.840050 9.864848 # 4 -8104 8104 4 -24.662121 -23.840050 10.686919 # 4 -8105 8105 4 -22.195910 -23.840050 9.864848 # 4 -8106 8106 4 -23.017979 -23.840050 10.686919 # 4 -8107 8107 4 -20.551767 -23.840050 9.864848 # 4 -8108 8108 4 -21.373838 -23.840050 10.686919 # 4 -8109 8109 4 -18.907625 -23.840050 9.864848 # 4 -8110 8110 4 -19.729696 -23.840050 10.686919 # 4 -8111 8111 4 -17.263485 -23.840050 9.864848 # 4 -8112 8112 4 -18.085556 -23.840050 10.686919 # 4 -8113 8113 4 -15.619343 -23.840050 9.864848 # 4 -8114 8114 4 -16.441414 -23.840050 10.686919 # 4 -8115 8115 4 -13.975202 -23.840050 9.864848 # 4 -8116 8116 4 -14.797273 -23.840050 10.686919 # 4 -8117 8117 4 -12.331060 -23.840050 9.864848 # 4 -8118 8118 4 -13.153131 -23.840050 10.686919 # 4 -8119 8119 4 -10.686919 -23.840050 9.864848 # 4 -8120 8120 4 -11.508989 -23.840050 10.686919 # 4 -8121 8121 4 -9.042778 -23.840050 9.864848 # 4 -8122 8122 4 -9.864848 -23.840050 10.686919 # 4 -8123 8123 4 -24.662121 -23.017979 9.864848 # 4 -8124 8124 4 -23.840050 -22.195910 9.864848 # 4 -8125 8125 4 -23.840050 -23.017979 10.686919 # 4 -8126 8126 4 -24.662121 -22.195910 10.686919 # 4 -8127 8127 4 -23.017979 -23.017979 9.864848 # 4 -8128 8128 4 -22.195910 -22.195910 9.864848 # 4 -8129 8129 4 -22.195910 -23.017979 10.686919 # 4 -8130 8130 4 -23.017979 -22.195910 10.686919 # 4 -8131 8131 4 -21.373838 -23.017979 9.864848 # 4 -8132 8132 4 -20.551767 -22.195910 9.864848 # 4 -8133 8133 4 -20.551767 -23.017979 10.686919 # 4 -8134 8134 4 -21.373838 -22.195910 10.686919 # 4 -8135 8135 4 -19.729696 -23.017979 9.864848 # 4 -8136 8136 4 -18.907625 -22.195910 9.864848 # 4 -8137 8137 4 -18.907625 -23.017979 10.686919 # 4 -8138 8138 4 -19.729696 -22.195910 10.686919 # 4 -8139 8139 4 -18.085556 -23.017979 9.864848 # 4 -8140 8140 4 -17.263485 -22.195910 9.864848 # 4 -8141 8141 4 -17.263485 -23.017979 10.686919 # 4 -8142 8142 4 -18.085556 -22.195910 10.686919 # 4 -8143 8143 4 -16.441414 -23.017979 9.864848 # 4 -8144 8144 4 -15.619343 -22.195910 9.864848 # 4 -8145 8145 4 -15.619343 -23.017979 10.686919 # 4 -8146 8146 4 -16.441414 -22.195910 10.686919 # 4 -8147 8147 4 -14.797273 -23.017979 9.864848 # 4 -8148 8148 4 -13.975202 -22.195910 9.864848 # 4 -8149 8149 4 -13.975202 -23.017979 10.686919 # 4 -8150 8150 4 -14.797273 -22.195910 10.686919 # 4 -8151 8151 4 -13.153131 -23.017979 9.864848 # 4 -8152 8152 4 -12.331060 -22.195910 9.864848 # 4 -8153 8153 4 -12.331060 -23.017979 10.686919 # 4 -8154 8154 4 -13.153131 -22.195910 10.686919 # 4 -8155 8155 4 -11.508989 -23.017979 9.864848 # 4 -8156 8156 4 -10.686919 -22.195910 9.864848 # 4 -8157 8157 4 -10.686919 -23.017979 10.686919 # 4 -8158 8158 4 -11.508989 -22.195910 10.686919 # 4 -8159 8159 4 -9.864848 -23.017979 9.864848 # 4 -8160 8160 4 -9.042778 -22.195910 9.864848 # 4 -8161 8161 4 -9.042778 -23.017979 10.686919 # 4 -8162 8162 4 -9.864848 -22.195910 10.686919 # 4 -8163 8163 4 -24.662121 -21.373838 9.864848 # 4 -8164 8164 4 -23.840050 -20.551767 9.864848 # 4 -8165 8165 4 -23.840050 -21.373838 10.686919 # 4 -8166 8166 4 -24.662121 -20.551767 10.686919 # 4 -8167 8167 4 -23.017979 -21.373838 9.864848 # 4 -8168 8168 4 -22.195910 -20.551767 9.864848 # 4 -8169 8169 4 -22.195910 -21.373838 10.686919 # 4 -8170 8170 4 -23.017979 -20.551767 10.686919 # 4 -8171 8171 4 -21.373838 -21.373838 9.864848 # 4 -8172 8172 4 -20.551767 -20.551767 9.864848 # 4 -8173 8173 4 -20.551767 -21.373838 10.686919 # 4 -8174 8174 4 -21.373838 -20.551767 10.686919 # 4 -8175 8175 4 -19.729696 -21.373838 9.864848 # 4 -8176 8176 4 -18.907625 -20.551767 9.864848 # 4 -8177 8177 4 -18.907625 -21.373838 10.686919 # 4 -8178 8178 4 -19.729696 -20.551767 10.686919 # 4 -8179 8179 4 -18.085556 -21.373838 9.864848 # 4 -8180 8180 4 -17.263485 -20.551767 9.864848 # 4 -8181 8181 4 -17.263485 -21.373838 10.686919 # 4 -8182 8182 4 -18.085556 -20.551767 10.686919 # 4 -8183 8183 4 -16.441414 -21.373838 9.864848 # 4 -8184 8184 4 -15.619343 -20.551767 9.864848 # 4 -8185 8185 4 -15.619343 -21.373838 10.686919 # 4 -8186 8186 4 -16.441414 -20.551767 10.686919 # 4 -8187 8187 4 -14.797273 -21.373838 9.864848 # 4 -8188 8188 4 -13.975202 -20.551767 9.864848 # 4 -8189 8189 4 -13.975202 -21.373838 10.686919 # 4 -8190 8190 4 -14.797273 -20.551767 10.686919 # 4 -8191 8191 4 -13.153131 -21.373838 9.864848 # 4 -8192 8192 4 -12.331060 -20.551767 9.864848 # 4 -8193 8193 4 -12.331060 -21.373838 10.686919 # 4 -8194 8194 4 -13.153131 -20.551767 10.686919 # 4 -8195 8195 4 -11.508989 -21.373838 9.864848 # 4 -8196 8196 4 -10.686919 -20.551767 9.864848 # 4 -8197 8197 4 -10.686919 -21.373838 10.686919 # 4 -8198 8198 4 -11.508989 -20.551767 10.686919 # 4 -8199 8199 4 -9.864848 -21.373838 9.864848 # 4 -8200 8200 4 -9.042778 -20.551767 9.864848 # 4 -8201 8201 4 -9.042778 -21.373838 10.686919 # 4 -8202 8202 4 -9.864848 -20.551767 10.686919 # 4 -8203 8203 4 -23.840050 -23.840050 11.508989 # 4 -8204 8204 4 -24.662121 -23.840050 12.331060 # 4 -8205 8205 4 -22.195910 -23.840050 11.508989 # 4 -8206 8206 4 -23.017979 -23.840050 12.331060 # 4 -8207 8207 4 -20.551767 -23.840050 11.508989 # 4 -8208 8208 4 -21.373838 -23.840050 12.331060 # 4 -8209 8209 4 -18.907625 -23.840050 11.508989 # 4 -8210 8210 4 -19.729696 -23.840050 12.331060 # 4 -8211 8211 4 -17.263485 -23.840050 11.508989 # 4 -8212 8212 4 -18.085556 -23.840050 12.331060 # 4 -8213 8213 4 -15.619343 -23.840050 11.508989 # 4 -8214 8214 4 -16.441414 -23.840050 12.331060 # 4 -8215 8215 4 -13.975202 -23.840050 11.508989 # 4 -8216 8216 4 -14.797273 -23.840050 12.331060 # 4 -8217 8217 4 -12.331060 -23.840050 11.508989 # 4 -8218 8218 4 -13.153131 -23.840050 12.331060 # 4 -8219 8219 4 -10.686919 -23.840050 11.508989 # 4 -8220 8220 4 -11.508989 -23.840050 12.331060 # 4 -8221 8221 4 -9.042778 -23.840050 11.508989 # 4 -8222 8222 4 -9.864848 -23.840050 12.331060 # 4 -8223 8223 4 -24.662121 -23.017979 11.508989 # 4 -8224 8224 4 -23.840050 -22.195910 11.508989 # 4 -8225 8225 4 -23.840050 -23.017979 12.331060 # 4 -8226 8226 4 -24.662121 -22.195910 12.331060 # 4 -8227 8227 4 -23.017979 -23.017979 11.508989 # 4 -8228 8228 4 -22.195910 -22.195910 11.508989 # 4 -8229 8229 4 -22.195910 -23.017979 12.331060 # 4 -8230 8230 4 -23.017979 -22.195910 12.331060 # 4 -8231 8231 4 -21.373838 -23.017979 11.508989 # 4 -8232 8232 4 -20.551767 -22.195910 11.508989 # 4 -8233 8233 4 -20.551767 -23.017979 12.331060 # 4 -8234 8234 4 -21.373838 -22.195910 12.331060 # 4 -8235 8235 4 -19.729696 -23.017979 11.508989 # 4 -8236 8236 4 -18.907625 -22.195910 11.508989 # 4 -8237 8237 4 -18.907625 -23.017979 12.331060 # 4 -8238 8238 4 -19.729696 -22.195910 12.331060 # 4 -8239 8239 4 -18.085556 -23.017979 11.508989 # 4 -8240 8240 4 -17.263485 -22.195910 11.508989 # 4 -8241 8241 4 -17.263485 -23.017979 12.331060 # 4 -8242 8242 4 -18.085556 -22.195910 12.331060 # 4 -8243 8243 4 -16.441414 -23.017979 11.508989 # 4 -8244 8244 4 -15.619343 -22.195910 11.508989 # 4 -8245 8245 4 -15.619343 -23.017979 12.331060 # 4 -8246 8246 4 -16.441414 -22.195910 12.331060 # 4 -8247 8247 4 -14.797273 -23.017979 11.508989 # 4 -8248 8248 4 -13.975202 -22.195910 11.508989 # 4 -8249 8249 4 -13.975202 -23.017979 12.331060 # 4 -8250 8250 4 -14.797273 -22.195910 12.331060 # 4 -8251 8251 4 -13.153131 -23.017979 11.508989 # 4 -8252 8252 4 -12.331060 -22.195910 11.508989 # 4 -8253 8253 4 -12.331060 -23.017979 12.331060 # 4 -8254 8254 4 -13.153131 -22.195910 12.331060 # 4 -8255 8255 4 -11.508989 -23.017979 11.508989 # 4 -8256 8256 4 -10.686919 -22.195910 11.508989 # 4 -8257 8257 4 -10.686919 -23.017979 12.331060 # 4 -8258 8258 4 -11.508989 -22.195910 12.331060 # 4 -8259 8259 4 -9.864848 -23.017979 11.508989 # 4 -8260 8260 4 -9.042778 -22.195910 11.508989 # 4 -8261 8261 4 -9.042778 -23.017979 12.331060 # 4 -8262 8262 4 -9.864848 -22.195910 12.331060 # 4 -8263 8263 4 -24.662121 -21.373838 11.508989 # 4 -8264 8264 4 -23.840050 -20.551767 11.508989 # 4 -8265 8265 4 -23.840050 -21.373838 12.331060 # 4 -8266 8266 4 -24.662121 -20.551767 12.331060 # 4 -8267 8267 4 -23.017979 -21.373838 11.508989 # 4 -8268 8268 4 -22.195910 -20.551767 11.508989 # 4 -8269 8269 4 -22.195910 -21.373838 12.331060 # 4 -8270 8270 4 -23.017979 -20.551767 12.331060 # 4 -8271 8271 4 -21.373838 -21.373838 11.508989 # 4 -8272 8272 4 -20.551767 -20.551767 11.508989 # 4 -8273 8273 4 -20.551767 -21.373838 12.331060 # 4 -8274 8274 4 -21.373838 -20.551767 12.331060 # 4 -8275 8275 4 -19.729696 -21.373838 11.508989 # 4 -8276 8276 4 -18.907625 -20.551767 11.508989 # 4 -8277 8277 4 -18.907625 -21.373838 12.331060 # 4 -8278 8278 4 -19.729696 -20.551767 12.331060 # 4 -8279 8279 4 -18.085556 -21.373838 11.508989 # 4 -8280 8280 4 -17.263485 -20.551767 11.508989 # 4 -8281 8281 4 -17.263485 -21.373838 12.331060 # 4 -8282 8282 4 -18.085556 -20.551767 12.331060 # 4 -8283 8283 4 -16.441414 -21.373838 11.508989 # 4 -8284 8284 4 -15.619343 -20.551767 11.508989 # 4 -8285 8285 4 -15.619343 -21.373838 12.331060 # 4 -8286 8286 4 -16.441414 -20.551767 12.331060 # 4 -8287 8287 4 -14.797273 -21.373838 11.508989 # 4 -8288 8288 4 -13.975202 -20.551767 11.508989 # 4 -8289 8289 4 -13.975202 -21.373838 12.331060 # 4 -8290 8290 4 -14.797273 -20.551767 12.331060 # 4 -8291 8291 4 -13.153131 -21.373838 11.508989 # 4 -8292 8292 4 -12.331060 -20.551767 11.508989 # 4 -8293 8293 4 -12.331060 -21.373838 12.331060 # 4 -8294 8294 4 -13.153131 -20.551767 12.331060 # 4 -8295 8295 4 -11.508989 -21.373838 11.508989 # 4 -8296 8296 4 -10.686919 -20.551767 11.508989 # 4 -8297 8297 4 -10.686919 -21.373838 12.331060 # 4 -8298 8298 4 -11.508989 -20.551767 12.331060 # 4 -8299 8299 4 -9.864848 -21.373838 11.508989 # 4 -8300 8300 4 -9.042778 -20.551767 11.508989 # 4 -8301 8301 4 -9.042778 -21.373838 12.331060 # 4 -8302 8302 4 -9.864848 -20.551767 12.331060 # 4 -8303 8303 4 -23.840050 -23.840050 13.153131 # 4 -8304 8304 4 -24.662121 -23.840050 13.975202 # 4 -8305 8305 4 -22.195910 -23.840050 13.153131 # 4 -8306 8306 4 -23.017979 -23.840050 13.975202 # 4 -8307 8307 4 -20.551767 -23.840050 13.153131 # 4 -8308 8308 4 -21.373838 -23.840050 13.975202 # 4 -8309 8309 4 -18.907625 -23.840050 13.153131 # 4 -8310 8310 4 -19.729696 -23.840050 13.975202 # 4 -8311 8311 4 -17.263485 -23.840050 13.153131 # 4 -8312 8312 4 -18.085556 -23.840050 13.975202 # 4 -8313 8313 4 -15.619343 -23.840050 13.153131 # 4 -8314 8314 4 -16.441414 -23.840050 13.975202 # 4 -8315 8315 4 -13.975202 -23.840050 13.153131 # 4 -8316 8316 4 -14.797273 -23.840050 13.975202 # 4 -8317 8317 4 -12.331060 -23.840050 13.153131 # 4 -8318 8318 4 -13.153131 -23.840050 13.975202 # 4 -8319 8319 4 -10.686919 -23.840050 13.153131 # 4 -8320 8320 4 -11.508989 -23.840050 13.975202 # 4 -8321 8321 4 -9.042778 -23.840050 13.153131 # 4 -8322 8322 4 -9.864848 -23.840050 13.975202 # 4 -8323 8323 4 -24.662121 -23.017979 13.153131 # 4 -8324 8324 4 -23.840050 -22.195910 13.153131 # 4 -8325 8325 4 -23.840050 -23.017979 13.975202 # 4 -8326 8326 4 -24.662121 -22.195910 13.975202 # 4 -8327 8327 4 -23.017979 -23.017979 13.153131 # 4 -8328 8328 4 -22.195910 -22.195910 13.153131 # 4 -8329 8329 4 -22.195910 -23.017979 13.975202 # 4 -8330 8330 4 -23.017979 -22.195910 13.975202 # 4 -8331 8331 4 -21.373838 -23.017979 13.153131 # 4 -8332 8332 4 -20.551767 -22.195910 13.153131 # 4 -8333 8333 4 -20.551767 -23.017979 13.975202 # 4 -8334 8334 4 -21.373838 -22.195910 13.975202 # 4 -8335 8335 4 -19.729696 -23.017979 13.153131 # 4 -8336 8336 4 -18.907625 -22.195910 13.153131 # 4 -8337 8337 4 -18.907625 -23.017979 13.975202 # 4 -8338 8338 4 -19.729696 -22.195910 13.975202 # 4 -8339 8339 4 -18.085556 -23.017979 13.153131 # 4 -8340 8340 4 -17.263485 -22.195910 13.153131 # 4 -8341 8341 4 -17.263485 -23.017979 13.975202 # 4 -8342 8342 4 -18.085556 -22.195910 13.975202 # 4 -8343 8343 4 -16.441414 -23.017979 13.153131 # 4 -8344 8344 4 -15.619343 -22.195910 13.153131 # 4 -8345 8345 4 -15.619343 -23.017979 13.975202 # 4 -8346 8346 4 -16.441414 -22.195910 13.975202 # 4 -8347 8347 4 -14.797273 -23.017979 13.153131 # 4 -8348 8348 4 -13.975202 -22.195910 13.153131 # 4 -8349 8349 4 -13.975202 -23.017979 13.975202 # 4 -8350 8350 4 -14.797273 -22.195910 13.975202 # 4 -8351 8351 4 -13.153131 -23.017979 13.153131 # 4 -8352 8352 4 -12.331060 -22.195910 13.153131 # 4 -8353 8353 4 -12.331060 -23.017979 13.975202 # 4 -8354 8354 4 -13.153131 -22.195910 13.975202 # 4 -8355 8355 4 -11.508989 -23.017979 13.153131 # 4 -8356 8356 4 -10.686919 -22.195910 13.153131 # 4 -8357 8357 4 -10.686919 -23.017979 13.975202 # 4 -8358 8358 4 -11.508989 -22.195910 13.975202 # 4 -8359 8359 4 -9.864848 -23.017979 13.153131 # 4 -8360 8360 4 -9.042778 -22.195910 13.153131 # 4 -8361 8361 4 -9.042778 -23.017979 13.975202 # 4 -8362 8362 4 -9.864848 -22.195910 13.975202 # 4 -8363 8363 4 -24.662121 -21.373838 13.153131 # 4 -8364 8364 4 -23.840050 -20.551767 13.153131 # 4 -8365 8365 4 -23.840050 -21.373838 13.975202 # 4 -8366 8366 4 -24.662121 -20.551767 13.975202 # 4 -8367 8367 4 -23.017979 -21.373838 13.153131 # 4 -8368 8368 4 -22.195910 -20.551767 13.153131 # 4 -8369 8369 4 -22.195910 -21.373838 13.975202 # 4 -8370 8370 4 -23.017979 -20.551767 13.975202 # 4 -8371 8371 4 -21.373838 -21.373838 13.153131 # 4 -8372 8372 4 -20.551767 -20.551767 13.153131 # 4 -8373 8373 4 -20.551767 -21.373838 13.975202 # 4 -8374 8374 4 -21.373838 -20.551767 13.975202 # 4 -8375 8375 4 -19.729696 -21.373838 13.153131 # 4 -8376 8376 4 -18.907625 -20.551767 13.153131 # 4 -8377 8377 4 -18.907625 -21.373838 13.975202 # 4 -8378 8378 4 -19.729696 -20.551767 13.975202 # 4 -8379 8379 4 -18.085556 -21.373838 13.153131 # 4 -8380 8380 4 -17.263485 -20.551767 13.153131 # 4 -8381 8381 4 -17.263485 -21.373838 13.975202 # 4 -8382 8382 4 -18.085556 -20.551767 13.975202 # 4 -8383 8383 4 -16.441414 -21.373838 13.153131 # 4 -8384 8384 4 -15.619343 -20.551767 13.153131 # 4 -8385 8385 4 -15.619343 -21.373838 13.975202 # 4 -8386 8386 4 -16.441414 -20.551767 13.975202 # 4 -8387 8387 4 -14.797273 -21.373838 13.153131 # 4 -8388 8388 4 -13.975202 -20.551767 13.153131 # 4 -8389 8389 4 -13.975202 -21.373838 13.975202 # 4 -8390 8390 4 -14.797273 -20.551767 13.975202 # 4 -8391 8391 4 -13.153131 -21.373838 13.153131 # 4 -8392 8392 4 -12.331060 -20.551767 13.153131 # 4 -8393 8393 4 -12.331060 -21.373838 13.975202 # 4 -8394 8394 4 -13.153131 -20.551767 13.975202 # 4 -8395 8395 4 -11.508989 -21.373838 13.153131 # 4 -8396 8396 4 -10.686919 -20.551767 13.153131 # 4 -8397 8397 4 -10.686919 -21.373838 13.975202 # 4 -8398 8398 4 -11.508989 -20.551767 13.975202 # 4 -8399 8399 4 -9.864848 -21.373838 13.153131 # 4 -8400 8400 4 -9.042778 -20.551767 13.153131 # 4 -8401 8401 4 -9.042778 -21.373838 13.975202 # 4 -8402 8402 4 -9.864848 -20.551767 13.975202 # 4 -8403 8403 4 -23.840050 -23.840050 14.797273 # 4 -8404 8404 4 -24.662121 -23.840050 15.619343 # 4 -8405 8405 4 -22.195910 -23.840050 14.797273 # 4 -8406 8406 4 -23.017979 -23.840050 15.619343 # 4 -8407 8407 4 -20.551767 -23.840050 14.797273 # 4 -8408 8408 4 -21.373838 -23.840050 15.619343 # 4 -8409 8409 4 -18.907625 -23.840050 14.797273 # 4 -8410 8410 4 -19.729696 -23.840050 15.619343 # 4 -8411 8411 4 -17.263485 -23.840050 14.797273 # 4 -8412 8412 4 -18.085556 -23.840050 15.619343 # 4 -8413 8413 4 -15.619343 -23.840050 14.797273 # 4 -8414 8414 4 -16.441414 -23.840050 15.619343 # 4 -8415 8415 4 -13.975202 -23.840050 14.797273 # 4 -8416 8416 4 -14.797273 -23.840050 15.619343 # 4 -8417 8417 4 -12.331060 -23.840050 14.797273 # 4 -8418 8418 4 -13.153131 -23.840050 15.619343 # 4 -8419 8419 4 -10.686919 -23.840050 14.797273 # 4 -8420 8420 4 -11.508989 -23.840050 15.619343 # 4 -8421 8421 4 -9.042778 -23.840050 14.797273 # 4 -8422 8422 4 -9.864848 -23.840050 15.619343 # 4 -8423 8423 4 -24.662121 -23.017979 14.797273 # 4 -8424 8424 4 -23.840050 -22.195910 14.797273 # 4 -8425 8425 4 -23.840050 -23.017979 15.619343 # 4 -8426 8426 4 -24.662121 -22.195910 15.619343 # 4 -8427 8427 4 -23.017979 -23.017979 14.797273 # 4 -8428 8428 4 -22.195910 -22.195910 14.797273 # 4 -8429 8429 4 -22.195910 -23.017979 15.619343 # 4 -8430 8430 4 -23.017979 -22.195910 15.619343 # 4 -8431 8431 4 -21.373838 -23.017979 14.797273 # 4 -8432 8432 4 -20.551767 -22.195910 14.797273 # 4 -8433 8433 4 -20.551767 -23.017979 15.619343 # 4 -8434 8434 4 -21.373838 -22.195910 15.619343 # 4 -8435 8435 4 -19.729696 -23.017979 14.797273 # 4 -8436 8436 4 -18.907625 -22.195910 14.797273 # 4 -8437 8437 4 -18.907625 -23.017979 15.619343 # 4 -8438 8438 4 -19.729696 -22.195910 15.619343 # 4 -8439 8439 4 -18.085556 -23.017979 14.797273 # 4 -8440 8440 4 -17.263485 -22.195910 14.797273 # 4 -8441 8441 4 -17.263485 -23.017979 15.619343 # 4 -8442 8442 4 -18.085556 -22.195910 15.619343 # 4 -8443 8443 4 -16.441414 -23.017979 14.797273 # 4 -8444 8444 4 -15.619343 -22.195910 14.797273 # 4 -8445 8445 4 -15.619343 -23.017979 15.619343 # 4 -8446 8446 4 -16.441414 -22.195910 15.619343 # 4 -8447 8447 4 -14.797273 -23.017979 14.797273 # 4 -8448 8448 4 -13.975202 -22.195910 14.797273 # 4 -8449 8449 4 -13.975202 -23.017979 15.619343 # 4 -8450 8450 4 -14.797273 -22.195910 15.619343 # 4 -8451 8451 4 -13.153131 -23.017979 14.797273 # 4 -8452 8452 4 -12.331060 -22.195910 14.797273 # 4 -8453 8453 4 -12.331060 -23.017979 15.619343 # 4 -8454 8454 4 -13.153131 -22.195910 15.619343 # 4 -8455 8455 4 -11.508989 -23.017979 14.797273 # 4 -8456 8456 4 -10.686919 -22.195910 14.797273 # 4 -8457 8457 4 -10.686919 -23.017979 15.619343 # 4 -8458 8458 4 -11.508989 -22.195910 15.619343 # 4 -8459 8459 4 -9.864848 -23.017979 14.797273 # 4 -8460 8460 4 -9.042778 -22.195910 14.797273 # 4 -8461 8461 4 -9.042778 -23.017979 15.619343 # 4 -8462 8462 4 -9.864848 -22.195910 15.619343 # 4 -8463 8463 4 -24.662121 -21.373838 14.797273 # 4 -8464 8464 4 -23.840050 -20.551767 14.797273 # 4 -8465 8465 4 -23.840050 -21.373838 15.619343 # 4 -8466 8466 4 -24.662121 -20.551767 15.619343 # 4 -8467 8467 4 -23.017979 -21.373838 14.797273 # 4 -8468 8468 4 -22.195910 -20.551767 14.797273 # 4 -8469 8469 4 -22.195910 -21.373838 15.619343 # 4 -8470 8470 4 -23.017979 -20.551767 15.619343 # 4 -8471 8471 4 -21.373838 -21.373838 14.797273 # 4 -8472 8472 4 -20.551767 -20.551767 14.797273 # 4 -8473 8473 4 -20.551767 -21.373838 15.619343 # 4 -8474 8474 4 -21.373838 -20.551767 15.619343 # 4 -8475 8475 4 -19.729696 -21.373838 14.797273 # 4 -8476 8476 4 -18.907625 -20.551767 14.797273 # 4 -8477 8477 4 -18.907625 -21.373838 15.619343 # 4 -8478 8478 4 -19.729696 -20.551767 15.619343 # 4 -8479 8479 4 -18.085556 -21.373838 14.797273 # 4 -8480 8480 4 -17.263485 -20.551767 14.797273 # 4 -8481 8481 4 -17.263485 -21.373838 15.619343 # 4 -8482 8482 4 -18.085556 -20.551767 15.619343 # 4 -8483 8483 4 -16.441414 -21.373838 14.797273 # 4 -8484 8484 4 -15.619343 -20.551767 14.797273 # 4 -8485 8485 4 -15.619343 -21.373838 15.619343 # 4 -8486 8486 4 -16.441414 -20.551767 15.619343 # 4 -8487 8487 4 -14.797273 -21.373838 14.797273 # 4 -8488 8488 4 -13.975202 -20.551767 14.797273 # 4 -8489 8489 4 -13.975202 -21.373838 15.619343 # 4 -8490 8490 4 -14.797273 -20.551767 15.619343 # 4 -8491 8491 4 -13.153131 -21.373838 14.797273 # 4 -8492 8492 4 -12.331060 -20.551767 14.797273 # 4 -8493 8493 4 -12.331060 -21.373838 15.619343 # 4 -8494 8494 4 -13.153131 -20.551767 15.619343 # 4 -8495 8495 4 -11.508989 -21.373838 14.797273 # 4 -8496 8496 4 -10.686919 -20.551767 14.797273 # 4 -8497 8497 4 -10.686919 -21.373838 15.619343 # 4 -8498 8498 4 -11.508989 -20.551767 15.619343 # 4 -8499 8499 4 -9.864848 -21.373838 14.797273 # 4 -8500 8500 4 -9.042778 -20.551767 14.797273 # 4 -8501 8501 4 -9.042778 -21.373838 15.619343 # 4 -8502 8502 4 -9.864848 -20.551767 15.619343 # 4 -8503 8503 4 -23.840050 -23.840050 16.441414 # 4 -8504 8504 4 -24.662121 -23.840050 17.263485 # 4 -8505 8505 4 -22.195910 -23.840050 16.441414 # 4 -8506 8506 4 -23.017979 -23.840050 17.263485 # 4 -8507 8507 4 -20.551767 -23.840050 16.441414 # 4 -8508 8508 4 -21.373838 -23.840050 17.263485 # 4 -8509 8509 4 -18.907625 -23.840050 16.441414 # 4 -8510 8510 4 -19.729696 -23.840050 17.263485 # 4 -8511 8511 4 -17.263485 -23.840050 16.441414 # 4 -8512 8512 4 -18.085556 -23.840050 17.263485 # 4 -8513 8513 4 -15.619343 -23.840050 16.441414 # 4 -8514 8514 4 -16.441414 -23.840050 17.263485 # 4 -8515 8515 4 -13.975202 -23.840050 16.441414 # 4 -8516 8516 4 -14.797273 -23.840050 17.263485 # 4 -8517 8517 4 -12.331060 -23.840050 16.441414 # 4 -8518 8518 4 -13.153131 -23.840050 17.263485 # 4 -8519 8519 4 -10.686919 -23.840050 16.441414 # 4 -8520 8520 4 -11.508989 -23.840050 17.263485 # 4 -8521 8521 4 -9.042778 -23.840050 16.441414 # 4 -8522 8522 4 -9.864848 -23.840050 17.263485 # 4 -8523 8523 4 -24.662121 -23.017979 16.441414 # 4 -8524 8524 4 -23.840050 -22.195910 16.441414 # 4 -8525 8525 4 -23.840050 -23.017979 17.263485 # 4 -8526 8526 4 -24.662121 -22.195910 17.263485 # 4 -8527 8527 4 -23.017979 -23.017979 16.441414 # 4 -8528 8528 4 -22.195910 -22.195910 16.441414 # 4 -8529 8529 4 -22.195910 -23.017979 17.263485 # 4 -8530 8530 4 -23.017979 -22.195910 17.263485 # 4 -8531 8531 4 -21.373838 -23.017979 16.441414 # 4 -8532 8532 4 -20.551767 -22.195910 16.441414 # 4 -8533 8533 4 -20.551767 -23.017979 17.263485 # 4 -8534 8534 4 -21.373838 -22.195910 17.263485 # 4 -8535 8535 4 -19.729696 -23.017979 16.441414 # 4 -8536 8536 4 -18.907625 -22.195910 16.441414 # 4 -8537 8537 4 -18.907625 -23.017979 17.263485 # 4 -8538 8538 4 -19.729696 -22.195910 17.263485 # 4 -8539 8539 4 -18.085556 -23.017979 16.441414 # 4 -8540 8540 4 -17.263485 -22.195910 16.441414 # 4 -8541 8541 4 -17.263485 -23.017979 17.263485 # 4 -8542 8542 4 -18.085556 -22.195910 17.263485 # 4 -8543 8543 4 -16.441414 -23.017979 16.441414 # 4 -8544 8544 4 -15.619343 -22.195910 16.441414 # 4 -8545 8545 4 -15.619343 -23.017979 17.263485 # 4 -8546 8546 4 -16.441414 -22.195910 17.263485 # 4 -8547 8547 4 -14.797273 -23.017979 16.441414 # 4 -8548 8548 4 -13.975202 -22.195910 16.441414 # 4 -8549 8549 4 -13.975202 -23.017979 17.263485 # 4 -8550 8550 4 -14.797273 -22.195910 17.263485 # 4 -8551 8551 4 -13.153131 -23.017979 16.441414 # 4 -8552 8552 4 -12.331060 -22.195910 16.441414 # 4 -8553 8553 4 -12.331060 -23.017979 17.263485 # 4 -8554 8554 4 -13.153131 -22.195910 17.263485 # 4 -8555 8555 4 -11.508989 -23.017979 16.441414 # 4 -8556 8556 4 -10.686919 -22.195910 16.441414 # 4 -8557 8557 4 -10.686919 -23.017979 17.263485 # 4 -8558 8558 4 -11.508989 -22.195910 17.263485 # 4 -8559 8559 4 -9.864848 -23.017979 16.441414 # 4 -8560 8560 4 -9.042778 -22.195910 16.441414 # 4 -8561 8561 4 -9.042778 -23.017979 17.263485 # 4 -8562 8562 4 -9.864848 -22.195910 17.263485 # 4 -8563 8563 4 -24.662121 -21.373838 16.441414 # 4 -8564 8564 4 -23.840050 -20.551767 16.441414 # 4 -8565 8565 4 -23.840050 -21.373838 17.263485 # 4 -8566 8566 4 -24.662121 -20.551767 17.263485 # 4 -8567 8567 4 -23.017979 -21.373838 16.441414 # 4 -8568 8568 4 -22.195910 -20.551767 16.441414 # 4 -8569 8569 4 -22.195910 -21.373838 17.263485 # 4 -8570 8570 4 -23.017979 -20.551767 17.263485 # 4 -8571 8571 4 -21.373838 -21.373838 16.441414 # 4 -8572 8572 4 -20.551767 -20.551767 16.441414 # 4 -8573 8573 4 -20.551767 -21.373838 17.263485 # 4 -8574 8574 4 -21.373838 -20.551767 17.263485 # 4 -8575 8575 4 -19.729696 -21.373838 16.441414 # 4 -8576 8576 4 -18.907625 -20.551767 16.441414 # 4 -8577 8577 4 -18.907625 -21.373838 17.263485 # 4 -8578 8578 4 -19.729696 -20.551767 17.263485 # 4 -8579 8579 4 -18.085556 -21.373838 16.441414 # 4 -8580 8580 4 -17.263485 -20.551767 16.441414 # 4 -8581 8581 4 -17.263485 -21.373838 17.263485 # 4 -8582 8582 4 -18.085556 -20.551767 17.263485 # 4 -8583 8583 4 -16.441414 -21.373838 16.441414 # 4 -8584 8584 4 -15.619343 -20.551767 16.441414 # 4 -8585 8585 4 -15.619343 -21.373838 17.263485 # 4 -8586 8586 4 -16.441414 -20.551767 17.263485 # 4 -8587 8587 4 -14.797273 -21.373838 16.441414 # 4 -8588 8588 4 -13.975202 -20.551767 16.441414 # 4 -8589 8589 4 -13.975202 -21.373838 17.263485 # 4 -8590 8590 4 -14.797273 -20.551767 17.263485 # 4 -8591 8591 4 -13.153131 -21.373838 16.441414 # 4 -8592 8592 4 -12.331060 -20.551767 16.441414 # 4 -8593 8593 4 -12.331060 -21.373838 17.263485 # 4 -8594 8594 4 -13.153131 -20.551767 17.263485 # 4 -8595 8595 4 -11.508989 -21.373838 16.441414 # 4 -8596 8596 4 -10.686919 -20.551767 16.441414 # 4 -8597 8597 4 -10.686919 -21.373838 17.263485 # 4 -8598 8598 4 -11.508989 -20.551767 17.263485 # 4 -8599 8599 4 -9.864848 -21.373838 16.441414 # 4 -8600 8600 4 -9.042778 -20.551767 16.441414 # 4 -8601 8601 4 -9.042778 -21.373838 17.263485 # 4 -8602 8602 4 -9.864848 -20.551767 17.263485 # 4 -8603 8603 4 -23.840050 -23.840050 18.085556 # 4 -8604 8604 4 -24.662121 -23.840050 18.907625 # 4 -8605 8605 4 -22.195910 -23.840050 18.085556 # 4 -8606 8606 4 -23.017979 -23.840050 18.907625 # 4 -8607 8607 4 -20.551767 -23.840050 18.085556 # 4 -8608 8608 4 -21.373838 -23.840050 18.907625 # 4 -8609 8609 4 -18.907625 -23.840050 18.085556 # 4 -8610 8610 4 -19.729696 -23.840050 18.907625 # 4 -8611 8611 4 -17.263485 -23.840050 18.085556 # 4 -8612 8612 4 -18.085556 -23.840050 18.907625 # 4 -8613 8613 4 -15.619343 -23.840050 18.085556 # 4 -8614 8614 4 -16.441414 -23.840050 18.907625 # 4 -8615 8615 4 -13.975202 -23.840050 18.085556 # 4 -8616 8616 4 -14.797273 -23.840050 18.907625 # 4 -8617 8617 4 -12.331060 -23.840050 18.085556 # 4 -8618 8618 4 -13.153131 -23.840050 18.907625 # 4 -8619 8619 4 -10.686919 -23.840050 18.085556 # 4 -8620 8620 4 -11.508989 -23.840050 18.907625 # 4 -8621 8621 4 -9.042778 -23.840050 18.085556 # 4 -8622 8622 4 -9.864848 -23.840050 18.907625 # 4 -8623 8623 4 -24.662121 -23.017979 18.085556 # 4 -8624 8624 4 -23.840050 -22.195910 18.085556 # 4 -8625 8625 4 -23.840050 -23.017979 18.907625 # 4 -8626 8626 4 -24.662121 -22.195910 18.907625 # 4 -8627 8627 4 -23.017979 -23.017979 18.085556 # 4 -8628 8628 4 -22.195910 -22.195910 18.085556 # 4 -8629 8629 4 -22.195910 -23.017979 18.907625 # 4 -8630 8630 4 -23.017979 -22.195910 18.907625 # 4 -8631 8631 4 -21.373838 -23.017979 18.085556 # 4 -8632 8632 4 -20.551767 -22.195910 18.085556 # 4 -8633 8633 4 -20.551767 -23.017979 18.907625 # 4 -8634 8634 4 -21.373838 -22.195910 18.907625 # 4 -8635 8635 4 -19.729696 -23.017979 18.085556 # 4 -8636 8636 4 -18.907625 -22.195910 18.085556 # 4 -8637 8637 4 -18.907625 -23.017979 18.907625 # 4 -8638 8638 4 -19.729696 -22.195910 18.907625 # 4 -8639 8639 4 -18.085556 -23.017979 18.085556 # 4 -8640 8640 4 -17.263485 -22.195910 18.085556 # 4 -8641 8641 4 -17.263485 -23.017979 18.907625 # 4 -8642 8642 4 -18.085556 -22.195910 18.907625 # 4 -8643 8643 4 -16.441414 -23.017979 18.085556 # 4 -8644 8644 4 -15.619343 -22.195910 18.085556 # 4 -8645 8645 4 -15.619343 -23.017979 18.907625 # 4 -8646 8646 4 -16.441414 -22.195910 18.907625 # 4 -8647 8647 4 -14.797273 -23.017979 18.085556 # 4 -8648 8648 4 -13.975202 -22.195910 18.085556 # 4 -8649 8649 4 -13.975202 -23.017979 18.907625 # 4 -8650 8650 4 -14.797273 -22.195910 18.907625 # 4 -8651 8651 4 -13.153131 -23.017979 18.085556 # 4 -8652 8652 4 -12.331060 -22.195910 18.085556 # 4 -8653 8653 4 -12.331060 -23.017979 18.907625 # 4 -8654 8654 4 -13.153131 -22.195910 18.907625 # 4 -8655 8655 4 -11.508989 -23.017979 18.085556 # 4 -8656 8656 4 -10.686919 -22.195910 18.085556 # 4 -8657 8657 4 -10.686919 -23.017979 18.907625 # 4 -8658 8658 4 -11.508989 -22.195910 18.907625 # 4 -8659 8659 4 -9.864848 -23.017979 18.085556 # 4 -8660 8660 4 -9.042778 -22.195910 18.085556 # 4 -8661 8661 4 -9.042778 -23.017979 18.907625 # 4 -8662 8662 4 -9.864848 -22.195910 18.907625 # 4 -8663 8663 4 -24.662121 -21.373838 18.085556 # 4 -8664 8664 4 -23.840050 -20.551767 18.085556 # 4 -8665 8665 4 -23.840050 -21.373838 18.907625 # 4 -8666 8666 4 -24.662121 -20.551767 18.907625 # 4 -8667 8667 4 -23.017979 -21.373838 18.085556 # 4 -8668 8668 4 -22.195910 -20.551767 18.085556 # 4 -8669 8669 4 -22.195910 -21.373838 18.907625 # 4 -8670 8670 4 -23.017979 -20.551767 18.907625 # 4 -8671 8671 4 -21.373838 -21.373838 18.085556 # 4 -8672 8672 4 -20.551767 -20.551767 18.085556 # 4 -8673 8673 4 -20.551767 -21.373838 18.907625 # 4 -8674 8674 4 -21.373838 -20.551767 18.907625 # 4 -8675 8675 4 -19.729696 -21.373838 18.085556 # 4 -8676 8676 4 -18.907625 -20.551767 18.085556 # 4 -8677 8677 4 -18.907625 -21.373838 18.907625 # 4 -8678 8678 4 -19.729696 -20.551767 18.907625 # 4 -8679 8679 4 -18.085556 -21.373838 18.085556 # 4 -8680 8680 4 -17.263485 -20.551767 18.085556 # 4 -8681 8681 4 -17.263485 -21.373838 18.907625 # 4 -8682 8682 4 -18.085556 -20.551767 18.907625 # 4 -8683 8683 4 -16.441414 -21.373838 18.085556 # 4 -8684 8684 4 -15.619343 -20.551767 18.085556 # 4 -8685 8685 4 -15.619343 -21.373838 18.907625 # 4 -8686 8686 4 -16.441414 -20.551767 18.907625 # 4 -8687 8687 4 -14.797273 -21.373838 18.085556 # 4 -8688 8688 4 -13.975202 -20.551767 18.085556 # 4 -8689 8689 4 -13.975202 -21.373838 18.907625 # 4 -8690 8690 4 -14.797273 -20.551767 18.907625 # 4 -8691 8691 4 -13.153131 -21.373838 18.085556 # 4 -8692 8692 4 -12.331060 -20.551767 18.085556 # 4 -8693 8693 4 -12.331060 -21.373838 18.907625 # 4 -8694 8694 4 -13.153131 -20.551767 18.907625 # 4 -8695 8695 4 -11.508989 -21.373838 18.085556 # 4 -8696 8696 4 -10.686919 -20.551767 18.085556 # 4 -8697 8697 4 -10.686919 -21.373838 18.907625 # 4 -8698 8698 4 -11.508989 -20.551767 18.907625 # 4 -8699 8699 4 -9.864848 -21.373838 18.085556 # 4 -8700 8700 4 -9.042778 -20.551767 18.085556 # 4 -8701 8701 4 -9.042778 -21.373838 18.907625 # 4 -8702 8702 4 -9.864848 -20.551767 18.907625 # 4 -8703 8703 4 -23.840050 -23.840050 19.729696 # 4 -8704 8704 4 -24.662121 -23.840050 20.551767 # 4 -8705 8705 4 -22.195910 -23.840050 19.729696 # 4 -8706 8706 4 -23.017979 -23.840050 20.551767 # 4 -8707 8707 4 -20.551767 -23.840050 19.729696 # 4 -8708 8708 4 -21.373838 -23.840050 20.551767 # 4 -8709 8709 4 -18.907625 -23.840050 19.729696 # 4 -8710 8710 4 -19.729696 -23.840050 20.551767 # 4 -8711 8711 4 -17.263485 -23.840050 19.729696 # 4 -8712 8712 4 -18.085556 -23.840050 20.551767 # 4 -8713 8713 4 -15.619343 -23.840050 19.729696 # 4 -8714 8714 4 -16.441414 -23.840050 20.551767 # 4 -8715 8715 4 -13.975202 -23.840050 19.729696 # 4 -8716 8716 4 -14.797273 -23.840050 20.551767 # 4 -8717 8717 4 -12.331060 -23.840050 19.729696 # 4 -8718 8718 4 -13.153131 -23.840050 20.551767 # 4 -8719 8719 4 -10.686919 -23.840050 19.729696 # 4 -8720 8720 4 -11.508989 -23.840050 20.551767 # 4 -8721 8721 4 -9.042778 -23.840050 19.729696 # 4 -8722 8722 4 -9.864848 -23.840050 20.551767 # 4 -8723 8723 4 -24.662121 -23.017979 19.729696 # 4 -8724 8724 4 -23.840050 -22.195910 19.729696 # 4 -8725 8725 4 -23.840050 -23.017979 20.551767 # 4 -8726 8726 4 -24.662121 -22.195910 20.551767 # 4 -8727 8727 4 -23.017979 -23.017979 19.729696 # 4 -8728 8728 4 -22.195910 -22.195910 19.729696 # 4 -8729 8729 4 -22.195910 -23.017979 20.551767 # 4 -8730 8730 4 -23.017979 -22.195910 20.551767 # 4 -8731 8731 4 -21.373838 -23.017979 19.729696 # 4 -8732 8732 4 -20.551767 -22.195910 19.729696 # 4 -8733 8733 4 -20.551767 -23.017979 20.551767 # 4 -8734 8734 4 -21.373838 -22.195910 20.551767 # 4 -8735 8735 4 -19.729696 -23.017979 19.729696 # 4 -8736 8736 4 -18.907625 -22.195910 19.729696 # 4 -8737 8737 4 -18.907625 -23.017979 20.551767 # 4 -8738 8738 4 -19.729696 -22.195910 20.551767 # 4 -8739 8739 4 -18.085556 -23.017979 19.729696 # 4 -8740 8740 4 -17.263485 -22.195910 19.729696 # 4 -8741 8741 4 -17.263485 -23.017979 20.551767 # 4 -8742 8742 4 -18.085556 -22.195910 20.551767 # 4 -8743 8743 4 -16.441414 -23.017979 19.729696 # 4 -8744 8744 4 -15.619343 -22.195910 19.729696 # 4 -8745 8745 4 -15.619343 -23.017979 20.551767 # 4 -8746 8746 4 -16.441414 -22.195910 20.551767 # 4 -8747 8747 4 -14.797273 -23.017979 19.729696 # 4 -8748 8748 4 -13.975202 -22.195910 19.729696 # 4 -8749 8749 4 -13.975202 -23.017979 20.551767 # 4 -8750 8750 4 -14.797273 -22.195910 20.551767 # 4 -8751 8751 4 -13.153131 -23.017979 19.729696 # 4 -8752 8752 4 -12.331060 -22.195910 19.729696 # 4 -8753 8753 4 -12.331060 -23.017979 20.551767 # 4 -8754 8754 4 -13.153131 -22.195910 20.551767 # 4 -8755 8755 4 -11.508989 -23.017979 19.729696 # 4 -8756 8756 4 -10.686919 -22.195910 19.729696 # 4 -8757 8757 4 -10.686919 -23.017979 20.551767 # 4 -8758 8758 4 -11.508989 -22.195910 20.551767 # 4 -8759 8759 4 -9.864848 -23.017979 19.729696 # 4 -8760 8760 4 -9.042778 -22.195910 19.729696 # 4 -8761 8761 4 -9.042778 -23.017979 20.551767 # 4 -8762 8762 4 -9.864848 -22.195910 20.551767 # 4 -8763 8763 4 -24.662121 -21.373838 19.729696 # 4 -8764 8764 4 -23.840050 -20.551767 19.729696 # 4 -8765 8765 4 -23.840050 -21.373838 20.551767 # 4 -8766 8766 4 -24.662121 -20.551767 20.551767 # 4 -8767 8767 4 -23.017979 -21.373838 19.729696 # 4 -8768 8768 4 -22.195910 -20.551767 19.729696 # 4 -8769 8769 4 -22.195910 -21.373838 20.551767 # 4 -8770 8770 4 -23.017979 -20.551767 20.551767 # 4 -8771 8771 4 -21.373838 -21.373838 19.729696 # 4 -8772 8772 4 -20.551767 -20.551767 19.729696 # 4 -8773 8773 4 -20.551767 -21.373838 20.551767 # 4 -8774 8774 4 -21.373838 -20.551767 20.551767 # 4 -8775 8775 4 -19.729696 -21.373838 19.729696 # 4 -8776 8776 4 -18.907625 -20.551767 19.729696 # 4 -8777 8777 4 -18.907625 -21.373838 20.551767 # 4 -8778 8778 4 -19.729696 -20.551767 20.551767 # 4 -8779 8779 4 -18.085556 -21.373838 19.729696 # 4 -8780 8780 4 -17.263485 -20.551767 19.729696 # 4 -8781 8781 4 -17.263485 -21.373838 20.551767 # 4 -8782 8782 4 -18.085556 -20.551767 20.551767 # 4 -8783 8783 4 -16.441414 -21.373838 19.729696 # 4 -8784 8784 4 -15.619343 -20.551767 19.729696 # 4 -8785 8785 4 -15.619343 -21.373838 20.551767 # 4 -8786 8786 4 -16.441414 -20.551767 20.551767 # 4 -8787 8787 4 -14.797273 -21.373838 19.729696 # 4 -8788 8788 4 -13.975202 -20.551767 19.729696 # 4 -8789 8789 4 -13.975202 -21.373838 20.551767 # 4 -8790 8790 4 -14.797273 -20.551767 20.551767 # 4 -8791 8791 4 -13.153131 -21.373838 19.729696 # 4 -8792 8792 4 -12.331060 -20.551767 19.729696 # 4 -8793 8793 4 -12.331060 -21.373838 20.551767 # 4 -8794 8794 4 -13.153131 -20.551767 20.551767 # 4 -8795 8795 4 -11.508989 -21.373838 19.729696 # 4 -8796 8796 4 -10.686919 -20.551767 19.729696 # 4 -8797 8797 4 -10.686919 -21.373838 20.551767 # 4 -8798 8798 4 -11.508989 -20.551767 20.551767 # 4 -8799 8799 4 -9.864848 -21.373838 19.729696 # 4 -8800 8800 4 -9.042778 -20.551767 19.729696 # 4 -8801 8801 4 -9.042778 -21.373838 20.551767 # 4 -8802 8802 4 -9.864848 -20.551767 20.551767 # 4 -8803 8803 4 -23.840050 -23.840050 21.373838 # 4 -8804 8804 4 -24.662121 -23.840050 22.195910 # 4 -8805 8805 4 -22.195910 -23.840050 21.373838 # 4 -8806 8806 4 -23.017979 -23.840050 22.195910 # 4 -8807 8807 4 -20.551767 -23.840050 21.373838 # 4 -8808 8808 4 -21.373838 -23.840050 22.195910 # 4 -8809 8809 4 -18.907625 -23.840050 21.373838 # 4 -8810 8810 4 -19.729696 -23.840050 22.195910 # 4 -8811 8811 4 -17.263485 -23.840050 21.373838 # 4 -8812 8812 4 -18.085556 -23.840050 22.195910 # 4 -8813 8813 4 -15.619343 -23.840050 21.373838 # 4 -8814 8814 4 -16.441414 -23.840050 22.195910 # 4 -8815 8815 4 -13.975202 -23.840050 21.373838 # 4 -8816 8816 4 -14.797273 -23.840050 22.195910 # 4 -8817 8817 4 -12.331060 -23.840050 21.373838 # 4 -8818 8818 4 -13.153131 -23.840050 22.195910 # 4 -8819 8819 4 -10.686919 -23.840050 21.373838 # 4 -8820 8820 4 -11.508989 -23.840050 22.195910 # 4 -8821 8821 4 -9.042778 -23.840050 21.373838 # 4 -8822 8822 4 -9.864848 -23.840050 22.195910 # 4 -8823 8823 4 -24.662121 -23.017979 21.373838 # 4 -8824 8824 4 -23.840050 -22.195910 21.373838 # 4 -8825 8825 4 -23.840050 -23.017979 22.195910 # 4 -8826 8826 4 -24.662121 -22.195910 22.195910 # 4 -8827 8827 4 -23.017979 -23.017979 21.373838 # 4 -8828 8828 4 -22.195910 -22.195910 21.373838 # 4 -8829 8829 4 -22.195910 -23.017979 22.195910 # 4 -8830 8830 4 -23.017979 -22.195910 22.195910 # 4 -8831 8831 4 -21.373838 -23.017979 21.373838 # 4 -8832 8832 4 -20.551767 -22.195910 21.373838 # 4 -8833 8833 4 -20.551767 -23.017979 22.195910 # 4 -8834 8834 4 -21.373838 -22.195910 22.195910 # 4 -8835 8835 4 -19.729696 -23.017979 21.373838 # 4 -8836 8836 4 -18.907625 -22.195910 21.373838 # 4 -8837 8837 4 -18.907625 -23.017979 22.195910 # 4 -8838 8838 4 -19.729696 -22.195910 22.195910 # 4 -8839 8839 4 -18.085556 -23.017979 21.373838 # 4 -8840 8840 4 -17.263485 -22.195910 21.373838 # 4 -8841 8841 4 -17.263485 -23.017979 22.195910 # 4 -8842 8842 4 -18.085556 -22.195910 22.195910 # 4 -8843 8843 4 -16.441414 -23.017979 21.373838 # 4 -8844 8844 4 -15.619343 -22.195910 21.373838 # 4 -8845 8845 4 -15.619343 -23.017979 22.195910 # 4 -8846 8846 4 -16.441414 -22.195910 22.195910 # 4 -8847 8847 4 -14.797273 -23.017979 21.373838 # 4 -8848 8848 4 -13.975202 -22.195910 21.373838 # 4 -8849 8849 4 -13.975202 -23.017979 22.195910 # 4 -8850 8850 4 -14.797273 -22.195910 22.195910 # 4 -8851 8851 4 -13.153131 -23.017979 21.373838 # 4 -8852 8852 4 -12.331060 -22.195910 21.373838 # 4 -8853 8853 4 -12.331060 -23.017979 22.195910 # 4 -8854 8854 4 -13.153131 -22.195910 22.195910 # 4 -8855 8855 4 -11.508989 -23.017979 21.373838 # 4 -8856 8856 4 -10.686919 -22.195910 21.373838 # 4 -8857 8857 4 -10.686919 -23.017979 22.195910 # 4 -8858 8858 4 -11.508989 -22.195910 22.195910 # 4 -8859 8859 4 -9.864848 -23.017979 21.373838 # 4 -8860 8860 4 -9.042778 -22.195910 21.373838 # 4 -8861 8861 4 -9.042778 -23.017979 22.195910 # 4 -8862 8862 4 -9.864848 -22.195910 22.195910 # 4 -8863 8863 4 -24.662121 -21.373838 21.373838 # 4 -8864 8864 4 -23.840050 -20.551767 21.373838 # 4 -8865 8865 4 -23.840050 -21.373838 22.195910 # 4 -8866 8866 4 -24.662121 -20.551767 22.195910 # 4 -8867 8867 4 -23.017979 -21.373838 21.373838 # 4 -8868 8868 4 -22.195910 -20.551767 21.373838 # 4 -8869 8869 4 -22.195910 -21.373838 22.195910 # 4 -8870 8870 4 -23.017979 -20.551767 22.195910 # 4 -8871 8871 4 -21.373838 -21.373838 21.373838 # 4 -8872 8872 4 -20.551767 -20.551767 21.373838 # 4 -8873 8873 4 -20.551767 -21.373838 22.195910 # 4 -8874 8874 4 -21.373838 -20.551767 22.195910 # 4 -8875 8875 4 -19.729696 -21.373838 21.373838 # 4 -8876 8876 4 -18.907625 -20.551767 21.373838 # 4 -8877 8877 4 -18.907625 -21.373838 22.195910 # 4 -8878 8878 4 -19.729696 -20.551767 22.195910 # 4 -8879 8879 4 -18.085556 -21.373838 21.373838 # 4 -8880 8880 4 -17.263485 -20.551767 21.373838 # 4 -8881 8881 4 -17.263485 -21.373838 22.195910 # 4 -8882 8882 4 -18.085556 -20.551767 22.195910 # 4 -8883 8883 4 -16.441414 -21.373838 21.373838 # 4 -8884 8884 4 -15.619343 -20.551767 21.373838 # 4 -8885 8885 4 -15.619343 -21.373838 22.195910 # 4 -8886 8886 4 -16.441414 -20.551767 22.195910 # 4 -8887 8887 4 -14.797273 -21.373838 21.373838 # 4 -8888 8888 4 -13.975202 -20.551767 21.373838 # 4 -8889 8889 4 -13.975202 -21.373838 22.195910 # 4 -8890 8890 4 -14.797273 -20.551767 22.195910 # 4 -8891 8891 4 -13.153131 -21.373838 21.373838 # 4 -8892 8892 4 -12.331060 -20.551767 21.373838 # 4 -8893 8893 4 -12.331060 -21.373838 22.195910 # 4 -8894 8894 4 -13.153131 -20.551767 22.195910 # 4 -8895 8895 4 -11.508989 -21.373838 21.373838 # 4 -8896 8896 4 -10.686919 -20.551767 21.373838 # 4 -8897 8897 4 -10.686919 -21.373838 22.195910 # 4 -8898 8898 4 -11.508989 -20.551767 22.195910 # 4 -8899 8899 4 -9.864848 -21.373838 21.373838 # 4 -8900 8900 4 -9.042778 -20.551767 21.373838 # 4 -8901 8901 4 -9.042778 -21.373838 22.195910 # 4 -8902 8902 4 -9.864848 -20.551767 22.195910 # 4 -8903 8903 4 -23.840050 -23.840050 23.017979 # 4 -8904 8904 4 -24.662121 -23.840050 23.840050 # 4 -8905 8905 4 -22.195910 -23.840050 23.017979 # 4 -8906 8906 4 -23.017979 -23.840050 23.840050 # 4 -8907 8907 4 -20.551767 -23.840050 23.017979 # 4 -8908 8908 4 -21.373838 -23.840050 23.840050 # 4 -8909 8909 4 -18.907625 -23.840050 23.017979 # 4 -8910 8910 4 -19.729696 -23.840050 23.840050 # 4 -8911 8911 4 -17.263485 -23.840050 23.017979 # 4 -8912 8912 4 -18.085556 -23.840050 23.840050 # 4 -8913 8913 4 -15.619343 -23.840050 23.017979 # 4 -8914 8914 4 -16.441414 -23.840050 23.840050 # 4 -8915 8915 4 -13.975202 -23.840050 23.017979 # 4 -8916 8916 4 -14.797273 -23.840050 23.840050 # 4 -8917 8917 4 -12.331060 -23.840050 23.017979 # 4 -8918 8918 4 -13.153131 -23.840050 23.840050 # 4 -8919 8919 4 -10.686919 -23.840050 23.017979 # 4 -8920 8920 4 -11.508989 -23.840050 23.840050 # 4 -8921 8921 4 -9.042778 -23.840050 23.017979 # 4 -8922 8922 4 -9.864848 -23.840050 23.840050 # 4 -8923 8923 4 -24.662121 -23.017979 23.017979 # 4 -8924 8924 4 -23.840050 -22.195910 23.017979 # 4 -8925 8925 4 -23.840050 -23.017979 23.840050 # 4 -8926 8926 4 -24.662121 -22.195910 23.840050 # 4 -8927 8927 4 -23.017979 -23.017979 23.017979 # 4 -8928 8928 4 -22.195910 -22.195910 23.017979 # 4 -8929 8929 4 -22.195910 -23.017979 23.840050 # 4 -8930 8930 4 -23.017979 -22.195910 23.840050 # 4 -8931 8931 4 -21.373838 -23.017979 23.017979 # 4 -8932 8932 4 -20.551767 -22.195910 23.017979 # 4 -8933 8933 4 -20.551767 -23.017979 23.840050 # 4 -8934 8934 4 -21.373838 -22.195910 23.840050 # 4 -8935 8935 4 -19.729696 -23.017979 23.017979 # 4 -8936 8936 4 -18.907625 -22.195910 23.017979 # 4 -8937 8937 4 -18.907625 -23.017979 23.840050 # 4 -8938 8938 4 -19.729696 -22.195910 23.840050 # 4 -8939 8939 4 -18.085556 -23.017979 23.017979 # 4 -8940 8940 4 -17.263485 -22.195910 23.017979 # 4 -8941 8941 4 -17.263485 -23.017979 23.840050 # 4 -8942 8942 4 -18.085556 -22.195910 23.840050 # 4 -8943 8943 4 -16.441414 -23.017979 23.017979 # 4 -8944 8944 4 -15.619343 -22.195910 23.017979 # 4 -8945 8945 4 -15.619343 -23.017979 23.840050 # 4 -8946 8946 4 -16.441414 -22.195910 23.840050 # 4 -8947 8947 4 -14.797273 -23.017979 23.017979 # 4 -8948 8948 4 -13.975202 -22.195910 23.017979 # 4 -8949 8949 4 -13.975202 -23.017979 23.840050 # 4 -8950 8950 4 -14.797273 -22.195910 23.840050 # 4 -8951 8951 4 -13.153131 -23.017979 23.017979 # 4 -8952 8952 4 -12.331060 -22.195910 23.017979 # 4 -8953 8953 4 -12.331060 -23.017979 23.840050 # 4 -8954 8954 4 -13.153131 -22.195910 23.840050 # 4 -8955 8955 4 -11.508989 -23.017979 23.017979 # 4 -8956 8956 4 -10.686919 -22.195910 23.017979 # 4 -8957 8957 4 -10.686919 -23.017979 23.840050 # 4 -8958 8958 4 -11.508989 -22.195910 23.840050 # 4 -8959 8959 4 -9.864848 -23.017979 23.017979 # 4 -8960 8960 4 -9.042778 -22.195910 23.017979 # 4 -8961 8961 4 -9.042778 -23.017979 23.840050 # 4 -8962 8962 4 -9.864848 -22.195910 23.840050 # 4 -8963 8963 4 -24.662121 -21.373838 23.017979 # 4 -8964 8964 4 -23.840050 -20.551767 23.017979 # 4 -8965 8965 4 -23.840050 -21.373838 23.840050 # 4 -8966 8966 4 -24.662121 -20.551767 23.840050 # 4 -8967 8967 4 -23.017979 -21.373838 23.017979 # 4 -8968 8968 4 -22.195910 -20.551767 23.017979 # 4 -8969 8969 4 -22.195910 -21.373838 23.840050 # 4 -8970 8970 4 -23.017979 -20.551767 23.840050 # 4 -8971 8971 4 -21.373838 -21.373838 23.017979 # 4 -8972 8972 4 -20.551767 -20.551767 23.017979 # 4 -8973 8973 4 -20.551767 -21.373838 23.840050 # 4 -8974 8974 4 -21.373838 -20.551767 23.840050 # 4 -8975 8975 4 -19.729696 -21.373838 23.017979 # 4 -8976 8976 4 -18.907625 -20.551767 23.017979 # 4 -8977 8977 4 -18.907625 -21.373838 23.840050 # 4 -8978 8978 4 -19.729696 -20.551767 23.840050 # 4 -8979 8979 4 -18.085556 -21.373838 23.017979 # 4 -8980 8980 4 -17.263485 -20.551767 23.017979 # 4 -8981 8981 4 -17.263485 -21.373838 23.840050 # 4 -8982 8982 4 -18.085556 -20.551767 23.840050 # 4 -8983 8983 4 -16.441414 -21.373838 23.017979 # 4 -8984 8984 4 -15.619343 -20.551767 23.017979 # 4 -8985 8985 4 -15.619343 -21.373838 23.840050 # 4 -8986 8986 4 -16.441414 -20.551767 23.840050 # 4 -8987 8987 4 -14.797273 -21.373838 23.017979 # 4 -8988 8988 4 -13.975202 -20.551767 23.017979 # 4 -8989 8989 4 -13.975202 -21.373838 23.840050 # 4 -8990 8990 4 -14.797273 -20.551767 23.840050 # 4 -8991 8991 4 -13.153131 -21.373838 23.017979 # 4 -8992 8992 4 -12.331060 -20.551767 23.017979 # 4 -8993 8993 4 -12.331060 -21.373838 23.840050 # 4 -8994 8994 4 -13.153131 -20.551767 23.840050 # 4 -8995 8995 4 -11.508989 -21.373838 23.017979 # 4 -8996 8996 4 -10.686919 -20.551767 23.017979 # 4 -8997 8997 4 -10.686919 -21.373838 23.840050 # 4 -8998 8998 4 -11.508989 -20.551767 23.840050 # 4 -8999 8999 4 -9.864848 -21.373838 23.017979 # 4 -9000 9000 4 -9.042778 -20.551767 23.017979 # 4 -9001 9001 4 -9.042778 -21.373838 23.840050 # 4 -9002 9002 4 -9.864848 -20.551767 23.840050 # 4 -9003 9003 4 -23.840050 -23.840050 24.662121 # 4 -9004 9004 4 -22.195910 -23.840050 24.662121 # 4 -9005 9005 4 -20.551767 -23.840050 24.662121 # 4 -9006 9006 4 -18.907625 -23.840050 24.662121 # 4 -9007 9007 4 -17.263485 -23.840050 24.662121 # 4 -9008 9008 4 -15.619343 -23.840050 24.662121 # 4 -9009 9009 4 -13.975202 -23.840050 24.662121 # 4 -9010 9010 4 -12.331060 -23.840050 24.662121 # 4 -9011 9011 4 -10.686919 -23.840050 24.662121 # 4 -9012 9012 4 -9.042778 -23.840050 24.662121 # 4 -9013 9013 4 -24.662121 -23.017979 24.662121 # 4 -9014 9014 4 -23.840050 -22.195910 24.662121 # 4 -9015 9015 4 -23.017979 -23.017979 24.662121 # 4 -9016 9016 4 -22.195910 -22.195910 24.662121 # 4 -9017 9017 4 -21.373838 -23.017979 24.662121 # 4 -9018 9018 4 -20.551767 -22.195910 24.662121 # 4 -9019 9019 4 -19.729696 -23.017979 24.662121 # 4 -9020 9020 4 -18.907625 -22.195910 24.662121 # 4 -9021 9021 4 -18.085556 -23.017979 24.662121 # 4 -9022 9022 4 -17.263485 -22.195910 24.662121 # 4 -9023 9023 4 -16.441414 -23.017979 24.662121 # 4 -9024 9024 4 -15.619343 -22.195910 24.662121 # 4 -9025 9025 4 -14.797273 -23.017979 24.662121 # 4 -9026 9026 4 -13.975202 -22.195910 24.662121 # 4 -9027 9027 4 -13.153131 -23.017979 24.662121 # 4 -9028 9028 4 -12.331060 -22.195910 24.662121 # 4 -9029 9029 4 -11.508989 -23.017979 24.662121 # 4 -9030 9030 4 -10.686919 -22.195910 24.662121 # 4 -9031 9031 4 -9.864848 -23.017979 24.662121 # 4 -9032 9032 4 -9.042778 -22.195910 24.662121 # 4 -9033 9033 4 -24.662121 -21.373838 24.662121 # 4 -9034 9034 4 -23.840050 -20.551767 24.662121 # 4 -9035 9035 4 -23.017979 -21.373838 24.662121 # 4 -9036 9036 4 -22.195910 -20.551767 24.662121 # 4 -9037 9037 4 -21.373838 -21.373838 24.662121 # 4 -9038 9038 4 -20.551767 -20.551767 24.662121 # 4 -9039 9039 4 -19.729696 -21.373838 24.662121 # 4 -9040 9040 4 -18.907625 -20.551767 24.662121 # 4 -9041 9041 4 -18.085556 -21.373838 24.662121 # 4 -9042 9042 4 -17.263485 -20.551767 24.662121 # 4 -9043 9043 4 -16.441414 -21.373838 24.662121 # 4 -9044 9044 4 -15.619343 -20.551767 24.662121 # 4 -9045 9045 4 -14.797273 -21.373838 24.662121 # 4 -9046 9046 4 -13.975202 -20.551767 24.662121 # 4 -9047 9047 4 -13.153131 -21.373838 24.662121 # 4 -9048 9048 4 -12.331060 -20.551767 24.662121 # 4 -9049 9049 4 -11.508989 -21.373838 24.662121 # 4 -9050 9050 4 -10.686919 -20.551767 24.662121 # 4 -9051 9051 4 -9.864848 -21.373838 24.662121 # 4 -9052 9052 4 -9.042778 -20.551767 24.662121 # 4 -9053 9053 4 -8.220707 -23.840050 9.042778 # 4 -9054 9054 4 -6.576566 -23.840050 9.042778 # 4 -9055 9055 4 -4.932424 -23.840050 9.042778 # 4 -9056 9056 4 -3.288283 -23.840050 9.042778 # 4 -9057 9057 4 -1.644141 -23.840050 9.042778 # 4 -9058 9058 4 0.000000 -23.840050 9.042778 # 4 -9059 9059 4 1.644141 -23.840050 9.042778 # 4 -9060 9060 4 3.288283 -23.840050 9.042778 # 4 -9061 9061 4 4.932424 -23.840050 9.042778 # 4 -9062 9062 4 6.576566 -23.840050 9.042778 # 4 -9063 9063 4 8.220707 -23.840050 9.042778 # 4 -9064 9064 4 -7.398636 -23.017979 9.042778 # 4 -9065 9065 4 -8.220707 -22.195910 9.042778 # 4 -9066 9066 4 -5.754495 -23.017979 9.042778 # 4 -9067 9067 4 -6.576566 -22.195910 9.042778 # 4 -9068 9068 4 -4.110353 -23.017979 9.042778 # 4 -9069 9069 4 -4.932424 -22.195910 9.042778 # 4 -9070 9070 4 -2.466212 -23.017979 9.042778 # 4 -9071 9071 4 -3.288283 -22.195910 9.042778 # 4 -9072 9072 4 -0.822071 -23.017979 9.042778 # 4 -9073 9073 4 -1.644141 -22.195910 9.042778 # 4 -9074 9074 4 0.822071 -23.017979 9.042778 # 4 -9075 9075 4 0.000000 -22.195910 9.042778 # 4 -9076 9076 4 2.466212 -23.017979 9.042778 # 4 -9077 9077 4 1.644141 -22.195910 9.042778 # 4 -9078 9078 4 4.110353 -23.017979 9.042778 # 4 -9079 9079 4 3.288283 -22.195910 9.042778 # 4 -9080 9080 4 5.754495 -23.017979 9.042778 # 4 -9081 9081 4 4.932424 -22.195910 9.042778 # 4 -9082 9082 4 7.398636 -23.017979 9.042778 # 4 -9083 9083 4 6.576566 -22.195910 9.042778 # 4 -9084 9084 4 8.220707 -22.195910 9.042778 # 4 -9085 9085 4 -7.398636 -21.373838 9.042778 # 4 -9086 9086 4 -8.220707 -20.551767 9.042778 # 4 -9087 9087 4 -5.754495 -21.373838 9.042778 # 4 -9088 9088 4 -6.576566 -20.551767 9.042778 # 4 -9089 9089 4 -4.110353 -21.373838 9.042778 # 4 -9090 9090 4 -4.932424 -20.551767 9.042778 # 4 -9091 9091 4 -2.466212 -21.373838 9.042778 # 4 -9092 9092 4 -3.288283 -20.551767 9.042778 # 4 -9093 9093 4 -0.822071 -21.373838 9.042778 # 4 -9094 9094 4 -1.644141 -20.551767 9.042778 # 4 -9095 9095 4 0.822071 -21.373838 9.042778 # 4 -9096 9096 4 0.000000 -20.551767 9.042778 # 4 -9097 9097 4 2.466212 -21.373838 9.042778 # 4 -9098 9098 4 1.644141 -20.551767 9.042778 # 4 -9099 9099 4 4.110353 -21.373838 9.042778 # 4 -9100 9100 4 3.288283 -20.551767 9.042778 # 4 -9101 9101 4 5.754495 -21.373838 9.042778 # 4 -9102 9102 4 4.932424 -20.551767 9.042778 # 4 -9103 9103 4 7.398636 -21.373838 9.042778 # 4 -9104 9104 4 6.576566 -20.551767 9.042778 # 4 -9105 9105 4 8.220707 -20.551767 9.042778 # 4 -9106 9106 4 -7.398636 -23.840050 9.864848 # 4 -9107 9107 4 -8.220707 -23.840050 10.686919 # 4 -9108 9108 4 -5.754495 -23.840050 9.864848 # 4 -9109 9109 4 -6.576566 -23.840050 10.686919 # 4 -9110 9110 4 -4.110353 -23.840050 9.864848 # 4 -9111 9111 4 -4.932424 -23.840050 10.686919 # 4 -9112 9112 4 -2.466212 -23.840050 9.864848 # 4 -9113 9113 4 -3.288283 -23.840050 10.686919 # 4 -9114 9114 4 -0.822071 -23.840050 9.864848 # 4 -9115 9115 4 -1.644141 -23.840050 10.686919 # 4 -9116 9116 4 0.822071 -23.840050 9.864848 # 4 -9117 9117 4 0.000000 -23.840050 10.686919 # 4 -9118 9118 4 2.466212 -23.840050 9.864848 # 4 -9119 9119 4 1.644141 -23.840050 10.686919 # 4 -9120 9120 4 4.110353 -23.840050 9.864848 # 4 -9121 9121 4 3.288283 -23.840050 10.686919 # 4 -9122 9122 4 5.754495 -23.840050 9.864848 # 4 -9123 9123 4 4.932424 -23.840050 10.686919 # 4 -9124 9124 4 7.398636 -23.840050 9.864848 # 4 -9125 9125 4 6.576566 -23.840050 10.686919 # 4 -9126 9126 4 8.220707 -23.840050 10.686919 # 4 -9127 9127 4 -8.220707 -23.017979 9.864848 # 4 -9128 9128 4 -7.398636 -22.195910 9.864848 # 4 -9129 9129 4 -7.398636 -23.017979 10.686919 # 4 -9130 9130 4 -8.220707 -22.195910 10.686919 # 4 -9131 9131 4 -6.576566 -23.017979 9.864848 # 4 -9132 9132 4 -5.754495 -22.195910 9.864848 # 4 -9133 9133 4 -5.754495 -23.017979 10.686919 # 4 -9134 9134 4 -6.576566 -22.195910 10.686919 # 4 -9135 9135 4 -4.932424 -23.017979 9.864848 # 4 -9136 9136 4 -4.110353 -22.195910 9.864848 # 4 -9137 9137 4 -4.110353 -23.017979 10.686919 # 4 -9138 9138 4 -4.932424 -22.195910 10.686919 # 4 -9139 9139 4 -3.288283 -23.017979 9.864848 # 4 -9140 9140 4 -2.466212 -22.195910 9.864848 # 4 -9141 9141 4 -2.466212 -23.017979 10.686919 # 4 -9142 9142 4 -3.288283 -22.195910 10.686919 # 4 -9143 9143 4 -1.644141 -23.017979 9.864848 # 4 -9144 9144 4 -0.822071 -22.195910 9.864848 # 4 -9145 9145 4 -0.822071 -23.017979 10.686919 # 4 -9146 9146 4 -1.644141 -22.195910 10.686919 # 4 -9147 9147 4 0.000000 -23.017979 9.864848 # 4 -9148 9148 4 0.822071 -22.195910 9.864848 # 4 -9149 9149 4 0.822071 -23.017979 10.686919 # 4 -9150 9150 4 0.000000 -22.195910 10.686919 # 4 -9151 9151 4 1.644141 -23.017979 9.864848 # 4 -9152 9152 4 2.466212 -22.195910 9.864848 # 4 -9153 9153 4 2.466212 -23.017979 10.686919 # 4 -9154 9154 4 1.644141 -22.195910 10.686919 # 4 -9155 9155 4 3.288283 -23.017979 9.864848 # 4 -9156 9156 4 4.110353 -22.195910 9.864848 # 4 -9157 9157 4 4.110353 -23.017979 10.686919 # 4 -9158 9158 4 3.288283 -22.195910 10.686919 # 4 -9159 9159 4 4.932424 -23.017979 9.864848 # 4 -9160 9160 4 5.754495 -22.195910 9.864848 # 4 -9161 9161 4 5.754495 -23.017979 10.686919 # 4 -9162 9162 4 4.932424 -22.195910 10.686919 # 4 -9163 9163 4 6.576566 -23.017979 9.864848 # 4 -9164 9164 4 7.398636 -22.195910 9.864848 # 4 -9165 9165 4 7.398636 -23.017979 10.686919 # 4 -9166 9166 4 6.576566 -22.195910 10.686919 # 4 -9167 9167 4 8.220707 -23.017979 9.864848 # 4 -9168 9168 4 8.220707 -22.195910 10.686919 # 4 -9169 9169 4 -8.220707 -21.373838 9.864848 # 4 -9170 9170 4 -7.398636 -20.551767 9.864848 # 4 -9171 9171 4 -7.398636 -21.373838 10.686919 # 4 -9172 9172 4 -8.220707 -20.551767 10.686919 # 4 -9173 9173 4 -6.576566 -21.373838 9.864848 # 4 -9174 9174 4 -5.754495 -20.551767 9.864848 # 4 -9175 9175 4 -5.754495 -21.373838 10.686919 # 4 -9176 9176 4 -6.576566 -20.551767 10.686919 # 4 -9177 9177 4 -4.932424 -21.373838 9.864848 # 4 -9178 9178 4 -4.110353 -20.551767 9.864848 # 4 -9179 9179 4 -4.110353 -21.373838 10.686919 # 4 -9180 9180 4 -4.932424 -20.551767 10.686919 # 4 -9181 9181 4 -3.288283 -21.373838 9.864848 # 4 -9182 9182 4 -2.466212 -20.551767 9.864848 # 4 -9183 9183 4 -2.466212 -21.373838 10.686919 # 4 -9184 9184 4 -3.288283 -20.551767 10.686919 # 4 -9185 9185 4 -1.644141 -21.373838 9.864848 # 4 -9186 9186 4 -0.822071 -20.551767 9.864848 # 4 -9187 9187 4 -0.822071 -21.373838 10.686919 # 4 -9188 9188 4 -1.644141 -20.551767 10.686919 # 4 -9189 9189 4 0.000000 -21.373838 9.864848 # 4 -9190 9190 4 0.822071 -20.551767 9.864848 # 4 -9191 9191 4 0.822071 -21.373838 10.686919 # 4 -9192 9192 4 0.000000 -20.551767 10.686919 # 4 -9193 9193 4 1.644141 -21.373838 9.864848 # 4 -9194 9194 4 2.466212 -20.551767 9.864848 # 4 -9195 9195 4 2.466212 -21.373838 10.686919 # 4 -9196 9196 4 1.644141 -20.551767 10.686919 # 4 -9197 9197 4 3.288283 -21.373838 9.864848 # 4 -9198 9198 4 4.110353 -20.551767 9.864848 # 4 -9199 9199 4 4.110353 -21.373838 10.686919 # 4 -9200 9200 4 3.288283 -20.551767 10.686919 # 4 -9201 9201 4 4.932424 -21.373838 9.864848 # 4 -9202 9202 4 5.754495 -20.551767 9.864848 # 4 -9203 9203 4 5.754495 -21.373838 10.686919 # 4 -9204 9204 4 4.932424 -20.551767 10.686919 # 4 -9205 9205 4 6.576566 -21.373838 9.864848 # 4 -9206 9206 4 7.398636 -20.551767 9.864848 # 4 -9207 9207 4 7.398636 -21.373838 10.686919 # 4 -9208 9208 4 6.576566 -20.551767 10.686919 # 4 -9209 9209 4 8.220707 -21.373838 9.864848 # 4 -9210 9210 4 8.220707 -20.551767 10.686919 # 4 -9211 9211 4 -7.398636 -23.840050 11.508989 # 4 -9212 9212 4 -8.220707 -23.840050 12.331060 # 4 -9213 9213 4 -5.754495 -23.840050 11.508989 # 4 -9214 9214 4 -6.576566 -23.840050 12.331060 # 4 -9215 9215 4 -4.110353 -23.840050 11.508989 # 4 -9216 9216 4 -4.932424 -23.840050 12.331060 # 4 -9217 9217 4 -2.466212 -23.840050 11.508989 # 4 -9218 9218 4 -3.288283 -23.840050 12.331060 # 4 -9219 9219 4 -0.822071 -23.840050 11.508989 # 4 -9220 9220 4 -1.644141 -23.840050 12.331060 # 4 -9221 9221 4 0.822071 -23.840050 11.508989 # 4 -9222 9222 4 0.000000 -23.840050 12.331060 # 4 -9223 9223 4 2.466212 -23.840050 11.508989 # 4 -9224 9224 4 1.644141 -23.840050 12.331060 # 4 -9225 9225 4 4.110353 -23.840050 11.508989 # 4 -9226 9226 4 3.288283 -23.840050 12.331060 # 4 -9227 9227 4 5.754495 -23.840050 11.508989 # 4 -9228 9228 4 4.932424 -23.840050 12.331060 # 4 -9229 9229 4 7.398636 -23.840050 11.508989 # 4 -9230 9230 4 6.576566 -23.840050 12.331060 # 4 -9231 9231 4 8.220707 -23.840050 12.331060 # 4 -9232 9232 4 -8.220707 -23.017979 11.508989 # 4 -9233 9233 4 -7.398636 -22.195910 11.508989 # 4 -9234 9234 4 -7.398636 -23.017979 12.331060 # 4 -9235 9235 4 -8.220707 -22.195910 12.331060 # 4 -9236 9236 4 -6.576566 -23.017979 11.508989 # 4 -9237 9237 4 -5.754495 -22.195910 11.508989 # 4 -9238 9238 4 -5.754495 -23.017979 12.331060 # 4 -9239 9239 4 -6.576566 -22.195910 12.331060 # 4 -9240 9240 4 -4.932424 -23.017979 11.508989 # 4 -9241 9241 4 -4.110353 -22.195910 11.508989 # 4 -9242 9242 4 -4.110353 -23.017979 12.331060 # 4 -9243 9243 4 -4.932424 -22.195910 12.331060 # 4 -9244 9244 4 -3.288283 -23.017979 11.508989 # 4 -9245 9245 4 -2.466212 -22.195910 11.508989 # 4 -9246 9246 4 -2.466212 -23.017979 12.331060 # 4 -9247 9247 4 -3.288283 -22.195910 12.331060 # 4 -9248 9248 4 -1.644141 -23.017979 11.508989 # 4 -9249 9249 4 -0.822071 -22.195910 11.508989 # 4 -9250 9250 4 -0.822071 -23.017979 12.331060 # 4 -9251 9251 4 -1.644141 -22.195910 12.331060 # 4 -9252 9252 4 0.000000 -23.017979 11.508989 # 4 -9253 9253 4 0.822071 -22.195910 11.508989 # 4 -9254 9254 4 0.822071 -23.017979 12.331060 # 4 -9255 9255 4 0.000000 -22.195910 12.331060 # 4 -9256 9256 4 1.644141 -23.017979 11.508989 # 4 -9257 9257 4 2.466212 -22.195910 11.508989 # 4 -9258 9258 4 2.466212 -23.017979 12.331060 # 4 -9259 9259 4 1.644141 -22.195910 12.331060 # 4 -9260 9260 4 3.288283 -23.017979 11.508989 # 4 -9261 9261 4 4.110353 -22.195910 11.508989 # 4 -9262 9262 4 4.110353 -23.017979 12.331060 # 4 -9263 9263 4 3.288283 -22.195910 12.331060 # 4 -9264 9264 4 4.932424 -23.017979 11.508989 # 4 -9265 9265 4 5.754495 -22.195910 11.508989 # 4 -9266 9266 4 5.754495 -23.017979 12.331060 # 4 -9267 9267 4 4.932424 -22.195910 12.331060 # 4 -9268 9268 4 6.576566 -23.017979 11.508989 # 4 -9269 9269 4 7.398636 -22.195910 11.508989 # 4 -9270 9270 4 7.398636 -23.017979 12.331060 # 4 -9271 9271 4 6.576566 -22.195910 12.331060 # 4 -9272 9272 4 8.220707 -23.017979 11.508989 # 4 -9273 9273 4 8.220707 -22.195910 12.331060 # 4 -9274 9274 4 -8.220707 -21.373838 11.508989 # 4 -9275 9275 4 -7.398636 -20.551767 11.508989 # 4 -9276 9276 4 -7.398636 -21.373838 12.331060 # 4 -9277 9277 4 -8.220707 -20.551767 12.331060 # 4 -9278 9278 4 -6.576566 -21.373838 11.508989 # 4 -9279 9279 4 -5.754495 -20.551767 11.508989 # 4 -9280 9280 4 -5.754495 -21.373838 12.331060 # 4 -9281 9281 4 -6.576566 -20.551767 12.331060 # 4 -9282 9282 4 -4.932424 -21.373838 11.508989 # 4 -9283 9283 4 -4.110353 -20.551767 11.508989 # 4 -9284 9284 4 -4.110353 -21.373838 12.331060 # 4 -9285 9285 4 -4.932424 -20.551767 12.331060 # 4 -9286 9286 4 -3.288283 -21.373838 11.508989 # 4 -9287 9287 4 -2.466212 -20.551767 11.508989 # 4 -9288 9288 4 -2.466212 -21.373838 12.331060 # 4 -9289 9289 4 -3.288283 -20.551767 12.331060 # 4 -9290 9290 4 -1.644141 -21.373838 11.508989 # 4 -9291 9291 4 -0.822071 -20.551767 11.508989 # 4 -9292 9292 4 -0.822071 -21.373838 12.331060 # 4 -9293 9293 4 -1.644141 -20.551767 12.331060 # 4 -9294 9294 4 0.000000 -21.373838 11.508989 # 4 -9295 9295 4 0.822071 -20.551767 11.508989 # 4 -9296 9296 4 0.822071 -21.373838 12.331060 # 4 -9297 9297 4 0.000000 -20.551767 12.331060 # 4 -9298 9298 4 1.644141 -21.373838 11.508989 # 4 -9299 9299 4 2.466212 -20.551767 11.508989 # 4 -9300 9300 4 2.466212 -21.373838 12.331060 # 4 -9301 9301 4 1.644141 -20.551767 12.331060 # 4 -9302 9302 4 3.288283 -21.373838 11.508989 # 4 -9303 9303 4 4.110353 -20.551767 11.508989 # 4 -9304 9304 4 4.110353 -21.373838 12.331060 # 4 -9305 9305 4 3.288283 -20.551767 12.331060 # 4 -9306 9306 4 4.932424 -21.373838 11.508989 # 4 -9307 9307 4 5.754495 -20.551767 11.508989 # 4 -9308 9308 4 5.754495 -21.373838 12.331060 # 4 -9309 9309 4 4.932424 -20.551767 12.331060 # 4 -9310 9310 4 6.576566 -21.373838 11.508989 # 4 -9311 9311 4 7.398636 -20.551767 11.508989 # 4 -9312 9312 4 7.398636 -21.373838 12.331060 # 4 -9313 9313 4 6.576566 -20.551767 12.331060 # 4 -9314 9314 4 8.220707 -21.373838 11.508989 # 4 -9315 9315 4 8.220707 -20.551767 12.331060 # 4 -9316 9316 4 -7.398636 -23.840050 13.153131 # 4 -9317 9317 4 -8.220707 -23.840050 13.975202 # 4 -9318 9318 4 -5.754495 -23.840050 13.153131 # 4 -9319 9319 4 -6.576566 -23.840050 13.975202 # 4 -9320 9320 4 -4.110353 -23.840050 13.153131 # 4 -9321 9321 4 -4.932424 -23.840050 13.975202 # 4 -9322 9322 4 -2.466212 -23.840050 13.153131 # 4 -9323 9323 4 -3.288283 -23.840050 13.975202 # 4 -9324 9324 4 -0.822071 -23.840050 13.153131 # 4 -9325 9325 4 -1.644141 -23.840050 13.975202 # 4 -9326 9326 4 0.822071 -23.840050 13.153131 # 4 -9327 9327 4 0.000000 -23.840050 13.975202 # 4 -9328 9328 4 2.466212 -23.840050 13.153131 # 4 -9329 9329 4 1.644141 -23.840050 13.975202 # 4 -9330 9330 4 4.110353 -23.840050 13.153131 # 4 -9331 9331 4 3.288283 -23.840050 13.975202 # 4 -9332 9332 4 5.754495 -23.840050 13.153131 # 4 -9333 9333 4 4.932424 -23.840050 13.975202 # 4 -9334 9334 4 7.398636 -23.840050 13.153131 # 4 -9335 9335 4 6.576566 -23.840050 13.975202 # 4 -9336 9336 4 8.220707 -23.840050 13.975202 # 4 -9337 9337 4 -8.220707 -23.017979 13.153131 # 4 -9338 9338 4 -7.398636 -22.195910 13.153131 # 4 -9339 9339 4 -7.398636 -23.017979 13.975202 # 4 -9340 9340 4 -8.220707 -22.195910 13.975202 # 4 -9341 9341 4 -6.576566 -23.017979 13.153131 # 4 -9342 9342 4 -5.754495 -22.195910 13.153131 # 4 -9343 9343 4 -5.754495 -23.017979 13.975202 # 4 -9344 9344 4 -6.576566 -22.195910 13.975202 # 4 -9345 9345 4 -4.932424 -23.017979 13.153131 # 4 -9346 9346 4 -4.110353 -22.195910 13.153131 # 4 -9347 9347 4 -4.110353 -23.017979 13.975202 # 4 -9348 9348 4 -4.932424 -22.195910 13.975202 # 4 -9349 9349 4 -3.288283 -23.017979 13.153131 # 4 -9350 9350 4 -2.466212 -22.195910 13.153131 # 4 -9351 9351 4 -2.466212 -23.017979 13.975202 # 4 -9352 9352 4 -3.288283 -22.195910 13.975202 # 4 -9353 9353 4 -1.644141 -23.017979 13.153131 # 4 -9354 9354 4 -0.822071 -22.195910 13.153131 # 4 -9355 9355 4 -0.822071 -23.017979 13.975202 # 4 -9356 9356 4 -1.644141 -22.195910 13.975202 # 4 -9357 9357 4 0.000000 -23.017979 13.153131 # 4 -9358 9358 4 0.822071 -22.195910 13.153131 # 4 -9359 9359 4 0.822071 -23.017979 13.975202 # 4 -9360 9360 4 0.000000 -22.195910 13.975202 # 4 -9361 9361 4 1.644141 -23.017979 13.153131 # 4 -9362 9362 4 2.466212 -22.195910 13.153131 # 4 -9363 9363 4 2.466212 -23.017979 13.975202 # 4 -9364 9364 4 1.644141 -22.195910 13.975202 # 4 -9365 9365 4 3.288283 -23.017979 13.153131 # 4 -9366 9366 4 4.110353 -22.195910 13.153131 # 4 -9367 9367 4 4.110353 -23.017979 13.975202 # 4 -9368 9368 4 3.288283 -22.195910 13.975202 # 4 -9369 9369 4 4.932424 -23.017979 13.153131 # 4 -9370 9370 4 5.754495 -22.195910 13.153131 # 4 -9371 9371 4 5.754495 -23.017979 13.975202 # 4 -9372 9372 4 4.932424 -22.195910 13.975202 # 4 -9373 9373 4 6.576566 -23.017979 13.153131 # 4 -9374 9374 4 7.398636 -22.195910 13.153131 # 4 -9375 9375 4 7.398636 -23.017979 13.975202 # 4 -9376 9376 4 6.576566 -22.195910 13.975202 # 4 -9377 9377 4 8.220707 -23.017979 13.153131 # 4 -9378 9378 4 8.220707 -22.195910 13.975202 # 4 -9379 9379 4 -8.220707 -21.373838 13.153131 # 4 -9380 9380 4 -7.398636 -20.551767 13.153131 # 4 -9381 9381 4 -7.398636 -21.373838 13.975202 # 4 -9382 9382 4 -8.220707 -20.551767 13.975202 # 4 -9383 9383 4 -6.576566 -21.373838 13.153131 # 4 -9384 9384 4 -5.754495 -20.551767 13.153131 # 4 -9385 9385 4 -5.754495 -21.373838 13.975202 # 4 -9386 9386 4 -6.576566 -20.551767 13.975202 # 4 -9387 9387 4 -4.932424 -21.373838 13.153131 # 4 -9388 9388 4 -4.110353 -20.551767 13.153131 # 4 -9389 9389 4 -4.110353 -21.373838 13.975202 # 4 -9390 9390 4 -4.932424 -20.551767 13.975202 # 4 -9391 9391 4 -3.288283 -21.373838 13.153131 # 4 -9392 9392 4 -2.466212 -20.551767 13.153131 # 4 -9393 9393 4 -2.466212 -21.373838 13.975202 # 4 -9394 9394 4 -3.288283 -20.551767 13.975202 # 4 -9395 9395 4 -1.644141 -21.373838 13.153131 # 4 -9396 9396 4 -0.822071 -20.551767 13.153131 # 4 -9397 9397 4 -0.822071 -21.373838 13.975202 # 4 -9398 9398 4 -1.644141 -20.551767 13.975202 # 4 -9399 9399 4 0.000000 -21.373838 13.153131 # 4 -9400 9400 4 0.822071 -20.551767 13.153131 # 4 -9401 9401 4 0.822071 -21.373838 13.975202 # 4 -9402 9402 4 0.000000 -20.551767 13.975202 # 4 -9403 9403 4 1.644141 -21.373838 13.153131 # 4 -9404 9404 4 2.466212 -20.551767 13.153131 # 4 -9405 9405 4 2.466212 -21.373838 13.975202 # 4 -9406 9406 4 1.644141 -20.551767 13.975202 # 4 -9407 9407 4 3.288283 -21.373838 13.153131 # 4 -9408 9408 4 4.110353 -20.551767 13.153131 # 4 -9409 9409 4 4.110353 -21.373838 13.975202 # 4 -9410 9410 4 3.288283 -20.551767 13.975202 # 4 -9411 9411 4 4.932424 -21.373838 13.153131 # 4 -9412 9412 4 5.754495 -20.551767 13.153131 # 4 -9413 9413 4 5.754495 -21.373838 13.975202 # 4 -9414 9414 4 4.932424 -20.551767 13.975202 # 4 -9415 9415 4 6.576566 -21.373838 13.153131 # 4 -9416 9416 4 7.398636 -20.551767 13.153131 # 4 -9417 9417 4 7.398636 -21.373838 13.975202 # 4 -9418 9418 4 6.576566 -20.551767 13.975202 # 4 -9419 9419 4 8.220707 -21.373838 13.153131 # 4 -9420 9420 4 8.220707 -20.551767 13.975202 # 4 -9421 9421 4 -7.398636 -23.840050 14.797273 # 4 -9422 9422 4 -8.220707 -23.840050 15.619343 # 4 -9423 9423 4 -5.754495 -23.840050 14.797273 # 4 -9424 9424 4 -6.576566 -23.840050 15.619343 # 4 -9425 9425 4 -4.110353 -23.840050 14.797273 # 4 -9426 9426 4 -4.932424 -23.840050 15.619343 # 4 -9427 9427 4 -2.466212 -23.840050 14.797273 # 4 -9428 9428 4 -3.288283 -23.840050 15.619343 # 4 -9429 9429 4 -0.822071 -23.840050 14.797273 # 4 -9430 9430 4 -1.644141 -23.840050 15.619343 # 4 -9431 9431 4 0.822071 -23.840050 14.797273 # 4 -9432 9432 4 0.000000 -23.840050 15.619343 # 4 -9433 9433 4 2.466212 -23.840050 14.797273 # 4 -9434 9434 4 1.644141 -23.840050 15.619343 # 4 -9435 9435 4 4.110353 -23.840050 14.797273 # 4 -9436 9436 4 3.288283 -23.840050 15.619343 # 4 -9437 9437 4 5.754495 -23.840050 14.797273 # 4 -9438 9438 4 4.932424 -23.840050 15.619343 # 4 -9439 9439 4 7.398636 -23.840050 14.797273 # 4 -9440 9440 4 6.576566 -23.840050 15.619343 # 4 -9441 9441 4 8.220707 -23.840050 15.619343 # 4 -9442 9442 4 -8.220707 -23.017979 14.797273 # 4 -9443 9443 4 -7.398636 -22.195910 14.797273 # 4 -9444 9444 4 -7.398636 -23.017979 15.619343 # 4 -9445 9445 4 -8.220707 -22.195910 15.619343 # 4 -9446 9446 4 -6.576566 -23.017979 14.797273 # 4 -9447 9447 4 -5.754495 -22.195910 14.797273 # 4 -9448 9448 4 -5.754495 -23.017979 15.619343 # 4 -9449 9449 4 -6.576566 -22.195910 15.619343 # 4 -9450 9450 4 -4.932424 -23.017979 14.797273 # 4 -9451 9451 4 -4.110353 -22.195910 14.797273 # 4 -9452 9452 4 -4.110353 -23.017979 15.619343 # 4 -9453 9453 4 -4.932424 -22.195910 15.619343 # 4 -9454 9454 4 -3.288283 -23.017979 14.797273 # 4 -9455 9455 4 -2.466212 -22.195910 14.797273 # 4 -9456 9456 4 -2.466212 -23.017979 15.619343 # 4 -9457 9457 4 -3.288283 -22.195910 15.619343 # 4 -9458 9458 4 -1.644141 -23.017979 14.797273 # 4 -9459 9459 4 -0.822071 -22.195910 14.797273 # 4 -9460 9460 4 -0.822071 -23.017979 15.619343 # 4 -9461 9461 4 -1.644141 -22.195910 15.619343 # 4 -9462 9462 4 0.000000 -23.017979 14.797273 # 4 -9463 9463 4 0.822071 -22.195910 14.797273 # 4 -9464 9464 4 0.822071 -23.017979 15.619343 # 4 -9465 9465 4 0.000000 -22.195910 15.619343 # 4 -9466 9466 4 1.644141 -23.017979 14.797273 # 4 -9467 9467 4 2.466212 -22.195910 14.797273 # 4 -9468 9468 4 2.466212 -23.017979 15.619343 # 4 -9469 9469 4 1.644141 -22.195910 15.619343 # 4 -9470 9470 4 3.288283 -23.017979 14.797273 # 4 -9471 9471 4 4.110353 -22.195910 14.797273 # 4 -9472 9472 4 4.110353 -23.017979 15.619343 # 4 -9473 9473 4 3.288283 -22.195910 15.619343 # 4 -9474 9474 4 4.932424 -23.017979 14.797273 # 4 -9475 9475 4 5.754495 -22.195910 14.797273 # 4 -9476 9476 4 5.754495 -23.017979 15.619343 # 4 -9477 9477 4 4.932424 -22.195910 15.619343 # 4 -9478 9478 4 6.576566 -23.017979 14.797273 # 4 -9479 9479 4 7.398636 -22.195910 14.797273 # 4 -9480 9480 4 7.398636 -23.017979 15.619343 # 4 -9481 9481 4 6.576566 -22.195910 15.619343 # 4 -9482 9482 4 8.220707 -23.017979 14.797273 # 4 -9483 9483 4 8.220707 -22.195910 15.619343 # 4 -9484 9484 4 -8.220707 -21.373838 14.797273 # 4 -9485 9485 4 -7.398636 -20.551767 14.797273 # 4 -9486 9486 4 -7.398636 -21.373838 15.619343 # 4 -9487 9487 4 -8.220707 -20.551767 15.619343 # 4 -9488 9488 4 -6.576566 -21.373838 14.797273 # 4 -9489 9489 4 -5.754495 -20.551767 14.797273 # 4 -9490 9490 4 -5.754495 -21.373838 15.619343 # 4 -9491 9491 4 -6.576566 -20.551767 15.619343 # 4 -9492 9492 4 -4.932424 -21.373838 14.797273 # 4 -9493 9493 4 -4.110353 -20.551767 14.797273 # 4 -9494 9494 4 -4.110353 -21.373838 15.619343 # 4 -9495 9495 4 -4.932424 -20.551767 15.619343 # 4 -9496 9496 4 -3.288283 -21.373838 14.797273 # 4 -9497 9497 4 -2.466212 -20.551767 14.797273 # 4 -9498 9498 4 -2.466212 -21.373838 15.619343 # 4 -9499 9499 4 -3.288283 -20.551767 15.619343 # 4 -9500 9500 4 -1.644141 -21.373838 14.797273 # 4 -9501 9501 4 -0.822071 -20.551767 14.797273 # 4 -9502 9502 4 -0.822071 -21.373838 15.619343 # 4 -9503 9503 4 -1.644141 -20.551767 15.619343 # 4 -9504 9504 4 0.000000 -21.373838 14.797273 # 4 -9505 9505 4 0.822071 -20.551767 14.797273 # 4 -9506 9506 4 0.822071 -21.373838 15.619343 # 4 -9507 9507 4 0.000000 -20.551767 15.619343 # 4 -9508 9508 4 1.644141 -21.373838 14.797273 # 4 -9509 9509 4 2.466212 -20.551767 14.797273 # 4 -9510 9510 4 2.466212 -21.373838 15.619343 # 4 -9511 9511 4 1.644141 -20.551767 15.619343 # 4 -9512 9512 4 3.288283 -21.373838 14.797273 # 4 -9513 9513 4 4.110353 -20.551767 14.797273 # 4 -9514 9514 4 4.110353 -21.373838 15.619343 # 4 -9515 9515 4 3.288283 -20.551767 15.619343 # 4 -9516 9516 4 4.932424 -21.373838 14.797273 # 4 -9517 9517 4 5.754495 -20.551767 14.797273 # 4 -9518 9518 4 5.754495 -21.373838 15.619343 # 4 -9519 9519 4 4.932424 -20.551767 15.619343 # 4 -9520 9520 4 6.576566 -21.373838 14.797273 # 4 -9521 9521 4 7.398636 -20.551767 14.797273 # 4 -9522 9522 4 7.398636 -21.373838 15.619343 # 4 -9523 9523 4 6.576566 -20.551767 15.619343 # 4 -9524 9524 4 8.220707 -21.373838 14.797273 # 4 -9525 9525 4 8.220707 -20.551767 15.619343 # 4 -9526 9526 4 -7.398636 -23.840050 16.441414 # 4 -9527 9527 4 -8.220707 -23.840050 17.263485 # 4 -9528 9528 4 -5.754495 -23.840050 16.441414 # 4 -9529 9529 4 -6.576566 -23.840050 17.263485 # 4 -9530 9530 4 -4.110353 -23.840050 16.441414 # 4 -9531 9531 4 -4.932424 -23.840050 17.263485 # 4 -9532 9532 4 -2.466212 -23.840050 16.441414 # 4 -9533 9533 4 -3.288283 -23.840050 17.263485 # 4 -9534 9534 4 -0.822071 -23.840050 16.441414 # 4 -9535 9535 4 -1.644141 -23.840050 17.263485 # 4 -9536 9536 4 0.822071 -23.840050 16.441414 # 4 -9537 9537 4 0.000000 -23.840050 17.263485 # 4 -9538 9538 4 2.466212 -23.840050 16.441414 # 4 -9539 9539 4 1.644141 -23.840050 17.263485 # 4 -9540 9540 4 4.110353 -23.840050 16.441414 # 4 -9541 9541 4 3.288283 -23.840050 17.263485 # 4 -9542 9542 4 5.754495 -23.840050 16.441414 # 4 -9543 9543 4 4.932424 -23.840050 17.263485 # 4 -9544 9544 4 7.398636 -23.840050 16.441414 # 4 -9545 9545 4 6.576566 -23.840050 17.263485 # 4 -9546 9546 4 8.220707 -23.840050 17.263485 # 4 -9547 9547 4 -8.220707 -23.017979 16.441414 # 4 -9548 9548 4 -7.398636 -22.195910 16.441414 # 4 -9549 9549 4 -7.398636 -23.017979 17.263485 # 4 -9550 9550 4 -8.220707 -22.195910 17.263485 # 4 -9551 9551 4 -6.576566 -23.017979 16.441414 # 4 -9552 9552 4 -5.754495 -22.195910 16.441414 # 4 -9553 9553 4 -5.754495 -23.017979 17.263485 # 4 -9554 9554 4 -6.576566 -22.195910 17.263485 # 4 -9555 9555 4 -4.932424 -23.017979 16.441414 # 4 -9556 9556 4 -4.110353 -22.195910 16.441414 # 4 -9557 9557 4 -4.110353 -23.017979 17.263485 # 4 -9558 9558 4 -4.932424 -22.195910 17.263485 # 4 -9559 9559 4 -3.288283 -23.017979 16.441414 # 4 -9560 9560 4 -2.466212 -22.195910 16.441414 # 4 -9561 9561 4 -2.466212 -23.017979 17.263485 # 4 -9562 9562 4 -3.288283 -22.195910 17.263485 # 4 -9563 9563 4 -1.644141 -23.017979 16.441414 # 4 -9564 9564 4 -0.822071 -22.195910 16.441414 # 4 -9565 9565 4 -0.822071 -23.017979 17.263485 # 4 -9566 9566 4 -1.644141 -22.195910 17.263485 # 4 -9567 9567 4 0.000000 -23.017979 16.441414 # 4 -9568 9568 4 0.822071 -22.195910 16.441414 # 4 -9569 9569 4 0.822071 -23.017979 17.263485 # 4 -9570 9570 4 0.000000 -22.195910 17.263485 # 4 -9571 9571 4 1.644141 -23.017979 16.441414 # 4 -9572 9572 4 2.466212 -22.195910 16.441414 # 4 -9573 9573 4 2.466212 -23.017979 17.263485 # 4 -9574 9574 4 1.644141 -22.195910 17.263485 # 4 -9575 9575 4 3.288283 -23.017979 16.441414 # 4 -9576 9576 4 4.110353 -22.195910 16.441414 # 4 -9577 9577 4 4.110353 -23.017979 17.263485 # 4 -9578 9578 4 3.288283 -22.195910 17.263485 # 4 -9579 9579 4 4.932424 -23.017979 16.441414 # 4 -9580 9580 4 5.754495 -22.195910 16.441414 # 4 -9581 9581 4 5.754495 -23.017979 17.263485 # 4 -9582 9582 4 4.932424 -22.195910 17.263485 # 4 -9583 9583 4 6.576566 -23.017979 16.441414 # 4 -9584 9584 4 7.398636 -22.195910 16.441414 # 4 -9585 9585 4 7.398636 -23.017979 17.263485 # 4 -9586 9586 4 6.576566 -22.195910 17.263485 # 4 -9587 9587 4 8.220707 -23.017979 16.441414 # 4 -9588 9588 4 8.220707 -22.195910 17.263485 # 4 -9589 9589 4 -8.220707 -21.373838 16.441414 # 4 -9590 9590 4 -7.398636 -20.551767 16.441414 # 4 -9591 9591 4 -7.398636 -21.373838 17.263485 # 4 -9592 9592 4 -8.220707 -20.551767 17.263485 # 4 -9593 9593 4 -6.576566 -21.373838 16.441414 # 4 -9594 9594 4 -5.754495 -20.551767 16.441414 # 4 -9595 9595 4 -5.754495 -21.373838 17.263485 # 4 -9596 9596 4 -6.576566 -20.551767 17.263485 # 4 -9597 9597 4 -4.932424 -21.373838 16.441414 # 4 -9598 9598 4 -4.110353 -20.551767 16.441414 # 4 -9599 9599 4 -4.110353 -21.373838 17.263485 # 4 -9600 9600 4 -4.932424 -20.551767 17.263485 # 4 -9601 9601 4 -3.288283 -21.373838 16.441414 # 4 -9602 9602 4 -2.466212 -20.551767 16.441414 # 4 -9603 9603 4 -2.466212 -21.373838 17.263485 # 4 -9604 9604 4 -3.288283 -20.551767 17.263485 # 4 -9605 9605 4 -1.644141 -21.373838 16.441414 # 4 -9606 9606 4 -0.822071 -20.551767 16.441414 # 4 -9607 9607 4 -0.822071 -21.373838 17.263485 # 4 -9608 9608 4 -1.644141 -20.551767 17.263485 # 4 -9609 9609 4 0.000000 -21.373838 16.441414 # 4 -9610 9610 4 0.822071 -20.551767 16.441414 # 4 -9611 9611 4 0.822071 -21.373838 17.263485 # 4 -9612 9612 4 0.000000 -20.551767 17.263485 # 4 -9613 9613 4 1.644141 -21.373838 16.441414 # 4 -9614 9614 4 2.466212 -20.551767 16.441414 # 4 -9615 9615 4 2.466212 -21.373838 17.263485 # 4 -9616 9616 4 1.644141 -20.551767 17.263485 # 4 -9617 9617 4 3.288283 -21.373838 16.441414 # 4 -9618 9618 4 4.110353 -20.551767 16.441414 # 4 -9619 9619 4 4.110353 -21.373838 17.263485 # 4 -9620 9620 4 3.288283 -20.551767 17.263485 # 4 -9621 9621 4 4.932424 -21.373838 16.441414 # 4 -9622 9622 4 5.754495 -20.551767 16.441414 # 4 -9623 9623 4 5.754495 -21.373838 17.263485 # 4 -9624 9624 4 4.932424 -20.551767 17.263485 # 4 -9625 9625 4 6.576566 -21.373838 16.441414 # 4 -9626 9626 4 7.398636 -20.551767 16.441414 # 4 -9627 9627 4 7.398636 -21.373838 17.263485 # 4 -9628 9628 4 6.576566 -20.551767 17.263485 # 4 -9629 9629 4 8.220707 -21.373838 16.441414 # 4 -9630 9630 4 8.220707 -20.551767 17.263485 # 4 -9631 9631 4 -7.398636 -23.840050 18.085556 # 4 -9632 9632 4 -8.220707 -23.840050 18.907625 # 4 -9633 9633 4 -5.754495 -23.840050 18.085556 # 4 -9634 9634 4 -6.576566 -23.840050 18.907625 # 4 -9635 9635 4 -4.110353 -23.840050 18.085556 # 4 -9636 9636 4 -4.932424 -23.840050 18.907625 # 4 -9637 9637 4 -2.466212 -23.840050 18.085556 # 4 -9638 9638 4 -3.288283 -23.840050 18.907625 # 4 -9639 9639 4 -0.822071 -23.840050 18.085556 # 4 -9640 9640 4 -1.644141 -23.840050 18.907625 # 4 -9641 9641 4 0.822071 -23.840050 18.085556 # 4 -9642 9642 4 0.000000 -23.840050 18.907625 # 4 -9643 9643 4 2.466212 -23.840050 18.085556 # 4 -9644 9644 4 1.644141 -23.840050 18.907625 # 4 -9645 9645 4 4.110353 -23.840050 18.085556 # 4 -9646 9646 4 3.288283 -23.840050 18.907625 # 4 -9647 9647 4 5.754495 -23.840050 18.085556 # 4 -9648 9648 4 4.932424 -23.840050 18.907625 # 4 -9649 9649 4 7.398636 -23.840050 18.085556 # 4 -9650 9650 4 6.576566 -23.840050 18.907625 # 4 -9651 9651 4 8.220707 -23.840050 18.907625 # 4 -9652 9652 4 -8.220707 -23.017979 18.085556 # 4 -9653 9653 4 -7.398636 -22.195910 18.085556 # 4 -9654 9654 4 -7.398636 -23.017979 18.907625 # 4 -9655 9655 4 -8.220707 -22.195910 18.907625 # 4 -9656 9656 4 -6.576566 -23.017979 18.085556 # 4 -9657 9657 4 -5.754495 -22.195910 18.085556 # 4 -9658 9658 4 -5.754495 -23.017979 18.907625 # 4 -9659 9659 4 -6.576566 -22.195910 18.907625 # 4 -9660 9660 4 -4.932424 -23.017979 18.085556 # 4 -9661 9661 4 -4.110353 -22.195910 18.085556 # 4 -9662 9662 4 -4.110353 -23.017979 18.907625 # 4 -9663 9663 4 -4.932424 -22.195910 18.907625 # 4 -9664 9664 4 -3.288283 -23.017979 18.085556 # 4 -9665 9665 4 -2.466212 -22.195910 18.085556 # 4 -9666 9666 4 -2.466212 -23.017979 18.907625 # 4 -9667 9667 4 -3.288283 -22.195910 18.907625 # 4 -9668 9668 4 -1.644141 -23.017979 18.085556 # 4 -9669 9669 4 -0.822071 -22.195910 18.085556 # 4 -9670 9670 4 -0.822071 -23.017979 18.907625 # 4 -9671 9671 4 -1.644141 -22.195910 18.907625 # 4 -9672 9672 4 0.000000 -23.017979 18.085556 # 4 -9673 9673 4 0.822071 -22.195910 18.085556 # 4 -9674 9674 4 0.822071 -23.017979 18.907625 # 4 -9675 9675 4 0.000000 -22.195910 18.907625 # 4 -9676 9676 4 1.644141 -23.017979 18.085556 # 4 -9677 9677 4 2.466212 -22.195910 18.085556 # 4 -9678 9678 4 2.466212 -23.017979 18.907625 # 4 -9679 9679 4 1.644141 -22.195910 18.907625 # 4 -9680 9680 4 3.288283 -23.017979 18.085556 # 4 -9681 9681 4 4.110353 -22.195910 18.085556 # 4 -9682 9682 4 4.110353 -23.017979 18.907625 # 4 -9683 9683 4 3.288283 -22.195910 18.907625 # 4 -9684 9684 4 4.932424 -23.017979 18.085556 # 4 -9685 9685 4 5.754495 -22.195910 18.085556 # 4 -9686 9686 4 5.754495 -23.017979 18.907625 # 4 -9687 9687 4 4.932424 -22.195910 18.907625 # 4 -9688 9688 4 6.576566 -23.017979 18.085556 # 4 -9689 9689 4 7.398636 -22.195910 18.085556 # 4 -9690 9690 4 7.398636 -23.017979 18.907625 # 4 -9691 9691 4 6.576566 -22.195910 18.907625 # 4 -9692 9692 4 8.220707 -23.017979 18.085556 # 4 -9693 9693 4 8.220707 -22.195910 18.907625 # 4 -9694 9694 4 -8.220707 -21.373838 18.085556 # 4 -9695 9695 4 -7.398636 -20.551767 18.085556 # 4 -9696 9696 4 -7.398636 -21.373838 18.907625 # 4 -9697 9697 4 -8.220707 -20.551767 18.907625 # 4 -9698 9698 4 -6.576566 -21.373838 18.085556 # 4 -9699 9699 4 -5.754495 -20.551767 18.085556 # 4 -9700 9700 4 -5.754495 -21.373838 18.907625 # 4 -9701 9701 4 -6.576566 -20.551767 18.907625 # 4 -9702 9702 4 -4.932424 -21.373838 18.085556 # 4 -9703 9703 4 -4.110353 -20.551767 18.085556 # 4 -9704 9704 4 -4.110353 -21.373838 18.907625 # 4 -9705 9705 4 -4.932424 -20.551767 18.907625 # 4 -9706 9706 4 -3.288283 -21.373838 18.085556 # 4 -9707 9707 4 -2.466212 -20.551767 18.085556 # 4 -9708 9708 4 -2.466212 -21.373838 18.907625 # 4 -9709 9709 4 -3.288283 -20.551767 18.907625 # 4 -9710 9710 4 -1.644141 -21.373838 18.085556 # 4 -9711 9711 4 -0.822071 -20.551767 18.085556 # 4 -9712 9712 4 -0.822071 -21.373838 18.907625 # 4 -9713 9713 4 -1.644141 -20.551767 18.907625 # 4 -9714 9714 4 0.000000 -21.373838 18.085556 # 4 -9715 9715 4 0.822071 -20.551767 18.085556 # 4 -9716 9716 4 0.822071 -21.373838 18.907625 # 4 -9717 9717 4 0.000000 -20.551767 18.907625 # 4 -9718 9718 4 1.644141 -21.373838 18.085556 # 4 -9719 9719 4 2.466212 -20.551767 18.085556 # 4 -9720 9720 4 2.466212 -21.373838 18.907625 # 4 -9721 9721 4 1.644141 -20.551767 18.907625 # 4 -9722 9722 4 3.288283 -21.373838 18.085556 # 4 -9723 9723 4 4.110353 -20.551767 18.085556 # 4 -9724 9724 4 4.110353 -21.373838 18.907625 # 4 -9725 9725 4 3.288283 -20.551767 18.907625 # 4 -9726 9726 4 4.932424 -21.373838 18.085556 # 4 -9727 9727 4 5.754495 -20.551767 18.085556 # 4 -9728 9728 4 5.754495 -21.373838 18.907625 # 4 -9729 9729 4 4.932424 -20.551767 18.907625 # 4 -9730 9730 4 6.576566 -21.373838 18.085556 # 4 -9731 9731 4 7.398636 -20.551767 18.085556 # 4 -9732 9732 4 7.398636 -21.373838 18.907625 # 4 -9733 9733 4 6.576566 -20.551767 18.907625 # 4 -9734 9734 4 8.220707 -21.373838 18.085556 # 4 -9735 9735 4 8.220707 -20.551767 18.907625 # 4 -9736 9736 4 -7.398636 -23.840050 19.729696 # 4 -9737 9737 4 -8.220707 -23.840050 20.551767 # 4 -9738 9738 4 -5.754495 -23.840050 19.729696 # 4 -9739 9739 4 -6.576566 -23.840050 20.551767 # 4 -9740 9740 4 -4.110353 -23.840050 19.729696 # 4 -9741 9741 4 -4.932424 -23.840050 20.551767 # 4 -9742 9742 4 -2.466212 -23.840050 19.729696 # 4 -9743 9743 4 -3.288283 -23.840050 20.551767 # 4 -9744 9744 4 -0.822071 -23.840050 19.729696 # 4 -9745 9745 4 -1.644141 -23.840050 20.551767 # 4 -9746 9746 4 0.822071 -23.840050 19.729696 # 4 -9747 9747 4 0.000000 -23.840050 20.551767 # 4 -9748 9748 4 2.466212 -23.840050 19.729696 # 4 -9749 9749 4 1.644141 -23.840050 20.551767 # 4 -9750 9750 4 4.110353 -23.840050 19.729696 # 4 -9751 9751 4 3.288283 -23.840050 20.551767 # 4 -9752 9752 4 5.754495 -23.840050 19.729696 # 4 -9753 9753 4 4.932424 -23.840050 20.551767 # 4 -9754 9754 4 7.398636 -23.840050 19.729696 # 4 -9755 9755 4 6.576566 -23.840050 20.551767 # 4 -9756 9756 4 8.220707 -23.840050 20.551767 # 4 -9757 9757 4 -8.220707 -23.017979 19.729696 # 4 -9758 9758 4 -7.398636 -22.195910 19.729696 # 4 -9759 9759 4 -7.398636 -23.017979 20.551767 # 4 -9760 9760 4 -8.220707 -22.195910 20.551767 # 4 -9761 9761 4 -6.576566 -23.017979 19.729696 # 4 -9762 9762 4 -5.754495 -22.195910 19.729696 # 4 -9763 9763 4 -5.754495 -23.017979 20.551767 # 4 -9764 9764 4 -6.576566 -22.195910 20.551767 # 4 -9765 9765 4 -4.932424 -23.017979 19.729696 # 4 -9766 9766 4 -4.110353 -22.195910 19.729696 # 4 -9767 9767 4 -4.110353 -23.017979 20.551767 # 4 -9768 9768 4 -4.932424 -22.195910 20.551767 # 4 -9769 9769 4 -3.288283 -23.017979 19.729696 # 4 -9770 9770 4 -2.466212 -22.195910 19.729696 # 4 -9771 9771 4 -2.466212 -23.017979 20.551767 # 4 -9772 9772 4 -3.288283 -22.195910 20.551767 # 4 -9773 9773 4 -1.644141 -23.017979 19.729696 # 4 -9774 9774 4 -0.822071 -22.195910 19.729696 # 4 -9775 9775 4 -0.822071 -23.017979 20.551767 # 4 -9776 9776 4 -1.644141 -22.195910 20.551767 # 4 -9777 9777 4 0.000000 -23.017979 19.729696 # 4 -9778 9778 4 0.822071 -22.195910 19.729696 # 4 -9779 9779 4 0.822071 -23.017979 20.551767 # 4 -9780 9780 4 0.000000 -22.195910 20.551767 # 4 -9781 9781 4 1.644141 -23.017979 19.729696 # 4 -9782 9782 4 2.466212 -22.195910 19.729696 # 4 -9783 9783 4 2.466212 -23.017979 20.551767 # 4 -9784 9784 4 1.644141 -22.195910 20.551767 # 4 -9785 9785 4 3.288283 -23.017979 19.729696 # 4 -9786 9786 4 4.110353 -22.195910 19.729696 # 4 -9787 9787 4 4.110353 -23.017979 20.551767 # 4 -9788 9788 4 3.288283 -22.195910 20.551767 # 4 -9789 9789 4 4.932424 -23.017979 19.729696 # 4 -9790 9790 4 5.754495 -22.195910 19.729696 # 4 -9791 9791 4 5.754495 -23.017979 20.551767 # 4 -9792 9792 4 4.932424 -22.195910 20.551767 # 4 -9793 9793 4 6.576566 -23.017979 19.729696 # 4 -9794 9794 4 7.398636 -22.195910 19.729696 # 4 -9795 9795 4 7.398636 -23.017979 20.551767 # 4 -9796 9796 4 6.576566 -22.195910 20.551767 # 4 -9797 9797 4 8.220707 -23.017979 19.729696 # 4 -9798 9798 4 8.220707 -22.195910 20.551767 # 4 -9799 9799 4 -8.220707 -21.373838 19.729696 # 4 -9800 9800 4 -7.398636 -20.551767 19.729696 # 4 -9801 9801 4 -7.398636 -21.373838 20.551767 # 4 -9802 9802 4 -8.220707 -20.551767 20.551767 # 4 -9803 9803 4 -6.576566 -21.373838 19.729696 # 4 -9804 9804 4 -5.754495 -20.551767 19.729696 # 4 -9805 9805 4 -5.754495 -21.373838 20.551767 # 4 -9806 9806 4 -6.576566 -20.551767 20.551767 # 4 -9807 9807 4 -4.932424 -21.373838 19.729696 # 4 -9808 9808 4 -4.110353 -20.551767 19.729696 # 4 -9809 9809 4 -4.110353 -21.373838 20.551767 # 4 -9810 9810 4 -4.932424 -20.551767 20.551767 # 4 -9811 9811 4 -3.288283 -21.373838 19.729696 # 4 -9812 9812 4 -2.466212 -20.551767 19.729696 # 4 -9813 9813 4 -2.466212 -21.373838 20.551767 # 4 -9814 9814 4 -3.288283 -20.551767 20.551767 # 4 -9815 9815 4 -1.644141 -21.373838 19.729696 # 4 -9816 9816 4 -0.822071 -20.551767 19.729696 # 4 -9817 9817 4 -0.822071 -21.373838 20.551767 # 4 -9818 9818 4 -1.644141 -20.551767 20.551767 # 4 -9819 9819 4 0.000000 -21.373838 19.729696 # 4 -9820 9820 4 0.822071 -20.551767 19.729696 # 4 -9821 9821 4 0.822071 -21.373838 20.551767 # 4 -9822 9822 4 0.000000 -20.551767 20.551767 # 4 -9823 9823 4 1.644141 -21.373838 19.729696 # 4 -9824 9824 4 2.466212 -20.551767 19.729696 # 4 -9825 9825 4 2.466212 -21.373838 20.551767 # 4 -9826 9826 4 1.644141 -20.551767 20.551767 # 4 -9827 9827 4 3.288283 -21.373838 19.729696 # 4 -9828 9828 4 4.110353 -20.551767 19.729696 # 4 -9829 9829 4 4.110353 -21.373838 20.551767 # 4 -9830 9830 4 3.288283 -20.551767 20.551767 # 4 -9831 9831 4 4.932424 -21.373838 19.729696 # 4 -9832 9832 4 5.754495 -20.551767 19.729696 # 4 -9833 9833 4 5.754495 -21.373838 20.551767 # 4 -9834 9834 4 4.932424 -20.551767 20.551767 # 4 -9835 9835 4 6.576566 -21.373838 19.729696 # 4 -9836 9836 4 7.398636 -20.551767 19.729696 # 4 -9837 9837 4 7.398636 -21.373838 20.551767 # 4 -9838 9838 4 6.576566 -20.551767 20.551767 # 4 -9839 9839 4 8.220707 -21.373838 19.729696 # 4 -9840 9840 4 8.220707 -20.551767 20.551767 # 4 -9841 9841 4 -7.398636 -23.840050 21.373838 # 4 -9842 9842 4 -8.220707 -23.840050 22.195910 # 4 -9843 9843 4 -5.754495 -23.840050 21.373838 # 4 -9844 9844 4 -6.576566 -23.840050 22.195910 # 4 -9845 9845 4 -4.110353 -23.840050 21.373838 # 4 -9846 9846 4 -4.932424 -23.840050 22.195910 # 4 -9847 9847 4 -2.466212 -23.840050 21.373838 # 4 -9848 9848 4 -3.288283 -23.840050 22.195910 # 4 -9849 9849 4 -0.822071 -23.840050 21.373838 # 4 -9850 9850 4 -1.644141 -23.840050 22.195910 # 4 -9851 9851 4 0.822071 -23.840050 21.373838 # 4 -9852 9852 4 0.000000 -23.840050 22.195910 # 4 -9853 9853 4 2.466212 -23.840050 21.373838 # 4 -9854 9854 4 1.644141 -23.840050 22.195910 # 4 -9855 9855 4 4.110353 -23.840050 21.373838 # 4 -9856 9856 4 3.288283 -23.840050 22.195910 # 4 -9857 9857 4 5.754495 -23.840050 21.373838 # 4 -9858 9858 4 4.932424 -23.840050 22.195910 # 4 -9859 9859 4 7.398636 -23.840050 21.373838 # 4 -9860 9860 4 6.576566 -23.840050 22.195910 # 4 -9861 9861 4 8.220707 -23.840050 22.195910 # 4 -9862 9862 4 -8.220707 -23.017979 21.373838 # 4 -9863 9863 4 -7.398636 -22.195910 21.373838 # 4 -9864 9864 4 -7.398636 -23.017979 22.195910 # 4 -9865 9865 4 -8.220707 -22.195910 22.195910 # 4 -9866 9866 4 -6.576566 -23.017979 21.373838 # 4 -9867 9867 4 -5.754495 -22.195910 21.373838 # 4 -9868 9868 4 -5.754495 -23.017979 22.195910 # 4 -9869 9869 4 -6.576566 -22.195910 22.195910 # 4 -9870 9870 4 -4.932424 -23.017979 21.373838 # 4 -9871 9871 4 -4.110353 -22.195910 21.373838 # 4 -9872 9872 4 -4.110353 -23.017979 22.195910 # 4 -9873 9873 4 -4.932424 -22.195910 22.195910 # 4 -9874 9874 4 -3.288283 -23.017979 21.373838 # 4 -9875 9875 4 -2.466212 -22.195910 21.373838 # 4 -9876 9876 4 -2.466212 -23.017979 22.195910 # 4 -9877 9877 4 -3.288283 -22.195910 22.195910 # 4 -9878 9878 4 -1.644141 -23.017979 21.373838 # 4 -9879 9879 4 -0.822071 -22.195910 21.373838 # 4 -9880 9880 4 -0.822071 -23.017979 22.195910 # 4 -9881 9881 4 -1.644141 -22.195910 22.195910 # 4 -9882 9882 4 0.000000 -23.017979 21.373838 # 4 -9883 9883 4 0.822071 -22.195910 21.373838 # 4 -9884 9884 4 0.822071 -23.017979 22.195910 # 4 -9885 9885 4 0.000000 -22.195910 22.195910 # 4 -9886 9886 4 1.644141 -23.017979 21.373838 # 4 -9887 9887 4 2.466212 -22.195910 21.373838 # 4 -9888 9888 4 2.466212 -23.017979 22.195910 # 4 -9889 9889 4 1.644141 -22.195910 22.195910 # 4 -9890 9890 4 3.288283 -23.017979 21.373838 # 4 -9891 9891 4 4.110353 -22.195910 21.373838 # 4 -9892 9892 4 4.110353 -23.017979 22.195910 # 4 -9893 9893 4 3.288283 -22.195910 22.195910 # 4 -9894 9894 4 4.932424 -23.017979 21.373838 # 4 -9895 9895 4 5.754495 -22.195910 21.373838 # 4 -9896 9896 4 5.754495 -23.017979 22.195910 # 4 -9897 9897 4 4.932424 -22.195910 22.195910 # 4 -9898 9898 4 6.576566 -23.017979 21.373838 # 4 -9899 9899 4 7.398636 -22.195910 21.373838 # 4 -9900 9900 4 7.398636 -23.017979 22.195910 # 4 -9901 9901 4 6.576566 -22.195910 22.195910 # 4 -9902 9902 4 8.220707 -23.017979 21.373838 # 4 -9903 9903 4 8.220707 -22.195910 22.195910 # 4 -9904 9904 4 -8.220707 -21.373838 21.373838 # 4 -9905 9905 4 -7.398636 -20.551767 21.373838 # 4 -9906 9906 4 -7.398636 -21.373838 22.195910 # 4 -9907 9907 4 -8.220707 -20.551767 22.195910 # 4 -9908 9908 4 -6.576566 -21.373838 21.373838 # 4 -9909 9909 4 -5.754495 -20.551767 21.373838 # 4 -9910 9910 4 -5.754495 -21.373838 22.195910 # 4 -9911 9911 4 -6.576566 -20.551767 22.195910 # 4 -9912 9912 4 -4.932424 -21.373838 21.373838 # 4 -9913 9913 4 -4.110353 -20.551767 21.373838 # 4 -9914 9914 4 -4.110353 -21.373838 22.195910 # 4 -9915 9915 4 -4.932424 -20.551767 22.195910 # 4 -9916 9916 4 -3.288283 -21.373838 21.373838 # 4 -9917 9917 4 -2.466212 -20.551767 21.373838 # 4 -9918 9918 4 -2.466212 -21.373838 22.195910 # 4 -9919 9919 4 -3.288283 -20.551767 22.195910 # 4 -9920 9920 4 -1.644141 -21.373838 21.373838 # 4 -9921 9921 4 -0.822071 -20.551767 21.373838 # 4 -9922 9922 4 -0.822071 -21.373838 22.195910 # 4 -9923 9923 4 -1.644141 -20.551767 22.195910 # 4 -9924 9924 4 0.000000 -21.373838 21.373838 # 4 -9925 9925 4 0.822071 -20.551767 21.373838 # 4 -9926 9926 4 0.822071 -21.373838 22.195910 # 4 -9927 9927 4 0.000000 -20.551767 22.195910 # 4 -9928 9928 4 1.644141 -21.373838 21.373838 # 4 -9929 9929 4 2.466212 -20.551767 21.373838 # 4 -9930 9930 4 2.466212 -21.373838 22.195910 # 4 -9931 9931 4 1.644141 -20.551767 22.195910 # 4 -9932 9932 4 3.288283 -21.373838 21.373838 # 4 -9933 9933 4 4.110353 -20.551767 21.373838 # 4 -9934 9934 4 4.110353 -21.373838 22.195910 # 4 -9935 9935 4 3.288283 -20.551767 22.195910 # 4 -9936 9936 4 4.932424 -21.373838 21.373838 # 4 -9937 9937 4 5.754495 -20.551767 21.373838 # 4 -9938 9938 4 5.754495 -21.373838 22.195910 # 4 -9939 9939 4 4.932424 -20.551767 22.195910 # 4 -9940 9940 4 6.576566 -21.373838 21.373838 # 4 -9941 9941 4 7.398636 -20.551767 21.373838 # 4 -9942 9942 4 7.398636 -21.373838 22.195910 # 4 -9943 9943 4 6.576566 -20.551767 22.195910 # 4 -9944 9944 4 8.220707 -21.373838 21.373838 # 4 -9945 9945 4 8.220707 -20.551767 22.195910 # 4 -9946 9946 4 -7.398636 -23.840050 23.017979 # 4 -9947 9947 4 -8.220707 -23.840050 23.840050 # 4 -9948 9948 4 -5.754495 -23.840050 23.017979 # 4 -9949 9949 4 -6.576566 -23.840050 23.840050 # 4 -9950 9950 4 -4.110353 -23.840050 23.017979 # 4 -9951 9951 4 -4.932424 -23.840050 23.840050 # 4 -9952 9952 4 -2.466212 -23.840050 23.017979 # 4 -9953 9953 4 -3.288283 -23.840050 23.840050 # 4 -9954 9954 4 -0.822071 -23.840050 23.017979 # 4 -9955 9955 4 -1.644141 -23.840050 23.840050 # 4 -9956 9956 4 0.822071 -23.840050 23.017979 # 4 -9957 9957 4 0.000000 -23.840050 23.840050 # 4 -9958 9958 4 2.466212 -23.840050 23.017979 # 4 -9959 9959 4 1.644141 -23.840050 23.840050 # 4 -9960 9960 4 4.110353 -23.840050 23.017979 # 4 -9961 9961 4 3.288283 -23.840050 23.840050 # 4 -9962 9962 4 5.754495 -23.840050 23.017979 # 4 -9963 9963 4 4.932424 -23.840050 23.840050 # 4 -9964 9964 4 7.398636 -23.840050 23.017979 # 4 -9965 9965 4 6.576566 -23.840050 23.840050 # 4 -9966 9966 4 8.220707 -23.840050 23.840050 # 4 -9967 9967 4 -8.220707 -23.017979 23.017979 # 4 -9968 9968 4 -7.398636 -22.195910 23.017979 # 4 -9969 9969 4 -7.398636 -23.017979 23.840050 # 4 -9970 9970 4 -8.220707 -22.195910 23.840050 # 4 -9971 9971 4 -6.576566 -23.017979 23.017979 # 4 -9972 9972 4 -5.754495 -22.195910 23.017979 # 4 -9973 9973 4 -5.754495 -23.017979 23.840050 # 4 -9974 9974 4 -6.576566 -22.195910 23.840050 # 4 -9975 9975 4 -4.932424 -23.017979 23.017979 # 4 -9976 9976 4 -4.110353 -22.195910 23.017979 # 4 -9977 9977 4 -4.110353 -23.017979 23.840050 # 4 -9978 9978 4 -4.932424 -22.195910 23.840050 # 4 -9979 9979 4 -3.288283 -23.017979 23.017979 # 4 -9980 9980 4 -2.466212 -22.195910 23.017979 # 4 -9981 9981 4 -2.466212 -23.017979 23.840050 # 4 -9982 9982 4 -3.288283 -22.195910 23.840050 # 4 -9983 9983 4 -1.644141 -23.017979 23.017979 # 4 -9984 9984 4 -0.822071 -22.195910 23.017979 # 4 -9985 9985 4 -0.822071 -23.017979 23.840050 # 4 -9986 9986 4 -1.644141 -22.195910 23.840050 # 4 -9987 9987 4 0.000000 -23.017979 23.017979 # 4 -9988 9988 4 0.822071 -22.195910 23.017979 # 4 -9989 9989 4 0.822071 -23.017979 23.840050 # 4 -9990 9990 4 0.000000 -22.195910 23.840050 # 4 -9991 9991 4 1.644141 -23.017979 23.017979 # 4 -9992 9992 4 2.466212 -22.195910 23.017979 # 4 -9993 9993 4 2.466212 -23.017979 23.840050 # 4 -9994 9994 4 1.644141 -22.195910 23.840050 # 4 -9995 9995 4 3.288283 -23.017979 23.017979 # 4 -9996 9996 4 4.110353 -22.195910 23.017979 # 4 -9997 9997 4 4.110353 -23.017979 23.840050 # 4 -9998 9998 4 3.288283 -22.195910 23.840050 # 4 -9999 9999 4 4.932424 -23.017979 23.017979 # 4 -10000 10000 4 5.754495 -22.195910 23.017979 # 4 -10001 10001 4 5.754495 -23.017979 23.840050 # 4 -10002 10002 4 4.932424 -22.195910 23.840050 # 4 -10003 10003 4 6.576566 -23.017979 23.017979 # 4 -10004 10004 4 7.398636 -22.195910 23.017979 # 4 -10005 10005 4 7.398636 -23.017979 23.840050 # 4 -10006 10006 4 6.576566 -22.195910 23.840050 # 4 -10007 10007 4 8.220707 -23.017979 23.017979 # 4 -10008 10008 4 8.220707 -22.195910 23.840050 # 4 -10009 10009 4 -8.220707 -21.373838 23.017979 # 4 -10010 10010 4 -7.398636 -20.551767 23.017979 # 4 -10011 10011 4 -7.398636 -21.373838 23.840050 # 4 -10012 10012 4 -8.220707 -20.551767 23.840050 # 4 -10013 10013 4 -6.576566 -21.373838 23.017979 # 4 -10014 10014 4 -5.754495 -20.551767 23.017979 # 4 -10015 10015 4 -5.754495 -21.373838 23.840050 # 4 -10016 10016 4 -6.576566 -20.551767 23.840050 # 4 -10017 10017 4 -4.932424 -21.373838 23.017979 # 4 -10018 10018 4 -4.110353 -20.551767 23.017979 # 4 -10019 10019 4 -4.110353 -21.373838 23.840050 # 4 -10020 10020 4 -4.932424 -20.551767 23.840050 # 4 -10021 10021 4 -3.288283 -21.373838 23.017979 # 4 -10022 10022 4 -2.466212 -20.551767 23.017979 # 4 -10023 10023 4 -2.466212 -21.373838 23.840050 # 4 -10024 10024 4 -3.288283 -20.551767 23.840050 # 4 -10025 10025 4 -1.644141 -21.373838 23.017979 # 4 -10026 10026 4 -0.822071 -20.551767 23.017979 # 4 -10027 10027 4 -0.822071 -21.373838 23.840050 # 4 -10028 10028 4 -1.644141 -20.551767 23.840050 # 4 -10029 10029 4 0.000000 -21.373838 23.017979 # 4 -10030 10030 4 0.822071 -20.551767 23.017979 # 4 -10031 10031 4 0.822071 -21.373838 23.840050 # 4 -10032 10032 4 0.000000 -20.551767 23.840050 # 4 -10033 10033 4 1.644141 -21.373838 23.017979 # 4 -10034 10034 4 2.466212 -20.551767 23.017979 # 4 -10035 10035 4 2.466212 -21.373838 23.840050 # 4 -10036 10036 4 1.644141 -20.551767 23.840050 # 4 -10037 10037 4 3.288283 -21.373838 23.017979 # 4 -10038 10038 4 4.110353 -20.551767 23.017979 # 4 -10039 10039 4 4.110353 -21.373838 23.840050 # 4 -10040 10040 4 3.288283 -20.551767 23.840050 # 4 -10041 10041 4 4.932424 -21.373838 23.017979 # 4 -10042 10042 4 5.754495 -20.551767 23.017979 # 4 -10043 10043 4 5.754495 -21.373838 23.840050 # 4 -10044 10044 4 4.932424 -20.551767 23.840050 # 4 -10045 10045 4 6.576566 -21.373838 23.017979 # 4 -10046 10046 4 7.398636 -20.551767 23.017979 # 4 -10047 10047 4 7.398636 -21.373838 23.840050 # 4 -10048 10048 4 6.576566 -20.551767 23.840050 # 4 -10049 10049 4 8.220707 -21.373838 23.017979 # 4 -10050 10050 4 8.220707 -20.551767 23.840050 # 4 -10051 10051 4 -7.398636 -23.840050 24.662121 # 4 -10052 10052 4 -5.754495 -23.840050 24.662121 # 4 -10053 10053 4 -4.110353 -23.840050 24.662121 # 4 -10054 10054 4 -2.466212 -23.840050 24.662121 # 4 -10055 10055 4 -0.822071 -23.840050 24.662121 # 4 -10056 10056 4 0.822071 -23.840050 24.662121 # 4 -10057 10057 4 2.466212 -23.840050 24.662121 # 4 -10058 10058 4 4.110353 -23.840050 24.662121 # 4 -10059 10059 4 5.754495 -23.840050 24.662121 # 4 -10060 10060 4 7.398636 -23.840050 24.662121 # 4 -10061 10061 4 -8.220707 -23.017979 24.662121 # 4 -10062 10062 4 -7.398636 -22.195910 24.662121 # 4 -10063 10063 4 -6.576566 -23.017979 24.662121 # 4 -10064 10064 4 -5.754495 -22.195910 24.662121 # 4 -10065 10065 4 -4.932424 -23.017979 24.662121 # 4 -10066 10066 4 -4.110353 -22.195910 24.662121 # 4 -10067 10067 4 -3.288283 -23.017979 24.662121 # 4 -10068 10068 4 -2.466212 -22.195910 24.662121 # 4 -10069 10069 4 -1.644141 -23.017979 24.662121 # 4 -10070 10070 4 -0.822071 -22.195910 24.662121 # 4 -10071 10071 4 0.000000 -23.017979 24.662121 # 4 -10072 10072 4 0.822071 -22.195910 24.662121 # 4 -10073 10073 4 1.644141 -23.017979 24.662121 # 4 -10074 10074 4 2.466212 -22.195910 24.662121 # 4 -10075 10075 4 3.288283 -23.017979 24.662121 # 4 -10076 10076 4 4.110353 -22.195910 24.662121 # 4 -10077 10077 4 4.932424 -23.017979 24.662121 # 4 -10078 10078 4 5.754495 -22.195910 24.662121 # 4 -10079 10079 4 6.576566 -23.017979 24.662121 # 4 -10080 10080 4 7.398636 -22.195910 24.662121 # 4 -10081 10081 4 8.220707 -23.017979 24.662121 # 4 -10082 10082 4 -8.220707 -21.373838 24.662121 # 4 -10083 10083 4 -7.398636 -20.551767 24.662121 # 4 -10084 10084 4 -6.576566 -21.373838 24.662121 # 4 -10085 10085 4 -5.754495 -20.551767 24.662121 # 4 -10086 10086 4 -4.932424 -21.373838 24.662121 # 4 -10087 10087 4 -4.110353 -20.551767 24.662121 # 4 -10088 10088 4 -3.288283 -21.373838 24.662121 # 4 -10089 10089 4 -2.466212 -20.551767 24.662121 # 4 -10090 10090 4 -1.644141 -21.373838 24.662121 # 4 -10091 10091 4 -0.822071 -20.551767 24.662121 # 4 -10092 10092 4 0.000000 -21.373838 24.662121 # 4 -10093 10093 4 0.822071 -20.551767 24.662121 # 4 -10094 10094 4 1.644141 -21.373838 24.662121 # 4 -10095 10095 4 2.466212 -20.551767 24.662121 # 4 -10096 10096 4 3.288283 -21.373838 24.662121 # 4 -10097 10097 4 4.110353 -20.551767 24.662121 # 4 -10098 10098 4 4.932424 -21.373838 24.662121 # 4 -10099 10099 4 5.754495 -20.551767 24.662121 # 4 -10100 10100 4 6.576566 -21.373838 24.662121 # 4 -10101 10101 4 7.398636 -20.551767 24.662121 # 4 -10102 10102 4 8.220707 -21.373838 24.662121 # 4 -10103 10103 4 9.864848 -23.840050 9.042778 # 4 -10104 10104 4 11.508989 -23.840050 9.042778 # 4 -10105 10105 4 13.153131 -23.840050 9.042778 # 4 -10106 10106 4 14.797273 -23.840050 9.042778 # 4 -10107 10107 4 16.441414 -23.840050 9.042778 # 4 -10108 10108 4 18.085556 -23.840050 9.042778 # 4 -10109 10109 4 19.729696 -23.840050 9.042778 # 4 -10110 10110 4 21.373838 -23.840050 9.042778 # 4 -10111 10111 4 23.017979 -23.840050 9.042778 # 4 -10112 10112 4 24.662121 -23.840050 9.042778 # 4 -10113 10113 4 9.042778 -23.017979 9.042778 # 4 -10114 10114 4 10.686919 -23.017979 9.042778 # 4 -10115 10115 4 9.864848 -22.195910 9.042778 # 4 -10116 10116 4 12.331060 -23.017979 9.042778 # 4 -10117 10117 4 11.508989 -22.195910 9.042778 # 4 -10118 10118 4 13.975202 -23.017979 9.042778 # 4 -10119 10119 4 13.153131 -22.195910 9.042778 # 4 -10120 10120 4 15.619343 -23.017979 9.042778 # 4 -10121 10121 4 14.797273 -22.195910 9.042778 # 4 -10122 10122 4 17.263485 -23.017979 9.042778 # 4 -10123 10123 4 16.441414 -22.195910 9.042778 # 4 -10124 10124 4 18.907625 -23.017979 9.042778 # 4 -10125 10125 4 18.085556 -22.195910 9.042778 # 4 -10126 10126 4 20.551767 -23.017979 9.042778 # 4 -10127 10127 4 19.729696 -22.195910 9.042778 # 4 -10128 10128 4 22.195910 -23.017979 9.042778 # 4 -10129 10129 4 21.373838 -22.195910 9.042778 # 4 -10130 10130 4 23.840050 -23.017979 9.042778 # 4 -10131 10131 4 23.017979 -22.195910 9.042778 # 4 -10132 10132 4 24.662121 -22.195910 9.042778 # 4 -10133 10133 4 9.042778 -21.373838 9.042778 # 4 -10134 10134 4 10.686919 -21.373838 9.042778 # 4 -10135 10135 4 9.864848 -20.551767 9.042778 # 4 -10136 10136 4 12.331060 -21.373838 9.042778 # 4 -10137 10137 4 11.508989 -20.551767 9.042778 # 4 -10138 10138 4 13.975202 -21.373838 9.042778 # 4 -10139 10139 4 13.153131 -20.551767 9.042778 # 4 -10140 10140 4 15.619343 -21.373838 9.042778 # 4 -10141 10141 4 14.797273 -20.551767 9.042778 # 4 -10142 10142 4 17.263485 -21.373838 9.042778 # 4 -10143 10143 4 16.441414 -20.551767 9.042778 # 4 -10144 10144 4 18.907625 -21.373838 9.042778 # 4 -10145 10145 4 18.085556 -20.551767 9.042778 # 4 -10146 10146 4 20.551767 -21.373838 9.042778 # 4 -10147 10147 4 19.729696 -20.551767 9.042778 # 4 -10148 10148 4 22.195910 -21.373838 9.042778 # 4 -10149 10149 4 21.373838 -20.551767 9.042778 # 4 -10150 10150 4 23.840050 -21.373838 9.042778 # 4 -10151 10151 4 23.017979 -20.551767 9.042778 # 4 -10152 10152 4 24.662121 -20.551767 9.042778 # 4 -10153 10153 4 9.042778 -23.840050 9.864848 # 4 -10154 10154 4 10.686919 -23.840050 9.864848 # 4 -10155 10155 4 9.864848 -23.840050 10.686919 # 4 -10156 10156 4 12.331060 -23.840050 9.864848 # 4 -10157 10157 4 11.508989 -23.840050 10.686919 # 4 -10158 10158 4 13.975202 -23.840050 9.864848 # 4 -10159 10159 4 13.153131 -23.840050 10.686919 # 4 -10160 10160 4 15.619343 -23.840050 9.864848 # 4 -10161 10161 4 14.797273 -23.840050 10.686919 # 4 -10162 10162 4 17.263485 -23.840050 9.864848 # 4 -10163 10163 4 16.441414 -23.840050 10.686919 # 4 -10164 10164 4 18.907625 -23.840050 9.864848 # 4 -10165 10165 4 18.085556 -23.840050 10.686919 # 4 -10166 10166 4 20.551767 -23.840050 9.864848 # 4 -10167 10167 4 19.729696 -23.840050 10.686919 # 4 -10168 10168 4 22.195910 -23.840050 9.864848 # 4 -10169 10169 4 21.373838 -23.840050 10.686919 # 4 -10170 10170 4 23.840050 -23.840050 9.864848 # 4 -10171 10171 4 23.017979 -23.840050 10.686919 # 4 -10172 10172 4 24.662121 -23.840050 10.686919 # 4 -10173 10173 4 9.042778 -22.195910 9.864848 # 4 -10174 10174 4 9.042778 -23.017979 10.686919 # 4 -10175 10175 4 9.864848 -23.017979 9.864848 # 4 -10176 10176 4 10.686919 -22.195910 9.864848 # 4 -10177 10177 4 10.686919 -23.017979 10.686919 # 4 -10178 10178 4 9.864848 -22.195910 10.686919 # 4 -10179 10179 4 11.508989 -23.017979 9.864848 # 4 -10180 10180 4 12.331060 -22.195910 9.864848 # 4 -10181 10181 4 12.331060 -23.017979 10.686919 # 4 -10182 10182 4 11.508989 -22.195910 10.686919 # 4 -10183 10183 4 13.153131 -23.017979 9.864848 # 4 -10184 10184 4 13.975202 -22.195910 9.864848 # 4 -10185 10185 4 13.975202 -23.017979 10.686919 # 4 -10186 10186 4 13.153131 -22.195910 10.686919 # 4 -10187 10187 4 14.797273 -23.017979 9.864848 # 4 -10188 10188 4 15.619343 -22.195910 9.864848 # 4 -10189 10189 4 15.619343 -23.017979 10.686919 # 4 -10190 10190 4 14.797273 -22.195910 10.686919 # 4 -10191 10191 4 16.441414 -23.017979 9.864848 # 4 -10192 10192 4 17.263485 -22.195910 9.864848 # 4 -10193 10193 4 17.263485 -23.017979 10.686919 # 4 -10194 10194 4 16.441414 -22.195910 10.686919 # 4 -10195 10195 4 18.085556 -23.017979 9.864848 # 4 -10196 10196 4 18.907625 -22.195910 9.864848 # 4 -10197 10197 4 18.907625 -23.017979 10.686919 # 4 -10198 10198 4 18.085556 -22.195910 10.686919 # 4 -10199 10199 4 19.729696 -23.017979 9.864848 # 4 -10200 10200 4 20.551767 -22.195910 9.864848 # 4 -10201 10201 4 20.551767 -23.017979 10.686919 # 4 -10202 10202 4 19.729696 -22.195910 10.686919 # 4 -10203 10203 4 21.373838 -23.017979 9.864848 # 4 -10204 10204 4 22.195910 -22.195910 9.864848 # 4 -10205 10205 4 22.195910 -23.017979 10.686919 # 4 -10206 10206 4 21.373838 -22.195910 10.686919 # 4 -10207 10207 4 23.017979 -23.017979 9.864848 # 4 -10208 10208 4 23.840050 -22.195910 9.864848 # 4 -10209 10209 4 23.840050 -23.017979 10.686919 # 4 -10210 10210 4 23.017979 -22.195910 10.686919 # 4 -10211 10211 4 24.662121 -23.017979 9.864848 # 4 -10212 10212 4 24.662121 -22.195910 10.686919 # 4 -10213 10213 4 9.042778 -20.551767 9.864848 # 4 -10214 10214 4 9.042778 -21.373838 10.686919 # 4 -10215 10215 4 9.864848 -21.373838 9.864848 # 4 -10216 10216 4 10.686919 -20.551767 9.864848 # 4 -10217 10217 4 10.686919 -21.373838 10.686919 # 4 -10218 10218 4 9.864848 -20.551767 10.686919 # 4 -10219 10219 4 11.508989 -21.373838 9.864848 # 4 -10220 10220 4 12.331060 -20.551767 9.864848 # 4 -10221 10221 4 12.331060 -21.373838 10.686919 # 4 -10222 10222 4 11.508989 -20.551767 10.686919 # 4 -10223 10223 4 13.153131 -21.373838 9.864848 # 4 -10224 10224 4 13.975202 -20.551767 9.864848 # 4 -10225 10225 4 13.975202 -21.373838 10.686919 # 4 -10226 10226 4 13.153131 -20.551767 10.686919 # 4 -10227 10227 4 14.797273 -21.373838 9.864848 # 4 -10228 10228 4 15.619343 -20.551767 9.864848 # 4 -10229 10229 4 15.619343 -21.373838 10.686919 # 4 -10230 10230 4 14.797273 -20.551767 10.686919 # 4 -10231 10231 4 16.441414 -21.373838 9.864848 # 4 -10232 10232 4 17.263485 -20.551767 9.864848 # 4 -10233 10233 4 17.263485 -21.373838 10.686919 # 4 -10234 10234 4 16.441414 -20.551767 10.686919 # 4 -10235 10235 4 18.085556 -21.373838 9.864848 # 4 -10236 10236 4 18.907625 -20.551767 9.864848 # 4 -10237 10237 4 18.907625 -21.373838 10.686919 # 4 -10238 10238 4 18.085556 -20.551767 10.686919 # 4 -10239 10239 4 19.729696 -21.373838 9.864848 # 4 -10240 10240 4 20.551767 -20.551767 9.864848 # 4 -10241 10241 4 20.551767 -21.373838 10.686919 # 4 -10242 10242 4 19.729696 -20.551767 10.686919 # 4 -10243 10243 4 21.373838 -21.373838 9.864848 # 4 -10244 10244 4 22.195910 -20.551767 9.864848 # 4 -10245 10245 4 22.195910 -21.373838 10.686919 # 4 -10246 10246 4 21.373838 -20.551767 10.686919 # 4 -10247 10247 4 23.017979 -21.373838 9.864848 # 4 -10248 10248 4 23.840050 -20.551767 9.864848 # 4 -10249 10249 4 23.840050 -21.373838 10.686919 # 4 -10250 10250 4 23.017979 -20.551767 10.686919 # 4 -10251 10251 4 24.662121 -21.373838 9.864848 # 4 -10252 10252 4 24.662121 -20.551767 10.686919 # 4 -10253 10253 4 9.042778 -23.840050 11.508989 # 4 -10254 10254 4 10.686919 -23.840050 11.508989 # 4 -10255 10255 4 9.864848 -23.840050 12.331060 # 4 -10256 10256 4 12.331060 -23.840050 11.508989 # 4 -10257 10257 4 11.508989 -23.840050 12.331060 # 4 -10258 10258 4 13.975202 -23.840050 11.508989 # 4 -10259 10259 4 13.153131 -23.840050 12.331060 # 4 -10260 10260 4 15.619343 -23.840050 11.508989 # 4 -10261 10261 4 14.797273 -23.840050 12.331060 # 4 -10262 10262 4 17.263485 -23.840050 11.508989 # 4 -10263 10263 4 16.441414 -23.840050 12.331060 # 4 -10264 10264 4 18.907625 -23.840050 11.508989 # 4 -10265 10265 4 18.085556 -23.840050 12.331060 # 4 -10266 10266 4 20.551767 -23.840050 11.508989 # 4 -10267 10267 4 19.729696 -23.840050 12.331060 # 4 -10268 10268 4 22.195910 -23.840050 11.508989 # 4 -10269 10269 4 21.373838 -23.840050 12.331060 # 4 -10270 10270 4 23.840050 -23.840050 11.508989 # 4 -10271 10271 4 23.017979 -23.840050 12.331060 # 4 -10272 10272 4 24.662121 -23.840050 12.331060 # 4 -10273 10273 4 9.042778 -22.195910 11.508989 # 4 -10274 10274 4 9.042778 -23.017979 12.331060 # 4 -10275 10275 4 9.864848 -23.017979 11.508989 # 4 -10276 10276 4 10.686919 -22.195910 11.508989 # 4 -10277 10277 4 10.686919 -23.017979 12.331060 # 4 -10278 10278 4 9.864848 -22.195910 12.331060 # 4 -10279 10279 4 11.508989 -23.017979 11.508989 # 4 -10280 10280 4 12.331060 -22.195910 11.508989 # 4 -10281 10281 4 12.331060 -23.017979 12.331060 # 4 -10282 10282 4 11.508989 -22.195910 12.331060 # 4 -10283 10283 4 13.153131 -23.017979 11.508989 # 4 -10284 10284 4 13.975202 -22.195910 11.508989 # 4 -10285 10285 4 13.975202 -23.017979 12.331060 # 4 -10286 10286 4 13.153131 -22.195910 12.331060 # 4 -10287 10287 4 14.797273 -23.017979 11.508989 # 4 -10288 10288 4 15.619343 -22.195910 11.508989 # 4 -10289 10289 4 15.619343 -23.017979 12.331060 # 4 -10290 10290 4 14.797273 -22.195910 12.331060 # 4 -10291 10291 4 16.441414 -23.017979 11.508989 # 4 -10292 10292 4 17.263485 -22.195910 11.508989 # 4 -10293 10293 4 17.263485 -23.017979 12.331060 # 4 -10294 10294 4 16.441414 -22.195910 12.331060 # 4 -10295 10295 4 18.085556 -23.017979 11.508989 # 4 -10296 10296 4 18.907625 -22.195910 11.508989 # 4 -10297 10297 4 18.907625 -23.017979 12.331060 # 4 -10298 10298 4 18.085556 -22.195910 12.331060 # 4 -10299 10299 4 19.729696 -23.017979 11.508989 # 4 -10300 10300 4 20.551767 -22.195910 11.508989 # 4 -10301 10301 4 20.551767 -23.017979 12.331060 # 4 -10302 10302 4 19.729696 -22.195910 12.331060 # 4 -10303 10303 4 21.373838 -23.017979 11.508989 # 4 -10304 10304 4 22.195910 -22.195910 11.508989 # 4 -10305 10305 4 22.195910 -23.017979 12.331060 # 4 -10306 10306 4 21.373838 -22.195910 12.331060 # 4 -10307 10307 4 23.017979 -23.017979 11.508989 # 4 -10308 10308 4 23.840050 -22.195910 11.508989 # 4 -10309 10309 4 23.840050 -23.017979 12.331060 # 4 -10310 10310 4 23.017979 -22.195910 12.331060 # 4 -10311 10311 4 24.662121 -23.017979 11.508989 # 4 -10312 10312 4 24.662121 -22.195910 12.331060 # 4 -10313 10313 4 9.042778 -20.551767 11.508989 # 4 -10314 10314 4 9.042778 -21.373838 12.331060 # 4 -10315 10315 4 9.864848 -21.373838 11.508989 # 4 -10316 10316 4 10.686919 -20.551767 11.508989 # 4 -10317 10317 4 10.686919 -21.373838 12.331060 # 4 -10318 10318 4 9.864848 -20.551767 12.331060 # 4 -10319 10319 4 11.508989 -21.373838 11.508989 # 4 -10320 10320 4 12.331060 -20.551767 11.508989 # 4 -10321 10321 4 12.331060 -21.373838 12.331060 # 4 -10322 10322 4 11.508989 -20.551767 12.331060 # 4 -10323 10323 4 13.153131 -21.373838 11.508989 # 4 -10324 10324 4 13.975202 -20.551767 11.508989 # 4 -10325 10325 4 13.975202 -21.373838 12.331060 # 4 -10326 10326 4 13.153131 -20.551767 12.331060 # 4 -10327 10327 4 14.797273 -21.373838 11.508989 # 4 -10328 10328 4 15.619343 -20.551767 11.508989 # 4 -10329 10329 4 15.619343 -21.373838 12.331060 # 4 -10330 10330 4 14.797273 -20.551767 12.331060 # 4 -10331 10331 4 16.441414 -21.373838 11.508989 # 4 -10332 10332 4 17.263485 -20.551767 11.508989 # 4 -10333 10333 4 17.263485 -21.373838 12.331060 # 4 -10334 10334 4 16.441414 -20.551767 12.331060 # 4 -10335 10335 4 18.085556 -21.373838 11.508989 # 4 -10336 10336 4 18.907625 -20.551767 11.508989 # 4 -10337 10337 4 18.907625 -21.373838 12.331060 # 4 -10338 10338 4 18.085556 -20.551767 12.331060 # 4 -10339 10339 4 19.729696 -21.373838 11.508989 # 4 -10340 10340 4 20.551767 -20.551767 11.508989 # 4 -10341 10341 4 20.551767 -21.373838 12.331060 # 4 -10342 10342 4 19.729696 -20.551767 12.331060 # 4 -10343 10343 4 21.373838 -21.373838 11.508989 # 4 -10344 10344 4 22.195910 -20.551767 11.508989 # 4 -10345 10345 4 22.195910 -21.373838 12.331060 # 4 -10346 10346 4 21.373838 -20.551767 12.331060 # 4 -10347 10347 4 23.017979 -21.373838 11.508989 # 4 -10348 10348 4 23.840050 -20.551767 11.508989 # 4 -10349 10349 4 23.840050 -21.373838 12.331060 # 4 -10350 10350 4 23.017979 -20.551767 12.331060 # 4 -10351 10351 4 24.662121 -21.373838 11.508989 # 4 -10352 10352 4 24.662121 -20.551767 12.331060 # 4 -10353 10353 4 9.042778 -23.840050 13.153131 # 4 -10354 10354 4 10.686919 -23.840050 13.153131 # 4 -10355 10355 4 9.864848 -23.840050 13.975202 # 4 -10356 10356 4 12.331060 -23.840050 13.153131 # 4 -10357 10357 4 11.508989 -23.840050 13.975202 # 4 -10358 10358 4 13.975202 -23.840050 13.153131 # 4 -10359 10359 4 13.153131 -23.840050 13.975202 # 4 -10360 10360 4 15.619343 -23.840050 13.153131 # 4 -10361 10361 4 14.797273 -23.840050 13.975202 # 4 -10362 10362 4 17.263485 -23.840050 13.153131 # 4 -10363 10363 4 16.441414 -23.840050 13.975202 # 4 -10364 10364 4 18.907625 -23.840050 13.153131 # 4 -10365 10365 4 18.085556 -23.840050 13.975202 # 4 -10366 10366 4 20.551767 -23.840050 13.153131 # 4 -10367 10367 4 19.729696 -23.840050 13.975202 # 4 -10368 10368 4 22.195910 -23.840050 13.153131 # 4 -10369 10369 4 21.373838 -23.840050 13.975202 # 4 -10370 10370 4 23.840050 -23.840050 13.153131 # 4 -10371 10371 4 23.017979 -23.840050 13.975202 # 4 -10372 10372 4 24.662121 -23.840050 13.975202 # 4 -10373 10373 4 9.042778 -22.195910 13.153131 # 4 -10374 10374 4 9.042778 -23.017979 13.975202 # 4 -10375 10375 4 9.864848 -23.017979 13.153131 # 4 -10376 10376 4 10.686919 -22.195910 13.153131 # 4 -10377 10377 4 10.686919 -23.017979 13.975202 # 4 -10378 10378 4 9.864848 -22.195910 13.975202 # 4 -10379 10379 4 11.508989 -23.017979 13.153131 # 4 -10380 10380 4 12.331060 -22.195910 13.153131 # 4 -10381 10381 4 12.331060 -23.017979 13.975202 # 4 -10382 10382 4 11.508989 -22.195910 13.975202 # 4 -10383 10383 4 13.153131 -23.017979 13.153131 # 4 -10384 10384 4 13.975202 -22.195910 13.153131 # 4 -10385 10385 4 13.975202 -23.017979 13.975202 # 4 -10386 10386 4 13.153131 -22.195910 13.975202 # 4 -10387 10387 4 14.797273 -23.017979 13.153131 # 4 -10388 10388 4 15.619343 -22.195910 13.153131 # 4 -10389 10389 4 15.619343 -23.017979 13.975202 # 4 -10390 10390 4 14.797273 -22.195910 13.975202 # 4 -10391 10391 4 16.441414 -23.017979 13.153131 # 4 -10392 10392 4 17.263485 -22.195910 13.153131 # 4 -10393 10393 4 17.263485 -23.017979 13.975202 # 4 -10394 10394 4 16.441414 -22.195910 13.975202 # 4 -10395 10395 4 18.085556 -23.017979 13.153131 # 4 -10396 10396 4 18.907625 -22.195910 13.153131 # 4 -10397 10397 4 18.907625 -23.017979 13.975202 # 4 -10398 10398 4 18.085556 -22.195910 13.975202 # 4 -10399 10399 4 19.729696 -23.017979 13.153131 # 4 -10400 10400 4 20.551767 -22.195910 13.153131 # 4 -10401 10401 4 20.551767 -23.017979 13.975202 # 4 -10402 10402 4 19.729696 -22.195910 13.975202 # 4 -10403 10403 4 21.373838 -23.017979 13.153131 # 4 -10404 10404 4 22.195910 -22.195910 13.153131 # 4 -10405 10405 4 22.195910 -23.017979 13.975202 # 4 -10406 10406 4 21.373838 -22.195910 13.975202 # 4 -10407 10407 4 23.017979 -23.017979 13.153131 # 4 -10408 10408 4 23.840050 -22.195910 13.153131 # 4 -10409 10409 4 23.840050 -23.017979 13.975202 # 4 -10410 10410 4 23.017979 -22.195910 13.975202 # 4 -10411 10411 4 24.662121 -23.017979 13.153131 # 4 -10412 10412 4 24.662121 -22.195910 13.975202 # 4 -10413 10413 4 9.042778 -20.551767 13.153131 # 4 -10414 10414 4 9.042778 -21.373838 13.975202 # 4 -10415 10415 4 9.864848 -21.373838 13.153131 # 4 -10416 10416 4 10.686919 -20.551767 13.153131 # 4 -10417 10417 4 10.686919 -21.373838 13.975202 # 4 -10418 10418 4 9.864848 -20.551767 13.975202 # 4 -10419 10419 4 11.508989 -21.373838 13.153131 # 4 -10420 10420 4 12.331060 -20.551767 13.153131 # 4 -10421 10421 4 12.331060 -21.373838 13.975202 # 4 -10422 10422 4 11.508989 -20.551767 13.975202 # 4 -10423 10423 4 13.153131 -21.373838 13.153131 # 4 -10424 10424 4 13.975202 -20.551767 13.153131 # 4 -10425 10425 4 13.975202 -21.373838 13.975202 # 4 -10426 10426 4 13.153131 -20.551767 13.975202 # 4 -10427 10427 4 14.797273 -21.373838 13.153131 # 4 -10428 10428 4 15.619343 -20.551767 13.153131 # 4 -10429 10429 4 15.619343 -21.373838 13.975202 # 4 -10430 10430 4 14.797273 -20.551767 13.975202 # 4 -10431 10431 4 16.441414 -21.373838 13.153131 # 4 -10432 10432 4 17.263485 -20.551767 13.153131 # 4 -10433 10433 4 17.263485 -21.373838 13.975202 # 4 -10434 10434 4 16.441414 -20.551767 13.975202 # 4 -10435 10435 4 18.085556 -21.373838 13.153131 # 4 -10436 10436 4 18.907625 -20.551767 13.153131 # 4 -10437 10437 4 18.907625 -21.373838 13.975202 # 4 -10438 10438 4 18.085556 -20.551767 13.975202 # 4 -10439 10439 4 19.729696 -21.373838 13.153131 # 4 -10440 10440 4 20.551767 -20.551767 13.153131 # 4 -10441 10441 4 20.551767 -21.373838 13.975202 # 4 -10442 10442 4 19.729696 -20.551767 13.975202 # 4 -10443 10443 4 21.373838 -21.373838 13.153131 # 4 -10444 10444 4 22.195910 -20.551767 13.153131 # 4 -10445 10445 4 22.195910 -21.373838 13.975202 # 4 -10446 10446 4 21.373838 -20.551767 13.975202 # 4 -10447 10447 4 23.017979 -21.373838 13.153131 # 4 -10448 10448 4 23.840050 -20.551767 13.153131 # 4 -10449 10449 4 23.840050 -21.373838 13.975202 # 4 -10450 10450 4 23.017979 -20.551767 13.975202 # 4 -10451 10451 4 24.662121 -21.373838 13.153131 # 4 -10452 10452 4 24.662121 -20.551767 13.975202 # 4 -10453 10453 4 9.042778 -23.840050 14.797273 # 4 -10454 10454 4 10.686919 -23.840050 14.797273 # 4 -10455 10455 4 9.864848 -23.840050 15.619343 # 4 -10456 10456 4 12.331060 -23.840050 14.797273 # 4 -10457 10457 4 11.508989 -23.840050 15.619343 # 4 -10458 10458 4 13.975202 -23.840050 14.797273 # 4 -10459 10459 4 13.153131 -23.840050 15.619343 # 4 -10460 10460 4 15.619343 -23.840050 14.797273 # 4 -10461 10461 4 14.797273 -23.840050 15.619343 # 4 -10462 10462 4 17.263485 -23.840050 14.797273 # 4 -10463 10463 4 16.441414 -23.840050 15.619343 # 4 -10464 10464 4 18.907625 -23.840050 14.797273 # 4 -10465 10465 4 18.085556 -23.840050 15.619343 # 4 -10466 10466 4 20.551767 -23.840050 14.797273 # 4 -10467 10467 4 19.729696 -23.840050 15.619343 # 4 -10468 10468 4 22.195910 -23.840050 14.797273 # 4 -10469 10469 4 21.373838 -23.840050 15.619343 # 4 -10470 10470 4 23.840050 -23.840050 14.797273 # 4 -10471 10471 4 23.017979 -23.840050 15.619343 # 4 -10472 10472 4 24.662121 -23.840050 15.619343 # 4 -10473 10473 4 9.042778 -22.195910 14.797273 # 4 -10474 10474 4 9.042778 -23.017979 15.619343 # 4 -10475 10475 4 9.864848 -23.017979 14.797273 # 4 -10476 10476 4 10.686919 -22.195910 14.797273 # 4 -10477 10477 4 10.686919 -23.017979 15.619343 # 4 -10478 10478 4 9.864848 -22.195910 15.619343 # 4 -10479 10479 4 11.508989 -23.017979 14.797273 # 4 -10480 10480 4 12.331060 -22.195910 14.797273 # 4 -10481 10481 4 12.331060 -23.017979 15.619343 # 4 -10482 10482 4 11.508989 -22.195910 15.619343 # 4 -10483 10483 4 13.153131 -23.017979 14.797273 # 4 -10484 10484 4 13.975202 -22.195910 14.797273 # 4 -10485 10485 4 13.975202 -23.017979 15.619343 # 4 -10486 10486 4 13.153131 -22.195910 15.619343 # 4 -10487 10487 4 14.797273 -23.017979 14.797273 # 4 -10488 10488 4 15.619343 -22.195910 14.797273 # 4 -10489 10489 4 15.619343 -23.017979 15.619343 # 4 -10490 10490 4 14.797273 -22.195910 15.619343 # 4 -10491 10491 4 16.441414 -23.017979 14.797273 # 4 -10492 10492 4 17.263485 -22.195910 14.797273 # 4 -10493 10493 4 17.263485 -23.017979 15.619343 # 4 -10494 10494 4 16.441414 -22.195910 15.619343 # 4 -10495 10495 4 18.085556 -23.017979 14.797273 # 4 -10496 10496 4 18.907625 -22.195910 14.797273 # 4 -10497 10497 4 18.907625 -23.017979 15.619343 # 4 -10498 10498 4 18.085556 -22.195910 15.619343 # 4 -10499 10499 4 19.729696 -23.017979 14.797273 # 4 -10500 10500 4 20.551767 -22.195910 14.797273 # 4 -10501 10501 4 20.551767 -23.017979 15.619343 # 4 -10502 10502 4 19.729696 -22.195910 15.619343 # 4 -10503 10503 4 21.373838 -23.017979 14.797273 # 4 -10504 10504 4 22.195910 -22.195910 14.797273 # 4 -10505 10505 4 22.195910 -23.017979 15.619343 # 4 -10506 10506 4 21.373838 -22.195910 15.619343 # 4 -10507 10507 4 23.017979 -23.017979 14.797273 # 4 -10508 10508 4 23.840050 -22.195910 14.797273 # 4 -10509 10509 4 23.840050 -23.017979 15.619343 # 4 -10510 10510 4 23.017979 -22.195910 15.619343 # 4 -10511 10511 4 24.662121 -23.017979 14.797273 # 4 -10512 10512 4 24.662121 -22.195910 15.619343 # 4 -10513 10513 4 9.042778 -20.551767 14.797273 # 4 -10514 10514 4 9.042778 -21.373838 15.619343 # 4 -10515 10515 4 9.864848 -21.373838 14.797273 # 4 -10516 10516 4 10.686919 -20.551767 14.797273 # 4 -10517 10517 4 10.686919 -21.373838 15.619343 # 4 -10518 10518 4 9.864848 -20.551767 15.619343 # 4 -10519 10519 4 11.508989 -21.373838 14.797273 # 4 -10520 10520 4 12.331060 -20.551767 14.797273 # 4 -10521 10521 4 12.331060 -21.373838 15.619343 # 4 -10522 10522 4 11.508989 -20.551767 15.619343 # 4 -10523 10523 4 13.153131 -21.373838 14.797273 # 4 -10524 10524 4 13.975202 -20.551767 14.797273 # 4 -10525 10525 4 13.975202 -21.373838 15.619343 # 4 -10526 10526 4 13.153131 -20.551767 15.619343 # 4 -10527 10527 4 14.797273 -21.373838 14.797273 # 4 -10528 10528 4 15.619343 -20.551767 14.797273 # 4 -10529 10529 4 15.619343 -21.373838 15.619343 # 4 -10530 10530 4 14.797273 -20.551767 15.619343 # 4 -10531 10531 4 16.441414 -21.373838 14.797273 # 4 -10532 10532 4 17.263485 -20.551767 14.797273 # 4 -10533 10533 4 17.263485 -21.373838 15.619343 # 4 -10534 10534 4 16.441414 -20.551767 15.619343 # 4 -10535 10535 4 18.085556 -21.373838 14.797273 # 4 -10536 10536 4 18.907625 -20.551767 14.797273 # 4 -10537 10537 4 18.907625 -21.373838 15.619343 # 4 -10538 10538 4 18.085556 -20.551767 15.619343 # 4 -10539 10539 4 19.729696 -21.373838 14.797273 # 4 -10540 10540 4 20.551767 -20.551767 14.797273 # 4 -10541 10541 4 20.551767 -21.373838 15.619343 # 4 -10542 10542 4 19.729696 -20.551767 15.619343 # 4 -10543 10543 4 21.373838 -21.373838 14.797273 # 4 -10544 10544 4 22.195910 -20.551767 14.797273 # 4 -10545 10545 4 22.195910 -21.373838 15.619343 # 4 -10546 10546 4 21.373838 -20.551767 15.619343 # 4 -10547 10547 4 23.017979 -21.373838 14.797273 # 4 -10548 10548 4 23.840050 -20.551767 14.797273 # 4 -10549 10549 4 23.840050 -21.373838 15.619343 # 4 -10550 10550 4 23.017979 -20.551767 15.619343 # 4 -10551 10551 4 24.662121 -21.373838 14.797273 # 4 -10552 10552 4 24.662121 -20.551767 15.619343 # 4 -10553 10553 4 9.042778 -23.840050 16.441414 # 4 -10554 10554 4 10.686919 -23.840050 16.441414 # 4 -10555 10555 4 9.864848 -23.840050 17.263485 # 4 -10556 10556 4 12.331060 -23.840050 16.441414 # 4 -10557 10557 4 11.508989 -23.840050 17.263485 # 4 -10558 10558 4 13.975202 -23.840050 16.441414 # 4 -10559 10559 4 13.153131 -23.840050 17.263485 # 4 -10560 10560 4 15.619343 -23.840050 16.441414 # 4 -10561 10561 4 14.797273 -23.840050 17.263485 # 4 -10562 10562 4 17.263485 -23.840050 16.441414 # 4 -10563 10563 4 16.441414 -23.840050 17.263485 # 4 -10564 10564 4 18.907625 -23.840050 16.441414 # 4 -10565 10565 4 18.085556 -23.840050 17.263485 # 4 -10566 10566 4 20.551767 -23.840050 16.441414 # 4 -10567 10567 4 19.729696 -23.840050 17.263485 # 4 -10568 10568 4 22.195910 -23.840050 16.441414 # 4 -10569 10569 4 21.373838 -23.840050 17.263485 # 4 -10570 10570 4 23.840050 -23.840050 16.441414 # 4 -10571 10571 4 23.017979 -23.840050 17.263485 # 4 -10572 10572 4 24.662121 -23.840050 17.263485 # 4 -10573 10573 4 9.042778 -22.195910 16.441414 # 4 -10574 10574 4 9.042778 -23.017979 17.263485 # 4 -10575 10575 4 9.864848 -23.017979 16.441414 # 4 -10576 10576 4 10.686919 -22.195910 16.441414 # 4 -10577 10577 4 10.686919 -23.017979 17.263485 # 4 -10578 10578 4 9.864848 -22.195910 17.263485 # 4 -10579 10579 4 11.508989 -23.017979 16.441414 # 4 -10580 10580 4 12.331060 -22.195910 16.441414 # 4 -10581 10581 4 12.331060 -23.017979 17.263485 # 4 -10582 10582 4 11.508989 -22.195910 17.263485 # 4 -10583 10583 4 13.153131 -23.017979 16.441414 # 4 -10584 10584 4 13.975202 -22.195910 16.441414 # 4 -10585 10585 4 13.975202 -23.017979 17.263485 # 4 -10586 10586 4 13.153131 -22.195910 17.263485 # 4 -10587 10587 4 14.797273 -23.017979 16.441414 # 4 -10588 10588 4 15.619343 -22.195910 16.441414 # 4 -10589 10589 4 15.619343 -23.017979 17.263485 # 4 -10590 10590 4 14.797273 -22.195910 17.263485 # 4 -10591 10591 4 16.441414 -23.017979 16.441414 # 4 -10592 10592 4 17.263485 -22.195910 16.441414 # 4 -10593 10593 4 17.263485 -23.017979 17.263485 # 4 -10594 10594 4 16.441414 -22.195910 17.263485 # 4 -10595 10595 4 18.085556 -23.017979 16.441414 # 4 -10596 10596 4 18.907625 -22.195910 16.441414 # 4 -10597 10597 4 18.907625 -23.017979 17.263485 # 4 -10598 10598 4 18.085556 -22.195910 17.263485 # 4 -10599 10599 4 19.729696 -23.017979 16.441414 # 4 -10600 10600 4 20.551767 -22.195910 16.441414 # 4 -10601 10601 4 20.551767 -23.017979 17.263485 # 4 -10602 10602 4 19.729696 -22.195910 17.263485 # 4 -10603 10603 4 21.373838 -23.017979 16.441414 # 4 -10604 10604 4 22.195910 -22.195910 16.441414 # 4 -10605 10605 4 22.195910 -23.017979 17.263485 # 4 -10606 10606 4 21.373838 -22.195910 17.263485 # 4 -10607 10607 4 23.017979 -23.017979 16.441414 # 4 -10608 10608 4 23.840050 -22.195910 16.441414 # 4 -10609 10609 4 23.840050 -23.017979 17.263485 # 4 -10610 10610 4 23.017979 -22.195910 17.263485 # 4 -10611 10611 4 24.662121 -23.017979 16.441414 # 4 -10612 10612 4 24.662121 -22.195910 17.263485 # 4 -10613 10613 4 9.042778 -20.551767 16.441414 # 4 -10614 10614 4 9.042778 -21.373838 17.263485 # 4 -10615 10615 4 9.864848 -21.373838 16.441414 # 4 -10616 10616 4 10.686919 -20.551767 16.441414 # 4 -10617 10617 4 10.686919 -21.373838 17.263485 # 4 -10618 10618 4 9.864848 -20.551767 17.263485 # 4 -10619 10619 4 11.508989 -21.373838 16.441414 # 4 -10620 10620 4 12.331060 -20.551767 16.441414 # 4 -10621 10621 4 12.331060 -21.373838 17.263485 # 4 -10622 10622 4 11.508989 -20.551767 17.263485 # 4 -10623 10623 4 13.153131 -21.373838 16.441414 # 4 -10624 10624 4 13.975202 -20.551767 16.441414 # 4 -10625 10625 4 13.975202 -21.373838 17.263485 # 4 -10626 10626 4 13.153131 -20.551767 17.263485 # 4 -10627 10627 4 14.797273 -21.373838 16.441414 # 4 -10628 10628 4 15.619343 -20.551767 16.441414 # 4 -10629 10629 4 15.619343 -21.373838 17.263485 # 4 -10630 10630 4 14.797273 -20.551767 17.263485 # 4 -10631 10631 4 16.441414 -21.373838 16.441414 # 4 -10632 10632 4 17.263485 -20.551767 16.441414 # 4 -10633 10633 4 17.263485 -21.373838 17.263485 # 4 -10634 10634 4 16.441414 -20.551767 17.263485 # 4 -10635 10635 4 18.085556 -21.373838 16.441414 # 4 -10636 10636 4 18.907625 -20.551767 16.441414 # 4 -10637 10637 4 18.907625 -21.373838 17.263485 # 4 -10638 10638 4 18.085556 -20.551767 17.263485 # 4 -10639 10639 4 19.729696 -21.373838 16.441414 # 4 -10640 10640 4 20.551767 -20.551767 16.441414 # 4 -10641 10641 4 20.551767 -21.373838 17.263485 # 4 -10642 10642 4 19.729696 -20.551767 17.263485 # 4 -10643 10643 4 21.373838 -21.373838 16.441414 # 4 -10644 10644 4 22.195910 -20.551767 16.441414 # 4 -10645 10645 4 22.195910 -21.373838 17.263485 # 4 -10646 10646 4 21.373838 -20.551767 17.263485 # 4 -10647 10647 4 23.017979 -21.373838 16.441414 # 4 -10648 10648 4 23.840050 -20.551767 16.441414 # 4 -10649 10649 4 23.840050 -21.373838 17.263485 # 4 -10650 10650 4 23.017979 -20.551767 17.263485 # 4 -10651 10651 4 24.662121 -21.373838 16.441414 # 4 -10652 10652 4 24.662121 -20.551767 17.263485 # 4 -10653 10653 4 9.042778 -23.840050 18.085556 # 4 -10654 10654 4 10.686919 -23.840050 18.085556 # 4 -10655 10655 4 9.864848 -23.840050 18.907625 # 4 -10656 10656 4 12.331060 -23.840050 18.085556 # 4 -10657 10657 4 11.508989 -23.840050 18.907625 # 4 -10658 10658 4 13.975202 -23.840050 18.085556 # 4 -10659 10659 4 13.153131 -23.840050 18.907625 # 4 -10660 10660 4 15.619343 -23.840050 18.085556 # 4 -10661 10661 4 14.797273 -23.840050 18.907625 # 4 -10662 10662 4 17.263485 -23.840050 18.085556 # 4 -10663 10663 4 16.441414 -23.840050 18.907625 # 4 -10664 10664 4 18.907625 -23.840050 18.085556 # 4 -10665 10665 4 18.085556 -23.840050 18.907625 # 4 -10666 10666 4 20.551767 -23.840050 18.085556 # 4 -10667 10667 4 19.729696 -23.840050 18.907625 # 4 -10668 10668 4 22.195910 -23.840050 18.085556 # 4 -10669 10669 4 21.373838 -23.840050 18.907625 # 4 -10670 10670 4 23.840050 -23.840050 18.085556 # 4 -10671 10671 4 23.017979 -23.840050 18.907625 # 4 -10672 10672 4 24.662121 -23.840050 18.907625 # 4 -10673 10673 4 9.042778 -22.195910 18.085556 # 4 -10674 10674 4 9.042778 -23.017979 18.907625 # 4 -10675 10675 4 9.864848 -23.017979 18.085556 # 4 -10676 10676 4 10.686919 -22.195910 18.085556 # 4 -10677 10677 4 10.686919 -23.017979 18.907625 # 4 -10678 10678 4 9.864848 -22.195910 18.907625 # 4 -10679 10679 4 11.508989 -23.017979 18.085556 # 4 -10680 10680 4 12.331060 -22.195910 18.085556 # 4 -10681 10681 4 12.331060 -23.017979 18.907625 # 4 -10682 10682 4 11.508989 -22.195910 18.907625 # 4 -10683 10683 4 13.153131 -23.017979 18.085556 # 4 -10684 10684 4 13.975202 -22.195910 18.085556 # 4 -10685 10685 4 13.975202 -23.017979 18.907625 # 4 -10686 10686 4 13.153131 -22.195910 18.907625 # 4 -10687 10687 4 14.797273 -23.017979 18.085556 # 4 -10688 10688 4 15.619343 -22.195910 18.085556 # 4 -10689 10689 4 15.619343 -23.017979 18.907625 # 4 -10690 10690 4 14.797273 -22.195910 18.907625 # 4 -10691 10691 4 16.441414 -23.017979 18.085556 # 4 -10692 10692 4 17.263485 -22.195910 18.085556 # 4 -10693 10693 4 17.263485 -23.017979 18.907625 # 4 -10694 10694 4 16.441414 -22.195910 18.907625 # 4 -10695 10695 4 18.085556 -23.017979 18.085556 # 4 -10696 10696 4 18.907625 -22.195910 18.085556 # 4 -10697 10697 4 18.907625 -23.017979 18.907625 # 4 -10698 10698 4 18.085556 -22.195910 18.907625 # 4 -10699 10699 4 19.729696 -23.017979 18.085556 # 4 -10700 10700 4 20.551767 -22.195910 18.085556 # 4 -10701 10701 4 20.551767 -23.017979 18.907625 # 4 -10702 10702 4 19.729696 -22.195910 18.907625 # 4 -10703 10703 4 21.373838 -23.017979 18.085556 # 4 -10704 10704 4 22.195910 -22.195910 18.085556 # 4 -10705 10705 4 22.195910 -23.017979 18.907625 # 4 -10706 10706 4 21.373838 -22.195910 18.907625 # 4 -10707 10707 4 23.017979 -23.017979 18.085556 # 4 -10708 10708 4 23.840050 -22.195910 18.085556 # 4 -10709 10709 4 23.840050 -23.017979 18.907625 # 4 -10710 10710 4 23.017979 -22.195910 18.907625 # 4 -10711 10711 4 24.662121 -23.017979 18.085556 # 4 -10712 10712 4 24.662121 -22.195910 18.907625 # 4 -10713 10713 4 9.042778 -20.551767 18.085556 # 4 -10714 10714 4 9.042778 -21.373838 18.907625 # 4 -10715 10715 4 9.864848 -21.373838 18.085556 # 4 -10716 10716 4 10.686919 -20.551767 18.085556 # 4 -10717 10717 4 10.686919 -21.373838 18.907625 # 4 -10718 10718 4 9.864848 -20.551767 18.907625 # 4 -10719 10719 4 11.508989 -21.373838 18.085556 # 4 -10720 10720 4 12.331060 -20.551767 18.085556 # 4 -10721 10721 4 12.331060 -21.373838 18.907625 # 4 -10722 10722 4 11.508989 -20.551767 18.907625 # 4 -10723 10723 4 13.153131 -21.373838 18.085556 # 4 -10724 10724 4 13.975202 -20.551767 18.085556 # 4 -10725 10725 4 13.975202 -21.373838 18.907625 # 4 -10726 10726 4 13.153131 -20.551767 18.907625 # 4 -10727 10727 4 14.797273 -21.373838 18.085556 # 4 -10728 10728 4 15.619343 -20.551767 18.085556 # 4 -10729 10729 4 15.619343 -21.373838 18.907625 # 4 -10730 10730 4 14.797273 -20.551767 18.907625 # 4 -10731 10731 4 16.441414 -21.373838 18.085556 # 4 -10732 10732 4 17.263485 -20.551767 18.085556 # 4 -10733 10733 4 17.263485 -21.373838 18.907625 # 4 -10734 10734 4 16.441414 -20.551767 18.907625 # 4 -10735 10735 4 18.085556 -21.373838 18.085556 # 4 -10736 10736 4 18.907625 -20.551767 18.085556 # 4 -10737 10737 4 18.907625 -21.373838 18.907625 # 4 -10738 10738 4 18.085556 -20.551767 18.907625 # 4 -10739 10739 4 19.729696 -21.373838 18.085556 # 4 -10740 10740 4 20.551767 -20.551767 18.085556 # 4 -10741 10741 4 20.551767 -21.373838 18.907625 # 4 -10742 10742 4 19.729696 -20.551767 18.907625 # 4 -10743 10743 4 21.373838 -21.373838 18.085556 # 4 -10744 10744 4 22.195910 -20.551767 18.085556 # 4 -10745 10745 4 22.195910 -21.373838 18.907625 # 4 -10746 10746 4 21.373838 -20.551767 18.907625 # 4 -10747 10747 4 23.017979 -21.373838 18.085556 # 4 -10748 10748 4 23.840050 -20.551767 18.085556 # 4 -10749 10749 4 23.840050 -21.373838 18.907625 # 4 -10750 10750 4 23.017979 -20.551767 18.907625 # 4 -10751 10751 4 24.662121 -21.373838 18.085556 # 4 -10752 10752 4 24.662121 -20.551767 18.907625 # 4 -10753 10753 4 9.042778 -23.840050 19.729696 # 4 -10754 10754 4 10.686919 -23.840050 19.729696 # 4 -10755 10755 4 9.864848 -23.840050 20.551767 # 4 -10756 10756 4 12.331060 -23.840050 19.729696 # 4 -10757 10757 4 11.508989 -23.840050 20.551767 # 4 -10758 10758 4 13.975202 -23.840050 19.729696 # 4 -10759 10759 4 13.153131 -23.840050 20.551767 # 4 -10760 10760 4 15.619343 -23.840050 19.729696 # 4 -10761 10761 4 14.797273 -23.840050 20.551767 # 4 -10762 10762 4 17.263485 -23.840050 19.729696 # 4 -10763 10763 4 16.441414 -23.840050 20.551767 # 4 -10764 10764 4 18.907625 -23.840050 19.729696 # 4 -10765 10765 4 18.085556 -23.840050 20.551767 # 4 -10766 10766 4 20.551767 -23.840050 19.729696 # 4 -10767 10767 4 19.729696 -23.840050 20.551767 # 4 -10768 10768 4 22.195910 -23.840050 19.729696 # 4 -10769 10769 4 21.373838 -23.840050 20.551767 # 4 -10770 10770 4 23.840050 -23.840050 19.729696 # 4 -10771 10771 4 23.017979 -23.840050 20.551767 # 4 -10772 10772 4 24.662121 -23.840050 20.551767 # 4 -10773 10773 4 9.042778 -22.195910 19.729696 # 4 -10774 10774 4 9.042778 -23.017979 20.551767 # 4 -10775 10775 4 9.864848 -23.017979 19.729696 # 4 -10776 10776 4 10.686919 -22.195910 19.729696 # 4 -10777 10777 4 10.686919 -23.017979 20.551767 # 4 -10778 10778 4 9.864848 -22.195910 20.551767 # 4 -10779 10779 4 11.508989 -23.017979 19.729696 # 4 -10780 10780 4 12.331060 -22.195910 19.729696 # 4 -10781 10781 4 12.331060 -23.017979 20.551767 # 4 -10782 10782 4 11.508989 -22.195910 20.551767 # 4 -10783 10783 4 13.153131 -23.017979 19.729696 # 4 -10784 10784 4 13.975202 -22.195910 19.729696 # 4 -10785 10785 4 13.975202 -23.017979 20.551767 # 4 -10786 10786 4 13.153131 -22.195910 20.551767 # 4 -10787 10787 4 14.797273 -23.017979 19.729696 # 4 -10788 10788 4 15.619343 -22.195910 19.729696 # 4 -10789 10789 4 15.619343 -23.017979 20.551767 # 4 -10790 10790 4 14.797273 -22.195910 20.551767 # 4 -10791 10791 4 16.441414 -23.017979 19.729696 # 4 -10792 10792 4 17.263485 -22.195910 19.729696 # 4 -10793 10793 4 17.263485 -23.017979 20.551767 # 4 -10794 10794 4 16.441414 -22.195910 20.551767 # 4 -10795 10795 4 18.085556 -23.017979 19.729696 # 4 -10796 10796 4 18.907625 -22.195910 19.729696 # 4 -10797 10797 4 18.907625 -23.017979 20.551767 # 4 -10798 10798 4 18.085556 -22.195910 20.551767 # 4 -10799 10799 4 19.729696 -23.017979 19.729696 # 4 -10800 10800 4 20.551767 -22.195910 19.729696 # 4 -10801 10801 4 20.551767 -23.017979 20.551767 # 4 -10802 10802 4 19.729696 -22.195910 20.551767 # 4 -10803 10803 4 21.373838 -23.017979 19.729696 # 4 -10804 10804 4 22.195910 -22.195910 19.729696 # 4 -10805 10805 4 22.195910 -23.017979 20.551767 # 4 -10806 10806 4 21.373838 -22.195910 20.551767 # 4 -10807 10807 4 23.017979 -23.017979 19.729696 # 4 -10808 10808 4 23.840050 -22.195910 19.729696 # 4 -10809 10809 4 23.840050 -23.017979 20.551767 # 4 -10810 10810 4 23.017979 -22.195910 20.551767 # 4 -10811 10811 4 24.662121 -23.017979 19.729696 # 4 -10812 10812 4 24.662121 -22.195910 20.551767 # 4 -10813 10813 4 9.042778 -20.551767 19.729696 # 4 -10814 10814 4 9.042778 -21.373838 20.551767 # 4 -10815 10815 4 9.864848 -21.373838 19.729696 # 4 -10816 10816 4 10.686919 -20.551767 19.729696 # 4 -10817 10817 4 10.686919 -21.373838 20.551767 # 4 -10818 10818 4 9.864848 -20.551767 20.551767 # 4 -10819 10819 4 11.508989 -21.373838 19.729696 # 4 -10820 10820 4 12.331060 -20.551767 19.729696 # 4 -10821 10821 4 12.331060 -21.373838 20.551767 # 4 -10822 10822 4 11.508989 -20.551767 20.551767 # 4 -10823 10823 4 13.153131 -21.373838 19.729696 # 4 -10824 10824 4 13.975202 -20.551767 19.729696 # 4 -10825 10825 4 13.975202 -21.373838 20.551767 # 4 -10826 10826 4 13.153131 -20.551767 20.551767 # 4 -10827 10827 4 14.797273 -21.373838 19.729696 # 4 -10828 10828 4 15.619343 -20.551767 19.729696 # 4 -10829 10829 4 15.619343 -21.373838 20.551767 # 4 -10830 10830 4 14.797273 -20.551767 20.551767 # 4 -10831 10831 4 16.441414 -21.373838 19.729696 # 4 -10832 10832 4 17.263485 -20.551767 19.729696 # 4 -10833 10833 4 17.263485 -21.373838 20.551767 # 4 -10834 10834 4 16.441414 -20.551767 20.551767 # 4 -10835 10835 4 18.085556 -21.373838 19.729696 # 4 -10836 10836 4 18.907625 -20.551767 19.729696 # 4 -10837 10837 4 18.907625 -21.373838 20.551767 # 4 -10838 10838 4 18.085556 -20.551767 20.551767 # 4 -10839 10839 4 19.729696 -21.373838 19.729696 # 4 -10840 10840 4 20.551767 -20.551767 19.729696 # 4 -10841 10841 4 20.551767 -21.373838 20.551767 # 4 -10842 10842 4 19.729696 -20.551767 20.551767 # 4 -10843 10843 4 21.373838 -21.373838 19.729696 # 4 -10844 10844 4 22.195910 -20.551767 19.729696 # 4 -10845 10845 4 22.195910 -21.373838 20.551767 # 4 -10846 10846 4 21.373838 -20.551767 20.551767 # 4 -10847 10847 4 23.017979 -21.373838 19.729696 # 4 -10848 10848 4 23.840050 -20.551767 19.729696 # 4 -10849 10849 4 23.840050 -21.373838 20.551767 # 4 -10850 10850 4 23.017979 -20.551767 20.551767 # 4 -10851 10851 4 24.662121 -21.373838 19.729696 # 4 -10852 10852 4 24.662121 -20.551767 20.551767 # 4 -10853 10853 4 9.042778 -23.840050 21.373838 # 4 -10854 10854 4 10.686919 -23.840050 21.373838 # 4 -10855 10855 4 9.864848 -23.840050 22.195910 # 4 -10856 10856 4 12.331060 -23.840050 21.373838 # 4 -10857 10857 4 11.508989 -23.840050 22.195910 # 4 -10858 10858 4 13.975202 -23.840050 21.373838 # 4 -10859 10859 4 13.153131 -23.840050 22.195910 # 4 -10860 10860 4 15.619343 -23.840050 21.373838 # 4 -10861 10861 4 14.797273 -23.840050 22.195910 # 4 -10862 10862 4 17.263485 -23.840050 21.373838 # 4 -10863 10863 4 16.441414 -23.840050 22.195910 # 4 -10864 10864 4 18.907625 -23.840050 21.373838 # 4 -10865 10865 4 18.085556 -23.840050 22.195910 # 4 -10866 10866 4 20.551767 -23.840050 21.373838 # 4 -10867 10867 4 19.729696 -23.840050 22.195910 # 4 -10868 10868 4 22.195910 -23.840050 21.373838 # 4 -10869 10869 4 21.373838 -23.840050 22.195910 # 4 -10870 10870 4 23.840050 -23.840050 21.373838 # 4 -10871 10871 4 23.017979 -23.840050 22.195910 # 4 -10872 10872 4 24.662121 -23.840050 22.195910 # 4 -10873 10873 4 9.042778 -22.195910 21.373838 # 4 -10874 10874 4 9.042778 -23.017979 22.195910 # 4 -10875 10875 4 9.864848 -23.017979 21.373838 # 4 -10876 10876 4 10.686919 -22.195910 21.373838 # 4 -10877 10877 4 10.686919 -23.017979 22.195910 # 4 -10878 10878 4 9.864848 -22.195910 22.195910 # 4 -10879 10879 4 11.508989 -23.017979 21.373838 # 4 -10880 10880 4 12.331060 -22.195910 21.373838 # 4 -10881 10881 4 12.331060 -23.017979 22.195910 # 4 -10882 10882 4 11.508989 -22.195910 22.195910 # 4 -10883 10883 4 13.153131 -23.017979 21.373838 # 4 -10884 10884 4 13.975202 -22.195910 21.373838 # 4 -10885 10885 4 13.975202 -23.017979 22.195910 # 4 -10886 10886 4 13.153131 -22.195910 22.195910 # 4 -10887 10887 4 14.797273 -23.017979 21.373838 # 4 -10888 10888 4 15.619343 -22.195910 21.373838 # 4 -10889 10889 4 15.619343 -23.017979 22.195910 # 4 -10890 10890 4 14.797273 -22.195910 22.195910 # 4 -10891 10891 4 16.441414 -23.017979 21.373838 # 4 -10892 10892 4 17.263485 -22.195910 21.373838 # 4 -10893 10893 4 17.263485 -23.017979 22.195910 # 4 -10894 10894 4 16.441414 -22.195910 22.195910 # 4 -10895 10895 4 18.085556 -23.017979 21.373838 # 4 -10896 10896 4 18.907625 -22.195910 21.373838 # 4 -10897 10897 4 18.907625 -23.017979 22.195910 # 4 -10898 10898 4 18.085556 -22.195910 22.195910 # 4 -10899 10899 4 19.729696 -23.017979 21.373838 # 4 -10900 10900 4 20.551767 -22.195910 21.373838 # 4 -10901 10901 4 20.551767 -23.017979 22.195910 # 4 -10902 10902 4 19.729696 -22.195910 22.195910 # 4 -10903 10903 4 21.373838 -23.017979 21.373838 # 4 -10904 10904 4 22.195910 -22.195910 21.373838 # 4 -10905 10905 4 22.195910 -23.017979 22.195910 # 4 -10906 10906 4 21.373838 -22.195910 22.195910 # 4 -10907 10907 4 23.017979 -23.017979 21.373838 # 4 -10908 10908 4 23.840050 -22.195910 21.373838 # 4 -10909 10909 4 23.840050 -23.017979 22.195910 # 4 -10910 10910 4 23.017979 -22.195910 22.195910 # 4 -10911 10911 4 24.662121 -23.017979 21.373838 # 4 -10912 10912 4 24.662121 -22.195910 22.195910 # 4 -10913 10913 4 9.042778 -20.551767 21.373838 # 4 -10914 10914 4 9.042778 -21.373838 22.195910 # 4 -10915 10915 4 9.864848 -21.373838 21.373838 # 4 -10916 10916 4 10.686919 -20.551767 21.373838 # 4 -10917 10917 4 10.686919 -21.373838 22.195910 # 4 -10918 10918 4 9.864848 -20.551767 22.195910 # 4 -10919 10919 4 11.508989 -21.373838 21.373838 # 4 -10920 10920 4 12.331060 -20.551767 21.373838 # 4 -10921 10921 4 12.331060 -21.373838 22.195910 # 4 -10922 10922 4 11.508989 -20.551767 22.195910 # 4 -10923 10923 4 13.153131 -21.373838 21.373838 # 4 -10924 10924 4 13.975202 -20.551767 21.373838 # 4 -10925 10925 4 13.975202 -21.373838 22.195910 # 4 -10926 10926 4 13.153131 -20.551767 22.195910 # 4 -10927 10927 4 14.797273 -21.373838 21.373838 # 4 -10928 10928 4 15.619343 -20.551767 21.373838 # 4 -10929 10929 4 15.619343 -21.373838 22.195910 # 4 -10930 10930 4 14.797273 -20.551767 22.195910 # 4 -10931 10931 4 16.441414 -21.373838 21.373838 # 4 -10932 10932 4 17.263485 -20.551767 21.373838 # 4 -10933 10933 4 17.263485 -21.373838 22.195910 # 4 -10934 10934 4 16.441414 -20.551767 22.195910 # 4 -10935 10935 4 18.085556 -21.373838 21.373838 # 4 -10936 10936 4 18.907625 -20.551767 21.373838 # 4 -10937 10937 4 18.907625 -21.373838 22.195910 # 4 -10938 10938 4 18.085556 -20.551767 22.195910 # 4 -10939 10939 4 19.729696 -21.373838 21.373838 # 4 -10940 10940 4 20.551767 -20.551767 21.373838 # 4 -10941 10941 4 20.551767 -21.373838 22.195910 # 4 -10942 10942 4 19.729696 -20.551767 22.195910 # 4 -10943 10943 4 21.373838 -21.373838 21.373838 # 4 -10944 10944 4 22.195910 -20.551767 21.373838 # 4 -10945 10945 4 22.195910 -21.373838 22.195910 # 4 -10946 10946 4 21.373838 -20.551767 22.195910 # 4 -10947 10947 4 23.017979 -21.373838 21.373838 # 4 -10948 10948 4 23.840050 -20.551767 21.373838 # 4 -10949 10949 4 23.840050 -21.373838 22.195910 # 4 -10950 10950 4 23.017979 -20.551767 22.195910 # 4 -10951 10951 4 24.662121 -21.373838 21.373838 # 4 -10952 10952 4 24.662121 -20.551767 22.195910 # 4 -10953 10953 4 9.042778 -23.840050 23.017979 # 4 -10954 10954 4 10.686919 -23.840050 23.017979 # 4 -10955 10955 4 9.864848 -23.840050 23.840050 # 4 -10956 10956 4 12.331060 -23.840050 23.017979 # 4 -10957 10957 4 11.508989 -23.840050 23.840050 # 4 -10958 10958 4 13.975202 -23.840050 23.017979 # 4 -10959 10959 4 13.153131 -23.840050 23.840050 # 4 -10960 10960 4 15.619343 -23.840050 23.017979 # 4 -10961 10961 4 14.797273 -23.840050 23.840050 # 4 -10962 10962 4 17.263485 -23.840050 23.017979 # 4 -10963 10963 4 16.441414 -23.840050 23.840050 # 4 -10964 10964 4 18.907625 -23.840050 23.017979 # 4 -10965 10965 4 18.085556 -23.840050 23.840050 # 4 -10966 10966 4 20.551767 -23.840050 23.017979 # 4 -10967 10967 4 19.729696 -23.840050 23.840050 # 4 -10968 10968 4 22.195910 -23.840050 23.017979 # 4 -10969 10969 4 21.373838 -23.840050 23.840050 # 4 -10970 10970 4 23.840050 -23.840050 23.017979 # 4 -10971 10971 4 23.017979 -23.840050 23.840050 # 4 -10972 10972 4 24.662121 -23.840050 23.840050 # 4 -10973 10973 4 9.042778 -22.195910 23.017979 # 4 -10974 10974 4 9.042778 -23.017979 23.840050 # 4 -10975 10975 4 9.864848 -23.017979 23.017979 # 4 -10976 10976 4 10.686919 -22.195910 23.017979 # 4 -10977 10977 4 10.686919 -23.017979 23.840050 # 4 -10978 10978 4 9.864848 -22.195910 23.840050 # 4 -10979 10979 4 11.508989 -23.017979 23.017979 # 4 -10980 10980 4 12.331060 -22.195910 23.017979 # 4 -10981 10981 4 12.331060 -23.017979 23.840050 # 4 -10982 10982 4 11.508989 -22.195910 23.840050 # 4 -10983 10983 4 13.153131 -23.017979 23.017979 # 4 -10984 10984 4 13.975202 -22.195910 23.017979 # 4 -10985 10985 4 13.975202 -23.017979 23.840050 # 4 -10986 10986 4 13.153131 -22.195910 23.840050 # 4 -10987 10987 4 14.797273 -23.017979 23.017979 # 4 -10988 10988 4 15.619343 -22.195910 23.017979 # 4 -10989 10989 4 15.619343 -23.017979 23.840050 # 4 -10990 10990 4 14.797273 -22.195910 23.840050 # 4 -10991 10991 4 16.441414 -23.017979 23.017979 # 4 -10992 10992 4 17.263485 -22.195910 23.017979 # 4 -10993 10993 4 17.263485 -23.017979 23.840050 # 4 -10994 10994 4 16.441414 -22.195910 23.840050 # 4 -10995 10995 4 18.085556 -23.017979 23.017979 # 4 -10996 10996 4 18.907625 -22.195910 23.017979 # 4 -10997 10997 4 18.907625 -23.017979 23.840050 # 4 -10998 10998 4 18.085556 -22.195910 23.840050 # 4 -10999 10999 4 19.729696 -23.017979 23.017979 # 4 -11000 11000 4 20.551767 -22.195910 23.017979 # 4 -11001 11001 4 20.551767 -23.017979 23.840050 # 4 -11002 11002 4 19.729696 -22.195910 23.840050 # 4 -11003 11003 4 21.373838 -23.017979 23.017979 # 4 -11004 11004 4 22.195910 -22.195910 23.017979 # 4 -11005 11005 4 22.195910 -23.017979 23.840050 # 4 -11006 11006 4 21.373838 -22.195910 23.840050 # 4 -11007 11007 4 23.017979 -23.017979 23.017979 # 4 -11008 11008 4 23.840050 -22.195910 23.017979 # 4 -11009 11009 4 23.840050 -23.017979 23.840050 # 4 -11010 11010 4 23.017979 -22.195910 23.840050 # 4 -11011 11011 4 24.662121 -23.017979 23.017979 # 4 -11012 11012 4 24.662121 -22.195910 23.840050 # 4 -11013 11013 4 9.042778 -20.551767 23.017979 # 4 -11014 11014 4 9.042778 -21.373838 23.840050 # 4 -11015 11015 4 9.864848 -21.373838 23.017979 # 4 -11016 11016 4 10.686919 -20.551767 23.017979 # 4 -11017 11017 4 10.686919 -21.373838 23.840050 # 4 -11018 11018 4 9.864848 -20.551767 23.840050 # 4 -11019 11019 4 11.508989 -21.373838 23.017979 # 4 -11020 11020 4 12.331060 -20.551767 23.017979 # 4 -11021 11021 4 12.331060 -21.373838 23.840050 # 4 -11022 11022 4 11.508989 -20.551767 23.840050 # 4 -11023 11023 4 13.153131 -21.373838 23.017979 # 4 -11024 11024 4 13.975202 -20.551767 23.017979 # 4 -11025 11025 4 13.975202 -21.373838 23.840050 # 4 -11026 11026 4 13.153131 -20.551767 23.840050 # 4 -11027 11027 4 14.797273 -21.373838 23.017979 # 4 -11028 11028 4 15.619343 -20.551767 23.017979 # 4 -11029 11029 4 15.619343 -21.373838 23.840050 # 4 -11030 11030 4 14.797273 -20.551767 23.840050 # 4 -11031 11031 4 16.441414 -21.373838 23.017979 # 4 -11032 11032 4 17.263485 -20.551767 23.017979 # 4 -11033 11033 4 17.263485 -21.373838 23.840050 # 4 -11034 11034 4 16.441414 -20.551767 23.840050 # 4 -11035 11035 4 18.085556 -21.373838 23.017979 # 4 -11036 11036 4 18.907625 -20.551767 23.017979 # 4 -11037 11037 4 18.907625 -21.373838 23.840050 # 4 -11038 11038 4 18.085556 -20.551767 23.840050 # 4 -11039 11039 4 19.729696 -21.373838 23.017979 # 4 -11040 11040 4 20.551767 -20.551767 23.017979 # 4 -11041 11041 4 20.551767 -21.373838 23.840050 # 4 -11042 11042 4 19.729696 -20.551767 23.840050 # 4 -11043 11043 4 21.373838 -21.373838 23.017979 # 4 -11044 11044 4 22.195910 -20.551767 23.017979 # 4 -11045 11045 4 22.195910 -21.373838 23.840050 # 4 -11046 11046 4 21.373838 -20.551767 23.840050 # 4 -11047 11047 4 23.017979 -21.373838 23.017979 # 4 -11048 11048 4 23.840050 -20.551767 23.017979 # 4 -11049 11049 4 23.840050 -21.373838 23.840050 # 4 -11050 11050 4 23.017979 -20.551767 23.840050 # 4 -11051 11051 4 24.662121 -21.373838 23.017979 # 4 -11052 11052 4 24.662121 -20.551767 23.840050 # 4 -11053 11053 4 9.042778 -23.840050 24.662121 # 4 -11054 11054 4 10.686919 -23.840050 24.662121 # 4 -11055 11055 4 12.331060 -23.840050 24.662121 # 4 -11056 11056 4 13.975202 -23.840050 24.662121 # 4 -11057 11057 4 15.619343 -23.840050 24.662121 # 4 -11058 11058 4 17.263485 -23.840050 24.662121 # 4 -11059 11059 4 18.907625 -23.840050 24.662121 # 4 -11060 11060 4 20.551767 -23.840050 24.662121 # 4 -11061 11061 4 22.195910 -23.840050 24.662121 # 4 -11062 11062 4 23.840050 -23.840050 24.662121 # 4 -11063 11063 4 9.042778 -22.195910 24.662121 # 4 -11064 11064 4 9.864848 -23.017979 24.662121 # 4 -11065 11065 4 10.686919 -22.195910 24.662121 # 4 -11066 11066 4 11.508989 -23.017979 24.662121 # 4 -11067 11067 4 12.331060 -22.195910 24.662121 # 4 -11068 11068 4 13.153131 -23.017979 24.662121 # 4 -11069 11069 4 13.975202 -22.195910 24.662121 # 4 -11070 11070 4 14.797273 -23.017979 24.662121 # 4 -11071 11071 4 15.619343 -22.195910 24.662121 # 4 -11072 11072 4 16.441414 -23.017979 24.662121 # 4 -11073 11073 4 17.263485 -22.195910 24.662121 # 4 -11074 11074 4 18.085556 -23.017979 24.662121 # 4 -11075 11075 4 18.907625 -22.195910 24.662121 # 4 -11076 11076 4 19.729696 -23.017979 24.662121 # 4 -11077 11077 4 20.551767 -22.195910 24.662121 # 4 -11078 11078 4 21.373838 -23.017979 24.662121 # 4 -11079 11079 4 22.195910 -22.195910 24.662121 # 4 -11080 11080 4 23.017979 -23.017979 24.662121 # 4 -11081 11081 4 23.840050 -22.195910 24.662121 # 4 -11082 11082 4 24.662121 -23.017979 24.662121 # 4 -11083 11083 4 9.042778 -20.551767 24.662121 # 4 -11084 11084 4 9.864848 -21.373838 24.662121 # 4 -11085 11085 4 10.686919 -20.551767 24.662121 # 4 -11086 11086 4 11.508989 -21.373838 24.662121 # 4 -11087 11087 4 12.331060 -20.551767 24.662121 # 4 -11088 11088 4 13.153131 -21.373838 24.662121 # 4 -11089 11089 4 13.975202 -20.551767 24.662121 # 4 -11090 11090 4 14.797273 -21.373838 24.662121 # 4 -11091 11091 4 15.619343 -20.551767 24.662121 # 4 -11092 11092 4 16.441414 -21.373838 24.662121 # 4 -11093 11093 4 17.263485 -20.551767 24.662121 # 4 -11094 11094 4 18.085556 -21.373838 24.662121 # 4 -11095 11095 4 18.907625 -20.551767 24.662121 # 4 -11096 11096 4 19.729696 -21.373838 24.662121 # 4 -11097 11097 4 20.551767 -20.551767 24.662121 # 4 -11098 11098 4 21.373838 -21.373838 24.662121 # 4 -11099 11099 4 22.195910 -20.551767 24.662121 # 4 -11100 11100 4 23.017979 -21.373838 24.662121 # 4 -11101 11101 4 23.840050 -20.551767 24.662121 # 4 -11102 11102 4 24.662121 -21.373838 24.662121 # 4 -11103 11103 4 -13.975202 -19.729696 -2.466212 # 4 -11104 11104 4 -12.331060 -18.907625 -3.288283 # 4 -11105 11105 4 -12.331060 -19.729696 -2.466212 # 4 -11106 11106 4 -13.153131 -18.907625 -2.466212 # 4 -11107 11107 4 -11.508989 -19.729696 -3.288283 # 4 -11108 11108 4 -10.686919 -18.907625 -3.288283 # 4 -11109 11109 4 -10.686919 -19.729696 -2.466212 # 4 -11110 11110 4 -11.508989 -18.907625 -2.466212 # 4 -11111 11111 4 -9.864848 -19.729696 -3.288283 # 4 -11112 11112 4 -9.042778 -18.907625 -3.288283 # 4 -11113 11113 4 -9.042778 -19.729696 -2.466212 # 4 -11114 11114 4 -9.864848 -18.907625 -2.466212 # 4 -11115 11115 4 -13.975202 -18.085556 -2.466212 # 4 -11116 11116 4 -12.331060 -17.263485 -3.288283 # 4 -11117 11117 4 -12.331060 -18.085556 -2.466212 # 4 -11118 11118 4 -13.153131 -17.263485 -2.466212 # 4 -11119 11119 4 -11.508989 -18.085556 -3.288283 # 4 -11120 11120 4 -10.686919 -17.263485 -3.288283 # 4 -11121 11121 4 -10.686919 -18.085556 -2.466212 # 4 -11122 11122 4 -11.508989 -17.263485 -2.466212 # 4 -11123 11123 4 -9.864848 -18.085556 -3.288283 # 4 -11124 11124 4 -9.042778 -17.263485 -3.288283 # 4 -11125 11125 4 -9.042778 -18.085556 -2.466212 # 4 -11126 11126 4 -9.864848 -17.263485 -2.466212 # 4 -11127 11127 4 -13.975202 -16.441414 -2.466212 # 4 -11128 11128 4 -12.331060 -16.441414 -2.466212 # 4 -11129 11129 4 -11.508989 -16.441414 -3.288283 # 4 -11130 11130 4 -10.686919 -16.441414 -2.466212 # 4 -11131 11131 4 -9.864848 -16.441414 -3.288283 # 4 -11132 11132 4 -9.042778 -16.441414 -2.466212 # 4 -11133 11133 4 -15.619343 -18.907625 -1.644141 # 4 -11134 11134 4 -15.619343 -19.729696 -0.822071 # 4 -11135 11135 4 -16.441414 -18.907625 -0.822071 # 4 -11136 11136 4 -14.797273 -19.729696 -1.644141 # 4 -11137 11137 4 -13.975202 -18.907625 -1.644141 # 4 -11138 11138 4 -13.975202 -19.729696 -0.822071 # 4 -11139 11139 4 -14.797273 -18.907625 -0.822071 # 4 -11140 11140 4 -13.153131 -19.729696 -1.644141 # 4 -11141 11141 4 -12.331060 -18.907625 -1.644141 # 4 -11142 11142 4 -12.331060 -19.729696 -0.822071 # 4 -11143 11143 4 -13.153131 -18.907625 -0.822071 # 4 -11144 11144 4 -11.508989 -19.729696 -1.644141 # 4 -11145 11145 4 -10.686919 -18.907625 -1.644141 # 4 -11146 11146 4 -10.686919 -19.729696 -0.822071 # 4 -11147 11147 4 -11.508989 -18.907625 -0.822071 # 4 -11148 11148 4 -9.864848 -19.729696 -1.644141 # 4 -11149 11149 4 -9.042778 -18.907625 -1.644141 # 4 -11150 11150 4 -9.042778 -19.729696 -0.822071 # 4 -11151 11151 4 -9.864848 -18.907625 -0.822071 # 4 -11152 11152 4 -15.619343 -17.263485 -1.644141 # 4 -11153 11153 4 -15.619343 -18.085556 -0.822071 # 4 -11154 11154 4 -16.441414 -17.263485 -0.822071 # 4 -11155 11155 4 -14.797273 -18.085556 -1.644141 # 4 -11156 11156 4 -13.975202 -17.263485 -1.644141 # 4 -11157 11157 4 -13.975202 -18.085556 -0.822071 # 4 -11158 11158 4 -14.797273 -17.263485 -0.822071 # 4 -11159 11159 4 -13.153131 -18.085556 -1.644141 # 4 -11160 11160 4 -12.331060 -17.263485 -1.644141 # 4 -11161 11161 4 -12.331060 -18.085556 -0.822071 # 4 -11162 11162 4 -13.153131 -17.263485 -0.822071 # 4 -11163 11163 4 -11.508989 -18.085556 -1.644141 # 4 -11164 11164 4 -10.686919 -17.263485 -1.644141 # 4 -11165 11165 4 -10.686919 -18.085556 -0.822071 # 4 -11166 11166 4 -11.508989 -17.263485 -0.822071 # 4 -11167 11167 4 -9.864848 -18.085556 -1.644141 # 4 -11168 11168 4 -9.042778 -17.263485 -1.644141 # 4 -11169 11169 4 -9.042778 -18.085556 -0.822071 # 4 -11170 11170 4 -9.864848 -17.263485 -0.822071 # 4 -11171 11171 4 -15.619343 -16.441414 -0.822071 # 4 -11172 11172 4 -14.797273 -16.441414 -1.644141 # 4 -11173 11173 4 -13.975202 -16.441414 -0.822071 # 4 -11174 11174 4 -13.153131 -16.441414 -1.644141 # 4 -11175 11175 4 -12.331060 -16.441414 -0.822071 # 4 -11176 11176 4 -11.508989 -16.441414 -1.644141 # 4 -11177 11177 4 -10.686919 -16.441414 -0.822071 # 4 -11178 11178 4 -9.864848 -16.441414 -1.644141 # 4 -11179 11179 4 -9.042778 -16.441414 -0.822071 # 4 -11180 11180 4 -17.263485 -18.907625 0.000000 # 4 -11181 11181 4 -17.263485 -19.729696 0.822071 # 4 -11182 11182 4 -18.085556 -18.907625 0.822071 # 4 -11183 11183 4 -16.441414 -19.729696 0.000000 # 4 -11184 11184 4 -15.619343 -18.907625 0.000000 # 4 -11185 11185 4 -15.619343 -19.729696 0.822071 # 4 -11186 11186 4 -16.441414 -18.907625 0.822071 # 4 -11187 11187 4 -14.797273 -19.729696 0.000000 # 4 -11188 11188 4 -13.975202 -18.907625 0.000000 # 4 -11189 11189 4 -13.975202 -19.729696 0.822071 # 4 -11190 11190 4 -14.797273 -18.907625 0.822071 # 4 -11191 11191 4 -13.153131 -19.729696 0.000000 # 4 -11192 11192 4 -12.331060 -18.907625 0.000000 # 4 -11193 11193 4 -12.331060 -19.729696 0.822071 # 4 -11194 11194 4 -13.153131 -18.907625 0.822071 # 4 -11195 11195 4 -11.508989 -19.729696 0.000000 # 4 -11196 11196 4 -10.686919 -18.907625 0.000000 # 4 -11197 11197 4 -10.686919 -19.729696 0.822071 # 4 -11198 11198 4 -11.508989 -18.907625 0.822071 # 4 -11199 11199 4 -9.864848 -19.729696 0.000000 # 4 -11200 11200 4 -9.042778 -18.907625 0.000000 # 4 -11201 11201 4 -9.042778 -19.729696 0.822071 # 4 -11202 11202 4 -9.864848 -18.907625 0.822071 # 4 -11203 11203 4 -17.263485 -17.263485 0.000000 # 4 -11204 11204 4 -17.263485 -18.085556 0.822071 # 4 -11205 11205 4 -18.085556 -17.263485 0.822071 # 4 -11206 11206 4 -16.441414 -18.085556 0.000000 # 4 -11207 11207 4 -15.619343 -17.263485 0.000000 # 4 -11208 11208 4 -15.619343 -18.085556 0.822071 # 4 -11209 11209 4 -16.441414 -17.263485 0.822071 # 4 -11210 11210 4 -14.797273 -18.085556 0.000000 # 4 -11211 11211 4 -13.975202 -17.263485 0.000000 # 4 -11212 11212 4 -13.975202 -18.085556 0.822071 # 4 -11213 11213 4 -14.797273 -17.263485 0.822071 # 4 -11214 11214 4 -13.153131 -18.085556 0.000000 # 4 -11215 11215 4 -12.331060 -17.263485 0.000000 # 4 -11216 11216 4 -12.331060 -18.085556 0.822071 # 4 -11217 11217 4 -13.153131 -17.263485 0.822071 # 4 -11218 11218 4 -11.508989 -18.085556 0.000000 # 4 -11219 11219 4 -10.686919 -17.263485 0.000000 # 4 -11220 11220 4 -10.686919 -18.085556 0.822071 # 4 -11221 11221 4 -11.508989 -17.263485 0.822071 # 4 -11222 11222 4 -9.864848 -18.085556 0.000000 # 4 -11223 11223 4 -9.042778 -17.263485 0.000000 # 4 -11224 11224 4 -9.042778 -18.085556 0.822071 # 4 -11225 11225 4 -9.864848 -17.263485 0.822071 # 4 -11226 11226 4 -17.263485 -16.441414 0.822071 # 4 -11227 11227 4 -16.441414 -16.441414 0.000000 # 4 -11228 11228 4 -15.619343 -16.441414 0.822071 # 4 -11229 11229 4 -14.797273 -16.441414 0.000000 # 4 -11230 11230 4 -13.975202 -16.441414 0.822071 # 4 -11231 11231 4 -13.153131 -16.441414 0.000000 # 4 -11232 11232 4 -12.331060 -16.441414 0.822071 # 4 -11233 11233 4 -11.508989 -16.441414 0.000000 # 4 -11234 11234 4 -10.686919 -16.441414 0.822071 # 4 -11235 11235 4 -9.864848 -16.441414 0.000000 # 4 -11236 11236 4 -9.042778 -16.441414 0.822071 # 4 -11237 11237 4 -18.907625 -19.729696 2.466212 # 4 -11238 11238 4 -18.085556 -19.729696 1.644141 # 4 -11239 11239 4 -17.263485 -18.907625 1.644141 # 4 -11240 11240 4 -17.263485 -19.729696 2.466212 # 4 -11241 11241 4 -18.085556 -18.907625 2.466212 # 4 -11242 11242 4 -16.441414 -19.729696 1.644141 # 4 -11243 11243 4 -15.619343 -18.907625 1.644141 # 4 -11244 11244 4 -15.619343 -19.729696 2.466212 # 4 -11245 11245 4 -16.441414 -18.907625 2.466212 # 4 -11246 11246 4 -14.797273 -19.729696 1.644141 # 4 -11247 11247 4 -13.975202 -18.907625 1.644141 # 4 -11248 11248 4 -13.975202 -19.729696 2.466212 # 4 -11249 11249 4 -14.797273 -18.907625 2.466212 # 4 -11250 11250 4 -13.153131 -19.729696 1.644141 # 4 -11251 11251 4 -12.331060 -18.907625 1.644141 # 4 -11252 11252 4 -12.331060 -19.729696 2.466212 # 4 -11253 11253 4 -13.153131 -18.907625 2.466212 # 4 -11254 11254 4 -11.508989 -19.729696 1.644141 # 4 -11255 11255 4 -10.686919 -18.907625 1.644141 # 4 -11256 11256 4 -10.686919 -19.729696 2.466212 # 4 -11257 11257 4 -11.508989 -18.907625 2.466212 # 4 -11258 11258 4 -9.864848 -19.729696 1.644141 # 4 -11259 11259 4 -9.042778 -18.907625 1.644141 # 4 -11260 11260 4 -9.042778 -19.729696 2.466212 # 4 -11261 11261 4 -9.864848 -18.907625 2.466212 # 4 -11262 11262 4 -18.907625 -18.085556 2.466212 # 4 -11263 11263 4 -18.085556 -18.085556 1.644141 # 4 -11264 11264 4 -17.263485 -17.263485 1.644141 # 4 -11265 11265 4 -17.263485 -18.085556 2.466212 # 4 -11266 11266 4 -18.085556 -17.263485 2.466212 # 4 -11267 11267 4 -16.441414 -18.085556 1.644141 # 4 -11268 11268 4 -15.619343 -17.263485 1.644141 # 4 -11269 11269 4 -15.619343 -18.085556 2.466212 # 4 -11270 11270 4 -16.441414 -17.263485 2.466212 # 4 -11271 11271 4 -14.797273 -18.085556 1.644141 # 4 -11272 11272 4 -13.975202 -17.263485 1.644141 # 4 -11273 11273 4 -13.975202 -18.085556 2.466212 # 4 -11274 11274 4 -14.797273 -17.263485 2.466212 # 4 -11275 11275 4 -13.153131 -18.085556 1.644141 # 4 -11276 11276 4 -12.331060 -17.263485 1.644141 # 4 -11277 11277 4 -12.331060 -18.085556 2.466212 # 4 -11278 11278 4 -13.153131 -17.263485 2.466212 # 4 -11279 11279 4 -11.508989 -18.085556 1.644141 # 4 -11280 11280 4 -10.686919 -17.263485 1.644141 # 4 -11281 11281 4 -10.686919 -18.085556 2.466212 # 4 -11282 11282 4 -11.508989 -17.263485 2.466212 # 4 -11283 11283 4 -9.864848 -18.085556 1.644141 # 4 -11284 11284 4 -9.042778 -17.263485 1.644141 # 4 -11285 11285 4 -9.042778 -18.085556 2.466212 # 4 -11286 11286 4 -9.864848 -17.263485 2.466212 # 4 -11287 11287 4 -18.907625 -16.441414 2.466212 # 4 -11288 11288 4 -18.085556 -16.441414 1.644141 # 4 -11289 11289 4 -17.263485 -16.441414 2.466212 # 4 -11290 11290 4 -16.441414 -16.441414 1.644141 # 4 -11291 11291 4 -15.619343 -16.441414 2.466212 # 4 -11292 11292 4 -14.797273 -16.441414 1.644141 # 4 -11293 11293 4 -13.975202 -16.441414 2.466212 # 4 -11294 11294 4 -13.153131 -16.441414 1.644141 # 4 -11295 11295 4 -12.331060 -16.441414 2.466212 # 4 -11296 11296 4 -11.508989 -16.441414 1.644141 # 4 -11297 11297 4 -10.686919 -16.441414 2.466212 # 4 -11298 11298 4 -9.864848 -16.441414 1.644141 # 4 -11299 11299 4 -9.042778 -16.441414 2.466212 # 4 -11300 11300 4 -18.907625 -18.907625 3.288283 # 4 -11301 11301 4 -18.907625 -19.729696 4.110353 # 4 -11302 11302 4 -19.729696 -18.907625 4.110353 # 4 -11303 11303 4 -18.085556 -19.729696 3.288283 # 4 -11304 11304 4 -17.263485 -18.907625 3.288283 # 4 -11305 11305 4 -17.263485 -19.729696 4.110353 # 4 -11306 11306 4 -18.085556 -18.907625 4.110353 # 4 -11307 11307 4 -16.441414 -19.729696 3.288283 # 4 -11308 11308 4 -15.619343 -18.907625 3.288283 # 4 -11309 11309 4 -15.619343 -19.729696 4.110353 # 4 -11310 11310 4 -16.441414 -18.907625 4.110353 # 4 -11311 11311 4 -14.797273 -19.729696 3.288283 # 4 -11312 11312 4 -13.975202 -18.907625 3.288283 # 4 -11313 11313 4 -13.975202 -19.729696 4.110353 # 4 -11314 11314 4 -14.797273 -18.907625 4.110353 # 4 -11315 11315 4 -13.153131 -19.729696 3.288283 # 4 -11316 11316 4 -12.331060 -18.907625 3.288283 # 4 -11317 11317 4 -12.331060 -19.729696 4.110353 # 4 -11318 11318 4 -13.153131 -18.907625 4.110353 # 4 -11319 11319 4 -11.508989 -19.729696 3.288283 # 4 -11320 11320 4 -10.686919 -18.907625 3.288283 # 4 -11321 11321 4 -10.686919 -19.729696 4.110353 # 4 -11322 11322 4 -11.508989 -18.907625 4.110353 # 4 -11323 11323 4 -9.864848 -19.729696 3.288283 # 4 -11324 11324 4 -9.042778 -18.907625 3.288283 # 4 -11325 11325 4 -9.042778 -19.729696 4.110353 # 4 -11326 11326 4 -9.864848 -18.907625 4.110353 # 4 -11327 11327 4 -18.907625 -17.263485 3.288283 # 4 -11328 11328 4 -18.907625 -18.085556 4.110353 # 4 -11329 11329 4 -19.729696 -17.263485 4.110353 # 4 -11330 11330 4 -18.085556 -18.085556 3.288283 # 4 -11331 11331 4 -17.263485 -17.263485 3.288283 # 4 -11332 11332 4 -17.263485 -18.085556 4.110353 # 4 -11333 11333 4 -18.085556 -17.263485 4.110353 # 4 -11334 11334 4 -16.441414 -18.085556 3.288283 # 4 -11335 11335 4 -15.619343 -17.263485 3.288283 # 4 -11336 11336 4 -15.619343 -18.085556 4.110353 # 4 -11337 11337 4 -16.441414 -17.263485 4.110353 # 4 -11338 11338 4 -14.797273 -18.085556 3.288283 # 4 -11339 11339 4 -13.975202 -17.263485 3.288283 # 4 -11340 11340 4 -13.975202 -18.085556 4.110353 # 4 -11341 11341 4 -14.797273 -17.263485 4.110353 # 4 -11342 11342 4 -13.153131 -18.085556 3.288283 # 4 -11343 11343 4 -12.331060 -17.263485 3.288283 # 4 -11344 11344 4 -12.331060 -18.085556 4.110353 # 4 -11345 11345 4 -13.153131 -17.263485 4.110353 # 4 -11346 11346 4 -11.508989 -18.085556 3.288283 # 4 -11347 11347 4 -10.686919 -17.263485 3.288283 # 4 -11348 11348 4 -10.686919 -18.085556 4.110353 # 4 -11349 11349 4 -11.508989 -17.263485 4.110353 # 4 -11350 11350 4 -9.864848 -18.085556 3.288283 # 4 -11351 11351 4 -9.042778 -17.263485 3.288283 # 4 -11352 11352 4 -9.042778 -18.085556 4.110353 # 4 -11353 11353 4 -9.864848 -17.263485 4.110353 # 4 -11354 11354 4 -18.907625 -16.441414 4.110353 # 4 -11355 11355 4 -18.085556 -16.441414 3.288283 # 4 -11356 11356 4 -17.263485 -16.441414 4.110353 # 4 -11357 11357 4 -16.441414 -16.441414 3.288283 # 4 -11358 11358 4 -15.619343 -16.441414 4.110353 # 4 -11359 11359 4 -14.797273 -16.441414 3.288283 # 4 -11360 11360 4 -13.975202 -16.441414 4.110353 # 4 -11361 11361 4 -13.153131 -16.441414 3.288283 # 4 -11362 11362 4 -12.331060 -16.441414 4.110353 # 4 -11363 11363 4 -11.508989 -16.441414 3.288283 # 4 -11364 11364 4 -10.686919 -16.441414 4.110353 # 4 -11365 11365 4 -9.864848 -16.441414 3.288283 # 4 -11366 11366 4 -9.042778 -16.441414 4.110353 # 4 -11367 11367 4 -19.729696 -19.729696 4.932424 # 4 -11368 11368 4 -18.907625 -18.907625 4.932424 # 4 -11369 11369 4 -18.907625 -19.729696 5.754495 # 4 -11370 11370 4 -19.729696 -18.907625 5.754495 # 4 -11371 11371 4 -18.085556 -19.729696 4.932424 # 4 -11372 11372 4 -17.263485 -18.907625 4.932424 # 4 -11373 11373 4 -17.263485 -19.729696 5.754495 # 4 -11374 11374 4 -18.085556 -18.907625 5.754495 # 4 -11375 11375 4 -16.441414 -19.729696 4.932424 # 4 -11376 11376 4 -15.619343 -18.907625 4.932424 # 4 -11377 11377 4 -15.619343 -19.729696 5.754495 # 4 -11378 11378 4 -16.441414 -18.907625 5.754495 # 4 -11379 11379 4 -14.797273 -19.729696 4.932424 # 4 -11380 11380 4 -13.975202 -18.907625 4.932424 # 4 -11381 11381 4 -13.975202 -19.729696 5.754495 # 4 -11382 11382 4 -14.797273 -18.907625 5.754495 # 4 -11383 11383 4 -13.153131 -19.729696 4.932424 # 4 -11384 11384 4 -12.331060 -18.907625 4.932424 # 4 -11385 11385 4 -12.331060 -19.729696 5.754495 # 4 -11386 11386 4 -13.153131 -18.907625 5.754495 # 4 -11387 11387 4 -11.508989 -19.729696 4.932424 # 4 -11388 11388 4 -10.686919 -18.907625 4.932424 # 4 -11389 11389 4 -10.686919 -19.729696 5.754495 # 4 -11390 11390 4 -11.508989 -18.907625 5.754495 # 4 -11391 11391 4 -9.864848 -19.729696 4.932424 # 4 -11392 11392 4 -9.042778 -18.907625 4.932424 # 4 -11393 11393 4 -9.042778 -19.729696 5.754495 # 4 -11394 11394 4 -9.864848 -18.907625 5.754495 # 4 -11395 11395 4 -19.729696 -18.085556 4.932424 # 4 -11396 11396 4 -18.907625 -17.263485 4.932424 # 4 -11397 11397 4 -18.907625 -18.085556 5.754495 # 4 -11398 11398 4 -19.729696 -17.263485 5.754495 # 4 -11399 11399 4 -18.085556 -18.085556 4.932424 # 4 -11400 11400 4 -17.263485 -17.263485 4.932424 # 4 -11401 11401 4 -17.263485 -18.085556 5.754495 # 4 -11402 11402 4 -18.085556 -17.263485 5.754495 # 4 -11403 11403 4 -16.441414 -18.085556 4.932424 # 4 -11404 11404 4 -15.619343 -17.263485 4.932424 # 4 -11405 11405 4 -15.619343 -18.085556 5.754495 # 4 -11406 11406 4 -16.441414 -17.263485 5.754495 # 4 -11407 11407 4 -14.797273 -18.085556 4.932424 # 4 -11408 11408 4 -13.975202 -17.263485 4.932424 # 4 -11409 11409 4 -13.975202 -18.085556 5.754495 # 4 -11410 11410 4 -14.797273 -17.263485 5.754495 # 4 -11411 11411 4 -13.153131 -18.085556 4.932424 # 4 -11412 11412 4 -12.331060 -17.263485 4.932424 # 4 -11413 11413 4 -12.331060 -18.085556 5.754495 # 4 -11414 11414 4 -13.153131 -17.263485 5.754495 # 4 -11415 11415 4 -11.508989 -18.085556 4.932424 # 4 -11416 11416 4 -10.686919 -17.263485 4.932424 # 4 -11417 11417 4 -10.686919 -18.085556 5.754495 # 4 -11418 11418 4 -11.508989 -17.263485 5.754495 # 4 -11419 11419 4 -9.864848 -18.085556 4.932424 # 4 -11420 11420 4 -9.042778 -17.263485 4.932424 # 4 -11421 11421 4 -9.042778 -18.085556 5.754495 # 4 -11422 11422 4 -9.864848 -17.263485 5.754495 # 4 -11423 11423 4 -19.729696 -16.441414 4.932424 # 4 -11424 11424 4 -18.907625 -16.441414 5.754495 # 4 -11425 11425 4 -18.085556 -16.441414 4.932424 # 4 -11426 11426 4 -17.263485 -16.441414 5.754495 # 4 -11427 11427 4 -16.441414 -16.441414 4.932424 # 4 -11428 11428 4 -15.619343 -16.441414 5.754495 # 4 -11429 11429 4 -14.797273 -16.441414 4.932424 # 4 -11430 11430 4 -13.975202 -16.441414 5.754495 # 4 -11431 11431 4 -13.153131 -16.441414 4.932424 # 4 -11432 11432 4 -12.331060 -16.441414 5.754495 # 4 -11433 11433 4 -11.508989 -16.441414 4.932424 # 4 -11434 11434 4 -10.686919 -16.441414 5.754495 # 4 -11435 11435 4 -9.864848 -16.441414 4.932424 # 4 -11436 11436 4 -9.042778 -16.441414 5.754495 # 4 -11437 11437 4 -19.729696 -19.729696 6.576566 # 4 -11438 11438 4 -18.907625 -18.907625 6.576566 # 4 -11439 11439 4 -18.907625 -19.729696 7.398636 # 4 -11440 11440 4 -19.729696 -18.907625 7.398636 # 4 -11441 11441 4 -18.085556 -19.729696 6.576566 # 4 -11442 11442 4 -17.263485 -18.907625 6.576566 # 4 -11443 11443 4 -17.263485 -19.729696 7.398636 # 4 -11444 11444 4 -18.085556 -18.907625 7.398636 # 4 -11445 11445 4 -16.441414 -19.729696 6.576566 # 4 -11446 11446 4 -15.619343 -18.907625 6.576566 # 4 -11447 11447 4 -15.619343 -19.729696 7.398636 # 4 -11448 11448 4 -16.441414 -18.907625 7.398636 # 4 -11449 11449 4 -14.797273 -19.729696 6.576566 # 4 -11450 11450 4 -13.975202 -18.907625 6.576566 # 4 -11451 11451 4 -13.975202 -19.729696 7.398636 # 4 -11452 11452 4 -14.797273 -18.907625 7.398636 # 4 -11453 11453 4 -13.153131 -19.729696 6.576566 # 4 -11454 11454 4 -12.331060 -18.907625 6.576566 # 4 -11455 11455 4 -12.331060 -19.729696 7.398636 # 4 -11456 11456 4 -13.153131 -18.907625 7.398636 # 4 -11457 11457 4 -11.508989 -19.729696 6.576566 # 4 -11458 11458 4 -10.686919 -18.907625 6.576566 # 4 -11459 11459 4 -10.686919 -19.729696 7.398636 # 4 -11460 11460 4 -11.508989 -18.907625 7.398636 # 4 -11461 11461 4 -9.864848 -19.729696 6.576566 # 4 -11462 11462 4 -9.042778 -18.907625 6.576566 # 4 -11463 11463 4 -9.042778 -19.729696 7.398636 # 4 -11464 11464 4 -9.864848 -18.907625 7.398636 # 4 -11465 11465 4 -19.729696 -18.085556 6.576566 # 4 -11466 11466 4 -18.907625 -17.263485 6.576566 # 4 -11467 11467 4 -18.907625 -18.085556 7.398636 # 4 -11468 11468 4 -19.729696 -17.263485 7.398636 # 4 -11469 11469 4 -18.085556 -18.085556 6.576566 # 4 -11470 11470 4 -17.263485 -17.263485 6.576566 # 4 -11471 11471 4 -17.263485 -18.085556 7.398636 # 4 -11472 11472 4 -18.085556 -17.263485 7.398636 # 4 -11473 11473 4 -16.441414 -18.085556 6.576566 # 4 -11474 11474 4 -15.619343 -17.263485 6.576566 # 4 -11475 11475 4 -15.619343 -18.085556 7.398636 # 4 -11476 11476 4 -16.441414 -17.263485 7.398636 # 4 -11477 11477 4 -14.797273 -18.085556 6.576566 # 4 -11478 11478 4 -13.975202 -17.263485 6.576566 # 4 -11479 11479 4 -13.975202 -18.085556 7.398636 # 4 -11480 11480 4 -14.797273 -17.263485 7.398636 # 4 -11481 11481 4 -13.153131 -18.085556 6.576566 # 4 -11482 11482 4 -12.331060 -17.263485 6.576566 # 4 -11483 11483 4 -12.331060 -18.085556 7.398636 # 4 -11484 11484 4 -13.153131 -17.263485 7.398636 # 4 -11485 11485 4 -11.508989 -18.085556 6.576566 # 4 -11486 11486 4 -10.686919 -17.263485 6.576566 # 4 -11487 11487 4 -10.686919 -18.085556 7.398636 # 4 -11488 11488 4 -11.508989 -17.263485 7.398636 # 4 -11489 11489 4 -9.864848 -18.085556 6.576566 # 4 -11490 11490 4 -9.042778 -17.263485 6.576566 # 4 -11491 11491 4 -9.042778 -18.085556 7.398636 # 4 -11492 11492 4 -9.864848 -17.263485 7.398636 # 4 -11493 11493 4 -19.729696 -16.441414 6.576566 # 4 -11494 11494 4 -18.907625 -16.441414 7.398636 # 4 -11495 11495 4 -18.085556 -16.441414 6.576566 # 4 -11496 11496 4 -17.263485 -16.441414 7.398636 # 4 -11497 11497 4 -16.441414 -16.441414 6.576566 # 4 -11498 11498 4 -15.619343 -16.441414 7.398636 # 4 -11499 11499 4 -14.797273 -16.441414 6.576566 # 4 -11500 11500 4 -13.975202 -16.441414 7.398636 # 4 -11501 11501 4 -13.153131 -16.441414 6.576566 # 4 -11502 11502 4 -12.331060 -16.441414 7.398636 # 4 -11503 11503 4 -11.508989 -16.441414 6.576566 # 4 -11504 11504 4 -10.686919 -16.441414 7.398636 # 4 -11505 11505 4 -9.864848 -16.441414 6.576566 # 4 -11506 11506 4 -9.042778 -16.441414 7.398636 # 4 -11507 11507 4 -20.551767 -18.907625 8.220707 # 4 -11508 11508 4 -19.729696 -19.729696 8.220707 # 4 -11509 11509 4 -18.907625 -18.907625 8.220707 # 4 -11510 11510 4 -18.085556 -19.729696 8.220707 # 4 -11511 11511 4 -17.263485 -18.907625 8.220707 # 4 -11512 11512 4 -16.441414 -19.729696 8.220707 # 4 -11513 11513 4 -15.619343 -18.907625 8.220707 # 4 -11514 11514 4 -14.797273 -19.729696 8.220707 # 4 -11515 11515 4 -13.975202 -18.907625 8.220707 # 4 -11516 11516 4 -13.153131 -19.729696 8.220707 # 4 -11517 11517 4 -12.331060 -18.907625 8.220707 # 4 -11518 11518 4 -11.508989 -19.729696 8.220707 # 4 -11519 11519 4 -10.686919 -18.907625 8.220707 # 4 -11520 11520 4 -9.864848 -19.729696 8.220707 # 4 -11521 11521 4 -9.042778 -18.907625 8.220707 # 4 -11522 11522 4 -20.551767 -17.263485 8.220707 # 4 -11523 11523 4 -19.729696 -18.085556 8.220707 # 4 -11524 11524 4 -18.907625 -17.263485 8.220707 # 4 -11525 11525 4 -18.085556 -18.085556 8.220707 # 4 -11526 11526 4 -17.263485 -17.263485 8.220707 # 4 -11527 11527 4 -16.441414 -18.085556 8.220707 # 4 -11528 11528 4 -15.619343 -17.263485 8.220707 # 4 -11529 11529 4 -14.797273 -18.085556 8.220707 # 4 -11530 11530 4 -13.975202 -17.263485 8.220707 # 4 -11531 11531 4 -13.153131 -18.085556 8.220707 # 4 -11532 11532 4 -12.331060 -17.263485 8.220707 # 4 -11533 11533 4 -11.508989 -18.085556 8.220707 # 4 -11534 11534 4 -10.686919 -17.263485 8.220707 # 4 -11535 11535 4 -9.864848 -18.085556 8.220707 # 4 -11536 11536 4 -9.042778 -17.263485 8.220707 # 4 -11537 11537 4 -19.729696 -16.441414 8.220707 # 4 -11538 11538 4 -18.085556 -16.441414 8.220707 # 4 -11539 11539 4 -16.441414 -16.441414 8.220707 # 4 -11540 11540 4 -14.797273 -16.441414 8.220707 # 4 -11541 11541 4 -13.153131 -16.441414 8.220707 # 4 -11542 11542 4 -11.508989 -16.441414 8.220707 # 4 -11543 11543 4 -9.864848 -16.441414 8.220707 # 4 -11544 11544 4 -8.220707 -18.907625 -4.110353 # 4 -11545 11545 4 -8.220707 -17.263485 -4.110353 # 4 -11546 11546 4 -8.220707 -19.729696 -3.288283 # 4 -11547 11547 4 -7.398636 -18.907625 -3.288283 # 4 -11548 11548 4 -7.398636 -19.729696 -2.466212 # 4 -11549 11549 4 -8.220707 -18.907625 -2.466212 # 4 -11550 11550 4 -6.576566 -19.729696 -3.288283 # 4 -11551 11551 4 -5.754495 -18.907625 -3.288283 # 4 -11552 11552 4 -5.754495 -19.729696 -2.466212 # 4 -11553 11553 4 -6.576566 -18.907625 -2.466212 # 4 -11554 11554 4 -4.932424 -19.729696 -3.288283 # 4 -11555 11555 4 -4.110353 -18.907625 -3.288283 # 4 -11556 11556 4 -4.110353 -19.729696 -2.466212 # 4 -11557 11557 4 -4.932424 -18.907625 -2.466212 # 4 -11558 11558 4 -2.466212 -19.729696 -2.466212 # 4 -11559 11559 4 -3.288283 -18.907625 -2.466212 # 4 -11560 11560 4 -8.220707 -18.085556 -3.288283 # 4 -11561 11561 4 -7.398636 -17.263485 -3.288283 # 4 -11562 11562 4 -7.398636 -18.085556 -2.466212 # 4 -11563 11563 4 -8.220707 -17.263485 -2.466212 # 4 -11564 11564 4 -6.576566 -18.085556 -3.288283 # 4 -11565 11565 4 -5.754495 -17.263485 -3.288283 # 4 -11566 11566 4 -5.754495 -18.085556 -2.466212 # 4 -11567 11567 4 -6.576566 -17.263485 -2.466212 # 4 -11568 11568 4 -4.932424 -18.085556 -3.288283 # 4 -11569 11569 4 -4.110353 -17.263485 -3.288283 # 4 -11570 11570 4 -4.110353 -18.085556 -2.466212 # 4 -11571 11571 4 -4.932424 -17.263485 -2.466212 # 4 -11572 11572 4 -2.466212 -18.085556 -2.466212 # 4 -11573 11573 4 -3.288283 -17.263485 -2.466212 # 4 -11574 11574 4 -8.220707 -16.441414 -3.288283 # 4 -11575 11575 4 -7.398636 -16.441414 -2.466212 # 4 -11576 11576 4 -6.576566 -16.441414 -3.288283 # 4 -11577 11577 4 -5.754495 -16.441414 -2.466212 # 4 -11578 11578 4 -4.932424 -16.441414 -3.288283 # 4 -11579 11579 4 -4.110353 -16.441414 -2.466212 # 4 -11580 11580 4 -2.466212 -16.441414 -2.466212 # 4 -11581 11581 4 -8.220707 -19.729696 -1.644141 # 4 -11582 11582 4 -7.398636 -18.907625 -1.644141 # 4 -11583 11583 4 -7.398636 -19.729696 -0.822071 # 4 -11584 11584 4 -8.220707 -18.907625 -0.822071 # 4 -11585 11585 4 -6.576566 -19.729696 -1.644141 # 4 -11586 11586 4 -5.754495 -18.907625 -1.644141 # 4 -11587 11587 4 -5.754495 -19.729696 -0.822071 # 4 -11588 11588 4 -6.576566 -18.907625 -0.822071 # 4 -11589 11589 4 -4.932424 -19.729696 -1.644141 # 4 -11590 11590 4 -4.110353 -18.907625 -1.644141 # 4 -11591 11591 4 -4.110353 -19.729696 -0.822071 # 4 -11592 11592 4 -4.932424 -18.907625 -0.822071 # 4 -11593 11593 4 -3.288283 -19.729696 -1.644141 # 4 -11594 11594 4 -2.466212 -18.907625 -1.644141 # 4 -11595 11595 4 -2.466212 -19.729696 -0.822071 # 4 -11596 11596 4 -3.288283 -18.907625 -0.822071 # 4 -11597 11597 4 -1.644141 -19.729696 -1.644141 # 4 -11598 11598 4 -0.822071 -18.907625 -1.644141 # 4 -11599 11599 4 -0.822071 -19.729696 -0.822071 # 4 -11600 11600 4 -1.644141 -18.907625 -0.822071 # 4 -11601 11601 4 0.000000 -18.907625 -0.822071 # 4 -11602 11602 4 -8.220707 -18.085556 -1.644141 # 4 -11603 11603 4 -7.398636 -17.263485 -1.644141 # 4 -11604 11604 4 -7.398636 -18.085556 -0.822071 # 4 -11605 11605 4 -8.220707 -17.263485 -0.822071 # 4 -11606 11606 4 -6.576566 -18.085556 -1.644141 # 4 -11607 11607 4 -5.754495 -17.263485 -1.644141 # 4 -11608 11608 4 -5.754495 -18.085556 -0.822071 # 4 -11609 11609 4 -6.576566 -17.263485 -0.822071 # 4 -11610 11610 4 -4.932424 -18.085556 -1.644141 # 4 -11611 11611 4 -4.110353 -17.263485 -1.644141 # 4 -11612 11612 4 -4.110353 -18.085556 -0.822071 # 4 -11613 11613 4 -4.932424 -17.263485 -0.822071 # 4 -11614 11614 4 -3.288283 -18.085556 -1.644141 # 4 -11615 11615 4 -2.466212 -17.263485 -1.644141 # 4 -11616 11616 4 -2.466212 -18.085556 -0.822071 # 4 -11617 11617 4 -3.288283 -17.263485 -0.822071 # 4 -11618 11618 4 -1.644141 -18.085556 -1.644141 # 4 -11619 11619 4 -0.822071 -17.263485 -1.644141 # 4 -11620 11620 4 -0.822071 -18.085556 -0.822071 # 4 -11621 11621 4 -1.644141 -17.263485 -0.822071 # 4 -11622 11622 4 0.000000 -17.263485 -0.822071 # 4 -11623 11623 4 -8.220707 -16.441414 -1.644141 # 4 -11624 11624 4 -7.398636 -16.441414 -0.822071 # 4 -11625 11625 4 -6.576566 -16.441414 -1.644141 # 4 -11626 11626 4 -5.754495 -16.441414 -0.822071 # 4 -11627 11627 4 -4.932424 -16.441414 -1.644141 # 4 -11628 11628 4 -4.110353 -16.441414 -0.822071 # 4 -11629 11629 4 -3.288283 -16.441414 -1.644141 # 4 -11630 11630 4 -2.466212 -16.441414 -0.822071 # 4 -11631 11631 4 -1.644141 -16.441414 -1.644141 # 4 -11632 11632 4 -0.822071 -16.441414 -0.822071 # 4 -11633 11633 4 -8.220707 -19.729696 0.000000 # 4 -11634 11634 4 -7.398636 -18.907625 0.000000 # 4 -11635 11635 4 -7.398636 -19.729696 0.822071 # 4 -11636 11636 4 -8.220707 -18.907625 0.822071 # 4 -11637 11637 4 -6.576566 -19.729696 0.000000 # 4 -11638 11638 4 -5.754495 -18.907625 0.000000 # 4 -11639 11639 4 -5.754495 -19.729696 0.822071 # 4 -11640 11640 4 -6.576566 -18.907625 0.822071 # 4 -11641 11641 4 -4.932424 -19.729696 0.000000 # 4 -11642 11642 4 -4.110353 -18.907625 0.000000 # 4 -11643 11643 4 -4.110353 -19.729696 0.822071 # 4 -11644 11644 4 -4.932424 -18.907625 0.822071 # 4 -11645 11645 4 -3.288283 -19.729696 0.000000 # 4 -11646 11646 4 -2.466212 -18.907625 0.000000 # 4 -11647 11647 4 -2.466212 -19.729696 0.822071 # 4 -11648 11648 4 -3.288283 -18.907625 0.822071 # 4 -11649 11649 4 -1.644141 -19.729696 0.000000 # 4 -11650 11650 4 -0.822071 -18.907625 0.000000 # 4 -11651 11651 4 -0.822071 -19.729696 0.822071 # 4 -11652 11652 4 -1.644141 -18.907625 0.822071 # 4 -11653 11653 4 0.000000 -19.729696 0.000000 # 4 -11654 11654 4 0.822071 -18.907625 0.000000 # 4 -11655 11655 4 0.822071 -19.729696 0.822071 # 4 -11656 11656 4 0.000000 -18.907625 0.822071 # 4 -11657 11657 4 1.644141 -18.907625 0.822071 # 4 -11658 11658 4 -8.220707 -18.085556 0.000000 # 4 -11659 11659 4 -7.398636 -17.263485 0.000000 # 4 -11660 11660 4 -7.398636 -18.085556 0.822071 # 4 -11661 11661 4 -8.220707 -17.263485 0.822071 # 4 -11662 11662 4 -6.576566 -18.085556 0.000000 # 4 -11663 11663 4 -5.754495 -17.263485 0.000000 # 4 -11664 11664 4 -5.754495 -18.085556 0.822071 # 4 -11665 11665 4 -6.576566 -17.263485 0.822071 # 4 -11666 11666 4 -4.932424 -18.085556 0.000000 # 4 -11667 11667 4 -4.110353 -17.263485 0.000000 # 4 -11668 11668 4 -4.110353 -18.085556 0.822071 # 4 -11669 11669 4 -4.932424 -17.263485 0.822071 # 4 -11670 11670 4 -3.288283 -18.085556 0.000000 # 4 -11671 11671 4 -2.466212 -17.263485 0.000000 # 4 -11672 11672 4 -2.466212 -18.085556 0.822071 # 4 -11673 11673 4 -3.288283 -17.263485 0.822071 # 4 -11674 11674 4 -1.644141 -18.085556 0.000000 # 4 -11675 11675 4 -0.822071 -17.263485 0.000000 # 4 -11676 11676 4 -0.822071 -18.085556 0.822071 # 4 -11677 11677 4 -1.644141 -17.263485 0.822071 # 4 -11678 11678 4 0.000000 -18.085556 0.000000 # 4 -11679 11679 4 0.822071 -17.263485 0.000000 # 4 -11680 11680 4 0.822071 -18.085556 0.822071 # 4 -11681 11681 4 0.000000 -17.263485 0.822071 # 4 -11682 11682 4 1.644141 -17.263485 0.822071 # 4 -11683 11683 4 -8.220707 -16.441414 0.000000 # 4 -11684 11684 4 -7.398636 -16.441414 0.822071 # 4 -11685 11685 4 -6.576566 -16.441414 0.000000 # 4 -11686 11686 4 -5.754495 -16.441414 0.822071 # 4 -11687 11687 4 -4.932424 -16.441414 0.000000 # 4 -11688 11688 4 -4.110353 -16.441414 0.822071 # 4 -11689 11689 4 -3.288283 -16.441414 0.000000 # 4 -11690 11690 4 -2.466212 -16.441414 0.822071 # 4 -11691 11691 4 -1.644141 -16.441414 0.000000 # 4 -11692 11692 4 -0.822071 -16.441414 0.822071 # 4 -11693 11693 4 0.000000 -16.441414 0.000000 # 4 -11694 11694 4 0.822071 -16.441414 0.822071 # 4 -11695 11695 4 -8.220707 -19.729696 1.644141 # 4 -11696 11696 4 -7.398636 -18.907625 1.644141 # 4 -11697 11697 4 -7.398636 -19.729696 2.466212 # 4 -11698 11698 4 -8.220707 -18.907625 2.466212 # 4 -11699 11699 4 -6.576566 -19.729696 1.644141 # 4 -11700 11700 4 -5.754495 -18.907625 1.644141 # 4 -11701 11701 4 -5.754495 -19.729696 2.466212 # 4 -11702 11702 4 -6.576566 -18.907625 2.466212 # 4 -11703 11703 4 -4.932424 -19.729696 1.644141 # 4 -11704 11704 4 -4.110353 -18.907625 1.644141 # 4 -11705 11705 4 -4.110353 -19.729696 2.466212 # 4 -11706 11706 4 -4.932424 -18.907625 2.466212 # 4 -11707 11707 4 -3.288283 -19.729696 1.644141 # 4 -11708 11708 4 -2.466212 -18.907625 1.644141 # 4 -11709 11709 4 -2.466212 -19.729696 2.466212 # 4 -11710 11710 4 -3.288283 -18.907625 2.466212 # 4 -11711 11711 4 -1.644141 -19.729696 1.644141 # 4 -11712 11712 4 -0.822071 -18.907625 1.644141 # 4 -11713 11713 4 -0.822071 -19.729696 2.466212 # 4 -11714 11714 4 -1.644141 -18.907625 2.466212 # 4 -11715 11715 4 0.000000 -19.729696 1.644141 # 4 -11716 11716 4 0.822071 -18.907625 1.644141 # 4 -11717 11717 4 0.822071 -19.729696 2.466212 # 4 -11718 11718 4 0.000000 -18.907625 2.466212 # 4 -11719 11719 4 1.644141 -19.729696 1.644141 # 4 -11720 11720 4 2.466212 -19.729696 2.466212 # 4 -11721 11721 4 1.644141 -18.907625 2.466212 # 4 -11722 11722 4 -8.220707 -18.085556 1.644141 # 4 -11723 11723 4 -7.398636 -17.263485 1.644141 # 4 -11724 11724 4 -7.398636 -18.085556 2.466212 # 4 -11725 11725 4 -8.220707 -17.263485 2.466212 # 4 -11726 11726 4 -6.576566 -18.085556 1.644141 # 4 -11727 11727 4 -5.754495 -17.263485 1.644141 # 4 -11728 11728 4 -5.754495 -18.085556 2.466212 # 4 -11729 11729 4 -6.576566 -17.263485 2.466212 # 4 -11730 11730 4 -4.932424 -18.085556 1.644141 # 4 -11731 11731 4 -4.110353 -17.263485 1.644141 # 4 -11732 11732 4 -4.110353 -18.085556 2.466212 # 4 -11733 11733 4 -4.932424 -17.263485 2.466212 # 4 -11734 11734 4 -3.288283 -18.085556 1.644141 # 4 -11735 11735 4 -2.466212 -17.263485 1.644141 # 4 -11736 11736 4 -2.466212 -18.085556 2.466212 # 4 -11737 11737 4 -3.288283 -17.263485 2.466212 # 4 -11738 11738 4 -1.644141 -18.085556 1.644141 # 4 -11739 11739 4 -0.822071 -17.263485 1.644141 # 4 -11740 11740 4 -0.822071 -18.085556 2.466212 # 4 -11741 11741 4 -1.644141 -17.263485 2.466212 # 4 -11742 11742 4 0.000000 -18.085556 1.644141 # 4 -11743 11743 4 0.822071 -17.263485 1.644141 # 4 -11744 11744 4 0.822071 -18.085556 2.466212 # 4 -11745 11745 4 0.000000 -17.263485 2.466212 # 4 -11746 11746 4 1.644141 -18.085556 1.644141 # 4 -11747 11747 4 2.466212 -18.085556 2.466212 # 4 -11748 11748 4 1.644141 -17.263485 2.466212 # 4 -11749 11749 4 -8.220707 -16.441414 1.644141 # 4 -11750 11750 4 -7.398636 -16.441414 2.466212 # 4 -11751 11751 4 -6.576566 -16.441414 1.644141 # 4 -11752 11752 4 -5.754495 -16.441414 2.466212 # 4 -11753 11753 4 -4.932424 -16.441414 1.644141 # 4 -11754 11754 4 -4.110353 -16.441414 2.466212 # 4 -11755 11755 4 -3.288283 -16.441414 1.644141 # 4 -11756 11756 4 -2.466212 -16.441414 2.466212 # 4 -11757 11757 4 -1.644141 -16.441414 1.644141 # 4 -11758 11758 4 -0.822071 -16.441414 2.466212 # 4 -11759 11759 4 0.000000 -16.441414 1.644141 # 4 -11760 11760 4 0.822071 -16.441414 2.466212 # 4 -11761 11761 4 1.644141 -16.441414 1.644141 # 4 -11762 11762 4 2.466212 -16.441414 2.466212 # 4 -11763 11763 4 -8.220707 -19.729696 3.288283 # 4 -11764 11764 4 -7.398636 -18.907625 3.288283 # 4 -11765 11765 4 -7.398636 -19.729696 4.110353 # 4 -11766 11766 4 -8.220707 -18.907625 4.110353 # 4 -11767 11767 4 -6.576566 -19.729696 3.288283 # 4 -11768 11768 4 -5.754495 -18.907625 3.288283 # 4 -11769 11769 4 -5.754495 -19.729696 4.110353 # 4 -11770 11770 4 -6.576566 -18.907625 4.110353 # 4 -11771 11771 4 -4.932424 -19.729696 3.288283 # 4 -11772 11772 4 -4.110353 -18.907625 3.288283 # 4 -11773 11773 4 -4.110353 -19.729696 4.110353 # 4 -11774 11774 4 -4.932424 -18.907625 4.110353 # 4 -11775 11775 4 -3.288283 -19.729696 3.288283 # 4 -11776 11776 4 -2.466212 -18.907625 3.288283 # 4 -11777 11777 4 -2.466212 -19.729696 4.110353 # 4 -11778 11778 4 -3.288283 -18.907625 4.110353 # 4 -11779 11779 4 -1.644141 -19.729696 3.288283 # 4 -11780 11780 4 -0.822071 -18.907625 3.288283 # 4 -11781 11781 4 -0.822071 -19.729696 4.110353 # 4 -11782 11782 4 -1.644141 -18.907625 4.110353 # 4 -11783 11783 4 0.000000 -19.729696 3.288283 # 4 -11784 11784 4 0.822071 -18.907625 3.288283 # 4 -11785 11785 4 0.822071 -19.729696 4.110353 # 4 -11786 11786 4 0.000000 -18.907625 4.110353 # 4 -11787 11787 4 1.644141 -19.729696 3.288283 # 4 -11788 11788 4 2.466212 -18.907625 3.288283 # 4 -11789 11789 4 2.466212 -19.729696 4.110353 # 4 -11790 11790 4 1.644141 -18.907625 4.110353 # 4 -11791 11791 4 3.288283 -18.907625 4.110353 # 4 -11792 11792 4 -8.220707 -18.085556 3.288283 # 4 -11793 11793 4 -7.398636 -17.263485 3.288283 # 4 -11794 11794 4 -7.398636 -18.085556 4.110353 # 4 -11795 11795 4 -8.220707 -17.263485 4.110353 # 4 -11796 11796 4 -6.576566 -18.085556 3.288283 # 4 -11797 11797 4 -5.754495 -17.263485 3.288283 # 4 -11798 11798 4 -5.754495 -18.085556 4.110353 # 4 -11799 11799 4 -6.576566 -17.263485 4.110353 # 4 -11800 11800 4 -4.932424 -18.085556 3.288283 # 4 -11801 11801 4 -4.110353 -17.263485 3.288283 # 4 -11802 11802 4 -4.110353 -18.085556 4.110353 # 4 -11803 11803 4 -4.932424 -17.263485 4.110353 # 4 -11804 11804 4 -3.288283 -18.085556 3.288283 # 4 -11805 11805 4 -2.466212 -17.263485 3.288283 # 4 -11806 11806 4 -2.466212 -18.085556 4.110353 # 4 -11807 11807 4 -3.288283 -17.263485 4.110353 # 4 -11808 11808 4 -1.644141 -18.085556 3.288283 # 4 -11809 11809 4 -0.822071 -17.263485 3.288283 # 4 -11810 11810 4 -0.822071 -18.085556 4.110353 # 4 -11811 11811 4 -1.644141 -17.263485 4.110353 # 4 -11812 11812 4 0.000000 -18.085556 3.288283 # 4 -11813 11813 4 0.822071 -17.263485 3.288283 # 4 -11814 11814 4 0.822071 -18.085556 4.110353 # 4 -11815 11815 4 0.000000 -17.263485 4.110353 # 4 -11816 11816 4 1.644141 -18.085556 3.288283 # 4 -11817 11817 4 2.466212 -17.263485 3.288283 # 4 -11818 11818 4 2.466212 -18.085556 4.110353 # 4 -11819 11819 4 1.644141 -17.263485 4.110353 # 4 -11820 11820 4 3.288283 -17.263485 4.110353 # 4 -11821 11821 4 -8.220707 -16.441414 3.288283 # 4 -11822 11822 4 -7.398636 -16.441414 4.110353 # 4 -11823 11823 4 -6.576566 -16.441414 3.288283 # 4 -11824 11824 4 -5.754495 -16.441414 4.110353 # 4 -11825 11825 4 -4.932424 -16.441414 3.288283 # 4 -11826 11826 4 -4.110353 -16.441414 4.110353 # 4 -11827 11827 4 -3.288283 -16.441414 3.288283 # 4 -11828 11828 4 -2.466212 -16.441414 4.110353 # 4 -11829 11829 4 -1.644141 -16.441414 3.288283 # 4 -11830 11830 4 -0.822071 -16.441414 4.110353 # 4 -11831 11831 4 0.000000 -16.441414 3.288283 # 4 -11832 11832 4 0.822071 -16.441414 4.110353 # 4 -11833 11833 4 1.644141 -16.441414 3.288283 # 4 -11834 11834 4 2.466212 -16.441414 4.110353 # 4 -11835 11835 4 -8.220707 -19.729696 4.932424 # 4 -11836 11836 4 -7.398636 -18.907625 4.932424 # 4 -11837 11837 4 -7.398636 -19.729696 5.754495 # 4 -11838 11838 4 -8.220707 -18.907625 5.754495 # 4 -11839 11839 4 -6.576566 -19.729696 4.932424 # 4 -11840 11840 4 -5.754495 -18.907625 4.932424 # 4 -11841 11841 4 -5.754495 -19.729696 5.754495 # 4 -11842 11842 4 -6.576566 -18.907625 5.754495 # 4 -11843 11843 4 -4.932424 -19.729696 4.932424 # 4 -11844 11844 4 -4.110353 -18.907625 4.932424 # 4 -11845 11845 4 -4.110353 -19.729696 5.754495 # 4 -11846 11846 4 -4.932424 -18.907625 5.754495 # 4 -11847 11847 4 -3.288283 -19.729696 4.932424 # 4 -11848 11848 4 -2.466212 -18.907625 4.932424 # 4 -11849 11849 4 -2.466212 -19.729696 5.754495 # 4 -11850 11850 4 -3.288283 -18.907625 5.754495 # 4 -11851 11851 4 -1.644141 -19.729696 4.932424 # 4 -11852 11852 4 -0.822071 -18.907625 4.932424 # 4 -11853 11853 4 -0.822071 -19.729696 5.754495 # 4 -11854 11854 4 -1.644141 -18.907625 5.754495 # 4 -11855 11855 4 0.000000 -19.729696 4.932424 # 4 -11856 11856 4 0.822071 -18.907625 4.932424 # 4 -11857 11857 4 0.822071 -19.729696 5.754495 # 4 -11858 11858 4 0.000000 -18.907625 5.754495 # 4 -11859 11859 4 1.644141 -19.729696 4.932424 # 4 -11860 11860 4 2.466212 -18.907625 4.932424 # 4 -11861 11861 4 2.466212 -19.729696 5.754495 # 4 -11862 11862 4 1.644141 -18.907625 5.754495 # 4 -11863 11863 4 3.288283 -19.729696 4.932424 # 4 -11864 11864 4 3.288283 -18.907625 5.754495 # 4 -11865 11865 4 -8.220707 -18.085556 4.932424 # 4 -11866 11866 4 -7.398636 -17.263485 4.932424 # 4 -11867 11867 4 -7.398636 -18.085556 5.754495 # 4 -11868 11868 4 -8.220707 -17.263485 5.754495 # 4 -11869 11869 4 -6.576566 -18.085556 4.932424 # 4 -11870 11870 4 -5.754495 -17.263485 4.932424 # 4 -11871 11871 4 -5.754495 -18.085556 5.754495 # 4 -11872 11872 4 -6.576566 -17.263485 5.754495 # 4 -11873 11873 4 -4.932424 -18.085556 4.932424 # 4 -11874 11874 4 -4.110353 -17.263485 4.932424 # 4 -11875 11875 4 -4.110353 -18.085556 5.754495 # 4 -11876 11876 4 -4.932424 -17.263485 5.754495 # 4 -11877 11877 4 -3.288283 -18.085556 4.932424 # 4 -11878 11878 4 -2.466212 -17.263485 4.932424 # 4 -11879 11879 4 -2.466212 -18.085556 5.754495 # 4 -11880 11880 4 -3.288283 -17.263485 5.754495 # 4 -11881 11881 4 -1.644141 -18.085556 4.932424 # 4 -11882 11882 4 -0.822071 -17.263485 4.932424 # 4 -11883 11883 4 -0.822071 -18.085556 5.754495 # 4 -11884 11884 4 -1.644141 -17.263485 5.754495 # 4 -11885 11885 4 0.000000 -18.085556 4.932424 # 4 -11886 11886 4 0.822071 -17.263485 4.932424 # 4 -11887 11887 4 0.822071 -18.085556 5.754495 # 4 -11888 11888 4 0.000000 -17.263485 5.754495 # 4 -11889 11889 4 1.644141 -18.085556 4.932424 # 4 -11890 11890 4 2.466212 -17.263485 4.932424 # 4 -11891 11891 4 2.466212 -18.085556 5.754495 # 4 -11892 11892 4 1.644141 -17.263485 5.754495 # 4 -11893 11893 4 3.288283 -18.085556 4.932424 # 4 -11894 11894 4 3.288283 -17.263485 5.754495 # 4 -11895 11895 4 -8.220707 -16.441414 4.932424 # 4 -11896 11896 4 -7.398636 -16.441414 5.754495 # 4 -11897 11897 4 -6.576566 -16.441414 4.932424 # 4 -11898 11898 4 -5.754495 -16.441414 5.754495 # 4 -11899 11899 4 -4.932424 -16.441414 4.932424 # 4 -11900 11900 4 -4.110353 -16.441414 5.754495 # 4 -11901 11901 4 -3.288283 -16.441414 4.932424 # 4 -11902 11902 4 -2.466212 -16.441414 5.754495 # 4 -11903 11903 4 -1.644141 -16.441414 4.932424 # 4 -11904 11904 4 -0.822071 -16.441414 5.754495 # 4 -11905 11905 4 0.000000 -16.441414 4.932424 # 4 -11906 11906 4 0.822071 -16.441414 5.754495 # 4 -11907 11907 4 1.644141 -16.441414 4.932424 # 4 -11908 11908 4 2.466212 -16.441414 5.754495 # 4 -11909 11909 4 3.288283 -16.441414 4.932424 # 4 -11910 11910 4 -8.220707 -19.729696 6.576566 # 4 -11911 11911 4 -7.398636 -18.907625 6.576566 # 4 -11912 11912 4 -7.398636 -19.729696 7.398636 # 4 -11913 11913 4 -8.220707 -18.907625 7.398636 # 4 -11914 11914 4 -6.576566 -19.729696 6.576566 # 4 -11915 11915 4 -5.754495 -18.907625 6.576566 # 4 -11916 11916 4 -5.754495 -19.729696 7.398636 # 4 -11917 11917 4 -6.576566 -18.907625 7.398636 # 4 -11918 11918 4 -4.932424 -19.729696 6.576566 # 4 -11919 11919 4 -4.110353 -18.907625 6.576566 # 4 -11920 11920 4 -4.110353 -19.729696 7.398636 # 4 -11921 11921 4 -4.932424 -18.907625 7.398636 # 4 -11922 11922 4 -3.288283 -19.729696 6.576566 # 4 -11923 11923 4 -2.466212 -18.907625 6.576566 # 4 -11924 11924 4 -2.466212 -19.729696 7.398636 # 4 -11925 11925 4 -3.288283 -18.907625 7.398636 # 4 -11926 11926 4 -1.644141 -19.729696 6.576566 # 4 -11927 11927 4 -0.822071 -18.907625 6.576566 # 4 -11928 11928 4 -0.822071 -19.729696 7.398636 # 4 -11929 11929 4 -1.644141 -18.907625 7.398636 # 4 -11930 11930 4 0.000000 -19.729696 6.576566 # 4 -11931 11931 4 0.822071 -18.907625 6.576566 # 4 -11932 11932 4 0.822071 -19.729696 7.398636 # 4 -11933 11933 4 0.000000 -18.907625 7.398636 # 4 -11934 11934 4 1.644141 -19.729696 6.576566 # 4 -11935 11935 4 2.466212 -18.907625 6.576566 # 4 -11936 11936 4 2.466212 -19.729696 7.398636 # 4 -11937 11937 4 1.644141 -18.907625 7.398636 # 4 -11938 11938 4 3.288283 -19.729696 6.576566 # 4 -11939 11939 4 3.288283 -18.907625 7.398636 # 4 -11940 11940 4 -8.220707 -18.085556 6.576566 # 4 -11941 11941 4 -7.398636 -17.263485 6.576566 # 4 -11942 11942 4 -7.398636 -18.085556 7.398636 # 4 -11943 11943 4 -8.220707 -17.263485 7.398636 # 4 -11944 11944 4 -6.576566 -18.085556 6.576566 # 4 -11945 11945 4 -5.754495 -17.263485 6.576566 # 4 -11946 11946 4 -5.754495 -18.085556 7.398636 # 4 -11947 11947 4 -6.576566 -17.263485 7.398636 # 4 -11948 11948 4 -4.932424 -18.085556 6.576566 # 4 -11949 11949 4 -4.110353 -17.263485 6.576566 # 4 -11950 11950 4 -4.110353 -18.085556 7.398636 # 4 -11951 11951 4 -4.932424 -17.263485 7.398636 # 4 -11952 11952 4 -3.288283 -18.085556 6.576566 # 4 -11953 11953 4 -2.466212 -17.263485 6.576566 # 4 -11954 11954 4 -2.466212 -18.085556 7.398636 # 4 -11955 11955 4 -3.288283 -17.263485 7.398636 # 4 -11956 11956 4 -1.644141 -18.085556 6.576566 # 4 -11957 11957 4 -0.822071 -17.263485 6.576566 # 4 -11958 11958 4 -0.822071 -18.085556 7.398636 # 4 -11959 11959 4 -1.644141 -17.263485 7.398636 # 4 -11960 11960 4 0.000000 -18.085556 6.576566 # 4 -11961 11961 4 0.822071 -17.263485 6.576566 # 4 -11962 11962 4 0.822071 -18.085556 7.398636 # 4 -11963 11963 4 0.000000 -17.263485 7.398636 # 4 -11964 11964 4 1.644141 -18.085556 6.576566 # 4 -11965 11965 4 2.466212 -17.263485 6.576566 # 4 -11966 11966 4 2.466212 -18.085556 7.398636 # 4 -11967 11967 4 1.644141 -17.263485 7.398636 # 4 -11968 11968 4 3.288283 -18.085556 6.576566 # 4 -11969 11969 4 3.288283 -17.263485 7.398636 # 4 -11970 11970 4 -8.220707 -16.441414 6.576566 # 4 -11971 11971 4 -7.398636 -16.441414 7.398636 # 4 -11972 11972 4 -6.576566 -16.441414 6.576566 # 4 -11973 11973 4 -5.754495 -16.441414 7.398636 # 4 -11974 11974 4 -4.932424 -16.441414 6.576566 # 4 -11975 11975 4 -4.110353 -16.441414 7.398636 # 4 -11976 11976 4 -3.288283 -16.441414 6.576566 # 4 -11977 11977 4 -2.466212 -16.441414 7.398636 # 4 -11978 11978 4 -1.644141 -16.441414 6.576566 # 4 -11979 11979 4 -0.822071 -16.441414 7.398636 # 4 -11980 11980 4 0.000000 -16.441414 6.576566 # 4 -11981 11981 4 0.822071 -16.441414 7.398636 # 4 -11982 11982 4 1.644141 -16.441414 6.576566 # 4 -11983 11983 4 2.466212 -16.441414 7.398636 # 4 -11984 11984 4 3.288283 -16.441414 6.576566 # 4 -11985 11985 4 -8.220707 -19.729696 8.220707 # 4 -11986 11986 4 -7.398636 -18.907625 8.220707 # 4 -11987 11987 4 -6.576566 -19.729696 8.220707 # 4 -11988 11988 4 -5.754495 -18.907625 8.220707 # 4 -11989 11989 4 -4.932424 -19.729696 8.220707 # 4 -11990 11990 4 -4.110353 -18.907625 8.220707 # 4 -11991 11991 4 -3.288283 -19.729696 8.220707 # 4 -11992 11992 4 -2.466212 -18.907625 8.220707 # 4 -11993 11993 4 -1.644141 -19.729696 8.220707 # 4 -11994 11994 4 -0.822071 -18.907625 8.220707 # 4 -11995 11995 4 0.000000 -19.729696 8.220707 # 4 -11996 11996 4 0.822071 -18.907625 8.220707 # 4 -11997 11997 4 1.644141 -19.729696 8.220707 # 4 -11998 11998 4 2.466212 -18.907625 8.220707 # 4 -11999 11999 4 3.288283 -19.729696 8.220707 # 4 -12000 12000 4 4.110353 -18.907625 8.220707 # 4 -12001 12001 4 -8.220707 -18.085556 8.220707 # 4 -12002 12002 4 -7.398636 -17.263485 8.220707 # 4 -12003 12003 4 -6.576566 -18.085556 8.220707 # 4 -12004 12004 4 -5.754495 -17.263485 8.220707 # 4 -12005 12005 4 -4.932424 -18.085556 8.220707 # 4 -12006 12006 4 -4.110353 -17.263485 8.220707 # 4 -12007 12007 4 -3.288283 -18.085556 8.220707 # 4 -12008 12008 4 -2.466212 -17.263485 8.220707 # 4 -12009 12009 4 -1.644141 -18.085556 8.220707 # 4 -12010 12010 4 -0.822071 -17.263485 8.220707 # 4 -12011 12011 4 0.000000 -18.085556 8.220707 # 4 -12012 12012 4 0.822071 -17.263485 8.220707 # 4 -12013 12013 4 1.644141 -18.085556 8.220707 # 4 -12014 12014 4 2.466212 -17.263485 8.220707 # 4 -12015 12015 4 3.288283 -18.085556 8.220707 # 4 -12016 12016 4 4.110353 -17.263485 8.220707 # 4 -12017 12017 4 -8.220707 -16.441414 8.220707 # 4 -12018 12018 4 -6.576566 -16.441414 8.220707 # 4 -12019 12019 4 -4.932424 -16.441414 8.220707 # 4 -12020 12020 4 -3.288283 -16.441414 8.220707 # 4 -12021 12021 4 -1.644141 -16.441414 8.220707 # 4 -12022 12022 4 0.000000 -16.441414 8.220707 # 4 -12023 12023 4 1.644141 -16.441414 8.220707 # 4 -12024 12024 4 3.288283 -16.441414 8.220707 # 4 -12025 12025 3 -23.840050 -19.729696 9.042778 # 3 -12026 12026 3 -24.662121 -18.907625 9.042778 # 3 -12027 12027 3 -22.195910 -19.729696 9.042778 # 3 -12028 12028 3 -23.017979 -18.907625 9.042778 # 3 -12029 12029 3 -20.551767 -19.729696 9.042778 # 3 -12030 12030 3 -21.373838 -18.907625 9.042778 # 3 -12031 12031 3 -23.840050 -18.085556 9.042778 # 3 -12032 12032 3 -24.662121 -17.263485 9.042778 # 3 -12033 12033 3 -22.195910 -18.085556 9.042778 # 3 -12034 12034 3 -23.017979 -17.263485 9.042778 # 3 -12035 12035 3 -20.551767 -18.085556 9.042778 # 3 -12036 12036 3 -21.373838 -17.263485 9.042778 # 3 -12037 12037 3 -23.840050 -16.441414 9.042778 # 3 -12038 12038 3 -22.195910 -16.441414 9.042778 # 3 -12039 12039 3 -20.551767 -16.441414 9.042778 # 3 -12040 12040 3 -24.662121 -19.729696 9.864848 # 3 -12041 12041 3 -23.840050 -18.907625 9.864848 # 3 -12042 12042 3 -23.840050 -19.729696 10.686919 # 3 -12043 12043 3 -24.662121 -18.907625 10.686919 # 3 -12044 12044 3 -23.017979 -19.729696 9.864848 # 3 -12045 12045 3 -22.195910 -18.907625 9.864848 # 3 -12046 12046 3 -22.195910 -19.729696 10.686919 # 3 -12047 12047 3 -23.017979 -18.907625 10.686919 # 3 -12048 12048 3 -21.373838 -19.729696 9.864848 # 3 -12049 12049 3 -20.551767 -18.907625 9.864848 # 3 -12050 12050 3 -20.551767 -19.729696 10.686919 # 3 -12051 12051 3 -21.373838 -18.907625 10.686919 # 3 -12052 12052 3 -24.662121 -18.085556 9.864848 # 3 -12053 12053 3 -23.840050 -17.263485 9.864848 # 3 -12054 12054 3 -23.840050 -18.085556 10.686919 # 3 -12055 12055 3 -24.662121 -17.263485 10.686919 # 3 -12056 12056 3 -23.017979 -18.085556 9.864848 # 3 -12057 12057 3 -22.195910 -17.263485 9.864848 # 3 -12058 12058 3 -22.195910 -18.085556 10.686919 # 3 -12059 12059 3 -23.017979 -17.263485 10.686919 # 3 -12060 12060 3 -21.373838 -18.085556 9.864848 # 3 -12061 12061 3 -20.551767 -17.263485 9.864848 # 3 -12062 12062 3 -20.551767 -18.085556 10.686919 # 3 -12063 12063 3 -21.373838 -17.263485 10.686919 # 3 -12064 12064 3 -24.662121 -16.441414 9.864848 # 3 -12065 12065 3 -23.840050 -16.441414 10.686919 # 3 -12066 12066 3 -23.017979 -16.441414 9.864848 # 3 -12067 12067 3 -22.195910 -16.441414 10.686919 # 3 -12068 12068 3 -21.373838 -16.441414 9.864848 # 3 -12069 12069 3 -20.551767 -16.441414 10.686919 # 3 -12070 12070 3 -24.662121 -19.729696 11.508989 # 3 -12071 12071 3 -23.840050 -18.907625 11.508989 # 3 -12072 12072 3 -23.840050 -19.729696 12.331060 # 3 -12073 12073 3 -24.662121 -18.907625 12.331060 # 3 -12074 12074 3 -23.017979 -19.729696 11.508989 # 3 -12075 12075 3 -22.195910 -18.907625 11.508989 # 3 -12076 12076 3 -22.195910 -19.729696 12.331060 # 3 -12077 12077 3 -23.017979 -18.907625 12.331060 # 3 -12078 12078 3 -21.373838 -19.729696 11.508989 # 3 -12079 12079 3 -20.551767 -18.907625 11.508989 # 3 -12080 12080 3 -20.551767 -19.729696 12.331060 # 3 -12081 12081 3 -21.373838 -18.907625 12.331060 # 3 -12082 12082 3 -24.662121 -18.085556 11.508989 # 3 -12083 12083 3 -23.840050 -17.263485 11.508989 # 3 -12084 12084 3 -23.840050 -18.085556 12.331060 # 3 -12085 12085 3 -24.662121 -17.263485 12.331060 # 3 -12086 12086 3 -23.017979 -18.085556 11.508989 # 3 -12087 12087 3 -22.195910 -17.263485 11.508989 # 3 -12088 12088 3 -22.195910 -18.085556 12.331060 # 3 -12089 12089 3 -23.017979 -17.263485 12.331060 # 3 -12090 12090 3 -21.373838 -18.085556 11.508989 # 3 -12091 12091 3 -20.551767 -17.263485 11.508989 # 3 -12092 12092 3 -20.551767 -18.085556 12.331060 # 3 -12093 12093 3 -21.373838 -17.263485 12.331060 # 3 -12094 12094 3 -24.662121 -16.441414 11.508989 # 3 -12095 12095 3 -23.840050 -16.441414 12.331060 # 3 -12096 12096 3 -23.017979 -16.441414 11.508989 # 3 -12097 12097 3 -22.195910 -16.441414 12.331060 # 3 -12098 12098 3 -21.373838 -16.441414 11.508989 # 3 -12099 12099 3 -20.551767 -16.441414 12.331060 # 3 -12100 12100 3 -24.662121 -19.729696 13.153131 # 3 -12101 12101 3 -23.840050 -18.907625 13.153131 # 3 -12102 12102 3 -23.840050 -19.729696 13.975202 # 3 -12103 12103 3 -24.662121 -18.907625 13.975202 # 3 -12104 12104 3 -23.017979 -19.729696 13.153131 # 3 -12105 12105 3 -22.195910 -18.907625 13.153131 # 3 -12106 12106 3 -22.195910 -19.729696 13.975202 # 3 -12107 12107 3 -23.017979 -18.907625 13.975202 # 3 -12108 12108 3 -21.373838 -19.729696 13.153131 # 3 -12109 12109 3 -20.551767 -18.907625 13.153131 # 3 -12110 12110 3 -20.551767 -19.729696 13.975202 # 3 -12111 12111 3 -21.373838 -18.907625 13.975202 # 3 -12112 12112 3 -19.729696 -19.729696 13.153131 # 3 -12113 12113 3 -19.729696 -18.907625 13.975202 # 3 -12114 12114 3 -24.662121 -18.085556 13.153131 # 3 -12115 12115 3 -23.840050 -17.263485 13.153131 # 3 -12116 12116 3 -23.840050 -18.085556 13.975202 # 3 -12117 12117 3 -24.662121 -17.263485 13.975202 # 3 -12118 12118 3 -23.017979 -18.085556 13.153131 # 3 -12119 12119 3 -22.195910 -17.263485 13.153131 # 3 -12120 12120 3 -22.195910 -18.085556 13.975202 # 3 -12121 12121 3 -23.017979 -17.263485 13.975202 # 3 -12122 12122 3 -21.373838 -18.085556 13.153131 # 3 -12123 12123 3 -20.551767 -17.263485 13.153131 # 3 -12124 12124 3 -20.551767 -18.085556 13.975202 # 3 -12125 12125 3 -21.373838 -17.263485 13.975202 # 3 -12126 12126 3 -19.729696 -18.085556 13.153131 # 3 -12127 12127 3 -19.729696 -17.263485 13.975202 # 3 -12128 12128 3 -24.662121 -16.441414 13.153131 # 3 -12129 12129 3 -23.840050 -16.441414 13.975202 # 3 -12130 12130 3 -23.017979 -16.441414 13.153131 # 3 -12131 12131 3 -22.195910 -16.441414 13.975202 # 3 -12132 12132 3 -21.373838 -16.441414 13.153131 # 3 -12133 12133 3 -20.551767 -16.441414 13.975202 # 3 -12134 12134 3 -19.729696 -16.441414 13.153131 # 3 -12135 12135 3 -24.662121 -19.729696 14.797273 # 3 -12136 12136 3 -23.840050 -18.907625 14.797273 # 3 -12137 12137 3 -23.840050 -19.729696 15.619343 # 3 -12138 12138 3 -24.662121 -18.907625 15.619343 # 3 -12139 12139 3 -23.017979 -19.729696 14.797273 # 3 -12140 12140 3 -22.195910 -18.907625 14.797273 # 3 -12141 12141 3 -22.195910 -19.729696 15.619343 # 3 -12142 12142 3 -23.017979 -18.907625 15.619343 # 3 -12143 12143 3 -21.373838 -19.729696 14.797273 # 3 -12144 12144 3 -20.551767 -18.907625 14.797273 # 3 -12145 12145 3 -20.551767 -19.729696 15.619343 # 3 -12146 12146 3 -21.373838 -18.907625 15.619343 # 3 -12147 12147 3 -19.729696 -19.729696 14.797273 # 3 -12148 12148 3 -18.907625 -18.907625 14.797273 # 3 -12149 12149 3 -18.907625 -19.729696 15.619343 # 3 -12150 12150 3 -19.729696 -18.907625 15.619343 # 3 -12151 12151 3 -24.662121 -18.085556 14.797273 # 3 -12152 12152 3 -23.840050 -17.263485 14.797273 # 3 -12153 12153 3 -23.840050 -18.085556 15.619343 # 3 -12154 12154 3 -24.662121 -17.263485 15.619343 # 3 -12155 12155 3 -23.017979 -18.085556 14.797273 # 3 -12156 12156 3 -22.195910 -17.263485 14.797273 # 3 -12157 12157 3 -22.195910 -18.085556 15.619343 # 3 -12158 12158 3 -23.017979 -17.263485 15.619343 # 3 -12159 12159 3 -21.373838 -18.085556 14.797273 # 3 -12160 12160 3 -20.551767 -17.263485 14.797273 # 3 -12161 12161 3 -20.551767 -18.085556 15.619343 # 3 -12162 12162 3 -21.373838 -17.263485 15.619343 # 3 -12163 12163 3 -19.729696 -18.085556 14.797273 # 3 -12164 12164 3 -18.907625 -17.263485 14.797273 # 3 -12165 12165 3 -18.907625 -18.085556 15.619343 # 3 -12166 12166 3 -19.729696 -17.263485 15.619343 # 3 -12167 12167 3 -24.662121 -16.441414 14.797273 # 3 -12168 12168 3 -23.840050 -16.441414 15.619343 # 3 -12169 12169 3 -23.017979 -16.441414 14.797273 # 3 -12170 12170 3 -22.195910 -16.441414 15.619343 # 3 -12171 12171 3 -21.373838 -16.441414 14.797273 # 3 -12172 12172 3 -20.551767 -16.441414 15.619343 # 3 -12173 12173 3 -19.729696 -16.441414 14.797273 # 3 -12174 12174 3 -18.907625 -16.441414 15.619343 # 3 -12175 12175 3 -24.662121 -19.729696 16.441414 # 3 -12176 12176 3 -23.840050 -18.907625 16.441414 # 3 -12177 12177 3 -23.840050 -19.729696 17.263485 # 3 -12178 12178 3 -24.662121 -18.907625 17.263485 # 3 -12179 12179 3 -23.017979 -19.729696 16.441414 # 3 -12180 12180 3 -22.195910 -18.907625 16.441414 # 3 -12181 12181 3 -22.195910 -19.729696 17.263485 # 3 -12182 12182 3 -23.017979 -18.907625 17.263485 # 3 -12183 12183 3 -21.373838 -19.729696 16.441414 # 3 -12184 12184 3 -20.551767 -18.907625 16.441414 # 3 -12185 12185 3 -20.551767 -19.729696 17.263485 # 3 -12186 12186 3 -21.373838 -18.907625 17.263485 # 3 -12187 12187 3 -19.729696 -19.729696 16.441414 # 3 -12188 12188 3 -18.907625 -18.907625 16.441414 # 3 -12189 12189 3 -18.907625 -19.729696 17.263485 # 3 -12190 12190 3 -19.729696 -18.907625 17.263485 # 3 -12191 12191 3 -18.085556 -19.729696 16.441414 # 3 -12192 12192 3 -17.263485 -19.729696 17.263485 # 3 -12193 12193 3 -18.085556 -18.907625 17.263485 # 3 -12194 12194 3 -24.662121 -18.085556 16.441414 # 3 -12195 12195 3 -23.840050 -17.263485 16.441414 # 3 -12196 12196 3 -23.840050 -18.085556 17.263485 # 3 -12197 12197 3 -24.662121 -17.263485 17.263485 # 3 -12198 12198 3 -23.017979 -18.085556 16.441414 # 3 -12199 12199 3 -22.195910 -17.263485 16.441414 # 3 -12200 12200 3 -22.195910 -18.085556 17.263485 # 3 -12201 12201 3 -23.017979 -17.263485 17.263485 # 3 -12202 12202 3 -21.373838 -18.085556 16.441414 # 3 -12203 12203 3 -20.551767 -17.263485 16.441414 # 3 -12204 12204 3 -20.551767 -18.085556 17.263485 # 3 -12205 12205 3 -21.373838 -17.263485 17.263485 # 3 -12206 12206 3 -19.729696 -18.085556 16.441414 # 3 -12207 12207 3 -18.907625 -17.263485 16.441414 # 3 -12208 12208 3 -18.907625 -18.085556 17.263485 # 3 -12209 12209 3 -19.729696 -17.263485 17.263485 # 3 -12210 12210 3 -18.085556 -18.085556 16.441414 # 3 -12211 12211 3 -17.263485 -18.085556 17.263485 # 3 -12212 12212 3 -18.085556 -17.263485 17.263485 # 3 -12213 12213 3 -24.662121 -16.441414 16.441414 # 3 -12214 12214 3 -23.840050 -16.441414 17.263485 # 3 -12215 12215 3 -23.017979 -16.441414 16.441414 # 3 -12216 12216 3 -22.195910 -16.441414 17.263485 # 3 -12217 12217 3 -21.373838 -16.441414 16.441414 # 3 -12218 12218 3 -20.551767 -16.441414 17.263485 # 3 -12219 12219 3 -19.729696 -16.441414 16.441414 # 3 -12220 12220 3 -18.907625 -16.441414 17.263485 # 3 -12221 12221 3 -18.085556 -16.441414 16.441414 # 3 -12222 12222 3 -17.263485 -16.441414 17.263485 # 3 -12223 12223 3 -24.662121 -19.729696 18.085556 # 3 -12224 12224 3 -23.840050 -18.907625 18.085556 # 3 -12225 12225 3 -23.840050 -19.729696 18.907625 # 3 -12226 12226 3 -24.662121 -18.907625 18.907625 # 3 -12227 12227 3 -23.017979 -19.729696 18.085556 # 3 -12228 12228 3 -22.195910 -18.907625 18.085556 # 3 -12229 12229 3 -22.195910 -19.729696 18.907625 # 3 -12230 12230 3 -23.017979 -18.907625 18.907625 # 3 -12231 12231 3 -21.373838 -19.729696 18.085556 # 3 -12232 12232 3 -20.551767 -18.907625 18.085556 # 3 -12233 12233 3 -20.551767 -19.729696 18.907625 # 3 -12234 12234 3 -21.373838 -18.907625 18.907625 # 3 -12235 12235 3 -19.729696 -19.729696 18.085556 # 3 -12236 12236 3 -18.907625 -18.907625 18.085556 # 3 -12237 12237 3 -18.907625 -19.729696 18.907625 # 3 -12238 12238 3 -19.729696 -18.907625 18.907625 # 3 -12239 12239 3 -18.085556 -19.729696 18.085556 # 3 -12240 12240 3 -17.263485 -18.907625 18.085556 # 3 -12241 12241 3 -17.263485 -19.729696 18.907625 # 3 -12242 12242 3 -18.085556 -18.907625 18.907625 # 3 -12243 12243 3 -16.441414 -19.729696 18.085556 # 3 -12244 12244 3 -15.619343 -19.729696 18.907625 # 3 -12245 12245 3 -16.441414 -18.907625 18.907625 # 3 -12246 12246 3 -14.797273 -18.907625 18.907625 # 3 -12247 12247 3 -24.662121 -18.085556 18.085556 # 3 -12248 12248 3 -23.840050 -17.263485 18.085556 # 3 -12249 12249 3 -23.840050 -18.085556 18.907625 # 3 -12250 12250 3 -24.662121 -17.263485 18.907625 # 3 -12251 12251 3 -23.017979 -18.085556 18.085556 # 3 -12252 12252 3 -22.195910 -17.263485 18.085556 # 3 -12253 12253 3 -22.195910 -18.085556 18.907625 # 3 -12254 12254 3 -23.017979 -17.263485 18.907625 # 3 -12255 12255 3 -21.373838 -18.085556 18.085556 # 3 -12256 12256 3 -20.551767 -17.263485 18.085556 # 3 -12257 12257 3 -20.551767 -18.085556 18.907625 # 3 -12258 12258 3 -21.373838 -17.263485 18.907625 # 3 -12259 12259 3 -19.729696 -18.085556 18.085556 # 3 -12260 12260 3 -18.907625 -17.263485 18.085556 # 3 -12261 12261 3 -18.907625 -18.085556 18.907625 # 3 -12262 12262 3 -19.729696 -17.263485 18.907625 # 3 -12263 12263 3 -18.085556 -18.085556 18.085556 # 3 -12264 12264 3 -17.263485 -17.263485 18.085556 # 3 -12265 12265 3 -17.263485 -18.085556 18.907625 # 3 -12266 12266 3 -18.085556 -17.263485 18.907625 # 3 -12267 12267 3 -16.441414 -18.085556 18.085556 # 3 -12268 12268 3 -15.619343 -18.085556 18.907625 # 3 -12269 12269 3 -16.441414 -17.263485 18.907625 # 3 -12270 12270 3 -14.797273 -17.263485 18.907625 # 3 -12271 12271 3 -24.662121 -16.441414 18.085556 # 3 -12272 12272 3 -23.840050 -16.441414 18.907625 # 3 -12273 12273 3 -23.017979 -16.441414 18.085556 # 3 -12274 12274 3 -22.195910 -16.441414 18.907625 # 3 -12275 12275 3 -21.373838 -16.441414 18.085556 # 3 -12276 12276 3 -20.551767 -16.441414 18.907625 # 3 -12277 12277 3 -19.729696 -16.441414 18.085556 # 3 -12278 12278 3 -18.907625 -16.441414 18.907625 # 3 -12279 12279 3 -18.085556 -16.441414 18.085556 # 3 -12280 12280 3 -17.263485 -16.441414 18.907625 # 3 -12281 12281 3 -16.441414 -16.441414 18.085556 # 3 -12282 12282 3 -15.619343 -16.441414 18.907625 # 3 -12283 12283 3 -24.662121 -19.729696 19.729696 # 3 -12284 12284 3 -23.840050 -18.907625 19.729696 # 3 -12285 12285 3 -23.840050 -19.729696 20.551767 # 3 -12286 12286 3 -24.662121 -18.907625 20.551767 # 3 -12287 12287 3 -23.017979 -19.729696 19.729696 # 3 -12288 12288 3 -22.195910 -18.907625 19.729696 # 3 -12289 12289 3 -22.195910 -19.729696 20.551767 # 3 -12290 12290 3 -23.017979 -18.907625 20.551767 # 3 -12291 12291 3 -21.373838 -19.729696 19.729696 # 3 -12292 12292 3 -20.551767 -18.907625 19.729696 # 3 -12293 12293 3 -20.551767 -19.729696 20.551767 # 3 -12294 12294 3 -21.373838 -18.907625 20.551767 # 3 -12295 12295 3 -19.729696 -19.729696 19.729696 # 3 -12296 12296 3 -18.907625 -18.907625 19.729696 # 3 -12297 12297 3 -18.907625 -19.729696 20.551767 # 3 -12298 12298 3 -19.729696 -18.907625 20.551767 # 3 -12299 12299 3 -18.085556 -19.729696 19.729696 # 3 -12300 12300 3 -17.263485 -18.907625 19.729696 # 3 -12301 12301 3 -17.263485 -19.729696 20.551767 # 3 -12302 12302 3 -18.085556 -18.907625 20.551767 # 3 -12303 12303 3 -16.441414 -19.729696 19.729696 # 3 -12304 12304 3 -15.619343 -18.907625 19.729696 # 3 -12305 12305 3 -15.619343 -19.729696 20.551767 # 3 -12306 12306 3 -16.441414 -18.907625 20.551767 # 3 -12307 12307 3 -14.797273 -19.729696 19.729696 # 3 -12308 12308 3 -13.975202 -18.907625 19.729696 # 3 -12309 12309 3 -13.975202 -19.729696 20.551767 # 3 -12310 12310 3 -14.797273 -18.907625 20.551767 # 3 -12311 12311 3 -13.153131 -19.729696 19.729696 # 3 -12312 12312 3 -12.331060 -19.729696 20.551767 # 3 -12313 12313 3 -13.153131 -18.907625 20.551767 # 3 -12314 12314 3 -10.686919 -19.729696 20.551767 # 3 -12315 12315 3 -11.508989 -18.907625 20.551767 # 3 -12316 12316 3 -9.042778 -19.729696 20.551767 # 3 -12317 12317 3 -9.864848 -18.907625 20.551767 # 3 -12318 12318 3 -24.662121 -18.085556 19.729696 # 3 -12319 12319 3 -23.840050 -17.263485 19.729696 # 3 -12320 12320 3 -23.840050 -18.085556 20.551767 # 3 -12321 12321 3 -24.662121 -17.263485 20.551767 # 3 -12322 12322 3 -23.017979 -18.085556 19.729696 # 3 -12323 12323 3 -22.195910 -17.263485 19.729696 # 3 -12324 12324 3 -22.195910 -18.085556 20.551767 # 3 -12325 12325 3 -23.017979 -17.263485 20.551767 # 3 -12326 12326 3 -21.373838 -18.085556 19.729696 # 3 -12327 12327 3 -20.551767 -17.263485 19.729696 # 3 -12328 12328 3 -20.551767 -18.085556 20.551767 # 3 -12329 12329 3 -21.373838 -17.263485 20.551767 # 3 -12330 12330 3 -19.729696 -18.085556 19.729696 # 3 -12331 12331 3 -18.907625 -17.263485 19.729696 # 3 -12332 12332 3 -18.907625 -18.085556 20.551767 # 3 -12333 12333 3 -19.729696 -17.263485 20.551767 # 3 -12334 12334 3 -18.085556 -18.085556 19.729696 # 3 -12335 12335 3 -17.263485 -17.263485 19.729696 # 3 -12336 12336 3 -17.263485 -18.085556 20.551767 # 3 -12337 12337 3 -18.085556 -17.263485 20.551767 # 3 -12338 12338 3 -16.441414 -18.085556 19.729696 # 3 -12339 12339 3 -15.619343 -17.263485 19.729696 # 3 -12340 12340 3 -15.619343 -18.085556 20.551767 # 3 -12341 12341 3 -16.441414 -17.263485 20.551767 # 3 -12342 12342 3 -14.797273 -18.085556 19.729696 # 3 -12343 12343 3 -13.975202 -17.263485 19.729696 # 3 -12344 12344 3 -13.975202 -18.085556 20.551767 # 3 -12345 12345 3 -14.797273 -17.263485 20.551767 # 3 -12346 12346 3 -13.153131 -18.085556 19.729696 # 3 -12347 12347 3 -12.331060 -18.085556 20.551767 # 3 -12348 12348 3 -13.153131 -17.263485 20.551767 # 3 -12349 12349 3 -10.686919 -18.085556 20.551767 # 3 -12350 12350 3 -11.508989 -17.263485 20.551767 # 3 -12351 12351 3 -9.042778 -18.085556 20.551767 # 3 -12352 12352 3 -9.864848 -17.263485 20.551767 # 3 -12353 12353 3 -24.662121 -16.441414 19.729696 # 3 -12354 12354 3 -23.840050 -16.441414 20.551767 # 3 -12355 12355 3 -23.017979 -16.441414 19.729696 # 3 -12356 12356 3 -22.195910 -16.441414 20.551767 # 3 -12357 12357 3 -21.373838 -16.441414 19.729696 # 3 -12358 12358 3 -20.551767 -16.441414 20.551767 # 3 -12359 12359 3 -19.729696 -16.441414 19.729696 # 3 -12360 12360 3 -18.907625 -16.441414 20.551767 # 3 -12361 12361 3 -18.085556 -16.441414 19.729696 # 3 -12362 12362 3 -17.263485 -16.441414 20.551767 # 3 -12363 12363 3 -16.441414 -16.441414 19.729696 # 3 -12364 12364 3 -15.619343 -16.441414 20.551767 # 3 -12365 12365 3 -14.797273 -16.441414 19.729696 # 3 -12366 12366 3 -13.975202 -16.441414 20.551767 # 3 -12367 12367 3 -13.153131 -16.441414 19.729696 # 3 -12368 12368 3 -12.331060 -16.441414 20.551767 # 3 -12369 12369 3 -10.686919 -16.441414 20.551767 # 3 -12370 12370 3 -9.042778 -16.441414 20.551767 # 3 -12371 12371 3 -24.662121 -19.729696 21.373838 # 3 -12372 12372 3 -23.840050 -18.907625 21.373838 # 3 -12373 12373 3 -23.840050 -19.729696 22.195910 # 3 -12374 12374 3 -24.662121 -18.907625 22.195910 # 3 -12375 12375 3 -23.017979 -19.729696 21.373838 # 3 -12376 12376 3 -22.195910 -18.907625 21.373838 # 3 -12377 12377 3 -22.195910 -19.729696 22.195910 # 3 -12378 12378 3 -23.017979 -18.907625 22.195910 # 3 -12379 12379 3 -21.373838 -19.729696 21.373838 # 3 -12380 12380 3 -20.551767 -18.907625 21.373838 # 3 -12381 12381 3 -20.551767 -19.729696 22.195910 # 3 -12382 12382 3 -21.373838 -18.907625 22.195910 # 3 -12383 12383 3 -19.729696 -19.729696 21.373838 # 3 -12384 12384 3 -18.907625 -18.907625 21.373838 # 3 -12385 12385 3 -18.907625 -19.729696 22.195910 # 3 -12386 12386 3 -19.729696 -18.907625 22.195910 # 3 -12387 12387 3 -18.085556 -19.729696 21.373838 # 3 -12388 12388 3 -17.263485 -18.907625 21.373838 # 3 -12389 12389 3 -17.263485 -19.729696 22.195910 # 3 -12390 12390 3 -18.085556 -18.907625 22.195910 # 3 -12391 12391 3 -16.441414 -19.729696 21.373838 # 3 -12392 12392 3 -15.619343 -18.907625 21.373838 # 3 -12393 12393 3 -15.619343 -19.729696 22.195910 # 3 -12394 12394 3 -16.441414 -18.907625 22.195910 # 3 -12395 12395 3 -14.797273 -19.729696 21.373838 # 3 -12396 12396 3 -13.975202 -18.907625 21.373838 # 3 -12397 12397 3 -13.975202 -19.729696 22.195910 # 3 -12398 12398 3 -14.797273 -18.907625 22.195910 # 3 -12399 12399 3 -13.153131 -19.729696 21.373838 # 3 -12400 12400 3 -12.331060 -18.907625 21.373838 # 3 -12401 12401 3 -12.331060 -19.729696 22.195910 # 3 -12402 12402 3 -13.153131 -18.907625 22.195910 # 3 -12403 12403 3 -11.508989 -19.729696 21.373838 # 3 -12404 12404 3 -10.686919 -18.907625 21.373838 # 3 -12405 12405 3 -10.686919 -19.729696 22.195910 # 3 -12406 12406 3 -11.508989 -18.907625 22.195910 # 3 -12407 12407 3 -9.864848 -19.729696 21.373838 # 3 -12408 12408 3 -9.042778 -18.907625 21.373838 # 3 -12409 12409 3 -9.042778 -19.729696 22.195910 # 3 -12410 12410 3 -9.864848 -18.907625 22.195910 # 3 -12411 12411 3 -24.662121 -18.085556 21.373838 # 3 -12412 12412 3 -23.840050 -17.263485 21.373838 # 3 -12413 12413 3 -23.840050 -18.085556 22.195910 # 3 -12414 12414 3 -24.662121 -17.263485 22.195910 # 3 -12415 12415 3 -23.017979 -18.085556 21.373838 # 3 -12416 12416 3 -22.195910 -17.263485 21.373838 # 3 -12417 12417 3 -22.195910 -18.085556 22.195910 # 3 -12418 12418 3 -23.017979 -17.263485 22.195910 # 3 -12419 12419 3 -21.373838 -18.085556 21.373838 # 3 -12420 12420 3 -20.551767 -17.263485 21.373838 # 3 -12421 12421 3 -20.551767 -18.085556 22.195910 # 3 -12422 12422 3 -21.373838 -17.263485 22.195910 # 3 -12423 12423 3 -19.729696 -18.085556 21.373838 # 3 -12424 12424 3 -18.907625 -17.263485 21.373838 # 3 -12425 12425 3 -18.907625 -18.085556 22.195910 # 3 -12426 12426 3 -19.729696 -17.263485 22.195910 # 3 -12427 12427 3 -18.085556 -18.085556 21.373838 # 3 -12428 12428 3 -17.263485 -17.263485 21.373838 # 3 -12429 12429 3 -17.263485 -18.085556 22.195910 # 3 -12430 12430 3 -18.085556 -17.263485 22.195910 # 3 -12431 12431 3 -16.441414 -18.085556 21.373838 # 3 -12432 12432 3 -15.619343 -17.263485 21.373838 # 3 -12433 12433 3 -15.619343 -18.085556 22.195910 # 3 -12434 12434 3 -16.441414 -17.263485 22.195910 # 3 -12435 12435 3 -14.797273 -18.085556 21.373838 # 3 -12436 12436 3 -13.975202 -17.263485 21.373838 # 3 -12437 12437 3 -13.975202 -18.085556 22.195910 # 3 -12438 12438 3 -14.797273 -17.263485 22.195910 # 3 -12439 12439 3 -13.153131 -18.085556 21.373838 # 3 -12440 12440 3 -12.331060 -17.263485 21.373838 # 3 -12441 12441 3 -12.331060 -18.085556 22.195910 # 3 -12442 12442 3 -13.153131 -17.263485 22.195910 # 3 -12443 12443 3 -11.508989 -18.085556 21.373838 # 3 -12444 12444 3 -10.686919 -17.263485 21.373838 # 3 -12445 12445 3 -10.686919 -18.085556 22.195910 # 3 -12446 12446 3 -11.508989 -17.263485 22.195910 # 3 -12447 12447 3 -9.864848 -18.085556 21.373838 # 3 -12448 12448 3 -9.042778 -17.263485 21.373838 # 3 -12449 12449 3 -9.042778 -18.085556 22.195910 # 3 -12450 12450 3 -9.864848 -17.263485 22.195910 # 3 -12451 12451 3 -24.662121 -16.441414 21.373838 # 3 -12452 12452 3 -23.840050 -16.441414 22.195910 # 3 -12453 12453 3 -23.017979 -16.441414 21.373838 # 3 -12454 12454 3 -22.195910 -16.441414 22.195910 # 3 -12455 12455 3 -21.373838 -16.441414 21.373838 # 3 -12456 12456 3 -20.551767 -16.441414 22.195910 # 3 -12457 12457 3 -19.729696 -16.441414 21.373838 # 3 -12458 12458 3 -18.907625 -16.441414 22.195910 # 3 -12459 12459 3 -18.085556 -16.441414 21.373838 # 3 -12460 12460 3 -17.263485 -16.441414 22.195910 # 3 -12461 12461 3 -16.441414 -16.441414 21.373838 # 3 -12462 12462 3 -15.619343 -16.441414 22.195910 # 3 -12463 12463 3 -14.797273 -16.441414 21.373838 # 3 -12464 12464 3 -13.975202 -16.441414 22.195910 # 3 -12465 12465 3 -13.153131 -16.441414 21.373838 # 3 -12466 12466 3 -12.331060 -16.441414 22.195910 # 3 -12467 12467 3 -11.508989 -16.441414 21.373838 # 3 -12468 12468 3 -10.686919 -16.441414 22.195910 # 3 -12469 12469 3 -9.864848 -16.441414 21.373838 # 3 -12470 12470 3 -9.042778 -16.441414 22.195910 # 3 -12471 12471 3 -24.662121 -19.729696 23.017979 # 3 -12472 12472 3 -23.840050 -18.907625 23.017979 # 3 -12473 12473 3 -23.840050 -19.729696 23.840050 # 3 -12474 12474 3 -24.662121 -18.907625 23.840050 # 3 -12475 12475 3 -23.017979 -19.729696 23.017979 # 3 -12476 12476 3 -22.195910 -18.907625 23.017979 # 3 -12477 12477 3 -22.195910 -19.729696 23.840050 # 3 -12478 12478 3 -23.017979 -18.907625 23.840050 # 3 -12479 12479 3 -21.373838 -19.729696 23.017979 # 3 -12480 12480 3 -20.551767 -18.907625 23.017979 # 3 -12481 12481 3 -20.551767 -19.729696 23.840050 # 3 -12482 12482 3 -21.373838 -18.907625 23.840050 # 3 -12483 12483 3 -19.729696 -19.729696 23.017979 # 3 -12484 12484 3 -18.907625 -18.907625 23.017979 # 3 -12485 12485 3 -18.907625 -19.729696 23.840050 # 3 -12486 12486 3 -19.729696 -18.907625 23.840050 # 3 -12487 12487 3 -18.085556 -19.729696 23.017979 # 3 -12488 12488 3 -17.263485 -18.907625 23.017979 # 3 -12489 12489 3 -17.263485 -19.729696 23.840050 # 3 -12490 12490 3 -18.085556 -18.907625 23.840050 # 3 -12491 12491 3 -16.441414 -19.729696 23.017979 # 3 -12492 12492 3 -15.619343 -18.907625 23.017979 # 3 -12493 12493 3 -15.619343 -19.729696 23.840050 # 3 -12494 12494 3 -16.441414 -18.907625 23.840050 # 3 -12495 12495 3 -14.797273 -19.729696 23.017979 # 3 -12496 12496 3 -13.975202 -18.907625 23.017979 # 3 -12497 12497 3 -13.975202 -19.729696 23.840050 # 3 -12498 12498 3 -14.797273 -18.907625 23.840050 # 3 -12499 12499 3 -13.153131 -19.729696 23.017979 # 3 -12500 12500 3 -12.331060 -18.907625 23.017979 # 3 -12501 12501 3 -12.331060 -19.729696 23.840050 # 3 -12502 12502 3 -13.153131 -18.907625 23.840050 # 3 -12503 12503 3 -11.508989 -19.729696 23.017979 # 3 -12504 12504 3 -10.686919 -18.907625 23.017979 # 3 -12505 12505 3 -10.686919 -19.729696 23.840050 # 3 -12506 12506 3 -11.508989 -18.907625 23.840050 # 3 -12507 12507 3 -9.864848 -19.729696 23.017979 # 3 -12508 12508 3 -9.042778 -18.907625 23.017979 # 3 -12509 12509 3 -9.042778 -19.729696 23.840050 # 3 -12510 12510 3 -9.864848 -18.907625 23.840050 # 3 -12511 12511 3 -24.662121 -18.085556 23.017979 # 3 -12512 12512 3 -23.840050 -17.263485 23.017979 # 3 -12513 12513 3 -23.840050 -18.085556 23.840050 # 3 -12514 12514 3 -24.662121 -17.263485 23.840050 # 3 -12515 12515 3 -23.017979 -18.085556 23.017979 # 3 -12516 12516 3 -22.195910 -17.263485 23.017979 # 3 -12517 12517 3 -22.195910 -18.085556 23.840050 # 3 -12518 12518 3 -23.017979 -17.263485 23.840050 # 3 -12519 12519 3 -21.373838 -18.085556 23.017979 # 3 -12520 12520 3 -20.551767 -17.263485 23.017979 # 3 -12521 12521 3 -20.551767 -18.085556 23.840050 # 3 -12522 12522 3 -21.373838 -17.263485 23.840050 # 3 -12523 12523 3 -19.729696 -18.085556 23.017979 # 3 -12524 12524 3 -18.907625 -17.263485 23.017979 # 3 -12525 12525 3 -18.907625 -18.085556 23.840050 # 3 -12526 12526 3 -19.729696 -17.263485 23.840050 # 3 -12527 12527 3 -18.085556 -18.085556 23.017979 # 3 -12528 12528 3 -17.263485 -17.263485 23.017979 # 3 -12529 12529 3 -17.263485 -18.085556 23.840050 # 3 -12530 12530 3 -18.085556 -17.263485 23.840050 # 3 -12531 12531 3 -16.441414 -18.085556 23.017979 # 3 -12532 12532 3 -15.619343 -17.263485 23.017979 # 3 -12533 12533 3 -15.619343 -18.085556 23.840050 # 3 -12534 12534 3 -16.441414 -17.263485 23.840050 # 3 -12535 12535 3 -14.797273 -18.085556 23.017979 # 3 -12536 12536 3 -13.975202 -17.263485 23.017979 # 3 -12537 12537 3 -13.975202 -18.085556 23.840050 # 3 -12538 12538 3 -14.797273 -17.263485 23.840050 # 3 -12539 12539 3 -13.153131 -18.085556 23.017979 # 3 -12540 12540 3 -12.331060 -17.263485 23.017979 # 3 -12541 12541 3 -12.331060 -18.085556 23.840050 # 3 -12542 12542 3 -13.153131 -17.263485 23.840050 # 3 -12543 12543 3 -11.508989 -18.085556 23.017979 # 3 -12544 12544 3 -10.686919 -17.263485 23.017979 # 3 -12545 12545 3 -10.686919 -18.085556 23.840050 # 3 -12546 12546 3 -11.508989 -17.263485 23.840050 # 3 -12547 12547 3 -9.864848 -18.085556 23.017979 # 3 -12548 12548 3 -9.042778 -17.263485 23.017979 # 3 -12549 12549 3 -9.042778 -18.085556 23.840050 # 3 -12550 12550 3 -9.864848 -17.263485 23.840050 # 3 -12551 12551 3 -24.662121 -16.441414 23.017979 # 3 -12552 12552 3 -23.840050 -16.441414 23.840050 # 3 -12553 12553 3 -23.017979 -16.441414 23.017979 # 3 -12554 12554 3 -22.195910 -16.441414 23.840050 # 3 -12555 12555 3 -21.373838 -16.441414 23.017979 # 3 -12556 12556 3 -20.551767 -16.441414 23.840050 # 3 -12557 12557 3 -19.729696 -16.441414 23.017979 # 3 -12558 12558 3 -18.907625 -16.441414 23.840050 # 3 -12559 12559 3 -18.085556 -16.441414 23.017979 # 3 -12560 12560 3 -17.263485 -16.441414 23.840050 # 3 -12561 12561 3 -16.441414 -16.441414 23.017979 # 3 -12562 12562 3 -15.619343 -16.441414 23.840050 # 3 -12563 12563 3 -14.797273 -16.441414 23.017979 # 3 -12564 12564 3 -13.975202 -16.441414 23.840050 # 3 -12565 12565 3 -13.153131 -16.441414 23.017979 # 3 -12566 12566 3 -12.331060 -16.441414 23.840050 # 3 -12567 12567 3 -11.508989 -16.441414 23.017979 # 3 -12568 12568 3 -10.686919 -16.441414 23.840050 # 3 -12569 12569 3 -9.864848 -16.441414 23.017979 # 3 -12570 12570 3 -9.042778 -16.441414 23.840050 # 3 -12571 12571 3 -24.662121 -19.729696 24.662121 # 3 -12572 12572 3 -23.840050 -18.907625 24.662121 # 3 -12573 12573 3 -23.017979 -19.729696 24.662121 # 3 -12574 12574 3 -22.195910 -18.907625 24.662121 # 3 -12575 12575 3 -21.373838 -19.729696 24.662121 # 3 -12576 12576 3 -20.551767 -18.907625 24.662121 # 3 -12577 12577 3 -19.729696 -19.729696 24.662121 # 3 -12578 12578 3 -18.907625 -18.907625 24.662121 # 3 -12579 12579 3 -18.085556 -19.729696 24.662121 # 3 -12580 12580 3 -17.263485 -18.907625 24.662121 # 3 -12581 12581 3 -16.441414 -19.729696 24.662121 # 3 -12582 12582 3 -15.619343 -18.907625 24.662121 # 3 -12583 12583 3 -14.797273 -19.729696 24.662121 # 3 -12584 12584 3 -13.975202 -18.907625 24.662121 # 3 -12585 12585 3 -13.153131 -19.729696 24.662121 # 3 -12586 12586 3 -12.331060 -18.907625 24.662121 # 3 -12587 12587 3 -11.508989 -19.729696 24.662121 # 3 -12588 12588 3 -10.686919 -18.907625 24.662121 # 3 -12589 12589 3 -9.864848 -19.729696 24.662121 # 3 -12590 12590 3 -9.042778 -18.907625 24.662121 # 3 -12591 12591 3 -24.662121 -18.085556 24.662121 # 3 -12592 12592 3 -23.840050 -17.263485 24.662121 # 3 -12593 12593 3 -23.017979 -18.085556 24.662121 # 3 -12594 12594 3 -22.195910 -17.263485 24.662121 # 3 -12595 12595 3 -21.373838 -18.085556 24.662121 # 3 -12596 12596 3 -20.551767 -17.263485 24.662121 # 3 -12597 12597 3 -19.729696 -18.085556 24.662121 # 3 -12598 12598 3 -18.907625 -17.263485 24.662121 # 3 -12599 12599 3 -18.085556 -18.085556 24.662121 # 3 -12600 12600 3 -17.263485 -17.263485 24.662121 # 3 -12601 12601 3 -16.441414 -18.085556 24.662121 # 3 -12602 12602 3 -15.619343 -17.263485 24.662121 # 3 -12603 12603 3 -14.797273 -18.085556 24.662121 # 3 -12604 12604 3 -13.975202 -17.263485 24.662121 # 3 -12605 12605 3 -13.153131 -18.085556 24.662121 # 3 -12606 12606 3 -12.331060 -17.263485 24.662121 # 3 -12607 12607 3 -11.508989 -18.085556 24.662121 # 3 -12608 12608 3 -10.686919 -17.263485 24.662121 # 3 -12609 12609 3 -9.864848 -18.085556 24.662121 # 3 -12610 12610 3 -9.042778 -17.263485 24.662121 # 3 -12611 12611 3 -24.662121 -16.441414 24.662121 # 3 -12612 12612 3 -23.017979 -16.441414 24.662121 # 3 -12613 12613 3 -21.373838 -16.441414 24.662121 # 3 -12614 12614 3 -19.729696 -16.441414 24.662121 # 3 -12615 12615 3 -18.085556 -16.441414 24.662121 # 3 -12616 12616 3 -16.441414 -16.441414 24.662121 # 3 -12617 12617 3 -14.797273 -16.441414 24.662121 # 3 -12618 12618 3 -13.153131 -16.441414 24.662121 # 3 -12619 12619 3 -11.508989 -16.441414 24.662121 # 3 -12620 12620 3 -9.864848 -16.441414 24.662121 # 3 -12621 12621 3 4.110353 -19.729696 9.042778 # 3 -12622 12622 3 5.754495 -19.729696 9.042778 # 3 -12623 12623 3 4.932424 -18.907625 9.042778 # 3 -12624 12624 3 7.398636 -19.729696 9.042778 # 3 -12625 12625 3 6.576566 -18.907625 9.042778 # 3 -12626 12626 3 8.220707 -18.907625 9.042778 # 3 -12627 12627 3 4.110353 -18.085556 9.042778 # 3 -12628 12628 3 5.754495 -18.085556 9.042778 # 3 -12629 12629 3 4.932424 -17.263485 9.042778 # 3 -12630 12630 3 7.398636 -18.085556 9.042778 # 3 -12631 12631 3 6.576566 -17.263485 9.042778 # 3 -12632 12632 3 8.220707 -17.263485 9.042778 # 3 -12633 12633 3 4.110353 -16.441414 9.042778 # 3 -12634 12634 3 5.754495 -16.441414 9.042778 # 3 -12635 12635 3 7.398636 -16.441414 9.042778 # 3 -12636 12636 3 4.110353 -18.907625 9.864848 # 3 -12637 12637 3 4.110353 -19.729696 10.686919 # 3 -12638 12638 3 4.932424 -19.729696 9.864848 # 3 -12639 12639 3 5.754495 -18.907625 9.864848 # 3 -12640 12640 3 5.754495 -19.729696 10.686919 # 3 -12641 12641 3 4.932424 -18.907625 10.686919 # 3 -12642 12642 3 6.576566 -19.729696 9.864848 # 3 -12643 12643 3 7.398636 -18.907625 9.864848 # 3 -12644 12644 3 7.398636 -19.729696 10.686919 # 3 -12645 12645 3 6.576566 -18.907625 10.686919 # 3 -12646 12646 3 8.220707 -19.729696 9.864848 # 3 -12647 12647 3 8.220707 -18.907625 10.686919 # 3 -12648 12648 3 4.110353 -17.263485 9.864848 # 3 -12649 12649 3 4.110353 -18.085556 10.686919 # 3 -12650 12650 3 4.932424 -18.085556 9.864848 # 3 -12651 12651 3 5.754495 -17.263485 9.864848 # 3 -12652 12652 3 5.754495 -18.085556 10.686919 # 3 -12653 12653 3 4.932424 -17.263485 10.686919 # 3 -12654 12654 3 6.576566 -18.085556 9.864848 # 3 -12655 12655 3 7.398636 -17.263485 9.864848 # 3 -12656 12656 3 7.398636 -18.085556 10.686919 # 3 -12657 12657 3 6.576566 -17.263485 10.686919 # 3 -12658 12658 3 8.220707 -18.085556 9.864848 # 3 -12659 12659 3 8.220707 -17.263485 10.686919 # 3 -12660 12660 3 4.110353 -16.441414 10.686919 # 3 -12661 12661 3 4.932424 -16.441414 9.864848 # 3 -12662 12662 3 5.754495 -16.441414 10.686919 # 3 -12663 12663 3 6.576566 -16.441414 9.864848 # 3 -12664 12664 3 7.398636 -16.441414 10.686919 # 3 -12665 12665 3 8.220707 -16.441414 9.864848 # 3 -12666 12666 3 4.110353 -18.907625 11.508989 # 3 -12667 12667 3 4.110353 -19.729696 12.331060 # 3 -12668 12668 3 4.932424 -19.729696 11.508989 # 3 -12669 12669 3 5.754495 -18.907625 11.508989 # 3 -12670 12670 3 5.754495 -19.729696 12.331060 # 3 -12671 12671 3 4.932424 -18.907625 12.331060 # 3 -12672 12672 3 6.576566 -19.729696 11.508989 # 3 -12673 12673 3 7.398636 -18.907625 11.508989 # 3 -12674 12674 3 7.398636 -19.729696 12.331060 # 3 -12675 12675 3 6.576566 -18.907625 12.331060 # 3 -12676 12676 3 8.220707 -19.729696 11.508989 # 3 -12677 12677 3 8.220707 -18.907625 12.331060 # 3 -12678 12678 3 4.110353 -17.263485 11.508989 # 3 -12679 12679 3 4.110353 -18.085556 12.331060 # 3 -12680 12680 3 4.932424 -18.085556 11.508989 # 3 -12681 12681 3 5.754495 -17.263485 11.508989 # 3 -12682 12682 3 5.754495 -18.085556 12.331060 # 3 -12683 12683 3 4.932424 -17.263485 12.331060 # 3 -12684 12684 3 6.576566 -18.085556 11.508989 # 3 -12685 12685 3 7.398636 -17.263485 11.508989 # 3 -12686 12686 3 7.398636 -18.085556 12.331060 # 3 -12687 12687 3 6.576566 -17.263485 12.331060 # 3 -12688 12688 3 8.220707 -18.085556 11.508989 # 3 -12689 12689 3 8.220707 -17.263485 12.331060 # 3 -12690 12690 3 4.110353 -16.441414 12.331060 # 3 -12691 12691 3 4.932424 -16.441414 11.508989 # 3 -12692 12692 3 5.754495 -16.441414 12.331060 # 3 -12693 12693 3 6.576566 -16.441414 11.508989 # 3 -12694 12694 3 7.398636 -16.441414 12.331060 # 3 -12695 12695 3 8.220707 -16.441414 11.508989 # 3 -12696 12696 3 3.288283 -19.729696 13.153131 # 3 -12697 12697 3 4.110353 -18.907625 13.153131 # 3 -12698 12698 3 4.110353 -19.729696 13.975202 # 3 -12699 12699 3 3.288283 -18.907625 13.975202 # 3 -12700 12700 3 4.932424 -19.729696 13.153131 # 3 -12701 12701 3 5.754495 -18.907625 13.153131 # 3 -12702 12702 3 5.754495 -19.729696 13.975202 # 3 -12703 12703 3 4.932424 -18.907625 13.975202 # 3 -12704 12704 3 6.576566 -19.729696 13.153131 # 3 -12705 12705 3 7.398636 -18.907625 13.153131 # 3 -12706 12706 3 7.398636 -19.729696 13.975202 # 3 -12707 12707 3 6.576566 -18.907625 13.975202 # 3 -12708 12708 3 8.220707 -19.729696 13.153131 # 3 -12709 12709 3 8.220707 -18.907625 13.975202 # 3 -12710 12710 3 3.288283 -18.085556 13.153131 # 3 -12711 12711 3 4.110353 -17.263485 13.153131 # 3 -12712 12712 3 4.110353 -18.085556 13.975202 # 3 -12713 12713 3 3.288283 -17.263485 13.975202 # 3 -12714 12714 3 4.932424 -18.085556 13.153131 # 3 -12715 12715 3 5.754495 -17.263485 13.153131 # 3 -12716 12716 3 5.754495 -18.085556 13.975202 # 3 -12717 12717 3 4.932424 -17.263485 13.975202 # 3 -12718 12718 3 6.576566 -18.085556 13.153131 # 3 -12719 12719 3 7.398636 -17.263485 13.153131 # 3 -12720 12720 3 7.398636 -18.085556 13.975202 # 3 -12721 12721 3 6.576566 -17.263485 13.975202 # 3 -12722 12722 3 8.220707 -18.085556 13.153131 # 3 -12723 12723 3 8.220707 -17.263485 13.975202 # 3 -12724 12724 3 3.288283 -16.441414 13.153131 # 3 -12725 12725 3 4.110353 -16.441414 13.975202 # 3 -12726 12726 3 4.932424 -16.441414 13.153131 # 3 -12727 12727 3 5.754495 -16.441414 13.975202 # 3 -12728 12728 3 6.576566 -16.441414 13.153131 # 3 -12729 12729 3 7.398636 -16.441414 13.975202 # 3 -12730 12730 3 8.220707 -16.441414 13.153131 # 3 -12731 12731 3 2.466212 -18.907625 14.797273 # 3 -12732 12732 3 2.466212 -19.729696 15.619343 # 3 -12733 12733 3 3.288283 -19.729696 14.797273 # 3 -12734 12734 3 4.110353 -18.907625 14.797273 # 3 -12735 12735 3 4.110353 -19.729696 15.619343 # 3 -12736 12736 3 3.288283 -18.907625 15.619343 # 3 -12737 12737 3 4.932424 -19.729696 14.797273 # 3 -12738 12738 3 5.754495 -18.907625 14.797273 # 3 -12739 12739 3 5.754495 -19.729696 15.619343 # 3 -12740 12740 3 4.932424 -18.907625 15.619343 # 3 -12741 12741 3 6.576566 -19.729696 14.797273 # 3 -12742 12742 3 7.398636 -18.907625 14.797273 # 3 -12743 12743 3 7.398636 -19.729696 15.619343 # 3 -12744 12744 3 6.576566 -18.907625 15.619343 # 3 -12745 12745 3 8.220707 -19.729696 14.797273 # 3 -12746 12746 3 8.220707 -18.907625 15.619343 # 3 -12747 12747 3 2.466212 -17.263485 14.797273 # 3 -12748 12748 3 2.466212 -18.085556 15.619343 # 3 -12749 12749 3 3.288283 -18.085556 14.797273 # 3 -12750 12750 3 4.110353 -17.263485 14.797273 # 3 -12751 12751 3 4.110353 -18.085556 15.619343 # 3 -12752 12752 3 3.288283 -17.263485 15.619343 # 3 -12753 12753 3 4.932424 -18.085556 14.797273 # 3 -12754 12754 3 5.754495 -17.263485 14.797273 # 3 -12755 12755 3 5.754495 -18.085556 15.619343 # 3 -12756 12756 3 4.932424 -17.263485 15.619343 # 3 -12757 12757 3 6.576566 -18.085556 14.797273 # 3 -12758 12758 3 7.398636 -17.263485 14.797273 # 3 -12759 12759 3 7.398636 -18.085556 15.619343 # 3 -12760 12760 3 6.576566 -17.263485 15.619343 # 3 -12761 12761 3 8.220707 -18.085556 14.797273 # 3 -12762 12762 3 8.220707 -17.263485 15.619343 # 3 -12763 12763 3 2.466212 -16.441414 15.619343 # 3 -12764 12764 3 3.288283 -16.441414 14.797273 # 3 -12765 12765 3 4.110353 -16.441414 15.619343 # 3 -12766 12766 3 4.932424 -16.441414 14.797273 # 3 -12767 12767 3 5.754495 -16.441414 15.619343 # 3 -12768 12768 3 6.576566 -16.441414 14.797273 # 3 -12769 12769 3 7.398636 -16.441414 15.619343 # 3 -12770 12770 3 8.220707 -16.441414 14.797273 # 3 -12771 12771 3 0.822071 -19.729696 17.263485 # 3 -12772 12772 3 1.644141 -19.729696 16.441414 # 3 -12773 12773 3 2.466212 -18.907625 16.441414 # 3 -12774 12774 3 2.466212 -19.729696 17.263485 # 3 -12775 12775 3 1.644141 -18.907625 17.263485 # 3 -12776 12776 3 3.288283 -19.729696 16.441414 # 3 -12777 12777 3 4.110353 -18.907625 16.441414 # 3 -12778 12778 3 4.110353 -19.729696 17.263485 # 3 -12779 12779 3 3.288283 -18.907625 17.263485 # 3 -12780 12780 3 4.932424 -19.729696 16.441414 # 3 -12781 12781 3 5.754495 -18.907625 16.441414 # 3 -12782 12782 3 5.754495 -19.729696 17.263485 # 3 -12783 12783 3 4.932424 -18.907625 17.263485 # 3 -12784 12784 3 6.576566 -19.729696 16.441414 # 3 -12785 12785 3 7.398636 -18.907625 16.441414 # 3 -12786 12786 3 7.398636 -19.729696 17.263485 # 3 -12787 12787 3 6.576566 -18.907625 17.263485 # 3 -12788 12788 3 8.220707 -19.729696 16.441414 # 3 -12789 12789 3 8.220707 -18.907625 17.263485 # 3 -12790 12790 3 0.822071 -18.085556 17.263485 # 3 -12791 12791 3 1.644141 -18.085556 16.441414 # 3 -12792 12792 3 2.466212 -17.263485 16.441414 # 3 -12793 12793 3 2.466212 -18.085556 17.263485 # 3 -12794 12794 3 1.644141 -17.263485 17.263485 # 3 -12795 12795 3 3.288283 -18.085556 16.441414 # 3 -12796 12796 3 4.110353 -17.263485 16.441414 # 3 -12797 12797 3 4.110353 -18.085556 17.263485 # 3 -12798 12798 3 3.288283 -17.263485 17.263485 # 3 -12799 12799 3 4.932424 -18.085556 16.441414 # 3 -12800 12800 3 5.754495 -17.263485 16.441414 # 3 -12801 12801 3 5.754495 -18.085556 17.263485 # 3 -12802 12802 3 4.932424 -17.263485 17.263485 # 3 -12803 12803 3 6.576566 -18.085556 16.441414 # 3 -12804 12804 3 7.398636 -17.263485 16.441414 # 3 -12805 12805 3 7.398636 -18.085556 17.263485 # 3 -12806 12806 3 6.576566 -17.263485 17.263485 # 3 -12807 12807 3 8.220707 -18.085556 16.441414 # 3 -12808 12808 3 8.220707 -17.263485 17.263485 # 3 -12809 12809 3 0.822071 -16.441414 17.263485 # 3 -12810 12810 3 1.644141 -16.441414 16.441414 # 3 -12811 12811 3 2.466212 -16.441414 17.263485 # 3 -12812 12812 3 3.288283 -16.441414 16.441414 # 3 -12813 12813 3 4.110353 -16.441414 17.263485 # 3 -12814 12814 3 4.932424 -16.441414 16.441414 # 3 -12815 12815 3 5.754495 -16.441414 17.263485 # 3 -12816 12816 3 6.576566 -16.441414 16.441414 # 3 -12817 12817 3 7.398636 -16.441414 17.263485 # 3 -12818 12818 3 8.220707 -16.441414 16.441414 # 3 -12819 12819 3 -0.822071 -19.729696 18.907625 # 3 -12820 12820 3 -1.644141 -18.907625 18.907625 # 3 -12821 12821 3 0.000000 -19.729696 18.085556 # 3 -12822 12822 3 0.822071 -18.907625 18.085556 # 3 -12823 12823 3 0.822071 -19.729696 18.907625 # 3 -12824 12824 3 0.000000 -18.907625 18.907625 # 3 -12825 12825 3 1.644141 -19.729696 18.085556 # 3 -12826 12826 3 2.466212 -18.907625 18.085556 # 3 -12827 12827 3 2.466212 -19.729696 18.907625 # 3 -12828 12828 3 1.644141 -18.907625 18.907625 # 3 -12829 12829 3 3.288283 -19.729696 18.085556 # 3 -12830 12830 3 4.110353 -18.907625 18.085556 # 3 -12831 12831 3 4.110353 -19.729696 18.907625 # 3 -12832 12832 3 3.288283 -18.907625 18.907625 # 3 -12833 12833 3 4.932424 -19.729696 18.085556 # 3 -12834 12834 3 5.754495 -18.907625 18.085556 # 3 -12835 12835 3 5.754495 -19.729696 18.907625 # 3 -12836 12836 3 4.932424 -18.907625 18.907625 # 3 -12837 12837 3 6.576566 -19.729696 18.085556 # 3 -12838 12838 3 7.398636 -18.907625 18.085556 # 3 -12839 12839 3 7.398636 -19.729696 18.907625 # 3 -12840 12840 3 6.576566 -18.907625 18.907625 # 3 -12841 12841 3 8.220707 -19.729696 18.085556 # 3 -12842 12842 3 8.220707 -18.907625 18.907625 # 3 -12843 12843 3 -0.822071 -18.085556 18.907625 # 3 -12844 12844 3 -1.644141 -17.263485 18.907625 # 3 -12845 12845 3 0.000000 -18.085556 18.085556 # 3 -12846 12846 3 0.822071 -17.263485 18.085556 # 3 -12847 12847 3 0.822071 -18.085556 18.907625 # 3 -12848 12848 3 0.000000 -17.263485 18.907625 # 3 -12849 12849 3 1.644141 -18.085556 18.085556 # 3 -12850 12850 3 2.466212 -17.263485 18.085556 # 3 -12851 12851 3 2.466212 -18.085556 18.907625 # 3 -12852 12852 3 1.644141 -17.263485 18.907625 # 3 -12853 12853 3 3.288283 -18.085556 18.085556 # 3 -12854 12854 3 4.110353 -17.263485 18.085556 # 3 -12855 12855 3 4.110353 -18.085556 18.907625 # 3 -12856 12856 3 3.288283 -17.263485 18.907625 # 3 -12857 12857 3 4.932424 -18.085556 18.085556 # 3 -12858 12858 3 5.754495 -17.263485 18.085556 # 3 -12859 12859 3 5.754495 -18.085556 18.907625 # 3 -12860 12860 3 4.932424 -17.263485 18.907625 # 3 -12861 12861 3 6.576566 -18.085556 18.085556 # 3 -12862 12862 3 7.398636 -17.263485 18.085556 # 3 -12863 12863 3 7.398636 -18.085556 18.907625 # 3 -12864 12864 3 6.576566 -17.263485 18.907625 # 3 -12865 12865 3 8.220707 -18.085556 18.085556 # 3 -12866 12866 3 8.220707 -17.263485 18.907625 # 3 -12867 12867 3 -0.822071 -16.441414 18.907625 # 3 -12868 12868 3 0.000000 -16.441414 18.085556 # 3 -12869 12869 3 0.822071 -16.441414 18.907625 # 3 -12870 12870 3 1.644141 -16.441414 18.085556 # 3 -12871 12871 3 2.466212 -16.441414 18.907625 # 3 -12872 12872 3 3.288283 -16.441414 18.085556 # 3 -12873 12873 3 4.110353 -16.441414 18.907625 # 3 -12874 12874 3 4.932424 -16.441414 18.085556 # 3 -12875 12875 3 5.754495 -16.441414 18.907625 # 3 -12876 12876 3 6.576566 -16.441414 18.085556 # 3 -12877 12877 3 7.398636 -16.441414 18.907625 # 3 -12878 12878 3 8.220707 -16.441414 18.085556 # 3 -12879 12879 3 -7.398636 -19.729696 20.551767 # 3 -12880 12880 3 -5.754495 -19.729696 20.551767 # 3 -12881 12881 3 -6.576566 -18.907625 20.551767 # 3 -12882 12882 3 -4.110353 -19.729696 20.551767 # 3 -12883 12883 3 -4.932424 -18.907625 20.551767 # 3 -12884 12884 3 -3.288283 -19.729696 19.729696 # 3 -12885 12885 3 -2.466212 -18.907625 19.729696 # 3 -12886 12886 3 -2.466212 -19.729696 20.551767 # 3 -12887 12887 3 -3.288283 -18.907625 20.551767 # 3 -12888 12888 3 -1.644141 -19.729696 19.729696 # 3 -12889 12889 3 -0.822071 -18.907625 19.729696 # 3 -12890 12890 3 -0.822071 -19.729696 20.551767 # 3 -12891 12891 3 -1.644141 -18.907625 20.551767 # 3 -12892 12892 3 0.000000 -19.729696 19.729696 # 3 -12893 12893 3 0.822071 -18.907625 19.729696 # 3 -12894 12894 3 0.822071 -19.729696 20.551767 # 3 -12895 12895 3 0.000000 -18.907625 20.551767 # 3 -12896 12896 3 1.644141 -19.729696 19.729696 # 3 -12897 12897 3 2.466212 -18.907625 19.729696 # 3 -12898 12898 3 2.466212 -19.729696 20.551767 # 3 -12899 12899 3 1.644141 -18.907625 20.551767 # 3 -12900 12900 3 3.288283 -19.729696 19.729696 # 3 -12901 12901 3 4.110353 -18.907625 19.729696 # 3 -12902 12902 3 4.110353 -19.729696 20.551767 # 3 -12903 12903 3 3.288283 -18.907625 20.551767 # 3 -12904 12904 3 4.932424 -19.729696 19.729696 # 3 -12905 12905 3 5.754495 -18.907625 19.729696 # 3 -12906 12906 3 5.754495 -19.729696 20.551767 # 3 -12907 12907 3 4.932424 -18.907625 20.551767 # 3 -12908 12908 3 6.576566 -19.729696 19.729696 # 3 -12909 12909 3 7.398636 -18.907625 19.729696 # 3 -12910 12910 3 7.398636 -19.729696 20.551767 # 3 -12911 12911 3 6.576566 -18.907625 20.551767 # 3 -12912 12912 3 8.220707 -19.729696 19.729696 # 3 -12913 12913 3 8.220707 -18.907625 20.551767 # 3 -12914 12914 3 -7.398636 -18.085556 20.551767 # 3 -12915 12915 3 -5.754495 -18.085556 20.551767 # 3 -12916 12916 3 -6.576566 -17.263485 20.551767 # 3 -12917 12917 3 -4.110353 -18.085556 20.551767 # 3 -12918 12918 3 -4.932424 -17.263485 20.551767 # 3 -12919 12919 3 -3.288283 -18.085556 19.729696 # 3 -12920 12920 3 -2.466212 -17.263485 19.729696 # 3 -12921 12921 3 -2.466212 -18.085556 20.551767 # 3 -12922 12922 3 -3.288283 -17.263485 20.551767 # 3 -12923 12923 3 -1.644141 -18.085556 19.729696 # 3 -12924 12924 3 -0.822071 -17.263485 19.729696 # 3 -12925 12925 3 -0.822071 -18.085556 20.551767 # 3 -12926 12926 3 -1.644141 -17.263485 20.551767 # 3 -12927 12927 3 0.000000 -18.085556 19.729696 # 3 -12928 12928 3 0.822071 -17.263485 19.729696 # 3 -12929 12929 3 0.822071 -18.085556 20.551767 # 3 -12930 12930 3 0.000000 -17.263485 20.551767 # 3 -12931 12931 3 1.644141 -18.085556 19.729696 # 3 -12932 12932 3 2.466212 -17.263485 19.729696 # 3 -12933 12933 3 2.466212 -18.085556 20.551767 # 3 -12934 12934 3 1.644141 -17.263485 20.551767 # 3 -12935 12935 3 3.288283 -18.085556 19.729696 # 3 -12936 12936 3 4.110353 -17.263485 19.729696 # 3 -12937 12937 3 4.110353 -18.085556 20.551767 # 3 -12938 12938 3 3.288283 -17.263485 20.551767 # 3 -12939 12939 3 4.932424 -18.085556 19.729696 # 3 -12940 12940 3 5.754495 -17.263485 19.729696 # 3 -12941 12941 3 5.754495 -18.085556 20.551767 # 3 -12942 12942 3 4.932424 -17.263485 20.551767 # 3 -12943 12943 3 6.576566 -18.085556 19.729696 # 3 -12944 12944 3 7.398636 -17.263485 19.729696 # 3 -12945 12945 3 7.398636 -18.085556 20.551767 # 3 -12946 12946 3 6.576566 -17.263485 20.551767 # 3 -12947 12947 3 8.220707 -18.085556 19.729696 # 3 -12948 12948 3 8.220707 -17.263485 20.551767 # 3 -12949 12949 3 -7.398636 -16.441414 20.551767 # 3 -12950 12950 3 -5.754495 -16.441414 20.551767 # 3 -12951 12951 3 -4.110353 -16.441414 20.551767 # 3 -12952 12952 3 -3.288283 -16.441414 19.729696 # 3 -12953 12953 3 -2.466212 -16.441414 20.551767 # 3 -12954 12954 3 -1.644141 -16.441414 19.729696 # 3 -12955 12955 3 -0.822071 -16.441414 20.551767 # 3 -12956 12956 3 0.000000 -16.441414 19.729696 # 3 -12957 12957 3 0.822071 -16.441414 20.551767 # 3 -12958 12958 3 1.644141 -16.441414 19.729696 # 3 -12959 12959 3 2.466212 -16.441414 20.551767 # 3 -12960 12960 3 3.288283 -16.441414 19.729696 # 3 -12961 12961 3 4.110353 -16.441414 20.551767 # 3 -12962 12962 3 4.932424 -16.441414 19.729696 # 3 -12963 12963 3 5.754495 -16.441414 20.551767 # 3 -12964 12964 3 6.576566 -16.441414 19.729696 # 3 -12965 12965 3 7.398636 -16.441414 20.551767 # 3 -12966 12966 3 8.220707 -16.441414 19.729696 # 3 -12967 12967 3 -8.220707 -19.729696 21.373838 # 3 -12968 12968 3 -7.398636 -18.907625 21.373838 # 3 -12969 12969 3 -7.398636 -19.729696 22.195910 # 3 -12970 12970 3 -8.220707 -18.907625 22.195910 # 3 -12971 12971 3 -6.576566 -19.729696 21.373838 # 3 -12972 12972 3 -5.754495 -18.907625 21.373838 # 3 -12973 12973 3 -5.754495 -19.729696 22.195910 # 3 -12974 12974 3 -6.576566 -18.907625 22.195910 # 3 -12975 12975 3 -4.932424 -19.729696 21.373838 # 3 -12976 12976 3 -4.110353 -18.907625 21.373838 # 3 -12977 12977 3 -4.110353 -19.729696 22.195910 # 3 -12978 12978 3 -4.932424 -18.907625 22.195910 # 3 -12979 12979 3 -3.288283 -19.729696 21.373838 # 3 -12980 12980 3 -2.466212 -18.907625 21.373838 # 3 -12981 12981 3 -2.466212 -19.729696 22.195910 # 3 -12982 12982 3 -3.288283 -18.907625 22.195910 # 3 -12983 12983 3 -1.644141 -19.729696 21.373838 # 3 -12984 12984 3 -0.822071 -18.907625 21.373838 # 3 -12985 12985 3 -0.822071 -19.729696 22.195910 # 3 -12986 12986 3 -1.644141 -18.907625 22.195910 # 3 -12987 12987 3 0.000000 -19.729696 21.373838 # 3 -12988 12988 3 0.822071 -18.907625 21.373838 # 3 -12989 12989 3 0.822071 -19.729696 22.195910 # 3 -12990 12990 3 0.000000 -18.907625 22.195910 # 3 -12991 12991 3 1.644141 -19.729696 21.373838 # 3 -12992 12992 3 2.466212 -18.907625 21.373838 # 3 -12993 12993 3 2.466212 -19.729696 22.195910 # 3 -12994 12994 3 1.644141 -18.907625 22.195910 # 3 -12995 12995 3 3.288283 -19.729696 21.373838 # 3 -12996 12996 3 4.110353 -18.907625 21.373838 # 3 -12997 12997 3 4.110353 -19.729696 22.195910 # 3 -12998 12998 3 3.288283 -18.907625 22.195910 # 3 -12999 12999 3 4.932424 -19.729696 21.373838 # 3 -13000 13000 3 5.754495 -18.907625 21.373838 # 3 -13001 13001 3 5.754495 -19.729696 22.195910 # 3 -13002 13002 3 4.932424 -18.907625 22.195910 # 3 -13003 13003 3 6.576566 -19.729696 21.373838 # 3 -13004 13004 3 7.398636 -18.907625 21.373838 # 3 -13005 13005 3 7.398636 -19.729696 22.195910 # 3 -13006 13006 3 6.576566 -18.907625 22.195910 # 3 -13007 13007 3 8.220707 -19.729696 21.373838 # 3 -13008 13008 3 8.220707 -18.907625 22.195910 # 3 -13009 13009 3 -8.220707 -18.085556 21.373838 # 3 -13010 13010 3 -7.398636 -17.263485 21.373838 # 3 -13011 13011 3 -7.398636 -18.085556 22.195910 # 3 -13012 13012 3 -8.220707 -17.263485 22.195910 # 3 -13013 13013 3 -6.576566 -18.085556 21.373838 # 3 -13014 13014 3 -5.754495 -17.263485 21.373838 # 3 -13015 13015 3 -5.754495 -18.085556 22.195910 # 3 -13016 13016 3 -6.576566 -17.263485 22.195910 # 3 -13017 13017 3 -4.932424 -18.085556 21.373838 # 3 -13018 13018 3 -4.110353 -17.263485 21.373838 # 3 -13019 13019 3 -4.110353 -18.085556 22.195910 # 3 -13020 13020 3 -4.932424 -17.263485 22.195910 # 3 -13021 13021 3 -3.288283 -18.085556 21.373838 # 3 -13022 13022 3 -2.466212 -17.263485 21.373838 # 3 -13023 13023 3 -2.466212 -18.085556 22.195910 # 3 -13024 13024 3 -3.288283 -17.263485 22.195910 # 3 -13025 13025 3 -1.644141 -18.085556 21.373838 # 3 -13026 13026 3 -0.822071 -17.263485 21.373838 # 3 -13027 13027 3 -0.822071 -18.085556 22.195910 # 3 -13028 13028 3 -1.644141 -17.263485 22.195910 # 3 -13029 13029 3 0.000000 -18.085556 21.373838 # 3 -13030 13030 3 0.822071 -17.263485 21.373838 # 3 -13031 13031 3 0.822071 -18.085556 22.195910 # 3 -13032 13032 3 0.000000 -17.263485 22.195910 # 3 -13033 13033 3 1.644141 -18.085556 21.373838 # 3 -13034 13034 3 2.466212 -17.263485 21.373838 # 3 -13035 13035 3 2.466212 -18.085556 22.195910 # 3 -13036 13036 3 1.644141 -17.263485 22.195910 # 3 -13037 13037 3 3.288283 -18.085556 21.373838 # 3 -13038 13038 3 4.110353 -17.263485 21.373838 # 3 -13039 13039 3 4.110353 -18.085556 22.195910 # 3 -13040 13040 3 3.288283 -17.263485 22.195910 # 3 -13041 13041 3 4.932424 -18.085556 21.373838 # 3 -13042 13042 3 5.754495 -17.263485 21.373838 # 3 -13043 13043 3 5.754495 -18.085556 22.195910 # 3 -13044 13044 3 4.932424 -17.263485 22.195910 # 3 -13045 13045 3 6.576566 -18.085556 21.373838 # 3 -13046 13046 3 7.398636 -17.263485 21.373838 # 3 -13047 13047 3 7.398636 -18.085556 22.195910 # 3 -13048 13048 3 6.576566 -17.263485 22.195910 # 3 -13049 13049 3 8.220707 -18.085556 21.373838 # 3 -13050 13050 3 8.220707 -17.263485 22.195910 # 3 -13051 13051 3 -8.220707 -16.441414 21.373838 # 3 -13052 13052 3 -7.398636 -16.441414 22.195910 # 3 -13053 13053 3 -6.576566 -16.441414 21.373838 # 3 -13054 13054 3 -5.754495 -16.441414 22.195910 # 3 -13055 13055 3 -4.932424 -16.441414 21.373838 # 3 -13056 13056 3 -4.110353 -16.441414 22.195910 # 3 -13057 13057 3 -3.288283 -16.441414 21.373838 # 3 -13058 13058 3 -2.466212 -16.441414 22.195910 # 3 -13059 13059 3 -1.644141 -16.441414 21.373838 # 3 -13060 13060 3 -0.822071 -16.441414 22.195910 # 3 -13061 13061 3 0.000000 -16.441414 21.373838 # 3 -13062 13062 3 0.822071 -16.441414 22.195910 # 3 -13063 13063 3 1.644141 -16.441414 21.373838 # 3 -13064 13064 3 2.466212 -16.441414 22.195910 # 3 -13065 13065 3 3.288283 -16.441414 21.373838 # 3 -13066 13066 3 4.110353 -16.441414 22.195910 # 3 -13067 13067 3 4.932424 -16.441414 21.373838 # 3 -13068 13068 3 5.754495 -16.441414 22.195910 # 3 -13069 13069 3 6.576566 -16.441414 21.373838 # 3 -13070 13070 3 7.398636 -16.441414 22.195910 # 3 -13071 13071 3 8.220707 -16.441414 21.373838 # 3 -13072 13072 3 -8.220707 -19.729696 23.017979 # 3 -13073 13073 3 -7.398636 -18.907625 23.017979 # 3 -13074 13074 3 -7.398636 -19.729696 23.840050 # 3 -13075 13075 3 -8.220707 -18.907625 23.840050 # 3 -13076 13076 3 -6.576566 -19.729696 23.017979 # 3 -13077 13077 3 -5.754495 -18.907625 23.017979 # 3 -13078 13078 3 -5.754495 -19.729696 23.840050 # 3 -13079 13079 3 -6.576566 -18.907625 23.840050 # 3 -13080 13080 3 -4.932424 -19.729696 23.017979 # 3 -13081 13081 3 -4.110353 -18.907625 23.017979 # 3 -13082 13082 3 -4.110353 -19.729696 23.840050 # 3 -13083 13083 3 -4.932424 -18.907625 23.840050 # 3 -13084 13084 3 -3.288283 -19.729696 23.017979 # 3 -13085 13085 3 -2.466212 -18.907625 23.017979 # 3 -13086 13086 3 -2.466212 -19.729696 23.840050 # 3 -13087 13087 3 -3.288283 -18.907625 23.840050 # 3 -13088 13088 3 -1.644141 -19.729696 23.017979 # 3 -13089 13089 3 -0.822071 -18.907625 23.017979 # 3 -13090 13090 3 -0.822071 -19.729696 23.840050 # 3 -13091 13091 3 -1.644141 -18.907625 23.840050 # 3 -13092 13092 3 0.000000 -19.729696 23.017979 # 3 -13093 13093 3 0.822071 -18.907625 23.017979 # 3 -13094 13094 3 0.822071 -19.729696 23.840050 # 3 -13095 13095 3 0.000000 -18.907625 23.840050 # 3 -13096 13096 3 1.644141 -19.729696 23.017979 # 3 -13097 13097 3 2.466212 -18.907625 23.017979 # 3 -13098 13098 3 2.466212 -19.729696 23.840050 # 3 -13099 13099 3 1.644141 -18.907625 23.840050 # 3 -13100 13100 3 3.288283 -19.729696 23.017979 # 3 -13101 13101 3 4.110353 -18.907625 23.017979 # 3 -13102 13102 3 4.110353 -19.729696 23.840050 # 3 -13103 13103 3 3.288283 -18.907625 23.840050 # 3 -13104 13104 3 4.932424 -19.729696 23.017979 # 3 -13105 13105 3 5.754495 -18.907625 23.017979 # 3 -13106 13106 3 5.754495 -19.729696 23.840050 # 3 -13107 13107 3 4.932424 -18.907625 23.840050 # 3 -13108 13108 3 6.576566 -19.729696 23.017979 # 3 -13109 13109 3 7.398636 -18.907625 23.017979 # 3 -13110 13110 3 7.398636 -19.729696 23.840050 # 3 -13111 13111 3 6.576566 -18.907625 23.840050 # 3 -13112 13112 3 8.220707 -19.729696 23.017979 # 3 -13113 13113 3 8.220707 -18.907625 23.840050 # 3 -13114 13114 3 -8.220707 -18.085556 23.017979 # 3 -13115 13115 3 -7.398636 -17.263485 23.017979 # 3 -13116 13116 3 -7.398636 -18.085556 23.840050 # 3 -13117 13117 3 -8.220707 -17.263485 23.840050 # 3 -13118 13118 3 -6.576566 -18.085556 23.017979 # 3 -13119 13119 3 -5.754495 -17.263485 23.017979 # 3 -13120 13120 3 -5.754495 -18.085556 23.840050 # 3 -13121 13121 3 -6.576566 -17.263485 23.840050 # 3 -13122 13122 3 -4.932424 -18.085556 23.017979 # 3 -13123 13123 3 -4.110353 -17.263485 23.017979 # 3 -13124 13124 3 -4.110353 -18.085556 23.840050 # 3 -13125 13125 3 -4.932424 -17.263485 23.840050 # 3 -13126 13126 3 -3.288283 -18.085556 23.017979 # 3 -13127 13127 3 -2.466212 -17.263485 23.017979 # 3 -13128 13128 3 -2.466212 -18.085556 23.840050 # 3 -13129 13129 3 -3.288283 -17.263485 23.840050 # 3 -13130 13130 3 -1.644141 -18.085556 23.017979 # 3 -13131 13131 3 -0.822071 -17.263485 23.017979 # 3 -13132 13132 3 -0.822071 -18.085556 23.840050 # 3 -13133 13133 3 -1.644141 -17.263485 23.840050 # 3 -13134 13134 3 0.000000 -18.085556 23.017979 # 3 -13135 13135 3 0.822071 -17.263485 23.017979 # 3 -13136 13136 3 0.822071 -18.085556 23.840050 # 3 -13137 13137 3 0.000000 -17.263485 23.840050 # 3 -13138 13138 3 1.644141 -18.085556 23.017979 # 3 -13139 13139 3 2.466212 -17.263485 23.017979 # 3 -13140 13140 3 2.466212 -18.085556 23.840050 # 3 -13141 13141 3 1.644141 -17.263485 23.840050 # 3 -13142 13142 3 3.288283 -18.085556 23.017979 # 3 -13143 13143 3 4.110353 -17.263485 23.017979 # 3 -13144 13144 3 4.110353 -18.085556 23.840050 # 3 -13145 13145 3 3.288283 -17.263485 23.840050 # 3 -13146 13146 3 4.932424 -18.085556 23.017979 # 3 -13147 13147 3 5.754495 -17.263485 23.017979 # 3 -13148 13148 3 5.754495 -18.085556 23.840050 # 3 -13149 13149 3 4.932424 -17.263485 23.840050 # 3 -13150 13150 3 6.576566 -18.085556 23.017979 # 3 -13151 13151 3 7.398636 -17.263485 23.017979 # 3 -13152 13152 3 7.398636 -18.085556 23.840050 # 3 -13153 13153 3 6.576566 -17.263485 23.840050 # 3 -13154 13154 3 8.220707 -18.085556 23.017979 # 3 -13155 13155 3 8.220707 -17.263485 23.840050 # 3 -13156 13156 3 -8.220707 -16.441414 23.017979 # 3 -13157 13157 3 -7.398636 -16.441414 23.840050 # 3 -13158 13158 3 -6.576566 -16.441414 23.017979 # 3 -13159 13159 3 -5.754495 -16.441414 23.840050 # 3 -13160 13160 3 -4.932424 -16.441414 23.017979 # 3 -13161 13161 3 -4.110353 -16.441414 23.840050 # 3 -13162 13162 3 -3.288283 -16.441414 23.017979 # 3 -13163 13163 3 -2.466212 -16.441414 23.840050 # 3 -13164 13164 3 -1.644141 -16.441414 23.017979 # 3 -13165 13165 3 -0.822071 -16.441414 23.840050 # 3 -13166 13166 3 0.000000 -16.441414 23.017979 # 3 -13167 13167 3 0.822071 -16.441414 23.840050 # 3 -13168 13168 3 1.644141 -16.441414 23.017979 # 3 -13169 13169 3 2.466212 -16.441414 23.840050 # 3 -13170 13170 3 3.288283 -16.441414 23.017979 # 3 -13171 13171 3 4.110353 -16.441414 23.840050 # 3 -13172 13172 3 4.932424 -16.441414 23.017979 # 3 -13173 13173 3 5.754495 -16.441414 23.840050 # 3 -13174 13174 3 6.576566 -16.441414 23.017979 # 3 -13175 13175 3 7.398636 -16.441414 23.840050 # 3 -13176 13176 3 8.220707 -16.441414 23.017979 # 3 -13177 13177 3 -8.220707 -19.729696 24.662121 # 3 -13178 13178 3 -7.398636 -18.907625 24.662121 # 3 -13179 13179 3 -6.576566 -19.729696 24.662121 # 3 -13180 13180 3 -5.754495 -18.907625 24.662121 # 3 -13181 13181 3 -4.932424 -19.729696 24.662121 # 3 -13182 13182 3 -4.110353 -18.907625 24.662121 # 3 -13183 13183 3 -3.288283 -19.729696 24.662121 # 3 -13184 13184 3 -2.466212 -18.907625 24.662121 # 3 -13185 13185 3 -1.644141 -19.729696 24.662121 # 3 -13186 13186 3 -0.822071 -18.907625 24.662121 # 3 -13187 13187 3 0.000000 -19.729696 24.662121 # 3 -13188 13188 3 0.822071 -18.907625 24.662121 # 3 -13189 13189 3 1.644141 -19.729696 24.662121 # 3 -13190 13190 3 2.466212 -18.907625 24.662121 # 3 -13191 13191 3 3.288283 -19.729696 24.662121 # 3 -13192 13192 3 4.110353 -18.907625 24.662121 # 3 -13193 13193 3 4.932424 -19.729696 24.662121 # 3 -13194 13194 3 5.754495 -18.907625 24.662121 # 3 -13195 13195 3 6.576566 -19.729696 24.662121 # 3 -13196 13196 3 7.398636 -18.907625 24.662121 # 3 -13197 13197 3 8.220707 -19.729696 24.662121 # 3 -13198 13198 3 -8.220707 -18.085556 24.662121 # 3 -13199 13199 3 -7.398636 -17.263485 24.662121 # 3 -13200 13200 3 -6.576566 -18.085556 24.662121 # 3 -13201 13201 3 -5.754495 -17.263485 24.662121 # 3 -13202 13202 3 -4.932424 -18.085556 24.662121 # 3 -13203 13203 3 -4.110353 -17.263485 24.662121 # 3 -13204 13204 3 -3.288283 -18.085556 24.662121 # 3 -13205 13205 3 -2.466212 -17.263485 24.662121 # 3 -13206 13206 3 -1.644141 -18.085556 24.662121 # 3 -13207 13207 3 -0.822071 -17.263485 24.662121 # 3 -13208 13208 3 0.000000 -18.085556 24.662121 # 3 -13209 13209 3 0.822071 -17.263485 24.662121 # 3 -13210 13210 3 1.644141 -18.085556 24.662121 # 3 -13211 13211 3 2.466212 -17.263485 24.662121 # 3 -13212 13212 3 3.288283 -18.085556 24.662121 # 3 -13213 13213 3 4.110353 -17.263485 24.662121 # 3 -13214 13214 3 4.932424 -18.085556 24.662121 # 3 -13215 13215 3 5.754495 -17.263485 24.662121 # 3 -13216 13216 3 6.576566 -18.085556 24.662121 # 3 -13217 13217 3 7.398636 -17.263485 24.662121 # 3 -13218 13218 3 8.220707 -18.085556 24.662121 # 3 -13219 13219 3 -8.220707 -16.441414 24.662121 # 3 -13220 13220 3 -6.576566 -16.441414 24.662121 # 3 -13221 13221 3 -4.932424 -16.441414 24.662121 # 3 -13222 13222 3 -3.288283 -16.441414 24.662121 # 3 -13223 13223 3 -1.644141 -16.441414 24.662121 # 3 -13224 13224 3 0.000000 -16.441414 24.662121 # 3 -13225 13225 3 1.644141 -16.441414 24.662121 # 3 -13226 13226 3 3.288283 -16.441414 24.662121 # 3 -13227 13227 3 4.932424 -16.441414 24.662121 # 3 -13228 13228 3 6.576566 -16.441414 24.662121 # 3 -13229 13229 3 8.220707 -16.441414 24.662121 # 3 -13230 13230 5 -1.644141 8.907625 -4.110353 # 5 -13231 13231 5 0.000000 8.907625 -4.110353 # 5 -13232 13232 5 1.644141 8.907625 -4.110353 # 5 -13233 13233 5 -2.466212 9.729696 -4.110353 # 5 -13234 13234 5 -0.822071 9.729696 -4.110353 # 5 -13235 13235 5 0.000000 9.729696 -4.932424 # 5 -13236 13236 5 0.822071 9.729696 -4.110353 # 5 -13237 13237 5 2.466212 9.729696 -4.110353 # 5 -13238 13238 5 0.000000 5.619343 -2.466212 # 5 -13239 13239 5 -0.822071 7.263485 -3.288283 # 5 -13240 13240 5 -0.822071 6.441414 -2.466212 # 5 -13241 13241 5 -1.644141 7.263485 -2.466212 # 5 -13242 13242 5 0.000000 6.441414 -3.288283 # 5 -13243 13243 5 0.822071 7.263485 -3.288283 # 5 -13244 13244 5 0.822071 6.441414 -2.466212 # 5 -13245 13245 5 0.000000 7.263485 -2.466212 # 5 -13246 13246 5 1.644141 7.263485 -2.466212 # 5 -13247 13247 5 -2.466212 8.907625 -3.288283 # 5 -13248 13248 5 -2.466212 8.085556 -2.466212 # 5 -13249 13249 5 -3.288283 8.907625 -2.466212 # 5 -13250 13250 5 -1.644141 8.085556 -3.288283 # 5 -13251 13251 5 -0.822071 8.907625 -3.288283 # 5 -13252 13252 5 -0.822071 8.085556 -2.466212 # 5 -13253 13253 5 -1.644141 8.907625 -2.466212 # 5 -13254 13254 5 0.000000 8.085556 -3.288283 # 5 -13255 13255 5 0.822071 8.907625 -3.288283 # 5 -13256 13256 5 0.822071 8.085556 -2.466212 # 5 -13257 13257 5 0.000000 8.907625 -2.466212 # 5 -13258 13258 5 1.644141 8.085556 -3.288283 # 5 -13259 13259 5 2.466212 8.907625 -3.288283 # 5 -13260 13260 5 2.466212 8.085556 -2.466212 # 5 -13261 13261 5 1.644141 8.907625 -2.466212 # 5 -13262 13262 5 3.288283 8.907625 -2.466212 # 5 -13263 13263 5 -4.110353 9.729696 -2.466212 # 5 -13264 13264 5 -3.288283 9.729696 -3.288283 # 5 -13265 13265 5 -2.466212 9.729696 -2.466212 # 5 -13266 13266 5 -1.644141 9.729696 -3.288283 # 5 -13267 13267 5 -0.822071 9.729696 -2.466212 # 5 -13268 13268 5 0.000000 9.729696 -3.288283 # 5 -13269 13269 5 0.822071 9.729696 -2.466212 # 5 -13270 13270 5 1.644141 9.729696 -3.288283 # 5 -13271 13271 5 2.466212 9.729696 -2.466212 # 5 -13272 13272 5 3.288283 9.729696 -3.288283 # 5 -13273 13273 5 4.110353 9.729696 -2.466212 # 5 -13274 13274 5 0.000000 2.331060 -0.822071 # 5 -13275 13275 5 -0.822071 3.975202 -1.644141 # 5 -13276 13276 5 -0.822071 3.153131 -0.822071 # 5 -13277 13277 5 -1.644141 3.975202 -0.822071 # 5 -13278 13278 5 0.000000 3.153131 -1.644141 # 5 -13279 13279 5 0.822071 3.975202 -1.644141 # 5 -13280 13280 5 0.822071 3.153131 -0.822071 # 5 -13281 13281 5 0.000000 3.975202 -0.822071 # 5 -13282 13282 5 1.644141 3.975202 -0.822071 # 5 -13283 13283 5 -1.644141 4.797273 -1.644141 # 5 -13284 13284 5 -0.822071 5.619343 -1.644141 # 5 -13285 13285 5 -0.822071 4.797273 -0.822071 # 5 -13286 13286 5 -1.644141 5.619343 -0.822071 # 5 -13287 13287 5 0.000000 4.797273 -1.644141 # 5 -13288 13288 5 0.822071 5.619343 -1.644141 # 5 -13289 13289 5 0.822071 4.797273 -0.822071 # 5 -13290 13290 5 0.000000 5.619343 -0.822071 # 5 -13291 13291 5 1.644141 4.797273 -1.644141 # 5 -13292 13292 5 1.644141 5.619343 -0.822071 # 5 -13293 13293 5 -2.466212 7.263485 -1.644141 # 5 -13294 13294 5 -2.466212 6.441414 -0.822071 # 5 -13295 13295 5 -3.288283 7.263485 -0.822071 # 5 -13296 13296 5 -1.644141 6.441414 -1.644141 # 5 -13297 13297 5 -0.822071 7.263485 -1.644141 # 5 -13298 13298 5 -0.822071 6.441414 -0.822071 # 5 -13299 13299 5 -1.644141 7.263485 -0.822071 # 5 -13300 13300 5 0.000000 6.441414 -1.644141 # 5 -13301 13301 5 0.822071 7.263485 -1.644141 # 5 -13302 13302 5 0.822071 6.441414 -0.822071 # 5 -13303 13303 5 0.000000 7.263485 -0.822071 # 5 -13304 13304 5 1.644141 6.441414 -1.644141 # 5 -13305 13305 5 2.466212 7.263485 -1.644141 # 5 -13306 13306 5 2.466212 6.441414 -0.822071 # 5 -13307 13307 5 1.644141 7.263485 -0.822071 # 5 -13308 13308 5 3.288283 7.263485 -0.822071 # 5 -13309 13309 5 -4.110353 8.907625 -1.644141 # 5 -13310 13310 5 -3.288283 8.085556 -1.644141 # 5 -13311 13311 5 -2.466212 8.907625 -1.644141 # 5 -13312 13312 5 -2.466212 8.085556 -0.822071 # 5 -13313 13313 5 -3.288283 8.907625 -0.822071 # 5 -13314 13314 5 -1.644141 8.085556 -1.644141 # 5 -13315 13315 5 -0.822071 8.907625 -1.644141 # 5 -13316 13316 5 -0.822071 8.085556 -0.822071 # 5 -13317 13317 5 -1.644141 8.907625 -0.822071 # 5 -13318 13318 5 0.000000 8.085556 -1.644141 # 5 -13319 13319 5 0.822071 8.907625 -1.644141 # 5 -13320 13320 5 0.822071 8.085556 -0.822071 # 5 -13321 13321 5 0.000000 8.907625 -0.822071 # 5 -13322 13322 5 1.644141 8.085556 -1.644141 # 5 -13323 13323 5 2.466212 8.907625 -1.644141 # 5 -13324 13324 5 2.466212 8.085556 -0.822071 # 5 -13325 13325 5 1.644141 8.907625 -0.822071 # 5 -13326 13326 5 3.288283 8.085556 -1.644141 # 5 -13327 13327 5 4.110353 8.907625 -1.644141 # 5 -13328 13328 5 3.288283 8.907625 -0.822071 # 5 -13329 13329 5 -4.110353 9.729696 -0.822071 # 5 -13330 13330 5 -3.288283 9.729696 -1.644141 # 5 -13331 13331 5 -2.466212 9.729696 -0.822071 # 5 -13332 13332 5 -1.644141 9.729696 -1.644141 # 5 -13333 13333 5 -0.822071 9.729696 -0.822071 # 5 -13334 13334 5 0.000000 9.729696 -1.644141 # 5 -13335 13335 5 0.822071 9.729696 -0.822071 # 5 -13336 13336 5 1.644141 9.729696 -1.644141 # 5 -13337 13337 5 2.466212 9.729696 -0.822071 # 5 -13338 13338 5 3.288283 9.729696 -1.644141 # 5 -13339 13339 5 4.110353 9.729696 -0.822071 # 5 -13340 13340 5 -0.822071 2.331060 0.000000 # 5 -13341 13341 5 0.000000 1.508989 0.000000 # 5 -13342 13342 5 0.822071 2.331060 0.000000 # 5 -13343 13343 5 0.000000 2.331060 0.822071 # 5 -13344 13344 5 -1.644141 3.153131 0.000000 # 5 -13345 13345 5 -0.822071 3.975202 0.000000 # 5 -13346 13346 5 -0.822071 3.153131 0.822071 # 5 -13347 13347 5 -1.644141 3.975202 0.822071 # 5 -13348 13348 5 0.000000 3.153131 0.000000 # 5 -13349 13349 5 0.822071 3.975202 0.000000 # 5 -13350 13350 5 0.822071 3.153131 0.822071 # 5 -13351 13351 5 0.000000 3.975202 0.822071 # 5 -13352 13352 5 1.644141 3.153131 0.000000 # 5 -13353 13353 5 1.644141 3.975202 0.822071 # 5 -13354 13354 5 -2.466212 5.619343 0.000000 # 5 -13355 13355 5 -1.644141 4.797273 0.000000 # 5 -13356 13356 5 -0.822071 5.619343 0.000000 # 5 -13357 13357 5 -0.822071 4.797273 0.822071 # 5 -13358 13358 5 -1.644141 5.619343 0.822071 # 5 -13359 13359 5 0.000000 4.797273 0.000000 # 5 -13360 13360 5 0.822071 5.619343 0.000000 # 5 -13361 13361 5 0.822071 4.797273 0.822071 # 5 -13362 13362 5 0.000000 5.619343 0.822071 # 5 -13363 13363 5 1.644141 4.797273 0.000000 # 5 -13364 13364 5 2.466212 5.619343 0.000000 # 5 -13365 13365 5 1.644141 5.619343 0.822071 # 5 -13366 13366 5 -3.288283 6.441414 0.000000 # 5 -13367 13367 5 -2.466212 7.263485 0.000000 # 5 -13368 13368 5 -2.466212 6.441414 0.822071 # 5 -13369 13369 5 -3.288283 7.263485 0.822071 # 5 -13370 13370 5 -1.644141 6.441414 0.000000 # 5 -13371 13371 5 -0.822071 7.263485 0.000000 # 5 -13372 13372 5 -0.822071 6.441414 0.822071 # 5 -13373 13373 5 -1.644141 7.263485 0.822071 # 5 -13374 13374 5 0.000000 6.441414 0.000000 # 5 -13375 13375 5 0.822071 7.263485 0.000000 # 5 -13376 13376 5 0.822071 6.441414 0.822071 # 5 -13377 13377 5 0.000000 7.263485 0.822071 # 5 -13378 13378 5 1.644141 6.441414 0.000000 # 5 -13379 13379 5 2.466212 7.263485 0.000000 # 5 -13380 13380 5 2.466212 6.441414 0.822071 # 5 -13381 13381 5 1.644141 7.263485 0.822071 # 5 -13382 13382 5 3.288283 6.441414 0.000000 # 5 -13383 13383 5 3.288283 7.263485 0.822071 # 5 -13384 13384 5 -4.110353 8.907625 0.000000 # 5 -13385 13385 5 -3.288283 8.085556 0.000000 # 5 -13386 13386 5 -2.466212 8.907625 0.000000 # 5 -13387 13387 5 -2.466212 8.085556 0.822071 # 5 -13388 13388 5 -3.288283 8.907625 0.822071 # 5 -13389 13389 5 -1.644141 8.085556 0.000000 # 5 -13390 13390 5 -0.822071 8.907625 0.000000 # 5 -13391 13391 5 -0.822071 8.085556 0.822071 # 5 -13392 13392 5 -1.644141 8.907625 0.822071 # 5 -13393 13393 5 0.000000 8.085556 0.000000 # X -13394 13394 5 0.822071 8.907625 0.000000 # 5 -13395 13395 5 0.822071 8.085556 0.822071 # 5 -13396 13396 5 0.000000 8.907625 0.822071 # 5 -13397 13397 5 1.644141 8.085556 0.000000 # 5 -13398 13398 5 2.466212 8.907625 0.000000 # 5 -13399 13399 5 2.466212 8.085556 0.822071 # 5 -13400 13400 5 1.644141 8.907625 0.822071 # 5 -13401 13401 5 3.288283 8.085556 0.000000 # 5 -13402 13402 5 4.110353 8.907625 0.000000 # 5 -13403 13403 5 3.288283 8.907625 0.822071 # 5 -13404 13404 5 -4.932424 9.729696 0.000000 # 5 -13405 13405 5 -4.110353 9.729696 0.822071 # 5 -13406 13406 5 -3.288283 9.729696 0.000000 # 5 -13407 13407 5 -2.466212 9.729696 0.822071 # 5 -13408 13408 5 -1.644141 9.729696 0.000000 # 5 -13409 13409 5 -0.822071 9.729696 0.822071 # 5 -13410 13410 5 0.000000 9.729696 0.000000 # 5 -13411 13411 5 0.822071 9.729696 0.822071 # 5 -13412 13412 5 1.644141 9.729696 0.000000 # 5 -13413 13413 5 2.466212 9.729696 0.822071 # 5 -13414 13414 5 3.288283 9.729696 0.000000 # 5 -13415 13415 5 4.110353 9.729696 0.822071 # 5 -13416 13416 5 4.932424 9.729696 0.000000 # 5 -13417 13417 5 -0.822071 3.975202 1.644141 # 5 -13418 13418 5 0.000000 3.153131 1.644141 # 5 -13419 13419 5 0.822071 3.975202 1.644141 # 5 -13420 13420 5 -1.644141 4.797273 1.644141 # 5 -13421 13421 5 -0.822071 5.619343 1.644141 # 5 -13422 13422 5 0.000000 4.797273 1.644141 # 5 -13423 13423 5 0.822071 5.619343 1.644141 # 5 -13424 13424 5 0.000000 5.619343 2.466212 # 5 -13425 13425 5 1.644141 4.797273 1.644141 # 5 -13426 13426 5 -2.466212 7.263485 1.644141 # 5 -13427 13427 5 -1.644141 6.441414 1.644141 # 5 -13428 13428 5 -0.822071 7.263485 1.644141 # 5 -13429 13429 5 -0.822071 6.441414 2.466212 # 5 -13430 13430 5 -1.644141 7.263485 2.466212 # 5 -13431 13431 5 0.000000 6.441414 1.644141 # 5 -13432 13432 5 0.822071 7.263485 1.644141 # 5 -13433 13433 5 0.822071 6.441414 2.466212 # 5 -13434 13434 5 0.000000 7.263485 2.466212 # 5 -13435 13435 5 1.644141 6.441414 1.644141 # 5 -13436 13436 5 2.466212 7.263485 1.644141 # 5 -13437 13437 5 1.644141 7.263485 2.466212 # 5 -13438 13438 5 -4.110353 8.907625 1.644141 # 5 -13439 13439 5 -3.288283 8.085556 1.644141 # 5 -13440 13440 5 -2.466212 8.907625 1.644141 # 5 -13441 13441 5 -2.466212 8.085556 2.466212 # 5 -13442 13442 5 -3.288283 8.907625 2.466212 # 5 -13443 13443 5 -1.644141 8.085556 1.644141 # 5 -13444 13444 5 -0.822071 8.907625 1.644141 # 5 -13445 13445 5 -0.822071 8.085556 2.466212 # 5 -13446 13446 5 -1.644141 8.907625 2.466212 # 5 -13447 13447 5 0.000000 8.085556 1.644141 # 5 -13448 13448 5 0.822071 8.907625 1.644141 # 5 -13449 13449 5 0.822071 8.085556 2.466212 # 5 -13450 13450 5 0.000000 8.907625 2.466212 # 5 -13451 13451 5 1.644141 8.085556 1.644141 # 5 -13452 13452 5 2.466212 8.907625 1.644141 # 5 -13453 13453 5 2.466212 8.085556 2.466212 # 5 -13454 13454 5 1.644141 8.907625 2.466212 # 5 -13455 13455 5 3.288283 8.085556 1.644141 # 5 -13456 13456 5 4.110353 8.907625 1.644141 # 5 -13457 13457 5 3.288283 8.907625 2.466212 # 5 -13458 13458 5 -4.110353 9.729696 2.466212 # 5 -13459 13459 5 -3.288283 9.729696 1.644141 # 5 -13460 13460 5 -2.466212 9.729696 2.466212 # 5 -13461 13461 5 -1.644141 9.729696 1.644141 # 5 -13462 13462 5 -0.822071 9.729696 2.466212 # 5 -13463 13463 5 0.000000 9.729696 1.644141 # 5 -13464 13464 5 0.822071 9.729696 2.466212 # 5 -13465 13465 5 1.644141 9.729696 1.644141 # 5 -13466 13466 5 2.466212 9.729696 2.466212 # 5 -13467 13467 5 3.288283 9.729696 1.644141 # 5 -13468 13468 5 4.110353 9.729696 2.466212 # 5 -13469 13469 5 -0.822071 7.263485 3.288283 # 5 -13470 13470 5 0.000000 6.441414 3.288283 # 5 -13471 13471 5 0.822071 7.263485 3.288283 # 5 -13472 13472 5 -2.466212 8.907625 3.288283 # 5 -13473 13473 5 -1.644141 8.085556 3.288283 # 5 -13474 13474 5 -0.822071 8.907625 3.288283 # 5 -13475 13475 5 -1.644141 8.907625 4.110353 # 5 -13476 13476 5 0.000000 8.085556 3.288283 # 5 -13477 13477 5 0.822071 8.907625 3.288283 # 5 -13478 13478 5 0.000000 8.907625 4.110353 # 5 -13479 13479 5 1.644141 8.085556 3.288283 # 5 -13480 13480 5 2.466212 8.907625 3.288283 # 5 -13481 13481 5 1.644141 8.907625 4.110353 # 5 -13482 13482 5 -3.288283 9.729696 3.288283 # 5 -13483 13483 5 -2.466212 9.729696 4.110353 # 5 -13484 13484 5 -1.644141 9.729696 3.288283 # 5 -13485 13485 5 -0.822071 9.729696 4.110353 # 5 -13486 13486 5 0.000000 9.729696 3.288283 # 5 -13487 13487 5 0.822071 9.729696 4.110353 # 5 -13488 13488 5 1.644141 9.729696 3.288283 # 5 -13489 13489 5 2.466212 9.729696 4.110353 # 5 -13490 13490 5 3.288283 9.729696 3.288283 # 5 -13491 13491 5 0.000000 9.729696 4.932424 # 5 -13492 13492 6 -16.361500 -17.497499 -21.671501 # CA -13493 13492 6 -15.638500 -17.497499 -21.671501 # CA -13494 13492 6 -15.415000 -16.809999 -21.671501 # CA -13495 13492 6 -16.000000 -16.385000 -21.671501 # CA -13496 13492 6 -16.584999 -16.809999 -21.671501 # CA -13497 13492 6 -17.160500 -16.623001 -21.297501 # CA -13498 13492 6 -16.716999 -17.987000 -21.297501 # CA -13499 13492 6 -15.283000 -17.987000 -21.297501 # CA -13500 13492 6 -14.839500 -16.623001 -21.297501 # CA -13501 13492 6 -16.000000 -15.780000 -21.297501 # CA -13502 13492 6 -14.698000 -17.797001 -20.917500 # CA -13503 13492 6 -14.478001 -17.120501 -20.917500 # CA -13504 13492 6 -14.839500 -16.007999 -20.917500 # CA -13505 13492 6 -15.415000 -15.590000 -20.917500 # CA -13506 13492 6 -16.584999 -15.590000 -20.917500 # CA -13507 13492 6 -17.160500 -16.007999 -20.917500 # CA -13508 13492 6 -17.521999 -17.120501 -20.917500 # CA -13509 13492 6 -17.302000 -17.797001 -20.917500 # CA -13510 13492 6 -16.355499 -18.484501 -20.917500 # CA -13511 13492 6 -15.644500 -18.484501 -20.917500 # CA -13512 13492 6 -16.716999 -18.602001 -20.302500 # CA -13513 13492 6 -17.302000 -18.177000 -20.302500 # CA -13514 13492 6 -15.283000 -18.602001 -20.302500 # CA -13515 13492 6 -14.698000 -18.177000 -20.302500 # CA -13516 13492 6 -14.254499 -16.813000 -20.302500 # CA -13517 13492 6 -14.478001 -16.125500 -20.302500 # CA -13518 13492 6 -15.638500 -15.282500 -20.302500 # CA -13519 13492 6 -16.361500 -15.282500 -20.302500 # CA -13520 13492 6 -17.521999 -16.125500 -20.302500 # CA -13521 13492 6 -17.745501 -16.813000 -20.302500 # CA -13522 13492 6 -16.361500 -18.717499 -19.697500 # CA -13523 13492 6 -15.638500 -18.717499 -19.697500 # CA -13524 13492 6 -14.478001 -17.874500 -19.697500 # CA -13525 13492 6 -14.254499 -17.187000 -19.697500 # CA -13526 13492 6 -14.698000 -15.823000 -19.697500 # CA -13527 13492 6 -15.283000 -15.398000 -19.697500 # CA -13528 13492 6 -17.302000 -15.823000 -19.697500 # CA -13529 13492 6 -16.716999 -15.398000 -19.697500 # CA -13530 13492 6 -17.521999 -17.874500 -19.697500 # CA -13531 13492 6 -17.745501 -17.187000 -19.697500 # CA -13532 13492 6 -15.415000 -18.410000 -19.082500 # CA -13533 13492 6 -14.839500 -17.992001 -19.082500 # CA -13534 13492 6 -17.160500 -17.992001 -19.082500 # CA -13535 13492 6 -16.584999 -18.410000 -19.082500 # CA -13536 13492 6 -17.521999 -16.879499 -19.082500 # CA -13537 13492 6 -17.302000 -16.202999 -19.082500 # CA -13538 13492 6 -16.355499 -15.515500 -19.082500 # CA -13539 13492 6 -15.644500 -15.515500 -19.082500 # CA -13540 13492 6 -14.478001 -16.879499 -19.082500 # CA -13541 13492 6 -14.698000 -16.202999 -19.082500 # CA -13542 13492 6 -16.000000 -18.220001 -18.702000 # CA -13543 13492 6 -17.160500 -17.376999 -18.702000 # CA -13544 13492 6 -16.716999 -16.013000 -18.702000 # CA -13545 13492 6 -15.283000 -16.013000 -18.702000 # CA -13546 13492 6 -14.839500 -17.376999 -18.702000 # CA -13547 13492 6 -16.361500 -16.502501 -18.327999 # CA -13548 13492 6 -15.638500 -16.502501 -18.327999 # CA -13549 13492 6 -15.415000 -17.190001 -18.327999 # CA -13550 13492 6 -16.000000 -17.615000 -18.327999 # CA -13551 13492 6 -16.584999 -17.190001 -18.327999 # CA -13552 13493 6 -6.361500 -17.497501 -21.671501 # CA -13553 13493 6 -5.638500 -17.497501 -21.671501 # CA -13554 13493 6 -5.415001 -16.810001 -21.671501 # CA -13555 13493 6 -6.000000 -16.384998 -21.671501 # CA -13556 13493 6 -6.584999 -16.810001 -21.671501 # CA -13557 13493 6 -7.160500 -16.623001 -21.297501 # CA -13558 13493 6 -6.716999 -17.987000 -21.297501 # CA -13559 13493 6 -5.283001 -17.987000 -21.297501 # CA -13560 13493 6 -4.839500 -16.623001 -21.297501 # CA -13561 13493 6 -6.000000 -15.779999 -21.297501 # CA -13562 13493 6 -4.698000 -17.797001 -20.917500 # CA -13563 13493 6 -4.478001 -17.120499 -20.917500 # CA -13564 13493 6 -4.839500 -16.007999 -20.917500 # CA -13565 13493 6 -5.415001 -15.590000 -20.917500 # CA -13566 13493 6 -6.584999 -15.590000 -20.917500 # CA -13567 13493 6 -7.160500 -16.007999 -20.917500 # CA -13568 13493 6 -7.521999 -17.120499 -20.917500 # CA -13569 13493 6 -7.302000 -17.797001 -20.917500 # CA -13570 13493 6 -6.355499 -18.484501 -20.917500 # CA -13571 13493 6 -5.644501 -18.484501 -20.917500 # CA -13572 13493 6 -6.716999 -18.602001 -20.302498 # CA -13573 13493 6 -7.302000 -18.176998 -20.302498 # CA -13574 13493 6 -5.283001 -18.602001 -20.302498 # CA -13575 13493 6 -4.698000 -18.176998 -20.302498 # CA -13576 13493 6 -4.254501 -16.813000 -20.302498 # CA -13577 13493 6 -4.478001 -16.125500 -20.302498 # CA -13578 13493 6 -5.638500 -15.282501 -20.302498 # CA -13579 13493 6 -6.361500 -15.282501 -20.302498 # CA -13580 13493 6 -7.521999 -16.125500 -20.302498 # CA -13581 13493 6 -7.745499 -16.813000 -20.302498 # CA -13582 13493 6 -6.361500 -18.717499 -19.697502 # CA -13583 13493 6 -5.638500 -18.717499 -19.697502 # CA -13584 13493 6 -4.478001 -17.874500 -19.697502 # CA -13585 13493 6 -4.254501 -17.187000 -19.697502 # CA -13586 13493 6 -4.698000 -15.823002 -19.697502 # CA -13587 13493 6 -5.283001 -15.397999 -19.697502 # CA -13588 13493 6 -7.302000 -15.823002 -19.697502 # CA -13589 13493 6 -6.716999 -15.397999 -19.697502 # CA -13590 13493 6 -7.521999 -17.874500 -19.697502 # CA -13591 13493 6 -7.745499 -17.187000 -19.697502 # CA -13592 13493 6 -5.415001 -18.410000 -19.082500 # CA -13593 13493 6 -4.839500 -17.992001 -19.082500 # CA -13594 13493 6 -7.160500 -17.992001 -19.082500 # CA -13595 13493 6 -6.584999 -18.410000 -19.082500 # CA -13596 13493 6 -7.521999 -16.879501 -19.082500 # CA -13597 13493 6 -7.302000 -16.202999 -19.082500 # CA -13598 13493 6 -6.355499 -15.515499 -19.082500 # CA -13599 13493 6 -5.644501 -15.515499 -19.082500 # CA -13600 13493 6 -4.478001 -16.879501 -19.082500 # CA -13601 13493 6 -4.698000 -16.202999 -19.082500 # CA -13602 13493 6 -6.000000 -18.220001 -18.702000 # CA -13603 13493 6 -7.160500 -17.376999 -18.702000 # CA -13604 13493 6 -6.716999 -16.013000 -18.702000 # CA -13605 13493 6 -5.283001 -16.013000 -18.702000 # CA -13606 13493 6 -4.839500 -17.376999 -18.702000 # CA -13607 13493 6 -6.361500 -16.502499 -18.327999 # CA -13608 13493 6 -5.638500 -16.502499 -18.327999 # CA -13609 13493 6 -5.415001 -17.189999 -18.327999 # CA -13610 13493 6 -6.000000 -17.615002 -18.327999 # CA -13611 13493 6 -6.584999 -17.189999 -18.327999 # CA -13612 13494 6 -11.361500 -17.497501 -15.671499 # CA -13613 13494 6 -10.638500 -17.497501 -15.671499 # CA -13614 13494 6 -10.415000 -16.810001 -15.671499 # CA -13615 13494 6 -11.000000 -16.385002 -15.671499 # CA -13616 13494 6 -11.585000 -16.810001 -15.671499 # CA -13617 13494 6 -12.160500 -16.623001 -15.297501 # CA -13618 13494 6 -11.717000 -17.987000 -15.297501 # CA -13619 13494 6 -10.283000 -17.987000 -15.297501 # CA -13620 13494 6 -9.839500 -16.623001 -15.297501 # CA -13621 13494 6 -11.000000 -15.780003 -15.297501 # CA -13622 13494 6 -9.698000 -17.797001 -14.917500 # CA -13623 13494 6 -9.478000 -17.120502 -14.917500 # CA -13624 13494 6 -9.839500 -16.007999 -14.917500 # CA -13625 13494 6 -10.415000 -15.590000 -14.917500 # CA -13626 13494 6 -11.585000 -15.590000 -14.917500 # CA -13627 13494 6 -12.160500 -16.007999 -14.917500 # CA -13628 13494 6 -12.521999 -17.120502 -14.917500 # CA -13629 13494 6 -12.302000 -17.797001 -14.917500 # CA -13630 13494 6 -11.355500 -18.484501 -14.917500 # CA -13631 13494 6 -10.644500 -18.484501 -14.917500 # CA -13632 13494 6 -11.717000 -18.602001 -14.302500 # CA -13633 13494 6 -12.302000 -18.177002 -14.302500 # CA -13634 13494 6 -10.283000 -18.602001 -14.302500 # CA -13635 13494 6 -9.698000 -18.177002 -14.302500 # CA -13636 13494 6 -9.254500 -16.813000 -14.302500 # CA -13637 13494 6 -9.478000 -16.125500 -14.302500 # CA -13638 13494 6 -10.638500 -15.282501 -14.302500 # CA -13639 13494 6 -11.361500 -15.282501 -14.302500 # CA -13640 13494 6 -12.521999 -16.125500 -14.302500 # CA -13641 13494 6 -12.745501 -16.813000 -14.302500 # CA -13642 13494 6 -11.361500 -18.717503 -13.697500 # CA -13643 13494 6 -10.638500 -18.717503 -13.697500 # CA -13644 13494 6 -9.478000 -17.874500 -13.697500 # CA -13645 13494 6 -9.254500 -17.187000 -13.697500 # CA -13646 13494 6 -9.698000 -15.823002 -13.697500 # CA -13647 13494 6 -10.283000 -15.398003 -13.697500 # CA -13648 13494 6 -12.302000 -15.823002 -13.697500 # CA -13649 13494 6 -11.717000 -15.398003 -13.697500 # CA -13650 13494 6 -12.521999 -17.874500 -13.697500 # CA -13651 13494 6 -12.745501 -17.187000 -13.697500 # CA -13652 13494 6 -10.415000 -18.410000 -13.082500 # CA -13653 13494 6 -9.839500 -17.992001 -13.082500 # CA -13654 13494 6 -12.160500 -17.992001 -13.082500 # CA -13655 13494 6 -11.585000 -18.410000 -13.082500 # CA -13656 13494 6 -12.521999 -16.879501 -13.082500 # CA -13657 13494 6 -12.302000 -16.202999 -13.082500 # CA -13658 13494 6 -11.355500 -15.515499 -13.082500 # CA -13659 13494 6 -10.644500 -15.515499 -13.082500 # CA -13660 13494 6 -9.478000 -16.879501 -13.082500 # CA -13661 13494 6 -9.698000 -16.202999 -13.082500 # CA -13662 13494 6 -11.000000 -18.220001 -12.702000 # CA -13663 13494 6 -12.160500 -17.376999 -12.702000 # CA -13664 13494 6 -11.717000 -16.013000 -12.702000 # CA -13665 13494 6 -10.283000 -16.013000 -12.702000 # CA -13666 13494 6 -9.839500 -17.376999 -12.702000 # CA -13667 13494 6 -11.361500 -16.502502 -12.328000 # CA -13668 13494 6 -10.638500 -16.502502 -12.328000 # CA -13669 13494 6 -10.415000 -17.190002 -12.328000 # CA -13670 13494 6 -11.000000 -17.615002 -12.328000 # CA -13671 13494 6 -11.585000 -17.190002 -12.328000 # CA - - Bonds - -1 1 13492 13493 -2 1 13492 13498 -3 1 13492 13496 -4 1 13493 13494 -5 1 13493 13499 -6 1 13494 13495 -7 1 13494 13500 -8 1 13495 13501 -9 1 13495 13496 -10 1 13496 13497 -11 1 13497 13507 -12 1 13497 13508 -13 1 13498 13510 -14 1 13498 13509 -15 1 13499 13511 -16 1 13499 13502 -17 1 13500 13504 -18 1 13500 13503 -19 1 13501 13505 -20 1 13501 13506 -21 1 13502 13503 -22 1 13502 13515 -23 1 13503 13516 -24 1 13504 13505 -25 1 13504 13517 -26 1 13505 13518 -27 1 13506 13507 -28 1 13506 13519 -29 1 13507 13520 -30 1 13508 13509 -31 1 13508 13521 -32 1 13509 13513 -33 1 13510 13511 -34 1 13510 13512 -35 1 13511 13514 -36 1 13512 13513 -37 1 13512 13522 -38 1 13513 13530 -39 1 13514 13515 -40 1 13514 13523 -41 1 13515 13524 -42 1 13516 13517 -43 1 13516 13525 -44 1 13517 13526 -45 1 13518 13519 -46 1 13518 13527 -47 1 13519 13529 -48 1 13520 13521 -49 1 13520 13528 -50 1 13521 13531 -51 1 13522 13523 -52 1 13522 13535 -53 1 13523 13532 -54 1 13524 13525 -55 1 13524 13533 -56 1 13525 13540 -57 1 13526 13541 -58 1 13526 13527 -59 1 13527 13539 -60 1 13528 13537 -61 1 13528 13529 -62 1 13529 13538 -63 1 13530 13534 -64 1 13530 13531 -65 1 13531 13536 -66 1 13532 13533 -67 1 13532 13542 -68 1 13533 13546 -69 1 13534 13535 -70 1 13534 13543 -71 1 13535 13542 -72 1 13536 13537 -73 1 13536 13543 -74 1 13537 13544 -75 1 13538 13539 -76 1 13538 13544 -77 1 13539 13545 -78 1 13540 13541 -79 1 13540 13546 -80 1 13541 13545 -81 1 13542 13550 -82 1 13543 13551 -83 1 13544 13547 -84 1 13545 13548 -85 1 13546 13549 -86 1 13547 13548 -87 1 13547 13551 -88 1 13548 13549 -89 1 13549 13550 -90 1 13550 13551 -91 1 13552 13553 -92 1 13552 13558 -93 1 13552 13556 -94 1 13553 13554 -95 1 13553 13559 -96 1 13554 13555 -97 1 13554 13560 -98 1 13555 13561 -99 1 13555 13556 -100 1 13556 13557 -101 1 13557 13567 -102 1 13557 13568 -103 1 13558 13570 -104 1 13558 13569 -105 1 13559 13571 -106 1 13559 13562 -107 1 13560 13564 -108 1 13560 13563 -109 1 13561 13565 -110 1 13561 13566 -111 1 13562 13563 -112 1 13562 13575 -113 1 13563 13576 -114 1 13564 13565 -115 1 13564 13577 -116 1 13565 13578 -117 1 13566 13567 -118 1 13566 13579 -119 1 13567 13580 -120 1 13568 13569 -121 1 13568 13581 -122 1 13569 13573 -123 1 13570 13571 -124 1 13570 13572 -125 1 13571 13574 -126 1 13572 13573 -127 1 13572 13582 -128 1 13573 13590 -129 1 13574 13575 -130 1 13574 13583 -131 1 13575 13584 -132 1 13576 13577 -133 1 13576 13585 -134 1 13577 13586 -135 1 13578 13579 -136 1 13578 13587 -137 1 13579 13589 -138 1 13580 13581 -139 1 13580 13588 -140 1 13581 13591 -141 1 13582 13583 -142 1 13582 13595 -143 1 13583 13592 -144 1 13584 13585 -145 1 13584 13593 -146 1 13585 13600 -147 1 13586 13601 -148 1 13586 13587 -149 1 13587 13599 -150 1 13588 13597 -151 1 13588 13589 -152 1 13589 13598 -153 1 13590 13594 -154 1 13590 13591 -155 1 13591 13596 -156 1 13592 13593 -157 1 13592 13602 -158 1 13593 13606 -159 1 13594 13595 -160 1 13594 13603 -161 1 13595 13602 -162 1 13596 13597 -163 1 13596 13603 -164 1 13597 13604 -165 1 13598 13599 -166 1 13598 13604 -167 1 13599 13605 -168 1 13600 13601 -169 1 13600 13606 -170 1 13601 13605 -171 1 13602 13610 -172 1 13603 13611 -173 1 13604 13607 -174 1 13605 13608 -175 1 13606 13609 -176 1 13607 13608 -177 1 13607 13611 -178 1 13608 13609 -179 1 13609 13610 -180 1 13610 13611 -181 1 13612 13618 -182 1 13612 13616 -183 1 13612 13613 -184 1 13613 13614 -185 1 13613 13619 -186 1 13614 13615 -187 1 13614 13620 -188 1 13615 13621 -189 1 13615 13616 -190 1 13616 13617 -191 1 13617 13628 -192 1 13617 13627 -193 1 13618 13630 -194 1 13618 13629 -195 1 13619 13622 -196 1 13619 13631 -197 1 13620 13623 -198 1 13620 13624 -199 1 13621 13625 -200 1 13621 13626 -201 1 13622 13623 -202 1 13622 13635 -203 1 13623 13636 -204 1 13624 13637 -205 1 13624 13625 -206 1 13625 13638 -207 1 13626 13639 -208 1 13626 13627 -209 1 13627 13640 -210 1 13628 13629 -211 1 13628 13641 -212 1 13629 13633 -213 1 13630 13631 -214 1 13630 13632 -215 1 13631 13634 -216 1 13632 13642 -217 1 13632 13633 -218 1 13633 13650 -219 1 13634 13635 -220 1 13634 13643 -221 1 13635 13644 -222 1 13636 13645 -223 1 13636 13637 -224 1 13637 13646 -225 1 13638 13647 -226 1 13638 13639 -227 1 13639 13649 -228 1 13640 13641 -229 1 13640 13648 -230 1 13641 13651 -231 1 13642 13643 -232 1 13642 13655 -233 1 13643 13652 -234 1 13644 13653 -235 1 13644 13645 -236 1 13645 13660 -237 1 13646 13661 -238 1 13646 13647 -239 1 13647 13659 -240 1 13648 13657 -241 1 13648 13649 -242 1 13649 13658 -243 1 13650 13654 -244 1 13650 13651 -245 1 13651 13656 -246 1 13652 13653 -247 1 13652 13662 -248 1 13653 13666 -249 1 13654 13655 -250 1 13654 13663 -251 1 13655 13662 -252 1 13656 13657 -253 1 13656 13663 -254 1 13657 13664 -255 1 13658 13659 -256 1 13658 13664 -257 1 13659 13665 -258 1 13660 13661 -259 1 13660 13666 -260 1 13661 13665 -261 1 13662 13670 -262 1 13663 13671 -263 1 13664 13667 -264 1 13665 13668 -265 1 13666 13669 -266 1 13667 13671 -267 1 13667 13668 -268 1 13668 13669 -269 1 13669 13670 -270 1 13670 13671 - - Angles - -1 1 13493 13492 13498 -2 1 13493 13492 13496 -3 1 13496 13492 13498 -4 1 13492 13493 13494 -5 1 13492 13493 13499 -6 1 13494 13493 13499 -7 1 13493 13494 13495 -8 1 13493 13494 13500 -9 1 13495 13494 13500 -10 1 13494 13495 13501 -11 1 13494 13495 13496 -12 1 13496 13495 13501 -13 1 13492 13496 13495 -14 1 13492 13496 13497 -15 1 13495 13496 13497 -16 1 13496 13497 13507 -17 1 13496 13497 13508 -18 1 13507 13497 13508 -19 1 13492 13498 13510 -20 1 13492 13498 13509 -21 1 13509 13498 13510 -22 1 13493 13499 13511 -23 1 13493 13499 13502 -24 1 13502 13499 13511 -25 1 13494 13500 13504 -26 1 13494 13500 13503 -27 1 13503 13500 13504 -28 1 13495 13501 13505 -29 1 13495 13501 13506 -30 1 13505 13501 13506 -31 1 13499 13502 13503 -32 1 13499 13502 13515 -33 1 13503 13502 13515 -34 1 13500 13503 13502 -35 1 13500 13503 13516 -36 1 13502 13503 13516 -37 1 13500 13504 13505 -38 1 13500 13504 13517 -39 1 13505 13504 13517 -40 1 13501 13505 13504 -41 1 13501 13505 13518 -42 1 13504 13505 13518 -43 1 13501 13506 13507 -44 1 13501 13506 13519 -45 1 13507 13506 13519 -46 1 13497 13507 13506 -47 1 13497 13507 13520 -48 1 13506 13507 13520 -49 1 13497 13508 13509 -50 1 13497 13508 13521 -51 1 13509 13508 13521 -52 1 13498 13509 13508 -53 1 13498 13509 13513 -54 1 13508 13509 13513 -55 1 13498 13510 13511 -56 1 13498 13510 13512 -57 1 13511 13510 13512 -58 1 13499 13511 13510 -59 1 13499 13511 13514 -60 1 13510 13511 13514 -61 1 13510 13512 13513 -62 1 13510 13512 13522 -63 1 13513 13512 13522 -64 1 13509 13513 13512 -65 1 13509 13513 13530 -66 1 13512 13513 13530 -67 1 13511 13514 13515 -68 1 13511 13514 13523 -69 1 13515 13514 13523 -70 1 13502 13515 13514 -71 1 13502 13515 13524 -72 1 13514 13515 13524 -73 1 13503 13516 13517 -74 1 13503 13516 13525 -75 1 13517 13516 13525 -76 1 13504 13517 13516 -77 1 13504 13517 13526 -78 1 13516 13517 13526 -79 1 13505 13518 13519 -80 1 13505 13518 13527 -81 1 13519 13518 13527 -82 1 13506 13519 13518 -83 1 13506 13519 13529 -84 1 13518 13519 13529 -85 1 13507 13520 13521 -86 1 13507 13520 13528 -87 1 13521 13520 13528 -88 1 13508 13521 13520 -89 1 13508 13521 13531 -90 1 13520 13521 13531 -91 1 13512 13522 13523 -92 1 13512 13522 13535 -93 1 13523 13522 13535 -94 1 13514 13523 13522 -95 1 13514 13523 13532 -96 1 13522 13523 13532 -97 1 13515 13524 13525 -98 1 13515 13524 13533 -99 1 13525 13524 13533 -100 1 13516 13525 13524 -101 1 13516 13525 13540 -102 1 13524 13525 13540 -103 1 13517 13526 13541 -104 1 13517 13526 13527 -105 1 13527 13526 13541 -106 1 13518 13527 13526 -107 1 13518 13527 13539 -108 1 13526 13527 13539 -109 1 13520 13528 13537 -110 1 13520 13528 13529 -111 1 13529 13528 13537 -112 1 13519 13529 13528 -113 1 13519 13529 13538 -114 1 13528 13529 13538 -115 1 13513 13530 13534 -116 1 13513 13530 13531 -117 1 13531 13530 13534 -118 1 13521 13531 13530 -119 1 13521 13531 13536 -120 1 13530 13531 13536 -121 1 13523 13532 13533 -122 1 13523 13532 13542 -123 1 13533 13532 13542 -124 1 13524 13533 13532 -125 1 13524 13533 13546 -126 1 13532 13533 13546 -127 1 13530 13534 13535 -128 1 13530 13534 13543 -129 1 13535 13534 13543 -130 1 13522 13535 13534 -131 1 13522 13535 13542 -132 1 13534 13535 13542 -133 1 13531 13536 13537 -134 1 13531 13536 13543 -135 1 13537 13536 13543 -136 1 13528 13537 13536 -137 1 13528 13537 13544 -138 1 13536 13537 13544 -139 1 13529 13538 13539 -140 1 13529 13538 13544 -141 1 13539 13538 13544 -142 1 13527 13539 13538 -143 1 13527 13539 13545 -144 1 13538 13539 13545 -145 1 13525 13540 13541 -146 1 13525 13540 13546 -147 1 13541 13540 13546 -148 1 13526 13541 13540 -149 1 13526 13541 13545 -150 1 13540 13541 13545 -151 1 13532 13542 13535 -152 1 13532 13542 13550 -153 1 13535 13542 13550 -154 1 13534 13543 13536 -155 1 13534 13543 13551 -156 1 13536 13543 13551 -157 1 13537 13544 13538 -158 1 13537 13544 13547 -159 1 13538 13544 13547 -160 1 13539 13545 13541 -161 1 13539 13545 13548 -162 1 13541 13545 13548 -163 1 13533 13546 13540 -164 1 13533 13546 13549 -165 1 13540 13546 13549 -166 1 13544 13547 13548 -167 1 13544 13547 13551 -168 1 13548 13547 13551 -169 1 13545 13548 13547 -170 1 13545 13548 13549 -171 1 13547 13548 13549 -172 1 13546 13549 13548 -173 1 13546 13549 13550 -174 1 13548 13549 13550 -175 1 13542 13550 13549 -176 1 13542 13550 13551 -177 1 13549 13550 13551 -178 1 13543 13551 13547 -179 1 13543 13551 13550 -180 1 13547 13551 13550 -181 1 13553 13552 13558 -182 1 13553 13552 13556 -183 1 13556 13552 13558 -184 1 13552 13553 13554 -185 1 13552 13553 13559 -186 1 13554 13553 13559 -187 1 13553 13554 13555 -188 1 13553 13554 13560 -189 1 13555 13554 13560 -190 1 13554 13555 13561 -191 1 13554 13555 13556 -192 1 13556 13555 13561 -193 1 13552 13556 13555 -194 1 13552 13556 13557 -195 1 13555 13556 13557 -196 1 13556 13557 13567 -197 1 13556 13557 13568 -198 1 13567 13557 13568 -199 1 13552 13558 13570 -200 1 13552 13558 13569 -201 1 13569 13558 13570 -202 1 13553 13559 13571 -203 1 13553 13559 13562 -204 1 13562 13559 13571 -205 1 13554 13560 13564 -206 1 13554 13560 13563 -207 1 13563 13560 13564 -208 1 13555 13561 13565 -209 1 13555 13561 13566 -210 1 13565 13561 13566 -211 1 13559 13562 13563 -212 1 13559 13562 13575 -213 1 13563 13562 13575 -214 1 13560 13563 13562 -215 1 13560 13563 13576 -216 1 13562 13563 13576 -217 1 13560 13564 13565 -218 1 13560 13564 13577 -219 1 13565 13564 13577 -220 1 13561 13565 13564 -221 1 13561 13565 13578 -222 1 13564 13565 13578 -223 1 13561 13566 13567 -224 1 13561 13566 13579 -225 1 13567 13566 13579 -226 1 13557 13567 13566 -227 1 13557 13567 13580 -228 1 13566 13567 13580 -229 1 13557 13568 13569 -230 1 13557 13568 13581 -231 1 13569 13568 13581 -232 1 13558 13569 13568 -233 1 13558 13569 13573 -234 1 13568 13569 13573 -235 1 13558 13570 13571 -236 1 13558 13570 13572 -237 1 13571 13570 13572 -238 1 13559 13571 13570 -239 1 13559 13571 13574 -240 1 13570 13571 13574 -241 1 13570 13572 13573 -242 1 13570 13572 13582 -243 1 13573 13572 13582 -244 1 13569 13573 13572 -245 1 13569 13573 13590 -246 1 13572 13573 13590 -247 1 13571 13574 13575 -248 1 13571 13574 13583 -249 1 13575 13574 13583 -250 1 13562 13575 13574 -251 1 13562 13575 13584 -252 1 13574 13575 13584 -253 1 13563 13576 13577 -254 1 13563 13576 13585 -255 1 13577 13576 13585 -256 1 13564 13577 13576 -257 1 13564 13577 13586 -258 1 13576 13577 13586 -259 1 13565 13578 13579 -260 1 13565 13578 13587 -261 1 13579 13578 13587 -262 1 13566 13579 13578 -263 1 13566 13579 13589 -264 1 13578 13579 13589 -265 1 13567 13580 13581 -266 1 13567 13580 13588 -267 1 13581 13580 13588 -268 1 13568 13581 13580 -269 1 13568 13581 13591 -270 1 13580 13581 13591 -271 1 13572 13582 13583 -272 1 13572 13582 13595 -273 1 13583 13582 13595 -274 1 13574 13583 13582 -275 1 13574 13583 13592 -276 1 13582 13583 13592 -277 1 13575 13584 13585 -278 1 13575 13584 13593 -279 1 13585 13584 13593 -280 1 13576 13585 13584 -281 1 13576 13585 13600 -282 1 13584 13585 13600 -283 1 13577 13586 13601 -284 1 13577 13586 13587 -285 1 13587 13586 13601 -286 1 13578 13587 13586 -287 1 13578 13587 13599 -288 1 13586 13587 13599 -289 1 13580 13588 13597 -290 1 13580 13588 13589 -291 1 13589 13588 13597 -292 1 13579 13589 13588 -293 1 13579 13589 13598 -294 1 13588 13589 13598 -295 1 13573 13590 13594 -296 1 13573 13590 13591 -297 1 13591 13590 13594 -298 1 13581 13591 13590 -299 1 13581 13591 13596 -300 1 13590 13591 13596 -301 1 13583 13592 13593 -302 1 13583 13592 13602 -303 1 13593 13592 13602 -304 1 13584 13593 13592 -305 1 13584 13593 13606 -306 1 13592 13593 13606 -307 1 13590 13594 13595 -308 1 13590 13594 13603 -309 1 13595 13594 13603 -310 1 13582 13595 13594 -311 1 13582 13595 13602 -312 1 13594 13595 13602 -313 1 13591 13596 13597 -314 1 13591 13596 13603 -315 1 13597 13596 13603 -316 1 13588 13597 13596 -317 1 13588 13597 13604 -318 1 13596 13597 13604 -319 1 13589 13598 13599 -320 1 13589 13598 13604 -321 1 13599 13598 13604 -322 1 13587 13599 13598 -323 1 13587 13599 13605 -324 1 13598 13599 13605 -325 1 13585 13600 13601 -326 1 13585 13600 13606 -327 1 13601 13600 13606 -328 1 13586 13601 13600 -329 1 13586 13601 13605 -330 1 13600 13601 13605 -331 1 13592 13602 13595 -332 1 13592 13602 13610 -333 1 13595 13602 13610 -334 1 13594 13603 13596 -335 1 13594 13603 13611 -336 1 13596 13603 13611 -337 1 13597 13604 13598 -338 1 13597 13604 13607 -339 1 13598 13604 13607 -340 1 13599 13605 13601 -341 1 13599 13605 13608 -342 1 13601 13605 13608 -343 1 13593 13606 13600 -344 1 13593 13606 13609 -345 1 13600 13606 13609 -346 1 13604 13607 13608 -347 1 13604 13607 13611 -348 1 13608 13607 13611 -349 1 13605 13608 13607 -350 1 13605 13608 13609 -351 1 13607 13608 13609 -352 1 13606 13609 13608 -353 1 13606 13609 13610 -354 1 13608 13609 13610 -355 1 13602 13610 13609 -356 1 13602 13610 13611 -357 1 13609 13610 13611 -358 1 13603 13611 13607 -359 1 13603 13611 13610 -360 1 13607 13611 13610 -361 1 13616 13612 13618 -362 1 13613 13612 13618 -363 1 13613 13612 13616 -364 1 13612 13613 13614 -365 1 13612 13613 13619 -366 1 13614 13613 13619 -367 1 13613 13614 13615 -368 1 13613 13614 13620 -369 1 13615 13614 13620 -370 1 13614 13615 13621 -371 1 13614 13615 13616 -372 1 13616 13615 13621 -373 1 13612 13616 13615 -374 1 13612 13616 13617 -375 1 13615 13616 13617 -376 1 13616 13617 13628 -377 1 13616 13617 13627 -378 1 13627 13617 13628 -379 1 13612 13618 13630 -380 1 13612 13618 13629 -381 1 13629 13618 13630 -382 1 13613 13619 13622 -383 1 13613 13619 13631 -384 1 13622 13619 13631 -385 1 13614 13620 13623 -386 1 13614 13620 13624 -387 1 13623 13620 13624 -388 1 13615 13621 13625 -389 1 13615 13621 13626 -390 1 13625 13621 13626 -391 1 13619 13622 13623 -392 1 13619 13622 13635 -393 1 13623 13622 13635 -394 1 13620 13623 13622 -395 1 13620 13623 13636 -396 1 13622 13623 13636 -397 1 13620 13624 13637 -398 1 13620 13624 13625 -399 1 13625 13624 13637 -400 1 13621 13625 13624 -401 1 13621 13625 13638 -402 1 13624 13625 13638 -403 1 13621 13626 13639 -404 1 13621 13626 13627 -405 1 13627 13626 13639 -406 1 13617 13627 13626 -407 1 13617 13627 13640 -408 1 13626 13627 13640 -409 1 13617 13628 13629 -410 1 13617 13628 13641 -411 1 13629 13628 13641 -412 1 13618 13629 13628 -413 1 13618 13629 13633 -414 1 13628 13629 13633 -415 1 13618 13630 13631 -416 1 13618 13630 13632 -417 1 13631 13630 13632 -418 1 13619 13631 13630 -419 1 13619 13631 13634 -420 1 13630 13631 13634 -421 1 13630 13632 13642 -422 1 13630 13632 13633 -423 1 13633 13632 13642 -424 1 13629 13633 13632 -425 1 13629 13633 13650 -426 1 13632 13633 13650 -427 1 13631 13634 13635 -428 1 13631 13634 13643 -429 1 13635 13634 13643 -430 1 13622 13635 13634 -431 1 13622 13635 13644 -432 1 13634 13635 13644 -433 1 13623 13636 13645 -434 1 13623 13636 13637 -435 1 13637 13636 13645 -436 1 13624 13637 13636 -437 1 13624 13637 13646 -438 1 13636 13637 13646 -439 1 13625 13638 13647 -440 1 13625 13638 13639 -441 1 13639 13638 13647 -442 1 13626 13639 13638 -443 1 13626 13639 13649 -444 1 13638 13639 13649 -445 1 13627 13640 13641 -446 1 13627 13640 13648 -447 1 13641 13640 13648 -448 1 13628 13641 13640 -449 1 13628 13641 13651 -450 1 13640 13641 13651 -451 1 13632 13642 13643 -452 1 13632 13642 13655 -453 1 13643 13642 13655 -454 1 13634 13643 13642 -455 1 13634 13643 13652 -456 1 13642 13643 13652 -457 1 13635 13644 13653 -458 1 13635 13644 13645 -459 1 13645 13644 13653 -460 1 13636 13645 13644 -461 1 13636 13645 13660 -462 1 13644 13645 13660 -463 1 13637 13646 13661 -464 1 13637 13646 13647 -465 1 13647 13646 13661 -466 1 13638 13647 13646 -467 1 13638 13647 13659 -468 1 13646 13647 13659 -469 1 13640 13648 13657 -470 1 13640 13648 13649 -471 1 13649 13648 13657 -472 1 13639 13649 13648 -473 1 13639 13649 13658 -474 1 13648 13649 13658 -475 1 13633 13650 13654 -476 1 13633 13650 13651 -477 1 13651 13650 13654 -478 1 13641 13651 13650 -479 1 13641 13651 13656 -480 1 13650 13651 13656 -481 1 13643 13652 13653 -482 1 13643 13652 13662 -483 1 13653 13652 13662 -484 1 13644 13653 13652 -485 1 13644 13653 13666 -486 1 13652 13653 13666 -487 1 13650 13654 13655 -488 1 13650 13654 13663 -489 1 13655 13654 13663 -490 1 13642 13655 13654 -491 1 13642 13655 13662 -492 1 13654 13655 13662 -493 1 13651 13656 13657 -494 1 13651 13656 13663 -495 1 13657 13656 13663 -496 1 13648 13657 13656 -497 1 13648 13657 13664 -498 1 13656 13657 13664 -499 1 13649 13658 13659 -500 1 13649 13658 13664 -501 1 13659 13658 13664 -502 1 13647 13659 13658 -503 1 13647 13659 13665 -504 1 13658 13659 13665 -505 1 13645 13660 13661 -506 1 13645 13660 13666 -507 1 13661 13660 13666 -508 1 13646 13661 13660 -509 1 13646 13661 13665 -510 1 13660 13661 13665 -511 1 13652 13662 13655 -512 1 13652 13662 13670 -513 1 13655 13662 13670 -514 1 13654 13663 13656 -515 1 13654 13663 13671 -516 1 13656 13663 13671 -517 1 13657 13664 13658 -518 1 13657 13664 13667 -519 1 13658 13664 13667 -520 1 13659 13665 13661 -521 1 13659 13665 13668 -522 1 13661 13665 13668 -523 1 13653 13666 13660 -524 1 13653 13666 13669 -525 1 13660 13666 13669 -526 1 13664 13667 13671 -527 1 13664 13667 13668 -528 1 13668 13667 13671 -529 1 13665 13668 13667 -530 1 13665 13668 13669 -531 1 13667 13668 13669 -532 1 13666 13669 13668 -533 1 13666 13669 13670 -534 1 13668 13669 13670 -535 1 13662 13670 13669 -536 1 13662 13670 13671 -537 1 13669 13670 13671 -538 1 13663 13671 13667 -539 1 13663 13671 13670 -540 1 13667 13671 13670 - diff --git a/src/vrpn/demos/afm-plus-lammps/falcon.tcl b/src/vrpn/demos/afm-plus-lammps/falcon.tcl deleted file mode 100644 index 88e1aeaf2ba85d20eb9d5da4701502cedfff7df1..0000000000000000000000000000000000000000 --- a/src/vrpn/demos/afm-plus-lammps/falcon.tcl +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/tclsh -# $Id$ -menu tool on -tool create tug falcon0 fbuttons0 ffeedback0 -tool scale 30.0 0 -tool scaleforce 20.0 0 -tool scalespring 25.0 - -if {1} { - # attach effector to second representation (AFM tip). - tool rep 0 0 1 -} else { - # effector grabs atoms. - tool rep 0 -1 -1 -} diff --git a/src/vrpn/demos/afm-plus-lammps/in.afm-plus_imd b/src/vrpn/demos/afm-plus-lammps/in.afm-plus_imd deleted file mode 100644 index 14cba70318019b016bac74686f45515f379083b8..0000000000000000000000000000000000000000 --- a/src/vrpn/demos/afm-plus-lammps/in.afm-plus_imd +++ /dev/null @@ -1,113 +0,0 @@ -# virtual atomic force microscope demo -# $Id $ -dimension 3 -units lj -atom_style molecular -bond_style harmonic -angle_style harmonic -boundary s s s -newton on off # apply newton's 3rd law only for nonbonded. -special_bonds lj/coul 0.0 0.0 1.0 - -# override original processor grid for maximum performance. -# since there are few atoms in y direction we don't want -# to do domain decomposition in that direction. so optimally -# is should be set to that the middle number is always 1. -# use this for 6 CPUs -#processors 3 1 2 -# use this for 7 CPUs -processors 1 1 7 - -# we are pushing the limits with the time step, -# make sure we don't miss neighbor list updates. -neighbor 0.45 bin -neigh_modify delay 2 every 1 check yes - -# an fcc lattice will be our base lattice -# not really needed with a data file, but... -lattice fcc 0.9 - -# system definition -read_data data.afm-plus - -# atom masses. -mass 1 1.0 # substrate, doesn't move so mass doesn't matter. -mass 2 1.0 # light, soft atoms => liquid. -mass 3 5.0 # medium weight, medium hard atoms => soft solid. -mass 4 25.0 # heavy, hard atoms => hard solid. -mass 5 0.005 # tip atoms. have to be very light, so we can "feel" something. -mass 6 1.0 # buckyballs. - -# surface and buckballs are integrated normally. -group mobile type 2 3 4 6 -velocity mobile create 0.6 46659 mom yes rot yes dist gaussian - -# temperature is based on mobile atoms only -compute mobtemp mobile temp - -# contain mobile atoms within the original simulation cell -fix bounds all wall/lj93 xlo -16.0 1.0 1.7 1.36 xhi 16.0 1.0 1.7 1.36 & - ylo -16.0 1.0 1.7 1.36 yhi 10.0 1.0 1.7 1.36 & - zlo -16.0 1.0 1.7 1.36 zhi 16.0 1.0 1.7 1.36 & - units lattice - -# make probe rigid and keep it from rotating. -group afm type 5 -fix afmtip afm rigid group 1 afm torque * off off off -velocity afm set 0.0 0.0 0.0 - -# damping through friction makes the probe much easier -# to control and keeps it in place if not grabbed. -fix dampen afm viscous 0.02 -# with bouncing walls we need to slow down regular atoms, too -fix frict mobile viscous 0.05 - -pair_style lj/cut 2.5 -# GPU version dies in cell list. -#pair_style lj/cut/gpu one/node 1 3.0 -pair_coeff * * 1.0 1.05 -pair_coeff 3 3 2.0 1.05 -pair_coeff 4 4 3.0 1.05 -pair_coeff 6 6 0.2 1.05 - -# reset parameters for interactions with the tip -# and make tip atoms a bit hard and large and -# mostly repulsive so that they are more "feely" -# (not physically correct, but much nicer). -pair_coeff 1 5 3.0 1.30 1.50 -pair_coeff 2 5 3.0 1.30 1.50 -pair_coeff 3 5 3.0 1.30 1.50 -pair_coeff 4 5 3.0 1.30 1.50 -pair_coeff 5 6 3.0 1.30 1.50 - -# buckballs are purely repulsive with -# type 2 atoms to make them float on top. -pair_coeff 2 6 0.6 1.05 1.178 - -# buckball bonded parameters, adapted from CHARMM benzene. -bond_coeff 1 340.0 0.72 -angle_coeff 1 570.0 120.00 - -# -run_style respa 2 3 bond 1 angle 1 dihedral 1 pair 2 -timestep 0.015 -# use verlet for smoother interactions through higher TimeS/S, -# but slower progress -#run_style verlet -#timestep 0.005 - -fix integrate mobile nve -fix thermostat mobile langevin 0.5 0.5 10.0 699483 - -thermo_style custom step pe ke evdwl emol c_mobtemp tpt tps -thermo 1000 -thermo_modify norm yes -thermo_modify temp mobtemp - -#write_restart afm-plus.restart - -#dump traj all atom 100 afm-plus.lammpstrj -fix comm all imd 6789 unwrap off trate 10 -#run 10000 -# XXX: need to correct fix imd to handle multiple runs. -run 5000000000 diff --git a/src/vrpn/demos/vrpn-novint.cfg b/src/vrpn/demos/vrpn-novint.cfg deleted file mode 100644 index 9b40109f80c71b31d1699e8a833572b4cd53ee51..0000000000000000000000000000000000000000 --- a/src/vrpn/demos/vrpn-novint.cfg +++ /dev/null @@ -1,37 +0,0 @@ -# vrpn.cfg.SAMPLE for VRPN version 07.18 - -################################################################################ -################################################################################ -# This file provides comments and examples for the vrpn.cfg file that is read -# by the vrpn_server application when it starts up. This is a generic server -# application that can start up many but maybe not all servers. -# -# This has sample lines for a vrpn.cfg file. If you get a new device working, -# add a line for it here. DO NOT remove lines from this file (unless -# devices are declared obsolete) - just change the actual vrpn.cfg to match -# your application. -# -# All examples in the file are preceded by comment characters (#). To actually -# use one of these examples, remove that character from the beginning of all the -# examples that you want to use, and edit those lines to suit your environment. -################################################################################ - -################################################################################ -# NULL Tracker. This is a "device" that reports the Identity transformation for -# each of its sensors at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are three arguments: -# char name_of_this_device[] -# int number_of_sensors -# float rate_at_which_to_report_updates -# -# vrpn_Tracker_NULL Tracker0 2 2.0 - -################################################################################ -# Novint Falcon attached to USB. -# Arguments: -# char name_of_this_device[] -# int device index (starts at 0) -# char name_of_grip (optional, default= "4-button") -# char kinematic_model (optional, default="stamper") -vrpn_Tracker_NovintFalcon Tracker0 0 4-button - diff --git a/src/vrpn/doxygen/.cvsignore b/src/vrpn/doxygen/.cvsignore deleted file mode 100644 index 145b06b4d8bbc33f978d518d292f796c7b2dfcbd..0000000000000000000000000000000000000000 --- a/src/vrpn/doxygen/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -html -latex -man - diff --git a/src/vrpn/doxygen/CMakeLists.txt b/src/vrpn/doxygen/CMakeLists.txt deleted file mode 100644 index 6f89b77ae99705ab83c512095051274c235a413e..0000000000000000000000000000000000000000 --- a/src/vrpn/doxygen/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Changes made by: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC - -include(DoxygenTargets) - -#----------------------------------------------------------------------------- -# Create documentation -add_doxygen(Doxyfile - INSTALL_DESTINATION - share/doc/vrpn-${BRIEF_VERSION}/source-docs - NO_PDF - INSTALL_COMPONENT - doc) # For some reason, LaTeX bails with a nesting-too-deep error diff --git a/src/vrpn/doxygen/Doxyfile b/src/vrpn/doxygen/Doxyfile deleted file mode 100644 index 5547f88e582dcda96cbc3ad6eaecb4f95dc2962c..0000000000000000000000000000000000000000 --- a/src/vrpn/doxygen/Doxyfile +++ /dev/null @@ -1,224 +0,0 @@ -# The PROJECT_NAME tag is a single word (or sequence of words) that should -# identify the project. Note that if you do not use Doxywizard you need -# to put quotes around the project name if it contains spaces. - -# For config item PROJECT_NAME, default is My Project -PROJECT_NAME = vrpn - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -# For config item PROJECT_BRIEF, default is -PROJECT_BRIEF = "Virtual Reality Peripheral Network" - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -# For config item FULL_PATH_NAMES, default is 1 -FULL_PATH_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -# For config item JAVADOC_AUTOBRIEF, default is 0 -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -# For config item QT_AUTOBRIEF, default is 0 -QT_AUTOBRIEF = YES - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -# For config item MULTILINE_CPP_IS_BRIEF, default is 0 -MULTILINE_CPP_IS_BRIEF = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -# For config item BUILTIN_STL_SUPPORT, default is 0 -BUILTIN_STL_SUPPORT = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -# For config item TYPEDEF_HIDES_STRUCT, default is 0 -TYPEDEF_HIDES_STRUCT = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -# For config item EXTRACT_ALL, default is 0 -EXTRACT_ALL = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -# For config item EXTRACT_LOCAL_CLASSES, default is 1 -EXTRACT_LOCAL_CLASSES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -# For config item INPUT, default is -INPUT = .. - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -# For config item FILE_PATTERNS, default is -FILE_PATTERNS = *.h \ - *.C - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -# For config item SOURCE_BROWSER, default is 0 -SOURCE_BROWSER = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -# For config item REFERENCED_BY_RELATION, default is 0 -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -# For config item REFERENCES_RELATION, default is 0 -REFERENCES_RELATION = YES - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. -# Since the tree basically has the same information as the tab index you -# could consider to set DISABLE_INDEX to NO when enabling this option. - -# For config item GENERATE_TREEVIEW, default is 0 -GENERATE_TREEVIEW = YES - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. - -# For config item PAPER_TYPE, default is a4 -PAPER_TYPE = letter - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -# For config item GENERATE_MAN, default is 0 -GENERATE_MAN = YES - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -# For config item PREDEFINED, default is -PREDEFINED = VRPN_USE_PHANTOM_SERVER \ - VRPN_USE_DIRECTINPUT \ - VRPN_USE_DIRECTSHOW \ - VRPN_INCLUDE_INTERSENSE \ - VRPN_USE_NATIONAL_INSTRUMENTS \ - VRPN_USE_NATIONAL_INSTRUMENTS_MX \ - VRPN_USE_USDIGITAL \ - VRPN_USE_MICROSCRIBE \ - VRPN_INCLUDE_PHASESPACE \ - VRPN_USE_GPM_MOUSE \ - VRPN_USE_MOTIONNODE \ - VRPN_USE_WIIUSE \ - VRPN_USE_FREESPACE \ - VRPN_USE_TRIVISIOCOLIBRI \ - VRPN_USE_HID \ - VRPN_USE_LIBUSB_1_0 - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -# For config item HAVE_DOT, default is 0 -HAVE_DOT = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -# For config item CALL_GRAPH, default is 0 -CALL_GRAPH = YES - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -# For config item CALLER_GRAPH, default is 0 -CALLER_GRAPH = NO - diff --git a/src/vrpn/executables.txt b/src/vrpn/executables.txt deleted file mode 100644 index 7de3ad2179ae94bdeb796d3d598242e265f66a04..0000000000000000000000000000000000000000 --- a/src/vrpn/executables.txt +++ /dev/null @@ -1,135 +0,0 @@ -android_widgets/example_app/.classpath -android_widgets/example_app/default.properties -android_widgets/example_app/proguard.cfg -android_widgets/example_app/res/drawable-hdpi/icon.png -android_widgets/example_app/res/drawable-mdpi/icon.png -android_widgets/example_app/res/drawable-ldpi/icon.png -android_widgets/example_app/res/layout/main.xml -android_widgets/example_app/res/values/vrpn.xml -android_widgets/example_app/res/values/strings.xml -android_widgets/example_app/res/values/arrays.xml -android_widgets/example_app/src/test/app1/MainActivity.java -android_widgets/example_app/.project -android_widgets/example_app/AndroidManifest.xml -android_widgets/README.txt -android_widgets/vrpn_library/.classpath -android_widgets/vrpn_library/doc/allclasses-noframe.html -android_widgets/vrpn_library/doc/deprecated-list.html -android_widgets/vrpn_library/doc/allclasses-frame.html -android_widgets/vrpn_library/doc/help-doc.html -android_widgets/vrpn_library/doc/index.html -android_widgets/vrpn_library/doc/package-list -android_widgets/vrpn_library/doc/constant-values.html -android_widgets/vrpn_library/doc/stylesheet.css -android_widgets/vrpn_library/doc/index-files/index-1.html -android_widgets/vrpn_library/doc/index-files/index-4.html -android_widgets/vrpn_library/doc/index-files/index-3.html -android_widgets/vrpn_library/doc/index-files/index-2.html -android_widgets/vrpn_library/doc/index-files/index-5.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-frame.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnToggleButton.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-use.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnSpinner.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnToggleButton.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnSpinner.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnClient.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnApplication.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnSeekBar.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnPressButton.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnRadioButton.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/class-use/VrpnSurface.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnClient.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnApplication.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnSeekBar.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-summary.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/package-tree.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnPressButton.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnRadioButton.html -android_widgets/vrpn_library/doc/eu/ensam/ii/vrpn/VrpnSurface.html -android_widgets/vrpn_library/doc/overview-tree.html -android_widgets/vrpn_library/doc/resources/inherit.gif -android_widgets/vrpn_library/default.properties -android_widgets/vrpn_library/proguard.cfg -android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_manage.png -android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_rotate_right.png -android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_rotate_left.png -android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_preferences.png -android_widgets/vrpn_library/res/drawable-hdpi/ic_lock_silent_mode_vibrate.png -android_widgets/vrpn_library/res/drawable-hdpi/icon.png -android_widgets/vrpn_library/res/drawable-hdpi/ic_menu_refresh.png -android_widgets/vrpn_library/res/drawable-mdpi/ic_menu_rotate_right.png -android_widgets/vrpn_library/res/drawable-mdpi/ic_menu_rotate_left.png -android_widgets/vrpn_library/res/drawable-mdpi/ic_lock_silent_mode_vibrate.png -android_widgets/vrpn_library/res/drawable-mdpi/icon.png -android_widgets/vrpn_library/res/drawable-ldpi/icon.png -android_widgets/vrpn_library/res/layout/vrpn_seekbar.xml -android_widgets/vrpn_library/res/layout/tab_debug_sensors.xml -android_widgets/vrpn_library/res/values/strings.xml -android_widgets/vrpn_library/res/values/attrs.xml -android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnSpinner.java -android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnSeekBar.java -android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/Quat.java -android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnClient.java -android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/package-info.html -android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/Vec3f.java -android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnPressButton.java -android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/package-info.java -android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnRadioButton.java -android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnSurface.java -android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnToggleButton.java -android_widgets/vrpn_library/src/eu/ensam/ii/vrpn/VrpnApplication.java -android_widgets/vrpn_library/.project -android_widgets/vrpn_library/AndroidManifest.xml -cmake/FindJsonCpp.cmake -gpsnmealib/typedCoord.h -gpsnmealib/utmCoord.h -gpsnmealib/gpsnmealib.vcproj -gpsnmealib/typedCoord.C -gpsnmealib/nmeaParser.h -gpsnmealib/latLonCoord.C -gpsnmealib/utmCoord.C -gpsnmealib/nmeaParser.C -gpsnmealib/.cvsignore -gpsnmealib/latLonCoord.h -server_src/vrpn.cfg -util/cleanupBeforeCommit.sh -vrpn_android/index_files/vrpn48.png -vrpn_android/cpp_doc.htm -vrpn_android/manuals/functionalspec.pdf -vrpn_android/manuals/designdoc.pdf -vrpn_android/manuals/manual.pdf -vrpn_android/comp523android/.classpath -vrpn_android/comp523android/default.properties -vrpn_android/comp523android/res/drawable-hdpi/icon.png -vrpn_android/comp523android/res/menu/controller_menu.xml -vrpn_android/comp523android/res/drawable-mdpi/icon.png -vrpn_android/comp523android/res/drawable/vrpn48.png -vrpn_android/comp523android/res/drawable/gradient.xml -vrpn_android/comp523android/res/drawable-ldpi/icon.png -vrpn_android/comp523android/res/layout/main.xml -vrpn_android/comp523android/res/values/strings.xml -vrpn_android/comp523android/jniInfo.txt -vrpn_android/comp523android/todo.txt -vrpn_android/comp523android/debugging.txt -vrpn_android/comp523android/src/edu/unc/cs/vrpn/VrpnSeekBarChangeListener.java -vrpn_android/comp523android/src/edu/unc/cs/vrpn/Main.java -vrpn_android/comp523android/src/edu/unc/cs/vrpn/JniBuilder.java -vrpn_android/comp523android/src/edu/unc/cs/vrpn/AccelerometerListener.java -vrpn_android/comp523android/src/edu/unc/cs/vrpn/ButtonListener.java -vrpn_android/comp523android/src/jni/JniLayer.java -vrpn_android/comp523android/.project -vrpn_android/comp523android/AndroidManifest.xml -vrpn_android/README.txt -vrpn_android/index.htm -vrpn_Qt_GUI_server/vrpn_Qt.h -vrpn_Qt_GUI_server/vrpn_Qt.C -vrpn_Qt_GUI_server/vrpn_Qt_AppExample/CMakeLists.txt -vrpn_Qt_GUI_server/vrpn_Qt_AppExample/vrpn_Qt_AppExample.cpp -vrpn_Qt_GUI_server/vrpn_Qt_AppExample/MainWindow.cpp -vrpn_Qt_GUI_server/vrpn_Qt_AppExample/MainWindow.h -vrpn_Qt_GUI_server/vrpn_Qt_AppExample/vrpn_Qt_AppExample.bat -vrpn_Qt_GUI_server/vrpn_Qt_AppExample/MainWindow.ui -vrpn_Qt_GUI_server/README.txt -vrpn_Qt_GUI_server/cmake/FindVRPN.cmake -vrpn_Qt_GUI_server/cmake/Findquatlib.cmake -vrpn_Qt_GUI_server/CMakeLists.txt diff --git a/src/vrpn/generate-vcproj.sh b/src/vrpn/generate-vcproj.sh deleted file mode 100644 index 83c278c3a4aaeaa663732cf6193127a62a47bf31..0000000000000000000000000000000000000000 --- a/src/vrpn/generate-vcproj.sh +++ /dev/null @@ -1,490 +0,0 @@ -#!/bin/sh -function SourceFile() -{ -cat <<EOS - <File - RelativePath="${1}" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> -EOS - -} -function HeaderFile() -{ -cat <<EOS - <File - RelativePath="${1}" - > - </File> -EOS -} - -function CleanFileList() -{ - sort -f | grep --invert-match "Android" | grep --invert-match "Atmel" -} - -function GenerateFilesSection() -{ - cat << EOS - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > -EOS - - for src in $(ls vrpn_*.C vrpn_*.cpp | CleanFileList) - do - SourceFile $src - done - -cat <<EOS - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > -EOS - - for header in $(ls vrpn_*.h | CleanFileList) - do - HeaderFile $header - done - -cat <<EOS - </Filter> - </Files> -EOS -} - -function GenerateVrpnVCPROJ() -{ - -cat <<'EOS' -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="vrpn" - ProjectGUID="{7EE1DB03-16A5-4465-9164-061BE0C88B8C}" - RootNamespace="vrpn" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\pc_win32/Release" - IntermediateDirectory=".\pc_win32/Release" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";../dtrack;quat;../isense;../Dtrack;../libfreespace/include;"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include";"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include";"$(SYSTEMDRIVE)\sdk\cpp";"$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1";./submodules/hidapi/hidapi;"$(SYSTEMDRIVE)\Program Files\libusb-1.0\libusb"" - PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS,VRPNDLL_NOEXPORTS" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\pc_win32/Release/vrpn.pch" - AssemblerListingLocation=".\pc_win32/Release/" - ObjectFile=".\pc_win32/Release/" - ProgramDataBaseFileName=".\pc_win32/Release/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile=".\pc_win32/Release\vrpn.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32/Release/vrpn.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\pc_win32/Debug" - IntermediateDirectory=".\pc_win32/Debug" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";../dtrack;quat;../isense;../Dtrack;../libfreespace/include;"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include";"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include";"$(SYSTEMDRIVE)\sdk\cpp";"$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1";./submodules/hidapi/hidapi;"$(SYSTEMDRIVE)\Program Files\libusb-1.0\libusb"" - PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS,VRPNDLL_NOEXPORTS" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\pc_win32/Debug/vrpn.pch" - AssemblerListingLocation=".\pc_win32/Debug/" - ObjectFile=".\pc_win32/Debug/" - ProgramDataBaseFileName=".\pc_win32/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile=".\pc_win32/Debug\vrpn.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32/Debug/vrpn.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> -EOS - -GenerateFilesSection - -cat <<EOS - <Globals> - </Globals> -</VisualStudioProject> -EOS -} - -function GenerateVrpnDLLVCPROJ() -{ -cat <<'EOS' -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="vrpndll" - ProjectGUID="{5F38B32E-B5AE-4316-B15E-9E21D033B1BE}" - RootNamespace="vrpndll" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\pc_win32/DLL/Debug" - IntermediateDirectory=".\pc_win32/DLL/Debug" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="_DEBUG" - MkTypLibCompatible="true" - SuppressStartupBanner="true" - TargetEnvironment="1" - TypeLibraryName=".\pc_win32/DLL/Debug/vrpndll.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";quat;../isense;../Dtrack;../libfreespace/include;"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include";"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include";"$(SYSTEMDRIVE)\sdk\cpp";"$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1";./submodules/hidapi/hidapi;"$(SYSTEMDRIVE)\Program Files\libusb-1.0\libusb"" - PreprocessorDefinitions="VRPNDLL_EXPORTS,_CRT_SECURE_NO_WARNINGS" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\pc_win32/DLL/Debug/vrpndll.pch" - AssemblerListingLocation=".\pc_win32/DLL/Debug/" - ObjectFile=".\pc_win32/DLL/Debug/" - ProgramDataBaseFileName=".\pc_win32/DLL/Debug/" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - IgnoreImportLibrary="true" - OutputFile=".\pc_win32/DLL/Debug/vrpndll.dll" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib,$(SYSTEMDRIVE)\sdk\cpp,$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1\lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\pc_win32/DLL/Debug/vrpndll.pdb" - ImportLibrary=".\pc_win32\DLL\Debug\vrpndll.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32/DLL/Debug/vrpndll.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\pc_win32/DLL/Release" - IntermediateDirectory=".\pc_win32/DLL/Release" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="NDEBUG" - MkTypLibCompatible="true" - SuppressStartupBanner="true" - TargetEnvironment="1" - TypeLibraryName=".\pc_win32/DLL/Release/vrpndll.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";quat;../isense;../Dtrack;../libfreespace/include;"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include";"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include";"$(SYSTEMDRIVE)\sdk\cpp";"$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1";./submodules/hidapi/hidapi;"$(SYSTEMDRIVE)\Program Files\libusb-1.0\libusb"" - PreprocessorDefinitions="VRPNDLL_EXPORTS,_CRT_SECURE_NO_WARNINGS" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\pc_win32/DLL/Release/vrpndll.pch" - AssemblerListingLocation=".\pc_win32/DLL/Release/" - ObjectFile=".\pc_win32/DLL/Release/" - ProgramDataBaseFileName=".\pc_win32/DLL/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - IgnoreImportLibrary="true" - OutputFile=".\pc_win32/DLL/Release/vrpndll.dll" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib,$(SYSTEMDRIVE)\sdk\cpp,$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1\lib" - ProgramDatabaseFile=".\pc_win32/DLL/Release/vrpndll.pdb" - ImportLibrary=".\pc_win32\DLL\Release\vrpndll.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32/DLL/Release/vrpndll.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> -EOS -GenerateFilesSection - -cat <<EOS - <Globals> - </Globals> -</VisualStudioProject> -EOS - -} - -GenerateVrpnVCPROJ > vrpn.vcproj -dos2unix --u2d vrpn.vcproj - -GenerateVrpnDLLVCPROJ > vrpndll.vcproj -dos2unix --u2d vrpndll.vcproj -# | sed 's|^\(.*\)$|<File RelativePath="\1"></File>|' diff --git a/src/vrpn/gpsnmealib/.cvsignore b/src/vrpn/gpsnmealib/.cvsignore deleted file mode 100644 index c2859ca48d0d58a76237b469ff4fbd81a3d43c5d..0000000000000000000000000000000000000000 --- a/src/vrpn/gpsnmealib/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -Debug -*.ncb -*.suo diff --git a/src/vrpn/gpsnmealib/CMakeLists.txt b/src/vrpn/gpsnmealib/CMakeLists.txt deleted file mode 100644 index fee7b3a87160cc3dceaffde11d5e38a30ff3bda8..0000000000000000000000000000000000000000 --- a/src/vrpn/gpsnmealib/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -if(WIN32) - ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) -endif() - -set(GPSNMEALIB_PUBLIC_HEADERS - nmeaParser.h - utmCoord.h - latLonCoord.h) - -set(GPSNMEALIB_SOURCES - latLonCoord.C - nmeaParser.C - typedCoord.h - typedCoord.C - utmCoord.C) - -add_library(gpsnmea ${GPSNMEALIB_PUBLIC_HEADERS} ${GPSNMEALIB_SOURCES}) -set_property(TARGET - gpsnmea - PROPERTY - PUBLIC_HEADER - ${GPSNMEALIB_PUBLIC_HEADERS}) -set_property(TARGET gpsnmea PROPERTY FOLDER "Library") - -if(VRPN_INSTALL) - install(TARGETS - gpsnmea - ARCHIVE - DESTINATION - lib - COMPONENT - serversdk - PUBLIC_HEADER - DESTINATION - include - COMPONENT - serversdk) -endif() \ No newline at end of file diff --git a/src/vrpn/gpsnmealib/gpsnmealib.vcproj b/src/vrpn/gpsnmealib/gpsnmealib.vcproj deleted file mode 100644 index 51ffc5b577bc50a210d80a253b3f36b502cdfec1..0000000000000000000000000000000000000000 --- a/src/vrpn/gpsnmealib/gpsnmealib.vcproj +++ /dev/null @@ -1,256 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="gpsnmealib" - ProjectGUID="{D60E311B-657F-444E-9A0E-5218B37D5551}" - RootNamespace="gpsnmealib" - TargetFrameworkVersion="196613" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="4" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="../" - PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - WarningLevel="3" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="4" - CharacterSet="2" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - EnableIntrinsicFunctions="true" - AdditionalIncludeDirectories="../" - PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - WarningLevel="3" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\latLonCoord.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\nmeaParser.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\typedCoord.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\utmCoord.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\latLonCoord.h" - > - </File> - <File - RelativePath=".\nmeaParser.h" - > - </File> - <File - RelativePath=".\typedCoord.h" - > - </File> - <File - RelativePath=".\utmCoord.h" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/gpsnmealib/latLonCoord.C b/src/vrpn/gpsnmealib/latLonCoord.C deleted file mode 100644 index 65816db8f0c54ce78a030cb337c3ddcb9b999bf0..0000000000000000000000000000000000000000 --- a/src/vrpn/gpsnmealib/latLonCoord.C +++ /dev/null @@ -1,402 +0,0 @@ -// LatLonCoord.cpp: Implementation of the CLatLonCoord class. -// -// Written by Jason Bevins in 1998. File is in the public domain. -// - - -#include "gpsnmealib/typedCoord.h" // for TypedCoord -#include "latLonCoord.h" - -#ifdef sgi -#include <assert.h> -#include <math.h> -#include <stdio.h> -#else -#include <cassert> // for assert -#include <cmath> // for fabs -#include <cstdio> // for sprintf -#endif - -// Format strings for the degree-to-string conversion functions. -// Note that east/west (EW) has a different set of format strings as north/ -// south (NS), as integer degrees in east/west can have up to three digits -// instead of two. -static const char formatD_NS[] = "%c %02d.%05d*"; -static const char formatDM_NS[] = "%c %02d*%02d.%03d'"; -static const char formatDMS_NS[] = "%c %02d*%02d'%02d.%01d\x22"; -static const char formatD_EW[] = "%c %03d.%05d*"; -static const char formatDM_EW[] = "%c %03d*%02d.%03d'"; -static const char formatDMS_EW[] = "%c %03d*%02d'%02d.%01d\x22"; - - -///////////////////////////////////////////////////////////////////////////// -// LatLonCoord construction/destruction - -LatLonCoord::LatLonCoord (): TypedCoord () -{ - // Set the default output coordinate format to decimal degrees. - m_latLonFormat = FORMAT_D; -} - - -LatLonCoord::LatLonCoord (double lat, double lon) -{ - m_lat = lat; - m_lon = lon; - - // Set the default output coordinate format to decimal degrees. - m_latLonFormat = FORMAT_D; -} - - -LatLonCoord::LatLonCoord (const LatLonCoord& other) -{ - copyLatLonCoord (other); -} - - -LatLonCoord::LatLonCoord (const TypedCoord& other) -{ - m_latLonFormat = FORMAT_D; - copyOtherCoord (other); -} - - -///////////////////////////////////////////////////////////////////////////// -// LatLonCoord operators - -LatLonCoord& LatLonCoord::operator= (const LatLonCoord& other) -{ - copyLatLonCoord (other); - return *this; -} - - -LatLonCoord& LatLonCoord::operator= (const TypedCoord& other) -{ - copyOtherCoord (other); - return *this; -} - - -///////////////////////////////////////////////////////////////////////////// -// LatLonCoord members - -void LatLonCoord::copyLatLonCoord (const LatLonCoord& other) - // Purpose: - // This function copies the lat/lon coordinate of the specified object and - // assigns that coordinate to this object. -{ - m_lat = other.m_lat; - m_lon = other.m_lon; -} - - -void LatLonCoord::copyOtherCoord (const TypedCoord& other) - // Purpose: - // This function copies the coordinate of the specified object, converts - // the coordinate to the coordinate type of this object, then assigns the - // converted coordinate to this object. -{ - // Convert the right hand side coordinate to lat/lon; then store these - // lat/lon values in this coordinate. - other.getLatLonCoord (m_lat, m_lon); -} - - -const std::string& LatLonCoord::createCoordString(std::string& coordString) const - // Purpose: - // This function creates a formatted coordinate string containing this - // object's coordinate value. - // Parameters: - // std::string& coordString: - // Upon exit, this parameter will contain the generated coordinate - // string - // Returns: - // A reference to the generated coordinate string. - // Notes: - // The string can be in one of three different formats (degrees, degrees and - // decimal minutes, or degrees, minutes, and decimal seconds.) Set the - // format by calling the SetCurrentLatLonFormat() member function. -{ - std::string latString; - std::string lonString; - // Create the formatted lat/lon strings; the format is specified by the - // m_currentLatLonFormat member variable - degreeToString (latString, m_lat, HEMISPHERE_NS); - degreeToString (lonString, m_lon, HEMISPHERE_EW); - coordString = latString + ", " + lonString; - return coordString; -} - - -void LatLonCoord::createDisplayStrings (std::string& topLeftString, - std::string& topRightString, std::string& bottomLeftString, - std::string& bottomRightString) const - // Purpose: - // This function creates four strings that can be used for display; these - // strings contain coordinate data. The four strings are for the top left, - // top right, bottom left, and bottom right text of a display; each string - // is specified as follows: - // - top left: North/south hemisphere character - // - top right: Latitude - // - bottom left: East/west hemisphere character - // - bottom right: Longitude - // Notes: - // It is up to the calling function to write these strings to the display. -{ - std::string coordString; - createCoordString (coordString); - -#if 0 - // Extract the elements of the coordinate string. - switch (getLatLonFormat ()) { - case FORMAT_D: - topLeftString = coordString.Mid (LAT_D_HPPEMISPHERE_POS, - LAT_D_HPPEMISPHERE_LEN); - topRightString = coordString.Mid (LAT_D_DEGREE_POS, - LAT_D_DEGREE_LEN); - bottomLeftString = coordString.Mid (LON_D_HPPEMISPHERE_POS, - LON_D_HPPEMISPHERE_LEN); - bottomRightString = coordString.Mid (LON_D_DEGREE_POS, - LON_D_DEGREE_LEN); - break; - case FORMAT_DM: - topLeftString = coordString.Mid (LAT_DM_HPPEMISPHERE_POS, - LAT_DM_HPPEMISPHERE_LEN); - topRightString = coordString.Mid (LAT_DM_DEGREE_POS, - LAT_DM_DEGREE_LEN); - bottomLeftString = coordString.Mid (LON_DM_HPPEMISPHERE_POS, - LON_DM_HPPEMISPHERE_LEN); - bottomRightString = coordString.Mid (LON_DM_DEGREE_POS, - LON_DM_DEGREE_LEN); - break; - case FORMAT_DMS: - topLeftString = coordString.Mid (LAT_DMS_HPPEMISPHERE_POS, - LAT_DMS_HPPEMISPHERE_LEN); - topRightString = coordString.Mid (LAT_DMS_DEGREE_POS, - LAT_DMS_DEGREE_LEN); - bottomLeftString = coordString.Mid (LON_DMS_HPPEMISPHERE_POS, - LON_DMS_HPPEMISPHERE_LEN); - bottomRightString = coordString.Mid (LON_DMS_DEGREE_POS, - LON_DMS_DEGREE_LEN); - break; - default: - ASSERT (FALSE); - } -#endif -} - - -void LatLonCoord::createXYCoordStrings (std::string& xString, std::string& yString) - const - // Purpose: - // This function generates two strings: a string containing the longitude - // (stored in the parameter xString), and a string containing the latitude - // (stored in the parameter yString.) - // Notes: - // The string can be in one of three different formats (degrees, degrees and - // decimal minutes, or degrees, minutes, and decimal seconds); Set the - // format by calling the SetCurrentLatLonFormat() member function. -{ - degreeToString (xString, m_lon, HEMISPHERE_EW); - degreeToString (yString, m_lat, HEMISPHERE_NS); -} - - -const std::string& LatLonCoord::degreeToD (std::string& output, double degree, - HEMISPHERE_DIRECTION direction) const - // Purpose: - // This function converts a value specified in decimal degrees to a string - // formatted as H DDD.DDDDD*. - // Pre: - // -180.0 <= degree <= 180.0 - // Parameters: - // std::string& output: - // Upon exit, this parameter contains the converted string. - // double degree: - // The degree value to convert. - // HEMISPHERE_DIRECTION direction: - // The direction of the hemisphere, either north/south or east/west. - // This value determines the hemisphere character in the converted - // string. - // Returns: - // The converted string. -{ - char hemisphereChar = getHemisphereChar (degree, direction); - double positiveDegrees = fabs (degree); - - // A "unit" is measured in 1/100000ths of a degree; this is the smallest - // possible unit when coordinates are expressed as DDD.DDDDD. - // (Calculating the degree and the 1/100000th degree parts as integers - // avoid rounding errors in the final result.) - int units = (int)((positiveDegrees * 100000.0) + 0.5); - int intDegrees = units / 100000; - int int100ThousandthDegrees = units % 100000; - - const char* pFormatString; - char tempString[1000]; - if (direction == HEMISPHERE_NS) { - pFormatString = formatD_NS; - } else { - pFormatString = formatD_EW; - } - sprintf(tempString, pFormatString, hemisphereChar, intDegrees, - int100ThousandthDegrees); - output = tempString; - return output; -} - - -const std::string& LatLonCoord::degreeToDM (std::string& output, double degree, - HEMISPHERE_DIRECTION direction) const - // Purpose: - // Same as DegreeToD, except the string is formatted as H DDD*MM.MMM'. - // Pre: - // -180.0 <= degree <= 180.0 -{ - char hemisphereChar = getHemisphereChar (degree, direction); - double positiveDegrees = fabs (degree); - - // A "unit" is measured in 1/1000ths of a minute (or 1/60000 of a degree); - // this is the smallest possible unit when coordinates are expressed as - // DDD MM.MMM. (Calculating the degree, minute, and the 1/1000th minute - // parts as integers avoid rounding errors in the final result.) - int units = (int)((positiveDegrees * 60000.0) + 0.5); - int intDegrees = units / 60000; - int intDegreesInUnits = intDegrees * 60000; - int intMinutes = (units - intDegreesInUnits) / 1000; - int intThousandthMinutes = (units - intDegreesInUnits) % 1000; - - const char* pFormatString; - char tempString[1000]; - if (direction == HEMISPHERE_NS) { - pFormatString = formatDM_NS; - } else { - pFormatString = formatDM_EW; - } - sprintf(tempString, pFormatString, hemisphereChar, - intDegrees, intMinutes, intThousandthMinutes); - output = tempString; - return output; -} - - -const std::string& LatLonCoord::degreeToDMS (std::string& output, double degree, - HEMISPHERE_DIRECTION direction) const - // Purpose: - // Same as DegreeToD, except the string is formatted as H DDD*MM'SS.S". - // Pre: - // -180.0 <= degree <= 180.0 -{ - char hemisphereChar = getHemisphereChar (degree, direction); - double positiveDegrees = fabs (degree); - - // A "unit" is measured in 1/10ths of a second (or 1/36000 of a degree); - // this is the smallest possible unit when coordinates are expressed as - // DDD MM SS.S. (Calculating the degree, minute, second, and the 1/10th - // second parts as integers will avoid rounding errors in the final - // result.) - int units = (int)((positiveDegrees * 36000.0) + 0.5); - int intDegrees = units / 36000; - int intDegreesInUnits = intDegrees * 36000; - int intMinutes = (units - intDegreesInUnits) / 600; - int intMinutesInUnits = intMinutes * 600; - int intSeconds = (units - intDegreesInUnits - intMinutesInUnits) / 10; - int intTenthSeconds = (units - intDegreesInUnits - intMinutesInUnits) % 10; - - - const char* pFormatString; - char tempString[1000]; - if (direction == HEMISPHERE_NS) { - pFormatString = formatDMS_NS; - } else { - pFormatString = formatDMS_EW; - } - sprintf(tempString, pFormatString, hemisphereChar, - intDegrees, intMinutes, intSeconds, intTenthSeconds); - output = tempString; - return output; -} - - -const std::string& LatLonCoord::degreeToString (std::string& output, double degree, - HEMISPHERE_DIRECTION direction) const - // Purpose: - // This function converts a value specified in decimal degrees to a formatted - // string. - // Pre: - // -180.0 <= degree <= 180.0 - // Parameters: - // std::string& output: - // Upon exit, this parameter contains the converted string. - // double degree: - // The degree value to convert. - // HEMISPHERE_DIRECTION direction: - // The direction of the hemisphere, either north/south or east/west. - // This value determines the hemisphere character in the converted - // string. - // Returns: - // The converted string. - // Notes: - // If formatType is FORMAT_D, the returned string format is H DDD.DDDDD*. - // If formatType is FORMAT_DM, the returned string format is H DDD*MM.MMM'. - // If formatType is FORMAT_DMS, the returned string format is H DDD*MM'SS.S". -{ - switch (m_latLonFormat) { - case FORMAT_DMS: - return degreeToDMS (output, degree, direction); - break; - case FORMAT_DM: - return degreeToDM (output, degree, direction); - break; - case FORMAT_D: - return degreeToD (output, degree, direction); - break; - default: - assert(false); - return output; // needed to stop compiler warning. - } -} - - -void LatLonCoord::getXYCoord (double& x, double& y) const - // Purpose: - // This function returns the (x, y) coordinate stored within this object. - // In this class, the x coordinate is the longitude and the y coordinate is - // the latitude. -{ - x = m_lon; - y = m_lat; -} - - -char LatLonCoord::getHemisphereChar (double degree, - HEMISPHERE_DIRECTION direction) const - // Purpose: - // This function determine the appropriate hemisphere character ('N', 'S', - // 'E', 'W') given the degree value and the hemisphere direction (north/south - // or east/west). - // Returns: - // 'N' if direction is HEMISPHERE_NS and degree is positive. - // 'S' if direction is HEMISPHERE_NS and degree is negative. - // 'E' if direction is HEMISPHERE_EW and degree is positive. - // 'W' if direction is HEMISPHERE_EW and degree is negative. -{ - if (direction == HEMISPHERE_NS) { - if (degree >= 0.0) { - return 'N'; - } else { - return 'S'; - } - } else { - if (degree >= 0.0) { - return 'E'; - } else { - return 'W'; - } - } -} - - - diff --git a/src/vrpn/gpsnmealib/latLonCoord.h b/src/vrpn/gpsnmealib/latLonCoord.h deleted file mode 100644 index 2f64bf7038b25bcf9d1beec8940d120890e57ffb..0000000000000000000000000000000000000000 --- a/src/vrpn/gpsnmealib/latLonCoord.h +++ /dev/null @@ -1,117 +0,0 @@ -// LatLonCoord.h: Definition of the CLatLonCoord class. -// -// The CLatLonCoord class, derived from the CTypedCoord class, represents a -// lat/lon coordinate. Since this class contains an internal lat/lon -// coordinate from CTypedCoord, no conversion functions are necessary. -// -// The formatted coordinate string generated by the CreateCoordString() member -// function can be in one of the three following formats: -// - Degrees (H DD.DDDDD*, H DDD.DDDDD*); this is the default. -// - Degrees, and decimal minutes (H DD*MM.MMM'. H DDD* MM.MMM') -// - Degrees, minutes, and decimal seconds (H DD*MM'SS.S", H DDD*MM'SS.S") -// -// The coordinate string format is set by calling the SetCurrentLatLonFormat() -// member function. -// -// Written by Jason Bevins in 1998. File is in the public domain. -// - -#ifndef __LAT_LON_CPPOORD_HPP -#define __LAT_LON_CPPOORD_HPP - -#include <string> // for string - -#include "typedCoord.h" // for COORD_TYPE, etc - -enum HEMISPHERE_DIRECTION -{ - HEMISPHERE_NS = 0, - HEMISPHERE_EW = 1 -}; - -enum COORD_LATLON_FORMAT -{ - FORMAT_D = 0, - FORMAT_DM = 1, - FORMAT_DMS = 2 -}; - -// These constants are used by the CreateDisplayStrings() and the -// CreateXYCoordStrings() functions to parse the string generated by the -// CreateCoordString() function. Modify these constants when you modify the -// code that generates the string. These constants do not affect the code -// that generate these strings, but you may write parsing functions that -// require the positions of the individual elements in the strings. - -const int LAT_D_HPPEMISPHERE_POS = 0; -const int LAT_D_HPPEMISPHERE_LEN = 1; -const int LON_D_HPPEMISPHERE_POS = 13; -const int LON_D_HPPEMISPHERE_LEN = 1; -const int LAT_D_DEGREE_POS = 2; -const int LAT_D_DEGREE_LEN = 9; -const int LON_D_DEGREE_POS = 15; -const int LON_D_DEGREE_LEN = 10; - -const int LAT_DM_HPPEMISPHERE_POS = 0; -const int LAT_DM_HPPEMISPHERE_LEN = 1; -const int LON_DM_HPPEMISPHERE_POS = 14; -const int LON_DM_HPPEMISPHERE_LEN = 1; -const int LAT_DM_DEGREE_POS = 2; -const int LAT_DM_DEGREE_LEN = 10; -const int LON_DM_DEGREE_POS = 16; -const int LON_DM_DEGREE_LEN = 11; - -const int LAT_DMS_HPPEMISPHERE_POS = 0; -const int LAT_DMS_HPPEMISPHERE_LEN = 1; -const int LON_DMS_HPPEMISPHERE_POS = 15; -const int LON_DMS_HPPEMISPHERE_LEN = 1; -const int LAT_DMS_DEGREE_POS = 2; -const int LAT_DMS_DEGREE_LEN = 11; -const int LON_DMS_DEGREE_POS = 17; -const int LON_DMS_DEGREE_LEN = 12; - -const char DEGREE_CHAR = '*'; - - -class LatLonCoord: public TypedCoord -{ -public: - LatLonCoord (); - LatLonCoord (double lat, double lon); - LatLonCoord (const TypedCoord& other); - LatLonCoord (const LatLonCoord& other); - LatLonCoord& operator= (const LatLonCoord& other); - LatLonCoord& operator= (const TypedCoord& other); - void copyLatLonCoord (const LatLonCoord& other); - void copyOtherCoord (const TypedCoord& other); - virtual const std::string& createCoordString (std::string& coordString) const; - virtual void createDisplayStrings (std::string& topLeftString, - std::string& topRightString, std::string& bottomLeftString, - std::string& bottomRightString) const; - virtual void createXYCoordStrings (std::string& xString, std::string& yString) - const; - virtual COORD_TYPE getCoordType () const {return COORD_LATLON;} - COORD_LATLON_FORMAT getLatLonFormat () const - {return m_latLonFormat;} - virtual void getXYCoord (double& x, double& y) const; - void setLatLonFormat (COORD_LATLON_FORMAT latLonFormat) - {m_latLonFormat = latLonFormat;} - -protected: - // Conversion functions for each of the three lat/lon formats. - const std::string& degreeToD (std::string& output, double degree, - HEMISPHERE_DIRECTION direction) const; - const std::string& degreeToDM (std::string& output, double degree, - HEMISPHERE_DIRECTION direction) const; - const std::string& degreeToDMS (std::string& output, double degree, - HEMISPHERE_DIRECTION direction) const; - const std::string& degreeToString (std::string& output, double degree, - HEMISPHERE_DIRECTION formatType) const; - char getHemisphereChar (double degree, HEMISPHERE_DIRECTION direction) - const; - - // Current lat/lon format in one of three format types. - COORD_LATLON_FORMAT m_latLonFormat; -}; - -#endif diff --git a/src/vrpn/gpsnmealib/nmeaParser.C b/src/vrpn/gpsnmealib/nmeaParser.C deleted file mode 100644 index 1b5a59b00fbc5f8e9aa4f4b4d7d5807debaffc14..0000000000000000000000000000000000000000 --- a/src/vrpn/gpsnmealib/nmeaParser.C +++ /dev/null @@ -1,1421 +0,0 @@ -// NmeaParser.cpp: Implementation of the NMEA-0183 2.0 parser class. -// -// Written by Jason Bevins in 1998. File is in the public domain. -// - -#ifdef sgi -#include <stdlib.h> -#include <string.h> -#else -#include <cstdlib> // for atof, atoi, atol -#endif -#include "nmeaParser.h" - -// This constant define the length of the date string in a sentence. -const int DATE_LEN = 6; - -///////////////////////////////////////////////////////////////////////////// -// NMEAData construction/destruction - -NMEAData::NMEAData () -{ - // The constructor for the NMEAData object clears all data and resets the - // times of last acquisition to 0. - reset (); - - // No coordinate has ever been valid since this object was created. - hasCoordEverBeenValid = false; -} - - -///////////////////////////////////////////////////////////////////////////// -// NMEAData methods - -void NMEAData::reset() - // Purpose: - // This function resets all the data in this object to its defaults. -{ - // Reset the data. - lat = 0.0; - lon = 0.0; - altitude = 0.0; - speed = 0.0; - UTCYear = 94; - UTCMonth = 6; - UTCDay = 1; - UTCHour = 0; - UTCMinute = 0; - UTCSecond = 0; - track = 0.0; - magVariation = 0.0; - hdop = 1.0; - eStd = 1.0; - nStd = 1.0; - numSats = 0; - - // All data stored by this object is currently invalid. - isValidLat = false; - isValidLon = false; - isValidAltitude = false; - isValidSpeed = false; - isValidDate = false; - isValidTime = false; - isValidTrack = false; - isValidMagVariation = false; - isValidHdop = false; - isValidNStd = false; - isValidEStd = false; - isValidZStd = false; - isValidHStd = false; - isValidSatData = false; - isValidRangeResidualData = false; - isValidFixQuality = false; - - // Last fix was invalid. - lastFixQuality = FIX_AUTONOMOUS; - - // Still waiting for the frame to start... - waitingForStart = true; - - // Clear what messages have been seen - seenZDA = false; - seenGGA = false; - seenGLL = false; - seenRMC = false; - seenGSV = false; - seenGST = false; - seenVTG = false; - seenRRE = false; -} - -///////////////////////////////////////////////////////////////////////////// -// NMEAParser construction/destruction - -NMEAParser::NMEAParser () //sj: log4cpp::Category& l) : logger(l) -{ - m_data = new NMEAData(); - // by default, we'll look for "RMC" message to signify a new sequence of messages - strcpy(startSentence, "RMC"); - - // Defaults for the GSV sentence parser. - m_lastSentenceNumber = 1; - m_numSentences = 1; - m_numSatsExpected = 0; - m_numSatsLeft = 0; - m_satArrayPos = 0; -} - -NMEAParser::NMEAParser (NMEAData* data)//sj: log4cpp::Category& l, NMEAData* data) : logger(l) -{ - m_data = data; - // Defaults for the GSV sentence parser. - m_lastSentenceNumber = 1; - m_numSentences = 1; - m_numSatsExpected = 0; - m_numSatsLeft = 0; - m_satArrayPos = 0; -} - -NMEAParser::~NMEAParser () -{ - delete m_data; - m_data = 0; -} - -void NMEAParser::parseZDA(const char* sentence) -{ - m_data->seenZDA=true; - char field[255]; - uint_ currentPos = 0; - bool isMore = true; // More strings to parse? - - // Skip past the '$xxZDA' - if ((isMore = getNextField (field, sentence, currentPos)) == false) - { - return; - } - // UTC time. - isMore = getNextField (field, sentence, currentPos); - parseAndValidateTime (field); -} - -void NMEAParser::parseGGA (const char* sentence) - // Purpose: - // This function parses a GGA sentence; all data will be stored in the - // NMEAData object within this class. This function will correctly parse - // a partial GGA sentence. - // Pre: - // The string to parse must be a valid GGA sentence. -{ - m_data->seenGGA=true; - char field[255]; - char hemisphereField[32]; - char hemisphereChar; - char unitField[32]; - char unitChar; - uint_ currentPos = 0; - bool isMore = true; // More strings to parse? - - // Skip past the '$xxGGA' - if ((isMore = getNextField (field, sentence, currentPos)) == false) - { - return; - } - - // UTC time. - isMore = getNextField (field, sentence, currentPos); - parseAndValidateTime (field); - if (isMore == false) return; - - // Latitude. - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - isMore = getNextField (hemisphereField, sentence, currentPos); - if (strlen (hemisphereField) != 0) { - hemisphereChar = hemisphereField[0]; - } else { - hemisphereChar = ' '; - } - parseAndValidateLat (field, hemisphereChar); - if (isMore == false) return; - - // Longitude. - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - isMore = getNextField (hemisphereField, sentence, currentPos); - if (strlen (hemisphereField) != 0) { - hemisphereChar = hemisphereField[0]; - } else { - hemisphereChar = ' '; - } - parseAndValidateLon (field, hemisphereChar); - if (isMore == false) return; - - // Quality of GPS fix. - isMore = getNextField (field, sentence, currentPos); - parseAndValidateFixQuality (field); - if (isMore == false) return; - - // Skip number of sats tracked for now. - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - - // Horizontal dilution of precision (HDOP). - isMore = getNextField (field, sentence, currentPos); - parseAndValidateHdop (field); - if (isMore == false) return; - - // Altitude. - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - isMore = getNextField (unitField, sentence, currentPos); - if (strlen (unitField) != 0) { - unitChar = unitField[0]; - } else { - unitChar = ' '; - } - parseAndValidateAltitude (field, unitChar); - if (isMore == false) return; - - // Everything else (geoid height and DGPS info) is ignored for now. - return; -} - -void NMEAParser::parseGLL (const char* sentence) - // Purpose: - // This function parses a GLL sentence; all data will be stored in the - // NMEAData object within this class. This function will correctly parse - // a partial GLL sentence. - // Pre: - // The string to parse must be a valid GLL sentence. -{ - m_data->seenGLL=true; - char field[255]; - char hemisphereField[32]; - char hemisphereChar; - uint_ currentPos = 0; - bool isMore = true; // More strings to parse? - - // Count commas in this sentence to see if it's valid. - if (countChars (sentence, ',', SENTENCE_GLL_COMMAS) < 0) return; - - // Skip past the '$xxGLL' - if ((isMore = getNextField (field, sentence, currentPos)) == false) { - return; - } - - // Latitude - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - isMore = getNextField (hemisphereField, sentence, currentPos); - if (strlen (hemisphereField) != 0) { - hemisphereChar = hemisphereField[0]; - } else { - hemisphereChar = ' '; - } - parseAndValidateLat (field, hemisphereChar); - if (isMore == false) return; - - // Longitude - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - isMore = getNextField (hemisphereField, sentence, currentPos); - if (strlen (hemisphereField) != 0) { - hemisphereChar = hemisphereField[0]; - } else { - hemisphereChar = ' '; - } - parseAndValidateLon (field, hemisphereChar); - if (isMore == false) return; - - // UTC time - isMore = getNextField (field, sentence, currentPos); - parseAndValidateTime (field); - if (isMore == false) return; -} - - -void NMEAParser::parseGSV (const char* sentence) - // Purpose: - // This function parses a GSV sentence; all data will be stored in the - // NMEAData object within this class. This function will correctly parse - // a partial GSV sentence. - // Pre: - // The string to parse must be a valid GSV sentence. - // Notes: - // All GSV sentences from a single packet (a collection of NMEA sentences - // sent from the GPS) must be processed before satellite information in the - // NMEAData object is updated. There is data for only four satellites - // in each GSV sentence, so multiple sentences must be processed. For - // example, if your GPS was tracking eight satellites, two GSV sentences is - // sent from your GPS in each packet; both sentences must be parsed before - // the NMEAData object is updated with the satellite information. -{ - m_data->seenGSV=true; - char field[255]; - uint_ numSats; - int numSentences; - int sentenceNumber; - uint_ currentPos = 0; - bool isMore = true; // More strings to parse? - - // Count commas in this sentence to see if it's valid. - if (countChars (sentence, ',', SENTENCE_GSV_COMMAS) < 0) return; - - // Skip past the '$xxGSV' - if ((isMore = getNextField (field, sentence, currentPos)) == false) { - return; - } - - // Determine the number of sentences that will make up the satellite data. - isMore = getNextField (field, sentence, currentPos); - numSentences = atoi (field); - if (isMore == false) return; - - // Which sentence is this?. - isMore = getNextField (field, sentence, currentPos); - sentenceNumber = atoi (field); - if (isMore == false) return; - - // How many satellites are in total? - isMore = getNextField (field, sentence, currentPos); - numSats = atoi (field); - if (isMore == false) return; - - // Is this the first sentence? If so, reset the satellite information. - if (sentenceNumber == 1) { - m_lastSentenceNumber = 1; - m_numSentences = numSentences; - m_numSatsExpected = numSats; - m_numSatsLeft = numSats; - m_satArrayPos = 0; - } else { - // Make sure the satellite strings are being sent in order. If not, - // then you're screwed. - if (sentenceNumber != m_lastSentenceNumber + 1) return; - - // BUGFIX: - // Added by Clarke Brunt 20001112 - m_lastSentenceNumber = sentenceNumber; - } - - // parse the satellite string. There are four satellite info fields per - // sentence. - int i; - - for (i = 0; i < 4; i++) { - getNextField (field, sentence, currentPos); - if (strlen (field) != 0) { - m_tempSatData[m_satArrayPos].prn = atoi (field); - getNextField (field, sentence, currentPos); - if (strlen (field) != 0) { - m_tempSatData[m_satArrayPos].elevation = atoi (field); - } - getNextField (field, sentence, currentPos); - if (strlen (field) != 0) { - m_tempSatData[m_satArrayPos].azimuth = atoi (field); - } - getNextField (field, sentence, currentPos); - if (strlen (field) != 0) { - m_tempSatData[m_satArrayPos].strength = atoi (field); - } - --m_numSatsLeft; - ++m_satArrayPos; - } else { - // Jump past the next three fields. - for (int j = 0; j < 3; j++) - getNextField (field, sentence, currentPos); - } - } - - // If all the satellite information has been received, then update the - // NMEAData object with the new satellite data. - if (m_numSatsLeft == 0) { - for (i = 0; i < m_numSatsExpected; i++) { - m_data->satData[i] = m_tempSatData[i]; - } - m_data->numSats = m_numSatsExpected; - m_data->isValidSatData = true; - } -} - -void NMEAParser::parseRRE (const char* sentence) -{ - m_data->seenRRE=true; - bool isMore; - char field[255]; - uint_ currentPos = 0; - // Skip past the '$xxRMC' - if ((isMore = getNextField (field, sentence, currentPos)) == false) - { - return; - } - isMore = getNextField (field, sentence, currentPos); - // I assume the RRE numSats is the same as the RRE numSats! - m_data->numSats = atoi(field); - - // Skip the intermediate stuff - for (uint_ i = 0; i < m_data->numSats; i++) - { - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) - { - //sj: logger.error("only read %d out of %d entries", m_data->numSats, i); - return; - } - m_data->rrData[i].prn = atoi(field); - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) - { - //sj: logger.error("only read %d out of %d entries", m_data->numSats, i); - return; - } - m_data->rrData[i].residual = atof(field); - } - m_data->isValidRangeResidualData = true; - - // Now read the horizontal - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) - { - // sj: logger.error("no fields left to read hStd"); - return; - } - m_data->hStd = atof(field); - m_data->isValidHStd = true; - - // Now read the vertical - isMore = getNextField (field, sentence, currentPos); - - m_data->zStd = atof(field); - m_data->isValidZStd = true; - //sj: logger.debug("isValidRangeResidualData=%d", - //sj: m_data->isValidRangeResidualData); - //sj: logger.debug("isValidHStd=%d", m_data->isValidHStd); - //sj: logger.debug("isValidZStd=%d", m_data->isValidZStd); -} - - -void NMEAParser::parseRMC (const char* sentence) - // Purpose: - // This function parses an RMC sentence; all data will be stored in the - // NMEAData object within this class. This function will correctly parse - // a partial RMC sentence. - // Pre: - // The string to parse must be a valid RMC sentence. -{ - m_data->seenRMC=true; - char field[255]; - char hemisphereField[32]; - char hemisphereChar; - char directionField[32]; - char directionChar; - uint_ currentPos = 0; - bool isMore = true; // More strings to parse? - - // Count commas in this sentence to see if it's valid. - if (countChars (sentence, ',', SENTENCE_RMC_COMMAS) < 0) return; - - // Skip past the '$xxRMC' - if ((isMore = getNextField (field, sentence, currentPos)) == false) { - return; - } - - // UTC time - isMore = getNextField (field, sentence, currentPos); - parseAndValidateTime (field); - if (isMore == false) return; - - // Skip past the navigation warning indicator for now. - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - - // Latitude - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - isMore = getNextField (hemisphereField, sentence, currentPos); - if (strlen (hemisphereField) != 0) { - hemisphereChar = hemisphereField[0]; - } else { - hemisphereChar = ' '; - } - parseAndValidateLat (field, hemisphereChar); - if (isMore == false) return; - - // Longitude - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - isMore = getNextField (hemisphereField, sentence, currentPos); - if (strlen (hemisphereField) != 0) { - hemisphereChar = hemisphereField[0]; - } else { - hemisphereChar = ' '; - } - parseAndValidateLon (field, hemisphereChar); - if (isMore == false) return; - - // Current speed, in knots. - isMore = getNextField (field, sentence, currentPos); - parseAndValidateSpeed (field); - if (isMore == false) return; - - // Current track, in degrees. - isMore = getNextField (field, sentence, currentPos); - parseAndValidateTrack (field); - if (isMore == false) return; - - // Current date - isMore = getNextField (field, sentence, currentPos); - parseAndValidateDate (field); - if (isMore == false) return; - - // Magnetic variation (degrees from true north) - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - isMore = getNextField (directionField, sentence, currentPos); - if (strlen (directionField) != 0) { - directionChar = directionField[0]; - } else { - directionChar = ' '; - } - parseAndValidateMagVariation (field, directionChar); - if (isMore == false) return; -} - -void NMEAParser::parseGST (const char* sentence) -{ - m_data->seenGST=true; - char field[255]; - uint_ currentPos = 0; - - bool isMore = true; // More strings to parse? - - // Count commas in this sentence to see if it's valid. - if (countChars (sentence, ',', SENTENCE_GST_COMMAS) < 0) return; - - // Skip past '$GPGST' - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - - // Get the UTC time - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - parseAndValidateTime(field); - - // This field is the RMS value of the standard deviations to the range inputs - // to the navigation process - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - - // Skip unimplemented fields - currentPos += 3; - - // Standard deviation of latitude - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - - // Parse the north standard deviation - parseAndValidateNStd(field); - - // Standard deviation of longitude - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - - parseAndValidateEStd(field); - - // Standard deviation of altitude - isMore = getNextField (field, sentence, currentPos); - - parseAndValidateZStd(field); -} - -void NMEAParser::parseVTG (const char* sentence) -{ - m_data->seenVTG=true; - - char field[255]; - char reference[256]; - uint_ currentPos = 0; - - bool isMore = true; // More strings to parse? - - // Count commas in this sentence to see if it's valid. - if (countChars (sentence, ',', SENTENCE_VTG_COMMAS) < 0) return; - - // Skip past '$GPVTG' - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - - // Get the COG wrt to true north - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - - // Get the reference - isMore = getNextField (reference, sentence, currentPos); - if (isMore == false) return; - - // Reference should be a 'T' to denote true north - if (reference[0] != 'T') - { - // sj: logger.warn("parseVTG: the reference should be T but it's ", - // sj: reference); - return; - } - - // Get the track - parseAndValidateTrack(field); - - - // Get the COG wrt to magnetic north - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - - // Get the reference - isMore = getNextField (reference, sentence, currentPos); - if (isMore == false) return; - - // Reference should be a 'M' to denote wrt magnetic north - if (reference[0] != 'M') - { - // sj: logger.warn("parseVTG: the reference should be M but it's ", - // sj: reference); - return; - } - - // Speed, should be in miles per hour - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - - // Get the reference - isMore = getNextField (reference, sentence, currentPos); - if (isMore == false) return; - - // Reference should be a 'N' to denote knots per hour - if (reference[0] != 'N') - { - // sj: logger.warn("parseVTG: the reference should be N but it's ", - // sj: reference); - return; - } - - // Speed, should be in kilometres per hour - isMore = getNextField (field, sentence, currentPos); - if (isMore == false) return; - - // Get the reference - isMore = getNextField (reference, sentence, currentPos); - - // Reference should be a 'K' to denote kilometers per hour - if (reference[0] != 'K') - { - // sj: logger.warn("parseVTG: the reference should be K but it's ", - // sj: reference); - return; - } - parseAndValidateSpeed(field); -} - -SENTENCE_STATUS NMEAParser::parseSentence (const char* sentence) - // Purpose: - // This function parses a given NMEA sentence. All valid information will be - // stored within the NMEAData object in this class; call the GetData() - // member function to retrieve the data. - // Parameters: - // const char* sentence: - // The sentence to parse. - // Returns: - // SENTENCE_VALID if the sentence passed is a valid NMEA sentence. - // SENTENCE_INVALID if the sentence passed is not a valid NMEA sentence, or - // the sentence type is unsupported (see NMEAParser.h for a list of - // supported sentences.) - // SENTENCE_BAD_CHECKSUM if the sentence has an invalid checksum. -{ -#if 0 // sj - if (logger.isDebugEnabled()) - { - logger.debug("parsing sentence %s", sentence); - } -#endif - - if (isCorrectChecksum (sentence) == false) - { - // sj: logger.debug("SENTENCE_BAD_CHECKSUM"); - return SENTENCE_BAD_CHECKSUM; - } - - if (isKnownSentenceType (sentence) == false) - { - // sj: logger.debug("SENTENCE_UNKNOWN"); - return SENTENCE_UNKNOWN; - } - return parseValidSentence(sentence); -} - -SENTENCE_STATUS NMEAParser::parseValidSentence (const char* sentence) -{ -#if 0 // sj - if (logger.isDebugEnabled()) - { - logger.debug("NMEAParser: parsing %s", sentence); - } -#endif - - // Start the parsing 3 spaces past start to get past the initial - // '$xx', where xx is the device type sending the sentences (GP = - // GPS, etc.) - uint_ currentPos = 3; - char sentenceType[4]; - - - if (getNextField (sentenceType, sentence, currentPos) == false) - { - return SENTENCE_INVALID; - } - - if (strcmp (sentenceType, startSentence) == 0) - { - // this message is the first in the sequence - m_data->waitingForStart = false; - } - - // If we are waiting for the start message to appear, don't bother - // processing any other message type - if (m_data->waitingForStart == true) - { - return SENTENCE_VALID; - } - - // Parse the sentence. Make sure the sentence has the correct - // number of commas in it, otherwise the sentence is invalid. - if (strcmp (sentenceType, "GGA") == 0) - { - if (countChars (sentence, ',', SENTENCE_GGA_COMMAS) < 0) - { - return SENTENCE_INVALID; - } - parseGGA (sentence); - } - else if (strcmp (sentenceType, "GLL") == 0) - { - if (countChars (sentence, ',', SENTENCE_GLL_COMMAS) < 0) - { - return SENTENCE_INVALID; - } - parseGLL (sentence); - } - else if (strcmp (sentenceType, "RMC") == 0) - { - if (countChars (sentence, ',', SENTENCE_RMC_COMMAS) < 0) - { - return SENTENCE_INVALID; - } - parseRMC (sentence); - } - else if (strcmp (sentenceType, "GSV") == 0) - { - if (countChars (sentence, ',', SENTENCE_GSV_COMMAS) < 0) - { - return SENTENCE_INVALID; - } - parseGSV (sentence); - } - else if (strcmp (sentenceType, "RRE") == 0) - { - // if (countChars (sentence, ',', SENTENCE_RRE_COMMAS) < 0) - //{ - // return SENTENCE_INVALID; - //} - parseRRE (sentence); - } - else if (strcmp (sentenceType, "VTG") == 0) - { - if (countChars (sentence, ',', SENTENCE_VTG_COMMAS) < 0) - { - return SENTENCE_INVALID; - } - parseVTG (sentence); - } - else if (strcmp (sentenceType, "GST") == 0) - { - if (countChars (sentence, ',', SENTENCE_GST_COMMAS) < 0) - { - return SENTENCE_INVALID; - } - parseGST (sentence); - } - else if (strcmp (sentenceType, "ZDA") == 0) - { - if (countChars (sentence, ',', SENTENCE_ZDA_COMMAS) < 0) - { - return SENTENCE_INVALID; - } - parseZDA (sentence); - } - else - { - return SENTENCE_INVALID; - } - return SENTENCE_VALID; -} - - -///////////////////////////////////////////////////////////////////////////// -// Member functions for individual element parsing of sentences. - -bool NMEAParser::parseDate (int& year, int& month, int& day, - const char* dateString) const - // Purpose: - // This function parses a date string from an NMEA sentence in DDMMYY format - // and returns the year, month, and day values. - // Parameters: - // int& year, int& month, int& year: - // Upon exit, these variables will contain the year, month, and day - // values specified in dateString, respectively. - // const char* dateString: - // The NMEA date string to parse. - // Returns: - // true if the date string is in a valid format, false if not. - // Notes: - // - NMEA sentences are *not* "Year 2000-compliant"{tm}; the software must - // correctly determine the year's century. - // - If this function returns false, then the variables year, month, and day - // are unaffected. -{ - // Date must be six characters. - if (strlen (dateString) < unsigned (DATE_LEN)) - { - return false; - } - - long tempDate = atol (dateString); - int tempYear, tempMonth, tempDay; - tempYear = tempDate - ((tempDate / 100) * 100); - tempMonth = (tempDate - ((tempDate / 10000) * 10000)) / 100; - tempDay = tempDate / 10000; - // Check to see if the date is valid. (This function will accept - // Feb 31 as a valid date; no check is made for how many days are in - // each month of our whacked calendar.) - if ((tempYear >= 0 && tempYear <= 99) - && (tempMonth >= 1 && tempMonth <= 12) - && (tempDay >= 1 && tempDay <= 31)) - { - year = tempYear; - month = tempMonth; - day = tempDay; - return true; - } - return false; -} - - -bool NMEAParser::parseDegrees (double& degrees, const char* degString) const - // Purpose: - // This function converts a lat/lon string returned from an NMEA string into - // a numeric representation of that string, in degrees. (A lat/lon string - // must be in the format DDMM.M(...) where D = degrees and M = minutes.) - // Pre: - // The string degString must contain a number in the format DDMM.M(...). - // Parameters: - // double& degrees: - // Upon exit, degrees will contain the numeric representation of the - // string passed to this function, in decimal degrees. - // const char* degString: - // Contains the string to convert. - // Returns: - // - true if the conversion was successful. If false is returned, either - // degString was not in one of those required formats, or the string data - // itself is invalid. (For example, the string 23809.666 would not be - // valid, as the 238th degree does not exist.) - // - If this function returns false, then the parameter 'degrees' is - // unaffected. -{ - if (strlen (degString) == 0) - { - return false; - } - - double tempPosition = atof (degString); - double tempDegrees = (double)((int)(tempPosition / 100.0)); - double tempMinutes = (tempPosition - (tempDegrees * 100.0)); - tempPosition = tempDegrees + (tempMinutes / 60.0); - - if (tempPosition >= 0.0 && tempPosition <= 180.0) - { - degrees = tempPosition; - return true; - } - return false; -} - - -bool NMEAParser::parseTime (int& hour, int& minute, int& second, - const char* timeString) const - // Purpose: - // This function parses a time string from an NMEA sentence in HHMMSS.S(...) - // format and returns the hour, minute, and second values. - // Parameters: - // int& hour, int& minute, int& second: - // Upon exit, these variables will contain the hour, minute, and second - // values specified in timeString, respectively. - // const char* timeString: - // The NMEA time string to parse. - // Returns: - // true if the time string is in a valid format, false if not. - // Notes: - // - Decimal second values are truncated. - // - If this function returns false, then the variables hour, minute, and - // second are unaffected. -{ - if (strlen (timeString) == 0) - { - return false; - } - - long tempTime = atol (timeString); - int tempHour = tempTime / 10000; - int tempMinute = (tempTime - ((tempTime / 10000) * 10000)) / 100; - int tempSecond = tempTime - ((tempTime / 100) * 100); - // Check to see if the time is valid. - if ((tempHour >= 0 && tempHour <= 23) - && (tempMinute >= 0 && tempMinute <= 59) - && (tempSecond >= 0 && tempSecond <= 61)) - { // leap seconds - hour = tempHour; - minute = tempMinute; - second = tempSecond; - return true; - } - return false; -} - - -///////////////////////////////////////////////////////////////////////////// -// parse And Validate member functions for NMEAParser. -// -// Each of these member functions parse a specified field from a sentence and -// updates the appropriate member variables in the NMEAData object. If the -// data parsed is valid, the validation member variable associated the parsed -// value is set to true, otherwise it is set to false. - -void NMEAParser::parseAndValidateAltitude (const char* field, const char unit) - // Purpose: - // This function parses the altitude field of a sentence. - // Parameters: - // const char* field: - // The altitude field of the sentence to parse. - // const char unit: - // The unit of altitude. Valid values are 'f' (feet) and 'm' (meters). - // Notes: - // The resulting altitude data is specified in feet. -{ - // Initially assume data is invalid. - m_data->isValidAltitude = false; - - if (strlen (field) != 0) { - if (unit == 'f' || unit == 'F') { - // Altitude is in feet. - m_data->altitude = atof (field) * FEET_TO_METERS; - m_data->isValidAltitude = true; - } else if (unit == 'm' || unit == 'M') { - // Altitude is in meters. Convert to feet. - m_data->altitude = atof (field); - m_data->isValidAltitude = true; - } - } - // sj: logger.debug("isValidAltitude=%d; altitude=%f", - // sj: m_data->isValidAltitude, m_data->altitude); -} - -void NMEAParser::parseAndValidateDate (const char* field) - // Purpose: - // This function parses the date field of a sentence, in the format DDMMYY. -{ - // Initially assume data is invalid. - m_data->isValidDate = false; - - if (strlen (field) != 0) { - int year, month, day; - if (parseDate (year, month, day, field) == true) { - m_data->UTCYear = year; - m_data->UTCMonth = month; - m_data->UTCDay = day; - m_data->isValidDate = true; - } - } - // sj: logger.debug("isValidDate=%d; year=%d; month=%d; day=%d", - // sj: m_data->isValidDate, m_data->UTCYear, m_data->UTCMonth, - // sj: m_data->UTCDay); -} - -void NMEAParser::parseAndValidateFixQuality (const char* field) - // Purpose: - // This function parses the GPS fix quality field of a sentence. -{ - if (strlen (field) != 0) { - m_data->isValidFixQuality = true; - int fixQuality = atoi (field); - if (fixQuality == 0) m_data->lastFixQuality = FIX_AUTONOMOUS; - else if (fixQuality == 1) m_data->lastFixQuality = FIX_RTCM; - else if (fixQuality == 2) m_data->lastFixQuality = FIX_CPD_FLOAT; - else if (fixQuality == 3) m_data->lastFixQuality = FIX_CPD_FIXED; - else if (fixQuality == 9) m_data->lastFixQuality = FIX_ALMANAC; - else - { - // sj: logger.notice("unknown fix quality %d", fixQuality); - m_data->lastFixQuality = FIX_AUTONOMOUS; - } - } - // sj: logger.debug("lastFixQuality=%d", m_data->lastFixQuality); -} - -void NMEAParser::parseAndValidateHdop (const char* field) - // Purpose: - // This function parses the HDOP (horizontal dilution of precision) field of - // a sentence. -{ - if (strlen (field) != 0) { - m_data->hdop = atof (field); - m_data->isValidHdop = true; - } else { - m_data->isValidHdop = false; - } - // sj: logger.debug("isValidHdop=%d; hdop=%f", m_data->isValidHdop, m_data->hdop); -} - -void NMEAParser::parseAndValidateNStd (const char* field) - // Purpose: - // This function parses the NSTD (1 standard deviation of position estimate in northern - // direction) -{ - if (strlen (field) != 0) { - m_data->nStd = atof (field); - m_data->isValidNStd = true; - } else { - m_data->isValidNStd = false; - } - // sj: logger.debug("isValidNStd=%d; nStd=%f", m_data->isValidNStd, m_data->nStd); -} - - -void NMEAParser::parseAndValidateEStd (const char* field) - // Purpose: - // This function parses the ESTD (1 standard deviation of position estimate in eastern - // direction) -{ - if (strlen (field) != 0) { - m_data->eStd = atof (field); - m_data->isValidEStd = true; - } else { - m_data->isValidEStd = false; - } -} - -void NMEAParser::parseAndValidateZStd (const char* field) - // Purpose: - // This function parses the ZSTD (1 standard deviation of position estimate in altitude) -{ - if (strlen (field) != 0) { - m_data->zStd = atof (field); - m_data->isValidZStd = true; - } else { - m_data->isValidZStd = false; - } - // sj: logger.debug("isValidEStd=%d; eStd=%f", m_data->isValidEStd, m_data->eStd); -} - -void NMEAParser::parseAndValidateLat (const char* field, const char hem) - // Purpose: - // This function parses the latitude field of a sentence in the format - // DDMM.M(...). - // Parameters: - // const char* field: - // The latitude field of the sentence to parse. - // const char hem: - // The hemisphere that contains the location. Valid values are 'N' and - // 'S'. - // Notes: - // - If the latitude is in the southern hemisphere, the latitude member - // variable will be negative. (e.g., 4000.000 S will be stored as -40.0.) - // - If the latitude field does not exist within a sentence, the fix - // quality variable, m_data->lastFixQuality, is set to FIX_AUTONOMOUS. -{ - // Initially assume data is invalid. - m_data->isValidLat = false; - - if (strlen (field) != 0) { - // GPS lat/lon data has been received. - // Set the fix quality to "GPS navigation." This is because some - // GPS's may not send GGA sentences; therefore the last fix quality - // would never get set. - if (m_data->lastFixQuality == FIX_AUTONOMOUS) { - m_data->lastFixQuality = FIX_RTCM; - } - m_data->hasCoordEverBeenValid = true; - double degree; - if (parseDegrees (degree, field) == true) { - if (hem == 'N') { - // Northern hemisphere. - m_data->lat = degree; - m_data->isValidLat = true; - } else if (hem == 'S') { - // Southern hemisphere, so make latitude negative. - m_data->lat = -degree; - m_data->isValidLat = true; - } - } - } else { - m_data->lastFixQuality = FIX_AUTONOMOUS; - } - // sj: logger.debug("isValidLat=%d; lat=%f", m_data->isValidLat, m_data->lat); -} - - -void NMEAParser::parseAndValidateLon (const char* field, const char hem) - // Purpose: - // Same as parseAndValidateLat(), but the longitude is in the format - // DDDMM.M(...). - // Notes: - // - The valid values for the hem parameter are 'E' and 'W'. - // - If the longitude is in the western hemisphere, the longitude member - // variable will be negative. (e.g., 4000.000 W will be stored as -40.0.) - // - If the latitude field does not exist within a sentence, the last fix - // quality variable, m_data->lastFixQuality, is set to FIX_AUTONOMOUS. -{ - // Initially assume data is invalid. - m_data->isValidLon = false; - - if (strlen (field) != 0) { - // GPS lat/lon data has been received. - // Set the fix quality to "GPS navigation." This is because some - // GPS's may not send GGA sentences; therefore the last fix quality - // would never get set. - if (m_data->lastFixQuality == FIX_AUTONOMOUS) { - m_data->lastFixQuality = FIX_RTCM; - m_data->hasCoordEverBeenValid = true; - } - double degree; - if (parseDegrees (degree, field) == true) { - if (hem == 'E') { - // Eastern hemisphere. - m_data->lon = degree; - m_data->isValidLon = true; - } else if (hem == 'W') { - // Western hemisphere, so make longitude negative. - m_data->lon = -degree; - m_data->isValidLon = true; - } - } - } else { - m_data->lastFixQuality = FIX_AUTONOMOUS; - } - // sj: logger.debug("isValidLon=%d; lon=%f", m_data->isValidLon, m_data->lon); -} - - -void NMEAParser::parseAndValidateMagVariation (const char* field, - const char direction) - // Purpose: - // This function parses the magnetic variation field of a sentence, in - // relation to true north. - // Parameters: - // const char* field: - // The magnetic variation field of the sentence to parse, in degrees. - // const char direction: - // The direction of the field in relation to true north. Valid values - // are 'E' and 'W'. - // Notes: - // If the magnetic variation points west of true north, the magnetic - // variation variable will be negative. (e.g., 020.3 W will be stored as - // -20.3.) -{ - // Initially assume data is invalid. - m_data->isValidMagVariation = false; - - if (strlen (field) != 0) { - double degree = atof (field); - if (degree >= 0.0 && degree <= 360.0) { - if (direction == 'E') { - m_data->magVariation = degree; - m_data->isValidMagVariation = true; - } else if (direction == 'W') { - m_data->magVariation = -degree; - m_data->isValidMagVariation = true; - } - } - } - // sj: logger.debug("isValidMagVariation=%d; magVariation=%f", - // sj: m_data->isValidMagVariation, m_data->magVariation); -} - - -void NMEAParser::parseAndValidateSpeed (const char* field) - // Purpose: - // This function parses the speed field of a sentence. -{ - if (strlen (field) != 0) { - m_data->speed = atof (field); - m_data->isValidSpeed = true; - } else { - m_data->isValidSpeed = false; - } - // sj: logger.debug("isValidSpeed=%d; speed=%f", - // sj: m_data->isValidSpeed, m_data->speed); -} - - -void NMEAParser::parseAndValidateTime (const char* field) - // Purpose: - // This function parses the date field of a sentence, in the format - // HHMMSS.S(...), except the decimal second values are truncated. -{ - // Initially assume data is invalid. - m_data->isValidTime = false; - - if (strlen (field) != 0) { - int hour, minute, second; - if (parseTime (hour, minute, second, field) == true) { - m_data->UTCHour = hour; - m_data->UTCMinute = minute; - m_data->UTCSecond = second; - m_data->isValidTime = true; - } - } - // sj: logger.debug("isValidTime=%d; hour=%d; minute=%d; second=%d", - // sj: m_data->isValidTime, m_data->UTCHour, m_data->UTCMinute, - // sj: m_data->UTCSecond); -} - -void NMEAParser::parseAndValidateTrack (const char* field) - // Purpose: - // This function parses the track field of a sentence. -{ - // Initially assume data is invalid. - m_data->isValidTrack = false; - - if (strlen (field) != 0) { - double track = atof (field); - if (track >= 0.0 && track <= 360.0) { - m_data->track = track; - m_data->isValidTrack = true; - } - } - // sj: logger.debug("isValidTrack=%d; track=%f", m_data->isValidTrack, m_data->track); -} - - -///////////////////////////////////////////////////////////////////////////// -// Miscellaneous member functions - -bool NMEAParser::getNextField (char* data, const char* sentence, - uint_& currentPos) const - // Purpose: - // This function retrieves the next field in the NMEA sentence. A field is - // defined as the text between two delimiters (in this case of NMEA - // sentences, a delimiter is a comma character.) - // Pre: - // The specified sentence is valid. (Before calling this function, call the - // member functions IsCorrectChecksum() and ValidSentenceType(), passing the - // sentence to those functions.) - // Parameters: - // char* data: - // Upon exit, this string will contain the contents of the next field - // in the sentence. - // const char* sentence: - // The NMEA sentence to parse. - // uint_& currentPos: - // Determines the initial position within the NMEA sentence in which to - // parse. This function will grab all of the characters from - // currentPos all the way to the character before the comma delimiter. - // Upon exit, currentPosition will point to the next field in the string. - // Note that the comma is not included in the field data. - // Returns: - // true if there are more fields to parse, false if not. - // Notes: - // To grab all of the fields, you can iteratively call GetNextData() - // using the same variable that is passed as currentPosition, until - // GetNextData() returns false. -{ - int srcPos = currentPos; - int dstPos = 0; - char currentChar = sentence[srcPos]; - - // The delimiter character is the comma. - while ((currentChar != '\0' ) && (currentChar != ',') - && (currentChar != '\x0d') && (currentChar != '*')) { - - data[dstPos++] = currentChar; - currentChar = sentence[++srcPos]; - } - data[dstPos] = '\0'; - - if (currentChar == ',') { - // Next data field to parse will be past the comma. - currentPos = srcPos + 1; - return true; - } else { - // No more characters in the string to parse; this function has - // arrived at the end of the string. - return false; - } -} - - -bool NMEAParser::isCorrectChecksum (const char* sentence) const - // Purpose: - // This function calculates the sentence's checksum and compares it with the - // checksum in the sentence. - // Pre: - // The NMEA sentence is valid (ValidSentenceStructure() must be called with - // this sentence before calling this function; that function must return - // true.) - // Returns: - // true if the checksum is valid or there is no checksum in the sentence. - // (It is not necessary to have a device append a checksum to a sentence.) - // Otherwise this function returns false. - // Notes: - // The checksum in the sentence occurs after the * character. -{ - // Check all characters between the initial '$' and the last "*" in the - // sentence and XOR them together. - - int charPos = 1; // start past the initial '$'. - char currentChar = sentence[charPos]; - uint8_ checksum = 0; - - while (currentChar != '*' && currentChar != '\0') { - checksum ^= (uint8_)currentChar; - currentChar = sentence[++charPos]; - } - - // If no checksum exists (this function has reached the end of the string - // without finding one), the sentence is good. - if (sentence[charPos + 1] == '\0') return true; - - // Convert last two hex characters (the checksum) in the sentence with - // the checksum this function has generated. - char firstDigit = sentence[charPos + 1]; - char lastDigit = sentence[charPos + 2]; - if ( (firstDigit <= '9' ? firstDigit - '0': (firstDigit - 'A') + 10) * 16 - + (lastDigit <= '9' ? lastDigit - '0': (lastDigit - 'A') + 10) - == checksum) { - return true; - } else { - return false; - } - - return true; -} - -bool NMEAParser::isValidSentenceType (const char* sentence) const -{ - if (strlen (sentence) < 6) - { - return false; - } - - if (sentence[0] != '$') - { - return false; - } - - return isKnownSentenceType(sentence); -} - -bool NMEAParser::isKnownSentenceType (const char* sentence) const - // Purpose: - // This function determines whether this is a valid NMEA sentence that this - // class can support. - // Notes: - // See the header file for a list of sentences supported by this class. -{ - // Get the three letters after the '$xx'; this is the type of - // sentence. (Note the xx is the type of device which is sending - // the string. For example, GP = GPS, etc.) - char sentenceType[4]; - memcpy (sentenceType, &(sentence[3]), 3); - sentenceType[3] = '\0'; - - return ((strcmp (sentenceType, "ZDA") == 0) - || (strcmp (sentenceType, "GGA") == 0) - || (strcmp (sentenceType, "GLL") == 0) - || (strcmp (sentenceType, "RMC") == 0) - || (strcmp (sentenceType, "GSV") == 0) - || (strcmp (sentenceType, "GST") == 0) - || (strcmp (sentenceType, "VTG") == 0) - || (strcmp (sentenceType, "RRE") == 0)); -} - -int NMEAParser::countChars (const char* string, char charToCount, uint_ charCount) const - // Purpose: - // This function counts the number of specified occurrences of the - // specified characters and compares to the number of characters that is - // expected. - // Parameters: - // const char* string: - // The string to check. - // char charToCount: - // The character to count. - // uint_ charCount: - // The number of the characters specified by charToCount that is expected - // to be contained within that string. - // Returns: - // 0 if the number of specified characters in the sentence matches charCount. - // 1 if the number of specified characters in the sentence is less than - // charCount. - // -1 if the number of specified characters in the sentence is greater than - // charCount. -{ - size_t stringSize = strlen (string); - size_t currentCharCount = 0; - const char* currentChar = string; - for (size_t i = 0; i < stringSize; i++) { - if (*currentChar++ == charToCount) ++currentCharCount; - } - if (currentCharCount > charCount) { - return 1; - } else if (currentCharCount < charCount) { - return -1; - } else { - return 0; - } -} diff --git a/src/vrpn/gpsnmealib/nmeaParser.h b/src/vrpn/gpsnmealib/nmeaParser.h deleted file mode 100644 index 919dc84659e8169a767756ae32bc97d33b247264..0000000000000000000000000000000000000000 --- a/src/vrpn/gpsnmealib/nmeaParser.h +++ /dev/null @@ -1,285 +0,0 @@ -/* - * This class was adapted from the GPSThing CNmeaParser class. - * Originally written by Jason Bevins - */ - -#ifndef __NMEAPARSER_HPP -#define __NMEAPARSER_HPP - -#if 1 - -typedef unsigned char uint8_; -typedef unsigned short uint16_; -typedef unsigned int uint32_; -typedef unsigned int uint_; - -#else - -// Get standard types (uint8_, etc.) -#include <cc++/config.h> - -#endif - -#include <string.h> - -// sj: #include <log4cpp/Category.hh> - -struct SatData -{ - SatData () - { - prn = 0; - elevation = 0; - azimuth = 0; - strength = 0; - } - - SatData (uint8_ prn_, uint16_ elevation_, uint16_ azimuth_, - uint16_ strength_) - { - prn = prn_; - elevation = elevation_; - azimuth = azimuth_; - strength = strength_; - } - - uint16_ prn; // Satellite's ID. - uint16_ elevation; // Elevation of satellite, in degrees. - uint16_ azimuth; // Azimuth of satellite, in degrees. - uint16_ strength; // Signal strength of satellite. -}; - -struct RangeResidualData -{ - RangeResidualData() - { - prn = 0; - residual = 0; - } - - RangeResidualData(uint8_ prn_, double residual_) - { - prn = prn_; - residual = residual_; - } - - uint8_ prn; - double residual; -}; - -const double METERS_TO_FEET = 3.280839895013; -const double FEET_TO_METERS = 1 / METERS_TO_FEET; -const double KM_TO_NM = 1.853; -const double NM_TO_KM = 1 / KM_TO_NM; -const double KM_TO_MI = FEET_TO_METERS * 5.28; -const double MI_TO_KM = 1 / KM_TO_MI; - -// GPS coordinate fix quality. -enum GPS_FIX_QUALITY -{ - FIX_AUTONOMOUS = 0, - FIX_RTCM = 1, - FIX_CPD_FLOAT = 2, - FIX_CPD_FIXED = 3, - FIX_ALMANAC = 9 -}; - -// Sentence parsing status. -enum SENTENCE_STATUS -{ - SENTENCE_VALID=0, // Sentence parsed is valid. - SENTENCE_INVALID, // Sentence parsed has invalid data. - SENTENCE_BAD_CHECKSUM, // Sentence parsed has a bad checksum. - SENTENCE_UNKNOWN // Sentence is of unknown type -}; - -// Number of commas in each sentence. In order for a sentence to be valid, -// it must have a specified number of commas. -enum SENTENCE_COMMA_SIZES -{ - SENTENCE_ZDA_COMMAS = 6, - SENTENCE_GGA_COMMAS = 14, - SENTENCE_GLL_COMMAS = 6, - SENTENCE_RMC_COMMAS = 11, - SENTENCE_GSV_COMMAS = 19, - SENTENCE_VTG_COMMAS = 7, - SENTENCE_GST_COMMAS = 8, - SENTENCE_RRE_COMMAS = 4 -}; - -// Maximum size of an NMEA sentence (plus the NULL character.) -const int MAX_SENTENCE_SIZE = 1024; - -// No GPS I'm aware of can track more than 12 satellites. -const uint8_ MAX_SATS = 12; - -// Data class stored with the parser. To extract the data parsed from the -// parser, pass an object of this class to the parser. -// NOTE! NMEA sentences are not "Year 2000-compliant"{tm} -struct NMEAData -{ - NMEAData (); - - virtual ~NMEAData() - { - } - - virtual void reset (); - - // Data retrieved from the NMEA sentences. - double lat; // Latitude, in degrees (positive=N, negative=S) - double lon; // Longitude, in degrees (positive=E, negative=W) - double altitude; // Altitude, in feet - double speed; // Speed, in knots - double track; // Current track, in degrees. - double magVariation; // Magnetic variation, in degrees. - double hdop; // Horizontal dilution of precision. - double nStd; // North standard deviation. - double eStd; // East standard deviation. - double zStd; // Altitude standard deviation. - double hStd; // Horizonal standard deviation. - uint_ numSats; // Number of satellites in the sky. - int UTCYear; // GPS Date (UTC), year part - int UTCMonth; // GPS Date (UTC), month part - int UTCDay; // GPS Date (UTC), day part - int UTCHour; // GPS Time (UTC), hour part. - int UTCMinute; // GPS Time (UTC), minute part - int UTCSecond; // GPS Time (UTC), second part - SatData satData[MAX_SATS]; - - RangeResidualData rrData[MAX_SATS]; - - // Quality of last fix: - // 0 = invalid, 1 = GPS fix, 2 = DGPS fix. - GPS_FIX_QUALITY lastFixQuality; - - // Validity of data parsed. - bool isValidLat; // Latitude - bool isValidLon; // Longitude - bool isValidAltitude; // Altitude - bool isValidSpeed; // Speed - bool isValidDate; // Date - bool isValidTime; // Time - bool isValidTrack; // Track - bool isValidMagVariation; // Magnetic variation - bool isValidHdop; // Horizontal dilution of precision - bool isValidNStd; - bool isValidEStd; - bool isValidZStd; - bool isValidSatData; // Satellite data - bool isValidRangeResidualData; // Satellite data - bool isValidHStd; - bool isValidFixQuality; - - // Has a valid coordinate ever been sent over the serial port? - bool hasCoordEverBeenValid; - - // Flag indicates if we are waiting for the frame to start - bool waitingForStart; - - // Whether we have seen a particular message since the data was - // reset - bool seenZDA; - bool seenGGA; - bool seenGLL; - bool seenRMC; - bool seenGSV; - bool seenGST; - bool seenVTG; - bool seenRRE; -}; - -class NMEAParser -{ - public: - NMEAParser (/* sj: log4cpp::Category& l*/); - virtual ~NMEAParser (); - SENTENCE_STATUS parseSentence (const char* sentence); - - void setStartSentence(char *sentence) - { - strcpy(startSentence, sentence); - } - - void getData (NMEAData& data) const - { - data = *m_data; - } - - NMEAData& getData() - { - return *m_data; - } - - void reset () - { - m_data->reset (); - } - - bool isValidSentenceType (const char* sentence) const; - - bool isCorrectChecksum (const char* sentence) const; - -protected: - NMEAParser (/* sj: log4cpp::Category& l,*/ NMEAData* data); - - bool parseDegrees (double& degrees, const char* degString) const; - bool parseDate (int& year, int& month, int& day, - const char* dateString) const; - bool parseTime (int& hour, int& minute, int& second, - const char* timeString) const; - void parseAndValidateAltitude (const char* field, const char unit); - void parseAndValidateDate (const char* field); - void parseAndValidateFixQuality (const char* field); - void parseAndValidateLat (const char* field, const char hem); - void parseAndValidateLon (const char* field, const char hem); - void parseAndValidateHdop (const char* field); - void parseAndValidateSpeed (const char* field); - void parseAndValidateNStd (const char* field); - void parseAndValidateEStd (const char* field); - void parseAndValidateZStd (const char* field); - void parseAndValidateMagVariation(const char* field, - const char direction); - void parseAndValidateTime (const char* field); - void parseAndValidateTrack (const char* field); - - bool getNextField(char* data, const char* sentence, - uint_& currentPosition) const; - - int countChars(const char* sentence, char charToCount, - uint_ charCount) const; - - virtual bool isKnownSentenceType (const char* sentence) const; - virtual SENTENCE_STATUS parseValidSentence (const char* sentence); - - NMEAData* m_data; - - // the sentence that marks the beginning of the set of packets - char startSentence[16]; - - // Needed for parsing the GSV sentence. - int m_lastSentenceNumber;// Which sentence number was the last one? - int m_numSentences; // Number of sentences to process. - int m_numSatsExpected; // Number of satellites expected to parse. - int m_numSatsLeft; // Number of satellites left to parse. - int m_satArrayPos; // Array position of the next sat entry. - SatData m_tempSatData[MAX_SATS]; - - - // The logging category - // sj: log4cpp::Category& logger; - -private: - void parseZDA(const char* sentence); - void parseGGA (const char* sentence); - void parseGLL (const char* sentence); - void parseRMC (const char* sentence); - void parseGSV (const char* sentence); - void parseGST (const char* sentence); - void parseVTG (const char* sentence); - void parseRRE (const char* sentence); -}; - -#endif - - diff --git a/src/vrpn/gpsnmealib/typedCoord.C b/src/vrpn/gpsnmealib/typedCoord.C deleted file mode 100644 index 5f4663e5023b63decf4473fbc807687bbcdd5412..0000000000000000000000000000000000000000 --- a/src/vrpn/gpsnmealib/typedCoord.C +++ /dev/null @@ -1,220 +0,0 @@ -// TypedCoord.C: Implementation of the CTypedCoord abstract base class. -// -// Written by Jason Bevins in 1998. File is in the public domain. -// - -#include "gpsnmealib/nmeaParser.h" // for GPS_FIX_QUALITY -#include "typedCoord.h" -#ifdef sgi -#include <math.h> -#else -#include <cmath> // for sqrt, atan2, cos, sin, fabs -#endif - -// Mmmmm, pi... -static const double PI = 3.141592653589793; - -// Radians to degrees conversion constants. -static const double RAD_TO_DEG = 180.0 / PI; -static const double DEG_TO_RAD = PI / 180.0; - -static double mod (double num, double divisor) -// Purpose: -// This function determines the remainder of num / divisor. -{ - if (num >= 0) { - return num - divisor * (int)(num / divisor); - } else { - return num + divisor * (int)((-num / divisor) + 1); - } -} - -///////////////////////////////////////////////////////////////////////////// -// TypedCoord operators - -TypedCoord& TypedCoord::operator= (const TypedCoord& other) -{ - double lat, lon; - other.getLatLonCoord (lat, lon); - setLatLonCoord (lat, lon); - return *this; -} - - -///////////////////////////////////////////////////////////////////////////// -// TypedCoord members - -void TypedCoord::calculateDistAndBearing (const TypedCoord& coord, - double& dist, double& bearingStartToEnd, double& bearingEndToStart) const - // Purpose: - // This function calculates the distance between this coordinate and the - // specified coordinate on the Earth and determines the bearing to the - // coordinates in the forward and the reverse direction. - // Parameters: - // TypedCoord& coord: - // The specified coordinate. - // double& dist: - // Upon exit, this parameter contains the distance between the two - // coordinates, in meters. - // double& bearingStartToEnd: - // Upon exit, this parameter contains the bearing from this coordinate - // to the specified coordinate, in degrees. - // double& bearingEndToStart: - // Upon exit, this parameter contains the bearing from the specified - // coordinate to this coordinate, in degrees. -{ - double startLat, startLon; - double endLat, endLon; - getLatLonCoord (startLat, startLon); - coord.getLatLonCoord (endLat, endLon); - distAndBearingWGS84 (startLat, startLon, endLat, endLon, dist, - bearingStartToEnd, bearingEndToStart); -} - - -void TypedCoord::distAndBearing (double a, double f, double startLat, - double startLon, double endLat, double endLon, double& dist, - double& bearingStartToEnd, double& bearingEndToStart) const - // Purpose: - // This function calculates the distance between two coordinates on the Earth - // and determines the bearing to the coordinates in the forward and the - // reverse direction. - // Pre: - // startLat and endLat does not equal 90 or -90 degrees. - // Parameters: - // double a: - // Ellipsoid semi-major axis, in meters. (For WGS84 datum, use 6378137.0) - // double f: - // Ellipsoid flattening. (For WGS84 datum, use 1 / 298.257223563) - // double startLat: - // The starting latitude. - // double startLon: - // The starting longitude. - // double endLat: - // The ending latitude. - // double startLon: - // The ending longitude. - // double& dist: - // Upon exit, this parameter contains the distance between the two - // coordinates, in meters. - // double& bearingStartToEnd: - // Upon exit, this parameter contains the bearing from the starting - // coordinate to the ending coordinate, in degrees. - // double& bearingEndToStart: - // Upon exit, this parameter contains the bearing from the ending - // coordinate to the starting coordinate, in degrees. -{ - double c; - double c1; - double c2; - double c2a; - double sinX, cosX; - double cy, cz; - double d, e; - double r, s; - double s1, sa, sy; - double tan1, tan2; - double x, y; - double t, t1, t2, t3, t4, t5; - double coordStartLatRad = startLat * DEG_TO_RAD; - double coordStartLonRad = startLon * DEG_TO_RAD; - double coordEndLatRad = endLat * DEG_TO_RAD; - double coordEndLonRad = endLon * DEG_TO_RAD; - r = 1.0 - f; - tan1 = (r * sin (coordStartLatRad)) / cos (coordStartLatRad); - tan2 = (r * sin (coordEndLatRad)) / cos (coordEndLatRad); - c1 = 1.0 / sqrt ((tan1 * tan1) + 1.0); - s1 = c1 * tan1; - c2 = 1.0 / sqrt ((tan2 * tan2) + 1.0); - s = c1 * c2; - bearingEndToStart = s * tan2; - bearingStartToEnd = bearingEndToStart * tan1; - x = coordEndLonRad - coordStartLonRad; - int exitLoop = 0; - int loopCount = 0; - while (exitLoop == 0 && loopCount < 6) - { - sinX = sin (x); - cosX = cos (x); - tan1 = c2 * sinX; - tan2 = bearingEndToStart - (s1 * c2 * cosX); - sy = sqrt ((tan1 * tan1) + (tan2 * tan2)); - cy = (s * cosX) + bearingStartToEnd; - y = atan2 (sy, cy); - sa = (s * sinX) / sy; - c2a = ((-sa) * sa) + 1.0; - cz = bearingStartToEnd * 2.0; - if (c2a > 0.0) { - cz = ((-cz) / c2a) + cy; - } - e = (cz * cz * 2.0) - 1.0; - c = (((((-3.0 * c2a) + 4.0 ) * f) + 4.0) * c2a * f) / 16.0; - d = x; - t = ((((e * cy * c) + cz) * sy * c) + y) * sa; - x = ((1.0 - c) * t * f) + coordEndLonRad - coordStartLonRad; - // Make sure this function does not go into an infinite loop... - if (fabs (d - x) > 0.00000000005) { - exitLoop = 0; - } else { - exitLoop = 1; - } - ++loopCount; - } - bearingStartToEnd = atan2 (tan1, tan2); - bearingEndToStart = atan2 (c1 * sinX, ((bearingEndToStart * cosX) - - (s1 * c2))) + PI; - t = sqrt ((((1.0 / r / r) - 1) * c2a) + 1.0) + 1.0; - x = (t - 2.0) / t; - t = 1.0 - x; - c = (((x * x) / 4.0) + 1.0) / t; - d = ((0.375 * (x * x)) - 1.0) * x; - x *= cy; - s = (1.0 - e) - e; - t1 = (sy * sy * 4.0) - 3.0; - t2 = ((s * cz * d) / 6.0) - x; - t3 = t1 * t2; - t4 = ((t3 * d) / 4.0) + cz; - t5 = (t4 * sy * d ) + y; - dist = t5 * c * a * r; - bearingStartToEnd *= RAD_TO_DEG; - bearingEndToStart *= RAD_TO_DEG; - // Make sure the bearings are between 0 and 360, inclusive. - bearingStartToEnd = mod (bearingStartToEnd, 360.0); - bearingEndToStart = mod (bearingEndToStart, 360.0); -} - - -void TypedCoord::distAndBearingWGS84 (double startLat, double startLon, - double endLat, double endLon, double& dist, double& bearingStartToEnd, - double& bearingEndToStart) const - // Purpose: - // This function calculates the distance between two coordinates on the Earth - // and determines the bearing to the coordinates in the forward and the - // reverse direction. - // Pre: - // startLat and endLat does not equal 90 or -90 degrees. - // Parameters: - // See TypedCoord::DistAndBearing(). -{ - distAndBearing (6378137.0, 1 / 298.257223563, startLat, startLon, endLat, - endLon, dist, bearingStartToEnd, bearingEndToStart); -} - - -void TypedCoord::getLatLonCoord (double& lat, double& lon) const - // Purpose: - // This function returns the latitude and longitude contained within this - // object. -{ - lat = m_lat; - lon = m_lon; -} - - -void TypedCoord::setFixQuality (GPS_FIX_QUALITY fixQuality) - // Purpose: - // This function sets the fix quality of the coordinate. Use this function - // to store the quality of the fix from a GPS with the coordinate. -{ - m_fixQuality = fixQuality; -} diff --git a/src/vrpn/gpsnmealib/typedCoord.h b/src/vrpn/gpsnmealib/typedCoord.h deleted file mode 100644 index d13b690a6a4f7b45bc030d26b5491e3bcdbd526c..0000000000000000000000000000000000000000 --- a/src/vrpn/gpsnmealib/typedCoord.h +++ /dev/null @@ -1,147 +0,0 @@ -// TypedCoord.h: Definition of the CTypedCoord abstract base class. -// -// The CTypedCoord class is an abstract base class whose derived classes -// represents a WGS84 coordinate with a specific type. For example, a UTM -// coordinate class can be derived from the CTypedCoord class. These classes -// store a coordinate in the class' coordinate type. -// -// Since a GPS uses lat/lon format for its coordinates, and distance/bearing -// formulas require lat/lon coordinates, CTypedCoord contains a latitude and -// a longitude member variable; member functions exist for converting between -// the lat/lon coordinate and the class' coordinate type. -// -// Conversion of coordinates from lat/lon to another format can be very -// computationally intensive, especially on machines without FPUs. Because -// of this, it is encouraged that derived classes use lazy evaluation when -// returning coordinates, so the conversions take place only when necessary. -// Because of the lazy evaluation, derived classes should not access the -// coordinate member variables directly; use the GetLatLonCoord() and the -// SetLatLonCoord() member functions to access and/or modify these variables. -// -// Since this is an abstract base class, you *must* override the following -// member functions in your derived classes: -// - GetCoordType(): Override this member function to return the type of this -// object. Each derived class from CTypedCoord has a unique type ID that -// specified the type of this object. Add a value to the enumerated type -// COORD_TYPE when deriving a new class, and return this value from this -// function. The COORD_TYPE enumerated type is found elsewhere in this -// project. -// - CreateCoordString(): Override this member function to create a formatted -// coordinate std::string using the coordinate within the class. -// - CreateXYCoordStrings(): Override this member function to create two -// formatted std::strings containing the x and y coordinate values; -// - GetXYCoord(): Override this member function to return the (x, y) -// coordinate values. This function is useful when the other data (e.g., -// zones, etc.) are not needed. -// - CreateDisplayStrings: Override this function to create four std::strings that -// can be used for display purposes. The four std::strings contain coordinate -// data; these std::strings are displayed at the top left, top right, bottom -// left, and bottom right of a display. For example: -// A lat/lon coordinate class may create std::strings as follows: -// - top left: North/south hemisphere character -// - top right: Latitude -// - bottom left: East/west hemisphere character -// - bottom right: Longitude -// This would create a display as follows: -// N 48*25'33.3" -// W 123*20'09.8" -// A UTM coordinate class may create std::strings as follows: -// - top left: UTM zone (e.g., "10U") -// - top right: UTM easting -// - bottom left A std::string describing the coordinate type ("UTM") -// - bottom right: UTM northing -// This would create a display as follows: -// 10U 475139 -// UTM 5363695 -// It is up to the calling function to write the std::strings to a display. -// -// Member functions that can (and should) be overridden include: -// - SetLatLonCoord(): Override this member function to set the current lat/ -// lon coordinate within this class and convert the lat/lon coordinate to -// the appropriate coordinate type so it can be stored within this class. -// - GetLatLonCoord(): Override this member function so that the lat/lon -// coordinate can be returned by converting the class' coordinate from the -// class' coordinate type. -// - operator=(): Override this operator to implement assignment operations. -// Two operator=() functions should be created as follows: -// - An operator=() function that takes a parameter of type CTypedCoord&. -// Use the GetLatLonCoord() function to convert the right hand side -// coordinate from its current type to a pair of lat/lon values, then -// call this class' SetLatLonCoord() function to convert the lat/lon pair -// to a coordinate of this class' type. -// - An operator=() function that takes a parameter of a reference to an -// object as the same type as the object. Simply copy all member -// variables from the right hand side object to this object. -// -// Using coordinate objects derived from this base class, it is simple to -// perform such operations as: -// - Finding the distance between two coordinate objects with different -// coordinate types. -// - Assigning the coordinates of an object of one coordinate type to another -// object with a different coordinate type. -// -// [TO DO: Allow for other map datums. For now, these coordinates are using -// the WGS84 datum.] -// -// Written by Jason Bevins in 1998. File is in the public domain. -// - -#ifndef __TYPED_COORD_HPP -#define __TYPED_COORD_HPP - -#include <string> - -// Because of the way I hacked up the GPSThing code -// Needed for GPS_FIX_QUALITY -#include "nmeaParser.h" - -enum COORD_TYPE -{ - COORD_LATLON = 0, - COORD_UTM = 1 -}; - -class TypedCoord -{ -public: - TypedCoord () {m_lat = 0; m_lon = 0;} - virtual ~TypedCoord () {} - TypedCoord& operator= (const TypedCoord& other); - void calculateDistAndBearing (const TypedCoord& coord, double& dist, - double& dirStartToEnd, double& bearingEndToStart) const; - virtual const std::string& createCoordString (std::string& coordString) const - = 0; - virtual void createDisplayStrings (std::string& topLeftString, - std::string& topRightString, std::string& bottomLeftString, - std::string& bottomRightString) const = 0; - virtual void createXYCoordStrings (std::string& xString, - std::string& yString) const = 0; - virtual COORD_TYPE getCoordType () const = 0; - GPS_FIX_QUALITY getFixQuality () const - {return m_fixQuality;} - virtual void getLatLonCoord (double& lat, double& lon) const; - virtual void getXYCoord (double& x, double& y) const = 0; - void setFixQuality (GPS_FIX_QUALITY fixQuality); - virtual void setLatLonCoord (double lat, double lon) - {m_lat = lat; m_lon = lon;} - -protected: - void distAndBearing (double a, double f, double startLat, - double startLon, double endLat, double endLon, - double& dist, - double& bearingStartToEnd, - double& bearingEndToStart) const; - void distAndBearingWGS84 (double startLat, double startLon, - double endLat, double endLon, double& dist, - double& bearingStartToEnd, - double& bearingEndToStart) const; - - // Current lat/lon coordinate. - double m_lat; - double m_lon; - - // Fix quality for the coordinate that originated from a GPS. - GPS_FIX_QUALITY m_fixQuality; -}; - -#endif // __TYPED_COORD_HPP diff --git a/src/vrpn/gpsnmealib/utmCoord.C b/src/vrpn/gpsnmealib/utmCoord.C deleted file mode 100644 index 4a08dc116fa0012abbf6ac310a1524f2b7d32853..0000000000000000000000000000000000000000 --- a/src/vrpn/gpsnmealib/utmCoord.C +++ /dev/null @@ -1,631 +0,0 @@ -// UtmCoord.C: Implementaion of the CUtmCoord class. -// -// Written by Jason Bevins in 1998. File is in the public domain. -// - -#include "gpsnmealib/typedCoord.h" // for TypedCoord -#include "utmCoord.h" -#ifdef sgi -#include <assert.h> -#include <math.h> -#else -#include <cassert> // for assert -#include <cmath> // for sin, cos, sqrt, M_PI -#endif - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -// Radians to degrees conversion constants. -static const double RAD_TO_DEG = 180.0 / M_PI; -static const double DEG_TO_RAD = M_PI / 180.0; - -// Some constants used by these functions. -static const double fe = 500000.0; -static const double ok = 0.9996; - -// An array containing each vertical UTM zone. -static char cArray[] = "CDEFGHJKLMNPQRSTUVWX"; - - -///////////////////////////////////////////////////////////////////////////// -// Miscellaneous functions for these UTM conversion formulas. - -static double calculateESquared (double a, double b) -{ - return ((a * a) - (b * b)) / (a * a); -} - - -static double calculateE2Squared (double a, double b) -{ - return ((a * a) - (b * b)) / (b * b); -} - - -static double denom (double es, double sphi) -{ - double sinSphi = sin (sphi); - return sqrt (1.0 - es * (sinSphi * sinSphi)); -} - -static double sphsr (double a, double es, double sphi) -{ - double dn = denom (es, sphi); - return a * (1.0 - es) / (dn * dn * dn); -} - - -static double sphsn (double a, double es, double sphi) -{ - double sinSphi = sin (sphi); - return a / sqrt (1.0 - es * (sinSphi * sinSphi)); -} - - -static double sphtmd (double ap, double bp, double cp, double dp, double ep, - double sphi) -{ - return (ap * sphi) - (bp * sin (2.0 * sphi)) + (cp * sin (4.0 * sphi)) - - (dp * sin (6.0 * sphi)) + (ep * sin (8.0 * sphi)); -} - -///////////////////////////////////////////////////////////////////////////// -// UTMCoord construction/destruction - -UTMCoord::UTMCoord () -{ - m_requireLatLonConvert = false; - m_requireUTMConvert = false; - setLatLonCoord (0.0, 0.0); -} - - -UTMCoord::UTMCoord (int utmXZone, char utmYZone, double easting, - double northing) -{ - m_requireLatLonConvert = false; - m_requireUTMConvert = false; - setUTMCoord (utmXZone, utmYZone, easting, northing); -} - - -UTMCoord::UTMCoord (const UTMCoord& other) -{ - copyUTMCoord (other); -} - - -UTMCoord::UTMCoord (const TypedCoord& other) -{ - copyOtherCoord (other); -} - - -///////////////////////////////////////////////////////////////////////////// -// UTMCoord operators - -UTMCoord& UTMCoord::operator= (const UTMCoord& other) -{ - copyUTMCoord (other); - return *this; -} - - -UTMCoord& UTMCoord::operator= (const TypedCoord& other) -{ - copyOtherCoord (other); - return *this; -} - - -///////////////////////////////////////////////////////////////////////////// -// UTMCoord members - -void UTMCoord::copyUTMCoord (const UTMCoord& other) - // Purpose: - // This function copies the UTM coordinate of the specified object and - // assigns that coordinate to this object. - // Notes: - // This function copies every member function from that object, including - // its lat/lon value and its lazy evaluation flags. -{ - m_lat = other.m_lat; - m_lon = other.m_lon; - m_utmXZone = other.m_utmXZone; - m_utmYZone = other.m_utmYZone; - m_easting = other.m_easting; - m_northing = other.m_northing; - m_requireLatLonConvert = other.m_requireLatLonConvert; - m_requireUTMConvert = other.m_requireUTMConvert; -} - - -void UTMCoord::copyOtherCoord (const TypedCoord& other) - // Purpose: - // This function copies the coordinate of the specified object, converts - // the coordinate to the coordinate type of this object, then assigns the - // converted coordinate to this object. -{ - // Convert the right hand side coordinate to lat/lon; then convert this - // lat/lon coordinate to UTM. - double lat, lon; - other.getLatLonCoord (lat, lon); - setLatLonCoord (lat, lon); -} - - -const std::string& UTMCoord::createCoordString (std::string& coordString) const - // Purpose: - // This function creates a formatted coordinate string containing this - // object's coordinate. - // Parameters: - // CString& coordString: - // Upon exit, this parameter will contain the coordinate string. - // Returns: - // The coordinate string. - // Notes: - // If the coordinate is outside of the UTM grid boundary (>= 84 N or <= 80 S) - // the string will contain the resource string specified by the constant - // IDS_OUTSIDE_UTM_BOUNDARY. -{ - double easting; - double northing; - int utmXZone; - char utmYZone; - getUTMCoord (utmXZone, utmYZone, easting, northing); -#if 0 - if (utmYZone != '*') { - coordString.Format ("%02d%c %06d %07d", utmXZone, utmYZone, - (int)easting, (int)northing); - } else { - // UTM vertical zone is out of range. - coordString.LoadString (IDS_OUTSIDE_UTM_BOUNDARY); - } -#endif - return coordString; -} - - -void UTMCoord::createDisplayStrings (std::string& topLeftString, - std::string& topRightString, std::string& bottomLeftString, - std::string& bottomRightString) const - // Purpose: - // This function creates four strings that can be used for display; these - // strings contain coordinate data. The four strings are for the top left, - // top right, bottom left, and bottom right text of a display; each string - // is specified as follows: - // - top left: UTM zone - // - top right: Easting - // - bottom left: "UTM" - // - bottom right: Northing - // Notes: - // It is up to the calling function to write these strings to the display. -{ -#if 0 - bottomLeftString.LoadString (IDS_UTM); - if (IsOutsideUTMGrid () == false) { - // Extract the elements of the coordinate string. - CString coordString; - CreateCoordString (coordString); - topLeftString = coordString.Mid (UTM_ZONE_POS, UTM_ZONE_LEN); - topRightString = coordString.Mid (UTM_EASTING_POS, UTM_EASTING_LEN); - bottomRightString = coordString.Mid (UTM_NORTHING_POS, - UTM_NORTHING_LEN); - } else { - // The coordinate is outside of the UTM grid boundary, so the - // coordiante strings are empty. - topLeftString = ""; - topRightString = ""; - bottomRightString = ""; - } -#endif -} - - -void UTMCoord::createXYCoordStrings (std::string& xString, std::string& yString) - const - // Purpose: - // This function generates two strings: a string containing the easting - // coordinate (stored in the parameter xString), and a string containing the - // northing coordinate (stored in the parameter yString.) -{ - double easting; - double northing; - int utmXZone; - char utmYZone; - getUTMCoord (utmXZone, utmYZone, easting, northing); -#if 0 - xString.Format ("%06d", (int)easting); - yString.Format ("%07d", (int)northing); -#endif -} - - -void UTMCoord::getLatLonCoord (double& lat, double& lon) const - // Purpose: - // This function converts the object's UTM coordinate to a lat/lon coordinate - // and returns the latitude and longitude. -{ - if (m_requireLatLonConvert == true) { - // The conversion between UTM and lat/lon has not occurred yet, so do - // the conversion now. A non-const pointer to this object must be - // created so that this function can convert the UTM coordinate stored - // within this object to a lat/lon coordinate if the conversion is - // necessary. This lat/lon coordinate is then copied to the m_lat - // and m_lon members of this object, requiring the object to be - // non-const. - UTMCoord* myThis = const_cast<UTMCoord*>(this); - // Convert to lat/lon. - utmToLatLonWGS84 (myThis->m_utmXZone, myThis->m_utmYZone, - myThis->m_easting, myThis->m_northing, myThis->m_lat, - myThis->m_lon); - // Do not make this conversion again (unless the coordinates have been - // changed and another conversion is required.) - myThis->m_requireLatLonConvert = false; - } - lat = m_lat; - lon = m_lon; -} - - -void UTMCoord::getUTMCoord (int& utmXZone, char& utmYZone, double& easting, - double& northing) const - // Purpose: - // This function returns the current UTM coordinate. -{ - if (m_requireUTMConvert == true) { - // The conversion between lat/lon and UTM has not occurred yet, so do - // the conversion now. A non-const pointer to this object must be - // created so that this function can convert the lat/lon coordinate - // stored within this object to a UTM coordinate if the conversion - // is necessary. This UTM coordinate is then copied to the m_utmXZone - // m_utmYZone, m_easting, and m_northing members of this object, - // requiring the object to be non-const. - UTMCoord* myThis = const_cast<UTMCoord*>(this); - // Convert to UTM. - latLonToUTMWGS84 (myThis->m_utmXZone, myThis->m_utmYZone, - myThis->m_easting, myThis->m_northing, myThis->m_lat, - myThis->m_lon); - // Do not make this conversion again (unless the coordinates have been - // changed and another conversion is required.) - myThis->m_requireUTMConvert = false; - } - easting = m_easting; - northing = m_northing; - utmXZone = m_utmXZone; - utmYZone = m_utmYZone; -} - - -void UTMCoord::getUTMZone (int& utmXZone, char& utmYZone) const - // Purpose: - // This function returns the current UTM zone. - // Parameters: - // int& utmXZone: - // Upon exit, this parameter contains the UTM horizontal zone. This - // zone will be between 1 and 60, inclusive. - // char& utmYZone: - // Upon exit, this parameter contains the UTM vertical zone. This - // zone will be one of: CDEFGHJKLMNPQRSTUVWX. -{ - double easting; - double northing; - getUTMCoord (utmXZone, utmYZone, easting, northing); -} - - -void UTMCoord::getXYCoord (double& x, double& y) const - // Purpose: - // This function returns the coordinate's (x, y) coordinate. For this class, - // the x coordinate is the easting, and the y coordinate is the northing. -{ - int utmXZone; - char utmYZone; - getUTMCoord (utmXZone, utmYZone, x, y); -} - - -bool UTMCoord::isOutsideUTMGrid () const - // Purpose: - // This function determines whether the current coordinate is outside of the - // UTM grid boundary (i.e., >= 84 N or <= 80 s) -{ - // If a UTM coordinate has been converted to a lat/lon coordinate by lazy - // evaluation, simply determine whether the coordinate is north of 84, or - // south of 80. - if (m_requireLatLonConvert == false) { - if (m_lat >= 84.0 || m_lat <= -80.0) { - return true; - } else { - return false; - } - } else if (m_requireUTMConvert == false) { - if (m_utmYZone == '*') { - return true; - } else { - return false; - } - } else { - // This should not happen - assert(false); - return false; - } -} - - -void UTMCoord::latLonToUTM (double a, double f, int& utmXZone, char& utmYZone, - double& easting, double& northing, double lat, double lon) const - // Purpose: - // This function converts the specified lat/lon coordinate to a UTM - // coordinate. - // Parameters: - // double a: - // Ellipsoid semi-major axis, in meters. (For WGS84 datum, use 6378137.0) - // double f: - // Ellipsoid flattening. (For WGS84 datum, use 1 / 298.257223563) - // int& utmXZone: - // Upon exit, this parameter will contain the hotizontal zone number of - // the UTM coordinate. The returned value for this parameter is a number - // within the range 1 to 60, inclusive. - // char& utmYZone: - // Upon exit, this parameter will contain the zone letter of the UTM - // coordinate. The returned value for this parameter will be one of: - // CDEFGHJKLMNPQRSTUVWX. - // double& easting: - // Upon exit, this parameter will contain the UTM easting, in meters. - // double& northing: - // Upon exit, this parameter will contain the UTM northing, in meters. - // double lat, double lon: - // The lat/lon coordinate to convert. - // Notes: - // - The code in this function is a C conversion of some of the source code - // from the Mapping Datum Transformation Software (MADTRAN) program, - // written in PowerBasic. To get the source code for MADTRAN, go to: - // - // http://164.214.2.59/publications/guides/MADTRAN/index.html - // - // and download MADTRAN.ZIP - // - If the UTM zone is out of range, the y-zone character is set to the - // asterisk character ('*'). -{ - double recf; - double b; - double eSquared; - double e2Squared; - double tn; - double ap; - double bp; - double cp; - double dp; - double ep; - double olam; - double dlam; - double s; - double c; - double t; - double eta; - double sn; - double tmd; - double t1, t2, t3, t6, t7; - double nfn; - - if (lon <= 0.0) { - utmXZone = 30 + (int)(lon / 6.0); - } else { - utmXZone = 31 + (int)(lon / 6.0); - } - if (lat < 84.0 && lat >= 72.0) { - // Special case: zone X is 12 degrees from north to south, not 8. - utmYZone = cArray[19]; - } else { - utmYZone = cArray[(int)((lat + 80.0) / 8.0)]; - } - if (lat >= 84.0 || lat < -80.0) { - // Invalid coordinate; the vertical zone is set to the invalid - // character. - utmYZone = '*'; - } - - double latRad = lat * DEG_TO_RAD; - double lonRad = lon * DEG_TO_RAD; - recf = 1.0 / f; - b = a * (recf - 1.0) / recf; - eSquared = calculateESquared (a, b); - e2Squared = calculateE2Squared (a, b); - tn = (a - b) / (a + b); - ap = a * (1.0 - tn + 5.0 * ((tn * tn) - (tn * tn * tn)) / 4.0 + 81.0 * - ((tn * tn * tn * tn) - (tn * tn * tn * tn * tn)) / 64.0); - bp = 3.0 * a * (tn - (tn * tn) + 7.0 * ((tn * tn * tn) - - (tn * tn * tn * tn)) / 8.0 + 55.0 * (tn * tn * tn * tn * tn) / 64.0) - / 2.0; - cp = 15.0 * a * ((tn * tn) - (tn * tn * tn) + 3.0 * ((tn * tn * tn * tn) - - (tn * tn * tn * tn * tn)) / 4.0) / 16.0; - dp = 35.0 * a * ((tn * tn * tn) - (tn * tn * tn * tn) + 11.0 - * (tn * tn * tn * tn * tn) / 16.0) / 48.0; - ep = 315.0 * a * ((tn * tn * tn * tn) - (tn * tn * tn * tn * tn)) / 512.0; - olam = (utmXZone * 6 - 183) * DEG_TO_RAD; - dlam = lonRad - olam; - s = sin (latRad); - c = cos (latRad); - t = s / c; - eta = e2Squared * (c * c); - sn = sphsn (a, eSquared, latRad); - tmd = sphtmd (ap, bp, cp, dp, ep, latRad); - t1 = tmd * ok; - t2 = sn * s * c * ok / 2.0; - t3 = sn * s * (c * c * c) * ok * (5.0 - (t * t) + 9.0 * eta + 4.0 - * (eta * eta)) / 24.0; - if (latRad < 0.0) nfn = 10000000.0; else nfn = 0; - northing = nfn + t1 + (dlam * dlam) * t2 + (dlam * dlam * dlam - * dlam) * t3 + (dlam * dlam * dlam * dlam * dlam * dlam) + 0.5; - t6 = sn * c * ok; - t7 = sn * (c * c * c) * (1.0 - (t * t) + eta) / 6.0; - easting = fe + dlam * t6 + (dlam * dlam * dlam) * t7 + 0.5; - if (northing >= 9999999.0) northing = 9999999.0; -} - - -void UTMCoord::latLonToUTMWGS84 (int& utmXZone, char& utmYZone, - double& easting, double& northing, double lat, double lon) const - // Purpose: - // This function converts the specified lat/lon coordinate to a UTM - // coordinate in the WGS84 datum. (See the comment block for the - // LatLonToUTM() member function.) -{ - latLonToUTM (6378137.0, 1 / 298.257223563, utmXZone, utmYZone, - easting, northing, lat, lon); -} - - -void UTMCoord::setLatLonCoord (double lat, double lon) - // Purpose: - // This function sets the UTM coordinate given a latitude and a longitude. -{ - m_lat = lat; - m_lon = lon; - - // No conversion between UTM and lat/lon is necessary, since this function - // has set a new lat/lon coordinate. - m_requireLatLonConvert = false; - // Do not perform the conversion between lat/lon and UTM now; wait until - // the user requests the UTM coordinate. - m_requireUTMConvert = true; -} - - -void UTMCoord::setUTMCoord (int utmXZone, char utmYZone, double easting, - double northing) -{ - m_easting = easting; - m_northing = northing; - m_utmXZone = utmXZone; - m_utmYZone = utmYZone; - - // Do not perform the conversion between UTM and lat/lon now; wait until - // the user requests the lat/lon coordinate. - m_requireLatLonConvert = true; - // No conversion between lat/lon and UTM is necessary, since this function - // has set a new UTM coordinate. - m_requireUTMConvert = false; -} - - -void UTMCoord::utmToLatLon (double a, double f, int utmXZone, char utmYZone, - double easting, double northing, double& lat, double& lon) const - // Purpose: - // This function converts the specified UTM coordinate to a lat/lon - // coordinate. - // Pre: - // - utmXZone must be between 1 and 60, inclusive. - // - utmYZone must be one of: CDEFGHJKLMNPQRSTUVWX - // Parameters: - // double a: - // Ellipsoid semi-major axis, in meters. (For WGS84 datum, use 6378137.0) - // double f: - // Ellipsoid flattening. (For WGS84 datum, use 1 / 298.257223563) - // int utmXZone: - // The horizontal zone number of the UTM coordinate. - // char utmYZone: - // The vertical zone letter of the UTM coordinate. - // double easting, double northing: - // The UTM coordinate to convert. - // double& lat: - // Upon exit, lat contains the latitude. - // double& lon: - // Upon exit, lon contains the longitude. - // Notes: - // The code in this function is a C conversion of some of the source code - // from the Mapping Datum Transformation Software (MADTRAN) program, written - // in PowerBasic. To get the source code for MADTRAN, go to: - // - // http://164.214.2.59/publications/guides/MADTRAN/index.html - // - // and download MADTRAN.ZIP -{ - double recf; - double b; - double eSquared; - double e2Squared; - double tn; - double ap; - double bp; - double cp; - double dp; - double ep; - double nfn; - double tmd; - double sr; - double sn; - double ftphi; - double s; - double c; - double t; - double eta; - double de; - double dlam; - double olam; - - recf = 1.0 / f; - b = a * (recf - 1) / recf; - eSquared = calculateESquared (a, b); - e2Squared = calculateE2Squared (a, b); - tn = (a - b) / (a + b); - ap = a * (1.0 - tn + 5.0 * ((tn * tn) - (tn * tn * tn)) / 4.0 + 81.0 * - ((tn * tn * tn * tn) - (tn * tn * tn * tn * tn)) / 64.0); - bp = 3.0 * a * (tn - (tn * tn) + 7.0 * ((tn * tn * tn) - - (tn * tn * tn * tn)) / 8.0 + 55.0 * (tn * tn * tn * tn * tn) / 64.0) - / 2.0; - cp = 15.0 * a * ((tn * tn) - (tn * tn * tn) + 3.0 * ((tn * tn * tn * tn) - - (tn * tn * tn * tn * tn)) / 4.0) / 16.0; - dp = 35.0 * a * ((tn * tn * tn) - (tn * tn * tn * tn) + 11.0 - * (tn * tn * tn * tn * tn) / 16.0) / 48.0; - ep = 315.0 * a * ((tn * tn * tn * tn) - (tn * tn * tn * tn * tn)) / 512.0; - if ((utmYZone <= 'M' && utmYZone >= 'C') - || (utmYZone <= 'm' && utmYZone >= 'c')) { - nfn = 10000000.0; - } else { - nfn = 0; - } - tmd = (northing - nfn) / ok; - sr = sphsr (a, eSquared, 0.0); - ftphi = tmd / sr; - double t10, t11, t14, t15; - for (int i = 0; i < 5; i++) { - t10 = sphtmd (ap, bp, cp, dp, ep, ftphi); - sr = sphsr (a, eSquared, ftphi); - ftphi = ftphi + (tmd - t10) / sr; - } - sr = sphsr (a, eSquared, ftphi); - sn = sphsn (a, eSquared, ftphi); - s = sin (ftphi); - c = cos (ftphi); - t = s / c; - eta = e2Squared * (c * c); - de = easting - fe; - t10 = t / (2.0 * sr * sn * (ok * ok)); - t11 = t * (5.0 + 3.0 * (t * t) + eta - 4.0 * (eta * eta) - 9.0 * (t * t) - * eta) / (24.0 * sr * (sn * sn * sn) * (ok * ok * ok * ok)); - lat = ftphi - (de * de) * t10 + (de * de * de * de) * t11; - t14 = 1.0 / (sn * c * ok); - t15 = (1.0 + 2.0 * (t * t) + eta) / (6 * (sn * sn * sn) * c - * (ok * ok * ok)); - dlam = de * t14 - (de * de * de) * t15; - olam = (utmXZone * 6 - 183.0) * DEG_TO_RAD; - lon = olam + dlam; - lon *= RAD_TO_DEG; - lat *= RAD_TO_DEG; -} - - -void UTMCoord::utmToLatLonWGS84 (int utmXZone, char utmYZone, double easting, - double northing, double& lat, double& lon) const - // Purpose: - // This function converts the specified UTM coordinate to a lat/lon - // coordinate in the WGS84 datum. (See the comment block for the - // UTMToLatLon() member function. -{ - utmToLatLon (6378137.0, 1 / 298.257223563, utmXZone, utmYZone, - easting, northing, lat, lon); -} diff --git a/src/vrpn/gpsnmealib/utmCoord.h b/src/vrpn/gpsnmealib/utmCoord.h deleted file mode 100644 index 53c82721a6c444a30ec77cc531a435525a3b787c..0000000000000000000000000000000000000000 --- a/src/vrpn/gpsnmealib/utmCoord.h +++ /dev/null @@ -1,97 +0,0 @@ -// UtmCoord.h: Definition of the CUtmCoord class. -// -// This class represents a coordinate on the UTM grid. -// -// Like all other typed coordinate classes, this class contains an internal -// lat/lon coordinate. This lat/lon coordinate is created by converting the -// lat/lon coordinate from a UTM coordinate. Since either lat/lon or UTM can -// be set and read, a conversion may be necessary from one type to another. -// This conversion is quite slow on machines without FPUs, so these conver- -// sions are done internally only when the converted coordinates are required -// by code using a UTM object (this is known as 'lazy evaluation.') In order -// to implement this lazy evaluation code, this class uses member functions -// to access the coordinates (since those member functions modify the lazy -// evaluation flags), rather than manipulating the coordinates directly. -// -// If the lat/lon coordinate contained within an object of this class is -// outside of the UTM grid boundary (>= 84 N or <= 80 S), the vertical UTM -// zone character is set to an asterisk ('*'). You can check the vertical -// UTM zone contained within this class to determine if the coordinate is -// outside of the UTM grid boundary. -// -// Written by Jason Bevins in 1998. File is in the public domain. -// - -#ifndef __UTM_COORD_HPP -#define __UTM_COORD_HPP - -#include <string> // for string - -#include "typedCoord.h" // for COORD_TYPE, etc - -// These constants are used by the CreateDisplayStrings() and the -// CreateXYCoordStrings() functions to parse the string generated by the -// CreateCoordString() function. Modify these constants when you modify the -// code that generates the string. These constants do not affect the code -// that generate these strings, but you may write parsing functions that -// require the positions of the individual elements in the strings. -const int UTM_ZONE_POS = 0; -const int UTM_ZONE_LEN = 3; -const int UTM_EASTING_POS = 4; -const int UTM_EASTING_LEN = 6; -const int UTM_NORTHING_POS = 11; -const int UTM_NORTHING_LEN = 7; - - -class UTMCoord: public TypedCoord -{ -public: - UTMCoord (); - UTMCoord (int utmXZone, char utmYZone, double easting, - double northing); - UTMCoord (const TypedCoord& other); - UTMCoord (const UTMCoord& other); - void copyUTMCoord (const UTMCoord& other); - void copyOtherCoord (const TypedCoord& other); - UTMCoord& operator= (const UTMCoord& other); - UTMCoord& operator= (const TypedCoord& other); - virtual const std::string& createCoordString (std::string& coordString) const; - virtual void createDisplayStrings (std::string& topLeftString, - std::string& topRightString, std::string& bottomLeftString, - std::string& bottomRightString) const; - virtual void createXYCoordStrings (std::string& xString, std::string& yString) - const; - virtual COORD_TYPE getCoordType () const {return COORD_UTM;} - virtual void getLatLonCoord (double& lat, double& lon) const; - virtual void getUTMCoord (int& utmXZone, char& utmYZone, - double& easting, double& northing) const; - void getUTMZone (int& utmXZone, char& utmYZone) const; - virtual void getXYCoord (double& x, double& y) const; - bool isOutsideUTMGrid () const; - virtual void setLatLonCoord (double lat, double lon); - virtual void setUTMCoord (int utmXZone, char utmYZone, double easting, - double northing); - -protected: - // Lazy evaluation flags. - mutable bool m_requireLatLonConvert; - mutable bool m_requireUTMConvert; - - // UTM conversion functions. - void latLonToUTM (double a, double f, int& utmXZone, char& utmYZone, - double& easting, double& northing, double lat, double lon) const; - void latLonToUTMWGS84 (int& utmXZone, char& utmYZone, double& easting, - double& northing, double lat, double lon) const; - void utmToLatLon (double a, double f, int utmXZone, char utmYZone, - double easting, double northing, double& lat, double& lon) const; - void utmToLatLonWGS84 (int utmXZone, char utmYZone, double easting, - double northing, double& lat, double& lon) const; - - // UTM values. - mutable int m_utmXZone; - mutable char m_utmYZone; - mutable double m_easting; - mutable double m_northing; -}; - -#endif // _UTM_COORD_HPP diff --git a/src/vrpn/hid_gui/CMakeLists.txt b/src/vrpn/hid_gui/CMakeLists.txt deleted file mode 100644 index 8d1a69a96e127b4783997e56fd5ebc51b0e89502..0000000000000000000000000000000000000000 --- a/src/vrpn/hid_gui/CMakeLists.txt +++ /dev/null @@ -1,54 +0,0 @@ - -if(NOT VRPN_BUILD_SERVER_LIBRARY OR NOT VRPN_USE_HID) - message(FATAL_ERROR - "Cannot compile HID gui without the full (server) library and HID support. Enable it and try again.") -endif() - -set(VRPN_SERVER_LIBRARY vrpnserver) - -if(NOT WIN32) - set(VRPN_ATMEL_LIBRARY vrpn_atmel) -endif() - -set(SOURCES - HIDDevice.cpp - Inspector.cpp - main.cpp - MainWindow.cpp - QuickChart.cpp) - -set(HEADERS) - -set(MOCS - HIDDevice.h - Inspector.h - MainWindow.h - QuickChart.h) - -set(UIS - mainwindow.ui - plot.ui) - -find_package(Qt4 4.7) -if(QT_FOUND) - include(${QT_USE_FILE}) - qt4_wrap_ui(GENERATED_SOURCES ${UIS}) - qt4_wrap_cpp(GENERATED_SOURCES ${MOCS}) - - source_group("Generated Sources - Do Not Edit" - FILES - ${GENERATED_SOURCES}) - include_directories(${CMAKE_CURRENT_BINARY_DIR}) - - # Build and link the app! - add_executable(vrpn_hid_gui - MACOSX_BUNDLE - ${SOURCES} - ${GENERATED_SOURCES} - ${HEADERS} - ${UIS} - ${MOCS} - ${RESOURCES}) - target_link_libraries(vrpn_hid_gui ${QT_LIBRARIES} vrpnserver) -endif() - diff --git a/src/vrpn/hid_gui/HIDDevice.cpp b/src/vrpn/hid_gui/HIDDevice.cpp deleted file mode 100644 index 24337f962df21b3a716a0b81f049612cf9852151..0000000000000000000000000000000000000000 --- a/src/vrpn/hid_gui/HIDDevice.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/** - @file - @brief Implementation - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// Internal Includes -#include "HIDDevice.h" -#include "vrpn_HumanInterface.h" - -// Library/third-party includes -#include <QDateTime> - -// Standard includes -// - none -class HIDDevice::VRPNDevice : public vrpn_HidInterface { - HIDDevice * _container; - - public: - VRPNDevice(vrpn_HidAcceptor * acceptor, HIDDevice * container) - : vrpn_HidInterface(acceptor) - , _container(container) - {} - protected: - void on_data_received(size_t bytes, vrpn_uint8 *buffer) { - _container->send_data_signal(bytes, reinterpret_cast<char *>(buffer)); - } - -}; - -HIDDevice::HIDDevice(vrpn_HidAcceptor * acceptor, QObject * parent) - : QObject(parent) - , _connected(false) - , _device(new VRPNDevice(acceptor, this)) - , _startingTimestamp(-1) {} - -HIDDevice::~HIDDevice() { - delete _device; - _device = NULL; -} - -void HIDDevice::do_update() { - bool wasConnected = _connected; - _connected = _device->connected(); - - if (_connected && !wasConnected) { - emit message("Connected to device!"); - } else if (!_connected && wasConnected) { - emit message("Lost connection to device!"); - } - _device->update(); -} - - - -void HIDDevice::send_data_signal(size_t bytes, const char * buffer) { - qint64 current = QDateTime::currentMSecsSinceEpoch(); - if (_startingTimestamp < 0) { - _startingTimestamp = current; - } - emit inputReport(QByteArray(buffer, bytes), current - _startingTimestamp); -} - -void HIDDevice::send_message_signal(QString const& msg) { - emit message(msg); -} diff --git a/src/vrpn/hid_gui/HIDDevice.h b/src/vrpn/hid_gui/HIDDevice.h deleted file mode 100644 index f948b3789165c844b4fa1f9ae2e4eed0a2827bdd..0000000000000000000000000000000000000000 --- a/src/vrpn/hid_gui/HIDDevice.h +++ /dev/null @@ -1,57 +0,0 @@ -/** @file - @brief Header - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -// Internal Includes -#include "vrpn_Shared.h" - -// Library/third-party includes -#include <QObject> -#include <QByteArray> -#include <QString> - -// Standard includes -// - none - -class vrpn_HidAcceptor; - -/// Qt wrapper for a debugging HidInterface. -class HIDDevice: public QObject { - Q_OBJECT - public: - explicit HIDDevice(vrpn_HidAcceptor * acceptor, QObject * parent = NULL); - ~HIDDevice(); - signals: - void inputReport(QByteArray buffer, qint64 timestamp); - void message(QString const& msg); - - public slots: - void do_update(); - - protected: - bool _connected; - class VRPNDevice; - friend class HIDDevice::VRPNDevice; - void send_data_signal(size_t bytes, const char * buffer); - void send_message_signal(QString const& msg); - VRPNDevice * _device; - qint64 _startingTimestamp; - -}; - diff --git a/src/vrpn/hid_gui/Inspector.cpp b/src/vrpn/hid_gui/Inspector.cpp deleted file mode 100644 index 8c547ee671a229f06641284441dc3e45245f4a69..0000000000000000000000000000000000000000 --- a/src/vrpn/hid_gui/Inspector.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/** - @file - @brief Implementation - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// Internal Includes -#include "Inspector.h" -#include "vrpn_Shared.h" - -// Library/third-party includes -// - none - -// Standard includes -#include <stdexcept> -#include <iostream> -//#include <stdint.h> - -template<typename T> -T getFromByteArray(QByteArray const& input) { - union { - char bytes[sizeof(T)]; - T value; - }; - for (int i = 0; i < sizeof(T); ++i) { - bytes[i] = input.at(i); - } - return value; -} - -Inspector::Inspector(std::size_t first_index, std::size_t length, bool signedVal, bool bigEndian, QObject * parent) - : QObject(parent) - , _first(first_index) - , _length(length) - , _signed(signedVal) - , _bigEndian(bigEndian) { - switch (_length) { - case 1: - case 2: - case 4: - break; - default: - throw std::logic_error("Can't get an integer with that many bytes!"); - } -} - - -void Inspector::updatedData(QByteArray buf, qint64 timestamp) { - QByteArray myPortion; - myPortion.reserve(_length); - if (!_bigEndian) { - myPortion = buf.mid(_first, _length); - } else { - unsigned i; - for (i = 0; i < _length; ++i) { - myPortion.prepend(buf.at(_first + i)); - } - - } - - switch (_length) { - case 1: - _sendNewValue(timestamp, _signed ? - myPortion.at(0) - : getFromByteArray<vrpn_uint8>(myPortion)); - break; - case 2: - - _sendNewValue(timestamp, _signed ? - getFromByteArray<vrpn_int16>(myPortion) : - getFromByteArray<vrpn_uint16>(myPortion)); - break; - case 4: - _sendNewValue(timestamp, _signed ? - getFromByteArray<vrpn_int32>(myPortion) : - getFromByteArray<vrpn_uint32>(myPortion)); - break; - } -} - -void Inspector::_sendNewValue(qint64 timestamp, float val) { - emit newValue(val); - emit newValue(float(timestamp) / 1000.0f, val); -} diff --git a/src/vrpn/hid_gui/Inspector.h b/src/vrpn/hid_gui/Inspector.h deleted file mode 100644 index 0ca860e919b47c7953a6e08ca4d688ccaf06d9d8..0000000000000000000000000000000000000000 --- a/src/vrpn/hid_gui/Inspector.h +++ /dev/null @@ -1,51 +0,0 @@ -/** @file - @brief Header - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -// Internal Includes -// - none - -// Library/third-party includes -#include <QObject> -#include <QByteArray> - -// Standard includes -// - none - -/// Class to extract bytes from an array and turn into some kind of value -class Inspector : public QObject { - Q_OBJECT - public: - explicit Inspector(std::size_t first_index, std::size_t length, bool signedVal, bool bigEndian = false, QObject * parent = NULL); - ~Inspector() {} - - signals: - void newValue(float val); - void newValue(float elapsed, float val); - public slots: - void updatedData(QByteArray buf, qint64 timestamp); - - private: - void _sendNewValue(qint64 timestamp, float val); - std::size_t _first; - std::size_t _length; - bool _signed; - bool _bigEndian; -}; - diff --git a/src/vrpn/hid_gui/MainWindow.cpp b/src/vrpn/hid_gui/MainWindow.cpp deleted file mode 100644 index 3e5c826e669030417206a4de407d092f49c9a047..0000000000000000000000000000000000000000 --- a/src/vrpn/hid_gui/MainWindow.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/** - @file - @brief Implementation - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// Internal Includes -#include "MainWindow.h" -#include "ui_mainwindow.h" -#include "HIDDevice.h" -#include "Inspector.h" -#include "QuickChart.h" - -// Library/third-party includes -#include <QTimer> -#include <QInputDialog> - -// Standard includes -#include <cmath> - -MainWindow::MainWindow(vrpn_HidAcceptor * acceptor, QWidget * parent) - : QMainWindow(parent) - , ui(new Ui::MainWindow) - , _device(new HIDDevice(acceptor)) - , _timer(new QTimer) - , _singlebyteIntMenu(new QMenu) - , _multibyteIntMenu(new QMenu) - , _selectionLabel(new QLabel) { - - ui->setupUi(this); - /// When the device has a message, add it to the log. - connect(_device.data(), SIGNAL(message(QString const&)), ui->textLog, SLOT(append(QString const&))); - - /// When the device gets an input report, update our controls - connect(_device.data(), SIGNAL(inputReport(QByteArray, qint64)), this, SLOT(gotReport(QByteArray))); - - /// Update the HID device every 20 ms - connect(_timer.data(), SIGNAL(timeout()), _device.data(), SLOT(do_update())); - _timer->start(20); - - /// Widget for showing what offset and length are selected - statusBar()->addPermanentWidget(_selectionLabel); - _selectionLabel->setText(QString("No selected bytes")); - - /// Create context menu for when a single byte is selected - _singlebyteIntMenu->addAction(QString("Inspect as signed integer"), this, SLOT(addSignedLEInspector())); - _singlebyteIntMenu->addAction(QString("Inspect as unsigned integer"), this, SLOT(addUnsignedLEInspector())); - - /// Create context menu for when 2, 4 bytes are selected - QMenu * submenu = _multibyteIntMenu->addMenu(QString("Inspect as signed integer")); - submenu->addAction(QString("Big endian"), this, SLOT(addSignedBEInspector())); - submenu->addAction(QString("Little endian"), this, SLOT(addSignedLEInspector())); - - submenu = _multibyteIntMenu->addMenu(QString("Inspect as unsigned integer")); - submenu->addAction(QString("Big endian"), this, SLOT(addUnsignedBEInspector())); - submenu->addAction(QString("Little endian"), this, SLOT(addUnsignedLEInspector())); -} - -MainWindow::~MainWindow() { - delete ui; -} - -void MainWindow::gotReport(QByteArray buf) { - /// Update display of report size - ui->reportSizeLabel->setText(QString("%1 bytes").arg(buf.size())); - - /// Save selection range, if applicable - int initialStart = -1; - int initialLength = -1; - if (ui->reportContents->hasSelectedText()) { - initialStart = ui->reportContents->selectionStart(); - initialLength = ui->reportContents->selectedText().length(); - } - - /// Update text - ui->reportContents->setText(buf.toHex()); - - /// Restore selection range - if (initialStart >= 0) { - ui->reportContents->setSelection(initialStart, initialLength); - } -} - -void MainWindow::on_actionRemove_all_inspectors_triggered() { - /// remove all inspectors - _inspectors.clear(); - - /// remove all charts - QLayoutItem * child; - while ((child = ui->chartBox->takeAt(0)) != NULL) { - delete child->widget(); - delete child; - } -} - -void MainWindow::on_reportContents_selectionChanged() { - if (ui->reportContents->hasSelectedText()) { - const QPair<int, int> offsetLength = _getSelectionByteOffsetLength(); - const int byteOffset = offsetLength.first; - const int byteLength = offsetLength.second; - - const int initialStart = ui->reportContents->selectionStart(); - const int initialLength = ui->reportContents->selectedText().length(); - - /// Normalize selection if needed - if (initialStart != byteOffset * 2 || initialLength != byteLength * 2) { - ui->reportContents->setSelection(byteOffset * 2, byteLength * 2); - } - _selectionLabel->setText(QString("Offset %1, length %2").arg(byteOffset).arg(byteLength)); - } else { - _selectionLabel->setText(QString("No selected bytes")); - } -} - -void MainWindow::on_reportContents_customContextMenuRequested(const QPoint & pos) { - QPoint globalPos = ui->reportContents->mapToGlobal(pos); - const QPair<int, int> offsetLength = _getSelectionByteOffsetLength(); - const int byteLength = offsetLength.second; - switch (byteLength) { - case -1: - /// no selection, no menu. - statusBar()->showMessage("No bytes selected to inspect."); - break; - case 1: - /// Single byte - _singlebyteIntMenu->popup(globalPos); - break; - case 2: - case 4: - /// Valid multibyte - _multibyteIntMenu->popup(globalPos); - break; - default: - /// Some other number of bytes - not handled - statusBar()->showMessage("Can only inspect integers with powers of 2 lengths."); - break; - } -} - -QPair<int, int> MainWindow::_getSelectionByteOffsetLength() const { - if (ui->reportContents->hasSelectedText()) { - int initialStart = ui->reportContents->selectionStart(); - int initialLength = ui->reportContents->selectedText().length(); - - int endingCharacter = initialStart + initialLength; - - /// get the initial byte - int startingByte = initialStart / 2; - int endingByte = (endingCharacter + 1) / 2; - int byteLength = endingByte - startingByte; - return QPair<int, int>(startingByte, byteLength); - } - /// Default case for when there's no selection - return QPair<int, int>(-1, -1); -} - -void MainWindow::_addInspector(bool signedVal, bool bigEndian) { - const QPair<int, int> offsetLength = _getSelectionByteOffsetLength(); - const int byteOffset = offsetLength.first; - const int byteLength = offsetLength.second; - _addInspector(byteOffset, byteLength, signedVal, bigEndian); -} - -void MainWindow::_addInspector(std::size_t size, bool signedVal, bool bigEndian) { - bool ok; - std::size_t offset = QInputDialog::getInt(this, - QString("Starting index"), - QString("What (0-based) index should we start at? Current report length is %1.") - .arg(ui->reportSizeLabel->text()), - 0, 0, 255, 1, &ok); - if (ok) { - _addInspector(offset, size, signedVal, bigEndian); - } -} - - -void MainWindow::_addInspector(std::size_t offset, std::size_t size, bool signedVal, bool bigEndian) { - QuickChart * chart = new QuickChart(this); - int range = std::pow(2.0, 8.0 * size); - chart->setMin(signedVal ? - range / 2 : 0); - chart->setMax(signedVal ? range / 2 : range); - QString label = QString("Offset %1 as %2-endian %3 int %4") - .arg(offset) - .arg(bigEndian ? "big" : "little") - .arg(signedVal ? "signed" : "unsigned") - .arg(size * 8); - chart->setLabel(label); - ui->chartBox->addWidget(chart); - - InspectorPtr inspect(new Inspector(offset, size, signedVal, bigEndian)); - connect(_device.data(), SIGNAL(inputReport(QByteArray, qint64)), inspect.data(), SLOT(updatedData(QByteArray, qint64))); - connect(inspect.data(), SIGNAL(newValue(float, float)), chart, SLOT(addSample(float, float))); - _inspectors.push_back(inspect); -} diff --git a/src/vrpn/hid_gui/MainWindow.h b/src/vrpn/hid_gui/MainWindow.h deleted file mode 100644 index e450999e3f143aed93b029db3774f94eb0257113..0000000000000000000000000000000000000000 --- a/src/vrpn/hid_gui/MainWindow.h +++ /dev/null @@ -1,123 +0,0 @@ -/** @file - @brief Header - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -// Internal Includes -// - none - -// Library/third-party includes -#include <QMainWindow> -#include <QSharedPointer> -#include <QPair> - -// Standard includes -// - none - - -namespace Ui { - class MainWindow; -} -class QTimer; -class QLabel; -class QMenu; - -class HIDDevice; -class vrpn_HidAcceptor; -class Inspector; - -class MainWindow : public QMainWindow { - Q_OBJECT - - public: - explicit MainWindow(vrpn_HidAcceptor * acceptor, QWidget *parent = 0); - ~MainWindow(); - - public slots: - void gotReport(QByteArray buf); - - void addSignedLEInspector() { - _addInspector(true, false); - } - void addUnsignedLEInspector() { - _addInspector(false, false); - } - - void addSignedBEInspector() { - _addInspector(true, true); - } - void addUnsignedBEInspector() { - _addInspector(false, true); - } - - void on_actionInt8_2_triggered() { - _addInspector(1, true, false); - } - - void on_actionUint8_2_triggered() { - _addInspector(1, false, false); - } - - void on_actionInt16_LE_triggered() { - _addInspector(2, true, false); - } - void on_actionInt16_BE_triggered() { - _addInspector(2, true, true); - } - - void on_actionUint16_LE_triggered() { - _addInspector(2, false, false); - } - void on_actionUint16_BE_triggered() { - _addInspector(2, false, true); - } - - void on_actionRemove_all_inspectors_triggered(); - - void on_reportContents_selectionChanged(); - - void on_reportContents_customContextMenuRequested(const QPoint & pos); - - private: - /// @brief return the offset and the length, in bytes, of the selection, - /// or -1, -1 if no selection. - QPair<int, int> _getSelectionByteOffsetLength() const; - - /// @brief Helper function to add an inspector from the selection - void _addInspector(bool signedVal, bool bigEndian); - - /// @brief Helper function to add an inspector from the menu, prompting for offset - void _addInspector(std::size_t size, bool signedVal, bool bigEndian); - - /// @brief Helper function called by the other overloads adding an inspector once - /// we know all the parameters - void _addInspector(std::size_t offset, std::size_t size, bool signedVal, bool bigEndian); - - typedef QSharedPointer<Inspector> InspectorPtr; - Ui::MainWindow *ui; - QSharedPointer<HIDDevice> _device; - QSharedPointer<QTimer> _timer; - std::vector<InspectorPtr> _inspectors; - QSharedPointer<QMenu> _singlebyteIntMenu; - QSharedPointer<QMenu> _multibyteIntMenu; - - /// ownership transferred to status bar - QLabel * _selectionLabel; - -}; - diff --git a/src/vrpn/hid_gui/QuickChart.cpp b/src/vrpn/hid_gui/QuickChart.cpp deleted file mode 100644 index 226fe71c3d160f2a6b766102a3c37fe02140e81a..0000000000000000000000000000000000000000 --- a/src/vrpn/hid_gui/QuickChart.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/** - @file - @brief Implementation - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// Internal Includes -#include "QuickChart.h" -#include "ui_plot.h" - -// Library/third-party includes -#include <QGraphicsScene> - -// Standard includes -// - none - -QuickChart::QuickChart(QWidget * parent) - : QFrame(parent) - , ui(new Ui::Plot) - , _x(0) - , _last(0) - , _min(0) - , _max(255) - , _sampleWidth(10) - , _gotOne(false) - , _scene(new QGraphicsScene) { - ui->setupUi(this); - ui->graphicsView->setScene(_scene.data()); - updateViewFit(); -} - -QuickChart::~QuickChart() { - delete ui; -} - -void QuickChart::addSample(float sample) { - addSample(_x + 1, sample); -} - -void QuickChart::addSample(float x, float sample) { - if (_gotOne) { - _scene->addLine(_x, _last, x, sample); - } - _gotOne = true; - _last = sample; - _x = x; - setSceneRect(); - ui->lastValue->setText(QString("(%1, %2)").arg(x).arg(sample)); -} - -void QuickChart::updateViewFit() { - const QSize s = ui->graphicsView->size(); - const float h(s.height()); - const float w(s.width()); - const float xScale = w / _sampleWidth; - const float yScale = h / (_max - _min); - ui->graphicsView->setTransform(QTransform::fromScale(xScale, yScale).translate(-_min, 0)); - setSceneRect(); -} - -void QuickChart::setSceneRect() { - float xmin = 0; - float width = _x; - if (_x < _sampleWidth) { - xmin = _x - _sampleWidth; - width = _sampleWidth; - } - _scene->setSceneRect(xmin, _min, width, _max - _min); -} - -void QuickChart::setSampleWidth(float w) { - _sampleWidth = w; - updateViewFit(); -} - -void QuickChart::setLabel(QString const& l) { - ui->label->setText(l); -} diff --git a/src/vrpn/hid_gui/QuickChart.h b/src/vrpn/hid_gui/QuickChart.h deleted file mode 100644 index f4b4d323cdea5ad807d5507919cbd035d43ca02a..0000000000000000000000000000000000000000 --- a/src/vrpn/hid_gui/QuickChart.h +++ /dev/null @@ -1,91 +0,0 @@ -/** @file - @brief Header - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -// Internal Includes -// - none - -// Library/third-party includes -#include <QFrame> -#include <QSharedPointer> - -// Standard includes -// - none - -namespace Ui { - class Plot; -} - -class QGraphicsScene; - -class QuickChart : public QFrame { - Q_OBJECT - - public: - explicit QuickChart(QWidget *parent = 0); - ~QuickChart(); - - /// set minimum y value - void setMin(float v) { - _min = v; - updateViewFit(); - } - - /// get minimum y value - float getMin(void) const { - return _min; - } - - /// set maximum y value - void setMax(float v) { - _max = v; - updateViewFit(); - } - - /// get maximum y value - float getMax(void) const { - return _max; - } - - /// set width of x values we should fit in the control at once - void setSampleWidth(float w); - - /// Set the text of the label - void setLabel(QString const& l); - - public slots: - /// Add a sample, with x defaulted to 1 + previous x - void addSample(float sample); - /// Add a sample specifying both x and the sample (y) - void addSample(float x, float sample); - void updateViewFit(); - void setSceneRect(); - - private: - Ui::Plot *ui; - float _x; - float _last; - float _min; - float _max; - float _sampleWidth; - bool _gotOne; - QSharedPointer<QGraphicsScene> _scene; - -}; - diff --git a/src/vrpn/hid_gui/main.cpp b/src/vrpn/hid_gui/main.cpp deleted file mode 100644 index 31607b25ea0fcb5c216add04dba3bffa12eac6fa..0000000000000000000000000000000000000000 --- a/src/vrpn/hid_gui/main.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/** - @file - @brief Implementation - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// Internal Includes -#include "MainWindow.h" -#include "vrpn_HumanInterface.h" - -// Library/third-party includes -#include <QtGui/QApplication> - -// Standard includes -#include <sstream> -#include <stdio.h> - -int usage(char * argv0) { - printf("Usage:\n\n" - "%s -h|--help\n" - " Display this help text.\n\n" - - "%s [N]\n" - " Open HID device number N (default to 0)\n\n" - - "%s VEND PROD [N]\n" - " Open HID device number N (default to 0) that matches\n" - " vendor VEND and product PROD, in _decimal_\n\n" - - , - argv0, argv0, argv0); - return 1; -} - -int failedOnArgument(int argNum, const char * expected, char * argv[]) { - fprintf(stderr, "Failed to interpret argument %d: expected %s, got '%s' - usage help follows.\n\n", argNum, expected, argv[argNum]); - return usage(argv[0]); -} - -int main(int argc, char *argv[]) { - QApplication a(argc, argv); - - if (argc > 1 && (std::string("-h") == argv[1] || std::string("--help") == argv[1])) { - return usage(argv[0]); - } - vrpn_HidAcceptor * acceptor = NULL; - unsigned N = 0; // Which device to open? - if (argc >= 3) { - vrpn_uint16 vend; - std::istringstream vendS(argv[1]); - if (!(vendS >> vend)) { - return failedOnArgument(1, "a decimal vendor ID", argv); - } - - vrpn_uint16 prod; - std::istringstream prodS(argv[2]); - if (!(prodS >> prod)) { - return failedOnArgument(2, "a decimal product ID", argv); - } - - if (argc >= 4) { - std::istringstream nS(argv[3]); - if (!(nS >> N)) { - return failedOnArgument(3, "a number indicating which matching device to pick, or nothing for the default '0'", argv); - } - } - printf("Will accept HID device number %u that has vendor:product %04x:%04x\n", N, vend, prod); - acceptor = new vrpn_HidProductAcceptor(vend, prod); - } else { - if (argc == 2) { - std::istringstream nS(argv[1]); - if (!(nS >> N)) { - return failedOnArgument(1, "a number indicating which device to pick, or nothing for the default '0'", argv); - } - } - printf("Will accept HID device number %u\n", N); - acceptor = new vrpn_HidAlwaysAcceptor; - } - - MainWindow w(new vrpn_HidNthMatchAcceptor(N, acceptor)); - w.show(); - - return a.exec(); -} diff --git a/src/vrpn/hid_gui/mainwindow.ui b/src/vrpn/hid_gui/mainwindow.ui deleted file mode 100644 index d6d5b303e37864943ef5c125ad0eefa48695e363..0000000000000000000000000000000000000000 --- a/src/vrpn/hid_gui/mainwindow.ui +++ /dev/null @@ -1,229 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>800</width> - <height>768</height> - </rect> - </property> - <property name="windowTitle"> - <string>VRPN HID Tool</string> - </property> - <widget class="QWidget" name="centralwidget"> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QScrollArea" name="scrollArea"> - <property name="horizontalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="widgetResizable"> - <bool>true</bool> - </property> - <widget class="QWidget" name="scrollAreaWidgetContents"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>780</width> - <height>445</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <layout class="QVBoxLayout" name="chartBox"/> - </item> - </layout> - </widget> - </widget> - </item> - <item> - <layout class="QFormLayout" name="formLayout"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Last Report:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLabel" name="reportSizeLabel"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QLineEdit" name="reportContents"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <family>Courier New</family> - <pointsize>12</pointsize> - </font> - </property> - <property name="contextMenuPolicy"> - <enum>Qt::CustomContextMenu</enum> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QTextBrowser" name="textLog"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QMenuBar" name="menubar"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>800</width> - <height>23</height> - </rect> - </property> - <widget class="QMenu" name="menu_File"> - <property name="title"> - <string>&File</string> - </property> - <addaction name="action_Quit"/> - </widget> - <widget class="QMenu" name="menu_Inspect"> - <property name="title"> - <string>&Inspect</string> - </property> - <addaction name="actionInt8_2"/> - <addaction name="actionUint8_2"/> - <addaction name="actionInt16_LE"/> - <addaction name="actionInt16_BE"/> - <addaction name="actionUint16_LE"/> - <addaction name="actionUint16_BE"/> - <addaction name="separator"/> - <addaction name="actionRemove_all_inspectors"/> - </widget> - <addaction name="menu_File"/> - <addaction name="menu_Inspect"/> - </widget> - <widget class="QStatusBar" name="statusbar"/> - <action name="action_Quit"> - <property name="text"> - <string>&Quit</string> - </property> - <property name="shortcut"> - <string>Ctrl+Q</string> - </property> - </action> - <action name="actionUint8"> - <property name="text"> - <string>uint8</string> - </property> - </action> - <action name="actionInt8"> - <property name="text"> - <string>int8</string> - </property> - </action> - <action name="actionBig_Endian"> - <property name="text"> - <string>Big Endian</string> - </property> - </action> - <action name="actionLittle_Endian"> - <property name="text"> - <string>Little Endian</string> - </property> - </action> - <action name="actionInt8_LE"> - <property name="text"> - <string>int8 (LE)</string> - </property> - </action> - <action name="actionInt8_BE"> - <property name="text"> - <string>int8 (BE)</string> - </property> - </action> - <action name="actionInt8_2"> - <property name="text"> - <string>int8</string> - </property> - </action> - <action name="actionUint8_2"> - <property name="text"> - <string>uint8</string> - </property> - </action> - <action name="actionInt16_LE"> - <property name="text"> - <string>int16 (LE)</string> - </property> - </action> - <action name="actionInt16_BE"> - <property name="text"> - <string>int16 (BE)</string> - </property> - </action> - <action name="actionUint16_LE"> - <property name="text"> - <string>uint16 (LE)</string> - </property> - </action> - <action name="actionUint16_BE"> - <property name="text"> - <string>uint16 (BE)</string> - </property> - </action> - <action name="actionRemove_all_inspectors"> - <property name="text"> - <string>Remove all inspectors</string> - </property> - </action> - </widget> - <resources/> - <connections> - <connection> - <sender>action_Quit</sender> - <signal>activated()</signal> - <receiver>MainWindow</receiver> - <slot>close()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>399</x> - <y>299</y> - </hint> - </hints> - </connection> - </connections> -</ui> diff --git a/src/vrpn/hid_gui/plot.ui b/src/vrpn/hid_gui/plot.ui deleted file mode 100644 index b14bf6cc3b900f832f0063728f6fa8074e710dc1..0000000000000000000000000000000000000000 --- a/src/vrpn/hid_gui/plot.ui +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Plot</class> - <widget class="QFrame" name="Plot"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>633</width> - <height>116</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="windowTitle"> - <string>Frame</string> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QLabel" name="label"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="lastValue"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QGraphicsView" name="graphicsView"> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="renderHints"> - <set>QPainter::Antialiasing|QPainter::TextAntialiasing</set> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/vrpn/installers/Nikon_focus_control/Nikon_focus_control.qsp b/src/vrpn/installers/Nikon_focus_control/Nikon_focus_control.qsp deleted file mode 100644 index 3911d377828dfaca612e2f2b4e4ce67de1ce4a47..0000000000000000000000000000000000000000 --- a/src/vrpn/installers/Nikon_focus_control/Nikon_focus_control.qsp +++ /dev/null @@ -1,233 +0,0 @@ -[General] -FileVersion=1.1 -FileType=QSetupIniFile -ComposerVersion=5.0.0.0 -OperatingSystem=WinXP 5.1 2600 (Service Pack 2) - -[Project] -ProjectName=Nikon_focus_control -ProjectDirectory=F:\taylorr\STM\src\vrpn\installers\Nikon_focus_control -NonSFXDirectory=F:\taylorr\STM\src\vrpn\installers\Nikon_focus_control\NonSFX -MediaFileName=nikon_focus_control_v01.00 -CopyMediaToFName= -ProgramDescriptiveName=Nikon Focus Control v01.00 -ProgramVersion=01.00 -CompanyName=UNC Nanoscale Science Research Group -ProgVerLiveUpdate=0 -RegisterAsApp=1 -LanguageFlag=1 -LanguageNames=| -UseNonSFXDir=0 -ClrNonSFXDir=0 -CompressNonSFXFiles=0 -ForceCopyNonSFXFiles=0 -CompressionLevel=0 - -[Display] -AddSetupBackground=1 -SetupBackground3D=0 -TopLabel=1 -TopLabelVer=0 -TopLabel2=0 -BottomLabel=0 -TopLabelText="Nikon Focus Control v01.00" -TopLabel2Text="" -BottomLabelText="Copyright © 2004" -BackgroundDesign=Windmill (Right) -TopBackgroundColor=16758613 -BottomBackgroundColor=11613445 -AddBottomColor=1 -DlgBmp3DFrame=1 -DialogStyle=Modern -AddDialogBitmap=0 -DialogBitmapFileName= -AddBackgroundBitmap=0 -BackgroundBitmapFileName= -BackgroundBitmapLocation=|Top/Left|0|0| -AddBackgroundWave=0 -BgBmpTransparent=0 -BackgroundWaveFileName= -BackgroundWaveLocation=|Center|300|0| -BackgroundWaveLoop=1 -BackgroundWaveDelay=0 -AddBackgroundWaveSlider=1 -BackgroundWaveSliderType=Fixed -TopLabelSide=Left -TopLabel2Side=Left -BottomLabelSide=Left -DialogLocation=|Center|0|0| -TopLabelFont=|Tahoma|32|16777215|1|0|1|0| -TopLabel2Font=|Tahoma|16|16777215|1|0|1|0| -BottomLabelFont=|Tahoma|10|16777215|1|0|1|0| -CompanyUrl= - -[TargetExe] -TargetDirectory=<AbsoluteDir>C:\NSRG\bin\Nikon focus control 01.00 -CommonDirectory=<CommonFilesDir>UNC Nanoscale Science Research Group -AuxDirectory=<FontDir> -TargetExeName=<Application Folder>\vrpn_server.exe -RunTimeDir_1=|||||||1||||1||1|<ProgramFilesDir>||||| -RunTimeDir_2=|||||||1||||1||1|<ProgramFilesDir>||||| -RunTimeDir_3=|||||||1||||1||1|<ProgramFilesDir>||||| - -[Dialogs] -SelectedDialogs=*Welcome,License,Readme,User Information,Setup Type,Custom,*Destination,Associate,*Shortcuts,*Confirm Setup,*Copy Files,*Complete -LicenseTextFile= -ReadmeTextFile= -ReadmeTextFile2= -UseNotepad=0 -SpaceReqOnDriveCheckBox=0 -SpaceReqOnDrive= -RequestUserName=1 -RequestCompanyName=1 -RequestSerialNumberAlso=0 -MandatoryUserName=1 -MandatoryCompanyName=1 -MandatorySerialNumber=1 -RequestSerialCheckDLL=0 -SerialCheckDll= -RequestPredefinedSerial=0 -CaseSensitiveSerial=0 -RequestTokenizedSerial=0 -CDSetup=0 -ShowCompactSetupAlso=1 -ForcePartialSetup=0 -ShowProgBar2=0 -SilentSetup=0 -ProposeReadme=0 -ProposeLaunch=1 -ProposeRestart=0 -ProposeReadmeChecked=0 -ProposeLaunchChecked=0 -ShowCloseRecommendation=0 -ShowAdwareDisclaimer=0 -ShowCopyrightWarning=1 - -[Shortcuts] -AddMainShortCut=1 -ForceRemoveShortcutFolder=0 -ProgramLinkFolder=NSRG\Nikon Focus Control v01.00 -ProgramLinkName=VRPN Nikon Focus Control Server Artemis -ProgramLinkParam=-f vrpn_artemis.cfg -ProgramLinkWorkDir=<Application Folder> -ProgramLinkRun=Normal Window -ProgramLinkIconFile= -ProgramLinkIconNum=0 -StartMenuLinkName=Nikon Focus Control v01.00 -DesktopLinkName=Nikon Focus Control Artemis v01.00 -SendToLinkName=Nikon Focus Control v01.00 -StartUpLinkName=Nikon Focus Control v01.00 -QuickLaunchLinkName=Nikon Focus Control v01.00 -StartMenuCheckBox=0 -DesktopCheckBox=1 -SendToCheckBox=0 -StartUpCheckBox=0 -QuickLaunchCheckBox=0 -StartMenuChecked=1 -DesktopChecked=1 -SendToChecked=1 -StartUpChecked=1 -QuickLaunchChecked=1 -SetAllUsers=1 -AddUninstallShortcut=1 -Item-000=*|VRPN Nikon Focus Control Server Hercules|<Application Folder>\vrpn_server.exe|NSRG\Nikon Focus Control v01.00|-f vrpn_hercules.cfg|<Application Folder>|Normal Window||0|1||0| - -[Billboard] -AddBillboard=1 -Item-000=|1|0|0|1|0|Center|0|0|8388608|16711680|Verdana|14|16777215|1|0|360|360|0|1| - -[SplitSetup] -SplitSetup=0 -ForceDownload=1 -DownloadURL_SPLIT=http:// -ConfirmSplitDownload=0 - -[AutoUpdate] -AutoUpdate=0 -RunAutoUpdate=1 -AddAutoUpdateShortcut=1 -ReqConfirmDownload=0 -ReqConfirmInstall=0 -ShutDownMethod=Don't Shut Down -BackgroundUpdate=0 -RestartProcess=0 -InformFinish=0 -UpdateProjectFName= -DownloadURL_UPDATE=http:/ -NameOfUpdateFile= -RunningProcess= -VersionOriginal=1 -ValidVersions= -VersionNew=1 -ReAskDays=0 -AutoUpdateProbeSpin=1 -AutoUpdateProbeText=Only at Agent Start - -[Switches] -OperatingSystems=All,95,98,ME,NT,2000,XP,2003 -OverwriteFlag=1 -CreateUnInstall=1 -ScrambleUnInstallData=0 -HideErrMsgUnInstall=0 -HideLogBtnUnInstall=0 -AddRemoveProgramsUnInstall=1 -AddRemoveButtonButtonInstall=1 -UnInstallExeStampSwitch=0 -UnInstallExeStamp= -CreateLogFile=0 -ConfirmExtract=0 -TestAdminRights=0 -TestAdminRightsUnInstall=0 -SetAllowFullAccess=0 -TestDotNetFramework=0 -TestExeBeforeInstall=0 -TestExeBeforeUnInstall=0 -AutorunCreateInfFile=0 -AutorunTest=0 -AutorunStartApp=0 - -[Registry] - -[IniFile] - -[Environment] - -[Association] -OpenWith=0 -OpenWithName= -OpenWithMenuText=Open with -OpenWithExtensions= - -[VerInfo] -CopyFromExe=0 -DefineManually=0 -Item-001=|Comments|| -Item-002=|CompanyName|| -Item-003=|FileDescription|| -Item-004=|FileVersion|| -Item-005=|InternalName|| -Item-006=|LegalCopyright|| -Item-007=|LegalTrademarks|| -Item-008=|OriginalFilename|| -Item-009=|ProductName|| -Item-010=|ProductVersion|| -CopyIconFromTargetExe=0 -CopyIconFromOtherApp=0 -OtherIconAppFileName= -Spin1=0 -Spin2=0 - -[Execute] -ExecuteDllCheckBox=0 -ExecutionDllFileName= - -[GroupNames] -Group-000=Main Group - -[Group-000] -TypicalCompactData=15 -Description=This is the main group of files -Item-000=Fol*<Application Folder>[0] -Item-001=Fil*F:\taylorr\STM\src\vrpn\installers\Nikon_focus_control\vrpn_artemis.cfg -Item-002=Fil*F:\taylorr\STM\src\vrpn\installers\Nikon_focus_control\vrpn_hercules.cfg -Item-003=Fil*F:\taylorr\STM\src\vrpn\pc_win32\server_src\vrpn_server\Release\vrpn_server.exe diff --git a/src/vrpn/installers/Nikon_focus_control/nikon_artemis.cfg b/src/vrpn/installers/Nikon_focus_control/nikon_artemis.cfg deleted file mode 100644 index 3ab7cf0aaa010c20149291da80fc17b703a98ace..0000000000000000000000000000000000000000 --- a/src/vrpn/installers/Nikon_focus_control/nikon_artemis.cfg +++ /dev/null @@ -1,184 +0,0 @@ -################################################################################ -# VRPN generic object configuration file to run a Mad City Labs controller -# wrapped with Tracker and Poser servers, each of which is named "Focus". -# They report the Z value of the stage in meters and set the Z height in -# meters. -# This file contains the general set of servers that might be useful for -# running or testing the code, with the appropriate ones for the particular -# device uncommented and the rest commented out. - -################################################################################ -# NULL Tracker. This is a "device" that reports the Identity transformation for -# each of its sensors at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are three arguments: -# char name_of_this_device[] -# int number_of_sensors -# float rate_at_which_to_report_updates - -#vrpn_Tracker_NULL Focus 1 2.0 - -################################################################################ -# AnalogFly Tracker. This is a tracker that is intended to be used on top of -# a joystick or motion tracker of some kind to turn it into a moving or flying -# device. It could be used on top of any analog device, in fact. -# This device basically takes in analog signals and puts out transformation -# matrices. It should supercede the JoyFly tracker, since it is more general. -# There are two kinds of JoyFly's: absolute ones and differential ones. For -# absolute ones, the analog value is mapped directly to position or orientation -# on each axis. For differential ones, the values are used to create a -# "change" matrix that is applied once per interval, accumulating changes as -# it goes; this enables the user to "fly" along by holding a joystick forward, -# for example. -# One analog channel is associated with each axis (X, Y, Z) and rotation about -# each axis (RX, RY, RZ). For each axis, the value is converted to a position -# (meters) or speed (meters/second) for absolute trackers; or into an -# orientation (revolutions) or angular velocity (revolutions/second) by first -# subtracting an offset, then thresholding it to see if it is far enough from -# zero, then (if it is) scaling it and taking it to a power (to allow nonlinear -# speedup as the stick is pushed far from center). -# A button can be associated with a reset function, which will take the -# device back to center (identity transformation). The device will also recenter -# when the first connection is made to the server it is running on. (Centering -# has no effect on absolute AnalogFlys). -# Any axis or the reset button can be disabled by setting the name of its -# associated device to the string "NULL". -# Note that you could have multiple of these devices running simultaneously, -# each with a different name and interaction metaphor. The user could then -# connect to their favorite one. Arguments: -# char name_of_this_device[] -# float update_rate_to_send_tracker_reports -# char type[] = "absolute" or "differential" -# [six lines follow, one for X Y Z RX RY RZ, each with: -# char axis_name[] (X Y Z RX RY RZ in that order) -# char name_of_analog_device[] (start with * for local) -# int channel_of_analog_device -# float offset -# float threshold -# float scale -# float power -# ] -# [New line to describe reset button, with: -# char "RESET" -# char name_of_button_device[] (start with * for local) -# int which_button_to_use -# ] - -vrpn_Tracker_AnalogFly Focus 5.0 absolute -X NULL 0 0.0 0.0 1.0 1.0 -Y NULL 1 0.0 0.0 -1.0 1.0 -Z *Focus 0 0.0 0.0 0.02e-6 1.0 -RX NULL 3 0.0 0.0 1.0 1.0 -RY NULL 4 0.0 0.0 1.0 1.0 -RZ NULL 5 0.0 0.0 0.5 1.0 -RESET NULL 0 - -#vrpn_Tracker_AnalogFly Focus 60.0 absolute -#X *MCLXYZIN 4 0.0 0.0 10.0e-6 1.0 -#Y *MCLXYZIN 5 0.0 0.0 10.0e-6 1.0 -#Z *MCLXYZIN 6 0.0 0.0 10.0e-6 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ NULL 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Focus 60.0 absolute -#X NULL 0 0.0 0.0 1.0 1.0 -#Y NULL 1 0.0 0.0 -1.0 1.0 -#Z *Joystick0 6 -1.0 0.0 50e-6 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ NULL 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 - -################################################################################ -# Microsoft DirectX compatible force-feedback joystick (or non-force-feedback -# joystick). -# char name_of_this_device[] -# int number of times per second to read from the device -# int number of times per second to update force (0 for non-force device) - -#vrpn_DirectXFFJoystick Joystick0 60 200 -#vrpn_DirectXFFJoystick Joystick0 60 0 - -################################################################################ -# Analog Poser. This is a poser that is intended to be used on top of -# an analog output (perhaps a National Instruments board), whose outputs -# directly drive the position of some actuated stage. It could be used on top -# of any analog output device, in fact. This device basically takes in poses -# and puts out analog outputs. -# One analog channel is associated with each axis (X, Y, Z) and rotation about -# each axis (RX, RY, RZ). For each axis, the position (meters) is converted into -# a voltage; the orientation is mapped from a quaternion into Euler angles and -# each of the Euler angles is converted into a voltage (XXX Orientation is not yet -# implemented; the RX,RY, and RZ values must be specified but they are not used). -# XXX Velocity and orientation velocity are not yet supported. -# Any axis can be disabled by setting the name of its associated device to the -# string "NULL". -# -# Arguments: -# char vrpn_name_for_this_device[] -# char vrpn_name_of_the_analog_output_to_use[] -# (Preface with a * if it uses the same connection) -# [six lines follow, one for X Y Z RX RY RZ, each with: -# char axis_name[] (X Y Z RX RY RZ in that order) -# int channel_of_analog_output_device (First channel is channel 0) -# float offset -# float scale -# float min_value of workspace -# float max_value of workspace -# ] - -vrpn_Poser_Analog Focus 0 -X NULL 0 0.0 1.0 -10 10 -Y NULL 1 0.0 1.0 -10 10 -Z *Focus 0 0.0 50.0e6 0 4e-3 -RX NULL 0 0.0 1.0 -10 10 -RY NULL 0 0.0 1.0 -10 10 -RZ NULL 0 0.0 1.0 -10 10 - - -#vrpn_Poser_Analog Focus 0 -#X *MCLXYZOUT 0 0.0 0.1e6 0 10.0 -#Y *MCLXYZOUT 1 0.0 0.1e6 0 10.0 -#Z *MCLXYZOUT 2 0.0 0.1e6 0 10.0 -#RX NULL 0 0.0 1.0 -10 10 -#RY NULL 0 0.0 1.0 -10 10 -#RZ NULL 0 0.0 1.0 -10 10 - -################################################################################ -# Nikon microscope connected to PC via serial port. Currently only controls -# the focus of the microscope using an analogout and reads the focus position -# using an analog. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] - -vrpn_nikon_controls Focus COM1 - -################################################################################ -# National Instruments A/D, D/A Analog and Analog Output server. This will open -# the board whose name is specified, configure the number of channels specified, -# and set the polarity and maximum voltage range at which to read and -# drive the channels. -## -# Arguments: -# char vrpn_name_for_this_device[] -# char name_of_NationalInstruments_board[] -# int number_of_input_channels (can be zero) -# float mininum_delay_between_Analog_Reports (zero for fastest) -# int input_polarity : 0 = unipolar, 1 = bipolar -# int input_mode : 0 = differential, 1 = ref single-end, 2 = non-ref SE -# int input_range : 5 = 5v, 10 = 10v, 20 = 20v -# int input_drive_ais : 0 = no, 1 = yes -# int input_gain -# int number_of_output_channels (can be zero) -# int output_polarity : 0 = unipolar, 1 = bipolar -# float min_out_voltage (used to guard against overdriving devices) -# float max_out_voltage (used to guard against overdriving devices) - -# Input example -#vrpn_National_Instruments MCLXYZIN PCI-6052E 7 0 0 10 0 1 0 0 -10.0 10.0 -# Output examples -#vrpn_National_Instruments MCLXYZOUT PCI-6733 0 0 0 10 0 1 0 3 0 0.0 10.0 -#vrpn_National_Instruments Analog_XY DAQCard-6036E 0 0 0 0 10 0 1 2 1 -10.0 10.0 diff --git a/src/vrpn/installers/Nikon_focus_control/nikon_hercules.cfg b/src/vrpn/installers/Nikon_focus_control/nikon_hercules.cfg deleted file mode 100644 index 8320efd2d4ef7279d8abc5ce073ca7b0a30f9d76..0000000000000000000000000000000000000000 --- a/src/vrpn/installers/Nikon_focus_control/nikon_hercules.cfg +++ /dev/null @@ -1,184 +0,0 @@ -################################################################################ -# VRPN generic object configuration file to run a Mad City Labs controller -# wrapped with Tracker and Poser servers, each of which is named "Focus". -# They report the Z value of the stage in meters and set the Z height in -# meters. -# This file contains the general set of servers that might be useful for -# running or testing the code, with the appropriate ones for the particular -# device uncommented and the rest commented out. - -################################################################################ -# NULL Tracker. This is a "device" that reports the Identity transformation for -# each of its sensors at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are three arguments: -# char name_of_this_device[] -# int number_of_sensors -# float rate_at_which_to_report_updates - -#vrpn_Tracker_NULL Focus 1 2.0 - -################################################################################ -# AnalogFly Tracker. This is a tracker that is intended to be used on top of -# a joystick or motion tracker of some kind to turn it into a moving or flying -# device. It could be used on top of any analog device, in fact. -# This device basically takes in analog signals and puts out transformation -# matrices. It should supercede the JoyFly tracker, since it is more general. -# There are two kinds of JoyFly's: absolute ones and differential ones. For -# absolute ones, the analog value is mapped directly to position or orientation -# on each axis. For differential ones, the values are used to create a -# "change" matrix that is applied once per interval, accumulating changes as -# it goes; this enables the user to "fly" along by holding a joystick forward, -# for example. -# One analog channel is associated with each axis (X, Y, Z) and rotation about -# each axis (RX, RY, RZ). For each axis, the value is converted to a position -# (meters) or speed (meters/second) for absolute trackers; or into an -# orientation (revolutions) or angular velocity (revolutions/second) by first -# subtracting an offset, then thresholding it to see if it is far enough from -# zero, then (if it is) scaling it and taking it to a power (to allow nonlinear -# speedup as the stick is pushed far from center). -# A button can be associated with a reset function, which will take the -# device back to center (identity transformation). The device will also recenter -# when the first connection is made to the server it is running on. (Centering -# has no effect on absolute AnalogFlys). -# Any axis or the reset button can be disabled by setting the name of its -# associated device to the string "NULL". -# Note that you could have multiple of these devices running simultaneously, -# each with a different name and interaction metaphor. The user could then -# connect to their favorite one. Arguments: -# char name_of_this_device[] -# float update_rate_to_send_tracker_reports -# char type[] = "absolute" or "differential" -# [six lines follow, one for X Y Z RX RY RZ, each with: -# char axis_name[] (X Y Z RX RY RZ in that order) -# char name_of_analog_device[] (start with * for local) -# int channel_of_analog_device -# float offset -# float threshold -# float scale -# float power -# ] -# [New line to describe reset button, with: -# char "RESET" -# char name_of_button_device[] (start with * for local) -# int which_button_to_use -# ] - -vrpn_Tracker_AnalogFly Focus 5.0 absolute -X NULL 0 0.0 0.0 1.0 1.0 -Y NULL 1 0.0 0.0 -1.0 1.0 -Z *Focus 0 0.0 0.0 0.02e-6 1.0 -RX NULL 3 0.0 0.0 1.0 1.0 -RY NULL 4 0.0 0.0 1.0 1.0 -RZ NULL 5 0.0 0.0 0.5 1.0 -RESET NULL 0 - -#vrpn_Tracker_AnalogFly Focus 60.0 absolute -#X *MCLXYZIN 4 0.0 0.0 10.0e-6 1.0 -#Y *MCLXYZIN 5 0.0 0.0 10.0e-6 1.0 -#Z *MCLXYZIN 6 0.0 0.0 10.0e-6 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ NULL 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Focus 60.0 absolute -#X NULL 0 0.0 0.0 1.0 1.0 -#Y NULL 1 0.0 0.0 -1.0 1.0 -#Z *Joystick0 6 -1.0 0.0 50e-6 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ NULL 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 - -################################################################################ -# Microsoft DirectX compatible force-feedback joystick (or non-force-feedback -# joystick). -# char name_of_this_device[] -# int number of times per second to read from the device -# int number of times per second to update force (0 for non-force device) - -#vrpn_DirectXFFJoystick Joystick0 60 200 -#vrpn_DirectXFFJoystick Joystick0 60 0 - -################################################################################ -# Analog Poser. This is a poser that is intended to be used on top of -# an analog output (perhaps a National Instruments board), whose outputs -# directly drive the position of some actuated stage. It could be used on top -# of any analog output device, in fact. This device basically takes in poses -# and puts out analog outputs. -# One analog channel is associated with each axis (X, Y, Z) and rotation about -# each axis (RX, RY, RZ). For each axis, the position (meters) is converted into -# a voltage; the orientation is mapped from a quaternion into Euler angles and -# each of the Euler angles is converted into a voltage (XXX Orientation is not yet -# implemented; the RX,RY, and RZ values must be specified but they are not used). -# XXX Velocity and orientation velocity are not yet supported. -# Any axis can be disabled by setting the name of its associated device to the -# string "NULL". -# -# Arguments: -# char vrpn_name_for_this_device[] -# char vrpn_name_of_the_analog_output_to_use[] -# (Preface with a * if it uses the same connection) -# [six lines follow, one for X Y Z RX RY RZ, each with: -# char axis_name[] (X Y Z RX RY RZ in that order) -# int channel_of_analog_output_device (First channel is channel 0) -# float offset -# float scale -# float min_value of workspace -# float max_value of workspace -# ] - -vrpn_Poser_Analog Focus 0 -X NULL 0 0.0 1.0 -10 10 -Y NULL 1 0.0 1.0 -10 10 -Z *Focus 0 0.0 50.0e6 0 4e-3 -RX NULL 0 0.0 1.0 -10 10 -RY NULL 0 0.0 1.0 -10 10 -RZ NULL 0 0.0 1.0 -10 10 - - -#vrpn_Poser_Analog Focus 0 -#X *MCLXYZOUT 0 0.0 0.1e6 0 10.0 -#Y *MCLXYZOUT 1 0.0 0.1e6 0 10.0 -#Z *MCLXYZOUT 2 0.0 0.1e6 0 10.0 -#RX NULL 0 0.0 1.0 -10 10 -#RY NULL 0 0.0 1.0 -10 10 -#RZ NULL 0 0.0 1.0 -10 10 - -################################################################################ -# Nikon microscope connected to PC via serial port. Currently only controls -# the focus of the microscope using an analogout and reads the focus position -# using an analog. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] - -vrpn_nikon_controls Focus COM4 - -################################################################################ -# National Instruments A/D, D/A Analog and Analog Output server. This will open -# the board whose name is specified, configure the number of channels specified, -# and set the polarity and maximum voltage range at which to read and -# drive the channels. -## -# Arguments: -# char vrpn_name_for_this_device[] -# char name_of_NationalInstruments_board[] -# int number_of_input_channels (can be zero) -# float mininum_delay_between_Analog_Reports (zero for fastest) -# int input_polarity : 0 = unipolar, 1 = bipolar -# int input_mode : 0 = differential, 1 = ref single-end, 2 = non-ref SE -# int input_range : 5 = 5v, 10 = 10v, 20 = 20v -# int input_drive_ais : 0 = no, 1 = yes -# int input_gain -# int number_of_output_channels (can be zero) -# int output_polarity : 0 = unipolar, 1 = bipolar -# float min_out_voltage (used to guard against overdriving devices) -# float max_out_voltage (used to guard against overdriving devices) - -# Input example -#vrpn_National_Instruments MCLXYZIN PCI-6052E 7 0 0 10 0 1 0 0 -10.0 10.0 -# Output examples -#vrpn_National_Instruments MCLXYZOUT PCI-6733 0 0 0 10 0 1 0 3 0 0.0 10.0 -#vrpn_National_Instruments Analog_XY DAQCard-6036E 0 0 0 0 10 0 1 2 1 -10.0 10.0 diff --git a/src/vrpn/installers/Nikon_focus_control/vrpn_artemis.cfg b/src/vrpn/installers/Nikon_focus_control/vrpn_artemis.cfg deleted file mode 100644 index a5bc98b4d7747051891531526934cc2cdcf3e6aa..0000000000000000000000000000000000000000 --- a/src/vrpn/installers/Nikon_focus_control/vrpn_artemis.cfg +++ /dev/null @@ -1,1019 +0,0 @@ -# vrpn.cfg.SAMPLE for VRPN version 06.06 - -################################################################################ -################################################################################ -# This file provides comments and examples for the vrpn.cfg file that is read -# by the vrpn_server application when it starts up. This is a generic server -# application that can start up many but maybe not all servers. -# -# This has sample lines for a vrpn.cfg file. If you get a new device working, -# add a line for it here. DO NOT remove lines from this file (unless -# devices are declared obsolete) - just change the actual vrpn.cfg to match -# your application. -# -# All examples in the file are preceded by comment characters (#). To actually -# use one of these examples, remove that character from the beginning of all the -# examples that you want to use, and edit those lines to suit your environment. -################################################################################ - -################################################################################ -################################################################################ -# Tracker classes. Lines here to start various tracker servers. A description is -# provided for each type of tracker for the arguments it takes, then an example -# configuration line is provided. -################################################################################ - -################################################################################ -# NULL Tracker. This is a "device" that reports the Identity transformation for -# each of its sensors at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are three arguments: -# char name_of_this_device[] -# int number_of_sensors -# float rate_at_which_to_report_updates - -#vrpn_Tracker_NULL Tracker0 2 2.0 - -################################################################################ -# Flock-of-birds Tracker. Runs an Ascension Flock of Birds tracker that is -# attached to a serial port on this machine. Note that there is another driver -# (listed below) that runs the Flock when each sensor is connected to its own -# serial line. Arguments: -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int invert_quaternion (0 = no, 1 = yes) -# optionnal char useERT -# -# NOTE: for useERT: use nothing, y or Y if you have an extended range -# transmitter, use N or n if not (added by David Nahon for Virtools -# VRPack/SAS Cube. -# NOTE: The "invert_quaternion" parameter was added because there was a -# conflict between the code that had been around since VRPN started and -# the Flock documentation -- it looks like most people had been using the -# Flock in the "wrong" hemisphere, which inverted the orientation relative -# to the position. The old behavior is obtained by specifying "1". Not -# inverting it is specified using "0". - -#vrpn_Tracker_Flock Tracker0 4 /dev/ttyS0 1 115200 - -# If you have to FOB, with no Extended Range ctrler/transmitter, on Windows, use - -#vrpn_Tracker_Flock Tracker0 2 COM1 38400 1 N - -# Watch: be sure that the serial baud rate dip switches (the 3 on the left) -# of your master flock are properly set. -# You should try baud rates like 38400 before trying to go higher -# In normal address mode - less than 14 fob units - your switch should be: -# 0 1 2 3 4 5 6 7 -# 0 0 1 X X X X 0 2400 -# 0 1 0 X X X X 0 4800 -# 0 1 1 X X X X 0 9600 -# 1 0 0 X X X X 0 19200 -# 1 0 1 X X X X 0 38400 -# 1 1 0 X X X X 0 57600 -# 1 1 1 X X X X 0 115200 -# -# X X X X are used for coding the FOB address, they must be set correctly, -# even if you are only using 1 unit (standalone mode) -# the settings should be (in normal address mode): -# 3 4 5 6 -# 0 0 0 1 for the first unit -# 0 0 1 0 for the second unit -# 0 0 1 1 for the third -# 0 1 0 0 for the fourth -# 0 1 0 1 for the fifth -# ... -# -############################################################################ -# WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH -################### -# -# On windows at least, it might be necessary to cut your serial cable so as -# to only have Transmit, Receive and Ground pins. Even if CBIRDS or WINBIRDS -# are fine with a cable, it doesn't mean that this cable will please vrpn. -# This limitation should have been fixed with version 06.05. -# -################### - -################################################################################ -# Flock-of-birds in parallel Tracker. Runs an Ascension Flock of Birds tracker -# that has its source and each sensor plugged into its own serial port on this -# machine (perhaps through a Cyclades multi-port serial card). This mode of -# operation increases the throughput and decreases the latency of tracker reports. -# The arguments match those of the Flock-of-birds tracker from above, with the -# addition of the name of the serial ports for each of the sensors added at the -# end. Arguments (all on the same line): -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device_for_controller[] -# int baud_rate_of_serial_device -# int invert_quaternion (0 = no, 1 = yes) -# [one for each sensor] char name_of_serial_device_for_sensor[] -# -# NOTE: The "invert_quaternion" parameter was added because there was a -# conflict between the code that had been around since VRPN started and -# the Flock documentation -- it looks like most people had been using the -# Flock in the "wrong" hemisphere, which inverted the orientation relative -# to the position. The old behavior is obtained by specifying "1". Not -# inverting it is specified using "0". - -#vrpn_Tracker_Flock_Parallel Tracker0 4 /dev/ttyC4 115200 1 /dev/ttyC0 /dev/ttyC1 /dev/ttyC2 /dev/ttyC3 -#vrpn_Tracker_Flock_Parallel Tracker0 2 COM1 115200 1 COM2 COM3 - -################################################################################ -# Fastrak Tracker. Runs a Polhemus Fastrak tracker that is attached to a serial -# port on this machine. This driver will also run an InterSense IS600 or IS900 -# tracker, but you will want to include extra initialization code (as described -# below) to set up the ultrasonic pip information, wand devices, stylus devices -# and so forth. Arguments that go on the first line: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the Fastrak during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the Fastrak -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. -# -# If one or more sensors on the Fastrak have a stylus button on them, use -# the "FTStylus" command after the reset command lines (if any). There should -# be a front-slash "/" character at the end of the line before the FTStylus -# command. The command takes two arguments: the name of the button device -# that will report the buttons and the sensor number to which the button is -# attached (the first sensor is sensor 0). -# -# Commands to add Joysticks (2 buttons) or Wands (5 buttons and 2 analogs) to -# the various sensors on the Isense900 are done by adding Stylus and -# Wand command lines after the reset command lines. Each of these lines -# takes two arguments: the name of the button (for Stylus) or button and -# analog (for Wand) servers, and the sensor number (starting from 0). The -# Wand line takes eight additional parameters, which specify the scaling -# and clipping behavior of the two directions on the analog joystick. Each -# set of for is the min, lowzero, hizero, and max values: these are mapped -# to -1, 0,0, and 1 (all values between lowzero and hizero are mapped to 0). -# Start with these at -1,0,0,1 and use the 'printcereal' program or some other -# method to read them and see what the range of acheivable values is. Then, -# set them to slightly conservative values so that the whole range is covered -# and the analogs will report zero when the joystick is centered. The -# presence of these lines is indicated by placing them after any additional -# reset command lines, by ending the line preceding them with the front slash -# "/" character. -# -# Remember that the "remote" button object is not the same as the the tracking -# device, so be sure to use a remote button object that connects to the button -# rather than the tracker. The button device name is defined on the stylus or -# wand line in the config file, and should not be the same as the tracker. In -# the case described by the example configuration below, if the name of the -# machine running the server is "myis900server" you would connect to the tracker -# as "Isense900@myis900server" and to the buttons on the stylus as -# "Stylus0@myis900server": -# -# Note that this frontslash and backslash-notation can only be used for the -# Fastrak/Isense tracker, not to extend the line for any other type of device -# listed in this configuration file. - -# Vanilla Fastrak on on a Unix box -#vrpn_Tracker_Fastrak Fastrak0 /dev/ttyS0 19200 - -# Fastrak with a stylus on sensor zero on a Windows box -#vrpn_Tracker_Fastrak Tracker0 COM1 115200 / -#FTStylus Stylus0 0 - -# IS600 and its pip settings -#vrpn_Tracker_Fastrak Isense600 /dev/ttyS0 19200 \ -#MCc\ -#*5\ -#MCM1,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,89\ -#MCM1,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,87\ -#MCM2,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,66\ -#MCM2,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,71\ -#MCM3,1,0.1237,-0.0762,-0.0424,0.00,0.00,-1.00,82\ -#MCM3,2,0.1237,0.0762,-0.0424,0.00,0.00,-1.00,77\ -#MCe\ -#*10 - -# IS900 with a wand on the first sensor and a stylus on the third: -#vrpn_Tracker_Fastrak Isense900 COM1 115200 / -#Wand Wand0 0 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 / -#Stylus Stylus0 2 - -################################################################################ -# Liberty Tracker. Runs a Polhemus Liberty tracker that is attached to a serial -# port or USB port on this machine. Arguments that go on the first line -# char name_of_this_device[] -# char name_of_serial_or_usb_device[] -# int baud_rate_of_serial_device (not used when the device is USB) -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the Liberty during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the Fastrak -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. - -# ------------------------------------------- -# Example when Liberty is attached via USB -# The BAUD Rate is needed, although it is not used - -#vrpn_Tracker_Liberty Liberty /dev/usb/ttyUSB0 115200 - -#-------------------------------------------- -# Example when Liberty is attached via Serial - -#vrpn_Tracker_Liberty Liberty /dev/ttyS0 115200 - -################################################################################ -# InterSense tracker using the Intersense-provided library to communicate -# with the tracker. This device type is not compiled by default, since it uses -# a proprietary library. However, you can get it to compile by defining -# VRPN_INCLUDE_INTERSENSE when compiling. Note that the Fastrak driver will -# run IS-600 and IS-900 trackers without the proprietary library, so you might -# try that as well. -# -# You can include extra initialization code (as described -# below) to set up the ultrasonic pip information, wand devices, stylus devices -# and so forth. Arguments that go on the first line: -# char name_of_this_device[] -# char name_of_serial_device[] - this can be COM1-4 or AUTO -# AUTO will automatically find USB and -# serial trackers. Use COM1-4 only if you -# have more than one serial tracker. -# You should use COM1-4 on unix as well, -# as these just tell the isense library -# to look in serial port 1-4. -# I guess you can't have >1 USB trackers. -# char "IS900time" - use the IS900 timestamps (optional) -# char "ResetAtStartup" - resets all boresight and heading, on intertrax, -# equivalent to push the reset button -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the InterSense during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the InterSense -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. -# -# Commands to add Joysticks (2 buttons) or Wands (5 buttons and 2 analogs) to -# the various sensors on the Isense900 are done by adding Stylus and -# Wand command lines after the reset command lines. Each of these lines -# takes two arguments: the name of the button (for Stylus) or button and -# analog (for Wand) servers, and the sensor number (starting from 0). The -# Wand line takes eight additional parameters, which specify the scaling -# and clipping behavior of the two directions on the analog joystick. Each -# set of for is the min, lowzero, hizero, and max values: these are mapped -# to -1, 0,0, and 1 (all values between lowzero and hizero are mapped to 0). -# Start with these at -1,0,0,1 and use the 'printcereal' program or some other -# method to read them and see what the range of acheivable values is. Then, -# set them to slightly conservative values so that the whole range is covered -# and the analogs will report zero when the joystick is centered. The -# presence of these lines is indicated by placing them after any additional -# reset command lines, by ending the line preceding them with the front slash -# "/" character. -# -# Remember that the "remote" button object is not the same as the the tracking -# device, so be sure to use a remote button object that connects to the button -# rather than the tracker. The button device name is defined on the stylus or -# wand line in the config file, and should not be the same as the tracker. In -# the case described by the example configuration below, if the name of the -# machine running the server is "myis900server" you would connect to the tracker -# as "Isense900@myis900server" and to the buttons on the stylus as -# "Stylus0@myis900server": -# -# Note that this frontslash and backslash-notation can only be used for the -# Fastrak and InterSense tracker, not to extend the line for any other -# type of device -# listed in this configuration file. -# -# Note that this driver expects the device to be set to output centimeters, and will convert -# the positions to meters. It is recommanded to permanently set the units in the eeprom of your device. -# If this is not possible, you should add in this file the "u" reset command so as to have vrpn -# tell your device to use centimeters -# -#Vanilla InterSense -#vrpn_Tracker_InterSense Tracker0 AUTO IS900time - -# Vanilla InterSense using IS900 timing, with wand in port B (and possibly head tracker in port A) -#vrpn_Tracker_InterSense Tracker0 AUTO IS900time / -#Wand Wand0 1 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 - -# IS600 and its pip settings -#vrpn_Tracker_InterSense Isense600 COM1 \ -#MCc\ -#*5\ -#MCM1,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,89\ -#MCM1,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,87\ -#MCM2,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,66\ -#MCM2,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,71\ -#MCM3,1,0.1237,-0.0762,-0.0424,0.00,0.00,-1.00,82\ -#MCM3,2,0.1237,0.0762,-0.0424,0.00,0.00,-1.00,77\ -#MCe\ -#*10 - -# IS900 with a wand on the first sensor and a stylus on the third: -#vrpn_Tracker_InterSense Isense900 COM1 / -#Wand Wand0 0 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 / -#Stylus Stylus0 2 - -# Intertrax2 on USB, With automatic reset at startup -#vrpn_Tracker_InterSense Tracker0 AUTO ResetAtStartup - -################################################################################ -# Dynasight Tracker. Runs an Origin System's DynaSight tracker connected to a -# serial port on this machine. arguments: -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tracker_Dyna Tracker0 1 /dev/ttyS0 19200 - -#vrpn_Tracker_Dyna Tracker0 1 COM1 19200 - -################################################################################ -# AnalogFly Tracker. This is a tracker that is intended to be used on top of -# a joystick or motion tracker of some kind to turn it into a moving or flying -# device. It could be used on top of any analog device, in fact. -# This device basically takes in analog signals and puts out transformation -# matrices. It should supercede the JoyFly tracker, since it is more general. -# There are two kinds of JoyFly's: absolute ones and differential ones. For -# absolute ones, the analog value is mapped directly to position or orientation -# on each axis. For differential ones, the values are used to create a -# "change" matrix that is applied once per interval, accumulating changes as -# it goes; this enables the user to "fly" along by holding a joystick forward, -# for example. -# One analog channel is associated with each axis (X, Y, Z) and rotation about -# each axis (RX, RY, RZ). For each axis, the value is converted to a position -# (meters) or speed (meters/second) for absolute trackers; or into an -# orientation (revolutions) or angular velocity (revolutions/second) by first -# subtracting an offset, then thresholding it to see if it is far enough from -# zero, then (if it is) scaling it and taking it to a power (to allow nonlinear -# speedup as the stick is pushed far from center). -# A button can be associated with a reset function, which will take the -# device back to center (identity transformation). The device will also recenter -# when the first connection is made to the server it is running on. (Centering -# has no effect on absolute AnalogFlys). -# Any axis or the reset button can be disabled by setting the name of its -# associated device to the string "NULL". -# Note that you could have multiple of these devices running simultaneously, -# each with a different name and interaction metaphor. The user could then -# connect to their favorite one. Arguments: -# char name_of_this_device[] -# float update_rate_to_send_tracker_reports -# char type[] = "absolute" or "differential" -# [six lines follow, one for X Y Z RX RY RZ, each with: -# char axis_name[] (X Y Z RX RY RZ in that order) -# char name_of_analog_device[] (start with * for local) -# int channel_of_analog_device -# float offset -# float threshold -# float scale -# float power -# ] -# [New line to describe reset button, with: -# char "RESET" -# char name_of_button_device[] (start with * for local) -# int which_button_to_use -# ] - -#vrpn_Tracker_AnalogFly Tracker0 60.0 differential -#X *CerealBox0 4 0.0 0.021 1.0 1.0 -#Y *CerealBox0 5 0.0 0.021 1.0 1.0 -#Z *CerealBox0 6 0.0 0.021 3.0 1.0 -#RX *CerealBox0 0 0.0 0.021 1.0 1.0 -#RY *CerealBox0 1 0.0 0.021 1.0 1.0 -#RZ *CerealBox0 2 0.0 0.021 3.0 1.0 -#RESET *CerealBox 3 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 differential -#X *Magellan0 0 0.0 0.0 2.0 1.0 -#Y *Magellan0 1 0.0 0.0 2.0 1.0 -#Z *Magellan0 2 0.0 0.0 2.0 1.0 -#RX *Magellan0 3 0.0 0.0 2.0 1.0 -#RY *Magellan0 4 0.0 0.0 2.0 1.0 -#RZ *Magellan0 5 0.0 0.0 2.0 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X NULL 0 0.0 0.0 1.0 1.0 -#Y NULL 0 0.0 0.0 1.0 1.0 -#Z NULL 0 0.0 0.0 1.0 1.0 -#RX *Radamec0 1 0.0 0.0 -0.0027777777 1.0 -#RY NULL 0 0.0 0.0 1.0 1.0 -#RZ *Radamec0 0 0.0 0.0 0.0027777777 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Joystick0 0 0.0 0.0 1.0 1.0 -#Y *Joystick0 1 0.0 0.0 -1.0 1.0 -#Z *Joystick0 6 0.0 0.0 1.0 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Joystick0 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Phantom 60.0 absolute -#X *Phantom 0 0.0 0.0 0.125 1.0 -#Y *Phantom 1 0.0 0.0 -0.125 1.0 -#Z *Phantom 6 0.0 0.0 0.25 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Phantom 5 0.0 0.0 0.06 1.0 -#RESET NULL 0 - -# For DTU/MIC optical nanoHand stage motion, moving over full 300 micron range -# of motion, using the Logitech joystick for the analog -# server and the tracker_to_poser program. -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Joystick0 0 -0.03 0.0 2.53 1.0 -#Y *Joystick0 1 -0.04 0.0 2.53 1.0 -#Z *Joystick0 6 -0.10 0.0 -1.75 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Joystick0 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 - -# To drive a Tektronix 4662 full range (Z, RZ ignored) -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Joystick0 0 -1.0 0.0 0.19 1.0 -#Y *Joystick0 1 1.0 0.0 -0.13 1.0 -#Z *Joystick0 6 0.0 0.0 1.0 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Joystick0 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 - -################################################################################ -# XXX This device is superceded by the more-general vrpn_Tracker_AnalogFly. -# JoyFly Tracker. A vrpn_Tracker that translates the vrpn_Joystick into -# Walkthrough- convention tracker reports. This is part of a two-part setup -# that allows you to use a joystick as a flying device. First, a joystick -# device has to be created (named joybox in our example) that will produce -# the analog inputs that the JoyFly tracker uses to determine the transformation. -# Then, the JoyFly device needs to be started and will listen to the device -# and produce tracker reports. If these are both run on the same server, then -# the JoyFly needs to use the "server" connection to hear from the Joystick -# device, which is indicated by placing a '*' in front of the name of the -# joystick device that it is to use. If the joystick device is remote from -# this server, then the full name of it should be used (joystick@foo.cs.unc.edu). -# XXX This device is superceded by the more-general vrpn_Tracker_AnalogFly -# Arguments: -# char name_of_this_device[] -# char source_joystick_name[] (Start with * for one sharing a connection) -# char joystick_configuration_file_name[] - -#vrpn_JoyFly walk-joybox *joybox vrpn_Joyfly.cfg - -################################################################################ -# ButtonFly Tracker. This is a tracker that is intended to be used on top of -# a Global Haptics Orb or other buttond device to turn it into a moving or -# flying device. It basically takes in button signals and puts out -# transformation matrices. -# There are two kinds of Buttons: absolute ones and differential ones. For -# absolute ones, pressing it causes the position or orientation associated with -# it to be stored directly into the transformation. This enables the user to -# "teleport" to given locations by pressing buttons. For differential ones, -# the position or orientation are treated as deltas and are used to create a -# "change" matrix that is applied once per interval, accumulating changes as -# it goes; this enables the user to "fly" along by holding a button down, -# for example. -# Each button is associated with either a position (meters) or speed -# (meters/second) for absolute buttons; or an orientation (revolutions) -# or angular velocity (revolutions/second). -# An analog channel can be associated with a scale function that scales the -# velocity or angular velocity terms uniformly. The entry specifies an -# offset to be applied to the analog channel, a scale to be applied to it, -# and a power to which the result should be taken; the end result is used -# to scale all velocity or angular velocity terms. This channel has no -# effect on the effects of absolute buttons. -# The device will recenter (set itself to the identity transform) when the -# first connection is made to the server it is running on. -# Note that you could have multiple of these devices running simultaneously, -# each with a different name and interaction metaphor. The user could then -# connect to their favorite one. Arguments: -# char name_of_this_device[] -# float update_rate_to_send_tracker_reports -# [one or more lines follow, each of one of two types -# (1) char [] = "absolute" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float X_to_translate_to -# float Y_to_translate_to -# float Z_to_translate_to -# float rotation_about_X -# float rotation_about_Y -# float rotation_about_Z -# (2) char [] = "differential" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float X_translation_meters_per_second -# float Y_translation_meters_per_second -# float Z_translation_meters_per_second -# float spin_about_X_revolutions_per_second -# float spin_about_Y_revolutions_per_second -# float spin_about_Z_revolutions_per_second -# ] -# [An optional line describing an analog to scale the velocity -# char [] = "vel_scale" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float offset -# float scale -# float power -# ] -# [An optional line describing an analog to scale the rotation -# char [] = "rot_scale" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float offset -# float scale -# float power -# ] -# [one more line, consisting of the word "end"] -# Note that the same button can cause more than one action to take place, -# and the same analog can cause scaling of both the velocity and rotation. - -# This example for a Global Haptics Orb pushes the transformation away -# from the button that is pressed -# for all of the standard buttons. It rotates around the Y axis when the -# rocker switch is rocked up and down. It resets to the origin when one -# of the pushbuttons is pressed. Both the velocity and angular velocity -# are controlled by the thumbwheel. - -#vrpn_Tracker_ButtonFly Tracker0 60.0 -#differential *Orb0 0 0 1 0 0 0 0 -#differential *Orb0 1 0.707 0.707 0 0 0 0 -#differential *Orb0 2 1 0 0 0 0 0 -#differential *Orb0 3 0.707 -0.707 0 0 0 0 -#differential *Orb0 4 0 -1 0 0 0 0 -#differential *Orb0 5 -0.707 -0.707 0 0 0 0 -#differential *Orb0 6 -1 0 0 0 0 0 -#differential *Orb0 7 -0.707 0.707 0 0 0 0 -#differential *Orb0 8 0 0.707 -0.707 0 0 0 -#differential *Orb0 9 0.577 0.577 -0.577 0 0 0 -#differential *Orb0 10 0.707 0 -0.707 0 0 0 -#differential *Orb0 11 0.577 -0.577 -0.577 0 0 0 -#differential *Orb0 12 0 -0.707 -0.707 0 0 0 -#differential *Orb0 13 -0.577 -0.577 -0.577 0 0 0 -#differential *Orb0 14 -0.707 0 -0.707 0 0 0 -#differential *Orb0 15 -0.577 0.577 -0.577 0 0 0 -#differential *Orb0 16 0 0.707 0.707 0 0 0 -#differential *Orb0 17 0.577 0.577 0.577 0 0 0 -#differential *Orb0 18 0.707 0 0.707 0 0 0 -#differential *Orb0 19 0.577 -0.577 0.577 0 0 0 -#differential *Orb0 20 0 -0.707 0.707 0 0 0 -#differential *Orb0 21 -0.577 -0.577 0.577 0 0 0 -#differential *Orb0 22 -0.707 0 0.707 0 0 0 -#differential *Orb0 23 -0.577 0.577 0.577 0 0 0 -#differential *Orb0 24 0 0 -1 0 0 0 -#differential *Orb0 25 0 0 1 0 0 0 -#differential *Orb0 28 0 0 0 0 -0.1 0 -#differential *Orb0 29 0 0 0 0 0.1 0 -#absolute *Orb0 27 0 0 0 0 0 0 -#vel_scale *Orb0 0 -1.0 0.5 1.0 -#rot_scale *Orb0 0 -1.0 0.5 1.0 -#end - -################################################################################ -# 3Space Tracker. Runs a Polhemus 3Space (not Fastrak) tracker that is attached -# to a serial port on this machine. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tracker_3Space Tracker0 /dev/ttyS0 19200 - -################################################################################ -################################################################################ -# Non-tracker devices. Lines are provided here for the various non-tracker servers -# that can be started. - -################################################################################ -# Example Dial server. This is a "device" that reports constant rotations for -# each of its dials at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are four arguments: -# char name_of_this_device[] -# int number_of_dials -# float rate_at_which_the_dials_spin (revolutions/second) -# float rate_at_which_to_report_updates (udpates/second) - -#vrpn_Dial_Example Dial0 2 2.0 10.0 - -################################################################################ -# CerealBox dial/button/analog. Runs a BG Systems CerealBox device that attaches -# to a serial port on this machine. As of VRPN version 04.07, 19200 is the -# only supported baud rate. The driver has been tested on an LV824-F-8e device. -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int number_of_buttons_to_read (starting from 0) -# int number_of_analogs_to_read -# int number_of_encoders_to_read - -#vrpn_CerealBox Cereal0 /dev/cua0 19200 8 8 8 - -################################################################################ -# Magellan button/analog. Runs a Logitech Magellan device that attaches -# to a serial port on this machine. As of VRPN version 04.12, 9600 is the -# only supported baud rate. -# -# Note that if you want to use the Magellan as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device that listens to its analog -# outputs and converts them into tracker reports -# -# John Stone added support for the SpaceBalls in version 06.03, an example -# startup is shown below. -# -# Julien Brisset discovered how to make this work with a slightly older version -# of the Magellan. If the example Magellan line doesn't work, add 'altreset' to -# the line to use the alternative reset string for the device. -# -# NOTE: You should NOT run the driver that comes with the Magellan, since the -# VRPN driver opens the serial port and communicates with the device directly. -# If the Magellan driver from the manufacturer is running, then VRPN will not -# be able to open the port. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# char "altreset" {Optional, for older Magellans} - -#vrpn_Magellan Magellan0 COM1 9600 -#vrpn_Magellan Magellan0 /dev/ttyS0 9600 altreset -#vrpn_Spaceball Spaceball0 /dev/ttyS0 9600 - -################################################################################ -# NRL Immersion Box dial/button/analog. Runs a Immersion Interface Box device -# attached to a serial port. As of March 28, 2000 code to read the analog and -# angle encoders has not been implemented. Also, baud rate on many SGI's is -# limited to 38400, but I have run the ibox at 115200 on PCs. -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int number_of_buttons_to_read (i.e. 4 ==> 0,1,2,3) -# int number_of_analogs_to_read -# int number_of_encoders_to_read - -#vrpn_ImmersionBox ibox /dev/ttyd2 38400 4 0 0 -#vrpn_ImmersionBox ibox com1 115200 4 0 0 - -################################################################################ -# Wands button/analog, driver from Brown University. Runs a Wanda device -# attached to a serial port. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port_to_use[] -# int baud_rate_of_serial_device -# float minimum_update_rate - -#vrpn_Wanda Wanda /dev/ttyd2 1200 60.0 -#vrpn_Wanda Wanda COM2 1200 60.0 - -################################################################################ -# Radamec Serial Position Interface analog. Camera tracker that attaches -# to a serial port on this machine. Note that for normal operation, 38400 is the -# only supported baud rate. -# -# Note that if you want to use the Radamec SPI as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device (of the absolute variety) -# that listens to its analog outputs and converts them into tracker reports. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port[] -# int baud_rate_of_serial_port - -#vrpn_Radamec_SPI Analog0 /dev/ttyS16 38400 - -################################################################################ -# Zaber linear positioning element analog that attaches -# to a serial port on this machine. -# -# Note that if you want to use the Zaber as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device (of the absolute variety) -# that listens to its analog outputs and converts them into tracker reports. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port[] - -#vrpn_Zaber Analog0 COM1 - -################################################################################ -# SGI Dial and Button box, raw interface. Runs a dial-and-button box from SGI, -# talking to it through the raw serial interface (not using the GL interface -# supplied by SGI). This allows the box to be opened even if there is nobody -# logged on at the console. Note that to use this on an SGI, you will need to -# configure the port as a serial device, not as a button device, to get it to -# run. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# [list of buttons to treat as toggles] int button_to_toggle - -#vrpn_raw_SGIBox Sgibox0 /dev/ttyS0 0 1 2 3 - -################################################################################ -# SGI Dial and Button box, cooked interface. Runs a dial-and-button box from SGI, -# talking to it through the GL interface supplied by SGI. Note that this can -# only be used on an SGI, and the serial port must be configured as a dial/button -# device and the dial/button server from SGI must be running to use it. Arguments: -# char name_of_this_device[] -# [list of buttons to treat as toggles] int button_to_toggle - -#vrpn_SGIBOX Sgibox0 1 2 - -################################################################################ -# UNC Python button device. UNC has developed a custom button input device, which -# is a 5-button controller that attaches to a parallel port and uses the sense -# lines to return the state of the buttons. This runs the device. Note that on -# Windows NT, you need to have installed the GiveIO driver for this code to -# work. It also works on Linux (no extra drivers needed), but on no other -# architecture. Arguments: -# char name_of_this_device[] -# int parallel_port_to_use_starting_with_1 - -#vrpn_Button_Python Button0 1 - -################################################################################ -# UNC Joystick driver. UNC has developed a custom-build joybox, with 7 analog -# and 2 button inputs (two 3-axis joysticks and a slider, with a button on top -# of each joystick). This will drive one of these devices, which attaches to -# a serial port on this computer. I'm not sure what the baud rate should be; -# David Harrison might know. -# This driver can be used in conjunction with the JoyFly driver to produce a -# tracker that uses the joystick to fly around. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# float minimum_update_rate_from_analogs_even_if_they_dont_move - -#vrpn_Joystick Joybox0 /dev/ttyd1 19200 10.0 - -################################################################################ -# Linux Joystick. Interface to the Linux Joystick driver by Vojtech Pavlik -# included in several Linux distributions. The server code has been tested -# with Linux Joystick driver version 1.2.14. Yet, there is no way how to -# map a typical joystick's zillion buttons and axes on few buttons and axes -# really used. Unfortunately, even joysticks of the same kind can have -# different button mappings from one to another. -# Arguments: -# char name_of_this_device[] -# char name_of_joystick_device[] - -#vrpn_Joylin Joylin0 /dev/js0 - -################################################################################ -# Fakespace Pinch Glove. Drives a Fakespace Pinch Glove device connected to a -# serial port on this machine. This device has ten buttons-two hands and five -# fingers on each hand. Buttons 0-4 are fingers for the right hand-thumb first -# and pinkie last- while buttons 5-9 are for the left hand-thumb first. The -# Button is ON when it is touching another finger. Therefore there cannot -# be just one Button ON. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Button_PinchGlove PinchGlove0 COM1 9600 - -################################################################################ -# Adrienne Electronics Corporation PCI time code driver. The PCI-VITC board -# for which this driver was developed reads in VITC time codes from an input -# signal. This will drive one of these devices. -# Arguments: -# char name_of_this_device[] - -#vrpn_TimeCode_Generator TimeGen0 - -################################################################################ -# 5DT glove. Drive a 5dt glove connected on a serial Port. This device uses -# optical fiber to get the finger position. Not all the 5dt gloves are available -# now. -# 2 modes are driven: the first one let the driver get data from the glove -# when requested (we advise this mode). The second one makes the glove send -# data continuously. This mode may saturate the input buffer. -# The manual states that there will be 9 bytes per report, but one group -# has found that they get an extra one: 0x55 at the end of each report. -# So, you can choose whether to use 9 (the default) or 10 now. -# Gesture management is not implemented yet nor the mouse emulation mode -# arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int mode_of_data_reporting (1 = on request, 2 = continuously) -# int ten_bytes_per_report (0 = no, use 9; 1 = yes) - -#vrpn_5dt glove_5dt /dev/ttyS0 19200 1 0 -#vrpn_5dt glove_5dt COM1 19200 1 0 - -################################################################################ -# NRL Serial Mouse. A device made by wiring buttons in parallel with the buttons -# on a serial mouse. Both mousesystems or microsoft mouse protocols are -# supported. Note that the server code makes the connection at the standard -# 1200 baud. The mouse can be plugged into any serial port -- this driver goes -# directly through the raw port and does not use the built-in mouse drivers. -# NOTE: The middle button on the 3button type is toggled by moving the mouse -# on a surface while not toggling the other two buttons, strange as this may -# seem. The motion of the mouse is not reported, only the buttons. - -#vrpn_Button_SerialMouse Button0 /dev/ttyd1 mousesystems -#vrpn_Button_SerialMouse Button0 /dev/ttyd1 3button -#vrpn_Button_SerialMouse Button0 COM1 mousesystems -#vrpn_Button_SerialMouse Button0 COM1 3button - -################################################################################ -# NRL TNG3. (Totally Neat Gadget) A device made by mindtel, available from -# pulsar.org. Powered off the serial port control lines, the TNG3 has 8 digital -# and 8 analog inputs. Analog resolution is 8 bits. Baud rate fixed internally -# at 19200. -# char name_of_this_device[] -# char name_of_serial_device[] -# int number_of_buttons_to_read (i.e. 8 ==> 0,1,2,3,4,5,6,7) -# int number_of_analogs_to_read - -#vrpn_Tng3 tng3name /dev/ttyd2 4 0 -#vrpn_Tng3 tng3name com1 8 8 -#vrpn_Tng3 tng3name com1 1 1 - -################################################################################ -# Microsoft DirectX compatible force-feedback joystick (or non-force-feedback -# joystick). -# char name_of_this_device[] -# int number of times per second to read from the device -# int number of times per second to update force (0 for non-force device) - -#vrpn_DirectXFFJoystick Joystick0 60 200 -#vrpn_DirectXFFJoystick Joystick0 60 0 - -################################################################################ -# Manager for joysticks under windows using standard win32 calls. -# for force feedback support, see DirectX joystick above -# -# Arguments: -# char name_of_this_device[] -# int joystick Id -# (1 for first joystick JOYSTICKID1 or 2 for second JOYSTICKID2 only) -# int number of times per second to read from the device -# int readmode : 0 = raw data; -# 1 = 0,1 normalized data; -# 2=-1,1 normalized data -# int percentage (0 to 100) of deadzone (used mode 1 and 2 only) - -#vrpn_Joywin32 joyWin32 1 60 2 35 - -################################################################################ -# Global Haptics GeoOrb serial-line device that contains a number of buttons, -# a thumbwheel, and a trackball. For current devices, only 19200 baud works. -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_GlobalHapticsOrb Orb0 COM1 19200 - -################################################################################ -# SensAble Technologies Phantom force-feedback device opened using the -# GHOST software developer's kit. For Phantom Desktop systems, you don't -# need to have the user establish the reset position. For the Premium models, -# you do. -# Arguments: -# char name_of_this_device[] -# int establish_reset_position (0 or 1) -# float rate_to_send_tracker_reports - -#vrpn_Phantom Phantom 0 60.0 - -############################################################################## -# Virtual Presence Joystick tracker device. (http://www.vrweb.com) -# Use this driver to read the button states, -# use Flock-of-Birds driver for the position/orientation state -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_VPJoystick VPJoystick0 /dev/ttyS0 9600 - -################################################################################ -# Advanced Realtime Tracking GmbH (http://www.ar-tracking.de) DTrack client -# -# creates as many vrpn_Tracker as there are bodies or flysticks, starting with -# the bodies. -# creates 2 analogs per flystick -# creates 8 buttons per flystick -# -# NOTE: numbering of flystick buttons differs from DTrack documentation -# -# Arguments: -# char name_of_this_device[] -# int udp_port (DTrack sends data to this udp port) -# float time_to_reach_joy (see below) -# -# Optional arguments: -# int number_of_bodies, number_of_flysticks (fixed numbers of bodies and flysticks) -# int renumbered_ids[] (vrpn_Tracker IDs of bodies and flysticks) -# char "-" (activates tracing; always last argument) -# -# NOTE: time_to_reach_joy is the time needed to reach the maximum value of the -# joystick -# (1.0 or -1.0) when the corresponding button is pressed (one of the last -# buttons amongst the 8) -# -# NOTE: if fixed numbers of bodies and flysticks should be used, both arguments -# number_of_bodies and number_of_flysticks have to be set -# -# NOTE: renumbering of tracker IDs is only possible, if fixed numbers of bodies and -# flysticks are set; there has to be an argument present for each -# body/flystick - -#vrpn_Tracker_DTrack DTrack 5000 0.5 -#vrpn_Tracker_DTrack DTrack 5000 0.5 2 2 -#vrpn_Tracker_DTrack DTrack 5000 0.5 2 2 2 1 0 3 - -################################################################################ -# National Instruments Analog Output server. This will open the board whose -# name is specified, configure the number of channels specified, and set the -# polarity and maximum voltage range at which to drive the channels. -# -# Arguments: -# char vrpn_name_for_this_device[] -# char name_of_NI_board[] -# int number_of_channels -# int polarity : 0 = unipolar, 1 = bipolar -# float min_voltage -# float max_voltage - -#vrpn_NI_Analog_Output Analog_XY DAQCard-6036E 2 0 -10.0 10.0 -#vrpn_NI_Analog_Output Analog_ZTweeze DAQCard-6036E 2 0 -10.0 10.0 - -################################################################################ -# Analog Poser. This is a poser that is intended to be used on top of -# an analog output (perhaps a National Instruments board), whose outputs -# directly drive the position of some actuated stage. It could be used on top -# of any analog output device, in fact. This device basically takes in poses -# and puts out analog outputs. -# One analog channel is associated with each axis (X, Y, Z) and rotation about -# each axis (RX, RY, RZ). For each axis, the position (meters) is converted into -# a voltage; the orientation is mapped from a quaternion into Euler angles and -# each of the Euler angles is converted into a voltage (XXX Orientation is not yet -# implemented; the RX,RY, and RZ values must be specified but they are not used). -# XXX Velocity and orientation velocity are not yet supported. -# Any axis can be disabled by setting the name of its associated device to the -# string "NULL". -# -# Arguments: -# char vrpn_name_for_this_device[] -# char vrpn_name_of_the_analog_output_to_use[] -# (Preface with a * if it uses the same connection) -# [six lines follow, one for X Y Z RX RY RZ, each with: -# char axis_name[] (X Y Z RX RY RZ in that order) -# int channel_of_analog_output_device (First channel is channel 0) -# float offset -# float scale -# float min_value of workspace -# float max_value of workspace -# ] - -#vrpn_Poser_Analog Poser0 -#X *Analog_XY 0 0.0 1.0 -10 10 -#Y *Analog_XY 1 0.0 1.0 -10 10 -#Z *Analog_ZTweeze 0 0.0 1.0 -10 10 -#RX NULL 0 0.0 1.0 -10 10 -#RY NULL 0 0.0 1.0 -10 10 -#RZ NULL 0 0.0 1.0 -10 10 - -################################################################################ -# Nikon microscope connected to PC via serial port. Currently only controls -# the focus of the microscope using an analogout and reads the focus position -# using an analog. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] - -vrpn_nikon_controls Focus COM2 - -################################################################################ -# Tektronix 4662 plotter. Attaches to a serial port. Acts as both a poser and -# a tracker. Reports positions 4x per second plus when a move command completes. -# Multiple move commands issued before they complete will result in only the last -# one being executed. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tek4662 Tek4662 COM1 1200 - diff --git a/src/vrpn/installers/Nikon_focus_control/vrpn_hercules.cfg b/src/vrpn/installers/Nikon_focus_control/vrpn_hercules.cfg deleted file mode 100644 index 8ae23cfe5cfe619c6492e16f117859b169f26ee1..0000000000000000000000000000000000000000 --- a/src/vrpn/installers/Nikon_focus_control/vrpn_hercules.cfg +++ /dev/null @@ -1,1019 +0,0 @@ -# vrpn.cfg.SAMPLE for VRPN version 06.06 - -################################################################################ -################################################################################ -# This file provides comments and examples for the vrpn.cfg file that is read -# by the vrpn_server application when it starts up. This is a generic server -# application that can start up many but maybe not all servers. -# -# This has sample lines for a vrpn.cfg file. If you get a new device working, -# add a line for it here. DO NOT remove lines from this file (unless -# devices are declared obsolete) - just change the actual vrpn.cfg to match -# your application. -# -# All examples in the file are preceded by comment characters (#). To actually -# use one of these examples, remove that character from the beginning of all the -# examples that you want to use, and edit those lines to suit your environment. -################################################################################ - -################################################################################ -################################################################################ -# Tracker classes. Lines here to start various tracker servers. A description is -# provided for each type of tracker for the arguments it takes, then an example -# configuration line is provided. -################################################################################ - -################################################################################ -# NULL Tracker. This is a "device" that reports the Identity transformation for -# each of its sensors at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are three arguments: -# char name_of_this_device[] -# int number_of_sensors -# float rate_at_which_to_report_updates - -#vrpn_Tracker_NULL Tracker0 2 2.0 - -################################################################################ -# Flock-of-birds Tracker. Runs an Ascension Flock of Birds tracker that is -# attached to a serial port on this machine. Note that there is another driver -# (listed below) that runs the Flock when each sensor is connected to its own -# serial line. Arguments: -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int invert_quaternion (0 = no, 1 = yes) -# optionnal char useERT -# -# NOTE: for useERT: use nothing, y or Y if you have an extended range -# transmitter, use N or n if not (added by David Nahon for Virtools -# VRPack/SAS Cube. -# NOTE: The "invert_quaternion" parameter was added because there was a -# conflict between the code that had been around since VRPN started and -# the Flock documentation -- it looks like most people had been using the -# Flock in the "wrong" hemisphere, which inverted the orientation relative -# to the position. The old behavior is obtained by specifying "1". Not -# inverting it is specified using "0". - -#vrpn_Tracker_Flock Tracker0 4 /dev/ttyS0 1 115200 - -# If you have to FOB, with no Extended Range ctrler/transmitter, on Windows, use - -#vrpn_Tracker_Flock Tracker0 2 COM1 38400 1 N - -# Watch: be sure that the serial baud rate dip switches (the 3 on the left) -# of your master flock are properly set. -# You should try baud rates like 38400 before trying to go higher -# In normal address mode - less than 14 fob units - your switch should be: -# 0 1 2 3 4 5 6 7 -# 0 0 1 X X X X 0 2400 -# 0 1 0 X X X X 0 4800 -# 0 1 1 X X X X 0 9600 -# 1 0 0 X X X X 0 19200 -# 1 0 1 X X X X 0 38400 -# 1 1 0 X X X X 0 57600 -# 1 1 1 X X X X 0 115200 -# -# X X X X are used for coding the FOB address, they must be set correctly, -# even if you are only using 1 unit (standalone mode) -# the settings should be (in normal address mode): -# 3 4 5 6 -# 0 0 0 1 for the first unit -# 0 0 1 0 for the second unit -# 0 0 1 1 for the third -# 0 1 0 0 for the fourth -# 0 1 0 1 for the fifth -# ... -# -############################################################################ -# WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH -################### -# -# On windows at least, it might be necessary to cut your serial cable so as -# to only have Transmit, Receive and Ground pins. Even if CBIRDS or WINBIRDS -# are fine with a cable, it doesn't mean that this cable will please vrpn. -# This limitation should have been fixed with version 06.05. -# -################### - -################################################################################ -# Flock-of-birds in parallel Tracker. Runs an Ascension Flock of Birds tracker -# that has its source and each sensor plugged into its own serial port on this -# machine (perhaps through a Cyclades multi-port serial card). This mode of -# operation increases the throughput and decreases the latency of tracker reports. -# The arguments match those of the Flock-of-birds tracker from above, with the -# addition of the name of the serial ports for each of the sensors added at the -# end. Arguments (all on the same line): -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device_for_controller[] -# int baud_rate_of_serial_device -# int invert_quaternion (0 = no, 1 = yes) -# [one for each sensor] char name_of_serial_device_for_sensor[] -# -# NOTE: The "invert_quaternion" parameter was added because there was a -# conflict between the code that had been around since VRPN started and -# the Flock documentation -- it looks like most people had been using the -# Flock in the "wrong" hemisphere, which inverted the orientation relative -# to the position. The old behavior is obtained by specifying "1". Not -# inverting it is specified using "0". - -#vrpn_Tracker_Flock_Parallel Tracker0 4 /dev/ttyC4 115200 1 /dev/ttyC0 /dev/ttyC1 /dev/ttyC2 /dev/ttyC3 -#vrpn_Tracker_Flock_Parallel Tracker0 2 COM1 115200 1 COM2 COM3 - -################################################################################ -# Fastrak Tracker. Runs a Polhemus Fastrak tracker that is attached to a serial -# port on this machine. This driver will also run an InterSense IS600 or IS900 -# tracker, but you will want to include extra initialization code (as described -# below) to set up the ultrasonic pip information, wand devices, stylus devices -# and so forth. Arguments that go on the first line: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the Fastrak during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the Fastrak -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. -# -# If one or more sensors on the Fastrak have a stylus button on them, use -# the "FTStylus" command after the reset command lines (if any). There should -# be a front-slash "/" character at the end of the line before the FTStylus -# command. The command takes two arguments: the name of the button device -# that will report the buttons and the sensor number to which the button is -# attached (the first sensor is sensor 0). -# -# Commands to add Joysticks (2 buttons) or Wands (5 buttons and 2 analogs) to -# the various sensors on the Isense900 are done by adding Stylus and -# Wand command lines after the reset command lines. Each of these lines -# takes two arguments: the name of the button (for Stylus) or button and -# analog (for Wand) servers, and the sensor number (starting from 0). The -# Wand line takes eight additional parameters, which specify the scaling -# and clipping behavior of the two directions on the analog joystick. Each -# set of for is the min, lowzero, hizero, and max values: these are mapped -# to -1, 0,0, and 1 (all values between lowzero and hizero are mapped to 0). -# Start with these at -1,0,0,1 and use the 'printcereal' program or some other -# method to read them and see what the range of acheivable values is. Then, -# set them to slightly conservative values so that the whole range is covered -# and the analogs will report zero when the joystick is centered. The -# presence of these lines is indicated by placing them after any additional -# reset command lines, by ending the line preceding them with the front slash -# "/" character. -# -# Remember that the "remote" button object is not the same as the the tracking -# device, so be sure to use a remote button object that connects to the button -# rather than the tracker. The button device name is defined on the stylus or -# wand line in the config file, and should not be the same as the tracker. In -# the case described by the example configuration below, if the name of the -# machine running the server is "myis900server" you would connect to the tracker -# as "Isense900@myis900server" and to the buttons on the stylus as -# "Stylus0@myis900server": -# -# Note that this frontslash and backslash-notation can only be used for the -# Fastrak/Isense tracker, not to extend the line for any other type of device -# listed in this configuration file. - -# Vanilla Fastrak on on a Unix box -#vrpn_Tracker_Fastrak Fastrak0 /dev/ttyS0 19200 - -# Fastrak with a stylus on sensor zero on a Windows box -#vrpn_Tracker_Fastrak Tracker0 COM1 115200 / -#FTStylus Stylus0 0 - -# IS600 and its pip settings -#vrpn_Tracker_Fastrak Isense600 /dev/ttyS0 19200 \ -#MCc\ -#*5\ -#MCM1,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,89\ -#MCM1,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,87\ -#MCM2,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,66\ -#MCM2,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,71\ -#MCM3,1,0.1237,-0.0762,-0.0424,0.00,0.00,-1.00,82\ -#MCM3,2,0.1237,0.0762,-0.0424,0.00,0.00,-1.00,77\ -#MCe\ -#*10 - -# IS900 with a wand on the first sensor and a stylus on the third: -#vrpn_Tracker_Fastrak Isense900 COM1 115200 / -#Wand Wand0 0 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 / -#Stylus Stylus0 2 - -################################################################################ -# Liberty Tracker. Runs a Polhemus Liberty tracker that is attached to a serial -# port or USB port on this machine. Arguments that go on the first line -# char name_of_this_device[] -# char name_of_serial_or_usb_device[] -# int baud_rate_of_serial_device (not used when the device is USB) -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the Liberty during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the Fastrak -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. - -# ------------------------------------------- -# Example when Liberty is attached via USB -# The BAUD Rate is needed, although it is not used - -#vrpn_Tracker_Liberty Liberty /dev/usb/ttyUSB0 115200 - -#-------------------------------------------- -# Example when Liberty is attached via Serial - -#vrpn_Tracker_Liberty Liberty /dev/ttyS0 115200 - -################################################################################ -# InterSense tracker using the Intersense-provided library to communicate -# with the tracker. This device type is not compiled by default, since it uses -# a proprietary library. However, you can get it to compile by defining -# VRPN_INCLUDE_INTERSENSE when compiling. Note that the Fastrak driver will -# run IS-600 and IS-900 trackers without the proprietary library, so you might -# try that as well. -# -# You can include extra initialization code (as described -# below) to set up the ultrasonic pip information, wand devices, stylus devices -# and so forth. Arguments that go on the first line: -# char name_of_this_device[] -# char name_of_serial_device[] - this can be COM1-4 or AUTO -# AUTO will automatically find USB and -# serial trackers. Use COM1-4 only if you -# have more than one serial tracker. -# You should use COM1-4 on unix as well, -# as these just tell the isense library -# to look in serial port 1-4. -# I guess you can't have >1 USB trackers. -# char "IS900time" - use the IS900 timestamps (optional) -# char "ResetAtStartup" - resets all boresight and heading, on intertrax, -# equivalent to push the reset button -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the InterSense during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the InterSense -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. -# -# Commands to add Joysticks (2 buttons) or Wands (5 buttons and 2 analogs) to -# the various sensors on the Isense900 are done by adding Stylus and -# Wand command lines after the reset command lines. Each of these lines -# takes two arguments: the name of the button (for Stylus) or button and -# analog (for Wand) servers, and the sensor number (starting from 0). The -# Wand line takes eight additional parameters, which specify the scaling -# and clipping behavior of the two directions on the analog joystick. Each -# set of for is the min, lowzero, hizero, and max values: these are mapped -# to -1, 0,0, and 1 (all values between lowzero and hizero are mapped to 0). -# Start with these at -1,0,0,1 and use the 'printcereal' program or some other -# method to read them and see what the range of acheivable values is. Then, -# set them to slightly conservative values so that the whole range is covered -# and the analogs will report zero when the joystick is centered. The -# presence of these lines is indicated by placing them after any additional -# reset command lines, by ending the line preceding them with the front slash -# "/" character. -# -# Remember that the "remote" button object is not the same as the the tracking -# device, so be sure to use a remote button object that connects to the button -# rather than the tracker. The button device name is defined on the stylus or -# wand line in the config file, and should not be the same as the tracker. In -# the case described by the example configuration below, if the name of the -# machine running the server is "myis900server" you would connect to the tracker -# as "Isense900@myis900server" and to the buttons on the stylus as -# "Stylus0@myis900server": -# -# Note that this frontslash and backslash-notation can only be used for the -# Fastrak and InterSense tracker, not to extend the line for any other -# type of device -# listed in this configuration file. -# -# Note that this driver expects the device to be set to output centimeters, and will convert -# the positions to meters. It is recommanded to permanently set the units in the eeprom of your device. -# If this is not possible, you should add in this file the "u" reset command so as to have vrpn -# tell your device to use centimeters -# -#Vanilla InterSense -#vrpn_Tracker_InterSense Tracker0 AUTO IS900time - -# Vanilla InterSense using IS900 timing, with wand in port B (and possibly head tracker in port A) -#vrpn_Tracker_InterSense Tracker0 AUTO IS900time / -#Wand Wand0 1 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 - -# IS600 and its pip settings -#vrpn_Tracker_InterSense Isense600 COM1 \ -#MCc\ -#*5\ -#MCM1,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,89\ -#MCM1,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,87\ -#MCM2,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,66\ -#MCM2,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,71\ -#MCM3,1,0.1237,-0.0762,-0.0424,0.00,0.00,-1.00,82\ -#MCM3,2,0.1237,0.0762,-0.0424,0.00,0.00,-1.00,77\ -#MCe\ -#*10 - -# IS900 with a wand on the first sensor and a stylus on the third: -#vrpn_Tracker_InterSense Isense900 COM1 / -#Wand Wand0 0 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 / -#Stylus Stylus0 2 - -# Intertrax2 on USB, With automatic reset at startup -#vrpn_Tracker_InterSense Tracker0 AUTO ResetAtStartup - -################################################################################ -# Dynasight Tracker. Runs an Origin System's DynaSight tracker connected to a -# serial port on this machine. arguments: -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tracker_Dyna Tracker0 1 /dev/ttyS0 19200 - -#vrpn_Tracker_Dyna Tracker0 1 COM1 19200 - -################################################################################ -# AnalogFly Tracker. This is a tracker that is intended to be used on top of -# a joystick or motion tracker of some kind to turn it into a moving or flying -# device. It could be used on top of any analog device, in fact. -# This device basically takes in analog signals and puts out transformation -# matrices. It should supercede the JoyFly tracker, since it is more general. -# There are two kinds of JoyFly's: absolute ones and differential ones. For -# absolute ones, the analog value is mapped directly to position or orientation -# on each axis. For differential ones, the values are used to create a -# "change" matrix that is applied once per interval, accumulating changes as -# it goes; this enables the user to "fly" along by holding a joystick forward, -# for example. -# One analog channel is associated with each axis (X, Y, Z) and rotation about -# each axis (RX, RY, RZ). For each axis, the value is converted to a position -# (meters) or speed (meters/second) for absolute trackers; or into an -# orientation (revolutions) or angular velocity (revolutions/second) by first -# subtracting an offset, then thresholding it to see if it is far enough from -# zero, then (if it is) scaling it and taking it to a power (to allow nonlinear -# speedup as the stick is pushed far from center). -# A button can be associated with a reset function, which will take the -# device back to center (identity transformation). The device will also recenter -# when the first connection is made to the server it is running on. (Centering -# has no effect on absolute AnalogFlys). -# Any axis or the reset button can be disabled by setting the name of its -# associated device to the string "NULL". -# Note that you could have multiple of these devices running simultaneously, -# each with a different name and interaction metaphor. The user could then -# connect to their favorite one. Arguments: -# char name_of_this_device[] -# float update_rate_to_send_tracker_reports -# char type[] = "absolute" or "differential" -# [six lines follow, one for X Y Z RX RY RZ, each with: -# char axis_name[] (X Y Z RX RY RZ in that order) -# char name_of_analog_device[] (start with * for local) -# int channel_of_analog_device -# float offset -# float threshold -# float scale -# float power -# ] -# [New line to describe reset button, with: -# char "RESET" -# char name_of_button_device[] (start with * for local) -# int which_button_to_use -# ] - -#vrpn_Tracker_AnalogFly Tracker0 60.0 differential -#X *CerealBox0 4 0.0 0.021 1.0 1.0 -#Y *CerealBox0 5 0.0 0.021 1.0 1.0 -#Z *CerealBox0 6 0.0 0.021 3.0 1.0 -#RX *CerealBox0 0 0.0 0.021 1.0 1.0 -#RY *CerealBox0 1 0.0 0.021 1.0 1.0 -#RZ *CerealBox0 2 0.0 0.021 3.0 1.0 -#RESET *CerealBox 3 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 differential -#X *Magellan0 0 0.0 0.0 2.0 1.0 -#Y *Magellan0 1 0.0 0.0 2.0 1.0 -#Z *Magellan0 2 0.0 0.0 2.0 1.0 -#RX *Magellan0 3 0.0 0.0 2.0 1.0 -#RY *Magellan0 4 0.0 0.0 2.0 1.0 -#RZ *Magellan0 5 0.0 0.0 2.0 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X NULL 0 0.0 0.0 1.0 1.0 -#Y NULL 0 0.0 0.0 1.0 1.0 -#Z NULL 0 0.0 0.0 1.0 1.0 -#RX *Radamec0 1 0.0 0.0 -0.0027777777 1.0 -#RY NULL 0 0.0 0.0 1.0 1.0 -#RZ *Radamec0 0 0.0 0.0 0.0027777777 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Joystick0 0 0.0 0.0 1.0 1.0 -#Y *Joystick0 1 0.0 0.0 -1.0 1.0 -#Z *Joystick0 6 0.0 0.0 1.0 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Joystick0 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Phantom 60.0 absolute -#X *Phantom 0 0.0 0.0 0.125 1.0 -#Y *Phantom 1 0.0 0.0 -0.125 1.0 -#Z *Phantom 6 0.0 0.0 0.25 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Phantom 5 0.0 0.0 0.06 1.0 -#RESET NULL 0 - -# For DTU/MIC optical nanoHand stage motion, moving over full 300 micron range -# of motion, using the Logitech joystick for the analog -# server and the tracker_to_poser program. -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Joystick0 0 -0.03 0.0 2.53 1.0 -#Y *Joystick0 1 -0.04 0.0 2.53 1.0 -#Z *Joystick0 6 -0.10 0.0 -1.75 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Joystick0 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 - -# To drive a Tektronix 4662 full range (Z, RZ ignored) -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Joystick0 0 -1.0 0.0 0.19 1.0 -#Y *Joystick0 1 1.0 0.0 -0.13 1.0 -#Z *Joystick0 6 0.0 0.0 1.0 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Joystick0 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 - -################################################################################ -# XXX This device is superceded by the more-general vrpn_Tracker_AnalogFly. -# JoyFly Tracker. A vrpn_Tracker that translates the vrpn_Joystick into -# Walkthrough- convention tracker reports. This is part of a two-part setup -# that allows you to use a joystick as a flying device. First, a joystick -# device has to be created (named joybox in our example) that will produce -# the analog inputs that the JoyFly tracker uses to determine the transformation. -# Then, the JoyFly device needs to be started and will listen to the device -# and produce tracker reports. If these are both run on the same server, then -# the JoyFly needs to use the "server" connection to hear from the Joystick -# device, which is indicated by placing a '*' in front of the name of the -# joystick device that it is to use. If the joystick device is remote from -# this server, then the full name of it should be used (joystick@foo.cs.unc.edu). -# XXX This device is superceded by the more-general vrpn_Tracker_AnalogFly -# Arguments: -# char name_of_this_device[] -# char source_joystick_name[] (Start with * for one sharing a connection) -# char joystick_configuration_file_name[] - -#vrpn_JoyFly walk-joybox *joybox vrpn_Joyfly.cfg - -################################################################################ -# ButtonFly Tracker. This is a tracker that is intended to be used on top of -# a Global Haptics Orb or other buttond device to turn it into a moving or -# flying device. It basically takes in button signals and puts out -# transformation matrices. -# There are two kinds of Buttons: absolute ones and differential ones. For -# absolute ones, pressing it causes the position or orientation associated with -# it to be stored directly into the transformation. This enables the user to -# "teleport" to given locations by pressing buttons. For differential ones, -# the position or orientation are treated as deltas and are used to create a -# "change" matrix that is applied once per interval, accumulating changes as -# it goes; this enables the user to "fly" along by holding a button down, -# for example. -# Each button is associated with either a position (meters) or speed -# (meters/second) for absolute buttons; or an orientation (revolutions) -# or angular velocity (revolutions/second). -# An analog channel can be associated with a scale function that scales the -# velocity or angular velocity terms uniformly. The entry specifies an -# offset to be applied to the analog channel, a scale to be applied to it, -# and a power to which the result should be taken; the end result is used -# to scale all velocity or angular velocity terms. This channel has no -# effect on the effects of absolute buttons. -# The device will recenter (set itself to the identity transform) when the -# first connection is made to the server it is running on. -# Note that you could have multiple of these devices running simultaneously, -# each with a different name and interaction metaphor. The user could then -# connect to their favorite one. Arguments: -# char name_of_this_device[] -# float update_rate_to_send_tracker_reports -# [one or more lines follow, each of one of two types -# (1) char [] = "absolute" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float X_to_translate_to -# float Y_to_translate_to -# float Z_to_translate_to -# float rotation_about_X -# float rotation_about_Y -# float rotation_about_Z -# (2) char [] = "differential" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float X_translation_meters_per_second -# float Y_translation_meters_per_second -# float Z_translation_meters_per_second -# float spin_about_X_revolutions_per_second -# float spin_about_Y_revolutions_per_second -# float spin_about_Z_revolutions_per_second -# ] -# [An optional line describing an analog to scale the velocity -# char [] = "vel_scale" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float offset -# float scale -# float power -# ] -# [An optional line describing an analog to scale the rotation -# char [] = "rot_scale" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float offset -# float scale -# float power -# ] -# [one more line, consisting of the word "end"] -# Note that the same button can cause more than one action to take place, -# and the same analog can cause scaling of both the velocity and rotation. - -# This example for a Global Haptics Orb pushes the transformation away -# from the button that is pressed -# for all of the standard buttons. It rotates around the Y axis when the -# rocker switch is rocked up and down. It resets to the origin when one -# of the pushbuttons is pressed. Both the velocity and angular velocity -# are controlled by the thumbwheel. - -#vrpn_Tracker_ButtonFly Tracker0 60.0 -#differential *Orb0 0 0 1 0 0 0 0 -#differential *Orb0 1 0.707 0.707 0 0 0 0 -#differential *Orb0 2 1 0 0 0 0 0 -#differential *Orb0 3 0.707 -0.707 0 0 0 0 -#differential *Orb0 4 0 -1 0 0 0 0 -#differential *Orb0 5 -0.707 -0.707 0 0 0 0 -#differential *Orb0 6 -1 0 0 0 0 0 -#differential *Orb0 7 -0.707 0.707 0 0 0 0 -#differential *Orb0 8 0 0.707 -0.707 0 0 0 -#differential *Orb0 9 0.577 0.577 -0.577 0 0 0 -#differential *Orb0 10 0.707 0 -0.707 0 0 0 -#differential *Orb0 11 0.577 -0.577 -0.577 0 0 0 -#differential *Orb0 12 0 -0.707 -0.707 0 0 0 -#differential *Orb0 13 -0.577 -0.577 -0.577 0 0 0 -#differential *Orb0 14 -0.707 0 -0.707 0 0 0 -#differential *Orb0 15 -0.577 0.577 -0.577 0 0 0 -#differential *Orb0 16 0 0.707 0.707 0 0 0 -#differential *Orb0 17 0.577 0.577 0.577 0 0 0 -#differential *Orb0 18 0.707 0 0.707 0 0 0 -#differential *Orb0 19 0.577 -0.577 0.577 0 0 0 -#differential *Orb0 20 0 -0.707 0.707 0 0 0 -#differential *Orb0 21 -0.577 -0.577 0.577 0 0 0 -#differential *Orb0 22 -0.707 0 0.707 0 0 0 -#differential *Orb0 23 -0.577 0.577 0.577 0 0 0 -#differential *Orb0 24 0 0 -1 0 0 0 -#differential *Orb0 25 0 0 1 0 0 0 -#differential *Orb0 28 0 0 0 0 -0.1 0 -#differential *Orb0 29 0 0 0 0 0.1 0 -#absolute *Orb0 27 0 0 0 0 0 0 -#vel_scale *Orb0 0 -1.0 0.5 1.0 -#rot_scale *Orb0 0 -1.0 0.5 1.0 -#end - -################################################################################ -# 3Space Tracker. Runs a Polhemus 3Space (not Fastrak) tracker that is attached -# to a serial port on this machine. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tracker_3Space Tracker0 /dev/ttyS0 19200 - -################################################################################ -################################################################################ -# Non-tracker devices. Lines are provided here for the various non-tracker servers -# that can be started. - -################################################################################ -# Example Dial server. This is a "device" that reports constant rotations for -# each of its dials at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are four arguments: -# char name_of_this_device[] -# int number_of_dials -# float rate_at_which_the_dials_spin (revolutions/second) -# float rate_at_which_to_report_updates (udpates/second) - -#vrpn_Dial_Example Dial0 2 2.0 10.0 - -################################################################################ -# CerealBox dial/button/analog. Runs a BG Systems CerealBox device that attaches -# to a serial port on this machine. As of VRPN version 04.07, 19200 is the -# only supported baud rate. The driver has been tested on an LV824-F-8e device. -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int number_of_buttons_to_read (starting from 0) -# int number_of_analogs_to_read -# int number_of_encoders_to_read - -#vrpn_CerealBox Cereal0 /dev/cua0 19200 8 8 8 - -################################################################################ -# Magellan button/analog. Runs a Logitech Magellan device that attaches -# to a serial port on this machine. As of VRPN version 04.12, 9600 is the -# only supported baud rate. -# -# Note that if you want to use the Magellan as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device that listens to its analog -# outputs and converts them into tracker reports -# -# John Stone added support for the SpaceBalls in version 06.03, an example -# startup is shown below. -# -# Julien Brisset discovered how to make this work with a slightly older version -# of the Magellan. If the example Magellan line doesn't work, add 'altreset' to -# the line to use the alternative reset string for the device. -# -# NOTE: You should NOT run the driver that comes with the Magellan, since the -# VRPN driver opens the serial port and communicates with the device directly. -# If the Magellan driver from the manufacturer is running, then VRPN will not -# be able to open the port. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# char "altreset" {Optional, for older Magellans} - -#vrpn_Magellan Magellan0 COM1 9600 -#vrpn_Magellan Magellan0 /dev/ttyS0 9600 altreset -#vrpn_Spaceball Spaceball0 /dev/ttyS0 9600 - -################################################################################ -# NRL Immersion Box dial/button/analog. Runs a Immersion Interface Box device -# attached to a serial port. As of March 28, 2000 code to read the analog and -# angle encoders has not been implemented. Also, baud rate on many SGI's is -# limited to 38400, but I have run the ibox at 115200 on PCs. -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int number_of_buttons_to_read (i.e. 4 ==> 0,1,2,3) -# int number_of_analogs_to_read -# int number_of_encoders_to_read - -#vrpn_ImmersionBox ibox /dev/ttyd2 38400 4 0 0 -#vrpn_ImmersionBox ibox com1 115200 4 0 0 - -################################################################################ -# Wands button/analog, driver from Brown University. Runs a Wanda device -# attached to a serial port. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port_to_use[] -# int baud_rate_of_serial_device -# float minimum_update_rate - -#vrpn_Wanda Wanda /dev/ttyd2 1200 60.0 -#vrpn_Wanda Wanda COM2 1200 60.0 - -################################################################################ -# Radamec Serial Position Interface analog. Camera tracker that attaches -# to a serial port on this machine. Note that for normal operation, 38400 is the -# only supported baud rate. -# -# Note that if you want to use the Radamec SPI as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device (of the absolute variety) -# that listens to its analog outputs and converts them into tracker reports. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port[] -# int baud_rate_of_serial_port - -#vrpn_Radamec_SPI Analog0 /dev/ttyS16 38400 - -################################################################################ -# Zaber linear positioning element analog that attaches -# to a serial port on this machine. -# -# Note that if you want to use the Zaber as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device (of the absolute variety) -# that listens to its analog outputs and converts them into tracker reports. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port[] - -#vrpn_Zaber Analog0 COM1 - -################################################################################ -# SGI Dial and Button box, raw interface. Runs a dial-and-button box from SGI, -# talking to it through the raw serial interface (not using the GL interface -# supplied by SGI). This allows the box to be opened even if there is nobody -# logged on at the console. Note that to use this on an SGI, you will need to -# configure the port as a serial device, not as a button device, to get it to -# run. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# [list of buttons to treat as toggles] int button_to_toggle - -#vrpn_raw_SGIBox Sgibox0 /dev/ttyS0 0 1 2 3 - -################################################################################ -# SGI Dial and Button box, cooked interface. Runs a dial-and-button box from SGI, -# talking to it through the GL interface supplied by SGI. Note that this can -# only be used on an SGI, and the serial port must be configured as a dial/button -# device and the dial/button server from SGI must be running to use it. Arguments: -# char name_of_this_device[] -# [list of buttons to treat as toggles] int button_to_toggle - -#vrpn_SGIBOX Sgibox0 1 2 - -################################################################################ -# UNC Python button device. UNC has developed a custom button input device, which -# is a 5-button controller that attaches to a parallel port and uses the sense -# lines to return the state of the buttons. This runs the device. Note that on -# Windows NT, you need to have installed the GiveIO driver for this code to -# work. It also works on Linux (no extra drivers needed), but on no other -# architecture. Arguments: -# char name_of_this_device[] -# int parallel_port_to_use_starting_with_1 - -#vrpn_Button_Python Button0 1 - -################################################################################ -# UNC Joystick driver. UNC has developed a custom-build joybox, with 7 analog -# and 2 button inputs (two 3-axis joysticks and a slider, with a button on top -# of each joystick). This will drive one of these devices, which attaches to -# a serial port on this computer. I'm not sure what the baud rate should be; -# David Harrison might know. -# This driver can be used in conjunction with the JoyFly driver to produce a -# tracker that uses the joystick to fly around. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# float minimum_update_rate_from_analogs_even_if_they_dont_move - -#vrpn_Joystick Joybox0 /dev/ttyd1 19200 10.0 - -################################################################################ -# Linux Joystick. Interface to the Linux Joystick driver by Vojtech Pavlik -# included in several Linux distributions. The server code has been tested -# with Linux Joystick driver version 1.2.14. Yet, there is no way how to -# map a typical joystick's zillion buttons and axes on few buttons and axes -# really used. Unfortunately, even joysticks of the same kind can have -# different button mappings from one to another. -# Arguments: -# char name_of_this_device[] -# char name_of_joystick_device[] - -#vrpn_Joylin Joylin0 /dev/js0 - -################################################################################ -# Fakespace Pinch Glove. Drives a Fakespace Pinch Glove device connected to a -# serial port on this machine. This device has ten buttons-two hands and five -# fingers on each hand. Buttons 0-4 are fingers for the right hand-thumb first -# and pinkie last- while buttons 5-9 are for the left hand-thumb first. The -# Button is ON when it is touching another finger. Therefore there cannot -# be just one Button ON. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Button_PinchGlove PinchGlove0 COM1 9600 - -################################################################################ -# Adrienne Electronics Corporation PCI time code driver. The PCI-VITC board -# for which this driver was developed reads in VITC time codes from an input -# signal. This will drive one of these devices. -# Arguments: -# char name_of_this_device[] - -#vrpn_TimeCode_Generator TimeGen0 - -################################################################################ -# 5DT glove. Drive a 5dt glove connected on a serial Port. This device uses -# optical fiber to get the finger position. Not all the 5dt gloves are available -# now. -# 2 modes are driven: the first one let the driver get data from the glove -# when requested (we advise this mode). The second one makes the glove send -# data continuously. This mode may saturate the input buffer. -# The manual states that there will be 9 bytes per report, but one group -# has found that they get an extra one: 0x55 at the end of each report. -# So, you can choose whether to use 9 (the default) or 10 now. -# Gesture management is not implemented yet nor the mouse emulation mode -# arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int mode_of_data_reporting (1 = on request, 2 = continuously) -# int ten_bytes_per_report (0 = no, use 9; 1 = yes) - -#vrpn_5dt glove_5dt /dev/ttyS0 19200 1 0 -#vrpn_5dt glove_5dt COM1 19200 1 0 - -################################################################################ -# NRL Serial Mouse. A device made by wiring buttons in parallel with the buttons -# on a serial mouse. Both mousesystems or microsoft mouse protocols are -# supported. Note that the server code makes the connection at the standard -# 1200 baud. The mouse can be plugged into any serial port -- this driver goes -# directly through the raw port and does not use the built-in mouse drivers. -# NOTE: The middle button on the 3button type is toggled by moving the mouse -# on a surface while not toggling the other two buttons, strange as this may -# seem. The motion of the mouse is not reported, only the buttons. - -#vrpn_Button_SerialMouse Button0 /dev/ttyd1 mousesystems -#vrpn_Button_SerialMouse Button0 /dev/ttyd1 3button -#vrpn_Button_SerialMouse Button0 COM1 mousesystems -#vrpn_Button_SerialMouse Button0 COM1 3button - -################################################################################ -# NRL TNG3. (Totally Neat Gadget) A device made by mindtel, available from -# pulsar.org. Powered off the serial port control lines, the TNG3 has 8 digital -# and 8 analog inputs. Analog resolution is 8 bits. Baud rate fixed internally -# at 19200. -# char name_of_this_device[] -# char name_of_serial_device[] -# int number_of_buttons_to_read (i.e. 8 ==> 0,1,2,3,4,5,6,7) -# int number_of_analogs_to_read - -#vrpn_Tng3 tng3name /dev/ttyd2 4 0 -#vrpn_Tng3 tng3name com1 8 8 -#vrpn_Tng3 tng3name com1 1 1 - -################################################################################ -# Microsoft DirectX compatible force-feedback joystick (or non-force-feedback -# joystick). -# char name_of_this_device[] -# int number of times per second to read from the device -# int number of times per second to update force (0 for non-force device) - -#vrpn_DirectXFFJoystick Joystick0 60 200 -#vrpn_DirectXFFJoystick Joystick0 60 0 - -################################################################################ -# Manager for joysticks under windows using standard win32 calls. -# for force feedback support, see DirectX joystick above -# -# Arguments: -# char name_of_this_device[] -# int joystick Id -# (1 for first joystick JOYSTICKID1 or 2 for second JOYSTICKID2 only) -# int number of times per second to read from the device -# int readmode : 0 = raw data; -# 1 = 0,1 normalized data; -# 2=-1,1 normalized data -# int percentage (0 to 100) of deadzone (used mode 1 and 2 only) - -#vrpn_Joywin32 joyWin32 1 60 2 35 - -################################################################################ -# Global Haptics GeoOrb serial-line device that contains a number of buttons, -# a thumbwheel, and a trackball. For current devices, only 19200 baud works. -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_GlobalHapticsOrb Orb0 COM1 19200 - -################################################################################ -# SensAble Technologies Phantom force-feedback device opened using the -# GHOST software developer's kit. For Phantom Desktop systems, you don't -# need to have the user establish the reset position. For the Premium models, -# you do. -# Arguments: -# char name_of_this_device[] -# int establish_reset_position (0 or 1) -# float rate_to_send_tracker_reports - -#vrpn_Phantom Phantom 0 60.0 - -############################################################################## -# Virtual Presence Joystick tracker device. (http://www.vrweb.com) -# Use this driver to read the button states, -# use Flock-of-Birds driver for the position/orientation state -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_VPJoystick VPJoystick0 /dev/ttyS0 9600 - -################################################################################ -# Advanced Realtime Tracking GmbH (http://www.ar-tracking.de) DTrack client -# -# creates as many vrpn_Tracker as there are bodies or flysticks, starting with -# the bodies. -# creates 2 analogs per flystick -# creates 8 buttons per flystick -# -# NOTE: numbering of flystick buttons differs from DTrack documentation -# -# Arguments: -# char name_of_this_device[] -# int udp_port (DTrack sends data to this udp port) -# float time_to_reach_joy (see below) -# -# Optional arguments: -# int number_of_bodies, number_of_flysticks (fixed numbers of bodies and flysticks) -# int renumbered_ids[] (vrpn_Tracker IDs of bodies and flysticks) -# char "-" (activates tracing; always last argument) -# -# NOTE: time_to_reach_joy is the time needed to reach the maximum value of the -# joystick -# (1.0 or -1.0) when the corresponding button is pressed (one of the last -# buttons amongst the 8) -# -# NOTE: if fixed numbers of bodies and flysticks should be used, both arguments -# number_of_bodies and number_of_flysticks have to be set -# -# NOTE: renumbering of tracker IDs is only possible, if fixed numbers of bodies and -# flysticks are set; there has to be an argument present for each -# body/flystick - -#vrpn_Tracker_DTrack DTrack 5000 0.5 -#vrpn_Tracker_DTrack DTrack 5000 0.5 2 2 -#vrpn_Tracker_DTrack DTrack 5000 0.5 2 2 2 1 0 3 - -################################################################################ -# National Instruments Analog Output server. This will open the board whose -# name is specified, configure the number of channels specified, and set the -# polarity and maximum voltage range at which to drive the channels. -# -# Arguments: -# char vrpn_name_for_this_device[] -# char name_of_NI_board[] -# int number_of_channels -# int polarity : 0 = unipolar, 1 = bipolar -# float min_voltage -# float max_voltage - -#vrpn_NI_Analog_Output Analog_XY DAQCard-6036E 2 0 -10.0 10.0 -#vrpn_NI_Analog_Output Analog_ZTweeze DAQCard-6036E 2 0 -10.0 10.0 - -################################################################################ -# Analog Poser. This is a poser that is intended to be used on top of -# an analog output (perhaps a National Instruments board), whose outputs -# directly drive the position of some actuated stage. It could be used on top -# of any analog output device, in fact. This device basically takes in poses -# and puts out analog outputs. -# One analog channel is associated with each axis (X, Y, Z) and rotation about -# each axis (RX, RY, RZ). For each axis, the position (meters) is converted into -# a voltage; the orientation is mapped from a quaternion into Euler angles and -# each of the Euler angles is converted into a voltage (XXX Orientation is not yet -# implemented; the RX,RY, and RZ values must be specified but they are not used). -# XXX Velocity and orientation velocity are not yet supported. -# Any axis can be disabled by setting the name of its associated device to the -# string "NULL". -# -# Arguments: -# char vrpn_name_for_this_device[] -# char vrpn_name_of_the_analog_output_to_use[] -# (Preface with a * if it uses the same connection) -# [six lines follow, one for X Y Z RX RY RZ, each with: -# char axis_name[] (X Y Z RX RY RZ in that order) -# int channel_of_analog_output_device (First channel is channel 0) -# float offset -# float scale -# float min_value of workspace -# float max_value of workspace -# ] - -#vrpn_Poser_Analog Poser0 -#X *Analog_XY 0 0.0 1.0 -10 10 -#Y *Analog_XY 1 0.0 1.0 -10 10 -#Z *Analog_ZTweeze 0 0.0 1.0 -10 10 -#RX NULL 0 0.0 1.0 -10 10 -#RY NULL 0 0.0 1.0 -10 10 -#RZ NULL 0 0.0 1.0 -10 10 - -################################################################################ -# Nikon microscope connected to PC via serial port. Currently only controls -# the focus of the microscope using an analogout and reads the focus position -# using an analog. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] - -vrpn_nikon_controls Focus COM1 - -################################################################################ -# Tektronix 4662 plotter. Attaches to a serial port. Acts as both a poser and -# a tracker. Reports positions 4x per second plus when a move command completes. -# Multiple move commands issued before they complete will result in only the last -# one being executed. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tek4662 Tek4662 COM1 1200 - diff --git a/src/vrpn/installers/phantom_server/autorun.inf b/src/vrpn/installers/phantom_server/autorun.inf deleted file mode 100644 index 454e205d027f47e51321144721563b006e59e341..0000000000000000000000000000000000000000 --- a/src/vrpn/installers/phantom_server/autorun.inf +++ /dev/null @@ -1,3 +0,0 @@ -[autorun] -open=Phantom server v06_04.exe -label=Phantom Server diff --git a/src/vrpn/installers/phantom_server/phantom_server.qsp b/src/vrpn/installers/phantom_server/phantom_server.qsp deleted file mode 100644 index 46cf68339300c9d863bae0b566a30135e1d7b20b..0000000000000000000000000000000000000000 --- a/src/vrpn/installers/phantom_server/phantom_server.qsp +++ /dev/null @@ -1,220 +0,0 @@ -[General] -FileVersion=1.1 -FileType=QSetupIniFile -ComposerVersion=4.0.0.4 - -[Project] -ProjectName=phantom_server -ProjectDirectory=F:\taylorr\STM\src\vrpn\installers\phantom_server -NonSFXDirectory=F:\taylorr\STM\src\vrpn\installers\phantom_server\NonSFX -MediaFileName=Phantom server v06_04 -CopyMediaToFName= -ProgramDescriptiveName=Phantom Server -ProgramVersion=06.04 -CompanyName=UNC NSRG -ProgVerLiveUpdate=0 -RegisterAsApp=1 -LanguageFlag=1 -LanguageNames=| -UseNonSFXDir=0 -ClrNonSFXDir=0 -CompressNonSFXFiles=0 -ForceCopyNonSFXFiles=0 - -[Display] -AddSetupBackground=1 -TopLabel=1 -TopLabelVer=1 -TopLabel2=0 -BottomLabel=0 -TopLabelText="Phantom Server" -TopLabel2Text="" -BottomLabelText="Copyright © 2003" -TopBackgroundColor=16711680 -BottomBackgroundColor=0 -AddBottomColor=1 -DlgBmp3DFrame=1 -DialogStyle=Modern -AddDialogBitmap=0 -DialogBitmapFileName= -AddBackgroundBitmap=0 -BackgroundBitmapFileName= -BackgroundBitmapLocation=|Top/Left|0|0| -AddBackgroundWave=0 -BgBmpTransparent=0 -BackgroundWaveFileName= -BackgroundWaveLocation=|Center|300|0| -BackgroundWaveLoop=1 -BackgroundWaveDelay=0 -AddBackgroundWaveSlider=1 -BackgroundWaveSliderType=Fixed -TopLabelSide=Left -TopLabel2Side=Left -BottomLabelSide=Left -DialogLocation=|Center|0|0| -TopLabelFont=|Tahoma|36|16777215|1|2| -TopLabel2Font=|Tahoma|18|16777215|1|2| -BottomLabelFont=|Tahoma|10|16777215|1|0| -CompanyUrl=www.cs.unc.edu/nano - -[TargetExe] -TargetDirectory=<AbsoluteDir>C:\nsrg\bin\Phantom server 06.04 -CommonDirectory=<AbsoluteDir>C:\nsrg\src -AuxDirectory=<FontDir> -TargetExeName=<Application Folder>\vrpn_server.exe -RunTimeDir_1=|||||||1||||1||1|<ProgramFilesDir>||||| -RunTimeDir_2=|||||||1||||1||1|<ProgramFilesDir>||||| -RunTimeDir_3=|||||||1||||1||1|<ProgramFilesDir>||||| - -[Dialogs] -SelectedDialogs=*Welcome,License,Readme,User Information,Setup Type,Custom,*Destination,Associate,*Shortcuts,*Confirm Setup,*Copy Files,*Complete -LicenseTextFile= -ReadmeTextFile= -ReadmeTextFile2= -UseNotepad=0 -SpaceReqOnDriveCheckBox=0 -SpaceReqOnDrive= -RequestUserName=1 -RequestCompanyName=1 -RequestSerialNumberAlso=0 -RequestSerialCheckDLL=0 -SerialCheckDll= -RequestPredefinedSerial=0 -CaseSensitiveSerial=0 -RequestTokenizedSerial=0 -CDSetup=0 -ShowCompactSetupAlso=1 -ForcePartialSetup=0 -ShowProgBar2=0 -SilentSetup=0 -ProposeReadme=0 -ProposeLaunch=0 -ProposeRestart=0 -ProposeReadmeChecked=0 -ProposeLaunchChecked=0 -ShowCloseRecommendation=0 -ShowAdwareDisclaimer=0 -ShowCopyrightWarning=0 - -[Shortcuts] -AddMainShortCut=1 -ForceRemoveShortcutFolder=0 -ProgramLinkFolder=NSRG\Phantom Server v06.04 -ProgramLinkName=Phantom server -ProgramLinkParam= -ProgramLinkWorkDir=<Application Folder> -ProgramLinkRun=Minimized -ProgramLinkIconFile= -ProgramLinkIconNum=0 -StartMenuLinkName=Phantom Server -DesktopLinkName=Phantom Server -SendToLinkName=Phantom Server -StartUpLinkName=Phantom Server -QuickLaunchLinkName=Phantom Server -StartMenuCheckBox=0 -DesktopCheckBox=0 -SendToCheckBox=0 -StartUpCheckBox=0 -QuickLaunchCheckBox=0 -StartMenuChecked=1 -DesktopChecked=1 -SendToChecked=1 -StartUpChecked=1 -QuickLaunchChecked=1 -SetAllUsers=1 -AddUninstallShortcut=1 -Item-000=*|Configuration|<Application Folder>\vrpn.cfg|NSRG\Phantom Server v06.04|||Normal Window||0| - -[Billboard] -AddBillboard=1 -Item-000=|1|0|0|1|0|Center|0|0|8388608|16711680|Verdana|14|16777215|1|0|360|360|0|1| - -[SplitSetup] -SplitSetup=0 -ForceDownload=1 -DownloadURL_SPLIT=http:// -ConfirmSplitDownload=0 - -[AutoUpdate] -AutoUpdate=0 -RunAutoUpdate=1 -AddAutoUpdateShortcut=1 -ReqConfirmDownload=0 -ReqConfirmInstall=0 -ShutDownMethod=Don't Shut Down -BackgroundUpdate=0 -RestartProcess=0 -InformFinish=0 -UpdateProjectFName= -DownloadURL_UPDATE=http:// -NameOfUpdateFile= -RunningProcess= -VersionOriginal=1 -ValidVersions= -VersionNew=1 -ReAskDays=0 -AutoUpdateProbeSpin=1 -AutoUpdateProbeText=Only at Agent Start - -[Switches] -OperatingSystems=2000,XP -OverwriteFlag=1 -CreateUnInstall=1 -ScrambleUnInstallData=1 -HideErrMsgUnInstall=0 -HideLogBtnUnInstall=0 -UnInstallExeStampSwitch=0 -UnInstallExeStamp= -CreateLogFile=0 -ConfirmExtract=0 -TestAdminRights=1 -TestAdminRightsUnInstall=1 -TestDotNetFramework=0 -TestExeBeforeInstall=1 -TestExeBeforeUnInstall=1 - -[Registry] - -[IniFile] - -[Environment] - -[Association] -OpenWith=0 -OpenWithName= -OpenWithMenuText=Open with -OpenWithExtensions= - -[VerInfo] -CopyFromExe=0 -DefineManually=0 -Item-001=|Comments|| -Item-002=|CompanyName|| -Item-003=|FileDescription|| -Item-004=|FileVersion|| -Item-005=|InternalName|| -Item-006=|LegalCopyright|| -Item-007=|LegalTrademarks|| -Item-008=|OriginalFilename|| -Item-009=|ProductName|| -Item-010=|ProductVersion|| -CopyIconFromTargetExe=0 -CopyIconFromOtherApp=0 -OtherIconAppFileName= -Spin1=0 -Spin2=0 - -[Execute] -ExecuteDllCheckBox=0 -ExecutionDllFileName= - -[GroupNames] -Group-000=Main Group - -[Group-000] -TypicalCompactData=15 -Description=This is the main group of files -Item-000=Fol*<Application Folder>[0] -Item-001=Fil*F:\taylorr\STM\src\vrpn\installers\phantom_server\vrpn.cfg -Item-002=Fil*F:\taylorr\STM\src\vrpn\installers\phantom_server\vrpn_Tracker.cfg -Item-003=Fil*F:\taylorr\STM\src\vrpn\pc_win32\server_src\vrpn_server\Release\vrpn_server.exe diff --git a/src/vrpn/installers/phantom_server/vrpn.cfg b/src/vrpn/installers/phantom_server/vrpn.cfg deleted file mode 100644 index 9d6e58147a5b627b1c2ae6b67ccfd2163df3b62c..0000000000000000000000000000000000000000 --- a/src/vrpn/installers/phantom_server/vrpn.cfg +++ /dev/null @@ -1,771 +0,0 @@ -# vrpn.cfg.SAMPLE for VRPN version 06.04 - -################################################################################ -################################################################################ -# This file provides comments and examples for the vrpn.cfg file that is read -# by the vrpn_server application when it starts up. This is a generic server -# application that can start up many but maybe not all servers. -# -# This has sample lines for a vrpn.cfg file. If you get a new device working, -# add a line for it here. DO NOT remove lines from this file (unless -# devices are declared obsolete) - just change the actual vrpn.cfg to match -# your application. -# -# All examples in the file are preceded by comment characters (#). To actually -# use one of these examples, remove that character from the beginning of all the -# examples that you want to use, and edit those lines to suit your environment. -################################################################################ - -################################################################################ -################################################################################ -# Tracker classes. Lines here to start various tracker servers. A description is -# provided for each type of tracker for the arguments it takes, then an example -# configuration line is provided. -################################################################################ - -################################################################################ -# NULL Tracker. This is a "device" that reports the Identity transformation for -# each of its sensors at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are three arguments: -# char name_of_this_device[] -# int number_of_sensors -# float rate_at_which_to_report_updates - -#vrpn_Tracker_NULL Tracker0 2 2.0 - -################################################################################ -# Flock-of-birds Tracker. Runs an Ascension Flock of Birds tracker that is -# attached to a serial port on this machine. Note that there is another driver -# (listed below) that runs the Flock when each sensor is connected to its own -# serial line. Arguments: -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tracker_Flock Tracker0 4 /dev/ttyS0 115200 - -################################################################################ -# Flock-of-birds in parallel Tracker. Runs an Ascension Flock of Birds tracker -# that has its source and each sensor plugged into its own serial port on this -# machine (perhaps through a Cyclades multi-port serial card). This mode of -# operation increases the throughput and decreases the latency of tracker reports. -# The arguments match those of the Flock-of-birds tracker from above, with the -# addition of the name of the serial ports for each of the sensors added at the -# end. Arguments (all on the same line): -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device_for_controller[] -# int baud_rate_of_serial_device -# [one for each sensor] char name_of_serial_device_for_sensor[] - -#vrpn_Tracker_Flock_Parallel Tracker0 4 /dev/ttyC4 115200 /dev/ttyC0 /dev/ttyC1 /dev/ttyC2 /dev/ttyC3 - -################################################################################ -# Fastrak Tracker. Runs a Polhemus Fastrak tracker that is attached to a serial -# port on this machine. This driver will also run an InterSense IS600 or IS900 -# tracker, but you will want to include extra initialization code (as described -# below) to set up the ultrasonic pip information, wand devices, stylus devices -# and so forth. Arguments that go on the first line: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the Fastrak during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the Fastrak -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. -# -# If one or more sensors on the Fastrak have a stylus button on them, use -# the "FTStylus" command after the reset command lines (if any). There should -# be a front-slash "/" character at the end of the line before the FTStylus -# command. The command takes two arguments: the name of the button device -# that will report the buttons and the sensor number to which the button is -# attached (the first sensor is sensor 0). -# -# Commands to add Joysticks (2 buttons) or Wands (5 buttons and 2 analogs) to -# the various sensors on the Isense900 are done by adding Stylus and -# Wand command lines after the reset command lines. Each of these lines -# takes two arguments: the name of the button (for Stylus) or button and -# analog (for Wand) servers, and the sensor number (starting from 0). The -# Wand line takes eight additional parameters, which specify the scaling -# and clipping behavior of the two directions on the analog joystick. Each -# set of for is the min, lowzero, hizero, and max values: these are mapped -# to -1, 0,0, and 1 (all values between lowzero and hizero are mapped to 0). -# Start with these at -1,0,0,1 and use the 'printcereal' program or some other -# method to read them and see what the range of acheivable values is. Then, -# set them to slightly conservative values so that the whole range is covered -# and the analogs will report zero when the joystick is centered. The -# presence of these lines is indicated by placing them after any additional -# reset command lines, by ending the line preceding them with the front slash -# "/" character. -# -# Remember that the "remote" button object is not the same as the the tracking -# device, so be sure to use a remote button object that connects to the button -# rather than the tracker. The button device name is defined on the stylus or -# wand line in the config file, and should not be the same as the tracker. In -# the case described by the example configuration below, if the name of the -# machine running the server is "myis900server" you would connect to the tracker -# as "Isense900@myis900server" and to the buttons on the stylus as -# "Stylus0@myis900server": -# -# Note that this frontslash and backslash-notation can only be used for the -# Fastrak/Isense tracker, not to extend the line for any other type of device -# listed in this configuration file. - -# Vanilla Fastrak on on a Unix box -#vrpn_Tracker_Fastrak Fastrak0 /dev/ttyS0 19200 - -# Fastrak with a stylus on sensor zero on a Windows box -#vrpn_Tracker_Fastrak Tracker0 COM1 115200 / -#FTStylus Stylus0 0 - -# IS600 and its pip settings -#vrpn_Tracker_Fastrak Isense600 /dev/ttyS0 19200 \ -#MCc\ -#*5\ -#MCM1,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,89\ -#MCM1,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,87\ -#MCM2,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,66\ -#MCM2,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,71\ -#MCM3,1,0.1237,-0.0762,-0.0424,0.00,0.00,-1.00,82\ -#MCM3,2,0.1237,0.0762,-0.0424,0.00,0.00,-1.00,77\ -#MCe\ -#*10 - -# IS900 with a wand on the first sensor and a stylus on the third: -#vrpn_Tracker_Fastrak Isense900 COM1 115200 / -#Wand Wand0 0 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 / -#Stylus Stylus0 2 - -################################################################################ -# InterSense tracker using the Intersense-provided library to communicate -# with the tracker. This device type is not compiled by default, since it uses -# a proprietary library. However, you can get it to compile by defining -# VRPN_INCLUDE_INTERSENSE when compiling. Note that the Fastrak driver will -# run IS-600 and IS-900 trackers without the proprietary library, so you might -# try that as well. -# -# You can include extra initialization code (as described -# below) to set up the ultrasonic pip information, wand devices, stylus devices -# and so forth. Arguments that go on the first line: -# char name_of_this_device[] -# char name_of_serial_device[] - this can be COM1-4 or AUTO -# AUTO will automatically find USB and -# serial trackers. Use COM1-4 only if you -# have more than one serial tracker. -# You should use COM1-4 on unix as well, -# as these just tell the isense library -# to look in serial port 1-4. -# I guess you can't have >1 USB trackers. -# char "IS900time" - use the IS900 timestamps (optional) -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the InterSense during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the InterSense -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. -# -# Commands to add Joysticks (2 buttons) or Wands (5 buttons and 2 analogs) to -# the various sensors on the Isense900 are done by adding Stylus and -# Wand command lines after the reset command lines. Each of these lines -# takes two arguments: the name of the button (for Stylus) or button and -# analog (for Wand) servers, and the sensor number (starting from 0). The -# Wand line takes eight additional parameters, which specify the scaling -# and clipping behavior of the two directions on the analog joystick. Each -# set of for is the min, lowzero, hizero, and max values: these are mapped -# to -1, 0,0, and 1 (all values between lowzero and hizero are mapped to 0). -# Start with these at -1,0,0,1 and use the 'printcereal' program or some other -# method to read them and see what the range of acheivable values is. Then, -# set them to slightly conservative values so that the whole range is covered -# and the analogs will report zero when the joystick is centered. The -# presence of these lines is indicated by placing them after any additional -# reset command lines, by ending the line preceding them with the front slash -# "/" character. -# -# Remember that the "remote" button object is not the same as the the tracking -# device, so be sure to use a remote button object that connects to the button -# rather than the tracker. The button device name is defined on the stylus or -# wand line in the config file, and should not be the same as the tracker. In -# the case described by the example configuration below, if the name of the -# machine running the server is "myis900server" you would connect to the tracker -# as "Isense900@myis900server" and to the buttons on the stylus as -# "Stylus0@myis900server": -# -# Note that this frontslash and backslash-notation can only be used for the -# Fastrak and InterSense tracker, not to extend the line for any other -# type of device -# listed in this configuration file. - -# Vanilla InterSense -#vrpn_Tracker_InterSense Tracker0 AUTO IS900time / -#Wand Wand0 0 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 - -# Vanilla InterSense using IS900 timing -#vrpn_Tracker_InterSense Tracker0 AUTO IS900time - -# IS600 and its pip settings -#vrpn_Tracker_InterSense Isense600 COM1 \ -#MCc\ -#*5\ -#MCM1,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,89\ -#MCM1,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,87\ -#MCM2,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,66\ -#MCM2,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,71\ -#MCM3,1,0.1237,-0.0762,-0.0424,0.00,0.00,-1.00,82\ -#MCM3,2,0.1237,0.0762,-0.0424,0.00,0.00,-1.00,77\ -#MCe\ -#*10 - -# IS900 with a wand on the first sensor and a stylus on the third: -#vrpn_Tracker_InterSense Isense900 COM1 / -#Wand Wand0 0 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 / -#Stylus Stylus0 2 - -################################################################################ -# Dynasight Tracker. Runs an Origin System's DynaSight tracker connected to a -# serial port on this machine. arguments: -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tracker_Dyna Tracker0 1 /dev/ttyS0 19200 - -#vrpn_Tracker_Dyna Tracker0 1 COM1 19200 - -################################################################################ -# AnalogFly Tracker. This is a tracker that is intended to be used on top of -# a joystick or motion tracker of some kind to turn it into a moving or flying -# device. It could be used on top of any analog device, in fact. -# This device basically takes in analog signals and puts out transformation -# matrices. It should supercede the JoyFly tracker, since it is more general. -# There are two kinds of JoyFly's: absolute ones and differential ones. For -# absolute ones, the analog value is mapped directly to position or orientation -# on each axis. For differential ones, the values are used to create a -# "change" matrix that is applied once per interval, accumulating changes as -# it goes; this enables the user to "fly" along by holding a joystick forward, -# for example. -# One analog channel is associated with each axis (X, Y, Z) and rotation about -# each axis (RX, RY, RZ). For each axis, the value is converted to a position -# (meters) or speed (meters/second) for absolute trackers; or into an -# orientation (revolutions) or angular velocity (revolutions/second) by first -# subtracting an offset, then thresholding it to see if it is far enough from -# zero, then (if it is) scaling it and taking it to a power (to allow nonlinear -# speedup as the stick is pushed far from center). -# A button can be associated with a reset function, which will take the -# device back to center (identity transformation). The device will also recenter -# when the first connection is made to the server it is running on. (Centering -# has no effect on absolute AnalogFlys). -# Any axis or the reset button can be disabled by setting the name of its -# associated device to the string "NULL". -# Note that you could have multiple of these devices running simultaneously, -# each with a different name and interaction metaphor. The user could then -# connect to their favorite one. Arguments: -# char name_of_this_device[] -# float update_rate_to_send_tracker_reports -# char type[] = "absolute" or "differential" -# [six lines follow, one for X Y Z RX RY RZ, each with: -# char axis_name[] (X Y Z RX RY RZ in that order) -# char name_of_analog_device[] (start with * for local) -# int channel_of_analog_device -# float offset -# float threshold -# float scale -# float power -# ] -# [New line to describe reset button, with: -# char "RESET" -# char name_of_button_device[] (start with * for local) -# int which_button_to_use -# ] - -#vrpn_Tracker_AnalogFly Tracker0 60.0 differential -#X *CerealBox0 4 0.0 0.021 1.0 1.0 -#Y *CerealBox0 5 0.0 0.021 1.0 1.0 -#Z *CerealBox0 6 0.0 0.021 3.0 1.0 -#RX *CerealBox0 0 0.0 0.021 1.0 1.0 -#RY *CerealBox0 1 0.0 0.021 1.0 1.0 -#RZ *CerealBox0 2 0.0 0.021 3.0 1.0 -#RESET *CerealBox 3 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 differential -#X *Magellan0 0 0.0 0.0 2.0 1.0 -#Y *Magellan0 1 0.0 0.0 2.0 1.0 -#Z *Magellan0 2 0.0 0.0 2.0 1.0 -#RX *Magellan0 3 0.0 0.0 2.0 1.0 -#RY *Magellan0 4 0.0 0.0 2.0 1.0 -#RZ *Magellan0 5 0.0 0.0 2.0 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X NULL 0 0.0 0.0 1.0 1.0 -#Y NULL 0 0.0 0.0 1.0 1.0 -#Z NULL 0 0.0 0.0 1.0 1.0 -#RX *Radamec0 1 0.0 0.0 -0.0027777777 1.0 -#RY NULL 0 0.0 0.0 1.0 1.0 -#RZ *Radamec0 0 0.0 0.0 0.0027777777 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Joystick0 0 0.0 0.0 1.0 1.0 -#Y *Joystick0 1 0.0 0.0 -1.0 1.0 -#Z *Joystick0 6 0.0 0.0 1.0 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Joystick0 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Phantom 60.0 absolute -#X *Phantom 0 0.0 0.0 0.125 1.0 -#Y *Phantom 1 0.0 0.0 -0.125 1.0 -#Z *Phantom 6 0.0 0.0 0.25 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Phantom 5 0.0 0.0 0.06 1.0 -#RESET NULL 0 - -################################################################################ -# XXX This device is superceded by the more-general vrpn_Tracker_AnalogFly. -# JoyFly Tracker. A vrpn_Tracker that translates the vrpn_Joystick into -# Walkthrough- convention tracker reports. This is part of a two-part setup -# that allows you to use a joystick as a flying device. First, a joystick -# device has to be created (named joybox in our example) that will produce -# the analog inputs that the JoyFly tracker uses to determine the transformation. -# Then, the JoyFly device needs to be started and will listen to the device -# and produce tracker reports. If these are both run on the same server, then -# the JoyFly needs to use the "server" connection to hear from the Joystick -# device, which is indicated by placing a '*' in front of the name of the -# joystick device that it is to use. If the joystick device is remote from -# this server, then the full name of it should be used (joystick@foo.cs.unc.edu). -# XXX This device is superceded by the more-general vrpn_Tracker_AnalogFly -# Arguments: -# char name_of_this_device[] -# char source_joystick_name[] (Start with * for one sharing a connection) -# char joystick_configuration_file_name[] - -#vrpn_JoyFly walk-joybox *joybox vrpn_Joyfly.cfg - -################################################################################ -# ButtonFly Tracker. This is a tracker that is intended to be used on top of -# a Global Haptics Orb or other buttond device to turn it into a moving or -# flying device. It basically takes in button signals and puts out -# transformation matrices. -# There are two kinds of Buttons: absolute ones and differential ones. For -# absolute ones, pressing it causes the position or orientation associated with -# it to be stored directly into the transformation. This enables the user to -# "teleport" to given locations by pressing buttons. For differential ones, -# the position or orientation are treated as deltas and are used to create a -# "change" matrix that is applied once per interval, accumulating changes as -# it goes; this enables the user to "fly" along by holding a button down, -# for example. -# Each button is associated with either a position (meters) or speed -# (meters/second) for absolute buttons; or an orientation (revolutions) -# or angular velocity (revolutions/second). -# An analog channel can be associated with a scale function that scales the -# velocity or angular velocity terms uniformly. The entry specifies an -# offset to be applied to the analog channel, a scale to be applied to it, -# and a power to which the result should be taken; the end result is used -# to scale all velocity or angular velocity terms. This channel has no -# effect on the effects of absolute buttons. -# The device will recenter (set itself to the identity transform) when the -# first connection is made to the server it is running on. -# Note that you could have multiple of these devices running simultaneously, -# each with a different name and interaction metaphor. The user could then -# connect to their favorite one. Arguments: -# char name_of_this_device[] -# float update_rate_to_send_tracker_reports -# [one or more lines follow, each of one of two types -# (1) char [] = "absolute" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float X_to_translate_to -# float Y_to_translate_to -# float Z_to_translate_to -# float rotation_about_X -# float rotation_about_Y -# float rotation_about_Z -# (2) char [] = "differential" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float X_translation_meters_per_second -# float Y_translation_meters_per_second -# float Z_translation_meters_per_second -# float spin_about_X_revolutions_per_second -# float spin_about_Y_revolutions_per_second -# float spin_about_Z_revolutions_per_second -# ] -# [An optional line describing an analog to scale the velocity -# char [] = "vel_scale" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float offset -# float scale -# float power -# ] -# [An optional line describing an analog to scale the rotation -# char [] = "rot_scale" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float offset -# float scale -# float power -# ] -# [one more line, consisting of the word "end"] -# Note that the same button can cause more than one action to take place, -# and the same analog can cause scaling of both the velocity and rotation. - -# This example for a Global Haptics Orb pushes the transformation away -# from the button that is pressed -# for all of the standard buttons. It rotates around the Y axis when the -# rocker switch is rocked up and down. It resets to the origin when one -# of the pushbuttons is pressed. Both the velocity and angular velocity -# are controlled by the thumbwheel. - -#vrpn_Tracker_ButtonFly Tracker0 60.0 -#differential *Orb0 0 0 1 0 0 0 0 -#differential *Orb0 1 0.707 0.707 0 0 0 0 -#differential *Orb0 2 1 0 0 0 0 0 -#differential *Orb0 3 0.707 -0.707 0 0 0 0 -#differential *Orb0 4 0 -1 0 0 0 0 -#differential *Orb0 5 -0.707 -0.707 0 0 0 0 -#differential *Orb0 6 -1 0 0 0 0 0 -#differential *Orb0 7 -0.707 0.707 0 0 0 0 -#differential *Orb0 8 0 0.707 -0.707 0 0 0 -#differential *Orb0 9 0.577 0.577 -0.577 0 0 0 -#differential *Orb0 10 0.707 0 -0.707 0 0 0 -#differential *Orb0 11 0.577 -0.577 -0.577 0 0 0 -#differential *Orb0 12 0 -0.707 -0.707 0 0 0 -#differential *Orb0 13 -0.577 -0.577 -0.577 0 0 0 -#differential *Orb0 14 -0.707 0 -0.707 0 0 0 -#differential *Orb0 15 -0.577 0.577 -0.577 0 0 0 -#differential *Orb0 16 0 0.707 0.707 0 0 0 -#differential *Orb0 17 0.577 0.577 0.577 0 0 0 -#differential *Orb0 18 0.707 0 0.707 0 0 0 -#differential *Orb0 19 0.577 -0.577 0.577 0 0 0 -#differential *Orb0 20 0 -0.707 0.707 0 0 0 -#differential *Orb0 21 -0.577 -0.577 0.577 0 0 0 -#differential *Orb0 22 -0.707 0 0.707 0 0 0 -#differential *Orb0 23 -0.577 0.577 0.577 0 0 0 -#differential *Orb0 24 0 0 -1 0 0 0 -#differential *Orb0 25 0 0 1 0 0 0 -#differential *Orb0 28 0 0 0 0 -0.1 0 -#differential *Orb0 29 0 0 0 0 0.1 0 -#absolute *Orb0 27 0 0 0 0 0 0 -#vel_scale *Orb0 0 -1.0 0.5 1.0 -#rot_scale *Orb0 0 -1.0 0.5 1.0 -#end - -################################################################################ -# 3Space Tracker. Runs a Polhemus 3Space (not Fastrak) tracker that is attached -# to a serial port on this machine. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tracker_3Space Tracker0 /dev/ttyS0 19200 - -################################################################################ -################################################################################ -# Non-tracker devices. Lines are provided here for the various non-tracker servers -# that can be started. - -################################################################################ -# Example Dial server. This is a "device" that reports constant rotations for -# each of its dials at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are four arguments: -# char name_of_this_device[] -# int number_of_dials -# float rate_at_which_the_dials_spin (revolutions/second) -# float rate_at_which_to_report_updates (udpates/second) - -#vrpn_Dial_Example Dial0 2 2.0 10.0 - -################################################################################ -# CerealBox dial/button/analog. Runs a BG Systems CerealBox device that attaches -# to a serial port on this machine. As of VRPN version 04.07, 19200 is the -# only supported baud rate. The driver has been tested on an LV824-F-8e device. -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int number_of_buttons_to_read (starting from 0) -# int number_of_analogs_to_read -# int number_of_encoders_to_read - -#vrpn_CerealBox Cereal0 /dev/cua0 19200 8 8 8 - -################################################################################ -# Magellan button/analog. Runs a Logitech Magellan device that attaches -# to a serial port on this machine. As of VRPN version 04.12, 9600 is the -# only supported baud rate. -# -# Note that if you want to use the Magellan as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device that listens to its analog -# outputs and converts them into tracker reports -# -# John Stone added support for the SpaceBalls in version 06.03, an example -# startup is shown below. -# -# Julien Brisset discovered how to make this work with a slightly older version -# of the Magellan. If the example Magellan line doesn't work, add 'altreset' to -# the line to use the alternative reset string for the device. -# -# NOTE: You should NOT run the driver that comes with the Magellan, since the -# VRPN driver opens the serial port and communicates with the device directly. -# If the Magellan driver from the manufacturer is running, then VRPN will not -# be able to open the port. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# char "altreset" {Optional, for older Magellans} - -#vrpn_Magellan Magellan0 /dev/ttyS0 9600 -#vrpn_Magellan Magellan0 /dev/ttyS0 9600 altreset -#vrpn_Spaceball Spaceball0 /dev/ttyS0 9600 - -################################################################################ -# NRL Immersion Box dial/button/analog. Runs a Immersion Interface Box device -# attached to a serial port. As of March 28, 2000 code to read the analog and -# angle encoders has not been implemented. Also, baud rate on many SGI's is -# limited to 38400, but I have run the ibox at 115200 on PCs. -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int number_of_buttons_to_read (i.e. 4 ==> 0,1,2,3) -# int number_of_analogs_to_read -# int number_of_encoders_to_read - -#vrpn_ImmersionBox ibox /dev/ttyd2 38400 4 0 0 -#vrpn_ImmersionBox ibox com1 115200 4 0 0 - -################################################################################ -# Wands button/analog, driver from Brown University. Runs a Wanda device -# attached to a serial port. As of Aug 28, 2000 this driver was untested on -# Windows machines. The code compiles fine for them, so it seems like things -# should work okay... -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port_to_use[] -# int baud_rate_of_serial_device -# float minimum_update_rate - -#vrpn_Wanda wanda /dev/ttyd2 38400 60.0 - -################################################################################ -# Radamec Serial Position Interface analog. Camera tracker that attaches -# to a serial port on this machine. Note that for normal operation, 38400 is the -# only supported baud rate. -# -# Note that if you want to use the Radamec SPI as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device (of the absolute variety) -# that listens to its analog outputs and converts them into tracker reports. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port[] -# int baud_rate_of_serial_port - -#vrpn_Radamec_SPI Analog0 /dev/ttyS16 38400 - -################################################################################ -# Zaber linear positioning element analog that attaches -# to a serial port on this machine. -# -# Note that if you want to use the Zaber as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device (of the absolute variety) -# that listens to its analog outputs and converts them into tracker reports. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port[] - -#vrpn_Zaber Analog0 COM1 - -################################################################################ -# SGI Dial and Button box, raw interface. Runs a dial-and-button box from SGI, -# talking to it through the raw serial interface (not using the GL interface -# supplied by SGI). This allows the box to be opened even if there is nobody -# logged on at the console. Note that to use this on an SGI, you will need to -# configure the port as a serial device, not as a button device, to get it to -# run. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# [list of buttons to treat as toggles] int button_to_toggle - -#vrpn_raw_SGIBox Sgibox0 /dev/ttyS0 0 1 2 3 - -################################################################################ -# SGI Dial and Button box, cooked interface. Runs a dial-and-button box from SGI, -# talking to it through the GL interface supplied by SGI. Note that this can -# only be used on an SGI, and the serial port must be configured as a dial/button -# device and the dial/button server from SGI must be running to use it. Arguments: -# char name_of_this_device[] -# [list of buttons to treat as toggles] int button_to_toggle - -#vrpn_SGIBOX Sgibox0 1 2 - -################################################################################ -# UNC Python button device. UNC has developed a custom button input device, which -# is a 5-button controller that attaches to a parallel port and uses the sense -# lines to return the state of the buttons. This runs the device. Note that on -# Windows NT, you need to have installed the GiveIO driver for this code to -# work. It also works on Linux (no extra drivers needed), but on no other -# architecture. Arguments: -# char name_of_this_device[] -# int parallel_port_to_use_starting_with_1 - -#vrpn_Button_Python Button0 1 - -################################################################################ -# UNC Joystick driver. UNC has developed a custom-build joybox, with 7 analog -# and 2 button inputs (two 3-axis joysticks and a slider, with a button on top -# of each joystick). This will drive one of these devices, which attaches to -# a serial port on this computer. I'm not sure what the baud rate should be; -# David Harrison might know. -# This driver can be used in conjunction with the JoyFly driver to produce a -# tracker that uses the joystick to fly around. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# float minimum_update_rate_from_analogs_even_if_they_dont_move - -#vrpn_Joystick Joybox0 /dev/ttyd1 19200 10.0 -#vrpn_Joystick Joybox0 COM1 19200 10.0 - -################################################################################ -# Linux Joystick. Interface to the Linux Joystick driver by Vojtech Pavlik -# included in several Linux distributions. The server code has been tested -# with Linux Joystick driver version 1.2.14. Yet, there is no way how to -# map a typical joystick's zillion buttons and axes on few buttons and axes -# really used. Unfortunately, even joysticks of the same kind can have -# different button mappings from one to another. -# Arguments: -# char name_of_this_device[] -# char name_of_joystick_device[] - -#vrpn_Joylin Joylin0 /dev/js0 - -################################################################################ -# Fakespace Pinch Glove. Drives a Fakespace Pinch Glove device connected to a -# serial port on this machine. This device has ten buttons-two hands and five -# fingers on each hand. Buttons 0-4 are fingers for the right hand-thumb first -# and pinkie last- while buttons 5-9 are for the left hand-thumb first. The -# Button is ON when it is touching another finger. Therefore there cannot -# be just one Button ON. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -# vrpn_Button_PinchGlove PinchGlove0 COM1 9600 - -################################################################################ -# Adrienne Electronics Corporation PCI time code driver. The PCI-VITC board -# for which this driver was developed reads in VITC time codes from an input -# signal. This will drive one of these devices. -# Arguments: -# char name_of_this_device[] - -# vrpn_TimeCode_Generator TimeGen0 - -################################################################################ -# 5DT glove. Drive a 5dt glove connected on a serial Port. This device uses -# optical fiber to get the finger position. Not all the 5dt gloves are available -# now. -# 2 modes are driven: the first one let the driver get data from the glove -# when requested (we advise this mode). The second one makes the glove send -# data continuously. This mode may saturate the input buffer. -# Gesture management is not implemented yet nor the mouse emulation mode -# arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int mode_of_data_reporting (1 = on request, 2 = continuously) - -# vrpn_5dt glove_5dt /dev/ttyS0 19200 1 - -################################################################################ -# NRL Serial Mouse. A device made by wiring buttons in parallel with the buttons -# on a serial mouse. Both mousesystems or microsoft mouse protocols are -# supported. Note that the server code makes the connection at the standard -# 1200 baud. The mouse can be plugged into any serial port -- this driver goes -# directly through the raw port and does not use the built-in mouse drivers. -# NOTE: The middle button on the 3button type is toggled by moving the mouse -# on a surface while not toggling the other two buttons, strange as this may -# seem. The motion of the mouse is not reported, only the buttons. - -#vrpn_Button_SerialMouse Button0 /dev/ttyd1 mousesystems -#vrpn_Button_SerialMouse Button0 /dev/ttyd1 3button -#vrpn_Button_SerialMouse Button0 COM1 mousesystems -#vrpn_Button_SerialMouse Button0 COM1 3button - -################################################################################ -# NRL TNG3. (Totally Neat Gadget) A device made by mindtel, available from -# pulsar.org. Powered off the serial port control lines, the TNG3 has 8 digital -# and 8 analog inputs. Analog resolution is 8 bits. Baud rate fixed internally -# at 19200. -# char name_of_this_device[] -# char name_of_serial_device[] -# int number_of_buttons_to_read (i.e. 8 ==> 0,1,2,3,4,5,6,7) -# int number_of_analogs_to_read - -#vrpn_Tng3 tng3name /dev/ttyd2 4 0 -#vrpn_Tng3 tng3name com1 8 8 - -################################################################################ -# Microsoft DirectX compatible force-feedback joystick (or non-force-feedback -# joystick). -# char name_of_this_device[] -# int number of times per second to read from the device -# int number of times per second to update force (0 for non-force device) - -#vrpn_DirectXFFJoystick Joystick0 60 0 -#vrpn_DirectXFFJoystick Joystick0 60 200 - -################################################################################ -# Manager for joysticks under windows using standard win32 calls. -# for force feedback support, see DirectX joystick above -# -# Arguments: -# char name_of_this_device[] -# int joystick Id -# (1 for first joystick JOYSTICKID1 or 2 for second JOYSTICKID2 only) -# int number of times per second to read from the device -# int readmode : 0 = raw data; -# 1 = 0,1 normalized data; -# 2=-1,1 normalized data -# int percentage (0 to 100) of deadzone (used mode 1 and 2 only) - -#vrpn_Joywin32 joyWin32 1 60 2 35 - -################################################################################ -# Global Haptics GeoOrb serial-line device that contains a number of buttons, -# a thumbwheel, and a trackball. For current devices, only 19200 baud works. -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_GlobalHapticsOrb Orb0 COM1 19200 - -################################################################################ -# SensAble Technologies Phantom force-feedback device opened using the -# GHOST software developer's kit. For Phantom Desktop systems, you don't -# need to have the user establish the reset position. For the Premium models, -# you do. -# Arguments: -# char name_of_this_device[] -# int establish_reset_position (0 or 1) -# float rate_to_send_tracker_reports - -vrpn_Phantom Phantom 0 60.0 diff --git a/src/vrpn/installers/phantom_server/vrpn_Tracker.cfg b/src/vrpn/installers/phantom_server/vrpn_Tracker.cfg deleted file mode 100644 index f2b84d3d1628f3c776c0510354a903181fc161d4..0000000000000000000000000000000000000000 --- a/src/vrpn/installers/phantom_server/vrpn_Tracker.cfg +++ /dev/null @@ -1,79 +0,0 @@ -Phantom -0.0 0.0 -0.28 -0.0 0.0 0.0 1.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -Phantom@phantom3 -0.0 0.0 -0.28 -0.0 0.0 0.0 1.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -Phantom@phantom -0.0 0.0 -0.28 -0.0 0.0 0.0 1.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -Phantom@phantom1 -0.0 0.0 -0.28 -0.0 0.0 0.0 1.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -Phantom@tantalum-cs -0.0 0.0 -0.28 -0.0 0.0 0.0 1.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -Phantom@phantom2 # nWB phantom, values from .tracker, not sure if right --0.424 -0.1146 -0.0166 -0.130526 0.0 -0.991445 0.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -Tracker0@ionanowb # nWB dynasight head tracker, values from .tracker --0.49 0.251 0.486 -0.521334 0.521334 0.477714 0.477714 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -PhantomNULLhead@phantom -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 - - all PHANToMs have only 1 sensor, (sensor number 0) - This is a sample vrpn_Tracker.cfg file - format: - -<tracker name> -<room from tracker translation (x,y,z)> -<room from tracker quaternion (x,y,z,w)> -<workspace (xmin,ymin,zmin) (xmax,ymax,zmax) in tracker coordinate system> -<number of sensors> -<sensor #> -<sensor from unit translation (x,y,z)> -<sensor from unit quaternion (x,y,z,w)> -... -... diff --git a/src/vrpn/installers/vrpn/autorun.inf b/src/vrpn/installers/vrpn/autorun.inf deleted file mode 100644 index e2eeabf6d16a880d897940d8f9eecc7ef4b2412f..0000000000000000000000000000000000000000 --- a/src/vrpn/installers/vrpn/autorun.inf +++ /dev/null @@ -1,3 +0,0 @@ -[autorun] -open=VRPN v06_04.exe -label=Virtual Reality Peripheral Network diff --git a/src/vrpn/installers/vrpn/vrpn.qsp b/src/vrpn/installers/vrpn/vrpn.qsp deleted file mode 100644 index 340fdf855912eb7480e41f28c4d8fb21c6a5b606..0000000000000000000000000000000000000000 --- a/src/vrpn/installers/vrpn/vrpn.qsp +++ /dev/null @@ -1,716 +0,0 @@ -[General] -FileVersion=1.1 -FileType=QSetupIniFile -ComposerVersion=4.0.0.4 - -[Project] -ProjectName=vrpn -ProjectDirectory=F:\taylorr\STM\src\vrpn\installers\vrpn -NonSFXDirectory=F:\taylorr\STM\src\vrpn\installers\vrpn\NonSFX -MediaFileName=VRPN v06_04 -CopyMediaToFName= -ProgramDescriptiveName=Virtual Reality Peripheral Network -ProgramVersion=06.04 -CompanyName=www.vrpn.org -ProgVerLiveUpdate=0 -RegisterAsApp=1 -LanguageFlag=1 -LanguageNames=| -UseNonSFXDir=0 -ClrNonSFXDir=0 -CompressNonSFXFiles=0 -ForceCopyNonSFXFiles=0 - -[Display] -AddSetupBackground=1 -TopLabel=1 -TopLabelVer=1 -TopLabel2=0 -BottomLabel=0 -TopLabelText="Virtual Reality Peripheral Network" -TopLabel2Text="" -BottomLabelText="Copyright © 2003" -TopBackgroundColor=16711680 -BottomBackgroundColor=0 -AddBottomColor=1 -DlgBmp3DFrame=1 -DialogStyle=Modern -AddDialogBitmap=0 -DialogBitmapFileName= -AddBackgroundBitmap=0 -BackgroundBitmapFileName= -BackgroundBitmapLocation=|Top/Left|0|0| -AddBackgroundWave=0 -BgBmpTransparent=0 -BackgroundWaveFileName= -BackgroundWaveLocation=|Center|300|0| -BackgroundWaveLoop=1 -BackgroundWaveDelay=0 -AddBackgroundWaveSlider=1 -BackgroundWaveSliderType=Fixed -TopLabelSide=Left -TopLabel2Side=Left -BottomLabelSide=Left -DialogLocation=|Center|0|0| -TopLabelFont=|Tahoma|36|16777215|1|2| -TopLabel2Font=|Tahoma|18|16777215|1|2| -BottomLabelFont=|Tahoma|10|16777215|1|0| -CompanyUrl=www.vrpn.org - -[TargetExe] -TargetDirectory=<AbsoluteDir>C:\NSRG\bin\VRPN v06.04 -CommonDirectory=<AbsoluteDir>C:\NSRG\src -AuxDirectory=<AbsoluteDir>C:\NSRG\src -TargetExeName=<Application Folder>\vrpn_server.exe -RunTimeDir_1=|||||||1||||1||1|<ProgramFilesDir>||||| -RunTimeDir_2=|||||||1||||1||1|<ProgramFilesDir>||||| -RunTimeDir_3=|||||||1||||1||1|<ProgramFilesDir>||||| - -[Dialogs] -SelectedDialogs=Welcome,License,Readme,User Information,*Setup Type,*Custom,*Destination,Associate,*Shortcuts,*Confirm Setup,*Copy Files,*Complete -LicenseTextFile= -ReadmeTextFile= -ReadmeTextFile2= -UseNotepad=0 -SpaceReqOnDriveCheckBox=0 -SpaceReqOnDrive= -RequestUserName=1 -RequestCompanyName=1 -RequestSerialNumberAlso=0 -RequestSerialCheckDLL=0 -SerialCheckDll= -RequestPredefinedSerial=0 -CaseSensitiveSerial=0 -RequestTokenizedSerial=0 -CDSetup=0 -ShowCompactSetupAlso=1 -ForcePartialSetup=0 -ShowProgBar2=0 -SilentSetup=0 -ProposeReadme=0 -ProposeLaunch=0 -ProposeRestart=0 -ProposeReadmeChecked=0 -ProposeLaunchChecked=0 -ShowCloseRecommendation=1 -ShowAdwareDisclaimer=0 -ShowCopyrightWarning=1 - -[Shortcuts] -AddMainShortCut=1 -ForceRemoveShortcutFolder=0 -ProgramLinkFolder=NSRG\VRPN 06.04 -ProgramLinkName=Vrpn_server -ProgramLinkParam= -ProgramLinkWorkDir=<Application Folder> -ProgramLinkRun=Normal Window -ProgramLinkIconFile= -ProgramLinkIconNum=0 -StartMenuLinkName=Virtual Reality Peripheral Network -DesktopLinkName=Virtual Reality Peripheral Network -SendToLinkName=Virtual Reality Peripheral Network -StartUpLinkName=Virtual Reality Peripheral Network -QuickLaunchLinkName=Virtual Reality Peripheral Network -StartMenuCheckBox=0 -DesktopCheckBox=0 -SendToCheckBox=0 -StartUpCheckBox=0 -QuickLaunchCheckBox=0 -StartMenuChecked=1 -DesktopChecked=1 -SendToChecked=1 -StartUpChecked=1 -QuickLaunchChecked=1 -SetAllUsers=1 -AddUninstallShortcut=1 -Item-000=*|Documentation|http://www.vrpn.org|NSRG\VRPN 06.04|||Normal Window||0| -Item-001=*|Test VRPN|<Application Folder>\test_vrpn.exe|NSRG\VRPN 06.04||<Application Folder>|Normal Window||0| -Item-002=*|Test Clock|<Application Folder>\time_test.exe|NSRG\VRPN 06.04||<Application Folder>|Normal Window||0| -Item-003=*|Test client and server|<Application Folder>\client_and_server.exe|NSRG\VRPN 06.04||<Application Folder>|Normal Window||0| -Item-004=*|Server configuration file|<Application Folder>\vrpn.cfg|NSRG\VRPN 06.04||<Application Folder>|Normal Window||0| -Item-005=*|Source code (if installed)|<Common Folder>\vrpn|NSRG\VRPN 06.04||<Common Folder>\vrpn|Normal Window||0| - -[Billboard] -AddBillboard=1 -Item-000=|1|0|0|1|0|Center|0|0|8388608|16711680|Verdana|14|16777215|1|0|360|360|0|1| - -[SplitSetup] -SplitSetup=0 -ForceDownload=1 -DownloadURL_SPLIT=http:// -ConfirmSplitDownload=0 - -[AutoUpdate] -AutoUpdate=0 -RunAutoUpdate=1 -AddAutoUpdateShortcut=1 -ReqConfirmDownload=0 -ReqConfirmInstall=0 -ShutDownMethod=Don't Shut Down -BackgroundUpdate=0 -RestartProcess=0 -InformFinish=0 -UpdateProjectFName= -DownloadURL_UPDATE=http:// -NameOfUpdateFile= -RunningProcess= -VersionOriginal=1 -ValidVersions= -VersionNew=1 -ReAskDays=0 -AutoUpdateProbeSpin=1 -AutoUpdateProbeText=Only at Agent Start - -[Switches] -OperatingSystems=All,95,98,ME,NT,2000,XP -OverwriteFlag=1 -CreateUnInstall=1 -ScrambleUnInstallData=1 -HideErrMsgUnInstall=0 -HideLogBtnUnInstall=0 -UnInstallExeStampSwitch=0 -UnInstallExeStamp= -CreateLogFile=0 -ConfirmExtract=0 -TestAdminRights=1 -TestAdminRightsUnInstall=1 -TestDotNetFramework=0 -TestExeBeforeInstall=1 -TestExeBeforeUnInstall=1 - -[Registry] - -[IniFile] - -[Environment] - -[Association] -OpenWith=0 -OpenWithName= -OpenWithMenuText=Open with -OpenWithExtensions= - -[VerInfo] -CopyFromExe=0 -DefineManually=0 -Item-001=|Comments|| -Item-002=|CompanyName|| -Item-003=|FileDescription|| -Item-004=|FileVersion|| -Item-005=|InternalName|| -Item-006=|LegalCopyright|| -Item-007=|LegalTrademarks|| -Item-008=|OriginalFilename|| -Item-009=|ProductName|| -Item-010=|ProductVersion|| -CopyIconFromTargetExe=0 -CopyIconFromOtherApp=0 -OtherIconAppFileName= -Spin1=0 -Spin2=0 - -[Execute] -ExecuteDllCheckBox=0 -ExecutionDllFileName= - -[GroupNames] -Group-000=Main Group -Group-001=Source Code - -[Group-000] -TypicalCompactData=15 -Description=This is the main group of files -Item-000=Fol*<Application Folder>[0] -Item-001=Fil*F:\taylorr\STM\src\vrpn\pc_win32\server_src\client_and_server\Release\client_and_server.exe -Item-002=Fil*F:\taylorr\STM\src\vrpn\pc_win32\server_src\test_vrpn\Release\test_vrpn.exe -Item-003=Fil*F:\taylorr\STM\src\vrpn\pc_win32\server_src\vrpn_server\Release\vrpn_server.exe -Item-004=Fil*F:\taylorr\STM\src\vrpn\pc_win32\time_test\Release\time_test.exe -Item-005=Fil*F:\taylorr\STM\src\vrpn\server_src\vrpn.cfg - -[Group-001] -TypicalCompactData=5 -Description= -Item-000=Fol*<Common Folder>[0] -Item-001=Dir*<Common Folder>\quat -Item-002=Fil*F:\taylorr\STM\src\quat\xyzquat.c -Item-003=Fil*F:\taylorr\STM\src\quat\vector.c -Item-004=Fil*F:\taylorr\STM\src\quat\Readme -Item-005=Fil*F:\taylorr\STM\src\quat\quatlib.dsw -Item-006=Fil*F:\taylorr\STM\src\quat\quatlib.dsp -Item-007=Fil*F:\taylorr\STM\src\quat\quat.h -Item-008=Fil*F:\taylorr\STM\src\quat\quat.c -Item-009=Fil*F:\taylorr\STM\src\quat\matrix.c -Item-010=Fil*F:\taylorr\STM\src\quat\makefile -Item-011=Fil*F:\taylorr\STM\src\quat\.cvsignore -Item-012=Dir*<Common Folder>\quat\CVS -Item-013=Fil*F:\taylorr\STM\src\quat\CVS\Root -Item-014=Fil*F:\taylorr\STM\src\quat\CVS\Repository -Item-015=Fil*F:\taylorr\STM\src\quat\CVS\Entries -Item-016=Dir*<Common Folder>\quat\testapps -Item-017=Fil*F:\taylorr\STM\src\quat\testapps\timer.c -Item-018=Fil*F:\taylorr\STM\src\quat\testapps\qxform.c -Item-019=Fil*F:\taylorr\STM\src\quat\testapps\qmult.c -Item-020=Fil*F:\taylorr\STM\src\quat\testapps\qmake.c -Item-021=Fil*F:\taylorr\STM\src\quat\testapps\eul.c -Item-022=Dir*<Common Folder>\quat\testapps\CVS -Item-023=Fil*F:\taylorr\STM\src\quat\testapps\CVS\Root -Item-024=Fil*F:\taylorr\STM\src\quat\testapps\CVS\Repository -Item-025=Fil*F:\taylorr\STM\src\quat\testapps\CVS\Entries -Item-026=Dir*<Common Folder>\vrpn -Item-027=Fil*F:\taylorr\STM\src\vrpn\.cvsignore -Item-028=Fil*F:\taylorr\STM\src\vrpn\ChangeLog -Item-029=Fil*F:\taylorr\STM\src\vrpn\Format -Item-030=Fil*F:\taylorr\STM\src\vrpn\Makefile -Item-031=Fil*F:\taylorr\STM\src\vrpn\README -Item-032=Fil*F:\taylorr\STM\src\vrpn\README.Compiling -Item-033=Fil*F:\taylorr\STM\src\vrpn\README.Legal -Item-034=Fil*F:\taylorr\STM\src\vrpn\time_test.cpp -Item-035=Fil*F:\taylorr\STM\src\vrpn\time_test.dsp -Item-036=Fil*F:\taylorr\STM\src\vrpn\time_test.plg -Item-037=Fil*F:\taylorr\STM\src\vrpn\vrpn.dsp -Item-038=Fil*F:\taylorr\STM\src\vrpn\vrpn.dsw -Item-039=Fil*F:\taylorr\STM\src\vrpn\vrpn_3Space.C -Item-040=Fil*F:\taylorr\STM\src\vrpn\vrpn_3Space.h -Item-041=Fil*F:\taylorr\STM\src\vrpn\vrpn_ADBox.C -Item-042=Fil*F:\taylorr\STM\src\vrpn\vrpn_ADBox.h -Item-043=Fil*F:\taylorr\STM\src\vrpn\vrpn_Analog.C -Item-044=Fil*F:\taylorr\STM\src\vrpn\vrpn_Analog.h -Item-045=Fil*F:\taylorr\STM\src\vrpn\vrpn_Analog_5dt.C -Item-046=Fil*F:\taylorr\STM\src\vrpn\vrpn_Analog_5dt.h -Item-047=Fil*F:\taylorr\STM\src\vrpn\vrpn_Analog_Output.C -Item-048=Fil*F:\taylorr\STM\src\vrpn\vrpn_Analog_Output.h -Item-049=Fil*F:\taylorr\STM\src\vrpn\vrpn_Analog_Radamec_SPI.C -Item-050=Fil*F:\taylorr\STM\src\vrpn\vrpn_Analog_Radamec_SPI.h -Item-051=Fil*F:\taylorr\STM\src\vrpn\vrpn_BaseClass.C -Item-052=Fil*F:\taylorr\STM\src\vrpn\vrpn_BaseClass.h -Item-053=Fil*F:\taylorr\STM\src\vrpn\vrpn_Button.C -Item-054=Fil*F:\taylorr\STM\src\vrpn\vrpn_Button.h -Item-055=Fil*F:\taylorr\STM\src\vrpn\vrpn_CerealBox.C -Item-056=Fil*F:\taylorr\STM\src\vrpn\vrpn_CerealBox.h -Item-057=Fil*F:\taylorr\STM\src\vrpn\vrpn_Clock.C -Item-058=Fil*F:\taylorr\STM\src\vrpn\vrpn_Clock.h -Item-059=Fil*F:\taylorr\STM\src\vrpn\vrpn_Configure.h -Item-060=Fil*F:\taylorr\STM\src\vrpn\vrpn_Connection.C -Item-061=Fil*F:\taylorr\STM\src\vrpn\vrpn_Connection.h -Item-062=Fil*F:\taylorr\STM\src\vrpn\vrpn_ConnectionTypes.h -Item-063=Fil*F:\taylorr\STM\src\vrpn\vrpn_Dial.C -Item-064=Fil*F:\taylorr\STM\src\vrpn\vrpn_Dial.h -Item-065=Fil*F:\taylorr\STM\src\vrpn\vrpn_DirectXFFJoystick.C -Item-066=Fil*F:\taylorr\STM\src\vrpn\vrpn_DirectXFFJoystick.h -Item-067=Fil*F:\taylorr\STM\src\vrpn\vrpn_Dyna.C -Item-068=Fil*F:\taylorr\STM\src\vrpn\vrpn_Dyna.h -Item-069=Fil*F:\taylorr\STM\src\vrpn\vrpn_FileConnection.C -Item-070=Fil*F:\taylorr\STM\src\vrpn\vrpn_FileConnection.h -Item-071=Fil*F:\taylorr\STM\src\vrpn\vrpn_FileController.C -Item-072=Fil*F:\taylorr\STM\src\vrpn\vrpn_FileController.h -Item-073=Fil*F:\taylorr\STM\src\vrpn\vrpn_Flock.C -Item-074=Fil*F:\taylorr\STM\src\vrpn\vrpn_Flock.h -Item-075=Fil*F:\taylorr\STM\src\vrpn\vrpn_Flock_Parallel.C -Item-076=Fil*F:\taylorr\STM\src\vrpn\vrpn_Flock_Parallel.h -Item-077=Fil*F:\taylorr\STM\src\vrpn\vrpn_ForceDevice.C -Item-078=Fil*F:\taylorr\STM\src\vrpn\vrpn_ForceDevice.h -Item-079=Fil*F:\taylorr\STM\src\vrpn\vrpn_Forwarder.C -Item-080=Fil*F:\taylorr\STM\src\vrpn\vrpn_Forwarder.h -Item-081=Fil*F:\taylorr\STM\src\vrpn\vrpn_ForwarderController.C -Item-082=Fil*F:\taylorr\STM\src\vrpn\vrpn_ForwarderController.h -Item-083=Fil*F:\taylorr\STM\src\vrpn\vrpn_GlobalHapticsOrb.C -Item-084=Fil*F:\taylorr\STM\src\vrpn\vrpn_GlobalHapticsOrb.h -Item-085=Fil*F:\taylorr\STM\src\vrpn\vrpn_ImmersionBox.C -Item-086=Fil*F:\taylorr\STM\src\vrpn\vrpn_ImmersionBox.h -Item-087=Fil*F:\taylorr\STM\src\vrpn\vrpn_JoyFly.C -Item-088=Fil*F:\taylorr\STM\src\vrpn\vrpn_JoyFly.h -Item-089=Fil*F:\taylorr\STM\src\vrpn\vrpn_Joylin.C -Item-090=Fil*F:\taylorr\STM\src\vrpn\vrpn_Joylin.h -Item-091=Fil*F:\taylorr\STM\src\vrpn\vrpn_Joywin32.C -Item-092=Fil*F:\taylorr\STM\src\vrpn\vrpn_Joywin32.h -Item-093=Fil*F:\taylorr\STM\src\vrpn\vrpn_LamportClock.C -Item-094=Fil*F:\taylorr\STM\src\vrpn\vrpn_LamportClock.h -Item-095=Fil*F:\taylorr\STM\src\vrpn\vrpn_Log.h -Item-096=Fil*F:\taylorr\STM\src\vrpn\vrpn_Magellan.C -Item-097=Fil*F:\taylorr\STM\src\vrpn\vrpn_Magellan.h -Item-098=Fil*F:\taylorr\STM\src\vrpn\vrpn_Mutex.C -Item-099=Fil*F:\taylorr\STM\src\vrpn\vrpn_Mutex.h -Item-100=Fil*F:\taylorr\STM\src\vrpn\vrpn_Nidaq.C -Item-101=Fil*F:\taylorr\STM\src\vrpn\vrpn_Nidaq.h -Item-102=Fil*F:\taylorr\STM\src\vrpn\vrpn_nikon_controls.C -Item-103=Fil*F:\taylorr\STM\src\vrpn\vrpn_nikon_controls.h -Item-104=Fil*F:\taylorr\STM\src\vrpn\vrpn_Poser.C -Item-105=Fil*F:\taylorr\STM\src\vrpn\vrpn_Poser.h -Item-106=Fil*F:\taylorr\STM\src\vrpn\vrpn_Poser_Analog.C -Item-107=Fil*F:\taylorr\STM\src\vrpn\vrpn_Poser_Analog.h -Item-108=Fil*F:\taylorr\STM\src\vrpn\vrpn_raw_sgibox.C -Item-109=Fil*F:\taylorr\STM\src\vrpn\vrpn_raw_sgibox.h -Item-110=Fil*F:\taylorr\STM\src\vrpn\vrpn_RedundantTransmission.C -Item-111=Fil*F:\taylorr\STM\src\vrpn\vrpn_RedundantTransmission.h -Item-112=Fil*F:\taylorr\STM\src\vrpn\vrpn_Router.C -Item-113=Fil*F:\taylorr\STM\src\vrpn\vrpn_Router.h -Item-114=Fil*F:\taylorr\STM\src\vrpn\vrpn_Serial.C -Item-115=Fil*F:\taylorr\STM\src\vrpn\vrpn_Serial.h -Item-116=Fil*F:\taylorr\STM\src\vrpn\vrpn_sgibox.C -Item-117=Fil*F:\taylorr\STM\src\vrpn\vrpn_sgibox.h -Item-118=Fil*F:\taylorr\STM\src\vrpn\vrpn_Shared.C -Item-119=Fil*F:\taylorr\STM\src\vrpn\vrpn_Shared.h -Item-120=Fil*F:\taylorr\STM\src\vrpn\vrpn_SharedObject.C -Item-121=Fil*F:\taylorr\STM\src\vrpn\vrpn_SharedObject.h -Item-122=Fil*F:\taylorr\STM\src\vrpn\vrpn_Sound.C -Item-123=Fil*F:\taylorr\STM\src\vrpn\vrpn_Sound.h -Item-124=Fil*F:\taylorr\STM\src\vrpn\vrpn_Spaceball.C -Item-125=Fil*F:\taylorr\STM\src\vrpn\vrpn_Spaceball.h -Item-126=Fil*F:\taylorr\STM\src\vrpn\vrpn_TempImager.C -Item-127=Fil*F:\taylorr\STM\src\vrpn\vrpn_TempImager.h -Item-128=Fil*F:\taylorr\STM\src\vrpn\vrpn_Text.C -Item-129=Fil*F:\taylorr\STM\src\vrpn\vrpn_Text.h -Item-130=Fil*F:\taylorr\STM\src\vrpn\vrpn_Tng3.C -Item-131=Fil*F:\taylorr\STM\src\vrpn\vrpn_Tng3.h -Item-132=Fil*F:\taylorr\STM\src\vrpn\vrpn_Tracker.C -Item-133=Fil*F:\taylorr\STM\src\vrpn\vrpn_Tracker.h -Item-134=Fil*F:\taylorr\STM\src\vrpn\vrpn_Tracker_AnalogFly.C -Item-135=Fil*F:\taylorr\STM\src\vrpn\vrpn_Tracker_AnalogFly.h -Item-136=Fil*F:\taylorr\STM\src\vrpn\vrpn_Tracker_ButtonFly.C -Item-137=Fil*F:\taylorr\STM\src\vrpn\vrpn_Tracker_ButtonFly.h -Item-138=Fil*F:\taylorr\STM\src\vrpn\vrpn_Tracker_Fastrak.C -Item-139=Fil*F:\taylorr\STM\src\vrpn\vrpn_Tracker_Fastrak.h -Item-140=Fil*F:\taylorr\STM\src\vrpn\vrpn_Tracker_isense.C -Item-141=Fil*F:\taylorr\STM\src\vrpn\vrpn_Tracker_isense.h -Item-142=Fil*F:\taylorr\STM\src\vrpn\vrpn_TypeDispatcher.C -Item-143=Fil*F:\taylorr\STM\src\vrpn\vrpn_TypeDispatcher.h -Item-144=Fil*F:\taylorr\STM\src\vrpn\vrpn_Types.h -Item-145=Fil*F:\taylorr\STM\src\vrpn\vrpn_UNC_Joystick.C -Item-146=Fil*F:\taylorr\STM\src\vrpn\vrpn_UNC_Joystick.h -Item-147=Fil*F:\taylorr\STM\src\vrpn\vrpn_Wanda.C -Item-148=Fil*F:\taylorr\STM\src\vrpn\vrpn_Wanda.h -Item-149=Fil*F:\taylorr\STM\src\vrpn\vrpn_Zaber.C -Item-150=Fil*F:\taylorr\STM\src\vrpn\vrpn_Zaber.h -Item-151=Dir*<Common Folder>\vrpn\client_src -Item-152=Fil*F:\taylorr\STM\src\vrpn\client_src\.cvsignore -Item-153=Fil*F:\taylorr\STM\src\vrpn\client_src\add_vrpn_cookie.C -Item-154=Fil*F:\taylorr\STM\src\vrpn\client_src\bdbox_client.C -Item-155=Fil*F:\taylorr\STM\src\vrpn\client_src\ChangeLog -Item-156=Fil*F:\taylorr\STM\src\vrpn\client_src\checklogfile.C -Item-157=Fil*F:\taylorr\STM\src\vrpn\client_src\clock_client.C -Item-158=Fil*F:\taylorr\STM\src\vrpn\client_src\ff_client.C -Item-159=Fil*F:\taylorr\STM\src\vrpn\client_src\forwarderClient.C -Item-160=Fil*F:\taylorr\STM\src\vrpn\client_src\logfilesenders.C -Item-161=Fil*F:\taylorr\STM\src\vrpn\client_src\logfiletypes.C -Item-162=Fil*F:\taylorr\STM\src\vrpn\client_src\Makefile -Item-163=Fil*F:\taylorr\STM\src\vrpn\client_src\midi_client.C -Item-164=Fil*F:\taylorr\STM\src\vrpn\client_src\ohm_client.C -Item-165=Fil*F:\taylorr\STM\src\vrpn\client_src\phan_client.C -Item-166=Fil*F:\taylorr\STM\src\vrpn\client_src\printcereal.C -Item-167=Fil*F:\taylorr\STM\src\vrpn\client_src\printcereal.dsp -Item-168=Fil*F:\taylorr\STM\src\vrpn\client_src\printvals.C -Item-169=Fil*F:\taylorr\STM\src\vrpn\client_src\printvals.dsp -Item-170=Fil*F:\taylorr\STM\src\vrpn\client_src\README -Item-171=Fil*F:\taylorr\STM\src\vrpn\client_src\setrouter.C -Item-172=Fil*F:\taylorr\STM\src\vrpn\client_src\setrouter.dsp -Item-173=Fil*F:\taylorr\STM\src\vrpn\client_src\sound_client.C -Item-174=Fil*F:\taylorr\STM\src\vrpn\client_src\sound_client.old -Item-175=Fil*F:\taylorr\STM\src\vrpn\client_src\sphere_client.C -Item-176=Fil*F:\taylorr\STM\src\vrpn\client_src\sphere_client.dsp -Item-177=Fil*F:\taylorr\STM\src\vrpn\client_src\testimager_client.C -Item-178=Fil*F:\taylorr\STM\src\vrpn\client_src\testimager_client.dsp -Item-179=Fil*F:\taylorr\STM\src\vrpn\client_src\testSharedObject.C -Item-180=Fil*F:\taylorr\STM\src\vrpn\client_src\test_mutex.C -Item-181=Fil*F:\taylorr\STM\src\vrpn\client_src\test_tempimager.C -Item-182=Fil*F:\taylorr\STM\src\vrpn\client_src\test_tempimager.dsp -Item-183=Fil*F:\taylorr\STM\src\vrpn\client_src\test_Zaber.C -Item-184=Fil*F:\taylorr\STM\src\vrpn\client_src\test_zaber.dsp -Item-185=Fil*F:\taylorr\STM\src\vrpn\client_src\text.C -Item-186=Fil*F:\taylorr\STM\src\vrpn\client_src\vrpnTrackerClient.cpp -Item-187=Fil*F:\taylorr\STM\src\vrpn\client_src\vrpn_LamportClock.t.C -Item-188=Fil*F:\taylorr\STM\src\vrpn\client_src\vrpn_ping.C -Item-189=Fil*F:\taylorr\STM\src\vrpn\client_src\vrpn_print_devices.C -Item-190=Fil*F:\taylorr\STM\src\vrpn\client_src\vrpn_print_devices.dsp -Item-191=Fil*F:\taylorr\STM\src\vrpn\client_src\vrpn_print_messages.C -Item-192=Fil*F:\taylorr\STM\src\vrpn\client_src\vrpn_Router_Client_GUI.C -Item-193=Fil*F:\taylorr\STM\src\vrpn\client_src\vrpn_Router_Client_GUI.dsp -Item-194=Dir*<Common Folder>\vrpn\client_src\CVS -Item-195=Fil*F:\taylorr\STM\src\vrpn\client_src\CVS\Entries -Item-196=Fil*F:\taylorr\STM\src\vrpn\client_src\CVS\Repository -Item-197=Fil*F:\taylorr\STM\src\vrpn\client_src\CVS\Root -Item-198=Dir*<Common Folder>\vrpn\client_src\directx_sound_client -Item-199=Fil*F:\taylorr\STM\src\vrpn\client_src\directx_sound_client\directx_sound_client.cpp -Item-200=Fil*F:\taylorr\STM\src\vrpn\client_src\directx_sound_client\directx_sound_client.dsp -Item-201=Fil*F:\taylorr\STM\src\vrpn\client_src\directx_sound_client\directx_sound_client.dsw -Item-202=Dir*<Common Folder>\vrpn\client_src\directx_sound_client\CVS -Item-203=Fil*F:\taylorr\STM\src\vrpn\client_src\directx_sound_client\CVS\Entries -Item-204=Fil*F:\taylorr\STM\src\vrpn\client_src\directx_sound_client\CVS\Repository -Item-205=Fil*F:\taylorr\STM\src\vrpn\client_src\directx_sound_client\CVS\Root -Item-206=Dir*<Common Folder>\vrpn\client_src\haptic -Item-207=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\drag-sphere.C -Item-208=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\glvrpn.C -Item-209=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\glwin.c -Item-210=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\glwin.h -Item-211=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\Makefile -Item-212=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\phantom-field.C -Item-213=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\phantom-plane.C -Item-214=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\phantom-wave.C -Item-215=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\README -Item-216=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\smdvrpn.C -Item-217=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\testvrpn.C -Item-218=Dir*<Common Folder>\vrpn\client_src\haptic\CVS -Item-219=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\CVS\Entries -Item-220=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\CVS\Repository -Item-221=Fil*F:\taylorr\STM\src\vrpn\client_src\haptic\CVS\Root -Item-222=Dir*<Common Folder>\vrpn\CVS -Item-223=Fil*F:\taylorr\STM\src\vrpn\CVS\Entries -Item-224=Fil*F:\taylorr\STM\src\vrpn\CVS\Repository -Item-225=Fil*F:\taylorr\STM\src\vrpn\CVS\Root -Item-226=Dir*<Common Folder>\vrpn\doxygen -Item-227=Fil*F:\taylorr\STM\src\vrpn\doxygen\.cvsignore -Item-228=Fil*F:\taylorr\STM\src\vrpn\doxygen\Doxyfile -Item-229=Dir*<Common Folder>\vrpn\doxygen\CVS -Item-230=Fil*F:\taylorr\STM\src\vrpn\doxygen\CVS\Entries -Item-231=Fil*F:\taylorr\STM\src\vrpn\doxygen\CVS\Repository -Item-232=Fil*F:\taylorr\STM\src\vrpn\doxygen\CVS\Root -Item-233=Dir*<Common Folder>\vrpn\java_vrpn -Item-234=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\.cvsignore -Item-235=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\AnalogOutputRemote.java -Item-236=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\AnalogRemote.java -Item-237=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\AnalogRemoteListener.java -Item-238=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\ButtonRemote.java -Item-239=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\ButtonRemoteListener.java -Item-240=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\ChangeLog -Item-241=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\ForceDeviceRemote.java -Item-242=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\ForceDeviceRemoteListener.java -Item-243=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\java_vrpn.cpp -Item-244=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\java_vrpn.dsp -Item-245=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\java_vrpn.dsw -Item-246=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\java_vrpn.h -Item-247=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\java_vrpn.sln -Item-248=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\java_vrpn.vjp -Item-249=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\README.txt -Item-250=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\TempImagerRemote.java -Item-251=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\TrackerRemote.java -Item-252=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\TrackerRemoteListener.java -Item-253=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\VRPN.java -Item-254=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\vrpn_AnalogOutputRemote.cpp -Item-255=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\vrpn_AnalogRemote.cpp -Item-256=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\vrpn_ButtonRemote.cpp -Item-257=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\vrpn_ForceDeviceRemote.cpp -Item-258=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\vrpn_TempImagerRemote.cpp -Item-259=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\vrpn_TrackerRemote.cpp -Item-260=Dir*<Common Folder>\vrpn\java_vrpn\CVS -Item-261=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\CVS\Entries -Item-262=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\CVS\Repository -Item-263=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\CVS\Root -Item-264=Dir*<Common Folder>\vrpn\java_vrpn\test -Item-265=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\.cvsignore -Item-266=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\AnalogListenerTest.java -Item-267=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\AnalogRandomValueGenerator.java -Item-268=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\AnalogTest.java -Item-269=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\ButtonListenerTest.java -Item-270=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\ButtonTest.java -Item-271=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\ChangeLog -Item-272=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\ForceDeviceTest.java -Item-273=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\TempImagerTest.java -Item-274=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\test.sln -Item-275=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\test.vjp -Item-276=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\TrackerTest.java -Item-277=Dir*<Common Folder>\vrpn\java_vrpn\test\CVS -Item-278=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\CVS\Entries -Item-279=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\CVS\Repository -Item-280=Fil*F:\taylorr\STM\src\vrpn\java_vrpn\test\CVS\Root -Item-281=Dir*<Common Folder>\vrpn\server_src -Item-282=Fil*F:\taylorr\STM\src\vrpn\server_src\.cvsignore -Item-283=Fil*F:\taylorr\STM\src\vrpn\server_src\buzzForceField.C -Item-284=Fil*F:\taylorr\STM\src\vrpn\server_src\buzzForceField.h -Item-285=Fil*F:\taylorr\STM\src\vrpn\server_src\ChangeLog -Item-286=Fil*F:\taylorr\STM\src\vrpn\server_src\client_and_server.C -Item-287=Fil*F:\taylorr\STM\src\vrpn\server_src\client_and_server.dsp -Item-288=Fil*F:\taylorr\STM\src\vrpn\server_src\client_and_server.plg -Item-289=Fil*F:\taylorr\STM\src\vrpn\server_src\clock_server.C -Item-290=Fil*F:\taylorr\STM\src\vrpn\server_src\constraint.C -Item-291=Fil*F:\taylorr\STM\src\vrpn\server_src\constraint.h -Item-292=Fil*F:\taylorr\STM\src\vrpn\server_src\daq_server.C -Item-293=Fil*F:\taylorr\STM\src\vrpn\server_src\daq_server.dsp -Item-294=Fil*F:\taylorr\STM\src\vrpn\server_src\def.pl -Item-295=Fil*F:\taylorr\STM\src\vrpn\server_src\directXFF.C -Item-296=Fil*F:\taylorr\STM\src\vrpn\server_src\directXFF_server.dsp -Item-297=Fil*F:\taylorr\STM\src\vrpn\server_src\forcefield.C -Item-298=Fil*F:\taylorr\STM\src\vrpn\server_src\forcefield.h -Item-299=Fil*F:\taylorr\STM\src\vrpn\server_src\forward.C -Item-300=Fil*F:\taylorr\STM\src\vrpn\server_src\ghost.h -Item-301=Fil*F:\taylorr\STM\src\vrpn\server_src\last_of_sequence.C -Item-302=Fil*F:\taylorr\STM\src\vrpn\server_src\Makefile -Item-303=Fil*F:\taylorr\STM\src\vrpn\server_src\nidaqClient.cpp -Item-304=Fil*F:\taylorr\STM\src\vrpn\server_src\nidaqServer.cpp -Item-305=Fil*F:\taylorr\STM\src\vrpn\server_src\NIUtil.cpp -Item-306=Fil*F:\taylorr\STM\src\vrpn\server_src\NIUtil.h -Item-307=Fil*F:\taylorr\STM\src\vrpn\server_src\phantom_custom_effects.txt -Item-308=Fil*F:\taylorr\STM\src\vrpn\server_src\plane.C -Item-309=Fil*F:\taylorr\STM\src\vrpn\server_src\plane.h -Item-310=Fil*F:\taylorr\STM\src\vrpn\server_src\sample_analog.C -Item-311=Fil*F:\taylorr\STM\src\vrpn\server_src\sample_server.C -Item-312=Fil*F:\taylorr\STM\src\vrpn\server_src\set_instruments_for_sound_server -Item-313=Fil*F:\taylorr\STM\src\vrpn\server_src\sgibdbox.cfg -Item-314=Fil*F:\taylorr\STM\src\vrpn\server_src\testSharedObject.C -Item-315=Fil*F:\taylorr\STM\src\vrpn\server_src\test_analogfly.C -Item-316=Fil*F:\taylorr\STM\src\vrpn\server_src\test_analogfly.dsp -Item-317=Fil*F:\taylorr\STM\src\vrpn\server_src\test_mutex.C -Item-318=Fil*F:\taylorr\STM\src\vrpn\server_src\test_peerMutex.C -Item-319=Fil*F:\taylorr\STM\src\vrpn\server_src\test_radamec_spi.C -Item-320=Fil*F:\taylorr\STM\src\vrpn\server_src\test_radamec_spi.dsp -Item-321=Fil*F:\taylorr\STM\src\vrpn\server_src\test_vrpn.C -Item-322=Fil*F:\taylorr\STM\src\vrpn\server_src\test_vrpn.dsp -Item-323=Fil*F:\taylorr\STM\src\vrpn\server_src\test_vrpn.plg -Item-324=Fil*F:\taylorr\STM\src\vrpn\server_src\text.C -Item-325=Fil*F:\taylorr\STM\src\vrpn\server_src\texture_plane.C -Item-326=Fil*F:\taylorr\STM\src\vrpn\server_src\texture_plane.h -Item-327=Fil*F:\taylorr\STM\src\vrpn\server_src\trimesh.C -Item-328=Fil*F:\taylorr\STM\src\vrpn\server_src\trimesh.h -Item-329=Fil*F:\taylorr\STM\src\vrpn\server_src\vrpn.C -Item-330=Fil*F:\taylorr\STM\src\vrpn\server_src\vrpn.cfg -Item-331=Fil*F:\taylorr\STM\src\vrpn\server_src\vrpn.cfg.SAMPLE -Item-332=Fil*F:\taylorr\STM\src\vrpn\server_src\vrpn.rc -Item-333=Fil*F:\taylorr\STM\src\vrpn\server_src\vrpn_Phantom.C -Item-334=Fil*F:\taylorr\STM\src\vrpn\server_src\vrpn_phantom.dsp -Item-335=Fil*F:\taylorr\STM\src\vrpn\server_src\vrpn_Phantom.h -Item-336=Fil*F:\taylorr\STM\src\vrpn\server_src\vrpn_server.dsp -Item-337=Fil*F:\taylorr\STM\src\vrpn\server_src\vrpn_server.plg -Item-338=Fil*F:\taylorr\STM\src\vrpn\server_src\vrpn_Tracker.cfg.UNC -Item-339=Dir*<Common Folder>\vrpn\server_src\aureal_sound_server -Item-340=Fil*F:\taylorr\STM\src\vrpn\server_src\aureal_sound_server\aureal_sound_server.dsp -Item-341=Fil*F:\taylorr\STM\src\vrpn\server_src\aureal_sound_server\aureal_sound_server.dsw -Item-342=Fil*F:\taylorr\STM\src\vrpn\server_src\aureal_sound_server\vrpn_Sound_A3D.cpp -Item-343=Fil*F:\taylorr\STM\src\vrpn\server_src\aureal_sound_server\vrpn_Sound_A3D.h -Item-344=Dir*<Common Folder>\vrpn\server_src\aureal_sound_server\CVS -Item-345=Fil*F:\taylorr\STM\src\vrpn\server_src\aureal_sound_server\CVS\Entries -Item-346=Fil*F:\taylorr\STM\src\vrpn\server_src\aureal_sound_server\CVS\Repository -Item-347=Fil*F:\taylorr\STM\src\vrpn\server_src\aureal_sound_server\CVS\Root -Item-348=Dir*<Common Folder>\vrpn\server_src\ausim_sound_server -Item-349=Fil*F:\taylorr\STM\src\vrpn\server_src\ausim_sound_server\ausim_sound_server.dsp -Item-350=Fil*F:\taylorr\STM\src\vrpn\server_src\ausim_sound_server\ausim_sound_server.dsw -Item-351=Fil*F:\taylorr\STM\src\vrpn\server_src\ausim_sound_server\README.txt -Item-352=Fil*F:\taylorr\STM\src\vrpn\server_src\ausim_sound_server\vrpn.cfg -Item-353=Fil*F:\taylorr\STM\src\vrpn\server_src\ausim_sound_server\vrpn_Sound_ASM.cpp -Item-354=Fil*F:\taylorr\STM\src\vrpn\server_src\ausim_sound_server\vrpn_Sound_ASM.h -Item-355=Dir*<Common Folder>\vrpn\server_src\ausim_sound_server\CVS -Item-356=Fil*F:\taylorr\STM\src\vrpn\server_src\ausim_sound_server\CVS\Entries -Item-357=Fil*F:\taylorr\STM\src\vrpn\server_src\ausim_sound_server\CVS\Repository -Item-358=Fil*F:\taylorr\STM\src\vrpn\server_src\ausim_sound_server\CVS\Root -Item-359=Dir*<Common Folder>\vrpn\server_src\CVS -Item-360=Fil*F:\taylorr\STM\src\vrpn\server_src\CVS\Entries -Item-361=Fil*F:\taylorr\STM\src\vrpn\server_src\CVS\Repository -Item-362=Fil*F:\taylorr\STM\src\vrpn\server_src\CVS\Root -Item-363=Dir*<Common Folder>\vrpn\server_src\directx_sound_server -Item-364=Fil*F:\taylorr\STM\src\vrpn\server_src\directx_sound_server\directx_sound_server.dsp -Item-365=Fil*F:\taylorr\STM\src\vrpn\server_src\directx_sound_server\directx_sound_server.dsw -Item-366=Fil*F:\taylorr\STM\src\vrpn\server_src\directx_sound_server\vrpn_Sound_DX9.cpp -Item-367=Fil*F:\taylorr\STM\src\vrpn\server_src\directx_sound_server\vrpn_Sound_DX9.h -Item-368=Dir*<Common Folder>\vrpn\server_src\directx_sound_server\CVS -Item-369=Fil*F:\taylorr\STM\src\vrpn\server_src\directx_sound_server\CVS\Entries -Item-370=Fil*F:\taylorr\STM\src\vrpn\server_src\directx_sound_server\CVS\Repository -Item-371=Fil*F:\taylorr\STM\src\vrpn\server_src\directx_sound_server\CVS\Root -Item-372=Dir*<Common Folder>\vrpn\server_src\ghostEffects -Item-373=Fil*F:\taylorr\STM\src\vrpn\server_src\ghostEffects\InstantBuzzEffect.cpp -Item-374=Fil*F:\taylorr\STM\src\vrpn\server_src\ghostEffects\InstantBuzzEffect.h -Item-375=Dir*<Common Folder>\vrpn\server_src\ghostEffects\CVS -Item-376=Fil*F:\taylorr\STM\src\vrpn\server_src\ghostEffects\CVS\Entries -Item-377=Fil*F:\taylorr\STM\src\vrpn\server_src\ghostEffects\CVS\Repository -Item-378=Fil*F:\taylorr\STM\src\vrpn\server_src\ghostEffects\CVS\Root -Item-379=Dir*<Common Folder>\vrpn\server_src\miles_sound_server -Item-380=Dir*<Common Folder>\vrpn\server_src\miles_sound_server\CVS -Item-381=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\CVS\Entries -Item-382=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\CVS\Repository -Item-383=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\CVS\Root -Item-384=Dir*<Common Folder>\vrpn\server_src\miles_sound_server\v5.0 -Item-385=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\Console.cpp -Item-386=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\Console.hpp -Item-387=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\readme.txt -Item-388=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\resource.h -Item-389=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\soundserver.ico -Item-390=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\SoundServerWin32.aps -Item-391=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\SoundServerWin32.rc -Item-392=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\sound_server.cpp -Item-393=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\sound_server.dsp -Item-394=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\sound_server.dsw -Item-395=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\vrpn_Sound_Miles.cpp -Item-396=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\vrpn_Sound_Miles.h -Item-397=Dir*<Common Folder>\vrpn\server_src\miles_sound_server\v5.0\CVS -Item-398=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\CVS\Entries -Item-399=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\CVS\Repository -Item-400=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v5.0\CVS\Root -Item-401=Dir*<Common Folder>\vrpn\server_src\miles_sound_server\v6.0 -Item-402=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\Console.cpp -Item-403=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\Console.hpp -Item-404=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\readme.txt -Item-405=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\resource.h -Item-406=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\soundserver.ico -Item-407=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\SoundServerWin32.aps -Item-408=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\SoundServerWin32.rc -Item-409=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\sound_server.cpp -Item-410=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\sound_server.dsp -Item-411=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\sound_server.dsw -Item-412=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\vrpn_Sound_Miles.cpp -Item-413=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\vrpn_Sound_Miles.h -Item-414=Dir*<Common Folder>\vrpn\server_src\miles_sound_server\v6.0\CVS -Item-415=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\CVS\Entries -Item-416=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\CVS\Repository -Item-417=Fil*F:\taylorr\STM\src\vrpn\server_src\miles_sound_server\v6.0\CVS\Root -Item-418=Dir*<Common Folder>\vrpn\server_src\sierra_router_server -Item-419=Fil*F:\taylorr\STM\src\vrpn\server_src\sierra_router_server\ChangeLog -Item-420=Fil*F:\taylorr\STM\src\vrpn\server_src\sierra_router_server\router.cfg -Item-421=Fil*F:\taylorr\STM\src\vrpn\server_src\sierra_router_server\sierra_router_server.dsp -Item-422=Fil*F:\taylorr\STM\src\vrpn\server_src\sierra_router_server\vrpn_Router_Sierra_ConfigFileParse.C -Item-423=Fil*F:\taylorr\STM\src\vrpn\server_src\sierra_router_server\vrpn_Router_Sierra_Serial.C -Item-424=Fil*F:\taylorr\STM\src\vrpn\server_src\sierra_router_server\vrpn_Router_Sierra_SerialParse.C -Item-425=Fil*F:\taylorr\STM\src\vrpn\server_src\sierra_router_server\vrpn_Router_Sierra_Server.C -Item-426=Fil*F:\taylorr\STM\src\vrpn\server_src\sierra_router_server\vrpn_Router_Sierra_Server.h -Item-427=Fil*F:\taylorr\STM\src\vrpn\server_src\sierra_router_server\vrpn_Router_Sierra_ServerMain.C -Item-428=Dir*<Common Folder>\vrpn\server_src\sierra_router_server\CVS -Item-429=Fil*F:\taylorr\STM\src\vrpn\server_src\sierra_router_server\CVS\Entries -Item-430=Fil*F:\taylorr\STM\src\vrpn\server_src\sierra_router_server\CVS\Repository -Item-431=Fil*F:\taylorr\STM\src\vrpn\server_src\sierra_router_server\CVS\Root -Item-432=Dir*<Common Folder>\vrpn\server_src\timecode_generator_server -Item-433=Fil*F:\taylorr\STM\src\vrpn\server_src\timecode_generator_server\ChangeLog -Item-434=Fil*F:\taylorr\STM\src\vrpn\server_src\timecode_generator_server\Readme -Item-435=Fil*F:\taylorr\STM\src\vrpn\server_src\timecode_generator_server\timecode_generator.dsp -Item-436=Fil*F:\taylorr\STM\src\vrpn\server_src\timecode_generator_server\vrpn_timecode_generator.cpp -Item-437=Fil*F:\taylorr\STM\src\vrpn\server_src\timecode_generator_server\vrpn_timecode_generator.h -Item-438=Dir*<Common Folder>\vrpn\server_src\timecode_generator_server\CVS -Item-439=Fil*F:\taylorr\STM\src\vrpn\server_src\timecode_generator_server\CVS\Entries -Item-440=Fil*F:\taylorr\STM\src\vrpn\server_src\timecode_generator_server\CVS\Repository -Item-441=Fil*F:\taylorr\STM\src\vrpn\server_src\timecode_generator_server\CVS\Root -Item-442=Dir*<Common Folder>\vrpn\util -Item-443=Dir*<Common Folder>\vrpn\util\CVS -Item-444=Fil*F:\taylorr\STM\src\vrpn\util\CVS\Entries -Item-445=Fil*F:\taylorr\STM\src\vrpn\util\CVS\Repository -Item-446=Fil*F:\taylorr\STM\src\vrpn\util\CVS\Root -Item-447=Dir*<Common Folder>\vrpn\util\gen_rpc -Item-448=Fil*F:\taylorr\STM\src\vrpn\util\gen_rpc\.cvsignore -Item-449=Fil*F:\taylorr\STM\src\vrpn\util\gen_rpc\ChangeLog -Item-450=Fil*F:\taylorr\STM\src\vrpn\util\gen_rpc\gen_vrpn_rpc.pl -Item-451=Fil*F:\taylorr\STM\src\vrpn\util\gen_rpc\main_test.C -Item-452=Fil*F:\taylorr\STM\src\vrpn\util\gen_rpc\rpc_Test.vrpndef -Item-453=Fil*F:\taylorr\STM\src\vrpn\util\gen_rpc\rpc_Test_Remote.Cdef -Item-454=Fil*F:\taylorr\STM\src\vrpn\util\gen_rpc\rpc_Test_Remote.hdef -Item-455=Fil*F:\taylorr\STM\src\vrpn\util\gen_rpc\test_gen_rpc.dsp -Item-456=Dir*<Common Folder>\vrpn\util\gen_rpc\CVS -Item-457=Fil*F:\taylorr\STM\src\vrpn\util\gen_rpc\CVS\Entries -Item-458=Fil*F:\taylorr\STM\src\vrpn\util\gen_rpc\CVS\Repository -Item-459=Fil*F:\taylorr\STM\src\vrpn\util\gen_rpc\CVS\Root -Item-460=Dir*<Common Folder>\vrpn\vrpn_embedded -Item-461=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\vrpn_embedded.vcw -Item-462=Dir*<Common Folder>\vrpn\vrpn_embedded\CVS -Item-463=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\CVS\Entries -Item-464=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\CVS\Repository -Item-465=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\CVS\Root -Item-466=Dir*<Common Folder>\vrpn\vrpn_embedded\quat -Item-467=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\quat\quat.vcp -Item-468=Dir*<Common Folder>\vrpn\vrpn_embedded\quat\CVS -Item-469=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\quat\CVS\Entries -Item-470=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\quat\CVS\Repository -Item-471=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\quat\CVS\Root -Item-472=Dir*<Common Folder>\vrpn\vrpn_embedded\vrpn_client_library -Item-473=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\vrpn_client_library\vrpn_client_library.vcp -Item-474=Dir*<Common Folder>\vrpn\vrpn_embedded\vrpn_client_library\CVS -Item-475=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\vrpn_client_library\CVS\Entries -Item-476=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\vrpn_client_library\CVS\Repository -Item-477=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\vrpn_client_library\CVS\Root -Item-478=Dir*<Common Folder>\vrpn\vrpn_embedded\vrpn_print_devices -Item-479=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\vrpn_print_devices\vrpn_print_devices.vcp -Item-480=Dir*<Common Folder>\vrpn\vrpn_embedded\vrpn_print_devices\CVS -Item-481=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\vrpn_print_devices\CVS\Entries -Item-482=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\vrpn_print_devices\CVS\Repository -Item-483=Fil*F:\taylorr\STM\src\vrpn\vrpn_embedded\vrpn_print_devices\CVS\Root diff --git a/src/vrpn/java_vrpn/.classpath b/src/vrpn/java_vrpn/.classpath deleted file mode 100644 index 8a9b20fe9b60f92d1dcc66e631f7ecb05b2f7f13..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/.classpath +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry excluding="test/" kind="src" path=""/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/src/vrpn/java_vrpn/.cvsignore b/src/vrpn/java_vrpn/.cvsignore deleted file mode 100644 index 6d8a638702ded1d27c6c6fd268e02d273cccd769..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/.cvsignore +++ /dev/null @@ -1,21 +0,0 @@ -*.suo -vrpn_ButtonRemote.h -vrpn_TrackerRemote.h -vrpn_AnalogRemote.h -vrpn_AnalogOutputRemote.h -vrpn_AuxiliaryLoggerRemote.h -vrpn_ForceDeviceRemote.h -vrpn_FunctionGeneratorRemote.h -vrpn_TempImagerRemote.h -vrpn_PoserRemote.h -vrpn_TextReceiver.h -vrpn_TextSender.h -vrpn_VRPNDevice.h -codebase.dat -vrpn.jar -javadoc -bin -java_vrpn.ncb -java_vrpn.plg -java_vrpn.opt -*.vcproj.*.user \ No newline at end of file diff --git a/src/vrpn/java_vrpn/.project b/src/vrpn/java_vrpn/.project deleted file mode 100644 index 0ac3185078026bd8e3babfacf1a13a65842ff069..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>java_vrpn</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/src/vrpn/java_vrpn/.settings/org.eclipse.jdt.core.prefs b/src/vrpn/java_vrpn/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 34aaeff7fa9e478f53c71803899ef349884538f4..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,14 +0,0 @@ -#Thu Jun 14 18:24:43 EDT 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*,.* -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error diff --git a/src/vrpn/java_vrpn/CMakeLists.txt b/src/vrpn/java_vrpn/CMakeLists.txt deleted file mode 100644 index 56c753c7cbc2c3d68d0654c612cd7297bfe38d04..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/CMakeLists.txt +++ /dev/null @@ -1,132 +0,0 @@ -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC - -# XXX TODO Install these bindings, don't just build them! - -if(JAVA_FOUND AND JNI_FOUND AND JAVAH_EXECUTABLE AND VRPN_BUILD_JAVA) - - # Set up file lists - set(JAVA_CLASSES - AnalogOutputRemote - AnalogRemote - AnalogRemoteListener - AuxiliaryLoggerRemote - ButtonRemote - ButtonRemoteListener - ForceDeviceRemote - ForceDeviceRemoteListener - FunctionGeneratorRemote - PoserRemote - TextReceiver - TextSender - TrackerRemote - TrackerRemoteListener - VRPN - VRPNDevice) - set(JAVAC_OUTPUT) - set(JAVAC_INPUT) - set(JAVA_JNI_HEADERS) - foreach(class ${JAVA_CLASSES}) - list(APPEND - JAVAC_OUTPUT - "${CMAKE_CURRENT_BINARY_DIR}/vrpn/${class}.class") - list(APPEND - JAVAC_INPUT - "${CMAKE_CURRENT_SOURCE_DIR}/vrpn/${class}.java") - list(APPEND - JAVA_JNI_HEADERS - "${CMAKE_CURRENT_BINARY_DIR}/vrpn_${class}.h") - endforeach() - - # *.java -> *.class - add_custom_command(OUTPUT - ${JAVAC_OUTPUT} - DEPENDS - ${JAVAC_INPUT} - COMMAND - "${Java_JAVAC_EXECUTABLE}" - -d - "${CMAKE_CURRENT_BINARY_DIR}" - ${JAVAC_INPUT} - COMMENT - "Compiling Java sources to class files...") - - # *.class -> vrpn.jar - add_custom_command(OUTPUT - "${CMAKE_CURRENT_BINARY_DIR}/vrpn.jar" - DEPENDS - ${JAVAC_OUTPUT} - COMMAND - ${CMAKE_COMMAND} - ARGS - -E - chdir - "${CMAKE_CURRENT_BINARY_DIR}" - ${Java_JAR_EXECUTABLE} - -cvf - "${CMAKE_CURRENT_BINARY_DIR}/vrpn.jar" - "${CMAKE_CURRENT_BINARY_DIR}/vrpn" - COMMENT - "Generating JAR file...") - - # *.class -> vrpn_*.h - foreach(in ${JAVA_CLASSES}) - add_custom_command(OUTPUT - "${CMAKE_CURRENT_BINARY_DIR}/vrpn_${in}.h" - DEPENDS - "${CMAKE_CURRENT_BINARY_DIR}/vrpn/${in}.class" - COMMAND - "${JAVAH_EXECUTABLE}" - -d - "${CMAKE_CURRENT_BINARY_DIR}" - -jni - -classpath - "${CMAKE_CURRENT_BINARY_DIR}" - vrpn.${in} - COMMENT - "Generating JNI header file for vrpn.${in}") - endforeach() - - # target for vrpn.jar - add_custom_target(java_vrpn_jar - DEPENDS - "${CMAKE_CURRENT_BINARY_DIR}/vrpn.jar") - - # java_vrpn library - set(LIB_SOURCES - java_vrpn.cpp - vrpn_AnalogOutputRemote.cpp - vrpn_AnalogRemote.cpp - vrpn_AuxiliaryLoggerRemote.cpp - vrpn_ButtonRemote.cpp - vrpn_ForceDeviceRemote.cpp - vrpn_PoserRemote.cpp - vrpn_TextReceiver.cpp - vrpn_TextSender.cpp - vrpn_TrackerRemote.cpp - vrpn_VRPNDevice.cpp - vrpn_FunctionGeneratorRemote.cpp) - - include_directories("${CMAKE_CURRENT_BINARY_DIR}" ${JNI_INCLUDE_DIRS}) - add_library(java_vrpn SHARED ${LIB_SOURCES} ${JAVA_JNI_HEADERS}) - if(BUILD_WITH_ANDROID_NDK) - # Currently link with the client-side libraries only for the Android build. - target_link_libraries(java_vrpn vrpn) - else() - target_link_libraries(java_vrpn vrpnserver ${JAVA_JVM_LIBRARY}) - add_dependencies(java_vrpn java_vrpn_jar) - endif() - - if(VRPN_INSTALL) - install(TARGETS java_vrpn - ARCHIVE DESTINATION lib COMPONENT java - LIBRARY DESTINATION lib COMPONENT java - RUNTIME DESTINATION lib COMPONENT java) - - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vrpn.jar" - DESTINATION share/java - COMPONENT java - RENAME vrpn-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.jar) - endif() -endif() diff --git a/src/vrpn/java_vrpn/ChangeLog b/src/vrpn/java_vrpn/ChangeLog deleted file mode 100644 index d1eac3f84f981d9b7ed05fa5128e3f20e6ad617b..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/ChangeLog +++ /dev/null @@ -1,714 +0,0 @@ -2010-01-14 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGeneratorRemote.cpp: corrected several - errors in the way channel messages were handled. also, - tested for invalid values in various functions before - calling any vrpn functions. - * makefile: additions from Sheldon Andrews to build - on 64-bit Linux. - -2010-01-05 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGeneratorRemote.cpp: added a handler - for error reports. - -2009-12-28 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_FunctionGeneratorRemote.cpp: finished the - implementation of the java native methods and the - vrpn handler methods. - -2009-11-24 David Marshburn <marshbur@cs.unc.edu> - - * all: added function generator wrapping. - -2009-05-18 David Marshburn <marshbur@cs.unc.edu> - - * *.cpp: changed the handling of the native_device member - from an java int to a java long. this includes the get and - set methods as well as the cached field descriptor. cursory - testing indicates that this works for at least one 32-bit - environment. - -2008-06-24 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_PoserRemote.cpp: corrected the text of - some error messages. - -2008-06-20 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_PoserRemote.cpp: implementation of java native - poser-relative methods - * vrpn_TextSenderRemote.cpp: uses the new way of - creating vrpn connections - * java_vrpn.dsp: added auxiliary logger files to project. - -2008-03-18 David Marshburn <marshbur@cs.unc.edu> - - * README.txt: updated build instructions. - -2007-11-12 David Marshburn <marshbur@cs.unc.edu> - - * corrected the spelling of Auxilliary to Auxiliary - -2007-10-30 David Marshburn <marshbur@cs.unc.edu> - - * buildNativeHeaders.xml: removed references to TempImager - * make_header.sh: same - * makefile: same - * *TempImager*: renamed temp imager files, appending .obsolete - -2007-10-22 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_AuxiliaryLoggerRemote.cpp: added some NULL-tests for stability - -2007-10-19 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_AuxiliaryLoggerRemote.cpp: new. java-native code for - aux. logger class. - * java_vrpn.h, .cpp: calls logger class OnLoad/OnUnload methods - * java_vrpn.sln, .vcproj: new. visual studio 8/2005 project files. - * .cvsignore: ignore vrpn_AuxiliaryLoggerRemote.h (generated code) - * buildNativeHeaders.xml: adds logger class - * other *.cppfixed line endings (to be unix-style) - -2007-10-16 David Marshburn <marshbur@cs.unc.edu> - * java_vrpn.jvp, .sln: removed. old, visual j++ project files. - - -2007-06-25 David Marshburn <marshbur@cs.unc.edu> - * buildJAR.xml: correctly packages the class in the file - -2007-06-18 David Marshburn <marshbur@cs.unc.edu> - * buildNativeHeader.xml: removed a print statement - * buildJAR.xml: new, and ANT build file for creating - the vrpn.jar file - -2007-06-15 David Marshburn <marshbur@cs.unc.edu> - * buildNativeHeaders.xml: left one class off the list - * java_vrpn.dsp: updated the include paths. output goes - into the bin directory. - * .cvsignore: ignore some auto-generated visual studio files - - -2007-06-14 David Marshburn <marshbur@cs.unc.edu> - * buildNativeHeaders.xml: an ANT build file, used by eclipse - to create the java native header files - - -2007-06-04 David Marshburn <marshbur@cs.unc.edu> - * .classpath, .project: eclipse project files for java_vrpn. - currently only builds the .class files. i still need to make - eclipse build the .jar file automatically, generate the - java-native .h files, generate the javadoc. - * .settings (directory): location of project-specific eclipse - settings - * .cvsignore: ignore the bin directory - - -2007-05-31 David Marshburn <marshbur@cs.unc.edu> - * .cvsignore: don't ignore the vrpn directory - -2007-01-18 David Marshburn <marshbur@cs.unc.edu> - - * make_header.sh: adds recent classes to the list - -2006-05-04 David Marshburn <marshbur@cs.unc.edu> - - * VRPNDevice.java (getTime): exposes the get_time method from - vrpn_[File]Connection. - * vrpn_VRPNDevice.cpp: native implementation of ^. - -2006-04-26 Ben Wilde <wilde@cs.unc.edu> - - * TextReceiver.java - -In 'handleTextMessage' set t.level to the passed level parameter - -2006-04-25 <marshbur@cs.unc.edu> - - * java_vrpn.vjp: also creates vrpn_TextSender.h - -2006-04-24 <marshbur@cs.unc.edu> - - * TextReceiver.java: new - * TextSender.java: new - * vrpn_TextReceiver.cpp: new - * vrpn_TextSender.cpp: new - * java_vrpn.[vjp,dsp]: adds the new text source files - * .cvsignore: ignore the generated text header files - * VRPNDevice.java: adds some constants for text stuff - * java_vrpn.[h,cpp]: adds functions from the text part of the library - -2006-02-10 <marshbur@cs.unc.edu> - - * vrpn_VRPNDevice.cpp (Java_vrpn_VRPNDevice_getEarliestTime_1native): - this should prevent times from being truncated; one calculation was - done at long precision (only 32 bits). - (Java_vrpn_VRPNDevice_getLatestTime_1native): same - * java_vrpn.dsp: path changes for a recent java installation - (v. 1.4.2_10, the last release before 1.5). - -2006-02-01 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_VRPNDevice.cpp (Java_vrpn_VRPNDevice_playToWallTime_1native): - uses the correct signature/name for java's Date::getTime. - -2006-01-31 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_VRPNDevice.cpp: corrected the way some Date functions - are caused (this was causing errors in some time-related functions). - -2006-01-30 <marshbur@cs.unc.edu> - - * VRPNDevice.java (constructor): now correctly starts the thread - for the device. also calls the init() method for the concrete - device classes. - * *Remote.java: removed code from constructors to VRPNDevice - * vrpn_VRPNDevice.cpp: corrected a typo in the way a function - from java's Date class was looked up in several places. - -2006-01-27 David Marshburn <marshbur@cs.unc.edu> - - * VRPNDevice.java: changed the parameter types or return values - of a few functions to more closely match vrpn. also, added - getReplayRate. - * vrpn_VRPNDevice.java: implementation of all the native functions. - * PoserRemote.java: corrected how time is passed for pose requests. - -2006-01-26 David Marshburn <marshbur@cs.unc.edu> - - * java_vrpn.dsp: adds new files to project - * java_vrpn.vjp: adds new files to project - * java_vrpn.h, .cpp: ups the version to 1.0. also, defines/calls - OnLoad/OnUnLoad functions for VRPNDevice. - * vrpn_*Remote.java: these now all use the java field ID for the - 'native_device' field, as cached by VRPNDevice, instead of looking - this up every function call. - * VRPNDevice.java: those function only valid during replay now - throw a NotReplayException if called when not replay. - (getEarliestTime): caches the earliest time, so only needs to call - the native method once. - (getLatestTime): same as getEarliestTime. - (playToElapsedTime): now takes a long integer. - (getElapsedTime): new function (and it's native wrapping). - * vrpn_VRPNDevice.cpp: new. - -2006-01-25 David Marshburn <marshbur@cs.unc.edu> - - There are two things in this commit. First, a (transparent) - reorganization. All the device classes (tracker, analog, etc) had - a lot of common code for managing the threads that run the devices. - All this code was identical, save for perhaps name changes, and has - been moved into a new super class VRPNDevice. Also, the integer - data member in which the java-native code stored the c++ pointer to - the native vrpn object was moved to this class (it was also common - among all the specific-device classes). Also, I moved all the - connection- and log-file-name stuff from VRPN.java to VRPNDevice.java. - Second, replay-control methods were added to the VRPNDevice - class. These call through to the native vrpn_Connection object for - each device. The native implementations of these (which will be - in a forthcoming VRPNDevices.cpp) have not be written yet. - - * *Remote.java: removed threading and native object pointer - * *Remote.cpp: renamed references to the native object poiner. - (more changes probably forthcoming). - * VRPNDevice.java: a superclass for all the specific device classes - * VRPN.java: removed cnxn and log file name stuff. - * ForceDeviceRemote.java: almost all the native functions were - public, which means they could be called without having an appropriate - lock asserted. Made all the functions protected and added public - wrappers that correctly synchronize on a lock to insure that only - one thread is calling native vrpn code at a time. - * .cvsignore: tells cvs to ignore vrpn_VRPNDevice.h since it - is a generated file. - -2005-08-10 Ben Wilde <wilde@cs.unc.edu> - - * vrpn_ForceDeviceRemote.cpp - -Fixed the wrapper for setConstraintMode by casting the - integer to a constraint geometry. - -2005-08-08 Ben Wilde <wilde@cs.unc.edu> - - * vrpn_ForceDeviceRemote.cpp - -Wrote wrappers for all functions dealing with force device - constraints - * ForceDeviceRemote.java - -Made all of the native functions booleans rather than voids - -2005-07-28 David Marshburn <marshbur@cs.unc.edu> - - * java_vrpn.vjp: adds a custom build rule for the poser native .h file - * vrpn_PoserRemote.cpp: includes vrpn_PoserRemote.h now. - -2005-07-25 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_AnalogOutputRemote.cpp (shutdownAnalog): changed the name - to shutdownAnalogOutput, as it should have been. Also, - call vrpn_Connection::removeReference, needed because we - initially got the connection with vrpn_get_connection_by_name. - * vrpn_AnalogRemote.cpp (shutdownAnalog): call - vrpn_Connection::removeReference, needed because we - initially got the connection with vrpn_get_connection_by_name. - * vrpn_ButtonRemote.cpp (shutdownButton): same - * vrpn_ForceDeviceRemote.cpp (shutdownForceDevice): same - * vrpn_PoserRemote.cpp (shutdownPoser): same - * vrpn_TrackerRemote.cpp (shutdownTracker): same - -2005-07-24 <marshbur@cs.unc.edu> - - * PoserRemote.java: new, first implementation of java wrapping - for poser - * vrpn_PoserRemote.cpp: new. native code for java wrapping - * .cvsignore: also ignore vrpn_PoserRemote.h (generated file) - * java_vrpn.vjp: adds poser to the project. removed temp imager - * java_vrpn.dsp: adds poser to the project. - * java_vrpn.h,cpp: adds function for poser. commented out - functions for temp_imager. - * vrpn_AnalogOutputRemote.cpp: corrected an error print statement - -2004-10-20 David Marshburn <marshbur@cs.unc.edu> - - * java_vrpn.dsp: rolled this back to before Oct. 2004. Something - had been corrupted in it (perhaps newline characters). - -2004-10-15 Ben Wilde <wilde@cs.unc.edu> - - * Added the line 'VRPN_CALLBACK' in front of handler functions - so that java_vrpn would compile. - -2004-10-14 David Marshburn <marshbur@cs.unc.edu> - - * java_vrpn.vjp: added back the custom build rule for the post-build - step. these create the .jar file, build the javadoc documentation - and generate the native-code header files. - -2004-07-22 David Marshburn <marshbur@cs.unc.edu> - - * *Remote.java (stopRunning): added most of the functionality of - finalize to this function (this should be used instead of finalize). - -2004-07-13 David Marshburn <marshbur@cs.unc.edu> - - * VRPN.java: added data members to store the connection name and - the names of the local-in, local-out, remote-in and remote-out - logfiles. added accessors for the same. added a constructor - where these are specified. made the default constructor private. - * *Remote.java: all call the new constructor of class VRPN - -2004-07-12 David Marshburn <marshbur@cs.unc.edu> - - * *Remote.java: made the finalize function public instead of - protected. This is the only reliable way to shut down a vrpn - device, force any log files to be written, etc. Also expanded - a comment in each file. - -2004-04-20 David Marshburn <marshbur@cs.unc.edu> - - * *Remote.java: time was being calculated/presented incorrectly - in all cases for message delivery in java. i'd incorrectly - used the tv_usec number of messages as milliseconds instead of - microseconds when putting it into the Date member of the various - *Update structures. - -2003-10-24 Oliver Otto <o.otto@reading.ac.uk> - - * makefile: builds java_vrpn on unix (linux and iris tested) - * make_header.sh: script to build the C++ header files - * README.txt: updated build instructions for Irix/Linux - -2003-05-16 David Marshburn <marshbur@cs.unc.edu> - - * *Remote.java: removed the 'synchronized' keyword from a number - of functions. This was allowing users to deadlock in certain - situations. This per-oject synchronization is not necessary, as - all java_vrpn objects obtain a lock, anyway, before calling any - c++ vrpn code. - -2003-05-09 David Marshburn <marshbur@cs.unc.edu> - - * *Remote.java: each device type now gives its thread a name - * java_vrpn.dsp: build browse info, also - * java_vrpn.vjp: also zip up the java source (for debugging) - -2003-04-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * java_vrpn.cpp : Removed ^Ms. - * vrpn_AnalogOutputRemote.cpp : Same. - * vrpn_AnalogRemote.cpp : Same. - * vrpn_ButtonRemote.cpp : Same. - * vrpn_ForceDeviceRemote.cpp : Same. - * vrpn_TempImagerRemote.cpp : Same. - * vrpn_TrackerRemote.cpp : Same. - -2003-01-15 David Marshburn <marshbur@cs.unc.edu> - - * AnalogOutputRemote.java: - (requestValueChange_native): new, the native functions - (requestValueChange): these are now java functions that acquire - the library-wide lock before calling the native functions. - * vrpn_AnalogOutputRemote.cpp: renames the requestValueChange - functions to match the new declarations, as above. - -2003-01-09 David Marshburn <marshbur@cs.unc.edu> - - * AnalogOutputRemote.java: - (requestValueChange): array version, new - (getNumActiveChannels): new - (getMaxActiveChannels): new - * AnalogRemote.java: - (getNumActiveChannels): new - (getMaxActiveChannels): new - * vrpn_AnalogOutputRemote.cpp: - (Java_vrpn_AnalogOutputRemote_requestValueChange__ID): name change - (Java_vrpn_AnalogOutputRemote_requestValueChange___3D): new. - implementation of java native function AnalogOutputRemote:: - requestValueChange (array version). - (Java_vrpn_AnalogOutputRemote_getNumActiveChannels): new. - implementation of java native function AnalogOutputRemote:: - getNumActiveChannels. - * vrpn_AnalogRemote.cpp: - (Java_vrpn_AnalogRemote_getNumActiveChannels): new. - implementation of java native function AnalogRemote:: - getNumActiveChannels. - -2002-12-16 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_TempImager_Remote.cpp: changed the names of the vrpn - TempImager variables to match current implementation. - -2002-11-25 <marshbur@cs.unc.edu> - - * TempImagerRemote.java: made all data members protected (were default - visibility before). - * vrpn_TempImager_Remote.cpp: changed the names of the functions - handle_region_changed and handle_description_change to prepend - "java_vrpn_" to the names. Changes to match recent naming changes - in vrpn_TempImager_Region. - (java_vrpn_handle_region_change): recognizes if it's been passed - something other than 16-bit image data and fails (temporary, until - we write something to deal with other size pixels). - -2002-10-24 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_ForceDeviceRemote.cpp (handle_force_error): corrected - signature for java handleForceError. - -2002-10-08 David Marshburn <marshbur@cs.unc.edu> - - * VRPN.java: adds a static variable (downInVrpnLock) on which all - the vrpn devices can synchronize their access to the vrpn libray. - Also, loads the native library. - * AnalogOutputRemote.java: synchronizes on downInVrpnLock all calls - to init, mainloop and shutdown native methods. Also removes - library-loading, static-initialization block. - * AnalogRemote.java: same - * ButtonRemote.java: same - * ForceDeviceRemote.java: same - * TempImagerRemote.java: same - * TrackerRemote.java: same - - * vrpn_AnalogOutputRemote.cpp: JNI_Onload and JNI_OnUnload renamed - to be device specific. Removed 'jvm' global variable. Check that - jvm has been defined in JNI_Onload function. - * vrpn_AnalogRemote.cpp: same - * vrpn_ButtonRemote.cpp: same - * vrpn_ForceDeviceRemote.cpp: same - * vrpn_TempImagerRemote.cpp: same - * vrpn_TrackerRemote.cpp: same - - * java_vrpn.h: global 'jvm' variable. Functions definitons for - device-specific JNI_Onload/OnUnload function. - * java_vrpn.cpp: new. contains JNI_Onload and JNI_OnUnload, whick - call the device-specific versions of these functions. - - * java_vrpn.dsp: new. everything in a single project. - * AnalogOutputRemote.dsp, AnalogRemote.dsp, ButtonRemote.dsp, - ForceDeviceRemote.dsp, TempImagerRemote.dsp, TrackerRemote.dsp: - all removed in favor of java_vrpn.dsp. - * java_vrpn.dsw: added/removed projects. - -2002-10-07 David Marshburn <marshbur@cs.unc.edu> - - * VRPN.java: new, pending superclass for java vrpn devices - * java_vrpn.vjp: added VRPN.java - -2002-09-24 Chris Weigle <weigle@cs.unc.edu> - - * TempImagerRemote.java: - (removeDescriptionChangeListner): fixed name - -2002-09-23 Chris Weigle <weigle@cs.unc.edu> - - * TempImagerRemote.java: - (setChannel): unneeded warning message removed - -2002-09-23 Chris Weigle <weigle@cs.unc.edu> - - * vrpn_TempImagerRemote.cpp: Minor changes (commented-out debug messages) - * TempImagerRemote.java: - (getNumRows): new - (addDescriptionChangeListener): fixed name of addDecriptionChangeListener - (setChannel): fixed guard (off by on at upper bound) - added test for null channel reference, create if needed - - Note: This shouldn't have to be here. The array of - TempImagerChannels is allocated, but we wind up with - an array of null pointers instead of instantiated - objects. Have I lost my mind, or shouldn't - "new TempImagerChannel[10]" give me 10 init'd - TICs and not 10 null references to TICs? - -2002-09-19 David Marshburn <marshbur@cs.unc.edu> - - * TempImagerRemote.java: change the function named - handleTempImagerChange to be named handleDescriptionChange - * vrpn_TempImagerRemote.cpp: comment changes. - -2002-09-19 Chris Weigle <weigle@cs.unc.edu> - * TempImagerRemote.java: TempImagerChanel and TempImagerRegion now have - public data members - -2002-09-18 David Marshburn <marshbur@cs.unc.edu> - - * .cvsignore: ignore vrpn_AnalogOutputRemote.h (generated) - * AnalogOutputRemote.dsp: new, project file for AnalogOutput - * AnalogOutputRemote.java: new, first implementation of AnalogOutput. - This includes logging. - * AnalogRemote.java: removed AnalogOutput stuff and the - function requestChannelChange. Also, added logging - functionality (init) and (AnalogRemote). - * java_vrpn.dsw: added AnalogRemoteOutput project - * java_vrpn.vjp: added AnalogRemoteOutput class - * vrpn_AnalogOutputRemote.cpp: new, implementation of native - Java functions. This includes logging. - * vrpn_AnalogRemote.cpp: removed AnalogOutput stuff and function - Java_vrpn_AnalogRemote_requestChannelChange. Also added - logging functionality (Java_vrpn_AnalogRemote_init) - -2002-09-16 David Marshburn <marshbur@cs.unc.edu> - - * ButtonRemote.java (init): takes extra params for log file names - (ButtonRemote): same - * ForceDeviceRemote.java (init): same - (ForceDeviceRemote): same - * TrackerRemote.java (init): same - (TrackerRemote): same - * vrpn_ButtonRemote.cpp (Java_vrpn_ButtonRemote_init): same - * vrpn_ForceDeviceRemote.cpp (Java_vrpn_ForceDeviceRemote_init): same - * vrpn_TrackerRemote.cpp (Java_vrpn_TrackerRemote_init): same - * TrackerRemote.dsp: include java_vrpn.h - - -2002-09-15 David Marshburn <marshbur@cs.unc.edu> - - * AnalogRemote.java: added another data member to hold - a pointer to a vrpn_Analog_Output_Remote (used by the - native code). - * vrpn_AnalogRemote.cpp: changed this to also use - vrpn_Analog_Output_Remote (corresponds to recent changes - in vrpn_Analog_Remote). - -2002-09-11 David Marshburn <marshbur@cs.unc.edu> - - * java_vrpn.dsw, java_vrpn.vjp: added TempImager stuff - * TempImagerRemote.java: new. first pass at an imager. - * vrpn_TempImagerRemote.cpp: same - * TempImagerRemote.dsp: project file for TempImager - * .cvsignore: ignore vrpn_TempImagerRemote.h (generated) - -2002-08-20 David Marshburn <marshbur@cs.unc.edu> - - * *.java: comment changes - -2002-08-19 David Marshburn <marshbur@cs.unc.edu> - - * *.java: fixed up the javadoc comments - * java_vrpn.vjp: builds the javadoc documentation from the - class files along with everything else. - * .cvsignore: ignore the javadoc directory - -2002-08-15 David Marshburn <marshbur@cs.unc.edu> - - * .cvsignore: ignore vrpn.jar - * java_vrpn.vjp: now creates vrpn.jar - -2002-08-13 David Marshburn <marshbur@cs.unc.edu> - - * AnalogRemoteListener.java: cosmetic & comment changes - * ButtonRemoteListener.java: changes exactly corresponding to - those committed for AnalogRemoteListener.java on 2002-08-12 - * ForceDeviceRemoteListener.java: same - * TrackerRemoteListener.java: same - * java_vrpn.vjp: changes from moving the *Listener classes - into the vrpn package. - -2002-08-12 David Marshburn <marshbur@cs.unc.edu> - - * AnalogRemoteListener.java: - - more and better comments. - - Added two new symbols, ALL_UPDATES and LAST_UPDATE to denote - how an instance of this Listener buffers updates. - (constructor): changed the order in which things are initialized - to prevent a race condition. - (setModeLastAnalogUpdate): uses ALL_UPDATES/LAST_UPDATE symbols - (setModeAllAnalogUpdates): uses ALL_UPDATES/LAST_UPDATE symbols. - Also, only clear the buffer of updates if we're coming from - LAST_UPDATE mode. - (getModeAnalogUpdate): now returns an integer, one of ALL_UPDATES - or LAST_UPDATE, instead of a boolean. - (getAnalogUpdate): if there are no updates to report, this now - returns an empty vector rather than null. - - -2002-08-09 David Marshburn <marshbur@cs.unc.edu> - - * AnalogRemoteListener.java: moved this into the vrpn package. - * ButtonRemoteListener.java: same - * ForceDeviceRemoteListener.java: same - * TrackerRemoteListener.java: same - -2002-08-01 David Marshburn <marshbur@cs.unc.edu> - - * AnalogRemote.java (stopRunning): new; let's the vrpn device - be shut down nicely if you need to disconnect from one device - and connect to another while your program is still running. - * ButtonRemote.java: same - * ForceDeviceRemote.java: same - * TrackerRemote.java: same - -2002-07-25 Tatsuhiro Segi <segi@email.unc.edu> - - * AnalogRemoteListener.java: revised and commented - * ButtonRemoteListener.java: same - * ForceDeviceRemoteListener.java: same - * TrackerRemoteListener.java: same - -2002-07-16 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_AnalogRemote.cpp: cleaned out some errant print statements. - * vrpn_ButtonRemote.cpp: same - * vrpn_ForceDeviceRemote.cpp: same - * vrpn_TrackerRemote.cpp: same - -2002-07-11 David Marshburn <marshbur@cs.unc.edu> - - * TrackerRemote.java: starts the thread in the constructor. - -2002-07-11 David Marshburn <marshbur@cs.unc.edu> - - * AnalogRemote.java: removes all references to java.util.Timer - and TimerTask, as these could not be rescheduled. This version - returns to the method of spawning a thread and sleeping. - * ButtonRemote.java: same - * ForceDeviceRemote.java: same - * TrackerRemote.java: same - -2002-07-08 Tatsuhiro Segi <segi@email.unc.edu> - - * AnalogRemoteListener.java: new file that acts as a wrapper - for updates. - * ButtonRemoteListener.java: same - * ForceDeviceRemoteListener.java: same - * TrackerRemoteListener.java: same - -2002-07-08 David Marshburn <marshbur@cs.unc.edu> - - * AnalogRemote.java (SetTimerPeriod): fixed this so that it no - longer causes an exception when rescheduling the thread. - * ButtonRemote.java: same - * ForceDeviceRemote.java: same - * TrackerRemote.java: same - -2002-07-01 David Marshburn <marshbur@cs.unc.edu> - - * ButtonRemote.java: restored the native_button data member, - which I accidentally deleted at last commit :) - -2002-06-28 David Marshburn <marshbur@cs.unc.edu> - - * AnalogRemote.java: two new functions, Get/SetTimerPeriod, to - control how often vrpn looks for messages. Also, instead of - spawning its own thread and sleeping, this uses the Java Timer - and TimerTask class to check for vrpn messages reliably. - * ButtonRemote.java: same - * ForceDeviceRemote.java: same - * TrackerRemote.java: same - * java_vrpn.vjp: added a classpath link to the Sun Java 1.4.0 SDK - * README.txt: updated instructions for building and using this. - * ButtonRemote.dsp: adds java_vrpn.h to source files. - -2002-06-27 David Marshburn <marshbur@cs.unc.edu> - - * AnalogRemote.java: more and more correct error messages when - the native library dll can't be found or has problems... - * ButtonRemote.java: same - * ForceDeviceRemote.java: same - * TrackerRemote.java: same - * vrpn_AnalogRemote.cpp: same - -2002-06-25 David Marshburn <marshbur@cs.unc.edu> - - * ForceDeviceRemote.java: *ForceField methods return boolean. - (stopForceField, sendForceField x2) - * vrpn_ForceDeviceRemote.java: *ForceField method implementations. - -2002-06-24 David Marshburn <marshbur@cs.unc.edu> - - * java_vrpn.vjp: adds ForceDevice - * java_vrpn.dsw: adds ForceDeviceRemote.dsp - * ForceDeviceRemote.dsp: new project for force device - * ForceDeviceRemote.java: new - * vrpn_ForceDeviceRemote.java: new, partial implementation of - native functions. - * .cvsignore: now ignores vrpn_ForceDeviceRemote.h (generated) - -2002-06-19 David Marshburn <marshbur@cs.unc.edu> - - * AnalogRemote.java (requestValueChange): new - * vrpn_AnalogRemote.cpp (Java_vrpn_AnalogRemote_requestValueChange): - new. - -2002-06-18 Tatsuhiro Segi <segi@email.unc.edu> - - * ButtonRemote.java: minor comment changes - * vrpn_ButtonRemote.cpp: comment changes - -2002-06-12 Tatsuhiro Segi <segi@email.unc.edu> - - * java_vrpn.dsw: added ButtonRemote.dsp project - * java_vrpn.vjp: added ButtonRemote.java - * ButtonRemote.dsp: new project file - * ButtonRemote.java: new. the java part of the vrpn button remote - * vrpn_ButtonRemote.cpp: new. c++ part of the same thing - * .cvsignore: added vrpn_ButtonRemote.h - -2002-06-10 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_TrackerRemote.cpp: minor comment changes - * vrpn_AnalogRemote.cpp: implementations for JNI_OnLoad, - JNI_OnUnload, handle_analog_change, - Java_vrpn_AnalogRemote_shutdownAnalog, - Java_vrpn_AnalogRemote_mainloop, and - Java_vrpn_AnalogRemote_init. - * AnalogRemote.java: comment changes - * AnalogRemote.dsp: build/link updates & corrections - -2002-06-07 David Marshburn <marshbur@cs.unc.edu> - - * TrackerRemote.dsw: removed in favor of java_vrpn.dsw - * java_vrpn.dsw: new; workspace for a project for each vrpn device - * AnalogRemote.dsp: new - * AnalogRemote.java: new. the java part of a java vrpn analog remote - * vrpn_AnalogRemote.cpp: new. the c++ part of java vrpn analog remote - * .cvsignore: new - * java_vrpn.h: new. some common constants for the c++ part - * TrackerRemote.java: comment changes. also throws an exception - if the tracker can't be created in native code. - * java_vrpn.vjp: added AnalogRemote - * vrpn_TrackerRemote.cpp: added handlers for velocity and - acceleration. - -2002-06-02 David Marshburn <marshbur@cs.unc.edu> - - * creation of java_vrpn repository - diff --git a/src/vrpn/java_vrpn/README.txt b/src/vrpn/java_vrpn/README.txt deleted file mode 100644 index 65cffbedd4adae9e44ec11bf0c4140c40176bc8e..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/README.txt +++ /dev/null @@ -1,48 +0,0 @@ -For notes on compiling under Android, see the "README_Android.txt" file - -You can ignore this file if you use CMake, as it handles all this for you. - -Notes on this java implementation (mixed Windows and Irix/Linux notes): - -there are three main steps to building the java wrapping of vrpn. -note that this only wraps the high-level remote device classes. -you should have built vrpn before proceeding with these steps. - -1) compile the java files and make the jar (resulting in `vrpn.jar`) -2) generate the native headers (resulting in several files `vrpn_*.h`) -3) compile the java native code (resulting in java_vrpn.dll or - libjava_vrpn.so) - -Two general approaches to the Java parts (1 and 2): one requires a Unix-like -command line but is good for automation, while the other involves either -a command line or Eclipse, plus ant. - -1. Java Parts - - command line: run `sh make_header.sh` to compile the Java files, - make `vrpn.jar`, and generate native headers in one step. - - Java-style: - 1. Compile the Java files. You can either build the Eclipse project - or run `mkdir bin; find vrpn -name "*.java" | xargs javac -d bin` - on the command line. - 2. Make the JAR. This can be done with `ant -f buildJAR.xml` - 3. Generate the native headers. Do this with - `ant -f buildNativeHeaders.xml` - -2. Native Code Parts - if you use visual studio 2005 (vc8), load java_vrpn.sln and build. - if you use visual studio 6, load java_vrpn.dsw and build. - if you use a unix-like command line, use the makefile. - -========================================================== -This library needs to be in your path or executable directory. Copy -java_vrpn.dll / libjava_vrpn.so into the test directory (for instance). -If not, you will get this error message: - no java_vrpn in java.library.path - Error initializing java_vrpn. - -- Unable to find native library. -you can use the -D parmeter in java to tell the path to the native library, -e.g. java -Djava.library.path=$PWD ButtonTest - -the resulting vrpn.jar file needs to be in your CLASSPATH or moved to -be in your CLASSPATH. Alternatively, you can invoke the Java -VM with the classpath of the java_vrpn directory. diff --git a/src/vrpn/java_vrpn/README_Android.txt b/src/vrpn/java_vrpn/README_Android.txt deleted file mode 100644 index f80b7709d66a33d7650c59f54a1cab8722040b64..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/README_Android.txt +++ /dev/null @@ -1,36 +0,0 @@ -# Notes from Andrew Montag on how to compile VRPN for the Android, modified to remove -# his patch file (which is no longer needed because the changes have been pulled -# into the main source tree). If you have the Android NDK in ~/Downloads and you -# have the directories created, you can run this as a shell script. - -export ANDROID_SDK=$HOME/android-sdk-linux/ - -# install NDK -cd ~ -tar xjvf ~/Downloads/android-ndk-r8b-linux-x86.tar.bz2 -export ANDROID_NDK=$HOME/android-ndk-r8b -export NDK=$HOME/android-ndk-r8b - -# get android-cmake -cd ~/vrac -hg clone https://code.google.com/p/android-cmake/ -export ANDROID_CMAKE=$HOME/vrac/android-cmake - -# make ndk tookchain -$NDK/build/tools/make-standalone-toolchain.sh --platform=android-5 --install-dir=$HOME/android-toolchain - -export ANDROID_NDK_TOOLCHAIN_ROOT=$HOME/android-toolchain -export ANDTOOLCHAIN=$ANDROID_CMAKE/toolchain/android.toolchain.cmake - -alias android-cmake='cmake -DCMAKE_TOOLCHAIN_FILE=$ANDTOOLCHAIN ' - -# download -cd ~/vrac/vrpn_ -git clone git://git.cs.unc.edu/vrpn.git -cd vrpn - -# compile -mkdir build -cd build -android-cmake .. -DVRPN_BUILD_JAVA=1 -DVRPN_BUILD_SERVER_LIBRARY=0 -DCMAKE_CXX_FLAGS=-fpermissive -DVRPN_BUILD_CLIENT_LIBRARY=1 - diff --git a/src/vrpn/java_vrpn/buildJAR.xml b/src/vrpn/java_vrpn/buildJAR.xml deleted file mode 100644 index 40a8abcb25d2e41bdeafa8d11a41f6107c4357f2..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/buildJAR.xml +++ /dev/null @@ -1,13 +0,0 @@ - -<!-- xml version="1.0" encoding="UTF-8" ?--> - -<project name="JAR file" default="jar" basedir="."> - <target name="jar"> - <jar destfile="./bin/vrpn.jar" - basedir="bin/" - includes="vrpn/**" - update="true" - /> - </target> -</project> - diff --git a/src/vrpn/java_vrpn/buildNativeHeaders.xml b/src/vrpn/java_vrpn/buildNativeHeaders.xml deleted file mode 100644 index 8daf9b6eed1ea63f508ec8274d9528095d4b5b11..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/buildNativeHeaders.xml +++ /dev/null @@ -1,23 +0,0 @@ - -<!-- xml version="1.0" encoding="UTF-8" ?--> - -<project name="native headers" default="native" basedir="."> - <target name="native"> - <javah destdir="." verbose="yes" classpath="bin"> - <class name="vrpn.AnalogOutputRemote"/> - <class name="vrpn.AnalogRemote"/> - <class name="vrpn.AuxiliaryLoggerRemote"/> - <class name="vrpn.ButtonRemote"/> - <class name="vrpn.ForceDeviceRemote"/> - <class name="vrpn.FunctionGeneratorRemote"/> - <class name="vrpn.PoserRemote"/> - <class name="vrpn.TextReceiver"/> - <class name="vrpn.TextSender"/> - <class name="vrpn.TrackerRemote"/> - <class name="vrpn.VRPNDevice"/> - </javah> - </target> -</project> - - - diff --git a/src/vrpn/java_vrpn/java_vrpn.cpp b/src/vrpn/java_vrpn/java_vrpn.cpp deleted file mode 100644 index df09114dfec2d80dd4843f0f8fe893adb0544c93..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/java_vrpn.cpp +++ /dev/null @@ -1,45 +0,0 @@ - -#include <jni.h> -#include "java_vrpn.h" - - -JavaVM* jvm = NULL; - - -JNIEXPORT jint JNICALL JNI_OnLoad( JavaVM* jvm, void* reserved ) -{ - ::jvm = jvm; - - if( JNI_OnLoad_VRPNDevice( jvm, reserved ) == JNI_ERR ) return JNI_ERR; - if( JNI_OnLoad_AnalogOutput_Remote( jvm, reserved ) == JNI_ERR ) return JNI_ERR; - if( JNI_OnLoad_Analog_Remote( jvm, reserved ) == JNI_ERR ) return JNI_ERR; - if( JNI_OnLoad_AuxiliaryLogger_Remote( jvm, reserved ) == JNI_ERR ) return JNI_ERR; - if( JNI_OnLoad_Button_Remote( jvm, reserved ) == JNI_ERR ) return JNI_ERR; - if( JNI_OnLoad_ForceDevice_Remote( jvm, reserved ) == JNI_ERR ) return JNI_ERR; - if( JNI_OnLoad_FunctionGenerator_Remote( jvm, reserved) == JNI_ERR ) return JNI_ERR; - //if( JNI_OnLoad_TempImagerRemote( jvm, reserved ) == JNI_ERR ) return JNI_ERR; - if( JNI_OnLoad_Tracker_Remote( jvm, reserved ) == JNI_ERR ) return JNI_ERR; - if( JNI_OnLoad_Poser_Remote( jvm, reserved ) == JNI_ERR ) return JNI_ERR; - if( JNI_OnLoad_Text_Receiver( jvm, reserved ) == JNI_ERR ) return JNI_ERR; - if( JNI_OnLoad_Text_Sender( jvm, reserved ) == JNI_ERR ) return JNI_ERR; - - return JAVA_VRPN_JNI_VERSION; -} - - - -JNIEXPORT void JNICALL JNI_OnUnload( JavaVM* jvm, void* reserved ) -{ - JNI_OnUnload_AnalogOutput_Remote( jvm, reserved ); - JNI_OnUnload_Analog_Remote( jvm, reserved ); - JNI_OnUnload_AuxiliaryLogger_Remote( jvm, reserved ); - JNI_OnUnload_Button_Remote( jvm, reserved ); - JNI_OnUnload_ForceDevice_Remote( jvm, reserved ); - JNI_OnUnload_FunctionGenerator_Remote( jvm, reserved ); - //JNI_OnUnload_TempImagerRemote( jvm, reserved ); - JNI_OnUnload_Tracker_Remote( jvm, reserved ); - JNI_OnUnload_Poser_Remote( jvm, reserved ); - JNI_OnUnload_Text_Receiver( jvm, reserved ); - JNI_OnUnload_Text_Sender( jvm, reserved ); - JNI_OnUnload_VRPNDevice( jvm, reserved ); -} \ No newline at end of file diff --git a/src/vrpn/java_vrpn/java_vrpn.dsp b/src/vrpn/java_vrpn/java_vrpn.dsp deleted file mode 100644 index 3766096dcdffe58884eb66b858d28f69e525209c..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/java_vrpn.dsp +++ /dev/null @@ -1,191 +0,0 @@ -# Microsoft Developer Studio Project File - Name="java_vrpn" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=java_vrpn - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "java_vrpn.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "java_vrpn.mak" CFG="java_vrpn - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "java_vrpn - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "java_vrpn - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "java_vrpn - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "bin/Release" -# PROP Intermediate_Dir "bin/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_VRPN_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "C:\Program Files\Java\jdk1.6.0_01\include" /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_VRPN_EXPORTS" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 wsock32.lib vrpn.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /libpath:"..\pc_win32\Release\\" - -!ELSEIF "$(CFG)" == "java_vrpn - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "bin/Debug" -# PROP Intermediate_Dir "bin/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_VRPN_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "C:\Program Files\Java\jdk1.6.0_01\include" /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_VRPN_EXPORTS" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 wsock32.lib vrpn.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\pc_win32\Debug\\" - -!ENDIF - -# Begin Target - -# Name "java_vrpn - Win32 Release" -# Name "java_vrpn - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\java_vrpn.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_AnalogOutputRemote.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_AnalogRemote.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_AuxiliaryLoggerRemote.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ButtonRemote.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForceDeviceRemote.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_PoserRemote.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_TextReceiver.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_TextSender.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_TrackerRemote.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_VRPNDevice.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\java_vrpn.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_AnalogOutputRemote.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_AnalogRemote.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_AuxiliaryLoggerRemote.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ButtonRemote.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForceDeviceRemote.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_PoserRemote.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_TextReceiver.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_TextSender.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_TrackerRemote.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_VRPNDevice.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/java_vrpn/java_vrpn.dsw b/src/vrpn/java_vrpn/java_vrpn.dsw deleted file mode 100644 index 29ad7dfe6f87caf83d25d38fab9f64f5c6dc895a..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/java_vrpn.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "java_vrpn"=.\java_vrpn\java_vrpn.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/vrpn/java_vrpn/java_vrpn.h b/src/vrpn/java_vrpn/java_vrpn.h deleted file mode 100644 index c02fa50cc9ab52e0a348144392bfdc4712d2343f..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/java_vrpn.h +++ /dev/null @@ -1,62 +0,0 @@ - -#include <jni.h> - -// this is the java/jni version that we're expecting -#define JAVA_VRPN_JNI_VERSION JNI_VERSION_1_4 - - -// this is the version of the java_vrpn library -#define JAVA_VRPN_VERSION "1.0" - - - -extern JavaVM* jvm; - -// VRPNDevice Load/Unload -JNIEXPORT jint JNICALL JNI_OnLoad_VRPNDevice( JavaVM* jvm, void* reserved ); -JNIEXPORT void JNICALL JNI_OnUnload_VRPNDevice( JavaVM* jvm, void* reserved ); - -// AnalogOutput_Remote Load/Unload -JNIEXPORT jint JNICALL JNI_OnLoad_AnalogOutput_Remote( JavaVM* jvm, void* reserved ); -JNIEXPORT void JNICALL JNI_OnUnload_AnalogOutput_Remote( JavaVM* jvm, void* reserved ); - -// Analog_Remote Load/Unload -JNIEXPORT jint JNICALL JNI_OnLoad_Analog_Remote( JavaVM* jvm, void* reserved ); -JNIEXPORT void JNICALL JNI_OnUnload_Analog_Remote( JavaVM* jvm, void* reserved ); - -// AuxiliaryLogger_Remote Load/Unload -JNIEXPORT jint JNICALL JNI_OnLoad_AuxiliaryLogger_Remote( JavaVM* jvm, void* reserved ); -JNIEXPORT void JNICALL JNI_OnUnload_AuxiliaryLogger_Remote( JavaVM* jvm, void* reserved ); - -// Button_Remote Load/Unload -JNIEXPORT jint JNICALL JNI_OnLoad_Button_Remote( JavaVM* jvm, void* reserved ); -JNIEXPORT void JNICALL JNI_OnUnload_Button_Remote( JavaVM* jvm, void* reserved ); - -// ForceDevice_Remote Load/Unload -JNIEXPORT jint JNICALL JNI_OnLoad_ForceDevice_Remote( JavaVM* jvm, void* reserved ); -JNIEXPORT void JNICALL JNI_OnUnload_ForceDevice_Remote( JavaVM* jvm, void* reserved ); - -// FunctionGenerator_Remote Load/Unload -JNIEXPORT jint JNICALL JNI_OnLoad_FunctionGenerator_Remote( JavaVM* jvm, void* reserved ); -JNIEXPORT void JNICALL JNI_OnUnload_FunctionGenerator_Remote( JavaVM* jvm, void* reserved ); - -// TempImage_Remote Load/Unload -//JNIEXPORT jint JNICALL JNI_OnLoad_TempImagerRemote( JavaVM* jvm, void* reserved ); -//JNIEXPORT void JNICALL JNI_OnUnload_TempImagerRemote( JavaVM* jvm, void* reserved ); - -// Tracker_Remote Load/Unload -JNIEXPORT jint JNICALL JNI_OnLoad_Tracker_Remote( JavaVM* jvm, void* reserved ); -JNIEXPORT void JNICALL JNI_OnUnload_Tracker_Remote( JavaVM* jvm, void* reserved ); - -// Poser_Remote Load/Unload -JNIEXPORT jint JNICALL JNI_OnLoad_Poser_Remote( JavaVM* jvm, void* reserved ); -JNIEXPORT void JNICALL JNI_OnUnload_Poser_Remote( JavaVM* jvm, void* reserved ); - -// TextReceiver Load/Unload -JNIEXPORT jint JNICALL JNI_OnLoad_Text_Receiver( JavaVM* jvm, void* reserved ); -JNIEXPORT void JNICALL JNI_OnUnload_Text_Receiver( JavaVM* jvm, void* reserved ); - -// TextSender Load/Unload -JNIEXPORT jint JNICALL JNI_OnLoad_Text_Sender( JavaVM* jvm, void* reserved ); -JNIEXPORT void JNICALL JNI_OnUnload_Text_Sender( JavaVM* jvm, void* reserved ); - diff --git a/src/vrpn/java_vrpn/java_vrpn.sln b/src/vrpn/java_vrpn/java_vrpn.sln deleted file mode 100644 index f65eccc0cdf51a3d607546c36f77c1f8f5c52250..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/java_vrpn.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "java_vrpn", "java_vrpn.vcproj", "{D403E252-EBEA-4CC2-9171-21848F8C9CE2}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D403E252-EBEA-4CC2-9171-21848F8C9CE2}.Debug|Win32.ActiveCfg = Debug|Win32 - {D403E252-EBEA-4CC2-9171-21848F8C9CE2}.Debug|Win32.Build.0 = Debug|Win32 - {D403E252-EBEA-4CC2-9171-21848F8C9CE2}.Release|Win32.ActiveCfg = Release|Win32 - {D403E252-EBEA-4CC2-9171-21848F8C9CE2}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/vrpn/java_vrpn/java_vrpn.vcproj b/src/vrpn/java_vrpn/java_vrpn.vcproj deleted file mode 100644 index 61c9a47f941fdc518e9386a1eea11fd4f284af24..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/java_vrpn.vcproj +++ /dev/null @@ -1,510 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="java_vrpn" - ProjectGUID="{D403E252-EBEA-4CC2-9171-21848F8C9CE2}" - RootNamespace="java_vrpn" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\bin/Debug" - IntermediateDirectory=".\bin/Debug" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="_DEBUG" - MkTypLibCompatible="true" - SuppressStartupBanner="true" - TargetEnvironment="1" - TypeLibraryName=".\bin/Debug/java_vrpn.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="C:\Program Files\Java\jdk1.6.0_01\include,.." - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;JAVA_VRPN_EXPORTS" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\bin/Debug/java_vrpn.pch" - AssemblerListingLocation=".\bin/Debug/" - ObjectFile=".\bin/Debug/" - ProgramDataBaseFileName=".\bin/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="wsock32.lib vrpn.lib odbc32.lib odbccp32.lib quat.lib" - OutputFile=".\bin/Debug/java_vrpn.dll" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="..\..\quat\pc_win32\Debug;..\pc_win32\Debug\;..\quat\pc_win32\Debug" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\bin/Debug/java_vrpn.pdb" - ImportLibrary=".\bin/Debug/java_vrpn.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\bin/Debug/java_vrpn.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\bin/Release" - IntermediateDirectory=".\bin/Release" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="NDEBUG" - MkTypLibCompatible="true" - SuppressStartupBanner="true" - TargetEnvironment="1" - TypeLibraryName=".\bin/Release/java_vrpn.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="C:\Program Files\Java\jdk1.6.0_01\include,.." - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;JAVA_VRPN_EXPORTS" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\bin/Release/java_vrpn.pch" - AssemblerListingLocation=".\bin/Release/" - ObjectFile=".\bin/Release/" - ProgramDataBaseFileName=".\bin/Release/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="wsock32.lib vrpn.lib odbc32.lib odbccp32.lib quat.lib" - OutputFile=".\bin/Release/java_vrpn.dll" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="..\..\quat\pc_win32\Release;..\pc_win32\Release\;..\quat\pc_win32\Release" - ProgramDatabaseFile=".\bin/Release/java_vrpn.pdb" - ImportLibrary=".\bin/Release/java_vrpn.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\bin/Release/java_vrpn.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="java_vrpn.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_AnalogOutputRemote.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_AnalogRemote.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_AuxiliaryLoggerRemote.cpp" - > - </File> - <File - RelativePath="vrpn_ButtonRemote.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_ForceDeviceRemote.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_FunctionGeneratorRemote.cpp" - > - </File> - <File - RelativePath="vrpn_PoserRemote.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_TextReceiver.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_TextSender.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_TrackerRemote.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_VRPNDevice.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - <File - RelativePath="java_vrpn.h" - > - </File> - <File - RelativePath="vrpn_AnalogOutputRemote.h" - > - </File> - <File - RelativePath="vrpn_AnalogRemote.h" - > - </File> - <File - RelativePath=".\vrpn_AuxiliaryLoggerRemote.h" - > - </File> - <File - RelativePath="vrpn_ButtonRemote.h" - > - </File> - <File - RelativePath="vrpn_ForceDeviceRemote.h" - > - </File> - <File - RelativePath=".\vrpn_FunctionGeneratorRemote.h" - > - </File> - <File - RelativePath="vrpn_PoserRemote.h" - > - </File> - <File - RelativePath="vrpn_TextReceiver.h" - > - </File> - <File - RelativePath="vrpn_TextSender.h" - > - </File> - <File - RelativePath="vrpn_TrackerRemote.h" - > - </File> - <File - RelativePath="vrpn_VRPNDevice.h" - > - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/java_vrpn/make_header.sh b/src/vrpn/java_vrpn/make_header.sh deleted file mode 100644 index 47b461ff00791b6a20129aabc013b5ec47dd02ba..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/make_header.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/csh -javac vrpn/*.java - -javah -jni -classpath . vrpn.FunctionGeneratorRemote -javah -jni -classpath . vrpn.AnalogOutputRemote -javah -jni -classpath . vrpn.AnalogRemote -javah -jni -classpath . vrpn.AuxiliaryLoggerRemote -javah -jni -classpath . vrpn.ButtonRemote -javah -jni -classpath . vrpn.ForceDeviceRemote -javah -jni -classpath . vrpn.PoserRemote -javah -jni -classpath . vrpn.TextSender -javah -jni -classpath . vrpn.TextReceiver -javah -jni -classpath . vrpn.TrackerRemote -javah -jni -classpath . vrpn.VRPNDevice - -jar -cvf vrpn.jar vrpn/ diff --git a/src/vrpn/java_vrpn/makefile b/src/vrpn/java_vrpn/makefile deleted file mode 100644 index 8c109c24d16196f322e25c9e24bac0aa3ae9afec..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/makefile +++ /dev/null @@ -1,595 +0,0 @@ -############################################################################# -# Makefile for the nanoManipulator client application. Needs to be -# built using 'gmake'. Should run on any architecture that is currently -# supported. It should be possible to build simultaneously on multiple -# architectures. -# -# On the sgi, both g++ and CC versions are built by default. -# -# Author: Russ Taylor, 10/2/1997 -# -# modified: -# * Oliver Otto, 15/10/2003 -# * modified client makefile to create shared library libjava_vrpn.so -# * tested on SGI and linux, make sure that the java path is right -# * use the make_header.sh script to create all header files -# -############################################################################# - -########################## -# common definitions. For non-UNC sites, uncomment one of the lines -# that defines hw_os for the machine you are on in the section just -# below. Then, the code should compile in your environment. -# -#HW_OS := sgi_irix -#HW_OS := pc_linux -#HW_OS := pc_linux64 -#HW_OS := pc_linux_ia64 -# Try this to cross-compile on a Linux PC for an ARM embedded controller. -#HW_OS := pc_linux_arm -#HW_OS := pc_cygwin -#HW_OS := pc_FreeBSD -#HW_OS := sparc_solaris -#HW_OS := sparc_solaris_64 -#HW_OS := powerpc_aix -#HW_OS := powerpc_macosx -#HW_OS := linux_x64 -########################## - -INSTALL_DIR := /usr/local -BIN_DIR := $(INSTALL_DIR)/bin -INCLUDE_DIR := $(INSTALL_DIR)/include -LIB_DIR := $(INSTALL_DIR)/lib -JAVA_LIB_DIR := $(INSTALL_DIR)/share/java/ - -VERSION := 07.22 - -MV = /bin/mv -MVF = $(MV) -f - -RM = /bin/rm -RMF = $(RM) -f - -ifndef HW_OS - # hw_os does not exist on FreeBSD at UNC or on CYGWIN - UNAME := $(shell uname -s) - ifeq ($(UNAME), FreeBSD) - HW_OS := pc_FreeBSD - else - # pc_cygwin doesn't have HW_OS - ifeq ($(UNAME), CYGWIN_NT-4.0) - HW_OS := pc_cygwin - # On cygwin make is gmake (and gmake doesn't exist) - MAKE := make -f $(MAKEFILE) - else - ifeq ($(UNAME), CYGWIN_98-4.10) - HW_OS := pc_cygwin - MAKE := make -f $(MAKEFILE) - else - ifeq ($(UNAME), CYGWIN_NT-5.0) - HW_OS := pc_cygwin - MAKE := make -f $(MAKEFILE) - else - HW_OS := $(shell hw_os) - endif - endif - endif - endif -endif - -# check if its for pxfl -ifdef PBASE_ROOT - HW_OS := hp_flow - ifeq ($(PXFL_COMPILER), aCC) - HW_OS = hp_flow_aCC - endif -endif - -# Which C++ compiler to use. Default is g++, but some don't use this. -# -# IF YOU CHANGE THESE, document either here or in the header comment -# why. Multiple contradictory changes have been made recently. - - -CC := g++ -AR := ar ruv -# need default 'ranlib' to be touch for platforms that don't use it, -# otherwise make fails. -RANLIB := touch - -ifeq ($(FORCE_GPP),1) - CC := g++ -else - - ifeq ($(HW_OS),sparc_solaris) - CC := /opt/SUNWspro/bin/CC - AR := /opt/SUNWspro/bin/CC -xar -o - endif - - ifeq ($(HW_OS),sparc_solaris_64) - CC := /opt/SUNWspro/bin/CC -xarch=v9a - AR := /opt/SUNWspro/bin/CC -xarch=v9a -xar -o - endif - - ifeq ($(HW_OS),powerpc_aix) - CC := /usr/ibmcxx/bin/xlC_r -g -qarch=pwr3 -w - RANLIB := ranlib - endif - - ifeq ($(HW_OS), pc_linux64) - CC := g++ -m64 -fPIC - RANLIB := ranlib - endif - - ifeq ($(HW_OS), pc_linux) - CC := g++ - RANLIB := ranlib - endif - - ifeq ($(HW_OS), linux_x64) - CC := g++ -fPIC - RANLIB := ranlib - endif - - ifeq ($(HW_OS), powerpc_macosx) - CC := cc - RANLIB := ranlib - endif - - ifeq ($(HW_OS), universal_macosx) - CC := g++ -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 - RANLIB := : - AR := libtool -static -o - SYSLIBS := -framework CoreFoundation -framework IOKit -framework System - endif - - ifeq ($(HW_OS), pc_linux_arm) - CC := arm-linux-g++ - RANLIB := arm-linux-ranlib - AR := arm-linux-ar ruv - endif - - ifeq ($(HW_OS), pc_cygwin_arm) - CC := arm-unknown-linux-gnu-g++ - RANLIB := arm-unknown-linux-gnu-ranlib - AR := arm-unknown-linux-gnu-ar ruv - endif - - ifeq ($(HW_OS),sgi_irix) - ifndef SGI_ABI - SGI_ABI := n32 - endif - ifndef SGI_ARCH - SGI_ARCH := mips3 - endif - OBJECT_DIR_SUFFIX := .$(SGI_ABI).$(SGI_ARCH) - CC := CC -$(SGI_ABI) -$(SGI_ARCH) - RANLIB := : - endif - - ifeq ($(HW_OS),hp700_hpux10) - CC := CC +a1 - endif - ifeq ($(HW_OS),pc_cygwin) - CC := g++ - endif - ifeq ($(HW_OS),sparc_sunos) - CC := /usr/local/lib/CenterLine/bin/CC - endif - ifeq ($(HW_OS), hp_flow_aCC) - CC := /opt/aCC/bin/aCC - endif -endif - -#ifeq ($(HW_OS),sparc_solaris) -# AR := /usr/ccs/bin/ar -#endif - -########################## -# directories -# - -#HMD_DIR := /afs/cs.unc.edu/proj/hmd -#HMD_INCLUDE_DIR := $(HMD_DIR)/include - -#BETA_DIR := $(HMD_DIR)/beta -#BETA_INCLUDE_DIR := $(BETA_DIR)/include -#BETA_LIB_DIR := $(BETA_DIR)/lib - -# subdirectory for make -ifeq ($(FORCE_GPP),1) -OBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/g++ -SOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/g++/server -else -UNQUAL_OBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX) -UNQUAL_SOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/server -OBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX) -SOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/server -endif - -# directories that we can do an rm -f on because they only contain -# object files and executables -SAFE_KNOWN_ARCHITECTURES := \ - hp700_hpux/* \ - hp700_hpux10/* \ - mips_ultrix/* \ - pc_linux/* \ - sgi_irix.32/* \ - sgi_irix.n32/* \ - sparc_solaris/* \ - sparc_solaris_64/* \ - sparc_sunos/* \ - pc_cygwin/* \ - powerpc_aix/* \ - pc_linux_arm/* \ - powerpc_macosx/* \ - universal_macosx/* \ - pc_linux64/* \ - pc_linux_ia64/* - -CLIENT_SKA = $(patsubst %,client_src/%,$(SAFE_KNOWN_ARCHITECTURES)) -SERVER_SKA = $(patsubst %,server_src/%,$(SAFE_KNOWN_ARCHITECTURES)) - -########################## -# Include flags -# - -#SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include -SYS_INCLUDE := - -ifeq ($(HW_OS),powerpc_macosx) -# SYS_INCLUDE := -I/usr/include - SYS_INCLUDE :=-DMACOSX -I../isense -endif - -ifeq ($(HW_OS),universal_macosx) -# SYS_INCLUDE := -I/usr/include - SYS_INCLUDE :=-DMACOSX -I../isense -endif - -ifeq ($(HW_OS),pc_linux) - SYS_INCLUDE := -I/opt/Embedix/arm-linux/include \ - -I/usr/lib/jvm/default-java/include/ \ - -I/usr/lib/jvm/default-java/include/linux \ - -I./ \ - -I../ -endif - -ifeq ($(HW_OS),pc_linux64) - SYS_INCLUDE := -I/opt/Embedix/arm-linux/include \ - -I/usr/lib/jvm/default-java/include/ \ - -I/usr/lib/jvm/default-java/include/linux \ - -I./ \ - -I../ -endif - -ifeq ($(HW_OS),pc_linux_arm) - SYS_INCLUDE := -I/opt/Embedix/arm-linux/include -# -I/usr/local/contrib/include \ -# -I/usr/local/contrib/mod/include -I/usr/include/bsd \ -# -I/usr/include/g++ -endif - -ifeq ($(HW_OS),pc_cygwin_arm) - SYS_INCLUDE := -I/opt/Embedix/arm-linux/include -# -I/usr/local/contrib/include \ -# -I/usr/local/contrib/mod/include -I/usr/include/bsd \ -# -I/usr/include/g++ -endif - -ifeq ($(HW_OS),sgi_irix) -# SYS_INCLUDE := -I/usr/local/contrib/mod/include - SYS_INCLUDE := -I/usr/java2/include -I/usr/java2/include/irix -I./ -I../ -endif - -ifeq ($(HW_OS),hp700_hpux10) - SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include \ - -I/usr/include/bsd -endif - -ifeq ($(HW_OS),hp_flow) - SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include \ - -I/usr/include/bsd -DFLOW -endif - -ifeq ($(HW_OS),hp_flow_aCC) - SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include \ - -I/usr/include/bsd -DFLOW -endif - -# On the PC, place quatlib in the directory ../../quat. No actual system -# includes should be needed. -ifeq ($(HW_OS),pc_cygwin) - INCLUDE_FLAGS := -I. -I../../quat -else - - INCLUDE_FLAGS := -I. $(SYS_INCLUDE) -I../../quat -I../../../quat -I../ - -endif -########################## -# Load flags -# - -LOAD_FLAGS := -L./$(HW_OS)$(OBJECT_DIR_SUFFIX) -L/usr/local/lib \ - -L/usr/local/contrib/unmod/lib -L/usr/local/contrib/mod/lib $(DEBUG_FLAGS) $(LDFLAGS) - -ifeq ($(HW_OS),sgi_irix) - LOAD_FLAGS := $(LOAD_FLAGS) -old_ld -endif - -ifeq ($(HW_OS),pc_linux) - LOAD_FLAGS := $(LOAD_FLAGS) -L/usr/X11R6/lib -endif - -ifeq ($(HW_OS),pc_linux_ia64) - LOAD_FLAGS := $(LOAD_FLAGS) -L/usr/X11R6/lib -endif - -ifeq ($(HW_OS),pc_linux64) - LOAD_FLAGS := $(LOAD_FLAGS) -L/usr/X11R6/lib -endif - -ifeq ($(HW_OS),powerpc_macosx) - LOAD_FLAGS := $(LOAD_FLAGS) -endif - -########################## -# Libraries -# - -ifeq ($(HW_OS),pc_linux64) - ARCH_LIBS := -lbsd -ldl -else - ifeq ($(HW_OS),pc_linux) - ARCH_LIBS := -lbsd -ldl - else - ifeq ($(HW_OS),sparc_solaris) - ARCH_LIBS := -lsocket -lnsl - else - ARCH_LIBS := - endif - endif -endif - -LIBS := -lquat -lsdi $(TCL_LIBS) -lXext -lX11 $(ARCH_LIBS) -lm - -# -# Defines for the compilation, CFLAGS -# - -#CFLAGS := $(INCLUDE_FLAGS) -g -override CFLAGS := $(INCLUDE_FLAGS) $(DEBUG_FLAGS) $(CFLAGS) -override CXXFLAGS := $(INCLUDE_FLAGS) $(DEBUG_FLAGS) $(CXXFLAGS) - -############################################################################# -# -# implicit rule for all .cpp files -# -.SUFFIXES: .cpp .C .o .a - -.cpp.o: - $(CC) -c $(CXXFLAGS) $< -.C.o: - $(CC) -c $(CFXXLAGS) $< - -# Build objects from .cpp files -#$(OBJECT_DIR)/%.o: %.cpp $(LIB_INCLUDES) $(MAKEFILE) -$(OBJECT_DIR)/%.o: %.cpp $(LIB_INCLUDES) - @[ -d $(OBJECT_DIR) ] || mkdir -p $(OBJECT_DIR) - $(CC) $(CXXFLAGS) -o $@ -c $< - -# Build objects from .C files -#$(OBJECT_DIR)/%.o: %.C $(LIB_INCLUDES) $(MAKEFILE) -#$(OBJECT_DIR)/%.o: %.C $(LIB_INCLUDES) -# @[ -d $(OBJECT_DIR) ] || mkdir -p $(OBJECT_DIR) -# $(CC) $(CXXFLAGS) -o $@ -c $< $(LIBS) -lvrpn -exceptions - -# Build objects from .C files -#$(SOBJECT_DIR)/%.o: %.C $(LIB_INCLUDES) $(MAKEFILE) -# @[ -d $(SOBJECT_DIR) ] || mkdir -p $(SOBJECT_DIR) -# $(CC) $(CXXFLAGS) -o $@ -c $< - -# -# -############################################################################# - -all: client - -.PHONY: client -client: $(OBJECT_DIR)/libjava_vrpn.a - @echo ----------------------------------------------------------------- - @echo create shared library libjava_vrpn.so - $(CC) -shared -L../$(OBJECT_DIR) -L../quat/$(OBJECT_DIR) -o $(OBJECT_DIR)/libjava_vrpn.so $(OBJECT_DIR)/*.o -lvrpnserver -lquat - - - -$(OBJECT_DIR): - -mkdir -p $(OBJECT_DIR) - -$(SOBJECT_DIR): - -mkdir -p $(SOBJECT_DIR) - -############################################################################# -# -# library code -# -############################################################################# - -# files to be compiled into the client library - -LIB_FILES = java_vrpn.cpp vrpn_AnalogOutputRemote.cpp vrpn_AnalogRemote.cpp \ - vrpn_AuxiliaryLoggerRemote.cpp vrpn_ButtonRemote.cpp \ - vrpn_ForceDeviceRemote.cpp vrpn_PoserRemote.cpp vrpn_TextReceiver.cpp \ - vrpn_TextSender.cpp vrpn_TrackerRemote.cpp vrpn_VRPNDevice.cpp \ - vrpn_FunctionGeneratorRemote.cpp - -LIB_OBJECTS = $(patsubst %,$(OBJECT_DIR)/%,$(LIB_FILES:.cpp=.o)) - -LIB_INCLUDES = java_vrpn.h vrpn_AnalogOutputRemote.h vrpn_AnalogRemote.h \ - vrpn_AuxiliaryLoggerRemote.h vrpn_ButtonRemote.h \ - vrpn_ForceDeviceRemote.h vrpn_PoserRemote.h vrpn_TextReceiver.h \ - vrpn_TextSender.h vrpn_TrackerRemote.h vrpn_VRPNDevice.h \ - vrpn_FunctionGeneratorRemote.h - - -# additional files for the new connection work-in-progress - -# Additional files to be compiled into the server library - -# We aren't going to use architecture-dependent sets of files. -# If vrpn_sgibox isn't supposed to be compiled on any other architecture, -# then put all of it inside "#ifdef sgi"! - - -#$(OBJECT_DIR)/java_vrpn.a: $(MAKEFILE) $(OBJECT_DIR) \ -# lib_depends \ -# $(LIB_OBJECTS) $(LIB_INCLUDES) - -$(LIB_OBJECTS): -$(OBJECT_DIR)/libjava_vrpn.a: $(MAKEFILE) $(LIB_OBJECTS) - $(AR) $(OBJECT_DIR)/libjava_vrpn.a $(LIB_OBJECTS) - -$(RANLIB) $(OBJECT_DIR)/libjava_vrpn.a - -#$(OBJECT_DIR)/libjava_vrpn.so: gcc -shared -L../$(OBJECT_DIR) -o $(OBJECT_DIR)/libjava_vrpn.so $(OBJECT_DIR)/*.o -lvrpn - - - - -############################################################################# -# -# other stuff -# -############################################################################# - -.PHONY: clean -clean: - $(RMF) $(LIB_OBJECTS) $(OBJECT_DIR)/libjava_vrpn.a \ - $(OBJECT_DIR)/.depend $(OBJECT_DIR)/.depend-old -ifneq (xxx$(FORCE_GPP),xxx1) - @echo ----------------------------------------------------------------- - @echo -- Wart: type \"$(MAKE) clean_g++\" to clean up after g++ - @echo -- I don\'t do it automatically in case you don\'t have g++ - @echo ----------------------------------------------------------------- -endif -#ifneq ($(CC), g++) -# $(MAKE) FORCE_GPP=1 clean -#endif - -.PHONY: clean -clean_g++: - $(MAKE) FORCE_GPP=1 clean - - -# clobberall removes the object directory for EVERY architecture. -# One problem - the object directory for pc_win32 also contains files -# that must be saved. -# clobberall also axes left-over CVS cache files. - -.PHONY: clobberall -clobberall: clobberwin32 - $(RMF) -r $(SAFE_KNOWN_ARCHITECTURES) - $(RMF) -r $(CLIENT_SKA) - $(RMF) -r $(SERVER_SKA) - $(RMF) .#* server_src/.#* client_src/.#* - -.PHONY: clobberwin32 -clobberwin32: - $(RMF) -r pc_win32/DEBUG/* - $(RMF) -r pc_win32/vrpn/Debug/* - $(RMF) -r client_src/pc_win32/printvals/Debug/* - $(RMF) -r server_src/pc_win32/vrpn_server/Debug/* - -install: all - -mkdir -p $(LIB_DIR) - ( cp -f $(OBJECT_DIR)/libjava_vrpn.so $(LIB_DIR) ) - -mkdir -p $(JAVA_LIB_DIR) - cp -f bin/vrpn.jar $(JAVA_LIB_DIR)/vrpn-$(VERSION).jar - ln -s $(JAVA_LIB_DIR)/vrpn.jar $(JAVA_LIB_DIR)/vrpn-$(VERSION).jar - #-mkdir -p $(INCLUDE_DIR) - #cp vrpn*.h $(INCLUDE_DIR) - -uninstall: - ( cd $(LIB_DIR) ; rm -f libjava_vrpn.so ) - ( rm -f $(JAVA_LIB_DIR)/vrpn.jar $(JAVA_LIB_DIR)/vrpn-$(VERSION).jar ) - -.PHONY: beta -beta : -# $(MAKE) clean -# $(MAKE) all -# -$(MV) $(OBJECT_DIR)/java_vrpn.a \ -# $(OBJECT_DIR)/libvrpnserver.a $(OBJECT_DIR)/libvrpnserver_g++.a \ -# $(BETA_LIB_DIR)/$(OBJECT_DIR) -# -$(RANLIB) $(BETA_LIB_DIR)/$(OBJECT_DIR)/libvrpn.a -# -$(RANLIB) $(BETA_LIB_DIR)/$(OBJECT_DIR)/libvrpnserver.a -# -( cd $(BETA_INCLUDE_DIR); $(RMF) $(SLIB_INCLUDES) ) -# cp $(SLIB_INCLUDES) $(BETA_INCLUDE_DIR) - -############################################################################# -# -# Dependencies -# -# If it doesn't already exist, this makefile automatically creates -# a dependency file called .depend. Then it includes it so that -# the build will know the dependency information. -# -# to recreate a dependencies file, type "make depend" -# do this any time you add a file to the project, -# or add/remove #include lines from a source file -# -# if you are on an SGI and want g++ to make the dependency file, -# then type: gmake CC=g++ depend -# -# if you don't want a dependency file, then remove .depend if it exists, -# and type "touch .depend". if it exists (and is empty), make will not -# automatically create it or automatically update it (unless you type -# make depend) -# - -############### -### this way works better -### you type "make depend" anytime you add a file or -### add/remove #includes from a file -######## - -include $(OBJECT_DIR)/.depend - -.PHONY: depend -depend: - -$(MVF) $(OBJECT_DIR)/.depend $(OBJECT_DIR)/.depend-old - $(MAKE) $(OBJECT_DIR)/.depend - -$(OBJECT_DIR)/.depend: - @echo ---------------------------------------------------------------- - @echo -- Making dependency file. If you add files to the makefile, - @echo -- or add/remove includes from a .h or .cpp file, then you should - @echo -- remake the dependency file by typing \"$(MAKE) depend\" - @echo ---------------------------------------------------------------- - -mkdir -p $(OBJECT_DIR) -ifeq ($(HW_OS),hp700_hpux10) - @echo -- $(HW_OS): Using g++ since HP CC does not understand -M - @echo -- if this causes an error, then delete .depend and type - @echo -- \"touch .depend\" to create an empty file - @echo ---------------------------------------------------------------- - $(SHELL) -ec 'g++ -MM $(CXXLAGS) $(LIB_FILES) \ - | sed '\''s/\(.*\.o[ ]*:[ ]*\)/$(OBJECT_DIR)\/\1/g'\'' > $(OBJECT_DIR)/.depend' -else - ifeq ($(HW_OS),hp_flow_aCC) - @echo -- $(HW_OS): Using g++ since HP aCC does not understand -M - @echo -- if this causes an error, then delete .depend and type - @echo -- \"touch .depend\" to create an empty file - @echo ---------------------------------------------------------------- - $(SHELL) -ec 'g++ -MM $(CXXFLAGS) $(LIB_FILES) \ - | sed '\''s/\(.*\.o[ ]*:[ ]*\)/$(OBJECT_DIR)\/\1/g'\'' > $(OBJECT_DIR)/.depend' - else - ifeq ($(HW_OS),powerpc_aix) - @$(RMF) *.u - $(SHELL) -ec '$(CC) -E -M $(CFLAGS) $(LIB_FILES) > /dev/null 2>&1' - cat *.u > .depend - @$(RMF) *.u - else - $(SHELL) -ec '$(CC) -M $(CFLAGS) $(LIB_FILES) \ - | sed '\''s/\(.*\.o[ ]*:[ ]*\)/$(OBJECT_DIR)\/\1/g'\'' > $(OBJECT_DIR)/.depend' - endif - endif -endif - @echo ---------------------------------------------------------------- diff --git a/src/vrpn/java_vrpn/runtest.sh b/src/vrpn/java_vrpn/runtest.sh deleted file mode 100755 index 87a4788e7ac496917d400a57abeb83cf56b68089..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/runtest.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# Be sure to export CLASSPATH to include where vrpn.jar is, as well as -# and VRPN_JAVA_LIBDIR to indicate where libvrpn_java.so is. -echo ------------------------- -echo $1 -( - cd test && \ - timeout -s9 5s java -Djava.library.path=${VRPN_JAVA_LIBDIR} $1 - ret=$? - if [ ! $ret -eq 124 ]; then - echo "Exited with code $ret" - exit $ret - fi -) diff --git a/src/vrpn/java_vrpn/runtests.sh b/src/vrpn/java_vrpn/runtests.sh deleted file mode 100755 index 46d271735aa91cb59be3d893d1bcad363799303a..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/runtests.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Be sure to export CLASSPATH to include where vrpn.jar is, as well as -# and VRPN_JAVA_LIBDIR to indicate where libvrpn_java.so is. -( - cd $(dirname $0) - export CLASSPATH=$CLASSPATH:$(cd test && pwd) - (cd test && ls *Test.class |sed s/.class//) | xargs -n 1 ./runtest.sh -) diff --git a/src/vrpn/java_vrpn/test/.classpath b/src/vrpn/java_vrpn/test/.classpath deleted file mode 100644 index 23ecc8312ac8537f9886bf6fdf42c652b1e67b08..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/.classpath +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path=""/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry combineaccessrules="false" kind="src" path="/java_vrpn"> - <attributes> - <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="java_vrpn/bin/Release"/> - </attributes> - </classpathentry> - <classpathentry kind="lib" path="/java_vrpn/bin/vrpn.jar"> - <attributes> - <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="java_vrpn/bin/Release"/> - </attributes> - </classpathentry> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/src/vrpn/java_vrpn/test/.cvsignore b/src/vrpn/java_vrpn/test/.cvsignore deleted file mode 100644 index 6a6c6730ee4d366b72c3af7a4e189d4e908c1eff..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -*.suo -*.class -codebase.dat -*.dll -bin diff --git a/src/vrpn/java_vrpn/test/.project b/src/vrpn/java_vrpn/test/.project deleted file mode 100644 index 6f9a7d04de6a6d220222dff0168be4797589b0be..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>java_vrpn test</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/src/vrpn/java_vrpn/test/AnalogListenerTest.java b/src/vrpn/java_vrpn/test/AnalogListenerTest.java deleted file mode 100644 index 147576dd1d63c9cd44fb41677d6ec718370e7181..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/AnalogListenerTest.java +++ /dev/null @@ -1,136 +0,0 @@ -import java.io.*; -import java.util.*; -import vrpn.*; - -public class AnalogListenerTest -{ - public static void main( String[] args ) throws IOException - { - String analogName = "tetra_force_server@gold-cs:4700"; - vrpn.AnalogRemote analog = null; - vrpn.AnalogOutputRemote ao = null; - - try - { - analog = new vrpn.AnalogRemote( analogName, null, null, null, null ); - ao = new vrpn.AnalogOutputRemote( analogName, null, null, null, null ); - } - - catch( InstantiationException e ) - { - System.out.println("We couldn't connect to analog " + analogName + "."); - System.out.println(e.getMessage()); - return; - } - AnalogRandomValueGenerator thread = new AnalogRandomValueGenerator( ao ); - - AnalogRemoteListener analogListener = new AnalogRemoteListener( analog ); - - BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); - - while(true) - { - System.out.println("\nActions:"); - System.out.println("\tC -> check mode"); - System.out.println("\tL -> set mode to last"); - System.out.println("\tA -> set mode to all"); - System.out.println("\tD -> display updates"); - System.out.println("\tR -> request a value change"); - System.out.println("\tS -> start a thread to keep requesting random value changes"); - System.out.println("\tT -> stop the thread"); - System.out.println("\tQ -> quit"); - - String s = in.readLine(); - - if (s.equalsIgnoreCase("q")) - { - System.exit(0); - } - - if (s.equalsIgnoreCase("c")) - { - int last = analogListener.getModeAnalogUpdate(); - - if (last == AnalogRemoteListener.LAST_UPDATE) System.out.println("Current mode is set to last"); - else System.out.println("Current mode is set to all"); - } - - if (s.equalsIgnoreCase("l")) - { - analogListener.setModeLastAnalogUpdate(); - - System.out.println("Mode set to last"); - } - - if (s.equalsIgnoreCase("a")) - { - analogListener.setModeAllAnalogUpdates(); - - System.out.println("Mode set to all"); - } - - if (s.equalsIgnoreCase("d")) - { - Vector updates = analogListener.getAnalogUpdate(); - - if (updates == null) - { - System.out.println("No updates received so far"); - } - - else - { - for (int i=0; i<updates.size(); i++) - { - vrpn.AnalogRemote.AnalogUpdate u = (vrpn.AnalogRemote.AnalogUpdate)updates.elementAt(i); - - System.out.println( - "time: " + u.msg_time.getTime( ) + "\n" + - "values: channel1->" + u.channel[0] + " channel2->" + u.channel[1] + - " channel3->" + u.channel[2] + " channel4->" + u.channel[3] - ); - } - } - } - - if (s.equalsIgnoreCase("r")) - { - System.out.println("Input value to send"); - System.out.print("(int) channel: (0-3)"); - - int channel = Integer.parseInt(in.readLine()); - - System.out.print("(double) value:"); - - Double temp = new Double(in.readLine()); - double value = temp.doubleValue(); - - if (channel<0 | channel>3) - { - System.out.println("invalid channel; action aborted"); - } - - else - { - ao.requestValueChange(channel, value); - System.out.println("Request completed"); - } - } - - if (s.equalsIgnoreCase("s")) - { - thread = new AnalogRandomValueGenerator( ao ); - thread.start(); - - System.out.println("Thread started"); - } - - if (s.equalsIgnoreCase("t")) - { - thread.stopRunning(); - - System.out.println("Thread stopped"); - } - } - } -} diff --git a/src/vrpn/java_vrpn/test/AnalogRandomValueGenerator.java b/src/vrpn/java_vrpn/test/AnalogRandomValueGenerator.java deleted file mode 100644 index 51f8921e8bda96213b7d237d1d40f8106bf713d1..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/AnalogRandomValueGenerator.java +++ /dev/null @@ -1,38 +0,0 @@ -import vrpn.*; - -public class AnalogRandomValueGenerator extends Thread -{ - AnalogOutputRemote ao = null; - boolean running = true; - - - public AnalogRandomValueGenerator( vrpn.AnalogOutputRemote a ) - { - ao = a; - } - - - public void run() - { - while (running) - { - int channel = (int)(Math.random()*4); - double value = (double)(Math.random()); - - ao.requestValueChange(channel, value); - } - try - { - Thread.sleep(10); - } - - catch(Exception e){} - - } - - - public void stopRunning() - { - running = false; - } -} diff --git a/src/vrpn/java_vrpn/test/AnalogTest.java b/src/vrpn/java_vrpn/test/AnalogTest.java deleted file mode 100644 index 9fdff0ebae760fa7e4e291df2a21b934834c5916..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/AnalogTest.java +++ /dev/null @@ -1,43 +0,0 @@ -import vrpn.*; - -public class AnalogTest - implements vrpn.AnalogRemote.AnalogChangeListener -{ - public void analogUpdate( vrpn.AnalogRemote.AnalogUpdate u, - vrpn.AnalogRemote tracker ) - { - - System.out.println( "Analog message from vrpn: \n" + - "\ttime: " + u.msg_time.getTime( ) + "\n" /*+ - "\tposition: " + u.pos[0] + " " + u.pos[1] + " " + u.pos[2] + "\n" + - "\torientation: " + u.quat[0] + " " + u.quat[1] + " " + - u.quat[2] + " " + u.quat[3] */ ); - - } - - - public static void main( String[] args ) - { - String analogName = "tetra_force_server@palladium-cs:4700"; - AnalogRemote analog = null; - AnalogOutputRemote ao = null; - try - { - analog = new AnalogRemote( analogName, null, null, null, null ); - ao = new AnalogOutputRemote( analogName, null, null, null, null ); - } - catch( InstantiationException e ) - { - // do something b/c you couldn't create the analog - System.out.println( "We couldn't connect to analog " + analogName + "." ); - System.out.println( e.getMessage( ) ); - return; - } - - AnalogTest test = new AnalogTest( ); - analog.addAnalogChangeListener( test ); - - ao.requestValueChange( 2, 5 ); - - } -} diff --git a/src/vrpn/java_vrpn/test/AuxiliaryLoggerTest.java b/src/vrpn/java_vrpn/test/AuxiliaryLoggerTest.java deleted file mode 100644 index 7c2cc8bdb98176e92ff19f74fc273cd3e36cec3d..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/AuxiliaryLoggerTest.java +++ /dev/null @@ -1,58 +0,0 @@ -import vrpn.*; -import vrpn.AuxiliaryLoggerRemote.LoggingReport; - -public class AuxiliaryLoggerTest implements AuxiliaryLoggerRemote.LoggingReportListener -{ - - public void loggingReport( LoggingReport u, AuxiliaryLoggerRemote logger ) - { - System.out.println( "logging report at (" + u.msg_time + "): " ); - System.out.println( "\tlocal in: " + ( u.localInLogfileName == null ? "(null)" : u.localInLogfileName ) ); - System.out.println( "\tlocal out: " + ( u.localOutLogfileName == null ? "(null)" : u.localOutLogfileName ) ); - System.out.println( "\tremote in: " + ( u.remoteInLogfileName == null ? "(null)" : u.remoteInLogfileName ) ); - System.out.println( "\tremote out: " + ( u.remoteOutLogfileName == null ? "(null)" : u.remoteOutLogfileName ) ); - - } - - - public static void main( String args[] ) - { - String loggerName = "ImageStream0@localhost"; - AuxiliaryLoggerRemote l = null; - - try - { - l = new AuxiliaryLoggerRemote( loggerName ); - } - catch( InstantiationException e ) - { - System.out.println( "couldn't connect to auxiliary logger \'" + loggerName + "\'" ); - System.out.println( e.getMessage() ); - return; - } - - AuxiliaryLoggerTest alt = new AuxiliaryLoggerTest(); - l.addLoggingReportListener( alt ); - - String logfilename = "file" + (int) (Math.random() * 1000); - l.sendLoggingRequest( logfilename, null, null, null ); - System.out.println( "made logging request for " + logfilename + ", null, null, null" ); - - try{ Thread.sleep( 3000 ); } - catch( InterruptedException e ) { } - - l.sendLoggingStatusRequest(); - System.out.println( "made logging status request" ); - - try{ Thread.sleep( 3000 ); } - catch( InterruptedException e ) { } - - l.sendLoggingRequest( null, null, null, null ); - System.out.println( "made logging request for null, null, null, null" ); - - try{ Thread.sleep( 3000 ); } - catch( InterruptedException e ) { } - } - - -} diff --git a/src/vrpn/java_vrpn/test/ButtonListenerTest.java b/src/vrpn/java_vrpn/test/ButtonListenerTest.java deleted file mode 100644 index ff41842737506c97347c264b9b493de152f2561a..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/ButtonListenerTest.java +++ /dev/null @@ -1,90 +0,0 @@ -import java.io.*; -import java.util.*; -import vrpn.*; - -public class ButtonListenerTest -{ - public static void main( String[] args ) throws IOException - { - String buttonName = "Phantom@gold-cs"; - vrpn.ButtonRemote button = null; - - try - { - button = new vrpn.ButtonRemote(buttonName, null, null, null, null ); - } - - catch(InstantiationException e) - { - System.out.println("We couldn't connect to phantom " + buttonName + "."); - System.out.println(e.getMessage()); - return; - } - - ButtonRemoteListener buttonListener = new ButtonRemoteListener(button); - - BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); - - while(true) - { - System.out.println("\nActions:"); - System.out.println("\tC -> check mode"); - System.out.println("\tL -> set mode to last"); - System.out.println("\tA -> set mode to all"); - System.out.println("\tD -> display updates"); - System.out.println("\tQ -> quit"); - - String s = in.readLine(); - - if (s.equalsIgnoreCase("q")) - { - System.exit(0); - } - - if (s.equalsIgnoreCase("c")) - { - int last = buttonListener.getModeButtonUpdate(); - - if (last== ButtonRemoteListener.LAST_UPDATE) System.out.println("Current mode is set to last"); - else System.out.println("Current mode is set to all"); - } - - if (s.equalsIgnoreCase("l")) - { - buttonListener.setModeLastButtonUpdate(); - - System.out.println("Mode set to last"); - } - - if (s.equalsIgnoreCase("a")) - { - buttonListener.setModeAllButtonUpdates(); - - System.out.println("Mode set to all"); - } - - if (s.equalsIgnoreCase("d")) - { - Vector updates = buttonListener.getButtonUpdate(); - - if (updates == null) - { - System.out.println("No updates received so far"); - } - - else - { - for (int i=0; i<updates.size(); i++) - { - vrpn.ButtonRemote.ButtonUpdate u = (vrpn.ButtonRemote.ButtonUpdate)updates.elementAt(i); - - System.out.println( - "\ttime: " + u.msg_time.getTime( ) + " button: " + u.button + " " + - " state: " + u.state - ); - } - } - } - } - } -} diff --git a/src/vrpn/java_vrpn/test/ButtonTest.java b/src/vrpn/java_vrpn/test/ButtonTest.java deleted file mode 100644 index a56a89e60c93de618cfff8d4be9d79238670dc99..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/ButtonTest.java +++ /dev/null @@ -1,39 +0,0 @@ -import vrpn.*; - -public class ButtonTest - implements vrpn.ButtonRemote.ButtonChangeListener - -{ - public void buttonUpdate( ButtonRemote.ButtonUpdate u, - ButtonRemote button ) - { - System.out.println( "Button message from vrpn: \n" + - "\ttime: " + u.msg_time.getTime( ) + " button: " + u.button + "\n" + - "\tstate: " + u.state ); - } - - - - public static void main( String[] args ) - { - String buttonName = "Phantom@gold-cs.cs.unc.edu"; - ButtonRemote button = null; - try - { - button = new ButtonRemote( buttonName, null, null, null, null ); - } - catch( InstantiationException e ) - { - // do something b/c you couldn't create the button - System.out.println( "We couldn't connect to button " + buttonName + "." ); - System.out.println( e.getMessage( ) ); - return; - } - - ButtonTest test = new ButtonTest( ); - button.addButtonChangeListener( test ); - - } - - -} diff --git a/src/vrpn/java_vrpn/test/ChangeLog b/src/vrpn/java_vrpn/test/ChangeLog deleted file mode 100644 index dac887c7a57042f2ecdc92238a7842d5eb85fe46..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/ChangeLog +++ /dev/null @@ -1,101 +0,0 @@ -2010-06-03 David Marshburn <marshbur@cs.unc.edu> - - * FunctionGeneratorTest.java: a more complete collection - of tests and example usage. - -2010-02-10 David Marshburn <marshbur@cs.unc.edu> - - * FunctionGeneratorTest.java: a few additional tests to - exercise the function-generator class - -2010-01-14 David Marshburn <marshbur@cs.unc.edu> - - * FunctionGeneratorTest.java: new. - -2009-09-10 David Marshburn <marshbur@cs.unc.edu> - - * TestTempImager.java: removed. TempImager no longer exists. - * .classpath: fixed location of vrpn.jar. - -2008-06-24 David Marshburn <marshbur@cs.unc.edu> - - * PoserTest.java: tests relative pose request - -2008-02-13 David Marshburn <marshbur@cs.unc.edu> - - * AuxiliaryLoggerTest.java: slightly better handling - of logging reports. - -2007-10-22 David Marshburn <marshbur@cs.unc.edu> - - * AuxiliaryLoggerTest.java: new - * TrackerTest.java: changed port - -2007-10-19 David Marshburn <marshbur@cs.unc.edu> - - * .classpath, .project: eclipse project files - * .cvsignore: ignore the bin/ directory - -2006-04-24 <marshbur@cs.unc.edu> - - * text sender/receiver test programs - -2006-01-30 <marshbur@cs.unc.edu> - - * all: catching up the test applications with the recent (and, in - some cases, not-so-recent) changes in java_vrpn. - -2005-07-28 David Marshburn <marshbur@cs.unc.edu> - - * PoserTest.java: new, a test program for java_vrpn poser. - -2003-10-24 Oliver Otto <o.otto@reading.ac.uk> - - * PrintCereals.java: java version of the printcereals utility. - -2002-09-16 David Marshburn <marshbur@cs.unc.edu> - - * ButtonListenerTest.java, ButtonTest.java, ForceDeviceTest.java, - TrackerTest.java: use new constructors with log file arguments. - * .cvsignore: ignore dll files in this directory - * test.vjp: changed debugging/execution options - -2002-09-12 David Marshburn <marshbur@cs.unc.edu> - - * AnalogListenerTest.java: fixed up this example to match recent - changes in AnalogRemoteListener.java - * ButtonListenerTest.java: ditto - * TempImagerTest.java: beginning of a test program for TempImager - * test.vjp: adds TempImagerTest - -2002-07-25 Tatsuhiro Segi <segi@email.unc.edu> - - * AnalogListenerTest.java: new file to test and demonstrate - how to use Remote Listener classes. - * ButtonListenerTest.java: same - * AnalogRandomValueGenerator.java: thread to generate bunch - of random value requests to analogRemote for testing - -2002-06-25 David Marshburn <marshbur@cs.unc.edu> - - * AnalogTest.java: new - * ForceDeviceTest.java: new - * test.vjp: adds the above two files. - -2002-06-18 Tatsuhiro Segi <segi@email.unc.edu> - - * ButtonTest.java: implemented - * test.jvp: added ButtonTest.java file - -2002-06-12 Tatsuhiro Segi <segi@email.unc.edu> - - * ButtonTest.java: new. - -2002-06-07 David Marshburn <marshbur@cs.unc.edu> - - * .cvsignore: new - * TrackerTest.java: changes to keep up with vrpn.TrackerRemote - (velocity, acceleration and exception) - * test.vjp: build setting (CLASSPATH) - - diff --git a/src/vrpn/java_vrpn/test/ForceDeviceTest.java b/src/vrpn/java_vrpn/test/ForceDeviceTest.java deleted file mode 100644 index 19a5baa4c7e5a30483e94582749a051da64c3e39..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/ForceDeviceTest.java +++ /dev/null @@ -1,68 +0,0 @@ -import vrpn.*; - -public class ForceDeviceTest - implements vrpn.ForceDeviceRemote.ForceChangeListener, - vrpn.ForceDeviceRemote.SCPChangeListener, - vrpn.ForceDeviceRemote.ForceErrorListener - -{ - public void forceUpdate( ForceDeviceRemote.ForceChange f, - ForceDeviceRemote forceDevice ) - { - System.out.println( "ForceDevice force message from vrpn: \n" /*+ - "\ttime: " + u.msg_time.getTime( ) + " sensor: " + u.sensor + "\n" + - "\tposition: " + u.pos[0] + " " + u.pos[1] + " " + u.pos[2] + "\n" + - "\torientation: " + u.quat[0] + " " + u.quat[1] + " " + - u.quat[2] + " " + u.quat[3] */ ); - } - - public void scpUpdate( ForceDeviceRemote.SCPChange s, - ForceDeviceRemote forceDevice ) - { - System.out.println( "ForceDevice surface contact message from vrpn: \n" /* + - "\ttime: " + v.msg_time.getTime( ) + " sensor: " + v.sensor + "\n" + - "\tvelocity: " + v.vel[0] + " " + v.vel[1] + " " + v.vel[2] + "\n" + - "\torientation: " + v.vel_quat[0] + " " + v.vel_quat[1] + " " + - v.vel_quat[2] + " " + v.vel_quat[3] + "\n" + - "\t quat dt: " + v.vel_quat_dt */ ); - } - - public void forceError( ForceDeviceRemote.ForceError e, - ForceDeviceRemote forceDevice ) - { - System.out.println( "ForceDevice force error message from vrpn: \n" /* + - "\ttime: " + a.msg_time.getTime( ) + " sensor: " + a.sensor + "\n" + - "\tposition: " + a.acc[0] + " " + a.acc[1] + " " + a.acc[2] + "\n" + - "\torientation: " + a.acc_quat[0] + " " + a.acc_quat[1] + " " + - a.acc_quat[2] + " " + a.acc_quat[3] + "\n" + - "\t quat dt: " + a.acc_quat_dt */ ); - } - - - public static void main( String[] args ) - { - String forceDeviceName = "Phantom@gold-cs"; - ForceDeviceRemote forceDevice = null; - try - { - forceDevice = new ForceDeviceRemote( forceDeviceName, null, null, null, null ); - } - catch( InstantiationException e ) - { - // do something b/c you couldn't create the force device - System.out.println( "We couldn't connect to force device " + forceDeviceName + "." ); - System.out.println( e.getMessage( ) ); - return; - } - - ForceDeviceTest test = new ForceDeviceTest( ); - forceDevice.addForceChangeListener( test ); - forceDevice.addSCPChangeListener( test ); - forceDevice.addForceErrorListener( test ); - - // try out the various force device methods... - - } - - -} diff --git a/src/vrpn/java_vrpn/test/FunctionGeneratorTest.java b/src/vrpn/java_vrpn/test/FunctionGeneratorTest.java deleted file mode 100644 index d408456060b72d7b711272868c786b8490625d0d..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/FunctionGeneratorTest.java +++ /dev/null @@ -1,153 +0,0 @@ -import vrpn.*; -import vrpn.FunctionGeneratorRemote.ChannelReply; -import vrpn.FunctionGeneratorRemote.ErrorReply; -import vrpn.FunctionGeneratorRemote.InterpreterReply; -import vrpn.FunctionGeneratorRemote.SampleRateReply; -import vrpn.FunctionGeneratorRemote.StartReply; -import vrpn.FunctionGeneratorRemote.StopReply; - -public class FunctionGeneratorTest - implements vrpn.FunctionGeneratorRemote.ChannelReplyListener, - vrpn.FunctionGeneratorRemote.StartStopReplyListener, - vrpn.FunctionGeneratorRemote.InterpreterReplyListener, - vrpn.FunctionGeneratorRemote.SampleRateReplyListener, - vrpn.FunctionGeneratorRemote.ErrorListener -{ - - public void fgChannelReply( ChannelReply r, FunctionGeneratorRemote fg ) - { - System.out.println( "FunctionGenerator channel message: " + - "\ttime: " + r.msg_time.getTime( ) + - "\t#: " + r.channelNumber + - "\t(with function type " + r.channel.function.getClass() + ")" ); - System.out.flush(); - - } - - public void fgStartReply( StartReply r, FunctionGeneratorRemote fg ) - { - System.out.println( "FunctionGenerator start message: " + - "\ttime: " + r.msg_time.getTime( ) ); - System.out.flush(); - - } - - public void fgStopReply( StopReply r, FunctionGeneratorRemote fg ) - { - System.out.println( "FunctionGenerator stop message: " + - "\ttime: " + r.msg_time.getTime( ) ); - System.out.flush(); - - } - - public void fgInterpreterReply( InterpreterReply r, FunctionGeneratorRemote fg ) - { - System.out.println( "FunctionGenerator interpreter-description message: " + - "\ttime: " + r.msg_time.getTime( ) + "\t(" + r.description + ")" ); - System.out.flush(); - - } - - public void fgSampleRateReply( SampleRateReply r, FunctionGeneratorRemote fg ) - { - System.out.println( "FunctionGenerator sample-rate message: " + - "\ttime: " + r.msg_time.getTime( ) + "\trate: " + r.sampleRate ); - System.out.flush(); - - } - - public void fgErrorReply( ErrorReply r, FunctionGeneratorRemote fg ) - { - System.out.println( "FunctionGenerator error message: " + - "\ttime: " + r.msg_time.getTime( ) ); - System.out.flush(); - - } - - - public static void main( String[] args ) - { - String functionGeneratorName = "hexa_force_server@iodine:4700"; - FunctionGeneratorRemote fg = null; - try - { - System.out.println( "connecting to " + functionGeneratorName ); - fg = new FunctionGeneratorRemote( functionGeneratorName, null, null, null, null ); - } - catch( InstantiationException e ) - { - // do something b/c you couldn't create the function generator - System.out.println( "We couldn't connect to function generator " + functionGeneratorName + "." ); - System.out.println( e.getMessage( ) ); - return; - } - - FunctionGeneratorTest test = new FunctionGeneratorTest( ); - fg.addChannelReplyListener( test ); - fg.addStartStopReplyListener( test ); - fg.addSampleRateReplyListener( test ); - fg.addInterpreterReplyListener( test ); - fg.addErrorListener( test ); - - for( int i = 0; i <= 9; i++ ) - try { Thread.sleep( 100 ); } - catch( InterruptedException e ) { } - - fg.requestSampleRate( 10000 ); - try { Thread.sleep( 1000 ); } - catch( InterruptedException e ) { } - - // this is before anything has started, so nothing should happen - fg.requestStop(); - try { Thread.sleep( 1000 ); } - catch( InterruptedException e ) { } - - //fg.requestAllChannels(); - fg.requestChannel( -1 ); // invalid channel - fg.requestChannel( 0 ); - fg.requestChannel( 1 ); - fg.requestChannel( 2 ); - try { Thread.sleep( 1000 ); } - catch( InterruptedException e ) { } - - String theScript = "doMagnetFunction( 0.15, @magnetConstant, 1 );" - + "doMagnetFunction( 0.4, @magnetConstant, 2 );" - + "doMagnetFunction( 0.9, @magnetConstant, 3 );" - + "doMagnetFunction( 1.72, @magnetConstant, -1 );" - + "doMagnetFunction( 2, @magnetConstant, 2 );"; - //String theScript = " #$%^Q %$%^@$%QRQGQA"; - FunctionGeneratorRemote.Function func - = new FunctionGeneratorRemote.Function_script( theScript ); - FunctionGeneratorRemote.Channel chan = new FunctionGeneratorRemote.Channel(); - chan.function = func; - fg.setChannel( 0, chan ); - fg.setChannel( 1, chan ); - fg.setChannel( 2, chan ); - fg.setChannel( 3, chan ); - fg.setChannel( 4, chan ); - fg.setChannel( 5, chan ); - try { Thread.sleep( 1000 ); } - catch( InterruptedException e ) { } - - fg.setChannel( -1, chan ); // invalid channel - try { Thread.sleep( 1000 ); } - catch( InterruptedException e ) { } - - /* - func = new FunctionGeneratorRemote.Function_NULL( ); - chan.function = func; - fg.setChannel( 2, chan ); - */ - - fg.requestStart(); - try { Thread.sleep( 10000 ); } - catch( InterruptedException e ) { } - - fg.requestStop(); - try { Thread.sleep( 1000 ); } - catch( InterruptedException e ) { } - - - } - -} diff --git a/src/vrpn/java_vrpn/test/PoserTest.java b/src/vrpn/java_vrpn/test/PoserTest.java deleted file mode 100644 index 6d429992f23e0d6d79ee8e94174b12c2cfffaf44..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/PoserTest.java +++ /dev/null @@ -1,63 +0,0 @@ - -import vrpn.*; - -public class PoserTest implements vrpn.TrackerRemote.PositionChangeListener -{ - public void trackerPositionUpdate( TrackerRemote.TrackerUpdate u, - TrackerRemote tracker ) - { - System.out.println( "Tracker position message from vrpn: \n" + - "\ttime: " + u.msg_time.getTime( ) + " sensor: " + u.sensor + "\n" + - "\tposition: " + u.pos[0] + " " + u.pos[1] + " " + u.pos[2] + "\n" + - "\torientation: " + u.quat[0] + " " + u.quat[1] + " " + - u.quat[2] + " " + u.quat[3] ); - } - - - public static void main( String[] args ) - { - String poserName = "Poser0@localhost"; - PoserRemote poser = null; - TrackerRemote tracker = null; - - try - { - tracker = new TrackerRemote( poserName, null, null, null, null ); - } - catch( InstantiationException e ) - { - // do something b/c you couldn't create the force device - System.out.println( "We couldn't connect to tracker " + poserName + "." ); - System.out.println( e.getMessage( ) ); - return; - } - - try - { - poser = new PoserRemote( poserName, null, null, null, null ); - } - catch( InstantiationException e ) - { - // do something b/c you couldn't create the force device - System.out.println( "We couldn't connect to poser " + poserName + "." ); - System.out.println( e.getMessage( ) ); - return; - } - - PoserTest test = new PoserTest(); - tracker.addPositionChangeListener( test ); - - //try some poser methods - - double[] pos = { 0, 1, 2 }; - double[] quat = { 3, 4, 5, 6 }; - poser.requestPose( pos, quat ); - try - { - Thread.sleep( 1000 ); - } - catch( Exception e ) { } - poser.requestPoseRelative( pos, quat ); - - } -} diff --git a/src/vrpn/java_vrpn/test/PrintCereals.java b/src/vrpn/java_vrpn/test/PrintCereals.java deleted file mode 100644 index 4655a189a2b466f02e5562d9b10a9a382b76dba9..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/PrintCereals.java +++ /dev/null @@ -1,231 +0,0 @@ -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.text.DecimalFormat; - -import vrpn.*; - - -/** - * @author Oliver Otto - * @version 1.0 - * - * This program is comparable with the printcereal and vrpn_prind_devices program - * from the original vrpn client programs. It can read the input from any analog, - * tracker and button device. - */ -public class PrintCereals - implements vrpn.ButtonRemote.ButtonChangeListener, - vrpn.AnalogRemote.AnalogChangeListener, - vrpn.TrackerRemote.PositionChangeListener, - vrpn.TrackerRemote.VelocityChangeListener, - vrpn.TrackerRemote.AccelerationChangeListener -{ - String stationName = null; - ButtonRemote button = null; - AnalogRemote analog = null; - TrackerRemote tracker = null; - - /** - * @param name The station name to which we connect - */ - public PrintCereals(String name) - { - stationName = name; - - // Button init - try - { - button = new ButtonRemote( stationName, null, null, null, null ); - } - catch( InstantiationException e ) - { - // do something b/c you couldn't create the button - System.out.println( "We couldn't connect to button " + stationName + "." ); - System.out.println( e.getMessage( ) ); - return; - } - - button.addButtonChangeListener( this ); - - // Analog init - try - { - analog = new AnalogRemote(stationName,null,null,null,null); - } - catch( InstantiationException e ) - { - // do something b/c you couldn't create the analog - System.out.println( "We couldn't connect to analog " + stationName + "." ); - System.out.println( e.getMessage( ) ); - return; - } - - analog.addAnalogChangeListener( this ); - - - try - { - //tracker = new TrackerRemote( trackerName, "localIn", "localOut", "remoteIn", "remoteOut" ); - tracker = new TrackerRemote( stationName, null, null, null, null ); - } - catch( InstantiationException e ) - { - // do something b/c you couldn't create the tracker - System.out.println( "We couldn't connect to tracker " + stationName + "." ); - System.out.println( e.getMessage( ) ); - return; - } - - - tracker.addPositionChangeListener( this ); - tracker.addVelocityChangeListener( this ); - tracker.addAccelerationChangeListener( this ); - - tracker.setUpdateRate( 2 ); - - - } - - public void shutdown() - { - button.removeButtonChangeListener(this); - analog.removeAnalogChangeListener(this); - } - - /** - * This method prints out every button update change. - * @param u Used to read all necessary information ot of the active channels - * @param button Used to get the number of active channels - * (non-Javadoc) - * @see vrpn.ButtonRemote.ButtonChangeListener#buttonUpdate(vrpn.ButtonRemote.ButtonUpdate, vrpn.ButtonRemote) - */ - public void buttonUpdate( ButtonRemote.ButtonUpdate u, - ButtonRemote button ) - { - System.out.println(this.stationName +" B"+ u.button +" -> "+ u.state); - } - - /** - * This method prints out every analog update change. - * @param u Used to read all necessary information ot of the active channels - * @param tracker Used to get the number of active channels - * (non-Javadoc) - * @see vrpn.AnalogRemote.AnalogChangeListener#analogUpdate(vrpn.AnalogRemote.AnalogUpdate, vrpn.AnalogRemote) - */ - public void analogUpdate( vrpn.AnalogRemote.AnalogUpdate u, - vrpn.AnalogRemote tracker ) - { - DecimalFormat f = new DecimalFormat(" 0.00;-0.00"); - - System.out.print( this.stationName + " Analogs:"); - for(int i=0; i<tracker.getNumActiveChannels(); i++) - { - System.out.print(" "+f.format(u.channel[i])); - } - System.out.println(""); - } - - /** - * This method prints out every tracker position update change. - * @param u Used to read all necessary information ot of the active channels - * @param tracker Used to get the number of active channels - */ - public void trackerPositionUpdate( TrackerRemote.TrackerUpdate u, - TrackerRemote tracker ) - { - DecimalFormat f = new DecimalFormat(" 0.00;-0.00"); - - System.out.println( "Tracker "+ this.stationName +", sensor " + u.sensor + ":\n" + - "\tpos ( " + f.format(u.pos[0]) + ", " + f.format(u.pos[1]) + ", " + f.format(u.pos[2]) + "); " + - "quat ( " + f.format(u.quat[0]) + ", " + f.format(u.quat[1]) + ", " + - f.format(u.quat[2]) + ", " + f.format(u.quat[3])+ ")" ); - } - - /** - * This method prints out every tracker velocity update change. - * @param v Used to read all necessary information ot of the active channels - * @param tracker Used to get the number of active channels - */ - public void trackerVelocityUpdate( TrackerRemote.VelocityUpdate v, - TrackerRemote tracker ) - { - System.out.println( "Tracker velocity message from vrpn: \n" /* + - "\ttime: " + v.msg_time.getTime( ) + " sensor: " + v.sensor + "\n" + - "\tvelocity: " + v.vel[0] + " " + v.vel[1] + " " + v.vel[2] + "\n" + - "\torientation: " + v.vel_quat[0] + " " + v.vel_quat[1] + " " + - v.vel_quat[2] + " " + v.vel_quat[3] + "\n" + - "\t quat dt: " + v.vel_quat_dt */ ); - } - - /** - * This method prints out every tracker acceleration update change. - * @param a Used to read all necessary information ot of the active channels - * @param tracker Used to get the number of active channels - */ - public void trackerAccelerationUpdate( TrackerRemote.AccelerationUpdate a, - TrackerRemote tracker ) - { - System.out.println( "Tracker acceleration message from vrpn: \n" /* + - "\ttime: " + a.msg_time.getTime( ) + " sensor: " + a.sensor + "\n" + - "\tposition: " + a.acc[0] + " " + a.acc[1] + " " + a.acc[2] + "\n" + - "\torientation: " + a.acc_quat[0] + " " + a.acc_quat[1] + " " + - a.acc_quat[2] + " " + a.acc_quat[3] + "\n" + - "\t quat dt: " + a.acc_quat_dt */ ); - } - - /** - * @param args Expect to get the station name to to which we want to connect. - * @throws Exception If there is no agrumnet, a usage information is shown. - */ - public static void main(String[] args) - throws Exception { - /* check command-line options */ - if (args.length<1) { - System.err.println("Usage: java "+PrintCereals.class.getName()+" "+ - "Device_name"); - System.err.println("Device_name: VRPN name of data source to contact"); - System.err.println(" example: Magellan0@localhost"); - System.exit(2); - } - PrintCereals[] new_station = new PrintCereals[args.length]; - - for(int i=0; i < args.length; i++) - { - // parse args - new_station[i] = new PrintCereals ( args[i]); - - // initialize the PC/station - System.out.println("Button's name is "+new_station[i].stationName); - System.out.println("Analog's name is "+new_station[i].stationName); - //System.out.println("Dial's name is "+new_station[i].stationName); - System.out.println("Button update: B<number> is <newstate>"); System.out.println("Analog update: Analogs: [new values listed]"); //System.out.println("Dial update: Dial# spun by [amount]"); - - } // end args for loop - - - // wait for q to quit - BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); - while(true) - { - String s = in.readLine(); //in.readLine(); - if (s.equalsIgnoreCase("q")) - { - for(int i=0; i < args.length; i++) - { - new_station[i].shutdown(); -/* This seems to have no effect on the error message we get when finishing the program - try - { - new_station[i].finalize(); - } - catch (Throwable e) - { - System.out.println("Could not finalize station "+i+" of "+new_station[i].stationName); - } -*/ - } - System.exit(0); - } - } - } -} diff --git a/src/vrpn/java_vrpn/test/TextReceiverTest.java b/src/vrpn/java_vrpn/test/TextReceiverTest.java deleted file mode 100644 index 37ff37faeca26620e8f1eea7d36260939a370c50..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/TextReceiverTest.java +++ /dev/null @@ -1,39 +0,0 @@ - -import vrpn.*; - -public class TextReceiverTest implements TextReceiver.TextMessageListener -{ - public void receiveTextMessage( TextReceiver.TextMessage t, TextReceiver r ) - { - System.out.println( "Text message from vrpn: \n" + - "\ttime: " + t.msg_time.getTime() + - "\tseverity: " + t.type + "(" + TextReceiver.getTextSeverityString( t.type ) + ")" + - "\tlevel: " + t.level + "\n" + - "\tmessage: " + t.msg - ); - - } - - - public static void main(String[] args) - { - String textSenderName = "testText@localhost"; - TextReceiver r = null; - try - { - r = new TextReceiver( textSenderName, null, null, null, null ); - } - catch( InstantiationException e ) - { - // do something b/c you couldn't create the text receiver - System.out.println( "We couldn't connect text receiver to " + textSenderName + "." ); - System.out.println( e.getMessage( ) ); - return; - } - - TextReceiverTest test = new TextReceiverTest( ); - r.addTextListener( test ); - - while(true); - } -} diff --git a/src/vrpn/java_vrpn/test/TextSenderTest.java b/src/vrpn/java_vrpn/test/TextSenderTest.java deleted file mode 100644 index e7e3e76f45f7c8d5fa6855210a5a1f6075ff26b1..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/TextSenderTest.java +++ /dev/null @@ -1,32 +0,0 @@ - -import vrpn.*; - -public class TextSenderTest -{ - public static void main(String[] args) - { - String textSenderName = "testText"; - TextSender r = null; - try - { - r = new TextSender( textSenderName, null, null, null, null ); - } - catch( InstantiationException e ) - { - // do something b/c you couldn't create the text sender - System.out.println( "We couldn't connect text sender to " + textSenderName + "." ); - System.out.println( e.getMessage( ) ); - return; - } - - int msgCount = 1; - while(true) - { - String msg = "hello from TextSenderTest (" + msgCount++ + ")"; - System.out.println( "sending: " + msg ); - r.sendMessage( msg ); - try{ Thread.sleep( 1000 ); } - catch( InterruptedException e ) { } - } - } -} diff --git a/src/vrpn/java_vrpn/test/TrackerTest.java b/src/vrpn/java_vrpn/test/TrackerTest.java deleted file mode 100644 index fd68a4cf1f1cf6d019b6e5ac0c79f46cc533f557..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/TrackerTest.java +++ /dev/null @@ -1,90 +0,0 @@ -import java.io.*; -import vrpn.*; - -public class TrackerTest - implements vrpn.TrackerRemote.PositionChangeListener, - vrpn.TrackerRemote.VelocityChangeListener, - vrpn.TrackerRemote.AccelerationChangeListener - -{ - public void trackerPositionUpdate( TrackerRemote.TrackerUpdate u, - TrackerRemote tracker ) - { - System.out.println( "Tracker position message from vrpn: \n" /*+ - "\ttime: " + u.msg_time.getTime( ) + " sensor: " + u.sensor + "\n" + - "\tposition: " + u.pos[0] + " " + u.pos[1] + " " + u.pos[2] + "\n" + - "\torientation: " + u.quat[0] + " " + u.quat[1] + " " + - u.quat[2] + " " + u.quat[3] */ ); - } - - public void trackerVelocityUpdate( TrackerRemote.VelocityUpdate v, - TrackerRemote tracker ) - { - System.out.println( "Tracker velocity message from vrpn: \n" /* + - "\ttime: " + v.msg_time.getTime( ) + " sensor: " + v.sensor + "\n" + - "\tvelocity: " + v.vel[0] + " " + v.vel[1] + " " + v.vel[2] + "\n" + - "\torientation: " + v.vel_quat[0] + " " + v.vel_quat[1] + " " + - v.vel_quat[2] + " " + v.vel_quat[3] + "\n" + - "\t quat dt: " + v.vel_quat_dt */ ); - } - - public void trackerAccelerationUpdate( TrackerRemote.AccelerationUpdate a, - TrackerRemote tracker ) - { - System.out.println( "Tracker acceleration message from vrpn: \n" /* + - "\ttime: " + a.msg_time.getTime( ) + " sensor: " + a.sensor + "\n" + - "\tposition: " + a.acc[0] + " " + a.acc[1] + " " + a.acc[2] + "\n" + - "\torientation: " + a.acc_quat[0] + " " + a.acc_quat[1] + " " + - a.acc_quat[2] + " " + a.acc_quat[3] + "\n" + - "\t quat dt: " + a.acc_quat_dt */ ); - } - - - public static void main( String[] args ) - { - String trackerName = "RandTracker@localhost:5500"; - TrackerRemote tracker = null; - BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); - try - { - tracker = new TrackerRemote( trackerName, null, null, null, null ); - } - catch( InstantiationException e ) - { - // do something b/c you couldn't create the tracker - System.out.println( "We couldn't connect to tracker " + trackerName + "." ); - System.out.println( e.getMessage( ) ); - try - { - System.out.flush(); - System.err.flush(); - System.out.println( "hit enter to end" ); - in.readLine(); - } - catch( IOException ioe ) {} - return; - } - - TrackerTest test = new TrackerTest( ); - tracker.addPositionChangeListener( test ); - tracker.addVelocityChangeListener( test ); - tracker.addAccelerationChangeListener( test ); - - //tracker.setUpdateRate( 2 ); - - while( true ); - /* - try - { - System.out.flush(); - System.err.flush(); - System.out.println( "hit enter to end" ); - String s = in.readLine(); - } - catch( IOException ioe ) {} - return; - */ - } - - -} diff --git a/src/vrpn/java_vrpn/test/test.sln b/src/vrpn/java_vrpn/test/test.sln deleted file mode 100644 index 6b54968d40c4af977de221fe8c83d1da0267b111..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/test/test.sln +++ /dev/null @@ -1,13 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 1.00 -Project("{66355F20-A65B-11D0-BFB5-00A0C91EBFA0}") = "test", "test.vjp", "{171CD3F2-DBE6-416A-AE8E-C963537336AB}" -EndProject -Global - GlobalSection(LocalDeployment) = postSolution - StartupProject = {171CD3F2-DBE6-416A-AE8E-C963537336AB} - EndGlobalSection - GlobalSection(BuildOrder) = postSolution - 0 = {171CD3F2-DBE6-416A-AE8E-C963537336AB} - EndGlobalSection - GlobalSection(DeploymentRoot) = postSolution - EndGlobalSection -EndGlobal diff --git a/src/vrpn/java_vrpn/test/test.vjp b/src/vrpn/java_vrpn/test/test.vjp deleted file mode 100644 index c87f13586458b5b5380f4817d52b3985e7dc2411..0000000000000000000000000000000000000000 Binary files a/src/vrpn/java_vrpn/test/test.vjp and /dev/null differ diff --git a/src/vrpn/java_vrpn/vrpn/AnalogOutputRemote.java b/src/vrpn/java_vrpn/vrpn/AnalogOutputRemote.java deleted file mode 100644 index eed6442b45c5e5162a6c710e0230e554748363c9..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/AnalogOutputRemote.java +++ /dev/null @@ -1,97 +0,0 @@ - -package vrpn; - -public class AnalogOutputRemote extends VRPNDevice implements Runnable -{ - - ////////////////// - // Public structures and interfaces - - public static final int MAX_CHANNELS = 128; - - // end of the public structures and interfaces - /////////////////// - - /////////////////// - // Public methods - - /** - * @exception java.lang.InstantiationException - * If the analogOutput could not be created because of problems with - * its native code and linking. - */ - public AnalogOutputRemote( String name, String localInLogfileName, String localOutLogfileName, - String remoteInLogfileName, String remoteOutLogfileName ) - throws InstantiationException - { - super( name, localInLogfileName, localOutLogfileName, remoteInLogfileName, remoteOutLogfileName ); - } - - public boolean requestValueChange( int channel, double value ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = this.requestValueChange_native( channel, value ); - } - return retval; - } - - public boolean requestValueChange( double[] values ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = this.requestValueChange_native( values ); - } - return retval; - } - - public synchronized native int getNumActiveChannels( ); - public int getMaxActiveChannels( ) - { return AnalogRemote.MAX_CHANNELS; } - - - // end public methods - //////////////////////// - - - //////////////////////// - // Protected methods - // - - /** - * Initialize the native analogOutput object - * @param name The name of the analogOutput and host (e.g., <code>"Analog0@myhost.edu"</code>). - * @return <code>true</code> if the analogOutput was connected successfully, - * <code>false</code> otherwise. - */ - protected native boolean init( String name, String localInLogfileName, - String localOutLogfileName, String remoteInLogfileName, - String remoteOutLogfileName ); - - /** - * This should only be called from the method finalize() - */ - protected native void shutdownAnalogOutput( ); - - protected native void mainloop( ); - protected native boolean requestValueChange_native( int channel, double value ); - protected native boolean requestValueChange_native( double[] values ); - - /** - * Called when the thread is stopped/the device shuts down - */ - protected void stoppedRunning( ) - { - synchronized( downInVrpnLock ) - { - this.shutdownAnalogOutput( ); - } - } - - // end protected methods - /////////////////////// - - -} diff --git a/src/vrpn/java_vrpn/vrpn/AnalogRemote.java b/src/vrpn/java_vrpn/vrpn/AnalogRemote.java deleted file mode 100644 index 0d40fd03f68936ffc78c891c62c9bbacbc5fc74c..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/AnalogRemote.java +++ /dev/null @@ -1,146 +0,0 @@ - -package vrpn; -import java.util.*; - -public class AnalogRemote extends VRPNDevice implements Runnable -{ - - ////////////////// - // Public structures and interfaces - - public static final int MAX_CHANNELS = 128; - - public class AnalogUpdate - { - public Date msg_time = new Date( ); - public double channel[]; - } - - public interface AnalogChangeListener - { - public void analogUpdate( AnalogUpdate a, AnalogRemote analog ); - } - - // end of the public structures and interfaces - /////////////////// - - /////////////////// - // Public methods - - /** - * @param name The name of the analog to connect to (e.g., Tracker0@localhost) - * @param localInLogfileName The name of a logfile to save incoming messages. Use <code> - * null</code> if no such log is desired. - * @param localOutLogfileName The name of a logfile to save outgoing messages. Use <code> - * null</code> if no such log is desired. - * @param remoteInLogfileName The name of a logfile in which the server <code>name</code> - * should save incoming messages. Use <code>null</code> if no such log is desired. - * @param remoteOutLogfileName The name of a logfile in which the server <code>name</code> - * should save outgoing messages. Use <code>null</code> if no such log is desired. - * @exception java.lang.InstantiationException - * If the analog could not be created because of problems with - * its native code and linking. - */ - public AnalogRemote( String name, String localInLogfileName, String localOutLogfileName, - String remoteInLogfileName, String remoteOutLogfileName ) - throws InstantiationException - { - super( name, localInLogfileName, localOutLogfileName, remoteInLogfileName, remoteOutLogfileName ); - } - - - public synchronized native int getNumActiveChannels( ); - public int getMaxActiveChannels( ) - { return AnalogRemote.MAX_CHANNELS; } - - public synchronized void addAnalogChangeListener( AnalogChangeListener listener ) - { - changeListeners.addElement( listener ); - } - - - public synchronized boolean removeAnalogChangeListener( AnalogChangeListener listener ) - { - return changeListeners.removeElement( listener ); - } - - // end public methods - //////////////////////// - - - //////////////////////// - // Protected methods - // - - /** - * Should be called only by mainloop(), a native method which is itself - * synchronized. By extension, this method is synchronized (in that, for - * a given AnalogRemote object, this method can only be called from one - * thread at a time). - */ - protected void handleAnalogChange( long tv_sec, long tv_usec, - double[] channel ) - { - // putting the body of this function into a synchronized block prevents - // other instances of AnalogRemote from calling listeners' analogUpdate - // method concurrently. - synchronized( notifyingChangeListenersLock ) - { - AnalogUpdate a = new AnalogUpdate(); - a.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - a.channel = (double[]) channel.clone( ); - - // notify all listeners - Enumeration e = changeListeners.elements( ); - while( e.hasMoreElements( ) ) - { - AnalogChangeListener l = (AnalogChangeListener) e.nextElement( ); - l.analogUpdate( a, this ); - } - } // end synchronized( notifyingChangeListenersLock ) - } // end method handleAnalogChange - - - /** - * Initialize the native analog object - * @param name The name of the analog and host (e.g., <code>"Analog0@myhost.edu"</code>). - * @return <code>true</code> if the analog was connected successfully, - * <code>false</code> otherwise. - */ - protected native boolean init( String name, String localInLogfileName, - String localOutLogfileName, String remoteInLogfileName, - String remoteOutLogfileName ); - - /** - * This should only be called from the method finalize() - */ - protected native void shutdownAnalog( ); - - protected native void mainloop( ); - - /** - * Called when the thread is stopped/the device shuts down - */ - protected void stoppedRunning( ) - { - changeListeners.removeAllElements( ); - synchronized( downInVrpnLock ) - { - this.shutdownAnalog( ); - } - } - - // end protected methods - /////////////////////// - - /////////////////// - // data members - - /** - * @see vrpn.TrackerRemote#notifyingChangeListenersLock - */ - protected final static Object notifyingChangeListenersLock = new Object( ); - protected Vector changeListeners = new Vector( ); - - -} diff --git a/src/vrpn/java_vrpn/vrpn/AnalogRemoteListener.java b/src/vrpn/java_vrpn/vrpn/AnalogRemoteListener.java deleted file mode 100644 index ce799889de63981eb7f5714667204ac0ffc308c2..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/AnalogRemoteListener.java +++ /dev/null @@ -1,146 +0,0 @@ -/*************************************************************************** - * Use this class to store AnalogUpdates in a vector and get them when - * you want. It is most useful if you don't want to worry about your code - * running in a multi-threaded environment and about vrpn possibly deliver- - * ing device updates at arbitrary times. - * - * The Listener can be configured to buffer and return either all - * updates or only the last (the most recent) update. By default, it - * keeps only the last update. - * - * It is not intended that Listeners be shared among objects. Each - * entity in a program that is interested in hearing about updates - * from some vrpn Analog device (and which wishes to use this Listener - * mechanism) should create its own listener (even if multiple entities - * wish to hear from the same device). - ***************************************************************************/ - -package vrpn; -import java.util.Vector; - -public class AnalogRemoteListener implements AnalogRemote.AnalogChangeListener -{ - public static final int ALL_UPDATES = 0; - public static final int LAST_UPDATE = 1; - - - public AnalogRemoteListener( AnalogRemote analog ) - { - analogUpdates = new Vector(); - bufferMode = LAST_UPDATE; - analog.addAnalogChangeListener(this); - } - - - /** - * Sets the buffering mode of the Listener to record and return only - * the most recent (the last, the latest) AnalogUpdate. - */ - public synchronized void setModeLastAnalogUpdate() - { - bufferMode = LAST_UPDATE; - if (!analogUpdates.isEmpty()) - { - Object temp = analogUpdates.lastElement(); - analogUpdates.removeAllElements(); - analogUpdates.addElement(temp); - } - } - - - /** - * Sets the buffering mode of the Listener to record and return all - * AnalogUpdates, beginning at the time this mode is first enabled. - */ - public synchronized void setModeAllAnalogUpdates() - { - if( bufferMode == LAST_UPDATE ) - { - analogUpdates.removeAllElements( ); - } - bufferMode = ALL_UPDATES; - } - - - /** - * @return AnalogRemoteListener.ALL_UPDATES if the Listener is recording and - * returning all AnalogUpdates; AnalogRemoteListener.LAST_UPDATE if only the - * latest AnalogUpdate. - */ - public synchronized int getModeAnalogUpdate() - { - return bufferMode; - } - - - /** - * This method retreives the buffered AnalogUpdates from the Listener. - * If the buffering mode is LAST_UPDATE, the last update received will - * be returned (note that, in this mode, successive calls to getAnalogUpdate() - * may return the same AnalogUpdate if no new updates were received in the - * interim). If the buffering mode is ALL_UPDATES, all updates - * received since the last call to getAnalogUpdate() (or since ALL_UPDATES - * mode was enabled) will be returned. - * @return A Vector containing the buffered AnalogUpdates. The number of - * AnalogUpdates returned will depend on the buffering mode. If there are - * no AnalogUpdates buffered, an empty Vector will be returned. - * @see #setModeLastAnalogUpdate - * @see #setModeAllAnalogUpdates - */ - public synchronized Vector getAnalogUpdate() - { - Vector v = new Vector( ); - if( analogUpdates.isEmpty() ) - { - return v; - } - - if( bufferMode == LAST_UPDATE ) - { - v.addElement(analogUpdates.lastElement()); - } - else if( bufferMode == ALL_UPDATES ) - { - for( int i = 0; i < analogUpdates.size(); i++ ) - { - v.addElement( analogUpdates.elementAt(i) ); - } - analogUpdates.removeAllElements(); - } - return v; - } // end method getAnalogUpdate() - - - /** - * @return The last (most recent, latest) AnalogUpdate received. This function - * returns <code>null</code> if no updates have been received. Note that - * successive calls to getLastAnalogUpdate() may return the same AnalogUpdate - * if no updates were received in the interim. - */ - public synchronized AnalogRemote.AnalogUpdate getLastAnalogUpdate() - { - if( analogUpdates.isEmpty( ) ) - return null; - - return (AnalogRemote.AnalogUpdate) analogUpdates.lastElement(); - } - - - /** - * This is the handler that the AnalogRemote instance will call to deliver updates. - * This method is not intended to be called by user code. - */ - public synchronized void analogUpdate (AnalogRemote.AnalogUpdate u, AnalogRemote analog) - { - if( bufferMode == LAST_UPDATE ) - { - analogUpdates.removeAllElements(); - } - analogUpdates.addElement(u); - } - - - protected Vector analogUpdates; - protected int bufferMode; - -} // end class AnalogRemoteListener diff --git a/src/vrpn/java_vrpn/vrpn/AuxiliaryLoggerRemote.java b/src/vrpn/java_vrpn/vrpn/AuxiliaryLoggerRemote.java deleted file mode 100644 index 66058792e6dc95115be1ac9ad9f3d4cb5d75c7ff..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/AuxiliaryLoggerRemote.java +++ /dev/null @@ -1,163 +0,0 @@ -package vrpn; - -import java.util.Date; -import java.util.Enumeration; -import java.util.Vector; - - -public class AuxiliaryLoggerRemote extends VRPNDevice implements Runnable -{ - - ///////////////////////////////// - // Public structures and interfaces - - public class LoggingReport - { - public Date msg_time = new Date(); - public String localInLogfileName = ""; - public String localOutLogfileName = ""; - public String remoteInLogfileName = ""; - public String remoteOutLogfileName = ""; - } - - public interface LoggingReportListener - { - public void loggingReport( LoggingReport u, AuxiliaryLoggerRemote logger ); - } - - // end of the public structures and interfaces - ////////////////////////////////// - - - //////////////////////////////// - // Public methods - // - - /** - * @param name The name of the tracker to connect to (e.g., Logger0@somehost.com) - * @exception java.lang.InstantiationException - * If the tracker could not be created because of problems with - * its native code and linking. - */ - public AuxiliaryLoggerRemote( String name ) - throws InstantiationException - { - super( name, null, null, null, null ); - } - - - public synchronized native boolean - sendLoggingRequest( String localInLogfileName, String localOutLogfileName, - String remoteInLogfileName, String remoteOutLogfileName ); - - - public synchronized native boolean sendLoggingStatusRequest( ); - - - public synchronized void addLoggingReportListener( LoggingReportListener listener ) - { - listeners.addElement( listener ); - } - - - /** - * @return true on success; false on failure - */ - public synchronized boolean removeLoggingReportListener( LoggingReportListener listener ) - { - return listeners.removeElement( listener ); - } - - - // end public methods - //////////////////////// - - - //////////////////////// - // Protected methods - // - - /** - * Should be called only by mainloop(), a native method which is itself - * synchronized. By extension, this method is synchronized (in that, for - * a given LoggerRemote object, this method can only be called from one - * thread at a time). - */ - protected void handleLoggingReport( long tv_sec, long tv_usec, - String localIn, String localOut, - String remoteIn, String remoteOut ) - { - synchronized( notifyingListenersLock ) - { - LoggingReport r = new LoggingReport(); - r.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - r.localInLogfileName = localIn; - r.localOutLogfileName = localOut; - r.remoteInLogfileName = remoteIn; - r.remoteOutLogfileName = remoteOut; - - // notify all listeners - Enumeration e = listeners.elements( ); - while( e.hasMoreElements( ) ) - { - LoggingReportListener l = (LoggingReportListener) e.nextElement( ); - l.loggingReport( r, this ); - } - } // end synchronized block - } // end handleLoggerReport - - - protected void stoppedRunning() - { - listeners.removeAllElements(); - synchronized( downInVrpnLock ) - { - this.shutdownAuxiliaryLogger(); - } - } - - - protected native void shutdownAuxiliaryLogger(); - - - /** - * This should only be called from the method run() - */ - protected native void mainloop(); - - - /** - * Initialize the native tracker object - * @param name The name of the tracker and host (e.g., <code>"Tracker0@myhost.edu"</code>). - * @param localInLogfileName This will be ignored (as will all the *LogfileName params). - * @return <code>true</code> if the tracker was connected successfully, - * <code>false</code> otherwise. - */ - protected native boolean init( String name, String localInLogfileName, - String localOutLogfileName, String remoteInLogfileName, - String remoteOutLogfileName ); - // end protected methods - /////////////////////// - - /////////////////// - // data members - - protected Vector listeners = new Vector( ); - - /** - * these notifying*ListenersLock variables are used to ensure that multiple - * TrackerRemote objects running in multiple threads don't call the - * trackerChangeUpdate, et al, method of some single object concurrently. - * For example, the handleTrackerChange(...) method, which is invoked from native - * code, gets a lock on the notifyingChangeListenersLock object. Since that object - * is static, all other instances of TrackerRemote must wait before notifying - * their listeners and completing their handleTrackerChange(...) methods. - * They are necessary, in part, because methods in an interface can't be declared - * synchronized (and the semantics of the keyword 'synchronized' aren't what's - * wanted here, anyway -- we want synchronization across all instances, not just a - * single object). - */ - protected final static Object notifyingListenersLock = new Object( ); - - -} diff --git a/src/vrpn/java_vrpn/vrpn/ButtonRemote.java b/src/vrpn/java_vrpn/vrpn/ButtonRemote.java deleted file mode 100644 index ca03517dbf3de79da5d01e801ea52ae66066750a..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/ButtonRemote.java +++ /dev/null @@ -1,131 +0,0 @@ -package vrpn; -import java.util.*; - -public class ButtonRemote extends VRPNDevice implements Runnable -{ - - ////////////////// - // Public structures and interfaces - - public class ButtonUpdate - { - public Date msg_time = new Date( ); - public int button = 0; //Which button. Starts from 0 - public int state = 0; //0 for off, 1 for on - } - - public interface ButtonChangeListener - { - public void buttonUpdate( ButtonUpdate u, ButtonRemote button ); - } - - // end of the public structures and interfaces - /////////////////// - - /////////////////// - // Public methods - - public ButtonRemote( String name, String localInLogfileName, String localOutLogfileName, - String remoteInLogfileName, String remoteOutLogfileName ) - throws InstantiationException - { - super( name, localInLogfileName, localOutLogfileName, remoteInLogfileName, remoteOutLogfileName ); - } - - public synchronized void addButtonChangeListener( ButtonChangeListener listener ) - { - changeListeners.addElement( listener ); - } - - /** - * @return true on success; false on failure - */ - public synchronized boolean removeButtonChangeListener( ButtonChangeListener listener ) - { - return changeListeners.removeElement( listener ); - } - - /** - * Stops the button device thread - */ - public void stoppedRunning( ) - { - changeListeners.removeAllElements( ); - synchronized( downInVrpnLock ) - { - this.shutdownButton( ); - } - } - - // end public methods - //////////////////////// - - - //////////////////////// - // Protected methods - // - - /** - * Should be called only by mainloop(), a native method which is itself - * synchronized. By extension, this method is synchronized (in that, for - * a given ButtonRemote object, this method can only be called from one - * thread at a time). - */ - protected void handleButtonChange( long tv_sec, long tv_usec, int button, - int state ) - { - // putting the body of this function into a synchronized block prevents - // other instances of ButtonRemote from calling listeners' buttonPositionUpdate - // method concurrently. - synchronized( notifyingChangeListenersLock ) - { - ButtonUpdate b = new ButtonUpdate(); - b.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - b.button = button; - b.state = state; - - // notify all listeners - Enumeration e = changeListeners.elements( ); - while( e.hasMoreElements( ) ) - { - ButtonChangeListener l = (ButtonChangeListener) e.nextElement( ); - l.buttonUpdate( b, this ); - } - } // end synchronized( notifyingChangeListenersLock ) - } // end method handleButtonChange - - - /** - * Initialize the native button object - * @param name The name of the button and host (e.g., <code>"Button0@myhost.edu"</code>). - * @return <code>true</code> if the button was connected successfully, - * <code>false</code> otherwise. - */ - protected native boolean init( String name, String localInLogfileName, - String localOutLogfileName, String remoteInLogfileName, - String remoteOutLogfileName ); - - /** - * This should only be called from the method finalize() - */ - protected native void shutdownButton( ); - - protected native void mainloop( ); - - // end protected methods - /////////////////////// - - /////////////////// - // data members - - protected Vector changeListeners = new Vector( ); - - /** - * @see vrpn.TrackerRemote#notifyingChangeListenersLock - */ - protected final static Object notifyingChangeListenersLock = new Object( ); - - -} - - diff --git a/src/vrpn/java_vrpn/vrpn/ButtonRemoteListener.java b/src/vrpn/java_vrpn/vrpn/ButtonRemoteListener.java deleted file mode 100644 index 1d281607f3124c363d76505c3ea98d7fb1db5519..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/ButtonRemoteListener.java +++ /dev/null @@ -1,146 +0,0 @@ -/*************************************************************************** - * Use this class to store ButtonUpdate in a vector and get them when you - * want. It is most useful if you don't want to worry about your code - * running in a multi-threaded environment and about vrpn possibly deliver- - * ing device updates at arbitrary times. - * - * The Listener can be configured to buffer and return either all - * updates or only the last (the most recent) update. By default, it - * keeps only the last update. - * - * It is not intended that Listeners be shared among objects. Each - * entity in a program that is interested in hearing about updates - * from some vrpn Button device (and which wishes to use this Listener - * mechanism) should create its own listener (even if multiple entities - * wish to hear from the same device). - ***************************************************************************/ - -package vrpn; -import java.util.Vector; - -public class ButtonRemoteListener implements ButtonRemote.ButtonChangeListener -{ - public static final int ALL_UPDATES = 0; - public static final int LAST_UPDATE = 1; - - - public ButtonRemoteListener(ButtonRemote button) - { - buttonUpdates = new Vector(); - bufferMode = LAST_UPDATE; - button.addButtonChangeListener(this); - } - - - /** - * Sets the buffering mode of the Listener to record and return only - * the most recent (the last, the latest) ButtonUpdate. - */ - public synchronized void setModeLastButtonUpdate() - { - bufferMode = LAST_UPDATE; - if (!buttonUpdates.isEmpty()) - { - Object temp = buttonUpdates.lastElement(); - buttonUpdates.removeAllElements(); - buttonUpdates.addElement(temp); - } - } - - - /** - * Sets the buffering mode of the Listener to record and return all - * ButtonUpdates, beginning at the time this mode is first enabled. - */ - public synchronized void setModeAllButtonUpdates() - { - if( bufferMode == LAST_UPDATE ) - { - buttonUpdates.removeAllElements( ); - } - bufferMode = ALL_UPDATES; - } - - - /** - * @return ButtonRemoteListener.ALL_UPDATES if the Listener is recording and - * returning all ButtonUpdates; ButtonRemoteListener.LAST_UPDATE if only the - * latest ButtonUpdate. - */ - public synchronized int getModeButtonUpdate() - { - return bufferMode; - } - - - /** - * This method retreives the buffered ButtonUpdates from the Listener. - * If the buffering mode is LAST_UPDATE, the last update received will - * be returned (note that, in this mode, successive calls to getButtonUpdate() - * may return the same ButtonUpdate if no new updates were received in the - * interim). If the buffering mode is ALL_UPDATES, all updates - * received since the last call to getButtonUpdate() (or since ALL_UPDATES - * mode was enabled) will be returned. - * @return A Vector containing the buffered ButtonUpdates. The number of - * ButtonUpdates returned will depend on the buffering mode. If there are - * no ButtonUpdates buffered, an empty Vector will be returned. - * @see #setModeLastButtonUpdate - * @see #setModeAllButtonUpdates - */ - public synchronized Vector getButtonUpdate() - { - Vector v = new Vector( ); - if( buttonUpdates.isEmpty() ) - { - return v; - } - - if( bufferMode == LAST_UPDATE ) - { - v.addElement( buttonUpdates.lastElement() ); - } - else if( bufferMode == ALL_UPDATES ) - { - for( int i = 0; i < buttonUpdates.size(); i++ ) - { - v.addElement( buttonUpdates.elementAt(i) ); - } - buttonUpdates.removeAllElements(); - } - return v; - } // end method getButtonUpdate() - - - /** - * @return The last (most recent, latest) ButtonUpdate received. This function - * returns <code>null</code> if no updates have been received. Note that - * successive calls to getLastButtonUpdate() may return the same ButtonUpdate - * if no updates were received in the interim. - */ - public synchronized ButtonRemote.ButtonUpdate getLastButtonUpdate() - { - if( buttonUpdates.isEmpty( ) ) - return null; - - return (ButtonRemote.ButtonUpdate) buttonUpdates.lastElement(); - } - - - /** - * This is the handler that the ButtonRemote instance will call to deliver updates. - * This method is not intended to be called by user code. - */ - public synchronized void buttonUpdate (ButtonRemote.ButtonUpdate u, ButtonRemote button) - { - if( bufferMode == LAST_UPDATE ) - { - buttonUpdates.removeAllElements(); - } - buttonUpdates.addElement(u); - } - - - protected Vector buttonUpdates; - protected int bufferMode; - -} // end class ButtonRemoteListener diff --git a/src/vrpn/java_vrpn/vrpn/ChangeLog.txt b/src/vrpn/java_vrpn/vrpn/ChangeLog.txt deleted file mode 100644 index b4ee6e589989c2da83abca382d1b61486fe4927d..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/ChangeLog.txt +++ /dev/null @@ -1,48 +0,0 @@ -2010-06-24 David Marshburn <marshbur@cs.unc.edu - - * FunctionGeneratorRemote.java: fixed a copy-paste error - -2010-06-03 David Marshburn <marshbur@cs.unc.edu> - - * FunctionGeneratorRemote.java: corrected a bug in which - several of the listener-calling methods were using the - wrong list of listeners. - -2010-01-14 David Marshburn <marshbur@cs.unc.edu> - - * FunctionGeneratorRemote.java: added methods to add and - remove error listeners. made several of the inner classes - and interfaces static. - -2010-01-05 David Marshburn <marshbur@cs.unc.edu> - - * FunctionGeneratorRemote.java: added error listeners - and reporting. - -2009-12-29 David Marshburn <marshbur@cs.unc.edu> - - * FunctionGeneratorRemote.java: changed the return type - of the mutators from 'int' to 'boolean'. also, removed - some unneeded import statements. - -2009-05-18 David Marshburn <marshbur@cs.unc.edu> - - * VRPNDevice.java: made the native_device member a long - -2008-06-24 David Marshburn <marshbur@cs.unc.edu> - - * PoserRemote.java (requestPoseRelative): calls the correct - native method. - -2008-06-20 David Marshburn <marshbur@cs.unc.edu> - - * PoserRemote.java: added relative-pose methods. - -2007-10-19 David Marshburn <marshbur@cs.unc.edu> - - * AuxiliaryLoggerRemote.java: new. wrapping of logger class. - - -2007-06-15 David Marshburn <marshbur@cs.unc.edu> - * AnalogOutputRemote.java: removed an unused import. - diff --git a/src/vrpn/java_vrpn/vrpn/ForceDeviceRemote.java b/src/vrpn/java_vrpn/vrpn/ForceDeviceRemote.java deleted file mode 100644 index 7729c571d903a49d09f740b196728003353db1a9..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/ForceDeviceRemote.java +++ /dev/null @@ -1,512 +0,0 @@ -package vrpn; -import java.util.*; - - - -public class ForceDeviceRemote extends VRPNDevice implements Runnable -{ - - ////////////////// - // Public structures and interfaces - - public class ForceChange - { - public Date msg_time = new Date(); - public double force[] = new double[3]; - } - - public interface ForceChangeListener - { - public void forceUpdate( ForceChange f, ForceDeviceRemote forceDevice ); - } - - - // SCP is "Surface Contact Point" - public class SCPChange - { - public Date msg_time = new Date( ); - public double pos[] = new double[3]; - public double quat[] = new double[4]; - } - - public interface SCPChangeListener - { - public void scpUpdate( SCPChange s, ForceDeviceRemote forceDevice ); - } - - - public class ForceError - { - public Date msg_time = new Date( ); - int errorCode; - } - - public interface ForceErrorListener - { - public void forceError( ForceError a, ForceDeviceRemote forceDevice ); - } - - public static final int NO_CONSTRAINT = 0; - public static final int POINT_CONSTRAINT = 1; - public static final int LINE_CONSTRAINT = 2; - public static final int PLANE_CONSTRAINT = 3; - - // end of the public structures and interfaces - ////////////////////////////////// - - - //////////////////////////////// - // Public methods - // - - /** - * @exception java.lang.InstantiationException - * If the force device could not be created because of problems with - * its native code and linking. - */ - public ForceDeviceRemote( String name, String localInLogfileName, String localOutLogfileName, - String remoteInLogfileName, String remoteOutLogfileName ) - throws InstantiationException - { - super( name, localInLogfileName, localOutLogfileName, remoteInLogfileName, remoteOutLogfileName ); - } - - - public void sendSurface( ) - { - synchronized( downInVrpnLock ) - { - sendSurface_native( ); - } - } - - - public void startSurface( ) - { - synchronized( downInVrpnLock ) - { - startSurface_native( ); - } - } - - - public void stopSurface( ) - { - synchronized( downInVrpnLock ) - { - stopSurface_native( ); - } - } - - - public void setVertex( int number, float x, float y, float z ) - { - synchronized( downInVrpnLock ) - { - setVertex_native( number, x, y, z ); - } - } - - - public void setNormal( int number, float x, float y, float z ) - { - synchronized( downInVrpnLock ) - { - setNormal_native( number, x, y, z ); - } - } - - - public void setTriangle( int number, int vertex1, int vertex2, int vertex3, - int normal1, int normal2, int normal3 ) - { - synchronized( downInVrpnLock ) - { - setTriangle_native( number, vertex1, vertex2, vertex3, - normal1, normal2, normal3 ); - } - } - - - public void removeTriangle( int number ) - { - synchronized( downInVrpnLock ) - { - removeTriangle_native( number ); - } - } - - - public void updateTrimeshChanges( ) - { - synchronized( downInVrpnLock ) - { - updateTrimeshChanges_native( ); - } - } - - - public void setTrimeshTransform( float[] transform ) - { - synchronized( downInVrpnLock ) - { - setTrimeshTransform_native( transform ); - } - } - - - public void clearTrimesh( ) - { - synchronized( downInVrpnLock ) - { - clearTrimesh_native( ); - } - } - - - public void useHcollide( ) - { - synchronized( downInVrpnLock ) - { - useHcollide_native( ); - } - } - - - public void useGhost( ) - { - synchronized( downInVrpnLock ) - { - useGhost_native( ); - } - } - - - public boolean enableConstraint( int enable ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = enableConstraint_native( enable ); - } - return retval; - } - - - public boolean setConstraintMode( int mode ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = setConstraintMode_native( mode ); - } - return retval; - } - - - public boolean setConstraintPoint( float[] point ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = setConstraintPoint_native( point ); - } - return retval; - } - - - public boolean setConstraintLinePoint( float[] point ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = setConstraintLinePoint_native( point ); - } - return retval; - } - - - public boolean setConstraintLineDirection( float[] direction ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = setConstraintLineDirection_native( direction ); - } - return retval; - } - - - public boolean setConstraintPlanePoint( float[] point ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = setConstraintPlanePoint_native( point ); - } - return retval; - } - - - public boolean setConstraintPlaneNormal( float[] normal ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = setConstraintPlaneNormal_native( normal ); - } - return retval; - } - - - public boolean setConstraintKSpring( float k ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = setConstraintKSpring_native( k ); - } - return retval; - } - - - public boolean sendForceField( float[] origin, float[] force, float[][] jacobian, float radius ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = sendForceField_native( origin, force, jacobian, radius ); - } - return retval; - } - - - public boolean sendForceField( ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = sendForceField_native( ); - } - return retval; - } - - - public boolean stopForceField( ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = stopForceField_native( ); - } - return retval; - } - - - public synchronized void addForceChangeListener( ForceChangeListener listener ) - { - forceListeners.addElement( listener ); - } - - /** - * @return true on success; false on failure - */ - public synchronized boolean removeForceChangeListener( ForceChangeListener listener ) - { - return forceListeners.removeElement( listener ); - } - - - public synchronized void addSCPChangeListener( SCPChangeListener listener ) - { - scpListeners.addElement( listener ); - } - - /** - * @return true on success; false on failure - */ - public synchronized boolean removeSCPChangeListener( SCPChangeListener listener ) - { - return scpListeners.removeElement( listener ); - } - - - public synchronized void addForceErrorListener( ForceErrorListener listener ) - { - errorListeners.addElement( listener ); - } - - /** - * @return true on success; false on failure - */ - public synchronized boolean removeForceErrorListener( ForceErrorListener listener ) - { - return errorListeners.removeElement( listener ); - } - - // end public methods - //////////////////////// - - - //////////////////////// - // Protected methods - // - - protected native void sendSurface_native( ); - protected native void startSurface_native( ); - protected native void stopSurface_native( ); - - protected native void setVertex_native( int number, float x, float y, float z ); - protected native void setNormal_native( int number, float x, float y, float z ); - protected native void setTriangle_native( int number, int vertex1, int vertex2, int vertex3, - int normal1, int normal2, int normal3 ); - protected native void removeTriangle_native( int number ); - protected native void updateTrimeshChanges_native( ); - protected native void setTrimeshTransform_native( float[] transform ); - protected native void clearTrimesh_native( ); - - protected native void useHcollide_native( ); - protected native void useGhost_native( ); - - protected native boolean enableConstraint_native( int enable ); - protected native boolean setConstraintMode_native( int mode ); - protected native boolean setConstraintPoint_native( float[] point ); - protected native boolean setConstraintLinePoint_native( float[] point ); - protected native boolean setConstraintLineDirection_native( float[] direction ); - protected native boolean setConstraintPlanePoint_native( float[] point ); - protected native boolean setConstraintPlaneNormal_native( float[] normal ); - protected native boolean setConstraintKSpring_native( float k ); - - protected native boolean sendForceField_native( float[] origin, float[] force, float[][] jacobian, float radius ); - protected native boolean sendForceField_native( ); - protected native boolean stopForceField_native( ); - - - /** - * Stops the force device thread - */ - protected void stoppedRunning( ) - { - forceListeners.removeAllElements( ); - scpListeners.removeAllElements( ); - errorListeners.removeAllElements( ); - synchronized( downInVrpnLock ) - { - this.shutdownForceDevice( ); - } - } - - - /** - * Should be called only by mainloop(), a native method which is itself - * synchronized. By extension, this method is synchronized (in that, for - * a given ForceDeviceRemote object, this method can only be called from one - * thread at a time). - */ - protected void handleForceChange( long tv_sec, long tv_usec, - double x, double y, double z ) - { - // putting the body of this function into a synchronized block prevents - // other instances of ForceDeviceRemote from calling listeners' forceUpdate - // method concurrently. - synchronized( notifyingForceListenersLock ) - { - ForceChange f = new ForceChange(); - f.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - f.force[0] = x; f.force[1] = y; f.force[2] = z; - - // notify all listeners - Enumeration e = forceListeners.elements( ); - while( e.hasMoreElements( ) ) - { - ForceChangeListener l = (ForceChangeListener) e.nextElement( ); - l.forceUpdate( f, this ); - } - } // end synchronized( notifyingForceListenersLock ) - } // end method handleForceChange - - - /** - * @see #handleForceChange - */ - protected void handleSCPChange( long tv_sec, long tv_usec, - double x, double y, double z, - double quat0, double quat1, double quat2, double quat3 ) - { - synchronized( notifyingSCPListenersLock ) - { - SCPChange s = new SCPChange(); - s.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - s.pos[0] = x; s.pos[1] = y; s.pos[2] = z; - s.quat[0] = quat0; s.quat[1] = quat1; s.quat[2] = quat2; - s.quat[3] = quat3; - - // notify all listeners - Enumeration e = scpListeners.elements( ); - while( e.hasMoreElements( ) ) - { - SCPChangeListener l = (SCPChangeListener) e.nextElement( ); - l.scpUpdate( s, this ); - } - } // end synchronized( notifyingSCPListenersLock ) - } // end method handleSCPChange - - - /** - * @see #handleForceChange - */ - protected void handleForceError( long tv_sec, long tv_usec, int errorCode ) - { - synchronized( notifyingErrorListenersLock ) - { - ForceError u = new ForceError(); - u.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - u.errorCode = errorCode; - - // notify all listeners - Enumeration e = errorListeners.elements( ); - while( e.hasMoreElements( ) ) - { - ForceErrorListener l = (ForceErrorListener) e.nextElement( ); - l.forceError( u, this ); - } - } // end synchronized( notifyingAccelerationListenersLock ) - } // end method handleErrorChange - - - /** - * Initialize the native force device object - * @param name The name of the force device and host (e.g., <code>"Phantom0@myhost.edu"</code>). - * @return <code>true</code> if the force device was connected successfully, - * <code>false</code> otherwise. - */ - protected native boolean init( String name, String localInLogfileName, - String localOutLogfileName, String remoteInLogfileName, - String remoteOutLogfileName ); - - /** - * This should only be called from the method finalize() - */ - protected native void shutdownForceDevice( ); - - protected native void mainloop( ); - - // end protected methods - /////////////////////// - - /////////////////// - // data members - - protected Vector forceListeners = new Vector( ); - protected Vector scpListeners = new Vector( ); - protected Vector errorListeners = new Vector( ); - - /** - * @see vrpn.TrackerRemote#notifyingChangeListenersLock - */ - protected final static Object notifyingForceListenersLock = new Object( ); - protected final static Object notifyingSCPListenersLock = new Object( ); - protected final static Object notifyingErrorListenersLock = new Object( ); - - -} diff --git a/src/vrpn/java_vrpn/vrpn/ForceDeviceRemoteListener.java b/src/vrpn/java_vrpn/vrpn/ForceDeviceRemoteListener.java deleted file mode 100644 index dfdf14c1ff6e484a422b0c2e2bfb82d3928a0fcd..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/ForceDeviceRemoteListener.java +++ /dev/null @@ -1,382 +0,0 @@ -/*************************************************************************** - * Use this class to store ForceChanges, ForceErrors and SCPChanges in a - * vector and get them when you want. It is most useful if you don't want - * to worry about your code running in a multi-threaded environment and - * about vrpn possibly delivering device updates at arbitrary times. - * - * The Listener can be configured to buffer and return either all - * updates or only the last (the most recent) update. Force messages, - * SCP messages and force-error messages are buffered independently. - * By default, the Listener keeps only the last update of each. - * - * It is not intended that Listeners be shared among objects. Each - * entity in a program that is interested in hearing about updates - * from some vrpn Force device (and which wishes to use this Listener - * mechanism) should create its own listener (even if multiple entities - * wish to hear from the same device). - ***************************************************************************/ - -package vrpn; -import java.util.Vector; - -public class ForceDeviceRemoteListener - implements ForceDeviceRemote.ForceChangeListener, - ForceDeviceRemote.ForceErrorListener, - ForceDeviceRemote.SCPChangeListener -{ - public static final int ALL_UPDATES = 0; - public static final int LAST_UPDATE = 1; - - - public ForceDeviceRemoteListener(ForceDeviceRemote force) - { - forceUpdates = new Vector(); - errorUpdates = new Vector(); - scpUpdates = new Vector(); - - forceBufferMode = LAST_UPDATE; - errorBufferMode = LAST_UPDATE; - scpBufferMode = LAST_UPDATE; - - force.addForceChangeListener(this); - force.addForceErrorListener(this); - force.addSCPChangeListener(this); - } - - - /** - * Sets the buffering mode of the Listener to record and return only - * the most recent (the last, the latest) ForceChange. - */ - public synchronized void setModeLastForceUpdate() - { - forceBufferMode = LAST_UPDATE; - if (!forceUpdates.isEmpty()) - { - Object temp = forceUpdates.lastElement(); - forceUpdates.removeAllElements(); - forceUpdates.addElement(temp); - } - } - - - /** - * Sets the buffering mode of the Listener to record and return only - * the most recent (the last, the latest) ForceError. - */ - public synchronized void setModeLastForceErrorUpdate() - { - errorBufferMode = LAST_UPDATE; - if (!errorUpdates.isEmpty()) - { - Object temp = errorUpdates.lastElement(); - errorUpdates.removeAllElements(); - errorUpdates.addElement(temp); - } - } - - - /** - * Sets the buffering mode of the Listener to record and return only - * the most recent (the last, the latest) SCPChange. - */ - public synchronized void setModeLastSCPUpdate() - { - scpBufferMode = LAST_UPDATE; - if (!scpUpdates.isEmpty()) - { - Object temp = scpUpdates.lastElement(); - scpUpdates.removeAllElements(); - scpUpdates.addElement(temp); - } - } - - - /** - * Sets the buffering mode of the Listener to record and return all - * ForceChanges, beginning at the time this mode is first enabled. - */ - public synchronized void setModeAllForceUpdates() - { - if( forceBufferMode == LAST_UPDATE ) - { - forceUpdates.removeAllElements( ); - } - forceBufferMode = ALL_UPDATES; - } - - - /** - * Sets the buffering mode of the Listener to record and return all - * ForceErrors, beginning at the time this mode is first enabled. - */ - public synchronized void setModeAllForceErrorUpdates() - { - if( errorBufferMode == LAST_UPDATE ) - { - errorUpdates.removeAllElements( ); - } - errorBufferMode = ALL_UPDATES; - } - - - /** - * Sets the buffering mode of the Listener to record and return all - * SCPChanges, beginning at the time this mode is first enabled. - */ - public synchronized void setModeAllSCPUpdates() - { - if( forceBufferMode == LAST_UPDATE ) - { - scpUpdates.removeAllElements( ); - } - scpBufferMode = ALL_UPDATES; - } - - - /** - * @return ForceDeviceRemoteListener.ALL_UPDATES if the Listener is recording and - * returning all ForceChanges; ForceDeviceRemoteListener.LAST_UPDATE if only the - * latest ForceChanges. - */ - public synchronized int getModeForceUpdate() - { - return forceBufferMode; - } - - - /** - * @return ForceDeviceRemoteListener.ALL_UPDATES if the Listener is recording and - * returning all ForceErrors; ForceDeviceRemoteListener.LAST_UPDATE if only the - * latest ForceErrors. - */ - public synchronized int getModeForceErrorUpdate() - { - return errorBufferMode; - } - - - /** - * @return ForceDeviceRemoteListener.ALL_UPDATES if the Listener is recording and - * returning all SCPUpdates; ForceDeviceRemoteListener.LAST_UPDATE if only the - * latest SCPUpdates. - */ - public synchronized int getModeSCPUpdate() - { - return scpBufferMode; - } - - - /** - * This method retreives the buffered ForceChanges from the Listener. - * If the buffering mode is LAST_UPDATE, the last update received will - * be returned (note that, in this mode, successive calls to getForceUpdate() - * may return the same ForceChange if no new changes were received in the - * interim). If the buffering mode is ALL_UPDATES, all changes - * received since the last call to getForceUpdate() (or since ALL_UPDATES - * mode was enabled) will be returned. - * @return A Vector containing the buffered ForceChanges. The number of - * ForceChanges returned will depend on the buffering mode. If there are - * no ForceChanges buffered, an empty Vector will be returned. - * @see #setModeLastForceUpdate - * @see #setModeAllForceUpdates - */ - public synchronized Vector getForceUpdate() - { - Vector v = new Vector( ); - if( forceUpdates.isEmpty() ) - { - return v; - } - - if( forceBufferMode == LAST_UPDATE ) - { - v.addElement( forceUpdates.lastElement() ); - } - else if( forceBufferMode == ALL_UPDATES ) - { - for( int i = 0; i < forceUpdates.size(); i++ ) - { - v.addElement( forceUpdates.elementAt(i) ); - } - forceUpdates.removeAllElements(); - } - return v; - } // end method getForceUpdate() - - - /** - * This method retreives the buffered ForceErrors from the Listener. - * If the buffering mode is LAST_UPDATE, the last update received will - * be returned (note that, in this mode, successive calls to getForceErrorUpdate() - * may return the same ForceError if no new changes were received in the - * interim). If the buffering mode is ALL_UPDATES, all changes - * received since the last call to getForceErrorUpdate() (or since ALL_UPDATES - * mode was enabled) will be returned. - * @return A Vector containing the buffered ForceErrors. The number of - * ForceErrors returned will depend on the buffering mode. If there are - * no ForceErrors buffered, an empty Vector will be returned. - * @see #setModeLastForceErrorUpdate - * @see #setModeAllForceErrorUpdates - */ - public synchronized Vector getForceErrorUpdate() - { - Vector v = new Vector( ); - if( errorUpdates.isEmpty() ) - { - return v; - } - - if( errorBufferMode == LAST_UPDATE ) - { - v.addElement( errorUpdates.lastElement() ); - } - else if( errorBufferMode == ALL_UPDATES ) - { - for( int i = 0; i < errorUpdates.size(); i++ ) - { - v.addElement( errorUpdates.elementAt(i) ); - } - errorUpdates.removeAllElements(); - } - return v; - } // end method getForceErrorUpdate() - - - /** - * This method retreives the buffered SCPChanges from the Listener. - * If the buffering mode is LAST_UPDATE, the last update received will - * be returned (note that, in this mode, successive calls to getSCPUpdate() - * may return the same SCPChange if no new changes were received in the - * interim). If the buffering mode is ALL_UPDATES, all changes - * received since the last call to getSCPUpdate() (or since ALL_UPDATES - * mode was enabled) will be returned. - * @return A Vector containing the buffered SCPChanges. The number of - * SCPChanges returned will depend on the buffering mode. If there are - * no SCPChanges buffered, an empty Vector will be returned. - * @see #setModeLastSCPUpdate - * @see #setModeAllSCPUpdates - */ - public synchronized Vector getSCPUpdate() - { - Vector v = new Vector( ); - if( scpUpdates.isEmpty() ) - { - return v; - } - - if( scpBufferMode == LAST_UPDATE ) - { - v.addElement( scpUpdates.lastElement() ); - } - else if( errorBufferMode == ALL_UPDATES ) - { - for( int i = 0; i < scpUpdates.size(); i++ ) - { - v.addElement( scpUpdates.elementAt(i) ); - } - scpUpdates.removeAllElements(); - } - return v; - } // end method getForceErrorUpdate() - - - /** - * @return The last (most recent, latest) ForceChange received. This function - * returns <code>null</code> if no updates have been received. Note that - * successive calls to getLastForceUpdate() may return the same ForceChange - * if no updates were received in the interim. - */ - public synchronized ForceDeviceRemote.ForceChange getLastForceUpdate() - { - if( forceUpdates.isEmpty( ) ) - return null; - - return (ForceDeviceRemote.ForceChange) forceUpdates.lastElement(); - } - - - /** - * @return The last (most recent, latest) ForceError received. This function - * returns <code>null</code> if no updates have been received. Note that - * successive calls to getLastErrorUpdate() may return the same ForceError - * if no updates were received in the interim. - */ - public synchronized ForceDeviceRemote.ForceError getLastErrorUpdate() - { - if( errorUpdates.isEmpty( ) ) - return null; - - return (ForceDeviceRemote.ForceError) errorUpdates.lastElement(); - } - - - /** - * @return The last (most recent, latest) SCPChange received. This function - * returns <code>null</code> if no updates have been received. Note that - * successive calls to getLastSCPUpdate() may return the same SCPChange - * if no updates were received in the interim. - */ - public synchronized ForceDeviceRemote.SCPChange getLastSCPUpdate() - { - if( scpUpdates.isEmpty( ) ) - return null; - - return (ForceDeviceRemote.SCPChange) scpUpdates.lastElement(); - } - - - /** - * This is the handler that the ForceDeviceRemote instance will call to deliver - * force change messages. This method is not intended to be called by user code. - */ - public synchronized void forceUpdate (ForceDeviceRemote.ForceChange f, ForceDeviceRemote force) - { - if( forceBufferMode == LAST_UPDATE ) - { - forceUpdates.removeAllElements(); - } - - forceUpdates.addElement(f); - } - - - /** - * This is the handler that the ForceDeviceRemote instance will call to deliver - * force error messages. This method is not intended to be called by user code. - */ - public synchronized void forceError (ForceDeviceRemote.ForceError e, ForceDeviceRemote force) - { - if( errorBufferMode == LAST_UPDATE ) - { - errorUpdates.removeAllElements(); - } - - errorUpdates.addElement(e); - } - - - /** - * This is the handler that the ForceDeviceRemote instance will call to deliver - * SCP change messages. This method is not intended to be called by user code. - */ - public synchronized void scpUpdate (ForceDeviceRemote.SCPChange s, ForceDeviceRemote force ) - { - if( scpBufferMode == LAST_UPDATE ) - { - scpUpdates.removeAllElements(); - } - - scpUpdates.addElement(s); - } - - - protected Vector forceUpdates; - protected Vector errorUpdates; - protected Vector scpUpdates; - - protected int forceBufferMode; - protected int errorBufferMode; - protected int scpBufferMode; - -} // end class ForceDeviceRemoteListener diff --git a/src/vrpn/java_vrpn/vrpn/FunctionGeneratorRemote.java b/src/vrpn/java_vrpn/vrpn/FunctionGeneratorRemote.java deleted file mode 100644 index d0bf2aca30a01d45cda852204dd2a3b523ab3054..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/FunctionGeneratorRemote.java +++ /dev/null @@ -1,520 +0,0 @@ -package vrpn; -import java.util.*; - - -public class FunctionGeneratorRemote extends VRPNDevice implements Runnable -{ - ////////////////// - // Public structures and interfaces - - public static interface Function { } - - public static class Function_NULL implements Function { } - - public static class Function_script implements Function - { - public String script = ""; - public Function_script( String script ) { this.script = script; } - } - - public static class Channel - { - public Function function = new Function_NULL(); - - public Channel( Function f ) - { - this.function = f; - } - public Channel() {} - } - - public class ChannelReply - { - public Date msg_time = new Date(); - public int channelNumber = 0; - public Channel channel = new Channel(); - } - - public interface ChannelReplyListener - { - public void fgChannelReply( ChannelReply r, FunctionGeneratorRemote fg ); - } - - public class StartReply - { - public Date msg_time = new Date(); - public boolean isStarted = false; - } - - public class StopReply - { - public Date msg_time = new Date(); - public boolean isStopped = false; - } - - public interface StartStopReplyListener - { - public void fgStartReply( StartReply r, FunctionGeneratorRemote fg ); - public void fgStopReply( StopReply r, FunctionGeneratorRemote fg ); - } - - public class SampleRateReply - { - public Date msg_time = new Date(); - public double sampleRate = 0; - } - - public interface SampleRateReplyListener - { - public void fgSampleRateReply( SampleRateReply r, FunctionGeneratorRemote fg ); - } - - public class InterpreterReply - { - public Date msg_time = new Date(); - public String description = ""; - } - - public interface InterpreterReplyListener - { - public void fgInterpreterReply( InterpreterReply r, FunctionGeneratorRemote fg ); - } - - public enum FGError - { - NO_FG_ERROR (0), - INTERPRETER_ERROR (1), - TAKING_TOO_LONG (2), - INVALID_RESULT_QUANTITY (3), - INVALID_RESULT_RANGE (4), - - UNKNOWN_ERROR (9999); - - private final int errorCode; - private FGError( int err ) { this.errorCode = err; } - public static FGError getErrorFromCode( int err ) - { - for( FGError fgerror : FGError.values() ) - { - if( err == fgerror.errorCode ) - return fgerror; - } - return UNKNOWN_ERROR; - } - } - - public class ErrorReply - { - public Date msg_time = new Date(); - public FGError error; - public int channel; - } - - public interface ErrorListener - { - public void fgErrorReply( ErrorReply r, FunctionGeneratorRemote fg ); - } - - // end of the public structures and interfaces - ////////////////////////////////// - - - //////////////////////////////// - // Public methods - // - - /** - * @exception java.lang.InstantiationException - * If the function generator could not be created because of problems with - * its native code and linking. - */ - public FunctionGeneratorRemote( String name, String localInLogfileName, String localOutLogfileName, - String remoteInLogfileName, String remoteOutLogfileName ) - throws InstantiationException - { - super( name, localInLogfileName, localOutLogfileName, remoteInLogfileName, remoteOutLogfileName ); - } - - - public boolean setChannel( int channelNumber, Channel c ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - if( c.function instanceof Function_NULL ) - retval = setChannelNULL_native( channelNumber ); - else if( c.function instanceof Function_script ) - retval = setChannelScript_native( channelNumber, ((Function_script)c.function).script ); - } - return retval; - } - - - public boolean requestChannel( int channelNumber ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = requestChannel_native( channelNumber ); - } - return retval; - } - - - public boolean requestAllChannels( ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = requestAllChannels_native( ); - } - return retval; - } - - - public boolean requestStart( ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = requestStart_native( ); - } - return retval; - } - - - public boolean requestStop( ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = requestStop_native( ); - } - return retval; - } - - - public boolean requestSampleRate( float rate ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = requestSampleRate_native( rate ); - } - return retval; - } - - - public boolean requestInterpreterDescription( ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = requestInterpreterDescription_native( ); - } - return retval; - } - - - public synchronized void addChannelReplyListener( ChannelReplyListener listener ) - { - channelListeners.addElement( listener ); - } - - - public synchronized boolean removeChannelReplyListener( ChannelReplyListener listener ) - { - return channelListeners.removeElement( listener ); - } - - - public synchronized void addStartStopReplyListener( StartStopReplyListener listener ) - { - startStopListeners.addElement( listener ); - } - - - public synchronized boolean removeStartStopReplyListener( StartStopReplyListener listener ) - { - return startStopListeners.removeElement( listener ); - } - - - public synchronized void addSampleRateReplyListener( SampleRateReplyListener listener ) - { - sampleRateListeners.addElement( listener ); - } - - - public synchronized boolean removeSampleRateReplyListener( SampleRateReplyListener listener ) - { - return sampleRateListeners.removeElement( listener ); - } - - - public synchronized void addInterpreterReplyListener( InterpreterReplyListener listener ) - { - interpreterListeners.addElement( listener ); - } - - - public synchronized boolean removeInterpreterReplyListener( InterpreterReplyListener listener ) - { - return interpreterListeners.removeElement( listener ); - } - - - public synchronized void addErrorListener( ErrorListener listener ) - { - errorListeners.addElement( listener ); - } - - - public synchronized boolean removeErrorListener( ErrorListener listener ) - { - return errorListeners.removeElement( listener ); - } - - - // end public methods - //////////////////////// - - - - //////////////////////// - // Protected methods - // - - protected native boolean setChannelNULL_native( int channelNumber ); - protected native boolean setChannelScript_native( int channelNumber, String script ); - protected native boolean requestChannel_native( int channelNumber ); - protected native boolean requestAllChannels_native( ); - protected native boolean requestStart_native( ); - protected native boolean requestStop_native( ); - protected native boolean requestSampleRate_native( float rate ); - protected native boolean requestInterpreterDescription_native( ); - - - protected void stoppedRunning() - { - // remove all listeners - channelListeners.removeAllElements(); - startStopListeners.removeAllElements(); - sampleRateListeners.removeAllElements(); - interpreterListeners.removeAllElements(); - errorListeners.removeAllElements(); - - // shut down the native object - synchronized( downInVrpnLock ) - { - this.shutdownFunctionGenerator( ); - } - } - - - /** - * Should be called only by mainloop(), a native method which is itself - * synchronized. By extension, this method is synchronized (in that, for - * a given FunctionGeneratorRemote object, this method can only be called from one - * thread at a time). - */ - protected void handleChannelChange_NULL( long tv_sec, long tv_usec, int channelNumber ) - { - // putting the body of this function into a synchronized block prevents - // other instances of FunctionGeneratorRemote from calling listeners' fgChannelReply - // method concurrently. - synchronized( notifyingChannelListenersLock ) - { - ChannelReply c = new ChannelReply(); - c.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - c.channelNumber = channelNumber; - c.channel = new Channel(); - - // notify all listeners - Enumeration e = channelListeners.elements( ); - while( e.hasMoreElements( ) ) - { - ChannelReplyListener l = (ChannelReplyListener) e.nextElement( ); - l.fgChannelReply( c, this ); - } - } - } // end method handleChannelChange - - - protected void handleChannelChange_Script( long tv_sec, long tv_usec, int channelNumber, - String script ) - { - // putting the body of this function into a synchronized block prevents - // other instances of FunctionGeneratorRemote from calling listeners' fgChannelReply - // method concurrently. - synchronized( notifyingChannelListenersLock ) - { - ChannelReply c = new ChannelReply(); - c.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - c.channelNumber = channelNumber; - c.channel = new Channel(); - c.channel.function = new Function_script( script ); - - // notify all listeners - Enumeration e = channelListeners.elements( ); - while( e.hasMoreElements( ) ) - { - ChannelReplyListener l = (ChannelReplyListener) e.nextElement( ); - l.fgChannelReply( c, this ); - } - } - } // end method handleChannelChange - - - protected void handleStartReply( long tv_sec, long tv_usec, boolean isStarted ) - { - // putting the body of this function into a synchronized block prevents - // other instances of FunctionGeneratorRemote from calling listeners' fgStartReply - // method concurrently. - synchronized( notifyingStartStopListenersLock ) - { - StartReply s = new StartReply(); - s.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - s.isStarted = isStarted; - - // notify all listeners - Enumeration e = startStopListeners.elements( ); - while( e.hasMoreElements( ) ) - { - StartStopReplyListener l = (StartStopReplyListener) e.nextElement( ); - l.fgStartReply( s, this ); - } - } - } - - - protected void handleStopReply( long tv_sec, long tv_usec, boolean isStopped ) - { - // putting the body of this function into a synchronized block prevents - // other instances of FunctionGeneratorRemote from calling listeners' fgStopReply - // method concurrently. - synchronized( notifyingStartStopListenersLock ) - { - StopReply s = new StopReply(); - s.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - s.isStopped = isStopped; - - // notify all listeners - Enumeration e = startStopListeners.elements( ); - while( e.hasMoreElements( ) ) - { - StartStopReplyListener l = (StartStopReplyListener) e.nextElement( ); - l.fgStopReply( s, this ); - } - } - } - - - protected void handleSampleRateReply( long tv_sec, long tv_usec, double rate ) - { - // putting the body of this function into a synchronized block prevents - // other instances of FunctionGeneratorRemote from calling listeners' fgSampleRateReply - // method concurrently. - synchronized( notifyingSampleRateListenersLock ) - { - SampleRateReply s = new SampleRateReply(); - s.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - s.sampleRate = rate; - - // notify all listeners - Enumeration e = sampleRateListeners.elements( ); - while( e.hasMoreElements( ) ) - { - SampleRateReplyListener l = (SampleRateReplyListener) e.nextElement( ); - l.fgSampleRateReply( s, this ); - } - } - } - - - protected void handleInterpreterDescription( long tv_sec, long tv_usec, String desc ) - { - // putting the body of this function into a synchronized block prevents - // other instances of FunctionGeneratorRemote from calling listeners' forceUpdate - // method concurrently. - synchronized( notifyingInterpreterListenersLock ) - { - InterpreterReply r = new InterpreterReply(); - r.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - r.description = desc; - - // notify all listeners - Enumeration e = interpreterListeners.elements( ); - while( e.hasMoreElements( ) ) - { - InterpreterReplyListener l = (InterpreterReplyListener) e.nextElement( ); - l.fgInterpreterReply( r, this ); - } - } - } - - - protected void handleErrorReport( long tv_sec, long tv_usec, int err, int channel ) - { - // putting the body of this function into a synchronized block prevents - // other instances of FunctionGeneratorRemote from calling listeners' fgErrorReply - // method concurrently. - synchronized( notifyingErrorListenersLock ) - { - ErrorReply r = new ErrorReply(); - r.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - r.error = FGError.getErrorFromCode( err ); - r.channel = channel; - - // notify all listeners - Enumeration e = errorListeners.elements( ); - while( e.hasMoreElements( ) ) - { - ErrorListener l = (ErrorListener) e.nextElement( ); - l.fgErrorReply( r, this ); - } - } - } - - - /** - * Initialize the native function generator object - * @param name The name of the function generator and host (e.g., <code>"Phantom0@myhost.edu"</code>). - * @return <code>true</code> if the force device was connected successfully, - * <code>false</code> otherwise. - */ - protected native boolean init( String name, String localInLogfileName, - String localOutLogfileName, String remoteInLogfileName, - String remoteOutLogfileName ); - - /** - * This should only be called from the method finalize() - */ - protected native void shutdownFunctionGenerator( ); - - - protected native void mainloop( ); - - // end protected methods - /////////////////////// - - /////////////////// - // data members - - protected Vector channelListeners = new Vector(); - protected Vector startStopListeners = new Vector(); - protected Vector sampleRateListeners = new Vector(); - protected Vector interpreterListeners = new Vector(); - protected Vector errorListeners = new Vector(); - - /** - * @see vrpn.TrackerRemote#notifyingChangeListenersLock - */ - protected final static Object notifyingChannelListenersLock = new Object( ); - protected final static Object notifyingStartStopListenersLock = new Object( ); - protected final static Object notifyingSampleRateListenersLock = new Object( ); - protected final static Object notifyingInterpreterListenersLock = new Object( ); - protected final static Object notifyingErrorListenersLock = new Object( ); - - -} diff --git a/src/vrpn/java_vrpn/vrpn/PoserRemote.java b/src/vrpn/java_vrpn/vrpn/PoserRemote.java deleted file mode 100644 index e1da201bb4b4c7bcef02e78da50ae255d17cb8c0..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/PoserRemote.java +++ /dev/null @@ -1,188 +0,0 @@ - -package vrpn; -import java.util.*; - - -public class PoserRemote extends VRPNDevice implements Runnable -{ - - //////////////////////////////// - // Public methods - // - - /** - * @param name The name of the poser to connect to (e.g., Poser0@localhost) - * @param localInLogfileName The name of a logfile to save incoming messages. Use <code> - * null</code> if no such log is desired. - * @param localOutLogfileName The name of a logfile to save outgoing messages. Use <code> - * null</code> if no such log is desired. - * @param remoteInLogfileName The name of a logfile in which the server <code>name</code> - * should save incoming messages. Use <code>null</code> if no such log is desired. - * @param remoteOutLogfileName The name of a logfile in which the server <code>name</code> - * should save outgoing messages. Use <code>null</code> if no such log is desired. - * @exception java.lang.InstantiationException - * If the poser could not be created because of problems with - * its native code and linking. - */ - public PoserRemote( String name, String localInLogfileName, String localOutLogfileName, - String remoteInLogfileName, String remoteOutLogfileName ) - throws InstantiationException - { - super( name, localInLogfileName, localOutLogfileName, remoteInLogfileName, remoteOutLogfileName ); - } - - - public boolean requestPose( double[] position, double[] quaternion ) - { - return requestPose( new Date(), position, quaternion ); - } - - - public boolean requestPose( Date t, double[] position, double[] quaternion ) - { - boolean retval = false; - if( position.length != 3 || quaternion.length != 4 ) - return false; - long msecs = t.getTime( ); - long secs = msecs / 1000; - synchronized( downInVrpnLock ) - { - retval = requestPose_native( secs, ( msecs - secs * 1000 ) * 1000, position, quaternion ); - } - return retval; - } - - /** - * @param positionDelta new position = old position + positionDelta - * @param quaternion new orientation = quaternion * old orientation - * @return true if the request was successfully transmitted to the poser. - * false if there was some problems sending the request. - */ - public boolean requestPoseRelative( double[] positionDelta, double[] quaternion ) - { - return requestPoseRelative( new Date(), positionDelta, quaternion ); - } - - /** - * - * @param t the time at which this pose should be adopted - * @param positionDelta new position = old position + positionDelta - * @param quaternion new orientation = quaternion * old orientation - * @return true if the request was successfully transmitted to the poser. - * false if there was some problems sending the request. - */ - public boolean requestPoseRelative( Date t, double[] positionDelta, double[] quaternion ) - { - boolean retval = false; - if( positionDelta.length != 3 || quaternion.length != 4 ) - return false; - long msecs = t.getTime( ); - long secs = msecs / 1000; - synchronized( downInVrpnLock ) - { - retval = requestPoseRelative_native( secs, ( msecs - secs * 1000 ) * 1000, positionDelta, quaternion ); - } - return retval; - } - - - public boolean requestVelocity( double[] velocity, double[] quaternion, double interval ) - { - return requestVelocity( new Date(), velocity, quaternion, interval ); - } - - - public boolean requestVelocity( Date t, double[] velocity, double[] quaternion, double interval ) - { - boolean retval = false; - if( velocity.length != 3 || quaternion.length != 4 ) - return false; - long msecs = t.getTime( ); - long secs = msecs / 1000; - synchronized( downInVrpnLock ) - { - retval = requestVelocity_native( secs, ( msecs - secs * 1000 ) * 1000, velocity, quaternion, interval ); - } - return retval; - } - - /** - * @param velocityDelta new velocity = old velocity + velocityDelta - * @param quaternion new orientation = quaternion * old orientation - * @param intervalDelta new interval = old interval + intervalDelta - * @return true if the request was successfully transmitted to the poser. - * false if there was some problems sending the request. - */ - public boolean requestVelocityRelative( double[] velocityDelta, double[] quaternion, double intervalDelta ) - { - return requestVelocityRelative( new Date(), velocityDelta, quaternion, intervalDelta ); - } - - - /** - * @param t the time at which this velocity pose should be adopted. - * @param velocityDelta new velocity = old velocity + velocityDelta - * @param quaternion new orientation = quaternion * old orientation - * @param intervalDelta new interval = old interval + intervalDelta - * @return true if the request was successfully transmitted to the poser. - * false if there was some problems sending the request. - */ - public boolean requestVelocityRelative( Date t, double[] velocityDelta, double[] quaternion, double intervalDelta ) - { - boolean retval = false; - if( velocityDelta.length != 3 || quaternion.length != 4 ) - return false; - long msecs = t.getTime( ); - long secs = msecs / 1000; - synchronized( downInVrpnLock ) - { - retval = requestVelocityRelative_native( secs, ( msecs - secs * 1000 ) * 1000, velocityDelta, quaternion, intervalDelta ); - } - return retval; - } - - // end public methods - //////////////////////// - - - //////////////////////// - // Protected methods - // - - /** - * Stops the poser thread - */ - protected void stoppedRunning( ) - { - synchronized( downInVrpnLock ) - { - this.shutdownPoser( ); - } - } - - /** - * Initialize the native poser object - * @param name The name of the poser and host (e.g., <code>"Poser0@myhost.edu"</code>). - * @return <code>true</code> if the poser was connected successfully, - * <code>false</code> otherwise. - */ - protected native boolean init( String name, String localInLogfileName, - String localOutLogfileName, String remoteInLogfileName, - String remoteOutLogfileName ); - - /** - * This should only be called from the method finalize() - */ - protected native void shutdownPoser( ); - - protected native void mainloop( ); - protected native boolean requestPose_native( long secs, long usecs, double[] position, double[] quaternion ); - protected native boolean requestPoseRelative_native( long secs, long usecs, double[] position_delta, double[] quaternion ); - protected native boolean requestVelocity_native( long secs, long usecs, double[] position, double[] quaternion, double interval); - protected native boolean requestVelocityRelative_native( long secs, long usecs, double[] velocity_delta, double[] quaternion, double interval_delta ); - - // end protected methods - /////////////////////// - - -} diff --git a/src/vrpn/java_vrpn/vrpn/TextReceiver.java b/src/vrpn/java_vrpn/vrpn/TextReceiver.java deleted file mode 100644 index cd7b552486f5c27f9af21669a93f9b15d963fa75..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/TextReceiver.java +++ /dev/null @@ -1,116 +0,0 @@ -package vrpn; - -import java.util.*; - -public class TextReceiver extends VRPNDevice implements Runnable -{ - //////////////////////////// - // public structures and interfaces - - public class TextMessage - { - public Date msg_time = new Date(); - public String msg = ""; - public int type = vrpn_TEXT_NORMAL; - public int level = 0; - } - - public interface TextMessageListener - { - public void receiveTextMessage( TextMessage t, TextReceiver r ); - } - - // end public structures and interfaces - ///////////////////////////// - - ///////////////////////////// - // public methods - - public TextReceiver( String name, String localInLogfileName, String localOutLogfileName, - String remoteInLogfileName, String remoteOutLogfileName ) - throws InstantiationException - { - super( name, localInLogfileName, localOutLogfileName, remoteInLogfileName, remoteOutLogfileName ); - } - - - public synchronized void addTextListener( TextMessageListener listener ) - { - textListeners.addElement( listener ); - } - - - public synchronized boolean removeTextListener( TextMessageListener listener ) - { - return textListeners.removeElement( listener ); - } - - // end public methods - ////////////////// - - - ////////////////// - // protected methods - - protected void stoppedRunning( ) - { - textListeners.removeAllElements( ); - synchronized( downInVrpnLock ) - { - this.shutdownTextReceiver( ); - } - } - - - protected void handleTextMessage( long tv_sec, long tv_usec, - int type, int level, String msg ) - { - synchronized( notifyingListenersLock ) - { - TextMessage t = new TextMessage( ); - t.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - t.type = type; - t.level = level; - t.msg = msg; - - Enumeration e = textListeners.elements(); - while( e.hasMoreElements() ) - { - TextMessageListener l = (TextMessageListener) e.nextElement(); - l.receiveTextMessage( t, this ); - } - } - } // end method handleTextMessage - - - protected native void shutdownTextReceiver( ); - - - /** - * This should only be called from the method run() - */ - protected native void mainloop( ); - - - /** - * Initialize the native text receiver object - * @param name The name of the text sender and host (e.g., <code>"Messages0@myhost.edu"</code>). - * @return <code>true</code> if the tracker was connected successfully, - * <code>false</code> otherwise. - */ - protected native boolean init( String name, String localInLogfileName, - String localOutLogfileName, String remoteInLogfileName, - String remoteOutLogfileName ); - - - // end protected methods - //////////////////// - - - ///////////////// - // data members - - protected Vector textListeners = new Vector(); - protected final static Object notifyingListenersLock = new Object(); - -} diff --git a/src/vrpn/java_vrpn/vrpn/TextSender.java b/src/vrpn/java_vrpn/vrpn/TextSender.java deleted file mode 100644 index b7d64bdd3da5609411d4fb09ed7df878f100149b..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/TextSender.java +++ /dev/null @@ -1,81 +0,0 @@ -package vrpn; - -import java.util.*; - -public class TextSender extends VRPNDevice implements Runnable -{ - - ///////////////////////////// - // public methods - - // NOTE: because TextSender is technically a server, the logfile-name specifications - // will do nothing. - public TextSender( String name, String localInLogfileName, String localOutLogfileName, - String remoteInLogfileName, String remoteOutLogfileName ) - throws InstantiationException - { - super( name, localInLogfileName, localOutLogfileName, remoteInLogfileName, remoteOutLogfileName ); - } - - - public boolean sendMessage( String msg, int type, int level, Date time ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = this.sendMessage_native( msg, type, level, time.getTime() ); - } - return retval; - } - - // sends the specified message with 'normal' severity, 0-level and - // the current time. - public boolean sendMessage( String msg ) - { - return sendMessage( msg, vrpn_TEXT_NORMAL, 0, vrpn_TEXT_NOW ); - } - - - // end public methods - ////////////////// - - - ////////////////// - // protected methods - - protected void stoppedRunning( ) - { - synchronized( downInVrpnLock ) - { - this.shutdownTextSender( ); - } - } - - - protected native void shutdownTextSender( ); - - - /** - * This should only be called from the method run() - */ - protected native void mainloop( ); - - - /** - * Initialize the native text receiver object - * @param name The name of the text sender and host (e.g., <code>"Messages0@myhost.edu"</code>). - * @return <code>true</code> if the tracker was connected successfully, - * <code>false</code> otherwise. - */ - protected native boolean init( String name, String localInLogfileName, - String localOutLogfileName, String remoteInLogfileName, - String remoteOutLogfileName ); - - protected native boolean sendMessage_native( String msg, int type, int level, long time ); - - // end protected methods - //////////////////// - - - -} diff --git a/src/vrpn/java_vrpn/vrpn/TrackerRemote.java b/src/vrpn/java_vrpn/vrpn/TrackerRemote.java deleted file mode 100644 index f20506976f3e699f47286a9e2e34b0a4a2116ba7..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/TrackerRemote.java +++ /dev/null @@ -1,289 +0,0 @@ - -package vrpn; -import java.util.*; - - -public class TrackerRemote extends VRPNDevice implements Runnable -{ - ////////////////// - // Public structures and interfaces - - public class TrackerUpdate - { - public Date msg_time = new Date(); - public int sensor = -1; - public double pos[] = new double[3]; - public double quat[] = new double[4]; - } - - public interface PositionChangeListener - { - public void trackerPositionUpdate( TrackerUpdate u, TrackerRemote tracker ); - } - - - public class VelocityUpdate - { - public Date msg_time = new Date( ); - public int sensor = -1; - public double vel[] = new double[3]; - public double vel_quat[] = new double[4]; - public double vel_quat_dt = 0; - } - - public interface VelocityChangeListener - { - public void trackerVelocityUpdate( VelocityUpdate v, TrackerRemote tracker ); - } - - - public class AccelerationUpdate - { - public Date msg_time = new Date( ); - public int sensor = -1; - public double acc[] = new double[3]; - public double acc_quat[] = new double[4]; - public double acc_quat_dt = 0; - } - - public interface AccelerationChangeListener - { - public void trackerAccelerationUpdate( AccelerationUpdate a, TrackerRemote tracker ); - } - - // end of the public structures and interfaces - ////////////////////////////////// - - - //////////////////////////////// - // Public methods - // - - /** - * @param name The name of the tracker to connect to (e.g., Tracker0@localhost) - * @param localInLogfileName The name of a logfile to save incoming messages. Use <code> - * null</code> if no such log is desired. - * @param localOutLogfileName The name of a logfile to save outgoing messages. Use <code> - * null</code> if no such log is desired. - * @param remoteInLogfileName The name of a logfile in which the server <code>name</code> - * should save incoming messages. Use <code>null</code> if no such log is desired. - * @param remoteOutLogfileName The name of a logfile in which the server <code>name</code> - * should save outgoing messages. Use <code>null</code> if no such log is desired. - * @exception java.lang.InstantiationException - * If the tracker could not be created because of problems with - * its native code and linking. - */ - public TrackerRemote( String name, String localInLogfileName, String localOutLogfileName, - String remoteInLogfileName, String remoteOutLogfileName ) - throws InstantiationException - { - super( name, localInLogfileName, localOutLogfileName, remoteInLogfileName, remoteOutLogfileName ); - } - - - /** - * @return 0 on success; non-zero on failure - */ - public synchronized native int setUpdateRate( double samplesPerSecond ); - - - public synchronized void addPositionChangeListener( PositionChangeListener listener ) - { - changeListeners.addElement( listener ); - } - - - /** - * @return true on success; false on failure - */ - public synchronized boolean removePositionChangeListener( PositionChangeListener listener ) - { - return changeListeners.removeElement( listener ); - } - - - public synchronized void addVelocityChangeListener( VelocityChangeListener listener ) - { - velocityListeners.addElement( listener ); - } - - - /** - * @return true on success; false on failure - */ - public synchronized boolean removeVelocityChangeListener( VelocityChangeListener listener ) - { - return velocityListeners.removeElement( listener ); - } - - - public synchronized void addAccelerationChangeListener( AccelerationChangeListener listener ) - { - accelerationListeners.addElement( listener ); - } - - - /** - * @return true on success; false on failure - */ - public synchronized boolean removeAccelerationChangeListener( AccelerationChangeListener listener ) - { - return accelerationListeners.removeElement( listener ); - } - - - // end public methods - //////////////////////// - - - //////////////////////// - // Protected methods - // - - protected void stoppedRunning( ) - { - changeListeners.removeAllElements( ); - velocityListeners.removeAllElements( ); - accelerationListeners.removeAllElements( ); - synchronized( downInVrpnLock ) - { - this.shutdownTracker( ); - } - } - - /** - * Should be called only by mainloop(), a native method which is itself - * synchronized. By extension, this method is synchronized (in that, for - * a given TrackerRemote object, this method can only be called from one - * thread at a time). - */ - protected void handleTrackerChange( long tv_sec, long tv_usec, int sensor, - double x, double y, double z, - double quat0, double quat1, double quat2, double quat3 ) - { - // putting the body of this function into a synchronized block prevents - // other instances of TrackerRemote from calling listeners' trackerPositionUpdate - // method concurrently. - synchronized( notifyingChangeListenersLock ) - { - TrackerUpdate t = new TrackerUpdate(); - t.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - t.sensor = sensor; - t.pos[0] = x; t.pos[1] = y; t.pos[2] = z; - t.quat[0] = quat0; t.quat[1] = quat1; t.quat[2] = quat2; t.quat[3] = quat3; - - // notify all listeners - Enumeration e = changeListeners.elements( ); - while( e.hasMoreElements( ) ) - { - PositionChangeListener l = (PositionChangeListener) e.nextElement( ); - l.trackerPositionUpdate( t, this ); - } - } // end synchronized( notifyingChangeListenersLock ) - } // end method handleTrackerChange - - - /** - * @see #handleTrackerChange - */ - protected void handleVelocityChange( long tv_sec, long tv_usec, int sensor, - double x, double y, double z, - double quat0, double quat1, double quat2, double quat3, - double quat_dt ) - { - synchronized( notifyingVelocityListenersLock ) - { - VelocityUpdate v = new VelocityUpdate(); - v.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - v.sensor = sensor; - v.vel[0] = x; v.vel[1] = y; v.vel[2] = z; - v.vel_quat[0] = quat0; v.vel_quat[1] = quat1; v.vel_quat[2] = quat2; - v.vel_quat[3] = quat3; - v.vel_quat_dt = quat_dt; - - // notify all listeners - Enumeration e = velocityListeners.elements( ); - while( e.hasMoreElements( ) ) - { - VelocityChangeListener l = (VelocityChangeListener) e.nextElement( ); - l.trackerVelocityUpdate( v, this ); - } - } // end synchronized( notifyingVelocityListenersLock ) - } // end method handleVelocityChange - - - /** - * @see #handleTrackerChange - */ - protected void handleAccelerationChange( long tv_sec, long tv_usec, int sensor, - double x, double y, double z, - double quat0, double quat1, double quat2, double quat3, - double quat_dt ) - { - synchronized( notifyingAccelerationListenersLock ) - { - AccelerationUpdate a = new AccelerationUpdate(); - a.msg_time.setTime( tv_sec * 1000 + (int) (tv_usec/1000.0) ); - a.sensor = sensor; - a.acc[0] = x; a.acc[1] = y; a.acc[2] = z; - a.acc_quat[0] = quat0; a.acc_quat[1] = quat1; a.acc_quat[2] = quat2; - a.acc_quat[3] = quat3; - a.acc_quat_dt = quat_dt; - - // notify all listeners - Enumeration e = accelerationListeners.elements( ); - while( e.hasMoreElements( ) ) - { - AccelerationChangeListener l = (AccelerationChangeListener) e.nextElement( ); - l.trackerAccelerationUpdate( a, this ); - } - } // end synchronized( notifyingAccelerationListenersLock ) - } // end method handleAccelerationChange - - - protected native void shutdownTracker( ); - - /** - * This should only be called from the method run() - */ - protected native void mainloop( ); - - - /** - * Initialize the native tracker object - * @param name The name of the tracker and host (e.g., <code>"Tracker0@myhost.edu"</code>). - * @return <code>true</code> if the tracker was connected successfully, - * <code>false</code> otherwise. - */ - protected native boolean init( String name, String localInLogfileName, - String localOutLogfileName, String remoteInLogfileName, - String remoteOutLogfileName ); - - // end protected methods - /////////////////////// - - /////////////////// - // data members - - protected Vector changeListeners = new Vector( ); - protected Vector velocityListeners = new Vector( ); - protected Vector accelerationListeners = new Vector( ); - - /** - * these notifying*ListenersLock variables are used to ensure that multiple - * TrackerRemote objects running in multiple threads don't call the - * trackerChangeUpdate, et al, method of some single object concurrently. - * For example, the handleTrackerChange(...) method, which is invoked from native - * code, gets a lock on the notifyingChangeListenersLock object. Since that object - * is static, all other instances of TrackerRemote must wait before notifying - * their listeners and completing their handleTrackerChange(...) methods. - * They are necessary, in part, because methods in an interface can't be declared - * synchronized (and the semantics of the keyword 'synchronized' aren't what's - * wanted here, anyway -- we want synchronization across all instances, not just a - * single object). - */ - protected final static Object notifyingChangeListenersLock = new Object( ); - protected final static Object notifyingVelocityListenersLock = new Object( ); - protected final static Object notifyingAccelerationListenersLock = new Object( ); - -} diff --git a/src/vrpn/java_vrpn/vrpn/TrackerRemoteListener.java b/src/vrpn/java_vrpn/vrpn/TrackerRemoteListener.java deleted file mode 100644 index 48f7919c15e348d86852e1234e5aaf7387ad65e9..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/TrackerRemoteListener.java +++ /dev/null @@ -1,380 +0,0 @@ -/*************************************************************************** - * Use this class to store Tracker-, Velocity- and AcceleraionUpdates in a - * vector and get them when you want. It is most useful if you don't want - * to worry about your code running in a multi-threaded environment and - * about vrpn possibly delivering device updates at arbitrary times. - * - * The Listener can be configured to buffer and return either all - * updates or only the last (the most recent) update. Tracker, velocity - * and acceleration messages are buffered independently. By default, the - * Listener keeps only the last update of each. - * - * It is not intended that Listeners be shared among objects. Each - * entity in a program that is interested in hearing about updates - * from some vrpn Tracker device (and which wishes to use this Listener - * mechanism) should create its own listener (even if multiple entities - * wish to hear from the same device). - ***************************************************************************/ - -package vrpn; -import java.util.Vector; - -public class TrackerRemoteListener - implements TrackerRemote.PositionChangeListener, - TrackerRemote.VelocityChangeListener, - TrackerRemote.AccelerationChangeListener -{ - public static final int ALL_UPDATES = 0; - public static final int LAST_UPDATE = 1; - - - public TrackerRemoteListener( TrackerRemote tracker ) - { - - trackerUpdates = new Vector(); - velocityUpdates = new Vector(); - accelerationUpdates = new Vector(); - - trackerBufferMode = LAST_UPDATE; - velocityBufferMode = LAST_UPDATE; - accelerationBufferMode = LAST_UPDATE; - - tracker.addPositionChangeListener(this); - tracker.addVelocityChangeListener(this); - tracker.addAccelerationChangeListener(this); - } - - - /** - * Sets the buffering mode of the Listener to record and return only - * the most recent (the last, the latest) TrackerUpdate. - */ - public synchronized void setModeLastTrackerUpdate() - { - trackerBufferMode = LAST_UPDATE; - if( !trackerUpdates.isEmpty() ) - { - Object temp = trackerUpdates.lastElement(); - trackerUpdates.removeAllElements(); - trackerUpdates.addElement(temp); - } - } - - - /** - * Sets the buffering mode of the Listener to record and return only - * the most recent (the last, the latest) VelocityUpdate. - */ - public synchronized void setModeLastVelocityUpdate() - { - velocityBufferMode = LAST_UPDATE; - if( !velocityUpdates.isEmpty() ) - { - Object temp = velocityUpdates.lastElement(); - velocityUpdates.removeAllElements(); - velocityUpdates.addElement(temp); - } - } - - - /** - * Sets the buffering mode of the Listener to record and return only - * the most recent (the last, the latest) AccelerationUpdate. - */ - public synchronized void setModeLastAccelerationUpdate() - { - accelerationBufferMode = LAST_UPDATE; - if( !accelerationUpdates.isEmpty() ) - { - Object temp = accelerationUpdates.lastElement(); - accelerationUpdates.removeAllElements(); - accelerationUpdates.addElement(temp); - } - } - - - /** - * Sets the buffering mode of the Listener to record and return all - * TrackerUpdates, beginning at the time this mode is first enabled. - */ - public synchronized void setModeAllTrackerUpdates() - { - if( trackerBufferMode == LAST_UPDATE ) - { - trackerUpdates.removeAllElements( ); - } - trackerBufferMode = ALL_UPDATES; - } - - - /** - * Sets the buffering mode of the Listener to record and return all - * VelocityUpdates, beginning at the time this mode is first enabled. - */ - public synchronized void setModeAllVelocityUpdates() - { - if( velocityBufferMode == LAST_UPDATE ) - { - velocityUpdates.removeAllElements( ); - } - velocityBufferMode = ALL_UPDATES; - } - - - /** - * Sets the buffering mode of the Listener to record and return all - * AccelerationUpdates, beginning at the time this mode is first enabled. - */ - public synchronized void setModeAllAccelerationUpdates() - { - if( accelerationBufferMode == LAST_UPDATE ) - { - accelerationUpdates.removeAllElements( ); - } - accelerationBufferMode = ALL_UPDATES; - } - - - /** - * @return TrackerRemoteListener.ALL_UPDATES if the Listener is recording and - * returning all TrackerUpdates; TrackerRemoteListener.LAST_UPDATE if only the - * latest TrackerUpdate. - */ - public synchronized int getModeTrackerUpdate() - { - return trackerBufferMode; - } - - - /** - * @return TrackerRemoteListener.ALL_UPDATES if the Listener is recording and - * returning all VelocityUpdates; TrackerRemoteListener.LAST_UPDATE if only the - * latest VelocityUpdate. - */ - public synchronized int getModeVelocityUpdate() - { - return velocityBufferMode; - } - - - /** - * @return TrackerRemoteListener.ALL_UPDATES if the Listener is recording and - * returning all AccelerationUpdates; TrackerRemoteListener.LAST_UPDATE if only the - * latest AccelerationUpdate. - */ - public synchronized int getModeAccelerationUpdate() - { - return accelerationBufferMode; - } - - - /** - * This method retreives the buffered TrackerUpdates from the Listener. - * If the buffering mode is LAST_UPDATE, the last update received will - * be returned (note that, in this mode, successive calls to getTrackerUpdate() - * may return the same TrackerUpdate if no new updates were received in the - * interim). If the buffering mode is ALL_UPDATES, all updates - * received since the last call to getTrackerUpdate() (or since ALL_UPDATES - * mode was enabled) will be returned. - * @return A Vector containing the buffered TrackerUpdates. The number of - * TrackerUpdates returned will depend on the buffering mode. If there are - * no TrackerUpdates buffered, an empty Vector will be returned. - * @see #setModeLastTrackerUpdate - * @see #setModeAllTrackerUpdates - */ - public synchronized Vector getTrackerUpdate() - { - Vector v = new Vector( ); - if( trackerUpdates.isEmpty() ) - { - return v; - } - - if( trackerBufferMode == LAST_UPDATE ) - { - v.addElement( trackerUpdates.lastElement() ); - } - else if( trackerBufferMode == ALL_UPDATES ) - { - for( int i = 0; i < trackerUpdates.size(); i++ ) - { - v.addElement( trackerUpdates.elementAt(i) ); - } - trackerUpdates.removeAllElements(); - } - return v; - } // end method getTrackerUpdate( ) - - - /** - * This method retreives the buffered VelocityUpdates from the Listener. - * If the buffering mode is LAST_UPDATE, the last update received will - * be returned (note that, in this mode, successive calls to getVelocityUpdate() - * may return the same VelocityUpdate if no new updates were received in the - * interim). If the buffering mode is ALL_UPDATES, all updates - * received since the last call to getVelocityUpdate() (or since ALL_UPDATES - * mode was enabled) will be returned. - * @return A Vector containing the buffered VelocityUpdates. The number of - * VelocityUpdates returned will depend on the buffering mode. If there are - * no VelocityUpdates buffered, an empty Vector will be returned. - * @see #setModeLastVelocityUpdate - * @see #setModeAllVelocityUpdates - */ - public synchronized Vector getVelocityUpdate() - { - Vector v = new Vector( ); - if( velocityUpdates.isEmpty() ) - { - return v; - } - - if( velocityBufferMode == LAST_UPDATE ) - { - v.addElement( velocityUpdates.lastElement() ); - } - else if( velocityBufferMode == ALL_UPDATES ) - { - for( int i = 0; i < velocityUpdates.size(); i++ ) - { - v.addElement( velocityUpdates.elementAt(i) ); - } - velocityUpdates.removeAllElements(); - } - return v; - } // end method getVelocityUpdate( ) - - - /** - * This method retreives the buffered AccelerationUpdates from the Listener. - * If the buffering mode is LAST_UPDATE, the last update received will - * be returned (note that, in this mode, successive calls to getAcclerationUpdate() - * may return the same AccelerationUpdate if no new updates were received in the - * interim). If the buffering mode is ALL_UPDATES, all updates - * received since the last call to getAcclerationUpdate() (or since ALL_UPDATES - * mode was enabled) will be returned. - * @return A Vector containing the buffered AccelerationUpdates. The number of - * AccelerationUpdates returned will depend on the buffering mode. If there are - * no AccelerationUpdates buffered, an empty Vector will be returned. - * @see #setModeLastAccelerationUpdate - * @see #setModeAllAccelerationUpdates - */ - public synchronized Vector getAcclerationUpdate() - { - Vector v = new Vector( ); - if( accelerationUpdates.isEmpty() ) - { - return v; - } - - if( accelerationBufferMode == LAST_UPDATE ) - { - v.addElement( accelerationUpdates.lastElement() ); - } - else if( accelerationBufferMode == ALL_UPDATES ) - { - for( int i = 0; i < accelerationUpdates.size(); i++ ) - { - v.addElement( accelerationUpdates.elementAt(i) ); - } - accelerationUpdates.removeAllElements(); - } - return v; - } // end method getAccelerationUpdate( ) - - - /** - * @return The last (most recent, latest) TrackerUpdate received. This function - * returns <code>null</code> if no updates have been received. Note that - * successive calls to getLastTrackerUpdate() may return the same TrackerUpdate - * if no updates were received in the interim. - */ - public synchronized TrackerRemote.TrackerUpdate getLastTrackerUpdate() - { - if( trackerUpdates.isEmpty( ) ) - return null; - - return (TrackerRemote.TrackerUpdate) trackerUpdates.lastElement(); - } - - - /** - * @return The last (most recent, latest) VelocityUpdate received. This function - * returns <code>null</code> if no updates have been received. Note that - * successive calls to getLastVelocityUpdate() may return the same VelocityUpdate - * if no updates were received in the interim. - */ - public synchronized TrackerRemote.VelocityUpdate getLastVelocityUpdate() - { - if( velocityUpdates.isEmpty( ) ) - return null; - - return (TrackerRemote.VelocityUpdate) velocityUpdates.lastElement(); - } - - - /** - * @return The last (most recent, latest) AccelerationUpdate received. This function - * returns <code>null</code> if no updates have been received. Note that - * successive calls to getLastAccelerationUpdate() may return the same - * AccelerationUpdate if no updates were received in the interim. - */ - public synchronized TrackerRemote.AccelerationUpdate getLastAccelerationUpdate() - { - if( accelerationUpdates.isEmpty( ) ) - return null; - - return (TrackerRemote.AccelerationUpdate) accelerationUpdates.lastElement(); - } - - - /** - * This is the handler that the TrackerRemote instance will call to deliver - * position updates. This method is not intended to be called by user code. - */ - public synchronized void trackerPositionUpdate( TrackerRemote.TrackerUpdate u, TrackerRemote tracker ) - { - if( trackerBufferMode == LAST_UPDATE ) - { - trackerUpdates.removeAllElements(); - } - trackerUpdates.addElement(u); - } - - - /** - * This is the handler that the TrackerRemote instance will call to deliver - * velocity updates. This method is not intended to be called by user code. - */ - public synchronized void trackerVelocityUpdate (TrackerRemote.VelocityUpdate v, TrackerRemote tracker) - { - if( velocityBufferMode == LAST_UPDATE ) - { - velocityUpdates.removeAllElements(); - } - velocityUpdates.addElement(v); - } - - - /** - * This is the handler that the TrackerRemote instance will call to deliver - * acceleration updates. This method is not intended to be called by user code. - */ - public synchronized void trackerAccelerationUpdate (TrackerRemote.AccelerationUpdate a, TrackerRemote tracker ) - { - if( accelerationBufferMode == LAST_UPDATE ) - { - accelerationUpdates.removeAllElements(); - } - accelerationUpdates.addElement(a); - } - - - protected Vector trackerUpdates; - protected Vector velocityUpdates; - protected Vector accelerationUpdates; - - protected int trackerBufferMode; - protected int velocityBufferMode; - protected int accelerationBufferMode; - -} // end class TrackerRemoteListener diff --git a/src/vrpn/java_vrpn/vrpn/VRPN.java b/src/vrpn/java_vrpn/vrpn/VRPN.java deleted file mode 100644 index 41fd684530aec858c3364f71a2c6b43269e1c08d..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/VRPN.java +++ /dev/null @@ -1,34 +0,0 @@ - - -package vrpn; - -public class VRPN -{ - - /** - * All VRPN objects must assert this lock before making any calls - * into native code. A corollary of this is that no native methods - * may be public; all native methods must be wrapped by other methods - * that first synchronize on this lock before calling the native - * method. - */ - protected final static Object downInVrpnLock = new Object( ); - - static - { - try { System.loadLibrary( "java_vrpn" ); } - catch( UnsatisfiedLinkError e ) - { - System.out.println( e.getMessage( ) ); - System.out.println( "Error initializing java_vrpn." ); - System.out.println( " -- Unable to find native library." ); - } - catch( SecurityException e ) - { - System.out.println( e.getMessage( ) ); - System.out.println( "Security exception: you couldn't load the native vrpn dll." ); - } - } // end static initializer block - - -} // end class VRPN diff --git a/src/vrpn/java_vrpn/vrpn/VRPNDevice.java b/src/vrpn/java_vrpn/vrpn/VRPNDevice.java deleted file mode 100644 index bd68b3e6f3988ac777077100d709a793236accc2..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn/VRPNDevice.java +++ /dev/null @@ -1,447 +0,0 @@ -package vrpn; - -import java.util.Date; - -public abstract class VRPNDevice extends VRPN implements Runnable -{ - /////////////// - // text-related definitions and constants - - // the following values are from vrpn_BaseClass.h - public final static int vrpn_TEXT_NORMAL = 0; - public final static int vrpn_TEXT_WARNING = 1; - public final static int vrpn_TEXT_ERROR = 2; - - public static String getTextSeverityString( int severity ) - { - switch( severity ) - { - case vrpn_TEXT_NORMAL: return "vrpn_TEXT_NORMAL"; - case vrpn_TEXT_WARNING: return "vrpn_TEXT_WARNING"; - case vrpn_TEXT_ERROR: return "vrpn_TEXT_ERROR"; - default: return "(unknown severity)"; - } - } - - public final static Date vrpn_TEXT_NOW = new Date( 0 ); - // end text-related stuff - //////////////// - - - public class NotReplayError extends Exception - { - public NotReplayError( String msg ) - { super( msg ); } - } - - // the arguments to this constructor are just stored for later reference. - // 'null' is a reasonable value for any (although something else will - // surely break if 'name' is null). - public VRPNDevice( String name, String localInLogfileName, String localOutLogfileName, - String remoteInLogfileName, String remoteOutLogfileName ) - throws InstantiationException - { - this.connectionName = name; - this.localInLogfileName = localInLogfileName; - this.localOutLogfileName = localOutLogfileName; - this.remoteInLogfileName = remoteInLogfileName; - this.remoteOutLogfileName = remoteOutLogfileName; - try - { - synchronized( downInVrpnLock ) - { - this.init( name, localInLogfileName, localOutLogfileName, - remoteInLogfileName, remoteOutLogfileName ); - } - } - catch( java.lang.UnsatisfiedLinkError e ) - { - System.out.println( "Error initializing remote device " + name + "." ); - System.out.println( " -- Unable to find the right functions. This may be a version problem." ); - throw new InstantiationException( e.getMessage( ) ); - } - - this.deviceThread = new Thread( this, "vrpn " + this.getClass().getName() ); - this.deviceThread.start( ); - } - - - public String getConnectionName( ) - { - return connectionName; - } - - public String getLocalInLogfileName( ) - { - return localInLogfileName; - } - - public String getLocalOutLogfileName( ) - { - return localOutLogfileName; - } - - public String getRemoteInLogfileName( ) - { - return remoteInLogfileName; - } - - public String getRemoteOutLogfileName( ) - { - return remoteOutLogfileName; - } - - /** - * Sets the interval between invocations of <code>mainloop()</code>, which checks - * for and delivers messages. - * @param period The period, in milliseconds, between the beginnings of two - * consecutive message loops. - */ - final public synchronized void setTimerPeriod( long period ) - { - mainloopPeriod = period; - } - - - /** - * @return The period, in milliseconds. - */ - final public synchronized long getTimerPeriod( ) - { - return mainloopPeriod; - } - - - final public boolean doingOkay( ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = doingOkay_native( ); - } - return retval; - } - - - final public boolean isConnected( ) - { - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = isConnected_native( ); - } - return retval; - } - - - final public boolean isLive( ) - { - if( liveReplayValid ) - return !replay; - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = isLive_native( ); - } - replay = !retval; - return retval; - } - - - final public boolean isReplay( ) - { - return !isLive(); - } - - - final public long getElapsedTimeSecs( ) - { - long retval = 0; - synchronized( downInVrpnLock ) - { - retval = getElapsedTimeSecs_native( ); - } - return retval; - } - - - final public Date getTime( ) - { - Date d = new Date( 0 ); - synchronized( downInVrpnLock ) - { - getTime_native( d ); - } - return d; - } - - /** - * Valid only when in replay. - * @param rate The fractional rate of wall-clock time. 0.0 means - * paused. 1.0 is the default and is normal speed. - */ - final public void setReplayRate( float rate ) throws NotReplayError - { - if( isLive() ) throw new NotReplayError( "a live device" ); - synchronized( downInVrpnLock ) - { - setReplayRate_native( rate ); - } - } - - - /** - * Valid only when in replay. - * Returns to the beginning of a file. - */ - final public boolean reset( ) throws NotReplayError - { - if( isLive() ) throw new NotReplayError( "a live device" ); - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = reset_native(); - } - return retval; - } - - - /** - * Valid only when in replay. - * @return true iff we are at the end of the file. false otherwise, or if not replay. - */ - final public boolean eof( ) throws NotReplayError - { - if( isLive() ) throw new NotReplayError( "a live device" ); - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = eof_native( ); - } - return retval; - } - - /** - * Valid only when in replay. - */ - final public boolean playToElapsedTime( long seconds ) throws NotReplayError - { - if( isLive() ) throw new NotReplayError( "a live device" ); - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = playToElapsedTime_native( seconds ); - } - return retval; - } - - - /** - * Valid only when in replay. - */ - final public boolean playToWallTime( Date date ) throws NotReplayError - { - if( isLive() ) throw new NotReplayError( "a live device" ); - boolean retval = false; - synchronized( downInVrpnLock ) - { - retval = playToWallTime_native( date ); - } - return retval; - } - - - /** - * Valid only when in replay. - */ - final public double getLengthSecs( ) throws NotReplayError - { - if( isLive() ) throw new NotReplayError( "a live device" ); - double retval = -1; - synchronized( downInVrpnLock ) - { - retval = getLengthSecs_native( ); - } - return retval; - } - - - /** - * Valid only when in replay. - */ - final public float getReplayRate( ) throws NotReplayError - { - if( isLive() ) throw new NotReplayError( "a live device" ); - float retval = -1; - synchronized( downInVrpnLock ) - { - retval = getReplayRate_native( ); - } - return retval; - } - - - /** - * Valid only when in replay. - * @return the earliest time of a user message in a file being replayed. - */ - final public Date getEarliestTime( ) throws NotReplayError - { - if( isLive() ) throw new NotReplayError( "a live device" ); - if( !earliestTimeValid ) - { - synchronized( downInVrpnLock ) - { - boolean success = getEarliestTime_native( earliestTime ); - if( !success ) earliestTime.setTime( 0 ); - else earliestTimeValid = true; - } - } - return earliestTime; - } - - - /** - * Valid only when in replay. - * @return the latest time of a user message in a file being replayed - */ - final public Date getLatestTime( ) throws NotReplayError - { - if( isLive() ) throw new NotReplayError( "a live device" ); - if( !latestTimeValid ) - { - synchronized( downInVrpnLock ) - { - boolean success = getLatestTime_native( latestTime ); - if( !success ) latestTime.setTime( 0 ); - else latestTimeValid = true; - } - } - return latestTime; - } - - - /** - * Stops the device thread - */ - final public void stopRunning( ) - { - keepRunning = false; - while( deviceThread.isAlive( ) ) - { - try { deviceThread.join( ); } - catch( InterruptedException e ) { } - } - - // let the concrete subclasses do any necessary clean-up - stoppedRunning( ); - } - - - /** - * This should <b>not</b> be called by user code. - */ - final public void run( ) - { - while( keepRunning ) - { - synchronized( downInVrpnLock ) - { - this.mainloop( ); - } - try { Thread.sleep( mainloopPeriod ); } - catch( InterruptedException e ) { } - } - } - - - final public void finalize( ) throws Throwable - { - stopRunning( ); - } - - // end public methods - //////////////////////// - - - //////////////////////// - // Protected methods - // - - protected native boolean isLive_native( ); - protected native boolean doingOkay_native( ); - protected native boolean isConnected_native( ); - protected native long getElapsedTimeSecs_native( ); - protected native void setReplayRate_native( float rate ); - protected native float getReplayRate_native( ); - protected native boolean reset_native( ); - protected native boolean eof_native( ); - protected native boolean playToElapsedTime_native( long seconds ); - protected native boolean playToWallTime_native( Date d ); - protected native double getLengthSecs_native( ); - protected native boolean getEarliestTime_native( Date d ); - protected native boolean getLatestTime_native( Date d ); - protected native boolean getTime_native( Date d ); - - /** - * This should only be called from the method run() - */ - protected abstract void mainloop( ); - - - /** - * This is called from the VRPNDevice constructor. - * It should return <code>true</code> only if the concrete - * native device was connected an initializaed successfully. - */ - protected abstract boolean init( String name, String localInLogfileName, - String localOutLogfileName, String remoteInLogfileName, - String remoteOutLogfileName ); - - /** - * This will be called when the specific vrpn device - * shuts down. - */ - protected abstract void stoppedRunning( ); - - // end protected methods - /////////////////////// - - /////////////////// - // data members - - // this is used by the native code to store a C++ pointer to the - // native device object (e.g., the vrpn_TrackerRemote, - // vrpn_AnalogRemote, etc.). this should be negative if the device - // is uninitialized or has already been shut down - protected long native_device = -1; - - // this is used to stop and to keep running the device thread - // in an orderly fashion. - protected boolean keepRunning = true; - - // the device thread - Thread deviceThread = null; - - // how long the thread sleeps between checking for messages - protected long mainloopPeriod = 100; // milliseconds - - protected String connectionName = null; - protected String localInLogfileName = null; - protected String localOutLogfileName = null; - protected String remoteInLogfileName = null; - protected String remoteOutLogfileName = null; - - - protected boolean liveReplayValid = false; - protected boolean replay = false; - protected boolean earliestTimeValid = false; - protected Date earliestTime = new Date(); - protected boolean latestTimeValid = false; - protected Date latestTime = new Date(); - - // the default constructor is private so that subclasses - // are forced to tell us the connection name and the - // various logfile names - private VRPNDevice( ) { } -} diff --git a/src/vrpn/java_vrpn/vrpn_AnalogOutputRemote.cpp b/src/vrpn/java_vrpn/vrpn_AnalogOutputRemote.cpp deleted file mode 100644 index 0fa92b8d857a8de9cafce5de38076d6cc729baff..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn_AnalogOutputRemote.cpp +++ /dev/null @@ -1,238 +0,0 @@ - - -#include <stdio.h> -#include <jni.h> -#include "java_vrpn.h" -#include "vrpn_Analog_Output.h" -#include "vrpn_AnalogOutputRemote.h" - - -jclass jclass_vrpn_AnalogOutputRemote = NULL; -extern jfieldID jfid_vrpn_VRPNDevice_native_device; - -////////////////////////// -// DLL functions - - -// This is called when the Java Virtual Machine loads this library -// and sets some global references that are used elsewhere. -JNIEXPORT jint JNICALL JNI_OnLoad_AnalogOutput_Remote( JavaVM* jvm, void* reserved ) -{ - /////////////// - // make sure the general library code set jvm - if( jvm == NULL ) - { - printf( "vrpn_AnalogOutputRemote native: no jvm.\n" ); - return JNI_ERR; - } - - /////////////// - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error loading vrpn AnalogOutputRemote native library.\n" ); - return JNI_ERR; - } - - /////////////// - // get the jclass reference to vrpn.AnalogOutputRemote - jclass cls = env->FindClass( "vrpn/AnalogOutputRemote" ); - if( cls == NULL ) - { - printf( "Error loading vrpn AnalogOutputRemote native library " - "while trying to find class vrpn.AnalogOutputRemote.\n" ); - return JNI_ERR; - } - - // make a global reference so the class can be referenced later. - // this must be a _WEAK_ global reference, so the class will be - // garbage collected, and so the JNI_OnUnLoad handler will be called - jclass_vrpn_AnalogOutputRemote = (jclass) env->NewWeakGlobalRef( cls ); - if( jclass_vrpn_AnalogOutputRemote == NULL ) - { - printf( "Error loading vrpn AnalogOutputRemote native library " - "while setting up class vrpn.AnalogOutputRemote.\n" ); - return JNI_ERR; - } - - return JAVA_VRPN_JNI_VERSION; -} // end JNI_OnLoad - - -JNIEXPORT void JNICALL JNI_OnUnload_AnalogOutput_Remote( JavaVM* jvm, void* reserved ) -{ - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error unloading vrpn AnalogOutputRemote native library.\n" ); - return; - } - - // delete the global reference to the vrpn.analogRemote class - env->DeleteWeakGlobalRef( jclass_vrpn_AnalogOutputRemote ); -} - - - -// end DLL functions -///////////////////////////// - - -//////////////////////////// -// dll utility functions - - - -JNIEXPORT jboolean JNICALL -Java_vrpn_AnalogOutputRemote_requestValueChange_1native__ID( JNIEnv* env, jobject jobj, - jint jchannel, jdouble jvalue ) -{ - if( jchannel < 0 ) - { - return false; - } - - // get the analog pointer - vrpn_Analog_Output_Remote* ao = (vrpn_Analog_Output_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( ao <= 0 ) // this analog is uninitialized or has been shut down already - { - printf( "Error in native method \"requestValueChange(double)\": the analog output is " - "uninitialized or has been shut down.\n" ); - return false; - } - - return ao->request_change_channel_value( jchannel, jvalue ); -} - - -JNIEXPORT jboolean JNICALL -Java_vrpn_AnalogOutputRemote_requestValueChange_1native___3D( JNIEnv* env, jobject jobj, - jdoubleArray jvalues ) -{ - // get the analog pointer - vrpn_Analog_Output_Remote* ao = (vrpn_Analog_Output_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( ao <= 0 ) // this analog is uninitialized or has been shut down already - { - printf( "Error in native method \"requestValueChange(double[])\": the analog output is " - "uninitialized or has been shut down.\n" ); - return false; - } - - // check the array length - int length = env->GetArrayLength( jvalues ); - if( length > ao->getNumChannels( ) ) - { - printf( "Error in native method \"requestValueChange(double[])\": someone tried " - "to use an array that was too long.\n" ); - return false; - } - if( length == 0 ) - { - return true; - } - - // get the array - double* values = env->GetDoubleArrayElements( jvalues, NULL ); - if( values == NULL ) - { - printf( "Error in native method \"requestValueChange(double[])\": couldn't " - "get the array in native form.\n" ); - env->ReleaseDoubleArrayElements( jvalues, values, JNI_ABORT /*mode*/ ); - return false; - } - - bool retval = ao->request_change_channels( length, values ); - env->ReleaseDoubleArrayElements( jvalues, values, JNI_ABORT /*mode*/ ); - return retval; -} - - -JNIEXPORT jint JNICALL -Java_vrpn_AnalogOutputRemote_getNumActiveChannels( JNIEnv* env, jobject jobj ) -{ - // get the analog pointer - vrpn_Analog_Output_Remote* ao = (vrpn_Analog_Output_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( ao <= 0 ) // this analog is uninitialized or has been shut down already - { - printf( "Error in native method \"getNumActiveChannels\": the analog output is " - "uninitialized or has been shut down.\n" ); - return 0; - } - - return ao->getNumChannels( ); -} - - -JNIEXPORT void JNICALL -Java_vrpn_AnalogOutputRemote_shutdownAnalogOutput( JNIEnv* env, jobject jobj ) -{ - // get the analog pointers - vrpn_Analog_Output_Remote* ao - = (vrpn_Analog_Output_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - if( ao > 0 ) - { - ao->connectionPtr()->removeReference(); // because we called vrpn_get_connection_by_name - delete ao; - } - - // set the analog pointers to -1 - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, -1 ); - - // delete global reference to object (that was created in init) - env->DeleteGlobalRef( jobj ); -} - - -JNIEXPORT void JNICALL -Java_vrpn_AnalogOutputRemote_mainloop( JNIEnv *env, jobject jobj ) -{ - - vrpn_Analog_Output_Remote* ao - = (vrpn_Analog_Output_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - if( ao > 0 ) - ao->mainloop( ); -} - - -JNIEXPORT jboolean JNICALL -Java_vrpn_AnalogOutputRemote_init( JNIEnv *env, jobject jobj, jstring jname, - jstring jlocalInLogfileName, jstring jlocalOutLogfileName, - jstring jremoteInLogfileName, jstring jremoteOutLogfileName ) -{ - // make a global reference to the Java AnalogOutputRemote - // object, so that it can be referenced in the function - // handle_analog_change(...) - jobj = env->NewGlobalRef( jobj ); - - // create the analog & output - const char* name = env->GetStringUTFChars( jname, NULL ); - const char* local_in_logfile_name = jlocalInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalInLogfileName, NULL ); - const char* local_out_logfile_name = jlocalOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalOutLogfileName, NULL ); - const char* remote_in_logfile_name = jremoteInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteInLogfileName, NULL ); - const char* remote_out_logfile_name = jremoteOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteOutLogfileName, NULL ); - vrpn_Connection* conn - = vrpn_get_connection_by_name( name, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name ); - vrpn_Analog_Output_Remote* ao = new vrpn_Analog_Output_Remote( name, conn ); - env->ReleaseStringUTFChars( jname, name ); - env->ReleaseStringUTFChars( jlocalInLogfileName, local_in_logfile_name ); - env->ReleaseStringUTFChars( jlocalOutLogfileName, local_out_logfile_name ); - env->ReleaseStringUTFChars( jremoteInLogfileName, remote_in_logfile_name ); - env->ReleaseStringUTFChars( jremoteOutLogfileName, remote_out_logfile_name ); - - - // now stash 'ao' in the jobj's 'native_device' field - jlong jao = (jlong) ao; - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, jao ); - - return true; -} - diff --git a/src/vrpn/java_vrpn/vrpn_AnalogRemote.cpp b/src/vrpn/java_vrpn/vrpn_AnalogRemote.cpp deleted file mode 100644 index 1d93bc9099b8c231ecb31fc7bd5a36a64ffffb5b..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn_AnalogRemote.cpp +++ /dev/null @@ -1,208 +0,0 @@ - - -#include <stdio.h> -#include <jni.h> -#include "java_vrpn.h" -#include "vrpn_Analog.h" -#include "vrpn_Analog_Output.h" -#include "vrpn_AnalogRemote.h" - - -jclass jclass_vrpn_AnalogRemote = NULL; -extern jfieldID jfid_vrpn_VRPNDevice_native_device; - - -// This is called when the Java Virtual Machine loads this library -// and sets some global references that are used elsewhere. -JNIEXPORT jint JNICALL JNI_OnLoad_Analog_Remote( JavaVM* jvm, void* reserved ) -{ - /////////////// - // make sure the general library code set jvm - if( jvm == NULL ) - { - printf( "vrpn_TrackerRemote native: no jvm.\n" ); - return JNI_ERR; - } - - /////////////// - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error loading vrpn AnalogRemote native library.\n" ); - return JNI_ERR; - } - - /////////////// - // get the jclass reference to vrpn.AnalogRemote - jclass cls = env->FindClass( "vrpn/AnalogRemote" ); - if( cls == NULL ) - { - printf( "Error loading vrpn AnalogRemote native library " - "while trying to find class vrpn.AnalogRemote.\n" ); - return JNI_ERR; - } - - // make a global reference so the class can be referenced later. - // this must be a _WEAK_ global reference, so the class will be - // garbage collected, and so the JNI_OnUnLoad handler will be called - jclass_vrpn_AnalogRemote = (jclass) env->NewWeakGlobalRef( cls ); - if( jclass_vrpn_AnalogRemote == NULL ) - { - printf( "Error loading vrpn AnalogRemote native library " - "while setting up class vrpn.AnalogRemote.\n" ); - return JNI_ERR; - } - - return JAVA_VRPN_JNI_VERSION; -} // end JNI_OnLoad - - -JNIEXPORT void JNICALL JNI_OnUnload_Analog_Remote( JavaVM* jvm, void* reserved ) -{ - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error unloading vrpn AnalogRemote native library.\n" ); - return; - } - - // delete the global reference to the vrpn.analogRemote class - env->DeleteWeakGlobalRef( jclass_vrpn_AnalogRemote ); -} - - -// This is the callback for vrpn to notify us of a new analog message -void VRPN_CALLBACK handle_analog_change( void* userdata, const vrpn_ANALOGCB info ) -{ - if( jvm == NULL ) - return; - - /* - printf( "analog change (C): time: %d.%d; num_channels: %d;\n\t", - info.msg_time.tv_sec, info.msg_time.tv_usec, info.num_channel ); - for( int i = 0; i <= info.num_channel - 1; i++ ) - printf( "%d ", info.channel[i] ); - printf( "\n" ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - jmethodID jmid = env->GetMethodID( jcls, "handleAnalogChange", "(JJ[D)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_AnalogRemote library was unable to find the " - "Java method \'handleAnalogChange\'. This may indicate a version mismatch.\n" ); - return; - } - - // create an array of the appropriate length - jdoubleArray jchannels = env->NewDoubleArray( info.num_channel ); - jchannels = (jdoubleArray) env->NewWeakGlobalRef( jchannels ); - if( jchannels == NULL ) - { - printf( "Error: vrpn AnalogRemote native library was unable to create a \'channels\' array.\n" ); - return; - } - - env->SetDoubleArrayRegion( jchannels, 0, info.num_channel, (double*) info.channel ); - - - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jdoubleArray) jchannels /* something here about the channels array */ ); - -} - - -JNIEXPORT void JNICALL -Java_vrpn_AnalogRemote_shutdownAnalog( JNIEnv* env, jobject jobj ) -{ - // get the analog pointers - vrpn_Analog_Remote* a = (vrpn_Analog_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - // unregister a handler and destroy the analogs - if( a > 0 ) - { - a->unregister_change_handler( jobj, handle_analog_change ); - a->connectionPtr()->removeReference(); // because we called vrpn_get_connection_by_name - delete a; - } - - // set the analog pointers to -1 - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, -1 ); - - // delete global reference to object (that was created in init) - env->DeleteGlobalRef( jobj ); - -} - - -JNIEXPORT void JNICALL -Java_vrpn_AnalogRemote_mainloop( JNIEnv *env, jobject jobj ) -{ - - vrpn_Analog_Remote* a = (vrpn_Analog_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - if( a > 0 ) // this analog is still alive - a->mainloop( ); -} - - -JNIEXPORT jboolean JNICALL -Java_vrpn_AnalogRemote_init( JNIEnv *env, jobject jobj, jstring jname, - jstring jlocalInLogfileName, jstring jlocalOutLogfileName, - jstring jremoteInLogfileName, jstring jremoteOutLogfileName ) -{ - // make a global reference to the Java AnalogRemote - // object, so that it can be referenced in the function - // handle_analog_change(...) - jobj = env->NewGlobalRef( jobj ); - - // create the analog - const char* name = env->GetStringUTFChars( jname, NULL ); - const char* local_in_logfile_name = jlocalInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalInLogfileName, NULL ); - const char* local_out_logfile_name = jlocalOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalOutLogfileName, NULL ); - const char* remote_in_logfile_name = jremoteInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteInLogfileName, NULL ); - const char* remote_out_logfile_name = jremoteOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteOutLogfileName, NULL ); - vrpn_Connection* conn - = vrpn_get_connection_by_name( name, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name ); - vrpn_Analog_Remote* a = new vrpn_Analog_Remote( name, conn ); - a->register_change_handler( jobj, handle_analog_change ); - env->ReleaseStringUTFChars( jname, name ); - env->ReleaseStringUTFChars( jlocalInLogfileName, local_in_logfile_name ); - env->ReleaseStringUTFChars( jlocalOutLogfileName, local_out_logfile_name ); - env->ReleaseStringUTFChars( jremoteInLogfileName, remote_in_logfile_name ); - env->ReleaseStringUTFChars( jremoteOutLogfileName, remote_out_logfile_name ); - - // now stash 'a' in the jobj's 'native_device' field - jlong ja = (jlong) a; - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, ja ); - - return true; -} - - -JNIEXPORT jint JNICALL Java_vrpn_AnalogRemote_getNumActiveChannels( JNIEnv* env, jobject jobj ) -{ - // get the analog pointer - vrpn_Analog_Remote* a = (vrpn_Analog_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( a <= 0 ) // this analog is uninitialized or has been shut down already - { - printf( "Error in native method \"getNumActiveChannels\": the analog is " - "uninitialized or has been shut down.\n" ); - return 0; - } - - return a->getNumChannels( ); -} - - diff --git a/src/vrpn/java_vrpn/vrpn_AuxiliaryLoggerRemote.cpp b/src/vrpn/java_vrpn/vrpn_AuxiliaryLoggerRemote.cpp deleted file mode 100644 index 690f5ce5ebb8b1e5e75bdf541d1c5aec302a48e2..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn_AuxiliaryLoggerRemote.cpp +++ /dev/null @@ -1,222 +0,0 @@ - -#include <stdio.h> -#include <jni.h> -#include "java_vrpn.h" -#include "vrpn_Auxiliary_Logger.h" -#include "vrpn_AuxiliaryLoggerRemote.h" - -jclass jclass_vrpn_AuxiliaryLoggerRemote = NULL; -extern jfieldID jfid_vrpn_VRPNDevice_native_device; - - -// This is called when the Java Virtual Machine loads this library -// and sets some global references that are used elsewhere. -JNIEXPORT jint JNICALL JNI_OnLoad_AuxiliaryLogger_Remote( JavaVM* jvm, void* reserved ) -{ - /////////////// - // make sure the general library code set jvm - if( jvm == NULL ) - { - printf( "vrpn_AuxiliaryLoggerRemote native: no jvm.\n" ); - return JNI_ERR; - } - - /////////////// - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error loading vrpn AuxiliaryLoggerRemote native library.\n" ); - return JNI_ERR; - } - - /////////////// - // get the jclass reference to vrpn.AuxiliaryLoggerRemote - jclass cls = env->FindClass( "vrpn/AuxiliaryLoggerRemote" ); - if( cls == NULL ) - { - printf( "Error loading vrpn AuxiliaryLoggerRemote native library " - "while trying to find class vrpn.AuxiliaryLoggerRemote.\n" ); - return JNI_ERR; - } - - // make a global reference so the class can be referenced later. - // this must be a _WEAK_ global reference, so the class will be - // garbage collected, and so the JNI_OnUnLoad handler will be called - jclass_vrpn_AuxiliaryLoggerRemote = (jclass) env->NewWeakGlobalRef( cls ); - if( jclass_vrpn_AuxiliaryLoggerRemote == NULL ) - { - printf( "Error loading vrpn AuxiliaryLoggerRemote native library " - "while setting up class vrpn.AuxiliaryLoggerRemote.\n" ); - return JNI_ERR; - } - - return JAVA_VRPN_JNI_VERSION; -} // end JNI_OnLoad - - -JNIEXPORT void JNICALL JNI_OnUnload_AuxiliaryLogger_Remote( JavaVM* jvm, void* reserved ) -{ - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error unloading vrpn AuxiliaryLoggerRemote native library.\n" ); - return; - } - - // delete the global reference to the vrpn.AuxiliaryLoggerRemote class - env->DeleteWeakGlobalRef( jclass_vrpn_AuxiliaryLoggerRemote ); -} - - -void VRPN_CALLBACK -handle_logging_report( void* userdata, const vrpn_AUXLOGGERCB info ) -{ - if( jvm == NULL ) - return; - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - jmethodID jmid = env->GetMethodID( jcls, "handleLoggingReport", "(JJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V" ); - if( jmid == NULL ) - { - printf( "Warning: vropn_AuxiliaryLogger library was unable to find the " - "Java method \'handleLoggingReport\'. This may indicate a version mismatch.\n" ); - return; - } - - // get a string to hold the message - jstring jLocalIn = env->NewStringUTF( info.local_in_logfile_name ); - jstring jLocalOut = env->NewStringUTF( info.local_out_logfile_name ); - jstring jRemoteIn = env->NewStringUTF( info.remote_in_logfile_name ); - jstring jRemoteOut = env->NewStringUTF( info.remote_out_logfile_name ); - - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - jLocalIn, jLocalOut, jRemoteIn, jRemoteOut ); - -} - - -JNIEXPORT jboolean JNICALL -Java_vrpn_AuxiliaryLoggerRemote_sendLoggingRequest( JNIEnv* env, jobject jobj, - jstring jLocalIn, jstring jLocalOut, - jstring jRemoteIn, jstring jRemoteOut ) -{ - // get the logger pointer - vrpn_Auxiliary_Logger_Remote* r = (vrpn_Auxiliary_Logger_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( r <= 0 ) // this logger is uninitialized or has been shut down already - { - printf( "Error in native method \"sendLoggingRequest(...)\": the logger is " - "uninitialized or has been shut down.\n" ); - return false; - } - const char* localIn = jLocalIn == NULL ? NULL : env->GetStringUTFChars( jLocalIn, NULL ); - const char* localOut = jLocalOut == NULL ? NULL : env->GetStringUTFChars( jLocalOut, NULL ); - const char* remoteIn = jRemoteIn == NULL ? NULL : env->GetStringUTFChars( jRemoteIn, NULL ); - const char* remoteOut = jRemoteOut == NULL ? NULL : env->GetStringUTFChars( jRemoteOut, NULL ); - - bool retval = r->send_logging_request( localIn, localOut, remoteIn, remoteOut ); - - env->ReleaseStringUTFChars( jLocalIn, localIn ); - env->ReleaseStringUTFChars( jLocalOut, localOut ); - env->ReleaseStringUTFChars( jRemoteIn, remoteIn ); - env->ReleaseStringUTFChars( jRemoteOut, remoteOut ); - return retval; -} - - -JNIEXPORT jboolean JNICALL -Java_vrpn_AuxiliaryLoggerRemote_sendLoggingStatusRequest( JNIEnv* env, jobject jobj ) -{ - // get the analog pointer - vrpn_Auxiliary_Logger_Remote* r = (vrpn_Auxiliary_Logger_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( r <= 0 ) // this analog is uninitialized or has been shut down already - { - printf( "Error in native method \"sendLoggingStatusRequest(...)\": the logger is " - "uninitialized or has been shut down.\n" ); - return false; - } - - bool retval = r->send_logging_status_request( ); - - return retval; -} - - -JNIEXPORT void JNICALL -Java_vrpn_AuxiliaryLoggerRemote_mainloop( JNIEnv* env, jobject jobj ) -{ - vrpn_Auxiliary_Logger_Remote* l = (vrpn_Auxiliary_Logger_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( l <= 0 ) // this logger is uninitialized or has been shut down already - return; - - // now call mainloop - l->mainloop( ); -} - - -JNIEXPORT jboolean JNICALL -Java_vrpn_AuxiliaryLoggerRemote_init( JNIEnv* env, jobject jobj,jstring jname, - jstring jlocalInLogfileName, jstring jlocalOutLogfileName, - jstring jremoteInLogfileName, jstring jremoteOutLogfileName ) -{ - // make a global reference to the Java AuxiliaryLoggerRemote - // object, so that it can be referenced in the function - // handle_logging_report(...) - jobj = env->NewGlobalRef( jobj ); - - // create the logger - const char* name = env->GetStringUTFChars( jname, NULL ); - const char* local_in_logfile_name = jlocalInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalInLogfileName, NULL ); - const char* local_out_logfile_name = jlocalOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalOutLogfileName, NULL ); - const char* remote_in_logfile_name = jremoteInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteInLogfileName, NULL ); - const char* remote_out_logfile_name = jremoteOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteOutLogfileName, NULL ); - vrpn_Connection* conn - = vrpn_get_connection_by_name( name, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name ); - vrpn_Auxiliary_Logger_Remote* r = new vrpn_Auxiliary_Logger_Remote( name, conn ); - r->register_report_handler( jobj, handle_logging_report ); - env->ReleaseStringUTFChars( jname, name ); - env->ReleaseStringUTFChars( jlocalInLogfileName, local_in_logfile_name ); - env->ReleaseStringUTFChars( jlocalOutLogfileName, local_out_logfile_name ); - env->ReleaseStringUTFChars( jremoteInLogfileName, remote_in_logfile_name ); - env->ReleaseStringUTFChars( jremoteOutLogfileName, remote_out_logfile_name ); - - // now stash 'r' in the jobj's 'native_device' field - jlong jr = (jlong) r; - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, jr ); - - return true; -} - - -JNIEXPORT void JNICALL -Java_vrpn_AuxiliaryLoggerRemote_shutdownAuxiliaryLogger( JNIEnv* env, jobject jobj ) -{ - // get the logger pointer - vrpn_Auxiliary_Logger_Remote* r = (vrpn_Auxiliary_Logger_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - // unregister a handler and destroy the button - if( r > 0 ) - { - r->unregister_report_handler( jobj, handle_logging_report ); - r->connectionPtr()->removeReference(); // because we called vrpn_get_connection_by_name - delete r; - } - - // set the logger pointer to -1 - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, -1 ); - - // delete global reference to object (that was created in init) - env->DeleteGlobalRef( jobj ); -} - - diff --git a/src/vrpn/java_vrpn/vrpn_ButtonRemote.cpp b/src/vrpn/java_vrpn/vrpn_ButtonRemote.cpp deleted file mode 100644 index 88ce211cc4ec91e1fd2908dd4519978fa7116f0b..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn_ButtonRemote.cpp +++ /dev/null @@ -1,181 +0,0 @@ -#include <stdio.h> -#include <jni.h> -#include "java_vrpn.h" -#include "vrpn_Button.h" -#include "vrpn_ButtonRemote.h" - -jclass jclass_vrpn_ButtonRemote = NULL; -extern jfieldID jfid_vrpn_VRPNDevice_native_device; - - -// This is called when the Java Virtual Machine loads this library -// and sets some global references that are used elsewhere. -JNIEXPORT jint JNICALL JNI_OnLoad_Button_Remote( JavaVM* jvm, void* reserved ) -{ - /////////////// - // make sure the general library code set jvm - if( jvm == NULL ) - { - printf( "vrpn_TrackerRemote native: no jvm.\n" ); - return JNI_ERR; - } - - /////////////// - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error loading vrpn ButtonRemote native library.\n" ); - return JNI_ERR; - } - - /////////////// - // get the jclass reference to vrpn.ButtonRemote - jclass cls = env->FindClass( "vrpn/ButtonRemote" ); - if( cls == NULL ) - { - printf( "Error loading vrpn ButtonRemote native library " - "while trying to find class vrpn.ButtonRemote.\n" ); - return JNI_ERR; - } - - // make a global reference so the class can be referenced later. - // this must be a _WEAK_ global reference, so the class will be - // garbage collected, and so the JNI_OnUnLoad handler will be called - jclass_vrpn_ButtonRemote = (jclass) env->NewWeakGlobalRef( cls ); - if( jclass_vrpn_ButtonRemote == NULL ) - { - printf( "Error loading vrpn ButtonRemote native library " - "while setting up class vrpn.ButtonRemote.\n" ); - return JNI_ERR; - } - - return JAVA_VRPN_JNI_VERSION; -} // end JNI_OnLoad - - -JNIEXPORT void JNICALL JNI_OnUnload_Button_Remote( JavaVM* jvm, void* reserved ) -{ - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error unloading vrpn ButtonRemote native library.\n" ); - return; - } - - // delete the global reference to the vrpn.ButtonRemote class - env->DeleteWeakGlobalRef( jclass_vrpn_ButtonRemote ); -} - - -// This is the callback for vrpn to notify us of a new button message -void VRPN_CALLBACK handle_button_change( void* userdata, const vrpn_BUTTONCB info ) -{ - if( jvm == NULL ) - return; - - /* - printf( "button change (C): time: %d.%d; button: %d;\n" - "\tstate: %d;\n", info.msg_time.tv_sec, info.msg_time.tv_usec, - info.button, info.state ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - jmethodID jmid = env->GetMethodID( jcls, "handleButtonChange", "(JJII)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_ButtonRemote library was unable to find the " - "Java method \'handleButtonChange\'. This may indicate a version mismatch.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jint) info.button, (jint) info.state ); - -} - - -JNIEXPORT void JNICALL -Java_vrpn_ButtonRemote_mainloop( JNIEnv* env, jobject jobj ) -{ - vrpn_Button_Remote* t = (vrpn_Button_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( t <= 0 ) // this button is uninitialized or has been shut down already - return; - - // now call mainloop - t->mainloop( ); -} - - -JNIEXPORT jboolean JNICALL -Java_vrpn_ButtonRemote_init( JNIEnv* env, jobject jobj, jstring jname, - jstring jlocalInLogfileName, jstring jlocalOutLogfileName, - jstring jremoteInLogfileName, jstring jremoteOutLogfileName ) -{ - // make a global reference to the Java ButtonRemote - // object, so that it can be referenced in the function - // handle_button_change(...) - jobj = env->NewGlobalRef( jobj ); - - // create the button - const char* name = env->GetStringUTFChars( jname, NULL ); - const char* local_in_logfile_name = jlocalInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalInLogfileName, NULL ); - const char* local_out_logfile_name = jlocalOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalOutLogfileName, NULL ); - const char* remote_in_logfile_name = jremoteInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteInLogfileName, NULL ); - const char* remote_out_logfile_name = jremoteOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteOutLogfileName, NULL ); - vrpn_Connection* conn - = vrpn_get_connection_by_name( name, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name ); - vrpn_Button_Remote* t = new vrpn_Button_Remote( name, conn ); - t->register_change_handler( jobj, handle_button_change ); - env->ReleaseStringUTFChars( jname, name ); - env->ReleaseStringUTFChars( jlocalInLogfileName, local_in_logfile_name ); - env->ReleaseStringUTFChars( jlocalOutLogfileName, local_out_logfile_name ); - env->ReleaseStringUTFChars( jremoteInLogfileName, remote_in_logfile_name ); - env->ReleaseStringUTFChars( jremoteOutLogfileName, remote_out_logfile_name ); - - // now stash 't' in the jobj's 'native_device' field - jlong jt = (jlong) t; - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, jt ); - - return true; -} - - - -// this is only supposed to be called when the ButtonRemote -// instance is finalized for garbage collection -JNIEXPORT void JNICALL -Java_vrpn_ButtonRemote_shutdownButton( JNIEnv* env, jobject jobj ) -{ - // get the button pointer - vrpn_Button_Remote* t = (vrpn_Button_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - // unregister a handler and destroy the button - if( t > 0 ) - { - t->unregister_change_handler( jobj, handle_button_change ); - t->connectionPtr()->removeReference(); // because we called vrpn_get_connection_by_name - delete t; - } - - // set the button pointer to -1 - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, -1 ); - - // delete global reference to object (that was created in init) - env->DeleteGlobalRef( jobj ); - - -} - - - - diff --git a/src/vrpn/java_vrpn/vrpn_ForceDeviceRemote.cpp b/src/vrpn/java_vrpn/vrpn_ForceDeviceRemote.cpp deleted file mode 100644 index b2444d7bcb2bda8b29ee36da9dcfb124c74568dd..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn_ForceDeviceRemote.cpp +++ /dev/null @@ -1,721 +0,0 @@ - -#include "stdio.h" -#include "jni.h" -#include "vrpn_ForceDevice.h" - -#include "java_vrpn.h" -#include "vrpn_ForceDeviceRemote.h" - - -jclass jclass_vrpn_ForceDeviceRemote = NULL; -extern jfieldID jfid_vrpn_VRPNDevice_native_device; - - -////////////////////////// -// DLL functions - - -// This is called when the Java Virtual Machine loads this library -// and sets some global references that are used elsewhere. -JNIEXPORT jint JNICALL JNI_OnLoad_ForceDevice_Remote( JavaVM* jvm, void* reserved ) -{ - /////////////// - // make sure the general library code set jvm - if( jvm == NULL ) - { - printf( "vrpn_ForceDevice native: no jvm.\n" ); - return JNI_ERR; - } - - /////////////// - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error loading vrpn ForceDeviceRemote native library.\n" ); - return JNI_ERR; - } - - /////////////// - // get the jclass reference to vrpn.ForceDeviceRemote - jclass cls = env->FindClass( "vrpn/ForceDeviceRemote" ); - if( cls == NULL ) - { - printf( "Error loading vrpn ForceDeviceRemote native library " - "while trying to find class vrpn.ForceDeviceRemote.\n" ); - return JNI_ERR; - } - - // make a global reference so the class can be referenced later. - // this must be a _WEAK_ global reference, so the class will be - // garbage collected, and so the JNI_OnUnLoad handler will be called - jclass_vrpn_ForceDeviceRemote = (jclass) env->NewWeakGlobalRef( cls ); - if( jclass_vrpn_ForceDeviceRemote == NULL ) - { - printf( "Error loading vrpn ForceDeviceRemote native library " - "while setting up class vrpn.ForceDeviceRemote.\n" ); - return JNI_ERR; - } - - return JAVA_VRPN_JNI_VERSION; -} // end JNI_OnLoad - - - -JNIEXPORT void JNICALL JNI_OnUnload_ForceDevice_Remote( JavaVM* jvm, void* reserved ) -{ - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error unloading vrpn ForceDeviceRemote native library.\n" ); - return; - } - - // delete the global reference to the vrpn.ForceDeviceRemote class - env->DeleteWeakGlobalRef( jclass_vrpn_ForceDeviceRemote ); -} - -// end DLL functions -///////////////////////////// - - -///////////////////////////// -// java_vrpn utility funcitons - -void VRPN_CALLBACK handle_force_change( void* userdata, const vrpn_FORCECB info ) -{ - if( jvm == NULL ) - { - printf( "Error in handle_force_change: uninitialized jvm.\n" ); - return; - } - - /* - printf( "force change (C): time: %d.%d;\n" - "\tforce: %f %f %f;\n", - info.msg_time.tv_sec, info.msg_time.tv_usec, - info.force[0], info.force[1], info.force[2] ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - jmethodID jmid = env->GetMethodID( jcls, "handleForceChange", "(JJDDD)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_ForceDeviceRemote library was unable to find the " - "Java method \'handleForceChange\'. This may indicate a version mismatch.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jdouble) info.force[0], (jdouble) info.force[1], (jdouble) info.force[2] ); - -} // end handle_force_change - - -void VRPN_CALLBACK handle_scp_change( void* userdata, const vrpn_FORCESCPCB info ) -{ - if( jvm == NULL ) - { - printf( "Error in handle_scp_change: uninitialized jvm.\n" ); - return; - } - - /* - printf( "scp change (C): time: %d.%d;\n" - "\pos: %f %f %f;\n\tquat: %f %f %f\n", - info.msg_time.tv_sec, info.msg_time.tv_usec, - info.pos[0], info.pos[1], info.pos[2], - info.quat[0], info.quat[1], info.quat[2], info.quat[3] ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - jmethodID jmid = env->GetMethodID( jcls, "handleSCPChange", "(JJDDDDDDD)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_ForceDeviceRemote library was unable to find the " - "Java method \'handleSCPChange\'. This may indicate a version mismatch.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jdouble) info.pos[0], (jdouble) info.pos[1], (jdouble) info.pos[2], - (jdouble) info.quat[0], (jdouble) info.quat[1], (jdouble) info.quat[2], - (jdouble) info.quat[3] ); - -} // end handle_scp_change - - -void VRPN_CALLBACK handle_force_error( void* userdata, const vrpn_FORCEERRORCB info ) -{ - if( jvm == NULL ) - { - printf( "Error in handle_force_error: uninitialized jvm.\n" ); - return; - } - - /* - printf( "force error (C): time: %d.%d; force: %d;\n", - info.msg_time.tv_sec, info.msg_time.tv_usec, - info.error_code ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - jmethodID jmid = env->GetMethodID( jcls, "handleForceError", "(JJI)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_ForceDeviceRemote library was unable to find the " - "Java method \'handleForceError\'. This may indicate a version mismatch.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jint) info.error_code ); - -} // end handle_force_error] - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: init - * Signature: (Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_ForceDeviceRemote_init( JNIEnv* env, jobject jobj, jstring jname, - jstring jlocalInLogfileName, jstring jlocalOutLogfileName, - jstring jremoteInLogfileName, jstring jremoteOutLogfileName ) -{ - // make a global reference to the Java ForceDeviceRemote - // object, so that it can be referenced in the functions - // handle_*_change(...) - jobj = env->NewGlobalRef( jobj ); - - // create the force device - const char* name = env->GetStringUTFChars( jname, NULL ); - const char* local_in_logfile_name = jlocalInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalInLogfileName, NULL ); - const char* local_out_logfile_name = jlocalOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalOutLogfileName, NULL ); - const char* remote_in_logfile_name = jremoteInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteInLogfileName, NULL ); - const char* remote_out_logfile_name = jremoteOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteOutLogfileName, NULL ); - vrpn_Connection* conn - = vrpn_get_connection_by_name( name, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name ); - vrpn_ForceDevice_Remote* f = new vrpn_ForceDevice_Remote( name, conn ); - f->register_force_change_handler( jobj, handle_force_change ); - f->register_scp_change_handler( jobj, handle_scp_change ); - f->register_error_handler( jobj, handle_force_error ); - env->ReleaseStringUTFChars( jname, name ); - env->ReleaseStringUTFChars( jlocalInLogfileName, local_in_logfile_name ); - env->ReleaseStringUTFChars( jlocalOutLogfileName, local_out_logfile_name ); - env->ReleaseStringUTFChars( jremoteInLogfileName, remote_in_logfile_name ); - env->ReleaseStringUTFChars( jremoteOutLogfileName, remote_out_logfile_name ); - - // now stash 'f' in the jobj's 'native_device' field - jlong jf = (jlong) f; - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, jf ); - - return true; -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: mainloop - * Signature: ()V - */ -JNIEXPORT void JNICALL -Java_vrpn_ForceDeviceRemote_mainloop( JNIEnv* env, jobject jobj ) -{ - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) // this force device is uninitialized or has been shut down already - return; - - // now call mainloop - f->mainloop( ); -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: shutdownForceDevice - * Signature: ()V - */ -JNIEXPORT void JNICALL -Java_vrpn_ForceDeviceRemote_shutdownForceDevice( JNIEnv* env, jobject jobj ) -{ - // get the force device pointer - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - // unregister a handler and destroy the force device - if( f > 0 ) - { - f->unregister_force_change_handler( jobj, handle_force_change ); - f->unregister_scp_change_handler( jobj, handle_scp_change ); - f->unregister_error_handler( jobj, handle_force_error ); - f->connectionPtr()->removeReference(); // because we called vrpn_get_connection_by_name - delete f; - } - - // set the force device pointer to -1 - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, -1 ); - - // delete global reference to object (that was created in init) - env->DeleteGlobalRef( jobj ); -} - - -// end java_vrpn utility functions -//////////////////////////////////// - - -//////////////////////////////////// -// native functions from java class ForceDeviceRemote - -/* - * Class: vrpn_ForceDeviceRemote - * Method: sendForceField - * Signature: ()V - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_ForceDeviceRemote_sendForceField_1native__( JNIEnv* env, jobject jobj ) -{ - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - - f->sendForceField( ); - return true; -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: stopForceField - * Signature: ()V - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_ForceDeviceRemote_stopForceField_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - - f->stopForceField( ); - return true; -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: sendForceField - * Signature: ([F[F[[FF)V - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_ForceDeviceRemote_sendForceField_1native___3F_3F_3_3FF( JNIEnv* env, jobject jobj, - jfloatArray jorigin, - jfloatArray jforce, - jobjectArray jjacobian, - jfloat jradius ) -{ - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - - // get the arguments - jfloat origin[3]; - jfloat force[3]; - jfloat jacobian_row0[3]; - jfloat jacobian_row1[3]; - jfloat jacobian_row2[3]; - jfloatArray jacobian_row; - - if( env->GetArrayLength( jorigin ) != 3 ) - return false; - env->GetFloatArrayRegion( jorigin, 0, 3, origin); - - if( env->GetArrayLength( jforce ) != 3 ) - return false; - env->GetFloatArrayRegion( jforce, 0, 3, force ); - - if( env->GetArrayLength( jjacobian ) != 3 ) - return false; - jacobian_row = (jfloatArray) env->GetObjectArrayElement( jjacobian, 0 ); - if( jacobian_row == NULL ) - return false; - if( env->GetArrayLength( jacobian_row ) != 3 ) - return false; - env->GetFloatArrayRegion( jacobian_row, 0, 3, jacobian_row0 ); - - jacobian_row = (jfloatArray) env->GetObjectArrayElement( jjacobian, 1 ); - if( jacobian_row == NULL ) - return false; - if( env->GetArrayLength( jacobian_row ) != 3 ) - return false; - env->GetFloatArrayRegion( jacobian_row, 0, 3, jacobian_row1 ); - - jacobian_row = (jfloatArray) env->GetObjectArrayElement( jjacobian, 2 ); - if( jacobian_row == NULL ) - return false; - if( env->GetArrayLength( jacobian_row ) != 3 ) - return false; - env->GetFloatArrayRegion( jacobian_row, 0, 3, jacobian_row2 ); - - - float jacobian[3][3]; - jacobian[0][0] = jacobian_row0[0]; - jacobian[0][1] = jacobian_row0[1]; - jacobian[0][2] = jacobian_row0[2]; - jacobian[1][0] = jacobian_row1[0]; - jacobian[1][1] = jacobian_row1[1]; - jacobian[1][2] = jacobian_row1[2]; - jacobian[2][0] = jacobian_row1[0]; - jacobian[2][1] = jacobian_row1[1]; - jacobian[2][2] = jacobian_row1[2]; - - - // now call the function - f->sendForceField( origin, force, jacobian, jradius ); - return true; - -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: enableConstraint - * Signature: (I)V - */ -JNIEXPORT jboolean JNICALL Java_vrpn_ForceDeviceRemote_enableConstraint_1native - (JNIEnv *env, jobject jobj, jint on_int) -{ - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - - // now call the function - f->enableConstraint( on_int ); - return true; -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: setConstraintMode - * Signature: (I)V - */ -JNIEXPORT jboolean JNICALL Java_vrpn_ForceDeviceRemote_setConstraintMode_1native - (JNIEnv *env, jobject jobj, jint mode) -{ - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - - // now call the function - f->setConstraintMode( (vrpn_ForceDevice::ConstraintGeometry)mode ); - return true; -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: setConstraintPoint - * Signature: ([F)V - */ -JNIEXPORT jboolean JNICALL Java_vrpn_ForceDeviceRemote_setConstraintPoint_1native - (JNIEnv* env, jobject jobj, jfloatArray jpoint) -{ - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - - // get the arguments - jfloat point[3]; - - if( env->GetArrayLength( jpoint ) != 3 ) - return false; - env->GetFloatArrayRegion( jpoint, 0, 3, point ); - - // now call the function - f->setConstraintPoint( point ); - return true; -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: setConstraintLinePoint - * Signature: ([F)V - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_ForceDeviceRemote_setConstraintLinePoint_1native( JNIEnv* env, jobject jobj, jfloatArray jpoint ) -{ - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - - // get the arguments - jfloat point[3]; - - if( env->GetArrayLength( jpoint ) != 3 ) - return false; - env->GetFloatArrayRegion( jpoint, 0, 3, point ); - - // now call the function - f->setConstraintLinePoint( point ); - return true; -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: setConstraintLineDirection - * Signature: ([F)V - */ -JNIEXPORT jboolean JNICALL Java_vrpn_ForceDeviceRemote_setConstraintLineDirection_1native - (JNIEnv* env, jobject jobj, jfloatArray jpoint) -{ - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - - // get the arguments - jfloat point[3]; - - if( env->GetArrayLength( jpoint ) != 3 ) - return false; - env->GetFloatArrayRegion( jpoint, 0, 3, point ); - - // now call the function - f->setConstraintLineDirection( point ); - return true; -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: setConstraintPlaneNormal - * Signature: ([F)V - */ -JNIEXPORT jboolean JNICALL Java_vrpn_ForceDeviceRemote_setConstraintPlaneNormal_1native - (JNIEnv* env, jobject jobj, jfloatArray jpoint) -{ - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - - // get the arguments - jfloat point[3]; - - if( env->GetArrayLength( jpoint ) != 3 ) - return false; - env->GetFloatArrayRegion( jpoint, 0, 3, point ); - - // now call the function - f->setConstraintPlaneNormal( point ); - return true; -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: setConstraintPlanePoint - * Signature: ([F)V - */ -JNIEXPORT jboolean JNICALL Java_vrpn_ForceDeviceRemote_setConstraintPlanePoint_1native - (JNIEnv* env, jobject jobj, jfloatArray jpoint) -{ - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - - // get the arguments - jfloat point[3]; - - if( env->GetArrayLength( jpoint ) != 3 ) - return false; - env->GetFloatArrayRegion( jpoint, 0, 3, point ); - - // now call the function - f->setConstraintPlanePoint( point ); - return true; -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: setConstraintKSpring - * Signature: (F)V - */ -JNIEXPORT jboolean JNICALL Java_vrpn_ForceDeviceRemote_setConstraintKSpring_1native - (JNIEnv* env, jobject jobj, jfloat springConst) -{ - vrpn_ForceDevice_Remote* f = (vrpn_ForceDevice_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - - // now call the function - f->setConstraintKSpring( springConst ); - return true; -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: setTriangle - * Signature: (IIIIIII)V - */ -JNIEXPORT void JNICALL Java_vrpn_ForceDeviceRemote_setTriangle_1native - (JNIEnv *, jobject, jint, jint, jint, jint, jint, jint, jint) -{ - printf( "Function Java_vrpn_ForceDeviceRemote_setTriangle is not implemented.\n" ); -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: useHcollide - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_vrpn_ForceDeviceRemote_useHcollide_1native - (JNIEnv *, jobject) -{ - printf( "Function Java_vrpn_ForceDeviceRemote_useHcollide is not implemented.\n" ); -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: useGhost - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_vrpn_ForceDeviceRemote_useGhost_1native - (JNIEnv *, jobject) -{ - printf( "Function Java_vrpn_ForceDeviceRemote_useGhost is not implemented.\n" ); -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: setTrimeshTransform - * Signature: ([F)V - */ -JNIEXPORT void JNICALL Java_vrpn_ForceDeviceRemote_setTrimeshTransform_1native - (JNIEnv *, jobject, jfloatArray) -{ - printf( "Function Java_vrpn_ForceDeviceRemote_setTrimeshTransform is not implemented.\n" ); -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: updateTrimeshChanges - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_vrpn_ForceDeviceRemote_updateTrimeshChanges_1native - (JNIEnv *, jobject) -{ - printf( "Function Java_vrpn_ForceDeviceRemote_updateTrimeshChanges is not implemented.\n" ); -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: clearTrimesh - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_vrpn_ForceDeviceRemote_clearTrimesh_1native - (JNIEnv *, jobject) -{ - printf( "Function Java_vrpn_ForceDeviceRemote_clearTrimesh is not implemented.\n" ); -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: sendSurface - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_vrpn_ForceDeviceRemote_sendSurface_1native - (JNIEnv *, jobject) -{ - printf( "Function Java_vrpn_ForceDeviceRemote_sendSurface is not implemented.\n" ); -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: startSurface - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_vrpn_ForceDeviceRemote_startSurface_1native - (JNIEnv *, jobject) -{ - printf( "Function Java_vrpn_ForceDeviceRemote_startSurface is not implemented.\n" ); -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: stopSurface - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_vrpn_ForceDeviceRemote_stopSurface_1native - (JNIEnv *, jobject) -{ - printf( "Function Java_vrpn_ForceDeviceRemote_stopSurface is not implemented.\n" ); -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: setVertex - * Signature: (IFFF)V - */ -JNIEXPORT void JNICALL Java_vrpn_ForceDeviceRemote_setVertex_1native - (JNIEnv *, jobject, jint, jfloat, jfloat, jfloat) -{ - printf( "Function Java_vrpn_ForceDeviceRemote_setVertex is not implemented.\n" ); -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: setNormal - * Signature: (IFFF)V - */ -JNIEXPORT void JNICALL Java_vrpn_ForceDeviceRemote_setNormal_1native - (JNIEnv *, jobject, jint, jfloat, jfloat, jfloat) -{ - printf( "Function Java_vrpn_ForceDeviceRemote_setNormal is not implemented.\n" ); -} - - -/* - * Class: vrpn_ForceDeviceRemote - * Method: removeTriangle - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_vrpn_ForceDeviceRemote_removeTriangle_1native - (JNIEnv *, jobject, jint) -{ - printf( "Function Java_vrpn_ForceDeviceRemote_removeTriangle is not implemented.\n" ); -} - - -// end native functions for java class ForceDeviceRemote -/////////////////////////////////////////// - - diff --git a/src/vrpn/java_vrpn/vrpn_FunctionGeneratorRemote.cpp b/src/vrpn/java_vrpn/vrpn_FunctionGeneratorRemote.cpp deleted file mode 100644 index c7920a2a487be7cdbf73c3343bbe27b028099bf5..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn_FunctionGeneratorRemote.cpp +++ /dev/null @@ -1,572 +0,0 @@ - -#include <typeinfo> -#include <iostream> -#include <jni.h> -#include <vrpn_FunctionGenerator.h> - -#include "java_vrpn.h" -#include "vrpn_FunctionGeneratorRemote.h" - - -jclass jclass_vrpn_FunctionGeneratorRemote = NULL; -extern jfieldID jfid_vrpn_VRPNDevice_native_device; - - -////////////////////////// -// DLL functions - -// This is called when the Java Virtual Machine loads this library -// and sets some global references that are used elsewhere. -JNIEXPORT jint JNICALL JNI_OnLoad_FunctionGenerator_Remote( JavaVM* jvm, void* reserved ) -{ - /////////////// - // make sure the general library code set jvm - if( jvm == NULL ) - { - printf( "vrpn_FunctionGeneratorRemote native: no jvm.\n" ); - return JNI_ERR; - } - - /////////////// - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error loading vrpn FunctionGeneratorRemote native library.\n" ); - return JNI_ERR; - } - - /////////////// - // get the jclass reference to vrpn.FunctionGeneratorRemote - jclass cls = env->FindClass( "vrpn/FunctionGeneratorRemote" ); - if( cls == NULL ) - { - printf( "Error loading vrpn FunctionGeneratorRemote native library " - "while trying to find class vrpn.FunctionGeneratorRemote.\n" ); - return JNI_ERR; - } - - // make a global reference so the class can be referenced later. - // this must be a _WEAK_ global reference, so the class will be - // garbage collected, and so the JNI_OnUnLoad handler will be called - jclass_vrpn_FunctionGeneratorRemote = (jclass) env->NewWeakGlobalRef( cls ); - if( jclass_vrpn_FunctionGeneratorRemote == NULL ) - { - printf( "Error loading vrpn FunctionGeneratorRemote native library " - "while setting up class vrpn.FunctionGeneratorRemote.\n" ); - return JNI_ERR; - } - - return JAVA_VRPN_JNI_VERSION; -} // end JNI_OnLoad - - - -JNIEXPORT void JNICALL JNI_OnUnload_FunctionGenerator_Remote( JavaVM* jvm, void* reserved ) -{ - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error unloading vrpn FunctionGeneratorRemote native library.\n" ); - return; - } - - // delete the global reference to the vrpn.ForceDeviceRemote class - env->DeleteWeakGlobalRef( jclass_vrpn_FunctionGeneratorRemote ); -} - -// end DLL functions -///////////////////////////// - - -///////////////////////////// -// java_vrpn utility funcitons - -void VRPN_CALLBACK handle_channel_reply( void *userdata, - const vrpn_FUNCTION_CHANNEL_REPLY_CB info ) -{ - if( jvm == NULL ) - { - printf( "Error in handle_channel_reply: uninitialized jvm.\n" ); - return; - } - - /* - printf( "fg channel change (C): time: %d.%d;\n" - info.msg_time.tv_sec, info.msg_time.tv_usec ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - - //determine what type of channel change this is - const vrpn_FunctionGenerator_function* fxn = info.channel->getFunction(); - jmethodID jmid = NULL; - if( typeid( *fxn ) == typeid( vrpn_FunctionGenerator_function_NULL ) ) - { - jmid = env->GetMethodID( jcls, "handleChannelChange_NULL", "(JJI)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_FunctionGeneratorRemote library was unable to find the " - "Java method \'handleChannelChange_NULL\'. This may indicate a version mismatch.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jint) info.channelNum ); - } - else if( typeid( *fxn ) == typeid( vrpn_FunctionGenerator_function_script ) ) - { - jmid = env->GetMethodID( jcls, "handleChannelChange_Script", "(JJILjava/lang/String;)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_FunctionGeneratorRemote library was unable to find the " - "Java method \'handleChannelChange_Script\'. This may indicate a version mismatch.\n" ); - return; - } - jstring jscript - = env->NewStringUTF( (dynamic_cast<const vrpn_FunctionGenerator_function_script*>(fxn))->getScript() ); - if( jscript == NULL ) // out of memory - { - printf( "Error: vrpn_FunctionGeneratorRemote library (handle_channel_reply) " - "was unable to create the script string.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jint) info.channelNum, jscript ); - } - else - { - printf( "Error: vrpn_FunctionGeneratorRemote library (handle_channel_reply): unknown function type\n" ); - std::cout << "handle_channel_reply: function type " << typeid( *fxn ).name() << std::endl; - return; - } -} - - -void VRPN_CALLBACK handle_start( void *userdata, - const vrpn_FUNCTION_START_REPLY_CB info ) -{ - if( jvm == NULL ) - { - printf( "Error in handle_start: uninitialized jvm.\n" ); - return; - } - /* - printf( "fg start (C): time: %d.%d;\n" - info.msg_time.tv_sec, info.msg_time.tv_usec ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - - jmethodID jmid = env->GetMethodID( jcls, "handleStartReply", "(JJZ)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_FunctionGeneratorRemote library was unable to find the " - "Java method \'handleStartReply\'. This may indicate a version mismatch.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jboolean) info.isStarted ); -} - - -void VRPN_CALLBACK handle_stop( void *userdata, - const vrpn_FUNCTION_STOP_REPLY_CB info ) -{ - if( jvm == NULL ) - { - printf( "Error in handle_stop: uninitialized jvm.\n" ); - return; - } - /* - printf( "fg stop (C): time: %d.%d;\n" - info.msg_time.tv_sec, info.msg_time.tv_usec ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - - jmethodID jmid = env->GetMethodID( jcls, "handleStopReply", "(JJZ)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_FunctionGeneratorRemote library was unable to find the " - "Java method \'handleStopReply\'. This may indicate a version mismatch.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jboolean) info.isStopped ); -} - - -void VRPN_CALLBACK handle_sample_rate( void *userdata, - const vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB info ) -{ - if( jvm == NULL ) - { - printf( "Error in handle_sample_rate: uninitialized jvm.\n" ); - return; - } - /* - printf( "fg sample rate (C): time: %d.%d;\n" - info.msg_time.tv_sec, info.msg_time.tv_usec ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - - jmethodID jmid = env->GetMethodID( jcls, "handleSampleRateReply", "(JJD)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_FunctionGeneratorRemote library was unable to find the " - "Java method \'handleSampleRateReply\'. This may indicate a version mismatch.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jdouble) info.sampleRate ); -} - - -void VRPN_CALLBACK handle_interpreter_description( void *userdata, - const vrpn_FUNCTION_INTERPRETER_REPLY_CB info ) -{ - if( jvm == NULL ) - { - printf( "Error in handle_interpreter_description: uninitialized jvm.\n" ); - return; - } - /* - printf( "fg interpreter description (C): time: %d.%d;\n" - info.msg_time.tv_sec, info.msg_time.tv_usec ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - - jmethodID jmid = env->GetMethodID( jcls, "handleInterpreterDescription", "(JJLjava/lang/String;)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_FunctionGeneratorRemote library was unable to find the " - "Java method \'handleInterpreterDescription\'. This may indicate a version mismatch.\n" ); - return; - } - - jstring jdesc = env->NewStringUTF( info.description ); - if( jdesc == NULL ) // out of memory - { - printf( "Warning: vrpn_FunctionGeneratorRemote library (handle_interpreter_description) " - "was unable to create the description string.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, jdesc ); -} - - -void VRPN_CALLBACK handle_error( void *userdata, - const vrpn_FUNCTION_ERROR_CB info ) -{ - if( jvm == NULL ) - { - printf( "Error in handle_error: uninitialized jvm.\n" ); - return; - } - /* - printf( "fg error (C): time: %d.%d;\n" - info.msg_time.tv_sec, info.msg_time.tv_usec ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - - jmethodID jmid = env->GetMethodID( jcls, "handleErrorReport", "(JJII)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_FunctionGeneratorRemote library was unable to find the " - "Java method \'handleErrorReport\'. This may indicate a version mismatch.\n" ); - return; - } - - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jint) info.err, (jint) info.channel ); -} - - -/* -* Class: vrpn_FunctionGeneratorRemote -* Method: init -* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z -*/ -JNIEXPORT jboolean JNICALL -Java_vrpn_FunctionGeneratorRemote_init( JNIEnv* env, jobject jobj, jstring jname, - jstring jlocalInLogfileName, jstring jlocalOutLogfileName, - jstring jremoteInLogfileName, jstring jremoteOutLogfileName ) -{ - // make a global reference to the Java FunctionGeneratorRemote - // object, so that it can be referenced in the functions - // handle_*_change(...) - jobj = env->NewGlobalRef( jobj ); - - // create the function generator - const char* name = env->GetStringUTFChars( jname, NULL ); - const char* local_in_logfile_name = jlocalInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalInLogfileName, NULL ); - const char* local_out_logfile_name = jlocalOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalOutLogfileName, NULL ); - const char* remote_in_logfile_name = jremoteInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteInLogfileName, NULL ); - const char* remote_out_logfile_name = jremoteOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteOutLogfileName, NULL ); - vrpn_Connection* conn - = vrpn_get_connection_by_name( name, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name ); - vrpn_FunctionGenerator_Remote* f = new vrpn_FunctionGenerator_Remote( name, conn ); - f->register_channel_reply_handler( jobj, handle_channel_reply ); - f->register_start_reply_handler( jobj, handle_start ); - f->register_stop_reply_handler( jobj, handle_stop ); - f->register_sample_rate_reply_handler( jobj, handle_sample_rate ); - f->register_interpreter_reply_handler( jobj, handle_interpreter_description ); - f->register_error_handler( jobj, handle_error ); - env->ReleaseStringUTFChars( jname, name ); - env->ReleaseStringUTFChars( jlocalInLogfileName, local_in_logfile_name ); - env->ReleaseStringUTFChars( jlocalOutLogfileName, local_out_logfile_name ); - env->ReleaseStringUTFChars( jremoteInLogfileName, remote_in_logfile_name ); - env->ReleaseStringUTFChars( jremoteOutLogfileName, remote_out_logfile_name ); - - // now stash 'f' in the jobj's 'native_device' field - jlong jf = (jlong) f; - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, jf ); - - return true; -} - - -/* -* Class: vrpn_FunctionGeneratorRemote -* Method: shutdownFunctionGenerator -* Signature: ()V -*/ -JNIEXPORT void JNICALL -Java_vrpn_FunctionGeneratorRemote_shutdownFunctionGenerator( JNIEnv* env, jobject jobj ) -{ - // get the function generator pointer - vrpn_FunctionGenerator_Remote* f = (vrpn_FunctionGenerator_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - // unregister a handler and destroy the force device - if( f > 0 ) - { - f->unregister_channel_reply_handler( jobj, handle_channel_reply ); - f->unregister_start_reply_handler( jobj, handle_start ); - f->unregister_stop_reply_handler( jobj, handle_stop ); - f->unregister_sample_rate_reply_handler( jobj, handle_sample_rate ); - f->unregister_interpreter_reply_handler( jobj, handle_interpreter_description ); - f->unregister_error_handler( jobj, handle_error ); - f->connectionPtr()->removeReference(); // because we called vrpn_get_connection_by_name - delete f; - } - - // set the force device pointer to -1 - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, -1 ); - - // delete global reference to object (that was created in init) - env->DeleteGlobalRef( jobj ); -} - - -/* -* Class: vrpn_FunctionGeneratorRemote -* Method: mainloop -* Signature: ()V -*/ -JNIEXPORT void JNICALL -Java_vrpn_FunctionGeneratorRemote_mainloop( JNIEnv* env, jobject jobj ) -{ - vrpn_FunctionGenerator_Remote* f = (vrpn_FunctionGenerator_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) // this force device is uninitialized or has been shut down already - return; - - // now call mainloop - f->mainloop( ); -} - -// end java_vrpn utility functions -//////////////////////////////////// - - -//////////////////////////////////// -// native functions from java class FunctionGeneratorRemote - -/* - * Class: vrpn_FunctionGeneratorRemote - * Method: setChannelNULL_native - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_FunctionGeneratorRemote_setChannelNULL_1native( JNIEnv* env, jobject jobj, jint jchannelNum ) -{ - vrpn_FunctionGenerator_Remote* f = (vrpn_FunctionGenerator_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - if( jchannelNum < 0 ) - return false; - vrpn_FunctionGenerator_channel c; - vrpn_FunctionGenerator_function_NULL func; - c.setFunction( &func ); - if( f->setChannel( jchannelNum, &c ) < 0 ) - return false; - return true; -} - - -/* - * Class: vrpn_FunctionGeneratorRemote - * Method: setChannelScript_native - * Signature: (ILjava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_FunctionGeneratorRemote_setChannelScript_1native( JNIEnv* env, jobject jobj, jint jchannelNum, jstring jscript ) -{ - vrpn_FunctionGenerator_Remote* f = (vrpn_FunctionGenerator_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - if( jchannelNum < 0 ) - return false; - vrpn_FunctionGenerator_channel c; - const char* msg = env->GetStringUTFChars( jscript, NULL ); - vrpn_FunctionGenerator_function_script func( msg ); - env->ReleaseStringUTFChars( jscript, msg ); - c.setFunction( &func ); - if( f->setChannel( jchannelNum, &c ) < 0 ) - return false; - return true; -} - - -/* -* Class: vrpn_FunctionGeneratorRemote -* Method: requestChannel_native -* Signature: (I)I -*/ -JNIEXPORT jboolean JNICALL -Java_vrpn_FunctionGeneratorRemote_requestChannel_1native( JNIEnv* env, jobject jobj, jint jchannelNum ) -{ - vrpn_FunctionGenerator_Remote* f = (vrpn_FunctionGenerator_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - if( jchannelNum < 0 ) - return false; - if( f->requestChannel( jchannelNum ) < 0 ) - return false; - return true; -} - - -/* -* Class: vrpn_FunctionGeneratorRemote -* Method: requestAllChannels_native -* Signature: ()I -*/ -JNIEXPORT jboolean JNICALL -Java_vrpn_FunctionGeneratorRemote_requestAllChannels_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_FunctionGenerator_Remote* f = (vrpn_FunctionGenerator_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - if( f->requestAllChannels( ) < 0 ) - return false; - return true; -} - - -/* -* Class: vrpn_FunctionGeneratorRemote -* Method: requestStart_native -* Signature: ()I -*/ -JNIEXPORT jboolean JNICALL -Java_vrpn_FunctionGeneratorRemote_requestStart_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_FunctionGenerator_Remote* f = (vrpn_FunctionGenerator_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - if( f->requestStart( ) < 0 ) - return false; - return true; -} - - -/* -* Class: vrpn_FunctionGeneratorRemote -* Method: requestStop_native -* Signature: ()I -*/ -JNIEXPORT jboolean JNICALL -Java_vrpn_FunctionGeneratorRemote_requestStop_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_FunctionGenerator_Remote* f = (vrpn_FunctionGenerator_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - if( f->requestStop( ) < 0 ) - return false; - return true; -} - - -/* -* Class: vrpn_FunctionGeneratorRemote -* Method: requestSampleRate_native -* Signature: (F)I -*/ -JNIEXPORT jboolean JNICALL \ -Java_vrpn_FunctionGeneratorRemote_requestSampleRate_1native( JNIEnv* env, jobject jobj, jfloat jrate) -{ - vrpn_FunctionGenerator_Remote* f = (vrpn_FunctionGenerator_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - if( jrate < 0 ) - return false; - if( f->requestSampleRate( jrate ) < 0 ) - return false; - return true; -} - - -/* -* Class: vrpn_FunctionGeneratorRemote -* Method: requestInterpreterDescription_native -* Signature: ()I -*/ -JNIEXPORT jboolean JNICALL -Java_vrpn_FunctionGeneratorRemote_requestInterpreterDescription_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_FunctionGenerator_Remote* f = (vrpn_FunctionGenerator_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( f <= 0 ) - return false; - if( f->requestInterpreterDescription( ) < 0 ) - return false; - return true; -} - - -// end native functions for java class ForceDeviceRemote -/////////////////////////////////////////// - - diff --git a/src/vrpn/java_vrpn/vrpn_PoserRemote.cpp b/src/vrpn/java_vrpn/vrpn_PoserRemote.cpp deleted file mode 100644 index cf6cd9d753ca8b6b56ba73a5c935e522c3396b94..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn_PoserRemote.cpp +++ /dev/null @@ -1,427 +0,0 @@ -#include <stdio.h> -#include <jni.h> -#include "java_vrpn.h" -#include "vrpn_Poser.h" -#include "vrpn_PoserRemote.h" - - -jclass jclass_vrpn_PoserRemote = NULL; -extern jfieldID jfid_vrpn_VRPNDevice_native_device; - - -////////////////////////// -// DLL functions - - -// This is called when the Java Virtual Machine loads this library -// and sets some global references that are used elsewhere. -JNIEXPORT jint JNICALL JNI_OnLoad_Poser_Remote( JavaVM* jvm, void* reserved ) -{ - /////////////// - // make sure the general library code set jvm - if( jvm == NULL ) - { - printf( "vrpn_PoserRemote native: no jvm.\n" ); - return JNI_ERR; - } - - /////////////// - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error loading vrpn PoserRemote native library.\n" ); - return JNI_ERR; - } - - /////////////// - // get the jclass reference to vrpn.PoserRemote - jclass cls = env->FindClass( "vrpn/PoserRemote" ); - if( cls == NULL ) - { - printf( "Error loading vrpn PoserRemote native library " - "while trying to find java class vrpn.PoserRemote.\n" ); - return JNI_ERR; - } - - // make a global reference so the class can be referenced later. - // this must be a _WEAK_ global reference, so the class will be - // garbage collected, and so the JNI_OnUnLoad handler will be called - jclass_vrpn_PoserRemote = (jclass) env->NewWeakGlobalRef( cls ); - if( jclass_vrpn_PoserRemote == NULL ) - { - printf( "Error loading vrpn PoserRemote native library " - "while setting up class vrpn.PoserRemote.\n" ); - return JNI_ERR; - } - - return JAVA_VRPN_JNI_VERSION; -} // end JNI_OnLoad - - -JNIEXPORT void JNICALL JNI_OnUnload_Poser_Remote( JavaVM* jvm, void* reserved ) -{ - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error unloading vrpn PoserRemote native library.\n" ); - return; - } - - // delete the global reference to the vrpn.poserRemote class - env->DeleteWeakGlobalRef( jclass_vrpn_PoserRemote ); -} - - -// end DLL functions -///////////////////////////// - - -/* - * Class: vrpn_PoserRemote - * Method: mainloop - * Signature: ()V - */ -JNIEXPORT void JNICALL -Java_vrpn_PoserRemote_mainloop( JNIEnv* env, jobject jobj ) -{ - vrpn_Poser_Remote* po - = (vrpn_Poser_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - if( po > 0 ) - po->mainloop( ); -} - - -/* - * Class: vrpn_PoserRemote - * Method: shutdownPoser - * Signature: ()V - */ -JNIEXPORT void JNICALL -Java_vrpn_PoserRemote_shutdownPoser( JNIEnv* env, jobject jobj ) -{ - // get the poser pointers - vrpn_Poser_Remote* po - = (vrpn_Poser_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - if( po > 0 ) - { - po->connectionPtr()->removeReference(); // because we called vrpn_get_connection_by_name - delete po; - } - - // set the poser pointers to -1 - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, -1 ); - - // delete global reference to object (that was created in init) - env->DeleteGlobalRef( jobj ); -} - - -/* - * Class: vrpn_PoserRemote - * Method: init - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_PoserRemote_init( JNIEnv* env, jobject jobj, jstring jname, - jstring jlocalInLogfileName, jstring jlocalOutLogfileName, - jstring jremoteInLogfileName, jstring jremoteOutLogfileName ) -{ - // make a global reference to the Java PoserRemote - // object, so it can be referenced by native code - jobj = env->NewGlobalRef( jobj ); - - // create the poser - const char* name = env->GetStringUTFChars( jname, NULL ); - const char* local_in_logfile_name = jlocalInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalInLogfileName, NULL ); - const char* local_out_logfile_name = jlocalOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalOutLogfileName, NULL ); - const char* remote_in_logfile_name = jremoteInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteInLogfileName, NULL ); - const char* remote_out_logfile_name = jremoteOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteOutLogfileName, NULL ); - vrpn_Connection* conn - = vrpn_get_connection_by_name( name, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name ); - vrpn_Poser_Remote* po = new vrpn_Poser_Remote( name, conn ); - env->ReleaseStringUTFChars( jname, name ); - env->ReleaseStringUTFChars( jlocalInLogfileName, local_in_logfile_name ); - env->ReleaseStringUTFChars( jlocalOutLogfileName, local_out_logfile_name ); - env->ReleaseStringUTFChars( jremoteInLogfileName, remote_in_logfile_name ); - env->ReleaseStringUTFChars( jremoteOutLogfileName, remote_out_logfile_name ); - - // now stash 'po' in the jobj's 'native_device field - jlong jpo = (jlong) po; - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, jpo ); - - return true; -} - - -/* - * Class: vrpn_PoserRemote - * Method: requestPose_native - * Signature: (JJ[D[D)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_PoserRemote_requestPose_1native( JNIEnv* env, jobject jobj, - jlong jsecs, jlong jusecs, - jdoubleArray jposition, jdoubleArray jquat ) -{ - // get the poser pointer - vrpn_Poser_Remote* po - = (vrpn_Poser_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( po <= 0 ) // this poser is uninitialized or has been shut down already - { - printf( "Error in native method \"requestPose(long,long,double[],double[])\": " - "the poser is uninitialized or has been shut down.\n" ); - return false; - } - - // check the array lengths - if( env->GetArrayLength( jposition ) != 3 ) - { - printf( "Error in native method \"requestPose(long,long,double[],double[])\": " - "position array was the wrong length.\n" ); - return false; - } - if( env->GetArrayLength( jquat ) != 4 ) - { - printf( "Error in native method \"requestPose(long,long,double[],double[])\": " - "quaternion array was the wrong length.\n" ); - return false; - } - - // eventual return value - bool retval = true; - - // get the array - double* position = env->GetDoubleArrayElements( jposition, NULL ); - if( position == NULL ) - { - printf( "Error in native method \"requestPose(long,long,double[],double[])\": " - "couldn't get position in native form.\n" ); - retval = false; - } - double* quat = env->GetDoubleArrayElements( jquat, NULL ); - if( quat == NULL ) - { - printf( "Error in native method \"requestPose(long,long,double[],double[])\": " - "couldn't get quaternion in native form.\n" ); - retval = false; - } - - timeval t; - t.tv_sec = (long) jsecs; - t.tv_usec = (long) jusecs; - - if( retval == true ) - retval = ( 0 != po->request_pose( t, position, quat ) ); - env->ReleaseDoubleArrayElements( jposition, position, JNI_ABORT /*mode*/ ); - env->ReleaseDoubleArrayElements( jquat, quat, JNI_ABORT /*mode*/ ); - return retval; -} - - -/* - * Class: vrpn_PoserRemote - * Method: requestPoseRelative_native - * Signature: (JJ[D[D)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_PoserRemote_requestPoseRelative_1native( JNIEnv* env, jobject jobj, - jlong jsecs, jlong jusecs, - jdoubleArray jpositionDelta, jdoubleArray jquat ) - -{ - // get the poser pointer - vrpn_Poser_Remote* po - = (vrpn_Poser_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( po <= 0 ) // this poser is uninitialized or has been shut down already - { - printf( "Error in native method \"requestPoseRelative(long,long,double[],double[])\": " - "the poser is uninitialized or has been shut down.\n" ); - return false; - } - - // check the array lengths - if( env->GetArrayLength( jpositionDelta ) != 3 ) - { - printf( "Error in native method \"requestPoseRelative(long,long,double[],double[])\": " - "position array was the wrong length.\n" ); - return false; - } - if( env->GetArrayLength( jquat ) != 4 ) - { - printf( "Error in native method \"requestPoseRelative(long,long,double[],double[])\": " - "quaternion array was the wrong length.\n" ); - return false; - } - - // eventual return value - bool retval = true; - - // get the array - double* position = env->GetDoubleArrayElements( jpositionDelta, NULL ); - if( position == NULL ) - { - printf( "Error in native method \"requestPoseRelative(long,long,double[],double[])\": " - "couldn't get position in native form.\n" ); - retval = false; - } - double* quat = env->GetDoubleArrayElements( jquat, NULL ); - if( quat == NULL ) - { - printf( "Error in native method \"requestPoseRelative(long,long,double[],double[])\": " - "couldn't get quaternion in native form.\n" ); - retval = false; - } - - timeval t; - t.tv_sec = (long) jsecs; - t.tv_usec = (long) jusecs; - - if( retval == true ) - retval = ( 0 != po->request_pose_relative( t, position, quat ) ); - env->ReleaseDoubleArrayElements( jpositionDelta, position, JNI_ABORT /*mode*/ ); - env->ReleaseDoubleArrayElements( jquat, quat, JNI_ABORT /*mode*/ ); - return retval; -} - - -/* - * Class: vrpn_PoserRemote - * Method: requestPoseVelocity_native - * Signature: (JJ[D[DD)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_PoserRemote_requestVelocity_1native( JNIEnv* env, jobject jobj, - jlong jsecs, jlong jusecs, - jdoubleArray jvelocity, jdoubleArray jquat, - jdouble jinterval ) -{ - // get the poser pointer - vrpn_Poser_Remote* po - = (vrpn_Poser_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( po <= 0 ) // this poser is uninitialized or has been shut down already - { - printf( "Error in native method \"requestVelocity(long,long,double[],double[],double)\": " - "the poser is uninitialized or has been shut down.\n" ); - return false; - } - - // check the array lengths - if( env->GetArrayLength( jvelocity ) != 3 ) - { - printf( "Error in native method \"requestVelocity(long,long,double[],double[],double)\": " - "position array was the wrong length.\n" ); - return false; - } - if( env->GetArrayLength( jquat ) != 4 ) - { - printf( "Error in native method \"requestVelocity(long,long,double[],double[],double)\": " - "quaternion array was the wrong length.\n" ); - return false; - } - - // eventual return value - bool retval = true; - - // get the array - double* position = env->GetDoubleArrayElements( jvelocity, NULL ); - if( position == NULL ) - { - printf( "Error in native method \"requestVelocity(long,long,double[],double[],double)\": " - "couldn't get position in native form.\n" ); - retval = false; - } - double* quat = env->GetDoubleArrayElements( jquat, NULL ); - if( quat == NULL ) - { - printf( "Error in native method \"requestVelocity(long,long,double[],double[],double)\": " - "couldn't get quaternion in native form.\n" ); - retval = false; - } - - timeval t; - t.tv_sec = (long) jsecs; - t.tv_usec = (long) jusecs; - - if( retval == true ) - retval = ( 0 != po->request_pose_velocity( t, position, quat, jinterval ) ); - env->ReleaseDoubleArrayElements( jvelocity, position, JNI_ABORT /*mode*/ ); - env->ReleaseDoubleArrayElements( jquat, quat, JNI_ABORT /*mode*/ ); - return retval; -} - - -/* - * Class: vrpn_PoserRemote - * Method: requestVelocityRelative_native - * Signature: (JJ[D[DD)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_PoserRemote_requestVelocityRelative_1native( JNIEnv* env, jobject jobj, - jlong jsecs, jlong jusecs, - jdoubleArray jvelocityDelta, - jdoubleArray jquat, - jdouble jinterval ) -{ - // get the poser pointer - vrpn_Poser_Remote* po - = (vrpn_Poser_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( po <= 0 ) // this poser is uninitialized or has been shut down already - { - printf( "Error in native method \"requestVelocityRelative(long,long,double[],double[],double)\": " - "the poser is uninitialized or has been shut down.\n" ); - return false; - } - - // check the array lengths - if( env->GetArrayLength( jvelocityDelta ) != 3 ) - { - printf( "Error in native method \"requestVelocityRelative(long,long,double[],double[],double)\": " - "position array was the wrong length.\n" ); - return false; - } - if( env->GetArrayLength( jquat ) != 4 ) - { - printf( "Error in native method \"requestVelocityRelative(long,long,double[],double[],double)\": " - "quaternion array was the wrong length.\n" ); - return false; - } - - // eventual return value - bool retval = true; - - // get the array - double* position = env->GetDoubleArrayElements( jvelocityDelta, NULL ); - if( position == NULL ) - { - printf( "Error in native method \"requestVelocityRelative(long,long,double[],double[],double)\": " - "couldn't get position in native form.\n" ); - retval = false; - } - double* quat = env->GetDoubleArrayElements( jquat, NULL ); - if( quat == NULL ) - { - printf( "Error in native method \"requestVelocityRelative(long,long,double[],double[],double)\": " - "couldn't get quaternion in native form.\n" ); - retval = false; - } - - timeval t; - t.tv_sec = (long) jsecs; - t.tv_usec = (long) jusecs; - - if( retval == true ) - retval = ( 0 != po->request_pose_velocity_relative( t, position, quat, jinterval ) ); - env->ReleaseDoubleArrayElements( jvelocityDelta, position, JNI_ABORT /*mode*/ ); - env->ReleaseDoubleArrayElements( jquat, quat, JNI_ABORT /*mode*/ ); - return retval; -} - diff --git a/src/vrpn/java_vrpn/vrpn_TextReceiver.cpp b/src/vrpn/java_vrpn/vrpn_TextReceiver.cpp deleted file mode 100644 index ae52d4f2fa083318f8fde206fda4a3b8b1041c7d..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn_TextReceiver.cpp +++ /dev/null @@ -1,210 +0,0 @@ - -#include <stdio.h> -#include <jni.h> -#include "java_vrpn.h" -#include "vrpn_Text.h" -#include "vrpn_TextReceiver.h" - - -jclass jclass_vrpn_TextReceiver = NULL; -extern jfieldID jfid_vrpn_VRPNDevice_native_device; - - -////////////////////////// -// DLL functions - - -// This is called when the Java Virtual Machine loads this library -// and sets some global references that are used elsewhere. -JNIEXPORT jint JNICALL JNI_OnLoad_Text_Receiver( JavaVM* jvm, void* reserved ) -{ - /////////////// - // make sure the general library code set jvm - if( jvm == NULL ) - { - printf( "vrpn_TextReceiver native: no jvm.\n" ); - return JNI_ERR; - } - - /////////////// - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error loading vrpn TextReceiver native library.\n" ); - return JNI_ERR; - } - - /////////////// - // get the jclass reference to vrpn.TextReceiver - jclass cls = env->FindClass( "vrpn/TextReceiver" ); - if( cls == NULL ) - { - printf( "Error loading vrpn TextReceiver native library " - "while trying to find class vrpn.TextReceiver.\n" ); - return JNI_ERR; - } - - // make a global reference so the class can be referenced later. - // this must be a _WEAK_ global reference, so the class will be - // garbage collected, and so the JNI_OnUnLoad handler will be called - jclass_vrpn_TextReceiver = (jclass) env->NewWeakGlobalRef( cls ); - if( jclass_vrpn_TextReceiver == NULL ) - { - printf( "Error loading vrpn TextReceiver native library " - "while setting up class vrpn.TextReceiver.\n" ); - return JNI_ERR; - } - - - return JAVA_VRPN_JNI_VERSION; -} // end JNI_OnLoad - - -JNIEXPORT void JNICALL JNI_OnUnload_Text_Receiver( JavaVM* jvm, void* reserved ) -{ - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error unloading vrpn TextReceiver native library.\n" ); - return; - } - - // delete the global reference to the vrpn.TrackerRemote class - env->DeleteWeakGlobalRef( jclass_vrpn_TextReceiver ); -} - - -// end DLL functions -///////////////////////////// - - -//////////////////////////// -// dll utility functions - - -// This is the callback for vrpn to notify us of a new tracker message -void VRPN_CALLBACK handle_text_message( void* userdata, const vrpn_TEXTCB info ) -{ - if( jvm == NULL ) - return; - - /* - printf( "text received (C): time: %d.%d; severity: %d; level: %d\n" - "\tmsg: %s\n", info.msg_time.tv_sec, info.msg_time.tv_usec, - info.type, info.level, info.message ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - jmethodID jmid = env->GetMethodID( jcls, "handleTextMessage", "(JJIILjava/lang/String;)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_TextReceiver library was unable to find the " - "Java method \'handleTextMessage\'. This may indicate a version mismatch.\n" ); - return; - } - - // get a string to hold the message - jstring jmsg = env->NewStringUTF( info.message ); - - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jint) info.type, (jint) info.level, jmsg ); - -} - - - -/* - * Class: vrpn_TextReceiver - * Method: mainloop - * Signature: ()V - */ -JNIEXPORT void JNICALL -Java_vrpn_TextReceiver_mainloop( JNIEnv* env, jobject jobj ) -{ - vrpn_Text_Receiver* t = (vrpn_Text_Receiver*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( t <= 0 ) // this text receiver is uninitialized or has been shut down already - return; - - // now call mainloop - t->mainloop( ); -} - - -/* - * Class: vrpn_TextReceiver - * Method: init - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_TextReceiver_init( JNIEnv* env, jobject jobj, jstring jname, - jstring jlocalInLogfileName, jstring jlocalOutLogfileName, - jstring jremoteInLogfileName, jstring jremoteOutLogfileName ) -{ - - // make a global reference to the Java TextReceiver - // object, so that it can be referenced in the function - // handle_text_message(...) - jobj = env->NewGlobalRef( jobj ); - - // create the text receiver - const char* name = env->GetStringUTFChars( jname, NULL ); - const char* local_in_logfile_name = jlocalInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalInLogfileName, NULL ); - const char* local_out_logfile_name = jlocalOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalOutLogfileName, NULL ); - const char* remote_in_logfile_name = jremoteInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteInLogfileName, NULL ); - const char* remote_out_logfile_name = jremoteOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteOutLogfileName, NULL ); - vrpn_Connection* conn - = vrpn_get_connection_by_name( name, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name ); - vrpn_Text_Receiver* t = new vrpn_Text_Receiver( name, conn ); - t->register_message_handler( jobj, handle_text_message ); - - env->ReleaseStringUTFChars( jname, name ); - env->ReleaseStringUTFChars( jlocalInLogfileName, local_in_logfile_name ); - env->ReleaseStringUTFChars( jlocalOutLogfileName, local_out_logfile_name ); - env->ReleaseStringUTFChars( jremoteInLogfileName, remote_in_logfile_name ); - env->ReleaseStringUTFChars( jremoteOutLogfileName, remote_out_logfile_name ); - - // now stash 't' in the jobj's 'native_device' field - jlong jt = (jlong) t; - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, jt ); - - - return true; -} - - -// this is only supposed to be called when the TextReceiver -// instance is finalized for garbage collection -JNIEXPORT void JNICALL -Java_vrpn_TextReceiver_shutdownTextReceiver( JNIEnv* env, jobject jobj ) -{ - // get the tracker pointer - vrpn_Text_Receiver* t = (vrpn_Text_Receiver*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - // unregister a handler and destroy the text receiver - if( t > 0 ) - { - t->unregister_message_handler( jobj, handle_text_message ); - t->connectionPtr()->removeReference(); // because we called vrpn_get_connection_by_name - delete t; - } - - // set the tracker pointer to -1 - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, -1 ); - - // delete global reference to object (that was created in init) - env->DeleteGlobalRef( jobj ); - - -} - diff --git a/src/vrpn/java_vrpn/vrpn_TextSender.cpp b/src/vrpn/java_vrpn/vrpn_TextSender.cpp deleted file mode 100644 index 279ca754f4cefdba8867d07977b8024138c7fbf5..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn_TextSender.cpp +++ /dev/null @@ -1,197 +0,0 @@ - -#include <stdio.h> -#include <jni.h> -#include "java_vrpn.h" -#include "vrpn_Text.h" -#include "vrpn_TextSender.h" - - -jclass jclass_vrpn_TextSender = NULL; -extern jfieldID jfid_vrpn_VRPNDevice_native_device; - - -////////////////////////// -// DLL functions - - -// This is called when the Java Virtual Machine loads this library -// and sets some global references that are used elsewhere. -JNIEXPORT jint JNICALL JNI_OnLoad_Text_Sender( JavaVM* jvm, void* reserved ) -{ - /////////////// - // make sure the general library code set jvm - if( jvm == NULL ) - { - printf( "vrpn_TextSender native: no jvm.\n" ); - return JNI_ERR; - } - - /////////////// - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error loading vrpn TextSender native library.\n" ); - return JNI_ERR; - } - - /////////////// - // get the jclass reference to vrpn.TextSender - jclass cls = env->FindClass( "vrpn/TextSender" ); - if( cls == NULL ) - { - printf( "Error loading vrpn TextSender native library " - "while trying to find class vrpn.TextSender.\n" ); - return JNI_ERR; - } - - // make a global reference so the class can be referenced later. - // this must be a _WEAK_ global reference, so the class will be - // garbage collected, and so the JNI_OnUnLoad handler will be called - jclass_vrpn_TextSender = (jclass) env->NewWeakGlobalRef( cls ); - if( jclass_vrpn_TextSender == NULL ) - { - printf( "Error loading vrpn TextSender native library " - "while setting up class vrpn.TextSender.\n" ); - return JNI_ERR; - } - - - return JAVA_VRPN_JNI_VERSION; -} // end JNI_OnLoad - - -JNIEXPORT void JNICALL JNI_OnUnload_Text_Sender( JavaVM* jvm, void* reserved ) -{ - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error unloading vrpn TextSender native library.\n" ); - return; - } - - // delete the global reference to the vrpn.TrackerRemote class - env->DeleteWeakGlobalRef( jclass_vrpn_TextSender ); -} - - -// end DLL functions -///////////////////////////// - - -/* - * Class: vrpn_TextSender - * Method: sendMessage_native - * Signature: (Ljava/lang/String;IIJ)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_TextSender_sendMessage_1native( JNIEnv* env, jobject jobj, jstring jmsg, jint jtype, - jint jlevel, jlong jmsecs ) -{ - // get the analog pointer - vrpn_Text_Sender* s = (vrpn_Text_Sender*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( s <= 0 ) // this analog is uninitialized or has been shut down already - { - printf( "Error in native method \"sendMessage(...)\": the text sender is " - "uninitialized or has been shut down.\n" ); - return false; - } - const char* msg = env->GetStringUTFChars( jmsg, NULL ); - timeval time; - time.tv_sec = (long) jmsecs / 1000; - time.tv_usec = (long) ( jmsecs % 1000 ) * 1000; - - int retval = s->send_message( msg, vrpn_TEXT_SEVERITY(jtype), jlevel, time ); - - env->ReleaseStringUTFChars( jmsg, msg ); - return retval; -} - - -/* - * Class: vrpn_TextSender - * Method: mainloop - * Signature: ()V - */ -JNIEXPORT void JNICALL -Java_vrpn_TextSender_mainloop( JNIEnv* env, jobject jobj ) -{ - vrpn_Text_Sender* t = (vrpn_Text_Sender*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( t <= 0 ) // this text sender is uninitialized or has been shut down already - return; - - // now call mainloop (since text sender is really a server object, call the connection's mainloop) - t->mainloop( ); - t->connectionPtr()->mainloop(); -} - - -/* - * Class: vrpn_TextSender - * Method: init - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_TextSender_init( JNIEnv* env, jobject jobj, jstring jname, - jstring jlocalInLogfileName, jstring jlocalOutLogfileName, - jstring jremoteInLogfileName, jstring jremoteOutLogfileName ) -{ - // make a global reference to the Java TextSender - // object, so that it can be referenced in the function - // handle_text_message(...) - jobj = env->NewGlobalRef( jobj ); - - // create the text Sender - const char* name = env->GetStringUTFChars( jname, NULL ); - const char* local_in_logfile_name = jlocalInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalInLogfileName, NULL ); - const char* local_out_logfile_name = jlocalOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalOutLogfileName, NULL ); - const char* remote_in_logfile_name = jremoteInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteInLogfileName, NULL ); - const char* remote_out_logfile_name = jremoteOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteOutLogfileName, NULL ); - vrpn_Connection* conn - = vrpn_create_server_connection( vrpn_DEFAULT_LISTEN_PORT_NO, local_in_logfile_name, local_out_logfile_name ); - vrpn_Text_Sender* t = new vrpn_Text_Sender( name, conn ); - - env->ReleaseStringUTFChars( jname, name ); - env->ReleaseStringUTFChars( jlocalInLogfileName, local_in_logfile_name ); - env->ReleaseStringUTFChars( jlocalOutLogfileName, local_out_logfile_name ); - env->ReleaseStringUTFChars( jremoteInLogfileName, remote_in_logfile_name ); - env->ReleaseStringUTFChars( jremoteOutLogfileName, remote_out_logfile_name ); - - // now stash 't' in the jobj's 'native_device' field - jlong jt = (jlong) t; - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, jt ); - - - return true; -} - - -// this is only supposed to be called when the TextSender -// instance is finalized for garbage collection -JNIEXPORT void JNICALL -Java_vrpn_TextSender_shutdownTextSender( JNIEnv* env, jobject jobj ) -{ - // get the tracker pointer - vrpn_Text_Sender* t = (vrpn_Text_Sender*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - // destroy the text sender - if( t > 0 ) - { - t->connectionPtr()->removeReference(); // because we called vrpn_get_connection_by_name - delete t; - } - - // set the tracker pointer to -1 - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, -1 ); - - // delete global reference to object (that was created in init) - env->DeleteGlobalRef( jobj ); - - -} - diff --git a/src/vrpn/java_vrpn/vrpn_TrackerRemote.cpp b/src/vrpn/java_vrpn/vrpn_TrackerRemote.cpp deleted file mode 100644 index eb09b61627a8f2e4fb7055cc5428c404bc067265..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn_TrackerRemote.cpp +++ /dev/null @@ -1,291 +0,0 @@ - -#include <stdio.h> -#include <jni.h> -#include "java_vrpn.h" -#include "vrpn_Tracker.h" -#include "vrpn_TrackerRemote.h" - -jclass jclass_vrpn_TrackerRemote = NULL; -extern jfieldID jfid_vrpn_VRPNDevice_native_device; - - -////////////////////////// -// DLL functions - - -// This is called when the Java Virtual Machine loads this library -// and sets some global references that are used elsewhere. -JNIEXPORT jint JNICALL JNI_OnLoad_Tracker_Remote( JavaVM* jvm, void* reserved ) -{ - /////////////// - // make sure the general library code set jvm - if( jvm == NULL ) - { - printf( "vrpn_TrackerRemote native: no jvm.\n" ); - return JNI_ERR; - } - - /////////////// - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error loading vrpn TrackerRemote native library.\n" ); - return JNI_ERR; - } - - /////////////// - // get the jclass reference to vrpn.TrackerRemote - jclass cls = env->FindClass( "vrpn/TrackerRemote" ); - if( cls == NULL ) - { - printf( "Error loading vrpn TrackerRemote native library " - "while trying to find class vrpn.TrackerRemote.\n" ); - return JNI_ERR; - } - - // make a global reference so the class can be referenced later. - // this must be a _WEAK_ global reference, so the class will be - // garbage collected, and so the JNI_OnUnLoad handler will be called - jclass_vrpn_TrackerRemote = (jclass) env->NewWeakGlobalRef( cls ); - if( jclass_vrpn_TrackerRemote == NULL ) - { - printf( "Error loading vrpn TrackerRemote native library " - "while setting up class vrpn.TrackerRemote.\n" ); - return JNI_ERR; - } - - - return JAVA_VRPN_JNI_VERSION; -} // end JNI_OnLoad - - -JNIEXPORT void JNICALL JNI_OnUnload_Tracker_Remote( JavaVM* jvm, void* reserved ) -{ - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error unloading vrpn TrackerRemote native library.\n" ); - return; - } - - // delete the global reference to the vrpn.TrackerRemote class - env->DeleteWeakGlobalRef( jclass_vrpn_TrackerRemote ); -} - - -// end DLL functions -///////////////////////////// - - -//////////////////////////// -// dll utility functions - - -// This is the callback for vrpn to notify us of a new tracker message -void VRPN_CALLBACK handle_tracker_change( void* userdata, const vrpn_TRACKERCB info ) -{ - if( jvm == NULL ) - return; - - /* - printf( "tracker change (C): time: %d.%d; sensor: %d;\n" - "\tpos: %f %f %f;\n" - "\tquat: %f %f %f %f\n", info.msg_time.tv_sec, info.msg_time.tv_usec, - info.sensor, info.pos[0], info.pos[1], info.pos[2], - info.quat[0], info.quat[1], info.quat[2], info.quat[3] ); - */ - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - jmethodID jmid = env->GetMethodID( jcls, "handleTrackerChange", "(JJIDDDDDDD)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_TrackerRemote library was unable to find the " - "Java method \'handleTrackerChange\'. This may indicate a version mismatch.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jint) info.sensor, (jdouble) info.pos[0], (jdouble) info.pos[1], - (jdouble) info.pos[2], (jdouble) info.quat[0], (jdouble) info.quat[1], - (jdouble) info.quat[2], (jdouble) info.quat[3] ); - -} - - -// This is the callback for vrpn to notify us of a new velocity message -void VRPN_CALLBACK handle_velocity_change( void* userdata, const vrpn_TRACKERVELCB info ) -{ - if( jvm == NULL ) - return; - - /* - printf( "velocityb change (C): time: %d.%d; sensor: %d;\n" - "\tvel: %f %f %f;\n" - "\tquat: %f %f %f %f dt: %f\n", info.msg_time.tv_sec, info.msg_time.tv_usec, - info.sensor, info.vel[0], info.vel[1], info.vel[2], - info.vel_quat[0], info.vel_quat[1], info.vel_quat[2], info.vel_quat[3], info.vel_quat_dt ); - */ - - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - jmethodID jmid = env->GetMethodID( jcls, "handleVelocityChange", "(JJIDDDDDDDD)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_TrackerRemote library was unable to find the " - "Java method \'handleVelocityChange\'. This may indicate a version mismatch.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jint) info.sensor, (jdouble) info.vel[0], (jdouble) info.vel[1], - (jdouble) info.vel[2], (jdouble) info.vel_quat[0], (jdouble) info.vel_quat[1], - (jdouble) info.vel_quat[2], (jdouble) info.vel_quat[3], (jdouble) info.vel_quat_dt ); - -} - - -// This is the callback for vrpn to notify us of a new tracker message -void VRPN_CALLBACK handle_acceleration_change( void* userdata, const vrpn_TRACKERACCCB info ) -{ - if( jvm == NULL ) - return; - - /* - printf( "tracker change (C): time: %d.%d; sensor: %d;\n" - "\tacc: %f %f %f;\n" - "\tquat: %f %f %f %f dt: %f\n", info.msg_time.tv_sec, info.msg_time.tv_usec, - info.sensor, info.acc[0], info.acc[1], info.acc[2], - info.acc_quat[0], info.acc_quat[1], info.acc_quat[2], info.acc_quat[3], info.acc_quat_dt ); - */ - - - JNIEnv* env; - jvm->AttachCurrentThread( (void**) &env, NULL ); - - jobject jobj = (jobject) userdata; - jclass jcls = env->GetObjectClass( jobj ); - jmethodID jmid = env->GetMethodID( jcls, "handleAccelerationChange", "(JJIDDDDDDDD)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_TrackerRemote library was unable to find the " - "Java method \'handleAccelerationChange\'. This may indicate a version mismatch.\n" ); - return; - } - env->CallVoidMethod( jobj, jmid, (jlong) info.msg_time.tv_sec, (jlong) info.msg_time.tv_usec, - (jint) info.sensor, (jdouble) info.acc[0], (jdouble) info.acc[1], - (jdouble) info.acc[2], (jdouble) info.acc_quat[0], (jdouble) info.acc_quat[1], - (jdouble) info.acc_quat[2], (jdouble) info.acc_quat[3], (jdouble) info.acc_quat_dt ); - -} - -// end dll utility function -////////////////////////// - - -///////////////////////// -// native java functions - -JNIEXPORT jint JNICALL -Java_vrpn_TrackerRemote_setUpdateRate( JNIEnv* env, jobject jobj, jdouble updateRate ) -{ - vrpn_Tracker_Remote* t = (vrpn_Tracker_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( t <= 0 ) - return -1; - - // now set the update rate - return t->set_update_rate( updateRate ); - -} - - -JNIEXPORT void JNICALL -Java_vrpn_TrackerRemote_mainloop( JNIEnv* env, jobject jobj ) -{ - vrpn_Tracker_Remote* t = (vrpn_Tracker_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( t <= 0 ) // this tracker is uninitialized or has been shut down already - return; - - // now call mainloop - t->mainloop( ); -} - - -JNIEXPORT jboolean JNICALL -Java_vrpn_TrackerRemote_init( JNIEnv* env, jobject jobj, jstring jname, - jstring jlocalInLogfileName, jstring jlocalOutLogfileName, - jstring jremoteInLogfileName, jstring jremoteOutLogfileName ) -{ - // make a global reference to the Java TrackerRemote - // object, so that it can be referenced in the function - // handle_tracker_change(...) - jobj = env->NewGlobalRef( jobj ); - - // create the tracker - const char* name = env->GetStringUTFChars( jname, NULL ); - const char* local_in_logfile_name = jlocalInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalInLogfileName, NULL ); - const char* local_out_logfile_name = jlocalOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jlocalOutLogfileName, NULL ); - const char* remote_in_logfile_name = jremoteInLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteInLogfileName, NULL ); - const char* remote_out_logfile_name = jremoteOutLogfileName == NULL ? NULL : - env->GetStringUTFChars( jremoteOutLogfileName, NULL ); - vrpn_Connection* conn - = vrpn_get_connection_by_name( name, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name ); - vrpn_Tracker_Remote* t = new vrpn_Tracker_Remote( name, conn ); - t->register_change_handler( jobj, handle_tracker_change ); - t->register_change_handler( jobj, handle_velocity_change ); - t->register_change_handler( jobj, handle_acceleration_change ); - env->ReleaseStringUTFChars( jname, name ); - env->ReleaseStringUTFChars( jlocalInLogfileName, local_in_logfile_name ); - env->ReleaseStringUTFChars( jlocalOutLogfileName, local_out_logfile_name ); - env->ReleaseStringUTFChars( jremoteInLogfileName, remote_in_logfile_name ); - env->ReleaseStringUTFChars( jremoteOutLogfileName, remote_out_logfile_name ); - - // now stash 't' in the jobj's 'native_device' field - jlong jt = (jlong) t; - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, jt ); - - return true; -} - - - -// this is only supposed to be called when the TrackerRemote -// instance is finalized for garbage collection -JNIEXPORT void JNICALL -Java_vrpn_TrackerRemote_shutdownTracker( JNIEnv* env, jobject jobj ) -{ - // get the tracker pointer - vrpn_Tracker_Remote* t = (vrpn_Tracker_Remote*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - - // unregister a handler and destroy the tracker - if( t > 0 ) - { - t->unregister_change_handler( jobj, handle_tracker_change ); - t->unregister_change_handler( jobj, handle_velocity_change ); - t->unregister_change_handler( jobj, handle_acceleration_change ); - t->connectionPtr()->removeReference(); // because we called vrpn_get_connection_by_name - delete t; - } - - // set the tracker pointer to -1 - env->SetLongField( jobj, jfid_vrpn_VRPNDevice_native_device, -1 ); - - // delete global reference to object (that was created in init) - env->DeleteGlobalRef( jobj ); - - -} - -// end native java functions -//////////////////////////// diff --git a/src/vrpn/java_vrpn/vrpn_VRPNDevice.cpp b/src/vrpn/java_vrpn/vrpn_VRPNDevice.cpp deleted file mode 100644 index ecb217ec515e99d5e183f19924a40feb922996bf..0000000000000000000000000000000000000000 --- a/src/vrpn/java_vrpn/vrpn_VRPNDevice.cpp +++ /dev/null @@ -1,568 +0,0 @@ - -#include <stdio.h> -#include <jni.h> -#include "java_vrpn.h" -#include "vrpn_VRPNDevice.h" -#include "vrpn_BaseClass.h" -#include "vrpn_Connection.h" -#include "vrpn_FileConnection.h" - -jclass jclass_vrpn_VRPNDevice = NULL; -jfieldID jfid_vrpn_VRPNDevice_native_device = NULL; - - -// This is called when the Java Virtual Machine loads this library -// and sets some global references that are used elsewhere. -JNIEXPORT jint JNICALL JNI_OnLoad_VRPNDevice( JavaVM* jvm, void* reserved ) -{ - - /////////////// - // make sure the general library code set jvm - if( jvm == NULL ) - { - printf( "vrpn_VRPNDevice native: no jvm.\n" ); - return JNI_ERR; - } - - /////////////// - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error loading vrpn_VRPNDevice native library.\n" ); - return JNI_ERR; - } - - /////////////// - // get the jclass reference to vrpn.VRPNDevice - jclass cls = env->FindClass( "vrpn/VRPNDevice" ); - if( cls == NULL ) - { - printf( "Error loading vrpn_VRPNDevice native library " - "while trying to find class vrpn.VRPNDevice.\n" ); - return JNI_ERR; - } - - // make a global reference so the class can be referenced later. - // this must be a _WEAK_ global reference, so the class will be - // garbage collected, and so the JNI_OnUnLoad handler will be called - jclass_vrpn_VRPNDevice = (jclass) env->NewWeakGlobalRef( cls ); - if( jclass_vrpn_VRPNDevice == NULL ) - { - printf( "Error loading vrpn VRPNDevice native library " - "while setting up class vrpn.VRPNDevice.\n" ); - return JNI_ERR; - } - - //////////////// - // get a jfid field id reference to the "native_device" - // field of class vrpn.VRPNDevice. - // field ids do not have to be made into global references. - jfid_vrpn_VRPNDevice_native_device - = env->GetFieldID( jclass_vrpn_VRPNDevice, "native_device", "J" ); - if( jfid_vrpn_VRPNDevice_native_device == NULL ) - { - printf( "Error loading vrpn native library " - "while looking into class vrpn.VRPNDevice.\n" ); - return JNI_ERR; - } - - return JAVA_VRPN_JNI_VERSION; -} - - -JNIEXPORT void JNICALL JNI_OnUnload_VRPNDevice( JavaVM* jvm, void* reserved ) -{ - // get the JNIEnv pointer - JNIEnv* env; - if( jvm->GetEnv( (void**) &env, JAVA_VRPN_JNI_VERSION ) != JNI_OK ) - { - printf( "Error unloading vrpn VRPNDevice native library.\n" ); - return; - } - - // delete the global reference to the vrpn.analogRemote class - env->DeleteWeakGlobalRef( jclass_vrpn_VRPNDevice ); -} - - - -/* - * Class: vrpn_VRPNDevice - * Method: doingOkay_native - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_VRPNDevice_doingOkay_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device <= 0 ) return false; - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) return false; - return ( conn->doing_okay() != 0 ); -} - - -/* - * Class: vrpn_VRPNDevice - * Method: getElapsedTimeSecs_native - * Signature: ()J - */ -JNIEXPORT jlong JNICALL -Java_vrpn_VRPNDevice_getElapsedTimeSecs_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"getElapsedTimeSecs\": " - "the device is uninitialized or has been shut down.\n" ); - return -1; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"getElapsedTimeSecs\": " - "no connection\n." ); - return -1; - } - timeval elapsed; - conn->time_since_connection_open( &elapsed ); - return elapsed.tv_sec; -} - - -/* - * Class: vrpn_VRPNDevice - * Method: getTime_native - * Signature: (Ljava/util/Date;)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_VRPNDevice_getTime_1native( JNIEnv* env, jobject jobj, jobject jdate ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"getTime\": " - "the device is uninitialized or has been shut down.\n" ); - return false; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"getTime\": " - "no connection\n." ); - return false; - } - timeval t = conn->get_time( ); - jclass jcls = env->GetObjectClass( jdate ); - jmethodID jmid = env->GetMethodID( jcls, "setTime", "(J)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_VRPNDevice (getTime) library was unable to find the " - "Java method \'Date::setTime\'.\n" ); - return false; - } - env->CallVoidMethod( jdate, jmid, ( (jlong) t.tv_sec ) * 1000 + ( (jlong) t.tv_usec ) / 1000 ); - return true; -} - - - -/* - * Class: vrpn_VRPNDevice - * Method: isConnected_native - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_VRPNDevice_isConnected_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"isConnected\": " - "the device is uninitialized or has been shut down.\n" ); - return false; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"isConnected\": " - "no connection\n." ); - return false; - } - return (jboolean) conn->connected(); -} - - -/* - * Class: vrpn_VRPNDevice - * Method: isLive_native - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_VRPNDevice_isLive_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"isLive\": " - "the device is uninitialized or has been shut down.\n" ); - return false; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"isLive\": " - "no connection\n." ); - return false; - } - return ( conn->get_File_Connection( ) == NULL ); -} - - -/* - * Class: vrpn_VRPNDevice - * Method: playToElapsedTime_native - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_VRPNDevice_playToElapsedTime_1native( JNIEnv* env, jobject jobj, jlong time ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"playToElapsedTime\": " - "the device is uninitialized or has been shut down.\n" ); - return false; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"playToElapsedTime\": " - "no connection\n." ); - return false; - } - vrpn_File_Connection* fc = conn->get_File_Connection( ); - if( fc == NULL ) - { - printf( "Error in native method \"playToElapsedTime\": " - "no file connection -- not replay\n." ); - return false; - } - return ( fc->play_to_time( (double) time ) == 0 ); - // note: the compiler claims the cast "(double) time" could possibly lose data - // (casting from __int64 to double) -} - - -/* - * Class: vrpn_VRPNDevice - * Method: getEarliestTime_native - * Signature: (Ljava/util/Date;)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_VRPNDevice_getEarliestTime_1native( JNIEnv* env, jobject jobj, jobject jdate) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"getEarliestTime\": " - "the device is uninitialized or has been shut down.\n" ); - return false; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"getEarliestTime\": " - "no connection\n." ); - return false; - } - vrpn_File_Connection* fc = conn->get_File_Connection( ); - if( fc == NULL ) - { - printf( "Error in native method \"getEarliestTime\": " - "no file connection -- not replay\n." ); - return false; - } - timeval t = fc->get_lowest_user_timestamp( ); - jclass jcls = env->GetObjectClass( jdate ); - jmethodID jmid = env->GetMethodID( jcls, "setTime", "(J)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_VRPNDevice (getEarliestTime) library was unable to find the " - "Java method \'Date::setTime\'.\n" ); - return false; - } - env->CallVoidMethod( jdate, jmid, ( (jlong) t.tv_sec ) * 1000 + ( (jlong) t.tv_usec ) / 1000 ); - return true; -} - - -/* - * Class: vrpn_VRPNDevice - * Method: getLatestTime_native - * Signature: (Ljava/util/Date;)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_VRPNDevice_getLatestTime_1native( JNIEnv* env, jobject jobj, jobject jdate ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"getLatestTime\": " - "the device is uninitialized or has been shut down.\n" ); - return false; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"getLatestTime\": " - "no connection\n." ); - return false; - } - vrpn_File_Connection* fc = conn->get_File_Connection( ); - if( fc == NULL ) - { - printf( "Error in native method \"getLatestTime\": " - "no file connection -- not replay\n." ); - return false; - } - timeval t = fc->get_highest_user_timestamp( ); - jclass jcls = env->GetObjectClass( jdate ); - jmethodID jmid = env->GetMethodID( jcls, "setTime", "(J)V" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_VRPNDevice (getLatestTime) library was unable to find the " - "Java method \'Date::setTime\'.\n" ); - return false; - } - env->CallVoidMethod( jdate, jmid, ( (jlong) t.tv_sec ) * 1000 + ( (jlong) t.tv_usec ) / 1000 ); - return true; -} - - -/* - * Class: vrpn_VRPNDevice - * Method: eof_native - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_VRPNDevice_eof_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"eof\": " - "the device is uninitialized or has been shut down.\n" ); - return false; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"eof\": " - "no connection\n." ); - return false; - } - vrpn_File_Connection* fc = conn->get_File_Connection( ); - if( fc == NULL ) - { - printf( "Error in native method \"eof\": " - "no file connection -- not replay\n." ); - return false; - } - return fc->eof( ); -} - - -/* - * Class: vrpn_VRPNDevice - * Method: getLengthSecs_native - * Signature: ()D - */ -JNIEXPORT jdouble JNICALL -Java_vrpn_VRPNDevice_getLengthSecs_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"getLengthSecs\": " - "the device is uninitialized or has been shut down.\n" ); - return -1; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"getLengthSecs\": " - "no connection\n." ); - return -1; - } - vrpn_File_Connection* fc = conn->get_File_Connection( ); - if( fc == NULL ) - { - printf( "Error in native method \"getLengthSecs\": " - "no file connection -- not replay\n." ); - return -1; - } - return (jdouble) fc->get_length_secs( ); -} - - -/* - * Class: vrpn_VRPNDevice - * Method: setReplayRate_native - * Signature: (F)V - */ -JNIEXPORT void JNICALL -Java_vrpn_VRPNDevice_setReplayRate_1native( JNIEnv* env, jobject jobj, jfloat jrate ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"setReplayRate\": " - "the device is uninitialized or has been shut down.\n" ); - return; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"setReplayRate\": " - "no connection\n." ); - return; - } - vrpn_File_Connection* fc = conn->get_File_Connection( ); - if( fc == NULL ) - { - printf( "Error in native method \"setReplayRate\": " - "no file connection -- not replay\n." ); - return; - } - fc->set_replay_rate( jrate ); -} - - -/* - * Class: vrpn_VRPNDevice - * Method: getReplayRate_native - * Signature: ()F - */ -JNIEXPORT jfloat JNICALL -Java_vrpn_VRPNDevice_getReplayRate_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"setReplayRate\": " - "the device is uninitialized or has been shut down.\n" ); - return -1; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"setReplayRate\": " - "no connection\n." ); - return -1; - } - vrpn_File_Connection* fc = conn->get_File_Connection( ); - if( fc == NULL ) - { - printf( "Error in native method \"setReplayRate\": " - "no file connection -- not replay\n." ); - return -1; - } - return fc->get_replay_rate( ); -} - - - - /* - * Class: vrpn_VRPNDevice - * Method: reset_native - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_VRPNDevice_reset_1native( JNIEnv* env, jobject jobj ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"reset\": " - "the device is uninitialized or has been shut down.\n" ); - return -1; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"reset\": " - "no connection\n." ); - return -1; - } - vrpn_File_Connection* fc = conn->get_File_Connection( ); - if( fc == NULL ) - { - printf( "Error in native method \"reset\": " - "no file connection -- not replay\n." ); - return -1; - } - return ( fc->reset( ) == 0 ); -} - - -/* - * Class: vrpn_VRPNDevice - * Method: playToWallTime_native - * Signature: (Ljava/util/Date;)Z - */ -JNIEXPORT jboolean JNICALL -Java_vrpn_VRPNDevice_playToWallTime_1native( JNIEnv* env, jobject jobj, jobject jdate ) -{ - vrpn_BaseClass* device - = (vrpn_BaseClass*) env->GetLongField( jobj, jfid_vrpn_VRPNDevice_native_device ); - if( device == 0 ) - { - printf( "Error in native method \"playToElapsedTime\": " - "the device is uninitialized or has been shut down.\n" ); - return false; - } - vrpn_Connection* conn = device->connectionPtr( ); - if( conn == NULL ) - { - printf( "Error in native method \"playToElapsedTime\": " - "no connection\n." ); - return false; - } - vrpn_File_Connection* fc = conn->get_File_Connection( ); - if( fc == NULL ) - { - printf( "Error in native method \"playToElapsedTime\": " - "no file connection -- not replay\n." ); - return false; - } - timeval t; - long int msecs; - jclass jcls = env->GetObjectClass( jdate ); - jmethodID jmid = env->GetMethodID( jcls, "getTime", "()J" ); - if( jmid == NULL ) - { - printf( "Warning: vrpn_VRPNDevice (playToWallTime) library was unable to find the " - "Java method \'Date::getTime\'.\n" ); - return false; - } - msecs = (long) env->CallLongMethod( jdate, jmid ); - t.tv_sec = msecs / 1000; - t.tv_usec = ( msecs - t.tv_sec * 1000 ) * 1000; - - return ( fc->play_to_filetime( t ) == 0 ); -} diff --git a/src/vrpn/jni_layer.cpp b/src/vrpn/jni_layer.cpp deleted file mode 100644 index 044efc0bb9007834e50a93e49030ade9fc9a9aa0..0000000000000000000000000000000000000000 --- a/src/vrpn/jni_layer.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#include "jni_layer.h" -#include "vrpn_Android.h" - -/* - * This is JNI code for interaction between the Java and C++ components. - * The JniLayer Java class stores a pointer to a vrpn_Android_Server instance - * in C++ in the form of a long integer. This long is passed to each of these - * functions, in addition to any necessary parameters. For the most part, the - * functions here correspond with functions in vrpn_Android_Server, so this - * code simply interprets the long as a pointer to the vrpn_Android_Server and - * calls the corresponding function. - */ - -/* - * Class: jni_JniLayer - * Method: jni_layer_initialize - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_jni_JniLayer_jni_1layer_1initialize - (JNIEnv * env, jobject, jintArray analogs, jint num_buttons, jint port) -{ - // convert jintArray into a c++ int array - int num_analogs = env->GetArrayLength(analogs); - int * analog_sizes = env->GetIntArrayElements(analogs, 0); - vrpn_Android_Server * theServer = new vrpn_Android_Server(num_analogs, analog_sizes, num_buttons, port); - return (long) theServer; -} - -/* - * Class: jni_JniLayer - * Method: jni_layer_mainloop - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_jni_JniLayer_jni_1layer_1mainloop - (JNIEnv *, jobject, jlong ptr) -{ - ((vrpn_Android_Server *) ptr)->mainloop(); -} - -/* - * Class: jni_JniLayer - * Method: jni_layer_update_button - * Signature: (II)V - */ -JNIEXPORT void JNICALL Java_jni_JniLayer_jni_1layer_1set_1button - (JNIEnv *, jobject, jlong ptr, jint button_id, jint state) -{ - ((vrpn_Android_Server *) ptr)->set_button(button_id, state); -} - -/* - * Class: jni_JniLayer - * Method: jni_layer_set_analog - * Signature: (JIF)V - */ -JNIEXPORT void JNICALL Java_jni_JniLayer_jni_1layer_1set_1analog - (JNIEnv *, jobject, jlong ptr, jint analog_id, jint channel, jfloat val) -{ - ((vrpn_Android_Server *) ptr)->set_analog(analog_id, channel, val); -} - -JNIEXPORT void JNICALL Java_jni_JniLayer_jni_1layer_1kill - (JNIEnv *, jobject, jlong ptr) -{ - delete ((vrpn_Android_Server *) ptr); -} - -/* - * Class: jni_JniLayer - * Method: jni_layer_report_analog_chg - * Signature: (JI)V - */ -JNIEXPORT void JNICALL Java_jni_JniLayer_jni_1layer_1report_1analog_1chg - (JNIEnv *, jobject, jlong ptr, jint analog_id) -{ - ((vrpn_Android_Server *) ptr)->report_analog_chg(analog_id); -} diff --git a/src/vrpn/jni_layer.h b/src/vrpn/jni_layer.h deleted file mode 100644 index 7400407060cb0cf416931df19e86647d29f809d2..0000000000000000000000000000000000000000 --- a/src/vrpn/jni_layer.h +++ /dev/null @@ -1,61 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> -/* Header for class jni_JniLayer */ - -#ifndef _Included_jni_JniLayer -#define _Included_jni_JniLayer -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: jni_JniLayer - * Method: jni_layer_initialize - * Signature: ([II)J - */ -JNIEXPORT jlong JNICALL Java_jni_JniLayer_jni_1layer_1initialize - (JNIEnv *, jobject, jintArray, jint, jint); - -/* - * Class: jni_JniLayer - * Method: jni_layer_mainloop - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_jni_JniLayer_jni_1layer_1mainloop - (JNIEnv *, jobject, jlong); - -/* - * Class: jni_JniLayer - * Method: jni_layer_set_button - * Signature: (JII)V - */ -JNIEXPORT void JNICALL Java_jni_JniLayer_jni_1layer_1set_1button - (JNIEnv *, jobject, jlong, jint, jint); - -/* - * Class: jni_JniLayer - * Method: jni_layer_set_analog - * Signature: (JIIF)V - */ -JNIEXPORT void JNICALL Java_jni_JniLayer_jni_1layer_1set_1analog - (JNIEnv *, jobject, jlong, jint, jint, jfloat); - -/* - * Class: jni_JniLayer - * Method: jni_layer_report_analog_chg - * Signature: (JI)V - */ -JNIEXPORT void JNICALL Java_jni_JniLayer_jni_1layer_1report_1analog_1chg - (JNIEnv *, jobject, jlong, jint); - -/* - * Class: jni_JniLayer - * Method: jni_layer_kill - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_jni_JniLayer_jni_1layer_1kill - (JNIEnv *, jobject, jlong); - -#ifdef __cplusplus -} -#endif -#endif \ No newline at end of file diff --git a/src/vrpn/libnifalcon-patches/0001-small-rewrite-of-the-sphere-example-with.patch b/src/vrpn/libnifalcon-patches/0001-small-rewrite-of-the-sphere-example-with.patch deleted file mode 100644 index 31fd22d465e6f1a15476f069b30619a6a456376a..0000000000000000000000000000000000000000 --- a/src/vrpn/libnifalcon-patches/0001-small-rewrite-of-the-sphere-example-with.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 661fc09eaa1c1d4657a784b23d828c06355f8018 Mon Sep 17 00:00:00 2001 -From: Axel Kohlmeyer <akohlmey@gmail.com> -Date: Wed, 7 Apr 2010 13:26:47 -0400 -Subject: [PATCH 1/2] small rewrite of the sphere example with - a few changes in the behavior that make - it more easy to use. - ---- - examples/falcon_test_cli/FalconSphereTest.cpp | 30 +++++++++++++++++------- - 1 files changed, 21 insertions(+), 9 deletions(-) - -diff --git a/examples/falcon_test_cli/FalconSphereTest.cpp b/examples/falcon_test_cli/FalconSphereTest.cpp -index 6312558..9c62c74 100644 ---- a/examples/falcon_test_cli/FalconSphereTest.cpp -+++ b/examples/falcon_test_cli/FalconSphereTest.cpp -@@ -75,23 +75,35 @@ void FalconSphereTest::runFunction() - return; - } - -- // make sphere soft radius - if(m_falconDevice->getFalconGrip()->getDigitalInputs() -- & libnifalcon::FalconGripFourButton::BUTTON_3) -+ & libnifalcon::FalconGripFourButton::BUTTON_2) - { -- m_stiffness = 100.0; -+ m_forwardButtonDown = true; - } else{ -- m_stiffness = 1000.0; -+ m_forwardButtonDown = false; - } - -- -- // make sphere soft sticky -+ // make sphere soft radius or "slippery" - if(m_falconDevice->getFalconGrip()->getDigitalInputs() -- & libnifalcon::FalconGripFourButton::BUTTON_2) -+ & libnifalcon::FalconGripFourButton::BUTTON_3) - { -- m_forwardButtonDown = true; -+ if(m_forwardButtonDown) -+ { -+ m_stiffness = -300.0; -+ } -+ else -+ { -+ m_stiffness = 1000.0; -+ } - } else{ -- m_forwardButtonDown = false; -+ if(m_forwardButtonDown) -+ { -+ m_stiffness = 500.0; -+ } -+ else -+ { -+ m_stiffness = 100.0; -+ } - } - - --- -1.6.6.1 - diff --git a/src/vrpn/libnifalcon-patches/0002-provide-symbolic-names-for-the-individual-buttons-in.patch b/src/vrpn/libnifalcon-patches/0002-provide-symbolic-names-for-the-individual-buttons-in.patch deleted file mode 100644 index 9de5351aa9fc34ca308d513141aa98ceb18484ba..0000000000000000000000000000000000000000 --- a/src/vrpn/libnifalcon-patches/0002-provide-symbolic-names-for-the-individual-buttons-in.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 6edfbdb7b1c77fade1afd1c1790102e185f2ee07 Mon Sep 17 00:00:00 2001 -From: Axel Kohlmeyer <akohlmey@gmail.com> -Date: Sun, 11 Apr 2010 22:25:39 -0400 -Subject: [PATCH 2/2] provide symbolic names for the individual buttons in the standard grip. - this makes selecting them in applications much easier. - ---- - examples/falcon_test_cli/FalconSphereTest.cpp | 8 ++++---- - include/falcon/grip/FalconGripFourButton.h | 12 +++++++++--- - 2 files changed, 13 insertions(+), 7 deletions(-) - -diff --git a/examples/falcon_test_cli/FalconSphereTest.cpp b/examples/falcon_test_cli/FalconSphereTest.cpp -index 9c62c74..bb7a9f0 100644 ---- a/examples/falcon_test_cli/FalconSphereTest.cpp -+++ b/examples/falcon_test_cli/FalconSphereTest.cpp -@@ -49,7 +49,7 @@ void FalconSphereTest::runFunction() - - // increase radius - if(m_falconDevice->getFalconGrip()->getDigitalInputs() -- & libnifalcon::FalconGripFourButton::BUTTON_1) -+ & libnifalcon::FalconGripFourButton::PLUS_BUTTON) - { - m_plusButtonDown = true; - } -@@ -63,7 +63,7 @@ void FalconSphereTest::runFunction() - - // decrease radius - if(m_falconDevice->getFalconGrip()->getDigitalInputs() -- & libnifalcon::FalconGripFourButton::BUTTON_4) -+ & libnifalcon::FalconGripFourButton::MINUS_BUTTON) - { - m_minusButtonDown = true; - } -@@ -76,7 +76,7 @@ void FalconSphereTest::runFunction() - } - - if(m_falconDevice->getFalconGrip()->getDigitalInputs() -- & libnifalcon::FalconGripFourButton::BUTTON_2) -+ & libnifalcon::FalconGripFourButton::FORWARD_BUTTON) - { - m_forwardButtonDown = true; - } else{ -@@ -85,7 +85,7 @@ void FalconSphereTest::runFunction() - - // make sphere soft radius or "slippery" - if(m_falconDevice->getFalconGrip()->getDigitalInputs() -- & libnifalcon::FalconGripFourButton::BUTTON_3) -+ & libnifalcon::FalconGripFourButton::CENTER_BUTTON) - { - if(m_forwardButtonDown) - { -diff --git a/include/falcon/grip/FalconGripFourButton.h b/include/falcon/grip/FalconGripFourButton.h -index 486a49d..216a5a0 100644 ---- a/include/falcon/grip/FalconGripFourButton.h -+++ b/include/falcon/grip/FalconGripFourButton.h -@@ -26,15 +26,21 @@ namespace libnifalcon - { - public: - /** -- * Enumeration for the default 4 button grip that comes with the falcon -- * -+ * Enumeration for the default 4 button grip that comes with the falcon. -+ * This grip has plus and minus buttonsr, one button in the center and -+ * one pointing forward. For convenience also symbolic names are provided. - */ - enum - { - BUTTON_1 = 0x1, - BUTTON_2 = 0x2, - BUTTON_3 = 0x4, -- BUTTON_4 = 0x8 -+ BUTTON_4 = 0x8, -+ /* symbolic names */ -+ PLUS_BUTTON = 0x1, -+ FORWARD_BUTTON = 0x2, -+ CENTER_BUTTON = 0x4, -+ MINUS_BUTTON = 0x8 - } FourButtonGripButtons; - - /** --- -1.6.6.1 - diff --git a/src/vrpn/libnifalcon-patches/README b/src/vrpn/libnifalcon-patches/README deleted file mode 100644 index 1b6a2ea587a0bf35b836d4e2ebe033f4b5289c65..0000000000000000000000000000000000000000 --- a/src/vrpn/libnifalcon-patches/README +++ /dev/null @@ -1,9 +0,0 @@ -these patches are currently 04/11/2010 needed to compile -the ICMS version of VRPN with support for the Novint -Falcon using the development version of libnifalcon. - -the numbered patches update the development code from -git://github.com/qdot/libnifalcon.git - -the update patch updates the 1.0.1 release version -of libnifalcon to what is needed. diff --git a/src/vrpn/libnifalcon-patches/update-libnifalcon-1.0.1.patch b/src/vrpn/libnifalcon-patches/update-libnifalcon-1.0.1.patch deleted file mode 100644 index 2fcd76ab0ac750897af0a7531cce0c6b9f5ee36c..0000000000000000000000000000000000000000 --- a/src/vrpn/libnifalcon-patches/update-libnifalcon-1.0.1.patch +++ /dev/null @@ -1,454 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 87f2f45..d8382e0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -147,32 +149,32 @@ IF(BUILD_SWIG_BINDINGS) - ADD_SUBDIRECTORY(lang/swig) - ENDIF(BUILD_SWIG_BINDINGS) - --# pkg-config (use the CPack information) --# FIND_PACKAGE(PkgConfig) --# if(PKG_CONFIG_EXECUTABLE) --# set(PC_SHORT_NAME "${BUILDSYS_CPACK_NAME}") --# set(PC_LONG_NAME "${BUILDSYS_CPACK_NAME}") --# set(PC_LIBRARY_NAME "${LIBNIFALCON_CPP}") --# set(PC_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") --# set(PC_VERSION "${LIBNIFALCON_MAJOR_VERSION}.${LIBNIFALCON_MINOR_VERSION}.${LIBNIFALCON_BUILD_VERSION}") -- --# if(LIBUSB_1_FOUND) --# set(PC_REQUIRES "${PC_REQUIRES}libusb-1.0 ") --# set(PC_LINK_FLAGS "${PC_LINK_FLAGS}-lnifalcon_comm_libusb ") --# endif(LIBUSB_1_FOUND) -- --# set(PC_LINK_FLAGS "${lib${PC_LIBRARY_NAME}_LINK_FLAGS} ${PC_LINK_FLAGS}") --# set(PC_LINK_FLAGS "-l${PC_LIBRARY_NAME} ${PC_LINK_FLAGS}") --# set(PC_COMPILE_FLAGS "${lib${PC_LIBRARY_NAME}_COMPILE_FLAGS}") --# set(PC_CONFIGURED_FILE --# ${CMAKE_BINARY_DIR}/libnifalcon.pc --# ) --# MESSAGE("-- Generating ${PC_CONFIGURED_FILE}") --# configure_file( --# ${CMAKE_SOURCE_DIR}/libnifalcon.pc.cmake --# ${PC_CONFIGURED_FILE} --# @ONLY --# ) --# set(PKG_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig") --# install(FILES ${PC_CONFIGURED_FILE} DESTINATION ${PKG_CONFIG_DIR}) --# endif(PKG_CONFIG_EXECUTABLE) -+#pkg-config (use the CPack information) -+FIND_PACKAGE(PkgConfig) -+if(PKG_CONFIG_EXECUTABLE) -+ set(PC_SHORT_NAME "${BUILDSYS_CPACK_NAME}") -+ set(PC_LONG_NAME "${BUILDSYS_CPACK_NAME}") -+ set(PC_LIBRARY_NAME "${LIBNIFALCON_CPP}") -+ set(PC_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") -+ set(PC_VERSION "${LIBNIFALCON_MAJOR_VERSION}.${LIBNIFALCON_MINOR_VERSION}.${LIBNIFALCON_BUILD_VERSION}") -+ -+ if(LIBUSB_1_FOUND) -+ set(PC_REQUIRES "${PC_REQUIRES}libusb-1.0 ") -+ set(PC_LINK_FLAGS "${PC_LINK_FLAGS}-lnifalcon_comm_libusb ") -+ endif(LIBUSB_1_FOUND) -+ -+ set(PC_LINK_FLAGS "${lib${PC_LIBRARY_NAME}_LINK_FLAGS} ${PC_LINK_FLAGS}") -+ set(PC_LINK_FLAGS "-l${PC_LIBRARY_NAME} ${PC_LINK_FLAGS}") -+ set(PC_COMPILE_FLAGS "${lib${PC_LIBRARY_NAME}_COMPILE_FLAGS}") -+ set(PC_CONFIGURED_FILE -+ ${CMAKE_BINARY_DIR}/libnifalcon.pc -+ ) -+ MESSAGE("-- Generating ${PC_CONFIGURED_FILE}") -+ configure_file( -+ ${CMAKE_SOURCE_DIR}/libnifalcon.pc.cmake -+ ${PC_CONFIGURED_FILE} -+ @ONLY -+ ) -+ set(PKG_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig") -+ install(FILES ${PC_CONFIGURED_FILE} DESTINATION ${PKG_CONFIG_DIR}) -+endif(PKG_CONFIG_EXECUTABLE) -diff --git a/README.txt b/README.txt -index 66ba252..ce864cd 100644 ---- a/README.txt -+++ b/README.txt -@@ -110,6 +110,7 @@ Jared Allen - Alastair Barrow - Niall Begley - Edgar Berdahl -+Axel Kohlmeyer - Steven Martin - Kevin Ouellet - Devanshi Shah -diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt -index f3e4626..04eadb6 100644 ---- a/examples/CMakeLists.txt -+++ b/examples/CMakeLists.txt -@@ -96,6 +96,7 @@ ELSE(NOT Boost_PROGRAM_OPTIONS_FOUND) - falcon_test_cli/FalconTestBase.cpp - falcon_test_cli/FalconLoopTimeTest.cpp - falcon_test_cli/FalconCubeTest.cpp -+ falcon_test_cli/FalconSphereTest.cpp - falcon_test_cli/FalconWallTest.cpp - falcon_test_cli/FalconColorTest.cpp - ) -diff --git a/examples/falcon_test_cli/FalconSphereTest.cpp b/examples/falcon_test_cli/FalconSphereTest.cpp -new file mode 100644 -index 0000000..bb7a9f0 ---- /dev/null -+++ b/examples/falcon_test_cli/FalconSphereTest.cpp -@@ -0,0 +1,137 @@ -+#include "FalconSphereTest.h" -+ -+#include "falcon/core/FalconDevice.h" -+#include "falcon/grip/FalconGripFourButton.h" -+#include "falcon/kinematic/FalconKinematicStamper.h" -+ -+FalconSphereTest::FalconSphereTest(boost::shared_ptr<libnifalcon::FalconDevice> d) : -+ FalconTestBase(d), -+ m_radius(0.028), -+ m_stiffness(1000.0), -+ m_isInitializing(true), -+ m_hasPrintedInitMsg(false), -+ m_plusButtonDown(false), -+ m_minusButtonDown(false), -+ m_centerButtonDown(false), -+ m_forwardButtonDown(false) -+{ -+ setPrintOnCount(1000); -+ m_falconDevice->setFalconKinematic<libnifalcon::FalconKinematicStamper>(); -+ m_falconDevice->setFalconGrip<libnifalcon::FalconGripFourButton>(); -+ m_oldpos[0] = m_oldpos[1] = m_oldpos[2] = 0.0; -+} -+ -+void FalconSphereTest::runFunction() -+{ -+ if(!m_falconDevice->runIOLoop()) -+ return; -+ -+ boost::array<double, 3> pos = m_falconDevice->getPosition(); -+ -+ if(m_isInitializing) -+ { -+ if(!m_hasPrintedInitMsg) -+ { -+ std::cout << "Move the end effector all the way out" << std::endl; -+ m_hasPrintedInitMsg = true; -+ } -+ if(pos[2] > .170) -+ { -+ std::cout << "Starting sphere simulation..." << std::endl; -+ m_isInitializing = false; -+ tstart(); -+ } else { -+ m_oldpos = pos; -+ } -+ m_lastLoopCount = m_falconDevice->getFalconFirmware()->getLoopCount(); -+ return; -+ } -+ -+ // increase radius -+ if(m_falconDevice->getFalconGrip()->getDigitalInputs() -+ & libnifalcon::FalconGripFourButton::PLUS_BUTTON) -+ { -+ m_plusButtonDown = true; -+ } -+ else if(m_plusButtonDown) -+ { -+ m_plusButtonDown = false; -+ m_radius += 0.002; -+ std::cout << "Plus button pressed... radius now:" << m_radius << std::endl; -+ return; -+ } -+ -+ // decrease radius -+ if(m_falconDevice->getFalconGrip()->getDigitalInputs() -+ & libnifalcon::FalconGripFourButton::MINUS_BUTTON) -+ { -+ m_minusButtonDown = true; -+ } -+ else if(m_minusButtonDown) -+ { -+ m_minusButtonDown = false; -+ m_radius -= 0.002; -+ std::cout << "Minus button pressed... radius now:" << m_radius << std::endl; -+ return; -+ } -+ -+ if(m_falconDevice->getFalconGrip()->getDigitalInputs() -+ & libnifalcon::FalconGripFourButton::FORWARD_BUTTON) -+ { -+ m_forwardButtonDown = true; -+ } else{ -+ m_forwardButtonDown = false; -+ } -+ -+ // make sphere soft radius or "slippery" -+ if(m_falconDevice->getFalconGrip()->getDigitalInputs() -+ & libnifalcon::FalconGripFourButton::CENTER_BUTTON) -+ { -+ if(m_forwardButtonDown) -+ { -+ m_stiffness = -300.0; -+ } -+ else -+ { -+ m_stiffness = 1000.0; -+ } -+ } else{ -+ if(m_forwardButtonDown) -+ { -+ m_stiffness = 500.0; -+ } -+ else -+ { -+ m_stiffness = 100.0; -+ } -+ } -+ -+ -+ boost::array<double, 3> force; -+ force[0] = 0.0; -+ force[1] = 0.0; -+ force[2] = 0.0; -+ -+ // offset z -+ pos[2] -= 0.11; -+ -+ double dist = sqrt(pos[0]*pos[0]+pos[1]*pos[1]+pos[2]*pos[2]); -+ -+ if (dist < m_radius) { -+ if (m_forwardButtonDown) { -+ force[0] = (m_oldpos[0] - pos[0]) * m_stiffness * 10.0; -+ force[1] = (m_oldpos[1] - pos[1]) * m_stiffness * 10.0; -+ force[2] = (m_oldpos[2] - pos[2]) * m_stiffness * 10.0; -+ } else { -+ force[0] = (pos[0] / dist) * (m_radius - dist) * m_stiffness; -+ force[1] = (pos[1] / dist) * (m_radius - dist) * m_stiffness; -+ force[2] = (pos[2] / dist) * (m_radius - dist) * m_stiffness; -+ } -+ } -+ // dampen position update to remove noise. -+ m_oldpos[0] = 0.4*m_oldpos[0]+ 0.6*pos[0]; -+ m_oldpos[1] = 0.4*m_oldpos[1]+ 0.6*pos[1]; -+ m_oldpos[2] = 0.4*m_oldpos[2]+ 0.6*pos[2]; -+ m_falconDevice->setForce(force); -+} -+ -diff --git a/examples/falcon_test_cli/FalconSphereTest.h b/examples/falcon_test_cli/FalconSphereTest.h -new file mode 100644 -index 0000000..c06bc11 ---- /dev/null -+++ b/examples/falcon_test_cli/FalconSphereTest.h -@@ -0,0 +1,27 @@ -+#ifndef FALCON_SPHERE_TEST_H -+#define FALCON_SPHERE_TEST_H -+ -+#include "FalconTestBase.h" -+#include "falcon/gmtl/Vec.h" -+ -+class FalconSphereTest : public FalconTestBase -+{ -+public: -+ FalconSphereTest(boost::shared_ptr<libnifalcon::FalconDevice> d); -+protected: -+ double m_stiffness; -+ double m_radius; -+ boost::array<double, 3> m_oldpos; -+ bool m_plusButtonDown; -+ bool m_minusButtonDown; -+ bool m_centerButtonDown; -+ bool m_forwardButtonDown; -+ -+ -+ void runFunction(); -+ bool m_isInitializing; -+ bool m_hasPrintedInitMsg; -+ -+}; -+ -+#endif -diff --git a/examples/falcon_test_cli/falcon_test_cli.cpp b/examples/falcon_test_cli/falcon_test_cli.cpp -index e6879e8..ef3f72f 100644 ---- a/examples/falcon_test_cli/falcon_test_cli.cpp -+++ b/examples/falcon_test_cli/falcon_test_cli.cpp -@@ -24,6 +24,7 @@ - #include "falcon/util/FalconCLIBase.h" - #include "FalconLoopTimeTest.h" - #include "FalconCubeTest.h" -+#include "FalconSphereTest.h" - #include "FalconWallTest.h" - #include "FalconColorTest.h" - -@@ -60,6 +61,7 @@ public: - ("loop_time_test", "Loops infinitely, printing time every 1000 I/O loops (should be as near 1.0 as possible)") - #endif - ("cube_test", "Presents a cube-shaped surface to touch") -+ ("sphere_test", "Presents a sphere-shaped surface to touch") - ("color_test", "Fades LEDs based on the position of the end effector") - ("x_wall_test", "Presents a wall surface to touch (force along x axis)") - ("y_wall_test", "Presents a wall surface to touch (force along y axis)") -@@ -84,6 +86,12 @@ public: - std::cout << "Running cube test" << std::endl; - t.reset(new FalconCubeTest(m_falconDevice)); - } -+ else if(m_varMap.count("sphere_test")) -+ { -+ while(!calibrateDevice() && !stop); -+ std::cout << "Running sphere test" << std::endl; -+ t.reset(new FalconSphereTest(m_falconDevice)); -+ } - else if(m_varMap.count("color_test")) - { - while(!calibrateDevice() && !stop); -diff --git a/include/falcon/core/FalconDevice.h b/include/falcon/core/FalconDevice.h -index 300616d..d4488d9 100644 ---- a/include/falcon/core/FalconDevice.h -+++ b/include/falcon/core/FalconDevice.h -@@ -103,7 +103,7 @@ namespace libnifalcon - bool setFirmwareFile(const std::string& filename); - - /** -- * Conveinence function, calls loadFirmware with a certain number of retries -+ * Convenience function, calls loadFirmware with a certain number of retries - * - * @param retries Number of times to retry loading firmware before quitting - * @param skip_checksum Whether or not to skip checksum tests when loading firmware (useful with ftd2xx on non-windows platforms) -diff --git a/include/falcon/gmtl/MatrixOps.h b/include/falcon/gmtl/MatrixOps.h -index f0bef0a..943c8aa 100644 ---- a/include/falcon/gmtl/MatrixOps.h -+++ b/include/falcon/gmtl/MatrixOps.h -@@ -436,7 +436,7 @@ namespace gmtl - { - //gmtlASSERT( ROWS == COLS && "invertFull only works with nxn matrices" ); - -- const DATA_TYPE pivot_eps(1e-20); // Epsilon for the pivot value test (delta with test against zero) -+ const DATA_TYPE pivot_eps(1e-10); // Epsilon for the pivot value test (delta with test against zero) - - // Computer inverse of matrix using a Gaussian-Jordan elimination. - // Uses max pivot at each point -@@ -468,7 +468,7 @@ namespace gmtl - - if(gmtl::Math::isEqual(DATA_TYPE(0),pivot_value,pivot_eps)) - { -- std::cerr << "*** pivot = " << pivot_value << " in mat_inv. ***\n"; -+ // std::cerr << "*** pivot = " << pivot_value << " in mat_inv. ***\n"; - result.setError(); - return result; - } -@@ -551,6 +551,7 @@ namespace gmtl - n dimenstion of matrix a. - */ - -+ const DATA_TYPE pivot_eps(1e-10); // Epsilon for the pivot value test (delta with test against zero) - const DATA_TYPE* a = src.getData(); - DATA_TYPE* b = result.mData; - -@@ -601,9 +602,9 @@ namespace gmtl - pivot = m[ r[ k] ][ c[ k] ]; - - -- if ( gmtl::Math::abs( pivot) <= 1e-20) -+ if ( gmtl::Math::abs( pivot) <= pivot_eps) - { -- std::cerr << "*** pivot = " << pivot << " in mat_inv. ***\n"; -+ // std::cerr << "*** pivot = " << pivot << " in mat_inv. ***\n"; - result.setError(); - return result; - } -diff --git a/include/falcon/grip/FalconGripFourButton.h b/include/falcon/grip/FalconGripFourButton.h -index 486a49d..216a5a0 100644 ---- a/include/falcon/grip/FalconGripFourButton.h -+++ b/include/falcon/grip/FalconGripFourButton.h -@@ -26,15 +26,21 @@ namespace libnifalcon - { - public: - /** -- * Enumeration for the default 4 button grip that comes with the falcon -- * -+ * Enumeration for the default 4 button grip that comes with the falcon. -+ * This grip has plus and minus buttonsr, one button in the center and -+ * one pointing forward. For convenience also symbolic names are provided. - */ - enum - { - BUTTON_1 = 0x1, - BUTTON_2 = 0x2, - BUTTON_3 = 0x4, -- BUTTON_4 = 0x8 -+ BUTTON_4 = 0x8, -+ /* symbolic names */ -+ PLUS_BUTTON = 0x1, -+ FORWARD_BUTTON = 0x2, -+ CENTER_BUTTON = 0x4, -+ MINUS_BUTTON = 0x8 - } FourButtonGripButtons; - - /** -diff --git a/src/comm/FalconCommLibUSB.cpp b/src/comm/FalconCommLibUSB.cpp -index b38b3a0..1ff056a 100644 ---- a/src/comm/FalconCommLibUSB.cpp -+++ b/src/comm/FalconCommLibUSB.cpp -@@ -649,13 +649,11 @@ namespace libnifalcon - ((FalconCommLibUSB*)transfer->user_data)->setHasBytesAvailable(true); - ((FalconCommLibUSB*)transfer->user_data)->setReceived(); - } -- //We will always at least get modem status bytes back -- //If we get nothing back, we have disconnected. -- //Thanks to Devanshi Shah for this fix. - else - { -- LOG_ERROR("Device disconnected"); -- ((FalconCommLibUSB*)transfer->user_data)->m_isCommOpen = false; -+ // We can't assume 0 bytes back = disconnected on linux, as it causes massive problems -+ // with other applications (mainly Pd). So, just set that we got nothing back and try to figure out -+ // some other way to detect unplugs - ((FalconCommLibUSB*)transfer->user_data)->setBytesAvailable(0); - ((FalconCommLibUSB*)transfer->user_data)->setHasBytesAvailable(false); - ((FalconCommLibUSB*)transfer->user_data)->setReceived(); -diff --git a/src/util/FalconCLIBase.cpp b/src/util/FalconCLIBase.cpp -index 6723622..a8d70cc 100644 ---- a/src/util/FalconCLIBase.cpp -+++ b/src/util/FalconCLIBase.cpp -@@ -154,8 +154,12 @@ namespace libnifalcon - } - else - { -- std::cout << "No device index specified to open, cannot continue (--help for options)" << std::endl; -- return false; -+ // assume device index 0, if none given -+ if(!m_falconDevice->open(0)) -+ { -+ std::cout << "Cannot open falcon device index 0 - Lib Error Code: " << m_falconDevice->getErrorCode() << " Device Error Code: " << m_falconDevice->getFalconComm()->getDeviceErrorCode() << std::endl; -+ return false; -+ } - } - - //There's only one kind of firmware right now, so automatically set that. -@@ -256,26 +260,20 @@ namespace libnifalcon - - bool FalconCLIBase::calibrateDevice() - { -- bool homing = false; - m_falconDevice->getFalconFirmware()->setHomingMode(true); - m_falconDevice->runIOLoop(); - if(!m_falconDevice->getFalconFirmware()->isHomed()) - { -- if(!homing) -+ m_falconDevice->getFalconFirmware()->setLEDStatus(libnifalcon::FalconFirmware::RED_LED); -+ if(m_displayCalibrationMessage) - { -- m_falconDevice->getFalconFirmware()->setLEDStatus(libnifalcon::FalconFirmware::RED_LED); -- if(m_displayCalibrationMessage) -- { -- std::cout << "Falcon not currently calibrated. Move control all the way out then push straight all the way in." << std::endl; -- m_displayCalibrationMessage = false; -- } -+ std::cout << "Falcon not currently calibrated. Move control all the way out then push straight all the way in." << std::endl; -+ m_displayCalibrationMessage = false; - } -- homing = true; - return false; - } - std::cout << "Falcon calibrated successfully." << std::endl; - m_falconDevice->getFalconFirmware()->setLEDStatus(libnifalcon::FalconFirmware::GREEN_LED); -- homing = false; - return true; - } - } diff --git a/src/vrpn/make_vrpn_libs_build.dsp b/src/vrpn/make_vrpn_libs_build.dsp deleted file mode 100644 index 50d328ce3a9156336e7b704425d850c4d727eb1d..0000000000000000000000000000000000000000 --- a/src/vrpn/make_vrpn_libs_build.dsp +++ /dev/null @@ -1,100 +0,0 @@ -# Microsoft Developer Studio Project File - Name="make_vrpn_libs_build" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=make_vrpn_libs_build - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "make_vrpn_libs_build.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "make_vrpn_libs_build.mak" CFG="make_vrpn_libs_build - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "make_vrpn_libs_build - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "make_vrpn_libs_build - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "make_vrpn_libs_build - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "pc_win32/Release" -# PROP Intermediate_Dir "pc_win32/Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "make_vrpn_libs_build - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "pc_win32/Debug" -# PROP Intermediate_Dir "pc_win32/Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "make_vrpn_libs_build - Win32 Release" -# Name "make_vrpn_libs_build - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\server_src\make_vrpn_libs_build.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/make_vrpn_libs_build.vcproj b/src/vrpn/make_vrpn_libs_build.vcproj deleted file mode 100644 index 8e91e0d5fc9060909d8aa8dfc96d65f8631d6f44..0000000000000000000000000000000000000000 --- a/src/vrpn/make_vrpn_libs_build.vcproj +++ /dev/null @@ -1,236 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="make_vrpn_libs_build" - ProjectGUID="{7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\pc_win32/Release" - IntermediateDirectory=".\pc_win32/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\pc_win32/Release/make_vrpn_libs_build.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\pc_win32/Release/make_vrpn_libs_build.pch" - AssemblerListingLocation=".\pc_win32/Release/" - ObjectFile=".\pc_win32/Release/" - ProgramDataBaseFileName=".\pc_win32/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\pc_win32/Release/make_vrpn_libs_build.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - ProgramDatabaseFile=".\pc_win32/Release/make_vrpn_libs_build.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32/Release/make_vrpn_libs_build.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\pc_win32/Debug" - IntermediateDirectory=".\pc_win32/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\pc_win32/Debug/make_vrpn_libs_build.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\pc_win32/Debug/make_vrpn_libs_build.pch" - AssemblerListingLocation=".\pc_win32/Debug/" - ObjectFile=".\pc_win32/Debug/" - ProgramDataBaseFileName=".\pc_win32/Debug/" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\pc_win32/Debug/make_vrpn_libs_build.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\pc_win32/Debug/make_vrpn_libs_build.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32/Debug/make_vrpn_libs_build.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="server_src\make_vrpn_libs_build.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/python/Base.cpp b/src/vrpn/python/Base.cpp deleted file mode 100644 index 74244dde610031dd04f77f355368f181bf5f9341..0000000000000000000000000000000000000000 --- a/src/vrpn/python/Base.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "include/Base.hpp" -#include "include/Connection.hpp" -#include <iostream> - -namespace vrpn_python { - BaseException::BaseException(const std::string &reason) : d_reason(reason) { - } - - void BaseException::launch(const std::string &reason) { - throw BaseException(reason); - } - - Base::Base(PyObject *error) : d_error(error) { - } -} diff --git a/src/vrpn/python/CMakeLists.txt b/src/vrpn/python/CMakeLists.txt deleted file mode 100644 index 8c3870f692dca143ecd6ab182f1f96005197685d..0000000000000000000000000000000000000000 --- a/src/vrpn/python/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ - -if(PYTHONLIBS_FOUND AND (VRPN_BUILD_PYTHON_HANDCODED_2X OR VRPN_BUILD_PYTHON_HANDCODED_3X)) - include_directories(${PYTHON_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}") - - set(PYTHONVERSIONDIR python) - if(PYTHON_LIBRARY MATCHES "python([23].[0-9])") - set(PYTHONVERSIONDIR "python${CMAKE_MATCH_1}/") - endif() - - if(WIN32) - add_definitions(-DCALLBACK_CALL=__stdcall) - else() - add_definitions(-DCALLBACK_CALL=) - endif() - python_add_module(vrpn-python - Base.cpp - Connection.cpp - Device.cpp - callback.cpp - include/Base.hpp - include/Connection.hpp - include/Device.hpp - include/callback.hpp - include/definition.hpp - include/exceptions.hpp - include/handlers.hpp - include/interface.hpp - include/tools.hpp - interface.cpp - quaternion/quaternion.cpp - receiver/Analog.cpp - receiver/Button.cpp - receiver/Dial.cpp - receiver/Text_Receiver.cpp - receiver/Tracker.cpp - receiver/include/Analog.hpp - receiver/include/Button.hpp - receiver/include/Dial.hpp - receiver/include/Text_Receiver.hpp - receiver/include/Tracker.hpp - receiver/receiver.cpp - sender/Poser.cpp - sender/Text_Sender.cpp - sender/include/Poser.hpp - sender/include/Text_Sender.hpp - sender/sender.cpp - tools.cpp) - target_link_libraries(vrpn-python ${PYTHON_LIBRARIES} vrpnserver) - set_target_properties(vrpn-python - PROPERTIES - FOLDER "Python Bindings" - OUTPUT_NAME vrpn) - - if(VRPN_INSTALL) - if(WIN32) -# install(TARGETS vrpn-python -# RUNTIME DESTINATION lib/${PYTHONVERSIONDIR}dist-packages/ COMPONENT python -# LIBRARY DESTINATION lib/${PYTHONVERSIONDIR}dist-packages/ COMPONENT python) - else() - install(TARGETS vrpn-python - RUNTIME DESTINATION lib/${PYTHONVERSIONDIR}dist-packages/ COMPONENT python - LIBRARY DESTINATION lib/${PYTHONVERSIONDIR}dist-packages/ COMPONENT python) - endif() - endif() -endif() diff --git a/src/vrpn/python/Connection.cpp b/src/vrpn/python/Connection.cpp deleted file mode 100644 index 7f36808beb8a1acd2140bbec16a678f44f6cc229..0000000000000000000000000000000000000000 --- a/src/vrpn/python/Connection.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "include/Connection.hpp" -#include <iostream> - -namespace vrpn_python { - - bool Connection::check(const PyObject *other) { - return (strcmp(other->ob_type->tp_name, "vrpn.Connection") == 0); - } - - bool Connection_IP::check(const PyObject *other) { - return (strcmp(other->ob_type->tp_name, "vrpn.Connection_IP") == 0); - } -} diff --git a/src/vrpn/python/Device.cpp b/src/vrpn/python/Device.cpp deleted file mode 100644 index 20d22d65925d325894383fb989281f9f8b8ce507..0000000000000000000000000000000000000000 --- a/src/vrpn/python/Device.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include "include/Device.hpp" -#include "include/Connection.hpp" -#include "include/tools.hpp" -#include "include/callback.hpp" -#include <datetime.h> -#include <iostream> -#include <algorithm> - -namespace vrpn_python { - - PyObject *Device::s_error = NULL; - - DeviceException::DeviceException(const std::string &reason) : BaseException(reason) { - } - - void DeviceException::launch(const std::string &reason) { - throw DeviceException(reason); - } - - Device::Device(PyObject *error, PyObject * args) : Base(error), d_connection(NULL) { - if (args) { - char *deviceName = NULL; - PyObject *connection = NULL; - if (!PyArg_ParseTuple(args,"s|O",&deviceName, &connection)) { - std::string error = "Invalid call : "; - error += -#if PY_MAJOR_VERSION >= 3 - ob_base. -#endif - ob_type->tp_name; - error += "(name, connection = NULL) !"; - DeviceException::launch(error); - return; - } - - d_deviceName = deviceName; - - if (connection) { - if (!Connection::check(connection)) { - std::string error = "Invalid call : "; - error += -#if PY_MAJOR_VERSION >= 3 - ob_base. -#endif - ob_type->tp_name; - error += "(name, connection = NULL): second argument must be a connexion !"; - DeviceException::launch(error); - return; - } - /// @todo Why is this using/needing a c-style cast? - //d_connection = static_cast<Connection *>(connection); - d_connection = (Connection *)(connection); - } - } - } - - Device::~Device() { - while (d_callbacks.size() > 0) { - Callback cb(d_callbacks.back()); - cb.decrement(); - d_callbacks.pop_back(); - } - } - - void Device::addCallback(void *callback) { - d_callbacks.push_back(callback); - } - - void Device::removeCallback(void *callback) { - std::vector<void *>::iterator it = std::find(d_callbacks.begin(), d_callbacks.end(), callback); - if (it != d_callbacks.end()) { - d_callbacks.erase(it); - } - } - - bool Device::init_device_common_objects(PyObject* vrpn_module) { - s_error = PyErr_NewException(const_cast<char *>("vrpn.error"), NULL, NULL); - if (!s_error) { - return false; - } - Py_INCREF(s_error); - PyModule_AddObject(vrpn_module, "error", s_error); - - PyDateTime_IMPORT; - return true; - } - - PyObject *Device::getDateTimeFromTimeval(const struct timeval &time) { - const time_t seconds = time.tv_sec; - struct tm* t = gmtime ( &seconds ); - if (t) { - return PyDateTime_FromDateAndTime(t->tm_year+1900, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, time.tv_usec); - } - return NULL; - } - - bool Device::getTimevalFromDateTime(PyObject *py_time, struct timeval &tv_time) { - if ((!py_time) || (!PyDateTime_Check(py_time))) { - return false; - } - struct tm t; - t.tm_year = PyDateTime_GET_YEAR(py_time) - 1900; - t.tm_mon = PyDateTime_GET_MONTH(py_time) - 1; - t.tm_mday = PyDateTime_GET_DAY(py_time); - t.tm_hour = PyDateTime_DATE_GET_HOUR(py_time); - t.tm_min = PyDateTime_DATE_GET_MINUTE(py_time); - t.tm_sec = PyDateTime_DATE_GET_SECOND(py_time); - - tv_time.tv_sec = mktime(&t); - tv_time.tv_usec = PyDateTime_DATE_GET_MICROSECOND(py_time); - return true; - } -} diff --git a/src/vrpn/python/GNUmakefile b/src/vrpn/python/GNUmakefile deleted file mode 100644 index 94555255f42f07318cd25d710d5c0f96dcd049da..0000000000000000000000000000000000000000 --- a/src/vrpn/python/GNUmakefile +++ /dev/null @@ -1,75 +0,0 @@ - -########################## -# common definitions. For non-UNC sites, uncomment one of the lines -# that defines hw_os for the machine you are on in the section just -# below. Then, the code should compile in your environment. -# -#HW_OS := sgi_irix -#HW_OS := pc_linux -#HW_OS := pc_linux64 -#HW_OS := pc_linux_ia64 -# Try this to cross-compile on a Linux PC for an ARM embedded controller. -#HW_OS := pc_linux_arm -# Try this to cross-compile on a Cygwin PC for an ARM embedded controller. -#HW_OS := pc_cygwin_arm -#HW_OS := pc_cygwin -#HW_OS := pc_FreeBSD -#HW_OS := sparc_solaris -#HW_OS := sparc_solaris_64 -#HW_OS := powerpc_aix -#HW_OS := powerpc_macosx -#HW_OS := universal_macosx -########################## - -########################## -# Mac OS X-specific options. If HW_OS is powerpc_macosx or universal_macosx, -# uncomment one line below to choose the minimum targeted OS X version and -# corresponding SDK. If none of the lines below is commented out, 10.5 will -# be the minimum version. -########################## -#MAC_OS_MIN_VERSION := 10.4 -#MAC_OS_MIN_VERSION := 10.5 -#MAC_OS_MIN_VERSION := 10.6 - -#PYTHON_VERSION := 2.7 -#PYTHON_VERSION := 3.2 -PYTHON_CONFIG := python$(PYTHON_VERSION)-config -PYTHON_MODULE_DIR := $(shell $(PYTHON_CONFIG) --exec-prefix)/lib/python$(PYTHON_VERSION)/lib-dynload - -CXXFLAGS := $(shell $(PYTHON_CONFIG) --includes) -I ./ -I ../ -fPIC -DCALLBACK_CALL= -LD_FLAGS := $(shell $(PYTHON_CONFIG) --ldflags) -L ../$(HW_OS) -L ../quat/$(HW_OS) -LIBSUP := $(shell $(PYTHON_CONFIG) --libs) -lvrpn -lquat -fPIC - -SRCS=interface.cpp callback.cpp tools.cpp Base.cpp Device.cpp Connection.cpp -SRCS+=receiver/receiver.cpp receiver/Tracker.cpp receiver/Analog.cpp receiver/Button.cpp receiver/Dial.cpp receiver/Text_Receiver.cpp -SRCS+=sender/sender.cpp sender/Poser.cpp sender/Text_Sender.cpp -SRCS+=quaternion/quaternion.cpp -OBJS=$(SRCS:%.cpp=$(HW_OS)/%.o) - -MODULE = $(HW_OS)/vrpn.so - -COMPILE_PATH=$(HW_OS)/receiver $(HW_OS)/sender $(HW_OS)/quaternion - -all: $(MODULE) - -$(MODULE): $(OBJS) - $(CXX) -shared $(LD_FLAGS) -o $@ $(OBJS) $(LIBSUP) - -$(HW_OS)/%.o: %.cpp - mkdir -p $(shell dirname $@)/.dir - $(CXX) $(CXXFLAGS) -o $@ -c $< - -%.C: %.cpp - $(CXX) $(CXXFLAGS) -o $@ -E $< - -clean: - rm -Rf $(HW_OS) - find . -name "*~" -delete - -depend: - @makedepend -- $(CXXFLAGS) $(SRCS) 2> /dev/null - -install: $(MODULE) - -mkdir -p $(PYTHON_MODULE_DIR) - ( cd $(PYTHON_MODULE_DIR) ; rm -f vrpn.so ) - ( cd $(HW_OS) ; cp vrpn.so $(PYTHON_MODULE_DIR) ) diff --git a/src/vrpn/python/README.txt b/src/vrpn/python/README.txt deleted file mode 100644 index 5fe5438bec23e6a87fc42f108bae9d624f45ab97..0000000000000000000000000000000000000000 --- a/src/vrpn/python/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains submissions from Damien Touraine that implements a Python interface to VRPN. There is a SWIG-produced interface in ../vrpn_python that works with Python 2.7. The version in this directory is hand-coded and works with both Python 2.7 and Python 3. - diff --git a/src/vrpn/python/callback.cpp b/src/vrpn/python/callback.cpp deleted file mode 100644 index bde47947b4a943fec2c8b17d4e6b26e69662831f..0000000000000000000000000000000000000000 --- a/src/vrpn/python/callback.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include "include/callback.hpp" -#include "include/Device.hpp" -#include <map> -#include <vrpn_Tracker.h> - -namespace vrpn_python { - - class callbackEntry { - PyObject *d_userdata; - PyObject *d_callback; - int d_counterReference; - - public: - callbackEntry(PyObject *userdata, PyObject *callback); - callbackEntry(const callbackEntry &other); - ~callbackEntry(); - - bool operator == (const callbackEntry &other) const; - bool operator < (const callbackEntry &other) const; - bool operator > (const callbackEntry &other) const; - - PyObject *getUserData() { return d_userdata ; } - PyObject *getCallback() { return d_callback ; } - - void incrementReference() { d_counterReference ++ ; } - void decrementReference() { d_counterReference -- ; } - int getCounterReference() const { return d_counterReference ; } - }; - - static std::map<callbackEntry, callbackEntry *> s_callbacks; - - callbackEntry::callbackEntry(PyObject *data, PyObject *callback) : - d_userdata(data), d_callback(callback), d_counterReference(0) { - } - - callbackEntry::callbackEntry(const callbackEntry &other) : - d_userdata(other.d_userdata), d_callback(other.d_callback), d_counterReference(0) { - } - - callbackEntry::~callbackEntry() { - } - - bool callbackEntry::operator == (const callbackEntry &other) const { - return ((other.d_userdata == d_userdata) && (other.d_callback == d_callback)); - } - - bool callbackEntry::operator < (const callbackEntry &other) const { - if (d_userdata < other.d_userdata) return true; - if (d_userdata > other.d_userdata) return false; - return (d_callback < other.d_callback); - } - - bool callbackEntry::operator > (const callbackEntry &other) const { - if (d_userdata > other.d_userdata) return true; - if (d_userdata < other.d_userdata) return false; - return (d_callback > other.d_callback); - } - - Callback::Callback(PyObject *userdata, PyObject *callback) : d_userdata(userdata), d_callback(callback) { - Py_INCREF(d_userdata); - Py_INCREF(d_callback); - - callbackEntry entry(d_userdata, d_callback); - - std::map<callbackEntry, callbackEntry *>::iterator position = s_callbacks.find(entry); - - if (position != s_callbacks.end()) { - d_entry = position->second; - } else { - d_entry = new callbackEntry(entry); - } - } - - Callback::Callback(void *data) { - d_entry = static_cast<callbackEntry *>(data); - d_userdata = d_entry->getUserData(); - d_callback = d_entry->getCallback(); - - Py_INCREF(d_userdata); - Py_INCREF(d_callback); - } - - Callback::~Callback() { - std::map<callbackEntry, callbackEntry *>::iterator position = s_callbacks.find(*d_entry); - if (d_entry->getCounterReference() < 1) { - if (position != s_callbacks.end()) { - s_callbacks.erase(position); - Py_DECREF(d_userdata); - Py_DECREF(d_callback); - } - delete d_entry; - } else { - if (position == s_callbacks.end()) { - Py_INCREF(d_userdata); - Py_INCREF(d_callback); - s_callbacks[*d_entry] = d_entry; - } - } - Py_DECREF(d_userdata); - Py_DECREF(d_callback); - } - - void Callback::increment() { - d_entry->incrementReference(); - } - - void Callback::decrement() { - d_entry->decrementReference(); - } - - void Callback::get(void *pointer, PyObject *&userdata, PyObject *&callback) { - callbackEntry* entry = static_cast<callbackEntry*>(pointer); - userdata = entry->getUserData(); - callback = entry->getCallback(); - } -} diff --git a/src/vrpn/python/essai_2_7.py b/src/vrpn/python/essai_2_7.py deleted file mode 100644 index e5cef445071e3d4292132c8a0e4f9a6e5eff0acf..0000000000000000000000000000000000000000 --- a/src/vrpn/python/essai_2_7.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/python2.7 - -import vrpn - -def callback(userdata, data): - print(type(userdata), userdata, " => ", data); - print(toto) - -tracker=vrpn.receiver.Tracker("Tracker0@localhost") -tracker.register_change_handler("position", callback, "position") - -analog=vrpn.receiver.Analog("Input0@localhost") -analog.register_change_handler("dev input", callback) - -button=vrpn.receiver.Button("Touchpad@localhost") -button.register_change_handler("dev input", callback) - -while 1: - tracker.mainloop() - analog.mainloop() - button.mainloop() - -#del(essai) diff --git a/src/vrpn/python/essai_3_2.py b/src/vrpn/python/essai_3_2.py deleted file mode 100644 index d7636572063e701b230f9904360469fd48da3e04..0000000000000000000000000000000000000000 --- a/src/vrpn/python/essai_3_2.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/python3.2 - -import vrpn - -def callback(userdata, data): - print(userdata, " => ", data); - -tracker=vrpn.receiver.Tracker("Tracker0@localhost") -tracker.register_change_handler("position", callback, "position") - -analog=vrpn.receiver.Analog("Touchpad@localhost") -analog.register_change_handler("dev input", callback) - -button=vrpn.receiver.Button("Touchpad@localhost") -button.register_change_handler("dev input", callback) - -while 1: - tracker.mainloop() - analog.mainloop() - button.mainloop() - -#del(essai) diff --git a/src/vrpn/python/include/Base.hpp b/src/vrpn/python/include/Base.hpp deleted file mode 100644 index 279540db2feaf003b488114385079ee9724a4994..0000000000000000000000000000000000000000 --- a/src/vrpn/python/include/Base.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __VRPN_PYTHON_BASE_HPP__ -#define __VRPN_PYTHON_BASE_HPP__ - -#include <Python.h> -#include <string> -#include "exceptions.hpp" - -namespace vrpn_python { - class Base { - protected: - PyObject_HEAD - PyObject *d_error; - Base(PyObject *error); - - }; -} - -#endif // defined(__VRPN_PYTHON_BASE_H__) diff --git a/src/vrpn/python/include/Connection.hpp b/src/vrpn/python/include/Connection.hpp deleted file mode 100644 index 4c310674a7268ca80183357f49b7fbce5b7a8e0f..0000000000000000000000000000000000000000 --- a/src/vrpn/python/include/Connection.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef __VRPN_PYTHON_CONNECTION_HPP__ -#define __VRPN_PYTHON_CONNECTION_HPP__ - -#include <vrpn_Tracker.h> -#include "Base.hpp" - -namespace vrpn_python { - class Connection : public Base { - vrpn_Connection *d_connection; - - public: - static bool check(const PyObject *other); - - vrpn_Connection *getConnection() { return d_connection ; } - }; - - class Connection_IP : public Connection { - - public: - static bool check(const PyObject *other); - }; - - -} - -#endif // defined(__VRPN_PYTHON_CONNECTION_REMOTE_H__) diff --git a/src/vrpn/python/include/Device.hpp b/src/vrpn/python/include/Device.hpp deleted file mode 100644 index 6d8e588fba8dde18aed180e958ccff0e6be05d76..0000000000000000000000000000000000000000 --- a/src/vrpn/python/include/Device.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __VRPN_PYTHON_DEVICE_HPP__ -#define __VRPN_PYTHON_DEVICE_HPP__ - -#include "Base.hpp" -#include "Connection.hpp" -#include <string> -#include <vector> - -namespace vrpn_python { - class Device; - - class Device : public Base { - - std::string d_deviceName; - Connection *d_connection; - - std::vector<void *> d_callbacks; - - protected: - static PyObject *s_error; - - Device(PyObject *error, PyObject * args = NULL); - ~Device(); - - const std::string &getDeviceName() const { return d_deviceName ; } - Connection *getConnection() { return d_connection ; } - - public: - void addCallback(void *); - void removeCallback(void *); - - static bool init_device_common_objects(PyObject* vrpn_module); - - static PyObject *getDateTimeFromTimeval(const struct timeval &time); - static bool getTimevalFromDateTime(PyObject *py_time, struct timeval &tv_time); - }; -} - -#endif // defined(__VRPN_PYTHON_DEVICE_H__) diff --git a/src/vrpn/python/include/callback.hpp b/src/vrpn/python/include/callback.hpp deleted file mode 100644 index e6e05e58a75c0cb8dcfd2a7b14bbb550d5db2687..0000000000000000000000000000000000000000 --- a/src/vrpn/python/include/callback.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __VRPN_PYTHON_CALLBACK_HPP__ -#define __VRPN_PYTHON_CALLBACK_HPP__ - -#include <Python.h> -#include <iostream> - -namespace vrpn_python { - - class callbackEntry; - - class Callback { - callbackEntry *d_entry; - PyObject *d_userdata; - PyObject *d_callback; - public: - Callback(PyObject *userdata, PyObject *callback); - Callback(void *data); - ~Callback(); - - void *getData() { return (void*)d_entry ; } - - void increment(); - void decrement(); - - static void get(void *, PyObject *&userdata, PyObject *&callback); - }; -} - -#endif // defined(__VRPN_PYTHON_CALLBACK_H__) diff --git a/src/vrpn/python/include/definition.hpp b/src/vrpn/python/include/definition.hpp deleted file mode 100644 index 7ad67ee57560c99e53dc641882c8bcca071a95fd..0000000000000000000000000000000000000000 --- a/src/vrpn/python/include/definition.hpp +++ /dev/null @@ -1,129 +0,0 @@ -#ifndef __VRPN_PYTHON_DEFINITION_HPP__ -#define __VRPN_PYTHON_DEFINITION_HPP__ - -#include "Connection.hpp" -#include "Device.hpp" -#include <iostream> - -namespace vrpn_python { - - template <class device_type> class definition { - - typedef typename device_type::vrpn_type vrpn_type; - - public: - static bool check(const PyObject *obj) { - if (!obj) { - return false; - } - if (PyType_IsSubtype(obj->ob_type, &device_type::getType())) { - return true; - } - return (device_type::getName() == device_type::getName()); - } - - static device_type *get(PyObject *obj) { - if (!obj) { - std::string error = "Invalid object mapping from 'NULL' to '"; - error += device_type::getName(); - error += "' !"; - DeviceException::launch(error); - } - if (!check(obj)) { - std::string error = "Invalid object mapping from '"; - error += obj->ob_type->tp_name; - error += "' to '"; - error += device_type::getName(); - error += "' !"; - DeviceException::launch(error); - } - return (device_type*)obj; - } - - static int init(PyObject *obj, PyObject *args, PyObject * /*kwds*/) { - try { - get(obj); - device_type *self = new(obj) device_type(device_type::s_error, args); - Connection *Py_Connection = self->getConnection(); - vrpn_Connection *connection = NULL; - if (Py_Connection != NULL) { - connection = Py_Connection->getConnection(); - } - self->d_device = new vrpn_type(self->getDeviceName().c_str(), connection); - if (self->d_device) { - return 0; - } - } catch (DeviceException &exception) { - PyErr_SetString(device_type::s_error, exception.getReason().c_str()); - } - return -1; - } - - static void dealloc(PyObject* obj) { - try { - device_type *self = get(obj); - self->~device_type(); - if (self->d_device) { - delete self->d_device; - self->d_device = NULL; - } - } catch (DeviceException &exception) { - PyErr_SetString(device_type::s_error, exception.getReason().c_str()); - } - Py_TYPE(obj)->tp_free(obj); - } - - static PyObject *mainloop(PyObject *obj) { - try { - device_type *self = get(obj); - self->d_device->mainloop(); - Py_RETURN_TRUE; - } catch (DeviceException &exception) { - PyErr_SetString(device_type::s_error, exception.getReason().c_str()); - Py_RETURN_FALSE; - } catch (CallbackException) { - return NULL; - } - } - - static bool init_type() { - PyTypeObject &device_object_type = device_type::getType(); - device_object_type.tp_new = PyType_GenericNew; - device_object_type.tp_dealloc = dealloc; - device_object_type.tp_init = init; - device_object_type.tp_flags = Py_TPFLAGS_DEFAULT; - std::string doc = device_type::getName() + " VRPN objects"; - device_object_type.tp_doc = doc.c_str(); - device_object_type.tp_methods = device_type::getMethods(); - - if (PyType_Ready(&device_object_type) < 0) - return false; - return true; - } - - static void add_type(PyObject *module) { - PyTypeObject &device_object_type = device_type::getType(); - Py_INCREF(&device_object_type); - PyModule_AddObject(module, device_type::getName().c_str(), (PyObject *)&device_object_type); - - std::string error_name = device_type::getName() + ".error"; - char *exception_name = new char [strlen(error_name.c_str()) + 1]; - strcpy(exception_name, error_name.c_str()); - device_type::s_error = PyErr_NewException(exception_name, NULL, NULL); - delete [] exception_name; - Py_INCREF(device_type::s_error); - PyModule_AddObject(module, error_name.c_str(), device_type::s_error); - } - - static PyObject *register_change_handler(PyObject *obj, PyObject *args) { - return device_type::work_on_change_handler(true, obj, args) ; - } - - static PyObject *unregister_change_handler(PyObject *obj, PyObject *args) { - return device_type::work_on_change_handler(false, obj, args) ; - } - - }; -} - -#endif // defined(__VRPN_PYTHON_DEFINITION_H__) diff --git a/src/vrpn/python/include/exceptions.hpp b/src/vrpn/python/include/exceptions.hpp deleted file mode 100644 index 4fd2457e8cd6e5739a6fbbdb7967a2030f2c04e8..0000000000000000000000000000000000000000 --- a/src/vrpn/python/include/exceptions.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef __VRPN_PYTHON_EXCEPTIONS_HPP__ -#define __VRPN_PYTHON_EXCEPTIONS_HPP__ - -#include <string> - -namespace vrpn_python { - - class BaseException { - std::string d_reason; - - protected: - BaseException(const std::string &reason); - - public: - static void launch(const std::string &reason); - - const std::string &getReason() const { return d_reason ; } - }; - - class DeviceException : public BaseException { - public: - DeviceException(const std::string &reason); - - public: - static void launch(const std::string &reason); - }; - - class CallbackException { - }; - -} - -#endif // defined(__VRPN_PYTHON_EXCEPTIONS_HPP__) diff --git a/src/vrpn/python/include/handlers.hpp b/src/vrpn/python/include/handlers.hpp deleted file mode 100644 index 9c27d1bc59884866f321734ff1f4acf9e8198205..0000000000000000000000000000000000000000 --- a/src/vrpn/python/include/handlers.hpp +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef __VRPN_PYTHON_HANDLERS_HPP__ -#define __VRPN_PYTHON_HANDLERS_HPP__ - -#include "callback.hpp" -#include "exceptions.hpp" -#include <iostream> - -namespace vrpn_python { - class Device; - - namespace handlers { - template <typename vrpn_info_type> PyObject *CALLBACK_CALL createPyObjectFromVRPN_Type(const vrpn_info_type &info); - - template <typename vrpn_info_type> void CALLBACK_CALL change_handler(void *data, const vrpn_info_type info) { - PyObject *userdata; - PyObject *callback; - - Callback::get(data, userdata, callback); - - PyObject *value = createPyObjectFromVRPN_Type<vrpn_info_type>(info); - PyObject *arglist = Py_BuildValue("OO", userdata, value); - Py_DECREF(value); // Destroy entity created by createPyObjectFromVRPN_Type<>(info) - - PyObject *result = PyEval_CallObject(callback,arglist); - Py_DECREF(arglist); // Destroy entities created by Py_BuildValue("OO", userdata, value) - - if (result != NULL) { - Py_DECREF(result); // Destroy the evaluation ! - } else { - throw CallbackException(); - } - } - - template <class device_type, typename vrpn_info_type> void register_handler(device_type *self, bool add, Callback &cb, int sensor, const std::string &error) { - if (add) { - if (self->getDevice()->register_change_handler(cb.getData(), change_handler<vrpn_info_type>, sensor) >= 0) { - cb.increment(); - return; - } - } else { - if (self->getDevice()->unregister_change_handler(cb.getData(), change_handler<vrpn_info_type>, sensor) >= 0) { - cb.decrement(); - return; - } - } - DeviceException::launch(error); - } - - template <class device_type, typename vrpn_info_type> void register_handler(device_type *self, bool add, Callback &cb, const std::string &error) { - if (add) { - if (self->getDevice()->register_change_handler(cb.getData(), change_handler<vrpn_info_type>) >= 0) { - cb.increment(); - return; - } - } else { - if (self->getDevice()->unregister_change_handler(cb.getData(), change_handler<vrpn_info_type>) >= 0) { - cb.decrement(); - return; - } - } - DeviceException::launch(error); - } - } -} - -#endif // defined(__VRPN_PYTHON_HANDLERS_H__) diff --git a/src/vrpn/python/include/interface.hpp b/src/vrpn/python/include/interface.hpp deleted file mode 100644 index 7912fc3bec8f42e060e50be4aa50e4a410186bf2..0000000000000000000000000000000000000000 --- a/src/vrpn/python/include/interface.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef __VRPN_PYTHON_INTERFACE_HPP__ -#define __VRPN_PYTHON_INTERFACE_HPP__ - -#include <Python.h> - -namespace vrpn_python { - namespace receiver { - bool init_types(); - void add_types(PyObject* module); - } - - namespace sender { - bool init_types(); - void add_types(PyObject* module); - } - - namespace quaternion { - bool init_types(); - void add_types(PyObject* module); - } -} - -#endif // defined(__VRPN_PYTHON_INTERFACE_H__) diff --git a/src/vrpn/python/include/tools.hpp b/src/vrpn/python/include/tools.hpp deleted file mode 100644 index aa37c7eb1ddc0d9986a76bee0c8e21afa9842f3f..0000000000000000000000000000000000000000 --- a/src/vrpn/python/include/tools.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __VRPN_PYTHON_TOOLS_HPP__ -#define __VRPN_PYTHON_TOOLS_HPP__ - -#include <Python.h> -#include <string> - -namespace vrpn_python { - namespace tools { - bool getStringFromPyObject(PyObject *, std::string &); - bool getIntegerFromPyObject(PyObject *py_int, int &_int); - } -} - -#endif // defined(__VRPN_PYTHON_BASE_H__) diff --git a/src/vrpn/python/interface.cpp b/src/vrpn/python/interface.cpp deleted file mode 100644 index db26710da5a18472ebd97387b0a64a7fce2277bd..0000000000000000000000000000000000000000 --- a/src/vrpn/python/interface.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "include/interface.hpp" -#include "include/definition.hpp" -#include "include/Device.hpp" - -#ifdef DEFINE_REFCOUNT -static PyObject *refCount(PyObject *self, PyObject *args) { - PyObject *real_object; - - if (!PyArg_ParseTuple(args, "O", &real_object)) - return NULL; - - return PyLong_FromLong(real_object->ob_refcnt); -} - -static PyMethodDef vrpnMethods[] = { - {"refCount", refCount, METH_VARARGS, "Execute a shell command."}, - {NULL, NULL, 0, NULL} -}; -#endif - -#if PY_MAJOR_VERSION >= 3 -static PyModuleDef module_definition = { - PyModuleDef_HEAD_INIT, - "vrpn", - "VRPN wrapper classes.", - -1, -# ifdef DEFINE_REFCOUNT - vrpnMethods -# else - NULL -# endif -}; - -#define INIT_FUNCTION_RETURN_VALUE(VALUE) return VALUE -PyMODINIT_FUNC PyInit_vrpn(void) { - -#else // if PY_MAJOR_VERSION < 3 -#define INIT_FUNCTION_RETURN_VALUE(VALUE) return -PyMODINIT_FUNC initvrpn(void) { - -#endif - - if (!vrpn_python::receiver::init_types()) INIT_FUNCTION_RETURN_VALUE (NULL); - if (!vrpn_python::sender::init_types()) INIT_FUNCTION_RETURN_VALUE (NULL); - if (!vrpn_python::quaternion::init_types()) INIT_FUNCTION_RETURN_VALUE (NULL); - - PyObject* vrpn_module = -#if (PY_MAJOR_VERSION >= 3) && (PY_MINOR_VERSION >= 1) - PyModule_Create(&module_definition); -#else -# ifdef DEFINE_REFCOUNT - Py_InitModule("vrpn", vrpnMethods); -# else - Py_InitModule("vrpn", NULL); -# endif -#endif - - if (vrpn_module == NULL) INIT_FUNCTION_RETURN_VALUE (NULL); - - if (!vrpn_python::Device::init_device_common_objects(vrpn_module)) { - INIT_FUNCTION_RETURN_VALUE (NULL); - } - - vrpn_python::receiver::add_types(vrpn_module); - vrpn_python::sender::add_types(vrpn_module); - vrpn_python::quaternion::add_types(vrpn_module); - - INIT_FUNCTION_RETURN_VALUE (vrpn_module); -} diff --git a/src/vrpn/python/quaternion/quaternion.cpp b/src/vrpn/python/quaternion/quaternion.cpp deleted file mode 100644 index e4767024a2d280be0ed61f304321b6b4044d1650..0000000000000000000000000000000000000000 --- a/src/vrpn/python/quaternion/quaternion.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include <include/interface.hpp> -#include <quat/quat.h> -#include <iostream> - -namespace vrpn_python { - namespace quaternion { - - static PyObject *to_col_matrix(PyObject *self, PyObject *args) { - q_type quaternion; - - if (!PyArg_ParseTuple(args, "(dddd)", &quaternion[0], &quaternion[1], &quaternion[2], &quaternion[3])) - return NULL; - - q_matrix_type matrix; - - q_to_col_matrix(matrix, quaternion); - - return Py_BuildValue("((ddd)(ddd)(ddd))", - matrix[0][0], matrix[0][1], matrix[0][2], - matrix[1][0], matrix[1][1], matrix[1][2], - matrix[2][0], matrix[2][1], matrix[2][2]); - } - - static PyObject *to_row_matrix(PyObject *self, PyObject *args) { - q_type quaternion; - - if (!PyArg_ParseTuple(args, "(dddd)", &quaternion[0], &quaternion[1], &quaternion[2], &quaternion[3])) - return NULL; - - q_matrix_type matrix; - - q_to_row_matrix(matrix, quaternion); - - return Py_BuildValue("((ddd)(ddd)(ddd))", - matrix[0][0], matrix[0][1], matrix[0][2], - matrix[1][0], matrix[1][1], matrix[1][2], - matrix[2][0], matrix[2][1], matrix[2][2]); - } - - static PyMethodDef vrpnMethods[] = { - {"to_col_matrix", to_col_matrix, METH_VARARGS, "Convert quaternion to 4x4 column-major rotation matrix.\nQuaternion need not be unit magnitude."}, - {"to_row_matrix", to_row_matrix, METH_VARARGS, "Convert quaternion to 4x4 row-major rotation matrix.\nQuaternion need not be unit magnitude."}, - {NULL, NULL, 0, NULL} - }; - -#if PY_MAJOR_VERSION >= 3 - static PyModuleDef module_definition = { - PyModuleDef_HEAD_INIT, - "quaternion", - "VRPN quaternion methods.", - -1, - vrpnMethods, - NULL - }; -#endif - - bool init_types() { - - return true; - } - - void add_types(PyObject* vrpn_module) { - PyObject* quaternion_module = -#if PY_MAJOR_VERSION >= 3 - PyModule_Create(&module_definition); -#else - Py_InitModule("quaternion", vrpnMethods); -#endif - - PyModule_AddObject(vrpn_module, "quaternion", quaternion_module); - } - } -} diff --git a/src/vrpn/python/receiver/Analog.cpp b/src/vrpn/python/receiver/Analog.cpp deleted file mode 100644 index 2f473e539b07010aa283218261620eb99304619a..0000000000000000000000000000000000000000 --- a/src/vrpn/python/receiver/Analog.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "include/Analog.hpp" -#include "include/callback.hpp" -#include "include/definition.hpp" -#include "include/handlers.hpp" -#include <iostream> - -namespace vrpn_python { - - static PyTypeObject Analog_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "Analog", // tp_name - sizeof(Analog), // tp_basicsize - }; - - static PyMethodDef Analog_methods[] = { - {"mainloop", (PyCFunction)Analog::_definition::mainloop, METH_NOARGS, "Run the mainloop" }, - {"register_change_handler", (PyCFunction)Analog::_definition::register_change_handler, METH_VARARGS, "Register a callback handler to handle a position change" }, - {"unregister_change_handler", (PyCFunction)Analog::_definition::unregister_change_handler, METH_VARARGS, "Unregister a callback handler to handle a position change" }, - {NULL} /* Sentinel */ - }; - - PyTypeObject &Analog::getType() { - return Analog_Type; - } - - PyMethodDef* Analog::getMethods() { - return (PyMethodDef*)Analog_methods; - } - - const std::string &Analog::getName() { - static const std::string name = "Analog"; - return name; - } - - - Analog::Analog(PyObject *error, PyObject * args) : Device(error, args), d_device(NULL) { - } - - PyObject * Analog::work_on_change_handler(bool add, PyObject *obj, PyObject *args) { - try { - Analog *self = _definition::get(obj); - - static std::string defaultCall("invalid call : register_change_handler(userdata, callback)"); - - PyObject *callback; - PyObject *userdata; - if ((!args) || (!PyArg_ParseTuple(args,"OO",&userdata, &callback))) { - DeviceException::launch(defaultCall); - } - - Callback cb(userdata, callback); - - handlers::register_handler<Analog, vrpn_ANALOGCB>(self, add, cb, defaultCall); - Py_RETURN_TRUE; - - } catch (DeviceException &exception) { - PyErr_SetString(Device::s_error, exception.getReason().c_str()); - } - return NULL; - } - - namespace handlers { - template<> PyObject *CALLBACK_CALL createPyObjectFromVRPN_Type(const vrpn_ANALOGCB &info) { - PyObject *channel = PyTuple_New(info.num_channel); - for (int i = 0 ; i < info.num_channel ; i++) { - PyTuple_SetItem(channel, i, Py_BuildValue("f", info.channel[i])); - } - PyObject *result = Py_BuildValue("{sOsO}", - "time", Device::getDateTimeFromTimeval(info.msg_time), - "channel", channel); - return result; - } - } -} diff --git a/src/vrpn/python/receiver/Button.cpp b/src/vrpn/python/receiver/Button.cpp deleted file mode 100644 index a92f0223eaafd0c4f7902e4171ebf1a2a94fc556..0000000000000000000000000000000000000000 --- a/src/vrpn/python/receiver/Button.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "include/Button.hpp" -#include "include/callback.hpp" -#include "include/definition.hpp" -#include "include/handlers.hpp" -#include <iostream> - -namespace vrpn_python { - - static PyTypeObject Button_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "Button", // tp_name - sizeof(Button), // tp_basicsize - }; - - static PyMethodDef Button_methods[] = { - {"mainloop", (PyCFunction)Button::_definition::mainloop, METH_NOARGS, "Run the mainloop" }, - {"register_change_handler", (PyCFunction)Button::_definition::register_change_handler, METH_VARARGS, "Register a callback handler to handle a position change" }, - {"unregister_change_handler", (PyCFunction)Button::_definition::unregister_change_handler, METH_VARARGS, "Unregister a callback handler to handle a position change" }, - {NULL} /* Sentinel */ - }; - - PyTypeObject &Button::getType() { - return Button_Type; - } - - PyMethodDef* Button::getMethods() { - return (PyMethodDef*)Button_methods; - } - - const std::string &Button::getName() { - static const std::string name = "Button"; - return name; - } - - - Button::Button(PyObject *error, PyObject * args) : Device(error, args), d_device(NULL) { - } - - PyObject * Button::work_on_change_handler(bool add, PyObject *obj, PyObject *args) { - try { - Button *self = _definition::get(obj); - - static std::string defaultCall("invalid call : register_change_handler(userdata, callback)"); - - PyObject *callback; - PyObject *userdata; - if ((!args) || (!PyArg_ParseTuple(args,"OO",&userdata, &callback))) { - DeviceException::launch(defaultCall); - } - - Callback cb(userdata, callback); - - handlers::register_handler<Button, vrpn_BUTTONCB>(self, add, cb, defaultCall); - Py_RETURN_TRUE; - - } catch (DeviceException &exception) { - PyErr_SetString(Button::s_error, exception.getReason().c_str()); - } - return NULL; - } - - namespace handlers { - template<> PyObject *CALLBACK_CALL createPyObjectFromVRPN_Type(const vrpn_BUTTONCB &info) { - return Py_BuildValue("{sOsisi}", - "time", Device::getDateTimeFromTimeval(info.msg_time), - "button", info.button, - "state", info.state); - } - } -} diff --git a/src/vrpn/python/receiver/Dial.cpp b/src/vrpn/python/receiver/Dial.cpp deleted file mode 100644 index 9dbf4b1f51db3b11a380e88a2de868e58b92e8e9..0000000000000000000000000000000000000000 --- a/src/vrpn/python/receiver/Dial.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "include/Dial.hpp" -#include "include/callback.hpp" -#include "include/definition.hpp" -#include "include/handlers.hpp" -#include <iostream> - -namespace vrpn_python { - - static PyTypeObject Dial_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "Dial", // tp_name - sizeof(Dial), // tp_basicsize - }; - - static PyMethodDef Dial_methods[] = { - {"mainloop", (PyCFunction)Dial::_definition::mainloop, METH_NOARGS, "Run the mainloop" }, - {"register_change_handler", (PyCFunction)Dial::_definition::register_change_handler, METH_VARARGS, "Register a callback handler to handle a position change" }, - {"unregister_change_handler", (PyCFunction)Dial::_definition::unregister_change_handler, METH_VARARGS, "Unregister a callback handler to handle a position change" }, - {NULL} /* Sentinel */ - }; - - PyTypeObject &Dial::getType() { - return Dial_Type; - } - - PyMethodDef* Dial::getMethods() { - return (PyMethodDef*)Dial_methods; - } - - const std::string &Dial::getName() { - static const std::string name = "Dial"; - return name; - } - - - Dial::Dial(PyObject *error, PyObject * args) : Device(error, args), d_device(NULL) { - } - - PyObject * Dial::work_on_change_handler(bool add, PyObject *obj, PyObject *args) { - try { - Dial *self = _definition::get(obj); - - static std::string defaultCall("invalid call : register_change_handler(userdata, callback)"); - - PyObject *callback; - PyObject *userdata; - if ((!args) || (!PyArg_ParseTuple(args,"OO",&userdata, &callback))) { - DeviceException::launch(defaultCall); - } - - Callback cb(userdata, callback); - - handlers::register_handler<Dial, vrpn_DIALCB>(self, add, cb, defaultCall); - Py_RETURN_TRUE; - - } catch (DeviceException &exception) { - PyErr_SetString(Device::s_error, exception.getReason().c_str()); - } - return NULL; - } - - namespace handlers { - template<> PyObject *CALLBACK_CALL createPyObjectFromVRPN_Type(const vrpn_DIALCB &info) { - return Py_BuildValue("{sOsisd}", - "time", Device::getDateTimeFromTimeval(info.msg_time), - "dial", info.dial, - "change", info.change); - } - } -} diff --git a/src/vrpn/python/receiver/Text_Receiver.cpp b/src/vrpn/python/receiver/Text_Receiver.cpp deleted file mode 100644 index dfea2c76eb26645491a9b4c35873ba6517044960..0000000000000000000000000000000000000000 --- a/src/vrpn/python/receiver/Text_Receiver.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include "include/Text_Receiver.hpp" -#include "include/callback.hpp" -#include "include/definition.hpp" -#include "include/handlers.hpp" -#include <iostream> - -namespace vrpn_python { - - static PyTypeObject Text_Receiver_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "Text", // tp_name - sizeof(Text_Receiver), // tp_basicsize - }; - - static PyMethodDef Text_Receiver_methods[] = { - {"mainloop", (PyCFunction)Text_Receiver::_definition::mainloop, METH_NOARGS, "Run the mainloop" }, - {"register_change_handler", (PyCFunction)Text_Receiver::_definition::register_change_handler, METH_VARARGS, "Register a callback handler to handle a position change" }, - {"unregister_change_handler", (PyCFunction)Text_Receiver::_definition::unregister_change_handler, METH_VARARGS, "Unregister a callback handler to handle a position change" }, - {NULL} /* Sentinel */ - }; - - PyTypeObject &Text_Receiver::getType() { - return Text_Receiver_Type; - } - - PyMethodDef* Text_Receiver::getMethods() { - return (PyMethodDef*)Text_Receiver_methods; - } - - const std::string &Text_Receiver::getName() { - static const std::string name = "Text"; - return name; - } - - - Text_Receiver::Text_Receiver(PyObject *error, PyObject * args) : Device(error, args), d_device(NULL) { - } - - PyObject * Text_Receiver::work_on_change_handler(bool add, PyObject *obj, PyObject *args) { - try { - Text_Receiver *self = _definition::get(obj); - - static std::string defaultCall("invalid call : register_change_handler(userdata, callback)"); - - PyObject *callback; - PyObject *userdata; - if ((!args) || (!PyArg_ParseTuple(args,"OO",&userdata, &callback))) { - DeviceException::launch(defaultCall); - } - - Callback cb(userdata, callback); - - if (add) { - if (self->getDevice()->register_message_handler(cb.getData(), handlers::change_handler<vrpn_TEXTCB>) >= 0) { - cb.increment(); - Py_RETURN_TRUE; - } - } else { - if (self->getDevice()->unregister_message_handler(cb.getData(), handlers::change_handler<vrpn_TEXTCB>) >= 0) { - cb.decrement(); - Py_RETURN_TRUE; - } - } - DeviceException::launch(defaultCall); - - } catch (DeviceException &exception) { - PyErr_SetString(Device::s_error, exception.getReason().c_str()); - } - return NULL; - } - - namespace handlers { - template<> PyObject *CALLBACK_CALL createPyObjectFromVRPN_Type(const vrpn_TEXTCB &info) { - const char *severity; - switch (info.type) { - case vrpn_TEXT_NORMAL: - severity = "normal"; - break; - case vrpn_TEXT_WARNING: - severity = "warning"; - break; - case vrpn_TEXT_ERROR: - severity = "error"; - break; - default: - DeviceException::launch("Invalid severity : should be normal, warning or error"); - return NULL; - }; - return Py_BuildValue("{sOsssssi}", - "time", Device::getDateTimeFromTimeval(info.msg_time), - "message", info.message, - "severity", severity, - "level", info.level); - } - } -} diff --git a/src/vrpn/python/receiver/Tracker.cpp b/src/vrpn/python/receiver/Tracker.cpp deleted file mode 100644 index 57448da1e54c6bcb62c963d240ebc4615e7c9276..0000000000000000000000000000000000000000 --- a/src/vrpn/python/receiver/Tracker.cpp +++ /dev/null @@ -1,172 +0,0 @@ -#include "include/Tracker.hpp" -#include "include/definition.hpp" -#include "include/callback.hpp" -#include "include/handlers.hpp" -#include <iostream> - -namespace vrpn_python { - - static PyTypeObject Tracker_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "Tracker", // tp_name - sizeof(Tracker), // tp_basicsize - }; - -#define WRAPPER_REQUEST(NAME, DOC) {#NAME, (PyCFunction)Tracker::NAME, METH_NOARGS, DOC } - - static PyMethodDef Tracker_methods[] = { - {"mainloop", (PyCFunction)Tracker::_definition::mainloop, METH_NOARGS, "Run the mainloop" }, - {"register_change_handler", (PyCFunction)Tracker::_definition::register_change_handler, METH_VARARGS, "Register a callback handler to handle a position change" }, - {"unregister_change_handler", (PyCFunction)Tracker::_definition::unregister_change_handler, METH_VARARGS, "Unregister a callback handler to handle a position change" }, - WRAPPER_REQUEST(request_t2r_xform, "request room from tracker xforms"), - WRAPPER_REQUEST(request_u2s_xform, "request all available sensor from unit xforms"), - WRAPPER_REQUEST(request_workspace, "request workspace bounding box"), - WRAPPER_REQUEST(reset_origin, "reset origin to current tracker location (e.g. - to reinitialize a PHANToM in its reset position)"), - {NULL} /* Sentinel */ - }; -#undef WRAPPER_REQUEST - - PyTypeObject &Tracker::getType() { - return Tracker_Type; - } - - PyMethodDef* Tracker::getMethods() { - return (PyMethodDef*)Tracker_methods; - } - - const std::string &Tracker::getName() { - static const std::string name = "Tracker"; - return name; - } - - Tracker::Tracker(PyObject *error, PyObject * args) : Device(error, args), d_device(NULL) { - } - - PyObject * Tracker::work_on_change_handler(bool add, PyObject *obj, PyObject *args) { - try { - Tracker *self = _definition::get(obj); - - static std::string defaultCall("invalid call : register_change_handler(userdata, callback, type, sensor)"); - - PyObject *callback; - PyObject *userdata; - char *_type; - int sensor = vrpn_ALL_SENSORS; - if ((!args) || (!PyArg_ParseTuple(args,"OOs|i",&userdata, &callback, &_type, &sensor))) { - DeviceException::launch(defaultCall); - } - - std::string thirdError("Third attribut must be 'position', 'velocity', 'acceleration', 'workspace', 'unit2sensor' or 'tracker2room' !"); - - std::string type(_type); - - Callback cb(userdata, callback); - - if (type == "position") { - handlers::register_handler<Tracker, vrpn_TRACKERCB>(self, add, cb, sensor, thirdError); - Py_RETURN_TRUE; - } - - if (type == "velocity") { - handlers::register_handler<Tracker, vrpn_TRACKERVELCB>(self, add, cb, sensor, thirdError); - Py_RETURN_TRUE; - } - - if (type == "acceleration") { - handlers::register_handler<Tracker, vrpn_TRACKERACCCB>(self, add, cb, sensor, thirdError); - Py_RETURN_TRUE; - } - - if (type == "unit2sensor") { - handlers::register_handler<Tracker, vrpn_TRACKERUNIT2SENSORCB>(self, add, cb, sensor, thirdError); - Py_RETURN_TRUE; - } - - if (type == "workspace") { - handlers::register_handler<Tracker, vrpn_TRACKERWORKSPACECB>(self, add, cb, thirdError); - Py_RETURN_TRUE; - } - - if (type == "tracker2room") { - handlers::register_handler<Tracker, vrpn_TRACKERTRACKER2ROOMCB>(self, add, cb, thirdError); - Py_RETURN_TRUE; - } - - DeviceException::launch(thirdError); - - } catch (DeviceException &exception) { - PyErr_SetString(Device::s_error, exception.getReason().c_str()); - } - return NULL; - } - -#define WRAPPER_REQUEST(NAME, ERROR_MSG) \ - PyObject *Tracker::NAME(PyObject *obj) { \ - try { \ - Tracker *self = _definition::get(obj); \ - if (self->d_device->NAME() < 1) \ - Py_RETURN_TRUE; \ - DeviceException::launch(ERROR_MSG); \ - } catch (DeviceException &exception) { \ - PyErr_SetString(Device::s_error, exception.getReason().c_str()); \ - } \ - return NULL; \ - } - - WRAPPER_REQUEST(request_t2r_xform, "Tracker : cannot request t2r xform") - WRAPPER_REQUEST(request_u2s_xform, "Tracker : cannot request u2s xform") - WRAPPER_REQUEST(request_workspace, "Tracker : cannot request workspace") - WRAPPER_REQUEST(reset_origin, "Tracker : cannot reset the origin") -#undef WRAPPER_REQUEST - - namespace handlers { - template<> PyObject *CALLBACK_CALL createPyObjectFromVRPN_Type(const vrpn_TRACKERCB &info) { - return Py_BuildValue("{sOsis(fff)s(ffff)}", - "time", Device::getDateTimeFromTimeval(info.msg_time), - "sensor", info.sensor, - "position", info.pos[0],info.pos[1],info.pos[2], - "quaternion", info.quat[0],info.quat[1],info.quat[2],info.quat[3]); - } - - template<> PyObject *CALLBACK_CALL createPyObjectFromVRPN_Type(const vrpn_TRACKERVELCB &info) { - return Py_BuildValue("{sOsis(fff)s(ffff)si}", - "time", Device::getDateTimeFromTimeval(info.msg_time), - "sensor", info.sensor, - "velocity", info.vel[0],info.vel[1],info.vel[2], - "future quaternion", info.vel_quat[0],info.vel_quat[1],info.vel_quat[2],info.vel_quat[3], - "future delta", info.vel_quat_dt); - } - - template<> PyObject *CALLBACK_CALL createPyObjectFromVRPN_Type(const vrpn_TRACKERACCCB &info) { - return Py_BuildValue("{sOsis(fff)s(ffff)si}", - "time", Device::getDateTimeFromTimeval(info.msg_time), - "sensor", info.sensor, - "acceleration", info.acc[0],info.acc[1],info.acc[2], - "future acceleration ?", info.acc_quat[0],info.acc_quat[1],info.acc_quat[2],info.acc_quat[3], - "future delta", info.acc_quat_dt); - } - - template<> PyObject *CALLBACK_CALL createPyObjectFromVRPN_Type(const vrpn_TRACKERTRACKER2ROOMCB &info) { - return Py_BuildValue("{sOs(fff)s(ffff)}", - "time", Device::getDateTimeFromTimeval(info.msg_time), - "position offset", info.tracker2room[0],info.tracker2room[1],info.tracker2room[2], - "quaternion offset", info.tracker2room_quat[0],info.tracker2room_quat[1],info.tracker2room_quat[2],info.tracker2room_quat[3]); - } - - template<> PyObject *CALLBACK_CALL createPyObjectFromVRPN_Type(const vrpn_TRACKERUNIT2SENSORCB &info) { - return Py_BuildValue("{sOsis(fff)s(ffff)}", - "time", Device::getDateTimeFromTimeval(info.msg_time), - "sensor", info.sensor, - "position offset", info.unit2sensor[0],info.unit2sensor[1],info.unit2sensor[2], - "quaternion offset", info.unit2sensor_quat[0],info.unit2sensor_quat[1],info.unit2sensor_quat[2],info.unit2sensor_quat[3]); - } - - template<> PyObject *CALLBACK_CALL createPyObjectFromVRPN_Type(const vrpn_TRACKERWORKSPACECB &info) { - return Py_BuildValue("{sOs(fff)s(fff)}", - "time", Device::getDateTimeFromTimeval(info.msg_time), - "minimum corner box", info.workspace_min[0],info.workspace_min[1],info.workspace_min[2], - "maximum corner box", info.workspace_max[0],info.workspace_max[1],info.workspace_max[2]); - } - - } -} diff --git a/src/vrpn/python/receiver/include/Analog.hpp b/src/vrpn/python/receiver/include/Analog.hpp deleted file mode 100644 index c30bcb13f28ed9715ea07e96c3fd85225a78776d..0000000000000000000000000000000000000000 --- a/src/vrpn/python/receiver/include/Analog.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __VRPN_PYTHON_ANALOG_HPP__ -#define __VRPN_PYTHON_ANALOG_HPP__ - -#include <vrpn_Analog.h> -#include <include/Device.hpp> - -namespace vrpn_python { - template <class device_type> class definition; - - class Analog : public Device { - typedef vrpn_Analog_Remote vrpn_type; - friend class definition<Analog>; - - vrpn_type *d_device; - - Analog(PyObject *error, PyObject * args); - - static PyTypeObject &getType(); - static PyMethodDef* getMethods(); - static const std::string &getName(); - - static PyObject *work_on_change_handler(bool add, PyObject *obj, PyObject *args); - - public: - vrpn_type *getDevice() { return d_device ; } - - typedef definition<Analog> _definition; - }; -} - -#endif // defined(__VRPN_PYTHON_ANALOG_REMOTE_H__) diff --git a/src/vrpn/python/receiver/include/Button.hpp b/src/vrpn/python/receiver/include/Button.hpp deleted file mode 100644 index 382f71db19c352666277c85696548ae5d9b69e17..0000000000000000000000000000000000000000 --- a/src/vrpn/python/receiver/include/Button.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __VRPN_PYTHON_BUTTON_HPP__ -#define __VRPN_PYTHON_BUTTON_HPP__ - -#include <vrpn_Button.h> -#include <include/Device.hpp> - -namespace vrpn_python { - template <class device_type> class definition; - - class Button : public Device { - typedef vrpn_Button_Remote vrpn_type; - friend class definition<Button>; - - vrpn_type *d_device; - - Button(PyObject *error, PyObject * args); - - static PyTypeObject &getType(); - static PyMethodDef* getMethods(); - static const std::string &getName(); - - static PyObject *work_on_change_handler(bool add, PyObject *obj, PyObject *args); - - public: - vrpn_type *getDevice() { return d_device ; } - - typedef definition<Button> _definition; - }; -} - -#endif // defined(__VRPN_PYTHON_BUTTON_REMOTE_H__) diff --git a/src/vrpn/python/receiver/include/Dial.hpp b/src/vrpn/python/receiver/include/Dial.hpp deleted file mode 100644 index 11d0fc66d2b5a59714a21f8eec02f89059c9e8f1..0000000000000000000000000000000000000000 --- a/src/vrpn/python/receiver/include/Dial.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __VRPN_PYTHON_DIAL_HPP__ -#define __VRPN_PYTHON_DIAL_HPP__ - -#include <vrpn_Dial.h> -#include <include/Device.hpp> - -namespace vrpn_python { - template <class device_type> class definition; - - class Dial : public Device { - typedef vrpn_Dial_Remote vrpn_type; - friend class definition<Dial>; - - vrpn_type *d_device; - - Dial(PyObject *error, PyObject * args); - - static PyTypeObject &getType(); - static PyMethodDef* getMethods(); - static const std::string &getName(); - - static PyObject *work_on_change_handler(bool add, PyObject *obj, PyObject *args); - - public: - vrpn_type *getDevice() { return d_device ; } - - typedef definition<Dial> _definition; - }; -} - -#endif // defined(__VRPN_PYTHON_DIAL_REMOTE_H__) diff --git a/src/vrpn/python/receiver/include/Text_Receiver.hpp b/src/vrpn/python/receiver/include/Text_Receiver.hpp deleted file mode 100644 index c2aeaebac658a0b42ba53dee63975413b79ad8bd..0000000000000000000000000000000000000000 --- a/src/vrpn/python/receiver/include/Text_Receiver.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __VRPN_PYTHON_TEXT_RECEIVER_HPP__ -#define __VRPN_PYTHON_TEXT_RECEIVER_HPP__ - -#include <vrpn_Text.h> -#include <include/Device.hpp> - -namespace vrpn_python { - template <class device_type> class definition; - - class Text_Receiver : public Device { - typedef vrpn_Text_Receiver vrpn_type; - friend class definition<Text_Receiver>; - - vrpn_type *d_device; - - Text_Receiver(PyObject *error, PyObject * args); - - static PyTypeObject &getType(); - static PyMethodDef* getMethods(); - static const std::string &getName(); - - static PyObject *work_on_change_handler(bool add, PyObject *obj, PyObject *args); - - public: - vrpn_type *getDevice() { return d_device ; } - - typedef definition<Text_Receiver> _definition; - }; -} - -#endif // defined(__VRPN_PYTHON_TEXT_RECEIVER_H__) diff --git a/src/vrpn/python/receiver/include/Tracker.hpp b/src/vrpn/python/receiver/include/Tracker.hpp deleted file mode 100644 index afd9d76768f8aa867de7fed65517d37d2f6615c8..0000000000000000000000000000000000000000 --- a/src/vrpn/python/receiver/include/Tracker.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __VRPN_PYTHON_TRACKER_HPP__ -#define __VRPN_PYTHON_TRACKER_HPP__ - -#include <vrpn_Tracker.h> -#include <include/Device.hpp> - -namespace vrpn_python { - template <class device_type> class definition; - - class Tracker : public Device { - typedef vrpn_Tracker_Remote vrpn_type; - friend class definition<Tracker>; - vrpn_type *d_device; - - Tracker(PyObject *error, PyObject * args); - - static PyTypeObject &getType(); - static PyMethodDef* getMethods(); - static const std::string &getName(); - - static PyObject *work_on_change_handler(bool add, PyObject *obj, PyObject *args); - - public: - vrpn_type *getDevice() { return d_device ; } - - static PyObject *request_t2r_xform(PyObject *obj); - static PyObject *request_u2s_xform(PyObject *obj); - static PyObject *request_workspace(PyObject *obj); - static PyObject *reset_origin(PyObject *obj); - - typedef definition<Tracker> _definition; - }; -} - -#endif // defined(__VRPN_PYTHON_TRACKER_H__) diff --git a/src/vrpn/python/receiver/receiver.cpp b/src/vrpn/python/receiver/receiver.cpp deleted file mode 100644 index d2db161427f822fea61a5b81b2c4e841b52f51d7..0000000000000000000000000000000000000000 --- a/src/vrpn/python/receiver/receiver.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include <include/interface.hpp> -#include "include/Tracker.hpp" -#include "include/Analog.hpp" -#include "include/Button.hpp" -#include "include/Dial.hpp" -#include "include/Text_Receiver.hpp" -#include <include/definition.hpp> - -namespace vrpn_python { - namespace receiver { - -#if PY_MAJOR_VERSION >= 3 - static PyModuleDef module_definition = { - PyModuleDef_HEAD_INIT, - "receiver", - "VRPN receiver classes.", - -1, - NULL - }; -#endif - - bool init_types() { - if (!Tracker::_definition::init_type()) return false; - if (!Analog::_definition::init_type()) return false; - if (!Button::_definition::init_type()) return false; - if (!Dial::_definition::init_type()) return false; - if (!Text_Receiver::_definition::init_type()) return false; - - return true; - } - - void add_types(PyObject* vrpn_module) { - PyObject* receiver_module = -#if PY_MAJOR_VERSION >= 3 - PyModule_Create(&module_definition); -#else - Py_InitModule("receiver", NULL); -#endif - - PyModule_AddObject(vrpn_module, "receiver", receiver_module); - - Tracker::_definition::add_type(receiver_module); - Analog::_definition::add_type(receiver_module); - Button::_definition::add_type(receiver_module); - Dial::_definition::add_type(receiver_module); - Text_Receiver::_definition::add_type(receiver_module); - } -} -} diff --git a/src/vrpn/python/sender/Poser.cpp b/src/vrpn/python/sender/Poser.cpp deleted file mode 100644 index 8fedbd3183a4aea57c4cc43de96b8213a094e898..0000000000000000000000000000000000000000 --- a/src/vrpn/python/sender/Poser.cpp +++ /dev/null @@ -1,173 +0,0 @@ -#include "include/Poser.hpp" -#include "include/callback.hpp" -#include "include/definition.hpp" -#include <iostream> - -namespace vrpn_python { - - static PyTypeObject Poser_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "Poser", // tp_name - sizeof(Poser), // tp_basicsize - }; - - static PyMethodDef Poser_methods[] = { - {"mainloop", (PyCFunction)Poser::_definition::mainloop, METH_NOARGS, "Run the mainloop" }, - {"request_pose", (PyCFunction)Poser::request_pose, METH_VARARGS, "Set the pose of the poser" }, - {"request_pose_relative", (PyCFunction)Poser::request_pose_relative, METH_VARARGS, "Set the relative pose of the poser" }, - {"request_pose_velocity", (PyCFunction)Poser::request_pose_velocity, METH_VARARGS, "Set the velocity of the poser" }, - {"request_pose_velocity", (PyCFunction)Poser::request_pose_velocity, METH_VARARGS, "Set the velocity of the poser" }, - {NULL} /* Sentinel */ - }; - - PyTypeObject &Poser::getType() { - return Poser_Type; - } - - PyMethodDef* Poser::getMethods() { - return (PyMethodDef*)Poser_methods; - } - - const std::string &Poser::getName() { - static const std::string name = "Poser"; - return name; - } - - Poser::Poser(PyObject *error, PyObject * args) : Device(error, args), d_device(NULL) { - } - - PyObject *Poser::request_pose(PyObject *obj, PyObject *args) { - try { - Poser *self = _definition::get(obj); - - static std::string defaultCall("invalid call : request_pose(datetime, double position[3], double quaternion[4])"); - - PyObject *py_time = NULL; - double position[3]; - double quaternion[4]; - - if ((!args) || (!PyArg_ParseTuple(args,"O(ddd)(dddd)", &py_time, - &position[0], &position[1], &position[2], - &quaternion[0], &quaternion[1], &quaternion[2], &quaternion[3]))) { - DeviceException::launch(defaultCall); - } - - timeval time; - if (!Device::getTimevalFromDateTime(py_time, time)) { - DeviceException::launch("First argument must be a datetime object !"); - } - - if (!self->d_device->request_pose(time, position, quaternion)) { - DeviceException::launch("vrpn.Poser : request_pose failed"); - } - Py_RETURN_TRUE; - - } catch (DeviceException &exception) { - PyErr_SetString(Device::s_error, exception.getReason().c_str()); - } - return NULL; - } - - PyObject *Poser::request_pose_relative(PyObject *obj, PyObject *args) { - try { - Poser *self = _definition::get(obj); - - static std::string defaultCall("invalid call : request_pose_relative(int time[2](second and microsecond), double position_delta[3], double quaternion[4])"); - - PyObject *py_time; - double position[3]; - double quaternion[4]; - - if (!PyArg_ParseTuple(args,"O(ddd)(dddd)", &py_time, - &position[0], &position[1], &position[2], - &quaternion[0], &quaternion[1], &quaternion[2], &quaternion[3])) { - DeviceException::launch(defaultCall); - } - - timeval time; - if (!Device::getTimevalFromDateTime(py_time, time)) { - DeviceException::launch("First argument must be a datetime object !"); - } - - if (!self->d_device->request_pose_relative(time, position, quaternion)) { - DeviceException::launch("vrpn.Poser : request_pose_relative failed"); - } - - Py_RETURN_TRUE; - - } catch (DeviceException &exception) { - PyErr_SetString(Device::s_error, exception.getReason().c_str()); - } - return NULL; - } - - PyObject *Poser::request_pose_velocity(PyObject *obj, PyObject *args) { - try { - Poser *self = _definition::get(obj); - - static std::string defaultCall("invalid call : request_pose_velocity(int time[2](second and microsecond), double velocity[3], double quaternion[4], double interval)"); - - PyObject *py_time; - double position[3]; - double quaternion[4]; - double interval; - - if (!PyArg_ParseTuple(args,"O(ddd)(dddd)d", &py_time, - &position[0], &position[1], &position[2], - &quaternion[0], &quaternion[1], &quaternion[2], &quaternion[3], - &interval)) { - DeviceException::launch(defaultCall); - } - - timeval time; - if (!Device::getTimevalFromDateTime(py_time, time)) { - DeviceException::launch("First argument must be a datetime object !"); - } - - if (!self->d_device->request_pose_velocity(time, position, quaternion, interval)) { - DeviceException::launch("vrpn.Poser : request_pose_velocity failed"); - } - - Py_RETURN_TRUE; - - } catch (DeviceException &exception) { - PyErr_SetString(Device::s_error, exception.getReason().c_str()); - } - return NULL; - } - - PyObject *Poser::request_pose_velocity_relative(PyObject *obj, PyObject *args) { - try { - Poser *self = _definition::get(obj); - - static std::string defaultCall("invalid call : request_pose_velocity_relative(int time[2](second and microsecond), double velocity_delta[3], double quaternion[4], double interval)"); - - PyObject *py_time; - double position[3]; - double quaternion[4]; - double interval; - - if (!PyArg_ParseTuple(args,"O(ddd)(dddd)d", &py_time, - &position[0], &position[1], &position[2], - &quaternion[0], &quaternion[1], &quaternion[2], &quaternion[3], - &interval)) { - DeviceException::launch(defaultCall); - } - - timeval time; - if (!Device::getTimevalFromDateTime(py_time, time)) { - DeviceException::launch("First argument must be a datetime object !"); - } - - if (!self->d_device->request_pose_velocity_relative(time, position, quaternion, interval)) { - DeviceException::launch("vrpn.Poser : request_pose_velocity_relative failed"); - } - - Py_RETURN_TRUE; - - } catch (DeviceException &exception) { - PyErr_SetString(Device::s_error, exception.getReason().c_str()); - } - return NULL; - } -} diff --git a/src/vrpn/python/sender/Text_Sender.cpp b/src/vrpn/python/sender/Text_Sender.cpp deleted file mode 100644 index e9ad6c4af0f341e37bdd06d8dcbfc577ca122705..0000000000000000000000000000000000000000 --- a/src/vrpn/python/sender/Text_Sender.cpp +++ /dev/null @@ -1,81 +0,0 @@ -#include "include/Text_Sender.hpp" -#include "include/callback.hpp" -#include "include/definition.hpp" -#include <iostream> - -namespace vrpn_python { - - static PyTypeObject Text_Sender_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "Text", // tp_name - sizeof(Text_Sender), // tp_basicsize - }; - - static PyMethodDef Text_Sender_methods[] = { - {"mainloop", (PyCFunction)Text_Sender::_definition::mainloop, METH_NOARGS, "Run the mainloop" }, - {"send_message", (PyCFunction)Text_Sender::send_message, METH_VARARGS, "Send a text message" }, - {NULL} /* Sentinel */ - }; - - PyTypeObject &Text_Sender::getType() { - return Text_Sender_Type; - } - - PyMethodDef* Text_Sender::getMethods() { - return (PyMethodDef*)Text_Sender_methods; - } - - const std::string &Text_Sender::getName() { - static const std::string name = "Text"; - return name; - } - - Text_Sender::Text_Sender(PyObject *error, PyObject * args) : Device(error, args), d_device(NULL) { - } - - PyObject *Text_Sender::send_message(PyObject *obj, PyObject *args) { - try { - Text_Sender *self = _definition::get(obj); - - static std::string defaultCall("invalid call : send_message(message, severity = normal, level = 0, datetime = NOW"); - - char *msg = NULL; - char *severity = (char *)"normal"; - int level = 0; - PyObject *py_time = NULL; - - if ((!args) || (!PyArg_ParseTuple(args,"s|siO", &msg, &severity, &level, &py_time))) { - DeviceException::launch(defaultCall); - } - - timeval time = vrpn_TEXT_NOW; - - if (py_time) { - if (!Device::getTimevalFromDateTime(py_time, time)) { - DeviceException::launch("Last argument must be a datetime object !"); - } - } - - vrpn_TEXT_SEVERITY type = vrpn_TEXT_NORMAL; - if (strcmp(severity,"normal") == 0 ) { - type = vrpn_TEXT_NORMAL; - } else if (strcmp(severity,"warning") == 0 ) { - type = vrpn_TEXT_WARNING; - } else if (strcmp(severity,"error") == 0 ) { - type = vrpn_TEXT_ERROR; - } else { - DeviceException::launch("Severity must be normal, warning or error"); - } - - if (self->d_device->send_message(msg, type, level, time) != 0) { - DeviceException::launch("vrpn.sender.Text : send_message failed"); - } - - Py_RETURN_TRUE; - - } catch (DeviceException &exception) { - PyErr_SetString(Device::s_error, exception.getReason().c_str()); - } - return NULL; - } -} diff --git a/src/vrpn/python/sender/include/Poser.hpp b/src/vrpn/python/sender/include/Poser.hpp deleted file mode 100644 index 73f1d2f68dbdecffb7e0a8fef831b4f769984d93..0000000000000000000000000000000000000000 --- a/src/vrpn/python/sender/include/Poser.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef __VRPN_PYTHON_POSER_HPP__ -#define __VRPN_PYTHON_POSER_HPP__ - -#include <vrpn_Poser.h> -#include <include/Device.hpp> - -namespace vrpn_python { - template <class device_type> class definition; - - class Poser : public Device { - typedef vrpn_Poser_Remote vrpn_type; - friend class definition<Poser>; - vrpn_type *d_device; - - Poser(PyObject *error, PyObject * args); - - static PyTypeObject &getType(); - static PyMethodDef* getMethods(); - static const std::string &getName(); - - public: - vrpn_type *getDevice() { return d_device ; } - - typedef definition<Poser> _definition; - - static PyObject *request_pose(PyObject *obj, PyObject *args); - static PyObject *request_pose_relative(PyObject *obj, PyObject *args); - static PyObject *request_pose_velocity(PyObject *obj, PyObject *args); - static PyObject *request_pose_velocity_relative(PyObject *obj, PyObject *args); - }; -} - -#endif // defined(__VRPN_PYTHON_POSER_H__) diff --git a/src/vrpn/python/sender/include/Text_Sender.hpp b/src/vrpn/python/sender/include/Text_Sender.hpp deleted file mode 100644 index 9ba1b0e43c064ed175f15c24a506801c681166e7..0000000000000000000000000000000000000000 --- a/src/vrpn/python/sender/include/Text_Sender.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __VRPN_PYTHON_TEXT_SENDER_HPP__ -#define __VRPN_PYTHON_TEXT_SENDER_HPP__ - -#include <vrpn_Text.h> -#include <include/Device.hpp> - -namespace vrpn_python { - template <class device_type> class definition; - - class Text_Sender : public Device { - typedef vrpn_Text_Sender vrpn_type; - friend class definition<Text_Sender>; - vrpn_type *d_device; - - Text_Sender(PyObject *error, PyObject * args); - - static PyTypeObject &getType(); - static PyMethodDef* getMethods(); - static const std::string &getName(); - - public: - vrpn_type *getDevice() { return d_device ; } - - typedef definition<Text_Sender> _definition; - - static PyObject *send_message(PyObject *obj, PyObject *args); - }; -} - -#endif // defined(__VRPN_PYTHON_TEXT_SENDER_H__) diff --git a/src/vrpn/python/sender/sender.cpp b/src/vrpn/python/sender/sender.cpp deleted file mode 100644 index 916456cc99e260588de336c890729cf51f27fa70..0000000000000000000000000000000000000000 --- a/src/vrpn/python/sender/sender.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include <include/interface.hpp> -#include "include/Poser.hpp" -#include "include/Text_Sender.hpp" -#include <include/definition.hpp> - -namespace vrpn_python { - namespace sender { -#if PY_MAJOR_VERSION >= 3 - static PyModuleDef module_definition = { - PyModuleDef_HEAD_INIT, - "sender", - "VRPN sender classes.", - -1, - NULL - }; -#endif - - bool init_types() { - if (!vrpn_python::Poser::_definition::init_type()) return false; - if (!vrpn_python::Text_Sender::_definition::init_type()) return false; - - return true; - } - - void add_types(PyObject* vrpn_module) { - PyObject* sender_module = -#if PY_MAJOR_VERSION >= 3 - PyModule_Create(&module_definition); -#else - Py_InitModule("sender", NULL); -#endif - - PyModule_AddObject(vrpn_module, "sender", sender_module); - - vrpn_python::Poser::_definition::add_type(sender_module); - vrpn_python::Text_Sender::_definition::add_type(sender_module); - } - } -} diff --git a/src/vrpn/python/tools.cpp b/src/vrpn/python/tools.cpp deleted file mode 100644 index a18565610ceadd289f701ccbce5b89779c880550..0000000000000000000000000000000000000000 --- a/src/vrpn/python/tools.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "include/tools.hpp" -#include <iostream> - -namespace vrpn_python { - namespace tools { - bool getStringFromPyObject(PyObject *py_str, std::string &std_str) { - - if (!PyUnicode_Check(py_str)) { - return false; - } - - PyObject *py_utf8 = PyUnicode_AsUTF8String(py_str); - char *chr_str; Py_ssize_t len; - if (PyBytes_AsStringAndSize(py_utf8, &chr_str, &len) < 0) { - return false; - } - Py_DECREF(py_utf8); - - std_str = chr_str; - - return true; - } - - bool getIntegerFromPyObject(PyObject *py_int, int &_int) { - - if (!PyNumber_Check(py_int)) { - return false; - } - - _int = PyNumber_AsSsize_t(py_int, PyExc_OverflowError); - - return true; - } - } -} diff --git a/src/vrpn/python/vrpn_python.sln b/src/vrpn/python/vrpn_python.sln deleted file mode 100644 index 1761c9ca6cfa637bc6f86ebbefac44c8d9444ca5..0000000000000000000000000000000000000000 --- a/src/vrpn/python/vrpn_python.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vrpn_python", "windows\vrpn_python.vcproj", "{1820AEB6-6954-4A83-8CCA-4359862326AB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1820AEB6-6954-4A83-8CCA-4359862326AB}.Debug|Win32.ActiveCfg = Debug|Win32 - {1820AEB6-6954-4A83-8CCA-4359862326AB}.Debug|Win32.Build.0 = Debug|Win32 - {1820AEB6-6954-4A83-8CCA-4359862326AB}.Release|Win32.ActiveCfg = Release|Win32 - {1820AEB6-6954-4A83-8CCA-4359862326AB}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/vrpn/python/windows/vrpn_python.vcproj b/src/vrpn/python/windows/vrpn_python.vcproj deleted file mode 100644 index 47c06a2349ffbc7ae9b6c635e47cbdbcd313b603..0000000000000000000000000000000000000000 --- a/src/vrpn/python/windows/vrpn_python.vcproj +++ /dev/null @@ -1,337 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8,00" - Name="vrpn_python" - ProjectGUID="{1820AEB6-6954-4A83-8CCA-4359862326AB}" - RootNamespace="vrpn_python" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="2" - CharacterSet="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="..;$(PYTHON_DIR)\include;$(VRPN_DIR)" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;VRPN_PYTHON_EXPORTS;CALLBACK_CALL=__stdcall" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="python32.lib" - OutputFile="$(OutDir)\vrpn.pyd" - LinkIncremental="2" - AdditionalLibraryDirectories="$(PYTHON_DIR)\libs" - GenerateDebugInformation="true" - SubSystem="2" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="2" - CharacterSet="1" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="..;$(PYTHON_DIR)\include;$(VRPN_DIR)" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;VRPN_PYTHON_EXPORTS;CALLBACK_CALL=__stdcall" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="vrpn.lib quat.lib" - OutputFile="$(OutDir)\vrpn.pyd" - LinkIncremental="1" - AdditionalLibraryDirectories="$(PYTHON_DIR)\libs;$(VRPN_DIR)\pc_win32\Debug;$(VRPN_DIR)\quat\pc_win32\Debug" - GenerateDebugInformation="true" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Fichiers sources" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath="..\Base.cpp" - > - </File> - <File - RelativePath="..\callback.cpp" - > - </File> - <File - RelativePath="..\Connection.cpp" - > - </File> - <File - RelativePath="..\Device.cpp" - > - </File> - <File - RelativePath="..\interface.cpp" - > - </File> - <File - RelativePath="..\tools.cpp" - > - </File> - <Filter - Name="sender" - > - <File - RelativePath="..\sender\Poser.cpp" - > - </File> - <File - RelativePath="..\sender\sender.cpp" - > - </File> - <File - RelativePath="..\sender\Text_Sender.cpp" - > - </File> - </Filter> - <Filter - Name="receiver" - > - <File - RelativePath="..\receiver\Analog.cpp" - > - </File> - <File - RelativePath="..\receiver\Button.cpp" - > - </File> - <File - RelativePath="..\receiver\Dial.cpp" - > - </File> - <File - RelativePath="..\receiver\receiver.cpp" - > - </File> - <File - RelativePath="..\receiver\Text_Receiver.cpp" - > - </File> - <File - RelativePath="..\receiver\Tracker.cpp" - > - </File> - </Filter> - </Filter> - <Filter - Name="Fichiers d'en-tête" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath="..\include\Base.hpp" - > - </File> - <File - RelativePath="..\include\callback.hpp" - > - </File> - <File - RelativePath="..\include\Connection.hpp" - > - </File> - <File - RelativePath="..\include\definition.hpp" - > - </File> - <File - RelativePath="..\include\Device.hpp" - > - </File> - <File - RelativePath="..\include\handlers.hpp" - > - </File> - <File - RelativePath="..\include\interface.hpp" - > - </File> - <File - RelativePath="..\include\tools.hpp" - > - </File> - <Filter - Name="receiver" - > - <File - RelativePath="..\receiver\include\Analog.hpp" - > - </File> - <File - RelativePath="..\receiver\include\Button.hpp" - > - </File> - <File - RelativePath="..\receiver\include\Dial.hpp" - > - </File> - <File - RelativePath="..\receiver\include\Text_Receiver.hpp" - > - </File> - <File - RelativePath="..\receiver\include\Tracker.hpp" - > - </File> - </Filter> - <Filter - Name="sender" - > - <File - RelativePath="..\sender\include\Poser.hpp" - > - </File> - <File - RelativePath="..\sender\include\Text_Sender.hpp" - > - </File> - </Filter> - </Filter> - <Filter - Name="Fichiers de ressources" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/python_vrpn/CMakeLists.txt b/src/vrpn/python_vrpn/CMakeLists.txt deleted file mode 100644 index 11a46554ba00f5ff932df820242a5f0e5a4bee43..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/CMakeLists.txt +++ /dev/null @@ -1,93 +0,0 @@ -# Changes made by: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC - -if(SWIG_FOUND AND PYTHONLIBS_FOUND AND VRPN_BUILD_PYTHON) - include(${SWIG_USE_FILE}) - include_directories(${PYTHON_INCLUDE_DIRS}) - - set(_client_lib_src - ${VRPN_CLIENT_SOURCES} - ${VRPN_CLIENT_PUBLIC_HEADERS}) - set(LIBS ${EXTRA_LIBS}) - - set(clientlib_fullsrc) - foreach(_src ${_client_lib_src}) - if(IS_ABSOLUTE "${_src}") - list(APPEND clientlib_fullsrc "${_src}") - else() - list(APPEND clientlib_fullsrc "${PROJECT_SOURCE_DIR}/${_src}") - endif() - endforeach() - source_group("VRPN Client Library Sources" FILES ${clientlib_fullsrc}) - - set(quatlib_fullsrc) - get_property(_quat_src TARGET quat PROPERTY SOURCES) - foreach(_src ${_quat_src}) - list(APPEND quatlib_fullsrc "${PROJECT_SOURCE_DIR}/quat/${_src}") - endforeach() - source_group("Quat Library Sources" FILES ${quatlib_fullsrc}) - - # XXX TODO: add dependency on these files - perhaps change extension to .h? - # - # set(COMMON - # client-only.i - # python-callback-wrapper.i) - # set_source_files_properties(${COMMON} PROPERTIES CPLUSPLUS ON) - - set(PYTHONVERSIONDIR python) - if(PYTHON_LIBRARY MATCHES "python(2.[0-9])") - set(PYTHONVERSIONDIR "python${CMAKE_MATCH_1}/") - endif() - - #Make sure Python wrapper files get correctly generated in Windows - if(WIN32 AND NOT CYGWIN) - #Define the preprocessor symbol VRPN_USE_WINSOCK_SOCKETS in swig, since the latter doesn't take the preprocessor definitions from vrpn_Shared.h in account - set(CMAKE_SWIG_FLAGS "-DVRPN_USE_WINSOCK_SOCKETS") - endif() - - set(MODULES - vrpn_Analog - vrpn_Analog_Output - vrpn_Auxiliary_Logger - vrpn_Button - vrpn_Dial - vrpn_ForceDevice - vrpn_Poser - vrpn_Text - vrpn_Tracker) - - foreach(module ${MODULES}) - set_source_files_properties(${module}.i PROPERTIES CPLUSPLUS ON) - swig_add_module(${module} - Python - ${module}.i - ${clientlib_fullsrc} - ${quatlib_fullsrc}) - swig_link_libraries(${module} ${PYTHON_LIBRARIES} ${LIBS} ${SERVER_EXTRA_LIBS}) - set_target_properties(_${module} PROPERTIES FOLDER "Python Bindings") - - if(VRPN_INSTALL) - install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${module}.py" - DESTINATION - lib/${PYTHONVERSIONDIR}dist-packages/ - COMPONENT - python) - install(TARGETS - ${SWIG_MODULE_${module}_REAL_NAME} - RUNTIME - DESTINATION - lib/${PYTHONVERSIONDIR}dist-packages/ - COMPONENT - python - LIBRARY - DESTINATION - lib/${PYTHONVERSIONDIR}dist-packages/ - COMPONENT - python) - endif() - endforeach() - -endif() diff --git a/src/vrpn/python_vrpn/Makefile.python b/src/vrpn/python_vrpn/Makefile.python deleted file mode 100644 index fd5e12d11faeac5e79b4e737b835361a8432fb3d..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/Makefile.python +++ /dev/null @@ -1,51 +0,0 @@ -# file: Makefile.python -# author: Thiebaut Mochel mochel@cecpv.u-strasbg.fr 2008-06-05 -# copyright: (C)2008 CECPV -# license: Released to the Public Domain. -# depends: python 2.4, swig 1.3.35, VRPN 07_15 -# tested on: Linux w/ gcc 4.1.2 -# references: http://python.org/ http://vrpn.org/ -# http://www.swig.org -# - -include ../Makefile - -PYTHON_VER := $(shell /usr/bin/python -V 2>&1 | sed 's/^[^0-9]*\([0-9]\+.[0-9]\+\)[^0-9].*/\1/') -VRPN_ROOT_DIR := .. -OBJECT_DIR := $(VRPN_ROOT_DIR)/$(OBJECT_DIR) -PYTHON_INCLUDE_DIR := /usr/include/python$(PYTHON_VER) -PYTHON_LIB := python$(PYTHON_VER) -PYTHON_PACKAGES_DIR := $(LIB_DIR)/python$(PYTHON_VER)/dist-packages -QUAT_INCLUDE_DIR := $(VRPN_ROOT_DIR)/quat -QUAT_LIB_DIR := $(QUAT_INCLUDE_DIR) -QUAT_LIB := quat - -CXX := g++ - -ifeq ($(HW_OS), pc_linux64) -CXX := g++ -m64 -fPIC -endif - -LIB_OBJECTS = $(patsubst %,$(OBJECT_DIR)/%,$(LIB_FILES:.C=.o)) - -vrpn-wrapper := $(addsuffix .so,$(basename $(wildcard vrpn_*.i))) -vrpn-libs := $(addprefix _,$(vrpn-wrapper)) - -vrpn-python: $(vrpn-wrapper) - -$(vrpn-wrapper): $(MAKEFILE) $(LIB_OBJECTS) - -mkdir -p $(HW_OS) - cp ../$(HW_OS)/.depend $(HW_OS) - swig -Wall -classic -c++ -python $(patsubst %.so,%.i,$@) - $(CXX) -ggdb -c $(patsubst %.so,%_wrap.cxx,$@) -I$(PYTHON_INCLUDE_DIR) -I$(VRPN_ROOT_DIR) -I$(QUAT_INCLUDE_DIR) - cp $(patsubst %.so,%_wrap.o,$@) $(HW_OS) - $(CXX) -ggdb -shared $(patsubst _%,%,$(patsubst %.so,%_wrap.o,$@)) $(LIB_OBJECTS) -o _$@ -I$(VRPN_ROOT_DIR) -I$(QUAT_INCLUDE_DIR) -I$(PYTHON_INCLUDE_DIR) -l$(PYTHON_LIB) -L$(QUAT_LIB_DIR)/$(HW_OS) -l$(QUAT_LIB) - -install-vrpn-python: $(vrpn-libs) - -mkdir -p $(PYTHON_PACKAGES_DIR) - cp $(vrpn-libs) $(PYTHON_PACKAGES_DIR) - cp *.py $(PYTHON_PACKAGES_DIR) - -clean-vrpn-python: - rm -f *.cxx *.py *.pyc *.o *.so - rm -rf $(HW_OS)/* diff --git a/src/vrpn/python_vrpn/README b/src/vrpn/python_vrpn/README deleted file mode 100644 index 3d2d39f2eb9fa1c737bcff1d69458c5021037f3b..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/README +++ /dev/null @@ -1,46 +0,0 @@ -Howto compile and use VRPN python wrappers - -vrpn_python is a quick and dirty python wrapper for the vrpn client. - -What you need : -- VRPN 07.15 -- SWIG 1.3.34 - -Basic installation : -cd vrpn -tar xzvf python_vrpn.tar.gz -cd python_vrpn -edit Makefile.python and set the environment according to your setup -make vrpn-python -(as root) make install-vrpn-python - -ISSUES : -- if vrpn_Tracker fails to load on symbol handle_update_tracker, comment out line 1124 of vrpn_Tracker.h ( //static int VRPN_CALLBACK handle_update_rate_request (void *, vrpn_HANDLERPARAM); ). I didn't find other fix so far. - -Simple test of the tracker module : - -import vrpn_Tracker - -def handle_tracker(userdata,t): - print t - -t=vrpn_Tracker.vrpn_Tracker_Remote("Tracker0@localhost") - -vrpn_Tracker.register_tracker_change_handler(handle_tracker) - -vrpn_Tracker.vrpn_Tracker_Remote.register_change_handler(t,None,vrpn_Tracker.get_tracker_change_handler()) - -while 1: - vrpn_Tracker.vrpn_Tracker_Remote.mainloop(t) - - -produces the following output, assuming Tracker0@localhost is the NULL tracker : - -(0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) -(1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) -(0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) -(1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) -(0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) -(1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) -(0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) -(1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) diff --git a/src/vrpn/python_vrpn/client-only.i b/src/vrpn/python_vrpn/client-only.i deleted file mode 100644 index b766fa0b9bade2c57bb911206f013d117a137faa..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/client-only.i +++ /dev/null @@ -1,11 +0,0 @@ -// file: client-only.h -// author: Thiebaut Mochel mochel@cecpv.u-strasbg.fr 2008-06-05 -// copyright: (C)2008 CECPV -// license: Released to the Public Domain. -// depends: python 2.4, swig 1.3.35, VRPN 07_15 -// tested on: Linux w/ gcc 4.1.2 -// references: http://python.org/ http://vrpn.org/ -// http://www.swig.org -// - -#define VRPN_CLIENT_ONLY diff --git a/src/vrpn/python_vrpn/python-callback-wrapper.i b/src/vrpn/python_vrpn/python-callback-wrapper.i deleted file mode 100644 index c2d71c0a0a24a4a2f5a3c04fe2197ee476205edb..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/python-callback-wrapper.i +++ /dev/null @@ -1,74 +0,0 @@ -// file: python-callback-wrapper.i -// author: Thiebaut Mochel mochel@cecpv.u-strasbg.fr 2008-06-05 -// copyright: (C)2008 CECPV -// license: Released to the Public Domain. -// depends: python 2.4, swig 1.3.35, VRPN 07_15 -// tested on: Linux w/ gcc 4.1.2 -// references: http://python.org/ http://vrpn.org/ -// http://www.swig.org -// - -%{ -#ifndef CONVERTVOID -static PyObject* convert_void(void* userdata) { - return Py_BuildValue("s",userdata); -} -#define CONVERTVOID -#endif -%} - -%define PYTHON_CALLBACK_WRAPPER(clname,clcallback,clhandler) -%{ - -static PyObject* PyCallBack_ ## clname ## _change_handler=0; - -void _cbwrap_ ## clname ## _change_handler(void* userdata,const clcallback t){ - PyObject *arglist,*result; - PyObject *arg0, *arg1; - - if(!PyCallBack_ ## clname ## _change_handler) return; - - arglist=Py_BuildValue("(O&O&)",convert_void,userdata,convert_ ## clname ## _cb,&t); - - result=PyEval_CallObject(PyCallBack_ ## clname ## _change_handler,arglist); - Py_DECREF(arglist); - { PyObject *args=Py_BuildValue("(O)",result); - Py_XDECREF(result); - - Py_XDECREF(args); - } - return ; -} -%} - -#ifdef SWIG<python> -%typemap(in) PyObject *{ $1=$input; } -#endif - -%inline %{ -void register_ ## clname ## _change_handler(PyObject *pyfunc){ - if (!PyCallable_Check(pyfunc)) { - PyErr_SetString(PyExc_TypeError, "Need a callable object!"); - return; - } - if(PyCallBack_ ## clname ## _change_handler)Py_DECREF(PyCallBack_ ## clname ## _change_handler); - PyCallBack_ ## clname ## _change_handler=pyfunc; - Py_INCREF(pyfunc); -} -/* For SWIG Type Conversion */ -/* void __null__ ## clname ## _change_handler( void* userdata,const clcallback t){} */ -%} -%inline %{ - void (* clname ## _change_handler)(void* userdata,const clcallback t); -%} - -%init %{ - clname ## _change_handler=&_cbwrap_ ## clname ## _change_handler; -%} -%inline %{ -clhandler get_ ## clname ## _change_handler() { - return reinterpret_cast< ## clhandler ## >(clname ## _change_handler); -} -%} - -%enddef diff --git a/src/vrpn/python_vrpn/vrpn_Analog.i b/src/vrpn/python_vrpn/vrpn_Analog.i deleted file mode 100644 index 52441a1fc01f06bca5417e87b2661f4836448fb0..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/vrpn_Analog.i +++ /dev/null @@ -1,34 +0,0 @@ -// file: vrpn_Analog.i -// author: Thiebaut Mochel mochel@cecpv.u-strasbg.fr 2008-06-05 -// copyright: (C)2008 CECPV -// license: Released to the Public Domain. -// depends: python 2.4, swig 1.3.35, VRPN 07_15 -// tested on: Linux w/ gcc 4.1.2 -// references: http://python.org/ http://vrpn.org/ -// http://www.swig.org -// - -%module vrpn_Analog - -%{ -#include "../vrpn_Types.h" -#include "../vrpn_BaseClass.h" -#include "../vrpn_Analog.h" -#include "../vrpn_Analog_Output.h" -#include "../vrpn_Analog_USDigital_A2.h" -%} - -%include "../vrpn_Configure.h" -%include "../vrpn_Connection.h" -%include "../vrpn_BaseClass.h" -%include "../vrpn_Analog.h" - -%{ -static PyObject* convert_analog_cb(vrpn_ANALOGCB* t) { - return Py_BuildValue("(iddddd)",t->num_channel,t->channel[0],t->channel[1],t->channel[2],t->channel[3],t->channel[4]); -} -%} - -%include python-callback-wrapper.i - -PYTHON_CALLBACK_WRAPPER(analog,vrpn_ANALOGCB,vrpn_ANALOGCHANGEHANDLER) diff --git a/src/vrpn/python_vrpn/vrpn_Analog_Output.i b/src/vrpn/python_vrpn/vrpn_Analog_Output.i deleted file mode 100644 index 68a986d1ad39d3b6fd8c7903033958250146f9d2..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/vrpn_Analog_Output.i +++ /dev/null @@ -1,32 +0,0 @@ -// file: vrpn_Analog_Output.i -// author: Thiebaut Mochel mochel@cecpv.u-strasbg.fr 2008-06-05 -// copyright: (C)2008 CECPV -// license: Released to the Public Domain. -// depends: python 2.4, swig 1.3.35, VRPN 07_15 -// tested on: Linux w/ gcc 4.1.2 -// references: http://python.org/ http://vrpn.org/ -// http://www.swig.org -// - -%module vrpn_Analog_Output -%{ -#include "../vrpn_Types.h" -#include "../vrpn_BaseClass.h" -#include "../vrpn_Analog_Output.h" -%} - -%include "../vrpn_Configure.h" -%include "../vrpn_Connection.h" -%include "../vrpn_BaseClass.h" -#include "../vrpn_Analog.h" // just for some #define's and constants -%include "../vrpn_Analog_Output.h" - -%{ -static PyObject* convert_analogoutput_cb(vrpn_ANALOGOUTPUTCB* t) { - return Py_BuildValue("(i|ddddd)",t->num_channel,t->channel[0],t->channel[1],t->channel[2],t->channel[3],t->channel[4]); -} -%} - -%include python-callback-wrapper.i - -PYTHON_CALLBACK_WRAPPER(analogoutput,vrpn_ANALOGOUTPUTCB,vrpn_ANALOGOUTPUTCHANGEHANDLER) diff --git a/src/vrpn/python_vrpn/vrpn_Auxiliary_Logger.i b/src/vrpn/python_vrpn/vrpn_Auxiliary_Logger.i deleted file mode 100644 index 1c65c9f621c988578021e95b4584f8b42185e2f5..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/vrpn_Auxiliary_Logger.i +++ /dev/null @@ -1,33 +0,0 @@ -// file: vrpn_Auxiliary_Logger.i -// author: Thiebaut Mochel mochel@cecpv.u-strasbg.fr 2008-06-05 -// copyright: (C)2008 CECPV -// license: Released to the Public Domain. -// depends: python 2.4, swig 1.3.35, VRPN 07_15 -// tested on: Linux w/ gcc 4.1.2 -// references: http://python.org/ http://vrpn.org/ -// http://www.swig.org -// - -%module vrpn_Auxiliary_Logger -%{ -#include "../vrpn_Types.h" -#include "../vrpn_BaseClass.h" -#include "../vrpn_Auxiliary_Logger.h" -%} - -%include "../vrpn_Configure.h" -#include "../vrpn_Connection.h" -%include "../vrpn_BaseClass.h" -%include "../vrpn_Auxiliary_Logger.h" - -%{ - -static PyObject* convert_auxlogger_cb(vrpn_AUXLOGGERCB* t) { - return Py_BuildValue("(ssss)",t->local_in_logfile_name,t->local_out_logfile_name,t->remote_in_logfile_name,t->remote_out_logfile_name); -} - -%} - -%include python-callback-wrapper.i - -PYTHON_CALLBACK_WRAPPER(auxlogger,vrpn_AUXLOGGERCB,vrpn_AUXLOGGERREPORTHANDLER) diff --git a/src/vrpn/python_vrpn/vrpn_Button.i b/src/vrpn/python_vrpn/vrpn_Button.i deleted file mode 100644 index 1e5266acbbdb5b456296909aec4997df1accc51d..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/vrpn_Button.i +++ /dev/null @@ -1,35 +0,0 @@ -// file: vrpn_Button.i -// author: Thiebaut Mochel mochel@cecpv.u-strasbg.fr 2008-06-05 -// copyright: (C)2008 CECPV -// license: Released to the Public Domain. -// depends: python 2.4, swig 1.3.35, VRPN 07_15 -// tested on: Linux w/ gcc 4.1.2 -// references: http://python.org/ http://vrpn.org/ -// http://www.swig.org -// - -%module vrpn_Button -%{ -#include "../vrpn_Types.h" -#include "../vrpn_BaseClass.h" -#include "../vrpn_Connection.h" -#include "../vrpn_Button.h" -#include "../vrpn_Button_NI_DIO24.h" -#include "../vrpn_Button_USB.h" -%} - -%include "client-only.i" -%include "../vrpn_Configure.h" -%include "../vrpn_BaseClass.h" -%include "../vrpn_Connection.h" -%include "../vrpn_Button.h" - -%{ -static PyObject* convert_button_cb(vrpn_BUTTONCB* t) { - return Py_BuildValue("(ii)",t->button,t->state); -} -%} - -%include python-callback-wrapper.i - -PYTHON_CALLBACK_WRAPPER(button,vrpn_BUTTONCB,vrpn_BUTTONCHANGEHANDLER) diff --git a/src/vrpn/python_vrpn/vrpn_Dial.i b/src/vrpn/python_vrpn/vrpn_Dial.i deleted file mode 100644 index 35b778e789e16165ff09d672f23f5642f0aa31cd..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/vrpn_Dial.i +++ /dev/null @@ -1,31 +0,0 @@ -// file: vrpn_Dial.i -// author: Thiebaut Mochel mochel@cecpv.u-strasbg.fr 2008-06-05 -// copyright: (C)2008 CECPV -// license: Released to the Public Domain. -// depends: python 2.4, swig 1.3.35, VRPN 07_15 -// tested on: Linux w/ gcc 4.1.2 -// references: http://python.org/ http://vrpn.org/ -// http://www.swig.org -// - -%module vrpn_Dial -%{ -#include "../vrpn_Types.h" -#include "../vrpn_Dial.h" -%} - - -%include "../vrpn_Configure.h" -%include "../vrpn_Connection.h" -%include "../vrpn_BaseClass.h" -%include "../vrpn_Dial.h" - -%{ -static PyObject* convert_dial_cb(vrpn_DIALCB* t) { - return Py_BuildValue("(id)",t->dial,t->change); -} -%} - -%include python-callback-wrapper.i - -PYTHON_CALLBACK_WRAPPER(dial,vrpn_DIALCB,vrpn_DIALCHANGEHANDLER) diff --git a/src/vrpn/python_vrpn/vrpn_ForceDevice.i b/src/vrpn/python_vrpn/vrpn_ForceDevice.i deleted file mode 100644 index 3afd411eaeedaf99a875e231fb9ab6f4d27fa396..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/vrpn_ForceDevice.i +++ /dev/null @@ -1,43 +0,0 @@ -// file: vrpn_ForceDevice.i -// author: Thiebaut Mochel mochel@cecpv.u-strasbg.fr 2008-06-05 -// copyright: (C)2008 CECPV -// license: Released to the Public Domain. -// depends: python 2.4, swig 1.3.35, VRPN 07_15 -// tested on: Linux w/ gcc 4.1.2 -// references: http://python.org/ http://vrpn.org/ -// http://www.swig.org -// - -%module vrpn_ForceDevice -%{ -#include "../vrpn_Types.h" -#include "../vrpn_BaseClass.h" -#include "../vrpn_ForceDevice.h" -#include "../vrpn_ForceDeviceServer.h" -%} - -%include "../vrpn_Configure.h" -%include "../vrpn_Connection.h" -%include "../vrpn_BaseClass.h" -%include "../vrpn_ForceDevice.h" - -%{ -static PyObject* convert_force_cb(vrpn_FORCECB* t) { - return Py_BuildValue("(ddd)",t->force[0],t->force[1],t->force[2]); -} - -static PyObject* convert_forcescp_cb(vrpn_FORCESCPCB* t) { - return Py_BuildValue("(ddddddd)",t->pos[0],t->pos[1],t->pos[2],t->quat[0],t->quat[1],t->quat[2],t->quat[3]); -} - -static PyObject* convert_forceerror_cb(vrpn_FORCEERRORCB* t) { - return Py_BuildValue("(i)",t->error_code); -} -%} - - -%include python-callback-wrapper.i - -PYTHON_CALLBACK_WRAPPER(force,vrpn_FORCECB,vrpn_FORCECHANGEHANDLER) -PYTHON_CALLBACK_WRAPPER(forceerror,vrpn_FORCEERRORCB,vrpn_FORCEERRORHANDLER) -PYTHON_CALLBACK_WRAPPER(forcescp,vrpn_FORCESCPCB,vrpn_FORCESCPHANDLER) diff --git a/src/vrpn/python_vrpn/vrpn_Poser.i b/src/vrpn/python_vrpn/vrpn_Poser.i deleted file mode 100644 index 20ab1bfd66813404527476ea1d81c2d91231c954..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/vrpn_Poser.i +++ /dev/null @@ -1,33 +0,0 @@ -// file: vrpn_Poser.i -// author: Thiebaut Mochel mochel@cecpv.u-strasbg.fr 2008-06-05 -// copyright: (C)2008 CECPV -// license: Released to the Public Domain. -// depends: python 2.4, swig 1.3.35, VRPN 07_15 -// tested on: Linux w/ gcc 4.1.2 -// references: http://python.org/ http://vrpn.org/ -// http://www.swig.org -// - -%module vrpn_Poser - -%{ -#include "../vrpn_Types.h" -#include "../vrpn_BaseClass.h" -#include "../vrpn_Poser.h" -#include "../vrpn_Poser_Analog.h" -#include "../vrpn_Poser_Tek4662.h" -%} - -%include "../vrpn_Configure.h" -%include "../vrpn_BaseClass.h" -%include "../vrpn_Poser.h" - -%{ -static PyObject* convert_poser_cb(vrpn_POSERCB* t) { - return Py_BuildValue("(ddddddd)",t->pos[0],t->pos[1],t->pos[2],t->quat[0],t->quat[1],t->quat[2],t->quat[3]); -} -%} - -%include python-callback-wrapper.i - -PYTHON_CALLBACK_WRAPPER(poser,vrpn_POSERCB,vrpn_POSERHANDLER) \ No newline at end of file diff --git a/src/vrpn/python_vrpn/vrpn_Text.i b/src/vrpn/python_vrpn/vrpn_Text.i deleted file mode 100644 index d1a9c572770591366f69402663710ec141b8ad29..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/vrpn_Text.i +++ /dev/null @@ -1,31 +0,0 @@ -// file: vrpn_Text.i -// author: Thiebaut Mochel mochel@cecpv.u-strasbg.fr 2008-06-05 -// copyright: (C)2008 CECPV -// license: Released to the Public Domain. -// depends: python 2.4, swig 1.3.35, VRPN 07_15 -// tested on: Linux w/ gcc 4.1.2 -// references: http://python.org/ http://vrpn.org/ -// http://www.swig.org -// - -%module vrpn_Text -%{ -#include "../vrpn_Types.h" -#include "../vrpn_BaseClass.h" -#include "../vrpn_Text.h" -%} - -%include "../vrpn_Configure.h" -%include "../vrpn_Connection.h" -%include "../vrpn_BaseClass.h" -%include "../vrpn_Text.h" - -%{ -static PyObject* convert_text_cb(vrpn_TEXTCB* t) { - return Py_BuildValue("(s)",t->message); -} -%} - -%include python-callback-wrapper.i - -PYTHON_CALLBACK_WRAPPER(text,vrpn_TEXTCB,vrpn_TEXTHANDLER) \ No newline at end of file diff --git a/src/vrpn/python_vrpn/vrpn_Tracker.i b/src/vrpn/python_vrpn/vrpn_Tracker.i deleted file mode 100644 index 9a61a055b9c088c89ae03b66c932dd222b1f6c0d..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/vrpn_Tracker.i +++ /dev/null @@ -1,69 +0,0 @@ -// file: vrpn_Tracker.i -// author: Thiebaut Mochel mochel@cecpv.u-strasbg.fr 2008-06-05 -// copyright: (C)2008 CECPV -// license: Released to the Public Domain. -// depends: python 2.4, swig 1.3.35, VRPN 07_15 -// tested on: Linux w/ gcc 4.1.2 -// references: http://python.org/ http://vrpn.org/ -// http://www.swig.org -// - -%module vrpn_Tracker -%{ -#include "../vrpn_Types.h" -#include "../vrpn_BaseClass.h" -#include "../vrpn_Connection.h" -#include "../vrpn_Tracker.h" -#include "../vrpn_Tracker_3DMouse.h" -#include "../vrpn_Tracker_AnalogFly.h" -#include "../vrpn_Tracker_ButtonFly.h" -#include "../vrpn_Tracker_Crossbow.h" -#include "../vrpn_Tracker_DTrack.h" -#include "../vrpn_Tracker_Fastrak.h" -#include "../vrpn_Tracker_Liberty.h" -#include "../vrpn_Tracker_MotionNode.h" -#include "../vrpn_Tracker_isense.h" -%} - -%ignore vrpn_Tracker_Remote::tracker_state; -%include "../vrpn_Configure.h" -%include "../vrpn_BaseClass.h" -%include "../vrpn_Connection.h" -%include "../vrpn_Tracker.h" - -%{ - -static PyObject* convert_tracker_cb(vrpn_TRACKERCB* t) { - return Py_BuildValue("(iddddddd)",t->sensor,t->pos[0],t->pos[1],t->pos[2],t->quat[0],t->quat[1],t->quat[2],t->quat[3]); -} - -static PyObject* convert_trackervel_cb(vrpn_TRACKERVELCB* t) { - return Py_BuildValue("(idddddddd)",t->sensor,t->vel[0],t->vel[1],t->vel[2],t->vel_quat[0],t->vel_quat[1],t->vel_quat[2],t->vel_quat[3],t->vel_quat_dt); -} - -static PyObject* convert_trackeracc_cb(vrpn_TRACKERACCCB* t) { - return Py_BuildValue("(idddddddd)",t->sensor,t->acc[0],t->acc[1],t->acc[2],t->acc_quat[0],t->acc_quat[1],t->acc_quat[2],t->acc_quat[3],t->acc_quat_dt); -} - -static PyObject* convert_tracker2room_cb(vrpn_TRACKERTRACKER2ROOMCB* t) { - return Py_BuildValue("(ddddddd)",t->tracker2room[0],t->tracker2room[1],t->tracker2room[2],t->tracker2room_quat[0],t->tracker2room_quat[1],t->tracker2room_quat[2],t->tracker2room_quat[3]); -} - -static PyObject* convert_trackerunit2sensor_cb(vrpn_TRACKERUNIT2SENSORCB* t) { - return Py_BuildValue("(iddddddd)",t->sensor,t->unit2sensor[0],t->unit2sensor[1],t->unit2sensor[2],t->unit2sensor_quat[0],t->unit2sensor_quat[1],t->unit2sensor_quat[2],t->unit2sensor_quat[3]); -} - -static PyObject* convert_trackerworkspace_cb(vrpn_TRACKERWORKSPACECB* t) { - return Py_BuildValue("(dddddd)",t->workspace_min[0],t->workspace_min[1],t->workspace_min[2],t->workspace_max[0],t->workspace_max[1],t->workspace_max[2]); -} -%} - -%include python-callback-wrapper.i - -PYTHON_CALLBACK_WRAPPER(tracker,vrpn_TRACKERCB,vrpn_TRACKERCHANGEHANDLER) -PYTHON_CALLBACK_WRAPPER(trackervel,vrpn_TRACKERVELCB,vrpn_TRACKERVELCHANGEHANDLER) -PYTHON_CALLBACK_WRAPPER(trackeracc,vrpn_TRACKERACCCB,vrpn_TRACKERACCCHANGEHANDLER) -PYTHON_CALLBACK_WRAPPER(tracker2room,vrpn_TRACKERTRACKER2ROOMCB,vrpn_TRACKERTRACKER2ROOMCHANGEHANDLER) -PYTHON_CALLBACK_WRAPPER(trackerunit2sensor,vrpn_TRACKERUNIT2SENSORCB,vrpn_TRACKERUNIT2SENSORCHANGEHANDLER) -PYTHON_CALLBACK_WRAPPER(trackerworkspace,vrpn_TRACKERWORKSPACECB,vrpn_TRACKERWORKSPACECHANGEHANDLER) - diff --git a/src/vrpn/python_vrpn/vrpn_glview.py b/src/vrpn/python_vrpn/vrpn_glview.py deleted file mode 100644 index fb87d1486f87dbd129427e03f52619daefbbafa1..0000000000000000000000000000000000000000 --- a/src/vrpn/python_vrpn/vrpn_glview.py +++ /dev/null @@ -1,273 +0,0 @@ -#!/usr/bin/python - -# -# Small program to examine positional data from a VRPN tracker -# -# Requirements: -# apt-get install python-qt python-qt-gl -# - -import sys -import math -import time -import optparse - -from PyQt4.QtCore import * -from PyQt4.QtGui import * -from PyQt4.QtOpenGL import * - -from OpenGL.GL import * -from OpenGL.GLU import * - -sys.path.append(".") - -import vrpn_Tracker - -VERBOSE = False - -# -class GLCamera: - def __init__(self): - self.angle = 0 - self.radius = 10 - self.height = 2 - pass - - def gluLookAt(self): - x = self.radius * math.sin(self.angle) - y = self.height - z = self.radius * math.cos(self.angle) - gluLookAt(x, y, z, - 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0) - pass - - pass - -# -def convert_to_glmatrix(pos, quat): - m = [1,0,0,0, - 0,1,0,0, - 0,0,1,0, - 0,0,0,1] - - p4_2 = quat[0]*2; p5_2 = quat[1]*2; p6_2 = quat[2]*2; - xx = p4_2*quat[0]; xy = p4_2*quat[1]; xz = p4_2*quat[2]; - yy = p5_2*quat[1]; yz = p5_2*quat[2]; - zz = p6_2*quat[2]; - - sx = quat[3]*p4_2; sy = quat[3]*p5_2; sz = quat[3]*p6_2; - - m[0] =1.0-(yy+zz); m[4] = (xy-sz); m[8] = (xz+sy); - m[1] = (xy+sz); m[5] =1.0-(xx+zz); m[9] = (yz-sx); - m[2] = (xz-sy); m[6] = (yz+sx); m[10]=1.0-(xx+yy); - m[3] =0 ; m[7] =0 ; m[11]=0 ; - - m[12] = pos[0] - m[13] = pos[1] - m[14] = pos[2] - m[15] = 1.0 - return m - -# -def draw_grid(scale): - glLineWidth(1) - #glColor4f(0.9, 0.9, 0.9, 0.9) - glBegin(GL_LINES) - s = scale - for i in range(-5,6): - glVertex3f(i, 0, s) - glVertex3f(i, 0, -s) - pass - for i in range(-5,6): - glVertex3f( s, 0, i) - glVertex3f(-s, 0, i) - pass - glEnd() - pass - -# -def draw_axes(scale): - s = scale - glLineWidth(2) - glBegin(GL_LINES) - glColor3f(1,0,0) # x - r - glVertex3f(0,0,0) - glVertex3f(s,0,0) - glColor3f(0,1,0) # y - g - glVertex3f(0,0,0) - glVertex3f(0,s,0) - glColor3f(0.2,0.2,1) # z - b - glVertex3f(0,0,0) - glVertex3f(0,0,s) - glEnd() - pass - -# -class ViewWidget3D(QGLWidget): - def __init__(self, parent): - QGLWidget.__init__(self, parent) - self.setFocusPolicy(Qt.StrongFocus) - self.lastmousepos = None - self.camera = GLCamera() - self.quadric = gluNewQuadric() - self.mutex = QMutex() - self.points = {} - pass - - def initializeGL(self): - QGLWidget.initializeGL(self) - glClearColor(0,0,0,1) - pass - - def resizeGL(self, w, h): - glViewport(0, 0, w, h) - pass - - def paintGL(self): - QGLWidget.paintGL(self) - - # erase previous frame - glClear(GL_COLOR_BUFFER_BIT) - - # setup matrices - glMatrixMode(GL_PROJECTION) - glLoadIdentity() - gluPerspective(45, self.width()/float(self.height()), 1, 100) - - glMatrixMode(GL_MODELVIEW) - glLoadIdentity() - self.camera.gluLookAt() - - # grid - glPushMatrix() - glColor4f(1,1,1,1) - draw_grid(5) - glPopMatrix() - - # axes - glPushMatrix() - draw_axes(1) - glPopMatrix() - - # points - radius = 0.05 - self.mutex.lock() - glColor4f(1,1,1,1) - for id in self.points: - p = self.points[id] - try: pos, quat = p[0:3], p[3:] - except: pass - m = convert_to_glmatrix(pos, quat) - glPushMatrix() - glMultMatrixf(m) - gluSphere(self.quadric, radius, 4,4) - self.renderText(radius, radius, radius, "%d"%(id,)) - draw_axes(0.1) - glPopMatrix() - pass - self.mutex.unlock() - pass - - def mouseMoveEvent(self, event): - if self.lastmousepos == None: - self.lastmousepos = QVector2D(event.x(), event.y()) - return - newpos = QVector2D(event.x(), event.y()) - dt = newpos - self.lastmousepos - self.lastmousepos = newpos - - self.camera.angle -= dt.x() / self.width() * 2 - self.camera.height -= dt.y() / self.height() * 2 - - self.update() - pass - def mousePressEvent(self, event): - pass - def mouseReleaseEvent(self, event): - self.lastmousepos = None - pass - def wheelEvent(self, event): - if(event.delta() > 0): - self.camera.radius *= 0.9 - else: - self.camera.radius *= 1.1 - pass - self.update() - pass - def keyReleaseEvent(self, event): - if event.text() == 'q': - pass - self.update() - pass - def handler(self, userdata, t): - if VERBOSE: - print userdata, t - pass - self.mutex.lock() - try: - self.points[t[0]] = t[1:] - pass - except: - print "unknown data: ", t - pass - self.mutex.unlock() - self.update() - pass - pass - -# -class mainthread(QThread): - def __init__(self, tracker, widget): - QThread.__init__(self) - self.tracker = tracker - self.widget = widget - pass - def run(self): - while True: - self.tracker.mainloop() - time.sleep(0) - pass - pass - pass - -# -def main(argv): - global VERBOSE - - # parse command line - parser = optparse.OptionParser() - parser.add_option("-v", "--verbose", dest="verbose", default=False, action="store_true") - options, args = parser.parse_args() - - if len(args) < 1: - print "no tracker specified (Example: Tracker0@localhost)" - return - print "using tracker: ", args[0] - - if options.verbose: - print "verbose mode" - VERBOSE = True - pass - # create QT widgets - app = QApplication(argv) - mw = QMainWindow() - widget = ViewWidget3D(mw) - mw.setCentralWidget(widget) - mw.resize(800,600) - mw.show() - - # create VRPN tracker and register change handlers - vrpn_Tracker.register_tracker_change_handler(widget.handler) - tracker = vrpn_Tracker.vrpn_Tracker_Remote(argv[1]) - tracker.register_change_handler(None, vrpn_Tracker.get_tracker_change_handler()) - - # start main thread - mt = mainthread(tracker,widget) - mt.start() - - # start main app - app.exec_() - pass - -main(sys.argv) diff --git a/src/vrpn/quat/.cvsignore b/src/vrpn/quat/.cvsignore deleted file mode 100644 index 50c1fe634600b90d860d4a5af08d69fff9aac906..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/.cvsignore +++ /dev/null @@ -1,10 +0,0 @@ -pc_win32 -make.out -makefile -pc_cygwin -pc_linux -powerpc_aix -sgi_irix -sparc_solaris -.depend -ptrepository diff --git a/src/vrpn/quat/CMakeLists.txt b/src/vrpn/quat/CMakeLists.txt deleted file mode 100644 index 597776e210f2d159352b14692e592130e6ffbc5b..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -project(quatlib) - -if(APPLE) - if(NOT CMAKE_OSX_ARCHITECTURES OR CMAKE_OSX_ARCHITECTURES STREQUAL "") - if(_CMAKE_OSX_MACHINE MATCHES "ppc") - set(CMAKE_OSX_ARCHITECTURES - "ppc;ppc64" - CACHE - STRING - "Build architectures for OS X" - FORCE) - else() - set(CMAKE_OSX_ARCHITECTURES - "i386;x86_64" - CACHE - STRING - "Build architectures for OS X" - FORCE) - endif() - endif() - set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ") - set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ") - if(NOT CMAKE_INSTALL_NAME_DIR) - set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib") - endif() - message(STATUS - "Building ${CMAKE_PROJECT_NAME} for ${CMAKE_OSX_ARCHITECTURES}") -endif() - -set(QUATLIB_SOURCES matrix.c quat.c vector.c xyzquat.c) -set(QUATLIB_HEADER quat.h) - -# Build the library itself and declare what bits need to be installed -add_library(quat ${QUATLIB_SOURCES} ${QUATLIB_HEADER}) -set_property(TARGET quat PROPERTY PUBLIC_HEADER ${QUATLIB_HEADER}) -set_target_properties(quat PROPERTIES FOLDER Library) -if(VRPN_INSTALL) - install(TARGETS - quat - ARCHIVE - DESTINATION - lib - COMPONENT - serversdk - PUBLIC_HEADER - DESTINATION - include - COMPONENT - serversdk) - install(TARGETS - quat - ARCHIVE - DESTINATION - lib - COMPONENT - clientsdk - PUBLIC_HEADER - DESTINATION - include - COMPONENT - clientsdk) -endif() - -add_subdirectory(testapps) diff --git a/src/vrpn/quat/Makefile b/src/vrpn/quat/Makefile deleted file mode 100644 index 2474c7a9af49f4d6a15b815265250815c74a493a..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/Makefile +++ /dev/null @@ -1,364 +0,0 @@ -############################################################################# -# -# makefile for quaternion lib -# -############################################################################# - -########################## -# common definitions. For non-UNC sites, uncomment one of the lines -# that defines hw_os for the machine you are on in the section just -# below. Then, the code should compile in your environment. -# -#HW_OS := sgi_irix -#HW_OS := pc_linux -HW_OS := pc_linux64 -#HW_OS := pc_linux_ia64 -# Set this to compile for ARM gcc compiler to use on embedded devices -# from a Linux box. -#HW_OS := pc_linux_arm -# Try this to compile for ARM gcc compiler to use on embedded devices -# from a Cygwin environment. -#HW_OS := pc_cygwin_arm -#HW_OS := pc_cygwin -#HW_OS := pc_FreeBSD -#HW_OS := sparc_solaris -#HW_OS := sparc_solaris_64 -#HW_OS := powerpc_aix -#HW_OS := powerpc_macosx -#HW_OS := universal_macosx -#HW_OS := macosx_32_64 -#HW_OS := macosx_64 -########################## - -########################## -# Mac OS X-specific options. If HW_OS is powerpc_macosx or universal_macosx, -# uncomment one line below to choose the minimum targeted OS X version and -# corresponding SDK. If none of the lines below is commented out, 10.5 will -# be the minimum version. -########################## -#MAC_OS_MIN_VERSION := 10.4 -#MAC_OS_MIN_VERSION := 10.5 -#MAC_OS_MIN_VERSION := 10.6 -#MAC_OS_MIN_VERSION := 10.7 -#MAC_OS_MIN_VERSION := 10.8 - - -INSTALL_DIR := /usr/local -BIN_DIR := $(INSTALL_DIR)/bin -INCLUDE_INSTALL_DIR := $(INSTALL_DIR)/include -LIB_INSTALL_DIR := $(INSTALL_DIR)/lib - -ifndef HW_OS - # hw_os does not exist on FreeBSD at UNC or on CYGWIN - UNAME := $(shell uname -s) - ifeq ($(UNAME), FreeBSD) - HW_OS := pc_FreeBSD - else - # pc_cygwin doesn't have HW_OS - ifeq ($(UNAME), CYGWIN_NT-4.0) - HW_OS := pc_cygwin - # On cygwin make is gmake (and gmake doesn't exist) - MAKE := make -f $(MAKEFILE) - else - ifeq ($(UNAME), CYGWIN_98-4.10) - HW_OS := pc_cygwin - MAKE := make -f $(MAKEFILE) - else - ifeq ($(UNAME), CYGWIN_NT-5.0) - HW_OS := pc_cygwin - MAKE := make -f $(MAKEFILE) - else - HW_OS := $(shell hw_os) - endif - endif - endif - endif -endif - -# Define defaults for the compilter, archiver, and ranlib. -CC := gcc -AR := ar ruv -RANLIB := ranlib - -ifdef PBASE_ROOT - HW_OS = hp_flow - ifeq ($(PXFL_COMPILER), aCC) - HW_OS = hp_flow_aCC - endif -endif - - -ifeq ($(HW_OS),sgi_irix) - ifndef SGI_ABI - SGI_ABI := n32 - endif - ifndef SGI_ARCH - SGI_ARCH := mips3 - endif - OBJECT_DIR_SUFFIX := .$(SGI_ABI).$(SGI_ARCH) - CC = cc -$(SGI_ABI) -$(SGI_ARCH) -endif - -AR := ar ruv -RANLIB := ranlib - -ifeq ($(HW_OS), pc_cygwin) -endif - -ifeq ($(HW_OS), hp700_hpux10) - CC = cc -Ae -endif - -ifeq ($(HW_OS), pc_linux) -endif - -ifeq ($(HW_OS), pc_linux_ia64) -endif - -ifeq ($(HW_OS), pc_linux64) - CC = gcc -m64 -fPIC -endif - -ifneq (,$(findstring macosx,$(HW_OS))) - ifndef MAC_OS_MIN_VERSION - MAC_OS_MIN_VERSION := 10.5 - endif - - # Select which compiler and MAC OS X SDK to use - MAC_GCC := g++ - ifeq ($(MAC_OS_MIN_VERSION), 10.8) - MAC_OS_SDK := MacOSX10.8.sdk - else - ifeq ($(MAC_OS_MIN_VERSION), 10.7) - MAC_OS_SDK := MacOSX10.7.sdk - else - ifeq ($(MAC_OS_MIN_VERSION), 10.6) - MAC_OS_SDK := MacOSX10.6.sdk - else - ifeq ($(MAC_OS_MIN_VERSION), 10.5) - MAC_OS_SDK := MacOSX10.5.sdk - else - MAC_OS_SDK := MacOSX10.4u.sdk - MAC_GCC := g++-4.0 - endif - endif - endif - endif -endif - -ifeq ($(HW_OS), powerpc_macosx) - CC = $(MAC_GCC) -arch ppc -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - AR = libtool -static -o - RANLIB = : -endif - -ifeq ($(HW_OS), universal_macosx) - CC = $(MAC_GCC) -arch ppc -arch i386 -arch x86_64 -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - AR = libtool -static -o - RANLIB = : -endif - - ifeq ($(HW_OS), macosx_32_64) - CC = $(MAC_GCC) -arch i386 -arch x86_64 -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - RANLIB = : - AR = libtool -static -o - SYSLIBS = -framework CoreFoundation -framework IOKit -framework System - endif - - ifeq ($(HW_OS), macosx_64) - ifeq ($(MAC_OS_SDK), MacOSX10.6.sdk) - CC = $(MAC_GCC) -arch x86_64 -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - else - CC = $(MAC_GCC) -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - endif - RANLIB = : - AR = libtool -static -o - SYSLIBS = -framework CoreFoundation -framework IOKit -framework System - endif - - -ifeq ($(HW_OS), pc_linux_arm) - CC = arm-linux-gcc - AR = arm-linux-ar ruv - RANLIB = arm-linux-ranlib -endif - -ifeq ($(HW_OS), pc_cygwin_arm) - CC = arm-unknown-linux-gnu-gcc - AR = arm-unknown-linux-gnu-ar ruv - RANLIB = arm-unknown-linux-gnu-ranlib -endif - -ifeq ($(HW_OS), sparc_solaris) - CC = /opt/SUNWspro/bin/CC -endif - -ifeq ($(HW_OS), sparc_solaris_64) - CC = /opt/SUNWspro/bin/CC -xarch=v9a -endif - -ifeq ($(HW_OS), hp_flow) - CC = g++ -endif - -ifeq ($(HW_OS), hp_flow_aCC) - CC = /opt/aCC/bin/aCC -endif - - -MAKEFILE = Makefile - -QUAT_LIB = libquat.a - -# flags -INCLUDE_FLAGS = -I. - -ifeq ($(HW_OS), pc_cygwin) - INCLUDE_FLAGS = -I. -endif - -ifeq ($(HW_OS), hp_flow) - INCLUDE_FLAGS = -I. -I$(INCLUDE_INSTALL_DIR) -DFLOW -endif - -ifeq ($(HW_OS), hp_flow_aCC) - INCLUDE_FLAGS = -I. -I$(INCLUDE_INSTALL_DIR) -DFLOW -endif - -override CFLAGS := -g $(INCLUDE_FLAGS) $(CFLAGS) -override OPT_CFLAGS := -O $(INCLUDE_FLAGS) $(CFLAGS) - -override LDFLAGS := -L. -L$(HW_OS) $(LDFLAGS) -LINT_FLAGS = $(INCLUDE_FLAGS) - -############################################################################# -# -# for building library -# -############################################################################# - -lib: $(HW_OS)$(OBJECT_DIR_SUFFIX) libquat.a - -$(HW_OS)$(OBJECT_DIR_SUFFIX): - -mkdir -p $(HW_OS)$(OBJECT_DIR_SUFFIX) - -############################################################################# -# -# example/test programs -# -############################################################################# - -TEST_FILES = eul matrix_to_posquat qmat qmult qxform qmake timer qpmult - -all : - -rm $(TEST_FILES) - $(MAKE) $(TEST_FILES) - -# -# timer- time some operation -# -timer : timer.c - $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $@.c -lquat -lm - -# -# matrix_to_posquat- matrix_to_posquat to quat -# -matrix_to_posquat : testapps/matrix_to_posquat.c - $(CC) -o $(HW_OS)/$@ $(CFLAGS) $(LDFLAGS) testapps/$@.c -lquat -lm - -# -# eul- eul to quat -# -eul : testapps/eul.c - $(CC) -o $(HW_OS)/$@ $(CFLAGS) $(LDFLAGS) testapps/$@.c -lquat -lm - -# -# qmult- multiply 2 quats -# -qmult : testapps/qmult.c - $(CC) -o $(HW_OS)/$@ $(CFLAGS) $(LDFLAGS) testapps/$@.c -lquat -lm - -# -# qpmult- multiply 2 pmatrices -# -qpmult : testapps/qpmult.c - $(CC) -o $(HW_OS)/$@ $(CFLAGS) $(LDFLAGS) testapps/$@.c -lquat -lm - -# -# qxform- xform a vec -# -qxform : testapps/qxform.c - $(CC) -o $(HW_OS)/$@ $(CFLAGS) $(LDFLAGS) testapps/$@.c -lquat -lm - -# -# qmat- matrix to quaternion -# -qmat : qmat.c - $(CC) -o $(HW_OS)/$@ $(CFLAGS) $(LDFLAGS) testapps/$@.c -lquat -lm - -# -# qmake- tests q_make -# -qmake : qmake.c - $(CC) -o $(HW_OS)/$@ $(CFLAGS) $(LDFLAGS) $@.c -lquat -lm - -oglconv : oglconv.c - $(CC) -o $(HW_OS)/$@ $(CFLAGS) $(LDFLAGS) $@.c -lquat -lm - -oglmult : oglmult.c - $(CC) -o $(HW_OS)/$@ $(CFLAGS) $(LDFLAGS) $@.c -lquat -lm - -############################################################################# -# -# rules and definitions for making quaternion library -# -############################################################################# - -QUAT_INCLUDES = quat.h -QUAT_C_FILES = quat.c matrix.c vector.c xyzquat.c -QUAT_OBJ_FILES = $(QUAT_C_FILES:.c=.o) - -$(QUAT_LIB) : $(QUAT_OBJ_FILES) $(MAKEFILE) - @echo "Building $@..." - $(AR) $(QUAT_LIB) $(QUAT_OBJ_FILES) - -$(RANLIB) $(QUAT_LIB) - mv $(QUAT_LIB) *.o $(HW_OS)$(OBJECT_DIR_SUFFIX) - -$(QUAT_OBJ_FILES) : $(QUAT_INCLUDES) - -############################################################################# -# -# miscellaneous rules -# -############################################################################# - -lint : - lint $(LINT_FLAGS) $(COORD_FILES) - -install: lib - #-mkdir $(BIN_DIR) - #( cd $(BIN_DIR) ; rm -f $(INSTALL_APPS) ) - #( cd $(OBJ_DIR) ; cp $(INSTALL_APPS) $(BIN_DIR) ) - #( cd $(BIN_DIR) ; strip $(INSTALL_APPS) ) - -mkdir -p $(LIB_DIR) - ( cd $(HW_OS)$(OBJECT_DIR_SUFFIX) ; cp $(QUAT_LIB) $(LIB_DIR) ) - -mkdir -p $(INCLUDE_DIR) - cp quat.h $(INCLUDE_DIR) - -allclean : - -/bin/rm -f *.o *.a *~ *.j foo a.out $(TEST_FILES) - -/bin/rm -fr $(HW_OS)$(OBJECT_DIR_SUFFIX)/*.o $(HW_OS)$(OBJECT_DIR_SUFFIX)/*.a - -clean : - -/bin/rm -f *.o *.a *~ *.j foo a.out $(TEST_FILES) - -/bin/rm -fr $(HW_OS)$(OBJECT_DIR_SUFFIX)/*.o $(HW_OS)$(OBJECT_DIR_SUFFIX)/*.a - - -install: lib - -mkdir -p $(LIB_INSTALL_DIR) - ( cd $(LIB_INSTALL_DIR) ; rm -f libquat.a ) - ( cd $(HW_OS)$(OBJECT_DIR_SUFFIX) ; cp lib*.a $(LIB_INSTALL_DIR) ) - -mkdir -p $(INCLUDE_INSTALL_DIR) - cp quat.h $(INCLUDE_INSTALL_DIR) - - diff --git a/src/vrpn/quat/Readme b/src/vrpn/quat/Readme deleted file mode 100644 index 84ff1dbd0a1502d64860edcfc21ca1b514ef7a74..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/Readme +++ /dev/null @@ -1,61 +0,0 @@ - -This directory contains the source and test files for the quaternion -library, libquat.a. It is based on Warren Robinett's adapted version of Ken -Shoemake's code, as seen in Shoemake's 1985 SIGGRAPH paper. - -For those not familiar with quaternions, they are a -concise and efficient way of describing rotations and orientations of -three-dimensional objects. (Two good references for this subject are -Ken Shoemake's 1985 SIGGRAPH papers "Quaternion Calculus for Animation" -and "Animating Rotation with Quaternion Curves" in the '85 -proceedings.) - -The library is built on Ken Shoemake's code (as presented in the appendix of -the first paper listed above) and implements the most common quaternion -functions, as well as some more obscure ones. In particular, there are -conversion routines between vectors, matrices and quaternions, as well as -various vector and matrix operations. - -This code is has been placed into the public domain by the University of -North Carolina at Chapel Hill on January 9th, 2005; after consultation -with its authors, Warren Robinett and Richard Holloway. It is provided -"as is", with no guarantee or warranty of any kind, even fitness for a -specific purpose. - -Documentation on individual routines is in quat.h. - -See header of quat.c and quat.h for more info. - -Compilation : -============= - -Unix : -Edit makefile and uncomment the line corresponding to your architecture, -then do 'make' - -Windows : -See ../vrpn/README.Compiling - - -Example Programs -================ - -These files are here for running random tests on the source code, and for -doing conversions between quats and matrices, etc. They are handy for -debugging source programs using quaternions. - -Files: ------- - - eul.c - convert from euler angles to quaternion - - qmat.c - converts matrix to quaternion - - qmult.c - multiplies two quaternions and shows result as a matrix and - a quat - - qxform.c - does xform of a vector - - qmake.c - make a quaternion from an axis & angle; show result as - quat and matrix - diff --git a/src/vrpn/quat/matrix.c b/src/vrpn/quat/matrix.c deleted file mode 100644 index 40194677eacbb2cc522b85ae598ecc5f21e03f04..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/matrix.c +++ /dev/null @@ -1,302 +0,0 @@ -/***************************************************************************** - * - matrix.c- code for matrix utilities for quaternion library; routines - here are only those that have nothing to do with quaternions. - - (see quat.h for revision history and more documentation.) - - * - *****************************************************************************/ - - -#include <math.h> // for atan2, cos, sin, fabs, sqrt -#include <stdio.h> // for printf - -#include "quat.h" // for q_matrix_type, etc - -/* define local X, Y, Z, W to override any external definition; don't use - * Q_X, etc, because it makes this code a LOT harder to read; don't use - * pphigs definition of X-W since it could theoretically change. - */ - -#undef X -#undef Y -#undef Z -#undef W - -#define X Q_X -#define Y Q_Y -#define Z Q_Z -#define W Q_W - - -/* - * q_print_matrix - prints a 4x4 matrix - */ -void q_print_matrix(const q_matrix_type matrix) -{ - int i, j; - - for ( i = 0; i < 4; i++ ) - { - printf(" "); - for ( j = 0; j < 4; j++ ) - printf("%10lf", matrix[i][j]); - printf("\n"); - } - -} /* q_print_matrix */ - - -/***************************************************************************** - * - q_euler_to_col_matrix - euler angles should be in radians - computed assuming the order of rotation is: yaw, pitch, roll. - - This means the following: - - p' = roll( pitch( yaw(p) ) ) - - or - - p' = Mr * Mp * My * p - - Yaw is rotation about Z axis, pitch is rotation about Y axis, and roll - is rotation about X axis. In terms of these axes, then, the process is: - - p' = Mx * My * Mz * p - - where Mx = the standard Foley and van Dam column matrix for rotation - about the X axis, and similarly for Y and Z. - - Thus the calling sequence in terms of X, Y, Z is: - - q_euler_to_col_matrix(destMatrix, zRot, yRot, xRot); - * - *****************************************************************************/ -void q_euler_to_col_matrix(q_matrix_type destMatrix, - double yaw, double pitch, double roll) -{ - double cosYaw, sinYaw, cosPitch, sinPitch, cosRoll, sinRoll; - - - cosYaw = cos(yaw); - sinYaw = sin(yaw); - - cosPitch = cos(pitch); - sinPitch = sin(pitch); - - cosRoll = cos(roll); - sinRoll = sin(roll); - - /* - * compute transformation destMatrix - */ - destMatrix[0][0] = cosYaw * cosPitch; - destMatrix[0][1] = cosYaw * sinPitch * sinRoll - sinYaw * cosRoll; - destMatrix[0][2] = cosYaw * sinPitch * cosRoll + sinYaw * sinRoll; - destMatrix[0][3] = 0.0; - - destMatrix[1][0] = sinYaw * cosPitch; - destMatrix[1][1] = cosYaw * cosRoll + sinYaw * sinPitch * sinRoll; - destMatrix[1][2] = sinYaw * sinPitch * cosRoll - cosYaw * sinRoll; - destMatrix[1][3] = 0.0; - - destMatrix[2][0] = -sinPitch; - destMatrix[2][1] = cosPitch * sinRoll; - destMatrix[2][2] = cosPitch * cosRoll; - destMatrix[2][3] = 0.0; - - destMatrix[3][0] = 0.0; - destMatrix[3][1] = 0.0; - destMatrix[3][2] = 0.0; - destMatrix[3][3] = 1.0; - -} /* q_euler_to_col_matrix */ - - -/***************************************************************************** - * - q_col_matrix_to_euler- convert a column matrix to euler angles - - input: - - vector to hold euler angles - - src column matrix - q_vec_type angles : Holds outgoing roll, pitch, yaw - q_matrix_type colMatrix : Holds incoming rotation - - output: - - euler angles in radians in the range -pi to pi; - vec[0] = yaw, vec[1] = pitch, vec[2] = roll - yaw is rotation about Z axis, pitch is about Y, roll -> X rot. - - notes: - - written by Gary Bishop - - you cannot use Q_X, Q_Y, and Q_Z to pull the elements out of - the Euler as if they were rotations about these angles -- - this will invert X and Z. You need to instead use Q_YAW - (rotation about Z), Q_PITCH (rotation about Y) and Q_ROLL - (rotation about X) to get them. - * - *****************************************************************************/ -void q_col_matrix_to_euler(q_vec_type yawpitchroll, const q_matrix_type colMatrix) -{ - - double sinPitch, cosPitch, sinRoll, cosRoll, sinYaw, cosYaw; - - - sinPitch = -colMatrix[2][0]; - cosPitch = sqrt(1 - sinPitch*sinPitch); - - if ( fabs(cosPitch) > Q_EPSILON ) - { - sinRoll = colMatrix[2][1] / cosPitch; - cosRoll = colMatrix[2][2] / cosPitch; - sinYaw = colMatrix[1][0] / cosPitch; - cosYaw = colMatrix[0][0] / cosPitch; - } - else - { - sinRoll = -colMatrix[1][2]; - cosRoll = colMatrix[1][1]; - sinYaw = 0; - cosYaw = 1; - } - - /* yaw */ - yawpitchroll[Q_YAW] = atan2(sinYaw, cosYaw); - - /* pitch */ - yawpitchroll[Q_PITCH] = atan2(sinPitch, cosPitch); - - /* roll */ - yawpitchroll[Q_ROLL] = atan2(sinRoll, cosRoll); - -} /* col_matrix_to_euler */ - - -/***************************************************************************** - * - q_matrix_mult - does a 4x4 matrix multiply (the input matrices are 4x4) and - puts the result in a 4x4 matrix. src == dest ok. - * - *****************************************************************************/ -void q_matrix_mult(q_matrix_type resultMatrix, const q_matrix_type leftMatrix, - const q_matrix_type rightMatrix) -{ - int i; - int r, c; - q_matrix_type tmpResultMatrix; - - - /* pick up a row of the multiplier matrix and multiply by a column of the - * multiplicand - */ - for ( r = 0; r < 4; r++ ) - /* multiply each column of the multiplicand by row r of the multiplier */ - for ( c = 0; c < 4; c++ ) - { - tmpResultMatrix[r][c] = 0.0; - - /* - * for each element in the multiplier row, multiply it with each - * element in column c of the multiplicand. - * i ranges over the length of the rows in multiplier and the length - * of the columns in the multiplicand - */ - for ( i = 0; i < 4; i++ ) - /* - * uses - * C[r][c] += A[r][i] * B[i][c] - */ - tmpResultMatrix[r][c] += leftMatrix[r][i] * rightMatrix[i][c]; - } - - - q_matrix_copy(resultMatrix, ( const double (*)[4] ) tmpResultMatrix); - -} /* q_matrix_mult */ - -/* - * multiplication of OpenGL-style matrices - */ -void qogl_matrix_mult(qogl_matrix_type result, const qogl_matrix_type left, - const qogl_matrix_type right ) -{ - int i, r, c; - qogl_matrix_type tmp; - - /* straightforward matrix multiplication */ - for ( r = 0; r < 4; r++ ) { - for( c = 0; c < 4; c++ ) { - tmp[r*4+c] = 0.0; - for( i = 0; i < 4; i++ ) { - tmp[r*4+c] += left[i*4+c] * right[r*4+i]; - } - } - } - - qogl_matrix_copy( result, tmp ); -} - -/***************************************************************************** - * - q_matrix_copy - copies srcMatrix to destMatrix (both matrices are 4x4) - * - *****************************************************************************/ -void q_matrix_copy(q_matrix_type destMatrix, const q_matrix_type srcMatrix) -{ - - int i, j; - - for ( i = 0; i < 4; i++ ) - for ( j = 0; j < 4; j++ ) - destMatrix[i][j] = srcMatrix[i][j]; - -} /* q_matrix_copy */ - -/* - * qogl_matrix_copy - copies src to dest, both OpenGL matrices - */ -void qogl_matrix_copy(qogl_matrix_type dest, const qogl_matrix_type src ) -{ - int i; - - for( i = 0; i < 16; i++ ) - dest[i] = src[i]; -} - -/***************************************************************************** - * - qgl_print_matrix - print gl-style matrix - * - *****************************************************************************/ -void qgl_print_matrix(const qgl_matrix_type matrix) -{ - - int i, j; - - for ( i = 0; i < 4; i++ ) - { - printf(" "); - for ( j = 0; j < 4; j++ ) - printf("%10f", matrix[i][j]); - printf("\n"); - } - -} /* qgl_print_matrix */ - -/* - * print OpenGL-style matrix - */ -void qogl_print_matrix(const qogl_matrix_type m ) -{ - int i, j; - - for( j = 0; j < 4; j++ ) { - for( i = 0; i < 4; i++ ) - printf( "%10lf", m[i*4+j] ); - printf( "\n" ); - } - -} /* qogl_print_matrix */ diff --git a/src/vrpn/quat/quat.c b/src/vrpn/quat/quat.c deleted file mode 100644 index ce70a79814f104b435e4b93eae335ce252ea79c7..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/quat.c +++ /dev/null @@ -1,963 +0,0 @@ - -/***************************************************************************** - * - quat.c- code for quaternion-specific routines. - - (see quat.h for revision history and more documentation.) - * - *****************************************************************************/ - - -#include "quat.h" - -#include <math.h> // for sqrt, sin, cos, acos, asin, etc -#include <stdio.h> // for printf - -/* define local X, Y, Z, W to override any external definition; don't use - * Q_X, etc, because it makes this code a LOT harder to read; don't use - * pphigs definition of X-W since it could theoretically change. - */ - -#undef X -#undef Y -#undef Z -#undef W - -#define X Q_X -#define Y Q_Y -#define Z Q_Z -#define W Q_W - - -/***************************************************************************** - * - q_print- print a quaternion - * - *****************************************************************************/ -void q_print(const q_type quat) -{ - printf(" [ (%lf, %lf, %lf), %lf ]\n", - quat[X], quat[Y], quat[Z], quat[W]); - -} /* q_print */ - - - - -/***************************************************************************** - * - q_xform: Compute quaternion product destQuat = q * vec * qinv. - vec can be same storage as destVec - * - *****************************************************************************/ -void q_xform(q_vec_type destVec, const q_type q, const q_vec_type vec) -{ - q_type inverse; - q_type vecQuat; - q_type tempVecQuat; - q_type resultQuat; - - /* copy vector into temp quaternion for multiply */ - q_from_vec(vecQuat, vec); - - /* invert multiplier */ - q_invert(inverse, q); - - /* do q * vec * q(inv) */ - q_mult(tempVecQuat, q, vecQuat); - q_mult(resultQuat, tempVecQuat, inverse); - - /* back to vector land */ - q_to_vec(destVec, resultQuat); - -} /* q_xform */ - - - - -/***************************************************************************** - * q_mult: Compute quaternion product destQuat = qLeft * qRight. - * destQuat can be same as either qLeft or qRight or both. - *****************************************************************************/ -void q_mult(q_type destQuat, const q_type qLeft, const q_type qRight) -{ - q_type tempDest; - - - tempDest[W] = qLeft[W]*qRight[W] - qLeft[X]*qRight[X] - - qLeft[Y]*qRight[Y] - qLeft[Z]*qRight[Z]; - - tempDest[X] = qLeft[W]*qRight[X] + qLeft[X]*qRight[W] + - qLeft[Y]*qRight[Z] - qLeft[Z]*qRight[Y]; - - tempDest[Y] = qLeft[W]*qRight[Y] + qLeft[Y]*qRight[W] + - qLeft[Z]*qRight[X] - qLeft[X]*qRight[Z]; - - tempDest[Z] = qLeft[W]*qRight[Z] + qLeft[Z]*qRight[W] + - qLeft[X]*qRight[Y] - qLeft[Y]*qRight[X]; - - q_copy(destQuat, tempDest); - -} /* q_mult */ - - - -/***************************************************************************** - * q_copy: copy quaternion q to destQuat - *****************************************************************************/ -void q_copy(q_type destQuat, const q_type srcQuat) -{ - - destQuat[X] = srcQuat[X]; - destQuat[Y] = srcQuat[Y]; - destQuat[Z] = srcQuat[Z]; - destQuat[W] = srcQuat[W]; - -} /* q_copy */ - - -/***************************************************************************** - * q_from_vec- convert vec to quaternion - *****************************************************************************/ -void q_from_vec(q_type destQuat, const q_vec_type vec) -{ - - destQuat[X] = vec[X]; - destQuat[Y] = vec[Y]; - destQuat[Z] = vec[Z]; - destQuat[W] = 0.0; - -} /* q_from_vec */ - - -/***************************************************************************** - * q_to_vec- convert quaternion to vector; q[W] is ignored - *****************************************************************************/ -void q_to_vec(q_vec_type destVec, const q_type srcQuat) -{ - - destVec[X] = srcQuat[X]; - destVec[Y] = srcQuat[Y]; - destVec[Z] = srcQuat[Z]; - -} /* q_to_vec */ - - -/***************************************************************************** - * q_normalize- normalize quaternion. src and dest can be same - *****************************************************************************/ -void q_normalize(q_type destQuat, const q_type srcQuat) -{ - double normalizeFactor; - - - normalizeFactor = 1.0 / sqrt( srcQuat[X]*srcQuat[X] + srcQuat[Y]*srcQuat[Y] + - srcQuat[Z]*srcQuat[Z] + srcQuat[W]*srcQuat[W] ); - - destQuat[X] = srcQuat[X] * normalizeFactor; - destQuat[Y] = srcQuat[Y] * normalizeFactor; - destQuat[Z] = srcQuat[Z] * normalizeFactor; - destQuat[W] = srcQuat[W] * normalizeFactor; - -} /* q_normalize */ - - - -/***************************************************************************** - * q_conjugate- conjugate quaternion. src == dest ok. - *****************************************************************************/ -void q_conjugate(q_type destQuat, const q_type srcQuat) -{ - - destQuat[X] = -srcQuat[X]; - destQuat[Y] = -srcQuat[Y]; - destQuat[Z] = -srcQuat[Z]; - destQuat[W] = srcQuat[W]; - -} /* q_conjugate */ - - -/***************************************************************************** - * q_invert: Invert quaternion; That is, form its multiplicative inverse. - * src == dest ok. - *****************************************************************************/ -void q_invert(q_type destQuat, const q_type srcQuat) -{ - double srcQuatNorm; - - srcQuatNorm = 1.0 / (srcQuat[X]*srcQuat[X] + srcQuat[Y]*srcQuat[Y] + - srcQuat[Z]*srcQuat[Z] + srcQuat[W]*srcQuat[W]); - - destQuat[X] = -srcQuat[X] * srcQuatNorm; - destQuat[Y] = -srcQuat[Y] * srcQuatNorm; - destQuat[Z] = -srcQuat[Z] * srcQuatNorm; - destQuat[W] = srcQuat[W] * srcQuatNorm; - -} /* q_invert */ - - -/***************************************************************************** - * q_exp: Exponentiate quaternion, assuming scalar part 0. src == dest ok. - *****************************************************************************/ -void q_exp(q_type destQuat, const q_type srcQuat) -{ - double theta, scale; - - - theta = sqrt(srcQuat[X]*srcQuat[X] + srcQuat[Y]*srcQuat[Y] + - srcQuat[Z]*srcQuat[Z]); - - if (theta > Q_EPSILON) - scale = sin(theta)/theta; - else - scale = 1.0; - - destQuat[X] = scale*srcQuat[X]; - destQuat[Y] = scale*srcQuat[Y]; - destQuat[Z] = scale*srcQuat[Z]; - destQuat[W] = cos(theta); - -} /* q_exp */ - - - -/***************************************************************************** - * q_log: Take the natural logarithm of unit quaternion. src == dest ok. - *****************************************************************************/ -void q_log(q_type destQuat, const q_type srcQuat) -{ - double theta, scale; - - - scale = sqrt(srcQuat[X]*srcQuat[X] + srcQuat[Y]*srcQuat[Y] + - srcQuat[Z]*srcQuat[Z]); - theta = atan2(scale, srcQuat[W]); - - if (scale > 0.0) - scale = theta/scale; - - destQuat[X] = scale * srcQuat[X]; - destQuat[Y] = scale * srcQuat[Y]; - destQuat[Z] = scale * srcQuat[Z]; - destQuat[W] = 0.0; - -} /* q_log */ - - - - -/***************************************************************************** - * - q_slerp: Spherical linear interpolation of unit quaternions. - - As t goes from 0 to 1, destQuat goes from startQ to endQuat. - This routine should always return a point along the shorter - of the two paths between the two. That is why the vector may be - negated in the end. - - src == dest should be ok, although that doesn't seem to make much - sense here. - * - *****************************************************************************/ -void q_slerp(q_type destQuat, const q_type startQuat, const q_type endQuat, double t) -{ - q_type startQ; /* temp copy of startQuat */ - double omega, cosOmega, sinOmega; - double startScale, endScale; - int i; - - - q_copy(startQ, startQuat); - - cosOmega = startQ[X]*endQuat[X] + startQ[Y]*endQuat[Y] + - startQ[Z]*endQuat[Z] + startQ[W]*endQuat[W]; - - /* If the above dot product is negative, it would be better to - * go between the negative of the initial and the final, so that - * we take the shorter path. - */ - if ( cosOmega < 0.0 ) - { - cosOmega *= -1; - for (i = X; i <= W; i++) - startQ[i] *= -1; - } - - if ( (1.0 + cosOmega) > Q_EPSILON ) - { - /* usual case */ - if ( (1.0 - cosOmega) > Q_EPSILON ) - { - /* usual case */ - omega = acos(cosOmega); - sinOmega = sin(omega); - startScale = sin((1.0 - t)*omega) / sinOmega; - endScale = sin(t*omega) / sinOmega; - } - else - { - /* ends very close */ - startScale = 1.0 - t; - endScale = t; - } - for (i = X; i <= W; i++) - destQuat[i] = startScale*startQ[i] + endScale*endQuat[i]; - } - else - { - /* ends nearly opposite */ - destQuat[X] = -startQ[Y]; - destQuat[Y] = startQ[X]; - destQuat[Z] = -startQ[W]; - destQuat[W] = startQ[Z]; - - startScale = sin((0.5 - t) * Q_PI); - endScale = sin(t * Q_PI); - for (i = X; i <= Z; i++) - destQuat[i] = startScale*startQ[i] + endScale*destQuat[i]; - } - -} /* q_slerp */ - - - -/***************************************************************************** - * - q_make: make a quaternion given an axis and an angle (in radians) - - notes: - - rotation is counter-clockwise when rotation axis vector is - pointing at you - - if angle or vector are 0, the identity quaternion is returned. - - q_type destQuat : quat to be made - double x, y, z : axis of rotation - double angle : angle of rotation about axis in radians - * - *****************************************************************************/ -void q_make( q_type destQuat,double x, double y, double z, double angle) -{ - double length, cosA, sinA; - - /* normalize vector */ - length = sqrt( x*x + y*y + z*z ); - - /* if zero vector passed in, just return identity quaternion */ - if ( length < Q_EPSILON ) { - destQuat[X] = 0; - destQuat[Y] = 0; - destQuat[Z] = 0; - destQuat[W] = 1; - return; - } - - x /= length; - y /= length; - z /= length; - - cosA = cos(angle / 2.0); - sinA = sin(angle / 2.0); - - destQuat[W] = cosA; - destQuat[X] = sinA * x; - destQuat[Y] = sinA * y; - destQuat[Z] = sinA * z; - -} /* q_make */ - -/***************************************************************************** - * - q_from_axis_angle: Another name for q_make - - * - *****************************************************************************/ -void q_from_axis_angle(q_type destQuat, double x, double y, double z, double angle) -{ - q_make(destQuat, x, y, z, angle); -} - -/***************************************************************************** - * - q_to_axis_angle: make an axis and an angle (in radians) given a quaternion - - notes: - - rotation is counter-clockwise when rotation axis vector is - pointing at you - - If identity quaternion is passed in, return zero rotation around - the Z axis. - - double x, y, z : axis of rotation - double angle : angle of rotation about axis in radians - q_type srcQuat : quat that is to be described - * - *****************************************************************************/ - -void q_to_axis_angle (double *x, double *y, double *z, double *angle, - const q_type srcQuat) -{ - /* If we have the identity quaternion, return zero rotation about Z */ - double length = sqrt( srcQuat[X]*srcQuat[X] + srcQuat[Y]*srcQuat[Y] + srcQuat[Z]*srcQuat[Z]); - if (length < Q_EPSILON) { - *x = *y = *angle = 0; - *z = 1; - return; - } - - /* According to an article by Sobiet Void (robin@cybervision.com) on Game Developer's - * Network, the following conversion is appropriate. */ - - *x = srcQuat[X] / length; - *y = srcQuat[Y] / length; - *z = srcQuat[Z] / length; - *angle = 2 * acos(srcQuat[W]); - -} /* q_to_axis_angle */ - - - -/***************************************************************************** - * - q_from_two_vecs - create a quaternion from two vectors that rotates - v1 to v2 about an axis perpendicular to both - * - *****************************************************************************/ -void q_from_two_vecs(q_type destQuat, const q_vec_type v1, const q_vec_type v2 ) -{ - q_vec_type u1, u2 ; - q_vec_type axis ; /* axis of rotation */ - double theta ; /* angle of rotation about axis */ - double theta_complement ; - double crossProductMagnitude ; - - /* - ** Normalize both vectors and take cross product to get rotation axis. - */ - q_vec_normalize( u1, v1 ) ; - q_vec_normalize( u2, v2 ) ; - q_vec_cross_product( axis, u1, u2 ) ; - - /* - ** | u1 X u2 | = |u1||u2|sin(theta) - ** - ** Since u1 and u2 are normalized, - ** - ** theta = arcsin(|axis|) - */ - crossProductMagnitude = sqrt( q_vec_dot_product( axis, axis ) ) ; - - /* - ** Occasionally, even though the vectors are normalized, the magnitude will - ** be calculated to be slightly greater than one. If this happens, just - ** set it to 1 or asin() will barf. - */ - if( crossProductMagnitude > 1.0 ) - crossProductMagnitude = 1.0 ; - - /* - ** Take arcsin of magnitude of rotation axis to compute rotation angle. - ** Since crossProductMagnitude=[0,1], we will have theta=[0,pi/2]. - */ - theta = asin( crossProductMagnitude ) ; - theta_complement = Q_PI - theta ; - - /* - ** If cos(theta) < 0, use complement of theta as rotation angle. - */ - if( q_vec_dot_product(u1, u2) < 0.0 ) - { - theta = theta_complement ; - theta_complement = Q_PI - theta ; - } - - /* if angle is 0, just return identity quaternion */ - if( theta < Q_EPSILON ) - { - destQuat[Q_X] = 0.0 ; - destQuat[Q_Y] = 0.0 ; - destQuat[Q_Z] = 0.0 ; - destQuat[Q_W] = 1.0 ; - } - else - { - if( theta_complement < Q_EPSILON ) - { - /* - ** The two vectors are opposed. Find some arbitrary axis vector. - ** First try cross product with x-axis if u1 not parallel to x-axis. - */ - if( (u1[Y]*u1[Y] + u1[Z]*u1[Z]) >= Q_EPSILON ) - { - axis[X] = 0.0 ; - axis[Y] = u1[Z] ; - axis[Z] = -u1[Y] ; - } - else - { - /* - ** u1 is parallel to to x-axis. Use z-axis as axis of rotation. - */ - axis[X] = axis[Y] = 0.0 ; - axis[Z] = 1.0 ; - } - } - - q_vec_normalize( axis, axis ) ; - q_make( destQuat, axis[Q_X], axis[Q_Y], axis[Q_Z], theta ) ; - q_normalize( destQuat, destQuat ) ; - } -} /* q_from_two_vecs */ - -/* converts quat to euler angles (yaw, pitch, roll). see - * q_col_matrix_to_euler() for conventions. Note that you - * cannot use Q_X, Q_Y, and Q_Z to pull the elements out of - * the Euler as if they were rotations about these angles -- - * this will invert X and Z. You need to instead use Q_YAW - * (rotation about Z), Q_PITCH (rotation about Y) and Q_ROLL - * (rotation about X) to get them. - */ -void q_to_euler(q_vec_type yawPitchRoll, const q_type q) -{ - q_matrix_type matrix; - - q_to_col_matrix(matrix, q); - q_col_matrix_to_euler(yawPitchRoll, ( const double (*)[4] ) matrix); -} - - -/***************************************************************************** - * - q_from_euler - converts 3 euler angles (in radians) to a quaternion - - angles are in radians; Assumes roll is rotation about X, pitch - is rotation about Y, yaw is about Z. Assumes order of - yaw, pitch, roll applied as follows: - - p' = roll( pitch( yaw(p) ) ) - - See comments for q_euler_to_col_matrix for more on this. - * - *****************************************************************************/ -void q_from_euler(q_type destQuat, double yaw, double pitch, double roll) -{ - double cosYaw, sinYaw, cosPitch, sinPitch, cosRoll, sinRoll; - double half_roll, half_pitch, half_yaw; - - - /* put angles into radians and divide by two, since all angles in formula - * are (angle/2) - */ - - half_yaw = yaw / 2.0; - half_pitch = pitch / 2.0; - half_roll = roll / 2.0; - - cosYaw = cos(half_yaw); - sinYaw = sin(half_yaw); - - cosPitch = cos(half_pitch); - sinPitch = sin(half_pitch); - - cosRoll = cos(half_roll); - sinRoll = sin(half_roll); - - - destQuat[X] = sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw; - destQuat[Y] = cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw; - destQuat[Z] = cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw; - - destQuat[W] = cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw; - -} /* q_from_euler */ - - - - - -/***************************************************************************** - * - q_to_row_matrix: Convert quaternion to 4x4 row-major rotation matrix. - Quaternion need not be unit magnitude. - * - *****************************************************************************/ -void q_to_row_matrix(q_matrix_type destMatrix, const q_type srcQuat) -{ - double s; - double xs, ys, zs, - wx, wy, wz, - xx, xy, xz, - yy, yz, zz; - - - /* - * For unit srcQuat, just set s = 2.0; or set xs = srcQuat[X] + - * srcQuat[X], etc. - */ - - s = 2.0 / (srcQuat[X]*srcQuat[X] + srcQuat[Y]*srcQuat[Y] + - srcQuat[Z]*srcQuat[Z] + srcQuat[W]*srcQuat[W]); - - xs = srcQuat[X] * s; ys = srcQuat[Y] * s; zs = srcQuat[Z] * s; - wx = srcQuat[W] * xs; wy = srcQuat[W] * ys; wz = srcQuat[W] * zs; - xx = srcQuat[X] * xs; xy = srcQuat[X] * ys; xz = srcQuat[X] * zs; - yy = srcQuat[Y] * ys; yz = srcQuat[Y] * zs; zz = srcQuat[Z] * zs; - - /* set up 4x4 destMatrixrix */ - destMatrix[X][X] = 1.0 - (yy + zz); - destMatrix[X][Y] = xy + wz; - destMatrix[X][Z] = xz - wy; - destMatrix[X][W] = 0.0; - - destMatrix[Y][X] = xy - wz; - destMatrix[Y][Y] = 1.0 - (xx + zz); - destMatrix[Y][Z] = yz + wx; - destMatrix[Y][W] = 0.0; - - destMatrix[Z][X] = xz + wy; - destMatrix[Z][Y] = yz - wx; - destMatrix[Z][Z] = 1.0 - (xx + yy); - destMatrix[Z][W] = 0.0; - - destMatrix[W][X] = 0.0; - destMatrix[W][Y] = 0.0; - destMatrix[W][Z] = 0.0; - destMatrix[W][W] = 1.0; - -} /* q_to_row_matrix */ - - - -/***************************************************************************** - * q_to_col_matrix: Convert quaternion to 4x4 column-major rotation matrix. - * Quaternion need not be unit magnitude. - *****************************************************************************/ -void q_to_col_matrix(q_matrix_type destMatrix, const q_type srcQuat) -{ - double s,xs,ys,zs,wx,wy,wz,xx,xy,xz,yy,yz,zz; - - - /* For unit srcQuat, just set s = 2.0; or set xs = srcQuat[X] + - * srcQuat[X], etc. - *****************************************************************************/ - s = 2.0 / (srcQuat[X]*srcQuat[X] + srcQuat[Y]*srcQuat[Y] + - srcQuat[Z]*srcQuat[Z] + srcQuat[W]*srcQuat[W]); - - xs = srcQuat[X] * s; ys = srcQuat[Y] * s; zs = srcQuat[Z] * s; - wx = srcQuat[W] * xs; wy = srcQuat[W] * ys; wz = srcQuat[W] * zs; - xx = srcQuat[X] * xs; xy = srcQuat[X] * ys; xz = srcQuat[X] * zs; - yy = srcQuat[Y] * ys; yz = srcQuat[Y] * zs; zz = srcQuat[Z] * zs; - - /* set up 4x4 destMatrixrix */ - destMatrix[X][X] = 1.0 - (yy + zz); - destMatrix[X][Y] = xy - wz; - destMatrix[X][Z] = xz + wy; - destMatrix[X][W] = 0.0; - - destMatrix[Y][X] = xy + wz; - destMatrix[Y][Y] = 1.0 - (xx + zz); - destMatrix[Y][Z] = yz - wx; - destMatrix[Y][W] = 0.0; - - destMatrix[Z][X] = xz - wy; - destMatrix[Z][Y] = yz + wx; - destMatrix[Z][Z] = 1.0 - (xx + yy); - destMatrix[Z][W] = 0.0; - - destMatrix[W][X] = 0.0; - destMatrix[W][Y] = 0.0; - destMatrix[W][Z] = 0.0; - destMatrix[W][W] = 1.0; - -} /* q_to_col_matrix */ - - - -/***************************************************************************** - * q_from_col_matrix- Convert 4x4 column-major rotation matrix - * to unit quaternion. - *****************************************************************************/ -void q_from_col_matrix(q_type destQuat, const q_matrix_type srcMatrix) -{ - double trace, s; - int i, j, k; - static int next[3] = {Y, Z, X}; - - - trace = srcMatrix[X][X] + srcMatrix[Y][Y] + srcMatrix[Z][Z]; - - if (trace > 0.0) - { - s = sqrt(trace + 1.0); - - destQuat[W] = s * 0.5; - - s = 0.5 / s; - - destQuat[X] = (srcMatrix[Z][Y] - srcMatrix[Y][Z]) * s; - destQuat[Y] = (srcMatrix[X][Z] - srcMatrix[Z][X]) * s; - destQuat[Z] = (srcMatrix[Y][X] - srcMatrix[X][Y]) * s; - } - - else - { - i = X; - if (srcMatrix[Y][Y] > srcMatrix[X][X]) - i = Y; - if (srcMatrix[Z][Z] > srcMatrix[i][i]) - i = Z; - j = next[i]; - k = next[j]; - - s = sqrt( (srcMatrix[i][i] - (srcMatrix[j][j]+srcMatrix[k][k])) + 1.0 ); - destQuat[i] = s * 0.5; - s = 0.5 / s; - - destQuat[W] = (srcMatrix[k][j] - srcMatrix[j][k]) * s; - destQuat[j] = (srcMatrix[j][i] + srcMatrix[i][j]) * s; - destQuat[k] = (srcMatrix[k][i] + srcMatrix[i][k]) * s; - } - -} /* q_from_col_matrix */ - - - -/***************************************************************************** - * - q_from_row_matrix: Convert 4x4 row-major rotation matrix to unit quaternion - * - *****************************************************************************/ -void q_from_row_matrix(q_type destQuat, const q_matrix_type srcMatrix) -{ - double trace, s; - int i, j, k; - static int next[3] = {Y, Z, X}; - - - trace = srcMatrix[X][X] + srcMatrix[Y][Y]+ srcMatrix[Z][Z]; - - if (trace > 0.0) - { - s = sqrt(trace + 1.0); - destQuat[W] = s * 0.5; - s = 0.5 / s; - - destQuat[X] = (srcMatrix[Y][Z] - srcMatrix[Z][Y]) * s; - destQuat[Y] = (srcMatrix[Z][X] - srcMatrix[X][Z]) * s; - destQuat[Z] = (srcMatrix[X][Y] - srcMatrix[Y][X]) * s; - } - - else - { - i = X; - if (srcMatrix[Y][Y] > srcMatrix[X][X]) - i = Y; - if (srcMatrix[Z][Z] > srcMatrix[i][i]) - i = Z; - j = next[i]; - k = next[j]; - - s = sqrt( (srcMatrix[i][i] - (srcMatrix[j][j]+srcMatrix[k][k])) + 1.0 ); - destQuat[i] = s * 0.5; - - s = 0.5 / s; - - destQuat[W] = (srcMatrix[j][k] - srcMatrix[k][j]) * s; - destQuat[j] = (srcMatrix[i][j] + srcMatrix[j][i]) * s; - destQuat[k] = (srcMatrix[i][k] + srcMatrix[k][i]) * s; - } - -} /* q_from_row_matrix */ - - - -/***************************************************************************** - * - qgl_to_matrix - convert from quat to GL 4x4 float row matrix - - notes: - - same as q_to_row_matrix, except base type is float, not double - * - *****************************************************************************/ -void qgl_to_matrix(qgl_matrix_type destMatrix, const q_type srcQuat) -{ - double s; - double xs, ys, zs, - wx, wy, wz, - xx, xy, xz, - yy, yz, zz; - - - /* - * For unit srcQuat, just set s = 2.0; or set xs = srcQuat[X] + - * srcQuat[X], etc. - */ - - s = 2.0 / (srcQuat[X]*srcQuat[X] + srcQuat[Y]*srcQuat[Y] + - srcQuat[Z]*srcQuat[Z] + srcQuat[W]*srcQuat[W]); - - xs = srcQuat[X] * s; ys = srcQuat[Y] * s; zs = srcQuat[Z] * s; - wx = srcQuat[W] * xs; wy = srcQuat[W] * ys; wz = srcQuat[W] * zs; - xx = srcQuat[X] * xs; xy = srcQuat[X] * ys; xz = srcQuat[X] * zs; - yy = srcQuat[Y] * ys; yz = srcQuat[Y] * zs; zz = srcQuat[Z] * zs; - - /* set up 4x4 destMatrixrix */ - destMatrix[X][X] = (float) (1.0 - (yy + zz)); - destMatrix[X][Y] = (float) (xy + wz); - destMatrix[X][Z] = (float) (xz - wy); - destMatrix[X][W] = 0.0; - - destMatrix[Y][X] = (float) (xy - wz); - destMatrix[Y][Y] = (float) (1.0 - (xx + zz)); - destMatrix[Y][Z] = (float) (yz + wx); - destMatrix[Y][W] = 0.0; - - destMatrix[Z][X] = (float) (xz + wy); - destMatrix[Z][Y] = (float) (yz - wx); - destMatrix[Z][Z] = (float) (1.0 - (xx + yy)); - destMatrix[Z][W] = 0.0; - - destMatrix[W][X] = 0.0; - destMatrix[W][Y] = 0.0; - destMatrix[W][Z] = 0.0; - destMatrix[W][W] = 1.0; - -} /* qgl_to_matrix */ - - -/***************************************************************************** - * - qgl_from_matrix: Convert GL 4x4 row-major - rotation matrix to unit quaternion. - - notes: - - same as q_from_row_matrix, except basic type is float, not double - * - *****************************************************************************/ -void qgl_from_matrix(q_type destQuat, const qgl_matrix_type srcMatrix) -{ - double trace, s; - int i, j, k; - static int next[3] = {Y, Z, X}; - - - trace = srcMatrix[X][X] + srcMatrix[Y][Y]+ srcMatrix[Z][Z]; - - if (trace > 0.0) - { - s = sqrt(trace + 1.0); - destQuat[W] = s * 0.5; - s = 0.5 / s; - - destQuat[X] = (srcMatrix[Y][Z] - srcMatrix[Z][Y]) * s; - destQuat[Y] = (srcMatrix[Z][X] - srcMatrix[X][Z]) * s; - destQuat[Z] = (srcMatrix[X][Y] - srcMatrix[Y][X]) * s; - } - - else - { - i = X; - if (srcMatrix[Y][Y] > srcMatrix[X][X]) - i = Y; - if (srcMatrix[Z][Z] > srcMatrix[i][i]) - i = Z; - j = next[i]; - k = next[j]; - - s = sqrt( (srcMatrix[i][i] - (srcMatrix[j][j]+srcMatrix[k][k])) + 1.0 ); - destQuat[i] = s * 0.5; - - s = 0.5 / s; - - destQuat[W] = (srcMatrix[j][k] - srcMatrix[k][j]) * s; - destQuat[j] = (srcMatrix[i][j] + srcMatrix[j][i]) * s; - destQuat[k] = (srcMatrix[i][k] + srcMatrix[k][i]) * s; - } - -} /* qgl_from_matrix */ - -/***************************************************************************** - * - q_from_ogl_matrix: Convert OpenGL matrix to quaternion - - notes: - - same as q_from_row_matrix, except matrix is single index - * - *****************************************************************************/ -void q_from_ogl_matrix(q_type destQuat, const qogl_matrix_type matrix ) -{ - double trace, s; - int i, j, k; - static int next[3] = { Y, Z, X }; - - trace = matrix[X*4+X] + matrix[Y*4+Y] + matrix[Z*4+Z]; - if( trace > 0.0 ) { - s = sqrt( trace + 1.0 ); - destQuat[ W ] = s * 0.5; - s = 0.5 / s; - - destQuat[ X ] = ( matrix[Y*4+Z] - matrix[Z*4+Y] ) * s; - destQuat[ Y ] = ( matrix[Z*4+X] - matrix[X*4+Z] ) * s; - destQuat[ Z ] = ( matrix[X*4+Y] - matrix[Y*4+X] ) * s; - } else { - i = X; - if( matrix[Y*4+Y] > matrix[X*4+X] ) - i = Y; - if( matrix[Z*4+Z] > matrix[i*4+i] ) - i = Z; - j = next[i]; - k = next[j]; - - s = sqrt(( matrix[i*4+i] - ( matrix[j*4+j] + matrix[k*4+k] )) + 1.0 ); - destQuat[i] = s * 0.5; - s = 0.5 / s; - - destQuat[W] = ( matrix[j*4+k] - matrix[k*4+j] ) * s; - destQuat[j] = ( matrix[i*4+j] + matrix[j*4+i] ) * s; - destQuat[k] = ( matrix[i*4+k] + matrix[k*4+i] ) * s; - } - -} /* q_from_ogl_matrix */ - -/***************************************************************************** - * - q_to_ogl_matrix: Convert quaternion to OpenGL matrix. - Quaternion need not be unit magnitude. - * - *****************************************************************************/ -void q_to_ogl_matrix(qogl_matrix_type matrix, const q_type srcQuat ) -{ - double s; - double xs, ys, zs, wx, wy, wz, xx, xy, xz, yy, yz, zz; - - /* For unit srcQuat, just set s = 2.0, or set xs = srcQuat[X] + - ** srcQuat[X], etc. - */ - s = 2.0 / ( srcQuat[X] * srcQuat[X] + srcQuat[Y] * srcQuat[Y] + - srcQuat[Z] * srcQuat[Z] + srcQuat[W] * srcQuat[W] ); - - xs = srcQuat[X] * s; ys = srcQuat[Y] * s; zs = srcQuat[Z] * s; - wx = srcQuat[W] * xs; wy = srcQuat[W] * ys; wz = srcQuat[W] * zs; - xx = srcQuat[X] * xs; xy = srcQuat[X] * ys; xz = srcQuat[X] * zs; - yy = srcQuat[Y] * ys; yz = srcQuat[Y] * zs; zz = srcQuat[Z] * zs; - - /* set up 4x4 matrix */ - matrix[X*4+X] = 1.0 - ( yy + zz ); - matrix[X*4+Y] = xy + wz; - matrix[X*4+Z] = xz - wy; - matrix[X*4+W] = 0.0; - - matrix[Y*4+X] = xy - wz; - matrix[Y*4+Y] = 1.0 - ( xx + zz ); - matrix[Y*4+Z] = yz + wx; - matrix[Y*4+W] = 0.0; - - matrix[Z*4+X] = xz + wy; - matrix[Z*4+Y] = yz - wx; - matrix[Z*4+Z] = 1.0 - ( xx + yy ); - matrix[Z*4+W] = 0.0; - - matrix[W*4+X] = 0.0; - matrix[W*4+Y] = 0.0; - matrix[W*4+Z] = 0.0; - matrix[W*4+W] = 1.0; - -} /* q_to_ogl_matrix */ diff --git a/src/vrpn/quat/quat.h b/src/vrpn/quat/quat.h deleted file mode 100644 index 8fb2615013687ab548153e1e80cb57962ce9cc8a..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/quat.h +++ /dev/null @@ -1,546 +0,0 @@ - -/***************************************************************************** - * - quat.h - include file for quaternion, vector and matrix routines. - - - Overview: - - quatlib is a library of routines that implements a grab-bag of - useful routines for dealing with quaternions, vectors, and - matrices. See the quatlib man page for an overview. - - - Notes: - - - to address the quaternion elements, use the Q_X, Q_Y, Q_Z and Q_W - #defines from this file. - - - to find out which version of the library you're using, do: - - % ident <path>/libquat.a - - (this information is in the rcsid string in quat.c) - - - see /afs/unc/proj/hmd/src/quat/{quat,vector,matrix}.c - for implementation details. - - - Conventions: - - - general-purpose quaternion routines start with q_ - - - all non-integer values are doubles by default- the exceptions - to this are old (non-open-) GL routines which use floats. - - - vector routines start with "q_vec" - - - matrix routines have the string "matrix" somewhere in their name - - - all matrices are 4x4 - - - positive rotation directions are as follows: - - about Z axis: from X axis to Y axis - about X axis: from Y axis to Z axis - about Y axis: from Z axis to X axis - - - all angles are specified in radians - - - destination parameter (if any) is always first argument (as in - Unix string routines) - - - src and dest parameters can always be the same, as long as they - are of the same type (copying is done if necessary) - - - naming conventions for conversion routines: - - q_{to,from}_whatever for routines involving quaternions - q_x_to_y for all others (ie., no "from" is used) - - - Revision History (for whole library, not just this file): - - Author Date Comments - ------ -------- ---------------------------- - Rich Holloway 09/10/01 Misc cleanup, deleted PPHIGS support, - added q_xyz_quat_xform(), renamed - qogl_matrix_mult_fixed() back to - qogl_matrix_mult(). - Mark Livingston 01/09/96 Added routines for OpenGL matrices - Rich Holloway 09/27/93 Added Gary Bishop's matrix to euler rtn - Rich Holloway 07/16/92 Added q_euler_to_col_matrix(), routines - for working with GL matrices, added - documentation for euler angle routines - Erik Erikson/ 06/26/92 Added q_xyz_quat_compose - Stefan Gottschalk/ - Russ Taylor - - Rich Holloway 05/13/92 Added Q_NULL_VECTOR, Q_ID_MATRIX - Jon Leech/ 04/29/92 Added CM_ prototypes - Erik Erikson - - Rich Holloway 09/21/90 Made into library, made all matrices 4x4, - added matrix routines for - 4x4 (standard) or 3x4 (for PPHIGS), - changed names of - routines (to avoid name conflicts with - non-library routines) by prefixing - everything with "q_". - - Russ Taylor 1990 Modified q_slerp to pick shortest path - between two angles - - Warren Robinett 12/89 Added PPHIGS support routines - - Ken Shoemake 1985 Initial version - - RCS Header: - $Id: quat.h,v 2.37 2004/07/22 20:54:42 taylorr Exp $ - * - *****************************************************************************/ - -/* prevent multiple includes */ -#ifndef Q_INCLUDED -#define Q_INCLUDED - - -/***************************************************************************** - * - #defines - * - *****************************************************************************/ - -/* for accessing the elements of q_type and q_vec_type */ -#define Q_X 0 -#define Q_Y 1 -#define Q_Z 2 -#define Q_W 3 - -/* For accessing the elements of a q_vec_type describing Euler angles */ -#define Q_YAW 0 -#define Q_PITCH 1 -#define Q_ROLL 2 - -/* tolerance for quaternion operations */ -#define Q_EPSILON (1e-10) - -/* min and max macros */ -#define Q_MAX(x, y) ( ((x) > (y)) ? (x) : (y) ) -#define Q_MIN(x, y) ( ((x) < (y)) ? (x) : (y) ) - -#define Q_ABS(x) ( ((x) > 0 ) ? (x) : (-(x)) ) - -/* - * use local definition of PI for machines that have no def in math.h; this - * value stolen from DEC Ultrix 4.1 math.h - */ -#define Q_PI 3.14159265358979323846 - -#define Q_ID_QUAT { 0.0, 0.0, 0.0, 1.0 } - -#define Q_ID_MATRIX { {1.0, 0.0, 0.0, 0.0}, \ - {0.0, 1.0, 0.0, 0.0}, \ - {0.0, 0.0, 1.0, 0.0}, \ - {0.0, 0.0, 0.0, 1.0} } - -#define Q_NULL_VECTOR { 0.0, 0.0, 0.0 } - -/* - * degree/radian conversion - */ -#define Q_DEG_TO_RAD(deg) ( ((deg)*Q_PI)/180.0 ) -#define Q_RAD_TO_DEG(rad) ( (((rad)*180.0)/Q_PI) ) - - -/***************************************************************************** - * - typedefs - * - *****************************************************************************/ - -/* basic quaternion type- scalar part is last element in array */ -typedef double q_type[4]; - -/* basic vector type */ -typedef double q_vec_type[3]; - -/* for row and column matrices */ -typedef double q_matrix_type[4][4]; - -/* for working with gl or other 4x4 float matrices */ -typedef float qgl_matrix_type[4][4]; - -/* for working with OpenGL matrices - these are really just like row matrices -** (i.e. same bits in same order), but the decl is a 1-D array, not 2-D, sigh -*/ -typedef double qogl_matrix_type[16]; - -/* special transformation type using quaternions and vectors */ -typedef struct q_xyz_quat_struct { - q_vec_type xyz; /* translation */ - q_type quat; /* rotation */ -} q_xyz_quat_type; - - - -/***************************************************************************** - ***************************************************************************** - * - function declarations - * - ***************************************************************************** - *****************************************************************************/ - -/* On some platforms, we need to specifically tell the compiler - * that these functions are to have C linkage. [why not everywhere?] - */ - -#if defined(__cplusplus) - -#ifdef FLOW -#define EXTERN_QUALIFICATION -#else -#define EXTERN_QUALIFICATION "C" -#endif /* FLOW */ - -#define BEGIN_EXTERN_BLOCK extern EXTERN_QUALIFICATION { -#define END_EXTERN_BLOCK } - -#else /* __cplusplus */ - -#define BEGIN_EXTERN_BLOCK -#define END_EXTERN_BLOCK - -#endif /* __cplusplus */ - - - -BEGIN_EXTERN_BLOCK - -/***************************************************************************** - * - strictly quaternion operations - * - *****************************************************************************/ - -/* prints a quaternion */ -void q_print (const q_type quat); - -/* make a quaternion given an axis and an angle; x,y,z is axis of - * rotation; angle is angle of rotation in radians (see also q_from_two_vecs) - * - * rotation is counter-clockwise when rotation axis vector is - * pointing at you - * - * if angle or vector are 0, the identity quaternion is returned. - */ -void q_make (q_type destQuat, - double x, double y, double z, - double angle); -void q_from_axis_angle(q_type destQuat, - double x, double y, double z, - double angle); - -/* Turn a quaternion into an axis and an angle; x,y,z is axis of - * rotation; angle is angle of rotation in radians. - * - * rotation is counter-clockwise when rotation axis vector is - * pointing at you - * - * if the identity quaternion is passed in, the angle will be - * zero and the axis will be the Z axis. - */ -void q_to_axis_angle (double *x, double *y, double *z, double *angle, - const q_type srcQuat); - -/* copy srcQuat to destQuat */ -void q_copy (q_type destQuat, const q_type srcQuat); - -/* normalizes quaternion; src and dest can be same */ -void q_normalize (q_type destQuat, const q_type srcQuat); - -/* invert quat; src and dest can be the same */ -void q_invert (q_type destQuat, const q_type srcQuat); - -/* - * computes quaternion product destQuat = qLeft * qRight. - * destQuat can be same as either qLeft or qRight or both. - */ -void q_mult (q_type destQuat, const q_type qLeft, const q_type qRight); - -/* conjugate quat; src and dest can be same */ -void q_conjugate (q_type destQuat, const q_type srcQuat); - -/* take natural log of unit quat; src and dest can be same */ -void q_log (q_type destQuat, const q_type srcQuat); - -/* exponentiate quaternion, assuming scalar part 0. src can be same as dest */ -void q_exp (q_type destQuat, const q_type srcQuat); - - -/* - * q_slerp: Spherical linear interpolation of unit quaternions. - * - * As t goes from 0 to 1, destQuat goes from startQ to endQuat. - * This routine should always return a point along the shorter - * of the two paths between the two. That is why the vector may be - * negated in the end. - * - * src == dest should be ok, although that doesn't seem to make much - * sense here. - */ -void q_slerp (q_type destQuat, const q_type startQuat, const q_type endQuat, double t); - -/***************************************************************************** - * - q_from_euler - converts 3 euler angles (in radians) to a quaternion - - Assumes roll is rotation about X, pitch - is rotation about Y, yaw is about Z. Assumes order of - yaw, pitch, roll applied as follows: - - p' = roll( pitch( yaw(p) ) ) - - See comments for q_euler_to_col_matrix for more on this. - * - *****************************************************************************/ -void q_from_euler (q_type destQuat, double yaw, double pitch, double roll); - -/* converts quat to euler angles (yaw, pitch, roll). see - * q_col_matrix_to_euler() for conventions. Note that you - * cannot use Q_X, Q_Y, and Q_Z to pull the elements out of - * the Euler as if they were rotations about these angles -- - * this will invert X and Z. You need to instead use Q_YAW - * (rotation about Z), Q_PITCH (rotation about Y) and Q_ROLL - * (rotation about X) to get them. - */ -void q_to_euler(q_vec_type yawPitchRoll, const q_type q); - -/***************************************************************************** - * - mixed quaternion operations: conversions to and from vectors & matrices - * - *****************************************************************************/ - -/* destVec = q * vec * q(inverse); vec can be same storage as destVec */ -void q_xform (q_vec_type destVec, const q_type q, const q_vec_type vec); - -/* quat/vector conversion */ -/* create a quaternion from two vectors that rotates v1 to v2 - * about an axis perpendicular to both - */ -void q_from_two_vecs (q_type destQuat, const q_vec_type v1, const q_vec_type v2); - -/* simple conversion */ -void q_from_vec (q_type destQuat, const q_vec_type srcVec); -void q_to_vec (q_vec_type destVec, const q_type srcQuat); - -/* quaternion/4x4 matrix conversions */ -void q_from_row_matrix (q_type destQuat, const q_matrix_type matrix); -void q_from_col_matrix (q_type destQuat, const q_matrix_type matrix); -void q_to_row_matrix (q_matrix_type destMatrix, const q_type srcQuat); -void q_to_col_matrix (q_matrix_type destMatrix, const q_type srcQuat); - -/* quat/ogl conversion */ -void q_from_ogl_matrix (q_type destQuat, const qogl_matrix_type matrix); -void q_to_ogl_matrix (qogl_matrix_type matrix, const q_type srcQuat); - - -/***************************************************************************** - * - strictly vector operations - * - *****************************************************************************/ - -/* prints a vector to stdout */ -void q_vec_print (const q_vec_type vec); - -/* compatibility w/ old */ -#define q_set_vec q_vec_set - -/* sets vector equal to 3 values given */ -void q_vec_set (q_vec_type vec, double x, double y, double z); - -/* copies srcVec to destVec */ -void q_vec_copy (q_vec_type destVec, const q_vec_type srcVec); - -/* adds two vectors */ -void q_vec_add (q_vec_type destVec, const q_vec_type aVec, const q_vec_type bVec); - -/* destVec = v1 - v2 (v1, v2, destVec need not be distinct storage) */ -void q_vec_subtract (q_vec_type destVec, const q_vec_type v1, const q_vec_type v2); - -/* returns value of dot product of v1 and v2 */ -double q_vec_dot_product (const q_vec_type v1, const q_vec_type v2); - -/* scale a vector (src and dest need not be distinct) */ -void q_vec_scale (q_vec_type destVec, double scaleFactor, const q_vec_type srcVec); - - -/* negate a vector to point in the opposite direction */ -void q_vec_invert (q_vec_type destVec, const q_vec_type srcVec); - -/* normalize a vector (destVec and srcVec may be the same) */ -void q_vec_normalize (q_vec_type destVec, const q_vec_type srcVec); - -/* returns magnitude of vector */ -double q_vec_magnitude (const q_vec_type vec); - -/* returns distance between two points/vectors */ -double q_vec_distance (const q_vec_type vec1, const q_vec_type vec2); - -/* computes cross product of two vectors: destVec = aVec X bVec - * destVec same as aVec or bVec ok */ -void q_vec_cross_product (q_vec_type destVec, - const q_vec_type aVec, const q_vec_type bVec); - - -/***************************************************************************** - * - strictly matrix operations - * - *****************************************************************************/ - -/* q_matrix_copy - copies srcMatrix to destMatrix (both matrices are 4x4) */ -void q_matrix_copy (q_matrix_type destMatrix, const q_matrix_type srcMatrix); - -void qogl_matrix_copy (qogl_matrix_type dest, const qogl_matrix_type src); - -/* does a 4x4 matrix multiply (the input matrices are 4x4) and - * puts the result in a 4x4 matrix. src == dest ok. - */ -void q_matrix_mult (q_matrix_type resultMatrix, - const q_matrix_type leftMatrix, - const q_matrix_type rightMatrix); - -// for backward compatibility -#define qogl_matrix_mult_fixed qogl_matrix_mult - -/* - * Computes result=left*right - * Used to be called qogl_matrix_mult_fixed because the old version - * did not compute the correct result. - */ -void qogl_matrix_mult (qogl_matrix_type result, - const qogl_matrix_type left, - const qogl_matrix_type right); - - -/***************************************************************************** - * - q_euler_to_col_matrix - euler angles should be in radians - computed assuming the order of rotation is: yaw, pitch, roll. - - This means the following: - - p' = roll( pitch( yaw(p) ) ) - - or - - p' = Mr * Mp * My * p - - Yaw is rotation about Z axis, pitch is rotation about Y axis, and roll - is rotation about X axis. In terms of these axes, then, the process is: - - p' = Mx * My * Mz * p - - where Mx = the standard Foley and van Dam column matrix for rotation - about the X axis, and similarly for Y and Z. - - Thus the calling sequence in terms of X, Y, Z is: - - q_euler_to_col_matrix(destMatrix, zRot, yRot, xRot); - * - *****************************************************************************/ -void q_euler_to_col_matrix (q_matrix_type destMatrix, - double yaw, double pitch, double roll); - -/***************************************************************************** - * - q_col_matrix_to_euler- convert a column matrix to euler angles - - input: - - vector to hold euler angles - - src column matrix - - output: - - euler angles in radians in the range -pi to pi; - vec[0] = yaw, vec[1] = pitch, vec[2] = roll - yaw is rotation about Z axis, pitch is about Y, roll -> X rot. - - notes: - - written by Gary Bishop - - you cannot use Q_X, Q_Y, and Q_Z to pull the elements out of - the Euler as if they were rotations about these angles -- - this will invert X and Z. You need to instead use Q_YAW - (rotation about Z), Q_PITCH (rotation about Y) and Q_ROLL - (rotation about X) to get them. - * - *****************************************************************************/ -void q_col_matrix_to_euler (q_vec_type yawpitchroll, const q_matrix_type colMatrix); - -/* prints 4x4 matrix */ -void q_print_matrix (const q_matrix_type matrix); - -void qogl_print_matrix (const qogl_matrix_type); - - -/***************************************************************************** - * - xyz_quat routines - * - *****************************************************************************/ - -/* invert a vector/quaternion transformation pair */ -void q_xyz_quat_invert (q_xyz_quat_type *destPtr, const q_xyz_quat_type *srcPtr); - - -/* converts a row matrix to an xyz_quat */ -void q_row_matrix_to_xyz_quat (q_xyz_quat_type * xyzQuatPtr, - const q_matrix_type rowMatrix); - -/* convert an xyz_quat to a row matrix */ -void q_xyz_quat_to_row_matrix (q_matrix_type rowMatrix, - const q_xyz_quat_type * xyzQuatPtr); - -void q_ogl_matrix_to_xyz_quat (q_xyz_quat_type * xyzQuatPtr, - const qogl_matrix_type matrix); - -void q_xyz_quat_to_ogl_matrix (qogl_matrix_type matrix, - const q_xyz_quat_type * xyzQuatPtr); - -/* compose q_xyz_quat_vecs to form a third. */ -/* C_from_A_ptr may be = to either C_from_B_ptr or B_from_A_ptr (or both) */ -void q_xyz_quat_compose (q_xyz_quat_type * C_from_A_ptr, - const q_xyz_quat_type * C_from_B_ptr, - const q_xyz_quat_type * B_from_A_ptr); - -void q_xyz_quat_xform(q_vec_type dest, const q_xyz_quat_type *xf, const q_vec_type src); - -/***************************************************************************** - * - GL support - * - *****************************************************************************/ - -/* convert from quat to GL 4x4 float row matrix */ -void qgl_to_matrix (qgl_matrix_type destMatrix, const q_type srcQuat); - - -/* qgl_from_matrix- Convert GL 4x4 row-major rotation matrix to - * unit quaternion. - * - same as q_from_row_matrix, except basic type is float, not double - */ -void qgl_from_matrix (q_type destQuat, const qgl_matrix_type srcMatrix); - -/* print gl-style matrix */ -void qgl_print_matrix (const qgl_matrix_type matrix); - -END_EXTERN_BLOCK - -#undef BEGIN_EXTERN_BLOCK -#undef END_EXTERN_BLOCK -#undef EXTERN_QUALIFICATION - -#endif /* Q_INCLUDED */ diff --git a/src/vrpn/quat/quatlib.dsp b/src/vrpn/quat/quatlib.dsp deleted file mode 100644 index 8fa96969ad6a9f1a5c5c1f59b84c0e861cd17ba9..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/quatlib.dsp +++ /dev/null @@ -1,104 +0,0 @@ -# Microsoft Developer Studio Project File - Name="quatlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=quatlib - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "quatlib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "quatlib.mak" CFG="quatlib - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "quatlib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "quatlib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 1 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "quatlib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "pc_win32\Release" -# PROP Intermediate_Dir "pc_win32\Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"pc_win32\Release\quat.lib" - -!ELSEIF "$(CFG)" == "quatlib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "pc_win32\Debug" -# PROP Intermediate_Dir "pc_win32\Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"pc_win32\Debug\quat.lib" - -!ENDIF - -# Begin Target - -# Name "quatlib - Win32 Release" -# Name "quatlib - Win32 Debug" -# Begin Source File - -SOURCE=matrix.c -# End Source File -# Begin Source File - -SOURCE=quat.c -# End Source File -# Begin Source File - -SOURCE=quat.h -# End Source File -# Begin Source File - -SOURCE=vector.c -# End Source File -# Begin Source File - -SOURCE=xyzquat.c -# End Source File -# End Target -# End Project diff --git a/src/vrpn/quat/quatlib.dsw b/src/vrpn/quat/quatlib.dsw deleted file mode 100644 index 117ed107a614127ddfdc68fdc8fbeb7763ca757a..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/quatlib.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "quatlib"=.\quatlib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/vrpn/quat/quatlib.sln b/src/vrpn/quat/quatlib.sln deleted file mode 100644 index ca6257f7cdcfbb59225d3b5bad5eea34386f6b6a..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/quatlib.sln +++ /dev/null @@ -1,29 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quatlib", "quatlib.vcproj", "{0C16E98C-A372-4E58-990D-EE276B32644E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xform_to_components", "testapps\xform_to_components.vcproj", "{CDE91DDD-1BFC-4BF0-B5E6-611C9AED47D0}" - ProjectSection(ProjectDependencies) = postProject - {0C16E98C-A372-4E58-990D-EE276B32644E} = {0C16E98C-A372-4E58-990D-EE276B32644E} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0C16E98C-A372-4E58-990D-EE276B32644E}.Debug|Win32.ActiveCfg = Debug|Win32 - {0C16E98C-A372-4E58-990D-EE276B32644E}.Debug|Win32.Build.0 = Debug|Win32 - {0C16E98C-A372-4E58-990D-EE276B32644E}.Release|Win32.ActiveCfg = Release|Win32 - {0C16E98C-A372-4E58-990D-EE276B32644E}.Release|Win32.Build.0 = Release|Win32 - {CDE91DDD-1BFC-4BF0-B5E6-611C9AED47D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {CDE91DDD-1BFC-4BF0-B5E6-611C9AED47D0}.Debug|Win32.Build.0 = Debug|Win32 - {CDE91DDD-1BFC-4BF0-B5E6-611C9AED47D0}.Release|Win32.ActiveCfg = Release|Win32 - {CDE91DDD-1BFC-4BF0-B5E6-611C9AED47D0}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/vrpn/quat/quatlib.vcproj b/src/vrpn/quat/quatlib.vcproj deleted file mode 100644 index 07a0ce4d073f0430d51e075924a7ee86039764f0..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/quatlib.vcproj +++ /dev/null @@ -1,251 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="quatlib" - ProjectGUID="{0C16E98C-A372-4E58-990D-EE276B32644E}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\pc_win32\Debug" - IntermediateDirectory=".\pc_win32\Debug" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\pc_win32\Debug/quatlib.pch" - AssemblerListingLocation=".\pc_win32\Debug/" - ObjectFile=".\pc_win32\Debug/" - ProgramDataBaseFileName=".\pc_win32\Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="pc_win32\Debug\quat.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32\Debug/quatlib.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\pc_win32\Release" - IntermediateDirectory=".\pc_win32\Release" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\pc_win32\Release/quatlib.pch" - AssemblerListingLocation=".\pc_win32\Release/" - ObjectFile=".\pc_win32\Release/" - ProgramDataBaseFileName=".\pc_win32\Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="pc_win32\Release\quat.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32\Release/quatlib.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <File - RelativePath="matrix.c" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="quat.c" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="quat.h" - > - </File> - <File - RelativePath="vector.c" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="xyzquat.c" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/quat/testapps/CMakeLists.txt b/src/vrpn/quat/testapps/CMakeLists.txt deleted file mode 100644 index 551cbb1273d30c3b2b8e1ccd754d23c1ad74dd9b..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/testapps/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# Build the testapps if required -option(QUATLIB_BUILD_EXAMPLES "Enable to build quatlib examples" OFF) - -if(QUATLIB_BUILD_EXAMPLES) - # Include directory needed by all of the files - include_directories(${quatlib_SOURCE_DIR}) - set(TESTAPPS - eul - matrix_to_posquat - qmake - qmult - qxform - timer) - - - foreach(APP ${TESTAPPS}) - add_executable(quat_${APP} ${APP}.c) - target_link_libraries(quat_${APP} quat) - - if(WIN32) # MS-Windows, both 32 and 64 bits - # nothing here yet - elseif(APPLE) # Apple - target_link_libraries(quat_${APP} m) # Math library - elseif(UNIX) # other UNIXes - target_link_libraries(quat_${APP} m) # Math library - endif() - - endforeach() - -endif() diff --git a/src/vrpn/quat/testapps/eul.c b/src/vrpn/quat/testapps/eul.c deleted file mode 100644 index b7d33524cece9bdcd67e5648043c503e7fb7698c..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/testapps/eul.c +++ /dev/null @@ -1,73 +0,0 @@ - - -/***************************************************************************** - * - eul.c - convert from euler angles to quaternion - - gary bishop 01/24/92 - added q_col_matrix_to_euler() test - rich holloway 10/15/90 - first version - - * - *****************************************************************************/ - -#ifdef _MSC_VER -#pragma warning( disable : 4996 ) // Don't complain about scanf -#endif - -#include <stdio.h> -#include "quat.h" - -int -main(int argc, char *argv[]) -{ - - q_type q; - double yaw, pitch, roll; - q_matrix_type matrix, matrix2; - q_vec_type yawPitchRoll; - - -/* - * read in euler angles - */ -while (1) - { - printf("\nEnter euler angles in degrees: (yaw, pitch, roll) "); - scanf("%lf %lf %lf", &yaw, &pitch, &roll); - yaw *= Q_PI/180; - pitch *= Q_PI/180; - roll *= Q_PI/180; - - /* matrix from euler */ - q_euler_to_col_matrix(matrix, yaw, pitch, roll); - printf("Col Matrix directly:\n"); - q_print_matrix(matrix); - - /* q from euler */ - q_from_euler(q, yaw, pitch, roll); - printf("q :\n"); - q_print(q); - - /* matrix of q */ - q_to_col_matrix(matrix, q); - printf("Col Matrix from q:\n"); - q_print_matrix(matrix); - - q_col_matrix_to_euler(yawPitchRoll, matrix); - - printf("euler angles from matrix\n"); - printf("%g %g %g\n", 180*yawPitchRoll[0]/Q_PI, - 180*yawPitchRoll[1]/Q_PI, 180*yawPitchRoll[2]/Q_PI); - - q_euler_to_col_matrix(matrix2, yawPitchRoll[0], - yawPitchRoll[1], yawPitchRoll[2]); - printf("matrix from euler\n"); - q_print_matrix(matrix2); - } - -} /* main */ - - - - - diff --git a/src/vrpn/quat/testapps/matrix_to_posquat.c b/src/vrpn/quat/testapps/matrix_to_posquat.c deleted file mode 100644 index 2a5384e42b362257fc931d195c8daf27a735e46c..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/testapps/matrix_to_posquat.c +++ /dev/null @@ -1,52 +0,0 @@ -/***************************************************************************** - * - matrix_to_posquat.c - convert from matrix to position and quaternion - - * - *****************************************************************************/ - -#include <stdio.h> -#include "quat.h" - -int main(int argc, char *argv[]) -{ - /* Set the matrix values directly. Ugly but true. */ - q_matrix_type col_matrix = { {-0.999848, 0.002700, -0.017242, 0.001715}, - { 0, -0.987960, -0.154710, -0.207295}, - {-0.017452, -0.154687, 0.987809, -0.098239}, - { 0, 0, 0, 1} }; -/* - q_matrix_type col_matrix = { { 0.999848, -0.002700, 0.017242, -0.001715}, - { 0, 0.987960, 0.154710, 0.207295}, - {-0.017452, -0.154687, 0.987809, -0.098239}, - { 0, 0, 0, 1} }; -*/ - q_matrix_type row_matrix; - q_xyz_quat_type q; - q_xyz_quat_type q_inverse; - - /* Transpose the column matrix into a row matrix */ - unsigned i,j; - for (i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { - row_matrix[i][j] = col_matrix[j][i]; - } - } - - printf("Row Matrix directly:\n"); - q_print_matrix(row_matrix); - - /* Convert to pos/quat and print. */ - q_row_matrix_to_xyz_quat(&q, row_matrix); - printf("XYZ Quat:\n"); - q_vec_print(q.xyz); - q_print(q.quat); - - /* Invert the result and print that. */ - printf("XYZ Quat inverse:\n"); - q_xyz_quat_invert(&q_inverse, &q); - q_vec_print(q_inverse.xyz); - q_print(q_inverse.quat); - -} /* main */ - diff --git a/src/vrpn/quat/testapps/qmake.c b/src/vrpn/quat/testapps/qmake.c deleted file mode 100644 index b29b87bb7cc6998203ae2fb1562615d54c7c3b9d..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/testapps/qmake.c +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************** - * - qmake.c - make a quaternion from an axis & angle; show result as - quat and matrix - - Session: - - - Enter axis - - Enter angle in degrees - - Show resulting quat as col matrix and quaternion - - rich holloway, 4/8/91 - * - *****************************************************************************/ - -#ifdef _MSC_VER -#pragma warning( disable : 4996 ) // Don't complain about scanf -#endif - -#include <stdio.h> -#include "quat.h" - -int -main(argc, argv) - - short argc; -char *argv[]; - -{ - - q_vec_type axis; - double angle; - - q_type resultQuat; - - q_matrix_type resultMatrix; - - /* - * read in vector and angle - */ - printf("\nEnter vector (x, y, z) followed by angle (in degrees): "); - scanf("%lf %lf %lf %lf", - &axis[0], &axis[1], &axis[2], &angle); - - q_make(resultQuat, axis[Q_X], axis[Q_Y], axis[Q_Z], Q_DEG_TO_RAD(angle)); - - printf("Result quaternion:\n"); - q_print(resultQuat); - - /* - * matrix of product quat - */ - q_to_col_matrix(resultMatrix, resultQuat); - printf("Equivalent column matrix:\n"); - q_print_matrix(resultMatrix); - - return 0; - -} /* main */ - diff --git a/src/vrpn/quat/testapps/qmult.c b/src/vrpn/quat/testapps/qmult.c deleted file mode 100644 index 34796fce7ae9ae603f3c160c36393a05ad7ea51e..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/testapps/qmult.c +++ /dev/null @@ -1,81 +0,0 @@ -/***************************************************************************** - * - qmult.c - multiplies two quaternions and shows result as a matrix and - a quat - - Session: - - - Enter 2 quaternions [(x, y, z), w] (no punctuation) - - Both are normalized and echoed - - Multiply 2 quats and print - - Print matrix for product - - rich holloway, 9/25/90 - - * - *****************************************************************************/ - -#ifdef _MSC_VER -#pragma warning( disable : 4996 ) // Don't complain about scanf -#endif - -#include <stdio.h> -#include "quat.h" - -int -main(argc, argv) - - short argc; -char *argv[]; - -{ - - q_type multQuat; - q_type candQuat; - q_type invertedQuat; - q_type productQuat; - - double matrix[4][4]; - - /* - * read in, echo, and normalize 2 quaternions - */ - printf("\nEnter multiplier: (vec, s) "); - scanf("%lf %lf %lf %lf", - &multQuat[0], &multQuat[1], &multQuat[2], &multQuat[3]); - q_normalize(multQuat, multQuat); - printf("Multiplier quat = \n"); - q_print(multQuat); - - /* get and normalize inverse of 1st quaternion */ - q_invert(invertedQuat, multQuat); - q_normalize(invertedQuat, invertedQuat); - printf("Inverse = \n"); - q_print(invertedQuat); - - printf("Enter multiplicand: "); - scanf("%lf %lf %lf %lf", - &candQuat[0], &candQuat[1], &candQuat[2], &candQuat[3]); - q_normalize(candQuat, candQuat); - printf("Multiplicand quat = \n"); - q_print(candQuat); - - /* - * productQuat = multQuat * candQuat - */ - q_mult(productQuat, multQuat, candQuat); - q_normalize(productQuat, productQuat); - printf("Product = \n"); - q_print(productQuat); - - /* - * matrix of product quat - */ - q_to_col_matrix(matrix, productQuat); - printf("Matrix:\n"); - q_print_matrix(matrix); - - return(0); - -} /* main */ - diff --git a/src/vrpn/quat/testapps/qxform.c b/src/vrpn/quat/testapps/qxform.c deleted file mode 100644 index 70e3e56984e4b12fc37035f0c41329bc26f9539b..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/testapps/qxform.c +++ /dev/null @@ -1,65 +0,0 @@ -/***************************************************************************** - * - qxform.c - does xform of a vector - - Session: - - - Enter quaternion [(x, y, z), w] (no punctuation) - - Enter vector to be xformed - - Show quat as col matrix - - Xform vector and print result - - rich holloway, 9/25/90 - - * - *****************************************************************************/ - - -#ifdef _MSC_VER -#pragma warning( disable : 4996 ) // Don't complain about scanf -#endif - -#include <stdio.h> -#include "quat.h" - -int -main(int argc, char *argv[]) -{ - - q_type multQuat; - q_type xformedPoint; - q_type point; - - double matrix[4][4]; - - /* - * read in, echo, and normalize 2 quaternions - */ - printf("\nEnter xform quaternion: (vec, s) "); - scanf("%lf %lf %lf %lf", - &multQuat[0], &multQuat[1], &multQuat[2], &multQuat[3]); - - printf("\nEnter point: (x y z) "); - scanf("%lf %lf %lf", - &point[Q_X], &point[Q_Y], &point[Q_Z]); - point[Q_W] = 0.0; - - /* - * matrix of product quat - */ - q_to_col_matrix(matrix, multQuat); - printf("Transformation (column) matrix:\n"); - q_print_matrix(matrix); - - /* - * xformedPoint = (multQuat * candQuat) * invertedQuat - */ - q_xform(xformedPoint, multQuat, point); - - printf("Xform Result:\n"); - q_print(xformedPoint); - - return(0); - -} /* main */ - diff --git a/src/vrpn/quat/testapps/test_xform_to_components.txt b/src/vrpn/quat/testapps/test_xform_to_components.txt deleted file mode 100644 index 119b09b13717c7c396075c6ff908f61a83305794..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/testapps/test_xform_to_components.txt +++ /dev/null @@ -1,5 +0,0 @@ -Rotate_90_around_Z_xlate_2_in_Z_scale_3_in_Z -0 -1 0 0 -1 0 0 0 -0 0 3 2 -0 0 0 1 \ No newline at end of file diff --git a/src/vrpn/quat/testapps/timer.c b/src/vrpn/quat/testapps/timer.c deleted file mode 100644 index 2e05805817f97fdddb4f21fc81196bd2071bdf11..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/testapps/timer.c +++ /dev/null @@ -1,65 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include "quat.h" - -int -main(argc, argv) - - short argc; - char *argv[]; - -{ - - int i, j; - int numCycles; - - static q_type quat; - static q_matrix_type matrix = - { 0.475299, 0.278958, 0.834430, 0.000000 , - 0.314176, 0.832064 -0.457125, 0.000000 , - -0.821818, 0.479428, 0.307837, 0.000000 , - 0.000000, 0.000000, 0.000000, 1.000000 }; - - static q_xyz_quat_type xyzQuat = { {44.6, 99999, -889.9}, - {78.9, .3, -322, 1} }; - - - printf("starting...\n"); - - /* parse command line */ - for ( i = 1; i < argc; i++ ) - { - /* command line flags */ - if ( argv[i][0] == '-' ) - { - switch ( argv[i][1] ) - { - case 'c': - /* numeric arg follows */ - i++; - numCycles = atoi(argv[i]); - printf("%d cycles\n", numCycles); - break; - default: - /* bogus flag value */ - fprintf(stderr, "Bogus argument: '%s'\n", argv[i] ); - exit(-1); - } - } - else - { - fprintf(stderr, "bogus arg '%s'\n", argv[i]); - } - } - - for ( i = 0; i < numCycles; i++ ) - { - j = i; - q_xyz_quat_to_row_matrix(matrix, &xyzQuat); - } - - printf("done, j = %d.\n", j); - - return(0); - -} /* main */ diff --git a/src/vrpn/quat/testapps/xform_to_components.c b/src/vrpn/quat/testapps/xform_to_components.c deleted file mode 100644 index 51fbfbff52be4936ce0fc04e024b6962a55781ac..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/testapps/xform_to_components.c +++ /dev/null @@ -1,124 +0,0 @@ -/***************************************************************************** - * - xform_to_components.c - convert from matrix to position, Euler rotation, scale. - Input file has a first header line that is ignored, followed by four lines - that are a 4x4 column matrix. - - * - *****************************************************************************/ - -#include <stdio.h> -#include <fcntl.h> -#include <stdlib.h> -#include "quat.h" - -#define DEGREES_PER_RADIAN (180 / acos(-1)) - -void Usage(const char *name) -{ - fprintf(stderr,"Usage: %s INPUT_FILE_NAME\n", name); - exit(-1); -} - -int main(int argc, char *argv[]) -{ - unsigned i; - q_matrix_type row_matrix; - double sx, sy, sz; /* Scale in X, Y, and Z */ - q_xyz_quat_type q; - q_vec_type euler; - - const char *infile_name = NULL; - FILE *infile = NULL; - char line[1025]; - - /* Check the command-line arguments. */ - if (argc != 2) { - Usage(argv[0]); - } else { - infile_name = argv[1]; - } - - /* Open and read the file */ - /* Transpose the matrix while it is being read into a row matrix. */ - if ( (infile = fopen(infile_name, "r")) == NULL) { - fprintf(stderr,"Cannot open %s for reading\n", infile_name); - return -2; - } - line[1024] = '\0'; /* Ensure null-termination */ - /* Print the comment line. */ - if (fgets(line, 1024, infile) == NULL) { - fprintf(stderr, "Could not read comment line from %s\n", infile_name); - return -3; - } - printf("Comment: %s\n", line); - /* Read and parse the first matrix line. */ - if (fgets(line, 1024, infile) == NULL) { - fprintf(stderr, "Could not read matrix line 1 from %s\n", infile_name); - return -3; - } - if (sscanf(line, "%lf%lf%lf%lf", &row_matrix[0][0], &row_matrix[1][0], &row_matrix[2][0], &row_matrix[3][0]) != 4) { - fprintf(stderr, "Could not parse matrix line 1 from %s\n", infile_name); - return -3; - } - /* Read and parse the second matrix line. */ - if (fgets(line, 1024, infile) == NULL) { - fprintf(stderr, "Could not read matrix line 2 from %s\n", infile_name); - return -3; - } - if (sscanf(line, "%lf%lf%lf%lf", &row_matrix[0][1], &row_matrix[1][1], &row_matrix[2][1], &row_matrix[3][1]) != 4) { - fprintf(stderr, "Could not parse matrix line 2 from %s\n", infile_name); - return -3; - } - /* Read and parse the third matrix line. */ - if (fgets(line, 1024, infile) == NULL) { - fprintf(stderr, "Could not read matrix line 3 from %s\n", infile_name); - return -3; - } - if (sscanf(line, "%lf%lf%lf%lf", &row_matrix[0][2], &row_matrix[1][2], &row_matrix[2][2], &row_matrix[3][2]) != 4) { - fprintf(stderr, "Could not parse matrix line 3 from %s\n", infile_name); - return -3; - } - /* Read and parse the fourth matrix line. */ - if (fgets(line, 1024, infile) == NULL) { - fprintf(stderr, "Could not read matrix line 4 from %s\n", infile_name); - return -3; - } - if (sscanf(line, "%lf%lf%lf%lf", &row_matrix[0][3], &row_matrix[1][3], &row_matrix[2][3], &row_matrix[3][3]) != 4) { - fprintf(stderr, "Could not parse matrix line 4 from %s\n", infile_name); - return -3; - } - - printf("Row Matrix directly:\n"); - q_print_matrix(row_matrix); - - /* The conversion routines cannot handle non-unit scaling. Compute the - * scale of each row in the matrix, print the scales, then divide each - * row to normalize before we do the rest of the math. */ - sx = sqrt(row_matrix[0][0]*row_matrix[0][0] + - row_matrix[0][1]*row_matrix[0][1] + - row_matrix[0][2]*row_matrix[0][2]); - sy = sqrt(row_matrix[1][0]*row_matrix[1][0] + - row_matrix[1][1]*row_matrix[1][1] + - row_matrix[1][2]*row_matrix[1][2]); - sz = sqrt(row_matrix[2][0]*row_matrix[2][0] + - row_matrix[2][1]*row_matrix[2][1] + - row_matrix[2][2]*row_matrix[2][2]); - printf("Scale:\n %lg, %lg, %lg\n", sx, sy, sz); - for (i = 0; i < 3; i++) { - row_matrix[0][i] /= sx; - row_matrix[1][i] /= sy; - row_matrix[2][i] /= sz; - } - - /* Convert to pos/quat, then Euler and print. */ - q_row_matrix_to_xyz_quat(&q, row_matrix); - q_to_euler(euler, q.quat); - printf("Translation:\n %lf, %lf, %lf\n", q.xyz[0], q.xyz[1], q.xyz[2]); - printf("Euler angles (degrees):\n %lg, %lg, %lg\n", - euler[2] * DEGREES_PER_RADIAN, /* Rotation about X is stored in the third component. */ - euler[1] * DEGREES_PER_RADIAN, - euler[0] * DEGREES_PER_RADIAN); - -} /* main */ - diff --git a/src/vrpn/quat/testapps/xform_to_components.vcproj b/src/vrpn/quat/testapps/xform_to_components.vcproj deleted file mode 100644 index 3b8c5888ec1b5cce9439b547f3ec98a19a665c45..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/testapps/xform_to_components.vcproj +++ /dev/null @@ -1,199 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="xform_to_components" - ProjectGUID="{CDE91DDD-1BFC-4BF0-B5E6-611C9AED47D0}" - RootNamespace="xform_to_components" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="1" - CharacterSet="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="../" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="1" - CharacterSet="1" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="../" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\xform_to_components.c" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/quat/vector.c b/src/vrpn/quat/vector.c deleted file mode 100644 index 3d1d51801a36edce54b2fac42ebce8601b1d8218..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/vector.c +++ /dev/null @@ -1,286 +0,0 @@ -/***************************************************************************** - * - vector.c - vector routines for quatlib that are unrelated to quaternions - - - (see quat.h for revision history and more documentation.) - - * - *****************************************************************************/ - - -#include <math.h> // for sqrt -#include <stdio.h> // for fprintf, printf, stderr - -#include "quat.h" // for Q_X, Q_Y, Q_Z, q_vec_type, etc - -/***************************************************************************** - * - q_vec_print - prints a vector to stdout - * - *****************************************************************************/ -void q_vec_print(const q_vec_type vec) -{ - - printf("(%lf, %lf, %lf)\n", vec[Q_X], vec[Q_Y], vec[Q_Z]); - -} /* q_vec_print */ - - - -/***************************************************************************** - * - q_vec_set - set vector equal to 3 values given - * - *****************************************************************************/ -void q_vec_set(q_vec_type vec, double x, double y, double z) -{ - vec[Q_X] = x; - vec[Q_Y] = y; - vec[Q_Z] = z; - -} /* q_set_vec */ - - -/***************************************************************************** - * - q_vec_copy - copies srcVec to destVec - * - *****************************************************************************/ -void q_vec_copy(q_vec_type destVec, const q_vec_type srcVec) -{ - - destVec[Q_X] = srcVec[Q_X]; - destVec[Q_Y] = srcVec[Q_Y]; - destVec[Q_Z] = srcVec[Q_Z]; - -} /* q_vec_copy */ - - - -/***************************************************************************** - * - q_vec_add - adds two vectors - - input: - - destVec, aVec, bVec - - output: - - destVec = aVec + bVec - - notes: - - src and dest may be same storage - * - *****************************************************************************/ -void q_vec_add(q_vec_type destVec, const q_vec_type aVec, const q_vec_type bVec) -{ - int i; - - for ( i = 0; i < 3; i++ ) - destVec[i] = aVec[i] + bVec[i]; - -} /* q_vec_add */ - - -/***************************************************************************** - * - q_vec_subtract - destVec = v1 - v2 - - input: - - dest vector - - v1, v2 - - output: - - dest vec - - notes: - - v1, v2, destVec need not be distinct storage - * - *****************************************************************************/ -void q_vec_subtract(q_vec_type destVec, const q_vec_type v1, const q_vec_type v2) -{ - - destVec[Q_X] = v1[Q_X] - v2[Q_X]; - destVec[Q_Y] = v1[Q_Y] - v2[Q_Y]; - destVec[Q_Z] = v1[Q_Z] - v2[Q_Z]; - -} /* q_vec_subtract */ - - - -/***************************************************************************** - * - q_vec_dot_product - returns value of dot product of v1 and v2 - * - *****************************************************************************/ -double q_vec_dot_product(const q_vec_type v1, const q_vec_type v2) -{ - - return((v1[Q_X] * v2[Q_X]) + (v1[Q_Y] * v2[Q_Y]) + (v1[Q_Z] * v2[Q_Z])); - -} /* q_vec_dot_product */ - - - - -/***************************************************************************** - * - q_vec_scale - scale a vector - - input: - - pointer to destination vector - - scale factor - - pointer to src vector - - output: - - dest vec is scaled by given amount - - notes: - - src and dest need not be distinct - * - *****************************************************************************/ -void q_vec_scale(q_vec_type destVec, double scaleFactor, const q_vec_type srcVec) -{ - - destVec[Q_X] = srcVec[Q_X] * scaleFactor; - destVec[Q_Y] = srcVec[Q_Y] * scaleFactor; - destVec[Q_Z] = srcVec[Q_Z] * scaleFactor; - -} /* q_vec_scale */ - - - -/***************************************************************************** - * - q_vec_invert - negate a vector to point in the opposite direction - - input: - - pointer to destination vector - - pointer to src vector - - output: - - dest vec is negated/inverted - - notes: - - src and dest need not be distinct - - this routine is called invert rather than negate to be consistent - with q_invert for quaternions - * - *****************************************************************************/ -void q_vec_invert(q_vec_type destVec, const q_vec_type srcVec) -{ - - destVec[Q_X] = -srcVec[Q_X]; - destVec[Q_Y] = -srcVec[Q_Y]; - destVec[Q_Z] = -srcVec[Q_Z]; - -} /* q_vec_invert */ - - - -/***************************************************************************** - * - q_vec_magnitude - returns magnitude of vector - - input: - - vector - - output: - - magnitude - - * - *****************************************************************************/ -double q_vec_magnitude(const q_vec_type vec) -{ - - return( sqrt( vec[Q_X]*vec[Q_X] + vec[Q_Y]*vec[Q_Y] + vec[Q_Z]*vec[Q_Z] ) ); - -} /* q_vec_magnitude */ - - - -/***************************************************************************** - * - q_vec_normalize - normalize a vector - - input: - vec - a vector - destVec - output parameter - - output: - normalized vector is put in destVec - - notes: - destVec and srcVec may be the same - * - *****************************************************************************/ -void q_vec_normalize(q_vec_type destVec, const q_vec_type srcVec) -{ - double normalizeFactor; - double magnitude; - - if ( (magnitude = q_vec_magnitude(srcVec)) < Q_EPSILON ) - { - fprintf(stderr, "quatlib: q_vec_normalize: vector has 0 magnitude.\n"); - return; - } - - normalizeFactor = 1.0 / magnitude; - - destVec[Q_X] = srcVec[Q_X] * normalizeFactor; - destVec[Q_Y] = srcVec[Q_Y] * normalizeFactor; - destVec[Q_Z] = srcVec[Q_Z] * normalizeFactor; - - -} /* q_vec_normalize */ - - - -/***************************************************************************** - * - q_vec_distance - returns distance between two points/vectors - * - *****************************************************************************/ -double q_vec_distance(const q_vec_type vec1, const q_vec_type vec2) -{ - - return( sqrt((vec2[Q_X] - vec1[Q_X]) * (vec2[Q_X] - vec1[Q_X]) + - (vec2[Q_Y] - vec1[Q_Y]) * (vec2[Q_Y] - vec1[Q_Y]) + - (vec2[Q_Z] - vec1[Q_Z]) * (vec2[Q_Z] - vec1[Q_Z])) ); - -} /* q_vec_distance */ - - - -/***************************************************************************** - * - q_vec_cross_product - computes cross product of two vectors: - - destVec = aVec X bVec - - input: - destVec: pointer to output vector - aVec: first vector - bVec: second vector - - output: - destVec = aVec X bVec - - notes: - destVec == aVec or bVec ok. - * - *****************************************************************************/ -void q_vec_cross_product(q_vec_type destVec, const q_vec_type aVec, const q_vec_type bVec) -{ - q_vec_type tmpDestVec; - - - tmpDestVec[Q_X] = aVec[Q_Y] * bVec[Q_Z] - aVec[Q_Z] * bVec[Q_Y]; - tmpDestVec[Q_Y] = aVec[Q_Z] * bVec[Q_X] - aVec[Q_X] * bVec[Q_Z]; - tmpDestVec[Q_Z] = aVec[Q_X] * bVec[Q_Y] - aVec[Q_Y] * bVec[Q_X]; - - q_vec_copy(destVec, tmpDestVec); - -} /* q_vec_cross_product */ - - diff --git a/src/vrpn/quat/xyzquat.c b/src/vrpn/quat/xyzquat.c deleted file mode 100644 index 13a16a80b4e1dea4b02c9503585b49ae784fef4b..0000000000000000000000000000000000000000 --- a/src/vrpn/quat/xyzquat.c +++ /dev/null @@ -1,190 +0,0 @@ -/***************************************************************************** - * - xyzquat.c - source for all operations related to the xyzquat data type - - Revision History: - - Author Date Comments - ------ -------- ---------------------------- - Erik Erikson 06/26/92 Added q_xyz_quat_compose - Stefan Gottschalk - Russ Taylor - Rich Holloway 01/25/91 Initial version - - - Developed at the University of North Carolina at Chapel Hill, supported - by the following grants/contracts: - - DARPA #DAEA18-90-C-0044 - ONR #N00014-86-K-0680 - NIH #5-R24-RR-02170 - * - *****************************************************************************/ - -#include "quat.h" - - -/***************************************************************************** - * - q_xyz_quat_invert - invert a vector/quaternion transformation pair - - input: - - dest and source pointers - - output: - - src is inverted and put into dest - - notes: - - src and dest may be same - * - *****************************************************************************/ -void q_xyz_quat_invert(q_xyz_quat_type *destPtr, const q_xyz_quat_type *srcPtr) -{ - - /* invert rotation first */ - q_invert(destPtr->quat, srcPtr->quat); - - /* vec = -vec */ - q_vec_invert(destPtr->xyz, srcPtr->xyz); - - /* rotate translation offsets into inverted system */ - q_xform(destPtr->xyz, destPtr->quat, destPtr->xyz); - - -} /* q_xyz_quat_invert */ - - - -/***************************************************************************** - * - q_row_matrix_to_xyz_quat - converts a row matrix to an xyz_quat - - input: - - pointer to each - - output: - - new xyz_quat - - notes: - - each call to this function takes about .1 milliseconds on pxpl4 - a VAX 3200 GPX, as of 4/11/91. - * - *****************************************************************************/ -void q_row_matrix_to_xyz_quat(q_xyz_quat_type *xyzQuatPtr, const q_matrix_type rowMatrix) -{ - int i; - - q_from_row_matrix(xyzQuatPtr->quat, rowMatrix); - - for ( i = 0; i < 3; i++ ) - xyzQuatPtr->xyz[i] = rowMatrix[3][i]; - -} /* q_row_matrix_to_xyz_quat */ - - -/***************************************************************************** - * - q_xyz_quat_to_row_matrix - convert an xyz_quat to a row matrix - - input: - - pointer to each - - output: - - new row matrix - - notes: - - each call to this function takes about .14 milliseconds on pxpl4 - a VAX 3200 GPX, as of 4/11/91. - * - *****************************************************************************/ -void q_xyz_quat_to_row_matrix(q_matrix_type rowMatrix, const q_xyz_quat_type *xyzQuatPtr) -{ - - int i; - - - q_to_row_matrix(rowMatrix, xyzQuatPtr->quat); - - for ( i = 0; i < 3; i++ ) - rowMatrix[3][i] = xyzQuatPtr->xyz[i]; - -} /* q_xyz_quat_to_row_matrix */ - - -/* - * q_ogl_matrix_to_xyz_quat - */ -void q_ogl_matrix_to_xyz_quat(q_xyz_quat_type *xyzQuatPtr, const qogl_matrix_type matrix ) -{ - q_from_ogl_matrix( xyzQuatPtr->quat, matrix ); - xyzQuatPtr->xyz[Q_X] = matrix[12+Q_X]; - xyzQuatPtr->xyz[Q_Y] = matrix[12+Q_Y]; - xyzQuatPtr->xyz[Q_Z] = matrix[12+Q_Z]; -} - -/* - * q_xyz_quat_to_ogl_matrix - */ -void q_xyz_quat_to_ogl_matrix(qogl_matrix_type matrix, const q_xyz_quat_type *xyzQuatPtr ) -{ - q_to_ogl_matrix( matrix, xyzQuatPtr->quat ); - matrix[12+Q_X] = xyzQuatPtr->xyz[Q_X]; - matrix[12+Q_Y] = xyzQuatPtr->xyz[Q_Y]; - matrix[12+Q_Z] = xyzQuatPtr->xyz[Q_Z]; -} - - -/***************************************************************************** - * - q_xyz_quat_compose - compose q_xyz_quat_types CfromB and BfromA to - get CfromA - - input: - - pointers to q_xyz_quat_types CfromA, CfromB and BfromA - - output: - - CfromA - - overview: - - treat the BA q_xyz_quat_type as local, since it's closer to - the point: - - newp = CB*BA*p - - - first xform the xlate part of BA into the CB system by rotating - and scaling it - - - add the xformed local xlate to the unchanged global xlate - - - then compose the rotation parts by multiplying global*local - * - *****************************************************************************/ -void q_xyz_quat_compose(q_xyz_quat_type *C_from_A_ptr, - const q_xyz_quat_type *C_from_B_ptr, const q_xyz_quat_type *B_from_A_ptr) -{ - q_vec_type rotated_BA_vec; - - - /* rotate local xlate into global */ - q_xform(rotated_BA_vec, C_from_B_ptr->quat, B_from_A_ptr->xyz); - - /* now add the xformed local vec to the unchanged global vec */ - q_vec_add(C_from_A_ptr->xyz, C_from_B_ptr->xyz, rotated_BA_vec); - - /* compose the rotations */ - /* CA_rotate = CB_rotate . BA_rotate */ - q_mult(C_from_A_ptr->quat, C_from_B_ptr->quat, B_from_A_ptr->quat); - - q_normalize(C_from_A_ptr->quat, C_from_A_ptr->quat); - -} /* q_xyz_quat_compose */ - - -// xform a vector by an xyzquat. dest == src ok. -void q_xyz_quat_xform(q_vec_type dest, const q_xyz_quat_type *xf, const q_vec_type src) -{ - q_xform(dest, xf->quat, src); - q_vec_add(dest, xf->xyz, dest); -} - - diff --git a/src/vrpn/server_src/.cvsignore b/src/vrpn/server_src/.cvsignore deleted file mode 100644 index 0a588c67fa0d2a8ebe9c9b79e2e05454ea6b03c4..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/.cvsignore +++ /dev/null @@ -1,9 +0,0 @@ -.depend -make.out -makefile -pc_cygwin -pc_linux -sgi_irix -sparc_solaris -powerpc_aix -*.vcproj.*.user \ No newline at end of file diff --git a/src/vrpn/server_src/CMakeLists.txt b/src/vrpn/server_src/CMakeLists.txt deleted file mode 100644 index b05ee32de90ed0751d4be760e04592f4702d9d12..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/CMakeLists.txt +++ /dev/null @@ -1,236 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -#----------------------------------------------------------------------------- -# XXX Things to make better. -# -# Move applications into subprojects in visual studio -# XXX tracker_to_poser -# Fix the ones that are commented out so that they compile and run? - -if(NOT VRPN_SERVER_LIBRARY) - message(FATAL_ERROR - "Cannot compile servers without the full (server) library. Enable it and try again.") -endif() - -set(VRPN_GPSNMEA_LIBRARY gpsnmea) - -if(NOT WIN32) - set(VRPN_ATMEL_LIBRARY vrpn_atmel) -endif() - -if(WIN32) - ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) -endif() - -#----------------------------------------------------------------------------- -# Phantom library (if configured) -find_package(OpenGL) -if(VRPN_USE_PHANTOM_SERVER AND OPENGL_FOUND) - set(PHANTOM_SOURCES - ghostEffects/InstantBuzzEffect.cpp - buzzForceField.C - constraint.C - forcefield.C - plane.C - texture_plane.C - trimesh.C - vrpn_Phantom.C) - - set(PHANTOM_HEADERS - ghostEffects/InstantBuzzEffect.h - buzzForceField.h - constraint.h - forcefield.h - ghost.h - plane.h - texture_plane.h - trimesh.h - vrpn_Phantom.h) - include_directories(${VRPN_SOURCE_DIR}/server_src/ghostEffects) - if(VRPN_USE_GHOST AND GHOST_STL_INCLUDE_DIR) - include_directories(${GHOST_STL_INCLUDE_DIR}) - endif() - add_library(vrpn_phantom ${PHANTOM_SOURCES} ${PHANTOM_HEADERS}) - target_link_libraries(vrpn_phantom vrpnserver ${OPENGL_LIBRARIES}) - - set_property(TARGET - vrpn_phantom - PROPERTY - PUBLIC_HEADER - ${PHANTOM_HEADERS}) - set_target_properties(vrpn_phantom PROPERTIES FOLDER Library) - - if(VRPN_INSTALL) - install(TARGETS - vrpn_phantom - ARCHIVE - DESTINATION - lib - COMPONENT - serversdk - PUBLIC_HEADER - DESTINATION - include - COMPONENT - serversdk) - endif() - set(VRPNPHANTOMLIB vrpn_phantom) -endif() - -#------------------------------------------------------------------ -# DirectShow video server - only for pre-VS10 due to header removal -if(VRPN_BUILD_DIRECTSHOW_VIDEO_SERVER AND DIRECTSHOW_FOUND) - add_subdirectory(directshow_video_server) -endif() - -add_subdirectory(timecode_generator_server) - -#----------------------------------------------------------------------------- -# Include directories needed -include_directories(${VRPN_SOURCE_DIR}/server_src - ${VRPN_SOURCE_DIR}/server_src/timecode_generator_server) - -#----------------------------------------------------------------------------- -# Applications that need more than one file to run. -add_executable(vrpn_server - vrpn.cfg - vrpn.C) -target_link_libraries(vrpn_server - ${VRPN_SERVER_LIBRARY} - vrpn_timecode_generator - ${VRPN_ATMEL_LIBRARY} - ${VRPN_GPSNMEA_LIBRARY} - ${VRPNPHANTOMLIB}) -set_target_properties(vrpn_server PROPERTIES SOLUTION_FOLDER servers) -set_property(TARGET - vrpn_server - PROPERTY - PROJECT_LABEL - "vrpn_server") -set_target_properties(vrpn_server PROPERTIES FOLDER "Main Server") -set_property(TARGET - vrpn_server - PROPERTY - LINK_FLAGS - ${SERVER_LINK_FLAGS}) - -if(VRPN_INSTALL) - install(TARGETS vrpn_server - RUNTIME DESTINATION bin - COMPONENT mainserver) -endif() - -if(VRPN_USE_NATIONAL_INSTRUMENTS) - add_executable(daq_server - daq_server.C - NIUtil.cpp - NIUtil.h) - target_link_libraries(daq_server ${VRPN_SERVER_LIBRARY}) - set_target_properties(daq_server PROPERTIES FOLDER Servers) - if(VRPN_INSTALL) - install(TARGETS daq_server RUNTIME DESTINATION bin COMPONENT servers) - endif() -endif() - -#----------------------------------------------------------------------------- -# Install the vrpn.cfg file needed by the server. -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/vrpn.cfg" - "${CMAKE_CURRENT_BINARY_DIR}/vrpn.cfg" - @ONLY) - -if(VRPN_INSTALL) - if(WIN32) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vrpn.cfg" - DESTINATION bin - COMPONENT mainserver) - else() - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vrpn.cfg" - DESTINATION etc - COMPONENT mainserver) - endif() - - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vrpn.cfg" - DESTINATION share/vrpn-${BRIEF_VERSION} - RENAME vrpn.cfg.sample - COMPONENT mainserver) -endif() - -#----------------------------------------------------------------------------- -# Declaration of the simple test applications that don't have extra files - -# XXX Are these files compiled somewhere? -# -#make_vrpn_libs_build.cpp - -set(SRV_TEST_SOURCES - client_and_server.C - forward.C - last_of_sequence.C - sample_analog.C - sample_server.C - testSharedObjectServer.C - test_analogfly.C - test_auxiliary_logger.C - test_freespace.C - test_logging.C - test_loopback.C - test_mutexServer.C - test_peerMutex.C - test_radamec_spi.C - test_rumble.C - test_vrpn.C - testimager_server.cpp - textServer.C -) -if(VRPN_USE_HID) - list(APPEND SRV_TEST_SOURCES vrpn_HID_device_watcher.cpp) -endif() - -if(WIN32 AND VRPN_USE_DIRECTINPUT) - list(APPEND SRV_TEST_SOURCES directXFF.C) -endif() - -if(WIN32) - list(APPEND SRV_TEST_SOURCES nidaqClient.cpp) # actually a client test -endif() - -if(WIN32 AND VRPN_USE_NIDAQ) -# list(APPEND SRV_TEST_SOURCES nidaqServer.cpp) # missing getOptClean -endif() - -set(SRV_SERVER_SOURCES) - -### -# Tests -### -if(BUILD_TESTING) - foreach(SOURCE ${SRV_TEST_SOURCES}) - get_filename_component(APP ${SOURCE} NAME_WE) - add_executable(${APP} ${SOURCE}) - target_link_libraries(${APP} ${VRPN_SERVER_LIBRARY}) - set_target_properties(${APP} PROPERTIES FOLDER Tests) - - if(VRPN_INSTALL) - install(TARGETS ${APP} - RUNTIME DESTINATION bin COMPONENT tests) - endif() - endforeach() - add_test(test_loopback test_loopback) - add_test(test_vrpn test_vrpn) -endif() - -### -# Servers -### -foreach(SOURCE ${SRV_SERVER_SOURCES}) - get_filename_component(APP ${SOURCE} NAME_WE) - add_executable(${APP} ${SOURCE}) - target_link_libraries(${APP} ${VRPN_SERVER_LIBRARY}) - set_target_properties(${APP} PROPERTIES FOLDER Servers) - - if(VRPN_INSTALL) - install(TARGETS ${APP} RUNTIME DESTINATION bin COMPONENT servers) - endif() -endforeach() - - diff --git a/src/vrpn/server_src/ChangeLog b/src/vrpn/server_src/ChangeLog deleted file mode 100644 index 3c2c4beec915aa3db3d3cd7adf5b8a2e0072dcfb..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/ChangeLog +++ /dev/null @@ -1,1433 +0,0 @@ -2010-01-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Making DreamCheeky not try to compile - in except on Windows and Cygwin and Apple, where it has been - implemented. - -2009-12-27 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Added support for the Dream Cheeky USB - roll-up drum kit, which is a HID device. - * vrpn_Generic_server_object.C : Same. - * vrpn_Generic_server_object.h : Same. - * vrpn_Hid_device_watcher.cpp : Added a print-out of the number of - bytes per packet. - -2009-12-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CmakeLists.txt : Added fix from Ryan Pavlik for SensAble. - -2009-11-27 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CMakeLists.txt : Added libraries required on the Mac. - -2009-11-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * client_and_server.C : Picking lint found by a new compiler. Const - declarations and printf format descriptions. - * test_analogfly.C : Same. - * test_radamec_spi.C : Same. - * test_vrpn.C : Same. - * vrpn.C : Same. - * vrpn_Generic_server_object.C : Same. - * vrpn_Generic_server_object.h : Same. - -2009-11-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * CMakeLists.txt : File to describe to the Cmake build system how - to compile VRPN. - * test_freespace.C : Upgrade to make it compile on Windows on new VRPN. - * text.C : Same. - * vrpn_Phantom.C : Same. - -2009-10-30 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Making this compile under Linux using new 0.4 version of - libfreespace; patch from Phil Black. - * test_freespace.C : Same. - -2009-10-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Added an entry for the new vrpn_Freespace submitted by - Phil Black from Hillcrest Labs. - * test_freespace.C : Same. - * test_freespace.vcproj : Same. - * vrpn_server.vcproj : Same. - * vrpn_Generic_server_object.h : Same. - * vrpn_Generic_Server_object.C : Same. - -2009-09-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Turned "-g" flag into "$(DEBUG_FLAGS)" throughout. - -2009-07-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.h : Adds an Isotrak tracker driver - submitted by Burno Herbelin from the Sensorama Laboratory - at AAlborg University. - * vrpn_Generic_server_object.C : Same. - * vrpn.cfg : Same. - -2009-06-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added comment showing how to link on 64-bit Linux - with WiiMote. - -2009-02-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added in comment showing how to link with WiiMote. - -2009-1-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Making HID work with Cygwin. - * Makefile : Same. - -2008-12-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Made this compile even when the WiiMote is - not being used. - * vrpn_Generic_server_object.h : Same. - -2008-12-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Driver for the WiiMote device using the - WiiUse library. Tested under Windows; also supposed to work under - Linux. Handles accelerometers, buttons, and raw IR values. - Should handle nunchuck, classic remote, and guitar hero 3 - attachments (not tested). - * vrpn_Generic_server_object.h : Same. - * vrpn.cfg : Same. - * test_rumble.C : Test program to send rumble on/off commands through - an Analog_Output device, switching every two seconds. - * test_rumble.vcproj : Same. - -2008-12-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Added Chris VanderKnyff's implementation of - the Xbox 360 game controller. - * vrpn_Generic_server_object.h : Same - * vrpn.cfg : Same - -2008-10-01 Ian Curington <ianc@acm.org> - * vrpn_Generic_server_object.C/h: - Added 3DConnexion Spaceball 5000 device support - * vrpn.cfg : Same. - -2008-08-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * test_auxilliary_logger.C : Changed the log duration for the test up - to 5 seconds from 2 seconds to enable transients to settle. - * vrpn.C : Fixed a bug in the local-out file naming command-line - argument that always named the file "-lo" rather than what - it was supposed to be. - -2008-07-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Fixed the case where NULL entries are - made for the vrpn_Tracker_AnalogFly so that the axis did not go - looking for a device named "NULL". - -2008-06-20 Aron Helser <helser@cs.unc.edu> - - * texture_plane.C (setPlaneFromTransform): Update to compile under - HD api and VS2005. Not verified to be correct. - * vrpn_phantom.vcproj: added WIN32 preprocessor define, so HD api - headers compile correctly. - -2008-06-19 David Marshburn <marshbur@cs.unc.edu> - - * test_vrpn.C: added Poser server/remote tests. - -2008-05-28 Aron Helser <helser@cs.unc.edu> - - * vrpn_Phantom.C : Additional initialization checks for HD api - errors, to avoid a crash. - -2008-05-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding changes from Lawrence K. at PhaseSpace. - * vrpn.cfg : Same. - * vrpn_Generic_server_object.C : Same. - -2008-04-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.h : Added patch from Mike Weiblen to add - 3DConnexion SpaceExplorer. - * vrpn_Generic_server_object.C : Same. - -2008-03-25 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_server.C : Fixed typo bug in the connection name - creation that kept this from working unless you - specified the NIC name. - -2008-03-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Better parser - for AnalogFly line that can handle the - case where only some of the lines are present. - Submitted by Jan Ciger. - -2008-03-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Adding entry for vrpn_Tracker_NDI_Polaris - submitted by Sharif Razzaque from InnerOptic. - * vrpn_Generic_server_object.C : Same. - * vrpn_Generic_server_object.h : Same. - -2008-03-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Changing the way the server connection is created so - that it can handle the more general vrpn_Connection object - types in preparation for the MPI communication method. Also - removed the option to connect to a client when it is started - up. - - * vrpn_testimager_server.cpp : Same. - * test_vrpn.C : Same. - * test_radamec_spi.C : Same. - * test_imager.C : Same. - * test_analogfly.C : Same. - * directshow_video_server.cpp : Same. - * test_mutex.C : Same. - * test_logging.C : New test for logging and replay. - * test_logging.vcproj : Same. - * test_logging.dsp : Same. - * Makefile : Same. - -2007-12-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Fixing a bug pointed out by - Jan Ciger, where the RESET and CLUTCH buttons were being - set to the same thing. - - * vrpn.cfg : Whitespace change and added comments to the - vrpn_AnalogFly examples. - -2007-12-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Adding example line for vrpn_Tracker_MotionNode. - -2007-12-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Added entry for MotionNode Tracker. - This compiles under Visual Studio 2005 (not 6.0). - * vrpn_Generic_server_object.h : Same - * vrpn_server.vcproj : Same. - -2007-11-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Added patch from Eric Griffith - to include control of a stylus. - * vrpn_Generic_server_object.C : Same. - -2007-11-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added (commented out) options to link with - both the GPM and the InterSense libraries. - -2007-11-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.h : Lets you open 100 joysticks on - the same machine, rather than just 2. Must have been a - fun project... - -2007-11-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Renamed Auxilliary to Auxiliary. - -2007-11-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Added entries for Mouse and Keyboard, - remove the KeyMouse entry. Added clutch option - to the vrpn_AnalogFly. - * vrpn_Generic_server_object.C : Added clutch option. - * vrpn_Generic_server_object.h : Same. - -2007-11-12 David Marshburn <marshbur@cs.unc.edu> - - * corrected the spelling of Auxilliary to Auxiliary - -2007-11-12 David Marshburn <marshbur@cs.unc.edu> - - * test_auxilliary_logger.C: also test status-request functionality - -2007-09-18 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.h : Added 3DConnexion SpaceMouse - * vrpn_Generic_server_object.C : Same. - * vrpn.cfg : Same. - -2007-08-25 Russell M. Taylor II <taylorr@cs.unc.edu> - - * test_vrpn.C : Added test for vrpn_Analog_Output. - * Makefile : Removed "-gpm" library from the default - build, as it is not available on some flavors - of Linux. The vrpn_Configure.h file tells how - to fix this when GPM is being used. - -2007-08-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Converting back to Unix format so it works - with all architectures. - -2007-08-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Fix submitted by Christian Odom for the Wand on the - Intersense tracker. - -2007-08-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * sgibdbox.cfg : Removed file that is no longer used. - * vrpn.C : Decremented reference count on connection - rather than deleting it (the reference-count reduction - deletes it the right way). - -2007-08-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Adding 3DConnexion Space - Navigator and Space Traveler devices. An impulse buy - at SIGGRAPH this year. - * vrpn_Generic_server_object.h : Same. - * vrpn_HID_device_watcher.cpp : Code from Chris VanderKnyff - that lets you watch the messages coming from a HID - device. Great for figuring out how to write a driver! - * vrpn_hid_device_watcher.dsp : Builds the project. - * vrpn_hid_device_watcher.vcproj : Same. - * vrpn.cfg : Entries for the new devices. - -2007-08-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Adding HID and XKeys from - Chris VanderKnyff to the objects that can be created. - * vrpn_Generic_server_object.h : Same. - * vrpn.cfg : Same. - * vrpn.C : Added ^C handler in Windows so that objects are - cleaned up nicely before exit. - -2007-08-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Fixed some #define terms (_WIN32 rather than WIN32). - Made non-verbose the default. - * vrpn.cfg : Added vrpn_Imager_Stream_Buffer object. - * vrpn_Generic_Server_Object.h : Same. - * vrpn_Generic_Server_Object.C : Same. - -2007-07-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding the vrpn_Auxilliary_Logger test - object and application. - * vrpn.cfg : Made it Unix format so that it can be - parsed on both Unix and Windows. - * vrpn.cfg.SAMPLE : Same. - -2007-07-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Adds the ability to create an - auxiliary log file connection to the same or a different - host. - * vrpn_Generic_server_object.h : Same. - * vrpn.cfg : Same. - * test_auxilliary_logger.C : Source code for a test program for - this new object. - * test_auxilliary_logger.dsp : Project build file for this. - * test_auxilliary_logger.vcproj : Same. - -2007-07-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * test_vrpn.C : Added a call to the function that tests the - vrpn_Semaphore and vrpn_Thread classes to make sure - they work. It does not use the threads in the rest - of the code, just tests them. - -2007-07-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Patch from Kurt Achatz to build for new - version of A.R.T. DTrack, which supports the new Flystick2 - input device. The patch was necessary to support the new - (additional) DTrack output format called '6df2'; the driver - still understands the former output format '6df', so that - it can work with any existing DTrack installation too. - Note that there was a change how buttons of a 'Flystick' - device are sorted; this was done to fit DTrack's standards - described in A.R.T. documentation. For backward - compatibility the driver uses the old sorting when using - the old output format '6df'. - * vrpn_Generic_server_object.C : Same. - -2007-06-30 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Fixing Mac Universal build to use g++ not gcc. - -2007-06-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added linking with pthread library because of - vrpn_Thread (defined in vrpn_Shared.h). - -2007-06-25 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Adding new devices from - Bauhaus University Weimar submitted by Jan Springer. - * vrpn_Generic_server_object.h : Same. - * clock_server.C : Removed comments that got filled - in with checked-out version information. - * vrpn.cfg : Comment mis-spelling fixed. - -2007-06-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Added entry to configure a vrpn_DirectXRumblePack. - Also added hemisphere setting for the Flock. - * vrpn_Generic_server_object.C : Same. - * vrpn_Generic_server_object.h : Same. - -2007-06-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding patch submitted by Patrick Hartling from - Infiscape.com for making this compile on MacOSX - to create universal binaries. - -2007-06-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Compiles with PhaseSpace driver submitted by - Lawrence Kwan. - * vrpn_server.vcproj : Same. - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - * vrpn_Generic_server_object.h: Same. - * vrpn_Generic_server_object.C: Same. - -2007-03-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding a build environment for cross-compiling to - ARM from PCs running Cygwin - -2007-03-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Making this code compile under pc_linux_arm. - -2006-01-30 David Borland <borland@cs.unc.edu> - - * vrpn_Phantom.C : Added call to forceField->stop() in - vrpn_Phantom::reset(). Previously, the force field would remain - in effect when the vrpn connection was dropped. - -2006-11-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Added support for new devices whose drivers were - submitted by William West from Disney VR Studios. These - are the US Digital analog device and a National - Instruments based DIO24 board. - * vrpn.cfg.SAMPLE : Same. - * vrpn_Generic_server_object.h : Same. - * vrpn_Generic_server_object.C : Same. - -2006-10-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * client_and_server.vcproj : Updated to use the August 2006 version - of the DirectX SDK and the Microsoft Platform SDK - for Windows Server 20003 R2. - * daq_server.vcproj : Same. - * test_analogfly.vcproj : Same. - * test_radamec_spi.vcproj : Same. - * test_vrpn.vcproj : Same. - * testimager_server.vcproj : Same. - * vrpn_phantom.vcproj : Same. - * vrpn_server.vcproj : Same. - * timecode_generator_server.vcproj : Same. - * directshow_video_server : New directory containing the code needed - for a DirectShow-based vrpn_Imager server. - -2006-09-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * directshow_video_server : New directory with a project file and - source code to build a DirectShow-based video imager - server. - -2006-08-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Phantom.C : Added fix sent in by Lode Vanacken. We don't - need to stop and re-start the servo loop when removing an object. - This causes the other objects to disappear. We just have to lock and - unlock the scene. - -2006-06-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding "making install" target. - -2006-06-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * ghost.h : Added the friction and damping parameters to - the Plane class to the HDAPI implementation. - This ended up meaning that HL is being used for all of - the force generation. This ended up requiring the - code to reset the ModelView transform in OpenGL (it puts - it back) to make sure the code works when run from within - an OpenGL context. - * forcefield.C : Same. - * plane.C : Same. - * plane.h : Same. - * texture_plane.C : Same. - * texture_plane.h : Same. - * vrpn_Phantom.C : Same. - * vrpn_Phantom.h : Same. - -2006-06-19 Russell M. Taylor II <taylorr@cs.unc.edu> - - * ghost.h : Continuing to try and port from GHOST to HDAPI. - Removed several of the home-built classes that had been - put in for Vector, Matrix, Position, Boolean, and Plane - and replaced them with HDU classes (utility classes from - the HDAPI library). This required putting some #ifdef - blocks in the code because the HDAPI and GHOST objects - named methods in inconsistent ways. - * buzzForceField.C : Same. - * constraint.C : Same. - * forcefield.C : Same. - * plane.C : Same. - * texture_plane.C : Same. - * vrpn_Phantom.C : Same. - -2006-04-28 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_server.dsp: made the Debug and Release include paths - be the same. - -2006-04-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : One of Virtools' partner, namely Kevin - from Axis 3D in Taiwan, actually spotted this issue the - add_is900_button is called with a hard code number of button - equal to 5. This made the wand button not work. Increased to - the value 6. - * vrpn.cfg : Had left an AnalogFly uncommented. - -2006-03-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.C : Commenting out Windows-specific - stuff on other architectures, replacing with error print. - -2006-03-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : New configuration for vrpn_Keyboard_Mouse. - * vrpn_Generic_server_object.C : Update for Keyboard_Mouse - and added Button_USB. - * vrpn_Generic_server_object.h : Same. - -2006-03-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * *.vcproj : Visual C++ 2005 project files for VRPN. - -2005-12-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * buzzForceField.C : Made generic definitions for the mutex - code, so that we didn't have #defines peppered all over - the code. Made the Cygwin code compile using Pthreads - critical sections, like the SGI code. - * buzzForceField.h : Same. - * ghost.h : Defined TRUE and FALSE to true and false if they - were not defined that way before. - * Makefile : Trying to make it compile under Cygwin. It does - everything but link now (cannot find a bunch of symbols - that should be defined in hd.lib, which it does link - with). - * plane.C : Needs to include <windows.h> under Cygwin to finish - compiling. - * plane.h : Same. - * vrpn_Phantom.C : Same. - * texture_plane.C : Even more dramatic replacement of the mutex - stuff, like in buzzForceField. - * texture_plane.h : Same. - -2005-10-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Fixes the example configuration for the Keymouse. - * vrpn.cfg.SAMPLE : Same. - * keycodes.txt : Tells what key codes are for each key. - -2005-10-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Phantom.C : Bug fix from Tom De Weyer. - * vrpn_Generic_Server_Object.h : Added Keyboard_Mouse. - * vrpn_Generic_Server_Object.C : Added Keyboard_Mouse. - * vrpn.cfg : Same. - -2005-10-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Fixed a typo for 64-bit compiles. - -2005-10-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added target for 64-bit Intel-based SGI compilation. - -2005-10-04 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Modified to hopefully work with 64-bit Linux - -2005-09-30 Russell M. Taylor II <taylorr@cs.unc.edu> - - * trimesh.C : Modified to use the new version 7.0 ForceDevice - protocol and code. - * trimesh.h : Same. - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - * vrpn_Phantom.C : Same. - * vrpn_Phantom.h : Same. - -2005-09-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Adding entries for 5DT16 analog driver and - for the button wrapper for it. - * vrpn.cfg.SAMPLE : Same. - * vrpn_Generic_server_object.h : Same. - * vrpn_Generic_server_object.C : Same. - -2005-09-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Added entry for Microscribe. - * vrpn.cfg.SAMPLE : Added entry for Microscribe. - * vrpn_Generic_server_object.h : Same. - * vrpn_Generic_server_object.C : Same. - -2005-09-29 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.h : Added support for Crossbow - tracker. - * vrpn_Generic_server_object.C : Same. - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - -2005-09-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Phantom.h : Added debounce counters for the buttons. - This is to overcome problems found on a particular - Omni device. Also set 2 buttons when using HDAPI, - in case we have an Omni. - * vrpn_Phantom.C : Same. - -2005-08-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_phantom.dsp : Swiched from GHOST to HDAPI include paths. - -2005-08-13 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_Phantom.C (mainloop): call vrpn_Button_Filter::report_changes - instead of vrpn_Button::report_changes (to get correct toggle - functionality). - (handle_plane): commented out a call to - DynamicPlane::setNumRecCycles, which seems not to exist any more. - * vrpn_phantom.dsp: builds browse info also - -2005-07-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Adds entry for serial mouse on mac through a - Keyspan serial-to-USB converter. Adds entry for - a Linux box. - * vrpn.cfg.SAMPLE : Same. - * Makefile : Fixes so that it compiles on a mac without - the intersense libraries. - -2005-07-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * ghost.h : Normalizing planes as they come in to avoid having their - stiffness depend on the scaling of their A,B,C coefficients. - * texture_plane.h : Removing print statement. - * vrpn_Phantom.C : Making the error reporting that is supposed to - happen rarely indeed happen rarely. - -2005-07-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * client_and_server.dsp : Added include directories on $(SYSTEMDRIVE) - and lib directories also on $(SYSTEMDRIVE) so that the - apps can build correctly with only edits in the - vrpn_Configure.h file if things are installed in standard - locations. - * daq_server.dsp : Same. - * test_analogfly.dsp : Same. - * test_radamec_spi.dsp : Same. - * test_vrpn.dsp : Same. - * testimager_server.dsp : Same. - * vrpn_phantom.dsp : Same. - * vrpn_server.dsp : Same. - -2005-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * test_mutex.C : Removed Synchronized. - -2005-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * client_and_server.C : Removed Synchronized. - * test_analogfly.C : Same. - * test_radamec_spi.C : Same. - * test_vrpn.C : Same. - * testimager_server.cpp : Same. - * vrpn.C : Same. - -2005-07-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adds new library on Linux needed by mouse driver. - * vrpn_Generic_Server_Object.h : Adds Linux GPM-based mouse driver - submitted by Mike Weiblen at 3DLabs. - * vrpn_Generic_Server_Object.C : Same. - -2005-06-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_Server_Object.h : Added support for the Logitech - 3DMouse. - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - * vrpn_Generic_Server_Object.C : Same. Removed guards by - architecture around some tracker creations. - -2005-05-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * NIUtil.cpp : Whitespace change. - * testimager_server.cpp : Same. - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - -2005-04-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Added entries to run the Mad City Labs - stages using a Microsoft Force-Feedback Joystick. - When you run a server with these configs, and - the Tracker_To_Poser, you can fly the focus all - through the volume. Things should now be ready - for Eli Holder's amazingly cool 3D optical - microscope program! - -2005-02-25 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Removed -LANG:std from compile, no streams - used in the code anymore. - -2005-02-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Added entries for NationalInstruments - server. Modified Poser to add additional - parameter to turn off tracking reporting. - * vrpn_Generic_server_object.C : Added NationalInstruments - parser and generator. - * vrpn_Generic_server_object.h : Same. - -2005-02-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added John Stone's definitions to make - things compile under 64-bit Linux. - -2005-01-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Generic_server_object.h : Added final newline. - * vrpn_Generic_server_object.C : Added final newline. - -2005-01-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Pulled most of the code out into an object that - parses the configuration file, creates the objects, and - provides a loop to mainloop() the objects. The connection - code and other functions are still within this file. - * vrpn_Generic_server_object.h : Object that performs most of the - functions of the server, making it possible to include as - part of an application. This should make it easier for - folks to run both clients and servers in the same application, - using one or more configuration files to create the objects. - * vrpn_Generic_server_object.C : Same. - * vrpn_phantom.dsp : Modified to compile correctly with STL. - * vrpn_server.dsp : Modified to include the above two files. - * Makefile : Same. - -2005-01-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_server.cpp : Comment change. - -2004-12-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * NIUtil.cpp : Turned on a higher level of warnings in - Windows and then went through and fixed all of the - warnings, except a few on FunctionGenerator (which - has an uncompleted function) and on Sound (which has - a bunch of uncompleted functions). Fixed a few bugs - that turned up along the way. Ripped out every trace - of iostream (old or new type) from the base library. - Also removed VRPN_NO_NO_STREAMS, which was obviated by - this. - * NIUtil.h : Same. - * nidaqClient.cpp : Same. - -2004-12-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_server.cpp : Guarded min() definition. - -2004-12-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Makes testimager_server as well. - * testimager_server.cpp : Defined min() - -2004-12-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * testimager_server.cpp : Simple server that makes an 8-bit - gray-scale image and sends a changing pattern in it. - * testimager_server.dsp : Same. - -2004-11-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Happy Birthday to me! - * Makefile : Added John Stone's additions to make it compile on - 64-bit Solaris - -2004-10-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added parsing for the config file for a Python joystick - so that the IO port address of the device can be specified - in the configuration file. This lets PC-card ports be used, - which use nonstandard I/O ports even for LPT1 and LPT2. - * vrpn.cfg : Comment in the config file saying how to do this. - * vrpn.cfg.SAMPLE : Same. - -2004-10-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Phantom.h : Hides the GHOST headers again. - -2004-09-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Phantom.C : Added HDCALLBACK definition so that HDAPI will - unambiguously link this the right way. - -2004-09-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - Adding Chris VanderKnyff's changes that enable DLL linkage - for applications. Heading towards enabling C# and other language - support. - - * client_and_server.C : Adding VRPN_CALLBACK. - * daq_server.C : same. - * test_analogfly.C : same. - * test_radamec_spi.C : same. - * vrpn_Phantom.h : same. - * test_vrpn.C : same. - * vrpn.C : same. Also, removed NI code when not compiled in. - * client_and_server.dsp : Making it depend on the project - that causes both VRPN and VRPNDLL projects to be built, rather - than on VRPN. If you try to make it depend on both - VRPN and VRPNDLL, you get linking trouble. - * daq_server.dsp : same. - * test_analogfly.dsp : same. - * test_radamec_spi.dsp : same. - * test_vrpn.dsp : same. - * vrpn_server.dsp : same. - -2004-09-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * client_and_server.dsp : Changing code generation back to DLL - linkage, which turned out to be correct after all. - * daq_server.dsp : Same. - * test_analogfly.dsp : Same. - * test_radamec_spi.dsp : Same. - * test_vrpn.dsp : Same. - * vrpn_phantom.dsp : Same. - * vrpn_server.dsp : Same. - * sierra_router_server.dsp : Same. - * timecode_generator.dsp : Same. - * test_gen_rpc.dsp : Same. - * vrpn.C : Added Tek4662 Poser parser and creator. Whitespace changes. - * vrpn.cfg : Same. Comment changes. - * vrpn.cfg.SAMPLE : Same. - -2004-08-31 Russell M. Taylor II <taylorr@cs.unc.edu> - - * client_and_server.dsp : Changing code generation to use - multithreaded non-DLL for both debug and release. This turns - out to have always been the proper setting to use. - Unfortunately, all apps have to be rebuild with new settings, - and all libraries have to use the same setting. - * daq_server.dsp : Same. - * test_analogfly.dsp : Same. - * test_radamec_spi.dsp : Same. - * test_vrpn.dsp : Same. - * vrpn_phantom.dsp : Same. - * vrpn_server.dsp : Same. - * sierra_router_server.dsp : Same. - * timecode_generator.dsp : Same. - * test_gen_rpc.dsp : Same. - * vrpn.C : Added Tek4662 Poser parser and creator. Whitespace changes. - * vrpn.cfg : Same. Comment changes. - * vrpn.cfg.SAMPLE : Same. - -2004-08-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * NIUtil.cpp : Added another D/A board to the list of known boards. - * vrpn_phantom.dsp : Added C: and D: versions of HDAPI includes. - * vrpn_server.dsp : Same. - -2004-08-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : changes added by Kurt Achatz of A.R.T. to handle - up to four Flysticks on A.R.T. tracker. Also avoids - target renumbering. - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - -2004-07-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * constraint.h : Hiding the HDAPI include files to avoid exposing - the old-style stream header includes to apps that have to - include the server. - * forcefield.h : Same. - * ghost.h : Same. - * plane.C : Same. - * vrpn_Phantom.C : Same. - * vrpn_Phantom.h : Same. - * vrpn_phantom.dsp : Removing GHOST include directories. - * vrpn_server.dsp : Same. - -2004-07-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * BuzzForceField.C : Modified to work with GHOST or HDAPI (partial port) - * BuzzForceField.h : Same. - * constraint.C : Modified to work with GHOST or HDAPI (full port). - * constraint.h : Same. - * forcefield.C : Modified to work with GHOST or HDAPI (full port). - * forcefield.h : Same. - * ghost.h : Added helper classes for port to HDAPI (partial). - * plane.C : Modified to work with GHOST or HDAPI (full port). - * plane.h : Same. - * texture_plane.C : Modified to work with GHOST or HDAPI (partial port). - * texture_plane.h : Same. - * trimesh.C : Modified to work with GHOST or HDAPI (beginning of port). - * trimesh.h : Same. - * vrpn_Phantom.C : Modified to work with GHOST or HDAPI (partial port). - * vrpn_Phantom.h : Same. - * vrpn_phantom.dsp : Modified include paths to look on C or D for GHOST - or HDAPI. Need to remove the GHOST ones if use HDAPI. - * vrpn_server.dsp : Same - -2004-05-23 Russell M. Taylor II <taylorr@cs.unc.edu> - - * NIUtil.cpp : Will return more than one instance of the same - type of device if they are plugged into the same PC. - * NIUtil.h : Comment change. - * vrpn.C : Modified Poser remote to include an entry for the - analog_out name for each channel, rather than one for - the whole device. - * vrpn.cfg : Same. Plus modified entry for DTU/MIC Poser and - Analog_Output devices. - * vrpn.cfg.SAMPLE : Same. - -2004-05-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * NIUtil.cpp : Added description for another board. - * vrpn.C : Added handlers for vrpn_Analog_Output_NI and - vrpn_Poser_Analog. - * vrpn.cfg : Added entries for vrpn_Analog_Output_NI and - vrpn_Poser_Analog. Added entry for settings needed - at DTU/MIC for their optical nanohand control. - -2004-04-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Adding flag to SGI compile in the hope that it would - fix things and let us use the new streams libraries. It - got us part of the way there on my system. - * NIUtil.cpp : Same. - * clock_server.C : Same. - * nidaqClient.cpp : Same. - -2004-04-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * directXFF.C : Using vrpn_gettimeofday() not gettimeofday(). - * nidaqClient.cpp : Same. - * sample_analog.C : Same. - * test_analogfly.C : Same. - * test_vrpn.C : Same. - * vrpn_Phantom.C : Same. - -2004-03-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added a better description of how the -millisleep - option works in Windows and non-Windows environments. - * vrpn_Phantom.C : Adding credits. - * vrpn_Phantom.h : Same. - -2004-01-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Whitespace. - * vrpn_server.dsp : Told it where to find the DTrack include file. - -2004-01-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - Added changes from David Nahon at Virtools. - * vrpn.C : Adds support for the DTrack tracker from - Advanced Realtime Tracking GmbH. - Also modifies the way sleep happens on Windows, - which will free up the time slice used by the process - but not sleep if it is passed 0. Still the same - on Unix. - * vrpn.cfg : Adds entry for DTrack. - * vrpn.cfg.SAMPLE : Same. - -2004-01-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * plane.C : Making this compile with version 3.1 of GHOST - (It was supposed to, but a capitalization error kept - it from actually working). - * texture_plane.C : Same. - * vrpn_phantom.dsp : Modified to include both 4.0 (first) and 3.1 - (second) in include list. This is in the hopes that people - using version 3.1 won't also have 4.0 installed. Otherwise, - they will have to edit this manually. - -2003-12-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added parser for new Flock parameter telling whether - to invert the Quaternion orientation report. Default is - to invert it, which was the previous behavior. - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - -2003-12-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added optional parameter to specify 9 or 10 bytes. - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - -2003-12-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Cleaned up code so that the Liberty tracker server - compiles on several architectures. Removed code that - caused compiler warnings. - -2003-12-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Adds driver submitted by Daniel Myall - from Westco for the Polhemus Liberty tracker. - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - * LibertyLinuxUSB.tar.gz : Instructions for making Linux USB work - with Liberty tracker. - -2003-11-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Removing DOS end-of-lines. - * vrpn.cfg.SAMPLE : Same. - -2003-11-25 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Update from David Nahon fixing the Wanda startup. - * vrpn.cfg.SAMPLE : Same. - -2003-11-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added changes by David Nahon to enable optional use - of the extended-range transmitter (no longer required). - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - -2003-11-14 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added changed by David Nahon that lets - the user specify whether to do a boresight reset at startup. - Also changes the sensor numbers to be zero-indexed like all - other VRPN trackers. Also changes units to meters and - radians to match other VRPN trackers. - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - -2003-09-26 Matt Harvey <m.j.harvey@ucl.ac.uk> - - * vrpn.cfg : Added new joystick device. - * vrpn.C : Added new joystick device. - -2003-09-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_Tracker.cfg : Removed because it caused lots of error - messages. - * vrpn_Tracker.cfg.UNC : Added so that we can remember the - settings for the Phantoms that we use in the systems - at UNC. - -2003-09-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg : Added description for UNC joystick on a - Windows machine. Removed redundant example. - * vrpn_Phantom.C : Made it stop doing planes, meshes, - and effects when the last connection is dropped. - * vrpn_Phantom.h : Same. - -2003-09-26 Blair MacIntyre <blair@cc.gatech.edu> - - * vrpn.cfg.SAMPLE : Added description of the parameters - that could be made to the native-mode Intersense - tracker driver. - * vrpn.cfg : Same. - -2003-09-26 Sebastien MARAUX <maraux@ondim.fr> - - * vrpn_Phantom.C : Added support for InstantBuzzEffect. - * vrpn_Phantom.h : Same. - * vrpn_phantom.dsp : Same. - -2003-09-17 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Fixing things that broke the build. - Bad Russ. No Cookie! - -2003-09-16 Blair MacIntyre <blair@cc.gatech.edu> - - * vrpn.C : Added handlers for wands and other things attached - to the native isense tracker driver to match the ones - that could be connected to the Fastrak version. - -2003-08-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added changes by Sebastien Maraux to include - reading from joysticks in Windows without going - through DirectX. - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - -2003-07-21 Sascha Scholz <sascha.scholz@imk.fraunhofer.de> - - * client_and_server.C : Changed main() to return int. - * test_radamec_spi.C : Changed main() to return int. - * test_vrpn.C : Changed main() to return int. - -2003-07-07 Sascha Scholz <sascha.scholz@imk.fraunhofer.de> - - * vrpn.cfg : added ADBox/CubicMouse driver - -2003-06-20 David Marshburn <marshbur@cs.unc.edu> - - * plane.C: uses Ghost 4.0/3.1 syntax depending on VRPN_USE_GHOST_31 - * texture_plane.C: same - * vrpn_Phantom.C: same - -2003-06-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_server.dsp : Removed isense.c file (this file is included - in the vrpn_Tracker_isense.C file in the library, so putting - it in here again is duplication that causes the link to - fail. - -2003-06-20 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Changes to enable opening InterSense tracker on - an arbitrary port (even USB). - * vrpn.cfg : Same. - * vrpn.cfg.SAMPLE : Same. - * vrpn_server.dsp : Modified to work with isense library files - in ../../isense. - -2003-06-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.cfg.SAMPLE : Comments to avoid confusion. - * vrpn.cfg : Same. - -2003-05-30 David Marshburn <marshbur@cs.unc.edu> - - These changes move vrpn from Ghost 3.1 to Ghost 4.0. - * plane.C: uses new isTouchableByPhantom function - * texture_plane.C: uses new isTouchableByPhantom function - * vrpn_Phantom.C: removes the use of the setQuitByDefault - function, which has been removed from Ghost 4.0. The servo - loops now restart themselves. - * vrpn_phantom.dsp: Ghost 4.0 include paths. - -2003-05-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * daq_server.dsp : Compiles with libraries in their new location - within the external directory. - -2003-04-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Includes files needed to build Phantom server. - * Makefile.phan.sgi_irix.n32.mips4 : No longer needed. - -2003-04-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * buzzForceField.C : Included only if VRPN_USE_PHANTOM_SERVER defined. - * buzzForceField.h : Included only if VRPN_USE_PHANTOM_SERVER defined. - * constraint.C : Included only if VRPN_USE_PHANTOM_SERVER defined. - * constraint.h : Included only if VRPN_USE_PHANTOM_SERVER defined. - * forcefield.C : Included only if VRPN_USE_PHANTOM_SERVER defined. - * forcefield.h : Included only if VRPN_USE_PHANTOM_SERVER defined. - * ghost.h : Included only if VRPN_USE_PHANTOM_SERVER defined. - * phantom.C : Included only if VRPN_USE_PHANTOM_SERVER defined. - * phan_server.dsp : Not needed any more (included in vrpn_server). - * phantom.C : Not needed any more (included in vrpn_server). - * phantom.cfg : Not needed any more (included in vrpn_server). - * plane.C : Included only if VRPN_USE_PHANTOM_SERVER defined. - * plane.h : Included only if VRPN_USE_PHANTOM_SERVER defined. - * texture_plane.C : Included only if VRPN_USE_PHANTOM_SERVER defined. - * texture_plane.h : Included only if VRPN_USE_PHANTOM_SERVER defined. - * vrpn_Phantom.C : Included only if VRPN_USE_PHANTOM_SERVER defined. - * vrpn_Phantom.h : Included only if VRPN_USE_PHANTOM_SERVER defined. - * vrpn.C : Now includes Phantom server. - * vrpn.cfg : Now includes Phantom server. - * vrpn.cfg.SAMPLE : Now includes Phantom server. - -2003-04-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * test_analogfly.C : Test program for analogfly that - deletes the objects. - -2003-03-05 Russell M. Taylor II <taylorr@cs.unc.edu> - - * plane.C : Inserting changes made by Marc Baaden. - Fixes the capitalization on an #include statement. - * buzzForceField.C : Inserting changes made by Marc Baaden. - Changes to make it compile on an SGI using GHOST 3.1. - * buzzForceField.h : Inserting changes made by Marc Baaden. - Changes to make it compile on an SGI using GHOST 3.1. - * texture_plane.C : Inserting changes made by Marc Baaden. - Fixes the capitalization on an #include statement. - Changes to make it compile on an SGI using GHOST 3.1. - * texture_plane.h : Inserting changes made by Marc Baaden. - Changes to make it compile on an SGI using GHOST 3.1. - * trimesh.h : Inserting changes made by Marc Baaden. - Fixes the capitalization on an #include statement. - Changes to make it compile on an SGI using GHOST 3.1. - * Makefile.phan.sgi_irix.n32.mips4 : Makefile for SGI with GHOST 3.1. - * SGI_GHOST_EXTRAS : Directory containing files from Marc Baaden. - Extras for getting things running on an SGI using GHOST 3.1. - -2003-01-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * directXFF.C : Comments. Modified to compile without warnings. - * directXFF_server.dsp : Modified to have the libraries specified in - the vrpn_Config.h file. - -2003-01-15 Alexandra Bokinsky <bokinsky@cs.unc.edu> - - * directXFF.C : Server for Direct X joystick in case you don't want - to run the vrpn_server program with special config file. - * directXFF_server.dsp : File to build the above server. - -2003-01-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added code to use a ButtonFly and Global Haptics GeoOrb. - Fixed string format conversion for Magellan so that - it will accept the alternative reset string. - Guarded const definitions to avoid compiler warnings. - * vrpn.cfg : Added sample description of ButtonFly and Orb. - * vrpn.cfg.SAMPLE : Same. - -2002-12-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added Deepak's code to run fastraks that have a stylus - with a button on them. - * vrpn.cfg.SAMPLE : Same. Also modified examples for AnalogFly to - use correct term. Also fixed comments. - -2002-12-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * client_and_server.dsp : DSP files have been modified to not do - definitions of VRPN_NO_STREAMS and other constants directly, - rather these are now set by editing vrpn_Configure.h. Also, - made projects compile in both debug and release versions. - * daq_server.dsp : Same. - * phan_server.dsp : Same. - * test_analogfly.dsp : Same. - * test_radamec_spi.dsp : Same. - * test_vrpn.dsp : Same. - * vrpn_phantom.dsp : Same. - * vrpn_server.dsp : Same. - * vrpn.C : Comment fix. More useful error messages. Whitespace - changes. - * vrpn.cfg.SAMPLE : Comment fixes for vrpn_AnalogFly. - - -2002-09-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added "altreset" parameter to Magellan startup. - * vrpn.cfg.SAMPLE : Added example of alt reset and more info for - Magellan. - -2002-08-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Deleted whitespace. - * vrpn.cfg : Added examples for force-feedback joystick. - * vrpn.cfg.SAMPLE : Added examples for force-feedback joystick. - -2002-08-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_server.dsp : Adds in definition of VRPN_USE_DIRECTINPUT to - enable the compilation of force-feedback joystick code under - DirectX (this first implementation doesn't use force feedback, - just reads from the joystick). Remove this definition from - VRPN and from vrpn_server to compile without the DirectX 8.0 - SDK. - * vrpn.C : Adds in code to read and control a DirectX Force Feedback - joystick. - -2002-07-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * phantom.C : Making the Phantom server sleep 1ms between - main loops so that it doesn't eat a whole CPU - doing busy-waits. - -2002-07-09 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Removed seldom-used servers that don't compile on - all architectures - -2002-05-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added code to enable controlling an Intersense tracker - * vrpn.cfg : Same - * vrpn.cfg.SAMPLE : Same - -2002-05-03 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added code to enable controlling a Zaber linear actuator. - * vrpn.cfg : Same - * vrpn.cfg.SAMPLE : Same - -2002-03-20 Aron Helser <helser@cs.unc.edu> - - * test_analogfly.C (main): Replaced cerr with fprintf. - * vrpn_phantom.dsp: Standardized settings, object files live in - ../pc_win32/server_src . - - * client_and_server.dsp: moved here, standardized settings, object - files live in ../pc_win32/server_src - * daq_server.dsp: same - * test_analogfly.dsp: same - * vrpn_server.dsp: same - * vrpn_server_with_timecode.dsp: same - -2002-03-13 Aron Helser <helser@cs.unc.edu> - - * vrpn_Phantom.h: Avoid ghost includes here, instead declare - classes, and include in .C file. Allows apps that use vrpn_phantom - lib to not include Ghost headers, and non-standard ghost-stl. - -2002-01-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added code from John Stone to enable using Spaceballs. - -2001-11-13 Russell M. Taylor II <taylorr@cs.unc.edu> - - * daq_server.C : Added ability to set range from command line. - -2001-06-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * daq_server.C : Added (runs a D/A server for UNC 3DFM) - * NIUtil.h : Added, support files - * NIUtil.cpp : Added, support files - -2001-06-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * constraint.h : Massive cleanup - * forcefield.C : Massive cleanup - * forcefield.h : Massive cleanup - * phan_server.dsp : Massive cleanup - * plane.C : Massive cleanup - * test_analogfly.C : Massive cleanup - * texture_plane.C : Massive cleanup - * texture_plane.h : Massive cleanup - * vrpn_Phantom.C : Massive cleanup - * vrpn_Phantom.h : Massive cleanup - -2001-06-02 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Added code to drive the buttons on a PC mouse treated as - a serial device. Also added code to run a TNG3. - * vrpn.cfg.SAMPLE : Example startup code for these devices. - -2001-06-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Adding code to drive a 5DT glove sent by DAVID Philippe. - Added code to run PC joysticks under Linux. - * vrpn.cfg.SAMPLE : Added example of starting a 5DT glove. - Added example of starting a PC joystick under Linux. - -2001-06-01 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Moved the code from the timecode generator version of - the VRPN server into here, guarded by INCLUDE_TIMECODE_SERVER - definitions so that it won't go in for the default build. - - * vrpn_with_timecode.C : Removed (its functions have been moved into - the default server, as described above). - -2001-05-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C (setup_Magellan) : Counts the number of magellans, rather - than the number of cereals. - -2001-02-14 Tom Hudson <hudson@cs.unc.edu> - - * vrpn.C : remove g_logMode, change g_logName to g_inLogName, - add g_outLogName. - (Usage) : change output to match new arguments for logging. - (main) : parse and process new arguments for logging. - -2001-02-07 Kwan Torrich Skinner <skinner@cs.unc.edu> - - * server_src/timecode_generator_server (all) : new files for a -AEC_NTTC timecode reader board. Win32 specific. - * server_src/pc_win32/vrpn_server_with_timecode (all) : same. - -2000-11-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C (shutDown) (handle_dlc) (sighandler) : - Rewrote so they all call the same shutDown() routine, and - to handle the case where ^C is handled in a separate thread - (Windows does this). - -2000-10-20 Aron Helser <helser@cs.unc.edu> - - * server_src/vrpn_Phantom.C (phantomErrorHandler): Adds error code - for force error discovered by using a debugger - undocumented in GHOST? - -2000-10-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Set default sleep back to 0 milliseconds - -2000-10-11 Tom Hudson <hudson@cs.unc.edu> - - * vrpn.C : add vrpn_RedundantTransmission, vrpn_RedundantController - (setup_Tracker_NULL) : call setRedundantTransmission() - (main) : create vrpn_RedundantTransmission, vrpn_RedundantController, - call mainloops - -2000-08-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile.remote : Removed; use Makefile. - - * vrpn.rc : Brown's startup code for Linux - - * Makefile : Added AIX compile - - * vrpn.C : Added Wanda code. Added code to handle MS-DOS - formatting for Fastrak startup. - -2000-08-28 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C : Replaced 512 with LINESIZE throughout - Added a Wanda device loader - -2000-08-24 Russell M. Taylor II <taylorr@cs.unc.edu> - - * sierra_router_server : New directory with router server in it - This server only compiles on PCs - -2000-08-12 Russell M. Taylor II <taylorr@cs.unc.edu> - - * Makefile : Added test_analogfly compile - - * vrpn.C : Made default millisleep be 1 millisecond - Added parameters to vrpn_Tracker_AnalogFly - - * vrpn.cfg : Updated AnalogFly -- LOOK AT THIS IF YOU ARE USING!!! - Added "absolute/differential" and per-axis offset - -2000-08-11 Russell M. Taylor II <taylorr@cs.unc.edu> - - * test_radamec_spi.C : Added baud rate specification - - * vrpn.C : Added code for ImmersionBox and Radamec_SPI - -2000-08-10 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn.C (setup_Tracker_Fastrak): Handles an IS600 line extension - (the IS900 code had broken it) - diff --git a/src/vrpn/server_src/LibertyLinuxUSB.tar.gz b/src/vrpn/server_src/LibertyLinuxUSB.tar.gz deleted file mode 100644 index 1710fcf00802ef8efd81417b69d99f3e81d66f61..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/LibertyLinuxUSB.tar.gz and /dev/null differ diff --git a/src/vrpn/server_src/Makefile b/src/vrpn/server_src/Makefile deleted file mode 100644 index 53f1ca8548f217a36427780d0336566e3e788377..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/Makefile +++ /dev/null @@ -1,504 +0,0 @@ -# this is a gmake file - -########################## -# common definitions. For non-UNC sites, uncomment one of the lines -# that defines hw_os for the machine you are on in the section just -# below. Then, the code should compile in your environment. -# -#HW_OS := sgi_irix -#HW_OS := sparc_solaris -#HW_OS := sparc_solaris_64 -#HW_OS := hp700_hpux10 -#HW_OS := pc_linux -HW_OS := pc_linux64 -#HW_OS := pc_linux_ia64 -# Try using this to cross-compile for ARM on a PC running Linux -#HW_OS := pc_linux_arm -# Try using this to cross-compile for ARM on a PC running Cygwin -#HW_OS := pc_cygwin_arm -#HW_OS := pc_cygwin -#HW_OS := pc_FreeBSD -#HW_OS := powerpc_aix -#HW_OS := powerpc_macosx -#HW_OS := universal_macosx -#HW_OS := macosx_32_64 -#HW_OS := macosx_64 -########################## - -########################## -# Mac OS X-specific options. If HW_OS is powerpc_macosx or universal_macosx, -# uncomment one line below to choose the minimum targeted OS X version and -# corresponding SDK. If none of the lines below is commented out, 10.5 will -# be the minimum version. -########################## -#MAC_OS_MIN_VERSION := 10.4 -#MAC_OS_MIN_VERSION := 10.5 -#MAC_OS_MIN_VERSION := 10.6 -#MAC_OS_MIN_VERSION := 10.7 -#MAC_OS_MIN_VERSION := 10.8 - -########################## -# Directories for installation - -INSTALL_DIR := /usr/local -BIN_DIR := $(INSTALL_DIR)/bin -INCLUDE_DIR := $(INSTALL_DIR)/include -LIB_DIR := $(INSTALL_DIR)/lib - -ifndef HW_OS -# hw_os does not exist on FreeBSD at UNC -UNAME := $(shell uname -s) -ifeq ($(UNAME), FreeBSD) - HW_OS := pc_FreeBSD -else - # pc_cygwin doesn't have HW_OS - ifeq ($(UNAME), CYGWIN_NT-4.0) - HW_OS := pc_cygwin - # On cygwin make is gmake (and gmake doesn't exist) - MAKE := make -f $(MAKEFILE) - else - ifeq ($(UNAME), CYGWIN_98-4.10) - HW_OS := pc_cygwin - MAKE := make -f $(MAKEFILE) - else - HW_OS := $(shell hw_os) - endif - endif -endif -endif - -# check if its for pxfl -ifdef PBASE_ROOT - HW_OS := hp_flow - ifeq ($(PXFL_COMPILER), aCC) - HW_OS = hp_flow_aCC - endif -endif - - ifneq (,$(findstring macosx,$(HW_OS))) - ifndef MAC_OS_MIN_VERSION - MAC_OS_MIN_VERSION := 10.5 - endif - - # Select which compiler and MAC OS X SDK to use - MAC_GCC := g++ - ifeq ($(MAC_OS_MIN_VERSION), 10.8) - MAC_OS_SDK := MacOSX10.8.sdk - else - ifeq ($(MAC_OS_MIN_VERSION), 10.7) - MAC_OS_SDK := MacOSX10.7.sdk - else - ifeq ($(MAC_OS_MIN_VERSION), 10.6) - MAC_OS_SDK := MacOSX10.6.sdk - else - ifeq ($(MAC_OS_MIN_VERSION), 10.5) - MAC_OS_SDK := MacOSX10.5.sdk - else - MAC_OS_SDK := MacOSX10.4u.sdk - MAC_GCC := g++-4.0 - endif - endif - endif - endif -endif - -CC := g++ -ifeq ($(HW_OS),pc_cygwin) - SYSLIBS := -lcygwin -luser32 -lgdi32 -lcomdlg32 -lwsock32 -lSetupApi -endif -ifeq ($(HW_OS),sparc_solaris) - CC := /opt/SUNWspro/bin/CC - SYSLIBS := -lsocket -lnsl -endif -ifeq ($(HW_OS),sparc_solaris_64) - CC := /opt/SUNWspro/bin/CC -xarch=v9a - SYSLIBS := -lsocket -lnsl -endif -ifeq ($(HW_OS),powerpc_aix) -# CC := /usr/ibmcxx/bin/xlC_r -g -qarch=pwr3 -w - CC := /usr/ibmcxx/bin/xlC_r $(DEBUG_FLAGS) -qarch=pwr3 -w -endif - -ifeq ($(HW_OS), powerpc_macosx) - CC := $(MAC_GCC) -arch ppc -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - RANLIB := ranlib - AR := libtool -static -o - SYSLIBS := -framework CoreFoundation -framework IOKit -framework System -endif - -ifeq ($(HW_OS),universal_macosx) - CC := $(MAC_GCC) -arch ppc -arch i386 -arch x86_64 -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - RANLIB := : - AR := libtool -static -o - SYSLIBS := -framework CoreFoundation -framework IOKit -framework System -endif - - ifeq ($(HW_OS), macosx_32_64) - CC := $(MAC_GCC) -arch i386 -arch x86_64 -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - RANLIB := : - AR := libtool -static -o - SYSLIBS := -framework CoreFoundation -framework IOKit -framework System - endif - - ifeq ($(HW_OS), macosx_64) - ifeq ($(MAC_OS_SDK), MacOSX10.6.sdk) - CC := $(MAC_GCC) -arch x86_64 -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - else - CC := $(MAC_GCC) -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION) - endif - RANLIB := : - AR := libtool -static -o - SYSLIBS := -framework CoreFoundation -framework IOKit -framework System - endif - -ifeq ($(HW_OS),pc_linux_ia64) - CC := g++ - SYSLIBS := -endif -ifeq ($(HW_OS),pc_linux64) - CC := g++ -m64 - SYSLIBS := -endif -ifeq ($(HW_OS), pc_linux_arm) - CC := arm-linux-g++ - RANLIB := arm-linux-ranlib - AR := arm-linux-ar ruv -endif -ifeq ($(HW_OS), pc_cygwin_arm) - CC := arm-unknown-linux-gnu-g++ - RANLIB := arm-unknown-linux-gnu-ranlib - AR := arm-unknown-linux-gnu-ar ruv -endif -ifeq ($(HW_OS),pc_linux) - SYSLIBS := -# For WiiMote -# SYSLIBS := -lwiiuse -# For GPM mouse -# SYSLIBS := -lgpm -# For Isense libraries -# SYSLIBS := -ldl -# For Freespace Devices -# SYSLIBS := -lfreespace -# For HID devices -# SYSLIBS := -lusb-1.0 -endif -ifeq ($(HW_OS),pc_linux64) - SYSLIBS := -# For WiiMote -# SYSLIBS := -lwiiuse -# For GPM mouse -# SYSLIBS := -lgpm -# For Isense libraries -# SYSLIBS := -ldl -# For Freespace Devices -# SYSLIBS := -lfreespace -endif - -ifeq ($(HW_OS),sgi_irix) - ifndef SGI_ABI - SGI_ABI := n32 - endif - ifndef SGI_ARCH - SGI_ARCH := mips3 - endif - OBJECT_DIR_SUFFIX := .$(SGI_ABI).$(SGI_ARCH) - CC := CC -$(SGI_ABI) -$(SGI_ARCH) -LANG:std - GL := -lgl -endif - -ifeq ($(HW_OS),hp700_hpux10) - CC := CC +a1 -endif -ifeq ($(HW_OS),sparc_sunos) - CC := /usr/local/lib/CenterLine/bin/CC -endif - -ifeq ($(HW_OS), hp_flow_aCC) - CC := /opt/aCC/bin/aCC -endif - -OBJ_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX) -LIB_DIR := ../$(OBJ_DIR) - -# Jean SIMARD <jean.simard@limsi.fr> -# Definition of the 'TRUE' and 'FALSE' constant for Linux (by default, they are -# defined in <windows.h>) -# XXX This would be better done in the .h/.C files with #ifndef -override CFLAGS := $(CFLAGS) -I./ -I../ -I../quat -I../../libfreespace/include $(DEBUG_FLAGS) $(CFLAGS) -DTRUE=true =DFALSE=false -override CXXFLAGS := $(CXXFLAGS) -I./ -I../ -I../quat -I../../libfreespace/include $(DEBUG_FLAGS) $(CXXFLAGS) -override LFLAGS := $(LFLAGS) -L$(LIB_DIR) -L../quat/$(HW_OS)$(OBJECT_DIR_SUFFIX) $(LDFLAGS) -VRPN_LIBS = -lvrpnserver -lvrpnatmel -lvrpngpsnmea -lpthread - -# Uncomment the following section and point them at the -# currect diretories to compile with HDAPI under Cygwin. -# Well, to make it almost compile -- link fails to find things -# in the libraries that should be there. -#HDAPI_ROOT := "C:/Program Files/SensAble/3DTouch" - -# Jean SIMARD <jean.simard@limsi.fr> -# This is only for the PHANToM server on Linux (not tested on other plateform) -# Put in comment if you don't want a PHANToM server -#override CFLAGS += -I$(HDAPI_ROOT)/include -I$(HDAPI_ROOT)/utilities/include -#override CXXFLAGS += -I$(HDAPI_ROOT)/include -I$(HDAPI_ROOT)/utilities/include -#override LFLAGS += -L$(HDAPI_ROOT)/lib -#SYSLIBS := $(SYSLIBS) -lHL -lHD -lHLU -lHDU - -# This is for the PHANToM/GHOST server on SGI (not tested on other plateform) -# Put in comment if you don't want a PHANToM server. GHOST expects SGI to -# be defined during compile, whereas sgi seems to be the standard definition. -#override CFLAGS += -I/usr/local/SensAble/GHOST/v31/include -DSGI -#override CXXFLAGS += -I/usr/local/SensAble/GHOST/v31/include -DSGI -#override LFLAGS += -L/usr/local/SensAble/GHOST/v31/lib -#SYSLIBS := $(SYSLIBS) -lghost31_32 - -ifdef INTERSENSE - ifeq ($(HW_OS),powerpc_macosx) -# CFLAGS = -g -I../ -I../../quat -I../../isense -DMACOSX - override CFLAGS += -I../../isense -DMACOSX - override CXXFLAGS += -I../../isense -DMACOSX - override LFLAGS += ../../isense/MacOSX/dlcompat.o - endif - ifeq ($(HW_OS),universal_macosx) -# CFLAGS = -g -I../ -I../../quat -I../../isense -DMACOSX - override CFLAGS += -I../../isense -DMACOSX - override CXXFLAGS += -I../../isense -DMACOSX - override LFLAGS += ../../isense/MacOSX/dlcompat.o - - endif -endif - -#uncomment the following lines to include the PHASESPACE library -#PHASESPACE := -L../../phasespace -lowlsock -#CXXFLAGS += -I../../phasespace -#CFLAGS += -I../../phasespace - -ifdef PHASESPACE -#the rpath option may not work on all platforms, remove it if necessary. -EXTRAOPTS := -Wl,-rpath . -override LFLAGS += $(PHASESPACE) $(EXTRAOPTS) -endif - -.SUFFIXES: .cpp - -.C.o: - $(CC) $(CXXFLAGS) -c $*.C - -.c.o: - $(CC) $(CFLAGS) -c $*.c - -.cpp.o: - $(CC) $(CXXFLAGS) -c $*.cpp - -$(OBJ_DIR)/%.o: %.c - @[ -d $(OBJ_DIR) ] || mkdir -p $(OBJ_DIR) - $(CC) $(CFLAGS) -o $@ -c $< - -$(OBJ_DIR)/%.o: %.C - @[ -d $(OBJ_DIR) ] || mkdir -p $(OBJ_DIR) - $(CC) $(CXXFLAGS) -o $@ -c $< - -$(OBJ_DIR)/%.o: %.cpp - @[ -d $(OBJ_DIR) ] || mkdir -p $(OBJ_DIR) - $(CC) $(CXXFLAGS) -o $@ -c $< - -INSTALL_APPS := vrpn_server test_vrpn -APPS := $(INSTALL_APPS) client_and_server test_mutexServer test_peerMutex \ -test_radamec_spi test_analogfly testimager_server test_auxiliary_logger \ -test_logging testSharedObjectServer -# test_freespace -# - -all: $(APPS) - -.PHONY: vrpn_server -vrpn_server: $(OBJ_DIR)/vrpn_server - -.PHONY: test_radamec_spi -test_radamec_spi: $(OBJ_DIR)/test_radamec_spi - -.PHONY: testimager_server -testimager_server: $(OBJ_DIR)/testimager_server - -.PHONY: test_logging -test_logging: $(OBJ_DIR)/test_logging - -.PHONY: test_freespace -test_freespace: $(OBJ_DIR)/test_freespace - -.PHONY: test_auxiliary_logger -test_auxiliary_logger: $(OBJ_DIR)/test_auxiliary_logger - -.PHONY: test_analogfly -test_analogfly: $(OBJ_DIR)/test_analogfly - -.PHONY: test_vrpn -test_vrpn: $(OBJ_DIR)/test_vrpn - -.PHONY: client_and_server -client_and_server: $(OBJ_DIR)/client_and_server - -.PHONY: sample_server -sample_server: $(OBJ_DIR)/sample_server - -.PHONY: test_mutexServer -test_mutexServer: $(OBJ_DIR)/test_mutexServer - -.PHONY: test_peerMutex -test_peerMutex: $(OBJ_DIR)/test_peerMutex - -.PHONY: sample_analog -sample_analog: $(OBJ_DIR)/sample_analog - -.PHONY: forward -forward: $(OBJ_DIR)/forward - -.PHONY: textServer -textServer: $(OBJ_DIR)/textServer - -.PHONY: last_of_sequence -last_of_sequence: $(OBJ_DIR)/last_of_sequence - -.PHONY: testSharedObjectServer -testSharedObjectServer: $(OBJ_DIR)/testSharedObjectServer - -$(OBJ_DIR)/InstantBuzzEffect.o: ghostEffects/InstantBuzzEffect.cpp - $(CC) $(CXXFLAGS) -o $@ -c $< - -$(OBJ_DIR)/vrpn_server: $(OBJ_DIR)/vrpn.o $(LIB_DIR)/libvrpnserver.a \ - $(OBJ_DIR)/buzzForceField.o $(OBJ_DIR)/constraint.o \ - $(OBJ_DIR)/forcefield.o $(OBJ_DIR)/plane.o \ - $(OBJ_DIR)/texture_plane.o $(OBJ_DIR)/trimesh.o \ - $(OBJ_DIR)/vrpn_Phantom.o \ - $(OBJ_DIR)/InstantBuzzEffect.o \ - $(OBJ_DIR)/vrpn_Generic_server_object.o - $(CC) $(LFLAGS) -o $(OBJ_DIR)/vrpn_server $(OBJ_DIR)/vrpn.o \ - $(OBJ_DIR)/buzzForceField.o $(OBJ_DIR)/constraint.o \ - $(OBJ_DIR)/forcefield.o $(OBJ_DIR)/plane.o \ - $(OBJ_DIR)/texture_plane.o $(OBJ_DIR)/trimesh.o \ - $(OBJ_DIR)/vrpn_Phantom.o \ - $(OBJ_DIR)/InstantBuzzEffect.o \ - $(OBJ_DIR)/vrpn_Generic_server_object.o \ - $(VRPN_LIBS) $(GL) -lquat $(SYSLIBS) -lm - -$(OBJ_DIR)/test_vrpn: $(OBJ_DIR)/test_vrpn.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/test_vrpn \ - $(OBJ_DIR)/test_vrpn.o \ - $(VRPN_LIBS) $(GL) -lquat $(SYSLIBS) -lm - -$(OBJ_DIR)/test_radamec_spi: $(OBJ_DIR)/test_radamec_spi.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/test_radamec_spi \ - $(OBJ_DIR)/test_radamec_spi.o \ - $(VRPN_LIBS) $(GL) -lquat $(SYSLIBS) -lm - -$(OBJ_DIR)/testimager_server: $(OBJ_DIR)/testimager_server.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/testimager_server \ - $(OBJ_DIR)/testimager_server.o \ - $(VRPN_LIBS) $(GL) -lquat $(SYSLIBS) -lm - -$(OBJ_DIR)/test_auxiliary_logger: $(OBJ_DIR)/test_auxiliary_logger.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/test_auxiliary_logger \ - $(OBJ_DIR)/test_auxiliary_logger.o \ - $(VRPN_LIBS) $(GL) -lquat $(SYSLIBS) -lm - -$(OBJ_DIR)/test_logging: $(OBJ_DIR)/test_logging.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/test_logging \ - $(OBJ_DIR)/test_logging.o \ - $(VRPN_LIBS) $(GL) -lquat $(SYSLIBS) -lm - -$(OBJ_DIR)/test_freespace: $(OBJ_DIR)/test_freespace.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/test_freespace \ - $(OBJ_DIR)/test_freespace.o \ - $(VRPN_LIBS) $(GL) -lquat $(SYSLIBS) -lm - -$(OBJ_DIR)/test_analogfly: $(OBJ_DIR)/test_analogfly.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/test_analogfly \ - $(OBJ_DIR)/test_analogfly.o \ - $(VRPN_LIBS) $(GL) -lquat $(SYSLIBS) -lm - -$(OBJ_DIR)/client_and_server: $(OBJ_DIR)/client_and_server.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/client_and_server \ - $(OBJ_DIR)/client_and_server.o \ - $(VRPN_LIBS) $(GL) -lquat $(SYSLIBS) -lm - -$(OBJ_DIR)/forward: $(OBJ_DIR)/forward.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/forward \ - $(OBJ_DIR)/forward.o \ - $(VRPN_LIBS) $(SYSLIBS) -lm - -$(OBJ_DIR)/textServer: $(OBJ_DIR)/textServer.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/textServer \ - $(OBJ_DIR)/textServer.o \ - $(VRPN_LIBS) $(SYSLIBS) -lm - -$(OBJ_DIR)/sample_server: $(OBJ_DIR)/sample_server.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/sample_server \ - $(OBJ_DIR)/sample_server.o \ - $(VRPN_LIBS) $(SYSLIBS) -lm - -$(OBJ_DIR)/test_mutexServer: $(OBJ_DIR)/test_mutexServer.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/test_mutexServer \ - $(OBJ_DIR)/test_mutexServer.o \ - $(VRPN_LIBS) $(SYSLIBS) -lm - -$(OBJ_DIR)/test_peerMutex: $(OBJ_DIR)/test_peerMutex.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/test_peerMutex \ - $(OBJ_DIR)/test_peerMutex.o \ - $(VRPN_LIBS) $(SYSLIBS) -lm - -$(OBJ_DIR)/sample_analog: $(OBJ_DIR)/sample_analog.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/sample_analog \ - $(OBJ_DIR)/sample_analog.o \ - $(VRPN_LIBS) $(SYSLIBS) -lm - -$(OBJ_DIR)/last_of_sequence: $(OBJ_DIR)/last_of_sequence.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/last_of_sequence \ - $(OBJ_DIR)/last_of_sequence.o \ - $(VRPN_LIBS) $(SYSLIBS) -lm - - -$(OBJ_DIR)/testSharedObjectServer: $(OBJ_DIR)/testSharedObjectServer.o \ - $(LIB_DIR)/libvrpnserver.a - $(CC) $(LFLAGS) -o $(OBJ_DIR)/testSharedObjectServer \ - $(OBJ_DIR)/testSharedObjectServer.o \ - $(VRPN_LIBS) $(SYSLIBS) -lm - -install: all - -mkdir -p $(BIN_DIR) - ( cd $(BIN_DIR) ; rm -f $(INSTALL_APPS) ) - ( cd $(OBJ_DIR) ; cp $(INSTALL_APPS) $(BIN_DIR) ) - ( cd $(BIN_DIR) ; strip $(INSTALL_APPS) ) - -uninstall: - ( cd $(BIN_DIR) ; rm -f $(INSTALL_APPS) ) - -clean: -ifeq ($(HW_OS),) - echo "Must specify HW_OS !" -else - rm -f $(OBJ_DIR)/* -endif - -$(OBJ_DIR)/vrpn.o: vrpn.C -$(OBJ_DIR)/vrpn_Generic_server_object.o: vrpn_Generic_server_object.C -$(OBJ_DIR)/forward.o: forward.C -$(OBJ_DIR)/textServer.o: textServer.C -$(OBJ_DIR)/sample_server.o: sample_server.C -$(OBJ_DIR)/test_mutexServer.o: test_mutexServer.C -$(OBJ_DIR)/test_peerMutex.o: test_peerMutex.C -$(OBJ_DIR)/sample_analog.o: sample_analog.C - diff --git a/src/vrpn/server_src/NIUtil.cpp b/src/vrpn/server_src/NIUtil.cpp deleted file mode 100644 index c297ac86f58d01ef024da674244f208f7c570b23..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/NIUtil.cpp +++ /dev/null @@ -1,220 +0,0 @@ -#include "NIUtil.h" - -const short Max_NIDAQ_Devices(10); - -// This array keeps track of whether a particular device has been -// returned by the findDevice() function. It prevents the same -// device from being found twice, enabling the program to open more -// than one device of the same type on the same computer - -static bool opened_already[Max_NIDAQ_Devices]; - -namespace NIUtil -{ - const char *nameCodeToString - ( - int code - ) - { - const char *name = NULL; - - - switch (code) - { - // The folling table comes from: - // National Instruments(TM) - // NI-DAQ(TM) Function Reference Manual for PC Compatibles - // Version 6.6 - // August 1999 Edition - // Part Number 321645E-01 - // Chapter 2 Function Reference - // Init_DA_Brds : pages 2-274 - 2-277 - // Entries were added based on later versions of the manual. - - case -1: name = "Not a National Instruments DAQ device"; break; - case 7: name = "PC-DIO-24"; break; - case 8: name = "AT-DIO-32F"; break; - case 12: name = "PC-DIO-96"; break; - case 13: name = "PC-LPM-16"; break; - case 14: name = "PC-TIO-10"; break; - case 15: name = "AT-AO-6"; break; - case 25: name = "AT-MIO-16E-2"; break; - case 26: name = "AT-AO-10"; break; - case 27: name = "AT-A2150C"; break; - case 28: name = "Lab-PC+"; break; - case 30: name = "SCXI-1200"; break; - case 31: name = "DAQCard-700"; break; - case 32: name = "NEC-MIO-16E-4"; break; - case 33: name = "DAQPad-1200"; break; - case 35: name = "DAQCard-DIO-24"; break; - case 36: name = "AT-MIO-16E-10"; break; - case 37: name = "AT-MIO-16DE-10"; break; - case 38: name = "AT-MIO-64E-3"; break; - case 39: name = "AT-MIO-16XE-50"; break; - case 40: name = "NEC-AI-16E-4"; break; - case 41: name = "NEC-MIO-16XE-50"; break; - case 42: name = "NEC-AI-16XE-50"; break; - case 43: name = "DAQPad-MIO-16XE-50"; break; - case 44: name = "AT-MIO-16E-1"; break; - case 45: name = "PC-OPDIO-16"; break; - case 46: name = "PC-AO-2DC"; break; - case 47: name = "DAQCard-AO-2DC"; break; - case 48: name = "DAQCard-1200"; break; - case 49: name = "DAQCard-500"; break; - case 50: name = "AT-MIO-16XE-10"; break; - case 51: name = "AT-AI-16XE-10"; break; - case 52: name = "DAQCard-AI-16XE-50"; break; - case 53: name = "DAQCard-AI-16E-4"; break; - case 54: name = "DAQCard-516"; break; - case 55: name = "PC-516"; break; - case 56: name = "PC-LPM-16PnP"; break; - case 57: name = "Lab-PC-1200"; break; - case 58: name = "Lab-PC-1200AI"; break; - case 59: name = "VXI-MIO-64E-1"; break; - case 60: name = "VXI-MIO-64XE-10"; break; - case 61: name = "VXI-AO-48XDC"; break; - case 62: name = "VXI-DIO-128"; break; - case 65: name = "PC-DIO-24PnP"; break; - case 66: name = "PC-DIO-96PnP"; break; - case 67: name = "AT-DIO-32HS"; break; - case 68: name = "PXI-6533"; break; - case 75: name = "DAQPad-6507/6508"; break; - case 76: name = "DAQPad-6020E for USB"; break; - case 88: name = "DAQCard-6062E"; break; - case 90: name = "DAQCard-6023E"; break; - case 91: name = "DAQCard-6024E"; break; - case 200: name = "PCI-DIO-96"; break; - case 201: name = "PCI-1200"; break; - case 202: name = "PCI-MIO-16XE-50"; break; - case 204: name = "PCI-MIO-16XE-10"; break; - case 205: name = "PCI-MIO-16E-1"; break; - case 206: name = "PCI-MIO-16E-4"; break; - case 207: name = "PXI-6070E"; break; - case 208: name = "PXI-6040E"; break; - case 209: name = "PXI-6030E"; break; - case 210: name = "PXI-6011E"; break; - case 211: name = "PCI-DIO-32HS"; break; - case 215: name = "DAQCard-6533"; break; - case 220: name = "PCI-6031E (MIO-64XE-10)"; break; - case 221: name = "PCI-6032E (AI-16XE-10)"; break; - case 222: name = "PCI-6033E (AI-64XE-10)"; break; - case 223: name = "PCI-6071E (MIO-64E-1)"; break; - case 232: name = "PCI-6602"; break; - case 233: name = "PCI-4451"; break; - case 234: name = "PCI-4452"; break; - case 235: name = "NI 4551"; break; - case 236: name = "NI 4552"; break; - case 237: name = "PXI-6602"; break; - case 240: name = "PXI-6508"; break; - case 241: name = "PCI-6110E"; break; - case 244: name = "PCI-6111E"; break; - case 256: name = "PCI-6503"; break; - case 261: name = "PCI-6711"; break; - case 262: name = "PXI-6711"; break; - case 263: name = "PCI-6713"; break; - case 264: name = "PXI-6713"; break; - case 265: name = "PCI-6704"; break; - case 266: name = "PXI-6704"; break; - case 267: name = "PCI-6023E"; break; - case 268: name = "PXI-6023E"; break; - case 269: name = "PCI-6024E"; break; - case 270: name = "PXI-6024E"; break; - case 271: name = "PCI-6025E"; break; - case 272: name = "PXI-6025E"; break; - case 273: name = "PCI-6052E"; break; - case 274: name = "PXI-6052E"; break; - case 275: name = "DAQPad-6070E"; break; - case 276: name = "DAQPad-6052E"; break; - case 285: name = "PCI-6527"; break; - case 286: name = "PXI-6527"; break; - case 308: name = "PCI-6601"; break; - case 311: name = "PCI-6703"; break; - case 314: name = "PCI-6034E"; break; - case 315: name = "PXI-6034E"; break; - case 316: name = "PCI-6035E"; break; - case 317: name = "PXI-6035E"; break; - case 318: name = "PXI-6703"; break; - case 319: name = "PXI-6608"; break; - case 320: name = "PCI-4453"; break; - case 321: name = "PCI-4454"; break; - case 348: name = "DAQCard-6036E"; break; - case 350: name = "PCI-6733"; break; - default : - fprintf(stderr, "NIUtil::nameCodeToString: Unknown code (%d)!\n", code); - name = "Unknown"; - break; - } - - return name; - } - - const char * getDeviceName - ( - short deviceNumber - ) - { - unsigned long code; - - - Get_DAQ_Device_Info(deviceNumber, ND_DEVICE_TYPE_CODE, &code); - - return nameCodeToString(code); - } - - unsigned long getDeviceCode - ( - short deviceNumber - ) - { - unsigned long code; - - - Get_DAQ_Device_Info(deviceNumber, ND_DEVICE_TYPE_CODE, &code); - - return code; - } - - short findDevice(const char *name) - { - static bool first_time = true; - if (first_time) { - int i; - for (i = 0; i < Max_NIDAQ_Devices; i++) { - opened_already[i] = false; - } - first_time = false; - } - short device(1); - unsigned long code(0); - - while ( (-1 != code) && (device < Max_NIDAQ_Devices) ) { - code = getDeviceCode(device); - - if ( !strcmp(name,nameCodeToString(code)) ) { - if (!opened_already[device]) { - opened_already[device] = true; - return device; - } - } - - device++; - } - - return -1; - } - - int checkError - ( - short status, - const char *message, - bool warn - ) - { - if (status) - { - return NIDAQErrorHandler(status, message, warn); - } - - return 0; - } -} diff --git a/src/vrpn/server_src/NIUtil.h b/src/vrpn/server_src/NIUtil.h deleted file mode 100644 index 9829d26aa6707f586364bddd58b12fd32ad343e5..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/NIUtil.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef NIUtil_Util -#define NIUtil_Util - -/*** NIUtil Class - Handy utility functions for getting the correct board - * and handling errors. Originally none of these were supplied by NI, - * now some of them are. - ***/ - -#include <nidaqex.h> - - -namespace NIUtil -{ - - const char *nameCodeToString - ( - int code - ); ///< Convert NI-DAQ device name code into meaningful string - - const char *getDeviceName - ( - int deviceNumber - ); ///< Get name of some device - - unsigned long getDeviceCode - ( - short deviceNumber - ); ///< Get device code of some device - - short findDevice - ( - const char *name - ); - ///< Get code for installed device matching name. If the same program - // asks for a device with the same name again, then it will look for a - // second instance of a device with that name (it will not return the - // same device ID twice). - - int checkError - ( - int status, - const char * message, - bool warn - ); ///< Error/Warning messages for NI-DAQ calls -} - - -#endif diff --git a/src/vrpn/server_src/aureal_sound_server/aureal_sound_server.dsp b/src/vrpn/server_src/aureal_sound_server/aureal_sound_server.dsp deleted file mode 100644 index dc2771d579bee3a2458d99da160c8b443baee39f..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/aureal_sound_server/aureal_sound_server.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="aureal_sound_server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=aureal_sound_server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "aureal_sound_server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "aureal_sound_server.mak" CFG="aureal_sound_server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "aureal_sound_server - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "aureal_sound_server - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "aureal_sound_server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../.." /I "e:/public/quat" /I "c:/Program Files/Aureal/A3D 3.0 SDK/sdk/inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 winmm.lib wsock32.lib comctl32.lib e:\public\quat\pc_win32\Debug\quat.lib ../../pc_win32/Debug/vrpn.lib "c:\Program Files\Aureal\A3D 3.0 SDK\sdk\lib\ia3dutild.lib" opengl32.lib glu32.lib glaux.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/aureal_sound_server.pdb" /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /nodefaultlib:"libcmt.lib" /nodefaultlib:"libcd.lib" /out:"Debug/aureal_sound_server.exe" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "aureal_sound_server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo /o"Debug/timecode_generator_server.bsc" -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 winmm.lib wsock32.lib comctl32.lib ../../pc_win32/Debug/vrpn.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /out:"Debug/timecode_generator_server.exe" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "aureal_sound_server - Win32 Release" -# Name "aureal_sound_server - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\timecode_generator_server\vrpn_timecode_generator.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\timecode_generator_server\vrpn_timecode_generator.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/server_src/aureal_sound_server/aureal_sound_server.dsw b/src/vrpn/server_src/aureal_sound_server/aureal_sound_server.dsw deleted file mode 100644 index f9cc7ec2200392a18d7e2662efcad78797d7b61c..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/aureal_sound_server/aureal_sound_server.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "aureal_sound_server"=.\aureal_sound_server.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/vrpn/server_src/aureal_sound_server/vrpn_Sound_A3D.cpp b/src/vrpn/server_src/aureal_sound_server/vrpn_Sound_A3D.cpp deleted file mode 100644 index a07a519d7a082fb6eb7f362bee532c03c847aba8..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/aureal_sound_server/vrpn_Sound_A3D.cpp +++ /dev/null @@ -1,1258 +0,0 @@ -#include "vrpn_Sound_A3D.h" - -#define NUM_SPIN 20000 -const int CHAR_BUF_SIZE =1024; - - -vrpn_Sound_Server_A3D::vrpn_Sound_Server_A3D(const char * name, - vrpn_Connection * c, - HWND hWin) - : vrpn_Sound_Server(name, c){ - - try { - - // initialize the sound goodies - a3droot = NULL; - a3dgeom = NULL; - a3dlis = NULL; - - lasterror = A3dCreate(NULL, (void**)&a3droot, NULL, A3D_1ST_REFLECTIONS | A3D_OCCLUSIONS | A3D_DISABLE_SPLASHSCREEN); - if(FAILED(lasterror)) - { - throw "Failed to retrieve the A3D COM interface"; - } - - // need to set cooperative level - lasterror = a3droot->SetCooperativeLevel(hWin, A3D_CL_EXCLUSIVE); - if(FAILED(lasterror)) - { - throw "Failed to Set the Cooperative Level"; - } - - lasterror = a3droot->QueryInterface(IID_IA3dListener, (void **)&a3dlis); - - if (FAILED(lasterror)) { - throw "Couldnt get Listener in constructor\n"; - } - - lasterror = a3droot->QueryInterface(IID_IA3dGeom, (void **)&a3dgeom); - - if (FAILED(lasterror)) { - throw "Couldnt get Geometry in constructor"; - } - - // check on status of requested features: - - if (a3droot->IsFeatureAvailable(A3D_1ST_REFLECTIONS)) - printf("Reflections available\n"); - else printf("Reflections NOT available\n"); - - if (a3droot->IsFeatureAvailable(A3D_OCCLUSIONS)) - printf("Occlusions available\n"); - else printf("Occlusions NOT available\n"); - - // set some global default values - // default DistanceModelScale is 1.0 which means gain is reducded 6dB for doubling in distance from listener - // default DopplerScale is 1.0 (340m/s) - // default Equalization is 1.0 - // default MaxReflectionDelayTime is .3 seconds which, according to - // the A3D document, is adequate for models smaller than a football stadium - // default NumFallBackSources is 12 (more than 12 sources and we go to software) - // default RMPriorityBias is .5 means we equally weigh audibility and priority when deciding whether to play source - // default UnitsPerMeter is 1.0 (we use meters) - - // default coordinate system is RIGHT HANDED - - lasterror = a3droot->SetCoordinateSystem(A3D_RIGHT_HANDED_CS); - - lasterror = a3droot->SetOutputGain(1.0); // max gain - - // default to using headphones - lasterror = a3droot->SetOutputMode(OUTPUT_HEADPHONES,OUTPUT_HEADPHONES,OUTPUT_MODE_STEREO); - - // set up our playlist - maxSounds = 15; - numSounds = -1; - numMaterials = 0; - maxMaterials = 0; - - a3dsamples = (IA3dSource2**) new IA3dSource2* [maxSounds]; - - // initialize playlist - for (int i(0); i < maxSounds; i++) { - a3dsamples[i] = NULL; - soundMap[i]=-1; - } - - a3droot->Clear(); - } - - catch(char* szError) { - // Display the message. - printf("AudioInit() - %s.\n", szError); - send_message("Error initializing sound card.. sound server did not start.",vrpn_TEXT_ERROR,0); - exit(0); - } - -} - -vrpn_Sound_Server_A3D::~vrpn_Sound_Server_A3D() { - - printf("Before freeing... \n"); - //release the interfaces.. - - a3droot->Shutdown(); - // free up COM - CoUninitialize(); - printf("After free... \n"); -} - - -void vrpn_Sound_Server_A3D::playSound(vrpn_SoundID id, vrpn_int32 repeat, vrpn_SoundDef soundDef) { - - vrpn_int32 myid = soundMap[id]; - if (myid != -1) { - if (repeat == 0) - lasterror = a3dsamples[myid]->Play(A3D_LOOPED); - else - lasterror = a3dsamples[myid]->Play(A3D_SINGLE); - printf("Playing sound %d\n", myid); - send_message("Playing sound",vrpn_TEXT_NORMAL,0); - } - else send_message("Error: playSound (Sound not loaded)",vrpn_TEXT_WARNING,0); -} - -void vrpn_Sound_Server_A3D::stopSound(vrpn_SoundID id) { - - vrpn_int32 myid = soundMap[id]; - if (myid!=-1) { - printf("Stopping sound %d\n",myid); - lasterror = a3dsamples[myid]->Stop(); - send_message("Stopping sound",vrpn_TEXT_NORMAL,0); - } else send_message("Invalid sound id",vrpn_TEXT_ERROR,0); -} - -void vrpn_Sound_Server_A3D::loadSoundLocal(char* filename, vrpn_SoundID id, vrpn_SoundDef soundDef) { - - char tempbuf[1024]; - - try { - numSounds++; - if (numSounds == maxSounds) { - maxSounds = 2 * maxSounds; - IA3dSource2 ** temp = new (IA3dSource2*); - - for (int i(0); i < maxSounds; i++) { - if (i <= numSounds) - temp[i] = a3dsamples[i]; - else temp[i] = NULL; - } - delete [] a3dsamples; - a3dsamples = temp; - } - filename = strlwr(filename); // string to lower case - - lasterror = a3droot->NewSource( A3DSOURCE_TYPEDEFAULT | A3DSOURCE_INITIAL_RENDERMODE_A3D , &a3dsamples[numSounds]); - - if (FAILED(lasterror)) { - throw "Error making new source"; - } - - if (strstr(filename, "mp3")==NULL) // assume WAVE format - lasterror = a3dsamples[numSounds]->LoadFile(filename, A3DSOURCE_FORMAT_WAVE); - else // otherwise we assume mp3 - lasterror = a3dsamples[numSounds]->LoadFile(filename, A3DSOURCE_FORMAT_MP3); - - if (FAILED(lasterror)) { - throw "Error loading file"; - } - - // initialize sound params - - lasterror=a3dsamples[numSounds]->SetCone(0,0,1); - // these values are defaults: - // default ModelScale of 6dB for each doubling of distance - // default DopplerScale of 1.0 - // default Equalization of 1.0 - // default pitch is 1.0 (unaltered pitch) - // default priority of .5 on a scale from 0 to 1 - // default ReflectionDelayScale is 1.0 (normal delay in reflections [.3 seconds]) - // default RefelectionGainScale is 1.0 - // default RenderMode uses occlusion, reflection, a3d (??) - // default TransformMode is relative to origin - - lasterror=a3dsamples[numSounds]->SetMinMaxDistance((float) soundDef.min_front_dist, (float)soundDef.max_front_dist, A3D_MUTE); - lasterror=a3dsamples[numSounds]->SetGain(soundDef.volume); - - // default position is at the origin - lasterror=a3dsamples[numSounds]->SetPosition3f((float)soundDef.pose.position[0],(float)soundDef.pose.position[1],(float)soundDef.pose.position[2]); - -qogl_matrix_type eye_f_world_mat; - qogl_matrix_type eye_axis_vectors_in_world; - - q_to_ogl_matrix (eye_f_world_mat, soundDef.pose.orientation); - qogl_matrix_type eye_axis_vectors=// we put the up and forward - // as the first two columns in the matrix. - //NOTE: these columns in the matrix - //appear as rows here since the number starts in the upper left corner - //as goes down! - { 0,0,-1,1, //the forward normal vector in eye space - 0,1,0,1, //the up normal vector in eye space - 0,0,0,0, //unused - 0,0,0,0 } ; //unused - - qogl_matrix_mult(eye_axis_vectors_in_world,eye_axis_vectors,eye_f_world_mat); - - - // takes front vector then up vector - lasterror = a3dlis->SetOrientation6f((float)eye_axis_vectors_in_world[0], (float)eye_axis_vectors_in_world[1], - (float)eye_axis_vectors_in_world[2], (float)eye_axis_vectors_in_world[4], (float)eye_axis_vectors_in_world[5], - (float)eye_axis_vectors_in_world[6]); - - soundMap[id] = numSounds; - } - catch(char* szError) - { - // Display the message. - - sprintf(tempbuf,"Error: loadSoundLocal (%s) [file: %s]",szError,filename); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - return; - } - - sprintf(tempbuf,"Loading sound #%d: %s \n",numSounds,filename); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - return; - -} - -// not supported -void vrpn_Sound_Server_A3D::loadSoundRemote(char* filename, vrpn_SoundID id, vrpn_SoundDef soundDef) { - - send_message("loadSoundRemote not supported",vrpn_TEXT_WARNING,0); -} - -void vrpn_Sound_Server_A3D::unloadSound(vrpn_SoundID id) { - - vrpn_int32 myid = soundMap[id]; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: unloadSound(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - return; - } - a3dsamples[myid]->Release(); - - for (int i(myid); i < numSounds; i++) { - a3dsamples[i] = a3dsamples[i+1]; - } - - sprintf(tempbuf,"Unloading sound: %d ",id); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); -} - -void vrpn_Sound_Server_A3D::setListenerPose(vrpn_PoseDef pose) { - -qogl_matrix_type eye_f_world_mat; - qogl_matrix_type eye_axis_vectors_in_world; - - q_to_ogl_matrix (eye_f_world_mat, pose.orientation); - qogl_matrix_type eye_axis_vectors=// we put the up and forward - // as the first two columns in the matrix. - //NOTE: these columns in the matrix - //appear as rows here since the number starts in the upper left corner - //as goes down! - { 0,0,-1,1, //the forward normal vector in eye space - 0,1,0,1, //the up normal vector in eye space - 0,0,0,0, //unused - 0,0,0,0 } ; //unused - - qogl_matrix_mult(eye_axis_vectors_in_world,eye_axis_vectors,eye_f_world_mat); - - - // takes front vector then up vector - lasterror = a3dlis->SetOrientation6f((float)eye_axis_vectors_in_world[0], (float)eye_axis_vectors_in_world[1], - (float)eye_axis_vectors_in_world[2], (float)eye_axis_vectors_in_world[4], (float)eye_axis_vectors_in_world[5], - (float)eye_axis_vectors_in_world[6]); - - lasterror = a3dlis->SetPosition3f((float)pose.position[0],(float)pose.position[1],(float)pose.position[2]); - - // dont send back a message here because there are a bunch of them -} - -void vrpn_Sound_Server_A3D::setListenerVelocity(vrpn_float64 velocity[4]) { - q_vec_type velocity_vec; - - q_to_vec(velocity_vec, velocity); - - lasterror = a3dlis->SetVelocity3fv((A3DVAL*) velocity_vec); - - char tempbuf[1024]; - sprintf(tempbuf,"Setting listener velocity "); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - return; -} - -void vrpn_Sound_Server_A3D::changeSoundStatus(vrpn_SoundID id, vrpn_SoundDef soundDef) { - vrpn_int32 myid = soundMap[id]; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundStatus(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - return; - } - - lasterror = a3dsamples[id]->SetPosition3f((float)soundDef.pose.position[0],(float)soundDef.pose.position[1],(float)soundDef.pose.position[2]); - - qogl_matrix_type eye_f_world_mat; - qogl_matrix_type eye_axis_vectors_in_world; - - q_to_ogl_matrix (eye_f_world_mat, soundDef.pose.orientation); - qogl_matrix_type eye_axis_vectors=// we put the up and forward - // as the first two columns in the matrix. - //NOTE: these columns in the matrix - //appear as rows here since the number starts in the upper left corner - //as goes down! - { 0,0,-1,1, //the forward normal vector in eye space - 0,1,0,1, //the up normal vector in eye space - 0,0,0,0, //unused - 0,0,0,0 } ; //unused - - qogl_matrix_mult(eye_axis_vectors_in_world,eye_axis_vectors,eye_f_world_mat); - - - // takes front vector then up vector - lasterror = a3dsamples[id]->SetOrientation6f((float)eye_axis_vectors_in_world[0], (float)eye_axis_vectors_in_world[1], - (float)eye_axis_vectors_in_world[2], (float)eye_axis_vectors_in_world[4], (float)eye_axis_vectors_in_world[5], - (float)eye_axis_vectors_in_world[6]); - q_vec_type velocity_vec; - - q_to_vec(velocity_vec, soundDef.velocity); - lasterror = a3dsamples[myid]->SetVelocity3fv((A3DVAL*) velocity_vec); - - // we only use front_min and front_back - lasterror = a3dsamples[myid]->SetMinMaxDistance((float)soundDef.min_front_dist, (float)soundDef.max_front_dist, A3D_AUDIBLE); - lasterror = a3dsamples[myid]->SetCone((float)soundDef.cone_inner_angle, (float)soundDef.cone_outer_angle, (float)soundDef.cone_gain); - lasterror = a3dsamples[myid]->SetDopplerScale((float)soundDef.dopler_scale); - lasterror = a3dsamples[myid]->SetEq((float)soundDef.equalization_val); - lasterror = a3dsamples[myid]->SetPitch((float)soundDef.pitch); - lasterror = a3dsamples[myid]->SetGain((float)soundDef.volume); - - sprintf(tempbuf,"Setting sound definition "); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - - return; -} - -void vrpn_Sound_Server_A3D::setSoundPose(vrpn_SoundID id, vrpn_PoseDef pose) { - vrpn_int32 myid = soundMap[id]; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundPose(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - return; - } - - lasterror = a3dsamples[id]->SetPosition3f((float)pose.position[0],(float)pose.position[1],(float)pose.position[2]); - - qogl_matrix_type eye_f_world_mat; - qogl_matrix_type eye_axis_vectors_in_world; - - q_to_ogl_matrix (eye_f_world_mat, pose.orientation); - qogl_matrix_type eye_axis_vectors=// we put the up and forward - // as the first two columns in the matrix. - //NOTE: these columns in the matrix - //appear as rows here since the number starts in the upper left corner - //as goes down! - { 0,0,-1,1, //the forward normal vector in eye space - 0,1,0,1, //the up normal vector in eye space - 0,0,0,0, //unused - 0,0,0,0 } ; //unused - - qogl_matrix_mult(eye_axis_vectors_in_world,eye_axis_vectors,eye_f_world_mat); - - - // takes front vector then up vector - lasterror = a3dsamples[id]->SetOrientation6f((float)eye_axis_vectors_in_world[0], (float)eye_axis_vectors_in_world[1], - (float)eye_axis_vectors_in_world[2], (float)eye_axis_vectors_in_world[4], (float)eye_axis_vectors_in_world[5], - (float)eye_axis_vectors_in_world[6]); - sprintf(tempbuf,"Setting sound pose "); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); -} - -void vrpn_Sound_Server_A3D::setSoundVelocity(vrpn_SoundID id, vrpn_float64 *velocity) { - q_vec_type velocity_vec; - vrpn_int32 myid = soundMap[id]; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundVelocity(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - return; - } - - q_to_vec(velocity_vec, velocity); - - lasterror = a3dsamples[myid]->SetVelocity3fv((A3DVAL*) velocity_vec); - - sprintf(tempbuf,"Setting sound velocity "); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - return; -} - -void vrpn_Sound_Server_A3D::setSoundDistInfo(vrpn_SoundID id, vrpn_float64 *distinfo) { - vrpn_int32 myid = soundMap[id]; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundDistInfo(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - return; - } - - lasterror = a3dsamples[myid]->SetMinMaxDistance((float)distinfo[2], (float)distinfo[3], A3D_AUDIBLE); - - sprintf(tempbuf,"Setting distance information for sound %d to min: %f; max: %f",id,distinfo[2],distinfo[3]); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - return; -} -void vrpn_Sound_Server_A3D::setSoundConeInfo(vrpn_SoundID id, vrpn_float64 *coneinfo) { - vrpn_int32 myid = soundMap[id]; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundConeInfo(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - return; - } - coneinfo[0] = coneinfo[0] * 180.0/Q_PI; - coneinfo[1] = coneinfo[1] * 180.0/Q_PI; - - lasterror = a3dsamples[myid]->SetCone((float)coneinfo[0], (float)coneinfo[1], (float)coneinfo[2]); - - sprintf(tempbuf,"Setting sound cone information for sound %d to inner: %f; outer: %f; gain: %f",coneinfo[0], coneinfo[1], coneinfo[2]); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - return; -} - - -void vrpn_Sound_Server_A3D::setSoundDoplerFactor(vrpn_SoundID id, vrpn_float64 doplerfactor) { - vrpn_int32 myid = soundMap[id]; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundDoplerFactor(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - return; - } - - lasterror = a3dsamples[myid]->SetDopplerScale((float)doplerfactor); - - sprintf(tempbuf,"Setting sound dopler scale"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - return; -} -void vrpn_Sound_Server_A3D::setSoundEqValue(vrpn_SoundID id, vrpn_float64 eqvalue) { - vrpn_int32 myid = soundMap[id]; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundEqValue(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - return; - } - - lasterror = a3dsamples[myid]->SetEq((float)eqvalue); - - sprintf(tempbuf,"Setting sound equalization value"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - return; -} -void vrpn_Sound_Server_A3D::setSoundPitch(vrpn_SoundID id, vrpn_float64 pitch) { - vrpn_int32 myid = soundMap[id]; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundPitch(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - return; - } - - lasterror = a3dsamples[myid]->SetPitch((float)pitch); - sprintf(tempbuf,"Setting sound pitch"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - return; -} -void vrpn_Sound_Server_A3D::setSoundVolume(vrpn_SoundID id, vrpn_float64 volume) { - vrpn_int32 myid = soundMap[id]; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundVolume(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - return; - } - lasterror = a3dsamples[myid]->SetGain((float)volume); - - sprintf(tempbuf,"Setting sound volume"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - - return; -} - -void vrpn_Sound_Server_A3D::loadModelLocal(const char * filename) { - FILE * model_file; - float x,y,z; - int num = 0; - char tempbuf[1024], tempbuf2[1024]; - - int valid_num = 0; - int mynum = 0; - int curnum = 0; - char material_name[MAX_MATERIAL_NAME_LENGTH]; - - float trans1, trans2, refl1, refl2; - float subopeningval; - // open the file - - try - { - sprintf(tempbuf, "Working from model file: %s", filename); - printf("%s\n",tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - - if ( (model_file = fopen(filename, "r")) == NULL) { - throw "Cannot open model file"; - } - - char line[512]; // Line read from the input file - char * pch; - char scrap[512]; - - // Read lines from the file until we run out - while ( fgets(line, sizeof(line), model_file) != NULL ) - { - - // Make sure the line wasn't too long - if (strlen(line) >= sizeof(line)-1) { - sprintf(tempbuf, "Line too long in config file: %s",line); - throw tempbuf; - } - - if ((strlen(line)<3)||(line[0]=='#')) { - continue; - } - - // copy for strtok work - strncpy(scrap, line, sizeof(line) - 1); - -#define isit(s) !strcmp(pch=strtok(scrap," \t"),s) -#define next() pch += strlen(pch) + 1 - - // for now just have 10 materials - - if(isit("MATERIAL")) - { - // material name should be first followed by trans and reflect values - next(); - - if (sscanf(pch,"%511s\t%f\t%f\t%f\t%f\n",material_name, &trans1, &trans2, &refl1, &refl2) != 5) { - sprintf(tempbuf, "PROBLEM in material list with material: %s", material_name); - throw tempbuf; - } - else { - // make sure name is not already in the list - for (int i(0); i < MAX_NUMBER_MATERIALS; i++) { - if (strcmp(material_name, mat_names[i]) == 0) - { - sprintf(tempbuf, "Material %s already exists in the list.. replacing with new definition", material_name); - send_message((const char *) tempbuf,vrpn_TEXT_WARNING,0); - } - } - - // copy the name to the name array - strcpy(mat_names[curnum], material_name); - a3dgeom->NewMaterial(&materials[curnum]); - materials[curnum]->SetTransmittance(trans1, trans2); - materials[curnum]->SetReflectance(refl1, refl2); - curnum++; - sprintf(tempbuf, "Material %d is %s", curnum-1, mat_names[curnum-1]); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - valid_num = curnum; - } - } - - else if(isit("A3D_QUAD")) - { - - next(); - - if (sscanf(pch,"%d\t%512s",&num, material_name) != 2) { - sprintf(tempbuf, "PROBLEM in A3D_QUAD %d\n", num); - throw tempbuf; - } - else { - // should look up the materials - mynum = -1; - - for (int i(0); i < valid_num; i++) { - - if (strcmp(material_name, mat_names[i]) == 0) { - mynum = i; - } - } - - if (mynum >= 0) - a3dgeom->BindMaterial(materials[mynum]); - } - - a3dgeom->PushMatrix(); - a3dgeom->Begin(A3D_QUADS); - a3dgeom->Tag(num); - - // read in 4 vertices - for (int i(0); i<4; i++) { - if (fgets(line, sizeof(line), model_file) != NULL) { - if (strlen(line) >= sizeof(line)-1) { - sprintf(tempbuf, "Quad (#%d) line too long in model file: %s",num, line); - throw tempbuf; - } - if ((strlen(line)<3)||(line[0]=='#')) - continue; // skip this line - - // read in the vertices - if (sscanf(line,"%f\t%f\t%f",&x, &y, &z) != 3) - return; - else { - a3dgeom->Vertex3f(x,y,z); - } - - } - else return; - } - a3dgeom->End(); - a3dgeom->PopMatrix(); - - } - - else if(isit("A3D_SUB_QUAD")) - { - - next(); - - if (sscanf(pch,"%d\t%511s\t%f",&num, material_name,&subopeningval) != 3) { - throw "PROBLEM in A3D_QUAD"; - } - else { - // should look up the materials - mynum = -1; - for (int i(0); i < valid_num; i++) { - if (strcmp(material_name, mat_names[i]) == 0) - mynum = i; - } - - if (mynum >= 0) - a3dgeom->BindMaterial(materials[mynum]); - } - - a3dgeom->PushMatrix(); - a3dgeom->Begin(A3D_SUB_QUADS); - a3dgeom->Tag(num); - a3dgeom->SetOpeningFactorf(subopeningval); // make sure to call this before specifying vertices - - // read in 4 vertices - for (int i(0); i<4; i++) { - if (fgets(line, sizeof(line), model_file) != NULL) { - if (strlen(line) >= sizeof(line)-1) { - sprintf(tempbuf, "subQuad (#%d) line too long in model file: %s",num, line); - throw tempbuf; - } - if ((strlen(line)<3)||(line[0]=='#')) - continue; // skip this line - - // read in the vertices - if (sscanf(line,"%f\t%f\t%f",&x, &y, &z) != 3) - return; - else { - a3dgeom->Vertex3f(x,y,z); - } - } - else return; - } - a3dgeom->End(); - a3dgeom->PopMatrix(); - - } - - else if(isit("A3D_TRIANGLE")) - { - - next(); - - if (sscanf(pch,"%d\t%511s\t%f",&num, material_name) != 2) { - throw "PROBLEM in A3D_TRI"; - } - else { - // should look up the materials - mynum = -1; - for (int i(0); i < valid_num; i++) { - if (strcmp(material_name, mat_names[i]) == 0) - mynum = i; - } - if (mynum >= 0) - a3dgeom->BindMaterial(materials[mynum]); - } - - a3dgeom->PushMatrix(); - a3dgeom->Begin(A3D_TRIANGLES); - a3dgeom->Tag(num); - - // read in 3 vertices - for (int i(0); i<3; i++) { - if (fgets(line, sizeof(line), model_file) != NULL) { - if (strlen(line) >= sizeof(line)-1) { - sprintf(tempbuf, "Tri (#%d) line too long in model file: %s",num, line); - throw tempbuf; - } - if ((strlen(line)<3)||(line[0]=='#')) - continue; // skip this line - - // read in the vertices - if (sscanf(line,"%f\t%f\t%f",&x, &y, &z) != 3) - return; - else { - a3dgeom->Vertex3f(x,y,z); - } - - } - else return; - } - a3dgeom->End(); - a3dgeom->PopMatrix(); - } - - else if(isit("A3D_SUB_TRIANGLE")) - { - next(); - if (sscanf(pch,"%d\t%511s\t%f",&num, material_name,&subopeningval) != 3) { - throw "PROBLEM in A3D_SUB_TRI"; - } - else { - // should look up the materials - mynum = -1; - for (int i(0); i < valid_num; i++) { - if (strcmp(material_name, mat_names[i]) == 0) - mynum = i; - } - if (mynum > 0) - a3dgeom->BindMaterial(materials[mynum]); - } - - a3dgeom->PushMatrix(); - a3dgeom->Begin(A3D_SUB_TRIANGLES); - a3dgeom->Tag(num); - a3dgeom->SetOpeningFactorf(subopeningval); // make sure to call this before specifying vertices - - // read in 3 vertices - for (int i(0); i<3; i++) { - if (fgets(line, sizeof(line), model_file) != NULL) { - if (strlen(line) >= sizeof(line)-1) { - sprintf(tempbuf, "subTri (#%d) line too long in model file: %s",num, line); - throw tempbuf; - } - if ((strlen(line)<3)||(line[0]=='#')) - continue; // skip this line - - // read in the vertices - if (sscanf(line,"%f\t%f\t%f",&x, &y, &z) != 3) - return; - else { - a3dgeom->Vertex3f(x,y,z); - } - } - else return; - } - a3dgeom->End(); - a3dgeom->PopMatrix(); - } - } - - fclose(model_file); -} -catch (char* szError) { - sprintf(tempbuf2,"Error: Loading model file (%s)", szError); - printf("%s\n", tempbuf2); - send_message((const char *) tempbuf2,vrpn_TEXT_ERROR,0); -} -return; -} - - -void vrpn_Sound_Server_A3D::loadModelRemote(){} // not supported - -void vrpn_Sound_Server_A3D::loadPolyQuad(vrpn_QuadDef * quad) { - - int mynum = -1; - for (int i(0); i < maxMaterials; i++) { - if (strcmp(quad->material_name, mat_names[i]) == 0) - mynum = i; - } - - lasterror = a3dgeom->BindMaterial(materials[mynum]); - lasterror = a3dgeom->PushMatrix(); - if (quad->subQuad) { - lasterror = a3dgeom->Begin(A3D_SUB_QUADS); - lasterror = a3dgeom->SetOpeningFactorf((float)quad->openingFactor); - } - else - lasterror = a3dgeom->Begin(A3D_QUADS); - - lasterror = a3dgeom->Tag(quad->tag); - for (i=0; i<4; i++) - lasterror = a3dgeom->Vertex3f((float)quad->vertices[i][0],(float)quad->vertices[i][1],(float)quad->vertices[i][2]); - lasterror = a3dgeom->End(); - lasterror = a3dgeom->PopMatrix(); - - char tempbuf[1024]; - sprintf(tempbuf,"Adding quad"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - return; -} - -void vrpn_Sound_Server_A3D::loadPolyTri(vrpn_TriDef * tri) { - int mynum = -1; - for (int i(0); i < maxMaterials; i++) { - if (strcmp(tri->material_name, mat_names[i]) == 0) - mynum = i; - } - - lasterror = a3dgeom->BindMaterial(materials[mynum]); - lasterror = a3dgeom->PushMatrix(); - if (tri->subTri) { - lasterror = a3dgeom->Begin(A3D_SUB_TRIANGLES); - lasterror = a3dgeom->SetOpeningFactorf((float)tri->openingFactor); - } - else - lasterror = a3dgeom->Begin(A3D_TRIANGLES); - - lasterror = a3dgeom->Tag(tri->tag); - for (i=0; i<3; i++) - lasterror = a3dgeom->Vertex3f((float)tri->vertices[i][0],(float)tri->vertices[i][1],(float)tri->vertices[i][2]); - lasterror = a3dgeom->End(); - lasterror = a3dgeom->PopMatrix(); - - char tempbuf[1024]; - sprintf(tempbuf,"Adding tri"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - return; -} - -void vrpn_Sound_Server_A3D::loadMaterial(vrpn_MaterialDef * material, vrpn_int32 id) { - char tempbuf[1024]; - for (int i(0); i < maxMaterials; i++) { - if (strcmp(material->material_name, mat_names[i]) == 0) { - sprintf(tempbuf,"Material %s already exists in the list\n", material->material_name); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_WARNING,0); - return; - } - } - - // copy the name to the name array - strcpy(mat_names[numMaterials], material->material_name); - a3dgeom->NewMaterial(&materials[numMaterials]); - materials[numMaterials]->SetTransmittance((float)material->transmittance_highfreq, (float)material->transmittance_gain); - materials[numMaterials]->SetReflectance((float)material->reflectance_highfreq, (float)material->reflectance_gain); - numMaterials++; - printf("Material %d is %s\n", numMaterials-1, mat_names[numMaterials-1]); - maxMaterials = numMaterials; - - sprintf(tempbuf,"Adding material"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - return; -} - -// moving vertices not supported yet because there is the issue of having to redraw the entire scene.. maybe use lists -void vrpn_Sound_Server_A3D::setPolyQuadVertices(vrpn_float64 vertices[4][3], const vrpn_int32 id) { - char tempbuf[1024]; - sprintf(tempbuf,"Setting quad vertices not implemented"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); -} - -void vrpn_Sound_Server_A3D::setPolyTriVertices(vrpn_float64 vertices[3][3], const vrpn_int32 id) { - char tempbuf[1024]; - sprintf(tempbuf,"Setting tri vertices not implemented"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); -} - -// need to look up the correct polygon somehow -void vrpn_Sound_Server_A3D::setPolyOF(vrpn_float64 OF, vrpn_int32 tag) { - char tempbuf[1024]; - sprintf(tempbuf,"Setting polygon opening factor not implemented"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); -} - -void vrpn_Sound_Server_A3D::setPolyMaterial(const char * material, vrpn_int32 tag) { - char tempbuf[1024]; - sprintf(tempbuf,"Setting polygon material not implemented"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); -} - - -void vrpn_Sound_Server_A3D::mainloop() { - vrpn_Text_Sender::mainloop(); - vrpn_Sound::d_connection->mainloop(); - lasterror = a3droot->Flush(); - server_mainloop(); -} - -bool vrpn_Sound_Server_A3D::noSounds(void) {return 0;} - -void vrpn_Sound_Server_A3D::stopAllSounds() { - for (int i(0); i<numSounds;i++) - a3dsamples[i]->Stop(); -} - -// re-initialize all sounds and materials etc -void vrpn_Sound_Server_A3D::shutDown() { - - // reinitialize playlist - printf("Begin cleanup\n"); - for (int i(0); i < maxSounds; i++) { - if (i<=numSounds) - a3dsamples[i]->FreeAudioData(); - - a3dsamples[i] = NULL; - soundMap[i]=-1; - - } - - for (int j(0); j<maxMaterials;j++) { - if (j<=numMaterials) - delete materials[j]; - materialMap[j]=-1; - strcpy(mat_names[j],""); - } - - maxSounds = 15; - numSounds = -1; - numMaterials = 0; - maxMaterials = 0; - - a3droot->Clear(); - printf("End cleanup\n"); -} - -vrpn_float64 vrpn_Sound_Server_A3D::GetCurrentVolume(const vrpn_int32 CurrentSoundId) { - float val; - vrpn_int32 myid = soundMap[CurrentSoundId]; - lasterror = a3dsamples[myid]->GetGain(&val); - return val; -} - -void vrpn_Sound_Server_A3D::GetLastError(char *buf) { - strcpy(buf,""); - if (FAILED(lasterror)) { - sprintf(buf,"ERROR: %d",lasterror); - send_message((const char *) buf,vrpn_TEXT_ERROR,0); - } - return; -} - -vrpn_int32 vrpn_Sound_Server_A3D::GetCurrentPlaybackRate(const vrpn_int32 CurrentSoundId) { - vrpn_int32 myid = soundMap[CurrentSoundId]; - return 1; -} - -void vrpn_Sound_Server_A3D::GetCurrentPosition(const vrpn_int32 CurrentSoundId, float* X_val, float* Y_val, float* Z_val) { - vrpn_int32 myid = soundMap[CurrentSoundId]; - lasterror = a3dsamples[myid]->GetPosition3f(X_val, Y_val, Z_val); - return; -} - -void vrpn_Sound_Server_A3D::GetListenerPosition(float* X_val, float* Y_val, float* Z_val) { - lasterror = a3dlis->GetPosition3f(X_val, Y_val, Z_val); - return; -} - -void vrpn_Sound_Server_A3D::GetCurrentDistances(const vrpn_int32 CurrentSoundId, float* FMin, float* FMax) { - vrpn_int32 myid = soundMap[CurrentSoundId]; - lasterror = a3dsamples[myid]->GetMinMaxDistance(FMax, FMin,NULL); - return; -} - -void vrpn_Sound_Server_A3D::GetListenerOrientation(float* y_val, float *p_val, float *r_val) { - // z y x is what we expect to get back.. these arent named right but deal for now - lasterror = a3dlis->GetOrientationAngles3f(y_val, p_val, r_val); - return; -} - -void vrpn_Sound_Server_A3D::GetCurrentOrientation(const vrpn_int32 CurrentSoundId,float *y_val, float *p_val, float *r_val) { - - vrpn_int32 myid = soundMap[CurrentSoundId]; - lasterror = a3dsamples[myid]->GetOrientationAngles3f(y_val, p_val, r_val); - return; -} - -HWND GetConsoleHwnd(void) { - // Get the current window title. - char pszOldWindowTitle[CHAR_BUF_SIZE]; - GetConsoleTitle(pszOldWindowTitle, CHAR_BUF_SIZE); - - // Format a unique New Window Title. - char pszNewWindowTitle[CHAR_BUF_SIZE]; - wsprintf(pszNewWindowTitle, "%d/%d", GetTickCount(), GetCurrentProcessId()); - - // Change the current window title. - SetConsoleTitle(pszNewWindowTitle); - - // Ensure window title has changed. - Sleep(40); - - // Look for the new window. - HWND hWnd = FindWindow(NULL, pszNewWindowTitle); - - // Restore orignal name - SetConsoleTitle(pszOldWindowTitle); - - return hWnd; -} - - -void main(int argc, char **argv) { - -HWND hWin; -vrpn_Sound_Server_A3D * soundServer = NULL; -vrpn_Tracker_Remote * tracker_connection; -char tracker_device[512]; -char tracker_name[512]; -vrpn_Connection * connection; -vrpn_Connection * trackerCon; -int got_report; - -int USE_TRACKER; - - char * config_file_name = "vrpn.cfg"; - FILE * config_file; - char * client_name = NULL; - int client_port = 4150; - int bail_on_error = 1; - int verbose = 1; - int auto_quit = 0; - int realparams = 0; - int loop = 0; - int port = vrpn_DEFAULT_LISTEN_PORT_NO; - - connection = new vrpn_Synchronized_Connection (port); - - // Open the configuration file - if (verbose) printf("Reading from config file %s\n", config_file_name); - - if ( (config_file = fopen(config_file_name, "r")) == NULL) - { - perror("Cannot open config file"); - printf(" (filename %s)\n", config_file_name); - return; - } - - // Read the configuration file, creating a device for each entry. - // Each entry is on one line, which starts with the name of the - // class of the object that is to be created. - // If we fail to open a certain device, print a message and decide - // whether we should bail. - { - char line[512]; // Line read from the input file - char *pch; - char scrap[512], s2[512]; - - // Read lines from the file until we run out - while ( fgets(line, sizeof(line), config_file) != NULL ) - { - - // Make sure the line wasn't too long - if (strlen(line) >= sizeof(line)-1) - { - printf("Line too long in config file: %s\n",line); - if (bail_on_error) { return; } - else { continue; } // Skip this line - } - - if ((strlen(line)<3)||(line[0]=='#')) - { - // comment or empty line -- ignore - continue; - } - - // copy for strtok work - strncpy(scrap, line, sizeof(line) - 1); - // Figure out the device from the name and handle appropriately - - // WARNING: SUBSTRINGS WILL MATCH THE EARLIER STRING, SO - // ADD AN EMPTY SPACE TO THE END OF STATIC STRINGS!!!! - - // #define isit(s) !strncmp(line,s,strlen(s)) -#define isit(s) !strcmp(pch=strtok(scrap," \t"),s) -#define next() pch += strlen(pch) + 1 - - #ifdef _WIN32 - - if(isit("vrpn_Sound_Server")) - { - printf("%s\n",pch); - next(); - printf("%s\n",pch); - if (sscanf(pch,"%511s\t%d\t%511s\t%511s",s2,&USE_TRACKER,tracker_name, tracker_device) != 4) - { - printf("Bad vrpn_Server_Sound line: %s\n",line); - if (bail_on_error) - { - return; - } - else - { - continue; - } // Skip this line - } - - hWin = GetConsoleHwnd(); - - printf("Begin initializing A3D Sound Server\n"); - soundServer = NULL; - soundServer = new vrpn_Sound_Server_A3D(s2, connection,hWin); - if (soundServer == NULL) - printf("Can't create sound server\n"); - printf("End A3D Sound Server initialization\n"); - - } -#endif - } - } - - fclose(config_file); - - // Open remote tracker if we are to use one - - if (USE_TRACKER) { - - char newname[1024]; - sprintf(newname,"%s@%s",(const char*)tracker_device, (const char*)tracker_name); - printf("Using tracker: %s\n",newname); - trackerCon = vrpn_get_connection_by_name(tracker_name); - tracker_connection = new vrpn_Tracker_Remote((const char *) newname); - // SET UP TRACKER HANDLER - if (trackerCon->doing_okay()) { - printf( "TC OK.\n"); - } else { - printf( "TC Not OK.\n"); - } - } - else printf("Not using tracker\n"); - - loop = 0; - - if (client_name) - { - printf( "vrpn_serv: connecting to client: %s:%d\n", - client_name, client_port); - if (connection->connect_to_client(client_name, client_port)) - { - printf( "server: could not connect to client %s:%d\n", client_name, client_port); - } - } - - -// ******************************************************************** -// ** ** -// ** MAIN LOOP ** -// ** ** -// ******************************************************************** -float fPrevTime = 0.0f; -float fFrameTime; -float fTime; -int counter = 0; -int stopNow = 0; -int numconnections = 0; -char buf[1024]; - - printf("Begin main loop\n"); - - while (!stopNow && !_kbhit()) { - - soundServer->GetLastError(buf); - - if (!strncmp(buf,"ERROR",5)) { - printf("%s", buf); - } - counter++; - - // record time since last frame - if (counter==NUM_SPIN) { - fTime = (float)timeGetTime(); - counter = 0; - - fFrameTime = (fTime - fPrevTime) * 0.001f; - - printf("Running at %4.2f Hz\n", (float) NUM_SPIN/fFrameTime); - - fPrevTime = fTime; - } - - soundServer->mainloop(); - - // ensure we get a new report! - if (USE_TRACKER) { - tracker_connection->mainloop(); - got_report = 0; - if (trackerCon->doing_okay()) - while (!got_report) - tracker_connection->mainloop(); - } - - // Send and receive all messages - connection->mainloop(); - if (numconnections==0 && connection->connected()) - numconnections++; - - if (((numconnections!=0) & (!connection->connected())) | !connection->doing_okay()) { - soundServer->shutDown(); - numconnections=0; - } - } - - printf("about to shutdown\n"); -// delete connection; - delete soundServer; -} diff --git a/src/vrpn/server_src/aureal_sound_server/vrpn_Sound_A3D.h b/src/vrpn/server_src/aureal_sound_server/vrpn_Sound_A3D.h deleted file mode 100644 index e7c07b4d7846744981e644c08ee3dd5066fc5be3..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/aureal_sound_server/vrpn_Sound_A3D.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef VRPN_SOUND_A3D_H -#define VRPN_SOUND_A3D_H - -#ifdef _WIN32 -#include "vrpn_Shared.h" - -#include <objbase.h> -#include <stdlib.h> -#include <cguid.h> - -#include <initguid.h> -#include "ia3dutil.h" -#include "ia3dapi.h" - -#include "vrpn_Sound.h" -#include "quat.h" - -#include "string.h" -#include <conio.h> - -class vrpn_Sound_Server_A3D : public vrpn_Sound_Server { -public: - vrpn_Sound_Server_A3D(const char * name, vrpn_Connection * c, HWND hWin); - - ~vrpn_Sound_Server_A3D(); - - void playSound(vrpn_SoundID id, vrpn_int32 repeat, vrpn_SoundDef soundDef); - void stopSound(vrpn_SoundID id); - - void loadSoundLocal(char* filename, vrpn_SoundID id, vrpn_SoundDef soundDef); - void loadSoundRemote(char* file, vrpn_SoundID id, vrpn_SoundDef soundDef); // not supported - void unloadSound(vrpn_SoundID id); - void changeSoundStatus(vrpn_SoundID id, vrpn_SoundDef soundDef); - - void setListenerPose(vrpn_PoseDef pose); - void setListenerVelocity(vrpn_float64 *velocity); - void setSoundPose(vrpn_SoundID id, vrpn_PoseDef pose); - void setSoundVelocity(vrpn_SoundID id, vrpn_float64 *velocity); - void setSoundDistInfo(vrpn_SoundID id, vrpn_float64 *distinfo); - void setSoundConeInfo(vrpn_SoundID id, vrpn_float64 *coneinfo); - - void setSoundDoplerFactor(vrpn_SoundID id, vrpn_float64 doplerfactor); - void setSoundEqValue(vrpn_SoundID id, vrpn_float64 eqvalue); - void setSoundPitch(vrpn_SoundID id, vrpn_float64 pitch); - void setSoundVolume(vrpn_SoundID id, vrpn_float64 volume); - void loadModelLocal(const char * filename); - void loadModelRemote(); // not supported - void loadPolyQuad(vrpn_QuadDef * quad); - void loadPolyTri(vrpn_TriDef * tri); - void loadMaterial(vrpn_MaterialDef * material, vrpn_int32 id); - void setPolyQuadVertices(vrpn_float64 vertices[4][3], const vrpn_int32 id); - void setPolyTriVertices(vrpn_float64 vertices[3][3], const vrpn_int32 id); - void setPolyOF(vrpn_float64 OF, vrpn_int32 tag); - void setPolyMaterial(const char * material, vrpn_int32 tag); - - void mainloop(); - bool noSounds(void); - void stopAllSounds(); - void shutDown(); - - vrpn_float64 GetCurrentVolume(const vrpn_int32 CurrentSoundId); - void GetLastError(char * buf); - vrpn_int32 GetCurrentPlaybackRate(const vrpn_int32 CurrentSoundId); - void GetCurrentPosition(const vrpn_int32 CurrentSoundId, float* X_val, float* Y_val, float* Z_val); - void GetListenerPosition(float* X_val, float* Y_val, float* Z_val); - void GetCurrentDistances(const vrpn_int32 CurrentSoundId, float* FMin, float* FMax); - void GetListenerOrientation(float* X_val, float *Y_val, float *Z_val); - void GetCurrentOrientation(const vrpn_int32 CurrentSoundId,float *X_val, float *Y_val, float *Z_val); - - vrpn_int32 LastSoundId; //ID of last played sound -private: - - // these are specific to A3D 3.0 - IA3d5 * a3droot; - IA3dListener * a3dlis; - IA3dSource2 ** a3dsamples; - IA3dGeom2 * a3dgeom; - HRESULT lasterror; - - // the idea of a map is to have a way to go from the unique id being passed in - // by the user to an internal identifier... - vrpn_int32 maxSounds; - vrpn_int32 numSounds; - vrpn_int32 soundMap[MAX_NUMBER_SOUNDS]; - - vrpn_int32 maxMaterials; - vrpn_int32 numMaterials; - vrpn_int32 materialMap[MAX_NUMBER_MATERIALS]; - IA3dMaterial * materials[MAX_NUMBER_MATERIALS]; - char mat_names[MAX_NUMBER_MATERIALS][MAX_MATERIAL_NAME_LENGTH]; - - vrpn_int32 numconnections; // number of times server has been connected to.. - -}; - -#endif //_WIN32 -#endif \ No newline at end of file diff --git a/src/vrpn/server_src/ausim_sound_server/README.txt b/src/vrpn/server_src/ausim_sound_server/README.txt deleted file mode 100644 index c4108dec98d9fef4616b1c8ceab5f6f1b929611a..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/ausim_sound_server/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -*everything* must be built singlethreaded! -this includes vrpn, ausim_sound_server, and client? - -make sure that you ignore the correct C runtime libs: -libcmt.lib,msvcrt.lib,libcd.lib,libcmtd.lib,msvcrtd.lib - diff --git a/src/vrpn/server_src/ausim_sound_server/ausim_sound_server.dsp b/src/vrpn/server_src/ausim_sound_server/ausim_sound_server.dsp deleted file mode 100644 index 57ef68202507b3ed4cd4db8db58ad0bf9568b2af..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/ausim_sound_server/ausim_sound_server.dsp +++ /dev/null @@ -1,106 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ausim_sound_server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=ausim_sound_server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ausim_sound_server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ausim_sound_server.mak" CFG="ausim_sound_server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ausim_sound_server - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "ausim_sound_server - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ausim_sound_server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "ausim_sound_server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /ML /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib quat.lib vrpn.lib auclient.lib ws2_32.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt.lib" /nodefaultlib:"msvcrt.lib" /nodefaultlib:"libcd.lib" /nodefaultlib:"libcmtd.lib" /nodefaultlib:"msvcrtd.lib" /pdbtype:sept -# SUBTRACT LINK32 /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "ausim_sound_server - Win32 Release" -# Name "ausim_sound_server - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\vrpn_Sound_ASM.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\vrpn_Sound_ASM.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/server_src/ausim_sound_server/ausim_sound_server.dsw b/src/vrpn/server_src/ausim_sound_server/ausim_sound_server.dsw deleted file mode 100644 index 80c25bf9b8bbb30255d18444c6c63e564654a4b8..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/ausim_sound_server/ausim_sound_server.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "ausim_sound_server"=.\ausim_sound_server.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/vrpn/server_src/ausim_sound_server/vrpn.cfg b/src/vrpn/server_src/ausim_sound_server/vrpn.cfg deleted file mode 100644 index c305a7bdfa8be5aa5baf76a626e4fac064c8f55d..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/ausim_sound_server/vrpn.cfg +++ /dev/null @@ -1,663 +0,0 @@ -# vrpn.cfg.SAMPLE for VRPN version 06.04 - -vrpn_Sound_Server sound 0 localhost tracker - -################################################################################ -################################################################################ -# This file provides comments and examples for the vrpn.cfg file that is read -# by the vrpn_server application when it starts up. This is a generic server -# application that can start up many but not all servers (not the Phantom -# server, for example). -# -# This has sample lines for a vrpn.cfg file. If you get a new device working, -# add a line for it here. DO NOT remove lines from this file (unless -# devices are declared obsolete) - just change the actual vrpn.cfg to match -# your application. -# -# All examples in the file are preceded by comment characters (#). To actually -# use one of these examples, remove that character from the beginning of all the -# examples that you want to use, and edit those lines to suit your environment. -################################################################################ - -################################################################################ -################################################################################ -# Tracker classes. Lines here to start various tracker servers. A description is -# provided for each type of tracker for the arguments it takes, then an example -# configuration line is provided. -################################################################################ - -################################################################################ -# NULL Tracker. This is a "device" that reports the Identity transformation for -# each of its sensors at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are three arguments: -# char name_of_this_device[] -# int number_of_sensors -# float rate_at_which_to_report_updates - -#vrpn_Tracker_NULL Tracker0 2 2.0 - -################################################################################ -# Flock-of-birds Tracker. Runs an Ascension Flock of Birds tracker that is -# attached to a serial port on this machine. Note that there is another driver -# (listed below) that runs the Flock when each sensor is connected to its own -# serial line. Arguments: -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tracker_Flock Tracker0 4 /dev/ttyS0 115200 - -################################################################################ -# Flock-of-birds in parallel Tracker. Runs an Ascension Flock of Birds tracker -# that has its source and each sensor plugged into its own serial port on this -# machine (perhaps through a Cyclades multi-port serial card). This mode of -# operation increases the throughput and decreases the latency of tracker reports. -# The arguments match those of the Flock-of-birds tracker from above, with the -# addition of the name of the serial ports for each of the sensors added at the -# end. Arguments (all on the same line): -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device_for_controller[] -# int baud_rate_of_serial_device -# [one for each sensor] char name_of_serial_device_for_sensor[] - -#vrpn_Tracker_Flock_Parallel Tracker0 4 /dev/ttyC4 115200 /dev/ttyC0 /dev/ttyC1 /dev/ttyC2 /dev/ttyC3 - -################################################################################ -# Fastrak Tracker. Runs a Polhemus Fastrak tracker that is attached to a serial -# port on this machine. This driver will also run an InterSense IS600 or IS900 -# tracker, but you will want to include extra initialization code (as described -# below) to set up the ultrasonic pip information, wand devices, stylus devices -# and so forth. Arguments that go on the first line: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the Fastrak during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the Fastrak -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. -# -# If one or more sensors on the Fastrak have a stylus button on them, use -# the "FTStylus" command after the reset command lines (if any). There should -# be a front-slash "/" character at the end of the line before the FTStylus -# command. The command takes two arguments: the name of the button device -# that will report the buttons and the sensor number to which the button is -# attached (the first sensor is sensor 0). -# -# Commands to add Joysticks (2 buttons) or Wands (5 buttons and 2 analogs) to -# the various sensors on the Isense900 are done by adding Stylus and -# Wand command lines after the reset command lines. Each of these lines -# takes two arguments: the name of the button (for Stylus) or button and -# analog (for Wand) servers, and the sensor number (starting from 0). The -# Wand line takes eight additional parameters, which specify the scaling -# and clipping behavior of the two directions on the analog joystick. Each -# set of for is the min, lowzero, hizero, and max values: these are mapped -# to -1, 0,0, and 1 (all values between lowzero and hizero are mapped to 0). -# Start with these at -1,0,0,1 and use the 'printcereal' program or some other -# method to read them and see what the range of acheivable values is. Then, -# set them to slightly conservative values so that the whole range is covered -# and the analogs will report zero when the joystick is centered. The -# presence of these lines is indicated by placing them after any additional -# reset command lines, by ending the line preceding them with the front slash -# "/" character. -# -# Note that this frontslash and backslash-notation can only be used for the -# Fastrak/Isense tracker, not to extend the line for any other type of device -# listed in this configuration file. - -# Vanilla Fastrak on on a Unix box -#vrpn_Tracker_Fastrak Fastrak0 /dev/ttyS0 19200 - -# Fastrak with a stylus on sensor zero on a Windows box -#vrpn_Tracker_Fastrak Tracker0 COM1 115200 / -#FTStylus Stylus0 0 - -# IS600 and its pip settings -#vrpn_Tracker_Fastrak Isense600 /dev/ttyS0 19200 \ -#MCc\ -#*5\ -#MCM1,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,89\ -#MCM1,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,87\ -#MCM2,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,66\ -#MCM2,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,71\ -#MCM3,1,0.1237,-0.0762,-0.0424,0.00,0.00,-1.00,82\ -#MCM3,2,0.1237,0.0762,-0.0424,0.00,0.00,-1.00,77\ -#MCe\ -#*10 - -# IS900 with a wand on the first sensor and a stylus on the third: -#vrpn_Tracker_Fastrak Isense900 COM1 115200 / -#Wand Wand0 0 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 / -#Stylus Stylus0 2 - -################################################################################ -# InterSense tracker using the Intersense-provided library to communicate -# with the tracker. This device type is not compiled by default, since it uses -# a proprietary library. However, you can get it to compile by defining -# VRPN_INCLUDE_INTERSENSE when compiling. Note that the Fastrak driver will -# run IS-600 and IS-900 trackers without the proprietary library, so you might -# try that as well. -# char name_of_this_device[] -# char name_of_serial_device[] - -#vrpn_Tracker_InterSense Tracker0 COM1 - -################################################################################ -# Dynasight Tracker. Runs an Origin System's DynaSight tracker connected to a -# serial port on this machine. arguments: -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tracker_Dyna Tracker0 1 /dev/ttyS0 19200 - -#vrpn_Tracker_Dyna Tracker0 1 COM1 19200 - -################################################################################ -# AnalogFly Tracker. This is a tracker that is intended to be used on top of -# a joystick or motion tracker of some kind to turn it into a moving or flying -# device. It could be used on top of any analog device, in fact. -# This device basically takes in analog signals and puts out transformation -# matrices. It should supercede the JoyFly tracker, since it is more general. -# There are two kinds of JoyFly's: absolute ones and differential ones. For -# absolute ones, the analog value is mapped directly to position or orientation -# on each axis. For differential ones, the values are used to create a -# "change" matrix that is applied once per interval, accumulating changes as -# it goes; this enables the user to "fly" along by holding a joystick forward, -# for example. -# One analog channel is associated with each axis (X, Y, Z) and rotation about -# each axis (RX, RY, RZ). For each axis, the value is converted to a position -# (meters) or speed (meters/second) for absolute trackers; or into an -# orientation (revolutions) or angular velocity (revolutions/second) by first -# subtracting an offset, then thresholding it to see if it is far enough from -# zero, then (if it is) scaling it and taking it to a power (to allow nonlinear -# speedup as the stick is pushed far from center). -# A button can be associated with a reset function, which will take the -# device back to center (identity transformation). The device will also recenter -# when the first connection is made to the server it is running on. (Centering -# has no effect on absolute AnalogFlys). -# Any axis or the reset button can be disabled by setting the name of its -# associated device to the string "NULL". -# Note that you could have multiple of these devices running simultaneously, -# each with a different name and interaction metaphor. The user could then -# connect to their favorite one. Arguments: -# char name_of_this_device[] -# float update_rate_to_send_tracker_reports -# char type[] = "absolute" or "differential" -# [six lines follow, one for X Y Z RX RY RZ, each with: -# char axis_name[] (X Y Z RX RY RZ in that order) -# char name_of_analog_device[] (start with * for local) -# int channel_of_analog_device -# float offset -# float threshold -# float scale -# float power -# ] -# [New line to describe reset button, with: -# char "RESET" -# char name_of_button_device[] (start with * for local) -# int which_button_to_use -# ] - -#vrpn_Tracker_AnalogFly Tracker0 60.0 differential -#X *CerealBox0 4 0.0 0.021 1.0 1.0 -#Y *CerealBox0 5 0.0 0.021 1.0 1.0 -#Z *CerealBox0 6 0.0 0.021 3.0 1.0 -#RX *CerealBox0 0 0.0 0.021 1.0 1.0 -#RY *CerealBox0 1 0.0 0.021 1.0 1.0 -#RZ *CerealBox0 2 0.0 0.021 3.0 1.0 -#RESET *CerealBox 3 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 differential -#X *Magellan0 0 0.0 0.0 2.0 1.0 -#Y *Magellan0 1 0.0 0.0 2.0 1.0 -#Z *Magellan0 2 0.0 0.0 2.0 1.0 -#RX *Magellan0 3 0.0 0.0 2.0 1.0 -#RY *Magellan0 4 0.0 0.0 2.0 1.0 -#RZ *Magellan0 5 0.0 0.0 2.0 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X NULL 0 0.0 0.0 1.0 1.0 -#Y NULL 0 0.0 0.0 1.0 1.0 -#Z NULL 0 0.0 0.0 1.0 1.0 -#RX *Radamec0 1 0.0 0.0 -0.0027777777 1.0 -#RY NULL 0 0.0 0.0 1.0 1.0 -#RZ *Radamec0 0 0.0 0.0 0.0027777777 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Joystick0 0 0.0 0.0 1.0 1.0 -#Y *Joystick0 1 0.0 0.0 -1.0 1.0 -#Z *Joystick0 6 0.0 0.0 1.0 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Joystick0 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 - -#vrpn_Tracker_AnalogFly Phantom 60.0 absolute -#X *Phantom 0 0.0 0.0 0.125 1.0 -#Y *Phantom 1 0.0 0.0 -0.125 1.0 -#Z *Phantom 6 0.0 0.0 0.25 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Phantom 5 0.0 0.0 0.06 1.0 -#RESET NULL 0 - -################################################################################ -# XXX This device is superceded by the more-general vrpn_Tracker_AnalogFly. -# JoyFly Tracker. A vrpn_Tracker that translates the vrpn_Joystick into -# Walkthrough- convention tracker reports. This is part of a two-part setup -# that allows you to use a joystick as a flying device. First, a joystick -# device has to be created (named joybox in our example) that will produce -# the analog inputs that the JoyFly tracker uses to determine the transformation. -# Then, the JoyFly device needs to be started and will listen to the device -# and produce tracker reports. If these are both run on the same server, then -# the JoyFly needs to use the "server" connection to hear from the Joystick -# device, which is indicated by placing a '*' in front of the name of the -# joystick device that it is to use. If the joystick device is remote from -# this server, then the full name of it should be used (joystick@foo.cs.unc.edu). -# XXX This device is superceded by the more-general vrpn_Tracker_AnalogFly -# Arguments: -# char name_of_this_device[] -# char source_joystick_name[] (Start with * for one sharing a connection) -# char joystick_configuration_file_name[] - -#vrpn_JoyFly walk-joybox *joybox vrpn_Joyfly.cfg - -################################################################################ -# ButtonFly Tracker. This is a tracker that is intended to be used on top of -# a Global Haptics Orb or other buttond device to turn it into a moving or -# flying device. It basically takes in button signals and puts out -# transformation matrices. -# There are two kinds of Buttons: absolute ones and differential ones. For -# absolute ones, pressing it causes the position or orientation associated with -# it to be stored directly into the transformation. This enables the user to -# "teleport" to given locations by pressing buttons. For differential ones, -# the position or orientation are treated as deltas and are used to create a -# "change" matrix that is applied once per interval, accumulating changes as -# it goes; this enables the user to "fly" along by holding a button down, -# for example. -# Each button is associated with either a position (meters) or speed -# (meters/second) for absolute buttons; or an orientation (revolutions) -# or angular velocity (revolutions/second). -# An analog channel can be associated with a scale function that scales the -# velocity or angular velocity terms uniformly. The entry specifies an -# offset to be applied to the analog channel, a scale to be applied to it, -# and a power to which the result should be taken; the end result is used -# to scale all velocity or angular velocity terms. This channel has no -# effect on the effects of absolute buttons. -# The device will recenter (set itself to the identity transform) when the -# first connection is made to the server it is running on. -# Note that you could have multiple of these devices running simultaneously, -# each with a different name and interaction metaphor. The user could then -# connect to their favorite one. Arguments: -# char name_of_this_device[] -# float update_rate_to_send_tracker_reports -# [one or more lines follow, each of one of two types -# (1) char [] = "absolute" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float X_to_translate_to -# float Y_to_translate_to -# float Z_to_translate_to -# float rotation_about_X -# float rotation_about_Y -# float rotation_about_Z -# (2) char [] = "differential" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float X_translation_meters_per_second -# float Y_translation_meters_per_second -# float Z_translation_meters_per_second -# float spin_about_X_revolutions_per_second -# float spin_about_Y_revolutions_per_second -# float spin_about_Z_revolutions_per_second -# ] -# [An optional line describing an analog to scale the velocity -# char [] = "vel_scale" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float offset -# float scale -# float power -# ] -# [An optional line describing an analog to scale the rotation -# char [] = "rot_scale" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float offset -# float scale -# float power -# ] -# [one more line, consisting of the word "end"] -# Note that the same button can cause more than one action to take place, -# and the same analog can cause scaling of both the velocity and rotation. - -# This example for a Global Haptics Orb pushes the transformation away -# from the button that is pressed -# for all of the standard buttons. It rotates around the Y axis when the -# rocker switch is rocked up and down. It resets to the origin when one -# of the pushbuttons is pressed. Both the velocity and angular velocity -# are controlled by the thumbwheel. - -#vrpn_Tracker_ButtonFly Tracker0 60.0 -#differential *Orb0 0 0 1 0 0 0 0 -#differential *Orb0 1 0.707 0.707 0 0 0 0 -#differential *Orb0 2 1 0 0 0 0 0 -#differential *Orb0 3 0.707 -0.707 0 0 0 0 -#differential *Orb0 4 0 -1 0 0 0 0 -#differential *Orb0 5 -0.707 -0.707 0 0 0 0 -#differential *Orb0 6 -1 0 0 0 0 0 -#differential *Orb0 7 -0.707 0.707 0 0 0 0 -#differential *Orb0 8 0 0.707 -0.707 0 0 0 -#differential *Orb0 9 0.577 0.577 -0.577 0 0 0 -#differential *Orb0 10 0.707 0 -0.707 0 0 0 -#differential *Orb0 11 0.577 -0.577 -0.577 0 0 0 -#differential *Orb0 12 0 -0.707 -0.707 0 0 0 -#differential *Orb0 13 -0.577 -0.577 -0.577 0 0 0 -#differential *Orb0 14 -0.707 0 -0.707 0 0 0 -#differential *Orb0 15 -0.577 0.577 -0.577 0 0 0 -#differential *Orb0 16 0 0.707 0.707 0 0 0 -#differential *Orb0 17 0.577 0.577 0.577 0 0 0 -#differential *Orb0 18 0.707 0 0.707 0 0 0 -#differential *Orb0 19 0.577 -0.577 0.577 0 0 0 -#differential *Orb0 20 0 -0.707 0.707 0 0 0 -#differential *Orb0 21 -0.577 -0.577 0.577 0 0 0 -#differential *Orb0 22 -0.707 0 0.707 0 0 0 -#differential *Orb0 23 -0.577 0.577 0.577 0 0 0 -#differential *Orb0 24 0 0 -1 0 0 0 -#differential *Orb0 25 0 0 1 0 0 0 -#differential *Orb0 28 0 0 0 0 -0.1 0 -#differential *Orb0 29 0 0 0 0 0.1 0 -#absolute *Orb0 27 0 0 0 0 0 0 -#vel_scale *Orb0 0 -1.0 0.5 1.0 -#rot_scale *Orb0 0 -1.0 0.5 1.0 -#end - -################################################################################ -# 3Space Tracker. Runs a Polhemus 3Space (not Fastrak) tracker that is attached -# to a serial port on this machine. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tracker_3Space Tracker0 /dev/ttyS0 19200 - -################################################################################ -################################################################################ -# Non-tracker devices. Lines are provided here for the various non-tracker servers -# that can be started. - -################################################################################ -# Example Dial server. This is a "device" that reports constant rotations for -# each of its dials at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are four arguments: -# char name_of_this_device[] -# int number_of_dials -# float rate_at_which_the_dials_spin (revolutions/second) -# float rate_at_which_to_report_updates (udpates/second) - -#vrpn_Dial_Example Dial0 2 2.0 10.0 - -################################################################################ -# CerealBox dial/button/analog. Runs a BG Systems CerealBox device that attaches -# to a serial port on this machine. As of VRPN version 04.07, 19200 is the -# only supported baud rate. The driver has been tested on an LV824-F-8e device. -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int number_of_buttons_to_read (starting from 0) -# int number_of_analogs_to_read -# int number_of_encoders_to_read - -#vrpn_CerealBox Cereal0 /dev/cua0 19200 8 8 8 - -################################################################################ -# Magellan button/analog. Runs a Logitech Magellan device that attaches -# to a serial port on this machine. As of VRPN version 04.12, 9600 is the -# only supported baud rate. -# -# Note that if you want to use the Magellan as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device that listens to its analog -# outputs and converts them into tracker reports -# -# John Stone added support for the SpaceBalls in version 06.03, an example -# startup is shown below. -# -# Julien Brisset discovered how to make this work with a slightly older version -# of the Magellan. If the example Magellan line doesn't work, add 'altreset' to -# the line to use the alternative reset string for the device. -# -# NOTE: You should NOT run the driver that comes with the Magellan, since the -# VRPN driver opens the serial port and communicates with the device directly. -# If the Magellan driver from the manufacturer is running, then VRPN will not -# be able to open the port. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# char "altreset" {Optional, for older Magellans} - -#vrpn_Magellan Magellan0 /dev/ttyS0 9600 -#vrpn_Magellan Magellan0 /dev/ttyS0 9600 altreset -#vrpn_Spaceball Spaceball0 /dev/ttyS0 9600 - -################################################################################ -# NRL Immersion Box dial/button/analog. Runs a Immersion Interface Box device -# attached to a serial port. As of March 28, 2000 code to read the analog and -# angle encoders has not been implemented. Also, baud rate on many SGI's is -# limited to 38400, but I have run the ibox at 115200 on PCs. -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int number_of_buttons_to_read (i.e. 4 ==> 0,1,2,3) -# int number_of_analogs_to_read -# int number_of_encoders_to_read - -#vrpn_ImmersionBox ibox /dev/ttyd2 38400 4 0 0 -#vrpn_ImmersionBox ibox com1 115200 4 0 0 - -################################################################################ -# Wands button/analog, driver from Brown University. Runs a Wanda device -# attached to a serial port. As of Aug 28, 2000 this driver was untested on -# Windows machines. The code compiles fine for them, so it seems like things -# should work okay... -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port_to_use[] -# int baud_rate_of_serial_device -# float minimum_update_rate - -#vrpn_Wanda wanda /dev/ttyd2 38400 60.0 - -################################################################################ -# Radamec Serial Position Interface analog. Camera tracker that attaches -# to a serial port on this machine. Note that for normal operation, 38400 is the -# only supported baud rate. -# -# Note that if you want to use the Radamec SPI as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device (of the absolute variety) -# that listens to its analog outputs and converts them into tracker reports. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port[] -# int baud_rate_of_serial_port - -#vrpn_Radamec_SPI Analog0 /dev/ttyS16 38400 - -################################################################################ -# Zaber linear positioning element analog that attaches -# to a serial port on this machine. -# -# Note that if you want to use the Zaber as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device (of the absolute variety) -# that listens to its analog outputs and converts them into tracker reports. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port[] - -#vrpn_Zaber Analog0 COM1 - -################################################################################ -# SGI Dial and Button box, raw interface. Runs a dial-and-button box from SGI, -# talking to it through the raw serial interface (not using the GL interface -# supplied by SGI). This allows the box to be opened even if there is nobody -# logged on at the console. Note that to use this on an SGI, you will need to -# configure the port as a serial device, not as a button device, to get it to -# run. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# [list of buttons to treat as toggles] int button_to_toggle - -#vrpn_raw_SGIBox Sgibox0 /dev/ttyS0 0 1 2 3 - -################################################################################ -# SGI Dial and Button box, cooked interface. Runs a dial-and-button box from SGI, -# talking to it through the GL interface supplied by SGI. Note that this can -# only be used on an SGI, and the serial port must be configured as a dial/button -# device and the dial/button server from SGI must be running to use it. Arguments: -# char name_of_this_device[] -# [list of buttons to treat as toggles] int button_to_toggle - -#vrpn_SGIBOX Sgibox0 1 2 - -################################################################################ -# UNC Python button device. UNC has developed a custom button input device, which -# is a 5-button controller that attaches to a parallel port and uses the sense -# lines to return the state of the buttons. This runs the device. Note that on -# Windows NT, you need to have installed the GiveIO driver for this code to -# work. It also works on Linux (no extra drivers needed), but on no other -# architecture. Arguments: -# char name_of_this_device[] -# int parallel_port_to_use_starting_with_1 - -#vrpn_Button_Python Button0 1 - -################################################################################ -# UNC Joystick driver. UNC has developed a custom-build joybox, with 7 analog -# and 2 button inputs (two 3-axis joysticks and a slider, with a button on top -# of each joystick). This will drive one of these devices, which attaches to -# a serial port on this computer. I'm not sure what the baud rate should be; -# David Harrison might know. -# This driver can be used in conjunction with the JoyFly driver to produce a -# tracker that uses the joystick to fly around. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# float minimum_update_rate_from_analogs_even_if_they_dont_move - -#vrpn_Joystick Joybox0 /dev/ttyd1 19200 10.0 - -################################################################################ -# Linux Joystick. Interface to the Linux Joystick driver by Vojtech Pavlik -# included in several Linux distributions. The server code has been tested -# with Linux Joystick driver version 1.2.14. Yet, there is no way how to -# map a typical joystick's zillion buttons and axes on few buttons and axes -# really used. Unfortunately, even joysticks of the same kind can have -# different button mappings from one to another. -# Arguments: -# char name_of_this_device[] -# char name_of_joystick_device[] - -#vrpn_Joylin Joylin0 /dev/js0 - -################################################################################ -# Fakespace Pinch Glove. Drives a Fakespace Pinch Glove device connected to a -# serial port on this machine. This device has ten buttons-two hands and five -# fingers on each hand. Buttons 0-4 are fingers for the right hand-thumb first -# and pinkie last- while buttons 5-9 are for the left hand-thumb first. The -# Button is ON when it is touching another finger. Therefore there cannot -# be just one Button ON. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -# vrpn_Button_PinchGlove PinchGlove0 COM1 9600 - -################################################################################ -# Adrienne Electronics Corporation PCI time code driver. The PCI-VITC board -# for which this driver was developed reads in VITC time codes from an input -# signal. This will drive one of these devices. -# Arguments: -# char name_of_this_device[] - -# vrpn_TimeCode_Generator TimeGen0 - -################################################################################ -# 5DT glove. Drive a 5dt glove connected on a serial Port. This device uses -# optical fiber to get the finger position. Not all the 5dt gloves are available -# now. -# 2 modes are driven: the first one let the driver get data from the glove -# when requested (we advise this mode). The second one makes the glove send -# data continuously. This mode may saturate the input buffer. -# Gesture management is not implemented yet nor the mouse emulation mode -# arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int mode_of_data_reporting (1 = on request, 2 = continuously) - -# vrpn_5dt glove_5dt /dev/ttyS0 19200 1 - -################################################################################ -# NRL Serial Mouse. A device made by wiring buttons in parallel with the buttons -# on a serial mouse. Both mousesystems or microsoft mouse protocols are -# supported. Note that the server code makes the connection at the standard -# 1200 baud. The mouse can be plugged into any serial port -- this driver goes -# directly through the raw port and does not use the built-in mouse drivers. -# NOTE: The middle button on the 3button type is toggled by moving the mouse -# on a surface while not toggling the other two buttons, strange as this may -# seem. The motion of the mouse is not reported, only the buttons. - -#vrpn_Button_SerialMouse Button0 /dev/ttyd1 mousesystems -#vrpn_Button_SerialMouse Button0 /dev/ttyd1 3button -#vrpn_Button_SerialMouse Button0 COM1 mousesystems -#vrpn_Button_SerialMouse Button0 COM1 3button - -################################################################################ -# NRL TNG3. (Totally Neat Gadget) A device made by mindtel, available from -# pulsar.org. Powered off the serial port control lines, the TNG3 has 8 digital -# and 8 analog inputs. Analog resolution is 8 bits. Baud rate fixed internally -# at 19200. -# char name_of_this_device[] -# char name_of_serial_device[] -# int number_of_buttons_to_read (i.e. 8 ==> 0,1,2,3,4,5,6,7) -# int number_of_analogs_to_read - -#vrpn_Tng3 tng3name /dev/ttyd2 4 0 -#vrpn_Tng3 tng3name com1 8 8 - -################################################################################ -# Microsoft DirectX compatible force-feedback joystick (or non-force-feedback -# joystick). -# char name_of_this_device[] -# int number of times per second to read from the device -# int number of times per second to update force (0 for non-force device) - -#vrpn_DirectXFFJoystick Joystick0 60 0 -#vrpn_DirectXFFJoystick Joystick0 60 200 -#vrpn_DirectXFFJoystick Joystick0 60 200 - -################################################################################ -# Global Haptics GeoOrb serial-line device that contains a number of buttons, -# a thumbwheel, and a trackball. For current devices, only 19200 baud works. -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_GlobalHapticsOrb Orb0 COM1 19200 - diff --git a/src/vrpn/server_src/ausim_sound_server/vrpn_Sound_ASM.cpp b/src/vrpn/server_src/ausim_sound_server/vrpn_Sound_ASM.cpp deleted file mode 100644 index 88ef5e4bfa3f24e2f0081ff692f2754a4f764c9d..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/ausim_sound_server/vrpn_Sound_ASM.cpp +++ /dev/null @@ -1,1273 +0,0 @@ -// vrpn_Sound_ASM.cpp (AuSIM) -// -// July 2003- Matt McCallus - -/* TODO: - find out about sound parameters and listener parameters - error checking on cre functions. - -*/ - -#include "vrpn_Sound_ASM.h" - -#define NUM_SPIN 10000 -#define MAX_NUM_SOUNDS 16 -const int CHAR_BUF_SIZE = 1024; - - -// Some globals for mapping sounds -int g_numSounds = 0; -SoundMap g_soundMap[MAX_NUM_SOUNDS]; -Sound g_Sound[MAX_NUM_SOUNDS]; // wrapper for ASMSound obj -Listener* g_pListener; - - - -vrpn_Sound_Server_ASM::vrpn_Sound_Server_ASM(const char * name, - vrpn_Connection * c ) - : vrpn_Sound_Server(name, c){ - - // initialize AuSIM - if(cre_init(Atrn_ASM1, 0, MAX_NUM_SOUNDS, _CONSOLE_|_VERBOSE_) < Ok) { - - printf("AudioInit().\n"); - send_message("Error initializing AuSIM server.. sound server did not start.",vrpn_TEXT_ERROR,0); - exit(0); - } - - // set up the sound map. - g_numSounds = 0; - - for(int i=0; i<MAX_NUM_SOUNDS; i++){ - g_soundMap[i].m_iSoundNum = -1; - for(int j=0; j<80; j++) - g_soundMap[i].m_ASMSoundName[j] = '\0'; - } -} - - - -vrpn_Sound_Server_ASM::~vrpn_Sound_Server_ASM() { - - // TODO: figure out what to release/delete -} - - -void vrpn_Sound_Server_ASM::playSound(vrpn_SoundID id, vrpn_int32 repeat, vrpn_SoundDef soundDef) { - - if(id<0 || id>g_numSounds){ - send_message("Error: playSound (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - // get sound id from the sound map - int myid = g_soundMap[id].m_iSoundNum; - - g_Sound[myid].repeat = repeat; - - if (myid != -1) { - - if(g_Sound[id].m_pSound != NULL){ - - if (repeat == 0) // loop continuously - g_Sound[myid].m_pSound->Play(myid, 0 , g_Sound[myid].m_pSound->m_fVolume ); - else { // decrement the repeat count - g_Sound[myid].m_pSound->Play(myid, g_Sound[myid].repeat, g_Sound[myid].m_pSound->m_fVolume ); - g_Sound[myid].repeat--; - - } - - send_message("Playing sound\n",vrpn_TEXT_NORMAL,0); - } - else send_message("Error: playSound (Sound not loaded)",vrpn_TEXT_WARNING,0); - - } - else send_message("Error: playSound (Sound not loaded)",vrpn_TEXT_WARNING,0); -} - - - -void vrpn_Sound_Server_ASM::stopSound(vrpn_SoundID id) { - - if(id<0 || id>g_numSounds){ - send_message("Error: stopSound (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - int myid = g_soundMap[id].m_iSoundNum; - - if ( myid != -1 && g_Sound[myid].m_pSound != NULL ) { - g_Sound[myid].m_pSound->Stop(myid); - g_Sound[myid].m_pSound->Reset(myid); - send_message("Stopping sound",vrpn_TEXT_NORMAL,0); - } - else{ - send_message("Invalid sound id",vrpn_TEXT_ERROR,0); - printf("Invalid sound id\n"); - } -} - - - -void vrpn_Sound_Server_ASM::loadSoundLocal(char* filename, vrpn_SoundID id, vrpn_SoundDef soundDef) { - - char tempbuf[1024]; - - // Free any previous sound, and make a new one - // SAFE_DELETE( g_Sound[id].m_pSound ); - - wavFt* waveFile; - - if( !(waveFile = cre_open_wave(filename, NULL))) { - - printf("Error opening waveFile: %s\n",waveFile); - send_message("Error opening waveFile",vrpn_TEXT_ERROR,0); - return; - } - - g_Sound[id].m_pSound = new ASMSound(waveFile); - - // Load the sound id and name(path) into the sound map - g_soundMap[g_numSounds].m_iSoundNum = (int)id; - - char* nameptr = g_soundMap[g_numSounds].m_ASMSoundName; - strcpy(nameptr, filename); - int myid = g_soundMap[g_numSounds].m_iSoundNum; - - g_numSounds++; - - // Set up sound parameters - float loc[6]; - - loc[0] = (float)soundDef.pose.position[0]; - loc[1] = (float)soundDef.pose.position[1]; - loc[2] = (float)soundDef.pose.position[2]; - - // convert quat to euler - q_vec_type tempeuler; - q_type tempquat; - - tempquat[0] = soundDef.pose.orientation[0]; - tempquat[1] = soundDef.pose.orientation[1]; - tempquat[2] = soundDef.pose.orientation[2]; - tempquat[3] = soundDef.pose.orientation[3]; - - // 0: yaw - // 1: pitch - // 2: roll - q_to_euler(tempeuler, tempquat); - - loc[3] = -(float)tempeuler[0]; - loc[4] = -(float)tempeuler[1]; - loc[5] = -(float)tempeuler[2]; - - cre_locate_source( (int)id, loc ); - cre_update_audio(); - - sprintf(tempbuf,"Loading sound #%d: %s \n",id,filename); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - - GetSoundList(); - - return; - -} - - - -// not supported -void vrpn_Sound_Server_ASM::loadSoundRemote(char* filename, vrpn_SoundID id, vrpn_SoundDef soundDef) { - - send_message("loadSoundRemote not supported",vrpn_TEXT_WARNING,0); -} - - - - -void vrpn_Sound_Server_ASM::unloadSound(vrpn_SoundID id) { - - if(id<0 || id>g_numSounds){ - send_message("Error: unloadSound (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - char tempbuf[1024]; - int myid = g_soundMap[id].m_iSoundNum; - - if (myid==-1 || g_Sound[myid].m_pSound == NULL) { - sprintf(tempbuf,"Error: unloadSound(Invalid id) "); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - // move everything down by one - for(int i=myid; i<g_numSounds; i++){ - - if(g_Sound[i].m_pSound->IsSoundPlaying(i)){ - g_Sound[i].m_pSound->Stop(i); - } - char* tempptr1 = g_soundMap[i].m_ASMSoundName; - strcpy( tempptr1, &g_soundMap[i+1].m_ASMSoundName[0] ); - g_Sound[i].m_pSound = g_Sound[i+1].m_pSound; - g_Sound[i].repeat = g_Sound[i+1].repeat; - } - - g_numSounds--; - - sprintf(tempbuf,"Unloading sound: %d ",myid); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - - GetSoundList(); - - return; -} - - - -void vrpn_Sound_Server_ASM::setListenerPose(vrpn_PoseDef pose) { - - // Set up listener parameters - float loc[6]; - - loc[0] = (float)pose.position[0]; - loc[1] = (float)pose.position[1]; - loc[2] = (float)pose.position[2]; - - // convert quat to euler - q_vec_type tempeuler; - q_type tempquat; - - tempquat[0] = pose.orientation[0]; - tempquat[1] = pose.orientation[1]; - tempquat[2] = pose.orientation[2]; - tempquat[3] = pose.orientation[3]; - - // 0: yaw - // 1: pitch - // 2: roll - q_to_euler(tempeuler, tempquat); - - - loc[3] = -(float)tempeuler[0]; - loc[4] = -(float)tempeuler[1]; - loc[5] = -(float)tempeuler[2]; - - cre_locate_head( 0, loc ); - cre_update_audio(); - - return; -} - - - - -void vrpn_Sound_Server_ASM::setListenerVelocity(vrpn_float64 velocity[4]) { - - send_message("setListenerVelocity not supported",vrpn_TEXT_WARNING,0); - - return; -} - - - - -void vrpn_Sound_Server_ASM::changeSoundStatus(vrpn_SoundID id, vrpn_SoundDef soundDef) { - - if(id<0 || id>g_numSounds){ - send_message("Error: changeSoundStatus (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - vrpn_int32 myid = g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - - sprintf(tempbuf,"Error: changeSoundStatus(Invalid id) "); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - // Set sound parameters - float loc[6]; - - loc[0] = (float)soundDef.pose.position[0]; - loc[1] = (float)soundDef.pose.position[1]; - loc[2] = (float)soundDef.pose.position[2]; - - // convert quat to euler - q_vec_type tempeuler; - q_type tempquat; - - tempquat[0] = soundDef.pose.orientation[0]; - tempquat[1] = soundDef.pose.orientation[1]; - tempquat[2] = soundDef.pose.orientation[2]; - tempquat[3] = soundDef.pose.orientation[3]; - - // 0: yaw - // 1: pitch - // 2: roll - q_to_euler(tempeuler, tempquat); - - loc[3] = -(float)tempeuler[0]; - loc[4] = -(float)tempeuler[1]; - loc[5] = -(float)tempeuler[2]; - - cre_locate_source( (int)id, loc ); - cre_update_audio(); - - return; -} - - - - -void vrpn_Sound_Server_ASM::setSoundPose(vrpn_SoundID id, vrpn_PoseDef pose) { - - if(id<0 || id>g_numSounds){ - send_message("Error: setSoundPose (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - int myid = g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundPose(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - // Set sound parameters - float loc[6]; - - loc[0] = (float)pose.position[0]; - loc[1] = (float)pose.position[1]; - loc[2] = (float)pose.position[2]; - - // convert quat to euler - q_vec_type tempeuler; - q_type tempquat; - - tempquat[0] = pose.orientation[0]; - tempquat[1] = pose.orientation[1]; - tempquat[2] = pose.orientation[2]; - tempquat[3] = pose.orientation[3]; - - // 0: yaw - // 1: pitch - // 2: roll - q_to_euler(tempeuler, tempquat); - - loc[3] = -(float)tempeuler[0]; - loc[4] = -(float)tempeuler[1]; - loc[5] = -(float)tempeuler[2]; - - cre_locate_source( (int)id, loc ); - cre_update_audio(); - - return; -} - - - - -void vrpn_Sound_Server_ASM::setSoundVelocity(vrpn_SoundID id, vrpn_float64 *velocity) { - - send_message("setSoundVelocity not supported",vrpn_TEXT_WARNING,0); - - return; - -} - - - -// AuSIM only sets minimum distance... -void vrpn_Sound_Server_ASM::setSoundDistInfo(vrpn_SoundID id, vrpn_float64 *distinfo) { - - // distinfo[0] is rear min - // distinfo[1] is rear max - // distinfo[2] is front min (we use this) - // distinfo[3] is front max - - if(id<0 || id>g_numSounds){ - send_message("Error: setSoundDistInfo (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - if(distinfo[2]<0){ - send_message("Error: setSoundDistInfo (Invalid distinfo[2])",vrpn_TEXT_WARNING,0); - return; - } - - int myid = (int)g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundDistInfo(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - - void* pData = &distinfo[2]; - - cre_define_source(myid, AtrnGAINdist, 1, pData ); - - return; - -} - - -// This differs from a DirectX implementation... -// Instead of taking in 3 floats specifying an orientation vector(coneinfo[0...2]), -// we are taking in 3 floats representing euler angles in radians. -void vrpn_Sound_Server_ASM::setSoundConeInfo(vrpn_SoundID id, vrpn_float64 *coneinfo) { - - if(id<0 || id>g_numSounds){ - send_message("Error: setSoundConeInfo (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - int myid = (int)g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundConeInfo(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - float loc[6]; - - // Set up sound parameters - - // we just get old position from sound struct. - loc[0] = g_Sound[id].m_pSound->m_fPos[0]; - loc[1] = g_Sound[id].m_pSound->m_fPos[1]; - loc[2] = g_Sound[id].m_pSound->m_fPos[2]; - - // set the orientation of the sound cone (euler). - loc[3] = (float)coneinfo[0]; // yaw - loc[4] = (float)coneinfo[1]; // pitch - loc[5] = (float)coneinfo[2]; // roll - - // write pos and ori. - cre_locate_source(myid, loc); - - /* - AuSIM doc for AtrnRADfields, their sound cone implementation. - - AtrnRADfields: - Allows the user to control the directivity of the sound. - data[] will contain two parameters (both in radians) describing a - field of radiation and a field of intensity. These fields are cones - centered on the source’s boresight direction (principal direction of - aural emission) in which ~90% (for the field of radiation) or ~45% - (for the field of intensity) of the sound energy is dissipated. - */ - - // NOTE: notice that coneinfo[5] (the outside cone gain) is not used. - - float angles[2]; - - angles[0] = (float)coneinfo[3]; - angles[1] = (float)coneinfo[4]; - - cre_define_source(myid, AtrnRADfields, 2, angles); - - return; -} - - - -void vrpn_Sound_Server_ASM::setSoundDoplerFactor(vrpn_SoundID id, vrpn_float64 doplerfactor) { - - // Still check for sane user anyway. - if(id<0 || id>g_numSounds){ - send_message("Error: setSoundDoplerFactor (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - int myid = (int)g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundDoplerFactor(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - void* pData = &doplerfactor; - - cre_define_source(myid, AtrnDPLRfactor, 1, pData); - - return; -} - - - -void vrpn_Sound_Server_ASM::setSoundEqValue(vrpn_SoundID id, vrpn_float64 eqvalue) { - - send_message("setSoundEqValue not supported",vrpn_TEXT_WARNING,0); - - return; -} - - - - -void vrpn_Sound_Server_ASM::setSoundPitch(vrpn_SoundID id, vrpn_float64 pitch) { - - if(id<0 || id>g_numSounds){ - send_message("Error: setSoundConeInfo (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - if(pitch<0.5 || pitch>2.0){ - send_message("Error: setSoundConeInfo (Invalid pitch)",vrpn_TEXT_WARNING,0); - return; - } - - int myid = (int)g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundConeInfo(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - void* pData = &pitch; - - cre_ctrl_wave(myid, g_Sound[id].m_pSound->m_pWav, WaveCTRL_PTCH, pData); - - return; -} - - - - -void vrpn_Sound_Server_ASM::setSoundVolume(vrpn_SoundID id, vrpn_float64 volume) { - - if(id<0 || id>g_numSounds){ - send_message("Error: setSoundVolume (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - if(volume > 0){ - send_message("Error: setSoundVolume (Invalid volume)",vrpn_TEXT_WARNING,0); - return; - } - - int myid = g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundVolume(Invalid id)\n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - cre_amplfy_source(myid, (float)volume); - - return; -} - - - - -void vrpn_Sound_Server_ASM::loadModelLocal(const char * filename) { - - char tempbuf[1024]; - - sprintf(tempbuf,"loadModelLocal not implemented\n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - -} - - - - -void vrpn_Sound_Server_ASM::loadModelRemote(){ - - char tempbuf[1024]; - - sprintf(tempbuf,"loadModelRemote not implemented\n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; -} - - - - -void vrpn_Sound_Server_ASM::loadPolyQuad(vrpn_QuadDef * quad) { - - char tempbuf[1024]; - - sprintf(tempbuf,"loadPolyQuad not implemented\n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return;} - - - - -void vrpn_Sound_Server_ASM::loadPolyTri(vrpn_TriDef * tri) { - - char tempbuf[1024]; - - sprintf(tempbuf,"loadPolyTri not implemented\n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return;} - - - - -void vrpn_Sound_Server_ASM::loadMaterial(vrpn_MaterialDef * material, vrpn_int32 id) { - - char tempbuf[1024]; - - sprintf(tempbuf,"loadMaterial not implemented\n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return;} - - - - -void vrpn_Sound_Server_ASM::setPolyQuadVertices(vrpn_float64 vertices[4][3], const vrpn_int32 id) { - - char tempbuf[1024]; - - sprintf(tempbuf,"setPolyQuadVertices not implemented"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return;} - - - - -void vrpn_Sound_Server_ASM::setPolyTriVertices(vrpn_float64 vertices[3][3], const vrpn_int32 id) { - - char tempbuf[1024]; - - sprintf(tempbuf,"setPolyTriVertices not implemented"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return;} - - - - -void vrpn_Sound_Server_ASM::setPolyOF(vrpn_float64 OF, vrpn_int32 tag) { - - char tempbuf[1024]; - - sprintf(tempbuf,"setPolyOF not implemented"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; -} - - - - -void vrpn_Sound_Server_ASM::setPolyMaterial(const char * material, vrpn_int32 tag) { - - char tempbuf[1024]; - - sprintf(tempbuf,"setPolyMaterial not implemented"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return;} - - - - - - - -vrpn_float64 vrpn_Sound_Server_ASM::GetCurrentVolume(const vrpn_int32 id) { - - if(id<0 || id>g_numSounds){ - send_message("Error: GetCurrentVolume (Invalid id)",vrpn_TEXT_WARNING,0); - return -1.0f; - } - - char tempbuf[1024]; - - int myid = g_soundMap[id].m_iSoundNum; - - if (myid==-1) { - sprintf(tempbuf,"Error: GetCurrentVolume(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return -1.0f; - } - - vrpn_float64 val = g_Sound[id].m_pSound->m_fVolume; - - return val; -} - - -vrpn_int32 vrpn_Sound_Server_ASM::GetCurrentPlaybackRate(const vrpn_int32 CurrentSoundId) { - - char tempbuf[1024]; - - sprintf(tempbuf,"GetCurrentPlaybackRate not available."); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return -1; -} - - - -// This returns the position for a sound -void vrpn_Sound_Server_ASM::GetCurrentPosition(const vrpn_int32 id, float* X_val, float* Y_val, float* Z_val) { - - if(id<0 || id>g_numSounds){ - send_message("Error: GetCurrentPosition (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - char tempbuf[1024]; - int myid = g_soundMap[id].m_iSoundNum; - - if (myid==-1) { - sprintf(tempbuf,"Error: GetCurrentPosition(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return ; - } - - *X_val = g_Sound[id].m_pSound->m_fPos[0]; - *Y_val = g_Sound[id].m_pSound->m_fPos[1]; - *Z_val = g_Sound[id].m_pSound->m_fPos[2]; - - return; -} - - - - -void vrpn_Sound_Server_ASM::GetListenerPosition(float* X_val, float* Y_val, float* Z_val) { - - - char tempbuf[1024]; - - if(g_pListener == NULL){ - sprintf(tempbuf,"Error: GetListenerPosition(NULL Listener)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return ; - } - - *X_val = g_pListener->m_fPos[0]; - *Y_val = g_pListener->m_fPos[1]; - *Z_val = g_pListener->m_fPos[2]; - - return; -} - - - -void vrpn_Sound_Server_ASM::GetCurrentDistances(const vrpn_int32 id, float* FMin, float* FMax) { - - if(id<0 || id>g_numSounds){ - send_message("Error: GetCurrentDistances (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - char tempbuf[1024]; - int myid = g_soundMap[id].m_iSoundNum; - - if (myid==-1) { - - sprintf(tempbuf,"Error: GetCurrentDistances(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return ; - } - - *FMin = g_Sound[myid].m_pSound->m_fMinDist; - *FMax = 0; // not supported in AuSIM - - return; -} - - - - -void vrpn_Sound_Server_ASM::GetListenerOrientation(float* y_val, float *p_val, float *r_val) { - - char tempbuf[1024]; - - if(g_pListener == NULL){ - sprintf(tempbuf,"Error: GetListenerOrientation(NULL Listener)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return ; - } - - *y_val = g_pListener->m_fOri[0]; - *p_val = g_pListener->m_fOri[1]; - *r_val = g_pListener->m_fOri[2]; - - return; -} - - - - -void vrpn_Sound_Server_ASM::GetCurrentOrientation(const vrpn_int32 id,float *yaw, float *pitch, float *roll) { - - if(id<0 || id>g_numSounds){ - send_message("Error: GetCurrentOrientation (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - char tempbuf[1024]; - int myid = g_soundMap[id].m_iSoundNum; - - if (myid==-1) { - sprintf(tempbuf,"Error: GetCurrentOrientation(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return ; - } - - *yaw = g_Sound[myid].m_pSound->m_fOri[0]; - *pitch = g_Sound[myid].m_pSound->m_fOri[1]; - *roll = g_Sound[myid].m_pSound->m_fOri[2]; - - return; -} - - - -void vrpn_Sound_Server_ASM::mainloop() { - - vrpn_Text_Sender::mainloop(); - vrpn_Sound::d_connection->mainloop(); - - vrpn_SoundDef temp; - temp.volume = 0.0f; // suppress VC6 initialization warning with this - // check if we need to repeat any sounds - for(int i=0; i<g_numSounds; i++){ - if(g_Sound[i].repeat != 0) { - if(!g_Sound[i].m_pSound->IsSoundPlaying(i)){ - playSound(g_soundMap[i].m_iSoundNum, g_Sound[i].repeat, temp); - } - } - } -} - - - -bool vrpn_Sound_Server_ASM::noSounds(void) {return 0;} - - - -void vrpn_Sound_Server_ASM::stopAllSounds() { - - for (int i(0); i<g_numSounds;i++) - g_Sound[i].m_pSound->Stop(i); - - return; -} - - - - -// re-initialize all sounds and materials etc -void vrpn_Sound_Server_ASM::shutDown() { - - // reinitialize playlist - for (int i=0; i<MAX_NUM_SOUNDS; i++) { - - // Stop all playing sounds - if(g_Sound[i].m_pSound != NULL){ - if(g_Sound[i].m_pSound->IsSoundPlaying(i)) - g_Sound[i].m_pSound->Stop(i); - } - - g_Sound[i].m_pSound = NULL; - g_soundMap[i].m_iSoundNum=-1; - } - - g_numSounds = 0; -} - - - -void vrpn_Sound_Server_ASM::GetSoundList() { - - char tempbuf[1024]; - - printf("\nCurrent sounds loaded***********\n"); - - for(int i=0; i<g_numSounds; i++){ - - sprintf(tempbuf,"Sound# %d: %s",i,g_soundMap[i].m_ASMSoundName); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - } - - printf("********************************\n"); - - return; -} - - - -//******************************************************** -// -// ASM Sound Class -// -//******************************************************** -ASMSound::ASMSound( wavFt* pWave ) -{ - m_fVolume = 0; - m_pWav = pWave; - -} - - - -ASMSound::~ASMSound() -{ - SAFE_DELETE( m_pWav ); -} - - - -void ASMSound::Play(int id, int repeat, float volume ) -{ - if(repeat == 0) - cre_ctrl_wave(id, m_pWav, WaveCTRL_LOOP, NULL); - else - cre_ctrl_wave(id, m_pWav, WaveCTRL_PLAY, NULL); - - return; -} - - - - -void ASMSound::Stop(int id) -{ - cre_ctrl_wave(id, m_pWav, WaveCTRL_STOP, NULL); - - return; -} - - - - -void ASMSound::Reset(int id) -{ - cre_ctrl_wave(id, m_pWav, WaveCTRL_RWND, NULL); - - return; -} - - - - -BOOL ASMSound::IsSoundPlaying(int id) -{ - BOOL bIsPlaying = false; - - int val = cre_ctrl_wave(id, m_pWav, WaveCTRL_STAT, NULL); - - if(val != 0) - bIsPlaying = true; - - return bIsPlaying; -} - - - - -HWND GetConsoleHwnd(void) { - - // Get the current window title. - char pszOldWindowTitle[CHAR_BUF_SIZE]; - GetConsoleTitle(pszOldWindowTitle, CHAR_BUF_SIZE); - - // Format a unique New Window Title. - char pszNewWindowTitle[CHAR_BUF_SIZE]; - wsprintf(pszNewWindowTitle, "%d/%d", GetTickCount(), GetCurrentProcessId()); - - // Change the current window title. - SetConsoleTitle(pszNewWindowTitle); - - // Ensure window title has changed. - Sleep(40); - - // Look for the new window. - HWND hWnd = FindWindow(NULL, pszNewWindowTitle); - - // Restore orignal name - SetConsoleTitle(pszOldWindowTitle); - - return hWnd; -} - - - -void main(int argc, char **argv) { - - HWND hWin; - vrpn_Sound_Server_ASM* soundServer = NULL; -// vrpn_Tracker_Remote* tracker_connection; - char tracker_device[512]; - char tracker_name[512]; - vrpn_Connection* connection; -// vrpn_Connection* trackerCon; -// int got_report; - - char* config_file_name = "vrpn.cfg"; - FILE* config_file; - char* client_name = NULL; - int client_port = 4502; - int bail_on_error = 1; - int verbose = 0; - int auto_quit = 0; - int realparams = 0; - int loop = 0; - int port = vrpn_DEFAULT_LISTEN_PORT_NO; - -//#define USING_TRACKER - int USE_TRACKER = 0; - - connection = new vrpn_Synchronized_Connection (port); - - // Open the configuration file - if (verbose) printf("Reading from config file %s\n", config_file_name); - - if ( (config_file = fopen(config_file_name, "r")) == NULL) - { - perror("Cannot open config file"); - printf(" (filename %s)\n", config_file_name); - return; - } - - // Read the configuration file, creating a device for each entry. - // Each entry is on one line, which starts with the name of the - // class of the object that is to be created. - // If we fail to open a certain device, print a message and decide - // whether we should bail. - { - char line[512]; // Line read from the input file - char* pch; - char scrap[512], s2[512]; - - // Read lines from the file until we run out - while ( fgets(line, sizeof(line), config_file) != NULL ) - { - - // Make sure the line wasn't too long - if (strlen(line) >= sizeof(line)-1) - { - printf("Line too long in config file: %s\n",line); - if (bail_on_error) { return; } - else { continue; } // Skip this line - } - - if ((strlen(line)<3)||(line[0]=='#')) - { - // comment or empty line -- ignore - continue; - } - - // copy for strtok work - strncpy(scrap, line, sizeof(line) - 1); - // Figure out the device from the name and handle appropriately - - // WARNING: SUBSTRINGS WILL MATCH THE EARLIER STRING, SO - // ADD AN EMPTY SPACE TO THE END OF STATIC STRINGS!!!! - - // #define isit(s) !strncmp(line,s,strlen(s)) - -#define isit(s) !strcmp(pch=strtok(scrap," \t"),s) -#define next() pch += strlen(pch) + 1 - -#ifdef _WIN32 - - if(isit("vrpn_Sound_Server")) - { - next(); - - if (sscanf(pch,"%511s\t%d\t%511s\t%511s",s2,&USE_TRACKER,tracker_name, tracker_device) != 4) - { - printf("Bad vrpn_Server_Sound line: %s\n",line); - if (bail_on_error) - { - return; - } - else - { - continue; - } // Skip this line - } - - hWin = GetConsoleHwnd(); - - printf("\nBegin initializing ASM Sound Server...\n"); - - - soundServer = NULL; - soundServer = new vrpn_Sound_Server_ASM(s2, connection); - - if (soundServer == NULL) - printf("Can't create sound server\n"); - - printf("ASM Sound Server successfully initialized.\n\n"); - - } -#endif - } - } - - fclose(config_file); - - // Open remote tracker if we are to use one - -#ifdef USING_TRACKER - - char newname[1024]; - sprintf(newname,"%s@%s",(const char*)tracker_device, (const char*)tracker_name); - printf("Using tracker: %s\n",newname); - trackerCon = vrpn_get_connection_by_name(tracker_name); - tracker_connection = new vrpn_Tracker_Remote((const char *) newname); - // SET UP TRACKER HANDLER - if (trackerCon->doing_okay()) { - printf( "TC OK.\n"); - } else { - printf( "TC Not OK.\n"); - } - } -#else - if(verbose) printf("Not using tracker\n"); -#endif - - loop = 0; - - if (client_name) - { - printf( "vrpn_serv: connecting to client: %s:%d\n", - client_name, client_port); - if (connection->connect_to_client(client_name, client_port)) - { - printf( "server: could not connect to client %s:%d\n", client_name, client_port); - } - } - - - // ******************************************************************** - // ** * * * * * * ** - // ** * MAIN LOOP * * ** - // ** * * * * * ** - // ******************************************************************** - float fPrevTime = 0.0f; - float fFrameTime; - float fTime; - int counter = 0; - int stopNow = 0; - int numconnections = 0; - - printf("Entering main loop\n\n"); - - while (!(_kbhit() && ((_getch()=='q') || (_getch()=='Q')))) { - - //soundServer->GetLastError(buf); - soundServer->mainloop(); - connection->mainloop(); - - if(counter % 100 == 0) - vrpn_SleepMsecs(1); - - counter++; - - // record time since last frame - if (counter==NUM_SPIN) { - - counter = 0; - fTime = (float)timeGetTime(); - - fFrameTime = (fTime - fPrevTime) * 0.001f; - //printf("Running at %4.2f Hz\r", (float) NUM_SPIN/fFrameTime); - fPrevTime = fTime; - } - - soundServer->mainloop(); - - // ensure we get a new report! -#ifdef USING_TRACKER - if (USE_TRACKER) { - tracker_connection->mainloop(); - got_report = 0; - if (trackerCon->doing_okay()) - while (!got_report) - tracker_connection->mainloop(); - } -#endif - - // Send and receive all messages - connection->mainloop(); - - if (numconnections==0 && connection->connected()) - numconnections++; - - if (((numconnections!=0) && (!connection->connected())) || !connection->doing_okay()) { - soundServer->shutDown(); - numconnections=0; - break; - } - - } - - printf("Sound Server shutting down.\n"); -} - diff --git a/src/vrpn/server_src/ausim_sound_server/vrpn_Sound_ASM.h b/src/vrpn/server_src/ausim_sound_server/vrpn_Sound_ASM.h deleted file mode 100644 index 9a5f02b4fa7ec65c9b9359c235ffabe78b5af37c..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/ausim_sound_server/vrpn_Sound_ASM.h +++ /dev/null @@ -1,146 +0,0 @@ -#ifndef VRPN_SOUND_ASM_H -#define VRPN_SOUND_ASM_H - -#ifdef _WIN32 -#include "vrpn_Shared.h" - -// Define PI if not already defined -#ifndef PI -#define PI 3.1415926535897932384626433832795f -#endif - -#include <objbase.h> -#include <stdlib.h> -#include <cguid.h> -#include "vrpn_Sound.h" -#include "quat.h" -#include "string.h" -#include <conio.h> -#include <mmsystem.h> -#include <mmreg.h> -#include "cre_tron.h" -#include "cre_wave.h" -#include <stdio.h> - -class vrpn_Sound_Server_ASM; -class ASMSound; - -typedef struct{ - char m_ASMSoundName[80]; - int m_iSoundNum; -} SoundMap; - -typedef struct{ - ASMSound* m_pSound; - int repeat; - float m_fPos[3]; - float m_fOri[3]; - wavFt* wavefile; - float m_fMinDist; -} Sound; - -typedef struct{ - float m_fPos[3]; - float m_fOri[3]; -} Listener; - - -// Macros -#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } } -#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } } -#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } } -#define DEG2RAD(x) (x * (PI / 180.0f)) // Converts degrees to radians -#define RAD2DEG(x) (x * (180.0f / PI)) // Converts radians to degrees - -class vrpn_Sound_Server_ASM : public vrpn_Sound_Server { - -public: - vrpn_Sound_Server_ASM(const char * name, vrpn_Connection * c ); - - ~vrpn_Sound_Server_ASM(); - - void playSound(vrpn_SoundID id, vrpn_int32 repeat, vrpn_SoundDef soundDef); - void stopSound(vrpn_SoundID id); - - void loadSoundLocal(char* filename, vrpn_SoundID id, vrpn_SoundDef soundDef); - void loadSoundRemote(char* file, vrpn_SoundID id, vrpn_SoundDef soundDef); // not supported - void unloadSound(vrpn_SoundID id); - void changeSoundStatus(vrpn_SoundID id, vrpn_SoundDef soundDef); - - void setListenerPose(vrpn_PoseDef pose); - void setListenerVelocity(vrpn_float64 *velocity); - - void setSoundPose(vrpn_SoundID id, vrpn_PoseDef pose); - void setSoundVelocity(vrpn_SoundID id, vrpn_float64 *velocity); - void setSoundDistInfo(vrpn_SoundID id, vrpn_float64 *distinfo); - void setSoundConeInfo(vrpn_SoundID id, vrpn_float64 *coneinfo); - - void setSoundDoplerFactor(vrpn_SoundID id, vrpn_float64 doplerfactor); - void setSoundEqValue(vrpn_SoundID id, vrpn_float64 eqvalue); // not supported - void setSoundPitch(vrpn_SoundID id, vrpn_float64 pitch); - void setSoundVolume(vrpn_SoundID id, vrpn_float64 volume); - - void GetSoundList(void); - - - // These are not supported - void loadModelLocal(const char * filename); - void loadModelRemote(); // not supported - void loadPolyQuad(vrpn_QuadDef * quad); - void loadPolyTri(vrpn_TriDef * tri); - void loadMaterial(vrpn_MaterialDef * material, vrpn_int32 id); - void setPolyQuadVertices(vrpn_float64 vertices[4][3], const vrpn_int32 id); - void setPolyTriVertices(vrpn_float64 vertices[3][3], const vrpn_int32 id); - void setPolyOF(vrpn_float64 OF, vrpn_int32 tag); - void setPolyMaterial(const char * material, vrpn_int32 tag); - // end of unsupported functions - - - void mainloop(); - bool noSounds(void); - void stopAllSounds(); - void shutDown(); - - vrpn_float64 GetCurrentVolume(const vrpn_int32 CurrentSoundId); - vrpn_int32 GetCurrentPlaybackRate(const vrpn_int32 CurrentSoundId); - void GetCurrentPosition(const vrpn_int32 CurrentSoundId, float* X_val, float* Y_val, float* Z_val); - void GetListenerPosition(float* X_val, float* Y_val, float* Z_val); - void GetCurrentDistances(const vrpn_int32 CurrentSoundId, float* FMin, float* FMax); - void GetListenerOrientation(float* yaw, float *pitch, float *roll); - void GetCurrentOrientation(const vrpn_int32 CurrentSoundId,float *yaw, float *pitch, float *roll); - - vrpn_int32 LastSoundId; //ID of last played sound - -private: - - // the idea of a map is to have a way to go from the unique id being passed in - // by the user to an internal identifier... - - HRESULT lasterror; - vrpn_int32 maxSounds; - vrpn_int32 numSounds; - SoundMap g_soundMap[MAX_NUMBER_SOUNDS]; - vrpn_int32 numconnections; // number of times server has been connected to.. -}; - - -class ASMSound -{ - -public: - wavFt* m_pWav; - float m_fVolume; - float m_fPos[3]; - float m_fOri[3]; - float m_fMinDist; - - ASMSound( wavFt* pWav ); - virtual ~ASMSound(); - void Play(int id, int repeat, float fVolume = 0); - void Stop(int id); - void Reset(int id); - BOOL IsSoundPlaying(int id); -}; - -#endif //_WIN32 -#endif \ No newline at end of file diff --git a/src/vrpn/server_src/buzzForceField.C b/src/vrpn/server_src/buzzForceField.C deleted file mode 100644 index a70fcba44e8653127436824079c7f43a2bd58474..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/buzzForceField.C +++ /dev/null @@ -1,149 +0,0 @@ -#include "vrpn_Configure.h" -#ifdef VRPN_USE_PHANTOM_SERVER -#include "buzzForceField.h" -#include "texture_plane.h" - -// So we don't have #defines throughout the code that we forget to fix. -#if defined(sgi) || defined (__CYGWIN__) || defined(linux) -#define init_mutex(x) pthread_mutex_init(x,NULL); -#define get_mutex(x) pthread_mutex_lock(x) -#define release_mutex(x) pthread_mutex_unlock(x); -#else -#define init_mutex(x) InitializeCriticalSection(x); -#define get_mutex(x) EnterCriticalSection(x); -#define release_mutex(x) LeaveCriticalSection(x); -#endif - -// macros for printing something out x times out of a thousand (i.e. x times per second) -#define DEBUG_BEGIN(x) {static int pcnt = 0; if ((pcnt % 1000 >= 0)&&(pcnt%1000 < x)){ -#define DEBUG_END }pcnt++;} - -// APPLICATION: -#ifdef VRPN_USE_HDAPI -BuzzForceField::BuzzForceField() : -#else -BuzzForceField::BuzzForceField() : gstForceField(), -#endif - _t_buzz(0.0), - _active(0), - _surface_only(0), - _plane(vrpn_HapticPlane(0.0, 1.0, 0.0, 0.0)), - _spring(0.5), - _amplitude(0.5), - _frequency(60.0), - _amp_needs_update(0), - _freq_needs_update(0) -{ -#ifndef VRPN_USE_HDAPI - boundBySphere(vrpn_HapticPosition(0,0,0), 1000); -#endif - _tex_plane = NULL; -// MB: for SGI compilation with pthreads - init_mutex(&_amp_freq_mutex); -} - -void BuzzForceField::setAmplitude(double amp) { - if (!_active){ - _amplitude = amp; - return; - } - _new_amplitude = amp; -// get_mutex(&_amp_freq_mutex); - _amp_needs_update = true; -// release_mutex(&_amp_freq_mutex); -} - -void BuzzForceField::setFrequency(double freq) { - if (!_active){ - _frequency = freq; - return; - } - _new_frequency = freq; -// get_mutex(&_amp_freq_mutex); - _freq_needs_update = true; -// release_mutex(&_amp_freq_mutex); -} - -// SERVOLOOP: -#ifdef VRPN_USE_HDAPI -vrpn_HapticVector BuzzForceField::calculateForceFieldForce(HDAPI_state *state) -#else -vrpn_HapticVector BuzzForceField::calculateForceFieldForce(gstPHANToM *phantom) -#endif -{ - vrpn_HapticPosition phanPos; - double force_mag; - vrpn_HapticVector force_vec; - double height_mod = 0; - double phase; - - if (_active){ -#ifdef VRPN_USE_HDAPI - int rate = state->instant_rate; - double deltaT = 1.0 / rate; - double vec[3]; - vec[0] = state->pose[3][0]; vec[1] = state->pose[3][1]; vec[2] = state->pose[3][2]; - //XXX We're not dealing with transforms here... make sure VRPN doesn't set them, or else deal with them! - phanPos = vrpn_HapticPosition(vec); -#else - double deltaT = phantom->getDeltaT(); - phantom->getPosition_WC(phanPos); - phanPos = fromWorld(phanPos); -#endif - _t_buzz += deltaT; - phase = 2.0*_t_buzz*_frequency; - if ( (phase - floor(phase)) < ((deltaT)*2.0*_frequency) ){ - // its okay to update freq, amp now -// get_mutex(&_amp_freq_mutex); - if (_amp_needs_update){ - _amp_needs_update = false; - _amplitude = _new_amplitude; - } - if (_freq_needs_update){ - _freq_needs_update = false; - if (_new_frequency != 0) - _t_buzz *= _frequency/_new_frequency; // for continuity - _frequency = _new_frequency; - } -// release_mutex(&_amp_freq_mutex); - } - // compute height above plane - if (_tex_plane) { - height_mod = _tex_plane->getTextureHeight(phanPos); - } -#ifdef VRPN_USE_HDAPI - double ph_height = _plane.perpDistance(phanPos)-height_mod; -#else - double ph_height = _plane.error(phanPos)-height_mod; -#endif - if (ph_height > _amplitude) { - return vrpn_HapticVector(0,0,0); - } - // force may be nonzero so compute height of vibrating plane to see - double buzzplane_height = _amplitude*(sin(2.0*M_PI*_frequency*_t_buzz)); - - if (ph_height > 0) { // above static plane but not necess. above vibrating plane - if (ph_height > buzzplane_height) // so force will be in +normal direction - force_mag = 0; - else - force_mag = (buzzplane_height-ph_height)*_spring; - } - else if (ph_height > buzzplane_height){ - force_mag = (ph_height)*_spring; // we need to cancel force of static plane so we - // produce the opposite of the collision force here - } - else { - force_mag = buzzplane_height*_spring; - } - - force_vec = _plane.normal(); - force_vec.normalize(); - force_vec *= force_mag; - - return force_vec; - } else { - return vrpn_HapticVector(0,0,0); - } -} - -#endif diff --git a/src/vrpn/server_src/buzzForceField.h b/src/vrpn/server_src/buzzForceField.h deleted file mode 100644 index 2ad1f83e8534b73f93b386730de91155cf266c6b..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/buzzForceField.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef BUZZFORCEFIELD_H -#define BUZZFORCEFIELD_H - -#include "vrpn_Configure.h" -#include "vrpn_ForceDevice.h" -#ifdef VRPN_USE_PHANTOM_SERVER - -/* - BuzzForceField : - This is a buzzing effect that may be tied to a particular surface to make - the surface feel like it is vibrating (buzzing is in direction of - surface normal and amplitude gets clipped down to zero as you - come off the surface. For accurate simulation of a buzzing surface, the - plane should be set to the plane approximation for the surface and the - spring constant should match that of the surface if the amplitude is to - represent the simulated buzzing amplitude. - Strictly speaking, the simulated vibrating plane is shifted by amplitude - outwards along normal so force is clipped in the thin layer above - the surface at heights between 0 and 2*amplitude. (amplitude is typically - on the order of a millimeter) - */ - -#include "ghost.h" - -// MB: for compilation with pthreads -#if defined(sgi) || defined (__CYGWIN__) || defined(linux) -#include "pthread.h" -#endif - -//#include <gstForceField.h> -//#include <gstPlane.h> - -class TexturePlane; - -#ifdef VRPN_USE_HDAPI -class BuzzForceField { - // gstForceField override: - vrpn_HapticVector calculateForceFieldForce(HDAPI_state *state); -#else -class BuzzForceField : public gstForceField { - // gstForceField override: - vrpn_HapticVector calculateForceFieldForce(gstPHANToM *phantom); -#endif -public: - BuzzForceField(); - void activate() {_active = true;}; - void deactivate() {_active = false;}; - void restrictToSurface(vrpn_HapticBoolean r) {_surface_only = r;}; - void setSurface(vrpn_HapticPlane &p, double spr) {_plane = p; _spring = spr;}; - void setPlane(const vrpn_HapticPlane &p) {_plane = p;}; - void adjustToTexturePlane(TexturePlane *p) { - _tex_plane = p; - } - void setParameters(double buzzamp, double buzzfreq, double kspr){ - setAmplitude(buzzamp); setFrequency(buzzfreq); setSpring(kspr); - } - void setSpring(double spr) {_spring = spr;}; - - // changes in amplitude or frequency are only done at zero-crossings - // to avoid 0th-order discontinuity - not done for spring because - // discontinuity is unavoidable if surface stiffness changes - might - // want a recovery time though - void setAmplitude(double amp); - void setFrequency(double freq); - - int active() {return _active;}; - int restrictedToSurface() {return _surface_only;}; - vrpn_HapticPlane &getPlane() {return _plane;}; - double getSpring() {return _spring;}; - double getAmplitude() {return _amplitude;}; - double getFrequency() {return _frequency;}; - -private: - double _t_buzz; // time used in force calculation - bool _active; // is force active - int _surface_only; // is buzzing limited to the surface of a plane - vrpn_HapticPlane _plane; // what surface is buzzing - double _spring; // force/mm - - double _amplitude; // mm - double _new_amplitude; - bool _amp_needs_update; - - double _frequency; // Hz - double _new_frequency; - bool _freq_needs_update; - -// MB: for compilation with pthreads -#if defined(sgi) || defined (__CYGWIN__) || defined(linux) - pthread_mutex_t _amp_freq_mutex;// mutex for accessing -#else - CRITICAL_SECTION _amp_freq_mutex;// mutex for accessing -#endif - // _amp_needs_update or _freq_needs_update - - TexturePlane *_tex_plane; // we use this to modulate height of _plane by - // the height of the texture -}; - -#endif - -#endif - diff --git a/src/vrpn/server_src/client_and_server.C b/src/vrpn/server_src/client_and_server.C deleted file mode 100644 index b9894d3c870c625ba6bd3ac37ff28070808f7e6d..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/client_and_server.C +++ /dev/null @@ -1,99 +0,0 @@ -// client_and_server.C -// This is a VRPN example program that has a client and server for a -// tracker both within the same thread. -// The basic idea is to instantiate both a vrpn_Tracker_NULL and -// a vrpn_Tracker_Remote using the same connection for each. Then, the -// local call handlers on the connection will send the information from -// the server to the client callbacks. - -#include <stdio.h> // for fprintf, stderr, printf, etc - -#include "vrpn_Configure.h" // for VRPN_CALLBACK, etc -#include "vrpn_Connection.h" -#include "vrpn_Shared.h" // for vrpn_SleepMsecs -#include "vrpn_Tracker.h" // for vrpn_TRACKERCB, etc -#include "vrpn_Types.h" // for vrpn_float64 - -const char *TRACKER_NAME = "Tracker0"; -int CONNECTION_PORT = vrpn_DEFAULT_LISTEN_PORT_NO; // Port for connection to listen on - -vrpn_Tracker_NULL *ntkr; -vrpn_Tracker_Remote *tkr; -vrpn_Connection *connection; - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_pos (void *, const vrpn_TRACKERCB t) -{ - static int count = 0; - - fprintf(stderr, "%d.", t.sensor); - if ((++count % 20) == 0) { - fprintf(stderr, "\n"); - if (count > 300) { - printf("Pos, sensor %d = %f, %f, %f\n", t.sensor, - t.pos[0], t.pos[1], t.pos[2]); - count = 0; - } - } -} - -void VRPN_CALLBACK handle_vel (void *, const vrpn_TRACKERVELCB t) -{ - //static int count = 0; - - fprintf(stderr, "%d/", t.sensor); -} - -void VRPN_CALLBACK handle_acc (void *, const vrpn_TRACKERACCCB t) -{ - //static int count = 0; - - fprintf(stderr, "%d~", t.sensor); -} - -int main (int argc, char * argv []) -{ - if (argc != 1) { - fprintf(stderr, "Usage: %s\n", argv[0]); - return -1; - } - - // explicitly open the connection - connection = vrpn_create_server_connection(CONNECTION_PORT); - - // Open the tracker server, using this connection, 2 sensors, update 60 times/sec - ntkr = new vrpn_Tracker_NULL(TRACKER_NAME, connection, 2, 60.0); - - // Open the tracker remote using this connection - fprintf(stderr, "Tracker's name is %s.\n", TRACKER_NAME); - tkr = new vrpn_Tracker_Remote (TRACKER_NAME, connection); - - // Set up the tracker callback handlers - printf("Tracker update: '.' = pos, '/' = vel, '~' = acc\n"); - tkr->register_change_handler(NULL, handle_pos); - tkr->register_change_handler(NULL, handle_vel); - tkr->register_change_handler(NULL, handle_acc); - - /* - * main interactive loop - */ - while ( 1 ) { - // Let the tracker server, client and connection do their things - ntkr->mainloop(); - tkr->mainloop(); - connection->mainloop(); - - // Sleep for 1ms so we don't eat the CPU - vrpn_SleepMsecs(1); - } - - return 0; - -} /* main */ - - diff --git a/src/vrpn/server_src/client_and_server.dsp b/src/vrpn/server_src/client_and_server.dsp deleted file mode 100644 index c003d81adedccdce70340c2a26d311ae64000f38..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/client_and_server.dsp +++ /dev/null @@ -1,90 +0,0 @@ -# Microsoft Developer Studio Project File - Name="client_and_server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=client_and_server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "client_and_server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "client_and_server.mak" CFG="client_and_server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "client_and_server - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "client_and_server - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "client_and_server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/client_and_server/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/client_and_server/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\..\quat" /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "client_and_server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "client_a" -# PROP BASE Intermediate_Dir "client_a" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/client_and_server/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/client_and_server/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /I "..\..\quat" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "client_and_server - Win32 Release" -# Name "client_and_server - Win32 Debug" -# Begin Source File - -SOURCE=client_and_server.C -# End Source File -# End Target -# End Project diff --git a/src/vrpn/server_src/client_and_server.vcproj b/src/vrpn/server_src/client_and_server.vcproj deleted file mode 100644 index 27310db166a58c7408bd4d48c99c97ec034d0ff8..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/client_and_server.vcproj +++ /dev/null @@ -1,229 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="client_and_server" - ProjectGUID="{E99FB2FA-3281-4DBE-905E-F4C7F4183F09}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/client_and_server/Release" - IntermediateDirectory=".\../pc_win32/server_src/client_and_server/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/client_and_server/Release/client_and_server.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include";..;..\..\quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/server_src/client_and_server/Release/client_and_server.pch" - AssemblerListingLocation=".\../pc_win32/server_src/client_and_server/Release/" - ObjectFile=".\../pc_win32/server_src/client_and_server/Release/" - ProgramDataBaseFileName=".\../pc_win32/server_src/client_and_server/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/client_and_server/Release/client_and_server.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/server_src/client_and_server/Release/client_and_server.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/client_and_server/Release/client_and_server.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/client_and_server/Debug" - IntermediateDirectory=".\../pc_win32/server_src/client_and_server/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/client_and_server/Debug/client_and_server.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include";..;..\..\quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/client_and_server/Debug/client_and_server.pch" - AssemblerListingLocation=".\../pc_win32/server_src/client_and_server/Debug/" - ObjectFile=".\../pc_win32/server_src/client_and_server/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/client_and_server/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/client_and_server/Debug/client_and_server.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/server_src/client_and_server/Debug/client_and_server.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/client_and_server/Debug/client_and_server.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <File - RelativePath="client_and_server.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/constraint.C b/src/vrpn/server_src/constraint.C deleted file mode 100644 index 763305a28e698f55c383eb66792b553ea9f941e8..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/constraint.C +++ /dev/null @@ -1,81 +0,0 @@ -#include "vrpn_Configure.h" -#ifdef VRPN_USE_PHANTOM_SERVER - -#ifndef VRPN_USE_HDAPI -#include <gstPHANToM.h> -#endif -#include "constraint.h" - - -#define MAX_FORCE 10.0 // we try not to exceed this - // force [dyne], this gets pretty close - // to the maximum PHANToM force -#define MAX_DIST 50.0 // maximum distance at which effect - // force can be felt [mm] - -vrpn_HapticVector ConstraintEffect::calcEffectForce(void *phantom_info) { - - vrpn_HapticPosition phantomPos; - vrpn_HapticPosition lastPhantomPos; - vrpn_HapticVector phantomVel; - vrpn_HapticVector effectForce; - double dt; - int i; -#ifdef VRPN_USE_HDAPI - HDAPI_state *state = (HDAPI_state *)phantom_info; - int rate = state->instant_rate; - dt = 1.0 / rate; - double vec[3]; - vec[0] = state->pose[3][0]; vec[1] = state->pose[3][1]; vec[2] = state->pose[3][2]; - phantomPos = vrpn_HapticPosition(vec); - double lastvec[3]; - lastvec[0] = state->last_pose[3][0]; lastvec[1] = state->last_pose[3][1]; lastvec[2] = state->last_pose[3][2]; - lastPhantomPos = vrpn_HapticPosition(lastvec); - double velvec[3]; - velvec[0] = (vec[0] - lastvec[0]) / dt; - velvec[1] = (vec[1] - lastvec[1]) / dt; - velvec[2] = (vec[2] - lastvec[2]) / dt; - phantomVel = vrpn_HapticVector(velvec); -#else - gstPHANToM *phantom = (gstPHANToM *)phantom_info; - phantom->getPosition_WC(phantomPos); - phantom->getLastPosition_WC(lastPhantomPos); - phantomVel = phantom->getVelocity(); - dt = phantom->getDeltaT(); -#endif - - time += dt; - - if (active) { - vrpn_HapticPosition forceVec = (fixedEnd - phantomPos); -#ifdef VRPN_USE_HDAPI - double dist = forceVec.magnitude(); -#else - double dist = forceVec.distToOrigin(); -#endif - effectForce = forceVec; - for (i = 0; i < 3; i++) { - effectForce[i] *= kSpring; - } - // set effectForce to (0,0,0) if given our velocity - // we may have already reached the fixedEnd -#ifdef VRPN_USE_HDAPI - if ((dist < phantomVel.magnitude()*dt) || (dist > MAX_DIST)) { -#else - if ((dist < phantomVel.distToOrigin()*dt) || (dist > MAX_DIST)) { -#endif - return vrpn_HapticVector(0,0,0); - } else if (dist*kSpring > MAX_FORCE){ - for (i = 0; i < 3; i++) { - effectForce[i] *= MAX_FORCE/(dist*kSpring); - } - return effectForce; - } else { - return effectForce; - } - } else { - return vrpn_HapticVector(0,0,0); - } -} - -#endif diff --git a/src/vrpn/server_src/constraint.h b/src/vrpn/server_src/constraint.h deleted file mode 100644 index 973aa44ff3a544cc5b8f043931cea7d64105f1b7..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/constraint.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef CONSTRAINT_H -#define CONSTRAINT_H - -#include "vrpn_Configure.h" -#ifdef VRPN_USE_PHANTOM_SERVER - -#include "ghost.h" -#include <math.h> - -/// Constraint effect for PHANToM (superceded by ForceField) - -#ifdef VRPN_USE_HDAPI -class ConstraintEffect -#else -class ConstraintEffect:public gstEffect -#endif - -{ - public: - - // Constructor. -#ifdef VRPN_USE_HDAPI - ConstraintEffect(): active(false), time(0) { } -#else - ConstraintEffect(): gstEffect() {} -#endif - - // Destructor. - ~ConstraintEffect() {} - - // set the point to which this effect is attached - // units are mm and Newtons/mm - void setPoint(double *pnt, double kSpr) { - fixedEnd = vrpn_HapticPosition(pnt[0],pnt[1],pnt[2]); - kSpring = kSpr; - } - - // FOR_GHOST_EXTENSION: - // Start the effect. WARNING: When re-starting an effect, - // make sure to reset any state, such as past PHANToM position. - // Otherwise, the next call to calcEffectForce could - // generate unexpectedly large forces. - virtual vrpn_HapticBoolean start() { -// if (!active) printf("starting force\n"); - active = true; time = 0.0; return true;} - - // FOR_GHOST_EXTENSION: - // Stop the effect. - virtual void stop() { -// if (active) printf("stopping force\n"); - active = false;} - - // FOR_GHOST_EXTENSION: - // Calculate the force. Force is returned in parent - // reference frame of phantom. When subclassing, the first - // parameter should be cast to gstPHANToM to retrieve - // any information about the state of the PHANToM that - // is needed to calculate the forces. deltaT should - // be used to update the time. Also, if the effect is - // not active, the zero vector should be returned. - // ACHTUNG! - // WARNING!: Never call PHANToM->setForce or - // PHANToM->setForce_WC from this function. - // It will cause an infinite recursion. - virtual vrpn_HapticVector calcEffectForce(void *phantom_info); - - protected: -#ifdef VRPN_USE_HDAPI - vrpn_HapticBoolean active; - double time; -#endif - vrpn_HapticPosition fixedEnd; - double kSpring; -}; - -#endif -#endif diff --git a/src/vrpn/server_src/daq_server.C b/src/vrpn/server_src/daq_server.C deleted file mode 100644 index 3ca6781e3d6142bcfa2a30614dd16c15661ae862..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/daq_server.C +++ /dev/null @@ -1,236 +0,0 @@ -/** daq_server.C - - This program is a bit backwards from most VRPN progams, in that it -is a "server" but it uses a client connection to do its thing. Its -purpose is to drive the voltages on a National Instruments' DAQ board -based on the values placed in a vrpn_Analog_Server. - This program creates a client connection and then connects a -vrpn_Analog_Remote to it. Whenever values come into the analog, it -puts them channel-for-channel into the D/A board. - Because of the continually-tried reconnect, you can leave this -server running, and it will continually try to reconnect to a -Server Connection whose name you tell it at startup. - -**/ - -#include <stdlib.h> -#include <stdio.h> -#include <signal.h> -#include "NIUtil.h" -#include "vrpn_Connection.h" -#include "vrpn_Analog.h" - - -/***************************************************************************** - * - Variables used to pass information around the program - * - *****************************************************************************/ - -vrpn_Analog_Remote *ana; -vrpn_Connection *c; -int done = 0; -int verbose = 0; //< Print the values when setting them? -int NI_device_number = -1; //< National Instruments device to use -int NI_num_channels = 8; //< Number of channels on the board -double min_voltage = 0.0; //< Minimum voltage allowed on a channel -double max_voltage = 6.0; //< Maximum voltate allowed on a channel - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_analog (void *, const vrpn_ANALOGCB a) -{ - int i; - int channels = a.num_channel; - - // Print the values if we're in verbose mode. - if (verbose) { - printf("Analogs: "); - for (i = 0; i < a.num_channel; i++) { - printf("%4.2f ",a.channel[i]); - } - printf("\n"); - } - - // Make sure we have a valid board number - if (NI_device_number < 0) { - fprintf(stderr,"handle_analog: Bad NI device number (%g)\n", NI_device_number); - done = 1; - } - - // Make sure we don't have too many channels - if (a.num_channel > NI_num_channels) { - fprintf(stderr,"handle_analog: Warning... too many channels (truncating to %d)\n", NI_num_channels); - channels = NI_num_channels; - } - - // XXX For now, we are setting each channel separately. In the future, it - // would be good to set them all in one fell swoop so that they voltages - // all change at once. - for (i = 0; i < channels; i++) { - - // Clip the values to within the minimum and maximum. - double voltage = a.channel[i]; - if (voltage < min_voltage) { - fprintf(stderr,"Warning: low voltage clipped to %g\n", min_voltage); - voltage = min_voltage; - } - if (voltage > max_voltage) { - fprintf(stderr,"Warning: high voltage clipped to %g\n", max_voltage); - voltage = max_voltage; - } - AO_VWrite(NI_device_number, i, voltage); - } -} - -int VRPN_CALLBACK handle_connection_shutdown(void *, vrpn_HANDLERPARAM) -{ - int i; - - // Make sure we have a valid board number - if (NI_device_number < 0) { - fprintf(stderr,"handle_analog: Bad NI device number (%g)\n", NI_device_number); - done = 1; - } - - fprintf(stderr, "handle_connection_shutdown: Zeroing the D/As\n"); - - // Set all the channels to zero whenever a connection is dropped - for (i = 0; i < NI_num_channels; i++) { - AO_VWrite(NI_device_number, i, 0.0); - } - - return 0; -} - -/// Shut down if the user presses ^C. - -void handle_cntl_c (int) { - done = 1; -} - - -void Usage (const char * s) -{ - fprintf(stderr,"Usage: %s [-board boardname] [-channels num] [-server servername] [-unipolar]\n",s); - fprintf(stderr," [-bipolar] [-range min max] [-internal_ref] [-external_ref]\n"); - fprintf(stderr," [-ref_voltage voltage] [-verbose]\n"); - fprintf(stderr," -channels: Number of channels (default 8).\n"); - fprintf(stderr," -board: Name of the NI board to use (default PCI-6713).\n"); - fprintf(stderr," -server: Name of the vrpn_Analog_Server to connect to (default MagnetDrive@nobellium-cs).\n"); - fprintf(stderr," -bipolar/-unipolar: Polarity (default unipolar).\n"); - fprintf(stderr," -range: Allowable voltage range (default %g to %g).\n", min_voltage, max_voltage); - fprintf(stderr," -internal_ref/-external_ref: Reference source (default internal).\n"); - fprintf(stderr," -ref_voltage: Reference voltage (default 0.0).\n"); - fprintf(stderr," -verbose: Print each new round of voltages.\n"); - exit(0); -} - -void main (int argc, char * argv []) -{ - char *server_name = "MagnetDrive@nobellium-cs"; - char *board_name = "PCI-6713"; - int polarity = 1; //< Unipolar = 1, bipolar = 0 - int ref_source = 0; //< Reference source, 0 = internal, 1 = external - double ref_voltage = 0.0; - int update_mode = 0; //< Mode to update the board (0 = immediate) - - int i; - int realparams = 0; //< How many non "flag" parameters - vrpn_Connection *conn; //< Connection used by the analog client - - // Parse the command line - i = 1; - while (i < argc) { - if (!strcmp(argv[i], "-board")) { - if (++i > argc) { Usage(argv[0]); } - board_name = argv[i]; - } else if (!strcmp(argv[i], "-channels")) { - if (++i > argc) { Usage(argv[0]); } - NI_num_channels = atoi(argv[i]); - } else if (!strcmp(argv[i], "-server")) { - if (++i > argc) { Usage(argv[0]); } - server_name = argv[i]; - } else if (!strcmp(argv[i], "-unipolar")) { - polarity = 1; - } else if (!strcmp(argv[i], "-bipolar")) { - polarity = 0; - } else if (!strcmp(argv[i], "-internal_ref")) { - ref_source = 0; - } else if (!strcmp(argv[i], "-external_ref")) { - ref_source = 1; - } else if (!strcmp(argv[i], "-ref_voltage")) { - if (++i > argc) { Usage(argv[0]); } - ref_voltage = atof(argv[i]); - } else if (!strcmp(argv[i], "-range")) { - if (++i > argc) { Usage(argv[0]); } - min_voltage = atof(argv[i]); - if (++i > argc) { Usage(argv[0]); } - max_voltage = atof(argv[i]); - } else if (!strcmp(argv[i], "-verbose")) { - verbose = 1; - } else if (argv[i][0] == '-') { // Unknown flag - Usage(argv[0]); - } else switch (realparams) { // Non-flag parameters - case 0: - Usage(argv[0]); - break; - default: - Usage(argv[0]); - } - i++; - } - - // Open the D/A board and set the parameters for each channel. - NI_device_number = NIUtil::findDevice(board_name); - if (NI_device_number == -1) { - fprintf(stderr, "Error opening the D/A board %s\n", board_name); - exit(-1); - } - for (i = 0; i < NI_num_channels; i++) { - AO_Configure(NI_device_number, i, polarity, ref_source, ref_voltage, - update_mode); - } - - // signal handler so logfiles get closed right - signal(SIGINT, handle_cntl_c); - - fprintf(stderr, "Analog's name is %s.\n", server_name); - ana = new vrpn_Analog_Remote (server_name); - - // Set up the callback handlers for analog values, and for - // when a connection drops. - printf("Analog update: Analogs: [new values listed]\n"); - ana->register_change_handler(NULL, handle_analog); - if ( (conn = ana->connectionPtr()) == NULL) { - fprintf(stderr,"Can't get connection from analog remote!\n"); - exit(-1); - } - conn->register_handler( conn->register_message_type(vrpn_dropped_connection), - handle_connection_shutdown, NULL); - conn->register_handler( conn->register_message_type(vrpn_dropped_last_connection), - handle_connection_shutdown, NULL); - - /* - * main interactive loop - */ - while ( ! done ) - { - // Handle any callbacks - ana->mainloop(); - - // Sleep for 1ms so we don't eat the CPU - vrpn_SleepMsecs(1); - } - - // Delete the analog device - if (ana) delete ana; - - // XXX Presumably the device gets closed when the program exits. Might be - // better to close it intentionally. - -} /* main */ diff --git a/src/vrpn/server_src/daq_server.dsp b/src/vrpn/server_src/daq_server.dsp deleted file mode 100644 index 1bb64b1c458ef445367fbff980fa50d8f87dcc75..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/daq_server.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# Microsoft Developer Studio Project File - Name="daq_server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=daq_server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "daq_server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "daq_server.mak" CFG="daq_server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "daq_server - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "daq_server - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "daq_server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\..\quat" /I "..\..\external\pc_win32\NIDAQ\Include" /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "daq_server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/daq_server/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/daq_server/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /I "..\..\quat" /I "..\..\external\pc_win32\NIDAQ\Include" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /GZ /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "daq_server - Win32 Release" -# Name "daq_server - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=daq_server.C -# End Source File -# Begin Source File - -SOURCE=NIUtil.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=NIUtil.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/server_src/daq_server.vcproj b/src/vrpn/server_src/daq_server.vcproj deleted file mode 100644 index a326b6d441758432f6436c047ce9cb5d226cb653..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/daq_server.vcproj +++ /dev/null @@ -1,271 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="daq_server" - ProjectGUID="{49248084-B6D2-4E33-BA43-BF51953377AC}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\Release" - IntermediateDirectory=".\Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\Release/daq_server.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,..\..\quat,..\..\external\pc_win32\NIDAQ\Include" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\Release/daq_server.pch" - AssemblerListingLocation=".\Release/" - ObjectFile=".\Release/" - ProgramDataBaseFileName=".\Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\Release/daq_server.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\Release/daq_server.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\Release/daq_server.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/daq_server/Debug" - IntermediateDirectory=".\../pc_win32/server_src/daq_server/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/daq_server/Debug/daq_server.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,..\..\quat,..\..\external\pc_win32\NIDAQ\Include" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/daq_server/Debug/daq_server.pch" - AssemblerListingLocation=".\../pc_win32/server_src/daq_server/Debug/" - ObjectFile=".\../pc_win32/server_src/daq_server/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/daq_server/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/daq_server/Debug/daq_server.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/server_src/daq_server/Debug/daq_server.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/daq_server/Debug/daq_server.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="daq_server.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="NIUtil.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - <File - RelativePath="NIUtil.h" - > - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/def.pl b/src/vrpn/server_src/def.pl deleted file mode 100644 index 69b49cdd390c71255ae8b42c425a3b33ab6c5f54..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/def.pl +++ /dev/null @@ -1,1058 +0,0 @@ -#!/usr/local/bin/perl - -# Perl script to parse VRPN message parameter declarations -# from a definition file (def-file) and then build -# an associative array to define them. -# The script then reads in one or more code files -# and inserts code in them based on keywords in the code -# files and the message parameters defined in the def-file. - -# usage: def.pl <def-file-name> <code-file-name>+ - -# Tom Hudson, June 1999 - -# Recursive descent parser pointed out by Chris Weigle. -# A redesign might use half-a-dozen RDParsers instead of two. - -use Parse::RecDescent; -#$::RD_HINT = 1; # turn on verbose debugging -#$::RD_TRACE = 1; # turn on verbose debugging - -local (%messageDefinitionArray) = (); -local ($numDefinitions) = 0; - -# debugging flags - -local ($dumpMessageArray) = 0; - -# Tie::IxHash allows us to retrieve from the hash table in -# insertion order, which would be esp. nice for debugging. - -# use Tie::IxHash; -# tie %messageDefinitionArray, "Tie::IxHash"; - -# If this were a full-featured language, we'd use a data structure -# to hold the syntax tree we create for the data types. However, -# Perl (to the best of my knowledge) doesn't have data structures, -# so we have to encode it in a string, then parse that string -# every time we want to read it. -# One way to do this would be to have a recursive descent parser -# for every output, but instead we rewrite the standard definition -# into a simpler format that we don't need a RD parser to parse. -# BNF looks something like: -# typeRecord: typeEntry -# | typeEntry ':' typeRecord -# typeEntry: typeName variableName optionalArray -# | 'struct' typeName '{' -# structTypeRecord -# '}' variableName optionalArray -# structTypeRecord: typeEntry -# | typeEntry ';' structTypeRecord -# optionalArray: count -# | empty -# Probably should have done it using many RD parsers, especially -# since they seem to be reentrant. - -$definitionGrammar = q[ - - start: line(s) - - line: /VRPN_MESSAGE/ typeName /{/ structOrFieldSequence /}/ - { $main::messageDefinitionArray{$item[2]} = $item[4]; - # print $item[2] . " is " . $item[4] . "\n"; - $main::numDefinitions++; } - | /[^\n]*\n/ - { } - - typeName: /(\w)+/ - { $return = $item[1]; } - - structOrFieldSequence: - structDefinition structOrFieldSequence - { $return = $item[1] . $item[2]; } - | field structOrFieldSequence - { $return = $item[1] . $item[2]; } - | structDefinition - { $return = $item[1]; } - | field - { $return = $item[1]; } - | // - { $return = ""; } - - structDefinition: - /struct/ structTypeName /{/ - fieldSequence - /}/ structName count - { $return = "struct " . $item[2] . " {" - . join(";", split(/:/, $item[4])) - . "}" . $item[6] . " " . $item[7]; } - - structName: - /(\w)+/ - { $return = $item[1]; } - - structTypeName: - /(\w)+/ - { $return = $item[1]; } - - fieldSequence: - field fieldSequence - { $return = $item[1] . $item[2]; } - | field - { $return = $item[1]; } - - field: - /(\w)+/ /(\w)+/ optionalCount - { $return = $item[1] . " " . $item[2] . " " . $item[3] . ":" . $item[4]; } - - optionalCount: - count optionalCount - { $return = $item[1] . $item[2]; } - | // - { $return = ""; } - - count: - /\[/ /(\d)+/ /\]/ # fixed, numeric count - { $return = "[" . $item[2] . "]"; } - | /\[/ /(\w)+/ /\]/ # variable count - { $return = "[" . $item[2] . "]"; } - -]; - -$definitionParser = new Parse::RecDescent ($definitionGrammar); -$definitionInput = ""; - - -# take name of file to open for definitions from command line $ARGV[0] - -open(DEFHANDLE, "< " . $ARGV[0]); -while (<DEFHANDLE>) { - $definitionInput .= $_; -}; -close(DEFHANDLE); - -$definitionParser->start($definitionInput); - -# traverse messageDefinitionArray and print - -if ($dumpMessageArray) { - foreach my $typeName (keys(%messageDefinitionArray)) { - print $typeName . " is:\n"; - # print $typeName . " is " . $messageDefinitionArray{$typeName} . "\n"; - foreach my $arg (split(/:/, $messageDefinitionArray{$typeName})) { - if (substr($arg,0,6) eq "struct") { - my $openbrace = index($arg, "{"); - my $closebrace = index($arg, "}"); # must only be one! - my $openbracket = index($arg, "[", $closebrace); - my $argbody = substr($arg, $openbrace + 1, - $closebrace - $openbrace - 1); - my $structtypename = substr($arg, 7, $openbrace - 7); - my $structname = substr($arg, $closebrace + 1, - $openbracket - $closebrace - 2); - my $count = substr($arg, $openbracket); - # print $argbody; - print " struct " . $structtypename . " {\n"; - foreach my $subarg (split(/;/, $argbody)) { - print " " . $subarg . "\n"; - } - print " } " . $structname - . " " . $count . "\n"; - } else { - print " " . $arg . "\n"; - } - } - } -} - -# print "Parsed " . $numDefinitions . " definitions.\n"; - -# Emits a function to decode the named type into network form. -# Returns 0, or -1 on error. -# -# int myClass::decode_foo (const char * buffer, ...) { -# if (!buffer || ...) return -1; -# vrpn_unbuffer(&buffer, ...); -# return 0; -# } - -sub emitDecoder { - my $typeName = $_[0]; - - # function declaration / parameter list - - print "int " . $classPrefix . "decode_" . $typeName . " (\n"; - print " const char * buffer,\n"; - - my @argarray = split(/:/, $messageDefinitionArray{$typeName}); - - for ($i = 0; $i <= $#argarray; $i++) { - my @thisarg = split(/ /, $argarray[$i]); - print " "; - - my $varname = $thisarg[1]; - - if (substr($thisarg[0],0,6) eq "struct") { - print "struct " . $varname . " "; - my $closebrace = index($argarray[$i], "}"); - $openbracket = index($argarray[$i], "[", $closebrace); - $varname = substr($argarray[$i], $closebrace + 1, - $openbracket - $closebrace - 2); - - } else { - $openbracket = index($argarray[$i], "["); - if ($thisarg[0] ne "char") { - print "vrpn_" - } - print $thisarg[0] . " "; - } - - print "* " . $varname; - if ($i != $#argarray) { - print ","; - } - print "\n"; - } - - print ") {\n"; - - # function body - - # test for non-NULL - - print " if (!buffer"; - for ($i = 0; $i <= $#argarray; $i++) { - my @thisarg = split(/ /, $argarray[$i]); - - my $varname = $thisarg[1]; - - if (substr($thisarg[0],0,6) eq "struct") { - $closebrace = index($argarray[$i], "}"); - $openbracket = index($argarray[$i], "[", $closebrace); - $varname = substr($argarray[$i], $closebrace + 1, - $openbracket - $closebrace - 2); - } - print "\n || !" . $varname; - } - print ") return -1;\n"; - - # OK, tough stuff: unbuffer each entry. - # Need to handle nested loops! - - emitUnbufferList(@argarray); - - print " return 0;\n"; - print "}\n"; - print "\n"; - - 1; -}; - -# Emits a function to encode the named type into network form. -# Returns a buffer which it is the caller's responsibility to -# delete []. Places the length of the buffer in the parameter -# len. -# -# char * myClass::encode_foo (int * len, ...) { -# char * msgbuf = NULL; -# char * mptr; -# int mlen; -# if (!len) return NULL; -# *len = sizeof(...); -# msgbuf = new char [*len]; -# if (!msgbuf) { -# fprintf(stderr, "encode_foo: Out of memory.\n"); -# *len = 0; -# } else { -# mptr = msgbuf; -# mlen = *len; -# vrpn_buffer(&mptr, &mlen, ...); -# } -# return msgbuf; -# } - -sub emitEncoder { - my $typeName = $_[0]; - - # function declaration / parameter list - - print "char * " . $classPrefix . "encode_" . $typeName . " (\n"; - print " int * len,\n"; - - my @argarray = split(/:/, $messageDefinitionArray{$typeName}); - - for ($i = 0; $i <= $#argarray; $i++) { - my @thisarg = split(/ /, $argarray[$i]); - print " "; - - my $varname = $thisarg[1]; - my $openbracket = $[-1; - - if (substr($thisarg[0],0,6) eq "struct") { - print "struct " . $varname . " "; - my $closebrace = index($argarray[$i], "}"); - $openbracket = index($argarray[$i], "[", $closebrace); - $varname = substr($argarray[$i], $closebrace + 1, - $openbracket - $closebrace - 2); - - } else { - $openbracket = index($argarray[$i], "["); - if ($thisarg[0] ne "char") { - print "vrpn_" - } - print $thisarg[0] . " "; - } - if ($openbracket != $[-1) { - print "* "; - } - print $varname; - if ($i != $#argarray) { - print ","; - } - print "\n"; - } - - print ") {\n"; - - # function body - - print " char * msgbuf = NULL;\n"; - print " char * mptr;\n"; - print " int mlen;\n"; - print " if (!len) return NULL;\n"; - - # figure out size of message by adding up types of every entry. - - print " *len =\n"; - emitMsgSizes(@argarray); - - print " msgbuf = new char [*len];\n" - . " if (!msgbuf) {\n" - . " fprintf(stderr, \"encode_" . $typeName . ": " . - "Out of memory.\\n\");\n" - . " *len = 0;\n" - . " } else {\n" - . " mptr = msgbuf;\n" - . " mlen = *len;\n"; - - # OK, tough stuff: buffer each entry. - # Need to handle nested loops! - - emitBufferList(@argarray); - - print " }\n"; - print " return msgbuf;\n"; - print "}\n"; - print "\n"; - - 1; -}; - -# Emits a function that unmarshalls (see decode_foo) onto the stack -# then executes user-specified code. - -sub emitHandler { - my $typeName = $_[0]; - - # function declaration / parameter list - - print "\n"; - print "int " . $classPrefix . "handle_" . $typeName . " (" - . "void * userdata, vrpn_HANDLERPARAM p) {\n"; - print " const char * buffer = p.buffer;\n"; - - my @argarray = split(/:/, $messageDefinitionArray{$typeName}); - - for (my $i = 0; $i <= $#argarray; $i++) { - my @thisarg = split(/ /, $argarray[$i]); - - my $varname = $thisarg[1]; - - my @arrayDimensions = split(/\[/, $argarray[$i]); - my $numArrayDimensions = $#arrayDimensions; - - #print "ARGARRAY[I] = " . $argarray[$i] . "\n"; - #foreach my $ad (@arrayDimensions) { - #print "DIMENSION = " . $ad . "\n"; - #} - #print "# ARRAY DIMENSIONS = " . $numArrayDimensions . "\n"; - - print " "; - if (substr($thisarg[0],0,6) eq "struct") { - print "struct " . $varname . " "; - my $closebrace = index($argarray[$i], "}"); - $openbracket = index($argarray[$i], "[", $closebrace); - $varname = substr($argarray[$i], $closebrace + 1, - $openbracket - $closebrace - 2); - - $trailingBrace = rindex($argarray[$i], "}"); - $trailingPart = substr($argarray[$i], $trailingBrace); - @arrayDimensions = split(/\[/, $trailingPart); - $numArrayDimensions = $#arrayDimensions; - } else { - if ($thisarg[0] ne "char") { - print "vrpn_" - } - print $thisarg[0] . " "; - } - - # hack: assume array dimension is a constant if - # we can get a nonzero numeric value for each of the dimensions - - my $dimensionIsConstant = 1; - for (my $j = 1; $j <= $numArrayDimensions; $j++) { - my $ad = $arrayDimensions[$j]; - #print "DIMENSION = " . $ad . "\n"; - if ($ad == 0) { - $dimensionIsConstant = 0; - } - } - - if (($numArrayDimensions > 0) && - !$dimensionIsConstant) { - for (my $j = 1; $j <= $numArrayDimensions; $j++) { - print "*"; - } - print " "; - } - - print $varname; - - if (($numArrayDimensions > 0) && - $dimensionIsConstant) { - print " "; - print substr($argarray[$i], index($argarray[$i], "[")); - } - - print ";\n"; - } - - print "\n"; - - # function body - - # test for non-NULL - - # OK, tough stuff: unbuffer each entry. - # Need to handle nested loops! - - emitAndedUnbufferList(@argarray); - - # User is expected to write the rest of the code. - - print "\n"; - - 1; -}; - -# -# TODO: extra parameters for register_handler -# - -sub emitRegister { - my $typeName = $_[0]; - my $argument = $_[1]; - - my $qTypeName = $typeName . "_type"; - print " vrpn_int32 " . $qTypeName . ";\n"; - print " " . $qTypeName . " = connection->register_message_type(\"" - . $typeName . "\");\n"; - print " connection->register_handler(" . $qTypeName . ", handle_" - . $typeName . ", " . $argument . ");\n"; - -} - -# Given a message type name, write out declarations for all the -# structures the message uses. - -# Quick 'n' dirty; doesn't pretty-print. - -# Need to do three ugly things: -# Find variable-sized arrays in the declaration and replace them -# with pointers. -# Insert "vrpn_" in type names where appropriate -# x Insert trailing ';' before the closing '}' - -sub emitStructures { - my $typeName = $_[0]; - - my @argarray = split(/:/, $messageDefinitionArray{$typeName}); - - foreach my $arg (@argarray) { - my @thisarg = split(/ /, $arg); - if ($thisarg[0] eq "struct") { - my $openBrace = index($arg, "{"); - my $closeBrace = rindex($arg, "}"); - #print substr($arg, 0, $closeBrace) . ";};\n"; - - my $structFieldString = substr($arg, $openBrace + 1, - $closeBrace - $openBrace - 1); - my $structDeclaration = substr($arg, 0, $openBrace); - - #print "FIELDS = " . $structFieldString . "\n"; - #print "DECLARATION = " . $structDeclaration . "\n"; - - my @structFields = split(/;/, $structFieldString); - - print $structDeclaration . " {\n"; - - foreach my $field (@structFields) { - my @words = split(/ /, $field); - my $typename = $words[0]; - my $varname = $words[1]; - my $arrayspec = $words[2]; - if ($typename eq "struct") { - $typename = $words[0] . " " . $words[1]; - $varname = $words[2]; - $arrayspec = $words[3]; - } elsif ($typename ne "char") { - $typename = "vrpn_" . $typename; - } - - # figure out if nonconstant-sized array - - # hack: assume array dimension is a constant if - # we can get a nonzero numeric value for each of the dimensions - - my @counts = split(/]/, $arrayspec); - my $numopenbracket = $#counts; - - my $dimensionIsConstant = 1; - for (my $j = 0; $j <= $numopenbracket; $j++) { - my $ad = substr($counts[$j], 1); - #print "DIMENSION = " . $ad . "\n"; - if ($ad == 0) { - $dimensionIsConstant = 0; - } - } - - if (!$dimensionIsConstant) { - $varname = " " . $varname; - for (my $j = 0; $j <= numopenbracket; $j++) { - $varname = "*" . $varname; - } - $arrayspec = ""; - } - - - print " " . $typename . " " . $varname . " " . $arrayspec . ";\n"; - - } - - print "};\n"; - print "\n"; - } - } -} - - -# Figure out how large the message will be once we encode it: -# take sizeof every element and sum. - -sub emitMsgSizes { - my @argarray = @_; - # print "Sizes: " . $#argarray . "\n"; - - for (my $i = 0; $i <= $#argarray; $i++) { - my @thisarg = split(/ /, $argarray[$i]); - print " sizeof("; - - my $typename = $thisarg[0]; - my $openbracket = $[-1; - - if ($typename eq "struct") { - print "struct " . $thisarg[1]; - my $closebrace = index($argarray[$i], "}"); - $openbracket = index($argarray[$i], "[", $closebrace); - } else { - $openbracket = index($argarray[$i], "["); - if ($typename ne "char") { - print "vrpn_" - } - print $typename; - } - print ")"; - - # multiply out all the counts - # This can be numeric or variable, so we can't do the math here, - # but have to do it at runtime. - - my $count = 1; - my $countstr = $thisarg[$#thisarg]; - if ($openbracket != $[-1) { - foreach my $countsubstr (split (/]/, $countstr)) { - print " * " . substr($countstr, 1, length($countstr) - 2); - } - } - - if ($i != $#argarray) { - print " +"; - } else { - print ";"; - } - print "\n"; - } -}; - -# Emit code to buffer (marshal) "one thing" -# Arguments: -# thing prefix indent -# thing is a complex space-separated string (don't you love Perl?): -# <type name> <variable name> [<array specifications>] -# prefix is a structure name (possibly with array index) -# indent is a string of spaces that we use to make pretty output - -sub emitBufferItem { - my $arg = $_[0]; - my $prefix = $_[1]; - my $indent = $_[2]; - - my @thisarg = split(/ /, $arg); - - my $typename = $thisarg[0]; - my $varname = $thisarg[1]; - my $openbracket = index($arg, "["); - - if ($openbracket != $[-1) { - # is it a one-dimensional character array? - my $lastopenbracket = rindex($arg, "["); - if (($typename eq "char") && - ($lastopenbracket == $openbracket)) { - my $count = substr($arg, $openbracket + 1, - index($arg, "]") - $openbracket - 1); - print $indent . " vrpn_buffer(&mptr, &mlen, " . $prefix . $varname - . ", " . $count . ");\n"; - } elsif ($typename eq "struct") { - # array of structures; assume one-dimensional - - print $indent . " int s;\n"; - print $indent . " for (s = 0; s < 1"; - my $countstr = $thisarg[$#thisarg]; - foreach my $countsubstr (split (/]/, $countstr)) { - print " * " . substr($countstr, 1, length($countstr) - 2); - } - print "; s++) {\n"; - - my $openbrace = index($arg, "{"); - my $lastclosebrace = rindex($arg, "}"); - my $subargstr = substr($arg, - $openbrace + 1, - $lastclosebrace - $openbrace - 2); - # print "Subargstr: " . $subargstr . "\n"; - my @subarg = split(/;/, $subargstr); - # print "#subarg: " . $subarg . "\n"; - - $openbracket = index($arg, "[", $lastclosebrace); - my $structname = substr($arg, $lastclosebrace + 1, - $openbracket - $lastclosebrace - 2); - - - for (my $i = 0; $i <= $#subarg; $i++) { - # print $i . " emitting: " . $subarg[$i] . "\n"; - emitBufferItem($subarg[$i], $structname . "[s]."); - } - - print " }\n"; - } else { - - # either an array of non-char - # or a multidimensional array of any type - # or ... - - print "BUG BUG BUG\n"; - - } - } else { - - # default case: not a struct, not an array, not anything special, - # just an ordinary parameter - - print $indent . " vrpn_buffer(&mptr, &mlen, " - . $prefix . $varname . ");\n"; - } - -}; - -# Given a list of things to buffer, -# generate the code to buffer each. - -sub emitBufferList { - my @argarray = @_; - - for (my $i = 0; $i <= $#argarray; $i++) { - emitBufferItem($argarray[$i], "", ""); - } -}; - -# Emit code to unbuffer (demarshal) "one thing" -# - -sub emitUnbufferItem { - my $arg = $_[0]; - my $prefix = $_[1]; - my $indent = $_[2]; - my $arrayspec = $_[3]; - my $recursioncount = $_[4]; - my $dereferenceNonconstantArraySizes = $_[5]; - - my @thisarg = split(/ /, $arg); - - my $typename = $thisarg[0]; - my $varname = $thisarg[1]; - my $firstOpenBracket = index($arg, "["); - my $lastclosebrace = rindex($arg, "}"); - my $trailingOpenBracket = index($arg, "[", $lastclosebrace); - my $lastopenbracket = rindex($arg, "["); - - my $qualifiedVarname = $prefix . $varname . $arrayspec; - - # is it not an array? - if ($trailingOpenBracket == $[-1) { - - if ($typename eq "struct") { - - # struct - - my $openbrace = index($arg, "{"); - my $subargstr = substr($arg, - $openbrace + 1, - $lastclosebrace - $openbrace - 1); - my @subarg = split(/;/, $subargstr); - - #print "ARG = " . $arg . "\n"; - - my $structname = substr($arg, $lastclosebrace + 1); - # $trailingOpenBracket - $lastclosebrace - 2); - - #print "STRUCTNAME = " . $structname . "\n"; - - for (my $i = 0; $i <= $#subarg; $i++) { - emitUnbufferItem($subarg[$i], $prefix . $structname . $arrayspec . ".", - " " . $indent, "", $recursioncount + 1); - # this doesn't need to be $recursioncount + 1, it could just be - # $recursioncount, since we're really using it for a - # number-of-enclosing-loops count, but it doesn't hurt. - } - - } else { - - # default case: not a struct, not an array, not anything special - - print $indent . " vrpn_unbuffer(&buffer, " . $qualifiedVarname . ");\n"; - - } - - } elsif (($typename eq "char") && - ($lastopenbracket == $trailingOpenBracket)) { - - # one-dimensional character array - - my $count = substr($arg, $trailingOpenBracket + 1, - index($arg, "]") - $trailingOpenBracket - 1); - - # hack: $count == 0 means this array size is nonconstant - if ($dereferenceNonconstantArraySizes && ($count == 0)) { - $count = "*" . $count; - } - - # hack: remove any leading '&' - # (But hey, strings are a little non-orthogonal. We could probably - # just go ahead and unbuffer one character at a time inside a loop, - # but it's more efficient to take advantage of vrpn_unbuffer()'s - # char special case. If this ever breaks, remove the char special - # case and add a single-character unbuffer function to vrpn.) - - my $charVarname = $qualifiedVarname; - if (index($qualifiedVarname, "&") == 0) { - $charVarname = substr($charVarname, 1); - } - - # if the dimension is non-constant we have to allocate the array. - - if ($count == 0) { - print $indent . " " . $charVarname . " = new char [" . $count . "];\n"; - } - - print $indent . " vrpn_unbuffer(&buffer, " . $charVarname . - ", " . $count . ");\n"; - - } else { - - # array: - # emit code to allocate the array on the heap IFF size is non-constant - # emit code for an iterator (variable declaration and for loop) - # construct an $arrayspec for this array dimension - # change the string we pass on to not include this dimension - # recurse - - #print "ARG = " . $arg . "\n"; - - my $countstr = $thisarg[$#thisarg]; - my @counts = split(/]/, $countstr); - my $numopenbracket = $#counts; - - my $numdimensions = $numopenbracket; - - my $loopvar = "vd_i" . $recursioncount; - - # allocation time - - # hack: assume array dimension is a constant if - # we can get a nonzero numeric value for each of the dimensions - - my $dimensionIsConstant = 1; - for (my $j = 0; $j <= $numopenbracket; $j++) { - my $ad = $counts[$j]; - #print "DIMENSION = " . $ad . "\n"; - if ($ad == 0) { - $dimensionIsConstant = 0; - } - } - - my $thisCount = substr($counts[0], 1); - - if (!$dimensionIsConstant) { - if ($dereferenceNonconstantArraySizes) { - $thisCount = "*" . $thisCount; - } - - my $bareVarname = $qualifiedVarname; - if (index($bareVarname, "&") == 0) { - $bareVarname = substr($bareVarname, 1); - } - - my $effectiveTypeName = $typename; - #print "BVN = " . $bareVarname . "\n"; - #print "ETN = " . $effectiveTypeName . "\n"; - - if ($effectiveTypeName eq "struct") { - - # effectiveTypeName and bareVarname reverse - - $effectiveTypeName = $bareVarname; - - $bareVarname = substr($arg, $lastclosebrace + 1); - #print "BVN = " . $bareVarname . "\n"; - #print "ETN = " . $effectiveTypeName . "\n"; - - my $bracketIndex = index($bareVarname, "["); - if ($bracketIndex != $[-1) { - $bareVarname = substr($bareVarname, 0, $bracketIndex); - #print "ETN = " . $effectiveTypeName . "\n"; - } - } elsif ($effectiveTypeName ne "char") { - $effectiveTypeName = "vrpn_" . $effectiveTypeName; - } - - print $indent . " " . $bareVarname . " = new " - . $effectiveTypeName . " "; - - # print any necessary "*"s - for (my $i = 1; $i <= $#counts; $i++) { - print "*"; - } - - print " [" . $thisCount . "];\n"; - } - - # define an index variable for this dimension of the array - print $indent . " int " . $loopvar . ";\n"; - - # start a loop over this dimension of the array - print $indent . " for (" . - $loopvar . " = 0; " . - $loopvar . " < " . $thisCount . "; " . - $loopvar . "++) {\n"; - - # "fix up" string we're passing down and construct the new arrayspec - # The string we pass down to the next recursion should have the FIRST - # array specifier ([...]) removed - - my $trailingCloseBracket = index($arg, "]", $trailingOpenBracket); - - #print "TRAILING OPEN = " . $trailingOpenBracket . "\n"; - #print "TRAILING CLOSED = " . $trailingCloseBracket . "\n"; - - my $newarg = substr($arg, 0, $trailingOpenBracket) . - substr($arg, $trailingCloseBracket + 1); - my $newarrayspec = $arrayspec . "[" . $loopvar . "]"; - - # recurse - emitUnbufferItem($newarg, $prefix, - $indent . " ", - $newarrayspec, - $recursioncount + 1, - $dereferenceNonconstantArraySizes); - - # end the for loop - print $indent . " }\n"; - - } - -}; - -# Given a list of things emit unbuffering code for all of them. - -sub emitUnbufferList { - my @argarray = @_; - - for (my $i = 0; $i <= $#argarray; $i++) { - emitUnbufferItem($argarray[$i], "", "", "", 0, 1); - } - -}; - -# Given a list of things emit unbuffering code for all of them -# with & prefixed. (A hack inside emitUnbufferItem will remove the -# '&' before one-dimensional character arrays.) - -sub emitAndedUnbufferList { - my @argarray = @_; - - for (my $i = 0; $i <= $#argarray; $i++) { - emitUnbufferItem($argarray[$i], "&", "", "", 0, 0); - } - -}; - -local $class = ""; -local $classPrefix = ""; - -# outputGrammar: -# Parses C++ source files for directives to insert code fragments. -# Recognized directives: -# CLASSNAME <class name> -# Subsequent functions definitions should be prefixed with <class name>:: -# NO CLASS -# Cancels a CLASSNAME directive -# ENCODE <type name> -# Inserts a code fragment for a function -# char * encode_<type name> (int * len, ...) -# Allocates and returns a pointer to a character buffer holding -# the marshalled message; returns the length of the message in -# len. Components of the message are passed as the "..." arguments; -# arrays should be passed as pointers. -# DECODE <type name> -# Inserts a code fragment for a function -# int decode_<type name> (const char * buffer, ...) -# Unpacks the buffer into its components, which should be passed -# as pointers. All arrays, whether fixed or variable-sized, -# will be allocated on the heap and returned in pointers. -# HANDLE <type name> -# ... -# } -# Inserts a code fragment for a function -# int handle_<type name> (void * userdata, vrpn_HANDLERPARAM p) -# Declares the message's components on the stack and unpacks the -# buffer into them. Then falls through into the user code -# indicated by "..." and terminated by "}". -# REGISTER <type name> -# Generates the following fragment: -# vrpn_int32 <type name>_type; -# <type name>_type = connection->register_message_type("<type name>"); -# connection->register_handler("<type name>", handle_<type name>, -# NULL); -# BUGS: Does not allow specification of the userdata pointer (forces -# it to NULL) or other parameters. - - -$outputGrammar = q[ - - start: line(s) - - line: - classname - | prototype - | encoder - | decoder - | handler - | register - | /[^\n]*\n/ - { my $thisspacepad = ""; - for (my $i = 0 ; $i < 1 + $prevcolumn - length($item[1]) ; $i++) { - $thisspacepad .= " "; - } - print $thisspacepad . $item[1]; } - - classname: - /CLASSNAME/ className - { my $class = className; - my $classPrefix = className . "::"; } - | /NO CLASS/ - { my $class = ""; - my $classPrefix = ""; } - - prototype: - /DECLARE STRUCTURES/ messageName - { main::emitStructures ($item[2]); } - - encoder: - /ENCODE/ typeName - { main::emitEncoder ($item[2]); } - - decoder: - /DECODE/ typeName - { main::emitDecoder ($item[2]); } - - handler: - /HANDLE/ typeName - { main::emitHandler ($item[2]); } - - register: - /REGISTER/ typeName optionalVariableName - { main::emitRegister ($item[2], $item[3]); } - - typeName: - /(\w)+/ - { $return = $item[1]; } - - className: - /(\w)+/ - { $return = $item[1]; } - - messageName: - /(\w)+/ - { $return = $item[1]; } - - optionalVariableName: - /(\w)+/ /;/ - { $return = $item[1]; } - | /;/ - { $return = "NULL"; } -]; - -$outputParser = new Parse::RecDescent ($outputGrammar); -$outputInput = ""; - - -#$::RD_HINT = 1; # turn on verbose debugging -#$::RD_TRACE = 1; # turn on verbose debugging - -# Do the actual work. -#print "Entering loop.\n"; - -for (my $i = 1; $i <= 1; $i++) { - - # print "Reading " . $ARGV[$i] . ".\n"; - - open(OUTPUTHANDLE, "< " . $ARGV[$i]); - while (<OUTPUTHANDLE>) { - $outputInput .= $_; - }; - close(OUTPUTHANDLE); - - $outputParser->start($outputInput); - -} - -# tests -#emitEncoder("InDirectZControl"); -#emitEncoder("HelloMessage"); -#emitEncoder("ReportScanDatasets"); -#emitDecoder("InDirectZControl"); -#emitDecoder("HelloMessage"); -#emitDecoder("ReportScanDatasets"); - -1; - - - diff --git a/src/vrpn/server_src/directXFF.C b/src/vrpn/server_src/directXFF.C deleted file mode 100644 index 707b9c8459e51ef54ad1ca8966827cc660ef2c9b..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directXFF.C +++ /dev/null @@ -1,113 +0,0 @@ -//XXX Note that this application can be replaced by building the -// vrpn_server program with DirectInput included in the configuration -// file and then giving it an appropriate vrpn.cfg file. - -#include "vrpn_DirectXFFJoystick.h" -#include "vrpn_Tracker_AnalogFly.h" - -void Usage(const char *s) -{ - fprintf(stderr,"Usage: %s [-warn] [-v]\n",s); - fprintf(stderr," -warn: Only warn on errors (default is to bail)\n"); - fprintf(stderr," -v: Verbose\n"); - exit(-1); -} - - -int main (int argc, const char *argv[]) -{ - - int bail_on_error = 1; - int verbose = 0; - int realparams = 0; - - // Parse the command line - int i = 1; - while (i < argc) { - if (!strcmp(argv[i], "-warn")) {// Don't bail on errors - bail_on_error = 0; - } else if (!strcmp(argv[i], "-v")) { // Verbose - verbose = 1; - } else if (argv[i][0] == '-') { // Unknown flag - Usage(argv[0]); - } else switch (realparams) { // Non-flag parameters - case 0: - default: - Usage(argv[0]); - } - i++; - } - -#ifdef _WIN32 - WSADATA wsaData; - int status; - if ((status = WSAStartup(MAKEWORD(1,1), &wsaData)) != 0) { - fprintf(stderr, "WSAStartup failed with %d\n", status); - } else if(verbose) { - fprintf(stderr, "WSAStartup success\n"); - } -#endif - - const char handTrackerName[] = "Joystick0"; - - vrpn_Connection * connection = vrpn_create_server_connection(); - // Create the joystick for analog and buttons - vrpn_DirectXFFJoystick *joyServer = new vrpn_DirectXFFJoystick(handTrackerName, - connection, 200, 200); - if (joyServer==NULL) { - fprintf(stderr, "Could not create Joystick\n"); - return -1; - } - - // Create the tracker to link to the joystick and provide transforms. - // We put "*" in the name to indicate that it should use the same - // connection. - char analogName[1024]; - sprintf(analogName, "*%s", (char*)handTrackerName); - vrpn_Tracker_AnalogFlyParam afp; - afp.x.name = (char*)analogName; - afp.x.channel = 0; - afp.x.offset = 0; - afp.x.thresh = 0; - afp.x.scale = (float)0.07; - afp.x.power = 1; - afp.y = afp.x; afp.y.channel = 1; afp.y.scale = (float)-0.07; - afp.z = afp.x; afp.z.channel = 6; afp.z.scale = (float)0.2; afp.z.offset = (float)1.5; - afp.sz = afp.x; afp.sz.channel = 5; afp.sz.scale = (float)0.06; - vrpn_Tracker_AnalogFly *joyflyServer = new vrpn_Tracker_AnalogFly((char*) handTrackerName, - connection, &afp, 200, vrpn_true); - if (joyflyServer==NULL) { - fprintf(stderr, "phantom_init(): Could not create AnalogFly\n"); - return -1; - } - - // Loop forever calling the mainloop()s for all devices -/* struct timeval tv1, tv2; -*/ int counter = 0; - while (1) { - /* - if ( counter == 0 ) { - vrpn_gettimeofday( &tv1, NULL ); - } - counter++; - */ - - // Let all the trackers generate reports - joyServer->mainloop(); - joyflyServer->mainloop(); - - // Send and receive all messages - connection->mainloop(); - - // Sleep for a short while to make sure we don't eat the whole CPU - //vrpn_SleepMsecs(1); - /* - if ( counter == 50 ) { - vrpn_gettimeofday( &tv2, NULL ); - printf( "%f\n", 50.0/(((tv2.tv_sec*1000 +tv2.tv_usec/1000.0) - (tv1.tv_sec*1000 +tv1.tv_usec/1000.0))/1000.0)); - counter = 0; - } - */ - } -} - diff --git a/src/vrpn/server_src/directXFF_server.dsp b/src/vrpn/server_src/directXFF_server.dsp deleted file mode 100644 index 02183623e41e22607a4a21c83af26b65b118d4f6..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directXFF_server.dsp +++ /dev/null @@ -1,99 +0,0 @@ -# Microsoft Developer Studio Project File - Name="directXFF_server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=directXFF_server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "directXFF_server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "directXFF_server.mak" CFG="directXFF_server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "directXFF_server - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "directXFF_server - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "directXFF_server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/directXFF_server/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/directXFF_server/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../quat" /I "../../external/pc_win32/include/ghost3.1" /I "../../external/pc_win32/include/stl" /I "../" /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:console /machine:I386 /libpath:"../../external/pc_win32/lib" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "directXFF_server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/directXFF_server/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/directXFF_server/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\quat" /I ".." /I "../../external/pc_win32/include/ghost-stl" /I "../../external/pc_win32/include/ghost3.1" /D "VRPN_USE_DIRECTINPUT" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /Fr /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /pdb:none /map /debug /machine:I386 /nodefaultlib:"libcmtd.lib" - -!ENDIF - -# Begin Target - -# Name "directXFF_server - Win32 Release" -# Name "directXFF_server - Win32 Debug" -# Begin Group "External Libraries" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\external\pc_win32\lib\GHOST31.lib -# End Source File -# End Group -# Begin Source File - -SOURCE=.\directXFF.C -# End Source File -# End Target -# End Project diff --git a/src/vrpn/server_src/directshow_video_server/.cvsignore b/src/vrpn/server_src/directshow_video_server/.cvsignore deleted file mode 100644 index 04367b61e78c31fdb509a134a9a91940f9fd101d..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directshow_video_server/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.vcproj.*.user \ No newline at end of file diff --git a/src/vrpn/server_src/directshow_video_server/CMakeLists.txt b/src/vrpn/server_src/directshow_video_server/CMakeLists.txt deleted file mode 100644 index 2c65cb2df19aed2b9b4c84e54857154100e988fc..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directshow_video_server/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -include_directories(${DIRECTSHOW_INCLUDE_DIRS}) -file(GLOB - BASECLASSES - "${DIRECTSHOW_BASECLASS_DIR}/*.cpp" - "${DIRECTSHOW_BASECLASS_DIR}/*.h") - -# Separate static library so that unresolved externals are OK - when -# we link with it below, we'll only grab what we need. -add_library(DirectShow_BaseClasses STATIC ${BASECLASSES}) - -add_executable(directshow_video_server - directx_video_imager_server.cpp - directx_camera_server.cpp - directx_camera_server.h) -target_link_libraries(directshow_video_server - ${VRPN_SERVER_LIBRARY} - DirectShow_BaseClasses - ${DIRECTSHOW_LIBRARIES}) - -set_target_properties(directshow_video_server - DirectShow_BaseClasses - PROPERTIES - FOLDER - Servers) - -if(VRPN_INSTALL) - install(TARGETS - directshow_video_server - RUNTIME - DESTINATION - bin - COMPONENT - servers) -endif() \ No newline at end of file diff --git a/src/vrpn/server_src/directshow_video_server/DirectShow_baseclasses.dsp b/src/vrpn/server_src/directshow_video_server/DirectShow_baseclasses.dsp deleted file mode 100644 index e23546f9bedc2640e6f44c3d909082bb53d904e4..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directshow_video_server/DirectShow_baseclasses.dsp +++ /dev/null @@ -1,208 +0,0 @@ -# Microsoft Developer Studio Project File - Name="DirectShow_baseclasses" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=DirectShow_baseclasses - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "DirectShow_baseclasses.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "DirectShow_baseclasses.mak" CFG="DirectShow_baseclasses - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "DirectShow_baseclasses - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "DirectShow_baseclasses - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "DirectShow_baseclasses - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\pc_win32\server_src\directshow_video_server\Release" -# PROP Intermediate_Dir "..\..\pc_win32\server_src\directshow_video_server\Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses" /I "$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include" /I "$(SYSTEMDRIVE)\Program Files\Microsoft DirectX SDK (August 2006)\Include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D COINIT_DISABLE_OLE1DDE=0x4 /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "DirectShow_baseclasses - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "DirectShow_baseclasses___Win32_Debug" -# PROP BASE Intermediate_Dir "DirectShow_baseclasses___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\pc_win32\server_src\directshow_video_server\Debug" -# PROP Intermediate_Dir "..\..\pc_win32\server_src\directshow_video_server\Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses" /I "$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include" /I "$(SYSTEMDRIVE)\Program Files\Microsoft DirectX SDK (August 2006)\Include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D COINIT_DISABLE_OLE1DDE=0x4 /FR /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "DirectShow_baseclasses - Win32 Release" -# Name "DirectShow_baseclasses - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\amextra.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\amfilter.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\amvideo.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\combase.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\cprop.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\ctlutil.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\ddmm.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\dllentry.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\dllsetup.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\mtype.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\outputq.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\pstream.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\pullpin.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\refclock.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\renbase.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\schedule.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\seekpt.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\source.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\strmctl.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\sysclock.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\transfrm.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\transip.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\videoctl.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\vtrans.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\winctrl.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\winutil.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\wxdebug.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\wxlist.cpp" -# End Source File -# Begin Source File - -SOURCE="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\wxutil.cpp" -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# End Target -# End Project diff --git a/src/vrpn/server_src/directshow_video_server/DirectShow_baseclasses.vcproj b/src/vrpn/server_src/directshow_video_server/DirectShow_baseclasses.vcproj deleted file mode 100644 index a758128b5f8e7be4942bb93d9d41ef485d284538..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directshow_video_server/DirectShow_baseclasses.vcproj +++ /dev/null @@ -1,823 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="DirectShow_baseclasses" - ProjectGUID="{C3262E68-CC9B-4EA3-9AA5-43417526FE5B}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\..\..\pc_win32\server_src\directshow_video_server\Release" - IntermediateDirectory=".\..\..\pc_win32\server_src\directshow_video_server\Release" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\atl,$(SYSTEMDRIVE)\Program Files\Microsoft DirectX SDK (August 2006)\Include" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE,COINIT_DISABLE_OLE1DDE=0x4" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\..\..\pc_win32\server_src\directshow_video_server\Release/DirectShow_baseclasses.pch" - AssemblerListingLocation=".\..\..\pc_win32\server_src\directshow_video_server\Release/" - ObjectFile=".\..\..\pc_win32\server_src\directshow_video_server\Release/" - ProgramDataBaseFileName=".\..\..\pc_win32\server_src\directshow_video_server\Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile=".\..\..\pc_win32\server_src\directshow_video_server\Release\DirectShow_baseclasses.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\..\..\pc_win32\server_src\directshow_video_server\Release/DirectShow_baseclasses.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\..\..\pc_win32\server_src\directshow_video_server\Debug" - IntermediateDirectory=".\..\..\pc_win32\server_src\directshow_video_server\Debug" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\atl,$(SYSTEMDRIVE)\Program Files\Microsoft DirectX SDK (August 2006)\Include" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE,COINIT_DISABLE_OLE1DDE=0x4" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\..\..\pc_win32\server_src\directshow_video_server\Debug/DirectShow_baseclasses.pch" - AssemblerListingLocation=".\..\..\pc_win32\server_src\directshow_video_server\Debug/" - ObjectFile=".\..\..\pc_win32\server_src\directshow_video_server\Debug/" - ProgramDataBaseFileName=".\..\..\pc_win32\server_src\directshow_video_server\Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile=".\..\..\pc_win32\server_src\directshow_video_server\Debug\DirectShow_baseclasses.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\..\..\pc_win32\server_src\directshow_video_server\Debug/DirectShow_baseclasses.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\amextra.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\amfilter.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\amvideo.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\combase.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\cprop.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\ctlutil.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\ddmm.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\dllentry.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\dllsetup.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\mtype.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\outputq.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\pstream.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\pullpin.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\refclock.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\renbase.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\schedule.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\seekpt.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\source.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\strmctl.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\sysclock.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\transfrm.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\transip.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\videoctl.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\vtrans.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\winctrl.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\winutil.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\wxdebug.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\wxlist.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\wxutil.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/directshow_video_server/directshow_video_server.dsp b/src/vrpn/server_src/directshow_video_server/directshow_video_server.dsp deleted file mode 100644 index b4262b326a2a6f2520222a02c24bec3a93b53922..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directshow_video_server/directshow_video_server.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# Microsoft Developer Studio Project File - Name="directshow_video_server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=directshow_video_server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "directshow_video_server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "directshow_video_server.mak" CFG="directshow_video_server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "directshow_video_server - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "directshow_video_server - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "directshow_video_server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\pc_win32\server_src\directshow_video_server\Release" -# PROP Intermediate_Dir "..\..\pc_win32\server_src\directshow_video_server\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../" /I "$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses" /I "$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include" /I "$(SYSTEMDRIVE)\Program Files\Microsoft DirectX SDK (August 2006)\Include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - -!ELSEIF "$(CFG)" == "directshow_video_server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "directshow_video_server___Win32_Debug" -# PROP BASE Intermediate_Dir "directshow_video_server___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\pc_win32\server_src\directshow_video_server\Debug" -# PROP Intermediate_Dir "..\..\pc_win32\server_src\directshow_video_server\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../" /I "$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses" /I "$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include" /I "$(SYSTEMDRIVE)\Program Files\Microsoft DirectX SDK (August 2006)\Include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - -!ENDIF - -# Begin Target - -# Name "directshow_video_server - Win32 Release" -# Name "directshow_video_server - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\directx_camera_server.cpp -# End Source File -# Begin Source File - -SOURCE=.\directx_video_imager_server.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\directx_camera_server.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/server_src/directshow_video_server/directshow_video_server.vcproj b/src/vrpn/server_src/directshow_video_server/directshow_video_server.vcproj deleted file mode 100644 index c9f1721053984c163b31b9524e3076d0467617fa..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directshow_video_server/directshow_video_server.vcproj +++ /dev/null @@ -1,271 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="directshow_video_server" - ProjectGUID="{F7E929EB-6422-40BF-84FF-C8D74E192567}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\..\..\pc_win32\server_src\directshow_video_server\Debug" - IntermediateDirectory=".\..\..\pc_win32\server_src\directshow_video_server\Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\..\..\pc_win32\server_src\directshow_video_server\Debug/directshow_video_server.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="../../,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft DirectX SDK (August 2006)\Include" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\..\..\pc_win32\server_src\directshow_video_server\Debug/directshow_video_server.pch" - AssemblerListingLocation=".\..\..\pc_win32\server_src\directshow_video_server\Debug/" - ObjectFile=".\..\..\pc_win32\server_src\directshow_video_server\Debug/" - ProgramDataBaseFileName=".\..\..\pc_win32\server_src\directshow_video_server\Debug/" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib ole32.lib user32.lib" - OutputFile=".\..\..\pc_win32\server_src\directshow_video_server\Debug/directshow_video_server.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib";"$(SYSTEMDRIVE)\Program Files\Microsoft DirectX SDK (August 2006)\Lib"" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\..\..\pc_win32\server_src\directshow_video_server\Debug/directshow_video_server.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\..\..\pc_win32\server_src\directshow_video_server\Debug/directshow_video_server.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\..\..\pc_win32\server_src\directshow_video_server\Release" - IntermediateDirectory=".\..\..\pc_win32\server_src\directshow_video_server\Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\..\..\pc_win32\server_src\directshow_video_server\Release/directshow_video_server.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="../../,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft DirectX SDK (August 2006)\Include" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\..\..\pc_win32\server_src\directshow_video_server\Release/directshow_video_server.pch" - AssemblerListingLocation=".\..\..\pc_win32\server_src\directshow_video_server\Release/" - ObjectFile=".\..\..\pc_win32\server_src\directshow_video_server\Release/" - ProgramDataBaseFileName=".\..\..\pc_win32\server_src\directshow_video_server\Release/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib ole32.lib user32.lib" - OutputFile=".\..\..\pc_win32\server_src\directshow_video_server\Release/directshow_video_server.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib";"$(SYSTEMDRIVE)\Program Files\Microsoft DirectX SDK (August 2006)\Lib"" - ProgramDatabaseFile=".\..\..\pc_win32\server_src\directshow_video_server\Release/directshow_video_server.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\..\..\pc_win32\server_src\directshow_video_server\Release/directshow_video_server.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="directx_camera_server.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="directx_video_imager_server.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - <File - RelativePath="directx_camera_server.h" - > - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/directshow_video_server/directx_camera_server.cpp b/src/vrpn/server_src/directshow_video_server/directx_camera_server.cpp deleted file mode 100644 index 62b8cf93250cefe029e406f9c7f3fcb2b7386bf1..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directshow_video_server/directx_camera_server.cpp +++ /dev/null @@ -1,825 +0,0 @@ -#include <vrpn_Configure.h> - -#include "directx_camera_server.h" -#include <string.h> -#include <stdlib.h> -#include <stdio.h> -#include <vrpn_BaseClass.h> - -// Libraries we need to link with to use what we're using. -#if defined(_MSC_VER) && !defined(VRPN_USING_CMAKE) -#pragma comment(lib,"strmiids.lib") -#endif - -//#define DEBUG - -//----------------------------------------------------------------------- -// Helper functions for editing the filter graph: - -static HRESULT GetPin(IBaseFilter *pFilter, PIN_DIRECTION PinDir, IPin **ppPin) -{ - IEnumPins *pEnum; - IPin *pPin; - pFilter->EnumPins(&pEnum); - while(pEnum->Next(1, &pPin, 0) == S_OK) - { - PIN_DIRECTION PinDirThis; - pPin->QueryDirection(&PinDirThis); - if (PinDir == PinDirThis) - { - pEnum->Release(); - *ppPin = pPin; - return S_OK; - } - pPin->Release(); - } - pEnum->Release(); - return E_FAIL; -} - -static HRESULT ConnectTwoFilters(IGraphBuilder *pGraph, IBaseFilter *pFirst, IBaseFilter *pSecond) -{ - IPin *pOut = NULL, *pIn = NULL; - HRESULT hr = GetPin(pFirst, PINDIR_OUTPUT, &pOut); - if (FAILED(hr)) return hr; - hr = GetPin(pSecond, PINDIR_INPUT, &pIn); - if (FAILED(hr)) - { - pOut->Release(); - return E_FAIL; - } - hr = pGraph->Connect(pOut, pIn); - pIn->Release(); - pOut->Release(); - return hr; -} - - -//----------------------------------------------------------------------- - -/** The first time we are called, start the filter graph running in continuous - mode and grab the first image that comes out. Later times, grab each new - image as it comes. The "mode" parameter tells what mode we are in: - Mode 0 = Run() - Mode 1 = Pause() - */ -bool directx_camera_server::read_one_frame(unsigned minX, unsigned maxX, - unsigned minY, unsigned maxY, - unsigned exposure_millisecs) -{ - HRESULT hr; - - if (!_status) { return false; }; - - // If we have not yet started the media graph running, set up the callback - // handler for the sample grabber filter so that we will hear about each frame - // as it comes in. Then set the filter graph running. - if (!_started_graph) { - // Set the grabber do not do one-shot mode because that would cause - // it to stop the filter graph after a single frame is captured. - _pGrabber->SetOneShot(FALSE); - - // Set the grabber to not do buffering mode, because we've not implemented - // the handler for buffered callbacks. - _pGrabber->SetBufferSamples(FALSE); - - // Run the graph and wait until it captures a frame into its buffer - switch (_mode) { - case 0: // Case 0 = run - hr = _pMediaControl->Run(); - break; - case 1: // Case 1 = paused - hr = _pMediaControl->Pause(); - break; - default: - fprintf(stderr, "directx_camera_server::read_one_frame(): Unknown mode (%d)\n", _mode); - _status = false; - return false; - } - if ( (hr != S_OK) && (hr != S_FALSE) ){ - fprintf(stderr,"directx_camera_server::read_one_frame(): Can't run filter graph\n"); - _status = false; - return false; - } - - _started_graph = true; - } - - //XXX Should the app set the timeout period? - - // Wait until there is a sample ready in the callback handler. If there is, - // copy it into our buffer and then tell it we are done processing the sample. - // If it takes too long, time out. - const int TIMEOUT_MSECS = 250; - BYTE *imageLocation; - if (!_pCallback->imageReady) { - for (int i = 0; i < TIMEOUT_MSECS; i++) { - vrpn_SleepMsecs(1); - if (_pCallback->imageReady) { break; } // Break out of the wait if its ready - } - if (!_pCallback->imageReady) { -#ifdef DEBUG - fprintf(stderr,"directx_camera_server::read_one_frame(): Timeout when reading image\n"); -#endif - return false; - } - } - - // If we are in mode 2, then we pause the graph after we captured one image. - if (_mode == 2) { - _pMediaControl->Pause(); - _mode = 1; - } - - if (_pCallback->imageReady) { - _pCallback->imageReady = false; - if (FAILED(_pCallback->imageSample->GetPointer(&imageLocation))) { - fprintf(stderr,"directx_camera_server::read_one_frame(): Can't get buffer\n"); - _status = false; - _pCallback->imageDone = true; - return false; - } - // Step through each line of the video and copy it into the buffer. We - // do one line at a time here because there can be padding at the end of - // each line on some video formats. - for (DWORD iRow = 0; iRow < _num_rows; iRow++) { - memcpy(_buffer+_num_columns*3*iRow, imageLocation+_stride*iRow, _num_columns*3); - } - _pCallback->imageDone = true; - } - - // Capture timing information and print out how many frames per second - // are being received. - - { static struct timeval last_print_time; - struct timeval now; - static bool first_time = true; - static int frame_count = 0; - - if (first_time) { - vrpn_gettimeofday(&last_print_time, NULL); - first_time = false; - } else { - static unsigned last_r = 10000; - frame_count++; - vrpn_gettimeofday(&now, NULL); - double timesecs = 0.001 * vrpn_TimevalMsecs(vrpn_TimevalDiff(now, last_print_time)); - if (timesecs >= 5) { - double frames_per_sec = frame_count / timesecs; - frame_count = 0; - printf("Received frames per second = %lg\n", frames_per_sec); - last_print_time = now; - } - } - } - - return true; -} - -//--------------------------------------------------------------------- -// Open the camera specified and determine its available features and parameters. - -bool directx_camera_server::open_and_find_parameters(const int which, unsigned width, unsigned height) -{ - HRESULT hr; - - //------------------------------------------------------------------- - // Create COM and DirectX objects needed to access a video stream. - - // Initialize COM. This must have a matching uninitialize somewhere before - // the object is destroyed. -#ifdef DEBUG - printf("directx_camera_server::open_and_find_parameters(): Before CoInitialize\n"); -#endif - CoInitialize(NULL); - - // Create the filter graph manager -#ifdef DEBUG - printf("directx_camera_server::open_and_find_parameters(): Before CoCreateInstance FilterGraph\n"); -#endif - CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, - IID_IGraphBuilder, (void **)&_pGraph); - if (_pGraph == NULL) { - fprintf(stderr, "directx_camera_server::open_and_find_parameters(): Can't create graph manager\n"); - return false; - } - _pGraph->QueryInterface(IID_IMediaControl, (void **)&_pMediaControl); - _pGraph->QueryInterface(IID_IMediaEvent, (void **)&_pEvent); - - // Create the Capture Graph Builder. -#ifdef DEBUG - printf("directx_camera_server::open_and_find_parameters(): Before CoCreateInstance CaptureGraphBuilder2\n"); -#endif - CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC, - IID_ICaptureGraphBuilder2, (void **)&_pBuilder); - if (_pBuilder == NULL) { - fprintf(stderr, "directx_camera_server::open_and_find_parameters(): Can't create graph builder\n"); - return false; - } - - // Associate the graph with the builder. -#ifdef DEBUG - printf("directx_camera_server::open_and_find_parameters(): Before SetFilterGraph\n"); -#endif - _pBuilder->SetFiltergraph(_pGraph); - - //------------------------------------------------------------------- - // Go find a video device to use: in this case, we are using the Nth - // one we find, where the number N is the "which" parameter. - - // Create the system device enumerator. -#ifdef DEBUG - printf("directx_camera_server::open_and_find_parameters(): Before CoCreateInstance SystemDeviceEnum\n"); -#endif - ICreateDevEnum *pDevEnum = NULL; - CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC, - IID_ICreateDevEnum, (void **)&pDevEnum); - if (pDevEnum == NULL) { - fprintf(stderr, "directx_camera_server::open_and_find_parameters(): Can't create device enumerator\n"); - return false; - } - - // Create an enumerator for video capture devices. -#ifdef DEBUG - printf("directx_camera_server::open_and_find_parameters(): Before CreateClassEnumerator\n"); -#endif - IEnumMoniker *pClassEnum = NULL; - pDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pClassEnum, 0); - if (pClassEnum == NULL) { - fprintf(stderr, "directx_camera_server::open_and_find_parameters(): Can't create video enumerator (no cameras?)\n"); - pDevEnum->Release(); - return false; - } - -#ifdef DEBUG - printf("directx_camera_server::open_and_find_parameters(): Before Loop over enumerators\n"); -#endif - ULONG cFetched; - IMoniker *pMoniker = NULL; - IBaseFilter *pSrc = NULL; - // Skip (which - 1) cameras - int i; - for (i = 0; i < which-1 ; i++) { - if (pClassEnum->Next(1, &pMoniker, &cFetched) != S_OK) { - fprintf(stderr,"directx_camera_server::open_and_find_parameters(): Can't open camera (not enough cameras)\n"); - pMoniker->Release(); - return false; - } - } - // Take the next camera and bind it - if (pClassEnum->Next(1, &pMoniker, &cFetched) == S_OK) { - // Bind the first moniker to a filter object. - pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)&pSrc); - pMoniker->Release(); - } else { - fprintf(stderr,"directx_camera_server::open_and_find_parameters(): Can't open camera (not enough cameras)\n"); - pMoniker->Release(); - return false; - } - - pClassEnum->Release(); - pDevEnum->Release(); - - //------------------------------------------------------------------- - // Construct the sample grabber callback handler that will be used - // to receive image data from the sample grabber. - if ( (_pCallback = new directx_samplegrabber_callback()) == NULL) { - fprintf(stderr,"directx_camera_server::open_and_find_parameters(): Can't create sample grabber callback handler (out of memory?)\n"); - return false; - } - - //------------------------------------------------------------------- - // Construct the sample grabber that will be used to snatch images from - // the video stream as they go by. Set its media type and callback. - - // Create the Sample Grabber. -#ifdef DEBUG - printf("directx_camera_server::open_and_find_parameters(): Before CoCreateInstance SampleGrabber\n"); -#endif - CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, - IID_IBaseFilter, reinterpret_cast<void**>(&_pSampleGrabberFilter)); - if (_pSampleGrabberFilter == NULL) { - fprintf(stderr,"directx_camera_server::open_and_find_parameters(): Can't get SampleGrabber filter (not DirectX 8.1+?)\n"); - return false; - } -#ifdef DEBUG - printf("directx_camera_server::open_and_find_parameters(): Before QueryInterface\n"); -#endif - _pSampleGrabberFilter->QueryInterface(IID_ISampleGrabber, - reinterpret_cast<void**>(&_pGrabber)); - - // Set the media type to video -#ifdef DEBUG - printf("directx_camera_server::open_and_find_parameters(): Before SetMediaType\n"); -#endif - AM_MEDIA_TYPE mt; - // Ask for video media producers that produce 8-bit RGB - ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE)); - mt.majortype = MEDIATYPE_Video; // Ask for video media producers - mt.subtype = MEDIASUBTYPE_RGB24; // Ask for 8 bit RGB - _pGrabber->SetMediaType(&mt); - - //------------------------------------------------------------------- - // Ask for the video resolution that has been passed in. - // This code is based on - // intuiting that we need to use the SetFormat call on the IAMStreamConfig - // interface; this interface is described in the help pages. - // If the width and height are specified as 0, then they are not set - // in the header, letting them use whatever is the default. - if ( (width != 0) && (height != 0) ) { - _pBuilder->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pSrc, - IID_IAMStreamConfig, (void **)&_pStreamConfig); - if (_pStreamConfig == NULL) { - fprintf(stderr,"directx_camera_server::open_and_find_parameters(): Can't get StreamConfig interface\n"); - return false; - } - - ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE)); - mt.majortype = MEDIATYPE_Video; // Ask for video media producers - mt.subtype = MEDIASUBTYPE_RGB24; // Ask for 8 bit RGB - mt.pbFormat = (BYTE*)CoTaskMemAlloc(sizeof(VIDEOINFOHEADER)); - VIDEOINFOHEADER *pVideoHeader = (VIDEOINFOHEADER*)mt.pbFormat; - ZeroMemory(pVideoHeader, sizeof(VIDEOINFOHEADER)); - pVideoHeader->bmiHeader.biBitCount = 24; - pVideoHeader->bmiHeader.biWidth = width; - pVideoHeader->bmiHeader.biHeight = height; - pVideoHeader->bmiHeader.biPlanes = 1; - pVideoHeader->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pVideoHeader->bmiHeader.biSizeImage = DIBSIZE(pVideoHeader->bmiHeader); - - // Set the format type and size. - mt.formattype = FORMAT_VideoInfo; - mt.cbFormat = sizeof(VIDEOINFOHEADER); - - // Set the sample size. - mt.bFixedSizeSamples = TRUE; - mt.lSampleSize = DIBSIZE(pVideoHeader->bmiHeader); - - // Make the call to actually set the video type to what we want. - if (_pStreamConfig->SetFormat(&mt) != S_OK) { - fprintf(stderr,"directx_camera_server::open_and_find_parameters(): Can't set resolution to %dx%d\n", - pVideoHeader->bmiHeader.biWidth, pVideoHeader->bmiHeader.biHeight); - return false; - } - - // Clean up the pbFormat header memory we allocated above. - CoTaskMemFree(mt.pbFormat); - } - - //------------------------------------------------------------------- - // Create a NULL renderer that will be used to discard the video frames - // on the output pin of the sample grabber - -#ifdef DEBUG - printf("directx_camera_server::open_and_find_parameters(): Before CoCreateInstance NullRenderer\n"); -#endif - IBaseFilter *pNull = NULL; - CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER, - IID_IBaseFilter, reinterpret_cast<void**>(&pNull)); - - //------------------------------------------------------------------- - // Build the filter graph. First add the filters and then connect them. - - // pSrc is the capture filter for the video device we found above. - _pGraph->AddFilter(pSrc, L"Video Capture"); - - // Add the sample grabber filter - _pGraph->AddFilter(_pSampleGrabberFilter, L"SampleGrabber"); - - // Add the null renderer filter - _pGraph->AddFilter(pNull, L"NullRenderer"); - - // Connect the output of the video reader to the sample grabber input - ConnectTwoFilters(_pGraph, pSrc, _pSampleGrabberFilter); - - // Connect the output of the sample grabber to the NULL renderer input - ConnectTwoFilters(_pGraph, _pSampleGrabberFilter, pNull); - - //------------------------------------------------------------------- - // XXX See if this is a video tuner card by querying for that interface. - // Set it to read the video channel if it is one. - IAMTVTuner *pTuner = NULL; - hr = _pBuilder->FindInterface(NULL, NULL, pSrc, IID_IAMTVTuner, (void**)&pTuner); - if (pTuner != NULL) { -#ifdef DEBUG - printf("directx_camera_server::open_and_find_parameters(): Found a TV Tuner!\n"); -#endif - - //XXX Put code here. - // Set the first input pin to use the cable as input - hr = pTuner->put_InputType(0, TunerInputCable); - if (FAILED(hr)) { - fprintf(stderr,"directx_camera_server::open_and_find_parameters(): Can't set input to cable\n"); - } - - // Set the channel on the video to be baseband (is this channel zero?) - hr = pTuner->put_Channel(0, -1, -1); - if (FAILED(hr)) { - fprintf(stderr,"directx_camera_server::open_and_find_parameters(): Can't set channel\n"); - } - - pTuner->Release(); - } - - - //------------------------------------------------------------------- - // Find _num_rows and _num_columns in the video stream. - _pGrabber->GetConnectedMediaType(&mt); - VIDEOINFOHEADER *pVih; - if (mt.formattype == FORMAT_VideoInfo) { - pVih = reinterpret_cast<VIDEOINFOHEADER*>(mt.pbFormat); - } else { - fprintf(stderr,"directx_camera_server::open_and_find_parameters(): Can't get video header type\n"); - return false; - } - - // Number of rows and columns. This is different if we are using a target - // rectangle (rcTarget) than if we are not. - if (IsRectEmpty(&pVih->rcTarget)) { - _num_columns = pVih->bmiHeader.biWidth; - _num_rows = pVih->bmiHeader.biHeight; - } else { - _num_columns = pVih->rcTarget.right; - _num_rows = pVih->bmiHeader.biHeight; - printf("XXX directx_camera_server::open_and_find_parameters(): Warning: may not work correctly with target rectangle\n"); - } - _minX = 0; - _maxX = _num_columns - 1; - _minY = 0; - _maxY = _num_rows - 1; -#ifdef DEBUG - printf("Got %dx%d video\n", _num_columns, _num_rows); -#endif - - // Make sure that the image is not compressed and that we have 8 bits - // per pixel. - if (pVih->bmiHeader.biCompression != BI_RGB) { - fprintf(stderr,"directx_camera_server::open_and_find_parameters(): Compression not RGB\n"); - switch (pVih->bmiHeader.biCompression) { - case BI_RLE8: - fprintf(stderr," (It is BI_RLE8)\n"); - break; - case BI_RLE4: - fprintf(stderr," (It is BI_RLE4)\n"); - case BI_BITFIELDS: - fprintf(stderr," (It is BI_BITFIELDS)\n"); - break; - default: - fprintf(stderr," (Unknown compression type)\n"); - } - return false; - } - int BytesPerPixel = pVih->bmiHeader.biBitCount / 8; - if (BytesPerPixel != 3) { - fprintf(stderr,"directx_camera_server::open_and_find_parameters(): Not 3 bytes per pixel (%d)\n", - pVih->bmiHeader.biBitCount); - return false; - } - - // A negative height indicates that the images are stored non-inverted in Y - // Not sure what to do with images that have negative height -- need to - // read the book some more to find out. - if (_num_rows < 0) { - fprintf(stderr,"directx_camera_server::open_and_find_parameters(): Num Rows is negative (internal error)\n"); - return false; - } - - // Find the stride to take when moving from one row of video to the - // next. This is rounded up to the nearest DWORD. - _stride = (_num_columns * BytesPerPixel + 3) & ~3; - - // Set the callback, where '0' means 'use the SampleCB callback' - _pGrabber->SetCallback(_pCallback, 0); - - //------------------------------------------------------------------- - // Release resources that won't be used later and return - pSrc->Release(); - pNull->Release(); - return true; -} - -/// Construct but do not open a camera -directx_camera_server::directx_camera_server() : - _pGraph(NULL), - _pBuilder(NULL), - _pMediaControl(NULL), - _pEvent(NULL), - _pSampleGrabberFilter(NULL), - _pGrabber(NULL), - _pStreamConfig(NULL), - _pCallback(NULL), - _started_graph(false), - _mode(0), - _buffer(NULL) -{ - // No image in memory yet. - _minX = _maxX = _minY = _maxY = 0; -} - -/// Open nth available camera with specified resolution. -directx_camera_server::directx_camera_server(int which, unsigned width, unsigned height) : - _pGraph(NULL), - _pBuilder(NULL), - _pMediaControl(NULL), - _pEvent(NULL), - _pSampleGrabberFilter(NULL), - _pGrabber(NULL), - _pStreamConfig(NULL), - _pCallback(NULL), - _started_graph(false), - _mode(0), - _buffer(NULL) -{ - //--------------------------------------------------------------------- - if (!open_and_find_parameters(which, width, height)) { - fprintf(stderr, "directx_camera_server::directx_camera_server(): Cannot open camera\n"); - _status = false; - return; - } - - //--------------------------------------------------------------------- - // Allocate a buffer that is large enough to read the maximum-sized - // image with no binning. - _buflen = (unsigned)(_num_rows * _num_columns * 3); // Expect B,G,R; 8-bits each. - if ( (_buffer = new unsigned char[_buflen]) == NULL) { - fprintf(stderr,"directx_camera_server::directx_camera_server(): Out of memory for buffer\n"); - _status = false; - return; - } - // No image in memory yet. - _minX = _maxX = _minY = _maxY = 0; - - _status = true; -} - -//--------------------------------------------------------------------- -// Close the camera and the system. Free up memory. - -void directx_camera_server::close_device(void) -{ - // Clean up. - if (_pGrabber) { _pGrabber->Release(); }; - if (_pSampleGrabberFilter) { _pSampleGrabberFilter->Release(); }; - if (_pStreamConfig) { _pStreamConfig->Release(); }; - if (_pEvent) { _pEvent->Release(); }; - if (_pMediaControl) { _pMediaControl->Release(); }; - if (_pBuilder) { _pBuilder->Release(); }; - if (_pGraph) { _pGraph->Release(); }; - CoUninitialize(); -} - -directx_camera_server::~directx_camera_server(void) -{ - // Get the callback device to immediately return all samples - // it has queued up, then shut down the filter graph. - _pCallback->shutdown(); - close_device(); - - if (_buffer != NULL) { delete [] _buffer; } - - // Delete the callback object, so that it can clean up and - // make sure all of its threads exit. - delete _pCallback; -} - -bool directx_camera_server::read_image_to_memory(unsigned minX, unsigned maxX, unsigned minY, unsigned maxY, - double exposure_millisecs) -{ - if (!_status) { return false; }; - - //--------------------------------------------------------------------- - // In case we fail, clear these - _minX = _minY = _maxX = _maxY = 0; - - //--------------------------------------------------------------------- - // If the maxes are greater than the mins, set them to the size of - // the image. - if (maxX < minX) { - minX = 0; maxX = _num_columns - 1; - } - if (maxY < minY) { - minY = 0; maxY = _num_rows - 1; - } - - //--------------------------------------------------------------------- - // Clip collection range to the size of the sensor on the camera. - if (minX < 0) { minX = 0; }; - if (minY < 0) { minY = 0; }; - if (maxX >= _num_columns) { maxX = _num_columns - 1; }; - if (maxY >= _num_rows) { maxY = _num_rows - 1; }; - - //--------------------------------------------------------------------- - // Store image size for later use - _minX = minX; _minY = minY; _maxX = maxX; _maxY = maxY; - - //--------------------------------------------------------------------- - // Set up and read one frame, if we can. - if (!read_one_frame(_minX, _maxX, _minY, _maxY, (int)exposure_millisecs)) { - return false; - } - - return true; -} - -bool directx_camera_server::write_memory_to_ppm_file(const char *filename, bool sixteen_bits) const -{ - // XXX This will depend on what kind of pixels we have! - - if (!_status) { return false; }; - - //--------------------------------------------------------------------- - // Make sure the region is non-zero (so we've read an image) - if ( (_maxX <= _minX) || (_maxY <= _minY) ) { - fprintf(stderr,"directx_camera_server::write_memory_to_ppm_file(): No image in memory\n"); - return false; - } - - //--------------------------------------------------------------------- - // If we've collected only a subset of the image, this version of the code - // won't work. - if ( (_minX != 0) || (_maxX != _num_columns-1) || (_minY != 0) || (_maxY != _num_rows-1) ) { - fprintf(stderr, "directx_camera_server::write_memory_to_ppm_file(): Can't write subset (not implemented)\n"); - return false; - } - - //--------------------------------------------------------------------- - // Swap the red and blue values for each triplet in the buffer, since - // the DirectShow order is BGR and the PPM order is RGB. - unsigned char *bufrgb = new unsigned char[_buflen]; - if (bufrgb == NULL) { - fprintf(stderr,"directx_camera_server::write_memory_to_ppm_file(): Out of memory\n"); - return false; - } - unsigned X,Y; - unsigned cols = (_maxX - _minX) + 1; - for (Y = _minY; Y < _maxY; Y++) { - for (X = _minX; X < _maxX; X++) { - bufrgb[ (Y*cols + X) * 3 + 0 ] = _buffer[ (Y*cols + X) * 3 + 2 ]; - bufrgb[ (Y*cols + X) * 3 + 1 ] = _buffer[ (Y*cols + X) * 3 + 1 ]; - bufrgb[ (Y*cols + X) * 3 + 2 ] = _buffer[ (Y*cols + X) * 3 + 0 ]; - } - } - - //--------------------------------------------------------------------- - // Write out an uncompressed RGB PPM file. We ignore the "16bits" request - // because we don't have 16 bits to put in there! - if (sixteen_bits) { - fprintf(stderr, "directx_camera_server::write_memory_to_ppm_file(): 16 bits requested, ignoring\n"); - } - FILE *of = fopen(filename, "wb"); - if (of == NULL) { - fprintf(stderr, "directx_camera_server::write_memory_to_ppm_file(): Can't open %s for write\n", filename); - return false; - } - if (fprintf(of, "P6\n%d %d\n%d\n", _num_columns, _num_rows, 255) < 0) { - fprintf(stderr, "directx_camera_server::write_memory_to_ppm_file(): Can't write header to %s\n", filename); - return false; - } - if (fwrite(bufrgb, 1, _buflen, of) != _buflen) { - fprintf(stderr, "directx_camera_server::write_memory_to_ppm_file(): Can't write data to %s\n", filename); - return false; - } - fclose(of); - delete [] bufrgb; - - return true; -} - -bool directx_camera_server::get_pixel_from_memory(unsigned X, unsigned Y, vrpn_uint8 &val, int RGB) const -{ - if (!_status) { return false; }; - - // Switch red and blue, since they are backwards in the record (blue is first). - RGB = 2 - RGB; - - // XXX This will depend on what kind of pixels we have! - if ( (_maxX <= _minX) || (_maxY <= _minY) ) { - fprintf(stderr,"directx_camera_server::get_pixel_from_memory(): No image in memory\n"); - return false; - } - if ( (X < _minX) || (X > _maxX) || (Y < _minY) || (Y > _maxY) ) { - return false; - } - unsigned cols = _num_columns; - val = _buffer[ (Y*cols + X) * 3 + RGB ]; - return true; -} - -bool directx_camera_server::get_pixel_from_memory(unsigned X, unsigned Y, vrpn_uint16 &val, int RGB) const -{ - if (!_status) { return false; }; - - // Switch red and blue, since they are backwards in the record (blue is first). - RGB = 2 - RGB; - - // XXX This will depend on what kind of pixels we have! - if ( (_maxX <= _minX) || (_maxY <= _minY) ) { - fprintf(stderr,"directx_camera_server::get_pixel_from_memory(): No image in memory\n"); - return false; - } - if ( (X < _minX) || (X > _maxX) || (Y < _minY) || (Y > _maxY) ) { - return false; - } - unsigned cols = _num_columns; - val = _buffer[ (Y*cols + X) * 3 + RGB ]; - return true; -} - -bool directx_camera_server::send_vrpn_image(vrpn_Imager_Server* svr,vrpn_Connection* svrcon,double g_exposure,int svrchan, int num_chans) const -{ - unsigned y; - - // Send the current frame over to the client in chunks as big as possible (limited by vrpn_IMAGER_MAX_REGION). - int nRowsPerRegion=vrpn_IMAGER_MAX_REGIONu8/_num_columns; - svr->send_begin_frame(0, _num_columns-1, 0, _num_rows-1); - for(y=0; y<_num_rows; y+=nRowsPerRegion) { - svr->send_region_using_base_pointer(svrchan,0,_num_columns-1,y,__min(_num_rows,y+nRowsPerRegion)-1, - _buffer+2 /* Send the red channel */, 3, 3*_num_columns, _num_rows, true); - svr->mainloop(); - } - if (num_chans >= 2) { - for(y=0; y<_num_rows; y+=nRowsPerRegion) { - svr->send_region_using_base_pointer(svrchan+1,0,_num_columns-1,y,__min(_num_rows,y+nRowsPerRegion)-1, - _buffer+1 /* Send the green channel */, 3, 3*_num_columns, _num_rows, true); - svr->mainloop(); - } - } - if (num_chans >= 3) { - for(y=0; y<_num_rows; y+=nRowsPerRegion) { - svr->send_region_using_base_pointer(svrchan+2,0,_num_columns-1,y,__min(_num_rows,y+nRowsPerRegion)-1, - _buffer+0 /* Send the blue channel */, 3, 3*_num_columns, _num_rows, true); - svr->mainloop(); - } - } - svr->send_end_frame(0, _num_columns-1, 0, _num_rows-1); - svr->mainloop(); - - // Mainloop the server connection (once per server mainloop, not once per object). - svrcon->mainloop(); - return true; -} - -//-------------------------------------------------------------------------------------------- -// This section implements the callback handler that gets frames from the -// SampleGrabber filter. - -directx_samplegrabber_callback::directx_samplegrabber_callback(void) : - imageReady(false), - imageDone(false), - imageSample(NULL), - _stayAlive(true) -{ -} - -directx_samplegrabber_callback::~directx_samplegrabber_callback(void) -{ - // Make sure the other thread knows that it is okay to return the - // buffer and wait until it has had time to do so. - _stayAlive = false; Sleep(100); -}; - -HRESULT directx_samplegrabber_callback::QueryInterface(REFIID interfaceRequested, void **handleToInterfaceRequested) -{ - if (handleToInterfaceRequested == NULL) { return E_POINTER; } - if (interfaceRequested == IID_IUnknown) { - *handleToInterfaceRequested = static_cast<IUnknown *>(this); - } else if (interfaceRequested == IID_ISampleGrabberCB) { - *handleToInterfaceRequested = static_cast<ISampleGrabberCB *>(this); - } else { - return E_NOINTERFACE; - } - AddRef(); - return S_OK; -} - -// This is the routine that processes each sample. It gets the information about -// the sample (one frame) from the SampleGrabber, then marks itself as being ready -// to process the sample. It then blocks until the sample has been processed by -// the associated camera server. -// The hand-off is handled by using two booleans acting as semaphores. -// The first semaphore (imageReady) -// controls access to the callback handler's buffer so that the application thread -// will only read it when it is full. The second sempaphore (imageDone) controls when -// the handler routine can release a sample; it makes sure that the sample is not -// released before the application thread is done processing it. -// The directx camera must be sure to free an open sample (if any) after changing -// the state of the filter graph, so that this doesn't block indefinitely. This means -// that the destructor for any object using this callback object has to destroy -// this object. The destructor sets _stayAlive to false to make sure this thread terminates. - -HRESULT directx_samplegrabber_callback::SampleCB(double time, IMediaSample *sample) -{ - // Point the image sample to the media sample we have and then set the flag - // to tell the application it can process it. - imageSample = sample; - imageReady = true; - - // Wait until the image has been processed and then return the buffer to the - // filter graph - while (!imageDone && _stayAlive) { vrpn_SleepMsecs(1); } - if (_stayAlive) { - imageDone = false; - } - - return S_OK; -} diff --git a/src/vrpn/server_src/directshow_video_server/directx_camera_server.h b/src/vrpn/server_src/directshow_video_server/directx_camera_server.h deleted file mode 100644 index 2f96294513a760e027df9242825f5145ecb12c3c..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directshow_video_server/directx_camera_server.h +++ /dev/null @@ -1,174 +0,0 @@ -#ifndef DIRECTX_CAMERA_SERVER_H -#define DIRECTX_CAMERA_SERVER_H - -#include "vrpn_Configure.h" - -#ifdef VRPN_USE_DIRECTSHOW - - -#include "vrpn_Shared.h" -#include <stdio.h> -#include <math.h> - -// Horrible hack to get around missing file in Platform SDK -#pragma include_alias( "dxtrans.h", "qedit.h" ) -#define __IDxtCompositor_INTERFACE_DEFINED__ -#define __IDxtAlphaSetter_INTERFACE_DEFINED__ -#define __IDxtJpeg_INTERFACE_DEFINED__ -#define __IDxtKey_INTERFACE_DEFINED__ - -// Include files for DirectShow video input -#include <dshow.h> -#include <qedit.h> - -#include <vrpn_Imager.h> - -// This code (and the code in the derived videofile server) is -// based on information the book "Programming Microsoft DirectShow -// for Digital Video and Television", Mark D. Pesce. Microsoft Press. -// ISBN 0-7356-1821-6. This book was required reading for me to -// understand how the filter graphs run, how to control replay rate, -// and how to reliably grab all of the samples from a stream. -// The chapter on using the Sample Grabber Filter -// (ch. 11) was particularly relevant. Note that I did not break the seal -// on the enclosed disk, which would require me to agree to licensing terms -// that include me not providing anyone with copies of my modified versions -// of the sample code in source-code format. Instead, I used the information -// gained in the reading of the book to write by hand my own version of this -// code. What a sick world we live in when example code can't be freely -// shared. - -// The Microsoft Platform SDK must be installed on your machine -// to make this work; this code makes use of the BaseClasses library and -// other parts of the library. - -class directx_samplegrabber_callback; //< Forward declaration - -class directx_camera_server { -public: - /// Open the nth available camera - directx_camera_server(int which, unsigned width = 320, unsigned height = 240); - virtual ~directx_camera_server(void); - virtual void close_device(void); - - /// Return the number of colors that the device has - virtual unsigned get_num_colors() const { return 3; }; - - /// Read an image to a memory buffer. Max < min means "whole range" - virtual bool read_image_to_memory(unsigned minX = 255, unsigned maxX = 0, - unsigned minY = 255, unsigned maxY = 0, - double exposure_millisecs = 250.0); - - /// Get pixels out of the memory buffer, RGB indexes the colors - virtual bool get_pixel_from_memory(unsigned X, unsigned Y, vrpn_uint8 &val, int RGB = 0) const; - virtual bool get_pixel_from_memory(unsigned X, unsigned Y, vrpn_uint16 &val, int RGB = 0) const; - - /// Store the memory image to a PPM file. - virtual bool write_memory_to_ppm_file(const char *filename, bool sixteen_bits = false) const; - - /// Send in-memory image over a vrpn connection - virtual bool send_vrpn_image(vrpn_Imager_Server* svr,vrpn_Connection* svrcon,double g_exposure,int svrchan, int num_chans = 1) const; - - /// Is the camera working properly? - bool working(void) const { return _status; }; - - // Tell what the range is for the image. - virtual void read_range(int &minx, int &maxx, int &miny, int &maxy) const { - minx = _minX; miny = _minY; maxx = _maxX; maxy = _maxY; - } - - virtual unsigned get_num_rows(void) const { - return _num_rows; - } - virtual unsigned get_num_columns(void) const { - return _num_columns; - } - -protected: - /// Construct but do not open camera (used by derived classes) - directx_camera_server(); - - // Objects needed for DirectShow video input. - IGraphBuilder *_pGraph; // Constructs a DirectShow filter graph - ICaptureGraphBuilder2 *_pBuilder; // Filter graph builder - IMediaControl *_pMediaControl; // Handles media streaming in the filter graph - IMediaEvent *_pEvent; // Handles filter graph events - IBaseFilter *_pSampleGrabberFilter; // Grabs samples from the media stream - ISampleGrabber *_pGrabber; // Interface for the sample grabber filter - IAMStreamConfig *_pStreamConfig; // Interface to set the video dimensions - - bool _status; //< True is working, false is not - unsigned _num_rows, _num_columns; //< Size of the memory buffer - unsigned _minX, _minY, _maxX, _maxY; //< The region most recently read - - // Memory pointers used to get non-virtual memory - unsigned char *_buffer; //< Buffer for what comes from camera, - size_t _buflen; //< Length of that buffer - bool _started_graph; //< Did we start the filter graph running? - unsigned _mode; //< Mode 0 = running, Mode 1 = paused. - - long _stride; //< How many bytes to skip when going to next line (may be negative for upside-down images) - - // Pointer to the associated sample grabber callback object. - directx_samplegrabber_callback *_pCallback; - - virtual bool open_and_find_parameters(const int which, unsigned width, unsigned height); - virtual bool read_one_frame(unsigned minX, unsigned maxX, - unsigned minY, unsigned maxY, - unsigned exposure_millisecs); -}; - -// This class is used to handle callbacks from the SampleGrabber filter. It -// grabs each sample and holds onto it until the camera server that is associated -// with the object comes and gets it. The callback method in this class is -// called in another thread, so its methods need to be guarded with semaphores. - -class directx_samplegrabber_callback : public ISampleGrabberCB { -public: - directx_samplegrabber_callback(void); - ~directx_samplegrabber_callback(void); - - void shutdown(void) { _stayAlive = false; Sleep(100); } - - // Boolean flag telling whether there is a sample in the image - // buffer ready for the application thread to consume. Set to - // true by the callback when there is an image there, and back - // to false by the application thread when it reads the image. - // XXX This should be done using a semaphore to avoid having - // to poll in the application. - bool imageReady; //< true when there is an image ready to be processed - - // Boolean flag telling whether the app is done processing the image - // buffer so that the callback thread can return it to the filter graph. - // Set to true by the application when it finishes, and back - // to false by the callback thread when it gets a new image. - // XXX This should be done using a semaphore to avoid having - // to poll in the callback thread. - bool imageDone; //< true when the app has finished processing an image - - // A pointer to the image sample that has been passed to the sample - // grabber callback handler. - IMediaSample *imageSample; - - // These three methods must be defined because of the IUnknown parent class. - // XXX The first two are a hack to pretend that we are doing reference counting; - // this object must last longer than the sample grabber it is connected to in - // order to avoid segmentations faults. - STDMETHODIMP_(ULONG) AddRef(void) { return 1; } - STDMETHODIMP_(ULONG) Release(void) { return 2; } - STDMETHOD(QueryInterface)(REFIID interfaceRequested, void **handleToInterfaceRequested); - - // One of the following two methods must be defined do to the ISampleGraberCB - // parent class; this is the way we hear from the grabber. We implement the one that - // gives us unbuffered access. Be sure to turn off buffering in the SampleGrabber - // that is associated with this callback handler. - STDMETHODIMP BufferCB(double, BYTE *, long) { return E_NOTIMPL; } - STDMETHOD(SampleCB)(double time, IMediaSample *sample); - -protected: - BITMAPINFOHEADER _bitmapInfo; //< Describes format of the bitmap - bool _stayAlive; //< Tells all threads to exit -}; - -#endif -#endif diff --git a/src/vrpn/server_src/directshow_video_server/directx_video_imager_server.cpp b/src/vrpn/server_src/directshow_video_server/directx_video_imager_server.cpp deleted file mode 100644 index f3cf85688173ebf479988941eda674a4860a740f..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directshow_video_server/directx_video_imager_server.cpp +++ /dev/null @@ -1,201 +0,0 @@ -#include <math.h> -#include <stdlib.h> -#include <signal.h> -#include <string.h> -#include <stdio.h> -#include <vrpn_Connection.h> -#include <vrpn_Imager.h> -#include "directx_camera_server.h" - -const int MAJOR_VERSION = 3; -const int MINOR_VERSION = 2; - -// sprintf() is okay in our usage. -#ifdef _MSC_VER -#pragma warning( disable : 4995 ) -#endif - -//----------------------------------------------------------------- -// This section contains code to initialize the camera and read its -// values. The server code reads values from the camera and sends -// them over the network. - -directx_camera_server *g_camera; //< The camera we're going to read from -unsigned g_width = 0, g_height = 0; //< Resolution for DirectX cameras, take the default -int g_numchannels = 1; //< How many channels to send (3 for RGB cameras, 1 otherwise) -int g_maxval = 4095; //< Maximum value available in a channel for this device - -/// Open the camera we want to use (the type is based on the name passed in) -bool init_camera_code(const char *type, int which = 1) -{ - if (!strcmp(type, "directx")) { - printf("Opening DirectX Camera %d\n", which); - g_camera = new directx_camera_server(which, g_width, g_height); - g_numchannels = 3; // Send RGB - g_maxval = 255; - printf("Making sure camera is working\n"); - if (!g_camera->working()) { - fprintf(stderr,"init_camera_code(): Can't open DirectX camera server\n"); - return false; - } - } else if (!strcmp(type, "directx640x480")) { - printf("Opening DirectX Camera %d\n", which); - g_camera = new directx_camera_server(which, 640, 480); - g_numchannels = 3; // Send RGB - g_maxval = 255; - printf("Making sure camera is working\n"); - if (!g_camera->working()) { - fprintf(stderr,"init_camera_code(): Can't open DirectX camera server\n"); - return false; - } - } else { - fprintf(stderr,"init_camera_code(): Unknown camera type (%s)\n", type); - return false; - } - - return true; -} - -void teardown_camera_code(void) -{ - if (g_camera) { delete g_camera; }; -} - -//----------------------------------------------------------------- -// This section contains code that does what the server should do - -vrpn_Connection *svrcon; //< Connection for server to talk on -vrpn_Imager_Server *svr; //< Image server to be used to send -int svrchan; //< Server channel index for image data - -bool init_server_code(const char *outgoing_logfile_name) -{ - int port = vrpn_DEFAULT_LISTEN_PORT_NO; - if ( (svrcon = vrpn_create_server_connection(port, NULL, outgoing_logfile_name)) == NULL) { - fprintf(stderr, "Could not open server connection\n"); - return false; - } - if ( (svr = new vrpn_Imager_Server("TestImage", svrcon, - g_camera->get_num_columns(), g_camera->get_num_rows())) == NULL) { - fprintf(stderr, "Could not open Imager Server\n"); - return false; - } - if ( (svrchan = svr->add_channel("red", "unknown", 0, (float)(g_maxval) )) == -1) { - fprintf(stderr, "Could not add channel to server image\n"); - return false; - } - // XXX This relies on VRPN to hand us sequential channel numbers. This might be - // dangerous. - if ( (svr->add_channel("green", "unknown", 0, (float)(g_maxval) )) == -1) { - fprintf(stderr, "Could not add channel to server image\n"); - return false; - } - if ( (svr->add_channel("blue", "unknown", 0, (float)(g_maxval) )) == -1) { - fprintf(stderr, "Could not add channel to server image\n"); - return false; - } - printf("Waiting for video connections on port %d\n", port); - - return true; -} - -void teardown_server_code(void) -{ - if (svr) { delete svr; svr = NULL; }; - if (svrcon) { delete svrcon; svrcon = NULL; }; -} - -//----------------------------------------------------------------- -// g_done gets set when the user presses ^C to exit the program. - -static bool g_done = false; //< Becomes true when time to exit - -// WARNING: On Windows systems, this handler is called in a separate -// thread from the main program (this differs from Unix). To avoid all -// sorts of chaos as the main program continues to handle packets, we -// set a done flag here and let the main program shut down in its own -// thread by calling shutdown() to do all of the stuff we used to do in -// this handler. - -void handle_cntl_c(int) { - g_done = true; -} - -void Usage(const char *s) -{ - fprintf(stderr,"Usage: %s [-res x y] [devicename] [devicenum [logfilename]]]\n",s); - fprintf(stderr," -res: Resolution in x and y (default 320 200)\n"); - fprintf(stderr," devicename: directx or directx640x480 (default is directx)\n"); - fprintf(stderr," devicenum: Which (starting with 1) if there are multiple (default 1)\n"); - fprintf(stderr," logfilename: Name of file to store outgoing log in (default NULL)\n"); - exit(-1); -} - -//----------------------------------------------------------------- -// Mostly just calls the above functions; split into client and -// server parts is done clearly to help people who want to use this -// as example code. You could pull the above functions down into -// the main() program body without trouble (except for the callback -// handler, of course). - -int main(int argc, char *argv[]) -{ - int i, realparams; // How many non-flag command-line arguments - char *devicename = "directx"; // Name of the device to open - int devicenum = 1; // Which, if there are more than one, to open - char *logfilename = NULL; // Outgoing log file name. - - realparams = 0; - for (i = 1; i < argc; i++) { - if (!strncmp(argv[i], "-res", strlen("-res"))) { - if (++i > argc) { Usage(argv[0]); } - g_width = atoi(argv[i]); - if ( (g_width < 1) || (g_width > 1600) ) { - fprintf(stderr,"Invalid width (1-1600 allowed, %f entered)\n", g_width); - exit(-1); - } - if (++i > argc) { Usage(argv[0]); } - g_height = atoi(argv[i]); - if ( (g_height < 1) || (g_height > 1200) ) { - fprintf(stderr,"Invalid height (1-1200 allowed, %f entered)\n", g_height); - exit(-1); - } - } else { - switch (++realparams) { - case 1: - devicename = argv[i]; - break; - case 2: - devicenum = atoi(argv[i]); - break; - case 3: - logfilename = argv[i]; - break; - default: - Usage(argv[0]); - } - } - } - - // Set up handler for all these signals to set done - signal(SIGINT, handle_cntl_c); - - printf("vrpn_DirectShow_Imager_server version %02d.%02d\n", MAJOR_VERSION, MINOR_VERSION); - - if (!init_camera_code(devicename, devicenum)) { return -1; } - printf("Opened camera\n"); - if (!init_server_code(logfilename)) { return -1; } - - while (!g_done) { - g_camera->read_image_to_memory(0,0,0,0,1); - g_camera->send_vrpn_image(svr,svrcon,1.0,svrchan, g_numchannels); - svr->mainloop(); - svrcon->mainloop(); - svrcon->save_log_so_far(); - } - - printf("Deleting camera and connection objects\n"); - teardown_server_code(); - teardown_camera_code(); - return 0; -} diff --git a/src/vrpn/server_src/directx_sound_server/directx_sound_server.dsp b/src/vrpn/server_src/directx_sound_server/directx_sound_server.dsp deleted file mode 100644 index b0c77bb47bef2ca8eadb66bff141c9335b5e963f..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directx_sound_server/directx_sound_server.dsp +++ /dev/null @@ -1,105 +0,0 @@ -# Microsoft Developer Studio Project File - Name="directx_sound_server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=directx_sound_server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "directx_sound_server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "directx_sound_server.mak" CFG="directx_sound_server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "directx_sound_server - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "directx_sound_server - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "directx_sound_server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "directx_sound_server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib dsound.lib DxErr8.lib dxguid.lib ddraw.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib vrpn.lib quat.lib winmm.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBC.lib" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "directx_sound_server - Win32 Release" -# Name "directx_sound_server - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\vrpn_Sound_DX9.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\vrpn_Sound_DX9.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/server_src/directx_sound_server/directx_sound_server.dsw b/src/vrpn/server_src/directx_sound_server/directx_sound_server.dsw deleted file mode 100644 index 3e60d4f373872570d486c5fca0fc18de0ee07973..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directx_sound_server/directx_sound_server.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "directx_sound_server"=.\directx_sound_server.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/vrpn/server_src/directx_sound_server/vrpn_Sound_DX9.cpp b/src/vrpn/server_src/directx_sound_server/vrpn_Sound_DX9.cpp deleted file mode 100644 index 365d278daa84905f25ee150bfd28d2e6f6c37b07..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directx_sound_server/vrpn_Sound_DX9.cpp +++ /dev/null @@ -1,1819 +0,0 @@ -// vrpn_Sound_DX9.cpp -// -// July 2003- Matt McCallus - -/// @todo Requires deprecated DXERR.lib for DXTrace and DXTRACE_ERR -#ifdef _WIN32 - - -#include "vrpn_Sound_DX9.h" -#include <dxerr8.h> -#include <dsound.h> - -#define NUM_SPIN 10000 -#define MAX_NUM_SOUNDS 16 -const int CHAR_BUF_SIZE = 1024; - - -HRESULT Get3DListenerInterface(LPDIRECTSOUND3DLISTENER8 *ppDSListener); - - -// DirectX9 stuff -LPDIRECTSOUND8 m_pDS = NULL; -LPDIRECTSOUNDBUFFER pDSBPrimary = NULL; -LPDIRECTSOUND3DBUFFER g_pDS3DBuffer = NULL; // 3D sound buffers -LPDIRECTSOUND3DLISTENER g_pDSListener = NULL; // 3D listener object -DS3DBUFFER g_dsBufferParams; // 3D buffer properties -DS3DLISTENER g_dsListenerParams; // Listener properties -BOOL g_bDeferSettings = FALSE; -int g_numSounds = 0; -SoundMap g_soundMap[MAX_NUM_SOUNDS]; -Sound g_Sound[MAX_NUM_SOUNDS]; // wrapper for DX9Sound obj - -vrpn_Sound_Server_DX9::vrpn_Sound_Server_DX9(const char * name, - vrpn_Connection * c, - HWND hWin) - : vrpn_Sound_Server(name, c){ - try { - - HRESULT hr; - - for(int i=0; i<MAX_NUM_SOUNDS; i++) - g_Sound[i].m_pSound = NULL; - - // Create IDirectSound using the primary sound device - hr = DirectSoundCreate8( NULL, &m_pDS, NULL ); - - // Set DirectSound coop level - hr = m_pDS->SetCooperativeLevel( hWin, DSSCL_PRIORITY ); - - hr = m_pDS->SetSpeakerConfig( DSSPEAKER_HEADPHONE ); - - // Get the primary buffer - DSBUFFERDESC dsbd; - ZeroMemory( &dsbd, sizeof(DSBUFFERDESC) ); - dsbd.dwSize = sizeof(DSBUFFERDESC); - dsbd.dwFlags = DSBCAPS_CTRL3D | DSBCAPS_PRIMARYBUFFER ; - dsbd.dwBufferBytes = 0; - dsbd.lpwfxFormat = NULL; - - hr = m_pDS->CreateSoundBuffer( &dsbd, &pDSBPrimary, NULL ); - - // Get the 3D Listener Interface - Get3DListenerInterface( &g_pDSListener ); - - WAVEFORMATEX wfx; - ZeroMemory( &wfx, sizeof(WAVEFORMATEX) ); - wfx.wFormatTag = (WORD) WAVE_FORMAT_PCM; - wfx.nChannels = 1; - wfx.nSamplesPerSec = 22050; - wfx.wBitsPerSample = 16; - wfx.nBlockAlign = (WORD) (wfx.wBitsPerSample / 8 * wfx.nChannels); - wfx.nAvgBytesPerSec = (DWORD) (wfx.nSamplesPerSec * wfx.nBlockAlign); - - hr = pDSBPrimary->SetFormat(&wfx); - - pDSBPrimary->Release(); - // Get listener parameters - g_dsListenerParams.dwSize = sizeof(DS3DLISTENER); - g_pDSListener->GetAllParameters( &g_dsListenerParams ); - - // set up the sound map. - g_numSounds = 0; - - for(i=0; i<MAX_NUM_SOUNDS; i++){ - g_soundMap[i].m_iSoundNum = -1; - for(int j=0; j<80; j++) - g_soundMap[i].m_DX9SoundName[j] = '\0'; - } - - } - catch(char* szError) { - // Display the message. - printf("AudioInit() - %s.\n", szError); - send_message("Error initializing sound card.. sound server did not start.",vrpn_TEXT_ERROR,0); - exit(0); - } -} - - - -vrpn_Sound_Server_DX9::~vrpn_Sound_Server_DX9() { - - //release the interfaces.. - SAFE_RELEASE(g_pDSListener); - SAFE_RELEASE(g_pDS3DBuffer); - - for(int i=0; i<MAX_NUM_SOUNDS; i++) - SAFE_DELETE(g_Sound[i].m_pSound); -} - - -void vrpn_Sound_Server_DX9::playSound(vrpn_SoundID id, vrpn_int32 repeat, vrpn_SoundDef soundDef) { - - HRESULT hr; - - if(id<0 || id>g_numSounds){ - send_message("Error: playSound (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - int myid = g_soundMap[id].m_iSoundNum; - g_Sound[myid].repeat = repeat; - - if (myid != -1) { - if(g_Sound[id].m_pSound != NULL){ - - if (repeat == 0) - hr = g_Sound[myid].m_pSound->Play( 0, DSBPLAY_LOOPING , g_Sound[myid].m_pSound->GetBufferVolume() ); - else { - hr = g_Sound[myid].m_pSound->Play( 0, NULL , g_Sound[myid].m_pSound->GetBufferVolume() ); - g_Sound[myid].repeat--; - - } - send_message("Playing sound\n",vrpn_TEXT_NORMAL,0); - } - else send_message("Error: playSound (Sound not loaded)",vrpn_TEXT_WARNING,0); - } - else send_message("Error: playSound (Sound not loaded)",vrpn_TEXT_WARNING,0); -} - - - -void vrpn_Sound_Server_DX9::stopSound(vrpn_SoundID id) { - - float x; - float y; - float z; - GetCurrentOrientation( 0, &x, &y, &z ); - - - if(id<0 || id>g_numSounds){ - send_message("Error: stopSound (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - HRESULT hr; - int myid = g_soundMap[id].m_iSoundNum; - - if ( myid != -1 && g_Sound[myid].m_pSound != NULL ) { - hr = g_Sound[myid].m_pSound->Stop(); - hr = g_Sound[myid].m_pSound->Reset(); - send_message("Stopping sound",vrpn_TEXT_NORMAL,0); - } - else{ - send_message("Invalid sound id",vrpn_TEXT_ERROR,0); - printf("Invalid sound id\n"); - } -} - - - -void vrpn_Sound_Server_DX9::loadSoundLocal(char* filename, vrpn_SoundID id, vrpn_SoundDef soundDef) { - - char tempbuf[1024]; - GUID guid3DAlgorithm = GUID_NULL; - HRESULT hr; - - // Free any previous sound, and make a new one - SAFE_DELETE( g_Sound[id].m_pSound ); - - // Verify the file is small - HANDLE hFile = CreateFile( filename, 0, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ); - if( hFile != NULL ) - { - // If you try to open a 100MB wav file, you could run out of system memory with this - // sample cause it puts all of it into a large buffer. If you need to do this, then - // see the "StreamData" sample to stream the data from the file into a sound buffer. - DWORD dwFileSizeHigh = 0; - DWORD dwFileSize = GetFileSize( hFile, &dwFileSizeHigh ); - CloseHandle( hFile ); - - if( dwFileSizeHigh != 0 || dwFileSize > 1000000 ) - { - sprintf(tempbuf,"File too large. You should stream large files."); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - - return; - } - } - - DX9WaveFile waveFile; - waveFile.Open( filename, NULL, 1 ); - WAVEFORMATEX* pwfx = waveFile.GetFormat(); - if( pwfx == NULL ) - { - sprintf(tempbuf,"Invalid wave file format."); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - - return; - } - - if( pwfx->nChannels > 1 ) - { - // Too many channels in wave. Sound must be mono when using DSBCAPS_CTRL3D - sprintf(tempbuf,"Wave file must be mono for 3D control."); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - - return; - } - - if( pwfx->wFormatTag != WAVE_FORMAT_PCM ) - { - // Sound must be PCM when using DSBCAPS_CTRL3D - sprintf(tempbuf,"Wave file must be PCM for 3D control."); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - - return; - } - - // Set the proper DirectX 3D Audio Algorithm - guid3DAlgorithm = DS3DALG_HRTF_FULL; - - // Load the sound id and name(path) into the sound map - g_soundMap[g_numSounds].m_iSoundNum = (int)id; - char* nameptr = g_soundMap[g_numSounds].m_DX9SoundName; - strcpy(nameptr, filename); - int myid = g_soundMap[g_numSounds].m_iSoundNum; - - g_numSounds++; - - // Load the wave file into a DirectSound buffer - hr = CreateSecondaryBuffer( &g_Sound[myid].m_pSound, filename, DSBCAPS_CTRL3D | DSBCAPS_CTRLVOLUME | DSBCAPS_STICKYFOCUS, guid3DAlgorithm, 1 ); - - if( FAILED( hr ) || hr == DS_NO_VIRTUALIZATION ) - { - DXTRACE_ERR( TEXT("Create"), hr ); - if( DS_NO_VIRTUALIZATION == hr ) - { - sprintf(tempbuf,"The 3D virtualization algorithm requested is not supported under this " - "operating system. It is available only on Windows 2000, Windows ME, and Windows 98 with WDM " - "drivers and beyond. Creating buffer with no virtualization."); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - } - - // Unknown error, but not a critical failure, so just update the status - sprintf(tempbuf,"Could not create sound buffer.\n"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - - return; - } - - // Get the 3D buffer from the secondary buffer - hr = g_Sound[myid].m_pSound->Get3DBufferInterface( 0, &g_pDS3DBuffer ); - - // Get the 3D buffer parameters - g_dsBufferParams.dwSize = sizeof(DS3DBUFFER); - g_pDS3DBuffer->GetAllParameters( &g_dsBufferParams ); - - // Set new 3D buffer parameters - g_dsBufferParams.dwMode = DS3DMODE_NORMAL; - - // Set up sound parameters - D3DVALUE pos_x = (float)soundDef.pose.position[0]; - D3DVALUE pos_y = (float)soundDef.pose.position[1]; - D3DVALUE pos_z = (float)soundDef.pose.position[2]; - g_pDS3DBuffer->SetPosition( pos_x, pos_y, pos_z, DS3D_IMMEDIATE ); - - D3DVALUE ori_x = (float)soundDef.pose.orientation[0]; - D3DVALUE ori_y = (float)soundDef.pose.orientation[1]; - D3DVALUE ori_z = (float)soundDef.pose.orientation[2]; - g_pDS3DBuffer->SetConeOrientation(ori_x,ori_y,ori_z, DS3D_IMMEDIATE ); - - long InsideConeAngle = (long)soundDef.cone_inner_angle; - long OutsideConeAngle = (long)soundDef.cone_outer_angle; - g_pDS3DBuffer->SetConeAngles(InsideConeAngle, OutsideConeAngle, DS3D_IMMEDIATE); - - long OutsideVolume = (long)soundDef.cone_gain; - g_pDS3DBuffer->SetConeOutsideVolume(OutsideVolume, DS3D_IMMEDIATE); - - float MinDistance = (float)soundDef.min_front_dist; - float MaxDistance = (float)soundDef.max_front_dist; - g_pDS3DBuffer->SetMinDistance(MinDistance, DS3D_IMMEDIATE); - g_pDS3DBuffer->SetMaxDistance(MaxDistance, DS3D_IMMEDIATE); - - D3DVALUE velocity_x = (float)soundDef.velocity[0]; - D3DVALUE velocity_y = (float)soundDef.velocity[1]; - D3DVALUE velocity_z = (float)soundDef.velocity[2]; - g_pDS3DBuffer->SetVelocity(velocity_x, velocity_y, velocity_z, DS3D_IMMEDIATE); - - DSBCAPS dsbcaps; - ZeroMemory( &dsbcaps, sizeof(DSBCAPS) ); - dsbcaps.dwSize = sizeof(DSBCAPS); - - LPDIRECTSOUNDBUFFER pDSB = g_Sound[myid].m_pSound->GetBuffer( 0 ); - - sprintf(tempbuf,"Loading sound #%d: %s \n",id,filename); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - - pDSB->GetCaps( &dsbcaps ); - if( ( dsbcaps.dwFlags & DSBCAPS_LOCHARDWARE ) != 0 ) { - sprintf(tempbuf,"File loaded using hardware mixing. \n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - } - else { - sprintf(tempbuf,"File loaded using software mixing. \n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - } - - GetSoundList(); - - return; - -} - - - -// not supported -void vrpn_Sound_Server_DX9::loadSoundRemote(char* filename, vrpn_SoundID id, vrpn_SoundDef soundDef) { - - send_message("loadSoundRemote not supported",vrpn_TEXT_WARNING,0); -} - - - - -void vrpn_Sound_Server_DX9::unloadSound(vrpn_SoundID id) { - - if(id<0 || id>g_numSounds){ - send_message("Error: unloadSound (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - char tempbuf[1024]; - int myid = g_soundMap[id].m_iSoundNum; - - if (myid==-1 || g_Sound[myid].m_pSound == NULL) { - sprintf(tempbuf,"Error: unloadSound(Invalid id) "); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - // move everything down by one - for(int i=myid; i<g_numSounds; i++){ - - if(g_Sound[i].m_pSound->IsSoundPlaying()){ - g_Sound[i].m_pSound->Stop(); - } - char* tempptr1 = g_soundMap[i].m_DX9SoundName; - strcpy( tempptr1, &g_soundMap[i+1].m_DX9SoundName[0] ); - g_Sound[i].m_pSound = g_Sound[i+1].m_pSound; - g_Sound[i].repeat = g_Sound[i+1].repeat; - } - - g_numSounds--; - - sprintf(tempbuf,"Unloading sound: %d ",myid); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - - GetSoundList(); - - return; -} - - - -// We use at and up vectors in DirectX... -// Use setListenerPosition and setListenerOrientation instead. -void vrpn_Sound_Server_DX9::setListenerPose(vrpn_PoseDef pose) { - - D3DVALUE pos_x = (float)pose.position[0]; - D3DVALUE pos_y = (float)pose.position[1]; - D3DVALUE pos_z = (float)pose.position[2]; - - g_pDSListener->SetPosition( pos_x, pos_y, pos_z, DS3D_IMMEDIATE ); - - D3DVECTOR up,at; - q_matrix_type mat; - - q_to_col_matrix( mat, pose.orientation ); - - at.x = -(float)mat[0][1]; - at.y = -(float)mat[1][1]; - at.z = (float)mat[2][1]; - - up.x = (float)mat[0][2]; - up.y = (float)mat[1][2]; - up.z = -(float)mat[2][2]; - -// printf("DEBUG: %f %f %f %f %f %f\n", -// at.x,at.y, at.z, up.x, up.y, up.z); - - g_pDSListener->SetOrientation( at.x, at.y, at.z, up.x, up.y, up.z, DS3D_IMMEDIATE ); - - return; -} - - - - -void vrpn_Sound_Server_DX9::setListenerVelocity(vrpn_float64 velocity[4]) { - - D3DVALUE velocity_x = (float)velocity[0]; - D3DVALUE velocity_y = (float)velocity[1]; - D3DVALUE velocity_z = (float)velocity[2]; - - g_pDSListener->SetVelocity( velocity_x, velocity_y, velocity_z, DS3D_IMMEDIATE ); - - return; -} - - - - -void vrpn_Sound_Server_DX9::changeSoundStatus(vrpn_SoundID id, vrpn_SoundDef soundDef) { - - if(id<0 || id>g_numSounds){ - send_message("Error: changeSoundStatus (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - HRESULT hr; - vrpn_int32 myid = g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - - sprintf(tempbuf,"Error: changeSoundStatus(Invalid id) "); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - // Get the 3D buffer from the secondary buffer - g_Sound[id].m_pSound->Get3DBufferInterface( 0, &g_pDS3DBuffer ); - - // Get the 3D buffer parameters - hr = g_pDS3DBuffer->GetAllParameters( &g_dsBufferParams ); - - // Set up sound parameters - g_dsBufferParams.vPosition.x = (float)soundDef.pose.position[0]; - g_dsBufferParams.vPosition.y = (float)soundDef.pose.position[1]; - g_dsBufferParams.vPosition.z = (float)soundDef.pose.position[2]; - - g_dsBufferParams.vConeOrientation.x = (float)soundDef.pose.orientation[0]; - g_dsBufferParams.vConeOrientation.y = (float)soundDef.pose.orientation[1]; - g_dsBufferParams.vConeOrientation.z = (float)soundDef.pose.orientation[2]; - - g_dsBufferParams.dwInsideConeAngle = (long)soundDef.cone_inner_angle; - g_dsBufferParams.dwOutsideConeAngle = (long)soundDef.cone_outer_angle; - g_dsBufferParams.lConeOutsideVolume = (long)soundDef.cone_gain; - - g_dsBufferParams.flMinDistance = (float)soundDef.min_front_dist; - g_dsBufferParams.flMaxDistance = (float)soundDef.max_front_dist; - - g_dsBufferParams.vVelocity.x = (float)soundDef.velocity[0]; - g_dsBufferParams.vVelocity.y = (float)soundDef.velocity[1]; - g_dsBufferParams.vVelocity.z = (float)soundDef.velocity[2]; - - // Now apply all parameters. - hr = g_pDS3DBuffer->SetAllParameters( &g_dsBufferParams, DS3D_IMMEDIATE ); - - return; -} - - - - -void vrpn_Sound_Server_DX9::setSoundPose(vrpn_SoundID id, vrpn_PoseDef pose) { - - if(id<0 || id>g_numSounds){ - send_message("Error: setSoundPose (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - HRESULT hr; - int myid = g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundPose(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - // Get the 3D buffer from the secondary buffer - hr = g_Sound[myid].m_pSound->Get3DBufferInterface( 0, &g_pDS3DBuffer ); - - // Get the 3D buffer parameters - hr = g_pDS3DBuffer->GetAllParameters( &g_dsBufferParams ); - - D3DVALUE pos0 = (float)pose.position[0]; - D3DVALUE pos1 = (float)pose.position[1]; - D3DVALUE pos2 = (float)pose.position[2]; - D3DVALUE ori0 = (float)pose.orientation[0]; - D3DVALUE ori1 = (float)pose.orientation[1]; - D3DVALUE ori2 = (float)pose.orientation[2]; - - g_pDS3DBuffer->SetPosition(pos0, pos1, pos2, DS3D_IMMEDIATE); - g_pDS3DBuffer->SetConeOrientation(ori0, ori1, ori2, DS3D_IMMEDIATE); - g_pDS3DBuffer->GetAllParameters( &g_dsBufferParams ); - - return; -} - - - - -void vrpn_Sound_Server_DX9::setSoundVelocity(vrpn_SoundID id, vrpn_float64 *velocity) { - - if(id<0 || id>g_numSounds){ - send_message("Error: setSoundVelocity (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - HRESULT hr; - vrpn_int32 myid = g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - - sprintf(tempbuf,"Error: setSoundVelocity(Invalid id)"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - // Get the 3D buffer from the secondary buffer - g_Sound[id].m_pSound->Get3DBufferInterface( 0, &g_pDS3DBuffer ); - - // Get the 3D buffer parameters - hr = g_pDS3DBuffer->GetAllParameters( &g_dsBufferParams ); - - // Set up sound parameters - g_dsBufferParams.vVelocity.x = (float)velocity[0]; - g_dsBufferParams.vVelocity.y = (float)velocity[1]; - g_dsBufferParams.vVelocity.z = (float)velocity[2]; - - // Now apply all parameters. - hr = g_pDS3DBuffer->SetAllParameters( &g_dsBufferParams, DS3D_IMMEDIATE ); - - return; -} - - - - -void vrpn_Sound_Server_DX9::setSoundDistInfo(vrpn_SoundID id, vrpn_float64 *distinfo) { - - if(id<0 || id>g_numSounds){ - send_message("Error: setSoundDistInfo (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - HRESULT hr; - vrpn_int32 myid = g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundDistInfo(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - // Get the 3D buffer from the secondary buffer - g_Sound[id].m_pSound->Get3DBufferInterface( 0, &g_pDS3DBuffer ); - - // Get the 3D buffer parameters - hr = g_pDS3DBuffer->GetAllParameters( &g_dsBufferParams ); - - // Set up sound parameters - // distinfo[2] is front min - // distinfo[3] is front max - g_dsBufferParams.flMinDistance = (float)distinfo[2]; - g_dsBufferParams.flMaxDistance = (float)distinfo[3]; - - // Now apply all parameters. - hr = g_pDS3DBuffer->SetAllParameters( &g_dsBufferParams, DS3D_IMMEDIATE ); - - return; -} - - - - -void vrpn_Sound_Server_DX9::setSoundConeInfo(vrpn_SoundID id, vrpn_float64 *coneinfo) { - - if(id<0 || id>g_numSounds){ - send_message("Error: setSoundConeInfo (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - HRESULT hr; - vrpn_int32 myid = g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundConeInfo(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - // Get the 3D buffer from the secondary buffer - g_Sound[id].m_pSound->Get3DBufferInterface( 0, &g_pDS3DBuffer ); - - // Get the 3D buffer parameters - hr = g_pDS3DBuffer->GetAllParameters( &g_dsBufferParams ); - - // Set up sound parameters - g_dsBufferParams.vConeOrientation.x = (float)coneinfo[0]; - g_dsBufferParams.vConeOrientation.y = (float)coneinfo[1]; - g_dsBufferParams.vConeOrientation.z = (float)coneinfo[2]; - - g_dsBufferParams.dwInsideConeAngle = (long)coneinfo[3]; - g_dsBufferParams.dwOutsideConeAngle = (long)coneinfo[4]; - g_dsBufferParams.lConeOutsideVolume = (long)coneinfo[5]; - - // Now apply all parameters. - hr = g_pDS3DBuffer->SetAllParameters( &g_dsBufferParams, DS3D_IMMEDIATE ); - - return; -} - - - -// With DirectSound this is really a property of the Listener, -// so vrpn_SoundID id is not used. -void vrpn_Sound_Server_DX9::setSoundDoplerFactor(vrpn_SoundID id, vrpn_float64 doplerfactor) { - - // Still check for sane user anyway. - if(id<0 || id>g_numSounds){ - send_message("Error: setSoundDoplerFactor (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - HRESULT hr; - vrpn_int32 myid = g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundDoplerFactor(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - // Set the Listener parameters - hr = g_pDSListener->SetDopplerFactor( (float)doplerfactor, DS3D_IMMEDIATE ); - - return; -} - - - -void vrpn_Sound_Server_DX9::setSoundEqValue(vrpn_SoundID id, vrpn_float64 eqvalue) { - - send_message("setSoundEqValue not supported",vrpn_TEXT_WARNING,0); - - return; -} - - - - -void vrpn_Sound_Server_DX9::setSoundPitch(vrpn_SoundID id, vrpn_float64 pitch) { - - send_message("setSoundPitch not supported",vrpn_TEXT_WARNING,0); - - return; -} - - - - -void vrpn_Sound_Server_DX9::setSoundVolume(vrpn_SoundID id, vrpn_float64 volume) { - - if(id<0 || id>g_numSounds){ - send_message("Error: setSoundVolume (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - vrpn_int32 myid = g_soundMap[id].m_iSoundNum; - char tempbuf[1024]; - - if (myid==-1) { - sprintf(tempbuf,"Error: setSoundVolume(Invalid id)\n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - } - - g_Sound[id].m_pSound->SetBufferVolume((long)volume); - - return; -} - - - - -void vrpn_Sound_Server_DX9::loadModelLocal(const char * filename) { - - char tempbuf[1024]; - - sprintf(tempbuf,"loadModelLocal not implemented\n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; - -} - - - - -void vrpn_Sound_Server_DX9::loadModelRemote(){ - - char tempbuf[1024]; - - sprintf(tempbuf,"loadModelRemote not implemented\n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; -} - - - - -void vrpn_Sound_Server_DX9::loadPolyQuad(vrpn_QuadDef * quad) { - - char tempbuf[1024]; - - sprintf(tempbuf,"loadPolyQuad not implemented\n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; -} - - - - -void vrpn_Sound_Server_DX9::loadPolyTri(vrpn_TriDef * tri) { - - char tempbuf[1024]; - - sprintf(tempbuf,"loadPolyTri not implemented\n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; -} - - - - -void vrpn_Sound_Server_DX9::loadMaterial(vrpn_MaterialDef * material, vrpn_int32 id) { - - char tempbuf[1024]; - - sprintf(tempbuf,"loadMaterial not implemented\n"); - printf("%s", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; -} - - - - -void vrpn_Sound_Server_DX9::setPolyQuadVertices(vrpn_float64 vertices[4][3], const vrpn_int32 id) { - - char tempbuf[1024]; - - sprintf(tempbuf,"setPolyQuadVertices not implemented"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; -} - - - - -void vrpn_Sound_Server_DX9::setPolyTriVertices(vrpn_float64 vertices[3][3], const vrpn_int32 id) { - - char tempbuf[1024]; - - sprintf(tempbuf,"setPolyTriVertices not implemented"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; -} - - - - -void vrpn_Sound_Server_DX9::setPolyOF(vrpn_float64 OF, vrpn_int32 tag) { - - char tempbuf[1024]; - - sprintf(tempbuf,"setPolyOF not implemented"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; -} - - - - -void vrpn_Sound_Server_DX9::setPolyMaterial(const char * material, vrpn_int32 tag) { - - char tempbuf[1024]; - - sprintf(tempbuf,"setPolyMaterial not implemented"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return; -} - - - - -vrpn_float64 vrpn_Sound_Server_DX9::GetCurrentVolume(const vrpn_int32 id) { - - if(id<0 || id>g_numSounds){ - send_message("Error: GetCurrentVolume (Invalid id)",vrpn_TEXT_WARNING,0); - return -1.0f; - } - - HRESULT hr; - char tempbuf[1024]; - long val; - vrpn_int32 myid = g_soundMap[id].m_iSoundNum; - - if (myid==-1) { - sprintf(tempbuf,"Error: GetCurrentVolume(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return -1.0f; - } - - // Get the 3D buffer from the secondary buffer - hr = g_Sound[id].m_pSound->Get3DBufferInterface( 0, &g_pDS3DBuffer ); - hr = g_pDS3DBuffer->GetAllParameters( &g_dsBufferParams ); - - val = g_dsBufferParams.lConeOutsideVolume; - - return val; -} - - - -// not supported in DirectX -vrpn_int32 vrpn_Sound_Server_DX9::GetCurrentPlaybackRate(const vrpn_int32 CurrentSoundId) { - - char tempbuf[1024]; - - sprintf(tempbuf,"GetCurrentPlaybackRate not available in DirectX"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return -1; -} - - - - -void vrpn_Sound_Server_DX9::GetCurrentPosition(const vrpn_int32 id, float* X_val, float* Y_val, float* Z_val) { - - if(id<0 || id>g_numSounds){ - send_message("Error: GetCurrentPosition (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - HRESULT hr; - char tempbuf[1024]; - vrpn_int32 myid = g_soundMap[id].m_iSoundNum; - D3DVECTOR val; - - if (myid==-1) { - - sprintf(tempbuf,"Error: GetCurrentPosition(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return ; - } - - // Get the 3D buffer from the secondary buffer - g_Sound[id].m_pSound->Get3DBufferInterface( 0, &g_pDS3DBuffer ); - hr = g_pDS3DBuffer->GetAllParameters( &g_dsBufferParams ); - - hr = g_pDS3DBuffer->GetPosition( &val ); - - *X_val = val.x; - *Y_val = val.y; - *Z_val = val.z; - - return; -} - - - - -void vrpn_Sound_Server_DX9::GetListenerPosition(float* X_val, float* Y_val, float* Z_val) { - - HRESULT hr; - D3DVECTOR pos; - - hr = g_pDSListener->GetPosition( &pos ); - - printf("DEBUG: %f %f %f \n\n",pos.x, pos.y, pos.z); - - *X_val = pos.x; - *Y_val = pos.y; - *Z_val = pos.z; - - return; -} - - - - -void vrpn_Sound_Server_DX9::GetCurrentDistances(const vrpn_int32 id, float* FMin, float* FMax) { - - if(id<0 || id>g_numSounds){ - send_message("Error: GetCurrentDistances (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - HRESULT hr; - char tempbuf[1024]; - int myid = g_soundMap[id].m_iSoundNum; - - if (myid==-1) { - - sprintf(tempbuf,"Error: GetCurrentDistances(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return ; - } - - // Get the 3D buffer from the secondary buffer - g_Sound[myid].m_pSound->Get3DBufferInterface( 0, &g_pDS3DBuffer ); - hr = g_pDS3DBuffer->GetAllParameters( &g_dsBufferParams ); - - hr = g_pDS3DBuffer->GetMinDistance( FMin ); - hr = g_pDS3DBuffer->GetMaxDistance( FMax ); - - return; -} - - - - -void vrpn_Sound_Server_DX9::GetListenerOrientation(double* y_val, double *p_val, double *r_val) { - - send_message("GetListenerOrientation not supported",vrpn_TEXT_WARNING,0); - - return; -} - - - -// Get sound's orientation (sound cone orientation) -// In DirectX the sound cone orientation is a vector -void vrpn_Sound_Server_DX9::GetCurrentOrientation(const vrpn_int32 id,float *x, float *y, float *z) { - - if(id<0 || id>g_numSounds){ - send_message("Error: GetCurrentOrientation (Invalid id)",vrpn_TEXT_WARNING,0); - return; - } - - HRESULT hr; - char tempbuf[1024]; - int myid = g_soundMap[id].m_iSoundNum; - D3DVECTOR ori; - - if (myid==-1) { - - sprintf(tempbuf,"Error: GetCurrentOrientation(Invalid id)"); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_ERROR,0); - - return ; - } - - // Get the 3D buffer from the secondary buffer - g_Sound[myid].m_pSound->Get3DBufferInterface( 0, &g_pDS3DBuffer ); - hr = g_pDS3DBuffer->GetAllParameters( &g_dsBufferParams ); - - hr = g_pDS3DBuffer->GetConeOrientation( &ori ); - - *x = ori.x; - *y = ori.y; - *z = ori.z; - - return; -} - - - -void vrpn_Sound_Server_DX9::mainloop() { - - vrpn_Text_Sender::mainloop(); - vrpn_Sound::d_connection->mainloop(); - - vrpn_SoundDef temp; - temp.volume = 0.0f; // suppress VC6 initialization warning with this - // check if we need to repeat any sounds - for(int i=0; i<g_numSounds; i++) { - if(g_Sound[i].repeat != 0) { - if(!g_Sound[i].m_pSound->IsSoundPlaying()) { - playSound(g_soundMap[i].m_iSoundNum, g_Sound[i].repeat, temp); - } - } - } - - return; -} - - - -bool vrpn_Sound_Server_DX9::noSounds(void) {return 0;} - - - -void vrpn_Sound_Server_DX9::stopAllSounds() { - - for (int i(0); i<g_numSounds;i++) - g_Sound[i].m_pSound->Stop(); - - return; -} - - - -void vrpn_Sound_Server_DX9::shutDown() { - - for (int i=0; i<MAX_NUM_SOUNDS; i++) { - g_Sound[i].m_pSound = NULL; - g_soundMap[i].m_iSoundNum=-1; - } - - g_numSounds = 0; -} - - - -void vrpn_Sound_Server_DX9::GetSoundList() { - - char tempbuf[1024]; - - printf("\nCurrent sounds loaded***********\n"); - - for(int i=0; i<g_numSounds; i++){ - - sprintf(tempbuf,"Sound# %d: %s",i,g_soundMap[i].m_DX9SoundName); - printf("%s\n", tempbuf); - send_message((const char *) tempbuf,vrpn_TEXT_NORMAL,0); - } - - printf("********************************\n"); - - return; -} - - - -// Create a secondary buffer -HRESULT vrpn_Sound_Server_DX9::CreateSecondaryBuffer( DX9Sound** ppSound, - LPTSTR strWaveFileName, - DWORD dwCreationFlags, - GUID guid3DAlgorithm, - DWORD dwNumBuffers ) -{ - HRESULT hr; - HRESULT hrRet = S_OK; - LPDIRECTSOUNDBUFFER* apDSBuffer = NULL; - DWORD dwDSBufferSize = NULL; - DX9WaveFile* pWaveFile = NULL; - - if( m_pDS == NULL ) - return CO_E_NOTINITIALIZED; - if( strWaveFileName == NULL || ppSound == NULL || dwNumBuffers < 1 ) - return E_INVALIDARG; - - apDSBuffer = new LPDIRECTSOUNDBUFFER[dwNumBuffers]; - pWaveFile = new DX9WaveFile(); - - pWaveFile->Open( strWaveFileName, NULL, 1 ); - - // Make the DirectSound buffer the same size as the wav file - dwDSBufferSize = pWaveFile->GetSize(); - - // Create the direct sound buffer, and only request the flags needed - // since each requires some overhead and limits if the buffer can - // be hardware accelerated - DSBUFFERDESC dsbd; - ZeroMemory( &dsbd, sizeof(DSBUFFERDESC) ); - dsbd.dwSize = sizeof(DSBUFFERDESC); - dsbd.dwFlags = dwCreationFlags; - dsbd.dwBufferBytes = dwDSBufferSize; - dsbd.guid3DAlgorithm = guid3DAlgorithm; - dsbd.lpwfxFormat = pWaveFile->m_pwfx; - - // DirectSound is only guaranteed to play PCM data. Other - // formats may or may not work depending the sound card driver. - hr = m_pDS->CreateSoundBuffer( &dsbd, &apDSBuffer[0], NULL ); - - // Create the sound - *ppSound = new DX9Sound( apDSBuffer, dwDSBufferSize, dwNumBuffers, pWaveFile, dwCreationFlags ); - - SAFE_DELETE( apDSBuffer ); - - return hrRet; -} - -HRESULT Get3DListenerInterface(LPDIRECTSOUND3DLISTENER *ppDSListener) { - - HRESULT hr; - - hr = pDSBPrimary->QueryInterface( IID_IDirectSound3DListener, - (VOID**)ppDSListener ); - - return hr; - -} - - - -//******************************************************** -// -// DX9 Sound Class -// -//******************************************************** -DX9Sound::DX9Sound( LPDIRECTSOUNDBUFFER* apDSBuffer, DWORD dwDSBufferSize, - DWORD dwNumBuffers, DX9WaveFile* pWaveFile, DWORD dwCreationFlags ) -{ - m_fvolume = 0; - - m_apDSBuffer = new LPDIRECTSOUNDBUFFER[dwNumBuffers]; - - for(DWORD i=0; i<dwNumBuffers; i++ ) - m_apDSBuffer[i] = apDSBuffer[i]; - - m_dwDSBufferSize = dwDSBufferSize; - m_dwNumBuffers = dwNumBuffers; - m_pWaveFile = pWaveFile; - m_dwCreationFlags = dwCreationFlags; - - FillBufferWithSound( m_apDSBuffer[0]); -} - - - -DX9Sound::~DX9Sound() -{ - for( DWORD i=0; i<m_dwNumBuffers; i++ ) - { - SAFE_RELEASE( m_apDSBuffer[i] ); - } - - SAFE_DELETE_ARRAY( m_apDSBuffer ); - SAFE_DELETE( m_pWaveFile ); -} - - - - -HRESULT DX9Sound::FillBufferWithSound( LPDIRECTSOUNDBUFFER pDSB ) -{ - HRESULT hr; - VOID* pDSLockedBuffer = NULL; // Pointer to locked buffer memory - DWORD dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer - DWORD dwWavDataRead = 0; // Amount of data read from the wav file - - // Make sure we have focus, and we didn't just switch in from - // an app which had a DirectSound device - RestoreBuffer( pDSB, NULL ); - - // Lock the buffer down - hr = pDSB->Lock( 0, m_dwDSBufferSize, - &pDSLockedBuffer, &dwDSLockedBufferSize, - NULL, NULL, 0L ); - - // Reset the wave file to the beginning - m_pWaveFile->ResetFile(); - - m_pWaveFile->Read( (BYTE*) pDSLockedBuffer, - dwDSLockedBufferSize, - &dwWavDataRead ); - - if( dwWavDataRead == 0 ) - { - // Wav is blank, so just fill with silence - FillMemory( (BYTE*) pDSLockedBuffer, - dwDSLockedBufferSize, - (BYTE)(m_pWaveFile->m_pwfx->wBitsPerSample == 8 ? 128 : 0 ) ); - } - else if( dwWavDataRead < dwDSLockedBufferSize ) - { - // If the wav file was smaller than the DirectSound buffer, - // we need to fill the remainder of the buffer with data - - // Don't repeat the wav file, just fill in silence - FillMemory( (BYTE*) pDSLockedBuffer + dwWavDataRead, - dwDSLockedBufferSize - dwWavDataRead, - (BYTE)(m_pWaveFile->m_pwfx->wBitsPerSample == 8 ? 128 : 0 ) ); - } - - // Unlock the buffer, we don't need it anymore. - pDSB->Unlock( pDSLockedBuffer, dwDSLockedBufferSize, NULL, 0 ); - - return S_OK; -} - - - - -HRESULT DX9Sound::RestoreBuffer( LPDIRECTSOUNDBUFFER pDSB, BOOL* pbWasRestored ) -{ - HRESULT hr; - - if( pDSB == NULL ) - return CO_E_NOTINITIALIZED; - if( pbWasRestored ) - *pbWasRestored = FALSE; - - DWORD dwStatus; - pDSB->GetStatus( &dwStatus ); - - if( dwStatus & DSBSTATUS_BUFFERLOST ) - { - // Since the app could have just been activated, then - // DirectSound may not be giving us control yet, so - // the restoring the buffer may fail. - // If it does, sleep until DirectSound gives us control. - do - { - hr = pDSB->Restore(); - if( hr == DSERR_BUFFERLOST ) - Sleep( 10 ); - } - while( ( hr = pDSB->Restore() ) == DSERR_BUFFERLOST ); - - if( pbWasRestored != NULL ) - *pbWasRestored = TRUE; - - return S_OK; - } - else - { - return S_FALSE; - } -} - - - - -LPDIRECTSOUNDBUFFER DX9Sound::GetFreeBuffer() -{ - - for( DWORD i=0; i<m_dwNumBuffers; i++ ) - { - if( m_apDSBuffer[i] ) - { - DWORD dwStatus = 0; - m_apDSBuffer[i]->GetStatus( &dwStatus ); - if ( ( dwStatus & DSBSTATUS_PLAYING ) == 0 ) - break; - } - } - - if( i != m_dwNumBuffers ) - return m_apDSBuffer[ i ]; - else - return m_apDSBuffer[ rand() % m_dwNumBuffers ]; -} - - - -LPDIRECTSOUNDBUFFER DX9Sound::GetBuffer( DWORD dwIndex ) -{ - if( dwIndex >= m_dwNumBuffers ) - return NULL; - - return m_apDSBuffer[dwIndex]; -} - - - - -HRESULT DX9Sound::Get3DBufferInterface( DWORD dwIndex, LPDIRECTSOUND3DBUFFER* ppDS3DBuffer ) -{ - if( dwIndex >= m_dwNumBuffers ) - return E_INVALIDARG; - - *ppDS3DBuffer = NULL; - - return m_apDSBuffer[dwIndex]->QueryInterface( IID_IDirectSound3DBuffer, - (VOID**)ppDS3DBuffer ); -} - - -HRESULT DX9Sound::Play( DWORD dwPriority, DWORD dwFlags, LONG lVolume ) -{ - HRESULT hr; - BOOL bRestored; - - LPDIRECTSOUNDBUFFER pDSB = GetFreeBuffer(); - - if( pDSB == NULL ) - return DXTRACE_ERR( TEXT("GetFreeBuffer"), E_FAIL ); - - // Restore the buffer if it was lost - if( FAILED( hr = RestoreBuffer( pDSB, &bRestored ) ) ) - return DXTRACE_ERR( TEXT("RestoreBuffer"), hr ); - - if( bRestored ) - { - // The buffer was restored, so we need to fill it with new data - if( FAILED( hr = FillBufferWithSound( pDSB ) ) ) - return DXTRACE_ERR( TEXT("FillBufferWithSound"), hr ); - } - - if( m_dwCreationFlags & DSBCAPS_CTRLVOLUME ) - { - pDSB->SetVolume( lVolume ); - } - - return pDSB->Play( 0, dwPriority, dwFlags ); -} - - - - -HRESULT DX9Sound::Stop() -{ - HRESULT hr = 0; - - for( DWORD i=0; i<m_dwNumBuffers; i++ ) - hr |= m_apDSBuffer[i]->Stop(); - - return hr; -} - - - - -HRESULT DX9Sound::Reset() -{ - HRESULT hr = 0; - - for( DWORD i=0; i<m_dwNumBuffers; i++ ) - hr |= m_apDSBuffer[i]->SetCurrentPosition( 0 ); - - return hr; -} - - - - -BOOL DX9Sound::IsSoundPlaying() -{ - BOOL bIsPlaying = FALSE; - - for( DWORD i=0; i<m_dwNumBuffers; i++ ) - { - if( m_apDSBuffer[i] ) - { - DWORD dwStatus = 0; - m_apDSBuffer[i]->GetStatus( &dwStatus ); - bIsPlaying |= ( ( dwStatus & DSBSTATUS_PLAYING ) != 0 ); - } - } - - return bIsPlaying; -} - - - - -void DX9Sound::SetBufferVolume(long volume) -{ - LPDIRECTSOUNDBUFFER pDSB = GetFreeBuffer(); - - if( m_dwCreationFlags & DSBCAPS_CTRLVOLUME ) - { - pDSB->SetVolume( volume ); - } - - pDSB->Play( 0, 0, DSBPLAY_LOOPING ); - - return; -} - -long DX9Sound::GetBufferVolume() -{ - return m_fvolume; -} - - -//******************************************************** -// -// DX9 Wavefile Class -// -//******************************************************** -DX9WaveFile::DX9WaveFile() -{ - m_pwfx = NULL; - m_hmmio = NULL; - m_pResourceBuffer = NULL; - m_dwSize = 0; - m_bIsReadingFromMemory = FALSE; -} - - - - -DX9WaveFile::~DX9WaveFile() -{ - Close(); -} - - - - -HRESULT DX9WaveFile::Open( LPTSTR strFileName, WAVEFORMATEX* pwfx, DWORD dwFlags ) -{ - MMCKINFO mmciFormat; // chunk info. for general use. - PCMWAVEFORMAT pcmWaveFormat; // Temp PCM structure to load in. - - - m_dwFlags = dwFlags; - m_bIsReadingFromMemory = FALSE; - - if( strFileName == NULL ) - return E_INVALIDARG; - SAFE_DELETE_ARRAY( m_pwfx ); - - //ICK! API STINKS! - m_hmmio = mmioOpen( strFileName, NULL, MMIO_ALLOCBUF | MMIO_READ ); - m_ckRiff.fccType = mmioFOURCC('W', 'A', 'V', 'E'); - mmioDescend( m_hmmio, &m_ckRiff, NULL, 0 ); - mmciFormat.ckid = mmioFOURCC('f', 'm', 't', ' '); - mmioDescend( m_hmmio, &mmciFormat, &m_ckRiff, MMIO_FINDCHUNK ); - mmioRead( m_hmmio, (HPSTR) &pcmWaveFormat, sizeof(pcmWaveFormat)); - m_pwfx = (WAVEFORMATEX*)new CHAR[ sizeof(WAVEFORMATEX) ]; - memcpy( m_pwfx, &pcmWaveFormat, sizeof(pcmWaveFormat) ); - m_pwfx->cbSize = 0; - - ResetFile(); - - // After the reset, the size of the wav file is m_ck.cksize so store it now - m_dwSize = m_ck.cksize; - - return S_OK; -} - - - -DWORD DX9WaveFile::GetSize() -{ - return m_dwSize; -} - - - -HRESULT DX9WaveFile::ResetFile() -{ - // Reset the pointer to the beginning of the file - mmioSeek( m_hmmio, m_ckRiff.dwDataOffset + sizeof(FOURCC), SEEK_SET ); - m_ck.ckid = mmioFOURCC('d', 'a', 't', 'a'); - mmioDescend( m_hmmio, &m_ck, &m_ckRiff, MMIO_FINDCHUNK ); - - return S_OK; -} - - - - -HRESULT DX9WaveFile::Read( BYTE* pBuffer, DWORD dwSizeToRead, DWORD* pdwSizeRead ) -{ - - MMIOINFO mmioinfoIn; // current status of m_hmmio - - if( pdwSizeRead != NULL ) - *pdwSizeRead = 0; - - if( 0 != mmioGetInfo( m_hmmio, &mmioinfoIn, 0 ) ) - return DXTRACE_ERR( TEXT("mmioGetInfo"), E_FAIL ); - - UINT cbDataIn = dwSizeToRead; - if( cbDataIn > m_ck.cksize ) - cbDataIn = m_ck.cksize; - - m_ck.cksize -= cbDataIn; - - for( DWORD cT = 0; cT < cbDataIn; cT++ ) - { - // Copy the bytes from the io to the buffer. - if( mmioinfoIn.pchNext == mmioinfoIn.pchEndRead ) - { - if( 0 != mmioAdvance( m_hmmio, &mmioinfoIn, MMIO_READ ) ) - return DXTRACE_ERR( TEXT("mmioAdvance"), E_FAIL ); - - if( mmioinfoIn.pchNext == mmioinfoIn.pchEndRead ) - return DXTRACE_ERR( TEXT("mmioinfoIn.pchNext"), E_FAIL ); - } - - // Actual copy. - *((BYTE*)pBuffer+cT) = *((BYTE*)mmioinfoIn.pchNext); - mmioinfoIn.pchNext++; - } - - if( 0 != mmioSetInfo( m_hmmio, &mmioinfoIn, 0 ) ) - return DXTRACE_ERR( TEXT("mmioSetInfo"), E_FAIL ); - - if( pdwSizeRead != NULL ) - *pdwSizeRead = cbDataIn; - - return S_OK; -} - - - - -HRESULT DX9WaveFile::Close() -{ - mmioClose( m_hmmio, 0 ); - m_hmmio = NULL; - SAFE_DELETE_ARRAY( m_pResourceBuffer ); - - return S_OK; -} - - - - - - - - -HWND GetConsoleHwnd(void) { - - // Get the current window title. - char pszOldWindowTitle[CHAR_BUF_SIZE]; - GetConsoleTitle(pszOldWindowTitle, CHAR_BUF_SIZE); - - // Format a unique New Window Title. - char pszNewWindowTitle[CHAR_BUF_SIZE]; - wsprintf(pszNewWindowTitle, "%d/%d", GetTickCount(), GetCurrentProcessId()); - - // Change the current window title. - SetConsoleTitle(pszNewWindowTitle); - - // Ensure window title has changed. - Sleep(40); - - // Look for the new window. - HWND hWnd = FindWindow(NULL, pszNewWindowTitle); - - // Restore orignal name - SetConsoleTitle(pszOldWindowTitle); - - return hWnd; -} - - - -void main(int argc, char **argv) { - - HWND hWin; - vrpn_Sound_Server_DX9* soundServer = NULL; - vrpn_Tracker_Remote* tracker_connection; - char tracker_device[512]; - char tracker_name[512]; - vrpn_Connection* connection; - vrpn_Connection* trackerCon; - int got_report; - - char* config_file_name = "vrpn.cfg"; - FILE* config_file; - char* client_name = NULL; - int client_port = 4501; - int bail_on_error = 1; - int verbose = 0; - int auto_quit = 0; - int realparams = 0; - int loop = 0; - int port = vrpn_DEFAULT_LISTEN_PORT_NO; - - int USE_TRACKER = 0; - - connection = new vrpn_Synchronized_Connection (port); - - // Open the configuration file - if (verbose) printf("Reading from config file %s\n", config_file_name); - - if ( (config_file = fopen(config_file_name, "r")) == NULL) - { - perror("Cannot open config file"); - printf(" (filename %s)\n", config_file_name); - return; - } - - // Read the configuration file, creating a device for each entry. - // Each entry is on one line, which starts with the name of the - // class of the object that is to be created. - // If we fail to open a certain device, print a message and decide - // whether we should bail. - { - char line[512]; // Line read from the input file - char* pch; - char scrap[512], s2[512]; - - // Read lines from the file until we run out - while ( fgets(line, sizeof(line), config_file) != NULL ) - { - - // Make sure the line wasn't too long - if (strlen(line) >= sizeof(line)-1) - { - printf("Line too long in config file: %s\n",line); - if (bail_on_error) { return; } - else { continue; } // Skip this line - } - - if ((strlen(line)<3)||(line[0]=='#')) - { - // comment or empty line -- ignore - continue; - } - - // copy for strtok work - strncpy(scrap, line, sizeof(line) - 1); - // Figure out the device from the name and handle appropriately - - // WARNING: SUBSTRINGS WILL MATCH THE EARLIER STRING, SO - // ADD AN EMPTY SPACE TO THE END OF STATIC STRINGS!!!! - - // #define isit(s) !strncmp(line,s,strlen(s)) - -#define isit(s) !strcmp(pch=strtok(scrap," \t"),s) -#define next() pch += strlen(pch) + 1 - -#ifdef _WIN32 - - if(isit("vrpn_Sound_Server")) - { - next(); - - if (sscanf(pch,"%511s\t%d\t%511s\t%511s",s2,&USE_TRACKER,tracker_name, tracker_device) != 4) - { - printf("Bad vrpn_Server_Sound line: %s\n",line); - if (bail_on_error) - { - return; - } - else - { - continue; - } // Skip this line - } - - hWin = GetConsoleHwnd(); - - printf("\nBegin initializing DX9 Sound Server...\n"); - - soundServer = NULL; - soundServer = new vrpn_Sound_Server_DX9(s2, connection,hWin); - - if (soundServer == NULL) - printf("Can't create sound server\n"); - - printf("DX9 Sound Server successfully initialized.\n\n"); - - } -#endif - } - } - - fclose(config_file); - - // Open remote tracker if we are to use one - - if (USE_TRACKER) { - - char newname[1024]; - sprintf(newname,"%s@%s",(const char*)tracker_device, (const char*)tracker_name); - printf("Using tracker: %s\n",newname); - trackerCon = vrpn_get_connection_by_name(tracker_name); - tracker_connection = new vrpn_Tracker_Remote((const char *) newname); - // SET UP TRACKER HANDLER - if (trackerCon->doing_okay()) { - printf( "TC OK.\n"); - } else { - printf( "TC Not OK.\n"); - } - } - else - if(verbose) printf("Not using tracker\n"); - - loop = 0; - - if (client_name) - { - printf( "vrpn_serv: connecting to client: %s:%d\n", - client_name, client_port); - if (connection->connect_to_client(client_name, client_port)) - { - printf( "server: could not connect to client %s:%d\n", client_name, client_port); - } - } - - // ******************************************************************** - // - // MAIN LOOP - // - // ******************************************************************** - - float fPrevTime = 0.0f; - float fFrameTime; - float fTime; - int counter = 0; - int stopNow = 0; - int numconnections = 0; - - printf("Entering main loop\n\n"); - - while (!(_kbhit() && ((_getch()=='q') || (_getch()=='Q')))) { - - //soundServer->GetLastError(buf); - soundServer->mainloop(); - connection->mainloop(); - - if(counter % 100 == 0) - vrpn_SleepMsecs(1); - - counter++; - - // record time since last frame - if (counter==NUM_SPIN) { - - counter = 0; - fTime = (float)timeGetTime(); - - fFrameTime = (fTime - fPrevTime) * 0.001f; - printf("Running at %4.2f Hz\r", (float) NUM_SPIN/fFrameTime); - fPrevTime = fTime; - } - - soundServer->mainloop(); - - // ensure we get a new report! - if (USE_TRACKER) { - tracker_connection->mainloop(); - got_report = 0; - if (trackerCon->doing_okay()) - while (!got_report) - tracker_connection->mainloop(); - } - - // Send and receive all messages - connection->mainloop(); - - if (numconnections==0 && connection->connected()) - numconnections++; - - if (((numconnections!=0) && (!connection->connected())) || !connection->doing_okay()) { - soundServer->shutDown(); - numconnections=0; - break; - } - - } - - printf("DirectX Sound Server shutting down.\n"); -} - -#endif diff --git a/src/vrpn/server_src/directx_sound_server/vrpn_Sound_DX9.h b/src/vrpn/server_src/directx_sound_server/vrpn_Sound_DX9.h deleted file mode 100644 index 8c79055f53a9f33d143f46fe2027e8e516402091..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/directx_sound_server/vrpn_Sound_DX9.h +++ /dev/null @@ -1,181 +0,0 @@ -#ifndef VRPN_SOUND_DX9_H -#define VRPN_SOUND_DX9_H - -#ifdef _WIN32 - -// Define PI if not already defined -#ifndef PI -#define PI 3.1415926535897932384626433832795f -#endif - -#include <objbase.h> -#include <stdlib.h> -#include <cguid.h> -#include <windows.h> -#include <initguid.h> -#include "vrpn_Sound.h" -#include "quat.h" -#include "string.h" -#include <conio.h> -#include <dxerr8.h> -#include <dsound.h> -#include <mmsystem.h> -#include <mmreg.h> - -class vrpn_Sound_Server_DX9; -class DX9Sound; -class DX9WaveFile; - -typedef struct{ - char m_DX9SoundName[80]; - int m_iSoundNum; -} SoundMap; - -typedef struct{ - DX9Sound* m_pSound; - int repeat; -} Sound; - -// Macros -#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } } -#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } } -#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } } -#define DEG2RAD(x) (x * (PI / 180.0f)) // Converts degrees to radians -#define RAD2DEG(x) (x * (180.0f / PI)) // Converts radians to degrees - - -class vrpn_Sound_Server_DX9 : public vrpn_Sound_Server { - -public: - vrpn_Sound_Server_DX9(const char * name, vrpn_Connection * c, HWND hWin); - - ~vrpn_Sound_Server_DX9(); - - void playSound(vrpn_SoundID id, vrpn_int32 repeat, vrpn_SoundDef soundDef); - void stopSound(vrpn_SoundID id); - - void loadSoundLocal(char* filename, vrpn_SoundID id, vrpn_SoundDef soundDef); - void loadSoundRemote(char* file, vrpn_SoundID id, vrpn_SoundDef soundDef); // not supported - void unloadSound(vrpn_SoundID id); - void changeSoundStatus(vrpn_SoundID id, vrpn_SoundDef soundDef); - - void setListenerPose(vrpn_PoseDef pose); - void setListenerVelocity(vrpn_float64 *velocity); - - void setSoundPose(vrpn_SoundID id, vrpn_PoseDef pose); - void setSoundVelocity(vrpn_SoundID id, vrpn_float64 *velocity); - void setSoundDistInfo(vrpn_SoundID id, vrpn_float64 *distinfo); - void setSoundConeInfo(vrpn_SoundID id, vrpn_float64 *coneinfo); - - void setSoundDoplerFactor(vrpn_SoundID id, vrpn_float64 doplerfactor); - void setSoundEqValue(vrpn_SoundID id, vrpn_float64 eqvalue); // not supported - void setSoundPitch(vrpn_SoundID id, vrpn_float64 pitch); - void setSoundVolume(vrpn_SoundID id, vrpn_float64 volume); - - void GetSoundList(void); - - - // These are not supported - void loadModelLocal(const char * filename); - void loadModelRemote(); // not supported - void loadPolyQuad(vrpn_QuadDef * quad); - void loadPolyTri(vrpn_TriDef * tri); - void loadMaterial(vrpn_MaterialDef * material, vrpn_int32 id); - void setPolyQuadVertices(vrpn_float64 vertices[4][3], const vrpn_int32 id); - void setPolyTriVertices(vrpn_float64 vertices[3][3], const vrpn_int32 id); - void setPolyOF(vrpn_float64 OF, vrpn_int32 tag); - void setPolyMaterial(const char * material, vrpn_int32 tag); - // end of unsupported functions - - - void mainloop(); - bool noSounds(void); - void stopAllSounds(); - void shutDown(); - - vrpn_float64 GetCurrentVolume(const vrpn_int32 CurrentSoundId); - vrpn_int32 GetCurrentPlaybackRate(const vrpn_int32 CurrentSoundId); - void GetCurrentPosition(const vrpn_int32 CurrentSoundId, float* X_val, float* Y_val, float* Z_val); - void GetListenerPosition(float* X_val, float* Y_val, float* Z_val); - void GetCurrentDistances(const vrpn_int32 CurrentSoundId, float* FMin, float* FMax); - void GetListenerOrientation(double* y_val, double *p_val, double *r_val); - void GetCurrentOrientation(const vrpn_int32 CurrentSoundId,float *X_val, float *Y_val, float *Z_val); - - vrpn_int32 LastSoundId; //ID of last played sound - -private: - - // the idea of a map is to have a way to go from the unique id being passed in - // by the user to an internal identifier... - - HRESULT lasterror; - vrpn_int32 maxSounds; - vrpn_int32 numSounds; - SoundMap g_soundMap[MAX_NUMBER_SOUNDS]; - vrpn_int32 numconnections; // number of times server has been connected to.. - - HRESULT CreateSecondaryBuffer( DX9Sound** ppSound, LPTSTR strWaveFileName, DWORD dwCreationFlags = 0, GUID guid3DAlgorithm = GUID_NULL, DWORD dwNumBuffers = 1 ); -}; - - -class DX9Sound -{ -protected: - LPDIRECTSOUNDBUFFER* m_apDSBuffer; - DWORD m_dwDSBufferSize; - DX9WaveFile* m_pWaveFile; - DWORD m_dwNumBuffers; - DWORD m_dwCreationFlags; - long m_fvolume; // 0 max to -10000 min - - HRESULT RestoreBuffer( LPDIRECTSOUNDBUFFER pDSB, BOOL* pbWasRestored ); - -public: - DX9Sound( LPDIRECTSOUNDBUFFER* apDSBuffer, DWORD dwDSBufferSize, DWORD dwNumBuffers, DX9WaveFile* pWaveFile, DWORD dwCreationFlags ); - virtual ~DX9Sound(); - - HRESULT Get3DBufferInterface( DWORD dwIndex, LPDIRECTSOUND3DBUFFER* ppDS3DBuffer ); - HRESULT FillBufferWithSound( LPDIRECTSOUNDBUFFER pDSB ); - LPDIRECTSOUNDBUFFER GetFreeBuffer(); - LPDIRECTSOUNDBUFFER GetBuffer( DWORD dwIndex ); - - HRESULT Play( DWORD dwPriority = 0, DWORD dwFlags = 0, LONG lVolume = 0); - HRESULT Stop(); - HRESULT Reset(); - BOOL IsSoundPlaying(); - void SetBufferVolume(long volume = 0); - long GetBufferVolume(); -}; - - - -class DX9WaveFile -{ -public: - WAVEFORMATEX* m_pwfx; // Pointer to WAVEFORMATEX structure - HMMIO m_hmmio; // MM I/O handle for the WAVE - MMCKINFO m_ck; // Multimedia RIFF chunk - MMCKINFO m_ckRiff; // Use in opening a WAVE file - DWORD m_dwSize; // The size of the wave file - MMIOINFO m_mmioinfoOut; - DWORD m_dwFlags; - BOOL m_bIsReadingFromMemory; - BYTE* m_pbData; - BYTE* m_pbDataCur; - ULONG m_ulDataSize; - CHAR* m_pResourceBuffer; - -public: - DX9WaveFile(); - ~DX9WaveFile(); - HRESULT Open( LPTSTR strFileName, WAVEFORMATEX* pwfx, DWORD dwFlags ); - HRESULT Close(); - HRESULT Read( BYTE* pBuffer, DWORD dwSizeToRead, DWORD* pdwSizeRead ); - DWORD GetSize(); - HRESULT ResetFile(); - WAVEFORMATEX* GetFormat() { return m_pwfx; }; -}; - - -#endif //_WIN32 -#endif \ No newline at end of file diff --git a/src/vrpn/server_src/docs/3Dconnexion-spacepilot-button-mapping.jpg b/src/vrpn/server_src/docs/3Dconnexion-spacepilot-button-mapping.jpg deleted file mode 100644 index 449ed59fbdd1c2e93194266c229d01536295ba01..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/docs/3Dconnexion-spacepilot-button-mapping.jpg and /dev/null differ diff --git a/src/vrpn/server_src/forcefield.C b/src/vrpn/server_src/forcefield.C deleted file mode 100644 index c4a4794407d4c33e4285e4eb4ec899d76bb36b29..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/forcefield.C +++ /dev/null @@ -1,81 +0,0 @@ -#include "vrpn_Configure.h" -#ifdef VRPN_USE_PHANTOM_SERVER -#ifndef VRPN_USE_HDAPI -#include "gstPHANToM.h" -#endif -#include "forcefield.h" - -/// Do not to exceed this force (in dynes). -// It is pretty close to the maximum PHANToM force. -const double FF_MAX_FORCE = 10.0; - -vrpn_HapticVector ForceFieldEffect::calcEffectForce(void *phantom_info) { - - vrpn_HapticPosition phantomPos; - vrpn_HapticVector effectForce = vrpn_HapticVector(0,0,0); - double forceMag; - int i,j; - - if (active) { - // Find out the vector from the current position to the origin - // of the defined force field. -#ifdef VRPN_USE_HDAPI - HDAPI_state *state = (HDAPI_state *)phantom_info; - double vec[3]; - vec[0] = state->pose[3][0]; vec[1] = state->pose[3][1]; vec[2] = state->pose[3][2]; - phantomPos = vrpn_HapticPosition(vec); -#else - gstPHANToM *phantom = (gstPHANToM *)phantom_info; - phantom->getPosition_WC(phantomPos); -#endif - vrpn_HapticVector dR = (phantomPos - origin); - - // If the Phantom has been moved too far from the origin, - // drop the force to zero. - -#ifdef VRPN_USE_HDAPI - if (dR.magnitude() > radius) { -#else - if (dR.norm() > radius) { -#endif - return vrpn_HapticVector(0,0,0); - } - - // Compute the force, which is the constant force plus - // a force that varies as the Phantom position deviates - // from the origin of the force field. The Jacobian - // determines how the force changes in different directions - // away from the origin (generalizing spring forces of different - // magnitudes that constrain the Phantom to the point of the - // origin, to a line containing the origin, or to a plane - // containing the origin). Tom Hudson worked out the math - // on this. - - effectForce = force; - for (i = 0; i < 3; i++) { - for (j = 0; j < 3; j++) { - effectForce[i] += dR[j]*jacobian[i][j]; - } - } - - // Clamp to FF_MAX_FORCE if it is exceeded, leaving the - // direction of the force unchanged. - -#ifdef VRPN_USE_HDAPI - forceMag = effectForce.magnitude(); -#else - forceMag = effectForce.norm(); -#endif - if (forceMag > FF_MAX_FORCE) { - for (i = 0; i < 3; i++) { - effectForce[i] *= FF_MAX_FORCE/(forceMag); - } - } - } - - // Return the force, which will be zero by default if the - // force field is not active. - return effectForce; -} - -#endif diff --git a/src/vrpn/server_src/forcefield.h b/src/vrpn/server_src/forcefield.h deleted file mode 100644 index 8049cf81fec4abba2063a71df5c915909a29ee1c..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/forcefield.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef FORCEFIELD_H -#define FORCEFIELD_H - -#include "vrpn_Configure.h" -#ifdef VRPN_USE_PHANTOM_SERVER - -#include "ghost.h" -#include <math.h> - -/// force field effect for PHANToM - -#ifdef VRPN_USE_HDAPI -class ForceFieldEffect -#else -class ForceFieldEffect:public gstEffect -#endif -{ - public: - - /// Constructor. -#ifdef VRPN_USE_HDAPI - ForceFieldEffect(): active(false), time(0) {} -#else - ForceFieldEffect():gstEffect() {} -#endif - - /// Destructor. - ~ForceFieldEffect() {} - - /// Sets the member variables to the specified values - void setForce(float ori[3], float f[3], float jm[3][3], - float r) { - int i,j; - for (i=0; i < 3; i++) { - origin[i] = ori[i]; - force[i] = f[i]; - for (j=0; j < 3; j++) { - jacobian[i][j] = jm[i][j]; - } - } - radius = r; - } - - // FOR_GHOST_EXTENSION: - // Start the effect. WARNING: When re-starting an effect, - // make sure to reset any state, such as past PHANToM position. - // Otherwise, the next call to calcEffectForce could - // generate unexpectedly large forces. - /// Start the application of forces based on the field. - virtual vrpn_HapticBoolean start() { -// if (!active) { printf("starting ForceFieldEffect\n"); } - active = true; time = 0.0; return true; - } - - // FOR_GHOST_EXTENSION: - /// Stop the application of force based on the field. - virtual void stop() { -// if (active) { printf("stopping ForceFieldEffect\n"); } - active = false; - } - -#ifdef VRPN_USE_HDAPI - virtual vrpn_HapticBoolean isActive() const { return active; } -#endif - - // FOR_GHOST_EXTENSION: - /// Calculate the force in parent reference frame of phantom. - // When subclassing, the first - // parameter should be cast to gstPHANToM to retrieve - // any information about the state of the PHANToM that - // is needed to calculate the forces. deltaT should - // be used to update the time. Also, if the effect is - // not active, the zero vector should be returned. - // ACHTUNG! - // WARNING!: Never call PHANToM->setForce or - // PHANToM->setForce_WC from this function. - // It will cause an infinite recursion. - virtual vrpn_HapticVector calcEffectForce(void *phantom_info); - - protected: - -#ifdef VRPN_USE_HDAPI - vrpn_HapticBoolean active; - double time; -#endif - vrpn_HapticPosition origin; //< Origin of the force field - vrpn_HapticVector force; //< Constant force to add to position-dependent forces - double radius; //< Distance from origin at which the field drops to zero - double jacobian[3][3]; //< Describes increase in force away from origin in different directions -}; - -#endif -#endif diff --git a/src/vrpn/server_src/forward.C b/src/vrpn/server_src/forward.C deleted file mode 100644 index 677ff91ce8acf70dd823aab48dc61f3db0f74294..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/forward.C +++ /dev/null @@ -1,124 +0,0 @@ -#include <vrpn_Connection.h> -#include <vrpn_Forwarder.h> - -#include <stdio.h> // fprintf() -#include <stdlib.h> // atoi() -#include <signal.h> // for signal() - -// forward.C - -// This program is a toy use of the vrpn_Forwarder class -// (actually vrpn_StreamForwarder, one of the two alternatives). - -// global so our signal handler can see them - -vrpn_Connection * server_connection; -vrpn_Connection * client_connection; -vrpn_StreamForwarder * forwarder; - - -void Usage (char * s) { - fprintf(stderr, "Usage: %s location service port\n", s); - exit(0); -} - -// Catch control-C and shut down our network connections nicely. - -void sighandler (int signal) { - delete forwarder; - delete server_connection; - delete client_connection; - exit(0); -} - -// Install the signal handler. Isn't it annoying that this code is -// longer than the handler itself? - -void install_handler (void) { - -#ifndef WIN32 -#ifdef sgi - - sigset( SIGINT, sighandler ); - sigset( SIGKILL, sighandler ); - sigset( SIGTERM, sighandler ); - sigset( SIGPIPE, sighandler ); - -#else - - signal( SIGINT, sighandler ); - signal( SIGKILL, sighandler ); - signal( SIGTERM, sighandler ); - signal( SIGPIPE, sighandler ); - -#endif // sgi -#endif // WIN32 - -} - - -int main (int argc, char ** argv) { - - char * source_location; - char * source_name; - char * client_name; - int port = 4510; - int retval; - - if ((argc < 3) || (argc > 4)) - Usage(argv[0]); - - // Expect that source_name and client_name are both ??? - // Port is the port that our client will connect to us on - - source_location = argv[1]; - source_name = argv[2]; - client_name = argv[2]; - if (argc == 4) - port = atoi(argv[3]); - - // Connect to the server. - - server_connection = vrpn_get_connection_by_name (source_location); - - // Open a port for our client to connect to us. - - client_connection = vrpn_create_server_connection(port); - - // Put a forwarder on that port. - - forwarder = new vrpn_StreamForwarder - (server_connection, source_name, client_connection, client_name); - - // Tell the forwarder to send Tracker Pos/Quat messages through, - // using the same name on both sides. - - retval = forwarder->forward("Tracker Pos/Quat", "Tracker Pos/Quat"); - - if (retval) - fprintf(stderr, "forwarder->forward(\"Tracker Pos/Quat\") failed.\n"); - else - fprintf(stderr, "forwarder->forward(\"Tracker Pos/Quat\") succeeded.\n"); - - // Set up a signal handler to shut down cleanly on control-C. - - install_handler(); - - // Do the dirty work. - - while (1) { - - // Get any received messages and queue them up for transmission - // to the client. - - server_connection->mainloop(); - - // Send them. - - client_connection->mainloop(); - - } - -} - - diff --git a/src/vrpn/server_src/ghost.h b/src/vrpn/server_src/ghost.h deleted file mode 100644 index 83d64e30ca364ae8f044e44e56151c1200e3b69a..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/ghost.h +++ /dev/null @@ -1,162 +0,0 @@ -#ifndef vrpn_GHOST_H -#define vrpn_GHOST_H - -#include "vrpn_Configure.h" -#ifdef VRPN_USE_PHANTOM_SERVER - -#include <math.h> -#include <stdio.h> -#include <quat.h> -#include <vector> - -//---------------------------------------------------------------------------- -// This section contains helper classes that might make life easier. They were -// put here when porting the Phantom code from GHOST to HDAPI. It either -// implements the functions that were needed form GHOST or else defines the -// VRPN types to use the relevant GHOST types. They do not completely solve -// the GHOST vs. HDAPI special-purpose code because not all of the methods -// implemented in GHOST objects are implemented in HDAPI objects (the names -// changed and some features were dropped). - -// XXX WARNING! These classes are not a sound foundation on which to build -// an application. They were fiddled with until they implemented sufficient -// functions to do what was needed for the port. The space, row/column, and -// other features of the matrices in particular are not tested beyond their -// ability to do what was needed. - -#ifdef VRPN_USE_HDAPI - #if defined(_WIN32) && !defined(WIN32) - // Through version 3.1, the test macro in Sensable's code is wrong. - #define WIN32 - #endif - - #ifndef M_PI - #define M_PI (3.14159265358979323846) - #endif - - #include <HL/hl.h> - #include <HDU/hduVector.h> - #include <HDU/hduPlane.h> - #include <HDU/hduMatrix.h> - #include <HDU/hduLineSegment.h> - typedef HDboolean vrpn_HapticBoolean; - typedef hduVector3Dd vrpn_HapticVector; - typedef hduVector3Dd vrpn_HapticPosition; - typedef hduPlaned vrpn_HapticPlane; - typedef hduMatrix vrpn_HapticMatrix; - - - class vrpn_HapticSurface { - public: - double getSurfaceFstatic(void) const { return d_surfaceFstatic; } - void setSurfaceFstatic(double f) { d_surfaceFstatic = f; } - - double getSurfaceFdynamic(void) const { return d_surfaceFdynamic; } - void setSurfaceFdynamic(double f) { d_surfaceFdynamic = f; } - - double getSurfaceKspring(void) const { return d_surfaceKspring; } - void setSurfaceKspring(double f) { d_surfaceKspring = f; } - - double getSurfaceKdamping(void) const { return d_surfaceKdamping; } - void setSurfaceKdamping(double f) { d_surfaceKdamping = f; } - - protected: - double d_surfaceFstatic; - double d_surfaceFdynamic; - double d_surfaceKspring; - double d_surfaceKdamping; - }; - - class vrpn_HapticCollision { - public: - vrpn_HapticCollision(const vrpn_HapticPosition &point, const vrpn_HapticVector &dir) { - d_location = point; - d_normal = dir; - d_normal.normalize(); - } - - vrpn_HapticPosition location(void) const { return d_location; } - vrpn_HapticVector normal(void) const { return d_normal; } - - protected: - vrpn_HapticPosition d_location; - vrpn_HapticVector d_normal; - }; - - typedef std::vector<vrpn_HapticCollision> vrpn_HapticCollisionList; - - class vrpn_HapticCollisionState { - public: - // XXX Temporary for half-baked collision code - vrpn_HapticCollisionState(const vrpn_HapticPosition curr_pos) { - d_inContact = false; - d_currentPosition = curr_pos; - } - - vrpn_HapticBoolean inContact(void) const { return d_inContact; } - - //XXX These methods will be used during the object collision - // query routine to indicate collision states and such. - void updateState(vrpn_HapticBoolean inContact) { - d_inContact = inContact; - } - void addCollision(const vrpn_HapticPosition &point, const vrpn_HapticVector &dir) { - if (!d_collisions.empty()) { - fprintf(stderr, "vrpn_HapticCollisionState::addCollision(): Only one allowed\n"); - } else { - d_collisions.push_back(vrpn_HapticCollision(point, dir)); - } - } - - const vrpn_HapticCollisionList &collisions(void) const { return d_collisions; } - void clear(void) { d_collisions.clear(); } - - // XXX Temporary for half-based collision code - vrpn_HapticPosition d_currentPosition; - - protected: - vrpn_HapticBoolean d_inContact; - vrpn_HapticCollisionList d_collisions; - }; - - // Structure to hold the Phantom device state, passed back from readDeviceState(). - typedef struct { - double pose[4][4]; - double last_pose[4][4]; - double max_stiffness; - double current_force[3]; - int instant_rate; - int buttons; - } HDAPI_state; - -#else - #include <gstBasic.h> - #include <gstBoundaryCube.h> - #include <gstButton.h> - #include <gstDynamic.h> - #include <gstNode.h> - #include <gstPHANToM.h> - #include <gstPHANToM_SCP.h> - #include <gstTriPolyMeshHaptic.h> - #include <gstPoint.h> - #include <gstScene.h> - #include <gstSeparator.h> - #include <gstSlider.h> - #include <gstTransformMatrix.h> - - #include <gstCube.h> - #include <gstSphere.h> - - #include <gstForceField.h> - - typedef gstBoolean vrpn_HapticBoolean; - typedef gstVector vrpn_HapticVector; - typedef gstPoint vrpn_HapticPosition; - typedef gstPlane vrpn_HapticPlane; - typedef gstTransformMatrix vrpn_HapticMatrix; - typedef gstShape vrpn_HapticSurface; -#endif - -#endif - -#endif diff --git a/src/vrpn/server_src/ghostEffects/ChangeLog b/src/vrpn/server_src/ghostEffects/ChangeLog deleted file mode 100644 index 41bbb5ea81d209fa78054de9d1e9e8c66d3999ff..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/ghostEffects/ChangeLog +++ /dev/null @@ -1,26 +0,0 @@ -2005-12-21 Russell M. Taylor II <taylorr@cs.unc.edu> - - * InstantBuzzEffect.h : Trying to make it build under Cygwin. - * InstantBuzzEffect.cpp : Adding CR at end of file. - -2004-07-22 Russell M. Taylor II <taylorr@cs.unc.edu> - - * InstantBuzzEffect.h : Port to use GHOST or HDAPI (full port). - * InstantBuzzEffect.cpp : Same. - -2004-03-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * InstantBuzzEffect.h : Adding credits. - * InstantBuzzEffect.cpp : Same. - -2003-12-08 Russell M. Taylor II <taylorr@cs.unc.edu> - - * InstantBuzzEffect.h : Making it compile again WITH Ghost. - * InstantBuzzEffect.cpp : Same. - -2003-11-26 Russell M. Taylor II <taylorr@cs.unc.edu> - - * InstantBuzzEffect.h : Makes it compile without requiring Ghost - libraries if VRPN_USE_PHANTOM_SERVER is not defined. - * InstantBuzzEffect.cpp : Same. - diff --git a/src/vrpn/server_src/ghostEffects/InstantBuzzEffect.cpp b/src/vrpn/server_src/ghostEffects/InstantBuzzEffect.cpp deleted file mode 100644 index 4a741ced2f0ee29ca58e7909fc4b0aeb05dbe762..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/ghostEffects/InstantBuzzEffect.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -# instantBuzzEffect : instantaneous buzz "custom" effect for Phantom server -# written by Sebastien MARAUX, ONDIM SA (France) -# maraux@ondim.fr -*/ - -#include "InstantBuzzEffect.h" -#ifdef VRPN_USE_PHANTOM_SERVER - -#ifdef VRPN_USE_HDAPI -#include <HD/hd.h> -#else -#include <gstPHANToM.h> -#endif - -#include <math.h> - -#ifdef VRPN_USE_HDAPI -vrpn_HapticVector InstantBuzzEffect::calcEffectForce(void) { -#else -gstVector InstantBuzzEffect::calcEffectForce(void *phantom) { -#endif - // No force if inactive - if (!active) { - return vrpn_HapticVector(0,0,0); - } - -// XXX Needs to be implemented on non-Windows platforms. Use -// the gettimeofday() function to calculate timing on those platforms. -// We might want to switch to vrpn_gettimeofday() on all platforms, since -// that is now implemented on Windows. -#ifdef _WIN32 - LARGE_INTEGER counter; - - if (currentPerformanceFrequency.HighPart == 0 && currentPerformanceFrequency.LowPart == 0) { - return vrpn_HapticVector(0,0,0); - } - - if (QueryPerformanceCounter(&counter) != TRUE){ - fprintf(stderr, "unable to get perfo counter\n"); - return vrpn_HapticVector(0,0,0); - } - - double elapsedSec = (counter.QuadPart - debut.QuadPart) / (double) currentPerformanceFrequency.QuadPart; - if (elapsedSec < getDuration()) { - double currentPart = (counter.QuadPart*getFrequency()/currentPerformanceFrequency.QuadPart); - currentPart = (currentPart-(long)currentPart)*2*PI; - double currentForce = sin(currentPart); - double force = currentForce*getAmplitude(); - return vrpn_HapticVector( x*force, y*force, z*force ); - } -#endif - - return vrpn_HapticVector(0,0,0); -} - -#endif // VRPN_USE_PHANTOM_SERVER diff --git a/src/vrpn/server_src/ghostEffects/InstantBuzzEffect.h b/src/vrpn/server_src/ghostEffects/InstantBuzzEffect.h deleted file mode 100644 index 4cb44f733876df0e184533e572b055b93295403b..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/ghostEffects/InstantBuzzEffect.h +++ /dev/null @@ -1,215 +0,0 @@ -/* -# instantBuzzEffect : instantaneous buzz "custom" effect for Phantom server -# written by Sebastien MARAUX, ONDIM SA (France) -# maraux@ondim.fr -*/ - -#ifndef INSTANT_BUZZ_EFFECT -#define INSTANT_BUZZ_EFFECT - -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif - -#include "vrpn_Shared.h" - -#include <math.h> -#include <stdio.h> -#include "vrpn_Configure.h" -#include "vrpn_ForceDevice.h" - -#ifdef VRPN_USE_PHANTOM_SERVER -#include "ghost.h" - -const double PI=3.1415926535897932384626433832795; - -// Buzz effect for PHANToM. This effect -// vibrates the PHANToM end point along the y-axis -// with a given frequency, amplitude, and duration. -#ifdef VRPN_USE_HDAPI -class InstantBuzzEffect -#else -class InstantBuzzEffect : public gstEffect -#endif -{ - -public: - - // Constructor. -#ifdef VRPN_USE_HDAPI - InstantBuzzEffect() { -#else - InstantBuzzEffect() : gstEffect() { -#endif - frequency = 40.0; - duration = 2.0; - amplitude = 1; - x = 0; - y = 0; - z = 1; -#ifdef _WIN32 - if (QueryPerformanceFrequency(¤tPerformanceFrequency) != TRUE) { - fprintf(stderr, "unable to get performance counter frequency\n"); - currentPerformanceFrequency.QuadPart = 0; - } - debut.QuadPart = 0; -#endif -#ifdef VRPN_USE_HDAPI - active = FALSE; // XXX Should this be true? - time = 0; -#endif - } - - // Destructor. - ~InstantBuzzEffect() {} - - // Set duration of effect [seconds]. - void setDuration(double durInSec) { - if (durInSec <= 0) { -#ifdef VRPN_USE_HDAPI - fprintf(stderr, - "InstantBuzzEffect:setDuration Invalid Duration <= 0 (%lf)\n",durInSec); -#else - gstErrorHandler(GST_BOUNDS_ERROR, - "InstantBuzzEffect:setDuration Invalid Duration <= 0",durInSec); -#endif - return; - } - duration = durInSec; - } - - // Get duration of effect [seconds]. - double getDuration() { return duration; } - - // Set "buzz" frequency [Hz]. - void setFrequency(double newFreq) { - if (newFreq <= 0) { -#ifdef VRPN_USE_HDAPI - fprintf(stderr, - "InstantBuzzEffect:setFrequency Invalid Frequency <= 0 (%lf)\n",newFreq); -#else - gstErrorHandler(GST_BOUNDS_ERROR, - "InstantBuzzEffect:setFrequency Invalid Frequency <= 0",newFreq); -#endif - return; - } - frequency = newFreq; - } - - // Get "buzz" frequency [Hz]. - double getFrequency() { return frequency; } - - // Set amplitude of effect [millimeters]. - void setAmplitude(double newAmp) { - if (newAmp < 0) { -#ifdef VRPN_USE_HDAPI - fprintf(stderr, - "InstantBuzzEffect:setAmplitude Invalid Amplitude <= 0 (%lf)\n",newAmp); -#else - gstErrorHandler(GST_BOUNDS_ERROR, - "InstantBuzzEffect:setAmplitude Invalid Amplitude < 0",newAmp); -#endif - return; - } - amplitude = newAmp; - } - - // Get amplitude of effect [millimeters]. - double getAmplitude() { return amplitude; } - - // Set Direction of effect. - void setDirection(double px, double py, double pz) { - double sqnorm = x*x + y*y + z*z; - if (sqnorm == 1 || sqnorm == 0) { - x=px; - y=py; - z=pz; - } - else { // normalize vector to avoid unexpected amplitude. - - double norm = sqrt(sqnorm); - x = px/norm; - y = py/norm; - z = pz/norm; - } - } - - // Get Direction of effect. - void getDirection(double *px, double *py, double *pz) { - *px=x; - *py=y; - *pz=z; - } - - // FOR_GHOST_EXTENSION: - // Start the effect. WARNING: When re-starting an effect, - // make sure to reset any state, such as past PHANToM position. - // Otherwise, the next call to calcEffectForce could - // generate unexpectedly large forces. - /// Start the application of forces based on the field. - virtual vrpn_HapticBoolean start() { - /*if (!active) { - printf("starting Buzz Effect\n"); - }*/ -#ifdef _WIN32 - LARGE_INTEGER counter; - if (QueryPerformanceCounter(&counter) != TRUE){ - fprintf(stderr, "unable to get perfo counter\n"); - return FALSE; - } - debut = counter; -#endif - active = TRUE; - time = 0.0; - return TRUE; - } - - // FOR_GHOST_EXTENSION: - /// Stop the application of force based on the field. - virtual void stop() { - /*if (active) { - printf("stopping Buzz Effect\n"); - }*/ - active = FALSE; - } - - // FOR_GHOST_EXTENSION: - // Caculate the force. Force is returned in parent - // reference frame of phantom. When subclassing, the first - // parameter should be cast to gstPHANToM to retrieve - // any information about the state of the PHANToM that - // is needed to calculate the forces. deltaT should - // be used to update the time. Also, if the effect is - // not active, the zero vector should be returned. - // ACTUNG! - // WARNING!: Never call PHANToM->setForce or - // PHANToM->setForce_WC from this function. - // It will cause an infinite recursion. -#ifdef VRPN_USE_HDAPI - virtual vrpn_HapticVector calcEffectForce(void); -#else - virtual gstVector calcEffectForce(void *phantom); - virtual gstVector calcEffectForce(void *phantom, gstVector &torques) { - torques.init(0.0, 0.0, 0.0); - return calcEffectForce(phantom); - } -#endif - -protected: - double frequency, amplitude, duration; - double x,y,z; -#ifdef _WIN32 - LARGE_INTEGER currentPerformanceFrequency, debut; -#endif -#ifdef VRPN_USE_HDAPI - bool active; - double time; -#endif -}; - -#endif // VRPN_USE_PHANTOM_SERVER -#endif // INSTANT_BUZZ_EFFECT - diff --git a/src/vrpn/server_src/keycodes.txt b/src/vrpn/server_src/keycodes.txt deleted file mode 100644 index 6c2b277627b0c16f0003b7c3815d5ecbdb1427f4..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/keycodes.txt +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Virtual Keys, Standard Set - */ -#define VK_LBUTTON 0x01 -#define VK_RBUTTON 0x02 -#define VK_CANCEL 0x03 -#define VK_MBUTTON 0x04 /* NOT contiguous with L & RBUTTON */ - -#if(_WIN32_WINNT >= 0x0500) -#define VK_XBUTTON1 0x05 /* NOT contiguous with L & RBUTTON */ -#define VK_XBUTTON2 0x06 /* NOT contiguous with L & RBUTTON */ -#endif /* _WIN32_WINNT >= 0x0500 */ - -/* - * 0x07 : unassigned - */ - -#define VK_BACK 0x08 -#define VK_TAB 0x09 - -/* - * 0x0A - 0x0B : reserved - */ - -#define VK_CLEAR 0x0C -#define VK_RETURN 0x0D - -#define VK_SHIFT 0x10 -#define VK_CONTROL 0x11 -#define VK_MENU 0x12 -#define VK_PAUSE 0x13 -#define VK_CAPITAL 0x14 - -#define VK_KANA 0x15 -#define VK_HANGEUL 0x15 /* old name - should be here for compatibility */ -#define VK_HANGUL 0x15 -#define VK_JUNJA 0x17 -#define VK_FINAL 0x18 -#define VK_HANJA 0x19 -#define VK_KANJI 0x19 - -#define VK_ESCAPE 0x1B - -#define VK_CONVERT 0x1C -#define VK_NONCONVERT 0x1D -#define VK_ACCEPT 0x1E -#define VK_MODECHANGE 0x1F - -#define VK_SPACE 0x20 -#define VK_PRIOR 0x21 -#define VK_NEXT 0x22 -#define VK_END 0x23 -#define VK_HOME 0x24 -#define VK_LEFT 0x25 -#define VK_UP 0x26 -#define VK_RIGHT 0x27 -#define VK_DOWN 0x28 -#define VK_SELECT 0x29 -#define VK_PRINT 0x2A -#define VK_EXECUTE 0x2B -#define VK_SNAPSHOT 0x2C -#define VK_INSERT 0x2D -#define VK_DELETE 0x2E -#define VK_HELP 0x2F - -/* - * VK_0 - VK_9 are the same as ASCII '0' - '9' (0x30 - 0x39) - * 0x40 : unassigned - * VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A) - */ - -#define VK_LWIN 0x5B -#define VK_RWIN 0x5C -#define VK_APPS 0x5D - -/* - * 0x5E : reserved - */ - -#define VK_SLEEP 0x5F - -#define VK_NUMPAD0 0x60 -#define VK_NUMPAD1 0x61 -#define VK_NUMPAD2 0x62 -#define VK_NUMPAD3 0x63 -#define VK_NUMPAD4 0x64 -#define VK_NUMPAD5 0x65 -#define VK_NUMPAD6 0x66 -#define VK_NUMPAD7 0x67 -#define VK_NUMPAD8 0x68 -#define VK_NUMPAD9 0x69 -#define VK_MULTIPLY 0x6A -#define VK_ADD 0x6B -#define VK_SEPARATOR 0x6C -#define VK_SUBTRACT 0x6D -#define VK_DECIMAL 0x6E -#define VK_DIVIDE 0x6F -#define VK_F1 0x70 -#define VK_F2 0x71 -#define VK_F3 0x72 -#define VK_F4 0x73 -#define VK_F5 0x74 -#define VK_F6 0x75 -#define VK_F7 0x76 -#define VK_F8 0x77 -#define VK_F9 0x78 -#define VK_F10 0x79 -#define VK_F11 0x7A -#define VK_F12 0x7B -#define VK_F13 0x7C -#define VK_F14 0x7D -#define VK_F15 0x7E -#define VK_F16 0x7F -#define VK_F17 0x80 -#define VK_F18 0x81 -#define VK_F19 0x82 -#define VK_F20 0x83 -#define VK_F21 0x84 -#define VK_F22 0x85 -#define VK_F23 0x86 -#define VK_F24 0x87 - -/* - * 0x88 - 0x8F : unassigned - */ - -#define VK_NUMLOCK 0x90 -#define VK_SCROLL 0x91 - -/* - * NEC PC-9800 kbd definitions - */ -#define VK_OEM_NEC_EQUAL 0x92 // '=' key on numpad - -/* - * Fujitsu/OASYS kbd definitions - */ -#define VK_OEM_FJ_JISHO 0x92 // 'Dictionary' key -#define VK_OEM_FJ_MASSHOU 0x93 // 'Unregister word' key -#define VK_OEM_FJ_TOUROKU 0x94 // 'Register word' key -#define VK_OEM_FJ_LOYA 0x95 // 'Left OYAYUBI' key -#define VK_OEM_FJ_ROYA 0x96 // 'Right OYAYUBI' key - -/* - * 0x97 - 0x9F : unassigned - */ - -/* - * VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys. - * Used only as parameters to GetAsyncKeyState() and GetKeyState(). - * No other API or message will distinguish left and right keys in this way. - */ -#define VK_LSHIFT 0xA0 -#define VK_RSHIFT 0xA1 -#define VK_LCONTROL 0xA2 -#define VK_RCONTROL 0xA3 -#define VK_LMENU 0xA4 -#define VK_RMENU 0xA5 - -#if(_WIN32_WINNT >= 0x0500) -#define VK_BROWSER_BACK 0xA6 -#define VK_BROWSER_FORWARD 0xA7 -#define VK_BROWSER_REFRESH 0xA8 -#define VK_BROWSER_STOP 0xA9 -#define VK_BROWSER_SEARCH 0xAA -#define VK_BROWSER_FAVORITES 0xAB -#define VK_BROWSER_HOME 0xAC - -#define VK_VOLUME_MUTE 0xAD -#define VK_VOLUME_DOWN 0xAE -#define VK_VOLUME_UP 0xAF -#define VK_MEDIA_NEXT_TRACK 0xB0 -#define VK_MEDIA_PREV_TRACK 0xB1 -#define VK_MEDIA_STOP 0xB2 -#define VK_MEDIA_PLAY_PAUSE 0xB3 -#define VK_LAUNCH_MAIL 0xB4 -#define VK_LAUNCH_MEDIA_SELECT 0xB5 -#define VK_LAUNCH_APP1 0xB6 -#define VK_LAUNCH_APP2 0xB7 - -#endif /* _WIN32_WINNT >= 0x0500 */ - -/* - * 0xB8 - 0xB9 : reserved - */ - -#define VK_OEM_1 0xBA // ';:' for US -#define VK_OEM_PLUS 0xBB // '+' any country -#define VK_OEM_COMMA 0xBC // ',' any country -#define VK_OEM_MINUS 0xBD // '-' any country -#define VK_OEM_PERIOD 0xBE // '.' any country -#define VK_OEM_2 0xBF // '/?' for US -#define VK_OEM_3 0xC0 // '`~' for US - -/* - * 0xC1 - 0xD7 : reserved - */ - -/* - * 0xD8 - 0xDA : unassigned - */ - -#define VK_OEM_4 0xDB // '[{' for US -#define VK_OEM_5 0xDC // '\|' for US -#define VK_OEM_6 0xDD // ']}' for US -#define VK_OEM_7 0xDE // ''"' for US -#define VK_OEM_8 0xDF diff --git a/src/vrpn/server_src/last_of_sequence.C b/src/vrpn/server_src/last_of_sequence.C deleted file mode 100644 index 27650604e5a0dcdf26156ab2e77b431b107c6cb1..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/last_of_sequence.C +++ /dev/null @@ -1,117 +0,0 @@ -// Demo program last_of_sequence -// Shows how to ensure that only the last of a sequence of messages of the -// same type that are waiting to be delivered are actually delivered. -// Minimizes latency. This is actually easier than the most recent period -// of that type, since that requires lots of lookahead if we want to maintain -// ordering. - -// We register two types of messages, foo and bar. -// We expect the client to send streams of many messages of type foo -// punctuated by messages of type bar. -// Every time mainloop is called, we execute all received bar messages, -// the last foo message before each bar message, and the last foo message. - -// f1 f2 f3 m f4 f5 f6 m b1 f7 f8 m f9 f10 b2 m f11 b3 b4 f12 m -// f13 f14 f15 f16 m b5 f17 f18 b6 m f19 b7 f20 f21 b8 m f22 f23 f24 b9 m -// produces -// f3; f6; b1 f8; f10 b2; f11 b3 b4 f12; f16; b5 f18 b6; -// f19 b7 f21 b8; f24 b9 - -// There is one implementation dependency in this example: -// We require that handle_anything_but_foo is called before handle_bar -// to guarantee that ordering is preserved. -// Currently, all callbacks on vrpn_ANY_TYPE are triggered before -// callbacks on individual types. We are in the process of adding to the -// spec the guarantee that if this changes it will be to triggering callbacks -// in the exact order registered. So long as one of those two callback -// ordering policies are followed, this code should work. - -#include <vrpn_Connection.h> -#include <string.h> - -static vrpn_HANDLERPARAM g_fooStore; -static void * g_fooData; - -static vrpn_int32 g_foo_type; -static vrpn_int32 g_bar_type; - -int VRPN_CALLBACK handle_real_foo (void * userdata, vrpn_HANDLERPARAM p); - -int VRPN_CALLBACK handle_anything_but_foo (void * userdata, vrpn_HANDLERPARAM p) { - int retval = 0; - - if (p.type == g_foo_type) { - return retval; - } - - if (g_fooStore.type == g_foo_type) { - retval = handle_real_foo(g_fooData, g_fooStore); - g_fooStore.type = -1; - } - - return retval; -} - -int VRPN_CALLBACK handle_bar (void * userdata, vrpn_HANDLERPARAM p) { - - printf("BAR! At time %ld.%ld.\n", static_cast<long>(p.msg_time.tv_sec), - static_cast<long>(p.msg_time.tv_usec)); - - return 0; -} - -int VRPN_CALLBACK handle_potential_foo (void * userdata, vrpn_HANDLERPARAM p) { - - // HACK - we don't need to delete and new this every time - // if we keep track of its real length. - if (g_fooStore.buffer) { - delete [] g_fooStore.buffer; - } - - g_fooStore = p; - - // HACK - this probably needs to be aligned - g_fooStore.buffer = new char [p.payload_len]; - if (!g_fooStore.buffer) { - fprintf(stderr, "handle_potential_foo: out of memory!\n"); - return -1; - } - memcpy((void *) g_fooStore.buffer, p.buffer, p.payload_len); - - g_fooData = userdata; - - return 0; -} - -int VRPN_CALLBACK handle_real_foo (void * userdata, vrpn_HANDLERPARAM p) { - - printf("FOO! At time %ld.%ld.\n", static_cast<long>(p.msg_time.tv_sec), - static_cast<long>(p.msg_time.tv_usec)); - - return 0; -} - -int main (int argc, char ** argv) { - - vrpn_Connection * c; - vrpn_int32 myId; - - c = vrpn_create_server_connection(); - - myId = c->register_sender ("Me!"); - g_foo_type = c->register_message_type ("Foo?"); - g_bar_type = c->register_message_type ("Bar bar bar bar bar"); - - c->register_handler(vrpn_ANY_TYPE, handle_anything_but_foo, NULL); - c->register_handler(g_foo_type, handle_potential_foo, NULL); - c->register_handler(g_bar_type, handle_bar, NULL); - - while (1) { - c->mainloop(); - - if (g_fooStore.type == g_foo_type) { - handle_real_foo(g_fooData, g_fooStore); - g_fooStore.type = -1; - } - } -} diff --git a/src/vrpn/server_src/make_vrpn_libs_build.cpp b/src/vrpn/server_src/make_vrpn_libs_build.cpp deleted file mode 100644 index 55a6f45901f83cd0d2019cacd8f360202d6079ef..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/make_vrpn_libs_build.cpp +++ /dev/null @@ -1,4 +0,0 @@ -int main(void) -{ - return 0; -} \ No newline at end of file diff --git a/src/vrpn/server_src/miles_sound_server/v5.0/Console.cpp b/src/vrpn/server_src/miles_sound_server/v5.0/Console.cpp deleted file mode 100644 index 7cda05be328ef5f11382d988ad4d4578cad341f8..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v5.0/Console.cpp +++ /dev/null @@ -1,383 +0,0 @@ -/* file:Console.cpp -Creator : Girish Bharadwaj. -Desc:This class will contain all the stuff we need from the -Console.Following is the list I can think of 1. Create a new console and -use it to Write and read console. This will be using AllocConsole -(),WriteConsole() and ReadConsole (). This will be via the win32 APIs. - -2. Use the scanf ,printf,cout ,cin and cerr ( this will be using the CRT -functionality.) Using the WDJ technique given there by Andrew Tucker & -using the KB "How to Spawn a Console App and Redirect Standard Handles" -Article ID: Q126628. - -3. Redirect the output from a console app to a windows GUI app. ( -"Redirection Issues on Windows 95 MS-DOS Apps and Batch Files" Article -ID: Q150956).This will be the fun part. What I would like to see is to -provide an API which takes the console process name as the argument. -That will redirect the stuff to a CString.. which can be read by the -creator. - -4. I am also planning to do a somesort of poor man's debugger.i.e. You -will have an API similar to scanf which takes the input from the user at -run time with a default value to fall back to after sometime specified -by u. if you want to change a particular variable and see the effect, -You can use this. -*/ - -#include "vrpn_Shared.h" -#include <stdio.h> -#include <fcntl.h> -#include <io.h> -#include <wincon.h> -#include "Console.hpp" - -#include <iostream> -#include <fstream> - -#ifndef _USE_OLD_IOSTREAMS -using namespace std; -#endif - -BOOL CConsole::sm_bConsole = FALSE; - -CConsole::CConsole() - { - //default constructor. - m_bRedirected = FALSE; // this is the right place to set this before this - m_sNumColumns = 0; - m_sNumLines = 0; - m_sMaxLines = 0; - m_wAttrib = 0; - } - -CConsole::CConsole(BOOL bCreateConsole) - { - m_bRedirected = FALSE; // this is the right place to set this before this - m_sNumColumns = 0; - m_sNumLines = 0; - m_sMaxLines = 0; - m_wAttrib = 0; - if (bCreateConsole) - CreateConsole (); - //I dont see any reason for not having bCreateConsole false But eh - } - - -CConsole::~CConsole() - { - DestroyConsole (); //We need to remove the Console - } - -BOOL CConsole::CreateConsole () - { - if (sm_bConsole == TRUE) // we have already created a console - { - return FALSE; - } - // I am not allocating the console if there is already one. - - if (!AllocConsole ()) //Just call the Console allocation API - { - sm_bConsole = FALSE; - m_dwError = GetLastError (); //Lets get the error and store it away. - return FALSE; - } - else - { - sm_bConsole = TRUE; //To make sure we wont allocate again - //Lets keep all the stuff around - m_sNumLines = (short)GetSettings (SC_LINES); - m_sNumColumns = (short)GetSettings (SC_COLUMNS); - m_sMaxLines = (short) GetSettings (SC_MAXLINES); - m_wAttrib = GetSettings (SC_ATTRIB); - m_dwError = 0; // Lets keep this zero for the time being. - return TRUE; - } - - } - -BOOL CConsole::DestroyConsole () - { - if (sm_bConsole == FALSE) //There is no console to destroy - return TRUE; //as Well return asif we deleted - if (!FreeConsole ()) - { - sm_bConsole = TRUE; - m_dwError = GetLastError ();//Lets keep the error here if someone wants - return FALSE; - } - else - { - sm_bConsole = FALSE; - return TRUE; - } - } -short CConsole::GetNumberOfLines() - { - return (short) GetSettings (SC_LINES); - } - -short CConsole::SetNumberOfLines (short sLines) - { - short sRes = m_sNumLines; - m_sNumLines = sLines; - SetupConsole (SC_LINES); - return sRes; - } - -short CConsole::SetNumberOfColumns (short sColumns) - { - short sOld = m_sNumColumns; - m_sNumColumns = sColumns; - SetupConsole (SC_COLUMNS); - return sOld; - } - -short CConsole::GetNumberOfColumns () - { - return (short)GetSettings (SC_COLUMNS); - } - -WORD CConsole::GetAttributes () - { - return (short) GetSettings (SC_ATTRIB); - } -WORD CConsole::SetAttributes (WORD wAttrib, short NumChars) - { - WORD wOld = m_wAttrib; - m_wAttrib = wAttrib; - SetupConsole (SC_ATTRIB); - ApplyAttrib(NumChars); - return wOld; - } -short CConsole::SetMaxLinesInWindow (short maxLines) - { - short sOld = m_sMaxLines; - m_sMaxLines = maxLines; - SetupConsole (SC_MAXLINES); - return sOld; - } -short CConsole::GetMaxLinesInWindow () - { - return (short) GetSettings (SC_MAXLINES); - } - -//Now here we have the basic beginning traits of a CConsole. -//But it has to do more than Allocing and Freeing consoles. -//So here it is.. - - -void CConsole::RedirectToConsole (WORD wFlags) - { - int hConHandle; - long lStdHandle; - CONSOLE_SCREEN_BUFFER_INFO coninfo; - FILE *fp; - //First lets see if we already have allocated a console - if (!sm_bConsole) - CreateConsole(); - - lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE); - - // set the screen buffer to be big enough to let us scroll text - GetConsoleScreenBufferInfo((HANDLE)lStdHandle,&coninfo); - SetupConsole (SC_COLUMNS|SC_LINES|SC_ATTRIB|SC_MAXLINES); - - - // redirect unbuffered STDOUT to the console - - hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); - fp = _fdopen( hConHandle, "w" ); - *stdout = *fp; - setvbuf( stdout, NULL, _IONBF, 0 ); - - // redirect unbuffered STDIN to the console - - lStdHandle = (long)GetStdHandle(STD_INPUT_HANDLE); - hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); - fp = _fdopen( hConHandle, "r" ); - *stdin = *fp; - setvbuf( stdin, NULL, _IONBF, 0 ); - - // redirect unbuffered STDERR to the console - - lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE); - hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); - fp = _fdopen( hConHandle, "w" ); - *stderr = *fp; - setvbuf( stderr, NULL, _IONBF, 0 ); - // make cout, wcout, cin, wcin, wcerr, cerr, wclog and clog - // point to console as well - ios::sync_with_stdio(); - m_bRedirected = TRUE; //Whether the Console is redirected - } - -/* -This will be function which will actually set up the console to the user -settings. -*/ -BOOL CConsole::SetupConsole(WORD wFlags) - { - - long lStdHandle; - CONSOLE_SCREEN_BUFFER_INFO coninfo; - - if (!sm_bConsole) - return FALSE; // There aint no console to set up, Duh - - lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE); - // set the screen buffer to be big enough to let us scroll text - GetConsoleScreenBufferInfo((HANDLE)lStdHandle,&coninfo); - - - if (wFlags & SC_COLUMNS ||wFlags & SC_LINES) //Set up only the columns - { - //Number of Columns to be set - if (m_sNumColumns) - coninfo.dwSize.X = m_sNumColumns; - // number of lines to be set - if (m_sNumLines) - coninfo.dwSize.Y = m_sNumLines; - - //Set the screen buffer size - SetConsoleScreenBufferSize((HANDLE)lStdHandle,coninfo.dwSize); - - } - if (wFlags & SC_ATTRIB) - { - //Attributes as specified - if (m_wAttrib) - coninfo.wAttributes = m_wAttrib; - //Set the Text attributes - SetConsoleTextAttribute ((HANDLE)lStdHandle,coninfo.wAttributes); - } - - if (wFlags & SC_MAXLINES) - { - SMALL_RECT rect; - - //Maximum Size of the window - if (m_sMaxLines) - rect.Bottom= m_sMaxLines; - else - rect.Bottom = coninfo.dwMaximumWindowSize.Y; - - if (m_sNumColumns) - rect.Right = m_sNumColumns; - else - rect.Right = coninfo.dwMaximumWindowSize.X; - rect.Top = rect.Left = 0; - - //Set the console window maximum size - SetConsoleWindowInfo ((HANDLE)lStdHandle,TRUE, - &rect); - } - return TRUE; - - } - -HANDLE CConsole::GetHandle (DWORD dwFlag) - { - if (!sm_bConsole) - return (HANDLE) NULL; - return GetStdHandle (dwFlag); - } - -BOOL CConsole::Clear () - { - COORD coordScreen = { 0, 0 }; /* here's where we'll home the - cursor */ - BOOL bSuccess; - DWORD cCharsWritten; - CONSOLE_SCREEN_BUFFER_INFO csbi; /* to get buffer info */ - DWORD dwConSize; /* number of character cells in - the current buffer */ - - if (!sm_bConsole) - return FALSE; - HANDLE hConsole = GetHandle (STD_OUTPUT_HANDLE); - - /* get the number of character cells in the current buffer */ - - - bSuccess = GetConsoleScreenBufferInfo( hConsole, &csbi ); - dwConSize = csbi.dwSize.X * csbi.dwSize.Y; - if (!bSuccess) return bSuccess; - - /* fill the entire screen with blanks */ - - bSuccess = FillConsoleOutputCharacter( hConsole, (TCHAR) ' ', - dwConSize, coordScreen, &cCharsWritten ); - if (!bSuccess) return bSuccess; - - /* get the current text attribute */ - - bSuccess = GetConsoleScreenBufferInfo( hConsole, &csbi ); - if (!bSuccess) return bSuccess; - - /* now set the buffer's attributes accordingly */ - - bSuccess = FillConsoleOutputAttribute( hConsole, csbi.wAttributes, - dwConSize, coordScreen, &cCharsWritten ); - if (!bSuccess) return bSuccess; - - /* put the cursor at (0, 0) */ - - bSuccess = SetConsoleCursorPosition( hConsole, coordScreen ); - if (!bSuccess) return bSuccess; - return TRUE; - } - -BOOL CConsole::ApplyAttrib (short NumChars) - { - COORD coordScreen = { 0, 0 }; /* here's where we'll home the - cursor */ - BOOL bSuccess; - DWORD cCharsWritten; - CONSOLE_SCREEN_BUFFER_INFO csbi; /* to get buffer info */ - DWORD dwConSize; /* number of character cells in - the current buffer */ - if (!sm_bConsole) - return FALSE; - HANDLE hConsole = GetHandle (STD_OUTPUT_HANDLE); - bSuccess = GetConsoleScreenBufferInfo( hConsole, &csbi ); - - if (!bSuccess) return bSuccess; - - dwConSize = csbi.dwSize.X * csbi.dwSize.Y; - bSuccess = FillConsoleOutputAttribute( hConsole, csbi.wAttributes, - NumChars?NumChars:dwConSize, csbi.dwCursorPosition, &cCharsWritten ); - - return bSuccess; - } - -WORD CConsole::GetSettings (WORD wFlags) - { - long lStdHandle; - CONSOLE_SCREEN_BUFFER_INFO coninfo; - - if (!sm_bConsole) - return FALSE; // There aint no console to set up, Duh - - lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE); - // set the screen buffer to be big enough to let us scroll text - GetConsoleScreenBufferInfo((HANDLE)lStdHandle,&coninfo); - - switch (wFlags) - { - case SC_ATTRIB: - return coninfo.wAttributes; - break; - case SC_LINES: - return coninfo.dwSize.Y; - break; - case SC_MAXLINES: - return coninfo.dwMaximumWindowSize.Y; - break; - case SC_COLUMNS: - return coninfo.dwSize.X; - break; - } - return 0; - } - diff --git a/src/vrpn/server_src/miles_sound_server/v5.0/Console.hpp b/src/vrpn/server_src/miles_sound_server/v5.0/Console.hpp deleted file mode 100644 index edc93a31fb5ce79ace5e91a200308f3ddbc7128b..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v5.0/Console.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef __CONSOLE_H__ -#define __CONSOLE_H__ - - - -//Some defines we will be requiring -#define SC_LINES 0x0001 -#define SC_COLUMNS 0x0002 -#define SC_ATTRIB 0x0004 -#define SC_MAXLINES 0x0008 - -class CConsole -{ - public: - //Constructor & Destructor - CConsole (); - CConsole (BOOL); - ~CConsole (); - - //Properties - short GetNumberOfLines(); - short SetNumberOfLines (short sLines); - short SetNumberOfColumns (short sColumns); - short GetNumberOfColumns (); - WORD GetAttributes (); - WORD SetAttributes (WORD wAttrib,short NumChars = 0); - short SetMaxLinesInWindow (short maxLines); - short GetMaxLinesInWindow (); - - //Methods - void RedirectToConsole (WORD wFlags); - BOOL SetupConsole(WORD wFlags); - HANDLE GetHandle (DWORD dwFlag); - BOOL Clear (); - BOOL ApplyAttrib (short NumChars); - WORD GetSettings (WORD wFlags); - - - //Helpers - BOOL CreateConsole (); - BOOL DestroyConsole (); - - protected: - BOOL m_bRedirected; - short m_sNumColumns; - short m_sNumLines; - WORD m_wAttrib; - short m_sMaxLines; - DWORD m_dwError; - static BOOL sm_bConsole; - -}; -#endif //__CONSOLE_H__ diff --git a/src/vrpn/server_src/miles_sound_server/v5.0/SoundServerWin32.aps b/src/vrpn/server_src/miles_sound_server/v5.0/SoundServerWin32.aps deleted file mode 100644 index bd5492fdad9083fdd2802daa14e1f17cf761b6f2..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/miles_sound_server/v5.0/SoundServerWin32.aps and /dev/null differ diff --git a/src/vrpn/server_src/miles_sound_server/v5.0/SoundServerWin32.rc b/src/vrpn/server_src/miles_sound_server/v5.0/SoundServerWin32.rc deleted file mode 100644 index d9b22cb9a2c6dcf633a4de155f792e56e875df90..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v5.0/SoundServerWin32.rc +++ /dev/null @@ -1,193 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -#include "c:\miles\mss.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -SOUNDSERVERWIN32 DIALOG DISCARDABLE 100, 100, 319, 230 -STYLE WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "VRPN Sound Server v1.0a" -CLASS "SoundServerWin32" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX " Digital Sound Controls: ",IDC_STATIC,5,6,310,45 - LTEXT "Choose the 3D &technology to use:",IDC_STATIC,15,20,105, - 8 - COMBOBOX 100,15,30,178,108,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - PUSHBUTTON "&Stop all sounds",110,45,210,61,12 - PUSHBUTTON "&Close",112,225,210,60,12 - EDITTEXT 114,55,190,255,12,ES_MULTILINE | ES_AUTOHSCROLL | - ES_READONLY - LTEXT "Y",IDC_STATIC,20,110,10,10 - LTEXT "X",IDC_STATIC,20,95,10,10 - LTEXT "Z",IDC_STATIC,20,125,8,8 - EDITTEXT 120,30,95,30,10,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER - EDITTEXT 121,30,110,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 122,30,125,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - COMBOBOX 131,15,65,40,45,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | - WS_TABSTOP - GROUPBOX "Position",IDC_STATIC,15,85,50,55 - GROUPBOX "Current sound",IDC_STATIC,5,55,140,115 - GROUPBOX "Orientation",IDC_STATIC,75,85,60,55 - GROUPBOX "",IDC_STATIC,5,180,310,25 - LTEXT "Z",IDC_STATIC,85,95,8,8 - LTEXT "Y",IDC_STATIC,85,110,8,8 - LTEXT "X",IDC_STATIC,85,125,8,8 - EDITTEXT 300,100,95,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 301,100,110,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 302,100,125,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - LTEXT "Last Error:",IDC_STATIC,10,190,40,8 - GROUPBOX "Listener",IDC_STATIC,155,55,160,115 - EDITTEXT 141,180,95,35,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 142,180,110,35,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 143,180,125,35,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - LTEXT "X",IDC_STATIC,170,95,8,10 - LTEXT "Y",IDC_STATIC,170,110,10,10 - LTEXT "Z",IDC_STATIC,170,125,10,10 - LTEXT "Z",IDC_STATIC,245,95,8,8 - LTEXT "Y",IDC_STATIC,245,110,8,8 - LTEXT "X",IDC_STATIC,245,125,8,8 - EDITTEXT 303,260,95,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 304,260,110,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 305,260,125,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - GROUPBOX "Position",IDC_STATIC,165,85,55,55 - GROUPBOX "Orientation",IDC_STATIC,240,85,55,55 - PUSHBUTTON "More Info",162,87,66,40,15 - LTEXT "Distance to listener:",IDC_STATIC,15,150,65,9 - EDITTEXT 181,85,145,46,13,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER -END - -SND_INFO DIALOG DISCARDABLE 120, 120, 209, 85 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Sound Information" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Volume",IDC_STATIC,20,5,30,10 - LTEXT "Replay Rate:",IDC_STATIC,105,5,45,10 - EDITTEXT 115,64,5,30,12,ES_AUTOHSCROLL | ES_READONLY - EDITTEXT 116,155,5,30,12,ES_AUTOHSCROLL | ES_READONLY - GROUPBOX "Distances",IDC_STATIC,10,30,185,40 - LTEXT "Min Front",IDC_STATIC,25,40,35,10 - EDITTEXT 151,65,40,30,10,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER - LTEXT "Max Front",IDC_STATIC,25,55,35,10 - LTEXT "Min Back",IDC_STATIC,115,40,35,10 - LTEXT "Max Back",IDC_STATIC,115,55,35,10 - EDITTEXT 152,65,55,30,10,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER - EDITTEXT 153,155,40,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 154,155,55,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - LTEXT "(Automatically closes in 5 seconds)",IDC_STATIC,51,75, - 108,10 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -VRPN ICON DISCARDABLE "SoundServer.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""windows.h""\r\n" - "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""c:\\miles\\mss.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - "SND_INFO", DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 202 - TOPMARGIN, 7 - BOTTOMMARGIN, 78 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/src/vrpn/server_src/miles_sound_server/v5.0/readme.txt b/src/vrpn/server_src/miles_sound_server/v5.0/readme.txt deleted file mode 100644 index 9eb304008b9416f8161d23fe417b903b0534c990..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v5.0/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ - Should copy sound_server.exe to c:\miles_sound_server. Might need to -make this directory if it doesn't exist. Also project expects Miles stuff -to be at c:\miles. \ No newline at end of file diff --git a/src/vrpn/server_src/miles_sound_server/v5.0/resource.h b/src/vrpn/server_src/miles_sound_server/v5.0/resource.h deleted file mode 100644 index 9c5421de43f43777c17d4eff22334c89d152951c..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v5.0/resource.h +++ /dev/null @@ -1,17 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by SoundServerWin32.rc -// -#define IDC_CUSTOM1 1032 -#define IDC_STATIC -1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1033 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/src/vrpn/server_src/miles_sound_server/v5.0/sound_server.cpp b/src/vrpn/server_src/miles_sound_server/v5.0/sound_server.cpp deleted file mode 100644 index b03b5fd1f69448ae7753c2a341bf7ebb65dba685..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v5.0/sound_server.cpp +++ /dev/null @@ -1,678 +0,0 @@ -#include "vrpn_Shared.h" - -#ifdef _WIN32 -#include <windowsx.h> -#include <conio.h> -#include "resource.h" -#include <commctrl.h> -#endif - -#include <stdlib.h> -#include <math.h> -#include <string.h> -#include <stdio.h> -#include <fcntl.h> -#include <iostream> - -#ifdef _WIN32 -#include "Console.hpp" -#endif - -#ifndef _USE_OLD_OSTREAMS -using namespace std; -#endif - -#include "vrpn_Connection.h" -#include "vrpn_Tracker.h" -#include "vrpn_Sound.h" - -#ifdef _WIN32 -#include "vrpn_Sound_Miles.h" -#endif -#include "vrpn_ForwarderController.h" - -#define SOUND_DEBUG 1 - -//Sound Server Specifics -#ifdef _WIN32 -vrpn_Sound_Server_Miles *soundServer = NULL; - -#define DIALOG_TIMEOUT 5000 -#define UPDATE_TIMEOUT 2000 - -#define cboxTech 100 -#define btnPlay 101 -#define btnStop 110 -#define btnClose 112 -#define ErrorBox 114 -#define VolumeBox 115 -#define ReplayBox 116 -#define SoundIdBox 131 - -#define PosX 120 -#define PosY 121 -#define PosZ 122 - -#define LPosX 141 -#define LPosY 142 -#define LPosZ 143 - -#define FMin 151 -#define FMax 152 -#define BMin 153 -#define BMax 154 - -#define SoundIdTBox 161 -#define MoreInfoBtn 162 - -#define Sound2Listener 181 - -#define SorX 300 -#define SorY 301 -#define SorZ 302 -#define LorX 303 -#define LorY 304 -#define LorZ 305 - -#define UpdateTimerId 1001 -#define DialogTimerId 1002 -int blanked = 0; -int ProviderSet = 0; - -int got_report; - -HWND SoundProvideCombo; -HWND SoundIdCombo; -HWND SoundWnd; -HWND InfoWnd; - -vrpn_Tracker_Remote * tracker_connection; -char tracker_device[512]; -char tracker_name[512]; -vrpn_ListenerDef listener, oldlistener; - -int USE_TRACKER; - -enum BoxAction{add, del}; - -vrpn_int32 CurrentSoundId = -1; -#endif - -vrpn_Connection * connection; - -// TCH October 1998 -// Use Forwarder as remote-controlled multiple connections. -vrpn_Forwarder_Server * forwarderServer; - -//Console for Win32 version of server -#ifdef _WIN32 -CConsole *con; -#endif - -// install a signal handler to shut down the trackers and buttons -#ifndef WIN32 -#include <signal.h> -void closeDevices(); - -void sighandler (int) -{ - closeDevices(); - delete connection; - exit(0); -} -#endif - -void closeDevices (void) { - cerr << endl << "All devices closed. Exiting ..." << endl; -} - -void handle_tracker(void *, const vrpn_TRACKERCB t) { - - q_xyz_quat_type sensor_f_tracker; // aka hiball_f_tracker or hiball_f_source - qogl_matrix_type sensor_f_tracker_m; - qogl_matrix_type eyeball_f_tracker_m; - q_xyz_quat_type eyeball_f_tracker; - - sensor_f_tracker.xyz[0] = t.pos[0]; - sensor_f_tracker.xyz[1] = t.pos[1]; - sensor_f_tracker.xyz[2] = t.pos[2]; - sensor_f_tracker.quat[0] = t.quat[0]; - sensor_f_tracker.quat[1] = t.quat[1]; - sensor_f_tracker.quat[2] = t.quat[2]; - sensor_f_tracker.quat[3] = t.quat[3]; - - q_xyz_quat_to_ogl_matrix(sensor_f_tracker_m, &sensor_f_tracker); - - // need to compose with the eye_from_sensor matrix here - - qogl_matrix_mult(eyeball_f_tracker_m, soundServer->eye_f_sensor_m, sensor_f_tracker_m); - - q_ogl_matrix_to_xyz_quat(&eyeball_f_tracker, eyeball_f_tracker_m); - - listener.pose.position[0] = eyeball_f_tracker.xyz[0]; - listener.pose.position[1] = eyeball_f_tracker.xyz[1]; - listener.pose.position[2] = eyeball_f_tracker.xyz[2]; - listener.pose.orientation[0] = eyeball_f_tracker.quat[0]; - listener.pose.orientation[1] = eyeball_f_tracker.quat[1]; - listener.pose.orientation[2] = eyeball_f_tracker.quat[2]; - listener.pose.orientation[3] = eyeball_f_tracker.quat[3]; - - got_report = 1; - - return; -} - -void UpdateListenerDef() { - if (listener.pose.orientation != oldlistener.pose.orientation) - soundServer->changeListenerStatus(listener); - oldlistener = oldlistener; -} - -int handle_dlc (void *, vrpn_HANDLERPARAM p) -{ - closeDevices(); - delete connection; - exit(0); - return 0; -} - -void shutDown (void) -{ - closeDevices(); -#ifdef _WIN32 - if (soundServer) - soundServer->shutDown(); - con->DestroyConsole(); -#endif - delete connection; - exit(0); - return; -} - -#ifdef _WIN32 - -void ChangeSoundIdBox(vrpn_int32 action, vrpn_int32 newId) { - char numbuf[3]; - - sprintf(numbuf,"%d",newId); - ComboBox_AddString(SoundIdCombo,numbuf); -} - - -void UpdateDialog(HWND SoundWnd) { - - float posx, posy, posz, orx, ory, orz; - float lposx, lposy, lposz; - char buf[15]; - - SetDlgItemText(SoundWnd,ErrorBox,soundServer->GetLastError()); - - soundServer->GetCurrentPosition(CurrentSoundId, &posx, &posy, &posz); - sprintf(buf,"%4.3f",posx); - SetDlgItemText(SoundWnd,PosX,buf); - sprintf(buf,"%4.3f",posy); - SetDlgItemText(SoundWnd,PosY,buf); - sprintf(buf,"%4.3f",posz); - SetDlgItemText(SoundWnd,PosZ,buf); - - soundServer->GetListenerPosition(&lposx, &lposy, &lposz); - sprintf(buf,"%4.3f",lposx); - SetDlgItemText(SoundWnd,LPosX,buf); - sprintf(buf,"%4.3f",lposy); - SetDlgItemText(SoundWnd,LPosY,buf); - sprintf(buf,"%4.3f",lposz); - SetDlgItemText(SoundWnd,LPosZ,buf); - - soundServer->GetCurrentOrientation(CurrentSoundId, &orx, &ory, &orz); - sprintf(buf,"%4.3f",orx); - SetDlgItemText(SoundWnd,SorX,buf); - sprintf(buf,"%4.3f",ory); - SetDlgItemText(SoundWnd,SorY,buf); - sprintf(buf,"%4.3f",orz); - SetDlgItemText(SoundWnd,SorZ,buf); - - soundServer->GetListenerOrientation(&orx, &ory, &orz); - sprintf(buf,"%4.3f",orx); - SetDlgItemText(SoundWnd,LorX,buf); - sprintf(buf,"%4.3f",ory); - SetDlgItemText(SoundWnd,LorY,buf); - sprintf(buf,"%4.3f",orz); - SetDlgItemText(SoundWnd,LorZ,buf); - - sprintf(buf,"%4.3f",sqrt((lposx-posx)*(lposx-posx)+ - (lposy-posy)*(lposy-posy)+ - (lposz-posz)*(lposz-posz))); - SetDlgItemText(SoundWnd,Sound2Listener,buf); - - -} - -/****************************************************************************** - Sound Server Window Section - *****************************************************************************/ -LRESULT AILEXPORT SoundServerProc(HWND SoundWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - HWND h; - float fmin, fmax, bmin, bmax; - char buf[15]; - - switch (message) - { - - case WM_SETFOCUS: // deal with the focus in this weird dialog-window - h=GetWindow(SoundWnd,GW_CHILD); - while (h) { - if ((GetWindowLong(h,GWL_STYLE)&0x2f)==BS_DEFPUSHBUTTON) { - SetFocus(h); - goto found; - } - h=GetNextWindow(h,GW_HWNDNEXT); - } - SetFocus(GetWindow(SoundWnd,GW_CHILD)); - found: - break; - - case WM_CTLCOLORBTN: - case WM_CTLCOLORSTATIC: - SetBkColor((HDC)wParam,RGB(192,192,192)); - return((LRESULT)GetStockObject(LTGRAY_BRUSH)); - - case WM_HSCROLL: - return 0; - - case WM_COMMAND: - - switch (LOWORD(wParam)) - { - - case cboxTech: - if (HIWORD(wParam) == CBN_SELENDOK) - if (ComboBox_GetCurSel(SoundProvideCombo)-1 >= 0) { - ProviderSet = 1; - soundServer->setProvider(ComboBox_GetCurSel(SoundProvideCombo)-1); - } else ProviderSet = 0; - - break; - case MoreInfoBtn: - SetDlgItemInt(InfoWnd,VolumeBox,soundServer->GetCurrentVolume(CurrentSoundId),1); - SetDlgItemInt(InfoWnd,ReplayBox,soundServer->GetCurrentPlaybackRate(CurrentSoundId),1); - soundServer->GetCurrentDistances(CurrentSoundId, &fmin, &fmax, &bmin, &bmax); - sprintf(buf,"%4.3f",fmin); - SetDlgItemText(InfoWnd,FMin,buf); - sprintf(buf,"%4.3f",fmax); - SetDlgItemText(InfoWnd,FMax,buf); - sprintf(buf,"%4.3f",bmin); - SetDlgItemText(InfoWnd,BMin,buf); - sprintf(buf,"%4.3f",bmax); - SetDlgItemText(InfoWnd,BMax,buf); - if (CurrentSoundId >= 0) - sprintf(buf,"Sound: %d",CurrentSoundId); - else - sprintf(buf,"Sound: none selected"); - SetWindowText(InfoWnd,buf); - ShowWindow(InfoWnd,SW_SHOW); - SetTimer(SoundWnd,DialogTimerId,DIALOG_TIMEOUT,NULL); - break; - - case SoundIdBox: - if (HIWORD(wParam) == CBN_SELENDOK) { - if (ComboBox_GetCurSel(SoundProvideCombo)-1 >= 0) { - CurrentSoundId = ComboBox_GetCurSel(SoundIdCombo); - UpdateDialog(SoundWnd); - } - } - break; - - - case btnStop: - soundServer->stopAllSounds(); - break; - - case IDCLOSE: - ShowWindow(InfoWnd,SW_HIDE); - break; - case btnClose: - - DestroyWindow(SoundWnd); - soundServer->shutDown(); - break; - } - return 0; - - case WM_DESTROY: - PostQuitMessage(0); - return 0; - case WM_TIMER: - // if there is no provider set then updating will cause an error! - if (wParam == UpdateTimerId) { - if (ProviderSet) - UpdateDialog(SoundWnd); - } - else { - ShowWindow(InfoWnd, SW_HIDE); - KillTimer(SoundWnd, DialogTimerId); - } - break; - } - - return DefWindowProc(SoundWnd,message,wParam,lParam); -} - -static void add_providers() -{ - char* name; - HPROVIDER provider; - - HPROENUM next = HPROENUM_FIRST; - - SoundProvideCombo=GetDlgItem(SoundWnd,cboxTech); - - ComboBox_AddString(SoundProvideCombo,"Choose a provider..."); - - while (AIL_enumerate_3D_providers(&next, &provider, &name)) - { - ComboBox_AddString(SoundProvideCombo,name); - soundServer->addProvider(provider); - } - - ComboBox_SetCurSel(SoundProvideCombo,0); -} - -bool InitSoundServerWindow(HINSTANCE hInstance) -{ - WNDCLASS wc; - BOOL rc; - static char szAppName[] = "SoundServerWin32"; - - wc.lpszClassName = szAppName; - wc.lpfnWndProc = (WNDPROC) SoundServerProc; - wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(hInstance,"VRPN"); - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = reinterpret_cast<HBRUSH>(GetStockObject(LTGRAY_BRUSH)); - wc.cbClsExtra = 0; - wc.cbWndExtra = DLGWINDOWEXTRA; - wc.lpszMenuName = NULL; - - rc = RegisterClass(&wc); - if (!rc) - return false; - - InitCommonControls(); - - SoundWnd = CreateDialog(hInstance,(LPCSTR)"SOUNDSERVERWIN32",0,NULL); - DWORD error = GetLastError(); - if (!SoundWnd) { - fprintf(stderr,"%ld\n",error); - return false; - } - // set a timer to update server stats - SetTimer(SoundWnd,UpdateTimerId,UPDATE_TIMEOUT,NULL); - SoundIdCombo=GetDlgItem(SoundWnd, SoundIdBox); - - ShowWindow(SoundWnd,SW_SHOW); - InfoWnd = CreateDialog(hInstance,(LPCSTR)"SND_INFO",0,NULL); - error = GetLastError(); - if (!InfoWnd) { - fprintf(stderr,"%ld\n",error); - return false; - } - - ShowWindow(InfoWnd,SW_HIDE); - - return true; -} - -#endif //Win32 -/****************************************************************************** - End Sound Server Window Section - *****************************************************************************/ - -int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) -{ -#ifdef _WIN32 - MSG msg; -#endif - char * config_file_name = "vrpn.cfg"; - FILE * config_file; - char * client_name = NULL; - int client_port; - int bail_on_error = 1; - int verbose = 1; - int auto_quit = 0; - int realparams = 0; - int loop = 0; - int port = vrpn_DEFAULT_LISTEN_PORT_NO; -#ifdef WIN32 - WSADATA wsaData; - int status; - if ((status = WSAStartup(MAKEWORD(1,1), &wsaData)) != 0) - { - fprintf(stderr, "WSAStartup failed with %d\n", status); - return(1); - } -#else -#ifdef sgi - sigset( SIGINT, sighandler ); - sigset( SIGKILL, sighandler ); - sigset( SIGTERM, sighandler ); - sigset( SIGPIPE, sighandler ); -#else - signal( SIGINT, sighandler ); - signal( SIGKILL, sighandler ); - signal( SIGTERM, sighandler ); - signal( SIGPIPE, sighandler ); -#endif // sgi -#endif - - con = new CConsole(TRUE); - con->RedirectToConsole(0); - - // TCH 2 Nov 99 - debugging code - vrpn_Connection * trackerCon; - - USE_TRACKER = 0; - - // Need to have a global pointer to it so we can shut it down - // in the signal handler (so we can close any open logfiles.) - - connection = new vrpn_Synchronized_Connection (port); - - // Open the configuration file - if (verbose) printf("Reading from config file %s\n", config_file_name); - if ( (config_file = fopen(config_file_name, "r")) == NULL) - { - perror("Cannot open config file"); - fprintf(stderr," (filename %s)\n", config_file_name); - return -1; - } - - // Read the configuration file, creating a device for each entry. - // Each entry is on one line, which starts with the name of the - // class of the object that is to be created. - // If we fail to open a certain device, print a message and decide - // whether we should bail. - { - char line[512]; // Line read from the input file - char *pch; - char scrap[512], s2[512]; - - // Read lines from the file until we run out - while ( fgets(line, sizeof(line), config_file) != NULL ) - { - - // Make sure the line wasn't too long - if (strlen(line) >= sizeof(line)-1) - { - fprintf(stderr,"Line too long in config file: %s\n",line); - if (bail_on_error) { return -1; } - else { continue; } // Skip this line - } - - if ((strlen(line)<3)||(line[0]=='#')) - { - // comment or empty line -- ignore - continue; - } - - // copy for strtok work - strncpy(scrap, line, sizeof(line) - 1); - // Figure out the device from the name and handle appropriately - - // WARNING: SUBSTRINGS WILL MATCH THE EARLIER STRING, SO - // ADD AN EMPTY SPACE TO THE END OF STATIC STRINGS!!!! - - // #define isit(s) !strncmp(line,s,strlen(s)) -#define isit(s) !strcmp(pch=strtok(scrap," \t"),s) -#define next() pch += strlen(pch) + 1 - -#ifdef _WIN32 - if(isit("vrpn_Sound_Server")) - { - fprintf(stderr,"%s\n",pch); - next(); - fprintf(stderr,"%s\n",pch); - if (sscanf(pch,"%511s\t%d\t%511s\t%511s",s2,&USE_TRACKER,tracker_name, tracker_device) != 4) - { - fprintf(stderr,"Bad vrpn_Server_Sound line: %s\n",line); - if (bail_on_error) - { - return -1; - } - else - { - continue; - } // Skip this line - } - fprintf(stderr,"ok\n"); - - - if (InitSoundServerWindow(hInstance) != true) - fprintf(stderr, "Didn't open window!\n"); - - soundServer = NULL; - soundServer = new vrpn_Sound_Server_Miles(s2, connection); - if (soundServer == NULL) - fprintf(stderr,"Can't create sound server\n"); - add_providers(); - } -#endif - - } - } - - // Close the configuration file - fclose(config_file); - - // Open remote tracker if we are to use one - - if (USE_TRACKER) { - - char newname[1024]; - sprintf(newname,"%s@%s",(const char*)tracker_device, (const char*)tracker_name); - fprintf(stderr,"Using tracker: %s\n",newname); - trackerCon = vrpn_get_connection_by_name(tracker_name); - tracker_connection = new vrpn_Tracker_Remote((const char *) newname); - //if (tracker_connection!=NULL) fprintf(stderr,"Connection set up correctly\n"); - int val = tracker_connection->register_change_handler(NULL,handle_tracker); - fprintf(stderr," Handler set up %d\n",val); - - if (trackerCon->doing_okay()) { - fprintf(stderr, "TC OK.\n"); - } else { - fprintf(stderr, "TC Not OK.\n"); - } - } - else fprintf(stderr,"Not using tracker\n"); - - // Open the Forwarder Server - forwarderServer = new vrpn_Forwarder_Server (connection); - - loop = 0; - if (auto_quit) - { - int dlc_m_id = connection->register_message_type( - vrpn_dropped_last_connection); - connection->register_handler(dlc_m_id, handle_dlc, NULL); - } - - if (client_name) - { - fprintf(stderr, "vrpn_serv: connecting to client: %s:%d\n", - client_name, client_port); - if (connection->connect_to_client(client_name, client_port)) - { - fprintf(stderr, "server: could not connect to client %s:%d\n", client_name, client_port); - shutDown(); - } - } - - // ******************************************************************** - // ** ** - // ** MAIN LOOP ** - // ** ** - // ******************************************************************** - while (1) { - - GetMessage(&msg, 0, 0, 0); - if (!IsDialogMessage(SoundWnd,&msg)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - if (USE_TRACKER && trackerCon->doing_okay() && ProviderSet) { - fprintf(stderr,"%d %d %d\n",USE_TRACKER, trackerCon->doing_okay(), ProviderSet); - UpdateListenerDef(); - } - - soundServer->mainloop(); - if (soundServer->noSounds()) { - EnableWindow(SoundProvideCombo, true); - - if (!blanked) { - ComboBox_ResetContent(SoundIdCombo); - Edit_SetText(GetDlgItem(SoundWnd, ErrorBox), ""); - Edit_SetText(GetDlgItem(SoundWnd, LPosX), ""); - Edit_SetText(GetDlgItem(SoundWnd, LPosY), ""); - Edit_SetText(GetDlgItem(SoundWnd, LPosZ), ""); - Edit_SetText(GetDlgItem(SoundWnd, SorX), ""); - Edit_SetText(GetDlgItem(SoundWnd, SorY), ""); - Edit_SetText(GetDlgItem(SoundWnd, SorZ), ""); - Edit_SetText(GetDlgItem(SoundWnd, LorX), ""); - Edit_SetText(GetDlgItem(SoundWnd, LorY), ""); - Edit_SetText(GetDlgItem(SoundWnd, LorZ), ""); - Edit_SetText(GetDlgItem(SoundWnd, PosX), ""); - Edit_SetText(GetDlgItem(SoundWnd, PosY), ""); - Edit_SetText(GetDlgItem(SoundWnd, PosZ), ""); - - blanked = 1; - } - } - else { - EnableWindow(SoundProvideCombo, false); - blanked = 0; - } - - - // ensure we get a new report! - if (USE_TRACKER) { - tracker_connection->mainloop(); - got_report = 0; - if (trackerCon->doing_okay()) - while (!got_report) - tracker_connection->mainloop(); - } - - // Send and receive all messages - connection->mainloop(); - if (!connection->doing_okay()) shutDown(); - - // Handle forwarding requests; send messages - // on auxiliary connections - forwarderServer->mainloop(); - } - - return 0; -} diff --git a/src/vrpn/server_src/miles_sound_server/v5.0/sound_server.dsp b/src/vrpn/server_src/miles_sound_server/v5.0/sound_server.dsp deleted file mode 100644 index f662254d7888cf5912ab1608d300534931647efa..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v5.0/sound_server.dsp +++ /dev/null @@ -1,140 +0,0 @@ -# Microsoft Developer Studio Project File - Name="sound_server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=sound_server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "sound_server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "sound_server.mak" CFG="sound_server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "sound_server - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "sound_server - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "sound_server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "sound_server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../.." /I "../../quat" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /YX /FD /D /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ..\..\quat\Debug\quat.lib odbc32.lib odbccp32.lib c:\miles\mss32.lib wsock32.lib comctl32.lib ../../../pc_win32/Debug/vrpn.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /pdb:none -# Begin Special Build Tool -SOURCE="$(InputPath)" -PostBuild_Desc=Copy SOund -PostBuild_Cmds=cp Debug\sound_server.exe c:\Miles_Sound_Server\sound_server.exe -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "sound_server - Win32 Release" -# Name "sound_server - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\Console.cpp -# End Source File -# Begin Source File - -SOURCE=.\sound_server.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Sound_Miles.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\Console.hpp -# End Source File -# Begin Source File - -SOURCE=.\sound_server.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Sound_Miles.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\soundserver.ico -# End Source File -# Begin Source File - -SOURCE=.\SoundServerWin32.rc -# End Source File -# End Group -# End Target -# End Project diff --git a/src/vrpn/server_src/miles_sound_server/v5.0/sound_server.dsw b/src/vrpn/server_src/miles_sound_server/v5.0/sound_server.dsw deleted file mode 100644 index 6344456c6be7181681cf711bd83506cff79f0a16..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v5.0/sound_server.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "sound_server"=.\sound_server.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/vrpn/server_src/miles_sound_server/v5.0/soundserver.ico b/src/vrpn/server_src/miles_sound_server/v5.0/soundserver.ico deleted file mode 100644 index b83c2f3303ea88362eeab3c2e1f11e68b4a3902b..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/miles_sound_server/v5.0/soundserver.ico and /dev/null differ diff --git a/src/vrpn/server_src/miles_sound_server/v5.0/vrpn_Sound_Miles.cpp b/src/vrpn/server_src/miles_sound_server/v5.0/vrpn_Sound_Miles.cpp deleted file mode 100644 index 7be3e02ed7f445477da0a73b8a65f4c012c4b766..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v5.0/vrpn_Sound_Miles.cpp +++ /dev/null @@ -1,569 +0,0 @@ - -#ifdef _WIN32 - -#include "vrpn_Sound_Miles.h" -//#include "quat.h" -#include <math.h> -#include <iostream.h> - -/******************************************************************************************** - Begin vrpn_Sound_Server_Miles - *******************************************************************************************/ -vrpn_Sound_Server_Miles::vrpn_Sound_Server_Miles(const char * name, vrpn_Connection * c) - : vrpn_Sound_Server(name, c) -{ - AIL_startup(); //initialize the Miles SDK stuff - - - //load a digital driver - if (!AIL_quick_startup(1,0,44100,16,2)) { - MessageBox(0,"Couldn't open a digital output device.","Error",MB_OK); - } - - AIL_quick_handles(&DIG,0,0); - - - // No sound played yet - LastSoundId = -1; - - provider = 0; - //Set variables to control size and growing of Audio handle array - H_Max = vrpn_Sound_START; - H_Cur = 0; - - //Allocate space for Audio Handle array - samples = new H3DSAMPLE[H_Max]; - - //Set variables to control size and growing of providers array - P_Max = vrpn_Sound_START; - P_Cur = 0; - - //Allocate space for Audio Handle array - providers = new HPROVIDER[P_Max]; - - // init eye from sensor matrix - eye_f_sensor_m[0] = 1.0; - eye_f_sensor_m[1] = 0.0; - eye_f_sensor_m[2] = 0.0; - eye_f_sensor_m[3] = 0.0; - eye_f_sensor_m[4] = 0.0; - eye_f_sensor_m[5] = 1.0; - eye_f_sensor_m[6] = 0.0; - eye_f_sensor_m[7] = 0.0; - eye_f_sensor_m[8] = 0.0; - eye_f_sensor_m[9] = 0.0; - eye_f_sensor_m[10] = 1.0; - eye_f_sensor_m[11] = 0.0; - eye_f_sensor_m[12] = 0.0; - eye_f_sensor_m[13] = 0.0; - eye_f_sensor_m[14] = 0.0; - eye_f_sensor_m[15] = 1.0; - -} - -vrpn_Sound_Server_Miles::~vrpn_Sound_Server_Miles() -{ - shutDown(); - delete [] samples; -} - -void vrpn_Sound_Server_Miles::shutDown() -{ - unloadAllSounds(); - AIL_close_3D_provider(provider); - - /*These two calls must be made before trying to exit or the - program will hang when you try to quit.*/ - AIL_waveOutClose(DIG); - AIL_shutdown(); -} - -void vrpn_Sound_Server_Miles::addProvider(HPROVIDER p) -{ - if (P_Cur >= P_Max) - { - int i; - HPROVIDER *oldproviders; - - oldproviders = providers; - - P_Max *= 2; - providers = new HPROVIDER[P_Max]; - - for(i = 0; i < P_Cur; i++) - providers[i] = oldproviders[i]; - - delete [] oldproviders; - } - - providers[P_Cur] = p; - P_Cur++; -} - -bool vrpn_Sound_Server_Miles::noSounds() -{ - int i; - - for(i = 0; i < H_Cur; i++) - if (samples[i] != NULL) - return false; - - return true; -} - -void vrpn_Sound_Server_Miles::setProvider(int index, int providerRoomSetting) -{ - DWORD result; - - unloadAllSounds(); - //If a provider is already open, then close it - AIL_close_3D_provider(provider); - - //load the new provider - - result = AIL_open_3D_provider(providers[index]); - if (result != M3D_NOERR) { - fprintf(stderr,"Error Opening 3D Provider: %s\n",AIL_last_error()); - } - else { - - provider = providers[index]; - //open a listener. Position defaults to the origin, looking down the -Z axis with ( - listener = AIL_open_3D_listener(provider); - AIL_set_3D_position(listener, 0, 0, 0); - AIL_set_3D_orientation(listener, 0, 0, -1, 0, 1, 0); - AIL_set_3D_velocity(listener, 0, 0, 0, 0); - //set a room style - AIL_set_3D_provider_preference(provider, "EAX environment selection", &providerRoomSetting); - } -} - -void vrpn_Sound_Server_Miles::unloadHandle(vrpn_SoundID id) -//unloads a handle corresponding to id from samples -{ - vrpn_int32 SIndex; - - SIndex = map_CIndex_To_SIndex(id); - if (SIndex != vrpn_Sound_FAIL) - { - samples[SIndex] = NULL; - set_CIndex_To_SIndex(id, vrpn_Sound_FAIL); - } -} - -void vrpn_Sound_Server_Miles::chooseProvider(char *ThreeDProvider) -/*chooses a 3D audio provider. -See the comment below the constructor in the .h for more info.*/ - -//a better way really should be implemented to choose a provider -{ - char* name; - HPROENUM next = HPROENUM_FIRST; - while (AIL_enumerate_3D_providers(&next, &provider, &name)) - { - if(strcmp(name, ThreeDProvider) == 0) - break; - } -} - -void vrpn_Sound_Server_Miles::unloadAllSounds() -//clears out samples -{ - for(vrpn_int32 i = 0; i < H_Cur; i++) - { - if (samples[i] == NULL) - continue; - S32 status = AIL_3D_sample_status(samples[i]); - if(status == SMP_DONE || status == SMP_STOPPED) - //if handle is loaded and not playing, unload - { - AIL_release_3D_sample_handle(samples[i]); - } - if(status == SMP_PLAYING) - //if handle is playing, stop then unload - { - AIL_stop_3D_sample(samples[i]); - AIL_release_3D_sample_handle(samples[i]); - } - - } - H_Cur = 0; -} - -void vrpn_Sound_Server_Miles::addSample(H3DSAMPLE sample, vrpn_SoundID id) -//adds sample to the location in samples corresponding to id -{ - if (H_Cur >= H_Max) - { - int i; - H3DSAMPLE *oldsamples; - - oldsamples = samples; - - H_Max *= 2; - samples = new H3DSAMPLE[H_Max]; - - for(i = 0; i < H_Cur; i++) - samples[i] = oldsamples[i]; - - delete [] oldsamples; - } - - if (samples != NULL) - { - samples[H_Cur] = sample; - set_CIndex_To_SIndex(id, H_Cur); - H_Cur++; - } - else - set_CIndex_To_SIndex(id, vrpn_Sound_FAIL); - -} - -H3DSAMPLE vrpn_Sound_Server_Miles::getSample(vrpn_SoundID id) -//gets the handle stored in samples[id] -{ - vrpn_int32 SIndex; - - SIndex = map_CIndex_To_SIndex(id); - - if (SIndex == vrpn_Sound_FAIL) - return NULL; - else - return samples[SIndex]; -} - -void vrpn_Sound_Server_Miles::loadSound(char* filename, vrpn_SoundID id) -/*loads a .wav file into memory. gives back id to reference the sound -currently (7/28/99) this does not reuse space previously vacated in -samples by unloading sounds*/ -{ - if (provider != 0) { - fprintf(stdout,"Loading sound: #%d %s\n", id, filename); - ChangeSoundIdBox(0,id); - //load into handle - unsigned long *s; - long type; - H3DSAMPLE handle; - void *sample_address; - void *d; - AILSOUNDINFO info; - - LastSoundId = id; - - //load the .wav file into memory - s = (unsigned long *)AIL_file_read(filename, FILE_READ_WITH_SIZE); - - if (s==0) - return; - - type=AIL_file_type(s+1,s[0]); - - switch (type) { - case AILFILETYPE_PCM_WAV: - sample_address = s+1; - break; - - case AILFILETYPE_ADPCM_WAV: - AIL_WAV_info(s+1,&info); - AIL_decompress_ADPCM(&info,&d,0); - AIL_mem_free_lock(s); - sample_address = d; - break; - - default: - AIL_mem_free_lock(s); - return; - } - - //initialize handle - handle = AIL_allocate_3D_sample_handle(provider); - //tell handle where the .wav file is in memory - AIL_set_3D_sample_file(handle, sample_address); - //set defaults - AIL_set_3D_sample_volume(handle, 100); //default volume is 100 on 0...127 inclusive - AIL_set_3D_position(handle,0,0,0); - AIL_set_3D_orientation(handle, 0,0,-1,0,1,0); - AIL_set_3D_velocity(handle,0,0,-1,0); - AIL_set_3D_sample_distances(handle, 200, 20, 200, 20); - - //load handle into samples - addSample(handle, id); - - /*Sample level environment preferences (ie, EAX_ENVIRONMENT_BATHROOM) - could be added in here as a passed-in parameter*/ - } - else fprintf(stderr,"No provider has been set prior to LoadSound\n"); -} - -void vrpn_Sound_Server_Miles::changeSoundStatus(vrpn_SoundID id, vrpn_SoundDef soundDef) -{ - vrpn_float32 uX = 0, uY = 1, uZ = 0; // up vector - - if (provider != 0) { - - //get pose info from quaternion in soundDef, put it into the above vectors - AIL_set_3D_position(getSample(id),soundDef.pose.position[0] , soundDef.pose.position[1], soundDef.pose.position[2]); - - // normalize - soundDef.pose.orientation[0] /= soundDef.pose.orientation[3]; - soundDef.pose.orientation[1] /= soundDef.pose.orientation[3]; - soundDef.pose.orientation[2] /= soundDef.pose.orientation[3]; - soundDef.pose.orientation[3] /= soundDef.pose.orientation[3]; - - AIL_set_3D_orientation(getSample(id), soundDef.pose.orientation[0], soundDef.pose.orientation[1], soundDef.pose.orientation[2], uX, uY, uZ); - - AIL_set_3D_velocity(getSample(id), soundDef.velocity[0], soundDef.velocity[1], soundDef.velocity[2], soundDef.velocity[3]); - - /*set the volume to the new level.*/ - AIL_set_3D_sample_volume(getSample(id), soundDef.volume); - - - // Since the RSX software sets max front/back to 128.0 * min front/back, - // we will divide max front/back by 128 and set this to min - // before giving it to miles - // We will change GetCurrentDistances to multiply by 128.0 before displaying - // value to the user.. This mess may need to be cleaned up if the Miles people - // come to their senses... - - soundDef.min_back_dist = soundDef.max_back_dist / 128.0; - soundDef.min_front_dist = soundDef.max_front_dist / 128.0; - - AIL_set_3D_sample_distances(getSample(id), soundDef.max_front_dist, soundDef.min_front_dist, soundDef.max_back_dist, soundDef.min_back_dist); - } - else fprintf(stderr,"No provider has been set prior to changeSoundStatus\n"); -} - -void vrpn_Sound_Server_Miles::playSound(vrpn_SoundID id, vrpn_int32 repeat, vrpn_SoundDef soundDef) -{ - if (provider != 0) { - fprintf(stderr,"Playing sound: %d\n",id); - // update last sound played record - LastSoundId = id; - - changeSoundStatus(id, soundDef); - AIL_set_3D_sample_loop_count(getSample(id), repeat); - - //if not playing, play - //if playing already modify parameters in p for pose, - //vel, etc but ignore loop count - - switch(AIL_3D_sample_status(getSample(id))) { - case SMP_DONE: - case SMP_STOPPED: { - AIL_start_3D_sample(getSample(id)); - break; } - case SMP_PLAYING: { - //it's already playing. - //new repeat info is ignored. new pose and velocity info was set above - break; } - default: { - /*It shouldn't occur that one of the above cases isn't triggered. If error - messages back to the client are ever implemented, one should be keyed here*/ - break; } - } - } else fprintf(stderr,"No provider has been set prior to playSound\n"); -} - - -void vrpn_Sound_Server_Miles::stopSound(vrpn_SoundID id) -/*immediately stops playing the sound referred to by id -the sound can be restarted*/ -{ - if (provider != 0) { - AIL_stop_3D_sample(getSample(id)); - } else fprintf(stderr,"No provider has been set prior to stopSound\n"); -} - -void vrpn_Sound_Server_Miles::stopAllSounds() -{ - if (provider != 0) { - int i; - - for(i = 0; i < H_Cur; i++) - AIL_stop_3D_sample(getSample(i)); - } else fprintf(stderr,"No provider has been set prior to stopAllSound\n"); -} - -void vrpn_Sound_Server_Miles::unloadSound(vrpn_SoundID id) -/*unloads id from samples. -Sets the corresponding cell in samples to FAIL. */ -{ - if (provider != 0) { - AIL_release_3D_sample_handle(getSample(id)); - unloadHandle(id); - } else fprintf(stderr,"No provider has been set prior to unloadSound\n"); -} - -void vrpn_Sound_Server_Miles::changeListenerStatus(vrpn_ListenerDef listenerDef) -//change pose, etc for listener -{ - if (provider != 0) { - vrpn_float32 uX = 0, uY = 1, uZ = 0; - - AIL_set_3D_position(listener, listenerDef.pose.position[0], listenerDef.pose.position[1], listenerDef.pose.position[2]); - - // normalize - listenerDef.pose.orientation[0] /= listenerDef.pose.orientation[3]; - listenerDef.pose.orientation[1] /= listenerDef.pose.orientation[3]; - listenerDef.pose.orientation[2] /= listenerDef.pose.orientation[3]; - listenerDef.pose.orientation[3] /= listenerDef.pose.orientation[3]; - - q_matrix_type mymatrix; - q_matrix_type multmatrix; - q_type facevec; - - q_to_row_matrix(mymatrix, listenerDef.pose.orientation); - - // 90 degree rotation about x - multmatrix[0][0] = 1; - multmatrix[0][1] = 0; - multmatrix[0][2] = 0; - multmatrix[0][3] = 0; - - multmatrix[1][0] = 0; - multmatrix[1][1] = 0; - multmatrix[1][2] = -1; - multmatrix[1][3] = 0; - - multmatrix[2][0] = 0; - multmatrix[2][1] = 1; - multmatrix[2][2] = 0; - multmatrix[2][3] = 0; - - multmatrix[3][0] = 0; - multmatrix[3][1] = 0; - multmatrix[3][2] = 0; - multmatrix[3][3] = 1; - - q_matrix_mult(mymatrix, mymatrix, multmatrix); - - q_from_row_matrix(facevec, mymatrix); - - AIL_set_3D_orientation(listener, listenerDef.pose.orientation[0], listenerDef.pose.orientation[1], listenerDef.pose.orientation[2], facevec[0], facevec[1], facevec[2]); - - AIL_set_3D_velocity(listener, listenerDef.velocity[0], listenerDef.velocity[1], listenerDef.velocity[2], listenerDef.velocity[3]); - } else fprintf(stderr,"No provider has been set prior to changeListenerStatus\n"); -} - -void vrpn_Sound_Server_Miles::changeE_f_S_m(qogl_matrix_type newmatrix) { - qogl_matrix_copy(eye_f_sensor_m, newmatrix); - return; -} - -void vrpn_Sound_Server_Miles::initModel(vrpn_ModelDef modelDef) { - qogl_matrix_copy(eye_f_sensor_m, modelDef.eye_from_sensor_matrix); -} - -void vrpn_Sound_Server_Miles::mainloop(const timeval *timeout) -{ - if (!connection->connected()) - { - unloadAllSounds(); - unloadCSMap(); - } - connection->mainloop(timeout); -} - -vrpn_int32 vrpn_Sound_Server_Miles::GetCurrentVolume(const vrpn_int32 CurrentSoundId) { - if ((CurrentSoundId > -1) && (provider != 0)) { - return (vrpn_int32) AIL_3D_sample_volume(getSample(CurrentSoundId)); } - else return -1; - } - -char * vrpn_Sound_Server_Miles::GetLastError() { - return AIL_last_error(); -} - -vrpn_int32 vrpn_Sound_Server_Miles::GetCurrentPlaybackRate(const vrpn_int32 CurrentSoundId) { - if ((CurrentSoundId > -1) && (provider != 0)) - return (vrpn_int32) AIL_3D_sample_playback_rate(getSample(CurrentSoundId)); - else return -1; -} - -void vrpn_Sound_Server_Miles::GetCurrentPosition(const vrpn_int32 CurrentSoundId,F32* X_val, F32* Y_val, F32* Z_val) { - if ((CurrentSoundId > -1) && (provider != 0)) - AIL_3D_position(getSample(CurrentSoundId),X_val,Y_val,Z_val); - else { - *X_val = -1; - *Y_val = -1; - *Z_val = -1; - } -return; -} - -void vrpn_Sound_Server_Miles::GetListenerPosition(F32* X_val, F32* Y_val, F32* Z_val) { - if (provider != 0) - AIL_3D_position(listener,X_val,Y_val,Z_val); - -return; -} - -void vrpn_Sound_Server_Miles::GetListenerOrientation(F32 *X_val, F32 *Y_val, F32 *Z_val) { - - q_vec_type angles; - q_matrix_type colMatrix; - q_type srcQuat; - F32 X_f, Y_f, Z_f, X_u, Y_u, Z_u; - - - if (provider != 0) { - - AIL_3D_orientation(listener,&X_f,&Y_f,&Z_f,&X_u,&Y_u,&Z_u); - - srcQuat[0] = X_f; - srcQuat[1] = Y_f; - srcQuat[2] = Z_f; - - srcQuat[3] = 1.0; - - q_to_col_matrix (colMatrix, srcQuat); - q_col_matrix_to_euler(angles,colMatrix); - - *X_val = angles[0]*180.0/Q_PI; - *Y_val = angles[1]*180.0/Q_PI; - *Z_val = angles[2]*180.0/Q_PI; - } - -return; -} - -void vrpn_Sound_Server_Miles::GetCurrentOrientation(const vrpn_int32 CurrentSoundId,F32 *X_val, F32 *Y_val, F32 *Z_val) { - - F32 X_f, Y_f, Z_f, X_u, Y_u, Z_u; - q_vec_type angles; - q_matrix_type colMatrix; - q_type srcQuat; - - if ((CurrentSoundId > -1) && (provider != 0)) { - AIL_3D_orientation(getSample(CurrentSoundId),&X_f,&Y_f,&Z_f,&X_u,&Y_u,&Z_u); - srcQuat[0] = X_f; - srcQuat[1] = Y_f; - srcQuat[2] = Z_f; - - srcQuat[3] = 1.0; - - q_to_col_matrix (colMatrix, srcQuat); - q_col_matrix_to_euler(angles,colMatrix); - - *X_val = angles[0]*180.0/Q_PI; - *Y_val = angles[1]*180.0/Q_PI; - *Z_val = angles[2]*180.0/Q_PI; - } - -return; -} - -void vrpn_Sound_Server_Miles::GetCurrentDistances(const vrpn_int32 CurrentSoundId, F32* FMin, F32* FMax, F32* BMin, F32* BMax) { - if (CurrentSoundId > -1) { - AIL_3D_sample_distances(getSample(CurrentSoundId), FMax, FMin, BMax, BMin); - *FMin *= 128.0; // multiply by 128.0 since we divided before setting them - *BMin *= 128.0; - } - else { - *FMin = *FMax = *BMin = *BMax = 0; - } -} - - -#endif diff --git a/src/vrpn/server_src/miles_sound_server/v5.0/vrpn_Sound_Miles.h b/src/vrpn/server_src/miles_sound_server/v5.0/vrpn_Sound_Miles.h deleted file mode 100644 index 98675b20c72e1d2ead6ac84496156e07ee006817..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v5.0/vrpn_Sound_Miles.h +++ /dev/null @@ -1,112 +0,0 @@ - -#ifndef VRPN_SOUND_MILES - - -#ifdef _WIN32 - -#include "c:\miles\mss.h" -#include "vrpn_Sound.h" -#include "quat.h" - -extern void ChangeSoundIdBox(vrpn_int32 action, vrpn_int32 newId); - -class vrpn_Sound_Server_Miles : public vrpn_Sound_Server -{ -public: - vrpn_Sound_Server_Miles(const char * name, vrpn_Connection * c); - /*Name is the sender name. c is the connection. - ThreeDProvider is the 3D audio provider. Creative, huh. - It provides 3D audio on a level underneath the Miles code and can - be swapped out when a new provider comes along. This will just - necessitate including the provider file in the application directory - and #defining an alias for it's name string so that it can be passed - to the constructor. - The providerRoomSetting parameter changes the type of environment - the 3D audio provider will simulate. There are a number of - possibilities, including (all prefaced with "EAX_ENVIRONMENT_") - ROOM, BATHROOM, LIVINGROOM, CARPETEDHALLWAY, and HALLWAY. The - complete list is on page 214 of the MSS 5.0 manual. */ - ~vrpn_Sound_Server_Miles(); - - void setProvider(int index, int providerRoomSetting = EAX_ENVIRONMENT_GENERIC); - //Set the 3D sound provider - void playSound(vrpn_SoundID id, vrpn_int32 repeat, vrpn_SoundDef soundDef); - /*vrpn_SoundID's are used to access sounds in memory. One is set - by calling loadSound. - repeat is the number of times to play the sound. Use 0 for the sound - to loop until stopped. - soundDef has pose, velocity, and volume information - */ - void stopSound(vrpn_SoundID id); - //immediately stops playing the sound referred to by id - void loadSound(char* filename, vrpn_SoundID id); - /*loads a .wav file into memory. - gives back id to reference the sound - currently (7/28/99) this does not reuse space previously - vacated in samples by unloading sounds*/ - void unloadSound(vrpn_SoundID id); - /*unloads id from samples. - Sets the corresponding cell in samples to FAIL. */ - void changeListenerStatus(vrpn_ListenerDef listenerDef); - /*sets the listener's pose and velocity to what is passed in*/ - void changeSoundStatus(vrpn_SoundID id, vrpn_SoundDef soundDef); - /*sets the sounds's pose and velocity to what is passed in. - If the sound is playing changes take place immediately. - If not nothing happens. */ - void initModel(vrpn_ModelDef modelDef); - - void changeE_f_S_m(qogl_matrix_type newmatrix); // sets the eye_from_sensor matrix - - void addProvider(HPROVIDER p); - void mainloop(const struct timeval * timeout=NULL); - bool noSounds(void); - void stopAllSounds(); - void shutDown(); - vrpn_int32 GetCurrentVolume(const vrpn_int32 CurrentSoundId); - char * GetLastError(); - vrpn_int32 GetCurrentPlaybackRate(const vrpn_int32 CurrentSoundId); - void GetCurrentPosition(const vrpn_int32 CurrentSoundId, F32* X_val, F32* Y_val, F32* Z_val); - void GetListenerPosition(F32* X_val, F32* Y_val, F32* Z_val); - void GetCurrentDistances(const vrpn_int32 CurrentSoundId, F32* FMin, F32* FMax, F32* BMin, F32* BMax); - void GetListenerOrientation(F32* X_val, F32 *Y_val, F32 *Z_val); - void GetCurrentOrientation(const vrpn_int32 CurrentSoundId,F32 *X_val, F32 *Y_val, F32 *Z_val); - - vrpn_int32 LastSoundId; //ID of last played sound - - qogl_matrix_type eye_f_sensor_m; // this is the matrix that goes from the - // sensor to the eyeball space (so for example - // it could be eyeball_f_hiballsensor [ where - // hiballsensor would be the hiball mounted - // on the HMD - -private: - - H3DSAMPLE* samples; /*audio handles for Miles, used as an array - accessed with getSample and addSample, - which are passed soundID's*/ - HDIGDRIVER DIG; //digital driver - HPROVIDER provider; //Current 3D audio provider - HPROVIDER *providers; //3D audio provider - H3DPOBJECT listener; //listener - - vrpn_int32 H_Max; //size of array samples - vrpn_int32 H_Cur; //index in samples - vrpn_int32 P_Max; //size of array samples - vrpn_int32 P_Cur; //index in samples - - void addSample(H3DSAMPLE sample, vrpn_SoundID id); - //adds a sample to the location in samples corresponding to id - H3DSAMPLE getSample(vrpn_SoundID id); - //gets the handle stored in samples[id] - void chooseProvider(char * ThreeDProvider); - /*chooses a 3D audio provider. - See the comment below the constructor for more info.*/ - void unloadAllSounds(); //clears out samples - void unloadHandle(vrpn_SoundID id); - //unloads a handle corresponding to id from samples - bool InitWindow(HINSTANCE hInstance); //Initializes the dialog window -}; -#endif //_WIN32 -#define VRPN_SOUND_MILES - -#endif \ No newline at end of file diff --git a/src/vrpn/server_src/miles_sound_server/v6.0/Console.cpp b/src/vrpn/server_src/miles_sound_server/v6.0/Console.cpp deleted file mode 100644 index e6f40b45528eb72380b22cf48fcabca9d65a9ebb..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v6.0/Console.cpp +++ /dev/null @@ -1,383 +0,0 @@ -/* file:Console.cpp -Creator : Girish Bharadwaj. -Desc:This class will contain all the stuff we need from the -Console.Following is the list I can think of 1. Create a new console and -use it to Write and read console. This will be using AllocConsole -(),WriteConsole() and ReadConsole (). This will be via the win32 APIs. - -2. Use the scanf ,printf,cout ,cin and cerr ( this will be using the CRT -functionality.) Using the WDJ technique given there by Andrew Tucker & -using the KB "How to Spawn a Console App and Redirect Standard Handles" -Article ID: Q126628. - -3. Redirect the output from a console app to a windows GUI app. ( -"Redirection Issues on Windows 95 MS-DOS Apps and Batch Files" Article -ID: Q150956).This will be the fun part. What I would like to see is to -provide an API which takes the console process name as the argument. -That will redirect the stuff to a CString.. which can be read by the -creator. - -4. I am also planning to do a somesort of poor man's debugger.i.e. You -will have an API similar to scanf which takes the input from the user at -run time with a default value to fall back to after sometime specified -by u. if you want to change a particular variable and see the effect, -You can use this. -*/ - -#include <windows.h> -#include <stdio.h> -#include <fcntl.h> -#include <io.h> -#include <wincon.h> -#include "Console.hpp" - -#include <iostream> -#include <fstream> - -#ifndef _USE_OLD_IOSTREAMS -using namespace std; -#endif - -BOOL CConsole::sm_bConsole = FALSE; - -CConsole::CConsole() - { - //default constructor. - m_bRedirected = FALSE; // this is the right place to set this before this - m_sNumColumns = 0; - m_sNumLines = 0; - m_sMaxLines = 0; - m_wAttrib = 0; - } - -CConsole::CConsole(BOOL bCreateConsole) - { - m_bRedirected = FALSE; // this is the right place to set this before this - m_sNumColumns = 0; - m_sNumLines = 0; - m_sMaxLines = 0; - m_wAttrib = 0; - if (bCreateConsole) - CreateConsole (); - //I dont see any reason for not having bCreateConsole false But eh - } - - -CConsole::~CConsole() - { - DestroyConsole (); //We need to remove the Console - } - -BOOL CConsole::CreateConsole () - { - if (sm_bConsole == TRUE) // we have already created a console - { - return FALSE; - } - // I am not allocating the console if there is already one. - - if (!AllocConsole ()) //Just call the Console allocation API - { - sm_bConsole = FALSE; - m_dwError = GetLastError (); //Lets get the error and store it away. - return FALSE; - } - else - { - sm_bConsole = TRUE; //To make sure we wont allocate again - //Lets keep all the stuff around - m_sNumLines = (short)GetSettings (SC_LINES); - m_sNumColumns = (short)GetSettings (SC_COLUMNS); - m_sMaxLines = (short) GetSettings (SC_MAXLINES); - m_wAttrib = GetSettings (SC_ATTRIB); - m_dwError = 0; // Lets keep this zero for the time being. - return TRUE; - } - - } - -BOOL CConsole::DestroyConsole () - { - if (sm_bConsole == FALSE) //There is no console to destroy - return TRUE; //as Well return asif we deleted - if (!FreeConsole ()) - { - sm_bConsole = TRUE; - m_dwError = GetLastError ();//Lets keep the error here if someone wants - return FALSE; - } - else - { - sm_bConsole = FALSE; - return TRUE; - } - } -short CConsole::GetNumberOfLines() - { - return (short) GetSettings (SC_LINES); - } - -short CConsole::SetNumberOfLines (short sLines) - { - short sRes = m_sNumLines; - m_sNumLines = sLines; - SetupConsole (SC_LINES); - return sRes; - } - -short CConsole::SetNumberOfColumns (short sColumns) - { - short sOld = m_sNumColumns; - m_sNumColumns = sColumns; - SetupConsole (SC_COLUMNS); - return sOld; - } - -short CConsole::GetNumberOfColumns () - { - return (short)GetSettings (SC_COLUMNS); - } - -WORD CConsole::GetAttributes () - { - return (short) GetSettings (SC_ATTRIB); - } -WORD CConsole::SetAttributes (WORD wAttrib, short NumChars) - { - WORD wOld = m_wAttrib; - m_wAttrib = wAttrib; - SetupConsole (SC_ATTRIB); - ApplyAttrib(NumChars); - return wOld; - } -short CConsole::SetMaxLinesInWindow (short maxLines) - { - short sOld = m_sMaxLines; - m_sMaxLines = maxLines; - SetupConsole (SC_MAXLINES); - return sOld; - } -short CConsole::GetMaxLinesInWindow () - { - return (short) GetSettings (SC_MAXLINES); - } - -//Now here we have the basic beginning traits of a CConsole. -//But it has to do more than Allocing and Freeing consoles. -//So here it is.. - - -void CConsole::RedirectToConsole (WORD wFlags) - { - int hConHandle; - long lStdHandle; - CONSOLE_SCREEN_BUFFER_INFO coninfo; - FILE *fp; - //First lets see if we already have allocated a console - if (!sm_bConsole) - CreateConsole(); - - lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE); - - // set the screen buffer to be big enough to let us scroll text - GetConsoleScreenBufferInfo((HANDLE)lStdHandle,&coninfo); - SetupConsole (SC_COLUMNS|SC_LINES|SC_ATTRIB|SC_MAXLINES); - - - // redirect unbuffered STDOUT to the console - - hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); - fp = _fdopen( hConHandle, "w" ); - *stdout = *fp; - setvbuf( stdout, NULL, _IONBF, 0 ); - - // redirect unbuffered STDIN to the console - - lStdHandle = (long)GetStdHandle(STD_INPUT_HANDLE); - hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); - fp = _fdopen( hConHandle, "r" ); - *stdin = *fp; - setvbuf( stdin, NULL, _IONBF, 0 ); - - // redirect unbuffered STDERR to the console - - lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE); - hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); - fp = _fdopen( hConHandle, "w" ); - *stderr = *fp; - setvbuf( stderr, NULL, _IONBF, 0 ); - // make cout, wcout, cin, wcin, wcerr, cerr, wclog and clog - // point to console as well - ios::sync_with_stdio(); - m_bRedirected = TRUE; //Whether the Console is redirected - } - -/* -This will be function which will actually set up the console to the user -settings. -*/ -BOOL CConsole::SetupConsole(WORD wFlags) - { - - long lStdHandle; - CONSOLE_SCREEN_BUFFER_INFO coninfo; - - if (!sm_bConsole) - return FALSE; // There aint no console to set up, Duh - - lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE); - // set the screen buffer to be big enough to let us scroll text - GetConsoleScreenBufferInfo((HANDLE)lStdHandle,&coninfo); - - - if (wFlags & SC_COLUMNS ||wFlags & SC_LINES) //Set up only the columns - { - //Number of Columns to be set - if (m_sNumColumns) - coninfo.dwSize.X = m_sNumColumns; - // number of lines to be set - if (m_sNumLines) - coninfo.dwSize.Y = m_sNumLines; - - //Set the screen buffer size - SetConsoleScreenBufferSize((HANDLE)lStdHandle,coninfo.dwSize); - - } - if (wFlags & SC_ATTRIB) - { - //Attributes as specified - if (m_wAttrib) - coninfo.wAttributes = m_wAttrib; - //Set the Text attributes - SetConsoleTextAttribute ((HANDLE)lStdHandle,coninfo.wAttributes); - } - - if (wFlags & SC_MAXLINES) - { - SMALL_RECT rect; - - //Maximum Size of the window - if (m_sMaxLines) - rect.Bottom= m_sMaxLines; - else - rect.Bottom = coninfo.dwMaximumWindowSize.Y; - - if (m_sNumColumns) - rect.Right = m_sNumColumns; - else - rect.Right = coninfo.dwMaximumWindowSize.X; - rect.Top = rect.Left = 0; - - //Set the console window maximum size - SetConsoleWindowInfo ((HANDLE)lStdHandle,TRUE, - &rect); - } - return TRUE; - - } - -HANDLE CConsole::GetHandle (DWORD dwFlag) - { - if (!sm_bConsole) - return (HANDLE) NULL; - return GetStdHandle (dwFlag); - } - -BOOL CConsole::Clear () - { - COORD coordScreen = { 0, 0 }; /* here's where we'll home the - cursor */ - BOOL bSuccess; - DWORD cCharsWritten; - CONSOLE_SCREEN_BUFFER_INFO csbi; /* to get buffer info */ - DWORD dwConSize; /* number of character cells in - the current buffer */ - - if (!sm_bConsole) - return FALSE; - HANDLE hConsole = GetHandle (STD_OUTPUT_HANDLE); - - /* get the number of character cells in the current buffer */ - - - bSuccess = GetConsoleScreenBufferInfo( hConsole, &csbi ); - dwConSize = csbi.dwSize.X * csbi.dwSize.Y; - if (!bSuccess) return bSuccess; - - /* fill the entire screen with blanks */ - - bSuccess = FillConsoleOutputCharacter( hConsole, (TCHAR) ' ', - dwConSize, coordScreen, &cCharsWritten ); - if (!bSuccess) return bSuccess; - - /* get the current text attribute */ - - bSuccess = GetConsoleScreenBufferInfo( hConsole, &csbi ); - if (!bSuccess) return bSuccess; - - /* now set the buffer's attributes accordingly */ - - bSuccess = FillConsoleOutputAttribute( hConsole, csbi.wAttributes, - dwConSize, coordScreen, &cCharsWritten ); - if (!bSuccess) return bSuccess; - - /* put the cursor at (0, 0) */ - - bSuccess = SetConsoleCursorPosition( hConsole, coordScreen ); - if (!bSuccess) return bSuccess; - return TRUE; - } - -BOOL CConsole::ApplyAttrib (short NumChars) - { - COORD coordScreen = { 0, 0 }; /* here's where we'll home the - cursor */ - BOOL bSuccess; - DWORD cCharsWritten; - CONSOLE_SCREEN_BUFFER_INFO csbi; /* to get buffer info */ - DWORD dwConSize; /* number of character cells in - the current buffer */ - if (!sm_bConsole) - return FALSE; - HANDLE hConsole = GetHandle (STD_OUTPUT_HANDLE); - bSuccess = GetConsoleScreenBufferInfo( hConsole, &csbi ); - - if (!bSuccess) return bSuccess; - - dwConSize = csbi.dwSize.X * csbi.dwSize.Y; - bSuccess = FillConsoleOutputAttribute( hConsole, csbi.wAttributes, - NumChars?NumChars:dwConSize, csbi.dwCursorPosition, &cCharsWritten ); - - return bSuccess; - } - -WORD CConsole::GetSettings (WORD wFlags) - { - long lStdHandle; - CONSOLE_SCREEN_BUFFER_INFO coninfo; - - if (!sm_bConsole) - return FALSE; // There aint no console to set up, Duh - - lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE); - // set the screen buffer to be big enough to let us scroll text - GetConsoleScreenBufferInfo((HANDLE)lStdHandle,&coninfo); - - switch (wFlags) - { - case SC_ATTRIB: - return coninfo.wAttributes; - break; - case SC_LINES: - return coninfo.dwSize.Y; - break; - case SC_MAXLINES: - return coninfo.dwMaximumWindowSize.Y; - break; - case SC_COLUMNS: - return coninfo.dwSize.X; - break; - } - return 0; - } - diff --git a/src/vrpn/server_src/miles_sound_server/v6.0/Console.hpp b/src/vrpn/server_src/miles_sound_server/v6.0/Console.hpp deleted file mode 100644 index edc93a31fb5ce79ace5e91a200308f3ddbc7128b..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v6.0/Console.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef __CONSOLE_H__ -#define __CONSOLE_H__ - - - -//Some defines we will be requiring -#define SC_LINES 0x0001 -#define SC_COLUMNS 0x0002 -#define SC_ATTRIB 0x0004 -#define SC_MAXLINES 0x0008 - -class CConsole -{ - public: - //Constructor & Destructor - CConsole (); - CConsole (BOOL); - ~CConsole (); - - //Properties - short GetNumberOfLines(); - short SetNumberOfLines (short sLines); - short SetNumberOfColumns (short sColumns); - short GetNumberOfColumns (); - WORD GetAttributes (); - WORD SetAttributes (WORD wAttrib,short NumChars = 0); - short SetMaxLinesInWindow (short maxLines); - short GetMaxLinesInWindow (); - - //Methods - void RedirectToConsole (WORD wFlags); - BOOL SetupConsole(WORD wFlags); - HANDLE GetHandle (DWORD dwFlag); - BOOL Clear (); - BOOL ApplyAttrib (short NumChars); - WORD GetSettings (WORD wFlags); - - - //Helpers - BOOL CreateConsole (); - BOOL DestroyConsole (); - - protected: - BOOL m_bRedirected; - short m_sNumColumns; - short m_sNumLines; - WORD m_wAttrib; - short m_sMaxLines; - DWORD m_dwError; - static BOOL sm_bConsole; - -}; -#endif //__CONSOLE_H__ diff --git a/src/vrpn/server_src/miles_sound_server/v6.0/SoundServerWin32.aps b/src/vrpn/server_src/miles_sound_server/v6.0/SoundServerWin32.aps deleted file mode 100644 index 85ae317b00702720db56d8fdc9161fb9e5ebc868..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/miles_sound_server/v6.0/SoundServerWin32.aps and /dev/null differ diff --git a/src/vrpn/server_src/miles_sound_server/v6.0/SoundServerWin32.rc b/src/vrpn/server_src/miles_sound_server/v6.0/SoundServerWin32.rc deleted file mode 100644 index 486debfed4e04d333ee3156926f55d9bd73e26f0..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v6.0/SoundServerWin32.rc +++ /dev/null @@ -1,222 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -#include "c:\miles6\include\mss.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -SOUNDSERVERWIN32 DIALOG DISCARDABLE 100, 100, 319, 265 -STYLE WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "VRPN Sound Server v1.0a" -CLASS "SoundServerWin32" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX " Digital Sound Controls: ",IDC_STATIC,5,40,190,44 - LTEXT "Choose the 3D &technology to use:",IDC_STATIC,15,55,125, - 8 - COMBOBOX 100,15,65,178,108,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - PUSHBUTTON "&Stop all sounds",110,45,245,61,12 - PUSHBUTTON "&Close",112,225,245,60,12 - EDITTEXT 114,55,225,255,12,ES_MULTILINE | ES_AUTOHSCROLL | - ES_READONLY - LTEXT "Y",IDC_STATIC,20,145,10,10 - LTEXT "X",IDC_STATIC,20,130,10,10 - LTEXT "Z",IDC_STATIC,20,160,8,8 - EDITTEXT 120,30,130,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 121,30,145,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 122,30,160,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - COMBOBOX 131,15,100,40,45,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | - WS_TABSTOP - GROUPBOX "Position",IDC_STATIC,15,120,50,55 - GROUPBOX "Current sound",IDC_STATIC,5,90,140,115 - GROUPBOX "Orientation",IDC_STATIC,75,120,60,55 - GROUPBOX "",IDC_STATIC,5,215,310,25 - LTEXT "Z",IDC_STATIC,85,130,8,8 - LTEXT "Y",IDC_STATIC,85,145,8,8 - LTEXT "X",IDC_STATIC,85,160,8,8 - EDITTEXT 300,100,130,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 301,100,145,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 302,100,160,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - LTEXT "Last Error:",IDC_STATIC,10,225,40,8 - GROUPBOX "Listener",IDC_STATIC,155,105,160,100 - EDITTEXT 141,180,130,35,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 142,180,145,35,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 143,180,160,35,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - LTEXT "X",IDC_STATIC,170,130,8,10 - LTEXT "Y",IDC_STATIC,170,145,10,10 - LTEXT "Z",IDC_STATIC,170,160,10,10 - LTEXT "Z",IDC_STATIC,245,130,8,8 - LTEXT "Y",IDC_STATIC,245,145,8,8 - LTEXT "X",IDC_STATIC,245,160,8,8 - EDITTEXT 303,260,130,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 304,260,145,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - EDITTEXT 305,260,160,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - GROUPBOX "Position",IDC_STATIC,165,120,55,55 - GROUPBOX "Orientation",IDC_STATIC,240,120,55,55 - PUSHBUTTON "More Info",162,87,101,40,15 - LTEXT "Distance to listener:",IDC_STATIC,15,185,65,9 - EDITTEXT 181,85,180,46,13,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER - GROUPBOX "Speaker type",IDC_STATIC,200,40,115,44 - COMBOBOX 102,205,65,105,50,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - LTEXT "Choose speaker type:",IDC_STATIC,205,55,70,10 - EDITTEXT 434,55,20,25,10,ES_AUTOHSCROLL | ES_READONLY - LTEXT "Server rate:",IDC_STATIC,10,20,40,10 - GROUPBOX "Server Information",IDC_STATIC,5,5,190,35 -END - -SND_INFO DIALOG DISCARDABLE 120, 120, 209, 85 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Sound Information" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Volume",IDC_STATIC,20,5,30,10 - LTEXT "Replay Rate:",IDC_STATIC,105,5,45,10 - EDITTEXT 115,64,5,30,12,ES_AUTOHSCROLL | ES_READONLY - EDITTEXT 116,155,5,30,12,ES_AUTOHSCROLL | ES_READONLY - GROUPBOX "Distances",IDC_STATIC,10,30,185,40 - LTEXT "Min Front",IDC_STATIC,25,40,35,10 - EDITTEXT 151,65,40,30,10,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER - LTEXT "Max Front",IDC_STATIC,25,55,35,10 - LTEXT "Min Back",IDC_STATIC,115,40,35,10,WS_DISABLED - LTEXT "Max Back",IDC_STATIC,115,55,35,10,WS_DISABLED - EDITTEXT 152,65,55,30,10,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER - EDITTEXT 153,155,40,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER | WS_DISABLED - EDITTEXT 154,155,55,30,10,ES_AUTOHSCROLL | ES_READONLY | - ES_NUMBER | WS_DISABLED - LTEXT "(Automatically closes in 5 seconds)",IDC_STATIC,51,75, - 108,10 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -VRPN ICON DISCARDABLE "SoundServer.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""windows.h""\r\n" - "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""c:\\miles6\\include\\mss.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - "SND_INFO", DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 202 - TOPMARGIN, 7 - BOTTOMMARGIN, 78 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog Info -// - -SOUNDSERVERWIN32 DLGINIT -BEGIN - 102, 0x403, 23, 0 -0x6f4e, 0x6d72, 0x6c61, 0x7320, 0x6574, 0x6572, 0x206f, 0x7073, 0x6165, -0x656b, 0x7372, "\000" - 102, 0x403, 11, 0 -0x6548, 0x6461, 0x6870, 0x6e6f, 0x7365, "\000" - 102, 0x403, 29, 0 -0x2833, 0x292b, 0x5320, 0x7275, 0x6f72, 0x6e75, 0x2064, 0x6f73, 0x6e75, -0x2064, 0x7073, 0x6165, 0x656b, 0x7372, "\000" - 102, 0x403, 27, 0 -0x6f46, 0x7275, 0x7320, 0x6570, 0x6b61, 0x7265, 0x2073, 0x7128, 0x6175, -0x2d64, 0x6f73, 0x6e75, 0x2964, "\000" - 0 -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/src/vrpn/server_src/miles_sound_server/v6.0/readme.txt b/src/vrpn/server_src/miles_sound_server/v6.0/readme.txt deleted file mode 100644 index 9eb304008b9416f8161d23fe417b903b0534c990..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v6.0/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ - Should copy sound_server.exe to c:\miles_sound_server. Might need to -make this directory if it doesn't exist. Also project expects Miles stuff -to be at c:\miles. \ No newline at end of file diff --git a/src/vrpn/server_src/miles_sound_server/v6.0/resource.h b/src/vrpn/server_src/miles_sound_server/v6.0/resource.h deleted file mode 100644 index 6b32ee0c8ff1560b007ebe18877e825da62c786b..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v6.0/resource.h +++ /dev/null @@ -1,17 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by SoundServerWin32.rc -// -#define IDC_CUSTOM1 1032 -#define IDC_STATIC -1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1035 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/src/vrpn/server_src/miles_sound_server/v6.0/sound_server.cpp b/src/vrpn/server_src/miles_sound_server/v6.0/sound_server.cpp deleted file mode 100644 index dc23679964f797d403f85fb5f01a7d22f5ac2c42..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v6.0/sound_server.cpp +++ /dev/null @@ -1,710 +0,0 @@ -#include "vrpn_Shared.h" - -#ifdef _WIN32 -#include <windowsx.h> -#include <conio.h> -#include "resource.h" -#include <commctrl.h> -#endif - -#include <stdlib.h> -#include <math.h> -#include <string.h> -#include <stdio.h> -#include <fcntl.h> -#include <iostream> - -#ifdef _WIN32 -#include "Console.hpp" -#endif - -#ifndef _USE_OLD_OSTREAMS -using namespace std; -#endif - -#include "vrpn_Connection.h" -#include "vrpn_Tracker.h" -#include "vrpn_Sound.h" - -#ifdef _WIN32 -#include "vrpn_Sound_Miles.h" -#endif -#include "vrpn_ForwarderController.h" - -#define SOUND_DEBUG 1 - -//Sound Server Specifics -#ifdef _WIN32 -vrpn_Sound_Server_Miles *soundServer = NULL; - -#define DIALOG_TIMEOUT 5000 -#define UPDATE_TIMEOUT 2000 -#define SPIN_TIMEOUT 2000 - -#define cboxTech 100 -#define btnPlay 101 -#define btnStop 110 -#define btnClose 112 -#define ErrorBox 114 -#define VolumeBox 115 -#define ReplayBox 116 -#define SoundIdBox 131 - -#define SPEAKERTYPE_BOX 102 - -#define PosX 120 -#define PosY 121 -#define PosZ 122 - -#define LPosX 141 -#define LPosY 142 -#define LPosZ 143 - -#define FMin 151 -#define FMax 152 -#define BMin 153 -#define BMax 154 - -#define SoundIdTBox 161 -#define MoreInfoBtn 162 - -#define Sound2Listener 181 -#define SPIN_BOX 434 - -#define SorX 300 -#define SorY 301 -#define SorZ 302 -#define LorX 303 -#define LorY 304 -#define LorZ 305 - -#define UpdateTimerId 1001 -#define DialogTimerId 1002 -#define SpinTimerId 1003 -int blanked = 0; -int ProviderSet = 0; - -float spinrate; -int spincounter; - -int got_report; - -HWND SoundProvideCombo; -HWND SpeakerTypeCombo; -HWND SoundIdCombo; -HWND SoundWnd; -HWND InfoWnd; - -vrpn_Tracker_Remote * tracker_connection; -char tracker_device[512]; -char tracker_name[512]; -vrpn_ListenerDef listener, oldlistener; - -int USE_TRACKER; - -enum BoxAction{add, del}; - -vrpn_int32 CurrentSoundId = -1; -#endif - -vrpn_Connection * connection; - -// TCH October 1998 -// Use Forwarder as remote-controlled multiple connections. -vrpn_Forwarder_Server * forwarderServer; - -//Console for Win32 version of server -#ifdef _WIN32 -CConsole *con; -#endif - -// install a signal handler to shut down the trackers and buttons -#ifndef WIN32 -#include <signal.h> -void closeDevices(); - -void sighandler (int) -{ - closeDevices(); - delete connection; - exit(0); -} -#endif - -void closeDevices (void) { - cerr << endl << "All devices closed. Exiting ..." << endl; -} - -void handle_tracker(void *, const vrpn_TRACKERCB t) { - - q_xyz_quat_type sensor_f_tracker; // aka hiball_f_tracker or hiball_f_source - qogl_matrix_type sensor_f_tracker_m; - qogl_matrix_type eyeball_f_tracker_m; - q_xyz_quat_type eyeball_f_tracker; - - sensor_f_tracker.xyz[0] = t.pos[0]; - sensor_f_tracker.xyz[1] = t.pos[1]; - sensor_f_tracker.xyz[2] = t.pos[2]; - sensor_f_tracker.quat[0] = t.quat[0]; - sensor_f_tracker.quat[1] = t.quat[1]; - sensor_f_tracker.quat[2] = t.quat[2]; - sensor_f_tracker.quat[3] = t.quat[3]; - - q_xyz_quat_to_ogl_matrix(sensor_f_tracker_m, &sensor_f_tracker); - - // need to compose with the eye_from_sensor matrix here - - qogl_matrix_mult(eyeball_f_tracker_m, soundServer->eye_f_sensor_m, sensor_f_tracker_m); - - q_ogl_matrix_to_xyz_quat(&eyeball_f_tracker, eyeball_f_tracker_m); - - listener.pose.position[0] = eyeball_f_tracker.xyz[0]; - listener.pose.position[1] = eyeball_f_tracker.xyz[1]; - listener.pose.position[2] = eyeball_f_tracker.xyz[2]; - listener.pose.orientation[0] = eyeball_f_tracker.quat[0]; - listener.pose.orientation[1] = eyeball_f_tracker.quat[1]; - listener.pose.orientation[2] = eyeball_f_tracker.quat[2]; - listener.pose.orientation[3] = eyeball_f_tracker.quat[3]; - - got_report = 1; - - return; -} - -void UpdateListenerDef() { - if (listener.pose.orientation != oldlistener.pose.orientation) - soundServer->changeListenerStatus(listener); - oldlistener = oldlistener; -} - -int handle_dlc (void *, vrpn_HANDLERPARAM p) -{ - closeDevices(); - delete connection; - exit(0); - return 0; -} - -void shutDown (void) -{ - closeDevices(); -#ifdef _WIN32 - if (soundServer) - soundServer->shutDown(); - con->DestroyConsole(); -#endif - delete connection; - exit(0); - return; -} - -#ifdef _WIN32 - -void ChangeSoundIdBox(vrpn_int32 action, vrpn_int32 newId) { - char numbuf[3]; - - sprintf(numbuf,"%d",newId); - ComboBox_AddString(SoundIdCombo,numbuf); -} - - -void UpdateDialog(HWND SoundWnd) { - - float posx, posy, posz, orx, ory, orz; - float lposx, lposy, lposz; - char buf[15]; - - SetDlgItemText(SoundWnd,ErrorBox,soundServer->GetLastError()); - - soundServer->GetCurrentPosition(CurrentSoundId, &posx, &posy, &posz); - sprintf(buf,"%4.3f",posx); - SetDlgItemText(SoundWnd,PosX,buf); - sprintf(buf,"%4.3f",posy); - SetDlgItemText(SoundWnd,PosY,buf); - sprintf(buf,"%4.3f",posz); - SetDlgItemText(SoundWnd,PosZ,buf); - - soundServer->GetListenerPosition(&lposx, &lposy, &lposz); - sprintf(buf,"%4.3f",lposx); - SetDlgItemText(SoundWnd,LPosX,buf); - sprintf(buf,"%4.3f",lposy); - SetDlgItemText(SoundWnd,LPosY,buf); - sprintf(buf,"%4.3f",lposz); - SetDlgItemText(SoundWnd,LPosZ,buf); - - soundServer->GetCurrentOrientation(CurrentSoundId, &orx, &ory, &orz); - sprintf(buf,"%4.3f",orx); - SetDlgItemText(SoundWnd,SorX,buf); - sprintf(buf,"%4.3f",ory); - SetDlgItemText(SoundWnd,SorY,buf); - sprintf(buf,"%4.3f",orz); - SetDlgItemText(SoundWnd,SorZ,buf); - - soundServer->GetListenerOrientation(&orx, &ory, &orz); - sprintf(buf,"%4.3f",orx); - SetDlgItemText(SoundWnd,LorX,buf); - sprintf(buf,"%4.3f",ory); - SetDlgItemText(SoundWnd,LorY,buf); - sprintf(buf,"%4.3f",orz); - SetDlgItemText(SoundWnd,LorZ,buf); - - sprintf(buf,"%4.3f",sqrt((lposx-posx)*(lposx-posx)+ - (lposy-posy)*(lposy-posy)+ - (lposz-posz)*(lposz-posz))); - SetDlgItemText(SoundWnd,Sound2Listener,buf); - - -} - -/****************************************************************************** - Sound Server Window Section - *****************************************************************************/ -LRESULT AILEXPORT SoundServerProc(HWND SoundWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - HWND h; - float fmin, fmax; - char buf[15]; - - switch (message) - { - - case WM_SETFOCUS: // deal with the focus in this weird dialog-window - h=GetWindow(SoundWnd,GW_CHILD); - while (h) { - if ((GetWindowLong(h,GWL_STYLE)&0x2f)==BS_DEFPUSHBUTTON) { - SetFocus(h); - goto found; - } - h=GetNextWindow(h,GW_HWNDNEXT); - } - SetFocus(GetWindow(SoundWnd,GW_CHILD)); - found: - break; - - case WM_CTLCOLORBTN: - case WM_CTLCOLORSTATIC: - SetBkColor((HDC)wParam,RGB(192,192,192)); - return((LRESULT)GetStockObject(LTGRAY_BRUSH)); - - case WM_HSCROLL: - return 0; - - case WM_COMMAND: - - switch (LOWORD(wParam)) - { - - case cboxTech: - if (HIWORD(wParam) == CBN_SELENDOK) - if (ComboBox_GetCurSel(SoundProvideCombo)-1 >= 0) { - ProviderSet = 1; - soundServer->setProvider(ComboBox_GetCurSel(SoundProvideCombo)-1); - } else ProviderSet = 0; - - break; - case SPEAKERTYPE_BOX: - if (HIWORD(wParam) == CBN_SELENDOK) - soundServer->setSpeakerType(ComboBox_GetCurSel(SpeakerTypeCombo)+1); - - break; - case MoreInfoBtn: - SetDlgItemInt(InfoWnd,VolumeBox,soundServer->GetCurrentVolume(CurrentSoundId),1); - SetDlgItemInt(InfoWnd,ReplayBox,soundServer->GetCurrentPlaybackRate(CurrentSoundId),1); - soundServer->GetCurrentDistances(CurrentSoundId, &fmin, &fmax); - sprintf(buf,"%4.3f",fmin); - SetDlgItemText(InfoWnd,FMin,buf); - sprintf(buf,"%4.3f",fmax); - SetDlgItemText(InfoWnd,FMax,buf); - if (CurrentSoundId >= 0) - sprintf(buf,"Sound: %d",CurrentSoundId); - else - sprintf(buf,"Sound: none selected"); - SetWindowText(InfoWnd,buf); - ShowWindow(InfoWnd,SW_SHOW); - SetTimer(SoundWnd,DialogTimerId,DIALOG_TIMEOUT,NULL); - break; - - case SoundIdBox: - if (HIWORD(wParam) == CBN_SELENDOK) { - if (ComboBox_GetCurSel(SoundProvideCombo)-1 >= 0) { - CurrentSoundId = ComboBox_GetCurSel(SoundIdCombo); - UpdateDialog(SoundWnd); - } - } - break; - - - case btnStop: - soundServer->stopAllSounds(); - break; - - case IDCLOSE: - ShowWindow(InfoWnd,SW_HIDE); - break; - case btnClose: - - DestroyWindow(SoundWnd); - soundServer->shutDown(); - break; - } - return 0; - - case WM_DESTROY: - PostQuitMessage(0); - return 0; - case WM_TIMER: - // if there is no provider set then updating will cause an error! - if (wParam == UpdateTimerId) { - if (ProviderSet) - UpdateDialog(SoundWnd); - } - else if (wParam == SpinTimerId) { - char buf[15]; - spinrate = ((float) spincounter / (float)SPIN_TIMEOUT) * ((float)SPIN_TIMEOUT/1.0); - spincounter = 0; - sprintf(buf,"%4.3f",spinrate); - SetDlgItemText(SoundWnd,SPIN_BOX,buf); - } - else { - ShowWindow(InfoWnd, SW_HIDE); - KillTimer(SoundWnd, DialogTimerId); - } - break; - } - - return DefWindowProc(SoundWnd,message,wParam,lParam); -} - -static void add_providers() -{ - char* name; - HPROVIDER provider; - - HPROENUM next = HPROENUM_FIRST; - - SoundProvideCombo=GetDlgItem(SoundWnd,cboxTech); - - ComboBox_AddString(SoundProvideCombo,"Choose a provider..."); - - while (AIL_enumerate_3D_providers(&next, &provider, &name)) - { - ComboBox_AddString(SoundProvideCombo,name); - soundServer->addProvider(provider); - } - - ComboBox_SetCurSel(SoundProvideCombo,0); -} - -bool InitSoundServerWindow(HINSTANCE hInstance) -{ - WNDCLASS wc; - BOOL rc; - static char szAppName[] = "SoundServerWin32"; - - wc.lpszClassName = szAppName; - wc.lpfnWndProc = (WNDPROC) SoundServerProc; - wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(hInstance,"VRPN"); - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = reinterpret_cast<HBRUSH>(GetStockObject(LTGRAY_BRUSH)); - wc.cbClsExtra = 0; - wc.cbWndExtra = DLGWINDOWEXTRA; - wc.lpszMenuName = NULL; - - rc = RegisterClass(&wc); - if (!rc) - return false; - - InitCommonControls(); - - SoundWnd = CreateDialog(hInstance,(LPCSTR)"SOUNDSERVERWIN32",0,NULL); - DWORD error = GetLastError(); - if (!SoundWnd) { - fprintf(stderr,"%ld\n",error); - return false; - } - // set a timer to update server stats - SetTimer(SoundWnd,UpdateTimerId,UPDATE_TIMEOUT,NULL); - - - SoundIdCombo=GetDlgItem(SoundWnd, SoundIdBox); - SpeakerTypeCombo=GetDlgItem(SoundWnd,SPEAKERTYPE_BOX); - ComboBox_AddString(SpeakerTypeCombo,"Normal stereo speakers"); - ComboBox_AddString(SpeakerTypeCombo,"Headphones"); - ComboBox_AddString(SpeakerTypeCombo,"3+ speakers in surround sound"); - ComboBox_AddString(SpeakerTypeCombo,"Four speakers (quad-channel)"); - ComboBox_SetCurSel(SpeakerTypeCombo,1); - - ShowWindow(SoundWnd,SW_SHOW); - InfoWnd = CreateDialog(hInstance,(LPCSTR)"SND_INFO",0,NULL); - error = GetLastError(); - if (!InfoWnd) { - fprintf(stderr,"%ld\n",error); - return false; - } - - ShowWindow(InfoWnd,SW_HIDE); - - return true; -} - -#endif //Win32 -/****************************************************************************** - End Sound Server Window Section - *****************************************************************************/ - -int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) -{ -#ifdef _WIN32 - MSG msg; -#endif - char * config_file_name = "vrpn.cfg"; - FILE * config_file; - char * client_name = NULL; - int client_port; - int bail_on_error = 1; - int verbose = 1; - int auto_quit = 0; - int realparams = 0; - int loop = 0; - int port = vrpn_DEFAULT_LISTEN_PORT_NO; -#ifdef WIN32 - WSADATA wsaData; - int status; - if ((status = WSAStartup(MAKEWORD(1,1), &wsaData)) != 0) - { - fprintf(stderr, "WSAStartup failed with %d\n", status); - return(1); - } -#else -#ifdef sgi - sigset( SIGINT, sighandler ); - sigset( SIGKILL, sighandler ); - sigset( SIGTERM, sighandler ); - sigset( SIGPIPE, sighandler ); -#else - signal( SIGINT, sighandler ); - signal( SIGKILL, sighandler ); - signal( SIGTERM, sighandler ); - signal( SIGPIPE, sighandler ); -#endif // sgi -#endif - - con = new CConsole(TRUE); - con->RedirectToConsole(0); - - // TCH 2 Nov 99 - debugging code - vrpn_Connection * trackerCon; - - USE_TRACKER = 0; - - // Need to have a global pointer to it so we can shut it down - // in the signal handler (so we can close any open logfiles.) - - connection = new vrpn_Synchronized_Connection (port); - - // Open the configuration file - if (verbose) printf("Reading from config file %s\n", config_file_name); - if ( (config_file = fopen(config_file_name, "r")) == NULL) - { - perror("Cannot open config file"); - fprintf(stderr," (filename %s)\n", config_file_name); - return -1; - } - - // Read the configuration file, creating a device for each entry. - // Each entry is on one line, which starts with the name of the - // class of the object that is to be created. - // If we fail to open a certain device, print a message and decide - // whether we should bail. - { - char line[512]; // Line read from the input file - char *pch; - char scrap[512], s2[512]; - - // Read lines from the file until we run out - while ( fgets(line, sizeof(line), config_file) != NULL ) - { - - // Make sure the line wasn't too long - if (strlen(line) >= sizeof(line)-1) - { - fprintf(stderr,"Line too long in config file: %s\n",line); - if (bail_on_error) { return -1; } - else { continue; } // Skip this line - } - - if ((strlen(line)<3)||(line[0]=='#')) - { - // comment or empty line -- ignore - continue; - } - - // copy for strtok work - strncpy(scrap, line, sizeof(line) - 1); - // Figure out the device from the name and handle appropriately - - // WARNING: SUBSTRINGS WILL MATCH THE EARLIER STRING, SO - // ADD AN EMPTY SPACE TO THE END OF STATIC STRINGS!!!! - - // #define isit(s) !strncmp(line,s,strlen(s)) -#define isit(s) !strcmp(pch=strtok(scrap," \t"),s) -#define next() pch += strlen(pch) + 1 - -#ifdef _WIN32 - if(isit("vrpn_Sound_Server")) - { - fprintf(stderr,"%s\n",pch); - next(); - fprintf(stderr,"%s\n",pch); - if (sscanf(pch,"%511s\t%d\t%511s\t%511s",s2,&USE_TRACKER,tracker_name, tracker_device) != 4) - { - fprintf(stderr,"Bad vrpn_Server_Sound line: %s\n",line); - if (bail_on_error) - { - return -1; - } - else - { - continue; - } // Skip this line - } - fprintf(stderr,"ok\n"); - - - if (InitSoundServerWindow(hInstance) != true) - fprintf(stderr, "Didn't open window!\n"); - - soundServer = NULL; - soundServer = new vrpn_Sound_Server_Miles(s2, connection); - if (soundServer == NULL) - fprintf(stderr,"Can't create sound server\n"); - add_providers(); - } -#endif - - } - } - - // Close the configuration file - fclose(config_file); - - // Open remote tracker if we are to use one - - if (USE_TRACKER) { - - char newname[1024]; - sprintf(newname,"%s@%s",(const char*)tracker_device, (const char*)tracker_name); - fprintf(stderr,"Using tracker: %s\n",newname); - trackerCon = vrpn_get_connection_by_name(tracker_name); - tracker_connection = new vrpn_Tracker_Remote((const char *) newname); - //if (tracker_connection!=NULL) fprintf(stderr,"Connection set up correctly\n"); - int val = tracker_connection->register_change_handler(NULL,handle_tracker); - fprintf(stderr," Handler set up %d\n",val); - - if (trackerCon->doing_okay()) { - fprintf(stderr, "TC OK.\n"); - } else { - fprintf(stderr, "TC Not OK.\n"); - } - } - else fprintf(stderr,"Not using tracker\n"); - - // Open the Forwarder Server - forwarderServer = new vrpn_Forwarder_Server (connection); - - loop = 0; - if (auto_quit) - { - int dlc_m_id = connection->register_message_type( - vrpn_dropped_last_connection); - connection->register_handler(dlc_m_id, handle_dlc, NULL); - } - - if (client_name) - { - fprintf(stderr, "vrpn_serv: connecting to client: %s:%d\n", - client_name, client_port); - if (connection->connect_to_client(client_name, client_port)) - { - fprintf(stderr, "server: could not connect to client %s:%d\n", client_name, client_port); - shutDown(); - } - } - - // ******************************************************************** - // ** ** - // ** MAIN LOOP ** - // ** ** - // ******************************************************************** - -// SetTimer(SoundWnd,SpinTimerId,SPIN_TIMEOUT,NULL); -// spincounter = 0; - - while (1) { -// spincounter++; - - GetMessage(&msg, 0, 0, 0); - if (!IsDialogMessage(SoundWnd,&msg)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - - // Let the sound server do it's thing - - if (USE_TRACKER && trackerCon->doing_okay() && ProviderSet) - UpdateListenerDef(); - - soundServer->mainloop(); - - if (soundServer->noSounds()) { - EnableWindow(SoundProvideCombo, true); - - if (!blanked) { - ComboBox_ResetContent(SoundIdCombo); - Edit_SetText(GetDlgItem(SoundWnd, ErrorBox), ""); - Edit_SetText(GetDlgItem(SoundWnd, LPosX), ""); - Edit_SetText(GetDlgItem(SoundWnd, LPosY), ""); - Edit_SetText(GetDlgItem(SoundWnd, LPosZ), ""); - Edit_SetText(GetDlgItem(SoundWnd, SorX), ""); - Edit_SetText(GetDlgItem(SoundWnd, SorY), ""); - Edit_SetText(GetDlgItem(SoundWnd, SorZ), ""); - Edit_SetText(GetDlgItem(SoundWnd, LorX), ""); - Edit_SetText(GetDlgItem(SoundWnd, LorY), ""); - Edit_SetText(GetDlgItem(SoundWnd, LorZ), ""); - Edit_SetText(GetDlgItem(SoundWnd, PosX), ""); - Edit_SetText(GetDlgItem(SoundWnd, PosY), ""); - Edit_SetText(GetDlgItem(SoundWnd, PosZ), ""); - - blanked = 1; - } - } - else { - EnableWindow(SoundProvideCombo, false); - blanked = 0; - } - - - // ensure we get a new report! - if (USE_TRACKER) { - tracker_connection->mainloop(); - got_report = 0; - if (trackerCon->doing_okay()) - while (!got_report) - tracker_connection->mainloop(); - } - - // Send and receive all messages - connection->mainloop(); - if (!connection->doing_okay()) shutDown(); - - // Handle forwarding requests; send messages - // on auxiliary connections - forwarderServer->mainloop(); - } - - return 0; -} diff --git a/src/vrpn/server_src/miles_sound_server/v6.0/sound_server.dsp b/src/vrpn/server_src/miles_sound_server/v6.0/sound_server.dsp deleted file mode 100644 index 7ea8031a4fab97508acaa4f2ce1e771a8359db39..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v6.0/sound_server.dsp +++ /dev/null @@ -1,140 +0,0 @@ -# Microsoft Developer Studio Project File - Name="sound_server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=sound_server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "sound_server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "sound_server.mak" CFG="sound_server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "sound_server - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "sound_server - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "sound_server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "sound_server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../.." /I "../../quat" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /YX /FD /D /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ..\..\quat\Debug\quat.lib odbc32.lib odbccp32.lib c:\miles6\lib\win\Mss32.lib wsock32.lib comctl32.lib ../../../pc_win32/Debug/vrpn.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /pdb:none -# Begin Special Build Tool -SOURCE="$(InputPath)" -PostBuild_Desc=Copy Sound v6.0 -PostBuild_Cmds=cp Debug\sound_server.exe c:\Miles_Sound_Serverv2.0\sound_server_v2.exe -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "sound_server - Win32 Release" -# Name "sound_server - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\Console.cpp -# End Source File -# Begin Source File - -SOURCE=.\sound_server.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Sound_Miles.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\Console.hpp -# End Source File -# Begin Source File - -SOURCE=.\sound_server.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Sound_Miles.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\soundserver.ico -# End Source File -# Begin Source File - -SOURCE=.\SoundServerWin32.rc -# End Source File -# End Group -# End Target -# End Project diff --git a/src/vrpn/server_src/miles_sound_server/v6.0/sound_server.dsw b/src/vrpn/server_src/miles_sound_server/v6.0/sound_server.dsw deleted file mode 100644 index 6344456c6be7181681cf711bd83506cff79f0a16..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v6.0/sound_server.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "sound_server"=.\sound_server.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/vrpn/server_src/miles_sound_server/v6.0/soundserver.ico b/src/vrpn/server_src/miles_sound_server/v6.0/soundserver.ico deleted file mode 100644 index a5cf63886695445fed9e56338363a8f76bd08821..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/miles_sound_server/v6.0/soundserver.ico and /dev/null differ diff --git a/src/vrpn/server_src/miles_sound_server/v6.0/vrpn_Sound_Miles.cpp b/src/vrpn/server_src/miles_sound_server/v6.0/vrpn_Sound_Miles.cpp deleted file mode 100644 index fc98cce051d3940bf43d612ef81ace6aefef9466..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v6.0/vrpn_Sound_Miles.cpp +++ /dev/null @@ -1,586 +0,0 @@ - -#ifdef _WIN32 - -#include "vrpn_Sound_Miles.h" -//#include "quat.h" -#include <math.h> -#include <iostream.h> - -/******************************************************************************************** - Begin vrpn_Sound_Server_Miles - *******************************************************************************************/ -vrpn_Sound_Server_Miles::vrpn_Sound_Server_Miles(const char * name, vrpn_Connection * c) - : vrpn_Sound_Server(name, c) -{ - AIL_startup(); //initialize the Miles SDK stuff - - - //load a digital driver - if (!AIL_quick_startup(1,0,44100,16,2)) { - MessageBox(0,"Couldn't open a digital output device.","Error",MB_OK); - } - - AIL_quick_handles(&DIG,0,0); - - - // No sound played yet - LastSoundId = -1; - - provider = 0; - //Set variables to control size and growing of Audio handle array - H_Max = vrpn_Sound_START; - H_Cur = 0; - - //Allocate space for Audio Handle array - samples = new H3DSAMPLE[H_Max]; - - //Set variables to control size and growing of providers array - P_Max = vrpn_Sound_START; - P_Cur = 0; - - //Allocate space for Audio Handle array - providers = new HPROVIDER[P_Max]; - - // init eye from sensor matrix - eye_f_sensor_m[0] = 1.0; - eye_f_sensor_m[1] = 0.0; - eye_f_sensor_m[2] = 0.0; - eye_f_sensor_m[3] = 0.0; - eye_f_sensor_m[4] = 0.0; - eye_f_sensor_m[5] = 1.0; - eye_f_sensor_m[6] = 0.0; - eye_f_sensor_m[7] = 0.0; - eye_f_sensor_m[8] = 0.0; - eye_f_sensor_m[9] = 0.0; - eye_f_sensor_m[10] = 1.0; - eye_f_sensor_m[11] = 0.0; - eye_f_sensor_m[12] = 0.0; - eye_f_sensor_m[13] = 0.0; - eye_f_sensor_m[14] = 0.0; - eye_f_sensor_m[15] = 1.0; -} - -vrpn_Sound_Server_Miles::~vrpn_Sound_Server_Miles() -{ - shutDown(); - delete [] samples; -} - -void vrpn_Sound_Server_Miles::shutDown() -{ - unloadAllSounds(); - AIL_close_3D_provider(provider); - - /*These two calls must be made before trying to exit or the - program will hang when you try to quit.*/ - AIL_waveOutClose(DIG); - AIL_shutdown(); -} - -void vrpn_Sound_Server_Miles::setSpeakerType(int index) { - S32 speaker_type; - if (index==1) - speaker_type=AIL_3D_2_SPEAKER; - else - if (index==2) - speaker_type=AIL_3D_HEADPHONE; - else - if (index==3) - speaker_type=AIL_3D_SURROUND; - else - if (index==4) - speaker_type=AIL_3D_4_SPEAKER; - - AIL_set_3D_speaker_type(provider, speaker_type); - return; -} - -void vrpn_Sound_Server_Miles::addProvider(HPROVIDER p) -{ - if (P_Cur >= P_Max) - { - int i; - HPROVIDER *oldproviders; - - oldproviders = providers; - - P_Max *= 2; - providers = new HPROVIDER[P_Max]; - - for(i = 0; i < P_Cur; i++) - providers[i] = oldproviders[i]; - - delete [] oldproviders; - } - - providers[P_Cur] = p; - P_Cur++; -} - -bool vrpn_Sound_Server_Miles::noSounds() -{ - int i; - - for(i = 0; i < H_Cur; i++) - if (samples[i] != NULL) - return false; - - return true; -} - -void vrpn_Sound_Server_Miles::setProvider(int index, int providerRoomSetting) -{ - DWORD result; - - unloadAllSounds(); - //If a provider is already open, then close it - AIL_close_3D_provider(provider); - - //load the new provider - - result = AIL_open_3D_provider(providers[index]); - if (result != M3D_NOERR) { - fprintf(stderr,"Error Opening 3D Provider: %s\n",AIL_last_error()); - } - else { - - provider = providers[index]; - //open a listener. Position defaults to the origin, looking down the -Z axis with ( - listener = AIL_open_3D_listener(provider); - AIL_set_3D_position(listener, 0, 0, 0); - AIL_set_3D_orientation(listener, 0, 0, -1, 0, 1, 0); - AIL_set_3D_velocity(listener, 0, 0, 0, 0); - //set a room style - AIL_set_3D_provider_preference(provider, "EAX environment selection", &providerRoomSetting); - } -} - -void vrpn_Sound_Server_Miles::unloadHandle(vrpn_SoundID id) -//unloads a handle corresponding to id from samples -{ - vrpn_int32 SIndex; - - SIndex = map_CIndex_To_SIndex(id); - if (SIndex != vrpn_Sound_FAIL) - { - samples[SIndex] = NULL; - set_CIndex_To_SIndex(id, vrpn_Sound_FAIL); - } -} - -void vrpn_Sound_Server_Miles::chooseProvider(char *ThreeDProvider) -/*chooses a 3D audio provider. -See the comment below the constructor in the .h for more info.*/ - -//a better way really should be implemented to choose a provider -{ - char* name; - HPROENUM next = HPROENUM_FIRST; - while (AIL_enumerate_3D_providers(&next, &provider, &name)) - { - if(strcmp(name, ThreeDProvider) == 0) - break; - } -} - -void vrpn_Sound_Server_Miles::unloadAllSounds() -//clears out samples -{ - for(vrpn_int32 i = 0; i < H_Cur; i++) - { - if (samples[i] == NULL) - continue; - S32 status = AIL_3D_sample_status(samples[i]); - if(status == SMP_DONE || status == SMP_STOPPED) - //if handle is loaded and not playing, unload - { - AIL_release_3D_sample_handle(samples[i]); - } - if(status == SMP_PLAYING) - //if handle is playing, stop then unload - { - AIL_stop_3D_sample(samples[i]); - AIL_release_3D_sample_handle(samples[i]); - } - - } - H_Cur = 0; -} - -void vrpn_Sound_Server_Miles::addSample(H3DSAMPLE sample, vrpn_SoundID id) -//adds sample to the location in samples corresponding to id -{ - if (H_Cur >= H_Max) - { - int i; - H3DSAMPLE *oldsamples; - - oldsamples = samples; - - H_Max *= 2; - samples = new H3DSAMPLE[H_Max]; - - for(i = 0; i < H_Cur; i++) - samples[i] = oldsamples[i]; - - delete [] oldsamples; - } - - if (samples != NULL) - { - samples[H_Cur] = sample; - set_CIndex_To_SIndex(id, H_Cur); - H_Cur++; - } - else - set_CIndex_To_SIndex(id, vrpn_Sound_FAIL); - -} - -H3DSAMPLE vrpn_Sound_Server_Miles::getSample(vrpn_SoundID id) -//gets the handle stored in samples[id] -{ - vrpn_int32 SIndex; - - SIndex = map_CIndex_To_SIndex(id); - - if (SIndex == vrpn_Sound_FAIL) - return NULL; - else - return samples[SIndex]; -} - -void vrpn_Sound_Server_Miles::loadSound(char* filename, vrpn_SoundID id) -/*loads a .wav file into memory. gives back id to reference the sound -currently (7/28/99) this does not reuse space previously vacated in -samples by unloading sounds*/ -{ - if (provider != 0) { - fprintf(stdout,"Loading sound: #%d %s\n", id, filename); - ChangeSoundIdBox(0,id); - //load into handle - unsigned long *s; - long type; - H3DSAMPLE handle; - void *sample_address; - void *d; - AILSOUNDINFO info; - - LastSoundId = id; - - //load the .wav file into memory - s = (unsigned long *)AIL_file_read(filename, FILE_READ_WITH_SIZE); - - if (s==0) - return; - - type=AIL_file_type(s+1,s[0]); - - switch (type) { - case AILFILETYPE_PCM_WAV: - sample_address = s+1; - break; - - case AILFILETYPE_ADPCM_WAV: - AIL_WAV_info(s+1,&info); - AIL_decompress_ADPCM(&info,&d,0); - AIL_mem_free_lock(s); - sample_address = d; - break; - - default: - AIL_mem_free_lock(s); - return; - } - - //initialize handle - handle = AIL_allocate_3D_sample_handle(provider); - //tell handle where the .wav file is in memory - AIL_set_3D_sample_file(handle, sample_address); - //set defaults - AIL_set_3D_sample_volume(handle, 100); //default volume is 100 on 0...127 inclusive - AIL_set_3D_position(handle,0,0,0); - AIL_set_3D_orientation(handle, 0,0,-1,0,1,0); - AIL_set_3D_velocity(handle,0,0,-1,0); - AIL_set_3D_sample_distances(handle, 200, 20); - - //load handle into samples - addSample(handle, id); - - /*Sample level environment preferences (ie, EAX_ENVIRONMENT_BATHROOM) - could be added in here as a passed-in parameter*/ - } - else fprintf(stderr,"No provider has been set prior to LoadSound\n"); -} - -void vrpn_Sound_Server_Miles::changeSoundStatus(vrpn_SoundID id, vrpn_SoundDef soundDef) -{ - vrpn_float32 uX = 0, uY = 1, uZ = 0; // up vector - - if (provider != 0) { - - // need to negate the Z values to get this into left handed before shipping to Miles.. - soundDef.pose.orientation[2] *= -1.0; - soundDef.pose.orientation[3] *= -1.0; - soundDef.pose.position[2] *= -1.0; - - //get pose info from quaternion in soundDef, put it into the above vectors - AIL_set_3D_position(getSample(id),soundDef.pose.position[0] , soundDef.pose.position[1], soundDef.pose.position[2]); - - // normalize - soundDef.pose.orientation[0] /= soundDef.pose.orientation[3]; - soundDef.pose.orientation[1] /= soundDef.pose.orientation[3]; - soundDef.pose.orientation[2] /= soundDef.pose.orientation[3]; - soundDef.pose.orientation[3] /= soundDef.pose.orientation[3]; - - AIL_set_3D_orientation(getSample(id), soundDef.pose.orientation[0], soundDef.pose.orientation[1], soundDef.pose.orientation[2], uX, uY, uZ); - - AIL_set_3D_velocity(getSample(id), soundDef.velocity[0], soundDef.velocity[1], soundDef.velocity[2], soundDef.velocity[3]); - - /*set the volume to the new level.*/ - AIL_set_3D_sample_volume(getSample(id), soundDef.volume); - - AIL_set_3D_sample_distances(getSample(id), soundDef.max_front_dist, soundDef.min_front_dist); - } - else fprintf(stderr,"No provider has been set prior to changeSoundStatus\n"); -} - -void vrpn_Sound_Server_Miles::playSound(vrpn_SoundID id, vrpn_int32 repeat, vrpn_SoundDef soundDef) -{ - if (provider != 0) { - fprintf(stderr,"Playing sound: %d\n",id); - // update last sound played record - LastSoundId = id; - - changeSoundStatus(id, soundDef); - AIL_set_3D_sample_loop_count(getSample(id), repeat); - - //if not playing, play - //if playing already modify parameters in p for pose, - //vel, etc but ignore loop count - - switch(AIL_3D_sample_status(getSample(id))) { - case SMP_DONE: - case SMP_STOPPED: { - AIL_start_3D_sample(getSample(id)); - break; } - case SMP_PLAYING: { - //it's already playing. - //new repeat info is ignored. new pose and velocity info was set above - break; } - default: { - /*It shouldn't occur that one of the above cases isn't triggered. If error - messages back to the client are ever implemented, one should be keyed here*/ - break; } - } - } else fprintf(stderr,"No provider has been set prior to playSound\n"); -} - - -void vrpn_Sound_Server_Miles::stopSound(vrpn_SoundID id) -/*immediately stops playing the sound referred to by id -the sound can be restarted*/ -{ - if (provider != 0) { - AIL_stop_3D_sample(getSample(id)); - } else fprintf(stderr,"No provider has been set prior to stopSound\n"); -} - -void vrpn_Sound_Server_Miles::stopAllSounds() -{ - if (provider != 0) { - int i; - - for(i = 0; i < H_Cur; i++) - AIL_stop_3D_sample(getSample(i)); - } else fprintf(stderr,"No provider has been set prior to stopAllSound\n"); -} - -void vrpn_Sound_Server_Miles::unloadSound(vrpn_SoundID id) -/*unloads id from samples. -Sets the corresponding cell in samples to FAIL. */ -{ - if (provider != 0) { - AIL_release_3D_sample_handle(getSample(id)); - unloadHandle(id); - } else fprintf(stderr,"No provider has been set prior to unloadSound\n"); -} - -void vrpn_Sound_Server_Miles::changeListenerStatus(vrpn_ListenerDef listenerDef) -//change pose, etc for listener -{ - if (provider != 0) { - vrpn_float32 uX = 0, uY = 1, uZ = 0; - - // switch to left handed - listenerDef.pose.orientation[2] *= -1.0; - listenerDef.pose.orientation[3] *= -1.0; - listenerDef.pose.position[2] *= -1.0; - - - AIL_set_3D_position(listener, listenerDef.pose.position[0], listenerDef.pose.position[1], listenerDef.pose.position[2]); - - // normalize - listenerDef.pose.orientation[0] /= listenerDef.pose.orientation[3]; - listenerDef.pose.orientation[1] /= listenerDef.pose.orientation[3]; - listenerDef.pose.orientation[2] /= listenerDef.pose.orientation[3]; - listenerDef.pose.orientation[3] /= listenerDef.pose.orientation[3]; - - q_matrix_type mymatrix; - q_matrix_type multmatrix; - q_type facevec; - - q_to_row_matrix(mymatrix, listenerDef.pose.orientation); - - // 90 degree rotation about x - multmatrix[0][0] = 1; - multmatrix[0][1] = 0; - multmatrix[0][2] = 0; - multmatrix[0][3] = 0; - - multmatrix[1][0] = 0; - multmatrix[1][1] = 0; - multmatrix[1][2] = -1; - multmatrix[1][3] = 0; - - multmatrix[2][0] = 0; - multmatrix[2][1] = 1; - multmatrix[2][2] = 0; - multmatrix[2][3] = 0; - - multmatrix[3][0] = 0; - multmatrix[3][1] = 0; - multmatrix[3][2] = 0; - multmatrix[3][3] = 1; - - q_matrix_mult(mymatrix, mymatrix, multmatrix); - - q_from_row_matrix(facevec, mymatrix); - - AIL_set_3D_orientation(listener, listenerDef.pose.orientation[0], listenerDef.pose.orientation[1], listenerDef.pose.orientation[2], facevec[0], facevec[1], facevec[2]); - - AIL_set_3D_velocity(listener, listenerDef.velocity[0], listenerDef.velocity[1], listenerDef.velocity[2], listenerDef.velocity[3]); - } else fprintf(stderr,"No provider has been set prior to changeListenerStatus\n"); -} - -void vrpn_Sound_Server_Miles::changeE_f_S_m(qogl_matrix_type newmatrix) { - qogl_matrix_copy(eye_f_sensor_m, newmatrix); - return; -} - -void vrpn_Sound_Server_Miles::initModel(vrpn_ModelDef modelDef) { - qogl_matrix_copy(eye_f_sensor_m, modelDef.eye_from_sensor_matrix); -} - -void vrpn_Sound_Server_Miles::mainloop(const timeval *timeout) -{ - if (!connection->connected()) - { - unloadAllSounds(); - unloadCSMap(); - } - connection->mainloop(timeout); -} - -vrpn_int32 vrpn_Sound_Server_Miles::GetCurrentVolume(const vrpn_int32 CurrentSoundId) { - if ((CurrentSoundId > -1) && (provider != 0)) { - return (vrpn_int32) AIL_3D_sample_volume(getSample(CurrentSoundId)); } - else return -1; - } - -char * vrpn_Sound_Server_Miles::GetLastError() { - return AIL_last_error(); -} - -vrpn_int32 vrpn_Sound_Server_Miles::GetCurrentPlaybackRate(const vrpn_int32 CurrentSoundId) { - if ((CurrentSoundId > -1) && (provider != 0)) - return (vrpn_int32) AIL_3D_sample_playback_rate(getSample(CurrentSoundId)); - else return -1; -} - -void vrpn_Sound_Server_Miles::GetCurrentPosition(const vrpn_int32 CurrentSoundId,F32* X_val, F32* Y_val, F32* Z_val) { - if ((CurrentSoundId > -1) && (provider != 0)) - AIL_3D_position(getSample(CurrentSoundId),X_val,Y_val,Z_val); - else { - *X_val = -1; - *Y_val = -1; - *Z_val = -1; - } -return; -} - -void vrpn_Sound_Server_Miles::GetListenerPosition(F32* X_val, F32* Y_val, F32* Z_val) { - if (provider != 0) - AIL_3D_position(listener,X_val,Y_val,Z_val); - -return; -} - -void vrpn_Sound_Server_Miles::GetListenerOrientation(F32 *X_val, F32 *Y_val, F32 *Z_val) { - - q_vec_type angles; - q_matrix_type colMatrix; - q_type srcQuat; - F32 X_f, Y_f, Z_f, X_u, Y_u, Z_u; - - - if (provider != 0) { - - AIL_3D_orientation(listener,&X_f,&Y_f,&Z_f,&X_u,&Y_u,&Z_u); - - srcQuat[0] = X_f; - srcQuat[1] = Y_f; - srcQuat[2] = Z_f; - - srcQuat[3] = 1.0; - - q_to_col_matrix (colMatrix, srcQuat); - q_col_matrix_to_euler(angles,colMatrix); - - *X_val = angles[0]*180.0/Q_PI; - *Y_val = angles[1]*180.0/Q_PI; - *Z_val = angles[2]*180.0/Q_PI; - } - -return; -} - -void vrpn_Sound_Server_Miles::GetCurrentOrientation(const vrpn_int32 CurrentSoundId,F32 *X_val, F32 *Y_val, F32 *Z_val) { - - F32 X_f, Y_f, Z_f, X_u, Y_u, Z_u; - q_vec_type angles; - q_matrix_type colMatrix; - q_type srcQuat; - - if ((CurrentSoundId > -1) && (provider != 0)) { - AIL_3D_orientation(getSample(CurrentSoundId),&X_f,&Y_f,&Z_f,&X_u,&Y_u,&Z_u); - srcQuat[0] = X_f; - srcQuat[1] = Y_f; - srcQuat[2] = Z_f; - - srcQuat[3] = 1.0; - fprintf(stderr,"%f %f %f\n",srcQuat[0]*180.0/Q_PI,srcQuat[1]*180.0/Q_PI,srcQuat[2]*180.0/Q_PI); - - q_to_col_matrix (colMatrix, srcQuat); - q_col_matrix_to_euler(angles,colMatrix); - - *X_val = angles[0]*180.0/Q_PI; - *Y_val = angles[1]*180.0/Q_PI; - *Z_val = angles[2]*180.0/Q_PI; - } - -return; -} - -void vrpn_Sound_Server_Miles::GetCurrentDistances(const vrpn_int32 CurrentSoundId, F32* FMin, F32* FMax) { - if (CurrentSoundId > -1) { - AIL_3D_sample_distances(getSample(CurrentSoundId), FMax, FMin); - - } - else { - *FMin = *FMax = 0; - } -} - - -#endif diff --git a/src/vrpn/server_src/miles_sound_server/v6.0/vrpn_Sound_Miles.h b/src/vrpn/server_src/miles_sound_server/v6.0/vrpn_Sound_Miles.h deleted file mode 100644 index ff58a93570c7013d3dd6fc800ec2a724287f4257..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/miles_sound_server/v6.0/vrpn_Sound_Miles.h +++ /dev/null @@ -1,114 +0,0 @@ - -#ifndef VRPN_SOUND_MILES - - -#ifdef _WIN32 - -#include "c:\miles6\include\mss.h" -#include "vrpn_Sound.h" -#include "quat.h" - -extern void ChangeSoundIdBox(vrpn_int32 action, vrpn_int32 newId); - -class vrpn_Sound_Server_Miles : public vrpn_Sound_Server -{ -public: - vrpn_Sound_Server_Miles(const char * name, vrpn_Connection * c); - /*Name is the sender name. c is the connection. - ThreeDProvider is the 3D audio provider. Creative, huh. - It provides 3D audio on a level underneath the Miles code and can - be swapped out when a new provider comes along. This will just - necessitate including the provider file in the application directory - and #defining an alias for it's name string so that it can be passed - to the constructor. - The providerRoomSetting parameter changes the type of environment - the 3D audio provider will simulate. There are a number of - possibilities, including (all prefaced with "EAX_ENVIRONMENT_") - ROOM, BATHROOM, LIVINGROOM, CARPETEDHALLWAY, and HALLWAY. The - complete list is on page 214 of the MSS 5.0 manual. */ - ~vrpn_Sound_Server_Miles(); - - void setSpeakerType(int index = AIL_3D_HEADPHONE); - void setProvider(int index, int providerRoomSetting = EAX_ENVIRONMENT_GENERIC); - - //Set the 3D sound provider - void playSound(vrpn_SoundID id, vrpn_int32 repeat, vrpn_SoundDef soundDef); - /*vrpn_SoundID's are used to access sounds in memory. One is set - by calling loadSound. - repeat is the number of times to play the sound. Use 0 for the sound - to loop until stopped. - soundDef has pose, velocity, and volume information - */ - void stopSound(vrpn_SoundID id); - //immediately stops playing the sound referred to by id - void loadSound(char* filename, vrpn_SoundID id); - /*loads a .wav file into memory. - gives back id to reference the sound - currently (7/28/99) this does not reuse space previously - vacated in samples by unloading sounds*/ - void unloadSound(vrpn_SoundID id); - /*unloads id from samples. - Sets the corresponding cell in samples to FAIL. */ - void changeListenerStatus(vrpn_ListenerDef listenerDef); - /*sets the listener's pose and velocity to what is passed in*/ - void changeSoundStatus(vrpn_SoundID id, vrpn_SoundDef soundDef); - /*sets the sounds's pose and velocity to what is passed in. - If the sound is playing changes take place immediately. - If not nothing happens. */ - void initModel(vrpn_ModelDef modelDef); - - void changeE_f_S_m(qogl_matrix_type newmatrix); // sets the eye_from_sensor matrix - - void addProvider(HPROVIDER p); - void mainloop(const struct timeval * timeout=NULL); - bool noSounds(void); - void stopAllSounds(); - void shutDown(); - vrpn_int32 GetCurrentVolume(const vrpn_int32 CurrentSoundId); - char * GetLastError(); - vrpn_int32 GetCurrentPlaybackRate(const vrpn_int32 CurrentSoundId); - void GetCurrentPosition(const vrpn_int32 CurrentSoundId, F32* X_val, F32* Y_val, F32* Z_val); - void GetListenerPosition(F32* X_val, F32* Y_val, F32* Z_val); - void GetCurrentDistances(const vrpn_int32 CurrentSoundId, F32* FMin, F32* FMax); - void GetListenerOrientation(F32* X_val, F32 *Y_val, F32 *Z_val); - void GetCurrentOrientation(const vrpn_int32 CurrentSoundId,F32 *X_val, F32 *Y_val, F32 *Z_val); - - vrpn_int32 LastSoundId; //ID of last played sound - - qogl_matrix_type eye_f_sensor_m; // this is the matrix that goes from the - // sensor to the eyeball space (so for example - // it could be eyeball_f_hiballsensor [ where - // hiballsensor would be the hiball mounted - // on the HMD - -private: - - H3DSAMPLE* samples; /*audio handles for Miles, used as an array - accessed with getSample and addSample, - which are passed soundID's*/ - HDIGDRIVER DIG; //digital driver - HPROVIDER provider; //Current 3D audio provider - HPROVIDER *providers; //3D audio provider - H3DPOBJECT listener; //listener - - vrpn_int32 H_Max; //size of array samples - vrpn_int32 H_Cur; //index in samples - vrpn_int32 P_Max; //size of array samples - vrpn_int32 P_Cur; //index in samples - - void addSample(H3DSAMPLE sample, vrpn_SoundID id); - //adds a sample to the location in samples corresponding to id - H3DSAMPLE getSample(vrpn_SoundID id); - //gets the handle stored in samples[id] - void chooseProvider(char * ThreeDProvider); - /*chooses a 3D audio provider. - See the comment below the constructor for more info.*/ - void unloadAllSounds(); //clears out samples - void unloadHandle(vrpn_SoundID id); - //unloads a handle corresponding to id from samples - bool InitWindow(HINSTANCE hInstance); //Initializes the dialog window -}; -#endif //_WIN32 -#define VRPN_SOUND_MILES - -#endif \ No newline at end of file diff --git a/src/vrpn/server_src/nidaqClient.cpp b/src/vrpn/server_src/nidaqClient.cpp deleted file mode 100644 index ff0e213f5a47995b85b7cf29415e437f1690e9a2..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/nidaqClient.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/*****************************************************************************\ - nidaqClient.cpp - -- - Description : you need to link to the vrpnClient library to compile this - executable. - - ---------------------------------------------------------------------------- - Author: weberh - Created: Mon Apr 27 14:26:09 1998 - Revised: Fri Jan 29 17:09:15 1999 by weberh -\*****************************************************************************/ -#include "vrpn_Shared.h" - -#include <mmsystem.h> -// link with winmm.lib - -#include <iostream> -using std::endl; -using std::cerr; - -#include "vrpn_Analog.h" -void VRPN_CALLBACK printNidaq( void *pvTVZero, const vrpn_ANALOGCB cbInfo ) { - cerr << vrpn_TimevalMsecs( vrpn_TimevalDiff(cbInfo.msg_time, - (*(struct timeval *)pvTVZero))) - *0.001 << " Voltages: "; - for (int i=0;i<cbInfo.num_channel;i++) { - cerr << cbInfo.channel[i] << "\t"; - } - cerr << endl; -} - -int main( int argc, char *argv[] ) { - struct timeval tvZero; - vrpn_Analog_Remote *pNidaq; - - // hires timer for sleep - MMRESULT res = timeBeginPeriod(1); - if (res != TIMERR_NOERROR) { - cerr << "NidaqServer: timeBeginPeriod() failed!!!\n"; - } - - // pNidaq = new vrpn_Analog_Remote("Nidaq0@helium.cs.unc.edu"); - pNidaq = new vrpn_Analog_Remote("Nidaq0@trackerpc-cs.cs.unc.edu"); - - vrpn_gettimeofday(&tvZero,NULL); - pNidaq->register_change_handler(&tvZero, printNidaq); - - while (1) { - pNidaq->mainloop(); - Sleep(1); - } - timeEndPeriod(1); - return 0; -} diff --git a/src/vrpn/server_src/pc_linux64/client_and_server b/src/vrpn/server_src/pc_linux64/client_and_server deleted file mode 100755 index b229602aca88a12a2e4b12ffedd571725f90cdc9..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/pc_linux64/client_and_server and /dev/null differ diff --git a/src/vrpn/server_src/pc_linux64/testSharedObjectServer b/src/vrpn/server_src/pc_linux64/testSharedObjectServer deleted file mode 100755 index 11ed5e6bb08d3f3acc1c71cafeb1428799d2d86d..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/pc_linux64/testSharedObjectServer and /dev/null differ diff --git a/src/vrpn/server_src/pc_linux64/test_analogfly b/src/vrpn/server_src/pc_linux64/test_analogfly deleted file mode 100755 index 07f59cabf1405557ffb3105823836547d8b567ca..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/pc_linux64/test_analogfly and /dev/null differ diff --git a/src/vrpn/server_src/pc_linux64/test_auxiliary_logger b/src/vrpn/server_src/pc_linux64/test_auxiliary_logger deleted file mode 100755 index ac30eac191e9075fb1355c66d39556b58b140080..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/pc_linux64/test_auxiliary_logger and /dev/null differ diff --git a/src/vrpn/server_src/pc_linux64/test_logging b/src/vrpn/server_src/pc_linux64/test_logging deleted file mode 100755 index e7e31d916324d1c33613587a32be16fe6fdda90c..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/pc_linux64/test_logging and /dev/null differ diff --git a/src/vrpn/server_src/pc_linux64/test_mutexServer b/src/vrpn/server_src/pc_linux64/test_mutexServer deleted file mode 100755 index c7bc903a112abf5b47746686e3d04cda98f11d10..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/pc_linux64/test_mutexServer and /dev/null differ diff --git a/src/vrpn/server_src/pc_linux64/test_peerMutex b/src/vrpn/server_src/pc_linux64/test_peerMutex deleted file mode 100755 index c641df9bd0500b542b9f99ee409f17b11c0a7808..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/pc_linux64/test_peerMutex and /dev/null differ diff --git a/src/vrpn/server_src/pc_linux64/test_radamec_spi b/src/vrpn/server_src/pc_linux64/test_radamec_spi deleted file mode 100755 index c8b2a07b157026c47e45c9179df2b0c117ea514c..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/pc_linux64/test_radamec_spi and /dev/null differ diff --git a/src/vrpn/server_src/pc_linux64/test_vrpn b/src/vrpn/server_src/pc_linux64/test_vrpn deleted file mode 100755 index aae0e4cfe0df21ebfaad5aeac67345d2e46468a6..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/pc_linux64/test_vrpn and /dev/null differ diff --git a/src/vrpn/server_src/pc_linux64/testimager_server b/src/vrpn/server_src/pc_linux64/testimager_server deleted file mode 100755 index 2dc0bc1cf87dab261ec866edb709c0a6858089ae..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/pc_linux64/testimager_server and /dev/null differ diff --git a/src/vrpn/server_src/pc_linux64/vrpn_server b/src/vrpn/server_src/pc_linux64/vrpn_server deleted file mode 100755 index 00571fa5b2a10956fd105b3917345b979ec7ccee..0000000000000000000000000000000000000000 Binary files a/src/vrpn/server_src/pc_linux64/vrpn_server and /dev/null differ diff --git a/src/vrpn/server_src/phantom_custom_effects.txt b/src/vrpn/server_src/phantom_custom_effects.txt deleted file mode 100644 index 020b26ff625de4185423abc09c0ac32cbef48f88..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/phantom_custom_effects.txt +++ /dev/null @@ -1,41 +0,0 @@ ---------- Using custom Ghost lib effects with Phantom server : ---------------- - -You can add a specific ghost effect in a few steps following this guide : - -0. If you cannot find a specified location, try searching for ONDIM keyword, this is put before and after each modification. - -1. add files for your source code (.c and .h) for your ghost effect in "ghostEffects" folder - -2. go in vrpn_phantom.dsp project, and add those files in "Ghost Effects" folders - -3. edit vrpn_Phantom.h : - find and increment NB_CUSTOM_EFFECTS value of your number of additional effects - just below declare a "class YourEffect;" - and declare a const unsigned YOUR_EFFECT_ID = 1; (and so on for all your effects) - in the protected part of vrpn_Phantom class add a pointer on your effect : - YourEffect *yourEffect; - -4. edit vrpn_Phantom.c : - include your effect header : #include "ghostEffects/YourEffect.h" - find vrpn_Phantom constructor and add your effect initialization : yourEffect = new YourEffect(); - find int vrpn_Phantom::handle_custom_effect_change_message(void *userdata,vrpn_HANDLERPARAM p){ and add you own code here : - in switch statement, add a new case like this : - - case YOUR_EFFECT_ID: - if (nbParams == 1) { - me->instantBuzzEffect->setYourEffectParameter1(params[0]); - } - - me->phantom->setEffect(me->yourEffect); - me->phantom->startEffect(); - - where setYourEffectParameter1 is your custom effect method(s). - you can add several parameters handling as it is done for instantBuzzEffect. - -you can then compile VRPN, call your effect via vrpn interface by setCustomEffect(YOUR_EFFECT_ID, "your parameters separated by space in a string") -to set your parameters, forceDevice->startEffect() to start Ghost effect and forceDevice->stopEffect() to stop it - - - - - diff --git a/src/vrpn/server_src/plane.C b/src/vrpn/server_src/plane.C deleted file mode 100644 index 73885b97891ff7e6b6285abfaf0baf8dbcb5824e..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/plane.C +++ /dev/null @@ -1,403 +0,0 @@ -#include "vrpn_Configure.h" -#ifdef VRPN_USE_PHANTOM_SERVER -#include "plane.h" - -//#define VERBOSE - -#ifdef VRPN_USE_HDAPI - #include <HD/hd.h> - #include <HDU/hduError.h> -#endif - -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef VRPN_USE_HDAPI -gstType Plane::PlaneClassTypeId; -static int temp = Plane::initClass(); -#endif - -//constructors -Plane::Plane(const vrpn_HapticPlane & p) -{ - plane= vrpn_HapticPlane(p); - inEffect= FALSE; - isNewPlane = FALSE; - isInRecovery = FALSE; - recoveryPlaneCount = 0; - originalPlane = plane; - lastDepth = 0; - dIncrement = 0; - numRecoveryCycles = 1; -#ifdef VRPN_USE_HDAPI -#else - invalidateCumTransf(); -#endif -} - -Plane::Plane(const vrpn_HapticPlane * p) -{ - plane = vrpn_HapticPlane(*p); - inEffect= FALSE; - isNewPlane = FALSE; - isInRecovery = FALSE; - recoveryPlaneCount = 0; - originalPlane = plane; - lastDepth = 0; - dIncrement = 0; - numRecoveryCycles = 1; -#ifdef VRPN_USE_HDAPI -#else - invalidateCumTransf(); -#endif -} - -Plane::Plane(const Plane *p) -{ - inEffect= FALSE; - isNewPlane = FALSE; - isInRecovery = FALSE; - recoveryPlaneCount = 0; - originalPlane = plane; - lastDepth = 0; - dIncrement = 0; - numRecoveryCycles = 1; -#ifdef VRPN_USE_HDAPI -#else - invalidateCumTransf(); -#endif - plane = vrpn_HapticPlane(p->plane); -} - -Plane::Plane(const Plane &p) -{ - plane = vrpn_HapticPlane(p.plane); - inEffect= FALSE; - isNewPlane = FALSE; - isInRecovery = FALSE; - recoveryPlaneCount = 0; - originalPlane = plane; - lastDepth = 0; - dIncrement = 0; - numRecoveryCycles = 1; -#ifdef VRPN_USE_HDAPI -#else - invalidateCumTransf(); -#endif -} - - -Plane::Plane(double a,double b, double c, double d) -{ - vrpn_HapticVector vec = vrpn_HapticVector(a,b,c); - plane = vrpn_HapticPlane(vec,d); -#ifdef VRPN_USE_HDAPI -#else - invalidateCumTransf(); -#endif - inEffect= FALSE; - isNewPlane = FALSE; - isInRecovery = FALSE; - recoveryPlaneCount = 0; - originalPlane = plane; - lastDepth = 0; - dIncrement = 0; - numRecoveryCycles = 1; -} - -void Plane::setPlane(vrpn_HapticVector newNormal, vrpn_HapticPosition point) -{ plane.setPlane(newNormal,point); -} - - -void Plane::update(double a, double b, double c, double d) -{ - plane = vrpn_HapticPlane(a,b,c,d); - isNewPlane = TRUE; -} - -#ifdef VRPN_USE_HDAPI -void Plane::renderHL(void) -{ - // Do nothing if we're not turned on. - if (!inEffect) { return; } - - // setup materials - hlMaterialf(HL_FRONT_AND_BACK, HL_STIFFNESS, static_cast<float>(getSurfaceKspring())); - hlMaterialf(HL_FRONT_AND_BACK, HL_DAMPING, static_cast<float>(getSurfaceKdamping())); - hlMaterialf(HL_FRONT_AND_BACK, HL_STATIC_FRICTION, static_cast<float>(getSurfaceFstatic())); - hlMaterialf(HL_FRONT_AND_BACK, HL_DYNAMIC_FRICTION, static_cast<float>(getSurfaceFdynamic())); - - // Render the shape by specifying the callbacks for it - hlBeginShape(HL_SHAPE_CALLBACK, myId); - hlCallback(HL_SHAPE_INTERSECT_LS, - (HLcallbackProc) intersectSurface, static_cast<void*>(this)); - hlCallback(HL_SHAPE_CLOSEST_FEATURES, - (HLcallbackProc) closestSurfaceFeatures, static_cast<void*>(this)); - hlEndShape(); -} -#endif - -#ifdef VRPN_USE_HDAPI -// intersect the line segment from startPt to endPt with the plane. Return the closest point of intersection -// to the start point in intersectionPt. Return the surface normal at intersectionPt in intersectionNormal. -// Return which face (HL_FRONT or HL_BACK) is being touched in face. -// Return true if there is an intersection. - -bool HLCALLBACK Plane::intersectSurface(const HLdouble startPt_WC[3], const HLdouble endPt_WC[3], - HLdouble intersectionPt_WC[3], HLdouble intersectionNormal_WC[3], HLenum *face, - void *userdata) -{ - // The planes are half-spaces, so we intersect the front surface - // whenever the endpoint is inside the space and we intersect the - // back whenever the endpoint is outside the space. Pretend that - // the endpoint dropped perpendicularly onto the plane is the - // intersection point in all cases. - - // Get our Plane pointer from userdata - Plane *plane = static_cast<Plane *>(userdata); - - // Convert the list of doubles into a point, so that we can - // use the HDU helper functions. - vrpn_HapticPosition P = vrpn_HapticPosition(endPt_WC); - vrpn_HapticPosition closest = plane->plane.projectPoint(P); - vrpn_HapticVector normal(plane->plane.normal()); - normal.normalize(); - - // See if we are inside our outside by evaluating the plane - // equation. - double height = plane->plane.perpDistance(P); - if (height <= 0) { - *face = HL_FRONT; - } else { - normal *= -1; - *face = HL_BACK; - } - - // Copy results into the lists of doubles - int i; - for (i = 0; i < 3; i++) { - intersectionPt_WC[i] = closest[i]; - intersectionNormal_WC[i] = normal[i]; - } - - // We always hit either the front or the back! - return true; - -#if XXX_version_that_works_but_you_slip_through - // Get our Plane pointer from userdata - Plane *plane = static_cast<Plane *>(userdata); - - // Convert the list of doubles into points, then put these into a - // line segment so that we can use the HDU helper functions. - vrpn_HapticPosition P1 = vrpn_HapticPosition(startPt_WC); - vrpn_HapticPosition P2 = vrpn_HapticPosition(endPt_WC); - hduLineSegmentd Seg(P1,P2); - - // See if we intersect either in the front or in the back. - vrpn_HapticPlane::IntersectResult front_or_back; - double t; - int i; - front_or_back = plane->plane.intersectSegmentFront( Seg, t, 1e-8); - if (front_or_back == vrpn_HapticPlane::ResultFront) { - vrpn_HapticPosition intersection = P1 + t * (P2 - P1); - *face = HL_FRONT; - for (i = 0; i < 3; i++) { - intersectionPt_WC[i] = intersection[i]; - intersectionNormal_WC[i] = plane->plane.normal()[i]; - } - return true; - } else if (front_or_back == vrpn_HapticPlane::ResultBack) { - // Hit the back -- invert the normal. - vrpn_HapticPosition intersection = P1 + t * (P2 - P1); - *face = HL_BACK; - for (i = 0; i < 3; i++) { - intersectionPt_WC[i] = intersection[i]; - intersectionNormal_WC[i] = -plane->plane.normal()[i]; - } - return true; - } else { - // No intersection. - return false; - } -#endif -} - -// find the closest surface feature(s) to queryPt - -bool HLCALLBACK Plane::closestSurfaceFeatures(const HLdouble queryPt_WC[3], - const HLdouble targetPt_WC[3], /* Unused in example I copied from */ - HLgeom *geom_WC, HLdouble closestPt_WC[3], - void *userdata) -{ - // Get our Plane pointer from userdata - Plane *plane = static_cast<Plane *>(userdata); - - // Convert the list of doubles into a point, so that we can use the HDU helper functions. - vrpn_HapticPosition P = vrpn_HapticPosition(queryPt_WC); - - // The closest point is the perpendicular projection of the point - vrpn_HapticPosition closest = plane->plane.projectPoint(P); - - // Return the plane itself as the closest 2D local feature - vrpn_HapticVector normal(plane->plane.a(), plane->plane.b(), plane->plane.c()); - normal.normalize(); - - hlLocalFeature2dv(geom_WC, HL_LOCAL_FEATURE_PLANE, normal, closest); - int i; - for (i = 0; i < 3; i++) { - closestPt_WC[i] = closest[i]; - } - - return true; -} - -#endif - -#ifndef VRPN_USE_HDAPI -vrpn_HapticBoolean Plane::intersection(const vrpn_HapticPosition &startPt_WC, - const vrpn_HapticPosition &endPt_WC, - vrpn_HapticPosition &intersectionPt_WC, - vrpn_HapticVector &intersectionPtNormal_WC, - void **) -{ - vrpn_HapticPosition intersectionPoint; - if(!inEffect) { return FALSE; } - - //get the start and end position of the line segment against - //which the collision will be checked - vrpn_HapticPosition P1 = fromWorld(startPt_WC); - vrpn_HapticPosition P2 = fromWorld(endPt_WC); - - // XXX This always returns false here for GHOST, but that doesn't seem right... - // How could it possibly have been working? Comments in the texture_plane code - // seem to indicate that perhaps it doesn't work when they are any other objects - // in the scene but does work in that case (because this code is never used). - return FALSE; - - float t1 = (float) plane.error(P1); - float t2 = (float) plane.error(P2); - if(t1*t2 > 0 ) { // Segment from P2 to P1 does not intersect the plane - return FALSE; - } - //else segment from p1 to p2 intersects the plane, find the intersection point - plane.pointOfLineIntersection(P1,P2,intersectionPoint); - - //set the intersection point and normal - intersectionPt_WC = toWorld(intersectionPoint); - //set normal - intersectionPtNormal_WC = toWorld(plane.normal()); - - return TRUE; -} -#endif - -#ifndef VRPN_USE_HDAPI -vrpn_HapticBoolean Plane::collisionDetect(gstPHANToM *PHANToM) -{ - vrpn_HapticPosition lastSCP, phantomPos, intersectionPoint; - vrpn_HapticBoolean inContact; - double depth, d_new, d_goal; - - //if the plane node is not in effect - if(inEffect== FALSE) - return FALSE; - - inContact = getStateForPHANToM(PHANToM); - -#ifdef VRPN_USE_GHOST_31 - if(!_touchableByPHANToM || _resetPHANToMContacts) { -#else // Ghost 4.0 (and the default case) - if(!isTouchableByPHANToM() || _resetPHANToMContacts) { -#endif - _resetPHANToMContacts = FALSE; - inContact = FALSE; - (void) updateStateForPHANToM(PHANToM,inContact); - //printf("in if incontact is false\n"); - - return inContact; - } - - PHANToM->getPosition_WC(phantomPos); - phantomPos= fromWorld(phantomPos); - - // note: this depth is not necessarily in the same units - // as the coordinates because the plane equation is the - // same if we multiply it by a constant but this doesn't matter - // for our purposes since we are only interested in making - // sure the perceived depth does not change too quickly and - // this is done by interpolation - depth = -plane.error(phantomPos); - if (depth <= 0) { // positive depth is below surface - inContact = FALSE; - (void) updateStateForPHANToM(PHANToM,inContact); - return inContact; - } - else { // In contact - - // START OF RECOVERY IMPLEMENTATION - if (isNewPlane) { // set up stuff for recovery - isNewPlane = FALSE; - isInRecovery = TRUE; - recoveryPlaneCount = 0; - originalPlane = plane; - d_goal = plane.d(); - // calculate a new value for d such that the depth below - // the surface is the same as the last depth - d_new = depth + d_goal; - if (lastDepth > 0) { - d_new -= lastDepth; - } - // set first value for plane - plane = vrpn_HapticPlane(originalPlane.a(),originalPlane.b(), - originalPlane.c(), d_new); - if (numRecoveryCycles < 1) { - numRecoveryCycles = 1; - } - dIncrement = (d_goal - d_new)/(float)numRecoveryCycles; - } - - if (isInRecovery) { // move the recovery along one more step - recoveryPlaneCount++; - if (recoveryPlaneCount == numRecoveryCycles) { - isInRecovery = FALSE; - plane = originalPlane; - } - else { - plane = vrpn_HapticPlane(plane.a(),plane.b(),plane.c(), - plane.d() + dIncrement); - } - } - lastDepth = -(phantomPos[0]*plane.a() + phantomPos[1]*plane.b() + - phantomPos[2]*plane.c() + plane.d()); - - // END OF RECOVERY IMPLEMENTATION - - //project the current phantomPosition onto the plane to get the SCP - vrpn_HapticPosition SCP = plane.projectPoint(phantomPos); - - //set the SCPnormal to be the normal of the plane - vrpn_HapticVector SCPnormal = plane.normal(); - - //SCP = SCP + SCPnormal*0.001; - - //convert the SCP and SCPnormal to the world coordinate - //frame and add to the collision list of Phanotom - - // XXX We rely on VRPN not using transforms for planes. - SCP=toWorld(SCP); - SCPnormal = toWorld(SCPnormal); - inContact= TRUE; - (void)updateStateForPHANToM(PHANToM, inContact); - addCollision(PHANToM,SCP,SCPnormal); - } - - return inContact; -} -#endif - -#endif diff --git a/src/vrpn/server_src/plane.h b/src/vrpn/server_src/plane.h deleted file mode 100644 index 6ee4e238dc610ca5cb0ad375d742c36f11187b6a..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/plane.h +++ /dev/null @@ -1,166 +0,0 @@ -/* plane.h - Plane primitive. This is a user defined geometry node which - extends the GHOST SDK. - This class represents a planar surface - */ - -#ifndef PLANE_H -#define PLANE_H - -#include "vrpn_Configure.h" - - -#ifdef VRPN_USE_PHANTOM_SERVER -#include "vrpn_Shared.h" - - -#include "ghost.h" - -class Plane:public vrpn_HapticSurface -{ -public: - //Constructor - Plane(const vrpn_HapticPlane *); - - Plane(const vrpn_HapticPlane &); - - //Constructor - Plane(const Plane *); - - //Constructor - Plane(const Plane &); - - //Constructor - Plane(double a, double b, double c, double d); - - //Destructor - ~Plane() {} - - - - void update(double a, double b, double c, double d); - - void setPlane(vrpn_HapticVector newNormal, vrpn_HapticPosition point); - - static int initClass() { - //PlaneClassTypeId = gstUniqueId++ ; - return 0;} - - void setInEffect(vrpn_HapticBoolean effect) {inEffect = effect;} - - void setNumRecCycles(int nrc) { - if (nrc < 1) - printf("Error: setRecCycles(cycles < 1): %d\n",nrc); - else - numRecoveryCycles = nrc;} - -#ifdef VRPN_USE_HDAPI - HLuint myId; - void getHLId(void) { myId = hlGenShapes(1); }; - void releaseHLId(void) { hlDeleteShapes(myId, 1); }; -#else - // Get type of this class. No instance needed. - static gstType getClassTypeId() { return PlaneClassTypeId; } - - virtual gstType getTypeId() const { return PlaneClassTypeId;} - - // GHOST_IGNORE_IN_DOC: - // Returns TRUE if subclass is of type. - static vrpn_HapticBoolean staticIsOfType(gstType type) { - if (type == PlaneClassTypeId) return TRUE; - else return (gstShape::staticIsOfType(type));} - - virtual vrpn_HapticBoolean isOftype(gstType type) const { - if( type == PlaneClassTypeId) return TRUE; - else return (gstShape::isOfType(type)); } -#endif - -#ifdef VRPN_USE_HDAPI - void renderHL(void); - - // intersect the line segment from startPt to endPt with - // the surface. Return the closest point of intersection - // to the start point in intersectionPt. Return the - // surface normal at intersectionPt in intersectionNormal. - // Return which face (HL_FRONT or HL_BACK) is being touched. - // Return true if there is an intersection. - static bool HLCALLBACK intersectSurface( - const HLdouble startPt_WC[3], - const HLdouble endPt_WC[3], - HLdouble intersectionPt_WC[3], - HLdouble intersectionNormal_WC[3], - HLenum *face, - void *userdata); - - // find the closest surface feature(s) to queryPt - static bool HLCALLBACK closestSurfaceFeatures( - const HLdouble queryPt_WC[3], - const HLdouble targetPt_WC[3], - HLgeom *geom_WC, - HLdouble closestPt_WC[3], - void *userdata); -#else - // FOR_GHOST_EXTENSION: - // Used by system or for creating sub-classes only. - // Returns TRUE if line segment defined by startPt_WC and endPt_WC - // intersects this shape object. If so, intersectionPt_WC is set to - // point of intersection and intersectionNormal_WC is set to surface - // normal at intersection point. - virtual vrpn_HapticBoolean intersection( const vrpn_HapticPosition &startPt_WC, - const vrpn_HapticPosition &endPt_WC, - vrpn_HapticPosition &intersectionPt_WC, - vrpn_HapticVector &intersectionPtNormal_WC, - void **); - - // Returns TRUE if PHANToM is currently in contact with this object. - // If so, the collision is added to the PHANToM's list through - // gstPHANToM::getCollisionInfo() and gstPHANToM::collisionAdded(). - virtual vrpn_HapticBoolean collisionDetect(gstPHANToM *PHANToM) ; -#endif - -#ifndef VRPN_USE_HDAPI - void printSelf2() const { plane.printSelf2(); } -#endif - -#ifdef VRPN_USE_HDAPI - const vrpn_HapticPlane &getPlane(void) const { return plane; } - bool getActive(void) const { return (inEffect != 0); } - void setActive(vrpn_HapticBoolean active) { setInEffect(active); } -#endif - -protected: - vrpn_HapticPlane plane; - vrpn_HapticBoolean inEffect; - - // variables used for recovery - vrpn_HapticBoolean isNewPlane; // set to true by update(), set to false - // by collisionDetect() - vrpn_HapticBoolean isInRecovery;// true after collisionDetect() discovers - // there is a new plane and set to - // false when recoveryPlaneCount - // reaches numRecoveryCycles - int recoveryPlaneCount; // keeps track of how many intermediate - // planes there have been - vrpn_HapticPlane originalPlane; // keeps a copy of the plane set by - // update() so that we can restore this - // plane when recovery is complete - double lastDepth; // this is the depth below the surface - // for the plane previous to the - // new plane - updated in collisionDetect() - double dIncrement; // value added to d parameter of plane - // equation with each call to - // collisionDetect() during a recovery - // - this value is computed when a new - // plane is received - int numRecoveryCycles; // number of recovery cycles - - // end of variables for recovery - -private: -#ifndef VRPN_USE_HDAPI - static gstType PlaneClassTypeId; -#endif -}; - -#endif -#endif diff --git a/src/vrpn/server_src/sample_analog.C b/src/vrpn/server_src/sample_analog.C deleted file mode 100644 index 7b27389d2a48c4a2fb7f9c2e322f95d9b9fc4741..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/sample_analog.C +++ /dev/null @@ -1,97 +0,0 @@ -#include <vrpn_Connection.h> -#include <vrpn_Analog.h> - -#include <stdio.h> // fprintf() -#include <stdlib.h> // exit() - -#include <math.h> // sin(), cos() for debugging - -// sample_analog -// Tom Hudson, February 1999 -// -// Server program that opens up a port and reports over it -// any changes to the array of doubles exposed as -// vrpn_Analog_Server::channels(). The size of this array is -// defined in vrpn_Analog.h; currently 128. -// -// init_* and do_* are sample routines - put whatever you need there. -// -// Sample routines should cause two rising ramps, with video rate -// 5x audio rate. - -void init_audio_throughput_magic (int, char **) { - -} -void do_audio_throughput_magic (double * channels) { - static int done = 0; - -#if 1 - if (!done) { - channels[0] = 0.0; - done = 1; - } else - channels[0] += 0.5; -#else - struct timeval now; - vrpn_gettimeofday(&now, NULL); - channels[0] = sin(((double) now.tv_usec) / 1000000L); -#endif - -//fprintf(stderr, "Audio channel %.2g\n", channels[0]); - -} -void init_video_throughput_magic (int, char **) { - -} -void do_video_throughput_magic (double * channels) { - static int done = 0; - -#if 1 - if (!done) { - channels[0] = 0.0; - done = 1; - } else - channels[0] += 2.5; -#else - struct timeval now; - vrpn_gettimeofday(&now, NULL); - channels[0] = cos(((double) now.tv_usec) / 1000000L); -#endif - -//fprintf(stderr, "Video channel %.2g\n", channels[0]); - -} - -int main (int argc, char ** argv) { - - vrpn_Connection * c; - vrpn_Analog_Server * ats; - vrpn_Analog_Server * vts; - - struct timeval delay; - - c = vrpn_create_server_connection(); - ats = new vrpn_Analog_Server ("audio_throughput", c); - ats->setNumChannels(1); - vts = new vrpn_Analog_Server ("video_throughput", c); - vts->setNumChannels(1); - - printf("Services named audio-throughput and video-throughput now listening on port %d.\n", vrpn_DEFAULT_LISTEN_PORT_NO); - - delay.tv_sec = 1L; - delay.tv_usec = 0L; - - init_audio_throughput_magic(argc, argv); - init_video_throughput_magic(argc, argv); - - while (1) { - do_audio_throughput_magic(ats->channels()); - ats->report_changes(); - do_video_throughput_magic(vts->channels()); - vts->report_changes(); - c->mainloop(&delay); -fprintf(stderr, "while(): a = %.2g, v = %.2g.\n", ats->channels()[0], -vts->channels()[0]); - } -} - diff --git a/src/vrpn/server_src/sample_server.C b/src/vrpn/server_src/sample_server.C deleted file mode 100644 index 2f54476e6f24e10de562b3d26827cb7733dd574b..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/sample_server.C +++ /dev/null @@ -1,46 +0,0 @@ -#include <stdio.h> - -#include <vrpn_Connection.h> - -int VRPN_CALLBACK handle_quit (void * userdata, vrpn_HANDLERPARAM) { - int * quitNow = (int *) userdata; - - *quitNow = 1; - - return 0; // non-error completion -} - -int VRPN_CALLBACK handle_any_print (void * userdata, vrpn_HANDLERPARAM p) { - vrpn_Connection * c = (vrpn_Connection *) userdata; - - fprintf(stderr, "Got mesage \"%s\" from \"%s\".\n", - c->message_type_name(p.type), c->sender_name(p.sender)); - - return 0; // non-error completion -} - -int main (int argc, char ** argv) { - - vrpn_Connection * listen_connection; - long myId; - long fooType, barType, bazType, quitType; - int quitNow = 0; - - listen_connection = vrpn_create_server_connection(); - // defaults to port vrpn_DEFAULT_LISTEN_PORT_NO - - myId = listen_connection->register_sender("Sample Server"); - fooType = listen_connection->register_message_type("Sample Foo Type"); - barType = listen_connection->register_message_type("Sample Bar Type"); - bazType = listen_connection->register_message_type("Sample Baz Type"); - quitType = listen_connection->register_message_type("Sample Quit Type"); - - listen_connection->register_handler(quitType, handle_quit, &quitNow); - listen_connection->register_handler(vrpn_ANY_TYPE, handle_any_print, - listen_connection); - // defaults to vrpn_SENDER_ANY - - while (!quitNow) { - listen_connection->mainloop(); - } -} diff --git a/src/vrpn/server_src/set_instruments_for_sound_server b/src/vrpn/server_src/set_instruments_for_sound_server deleted file mode 100644 index 98ace6ee89f9040086010ebe994d70b606fd405b..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/set_instruments_for_sound_server +++ /dev/null @@ -1,7 +0,0 @@ -/unc/hmd/bin/pc_linux/sbiset \ - /unc/hmd/data/sbi/piano.sbi \ - /unc/hmd/data/sbi/bells.sbi \ - /unc/hmd/data/sbi/flute.sbi \ - /unc/hmd/data/sbi/guitar1.sbi - -#mixer vol 90 diff --git a/src/vrpn/server_src/testSharedObjectServer.C b/src/vrpn/server_src/testSharedObjectServer.C deleted file mode 100644 index ca4130467e4da4059d7beca2454c2fb6867cdd93..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/testSharedObjectServer.C +++ /dev/null @@ -1,65 +0,0 @@ -#include <vrpn_Connection.h> -#include <vrpn_SharedObject.h> - -#include <stdio.h> // for printf() -#include <stdlib.h> // for atoi() - -int VRPN_CALLBACK noteChange (void * userdata, vrpn_int32 newValue, vrpn_bool isLocal) { - vrpn_Shared_int32_Server * ip; - - ip = (vrpn_Shared_int32_Server *) userdata; - printf("Server %s set to %d.\n", ip->name(), newValue); - - return 0; -} - -int main (int argc, char ** argv) { - if (argc != 2) { - fprintf(stderr, "Must pass a port number as the sole argument\n"); - return 1; - } - vrpn_Connection * c; - - c = vrpn_create_server_connection(atoi(argv[1])); - - vrpn_Shared_int32_Server a ("a", 0, VRPN_SO_DEFER_UPDATES); - - a.setSerializerPolicy(vrpn_DENY_REMOTE); - - c->mainloop(); - - a.bindConnection(c); - a.register_handler(¬eChange, &a); - - c->mainloop(); - - printf("a = %d.\n", a.value()); - - c->mainloop(); - - a = 3; - - c->mainloop(); - - printf("a = %d.\n", a.value()); - - c->mainloop(); - - a = -3; - - c->mainloop(); - - printf("a = %d.\n", a.value()); - - c->mainloop(); - - while (c->doing_okay()) { - c->mainloop(); - } - - printf("C is not OK; shutting down.\n"); - - delete c; - return 2; -} - diff --git a/src/vrpn/server_src/test_analogfly.C b/src/vrpn/server_src/test_analogfly.C deleted file mode 100644 index 0eb3055e973541b9c1ed894d1fa978acb921b057..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_analogfly.C +++ /dev/null @@ -1,214 +0,0 @@ -// test_analogfly.C -// This is a VRPN test program that has both clients and servers -// running within the same thread. It is intended to test whether the -// vrpn_Tracker_AnalogFly class is working as intended. It does this -// by creating an analog to drive both an absolute and a differential -// AnalogFly and then seeing what their resulting outputs are. - -#include <stdio.h> // for printf, NULL, fprintf, etc -#include <stdlib.h> // for exit - -#include "vrpn_Analog.h" // for vrpn_Analog_Server, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, etc -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday, etc -#include "vrpn_Tracker.h" // for vrpn_TRACKERCB, etc -#include "vrpn_Tracker_AnalogFly.h" // for vrpn_TAF_axis, etc -#include "vrpn_Types.h" // for vrpn_float64, vrpn_false, etc - -const char *TRACKER1_NAME = "Tracker1"; -const char *TRACKER2_NAME = "Tracker2"; -const char *ANALOG_NAME = "Analog0"; -int CONNECTION_PORT = vrpn_DEFAULT_LISTEN_PORT_NO; // Port for connection to listen on - -int getting_analog_values = 0; //< Are we getting analog reports? - -// The connection that is used by all of the servers and remotes -vrpn_Connection *connection; - -// The tracker remotes -vrpn_Tracker_Remote *rtkr1; -vrpn_Tracker_Remote *rtkr2; - -// The analog remote -vrpn_Analog_Remote *rana; - -// The analog server to drive all this -vrpn_Analog_Server *sana; - -// The tracker servers -vrpn_Tracker_AnalogFly *stkr1; -vrpn_Tracker_AnalogFly *stkr2; - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_pos1 (void *, const vrpn_TRACKERCB t) -{ - printf("Got tracker1 pos: sensor %d at (%f, %f, %f)\n", t.sensor, - t.pos[0], t.pos[1], t.pos[2]); -} - -void VRPN_CALLBACK handle_pos2 (void *, const vrpn_TRACKERCB t) -{ - printf("Got tracker2 pos: sensor %d at (%f, %f, %f)\n", t.sensor, - t.pos[0], t.pos[1], t.pos[2]); -} - -void VRPN_CALLBACK handle_analog (void *, const vrpn_ANALOGCB a) -{ - if (a.channel[0] != 1.0) { - fprintf(stderr, "handle_analog: Expected 1.0, got %f\n",a.channel[0]); - } else { - getting_analog_values = 1; - } -} - - -/***************************************************************************** - * - Routines to create remotes and link their callback handlers. - * - *****************************************************************************/ - -void create_and_link_tracker_remotes(void) -{ - // Open the tracker remote using this connection - rtkr1 = new vrpn_Tracker_Remote (TRACKER1_NAME, connection); - rtkr2 = new vrpn_Tracker_Remote (TRACKER2_NAME, connection); - - // Set up the tracker callback handlers - rtkr1->register_change_handler(NULL, handle_pos1); - rtkr2->register_change_handler(NULL, handle_pos2); -} - -void create_and_link_analog_remote(void) -{ - // Open the analog remote using this connection - rana = new vrpn_Analog_Remote (ANALOG_NAME, connection); - - // Set up the analog callback handlers - rana->register_change_handler(NULL, handle_analog); -} - -int main (int argc, char * argv []) -{ - if (argc != 1) { - fprintf(stderr, "Usage: %s\n", argv[0]); - exit(-1); - } - - //--------------------------------------------------------------------- - // explicitly open the connection - connection = vrpn_create_server_connection(CONNECTION_PORT); - - //--------------------------------------------------------------------- - // Open the analog server, using this connection. - sana = new vrpn_Analog_Server(ANALOG_NAME, connection); - sana->setNumChannels(1); - sana->channels()[0] = 1.0; //< Set the value to 1 - printf("Analog's name is %s.\n", ANALOG_NAME); - create_and_link_analog_remote(); - - //--------------------------------------------------------------------- - // Open the tracker remotes, using this connection. - printf("Tracker 1's name is %s.\n", TRACKER1_NAME); - printf("Tracker 2's name is %s.\n", TRACKER2_NAME); - create_and_link_tracker_remotes(); - - //--------------------------------------------------------------------- - // Create the differential and absolute trackers. Both should send one - // report every two seconds. First, create the axis descriptor (used - // for all axes). Then pack this into the parameter descriptor and start - // the relative tracker and absolute tracker. - - vrpn_TAF_axis taf_axis1; // Axis that returns values from the analog - char name[500]; - sprintf(name, "*%s", ANALOG_NAME); - taf_axis1.name = name; - taf_axis1.channel = 0; - taf_axis1.offset = 0.0; - taf_axis1.thresh = 0.0; - taf_axis1.scale = 1.0; - taf_axis1.power = 1.0; - - vrpn_TAF_axis taf_axisNULL; // Axis that doesn't return anything - taf_axisNULL.name = NULL; - taf_axisNULL.channel = 0; - taf_axisNULL.offset = 0.0; - taf_axisNULL.thresh = 0.0; - taf_axisNULL.scale = 1.0; - taf_axisNULL.power = 1.0; - - vrpn_Tracker_AnalogFlyParam p; - p.reset_name = NULL; - p.reset_which = 0; - p.x = taf_axis1; - p.y = taf_axis1; - p.z = taf_axis1; - p.sx = taf_axisNULL; // Don't want any rotation! - p.sy = taf_axisNULL; - p.sz = taf_axisNULL; - - stkr1 = new vrpn_Tracker_AnalogFly(TRACKER1_NAME, connection, &p, 0.5, vrpn_false); - stkr2 = new vrpn_Tracker_AnalogFly(TRACKER2_NAME, connection, &p, 0.5, vrpn_true); - - /* - * main interactive loop - */ - - printf("You should see tracker1 positions increasing by 2 per 2 seconds\n"); - printf("You should see tracker2 positions remaining at 1\n"); - - struct timeval start, now, diff; - vrpn_gettimeofday(&start, NULL); - vrpn_gettimeofday(&now, NULL); - diff = vrpn_TimevalDiff(now, start); - while ( diff.tv_sec <= 10 ) { - - // Make sure that we are getting analog values - { static struct timeval last_report; - static int first = 1; - struct timeval now; - - if (first) { - vrpn_gettimeofday(&last_report, NULL); - first = 0; - } - vrpn_gettimeofday(&now, NULL); - if (now.tv_sec - last_report.tv_sec > 1) { - if (!getting_analog_values) { - fprintf(stderr, "Error - not getting analog values!\n"); - } - vrpn_gettimeofday(&last_report, NULL); - getting_analog_values = 0; // Make sure we get more next time - } - } - - // Let the servers, clients and connection do their things - sana->report(); sana->mainloop(); - stkr1->mainloop(); - stkr2->mainloop(); - rana->mainloop(); - rtkr1->mainloop(); - rtkr2->mainloop(); - connection->mainloop(); - - // Sleep for 1ms each iteration so we don't eat the CPU - vrpn_SleepMsecs(1); - vrpn_gettimeofday(&now, NULL); - diff = vrpn_TimevalDiff(now, start); - } - - delete sana; - delete rtkr1; - delete rtkr2; - delete stkr1; - delete stkr2; - delete connection; - - return 0; -} /* main */ diff --git a/src/vrpn/server_src/test_analogfly.dsp b/src/vrpn/server_src/test_analogfly.dsp deleted file mode 100644 index 88af1440fa44883428705ecbfa47652d46bca3e8..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_analogfly.dsp +++ /dev/null @@ -1,97 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_analogfly" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_analogfly - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_analogfly.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_analogfly.mak" CFG="test_analogfly - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_analogfly - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_analogfly - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_analogfly - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/test_analogfly/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/test_analogfly/Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "../../quat" /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "test_analogfly - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/test_analogfly/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/test_analogfly/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /I "../../quat" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /GZ /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "test_analogfly - Win32 Release" -# Name "test_analogfly - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=test_analogfly.C -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# End Target -# End Project diff --git a/src/vrpn/server_src/test_analogfly.vcproj b/src/vrpn/server_src/test_analogfly.vcproj deleted file mode 100644 index 70693c532181cc138050aa61c5f0a724bac9f8f6..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_analogfly.vcproj +++ /dev/null @@ -1,241 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="test_analogfly" - ProjectGUID="{ACD7DC44-3F1B-4321-86E0-2623B7CA0971}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/test_analogfly/Release" - IntermediateDirectory=".\../pc_win32/server_src/test_analogfly/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_analogfly/Release/test_analogfly.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,../quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_analogfly/Release/test_analogfly.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_analogfly/Release/" - ObjectFile=".\../pc_win32/server_src/test_analogfly/Release/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_analogfly/Release/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_analogfly/Release/test_analogfly.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/server_src/test_analogfly/Release/test_analogfly.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_analogfly/Release/test_analogfly.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/test_analogfly/Debug" - IntermediateDirectory=".\../pc_win32/server_src/test_analogfly/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_analogfly/Debug/test_analogfly.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,../quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_analogfly/Debug/test_analogfly.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_analogfly/Debug/" - ObjectFile=".\../pc_win32/server_src/test_analogfly/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_analogfly/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_analogfly/Debug/test_analogfly.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/server_src/test_analogfly/Debug/test_analogfly.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_analogfly/Debug/test_analogfly.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="test_analogfly.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/test_auxiliary_logger.C b/src/vrpn/server_src/test_auxiliary_logger.C deleted file mode 100644 index 6cf8a82a9ef3a74683300005998c25abde6d27ba..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_auxiliary_logger.C +++ /dev/null @@ -1,191 +0,0 @@ -#include <stdio.h> // for fprintf, NULL, stderr, etc -#include <stdlib.h> // for exit -#include <string.h> // for strcmp, strncpy - -#include "vrpn_Auxiliary_Logger.h" -#include "vrpn_Configure.h" // for VRPN_CALLBACK -#include "vrpn_Shared.h" // for vrpn_gettimeofday, timeval, etc - -vrpn_Auxiliary_Logger_Remote *g_logger; - - -/***************************************************************************** - * - Callback handlers and the data structures they use to pass information - to the rest of the program. - * - *****************************************************************************/ - -// Caller sets to false before mainloop(); handle_log_report sets to true -// when a report arrives. -bool g_got_report = false; - -// Names returned to the log report handler. Filled in by the report handler. -const unsigned NAMELEN = 2048; -char g_local_in[NAMELEN]; -char g_local_out[NAMELEN]; -char g_remote_in[NAMELEN]; -char g_remote_out[NAMELEN]; - -void VRPN_CALLBACK handle_log_report (void *, const vrpn_AUXLOGGERCB info) -{ - strncpy(g_local_in, info.local_in_logfile_name, NAMELEN); - strncpy(g_local_out, info.local_out_logfile_name, NAMELEN); - strncpy(g_remote_in, info.remote_in_logfile_name, NAMELEN); - strncpy(g_remote_out, info.remote_out_logfile_name, NAMELEN); - printf( "log report: \'%s\' \'%s\' \'%s\' \'%s\'\n", - g_local_in, g_local_out, g_remote_in, g_remote_out ); - g_got_report = true; -} - -/***************************************************************************** - * - *****************************************************************************/ - -// Request some log files and wait up to a second for the report of these -// files. Return true if we got a report and the names match. -bool test_logfile_names(const char *local_in, const char *local_out, - const char *remote_in, const char *remote_out) -{ - struct timeval start; - struct timeval now; - - // Mark no report and the request logging with the specified - // parameters. - g_got_report = false; - if (!g_logger->send_logging_request(local_in, local_out, remote_in, remote_out)) { - fprintf(stderr, "test_logfile_names: Logging request send failed\n"); - return false; - } - - // Mainloop the logger for up to five seconds waiting for a response. - // If we don't get a response, this is a failure. - vrpn_gettimeofday(&start, NULL); - do { - g_logger->mainloop(); - vrpn_gettimeofday(&now, NULL); - vrpn_SleepMsecs(1); - } while ( !g_got_report && (vrpn_TimevalDurationSeconds(now, start) < 5.0)); - if (!g_got_report) { - fprintf(stderr, "test_logfile_names: Timeout waiting for report of logging from server\n"); - return false; - } - - // Check to see if the names are the same. Return true if they all are. - if ( (strcmp(g_local_in, local_in) == 0) && - (strcmp(g_local_out, local_out) == 0) && - (strcmp(g_remote_in, remote_in) == 0) && - (strcmp(g_remote_out, remote_out) == 0) ) { - return true; - } else { - return false; - } -} - - -/***************************************************************************** - * - init - initialize everything - * - *****************************************************************************/ - -int main (int argc, char * argv []) -{ - const char * devicename = "Logger0@localhost"; - struct timeval start; - struct timeval now; - int ret = 0; - - // parse args - if (argc == 1) { - // Fine, use defaults. - } else if (argc > 2) { - fprintf(stderr, "Usage: %s Device_name\n" - " Device_name: VRPN name of data source to contact\n" - " example: Logger0@localhost\n", - argv[0]); - exit(0); - } else { - devicename = argv[1]; - } - - // Open the logger and set up its callback handler. - fprintf(stderr, "Logger's name is %s.\n", devicename); - g_logger = new vrpn_Auxiliary_Logger_Remote (devicename); - g_logger->register_report_handler(NULL, handle_log_report); - - // Main loop for half a second to get things started on the - // connection. - vrpn_gettimeofday(&start, NULL); - do { - g_logger->mainloop(); - vrpn_gettimeofday(&now, NULL); - } while (vrpn_TimevalDurationSeconds(now, start) < 0.5); - - // Try to create four named log files. Wait for a second after - // creation to give it something to log. - if (!test_logfile_names("temp1_local_in", "temp1_local_out", - "temp1_remote_in", "temp1_remote_out") ) { - fprintf(stderr,"Error creating first set of logs\n"); - ret = -1; - } - vrpn_gettimeofday(&start, NULL); - do { - g_logger->mainloop(); - vrpn_gettimeofday(&now, NULL); - } while (vrpn_TimevalDurationSeconds(now, start) < 5.0); - - // send a log-file-name request - g_logger->send_logging_status_request( ); - vrpn_gettimeofday(&start, NULL); - do { - g_logger->mainloop(); - vrpn_gettimeofday(&now, NULL); - } while (vrpn_TimevalDurationSeconds(now, start) < 5.0); - - // Try to create blank log files (no log should be made). Wait for a second after - // creation to give it something to log. - if (!test_logfile_names("", "", "", "") ) { - fprintf(stderr,"Error turning off logs\n"); - ret = -1; - } - vrpn_gettimeofday(&start, NULL); - do { - g_logger->mainloop(); - vrpn_gettimeofday(&now, NULL); - } while (vrpn_TimevalDurationSeconds(now, start) < 5.0); - - // Try to create just one named log file. Wait for a second after - // creation to give it something to log. - if (!test_logfile_names("temp2_local_in", "", "", "") ) { - fprintf(stderr,"Error creating second set of logs\n"); - ret = -1; - } - vrpn_gettimeofday(&start, NULL); - do { - g_logger->mainloop(); - vrpn_gettimeofday(&now, NULL); - } while (vrpn_TimevalDurationSeconds(now, start) < 5.0); - - // Try to create blank log files (no log should be made). Wait for a second after - // creation to give it something to log. - if (!test_logfile_names("", "", "", "") ) { - fprintf(stderr,"Error turning off logs\n"); - ret = -1; - } - vrpn_gettimeofday(&start, NULL); - do { - g_logger->mainloop(); - vrpn_gettimeofday(&now, NULL); - } while (vrpn_TimevalDurationSeconds(now, start) < 5.0); - - // Done. - if (ret == 0) { - printf("Success!\n"); - } else { - printf("Make sure that files with the requested names don't already exist.\n"); - } - delete g_logger; - return ret; - -} /* main */ diff --git a/src/vrpn/server_src/test_auxiliary_logger.dsp b/src/vrpn/server_src/test_auxiliary_logger.dsp deleted file mode 100644 index e2a065ef632a0b15f1caf1b34b1895c3a6ff4955..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_auxiliary_logger.dsp +++ /dev/null @@ -1,90 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_auxiliary_logger" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_auxiliary_logger - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_auxiliary_logger.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_auxiliary_logger.mak" CFG="test_auxiliary_logger - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_auxiliary_logger - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_auxiliary_logger - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_auxiliary_logger - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/test_auxiliary_logger/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/test_auxiliary_logger/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\..\quat" /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "test_auxiliary_logger - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/test_auxiliary_logger/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/test_auxiliary_logger/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /I "..\..\quat" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "test_auxiliary_logger - Win32 Release" -# Name "test_auxiliary_logger - Win32 Debug" -# Begin Source File - -SOURCE=test_auxiliary_logger.C -# End Source File -# End Target -# End Project diff --git a/src/vrpn/server_src/test_auxiliary_logger.vcproj b/src/vrpn/server_src/test_auxiliary_logger.vcproj deleted file mode 100644 index ac8a991a9413fa253d66361259d98063b337c6cc..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_auxiliary_logger.vcproj +++ /dev/null @@ -1,242 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="test_auxiliary_logger" - ProjectGUID="{D3E2077E-765E-42D6-AD31-B41EE6630DF3}" - RootNamespace="test_auxiliary_logger" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/test_auxiliary_logger/Release" - IntermediateDirectory=".\../pc_win32/server_src/test_auxiliary_logger/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_auxiliary_logger/Release/test_auxiliary_logger.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,../quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_auxiliary_logger/Release/test_auxiliary_logger.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_auxiliary_logger/Release/" - ObjectFile=".\../pc_win32/server_src/test_auxiliary_logger/Release/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_auxiliary_logger/Release/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_auxiliary_logger/Release/test_auxiliary_logger.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/server_src/test_auxiliary_logger/Release/test_auxiliary_logger.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_auxiliary_logger/Release/test_auxiliary_logger.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/test_auxiliary_logger/Debug" - IntermediateDirectory=".\../pc_win32/server_src/test_auxiliary_logger/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_auxiliary_logger/Debug/test_auxiliary_logger.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,../quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_auxiliary_logger/Debug/test_auxiliary_logger.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_auxiliary_logger/Debug/" - ObjectFile=".\../pc_win32/server_src/test_auxiliary_logger/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_auxiliary_logger/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_auxiliary_logger/Debug/test_auxiliary_logger.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/server_src/test_auxiliary_logger/Debug/test_auxiliary_logger.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_auxiliary_logger/Debug/test_auxiliary_logger.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="test_auxiliary_logger.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/test_freespace.C b/src/vrpn/server_src/test_freespace.C deleted file mode 100644 index 16ce3c18ec017c1a4eb9c7d50c86de988d828917..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_freespace.C +++ /dev/null @@ -1,196 +0,0 @@ -// test_freespace.C -// This is a VRPN test program that has both clients and servers -// running within the same thread. It is intended to test whether a -// Hillcrest Labs Freespace powered device is working properly. -// Most of this code was copied from the test_radamec_spi.C file -// -#ifdef VRPN_USE_FREESPACE -#include <stdlib.h> -#include <stdio.h> -#include <signal.h> -#include <string.h> -#include "vrpn_Connection.h" -#include "vrpn_Tracker.h" -#include "vrpn_Dial.h" -#include "vrpn_Button.h" -#include "vrpn_Freespace.h" - -char *TRACKER_NAME = "Freespace0"; -char trackerName[512]; -int CONNECTION_PORT = vrpn_DEFAULT_LISTEN_PORT_NO; // Port for connection to listen on - -// The connection that is used by all of the servers and remotes -vrpn_Connection *connection; - -// The tracker remote -vrpn_Tracker_Remote *rtkr; -vrpn_Dial_Remote *rdial; -vrpn_Button_Remote *rbutton; -// The freespace device -vrpn_Freespace *freespace; - -/***************************************************************************** - * Console handlers for CTRL-C - ****************************************************************************/ -int quit = 0; -#ifdef _WIN32 -static BOOL CtrlHandler(DWORD fdwCtrlType) { - quit = 1; - return TRUE; -} - -void addControlHandler() { - if (!SetConsoleCtrlHandler( (PHANDLER_ROUTINE) CtrlHandler, TRUE )) { - printf("Could not install control handler\n"); - } -} - -#else - -static void sighandler(int num) { - quit = 1; -} -void addControlHandler() { - // Set up the signal handler to catch - // CTRL-C and clean up gracefully. - struct sigaction setmask; - sigemptyset(&setmask.sa_mask); - setmask.sa_handler = sighandler; - setmask.sa_flags = 0; - - sigaction(SIGHUP, &setmask, NULL); - sigaction(SIGINT, &setmask, NULL); -} -#endif - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_pos (void *, const vrpn_TRACKERCB t) -{ - printf(" + pos, sensor: %+08.08lf %+08.08lf %+08.08lf %+08.08lf\n", t.quat[0], t.quat[1], t.quat[2], t.quat[3]); -} - -void VRPN_CALLBACK handle_vel (void *, const vrpn_TRACKERVELCB t) -{ - printf(" + vel, sensor: %+08.08lf %+08.08lf %+08.08lf\n", t.vel[0], t.vel[1], t.vel[2]); -} - -void VRPN_CALLBACK handle_acc (void *, const vrpn_TRACKERACCCB t) -{ - printf(" + acc, sensor: %+08.08lf %+08.08lf %+08.08lf\n", t.acc[0], t.acc[1], t.acc[2]); -} -void VRPN_CALLBACK handle_dial (void *, const vrpn_DIALCB d) -{ - printf(" + dial %d %lf: \n", d.dial, d.change); -} -void VRPN_CALLBACK handle_buttons (void *, const vrpn_BUTTONCB b) -{ - printf(" + button %d %d: \n", b.button, b.state); -} - -/***************************************************************************** - * - Routines to create remotes and link their callback handlers. - * - *****************************************************************************/ - -void create_and_link_tracker_remote(const char * trackerName) -{ - // Open the tracker remote using this connection - rtkr = new vrpn_Tracker_Remote (trackerName, connection); - - // Set up the tracker callback handlers - rtkr->register_change_handler(NULL, handle_pos); - rtkr->register_change_handler(NULL, handle_vel); - rtkr->register_change_handler(NULL, handle_acc); -} -void create_and_link_button_remote(const char * trackerName) -{ - // Open the tracker remote using this connection - rbutton = new vrpn_Button_Remote (trackerName, connection); - // Set up the tracker callback handlers - rbutton->register_change_handler(NULL, handle_buttons); -} -void create_and_link_dial_remote(const char * trackerName) -{ - // Open the tracker remote using this connection - rdial = new vrpn_Dial_Remote (trackerName, connection); - - // Set up the tracker callback handlers - rdial->register_change_handler(NULL, handle_dial); -} - - -int main (int argc, char * argv []) -{ - unsigned controller = 0, sendBody = 0, sendUser = 1; - sprintf(trackerName, "%s", TRACKER_NAME); - - // The only command line argument is a string for the configuration - if (argc > 1) { - // Get the arguments (device_name, controller_index, bodyFrame, userFrame) - if (sscanf(argv[1], "%511s%u%u%u", trackerName, &controller, &sendBody, &sendUser) != 4) { - fprintf(stderr, "Bad vrpn_Freespace line: %s\n", argv[1]); - fprintf(stderr, "Expect: deviceName controllerIndex bodyFrame userFrame\n"); - return -1; - } - } - - // Correctly handle command line input - addControlHandler(); - - //--------------------------------------------------------------------- - // explicitly open the connection - connection = vrpn_create_server_connection(CONNECTION_PORT); - - //--------------------------------------------------------------------- - // create a freespace tracker for the first device. - printf("Tracker's name is %s.\n", trackerName); - freespace = vrpn_Freespace::create(trackerName, connection, 0, (sendBody != 0), (sendUser != 0)); - if (!freespace) { - fprintf(stderr, "Error opening freespace device: %s\n", trackerName); - return 1; - } - // the freespace device exposes 3 vrpn interfaces. Tracker, buttons, - // and a Dial (scrollwheel) - // libfreespace also reports values like a mouse (dx/dy), though the - // vrpn messages are not currently sent. Considering the client side doesn't - // have a notion of a mouse, but treats it as an analog device, I didn't feel - // compelled to generate the messages, though the additional code is fairly - // straight forward - - create_and_link_tracker_remote(trackerName); - create_and_link_button_remote(trackerName); - create_and_link_dial_remote(trackerName); - - while ( !quit ) { - - // Let the servers, clients and connection do their things - freespace->mainloop(); - rtkr->mainloop(); - connection->mainloop(); - - // Sleep for 1ms each iteration so we don't eat the CPU - vrpn_SleepMsecs(1); - } - - delete freespace; - delete rtkr; - delete connection; - - return 0; -} /* main */ - -#else -#include <stdio.h> -int main (void) -{ - printf("vrpn_FreeSpace not compiled in, set this in Cmake config or vrpn_Configuration.h and recompile\n"); - return -1; -} -#endif - diff --git a/src/vrpn/server_src/test_freespace.vcproj b/src/vrpn/server_src/test_freespace.vcproj deleted file mode 100644 index 54fc9737d1c5abe82fc630aa8fdf4fc79c574b6d..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_freespace.vcproj +++ /dev/null @@ -1,216 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="test_freespace" - ProjectGUID="{E78DD78A-4E96-44EA-975E-55D647DF7270}" - RootNamespace="test_freespace" - Keyword="Win32Proj" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/test_freespace/Debug" - IntermediateDirectory=".\../pc_win32/server_src/test_freespace/Debug" - ConfigurationType="1" - CharacterSet="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="../,../../libfreespace/include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - AdditionalLibraryDirectories="" - GenerateDebugInformation="true" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/test_freespace/Release" - IntermediateDirectory=".\../pc_win32/server_src/test_freespace/Release" - ConfigurationType="1" - CharacterSet="1" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="../,../../libfreespace/include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile="$(OutDir)\$(ProjectName).exe" - LinkIncremental="1" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\test_freespace.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/test_logging.C b/src/vrpn/server_src/test_logging.C deleted file mode 100644 index 60751bf9a4b978c3a92d3b751363cc3ad3823ea9..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_logging.C +++ /dev/null @@ -1,401 +0,0 @@ -// test_logging.C -// This is a VRPN test program that has both clients and servers -// running within the same thread. It is intended to test the logging of -// messages and the replay of those messages from the saved log files -// The program uses VRPN text send/receive to make the logged messages -// flow from both the client to the server and the server to the client. - -#include <stdio.h> // for NULL, fprintf, printf, etc -#include <string.h> // for strlen - -#include "vrpn_Configure.h" // for VRPN_CALLBACK, etc -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday -#include "vrpn_Text.h" // for vrpn_Text_Receiver, etc -#ifndef _WIN32 -#include <unistd.h> // for unlink -#endif - -const char *CLIENT_TEXT_NAME = "Text0"; -const char *SERVER_TEXT_NAME = "Text1"; -int CONNECTION_PORT = vrpn_DEFAULT_LISTEN_PORT_NO; // Port for connection to listen on - -// The names of the files to log to. First the ones that will be -// open the whole time, then the ones that get created on request -// by the client connection. -const char *SERVER_BASE_INCOMING_LOG = "svr_incoming"; -const char *SERVER_BASE_OUTGOING_LOG = "svr_outgoing"; - -const char *CLIENT_CLIENT_INCOMING_LOG = "cli_cli_incoming"; -const char *CLIENT_CLIENT_OUTGOING_LOG = "cli_cli_outgoing"; -const char *CLIENT_SERVER_INCOMING_LOG = "cli_svr_incoming"; -const char *CLIENT_SERVER_OUTGOING_LOG = "cli_svr_outgoing"; - -// The server and client connections -vrpn_Connection *server_connection = NULL; -vrpn_Connection *client_connection = NULL; - -// The text sender and receiver whose receiver is on the client side. -vrpn_Text_Sender *server_text_sender = NULL; -vrpn_Text_Receiver *client_text_receiver = NULL; - -// The text sender and receiver whose receiver is on the server side. -vrpn_Text_Sender *client_text_sender = NULL; -vrpn_Text_Receiver *server_text_receiver = NULL; - -bool got_text_message = false; - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_text (void *, const vrpn_TEXTCB info) -{ - printf("Got text type %d level %d: '%s'\n", info.type, info.level, info.message); - got_text_message = true; -} - -/***************************************************************************** - * - Routines to create remotes and link their callback handlers. - * - *****************************************************************************/ - -void create_and_link_text_remote(void) -{ - client_text_receiver = new vrpn_Text_Receiver (CLIENT_TEXT_NAME, client_connection); - client_text_receiver->register_message_handler(NULL, handle_text); - - client_text_sender = new vrpn_Text_Sender (SERVER_TEXT_NAME, client_connection); -} - -/***************************************************************************** - * - Server routines for those devices that rely on application intervention - * - *****************************************************************************/ - -void send_text_once_per_second(void) -{ - static long secs = 0; - struct timeval now; - - vrpn_gettimeofday(&now, NULL); - if (secs == 0) { // First time through - secs = now.tv_sec; - } - if ( now.tv_sec - secs >= 1 ) { - secs = now.tv_sec; - client_text_sender->send_message("Client message"); - server_text_sender->send_message("Server message"); - } -} - -//--------------------------------------------------------------------- -// Open a client connection, asking for the specified logging files -// from the server. Loop for a while to make sure messages get delivered. -// Then delete the client-side objects and connection. - -int open_client_connection_and_loop(const char *local_in, const char *local_out, - const char *remote_in, const char *remote_out) -{ - //--------------------------------------------------------------------- - // Open a client connection to the server, asking for the logging files - // requested in the parameters. - char name[512]; - sprintf(name, "%s@localhost:%d", CLIENT_TEXT_NAME, CONNECTION_PORT); - client_connection = vrpn_get_connection_by_name(name, local_in, local_out, - remote_in, remote_out); - if (client_connection == NULL) { - fprintf(stderr,"Cannot open client connection\n"); - return -2; - } - - //--------------------------------------------------------------------- - // Open the client-side text sender and receivers. - create_and_link_text_remote(); - - //--------------------------------------------------------------------- - // Go for a few seconds to let messages get sent back and forth. - - struct timeval now, start; - vrpn_gettimeofday(&now, NULL); - start = now; - while ( now.tv_sec - start.tv_sec < 3 ) { - send_text_once_per_second(); - server_connection->mainloop(); - client_connection->mainloop(); - vrpn_gettimeofday(&now, NULL); - } - - //--------------------------------------------------------------------- - // Delete the client-side objects and get rid of the client connection - // by reducing its reference count. - delete client_text_receiver; - delete client_text_sender; - client_connection->removeReference(); - - return 0; -} - -int check_for_messages_in(const char *device_name, const char *file_name) -{ - //--------------------------------------------------------------------- - // Open a text receiver to connect to the specified input file. - char name[512]; - sprintf(name, "%s@file://%s", device_name, file_name); - printf("Checking for logs in %s\n", name); - vrpn_Text_Receiver *r = new vrpn_Text_Receiver(name); - r->register_message_handler(NULL, handle_text); - - //--------------------------------------------------------------------- - // Clear the text-received flag and then watch the connection for a - // few seconds to see if we get a message. - got_text_message = false; - struct timeval now, start; - vrpn_gettimeofday(&now, NULL); - start = now; - while ( now.tv_sec - start.tv_sec < 3 ) { - r->mainloop(); - vrpn_gettimeofday(&now, NULL); - } - - //--------------------------------------------------------------------- - // Delete the receiver, which should also get rid of the connection. - delete r; - - //--------------------------------------------------------------------- - // Make sure we got a message. - if (got_text_message) { - return 0; - } else { - return -1; - } -} - -// Server incoming connections get saved to files with a number -// appended, per connection: if the base name is "foo", then the -// files are foo-1 foo-2 fo-3... -char *make_server_incoming_name(const char *base, int which) -{ - char *name = new char[strlen(base) + 30]; - if (name == NULL) { - return NULL; - } - sprintf(name, "%s-%d", base, which); - return name; -} - -int main (int argc, char * argv []) -{ - // Return value is good so far... - int ret = 0; - - if (argc != 1) { - fprintf(stderr, "Usage: %s\n", argv[0]); - return -1; - } - - //--------------------------------------------------------------------- - // explicitly open the server connection, telling it to log its - // incoming and outgoing messages even when there is not a logging - // client connection. - server_connection = vrpn_create_server_connection(CONNECTION_PORT, - SERVER_BASE_INCOMING_LOG, SERVER_BASE_OUTGOING_LOG); - if (server_connection == NULL) { - fprintf(stderr,"Cannot open server connection\n"); - return -1; - } - - //--------------------------------------------------------------------- - // Open the server-side text sender and receivers. - server_text_sender = new vrpn_Text_Sender(CLIENT_TEXT_NAME, server_connection); - server_text_receiver = new vrpn_Text_Receiver(SERVER_TEXT_NAME, server_connection); - if ( (server_text_sender == NULL) || (server_text_receiver == NULL) ) { - fprintf(stderr,"Cannot create text server or client\n"); - return -3; - } - - //--------------------------------------------------------------------- - // Establish the no-logging connection and make sure it works. - // (This will put entries into the server-side log files.) - printf("Sending messages to and from server with base logging only\n"); - if (0 != open_client_connection_and_loop(NULL, NULL, NULL, NULL)) { - fprintf(stderr,"Could not test no-logging connection\n"); - ret = -4; - } - - //--------------------------------------------------------------------- - // Establish the client-in-logging connection and make sure it works. - // (This will put entries into the server-side log files.) - printf("Sending messages to and from server with client-in\n"); - if (0 != open_client_connection_and_loop(CLIENT_CLIENT_INCOMING_LOG, NULL, NULL, NULL)) { - fprintf(stderr,"Could not test CLIENT_CLIENT_INCOMING_LOG connection\n"); - ret = -4; - } - - //--------------------------------------------------------------------- - // Establish the client-out-logging connection and make sure it works. - // (This will put entries into the server-side log files.) - printf("Sending messages to and from server with client-out\n"); - if (0 != open_client_connection_and_loop(NULL, CLIENT_CLIENT_OUTGOING_LOG, NULL, NULL)) { - fprintf(stderr,"Could not test CLIENT_CLIENT_OUTGOING_LOG connection\n"); - ret = -4; - } - - //--------------------------------------------------------------------- - // Establish the server-in-logging connection and make sure it works. - // Actually, this has to be done below in a separate step because the - // server has been set to automatically log incoming connections. - - //--------------------------------------------------------------------- - // Establish the server-out-logging connection and make sure it works. - // (This will put entries into the server-side log files.) - printf("Sending messages to and from server with server-out\n"); - if (0 != open_client_connection_and_loop(NULL, NULL, NULL, CLIENT_SERVER_OUTGOING_LOG)) { - fprintf(stderr,"Could not test CLIENT_SERVER_OUTGOING_LOG connection\n"); - ret = -4; - } - - //--------------------------------------------------------------------- - // Mainloop the sever connection to make sure we close all open links - printf("Waiting for connections to close\n"); - struct timeval now, start; - vrpn_gettimeofday(&now, NULL); - start = now; - while ( now.tv_sec - start.tv_sec < 3 ) { - server_connection->mainloop(); - vrpn_gettimeofday(&now, NULL); - } - - //--------------------------------------------------------------------- - // Delete the server-side objects and get rid of the server connection - // by reducing its reference count. - delete server_text_receiver; - delete server_text_sender; - server_connection->removeReference(); - - //--------------------------------------------------------------------- - // To test the case of logging server-side incoming messages when the - // server was not constructed to do so automatically, we need to open - // the server again with no logging requested and then connect to it - // with a client that requests it. - server_connection = vrpn_create_server_connection(CONNECTION_PORT); - if (server_connection == NULL) { - fprintf(stderr,"Cannot open server connection\n"); - return -1; - } - - //--------------------------------------------------------------------- - // Open the server-side text sender and receivers. - server_text_sender = new vrpn_Text_Sender(CLIENT_TEXT_NAME, server_connection); - server_text_receiver = new vrpn_Text_Receiver(SERVER_TEXT_NAME, server_connection); - if ( (server_text_sender == NULL) || (server_text_receiver == NULL) ) { - fprintf(stderr,"Cannot create text server or client\n"); - return -3; - } - - //--------------------------------------------------------------------- - // Establish the server-in-logging connection and make sure it works. - // (This will put entries into the server-side log files.) - printf("Sending messages to and from server with server-out\n"); - if (0 != open_client_connection_and_loop(NULL, NULL, CLIENT_SERVER_INCOMING_LOG, NULL )) { - fprintf(stderr,"Could not test CLIENT_SERVER_INCOMING_LOG connection\n"); - ret = -4; - } - - //--------------------------------------------------------------------- - // Try re-writing the same log file a couple of times. This turned up a - // crash case before. We do it twice because it may save an emergency - // log file in temp the first time. - printf("Testing for crash when attempt to rewrite file with client-out\n"); - open_client_connection_and_loop(NULL, CLIENT_CLIENT_OUTGOING_LOG, NULL, NULL); - open_client_connection_and_loop(NULL, CLIENT_CLIENT_OUTGOING_LOG, NULL, NULL); - - //--------------------------------------------------------------------- - // Mainloop the server connection to make sure we close all open links - printf("Waiting for connections to close\n"); - vrpn_gettimeofday(&now, NULL); - start = now; - while ( now.tv_sec - start.tv_sec < 3 ) { - server_connection->mainloop(); - vrpn_gettimeofday(&now, NULL); - } - - //--------------------------------------------------------------------- - // Delete the server-side objects and get rid of the server connection - // by reducing its reference count. - delete server_text_receiver; - delete server_text_sender; - server_connection->removeReference(); - - //--------------------------------------------------------------------- - // Try reading from each of the log files in turn to make sure each - // contains at least one text message of the desired type. - if (0 != check_for_messages_in(SERVER_TEXT_NAME, make_server_incoming_name(SERVER_BASE_INCOMING_LOG,1))) { - fprintf(stderr,"Failure when reading from server base incoming log file\n"); - ret = -5; - } - if (0 != check_for_messages_in(CLIENT_TEXT_NAME, SERVER_BASE_OUTGOING_LOG)) { - fprintf(stderr,"Failure when reading from server base outgoing log file\n"); - ret = -5; - } - if (0 != check_for_messages_in(CLIENT_TEXT_NAME, CLIENT_CLIENT_INCOMING_LOG)) { - fprintf(stderr,"Failure when reading from client-side incoming log file\n"); - ret = -5; - } - if (0 != check_for_messages_in(SERVER_TEXT_NAME, CLIENT_CLIENT_OUTGOING_LOG)) { - fprintf(stderr,"Failure when reading from client-side outgoing log file\n"); - ret = -5; - } - if (0 != check_for_messages_in(SERVER_TEXT_NAME, CLIENT_SERVER_INCOMING_LOG)) { - fprintf(stderr,"Failure when reading from server-side incoming log file\n"); - ret = -5; - } - if (0 != check_for_messages_in(CLIENT_TEXT_NAME, CLIENT_SERVER_OUTGOING_LOG)) { - fprintf(stderr,"Failure when reading from server-side outgoing log file\n"); - ret = -5; - } - - // Clean up after ourselves by deleting the log files. - printf("Deleting log files\n"); - // Don't complain about using "unlink" -#ifdef _MSC_VER -#pragma warning ( disable : 4996 ) -#endif - - char * name; - name = make_server_incoming_name(SERVER_BASE_INCOMING_LOG,1); - unlink(name); - delete[] name; - - name = make_server_incoming_name(SERVER_BASE_INCOMING_LOG,2); - unlink(name); - delete[] name; - - name = make_server_incoming_name(SERVER_BASE_INCOMING_LOG,3); - unlink(name); - delete[] name; - - name = make_server_incoming_name(SERVER_BASE_INCOMING_LOG,4); - unlink(name); - delete[] name; - - unlink(SERVER_BASE_OUTGOING_LOG); - unlink(CLIENT_CLIENT_INCOMING_LOG); - unlink(CLIENT_CLIENT_OUTGOING_LOG); - unlink(CLIENT_SERVER_INCOMING_LOG); - unlink(CLIENT_SERVER_OUTGOING_LOG); - - unlink("/tmp/vrpn_emergency_log"); - - if (ret == 0) { - printf("Success!\n"); - } else { - printf("Failure\n"); - } - return ret; - -} /* main */ diff --git a/src/vrpn/server_src/test_logging.dsp b/src/vrpn/server_src/test_logging.dsp deleted file mode 100644 index a55a3c50c1fbd942e4717da3406d44adf9d7dd19..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_logging.dsp +++ /dev/null @@ -1,90 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_logging" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_logging - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_logging.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_logging.mak" CFG="test_logging - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_logging - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_logging - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_logging - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/test_logging/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/test_logging/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\..\quat" /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "test_logging - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/test_logging/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/test_logging/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /I "..\..\quat" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "test_logging - Win32 Release" -# Name "test_logging - Win32 Debug" -# Begin Source File - -SOURCE=test_logging.C -# End Source File -# End Target -# End Project diff --git a/src/vrpn/server_src/test_logging.vcproj b/src/vrpn/server_src/test_logging.vcproj deleted file mode 100644 index 1c87d49002b34075086ef70f97c2b406d7862430..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_logging.vcproj +++ /dev/null @@ -1,229 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="test_logging" - ProjectGUID="{BC7D2A06-CDC7-45AC-9CD9-4911B7A65059}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/test_logging/Release" - IntermediateDirectory=".\../pc_win32/server_src/test_logging/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_logging/Release/test_logging.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,..\..\quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_logging/Release/test_logging.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_logging/Release/" - ObjectFile=".\../pc_win32/server_src/test_logging/Release/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_logging/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_logging/Release/test_logging.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/server_src/test_logging/Release/test_logging.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_logging/Release/test_logging.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/test_logging/Debug" - IntermediateDirectory=".\../pc_win32/server_src/test_logging/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_logging/Debug/test_logging.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,..\..\quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_logging/Debug/test_logging.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_logging/Debug/" - ObjectFile=".\../pc_win32/server_src/test_logging/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_logging/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_logging/Debug/test_logging.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/server_src/test_logging/Debug/test_logging.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_logging/Debug/test_logging.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <File - RelativePath="test_logging.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/test_loopback.C b/src/vrpn/server_src/test_loopback.C deleted file mode 100644 index 673992ff52c9055f87e63f5b1241e323a077d83a..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_loopback.C +++ /dev/null @@ -1,548 +0,0 @@ -// test_loopback.C -// This is a VRPN test program that has both clients and servers -// running within the same thread. It is intended to test the sending -// and receiving of messages for the various types of devices that VRPN -// supports. It also tests the deletion and creation of "Remote" objects -// to make sure that it doesn't cause problems. -// The basic idea is to instantiate both "server" devices (the example -// drivers are used for this) and "Remote" devices using the same connection -// for each. Then, the local call handlers on the connection will send the -// information from the server to the client callbacks. -// Before performing the above tests, VRPN checks its thread library -// to make sure the calls work as expected. If that fails, the program -// returns an error message. Note that there is no multi-threading happening -// in the actual message or other test code, just a testing of the thread -// library itself. -// This code is similar to a subset of test_vrpn, but it uses a -// Loopback connection for its tests. -// -// Tested device types so far include: -// vrpn_Analog_Server --> vrpn_Analog_Remote -// vrpn_Button_Example_Server --> vrpn_Button_Remote -// vrpn_Dial_Example_Server --> vrpn_Dial_Remote -// vrpn_Text_Sender --> vrpn_Text_Receiver -// vrpn_Tracker_NULL --> vrpn_Tracker_Remote - -#include <stdio.h> // for printf, NULL, fprintf, etc - -#include "vrpn_Analog.h" // for vrpn_Analog_Remote, etc -#include "vrpn_Analog_Output.h" -#include "vrpn_Button.h" // for vrpn_Button_Remote, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, etc -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_Dial.h" // for vrpn_Dial_Remote, etc -#include "vrpn_Poser.h" // for vrpn_POSERCB, etc -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday, etc -#include "vrpn_Text.h" // for vrpn_Text_Receiver, etc -#include "vrpn_Tracker.h" // for vrpn_Tracker_Remote, etc -#include "vrpn_Types.h" // for vrpn_float64 - -const char *DIAL_NAME = "Dial0@localhost"; -const char *TRACKER_NAME = "Tracker0@localhost"; -const char *TEXT_NAME = "Text0@localhost"; -const char *ANALOG_NAME = "Analog0@localhost"; -const char *ANALOG_OUTPUT_NAME = "AnalogOutput0@localhost"; -const char *BUTTON_NAME = "Button0@localhost"; -const char *POSER_NAME = "Poser0@localhost"; - -// The connection that is used by all of the servers and remotes -vrpn_Connection *connection; - -// The tracker server and remote -vrpn_Tracker_NULL *stkr; -vrpn_Tracker_Remote *rtkr; - -// The dial server and remote -vrpn_Dial_Example_Server *sdial; -vrpn_Dial_Remote *rdial; - -// The button server and remote -vrpn_Button_Example_Server *sbtn; -vrpn_Button_Remote *rbtn; - -// The text sender and receiver -vrpn_Text_Sender *stext; -vrpn_Text_Receiver *rtext; - -// The analog server and remote -vrpn_Analog_Server *sana; -vrpn_Analog_Remote *rana; - -// The analog output server and remote -vrpn_Analog_Output_Callback_Server *sanaout; -vrpn_Analog_Output_Remote *ranaout; - -// the poser server and remote -vrpn_Poser_Server* sposer; -vrpn_Poser_Remote* rposer; - -// Counters incremented by callback handlers. -unsigned pcount = 0, vcount = 0, acount = 0; -unsigned dcount = 0; -unsigned tcount = 0; -unsigned ancount = 0; -unsigned aocount = 0; -unsigned bcount = 0; -unsigned pocount = 0, prcount = 0; - -unsigned p1count = 0, p2count = 0; -unsigned b1count = 0, b2count = 0; - - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_pos (void *, const vrpn_TRACKERCB t) -{ - printf("Got tracker pos, sensor %d\n", t.sensor); - pcount++; -} - -void VRPN_CALLBACK handle_vel (void *, const vrpn_TRACKERVELCB t) -{ - printf(" + vel, sensor %d\n", t.sensor); - vcount++; -} - -void VRPN_CALLBACK handle_acc (void *, const vrpn_TRACKERACCCB t) -{ - printf(" + acc, sensor %d\n", t.sensor); - acount++; -} - -void VRPN_CALLBACK handle_dial (void *, const vrpn_DIALCB d) -{ - printf("Dial %d spun by %lf\n", d.dial, d.change); - dcount++; -} - -void VRPN_CALLBACK handle_text (void *, const vrpn_TEXTCB t) -{ - printf("Received text \"%s\"\n", t.message); - tcount++; -} - -void VRPN_CALLBACK handle_analog (void *, const vrpn_ANALOGCB a) -{ - printf("Received %d analog channels\n", a.num_channel); - ancount++; -} - -void VRPN_CALLBACK handle_analog_output (void *, const vrpn_ANALOGOUTPUTCB a) -{ - printf("Received %d analog output channels (first is %lf)\n", a.num_channel, a.channel[0]); - aocount++; -} - -void VRPN_CALLBACK handle_button (void *, const vrpn_BUTTONCB b) -{ - printf("Button %d is now in state %d\n", b.button, b.state); - bcount++; -} - - -void VRPN_CALLBACK handle_poser( void*, const vrpn_POSERCB p ) -{ - printf( "Poser position/orientation: (%lf, %lf, %lf) \n\t (%lf, %lf, %lf, %lf)\n", - p.pos[0], p.pos[1], p.pos[2], p.quat[0], p.quat[1], p.quat[2], p.quat[3] ); - pocount++; -} - - -void VRPN_CALLBACK handle_poser_relative( void*, const vrpn_POSERCB p ) -{ - printf( "Poser position/orientation relative: (%lf, %lf, %lf) \n\t (%lf, %lf, %lf, %lf)\n", - p.pos[0], p.pos[1], p.pos[2], p.quat[0], p.quat[1], p.quat[2], p.quat[3] ); - prcount++; -} - -void VRPN_CALLBACK handle_pos1 (void *, const vrpn_TRACKERCB t) -{ - printf("Got tracker1 pos, sensor %d\n", t.sensor); - p1count++; -} - -void VRPN_CALLBACK handle_pos2 (void *, const vrpn_TRACKERCB t) -{ - printf("Got tracker2 pos, sensor %d\n", t.sensor); - p2count++; -} - -void VRPN_CALLBACK handle_button1 (void *, const vrpn_BUTTONCB b) -{ - printf("Button1 %d is now in state %d\n", b.button, b.state); - b1count++; -} - -void VRPN_CALLBACK handle_button2 (void *, const vrpn_BUTTONCB b) -{ - printf("Button2 %d is now in state %d\n", b.button, b.state); - b2count++; -} - - -/***************************************************************************** - * - Routines to create remotes and link their callback handlers. - * - *****************************************************************************/ - -void create_and_link_tracker_remote(void) -{ - // Open the tracker remote using this connection - rtkr = new vrpn_Tracker_Remote (TRACKER_NAME, connection); - - // Set up the tracker callback handlers - rtkr->register_change_handler(NULL, handle_pos); - rtkr->register_change_handler(NULL, handle_vel); - rtkr->register_change_handler(NULL, handle_acc); -} - -void create_and_link_dial_remote(void) -{ - // Open the dial remote using this connection - rdial = new vrpn_Dial_Remote (DIAL_NAME, connection); - - // Set up the dial callback handlers - rdial->register_change_handler(NULL, handle_dial); -} - -void create_and_link_button_remote(void) -{ - // Open the button remote using this connection - rbtn = new vrpn_Button_Remote (BUTTON_NAME, connection); - - // Set up the button callback handlers - rbtn->register_change_handler(NULL, handle_button); -} - -void create_and_link_text_remote(void) -{ - // Open the text remote using this connection - rtext = new vrpn_Text_Receiver (TEXT_NAME, connection); - - // Set up the dial callback handlers - rtext->register_message_handler(NULL, handle_text); -} - -void create_and_link_analog_remote(void) -{ - // Open the analog remote using this connection - rana = new vrpn_Analog_Remote (ANALOG_NAME, connection); - - // Set up the analog callback handlers - rana->register_change_handler(NULL, handle_analog); -} - -void create_and_link_analog_output_server(void) -{ - // Open the analog output remote using this connection - sanaout = new vrpn_Analog_Output_Callback_Server (ANALOG_OUTPUT_NAME, connection, 12); - - // Set up the analog output callback handlers - sanaout->register_change_handler(NULL, handle_analog_output); -} - - -void create_and_link_poser_server( void ) -{ - sposer = new vrpn_Poser_Server( POSER_NAME, connection ); - sposer->register_change_handler( NULL, handle_poser ); - sposer->register_relative_change_handler( NULL, handle_poser_relative ); -} - - -/***************************************************************************** - * - Server routines for those devices that rely on application intervention - * - *****************************************************************************/ - -void send_text_once_in_a_while(void) -{ - static long secs = 0; - struct timeval now; - - vrpn_gettimeofday(&now, NULL); - if (secs == 0) { // First time through - secs = now.tv_sec; - } - if ( now.tv_sec - secs >= 1 ) { - secs = now.tv_sec; - stext->send_message("Text message"); - } -} - -void send_analog_once_in_a_while(void) -{ - static long secs = 0; - struct timeval now; - - vrpn_gettimeofday(&now, NULL); - if (secs == 0) { // First time through - secs = now.tv_sec; - } - if ( now.tv_sec - secs >= 1 ) { - secs = now.tv_sec; - sana->report(); - } -} - -void send_analog_output_once_in_a_while(void) -{ - static long secs = 0; - struct timeval now; - - vrpn_gettimeofday(&now, NULL); - if (secs == 0) { // First time through - secs = now.tv_sec; - } - if ( now.tv_sec - secs >= 1 ) { - static vrpn_float64 val = 1.0; - secs = now.tv_sec; - val++; - ranaout->request_change_channel_value(0, val); - } -} - - -void send_poser_once_in_a_while( void ) -{ - static long secs = 0; - struct timeval now; - static vrpn_float64 p[3] = { 0, 0, 0 }; - static vrpn_float64 dp[3] = {0, 0, 0 }; - static vrpn_float64 q[4] = { 1, 1, 1, 1 }; - static int count = 0; - static bool doRelative = true; - - vrpn_gettimeofday( &now, NULL ); - if( secs == 0 ) - { // First time through - secs = now.tv_sec; - } - if( now.tv_sec - secs >= 1 ) - { - if( !doRelative ) - { - // do a pose request - p[count%3] += 1; - if( p[count%3] > 1 ) p[count%3] = -1; - rposer->request_pose( now, p, q ); - count++; - doRelative = true; - } - else - { // do a relative pose request - dp[count%3] = 0.25; - dp[(count+1)%3] = 0; - dp[(count+2)%3] = 0; - rposer->request_pose_relative( now, dp, q ); - doRelative = false; - } - secs = now.tv_sec; - } -} - - -int main (int argc, char * argv []) -{ - if (argc != 1) { - fprintf(stderr, "Usage: %s\n", argv[0]); - return -1; - } - - //--------------------------------------------------------------------- - // test the thread library - if (!vrpn_test_threads_and_semaphores()) { - fprintf(stderr, "vrpn_test_threads_and_semaphores() failed!\n"); - fprintf(stderr, " (This is not often used within VRPN, so it should not be fatal\n"); - } else { - printf("Thread code passes tests (not using for the following though)\n"); - } - - //--------------------------------------------------------------------- - // explicitly open the connection - connection = vrpn_create_server_connection("loopback:"); - - if (!connection->doing_okay()) { - fprintf(stderr, "Connection not doing okay (should be impossible)!\n"); - return -1; - } - - - //--------------------------------------------------------------------- - // Open the tracker server, using this connection, 2 sensors, update 1 times/sec - stkr = new vrpn_Tracker_NULL(TRACKER_NAME, connection, 2, 1.0); - printf("Tracker's name is %s.\n", TRACKER_NAME); - create_and_link_tracker_remote(); - - //--------------------------------------------------------------------- - // Open the dial server, using this connection, 2 dials, spin 0.5 rev/sec, - // update 1 times/sec - sdial = new vrpn_Dial_Example_Server(DIAL_NAME, connection, 2, 0.5, 1.0); - printf("Dial's name is %s.\n", DIAL_NAME); - create_and_link_dial_remote(); - - //--------------------------------------------------------------------- - // Open the button server, using this connection, defaults - sbtn = new vrpn_Button_Example_Server(BUTTON_NAME, connection); - printf("Button's name is %s.\n", BUTTON_NAME); - create_and_link_button_remote(); - - //--------------------------------------------------------------------- - // Open the text sender and receiver. - stext = new vrpn_Text_Sender(TEXT_NAME, connection); - printf("Text's name is %s.\n", TEXT_NAME); - create_and_link_text_remote(); - - //--------------------------------------------------------------------- - // Open the analog server, using this connection. - sana = new vrpn_Analog_Server(ANALOG_NAME, connection); - sana->setNumChannels(8); - printf("Analog's name is %s.\n", ANALOG_NAME); - create_and_link_analog_remote(); - - //--------------------------------------------------------------------- - // Open the analog output remote , using this connection. - ranaout = new vrpn_Analog_Output_Remote(ANALOG_OUTPUT_NAME, connection); - printf("Analog's name is %s.\n", ANALOG_OUTPUT_NAME); - create_and_link_analog_output_server(); - - //--------------------------------------------------------------------- - // open the poser remote - rposer = new vrpn_Poser_Remote( POSER_NAME, connection ); - printf( "Poser's name is %s.\n", POSER_NAME ); - create_and_link_poser_server(); - - /* - * main interactive loop - */ - int repeat_tests = 4; - while ( repeat_tests > 0 ) { - static long secs = 0; - struct timeval now; - - // Let the servers, clients and connection do their things - send_analog_output_once_in_a_while(); - ranaout->mainloop(); // The remote is on the server for AnalogOutput - sanaout->mainloop(); // The server is on the client for AnalogOutput - send_analog_once_in_a_while(); - sana->mainloop(); - rana->mainloop(); - send_text_once_in_a_while(); - rtext->mainloop(); - sdial->mainloop(); - rdial->mainloop(); - sbtn->mainloop(); - rbtn->mainloop(); - stkr->mainloop(); - rtkr->mainloop(); - send_poser_once_in_a_while(); - rposer->mainloop(); - sposer->mainloop(); - connection->mainloop(); - - // Every 2 seconds, delete the old remotes and create new ones - vrpn_gettimeofday(&now, NULL); - if (secs == 0) { // First time through - secs = now.tv_sec; - } - if ( now.tv_sec - secs >= 2 ) { - secs = now.tv_sec; - printf("\nDeleting and restarting _Remote objects\n"); - delete rtkr; - delete rdial; - delete rbtn; - delete rtext; - delete rana; - delete sanaout; - delete sposer; - create_and_link_tracker_remote(); - create_and_link_dial_remote(); - create_and_link_button_remote(); - create_and_link_text_remote(); - create_and_link_analog_remote(); - create_and_link_analog_output_server(); - create_and_link_poser_server(); - --repeat_tests; - } - - // Sleep for 1ms each iteration so we don't eat the CPU - vrpn_SleepMsecs(1); - } - if ( (pcount == 0) || (vcount == 0) || (acount == 0) || - (dcount == 0) || (tcount == 0) || (ancount == 0) || - (aocount == 0) || - (bcount == 0) || (pocount == 0) || (prcount == 0) ) { - fprintf(stderr,"Did not get callbacks from one or more device\n"); - return -1; - } - - printf("\nDeleting _Remote objects\n"); - delete rtkr; - delete rdial; - delete rbtn; - delete rtext; - delete rana; - delete ranaout; - delete rposer; - - printf("Testing whether two connections to a tracker and to a button each get their own messages.\n"); - vrpn_Tracker_Remote *t1 = new vrpn_Tracker_Remote(TRACKER_NAME, connection); - t1->register_change_handler(NULL, handle_pos1); - vrpn_Tracker_Remote *t2 = new vrpn_Tracker_Remote(TRACKER_NAME, connection); - t2->register_change_handler(NULL, handle_pos2); - vrpn_Button_Remote *b1 = new vrpn_Button_Remote(BUTTON_NAME, connection); - b1->register_change_handler(NULL, handle_button1); - vrpn_Button_Remote *b2 = new vrpn_Button_Remote(BUTTON_NAME, connection); - b2->register_change_handler(NULL, handle_button2); - unsigned long secs; - struct timeval start, now; - vrpn_gettimeofday(&start, NULL); - do { - stkr->mainloop(); - sbtn->mainloop(); - t1->mainloop(); - t2->mainloop(); - b1->mainloop(); - b2->mainloop(); - connection->mainloop(); - - vrpn_gettimeofday(&now, NULL); - secs = now.tv_sec - start.tv_sec; - } while (secs <= 2); - if ( (p1count == 0) || (p2count == 0) ) { - fprintf(stderr,"Did not get callbacks from trackers\n"); - return -1; - } - if ( (b1count == 0) || (b2count == 0) ) { - fprintf(stderr,"Did not get callbacks from buttons\n"); - return -1; - } - - printf("Deleting extra remote objects\n"); - delete t1; - delete t2; - delete b1; - delete b2; - - printf("Deleting servers and connection\n"); - delete stkr; - delete sbtn; - delete sdial; - delete stext; - delete sana; - delete sanaout; - delete sposer; - connection->removeReference(); - - printf("Success!\n"); - return 0; - -} /* main */ - - diff --git a/src/vrpn/server_src/test_mutexServer.C b/src/vrpn/server_src/test_mutexServer.C deleted file mode 100644 index 1c80eb731e7ee9cf04ebecc706328a973b0b7fd6..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_mutexServer.C +++ /dev/null @@ -1,29 +0,0 @@ - -#include <stdlib.h> -#include <string.h> -#include <vrpn_Connection.h> -#include <vrpn_Mutex.h> - - -int main (int argc, char ** argv) { - - vrpn_Connection * c; - vrpn_Mutex_Server * me; - int portno = vrpn_DEFAULT_LISTEN_PORT_NO; - - if (argc > 2) { - portno = atoi(argv[2]); - } - - char con_name[512]; - sprintf(con_name, "localhost:%d", portno); - c = vrpn_create_server_connection(con_name); - me = new vrpn_Mutex_Server (argv[1], c); - - while (1) { - me->mainloop(); - } - -} - - diff --git a/src/vrpn/server_src/test_peerMutex.C b/src/vrpn/server_src/test_peerMutex.C deleted file mode 100644 index a6f879e97a70cca1d4ade06f6dba0b2c05a0a62d..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_peerMutex.C +++ /dev/null @@ -1,79 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> // for exit(), atoi() - -#include <vrpn_Mutex.h> - - -int rg (void *) { - printf("callback - Mutex granted.\n"); - return 0; -} - -int rd (void *) { - printf("callback - Mutex denied.\n"); - return 0; -} - -int rel (void *) { - printf("callback - Mutex released.\n"); - return 0; -} - -int main (int argc, char ** argv) { - - vrpn_PeerMutex * me; - char inputLine [100]; - - me = new vrpn_PeerMutex (argv[1], atoi(argv[2])); - - me->addRequestGrantedCallback(NULL, rg); - me->addRequestDeniedCallback(NULL, rd); - me->addReleaseCallback(NULL, rel); - - printf("req - request the mutex.\n"); - printf("rel - release the mutex.\n"); - printf("? - get current mutex state.\n"); - printf("add - add a peer site to the mutex.\n"); - printf("quit - exit.\n"); - - while (1) { - - me->mainloop(); - memset(inputLine, 0, 100); - if (fgets(inputLine, 100, stdin) == NULL) { - perror("could not read line"); - return -1; - } - - if (!strncmp(inputLine, "req", 3)) { - printf("test_mutex: sending request.\n"); - me->request(); - } else if (!strncmp(inputLine, "rel", 3)) { - printf("test_mutex: sending release.\n"); - me->release(); - } else if (!strncmp(inputLine, "?", 1)) { - printf("isAvailable: %d.\n", me->isAvailable()); - printf("isHeldLocally: %d.\n", me->isHeldLocally()); - printf("isHeldRemotely: %d.\n", me->isHeldRemotely()); - printf("numPeers: %d.\n", me->numPeers()); - } else if (!strncmp(inputLine, "add", 3)) { - printf("Name of peer: "); - fflush(stdout); - if (fgets(inputLine, 100, stdin) == NULL) { - perror("could not read line"); - return -1; - } - me->addPeer(inputLine); - } else if (!strncmp(inputLine, "quit", 4)) { - delete me; - exit(0); - } else { - printf(".\n"); - } - } - - -} - - diff --git a/src/vrpn/server_src/test_radamec_spi.C b/src/vrpn/server_src/test_radamec_spi.C deleted file mode 100644 index b0f36f97b3596a039cb05b622fe08cb4da05343c..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_radamec_spi.C +++ /dev/null @@ -1,128 +0,0 @@ -// test_radamec_spi.C -// This is a VRPN test program that has both clients and servers -// running within the same thread. It is intended to test whether a -// Radamec Serial Positioning Interface that is connected to a local -// serial port is working. -// - -#include <stdio.h> // for printf, NULL, fprintf, etc - -#include "vrpn_Analog.h" // for vrpn_Analog_Remote, etc -#include "vrpn_Analog_Radamec_SPI.h" // for vrpn_Radamec_SPI -#include "vrpn_Configure.h" // for VRPN_CALLBACK, etc -#include "vrpn_Connection.h" -#include "vrpn_Shared.h" // for vrpn_SleepMsecs -#include "vrpn_Tracker.h" // for vrpn_Tracker_Remote, etc - -const char *TRACKER_NAME = "Tracker0"; -const char *ANALOG_NAME = "Analog0"; -int CONNECTION_PORT = vrpn_DEFAULT_LISTEN_PORT_NO; // Port for connection to listen on - -// The connection that is used by all of the servers and remotes -vrpn_Connection *connection; - -// The tracker remote -vrpn_Tracker_Remote *rtkr; - -// The analog remote -vrpn_Analog_Remote *rana; - -// The Serial unit -vrpn_Radamec_SPI *sana; - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_pos (void *, const vrpn_TRACKERCB t) -{ - printf("Got tracker pos, sensor %d", t.sensor); -} - -void VRPN_CALLBACK handle_vel (void *, const vrpn_TRACKERVELCB t) -{ - printf(" + vel, sensor %d", t.sensor); -} - -void VRPN_CALLBACK handle_acc (void *, const vrpn_TRACKERACCCB t) -{ - printf(" + acc, sensor %d\n", t.sensor); -} - -void VRPN_CALLBACK handle_analog (void *, const vrpn_ANALOGCB a) -{ - printf("Received %d analog channels\n", a.num_channel); -} - - -/***************************************************************************** - * - Routines to create remotes and link their callback handlers. - * - *****************************************************************************/ - -void create_and_link_tracker_remote(void) -{ - // Open the tracker remote using this connection - rtkr = new vrpn_Tracker_Remote (TRACKER_NAME, connection); - - // Set up the tracker callback handlers - rtkr->register_change_handler(NULL, handle_pos); - rtkr->register_change_handler(NULL, handle_vel); - rtkr->register_change_handler(NULL, handle_acc); -} - -void create_and_link_analog_remote(void) -{ - // Open the analog remote using this connection - rana = new vrpn_Analog_Remote (ANALOG_NAME, connection); - - // Set up the analog callback handlers - rana->register_change_handler(NULL, handle_analog); -} - - -int main (int argc, char * argv []) -{ - if (argc != 2) { - fprintf(stderr, "Usage: %s serial_port_name\n", argv[0]); - return -1; - } - - //--------------------------------------------------------------------- - // explicitly open the connection - connection = vrpn_create_server_connection(CONNECTION_PORT); - - //--------------------------------------------------------------------- - // Open the tracker server, using this connection, 2 sensors, update 1 times/sec -// printf("Tracker's name is %s.\n", TRACKER_NAME); -// create_and_link_tracker_remote(); - - //--------------------------------------------------------------------- - // Open the analog server, using this connection. - sana = new vrpn_Radamec_SPI(ANALOG_NAME, connection, argv[1], 38400); - printf("Analog's name is %s.\n", ANALOG_NAME); - create_and_link_analog_remote(); - - /* - * main interactive loop - */ - while ( 1 ) { - - // Let the servers, clients and connection do their things - sana->mainloop(); - rana->mainloop(); -// rtkr->mainloop(); - connection->mainloop(); - - // Sleep for 1ms each iteration so we don't eat the CPU - vrpn_SleepMsecs(1); - } - - return 0; - -} /* main */ - - diff --git a/src/vrpn/server_src/test_radamec_spi.dsp b/src/vrpn/server_src/test_radamec_spi.dsp deleted file mode 100644 index 423385c412528c997cb150600aec6e481bb30608..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_radamec_spi.dsp +++ /dev/null @@ -1,93 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_radamec_spi" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_radamec_spi - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_radamec_spi.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_radamec_spi.mak" CFG="test_radamec_spi - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_radamec_spi - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_radamec_spi - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_radamec_spi - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/test_radamec_spi/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/test_radamec_spi/Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\..\quat" /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /TP /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "test_radamec_spi - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/test_radamec_spi/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/test_radamec_spi/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /I "..\..\quat" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /GZ /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "test_radamec_spi - Win32 Release" -# Name "test_radamec_spi - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=test_radamec_spi.C -# End Source File -# End Group -# End Target -# End Project diff --git a/src/vrpn/server_src/test_radamec_spi.vcproj b/src/vrpn/server_src/test_radamec_spi.vcproj deleted file mode 100644 index 84e9efb38da6682bc2b118ea54440a4ac8c4fdcf..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_radamec_spi.vcproj +++ /dev/null @@ -1,235 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="test_radamec_spi" - ProjectGUID="{65E26214-D2DE-4577-93E7-9A34C968C341}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/test_radamec_spi/Release" - IntermediateDirectory=".\../pc_win32/server_src/test_radamec_spi/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_radamec_spi/Release/test_radamec_spi.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,..\..\quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_radamec_spi/Release/test_radamec_spi.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_radamec_spi/Release/" - ObjectFile=".\../pc_win32/server_src/test_radamec_spi/Release/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_radamec_spi/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_radamec_spi/Release/test_radamec_spi.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/server_src/test_radamec_spi/Release/test_radamec_spi.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_radamec_spi/Release/test_radamec_spi.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/test_radamec_spi/Debug" - IntermediateDirectory=".\../pc_win32/server_src/test_radamec_spi/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_radamec_spi/Debug/test_radamec_spi.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,..\..\quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_radamec_spi/Debug/test_radamec_spi.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_radamec_spi/Debug/" - ObjectFile=".\../pc_win32/server_src/test_radamec_spi/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_radamec_spi/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_radamec_spi/Debug/test_radamec_spi.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/server_src/test_radamec_spi/Debug/test_radamec_spi.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_radamec_spi/Debug/test_radamec_spi.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="test_radamec_spi.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/test_rumble.C b/src/vrpn/server_src/test_rumble.C deleted file mode 100644 index d01cdde34db39b3ea499a222122f92c8ea4dca00..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_rumble.C +++ /dev/null @@ -1,94 +0,0 @@ -/* test_rumble.C - - This is a VRPN client program that will connect to a vrpn_Analog_Output - device and alternately send 1 and then 0 to its zeroeth element. This - is to test the rumble function. -*/ - -#include <stdio.h> // for printf, NULL, fprintf, etc -#include <stdlib.h> // for exit -#ifndef _WIN32_WCE -#include <signal.h> // for signal, SIGINT -#endif -#include <vrpn_Analog_Output.h> // for vrpn_Analog_Output_Remote - -#include "vrpn_Shared.h" // for timeval, vrpn_SleepMsecs, etc -#include "vrpn_Types.h" // for vrpn_float64 - -int done = 0; // Signals that the program should exit - -// WARNING: On Windows systems, this handler is called in a separate -// thread from the main program (this differs from Unix). To avoid all -// sorts of chaos as the main program continues to handle packets, we -// set a done flag here and let the main program shut down in its own -// thread by calling shutdown() to do all of the stuff we used to do in -// this handler. - -void handle_cntl_c(int) { - done = 1; -} - -void Usage (const char * arg0) { - fprintf(stderr, -"Usage: %s device\n", - arg0); - - exit(0); -} - -int main (int argc, char * argv []) -{ - vrpn_Analog_Output_Remote *anaout = NULL; - - int i; - - // Parse arguments, creating objects as we go. Arguments that - // change the way a device is treated affect all devices that - // follow on the command line. - if (argc != 2) { Usage(argv[0]); } - for (i = 1; i < argc; i++) { - - // Name the device and open it as everything - anaout = new vrpn_Analog_Output_Remote(argv[i]); - - } - -#ifndef _WIN32_WCE - // signal handler so logfiles get closed right - signal(SIGINT, handle_cntl_c); -#endif - - // Turn the rumble on and set up to change. - struct timeval last_change; - vrpn_float64 state = 1.0; - vrpn_gettimeofday(&last_change, NULL); - anaout->request_change_channel_value(0, state); - -/* - * main interactive loop - */ - printf("Turing rumble on and off every two seconds\n"); - printf("Press ^C to exit.\n"); - while ( ! done ) { - - // See if it has been long enough for a change; if so, change state. - struct timeval now; - vrpn_gettimeofday(&now, NULL); - if (now.tv_sec - last_change.tv_sec > 2) { - state = 1 - state; - last_change = now; - anaout->request_change_channel_value(0, state); - } - - // Let the device do its thing. - anaout->mainloop(); - - // Sleep for 1ms so we don't eat the CPU - vrpn_SleepMsecs(1); - } - - delete anaout; - return 0; -} /* main */ - - diff --git a/src/vrpn/server_src/test_rumble.vcproj b/src/vrpn/server_src/test_rumble.vcproj deleted file mode 100644 index 275e509e5aced483b2ab1fe36cb487d91cc1646a..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_rumble.vcproj +++ /dev/null @@ -1,241 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="test_rumble" - ProjectGUID="{25163426-6EF1-461C-84BC-DA4FD6BDC88A}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/test_rumble/Release" - IntermediateDirectory=".\../pc_win32/server_src/test_rumble/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_rumble/Release/test_rumble.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,../quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_rumble/Release/test_rumble.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_rumble/Release/" - ObjectFile=".\../pc_win32/server_src/test_rumble/Release/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_rumble/Release/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_rumble/Release/test_rumble.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/server_src/test_rumble/Release/test_rumble.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_rumble/Release/test_rumble.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/test_rumble/Debug" - IntermediateDirectory=".\../pc_win32/server_src/test_rumble/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_rumble/Debug/test_rumble.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,../quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_rumble/Debug/test_rumble.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_rumble/Debug/" - ObjectFile=".\../pc_win32/server_src/test_rumble/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_rumble/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_rumble/Debug/test_rumble.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/server_src/test_rumble/Debug/test_rumble.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_rumble/Debug/test_rumble.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="test_rumble.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/test_vrpn.C b/src/vrpn/server_src/test_vrpn.C deleted file mode 100644 index c7376336d06f55611812e7a0b48adcdab2fe02c6..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_vrpn.C +++ /dev/null @@ -1,554 +0,0 @@ -// test_vrpn.C -// This is a VRPN test program that has both clients and servers -// running within the same thread. It is intended to test the sending -// and receiving of messages for the various types of devices that VRPN -// supports. It also tests the deletion and creation of "Remote" objects -// to make sure that it doesn't cause problems. -// The basic idea is to instantiate both "server" devices (the example -// drivers are used for this) and "Remote" devices using the same connection -// for each. Then, the local call handlers on the connection will send the -// information from the server to the client callbacks. -// Before performing the above tests, VRPN checks its thread library -// to make sure the calls work as expected. If that fails, the program -// returns an error message. Note that there is no multi-threading happening -// in the actual message or other test code, just a testing of the thread -// library itself. -// -// Tested device types so far include: -// vrpn_Analog_Server --> vrpn_Analog_Remote -// vrpn_Button_Example_Server --> vrpn_Button_Remote -// vrpn_Dial_Example_Server --> vrpn_Dial_Remote -// vrpn_Text_Sender --> vrpn_Text_Receiver -// vrpn_Tracker_NULL --> vrpn_Tracker_Remote - -#include <stdio.h> // for printf, NULL, fprintf, etc - -#include "vrpn_Analog.h" // for vrpn_Analog_Remote, etc -#include "vrpn_Analog_Output.h" -#include "vrpn_Button.h" // for vrpn_Button_Remote, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, etc -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_Dial.h" // for vrpn_Dial_Remote, etc -#include "vrpn_Poser.h" // for vrpn_POSERCB, etc -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday, etc -#include "vrpn_Text.h" // for vrpn_Text_Receiver, etc -#include "vrpn_Tracker.h" // for vrpn_Tracker_Remote, etc -#include "vrpn_Types.h" // for vrpn_float64 - -const char *DIAL_NAME = "Dial0@localhost"; -const char *TRACKER_NAME = "Tracker0@localhost"; -const char *TEXT_NAME = "Text0@localhost"; -const char *ANALOG_NAME = "Analog0@localhost"; -const char *ANALOG_OUTPUT_NAME = "AnalogOutput0@localhost"; -const char *BUTTON_NAME = "Button0@localhost"; -const char *POSER_NAME = "Poser0@localhost"; -int CONNECTION_PORT = vrpn_DEFAULT_LISTEN_PORT_NO; // Port for connection to listen on -int MAX_CONNECTION_PORT = vrpn_DEFAULT_LISTEN_PORT_NO + 10; - -// The connection that is used by all of the servers and remotes -vrpn_Connection *connection; - -// The tracker server and remote -vrpn_Tracker_NULL *stkr; -vrpn_Tracker_Remote *rtkr; - -// The dial server and remote -vrpn_Dial_Example_Server *sdial; -vrpn_Dial_Remote *rdial; - -// The button server and remote -vrpn_Button_Example_Server *sbtn; -vrpn_Button_Remote *rbtn; - -// The text sender and receiver -vrpn_Text_Sender *stext; -vrpn_Text_Receiver *rtext; - -// The analog server and remote -vrpn_Analog_Server *sana; -vrpn_Analog_Remote *rana; - -// The analog output server and remote -vrpn_Analog_Output_Callback_Server *sanaout; -vrpn_Analog_Output_Remote *ranaout; - -// the poser server and remote -vrpn_Poser_Server* sposer; -vrpn_Poser_Remote* rposer; - -// Counters incremented by callback handlers. -unsigned pcount = 0, vcount = 0, acount = 0; -unsigned dcount = 0; -unsigned tcount = 0; -unsigned ancount = 0; -unsigned aocount = 0; -unsigned bcount = 0; -unsigned pocount = 0, prcount = 0; - -unsigned p1count = 0, p2count = 0; -unsigned b1count = 0, b2count = 0; - - -/***************************************************************************** - * - Callback handlers - * - *****************************************************************************/ - -void VRPN_CALLBACK handle_pos (void *, const vrpn_TRACKERCB t) -{ - printf("Got tracker pos, sensor %d\n", t.sensor); - pcount++; -} - -void VRPN_CALLBACK handle_vel (void *, const vrpn_TRACKERVELCB t) -{ - printf(" + vel, sensor %d\n", t.sensor); - vcount++; -} - -void VRPN_CALLBACK handle_acc (void *, const vrpn_TRACKERACCCB t) -{ - printf(" + acc, sensor %d\n", t.sensor); - acount++; -} - -void VRPN_CALLBACK handle_dial (void *, const vrpn_DIALCB d) -{ - printf("Dial %d spun by %lf\n", d.dial, d.change); - dcount++; -} - -void VRPN_CALLBACK handle_text (void *, const vrpn_TEXTCB t) -{ - printf("Received text \"%s\"\n", t.message); - tcount++; -} - -void VRPN_CALLBACK handle_analog (void *, const vrpn_ANALOGCB a) -{ - printf("Received %d analog channels\n", a.num_channel); - ancount++; -} - -void VRPN_CALLBACK handle_analog_output (void *, const vrpn_ANALOGOUTPUTCB a) -{ - printf("Received %d analog output channels (first is %lf)\n", a.num_channel, a.channel[0]); - aocount++; -} - -void VRPN_CALLBACK handle_button (void *, const vrpn_BUTTONCB b) -{ - printf("Button %d is now in state %d\n", b.button, b.state); - bcount++; -} - - -void VRPN_CALLBACK handle_poser( void*, const vrpn_POSERCB p ) -{ - printf( "Poser position/orientation: (%lf, %lf, %lf) \n\t (%lf, %lf, %lf, %lf)\n", - p.pos[0], p.pos[1], p.pos[2], p.quat[0], p.quat[1], p.quat[2], p.quat[3] ); - pocount++; -} - - -void VRPN_CALLBACK handle_poser_relative( void*, const vrpn_POSERCB p ) -{ - printf( "Poser position/orientation relative: (%lf, %lf, %lf) \n\t (%lf, %lf, %lf, %lf)\n", - p.pos[0], p.pos[1], p.pos[2], p.quat[0], p.quat[1], p.quat[2], p.quat[3] ); - prcount++; -} - -void VRPN_CALLBACK handle_pos1 (void *, const vrpn_TRACKERCB t) -{ - printf("Got tracker1 pos, sensor %d\n", t.sensor); - p1count++; -} - -void VRPN_CALLBACK handle_pos2 (void *, const vrpn_TRACKERCB t) -{ - printf("Got tracker2 pos, sensor %d\n", t.sensor); - p2count++; -} - -void VRPN_CALLBACK handle_button1 (void *, const vrpn_BUTTONCB b) -{ - printf("Button1 %d is now in state %d\n", b.button, b.state); - b1count++; -} - -void VRPN_CALLBACK handle_button2 (void *, const vrpn_BUTTONCB b) -{ - printf("Button2 %d is now in state %d\n", b.button, b.state); - b2count++; -} - - -/***************************************************************************** - * - Routines to create remotes and link their callback handlers. - * - *****************************************************************************/ - -void create_and_link_tracker_remote(void) -{ - // Open the tracker remote using this connection - rtkr = new vrpn_Tracker_Remote (TRACKER_NAME, connection); - - // Set up the tracker callback handlers - rtkr->register_change_handler(NULL, handle_pos); - rtkr->register_change_handler(NULL, handle_vel); - rtkr->register_change_handler(NULL, handle_acc); -} - -void create_and_link_dial_remote(void) -{ - // Open the dial remote using this connection - rdial = new vrpn_Dial_Remote (DIAL_NAME, connection); - - // Set up the dial callback handlers - rdial->register_change_handler(NULL, handle_dial); -} - -void create_and_link_button_remote(void) -{ - // Open the button remote using this connection - rbtn = new vrpn_Button_Remote (BUTTON_NAME, connection); - - // Set up the button callback handlers - rbtn->register_change_handler(NULL, handle_button); -} - -void create_and_link_text_remote(void) -{ - // Open the text remote using this connection - rtext = new vrpn_Text_Receiver (TEXT_NAME, connection); - - // Set up the dial callback handlers - rtext->register_message_handler(NULL, handle_text); -} - -void create_and_link_analog_remote(void) -{ - // Open the analog remote using this connection - rana = new vrpn_Analog_Remote (ANALOG_NAME, connection); - - // Set up the analog callback handlers - rana->register_change_handler(NULL, handle_analog); -} - -void create_and_link_analog_output_server(void) -{ - // Open the analog output remote using this connection - sanaout = new vrpn_Analog_Output_Callback_Server (ANALOG_OUTPUT_NAME, connection, 12); - - // Set up the analog output callback handlers - sanaout->register_change_handler(NULL, handle_analog_output); -} - - -void create_and_link_poser_server( void ) -{ - sposer = new vrpn_Poser_Server( POSER_NAME, connection ); - sposer->register_change_handler( NULL, handle_poser ); - sposer->register_relative_change_handler( NULL, handle_poser_relative ); -} - - -/***************************************************************************** - * - Server routines for those devices that rely on application intervention - * - *****************************************************************************/ - -void send_text_once_in_a_while(void) -{ - static long secs = 0; - struct timeval now; - - vrpn_gettimeofday(&now, NULL); - if (secs == 0) { // First time through - secs = now.tv_sec; - } - if ( now.tv_sec - secs >= 1 ) { - secs = now.tv_sec; - stext->send_message("Text message"); - } -} - -void send_analog_once_in_a_while(void) -{ - static long secs = 0; - struct timeval now; - - vrpn_gettimeofday(&now, NULL); - if (secs == 0) { // First time through - secs = now.tv_sec; - } - if ( now.tv_sec - secs >= 1 ) { - secs = now.tv_sec; - sana->report(); - } -} - -void send_analog_output_once_in_a_while(void) -{ - static long secs = 0; - struct timeval now; - - vrpn_gettimeofday(&now, NULL); - if (secs == 0) { // First time through - secs = now.tv_sec; - } - if ( now.tv_sec - secs >= 1 ) { - static vrpn_float64 val = 1.0; - secs = now.tv_sec; - val++; - ranaout->request_change_channel_value(0, val); - } -} - - -void send_poser_once_in_a_while( void ) -{ - static long secs = 0; - struct timeval now; - static vrpn_float64 p[3] = { 0, 0, 0 }; - static vrpn_float64 dp[3] = {0, 0, 0 }; - static vrpn_float64 q[4] = { 1, 1, 1, 1 }; - static int count = 0; - static bool doRelative = true; - - vrpn_gettimeofday( &now, NULL ); - if( secs == 0 ) - { // First time through - secs = now.tv_sec; - } - if( now.tv_sec - secs >= 1 ) - { - if( !doRelative ) - { - // do a pose request - p[count%3] += 1; - if( p[count%3] > 1 ) p[count%3] = -1; - rposer->request_pose( now, p, q ); - count++; - doRelative = true; - } - else - { // do a relative pose request - dp[count%3] = 0.25; - dp[(count+1)%3] = 0; - dp[(count+2)%3] = 0; - rposer->request_pose_relative( now, dp, q ); - doRelative = false; - } - secs = now.tv_sec; - } -} - - -int main (int argc, char * argv []) -{ - if (argc != 1) { - fprintf(stderr, "Usage: %s\n", argv[0]); - return -1; - } - - //--------------------------------------------------------------------- - // test the thread library - if (!vrpn_test_threads_and_semaphores()) { - fprintf(stderr, "vrpn_test_threads_and_semaphores() failed!\n"); - fprintf(stderr, " (This is not often used within VRPN, so it should not be fatal\n"); - } else { - printf("Thread code passes tests (not using for the following though)\n"); - } - - //--------------------------------------------------------------------- - // explicitly open the connection - connection = vrpn_create_server_connection(CONNECTION_PORT); - - while (!connection->doing_okay() && CONNECTION_PORT < MAX_CONNECTION_PORT) { - CONNECTION_PORT++; - fprintf(stderr, "Could not open port - assuming parallel test. Increasing port number to %d and trying again\n", CONNECTION_PORT); - connection = vrpn_create_server_connection(CONNECTION_PORT); - } - - if (!connection->doing_okay()) { - fprintf(stderr, "Hit port number limit - assuming something in port opening is broken!\n"); - return -1; - } - - - //--------------------------------------------------------------------- - // Open the tracker server, using this connection, 2 sensors, update 1 times/sec - stkr = new vrpn_Tracker_NULL(TRACKER_NAME, connection, 2, 1.0); - printf("Tracker's name is %s.\n", TRACKER_NAME); - create_and_link_tracker_remote(); - - //--------------------------------------------------------------------- - // Open the dial server, using this connection, 2 dials, spin 0.5 rev/sec, - // update 1 times/sec - sdial = new vrpn_Dial_Example_Server(DIAL_NAME, connection, 2, 0.5, 1.0); - printf("Dial's name is %s.\n", DIAL_NAME); - create_and_link_dial_remote(); - - //--------------------------------------------------------------------- - // Open the button server, using this connection, defaults - sbtn = new vrpn_Button_Example_Server(BUTTON_NAME, connection); - printf("Button's name is %s.\n", BUTTON_NAME); - create_and_link_button_remote(); - - //--------------------------------------------------------------------- - // Open the text sender and receiver. - stext = new vrpn_Text_Sender(TEXT_NAME, connection); - printf("Text's name is %s.\n", TEXT_NAME); - create_and_link_text_remote(); - - //--------------------------------------------------------------------- - // Open the analog server, using this connection. - sana = new vrpn_Analog_Server(ANALOG_NAME, connection); - sana->setNumChannels(8); - printf("Analog's name is %s.\n", ANALOG_NAME); - create_and_link_analog_remote(); - - //--------------------------------------------------------------------- - // Open the analog output remote , using this connection. - ranaout = new vrpn_Analog_Output_Remote(ANALOG_OUTPUT_NAME, connection); - printf("Analog's name is %s.\n", ANALOG_OUTPUT_NAME); - create_and_link_analog_output_server(); - - //--------------------------------------------------------------------- - // open the poser remote - rposer = new vrpn_Poser_Remote( POSER_NAME, connection ); - printf( "Poser's name is %s.\n", POSER_NAME ); - create_and_link_poser_server(); - - /* - * main interactive loop - */ - int repeat_tests = 4; - while ( repeat_tests > 0 ) { - static long secs = 0; - struct timeval now; - - // Let the servers, clients and connection do their things - send_analog_output_once_in_a_while(); - ranaout->mainloop(); // The remote is on the server for AnalogOutput - sanaout->mainloop(); // The server is on the client for AnalogOutput - send_analog_once_in_a_while(); - sana->mainloop(); - rana->mainloop(); - send_text_once_in_a_while(); - rtext->mainloop(); - sdial->mainloop(); - rdial->mainloop(); - sbtn->mainloop(); - rbtn->mainloop(); - stkr->mainloop(); - rtkr->mainloop(); - send_poser_once_in_a_while(); - rposer->mainloop(); - sposer->mainloop(); - connection->mainloop(); - - // Every 2 seconds, delete the old remotes and create new ones - vrpn_gettimeofday(&now, NULL); - if (secs == 0) { // First time through - secs = now.tv_sec; - } - if ( now.tv_sec - secs >= 2 ) { - secs = now.tv_sec; - printf("\nDeleting and restarting _Remote objects\n"); - delete rtkr; - delete rdial; - delete rbtn; - delete rtext; - delete rana; - delete sanaout; - delete sposer; - create_and_link_tracker_remote(); - create_and_link_dial_remote(); - create_and_link_button_remote(); - create_and_link_text_remote(); - create_and_link_analog_remote(); - create_and_link_analog_output_server(); - create_and_link_poser_server(); - --repeat_tests; - } - - // Sleep for 1ms each iteration so we don't eat the CPU - vrpn_SleepMsecs(1); - } - if ( (pcount == 0) || (vcount == 0) || (acount == 0) || - (dcount == 0) || (tcount == 0) || (ancount == 0) || - (aocount == 0) || - (bcount == 0) || (pocount == 0) || (prcount == 0) ) { - fprintf(stderr,"Did not get callbacks from one or more device\n"); - return -1; - } - - printf("\nDeleting _Remote objects\n"); - delete rtkr; - delete rdial; - delete rbtn; - delete rtext; - delete rana; - delete ranaout; - delete rposer; - - printf("Testing whether two connections to a tracker and to a button each get their own messages.\n"); - vrpn_Tracker_Remote *t1 = new vrpn_Tracker_Remote(TRACKER_NAME); - t1->register_change_handler(NULL, handle_pos1); - vrpn_Tracker_Remote *t2 = new vrpn_Tracker_Remote(TRACKER_NAME); - t2->register_change_handler(NULL, handle_pos2); - vrpn_Button_Remote *b1 = new vrpn_Button_Remote(BUTTON_NAME); - b1->register_change_handler(NULL, handle_button1); - vrpn_Button_Remote *b2 = new vrpn_Button_Remote(BUTTON_NAME); - b2->register_change_handler(NULL, handle_button2); - unsigned long secs; - struct timeval start, now; - vrpn_gettimeofday(&start, NULL); - do { - stkr->mainloop(); - sbtn->mainloop(); - t1->mainloop(); - t2->mainloop(); - b1->mainloop(); - b2->mainloop(); - connection->mainloop(); - - vrpn_gettimeofday(&now, NULL); - secs = now.tv_sec - start.tv_sec; - } while (secs <= 2); - if ( (p1count == 0) || (p2count == 0) ) { - fprintf(stderr,"Did not get callbacks from trackers\n"); - return -1; - } - if ( (b1count == 0) || (b2count == 0) ) { - fprintf(stderr,"Did not get callbacks from buttons\n"); - return -1; - } - - printf("Deleting extra remote objects\n"); - delete t1; - delete t2; - delete b1; - delete b2; - - printf("Deleting servers and connection\n"); - delete stkr; - delete sbtn; - delete sdial; - delete stext; - delete sana; - delete sanaout; - delete sposer; - connection->removeReference(); - - printf("Success!\n"); - return 0; - -} /* main */ - - diff --git a/src/vrpn/server_src/test_vrpn.dsp b/src/vrpn/server_src/test_vrpn.dsp deleted file mode 100644 index b7687942fd2ebd46f2410ad295e7837122f63016..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_vrpn.dsp +++ /dev/null @@ -1,90 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_vrpn" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_vrpn - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_vrpn.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_vrpn.mak" CFG="test_vrpn - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_vrpn - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_vrpn - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_vrpn - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/test_vrpn/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/test_vrpn/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\..\quat" /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "test_vrpn - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/test_vrpn/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/test_vrpn/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /I "..\..\quat" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "test_vrpn - Win32 Release" -# Name "test_vrpn - Win32 Debug" -# Begin Source File - -SOURCE=test_vrpn.C -# End Source File -# End Target -# End Project diff --git a/src/vrpn/server_src/test_vrpn.vcproj b/src/vrpn/server_src/test_vrpn.vcproj deleted file mode 100644 index 8ff7a844edf1a4832e2631429d45fe33c7e2adb5..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/test_vrpn.vcproj +++ /dev/null @@ -1,229 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="test_vrpn" - ProjectGUID="{5AFB984D-A654-4957-A2C8-387083A6FFDC}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/test_vrpn/Release" - IntermediateDirectory=".\../pc_win32/server_src/test_vrpn/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_vrpn/Release/test_vrpn.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,..\..\quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_vrpn/Release/test_vrpn.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_vrpn/Release/" - ObjectFile=".\../pc_win32/server_src/test_vrpn/Release/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_vrpn/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_vrpn/Release/test_vrpn.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/server_src/test_vrpn/Release/test_vrpn.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_vrpn/Release/test_vrpn.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/test_vrpn/Debug" - IntermediateDirectory=".\../pc_win32/server_src/test_vrpn/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/test_vrpn/Debug/test_vrpn.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,..,..\..\quat" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/test_vrpn/Debug/test_vrpn.pch" - AssemblerListingLocation=".\../pc_win32/server_src/test_vrpn/Debug/" - ObjectFile=".\../pc_win32/server_src/test_vrpn/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/test_vrpn/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/test_vrpn/Debug/test_vrpn.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/server_src/test_vrpn/Debug/test_vrpn.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/test_vrpn/Debug/test_vrpn.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <File - RelativePath="test_vrpn.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/testimager_server.cpp b/src/vrpn/server_src/testimager_server.cpp deleted file mode 100644 index 4b70f449767575fb045f5284d2d8047621beaf39..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/testimager_server.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// VRPN Imager Server example program. - -#include <stdio.h> // for fprintf, NULL, stderr - -#include "vrpn_Connection.h" -#include "vrpn_Imager.h" // for vrpn_Imager_Server, etc -#include "vrpn_Shared.h" // for vrpn_SleepMsecs -#include "vrpn_Types.h" // for vrpn_uint8 - -static vrpn_Connection *g_connection = NULL; -static vrpn_Imager_Server *g_is = NULL; -const unsigned g_size = 256; - -// Fill a buffer of 8-bit integers with an image that has a diagonal -// line of growing brightness. The size of the image is passed in, as -// well as an offset for the brightnesses to make the image change -// a bit over time. - -static void fill_buffer(vrpn_uint8 *buffer, - const unsigned numX, const unsigned numY, - const unsigned offset) -{ - unsigned x,y; - for (x = 0; x < numX; x++) { - for (y = 0; y < numY; y++) { - buffer[x + y*numX] = (x + y + offset) % 256; - } - } -} - -#ifndef min -#define min(a,b) ( (a) < (b) ? (a) : (b) ) -#endif -int main (int argc, char * argv[]) -{ - static int frame_number = 0; - static vrpn_uint8 buffer[g_size*g_size]; - int channel_id; - - // Need to have a global pointer to it so we can shut it down - // in the signal handler (so we can close any open logfiles.) - //vrpn_Synchronized_Connection connection; - if ( (g_connection = vrpn_create_server_connection()) == NULL) { - fprintf(stderr, "Could not open connection\n"); - return -1; - } - - // Open the imager server and set up channel zero to send our data. - if ( (g_is = new vrpn_Imager_Server("TestImage", g_connection, g_size, g_size)) == NULL) { - fprintf(stderr, "Could not open imager server\n"); - return -1; - } - if ( (channel_id = g_is->add_channel("Slope")) == -1) { - fprintf(stderr, "Could not add channel\n"); - return -1; - } - - // Generate about ten frames per second by sending one and then sleeping. - // Better would be to mainloop() the connection much faster, and then - // only send when it is time. This will do, but the connections might - // not open as fast as they would otherwise. - - // It would be nice to let the user stop the server cleanly, but ^C - // will do the trick. - - while (1) { - fill_buffer(buffer, g_size, g_size, frame_number++ % 256); - g_is->send_begin_frame(0, g_size-1, 0, g_size-1); - g_is->mainloop(); - int nRowsPerRegion=vrpn_IMAGER_MAX_REGIONu8/g_size; - unsigned y; - for(y=0; y<g_size; y+=nRowsPerRegion) { - g_is->send_region_using_base_pointer(channel_id,0,g_size-1,y,min(g_size,y+nRowsPerRegion)-1, - buffer, 1, g_size, g_size); - g_is->mainloop(); - } - g_is->send_end_frame(0, g_size-1, 0, g_size-1); - - g_is->mainloop(); - g_connection->mainloop(); - vrpn_SleepMsecs(100); - } - - return 0; -} diff --git a/src/vrpn/server_src/testimager_server.dsp b/src/vrpn/server_src/testimager_server.dsp deleted file mode 100644 index 9178d5e09b8e7611d6429bed4cba0e5df2981fc5..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/testimager_server.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testimager_server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=testimager_server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testimager_server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testimager_server.mak" CFG="testimager_server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testimager_server - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "testimager_server - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testimager_server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "testimager_server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "testimager_server - Win32 Release" -# Name "testimager_server - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\testimager_server.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/server_src/testimager_server.vcproj b/src/vrpn/server_src/testimager_server.vcproj deleted file mode 100644 index eb440cb537f5e8ec1bfb2473d165b85770ddd5b5..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/testimager_server.vcproj +++ /dev/null @@ -1,242 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="testimager_server" - ProjectGUID="{922B4D4C-396E-46A7-91BB-FE9BBB80FE78}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/Release" - IntermediateDirectory=".\../pc_win32/server_src/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/Release/testimager_server.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,../" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/server_src/Release/testimager_server.pch" - AssemblerListingLocation=".\../pc_win32/server_src/Release/" - ObjectFile=".\../pc_win32/server_src/Release/" - ProgramDataBaseFileName=".\../pc_win32/server_src/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/Release/testimager_server.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\../pc_win32/server_src/Release/testimager_server.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/Release/testimager_server.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/Debug" - IntermediateDirectory=".\../pc_win32/server_src/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/Debug/testimager_server.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,../" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/Debug/testimager_server.pch" - AssemblerListingLocation=".\../pc_win32/server_src/Debug/" - ObjectFile=".\../pc_win32/server_src/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/Debug/" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/Debug/testimager_server.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/server_src/Debug/testimager_server.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/Debug/testimager_server.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="testimager_server.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - <Filter - Name="Resource Files" - Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/textServer.C b/src/vrpn/server_src/textServer.C deleted file mode 100644 index b540a740110b85ae498881a035813b5b1b241e4b..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/textServer.C +++ /dev/null @@ -1,38 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#ifndef _WIN32 -#include <unistd.h> -#include <sys/time.h> -#endif -#include <vrpn_Connection.h> -#include "vrpn_Text.h" - -#define MAX 1024 - -int main (int argc, char* argv[]) -{ - if (argc != 2) { - fprintf(stderr, "Must pass a device name as the sole argument\n"); - return 1; - } - char msg[MAX]; - vrpn_Connection *sc = vrpn_create_server_connection(); - vrpn_Text_Sender *s = new vrpn_Text_Sender(argv[1], sc); - - while (1) { - while (!sc->connected()) { // wait until we've got a connection - sc->mainloop(); - } - while (sc->connected()) { - printf("Please enter the message:\n"); - if (scanf("%s", msg) != 1) { - fprintf(stderr, "No message entered\n"); - return(-1); - } - s->send_message(msg, vrpn_TEXT_NORMAL); - s->mainloop(); - sc->mainloop(); - } - } -} diff --git a/src/vrpn/server_src/texture_plane.C b/src/vrpn/server_src/texture_plane.C deleted file mode 100644 index 7cf6c1ba0265a7fdec7ffdd20986f00a3601276b..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/texture_plane.C +++ /dev/null @@ -1,896 +0,0 @@ -#include "vrpn_Configure.h" -#ifdef VRPN_USE_PHANTOM_SERVER -#include "texture_plane.h" - -// So we don't have #defines throughout the code that we forget to fix. -#if defined(sgi) || defined (__CYGWIN__) || defined(linux) -#define init_mutex(x) pthread_mutex_init(x,NULL); -#define get_mutex(x) pthread_mutex_lock(x) -#define release_mutex(x) pthread_mutex_unlock(x); -#else -#define init_mutex(x) InitializeCriticalSection(x); -#define get_mutex(x) EnterCriticalSection(x); -#define release_mutex(x) LeaveCriticalSection(x); -#endif - -// macros for printing something out x times out of a thousand (i.e. x times per second) -#define DEBUG_BEGIN(x) {static int pcnt = 0; if ((pcnt % 1000 >= 0)&&(pcnt%1000 < x)){ -#define DEBUG_END }pcnt++;} -//#define VERBOSE - -#define MAX_FORCE (10.0) - -// Initialize class. -#ifndef VRPN_USE_HDAPI -gstType DynamicPlane::DynamicPlaneClassTypeId; -int DynamicPlaneTest = DynamicPlane::initClass(); -int DynamicPlane::initClass() { - DynamicPlaneClassTypeId = -1000; - return 0; -} -#endif - - -#ifdef VRPN_USE_HDAPI -DynamicPlane::DynamicPlane() -#else -DynamicPlane::DynamicPlane() : gstDynamic() -#endif -{ - // initialize transform to identity - fixedPlane = new TexturePlane(0.0, 1.0, 0.0, 0.0); -#ifdef VRPN_USE_HDAPI - //XXX Probably going to need some linking code in here somewhere to keep track of objects -#else - xform.identity(); - fixedPlane->setParent(this); -#endif - buzzForce = new BuzzForceField(); - buzzForce->setPlane(vrpn_HapticPlane(0.0, 1.0, 0.0, 0.0)); - buzzForce->setSpring(fixedPlane->getSurfaceKspring()); - buzzForce->restrictToSurface(TRUE); - buzzForce->adjustToTexturePlane(fixedPlane); - - plane = vrpn_HapticPlane(0.0, 1.0, 0.0, 0.0); - lastPlane = vrpn_HapticPlane(plane); -#ifdef VRPN_USE_HDAPI - //XXX Probably going to need some linking code in here somewhere to keep track of objects -#else - addChild(fixedPlane); - addChild(buzzForce); -#endif - _using_buzz = FALSE; - _active = FALSE; - _is_new_plane = FALSE; - buzzForce->deactivate(); - fixedPlane->enableTexture(); - fixedPlane->setTextureSize(10.0); - fixedPlane->setTextureAspectRatio(0.0); - fixedPlane->setInEffect(FALSE); - init_mutex(&xform_mutex); -} - -void DynamicPlane::setParameters(double fd, double fs, double ks, - double bpa, double bpl, - double buzzamp, double buzzfreq) -{ - fixedPlane->setParameters(fd, fs, ks, bpa, bpl); - buzzForce->setParameters(buzzamp, buzzfreq, ks); -} - - -void DynamicPlane::setActive(vrpn_HapticBoolean active) -{ - _active = (active == TRUE); - fixedPlane->setInEffect(active); - if (_active && _using_buzz) { - buzzForce->activate(); - } else { - buzzForce->deactivate(); - } -} - -void DynamicPlane::cleanUpAfterError() { - _is_new_plane = FALSE; - setActive(FALSE); -} - -void DynamicPlane::enableBuzzing(vrpn_HapticBoolean enable) -{ - _using_buzz = (enable == TRUE); - if (_active && _using_buzz) buzzForce->activate(); - else buzzForce->deactivate(); -} -void DynamicPlane::enableTexture(vrpn_HapticBoolean enable) -{ - if (enable) fixedPlane->enableTexture(); - else fixedPlane->disableTexture(); -} - -void DynamicPlane::setSurfaceKspring(double ks) -{ - buzzForce->setSpring(ks); - fixedPlane->setSurfaceKspring(ks); -} - -void DynamicPlane::setBuzzAmplitude(double amp) -{ - buzzForce->setAmplitude(amp); -} - -void DynamicPlane::setBuzzFrequency(double freq) { - buzzForce->setFrequency(freq);} - -// notes for stuff in updateDynamics() and update(): - // tell surface to add a translation which - // is a function of the next phantom position - // read in collisionDetect since this position - // is the pivot (point for which old plane - // was in effect before and new plane is in - // effect after). Plane is translated in its - // plane so that the pivot point projects to - // the same place on the old and new planes. - - // alternative description: - // order of events: - // 0) collisionDetect: - // force from old plane specified and SCP_old computed - // 1) plane message received, xform computed without translation - // 2) phantom moves to position X from forces of old plane - // 3) collisionDetect: - // force from new plane specified with condition - // SCP_old = SCP_new in plane coordinate system - // requiring a shift of the new plane - // (only at this stage is X known to plane so it couldn't have - // added this translation into xform previously) - // - // projection of position X is treated as the pivot point - // so we translate the new plane so that the projection lies at - // the same point in the plane as the projection did in the old - // plane - // - // this way, if you were on a peak of a texture bump before the plane - // changed, then you will still be on the peak but with a different - // surface normal; the discontinuity is the same as that produced - // by a non-textured surface and this is what we would expect for - // a textured surface that was bent around a sharp edge - // if we didn't do this, then you would get all kinds of strange - // things happening at edges because all of a sudden you would be - // at a different place on the texture - // - // - -void DynamicPlane::updateDynamics() { - get_mutex(&xform_mutex); - if (_is_new_plane) { - planeEquationToTransform(lastPlane, plane, xform); - // if we don't compute plane from xform then any - // roundoff error in xform will be allowed to accumulate without - // correction; by computing the actual plane represented by xform - // it should cause updates to tend to reduce roundoff error to - // zero if plane stays constant for a while or at least a small - // bounded amount if plane is always changing - this has been verified - // in a test program - setPlaneFromTransform(plane, xform); - release_mutex(&xform_mutex); -#ifdef VRPN_USE_HDAPI - //XXX Probably going to need some transform code in here somewhere to keep track of motion - //XXXX This xform definitely changes when new planes are sent! -#else - setTransformMatrixDynamic(xform); -#endif - _is_new_plane = FALSE; - } else { - release_mutex(&xform_mutex); - } - -#ifdef VRPN_USE_HDAPI - //XXX Probably going to need some code in here somewhere to emulate GHOST behavior -#else - gstDynamic::updateDynamics(); -#endif -} - -void DynamicPlane::update(double a,double b,double c,double d) -{ - //static int err_cnt = 0; - - // no need to do anything unless this plane is different from - // the previous one - get_mutex(&xform_mutex); - if (plane.a() != a || plane.b() != b || - plane.c() != c || plane.d() != d){ - if (_is_new_plane) { - // err_cnt++; - // if (err_cnt > 3) - // printf("waited %d msec\n", err_cnt); - release_mutex(&xform_mutex); - return; - } -// else err_cnt = 0; - lastPlane = vrpn_HapticPlane(plane); - fixedPlane->signalNewTransform(); - plane = vrpn_HapticPlane(a,b,c,d); - _is_new_plane = TRUE; - release_mutex(&xform_mutex); -#ifndef VRPN_USE_HDAPI - // XXX At some point, we may implement HDAPI dynamics objects. - addToDynamicList(); -#endif - } - else - get_mutex(&xform_mutex); -} - - -// planeEquationToTransform: -// Given a plane that passes through the origin (0,0,0), and a transformation -// xform that transforms that plane to prev_plane, this function modifies -// xform so that it transforms the plane to next_plane. The incremental -// transformation composed with xform to achieve this consists of a rotation -// about the axis that is the intersection of prev_plane with next_plane. - -void DynamicPlane::planeEquationToTransform(vrpn_HapticPlane &prev_plane, - vrpn_HapticPlane &next_plane, vrpn_HapticMatrix &xform_to_update) -{ - // plane is [a,b,c,d] where ax + by +cz + d = 0 - - vrpn_HapticVector next_normal = next_plane.normal(); - vrpn_HapticVector prev_normal = prev_plane.normal(); -#ifdef VRPN_USE_HDAPI - double m = next_normal.magnitude(); -#else - double m = next_normal.distToOrigin(); -#endif - - double distAlongNormal = -next_plane.d(); - - vrpn_HapticVector axis = vrpn_HapticVector(0,0,0); - double theta = 0; - vrpn_HapticVector trans; - - trans = distAlongNormal*next_normal; // translation vector for xform - - // compute the rotation axis and angle -#ifdef VRPN_USE_HDAPI - vrpn_HapticVector crossprod = prev_normal.crossProduct(next_normal); - double sintheta = crossprod.magnitude(); - double costheta = prev_normal.dotProduct(next_normal); -#else - vrpn_HapticVector crossprod = prev_normal.cross(next_normal); - double sintheta = crossprod.distToOrigin(); - double costheta = prev_normal.dot(next_normal); -#endif - if (sintheta == 0) { // exceptional case - // pick an arbitrary vector perp to normal because we are either - // rotating by 0 or 180 degrees - if (next_normal[0] != 0) { - axis = vrpn_HapticVector(next_normal[1], -next_normal[0], 0); -#ifdef VRPN_USE_HDAPI - axis /= (axis.magnitude()); -#else - axis /= (axis.distToOrigin()); -#endif - } else { - axis = vrpn_HapticVector(1,0,0); - } - } else { // normal case - axis = crossprod/sintheta; - } - theta = asin(sintheta); - if (costheta < 0) theta = M_PI - theta; - - // set the incremental rotation -#ifdef VRPN_USE_HDAPI - vrpn_HapticMatrix rot_incrxform; - rot_incrxform.createRotation(axis, theta); -#else - vrpn_HapticMatrix rot_incrxform; - rot_incrxform.setRotate(axis,theta); -#endif - - // Set the rotation portion of the matrix based on the accumulation - // of its previous value and the new rotation. - double prod[3][3]; - int i,j; - for (i = 0; i < 3; i++) { - for (j = 0; j < 3; j++) { - prod[i][j] = xform_to_update[i][0]*rot_incrxform[0][j] + - xform_to_update[i][1]*rot_incrxform[1][j] + - xform_to_update[i][2]*rot_incrxform[2][j]; - } - } - for (i = 0; i < 3; i++) { - for (j = 0; j < 3; j++) { - xform_to_update[i][j] = prod[i][j]; - } - } - - // Set the translation for the new matrix. XXX For HDAPI, I'm not sure - // we are putting the translation into the proper portion of the - // matrix. -#ifdef VRPN_USE_HDAPI - for (i = 0; i < 3; i++) { - xform_to_update[3][i] = trans[i]; - } -#else - xform_to_update.setTranslate(trans); -#endif - - return; -} - -// XXX This is almost certainly broken in the HDAPI implementation. -// Don't trust it until you've verified that it works. If you're lucky, -// the fix will require only swapping the matrix multiplication types. -void DynamicPlane::setPlaneFromTransform(vrpn_HapticPlane &pl, - vrpn_HapticMatrix &xfm) -{ -#ifdef VRPN_USE_HDAPI - vrpn_HapticVector normal(0,1,0); - //normal = - xfm.multVecMatrix(normal, normal); - vrpn_HapticPosition origin(0,0,0); - //origin = - xfm.multMatrixVec(origin, origin); - pl = vrpn_HapticPlane(normal[0], normal[1], normal[2], -origin.magnitude()); -#else - vrpn_HapticVector normal(0,1,0); - normal = xfm.fromLocal(normal); - vrpn_HapticPosition origin(0,0,0); - origin = xfm.fromLocal(origin); - pl = vrpn_HapticPlane(normal[0], normal[1], normal[2], -origin.distToOrigin()); -#endif - //printf("XXX %lf, %lf, %lf, %lf\n", pl.a(), pl.b(), pl.c(), pl.d()); -} - -#ifndef VRPN_USE_HDAPI -gstType TexturePlane::PlaneClassTypeId; -static int temp = TexturePlane::initClass(); -#endif - -void TexturePlane::init() { - isNewPlane = FALSE; - inEffect= FALSE; - isInRecovery = FALSE; - recoveryPlaneCount = 0; - originalPlane = plane; - lastDepth = 0; - dIncrement = 0; - numRecoveryCycles = 1; - // boundingRadius = 1000.0; -#ifndef VRPN_USE_HDAPI - invalidateCumTransf(); - dynamicParent = NULL; -#endif - textureOrigin = vrpn_HapticPosition(0,0,0); - - usingTexture = 0; - texWL = 10.0; - texWN = 1/texWL; - texAmp = 0; - textureAspect = texAmp*2.0/texWL; - - fadeActive = FALSE; - fadeOldKspring = 0; - dSpring_dt = 0; - dataCB = NULL; - userdata = NULL; - data_time = 0; - safety_ineffect = TRUE; - newCoordinates = FALSE; - inContact = FALSE; - init_mutex(&tex_param_mutex); -} - -//constructors -TexturePlane::TexturePlane(const vrpn_HapticPlane & p) -{ - init(); - plane= vrpn_HapticPlane(p); -} - -TexturePlane::TexturePlane(const vrpn_HapticPlane * p) -{ - init(); - plane = vrpn_HapticPlane(*p); -} - -TexturePlane::TexturePlane(const TexturePlane *p) -{ - init(); - plane = vrpn_HapticPlane(p->plane); -} - -TexturePlane::TexturePlane(const TexturePlane &p) -{ - init(); - plane = vrpn_HapticPlane(p.plane); -} - - -TexturePlane::TexturePlane(double a,double b, double c, double d) -{ - init(); - vrpn_HapticVector vec = vrpn_HapticVector(a,b,c); - plane = vrpn_HapticPlane(vec,d); -} - -void TexturePlane::setPlane(vrpn_HapticVector newNormal, vrpn_HapticPosition point) -{ - plane.setPlane(newNormal,point); - isNewPlane = TRUE; -} - - -void TexturePlane::setParameters(double fd, double fs, double ks, - double bpa, double bpl){ - setSurfaceFdynamic(fd); - setSurfaceFstatic(fs); - setSurfaceKspring(ks); - setTextureAmplitude(bpa); - setTextureWavelength(bpl); -} - -void TexturePlane::update(double a, double b, double c, double d) -{ - plane = vrpn_HapticPlane(a,b,c,d); - isNewPlane = TRUE; -} - -void TexturePlane::setTextureWavelength(double wavelength){ - if (wavelength < MIN_TEXTURE_WAVELENGTH) return; - get_mutex(&tex_param_mutex); - new_texWN = 1.0/wavelength; - texWN_needs_update = TRUE; - release_mutex(&tex_param_mutex); -} - -void TexturePlane::setTextureWaveNumber(double wavenum){ - if (wavenum == 0 || 1/wavenum < MIN_TEXTURE_WAVELENGTH) return; - get_mutex(&tex_param_mutex); - new_texWN = wavenum; - texWN_needs_update = TRUE; - release_mutex(&tex_param_mutex); -} - -void TexturePlane::setTextureAmplitude(double amplitude){ - get_mutex(&tex_param_mutex); - new_texAmp = amplitude; - texAmp_needs_update = TRUE; - release_mutex(&tex_param_mutex); -} - -void TexturePlane::setTextureSize(double size){ - if (size < MIN_TEXTURE_WAVELENGTH) return; - get_mutex(&tex_param_mutex); - new_Size = size; - texSize_needs_update = TRUE; - release_mutex(&tex_param_mutex); -} - -void TexturePlane::setTextureAspectRatio(double aspectRatio){ - get_mutex(&tex_param_mutex); - new_textureAspect = aspectRatio; - texAspect_needs_update = TRUE; - release_mutex(&tex_param_mutex); -} - -void TexturePlane::updateTextureWavelength(){ - get_mutex(&tex_param_mutex); - if (texWN_needs_update){ - texWN_needs_update = FALSE; - texWN = new_texWN; - texWL = 1.0/texWN; - textureAspect = 2.0*texAmp/texWL; - } - release_mutex(&tex_param_mutex); -} - -void TexturePlane::updateTextureAmplitude(){ - get_mutex(&tex_param_mutex); - if (texAmp_needs_update){ - texAmp_needs_update = FALSE; - texAmp = new_texAmp; - textureAspect = 2.0*texAmp/texWL; - } - release_mutex(&tex_param_mutex); -} - -void TexturePlane::updateTextureSize() { - get_mutex(&tex_param_mutex); - if (texSize_needs_update){ - texSize_needs_update = FALSE; - texWL = new_Size; - texWN = 1.0/texWL; - texAmp = textureAspect*texWL/2.0; - } - release_mutex(&tex_param_mutex); -} - -void TexturePlane::updateTextureAspectRatio() { - get_mutex(&tex_param_mutex); - if (texAspect_needs_update){ - texAspect_needs_update = FALSE; - textureAspect = new_textureAspect; - texAmp = textureAspect*texWL/2.0; - } - release_mutex(&tex_param_mutex); -} - -vrpn_HapticBoolean TexturePlane::intersection(const vrpn_HapticPosition &startPt_WC, - const vrpn_HapticPosition &endPt_WC, - vrpn_HapticPosition &intersectionPt_WC, - vrpn_HapticVector &intersectionPtNormal_WC, - void **) -{ - // XXX - this function doesn't do the right thing if there - // are any other shapes in the scene - return FALSE; -} - - -#ifndef VRPN_USE_HDAPI -vrpn_HapticBoolean TexturePlane::collisionDetect(gstPHANToM *PHANToM) -{ - vrpn_HapticPosition phantomPos, lastPhantPos, intersectionPoint; - - double depth = 0; - vrpn_HapticPosition SCP; - vrpn_HapticVector SCPnormal; - double deltaT; - static double deltaDist; - vrpn_HapticPosition diff; - deltaT = PHANToM->getDeltaT(); - - if (fadeActive) - incrementFade(deltaT); - - vrpn_HapticVector phantomForce = PHANToM->getReactionForce_WC(); - PHANToM->getLastPosition_WC(lastPhantPos); - PHANToM->getPosition_WC(phantomPos); - diff = lastPhantPos - phantomPos; - deltaDist = diff.distToOrigin(); - - if (dataCB){ - dataCB(data_time, lastPhantPos, phantomForce, userdata); - data_time += deltaT; - } - - //if the plane node is not in effect - if(inEffect == FALSE){ - safety_ineffect = TRUE; - return FALSE; - } - - inContact = getStateForPHANToM(PHANToM); - -#ifdef VRPN_USE_GHOST_31 - if(!_touchableByPHANToM || _resetPHANToMContacts) { -#else // Ghost 4.0 (and the default case) - if(!isTouchableByPHANToM() || _resetPHANToMContacts) { -#endif - _resetPHANToMContacts = FALSE; - - inContact = FALSE; - (void) updateStateForPHANToM(PHANToM,inContact); - //printf("in if incontact is false\n"); - - return inContact; - } - - phantomPos = fromWorld(phantomPos); - - //project the current phantomPosition onto the plane to get the SCP - - // if we don't have the constant plane assumed by texture computing - // functions - if (!usingTexture || !usingAssumedTextureBasePlane(plane) || - !dynamicParent){ - depth = -(phantomPos[0]*plane.a() + phantomPos[1]*plane.b() + - phantomPos[2]*plane.c() + plane.d()); - SCP = plane.projectPoint(phantomPos); - //set the SCPnormal to be the normal of the plane - SCPnormal = plane.normal(); - texAmp = 0; // extra precaution in case plane happens to - // become (0,1,0,0) we don't want to suddenly add - // texture - } else { - - // adjust things so plane update for parent node preserves - // projection of phantom position in our coordinate system - // - if (dynamicParent){ - if (newCoordinates){ - t_elapsed = 0; - newCoordinates = FALSE; - } else { - t_elapsed += deltaT; - } - vrpn_HapticPosition posInPreviousCoordinates; - PHANToM->getPosition_WC(posInPreviousCoordinates); - posInPreviousCoordinates = dynamicParent->fromWorldLast(posInPreviousCoordinates); - posInPreviousCoordinates = fromParent(posInPreviousCoordinates); - - if (posInPreviousCoordinates != phantomPos){ - -// if (t_elapsed > 0.0){ -// printf("big t_elapsed: %f\n", t_elapsed); -// } - vrpn_HapticPosition currProj = plane.projectPoint(phantomPos); - vrpn_HapticPosition prevProj = - plane.projectPoint(posInPreviousCoordinates); - // this is the projection of the - // current position onto the - // previous plane (as defined by - // the parent transformation) - if (!dynamicParent->dynamicMoveThisServoLoop()) - printf("error: dynamicParent move not detected\n"); - - textureOrigin[0] = textureOrigin[0] - prevProj[0] + currProj[0]; - textureOrigin[1] = 0; - textureOrigin[2] = textureOrigin[2] - prevProj[2] + currProj[2]; - } - } - - // move textureOrigin from its current location towards current - // position in steps of length texWL until it is within texWL of - // the current position - updateTextureOrigin(phantomPos[0], phantomPos[2]); - - // translate to texture coordinates - note: this is a translation in the plane of - // the phantom position - vrpn_HapticPosition texturePos = phantomPos - textureOrigin; - - SCP = computeSCPfromGradient(texturePos); - vrpn_HapticPlane texPlane; - texPlane = computeTangentPlaneAt(texturePos); - depth = -(texturePos.x()*texPlane.a() + texturePos.y()*texPlane.b() + - texturePos.z()*texPlane.c() + texPlane.d()); - - // go back to untranslated (non-texture) plane coordinates - SCP = SCP + textureOrigin; - SCPnormal = texPlane.normal(); - - // if (|texturePos| is close to 0.25*texWL or 0.75*texWL then we - // are near a zero crossing so its relatively safe to - // update texture shape - double old_wl = texWL; - double radius = sqrt(texturePos[0]*texturePos[0] + texturePos[2]*texturePos[2]);// this is between 0 and texWL - if (fabs(radius - 0.25*texWL) < deltaDist || - fabs(radius - 0.75*texWL) < deltaDist){ - if (texWN_needs_update) updateTextureWavelength(); - if (texAmp_needs_update) updateTextureAmplitude(); - if (texSize_needs_update) updateTextureSize(); - if (texAspect_needs_update) updateTextureAspectRatio(); - - if (old_wl != texWL && old_wl != 0){ // adjust to maintain phase continuity - textureOrigin[0] = -texWL*texturePos[0]/old_wl + phantomPos[0]; - textureOrigin[2] = -texWL*texturePos[2]/old_wl + phantomPos[2]; - } - } - } - - if (depth <= 0) { // positive depth is below surface - inContact = FALSE; - lastDepth = 0; - safety_ineffect = FALSE; - (void) updateStateForPHANToM(PHANToM,inContact); - return inContact; - } - // if we suddenly get a new plane that causes the depth in the - // plane to be large then we don't want to let the phantom force - // get large - else if (safety_ineffect) { - inContact = FALSE; - lastDepth = 0; - (void) updateStateForPHANToM(PHANToM,inContact); - return inContact; - } - else if ((depth - lastDepth)*getSurfaceKspring() > MAX_FORCE){ - inContact = FALSE; - lastDepth = 0; - fprintf(stderr, "Warning: exceeded max force change\n"); - fprintf(stderr, " move out of surface to re-enable forces\n"); - safety_ineffect = TRUE; - (void) updateStateForPHANToM(PHANToM,inContact); - return inContact; - } - else { // In contact - inContact = TRUE; - (void)updateStateForPHANToM(PHANToM, inContact); - addCollision(PHANToM,SCP,SCPnormal); - } - - // this value is important for safety checks - lastDepth = depth; - - return inContact; -} -#endif - -void TexturePlane::incrementFade(double dT){ - double curr_spr = getSurfaceKspring(); - double next_spr = curr_spr - dT*dSpring_dt; - - if (next_spr > 0) - setSurfaceKspring(next_spr); - else{ - inEffect = FALSE; - fadeActive = FALSE; - setSurfaceKspring(fadeOldKspring); - } -} - -vrpn_HapticBoolean TexturePlane::usingAssumedTextureBasePlane(vrpn_HapticPlane &p){ - return !(p.a() != 0 || p.b() != 1 || p.c() != 0 || p.d() != 0); -} - -// given a point, compute the tangent to the -// point at the orthogonal projection intersection point -vrpn_HapticPlane TexturePlane::computeTangentPlaneAt(vrpn_HapticPosition pnt) const -{ - // compute normal at pnt[0],pnt[2] - vrpn_HapticVector pNormal = computeNormal(pnt[0],pnt[2]); - // assume pnt is in the tangent plane - vrpn_HapticPosition proj = projectPointOrthogonalToStaticPlane(pnt); - vrpn_HapticPlane tangPlane = vrpn_HapticPlane(pNormal, proj); - return tangPlane; -} - - -vrpn_HapticPosition TexturePlane::projectPointOrthogonalToStaticPlane(vrpn_HapticPosition pnt) const -{ - double y = computeHeight(pnt[0], pnt[2]); - vrpn_HapticPosition projection = pnt; - projection[1] = y; - return projection; -} - -// computes an scp such that the vector from currentPos to -// the scp gives a force in the direction of the normal but -// with magnitude such that the component in the direction -// perpendicular to the base plane is equal to the depth -// below the surface (where the point on the surface is -// found by projecting the current position along the base -// plane normal to the texture plane: -/* - 2<- 1/--------\ <- bump on plane - / \ -------------/ c \---------- <- base plane - - c = current position - 1 = projection to textured surface along normal to base plane - 2 = projection along normal for textured surface with height - from base plane equal to that for 1 (this is the scp returned) - - */ -/* - IMPORTANT: This function assumes that the plane equation is - y = 0 for simplicity of computation - the position is expected to be in a coordinate system such that - the plane has this equation. - Therefore, to simulate other planes, the position in world coordinates - must be transformed correctly - - */ -vrpn_HapticPosition TexturePlane::computeSCPfromGradient(vrpn_HapticPosition currentPos) const -{ - double pos_x, pos_y, pos_z, pos_r; // position in local coordinates - double scp_h; // scp in local coordinates - - // first, translate position into texture coordinates - pos_x = (currentPos[0]); - pos_y = currentPos[1]; - pos_z = (currentPos[2]); - - pos_r = sqrt(pos_x*pos_x + pos_z*pos_z); - - // the first time we contact - if (!inContact){ - return currentPos; - } - - vrpn_HapticPosition newSCP; - - // get height of surface at contact point - scp_h = computeHeight(pos_r); - - // return current position if we are not touching the surface - if (scp_h < pos_y) - newSCP = currentPos; - else { - vrpn_HapticVector normal = computeNormal(pos_x, pos_z); - normal.normalize(); - - double delta_y = scp_h - pos_y; - - // compute scp in untranslated coordinates - newSCP[0] = pos_x + normal[0]*(delta_y/normal[1]); - newSCP[1] = scp_h; - newSCP[2] = pos_z + normal[2]*(delta_y/normal[1]); - } - - return newSCP; -} - -// for texture: -void TexturePlane::updateTextureOrigin(double x, double z) -{ - if (texWN == 0) return; - double r_x = (x - textureOrigin[0]); - double r_z = (z - textureOrigin[2]); - double r_sq = r_x*r_x + r_z*r_z; - double r = sqrt(r_sq); - r_x /= r; - r_z /= r; - // (r_x, r_z) is the direction along which we want to move origin - double num_radii = r/texWL; - num_radii = floor(num_radii); - if (num_radii >= 1){ - textureOrigin[0] += num_radii*texWL*r_x; - textureOrigin[2] += num_radii*texWL*r_z; - } -} - -// for texture: -double TexturePlane::computeHeight(double x, double z) const -{ - double r_sq = x*x + z*z; - double r = sqrt(r_sq); - - double height = computeHeight(r); - return height; -} - -// for texture: compute height as a function of radius from texture origin -double TexturePlane::computeHeight(double r) const -{ - double k = 2*M_PI*texWN; - return texAmp*cos(k*r); -} - -// for texture: -vrpn_HapticVector TexturePlane::computeNormal(double x, double z) const -{ - double k = 2*M_PI*texWN; - double r_sq = x*x + z*z; - double r = sqrt(r_sq); - - vrpn_HapticVector normal; - - if (r != 0){ - normal = vrpn_HapticVector(texAmp*x*k*sin(k*r)/r, 1.0, texAmp*z*k*sin(k*r)/r); - } - else{ - normal = vrpn_HapticVector(0, 1.0, 0); - } - return normal; - -} - -// returns what a single wavelength looks like (height in mm as a function -// of distance from texture origin) -void TexturePlane::getTextureShape(int nsamples, float *surface) const -{ - - double radius = 0; - double incr = texWL/(float)(nsamples-1); - int i; - - if (texWN == 0) { - surface[0] = (float)computeHeight(0); - for (i = 1; i < nsamples; i++){ - surface[i] = surface[0]; - } - } - else { - for (i = 0; i < nsamples; i++){ - // (radius, height) - surface[i] = (float)computeHeight(radius); - radius += incr; - } - } -} - -#endif diff --git a/src/vrpn/server_src/texture_plane.h b/src/vrpn/server_src/texture_plane.h deleted file mode 100644 index 858116ba3293311a785a3570c827b157fd803b5d..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/texture_plane.h +++ /dev/null @@ -1,490 +0,0 @@ -/* texture_plane.h - Plane primitive. This is a user defined geometry node which - extends the GHOST SDK. - This class represents a planar surface which can have bumps, and - a dynamic plane with bumps that can jump up and down. - - XXX The port to HDAPI is not complete for these classes. There is - something in the dynamics callback that is not working (probably), - and the Matrix class defined in ghost.h for the HDAPI implementation - also may not work. - */ - -#ifndef TEXTURE_PLANE_H -#define TEXTURE_PLANE_H - -#include "vrpn_Configure.h" -#include "vrpn_ForceDevice.h" -#ifdef VRPN_USE_PHANTOM_SERVER - -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif - -#define MIN_TEXTURE_WAVELENGTH (0.06) // [mm] reasonable value considering - // resolution of phantom - -#include "ghost.h" -#include "buzzForceField.h" - -typedef void (*pos_force_dataCB)(const double time, - const vrpn_HapticPosition &pos, const vrpn_HapticVector &force, void *ud); - - -class TexturePlane:public vrpn_HapticSurface -{ -public: - void init(); - - //Constructor - TexturePlane(const vrpn_HapticPlane *); - TexturePlane(const vrpn_HapticPlane &); - - //Constructor - TexturePlane(const TexturePlane *); - TexturePlane(const TexturePlane &); - - //Constructor - TexturePlane(double a, double b, double c, double d); - //destructor - ~TexturePlane(){} - - // use the DynamicPlane functions instead of these: - void update(double a, double b, double c, double d); - void setPlane(vrpn_HapticVector newNormal, vrpn_HapticPosition point); - - static int initClass() { - //PlaneClassTypeId = gstUniqueId++ ; - return 0;} - - void setNumRecCycles(int nrc) { - if (nrc < 1) { - numRecoveryCycles = 1; - } else { - numRecoveryCycles = nrc; - } - } - - void setInEffect(vrpn_HapticBoolean effect) {inEffect = effect;} - - // FOR_GHOST_EXTENSION: - // Used by system or for creating sub-classes only. - // Returns true if line segment defined by startPt_WC and endPt_WC - // intersects this shape object. If so, intersectionPt_WC is set to - // point of intersection and intersectionNormal_WC is set to surface - // normal at intersection point. - virtual vrpn_HapticBoolean intersection(const vrpn_HapticPosition &startPt_WC, - const vrpn_HapticPosition &endPt_WC, - vrpn_HapticPosition &intersectionPt_WC, - vrpn_HapticVector &intersectionPtNormal_WC, - void **); - - // Used by system or for creating sub-classes only. - // Returns true if pt is inside of this object. - //virtual int checkIfPointIsInside_WC(const vrpn_HapticPosition &pt) = 0; - -#ifndef VRPN_USE_HDAPI - // Used by system or for creating sub-classes only. - // Returns TRUE if PHANToM is currently in contact with this object. - // If so, the collision is added to the PHANToM's list through - // gstPHANToM::getCollisionInfo() and gstPHANToM::collisionAdded(). - // XXX We may need this. - virtual vrpn_HapticBoolean collisionDetect(gstPHANToM *PHANToM) ; - - void setParent(gstDynamic *d) {dynamicParent = d;}; // tells plane that its - // coordinate system relative to the world coordinates has changed - - // Get type of this class. No instance needed. - static gstType getClassTypeId() { return PlaneClassTypeId; } - - virtual gstType getTypeId() const { return PlaneClassTypeId;} - - // GHOST_IGNORE_IN_DOC: - // Returns TRUE if subclass is of type. - static vrpn_HapticBoolean staticIsOfType(gstType type) { - if (type == PlaneClassTypeId) return TRUE; - else return (gstShape::staticIsOfType(type));} - - virtual vrpn_HapticBoolean isOftype(gstType type) const { - if( type == PlaneClassTypeId) return TRUE; - else return (gstShape::isOfType(type)); } - - void printSelf2() const { plane.printSelf2(); } -#endif - // set frict. dyn, frict. stat, spring, texture amplitude - // and texture wavelength - void setParameters(double fd, double fs, double ks, - double bpa, double bpl); - - // texture-related attributes: - - void enableTexture() {usingTexture = 1;}; - void disableTexture() {usingTexture = 0;}; - int textureEnabled() const {return usingTexture;}; - // for setting texture by wavelength,amplitude: - void setTextureWavelength(double wavelength); - double getTextureWavelength() const {return texWL;}; - void updateTextureWavelength(); - - void setTextureAmplitude(double amplitude); - double getTextureAmplitude() const {return texAmp;}; - void updateTextureAmplitude(); - - void setTextureWaveNumber(double wavenum); - double getTextureWaveNumber() const {return texWN;}; - - // for setting texture by size, aspect ratio: - // size = length of one wavelength - void setTextureSize(double size); - double getTextureSize() const {return texWL;}; - void updateTextureSize(); - - // aspectRatio = 2*amp/wavelength, for normal sine wave this is 1/(PI) - void setTextureAspectRatio(double aspectRatio); - double getTextureAspectRatio() const {return 2.0*texAmp/texWL;}; - void updateTextureAspectRatio(); - - // get a graph of what isotropic surface texture looks like - void getTextureShape(int nsamples, float *surface) const; - - double getTextureHeight(vrpn_HapticPosition &position) const { - vrpn_HapticVector tex_pos = position - textureOrigin; - return computeHeight(tex_pos[0], tex_pos[2]); - } - - vrpn_HapticVector getTextureNormal(vrpn_HapticPosition &position) const { - vrpn_HapticVector tex_pos = position - textureOrigin; - return computeNormal(tex_pos[0], tex_pos[2]); - } - - vrpn_HapticPlane getTangentPlane(vrpn_HapticPosition &position) const { - vrpn_HapticVector tex_pos = position - textureOrigin; - return computeTangentPlaneAt(tex_pos); - } - - int isInContact() const {return inContact;}; - - // fading force effect - void fadeAway(double fadingDuration) { - if (!fadeActive) { - fadeOldKspring = getSurfaceKspring(); - } - fadeActive = TRUE; - dSpring_dt = fadeOldKspring/fadingDuration; - } - int fadeDone() const { - return !fadeActive; - } - void cancelFade() { - if (!fadeActive) return; - inEffect = FALSE; - setSurfaceKspring(fadeOldKspring); - fadeActive = FALSE; - } - - // for data collection - data callback should not do anything other - // than store the data to an external buffer, set to NULL to - // stop data collection: - void setDataCB(pos_force_dataCB func, void *ud){ - dataCB = func; userdata = ud; data_time = 0; - } - void resetDataTime() {data_time = 0;}; - - void signalNewTransform() {newCoordinates = TRUE;}; - -private: - // texture-related functions - vrpn_HapticBoolean usingAssumedTextureBasePlane(vrpn_HapticPlane &p); - void updateTextureOrigin(double x, double z); - - // FOR USE IN TEXTURE COORDINATES ONLY!(i.e. phantomPos - textureOrigin): - double computeHeight(double x, double z) const; - double computeHeight(double r) const; - vrpn_HapticPlane computeTangentPlaneAt(vrpn_HapticPosition pnt) const; - vrpn_HapticPosition projectPointOrthogonalToStaticPlane(vrpn_HapticPosition pnt) const; - vrpn_HapticPosition computeSCPfromGradient(vrpn_HapticPosition currentPos) const; - vrpn_HapticVector computeNormal(double x, double z) const; - - // fade-related functions - void incrementFade(double dT); - -protected: - vrpn_HapticPlane plane; - vrpn_HapticBoolean inEffect; - - // variables used for recovery - vrpn_HapticBoolean isNewPlane; // set to true by update(), set to false - // by collisionDetect() - vrpn_HapticBoolean isInRecovery;// true after collisionDetect() discovers - // there is a new plane and set to - // false when recoveryPlaneCount - // reaches numRecoveryCycles - int recoveryPlaneCount; // keeps track of how many intermediate - // planes there have been - vrpn_HapticPlane originalPlane; // keeps a copy of the plane set by - // update() so that we can restore this - // plane precisely when recovery is complete - double lastDepth; // this is the depth below the surface - // for the plane previous to the - // new plane - updated in collisionDetect() - double dIncrement; // value added to d parameter of plane - // equation with each call to - // collisionDetect() during a recovery - // - this value is computed when a new - // plane is encountered - int numRecoveryCycles; // number of recovery cycles - - // end of variables for recovery - - // variables for transforming into texture coordinates - // problem this addresses: provide a continuous 2D->2D map from a texture plane onto - // the haptic plane where the map is a continuous function of the phantom - // position which minimizes local distortion. With such a map we can add - // texture to a curved surface so it feels almost like the texture on a - // flat plane as long as the texture scale is much smaller - // than the surface scale. - - // the parent node transforms the plane (0,1,0,0) into - // the current plane by incremental rotations about edges formed by - // consecutive planes - in this way we get a mapping that takes care of - // preserving orientation in the plane with each new plane update - // However, we are still left with a translation to maintain continuity - // between texture coordinates on one plane and the next and this is - // handled by updating a textureOrigin. textureOrigin is updated so that - // the projection of the phantom position onto the plane texture coordinates - // is preserved over plane updates - vrpn_HapticVector textureOrigin; -#ifndef VRPN_USE_HDAPI - gstDynamic *dynamicParent; -#endif - // end of texture variables for xform stuff - // other texture variables - int usingTexture; - - double new_texWN; - int texWN_needs_update; // update texWN/texWL preserving texAmp - double texWN; // wave number (waves per mm) - double texWL; // wave length - inverse of wave number - - double new_Size; // this is really the new value for texWL but - int texSize_needs_update;// it is updated in such a way as to preserve - // textureAspect - double new_texAmp; - int texAmp_needs_update; - double texAmp; // amplitude - - double new_textureAspect; - int texAspect_needs_update; // when this is updated it preserves wavelength - double textureAspect; // ratio of amplitude to wave length - -// MB: for SGI compilation with pthreads -#if defined(SGI) || defined (__CYGWIN__) || defined(linux) - pthread_mutex_t tex_param_mutex; -#else - CRITICAL_SECTION tex_param_mutex; -#endif - - // variables for fading surface away (gradually reducing spring const) - int fadeActive; - double fadeOldKspring; - double dSpring_dt; - - // variables for data callback - pos_force_dataCB dataCB; - void *userdata; - double data_time; - - // other - int inContact; - int safety_ineffect; - int newCoordinates; - double t_elapsed; - -private: -#ifndef VRPN_USE_HDAPI - static gstType PlaneClassTypeId; -#endif -}; - -class BuzzForceField; -// This class implements a haptic plane that will rotate and shift to match -// a specified plane equation allowing special effects to be defined in a -// local plane coordinate system -#ifdef VRPN_USE_HDAPI -class DynamicPlane { -#else -class DynamicPlane: public gstDynamic { -#endif - public: - DynamicPlane(); - ~DynamicPlane() {}; -#ifndef VRPN_USE_HDAPI - static gstType getClassTypeId() {return DynamicPlaneClassTypeId;}; - virtual gstType getTypeId() const {return DynamicPlaneClassTypeId;}; - virtual vrpn_HapticBoolean isOfType(gstType type) const { - if (type == DynamicPlaneClassTypeId) { - return TRUE; - } else {// Check if type is parent class. - return (gstDynamic::staticIsOfType(type)); - } - } - - // Allows subclasses to check if they are subclass of type. - static vrpn_HapticBoolean staticIsOfType(gstType type) { - if (type == DynamicPlaneClassTypeId) return TRUE; - else return (gstDynamic::staticIsOfType(type));} - gstEvent getEvent() const { - gstEvent event; - event.id = 0; - return event; - } -#endif - - void update(double a, double b, double c, double d); // set plane equation - - // mostly duplicates of child node functions so we can combine the - // interfaces of multiple objects - - void setActive(vrpn_HapticBoolean active); - void cleanUpAfterError(); - - void enableBuzzing(vrpn_HapticBoolean enable); - void enableTexture(vrpn_HapticBoolean enable); - - int buzzingEnabled() const {return _using_buzz;}; - - int textureEnabled() const {return fixedPlane->textureEnabled();}; - - void setParameters(double fd, double fs, double ks, - double bpa, double bpl, - double buzzamp, double buzzfreq); - - double getSurfaceFstatic() const { - return fixedPlane->getSurfaceFstatic();} - - void setSurfaceFstatic(double fs) { - fixedPlane->setSurfaceFstatic(fs);} - - double getSurfaceFdynamic() const { - return fixedPlane->getSurfaceFdynamic();} - - void setSurfaceFdynamic(double fd) { - fixedPlane->setSurfaceFdynamic(fd);} - - double getSurfaceKspring() const { - return fixedPlane->getSurfaceKspring();} - - void setSurfaceKspring(double ks); - - void setSurfaceKdamping(double kd) { - fixedPlane->setSurfaceKdamping(kd);} - double getSurfaceKdamping() const { - return fixedPlane->getSurfaceKdamping();} - - double getBuzzAmplitude() const { return buzzForce->getAmplitude(); }; - - void setBuzzAmplitude(double amp); - - double getBuzzFrequency() const { return buzzForce->getFrequency(); }; - - void setBuzzFrequency(double freq); - - double getTextureAspectRatio() const { - return fixedPlane->getTextureAspectRatio();} - - void setTextureAspectRatio(double ar) { - fixedPlane->setTextureAspectRatio(ar);} - - void setTextureSize(double size){ - fixedPlane->setTextureSize(size);} - double getTextureSize() const {return fixedPlane->getTextureSize();}; - - void setTextureAmplitude(double amp){ - fixedPlane->setTextureAmplitude(amp);} - double getTextureAmplitude() const { - return fixedPlane->getTextureAmplitude();}; - - double getTextureWavelength() const { - return fixedPlane->getTextureWavelength();} - - void setTextureWavelength(double wl) { - fixedPlane->setTextureWavelength(wl);} - - double getTextureWaveNumber() const { - return fixedPlane->getTextureWaveNumber();} - - void setTextureWaveNumber(double wn) { - fixedPlane->setTextureWaveNumber(wn);} - - void getTextureShape(int nsamples, float *surface) const { - fixedPlane->getTextureShape(nsamples, surface);} - - bool getActive(void) const { return (_active != 0); } - - // TODO: setTextureShape() - - void fadeAway(double fadingDuration) - { fixedPlane->fadeAway(fadingDuration);} - int fadeDone() const { return fixedPlane->fadeDone();} - void cancelFade() {fixedPlane->cancelFade();} - - void setDataCB(pos_force_dataCB func, void *ud){ - fixedPlane->setDataCB(func, ud); - } - void resetDataTime() {fixedPlane->resetDataTime();}; - - // DynamicPlane-specific: - void planeEquationToTransform(vrpn_HapticPlane &prev_plane, - vrpn_HapticPlane &next_plane, vrpn_HapticMatrix &xform_to_update); - void planeEquationToTransform(const vrpn_HapticPlane &prev_plane, - const vrpn_HapticPlane &next_plane, const vrpn_HapticVector &p_project, - vrpn_HapticMatrix &xform); - void setPlaneFromTransform(vrpn_HapticPlane &pl, vrpn_HapticMatrix &xfm); - - -#ifdef VRPN_USE_HDAPI - const vrpn_HapticPlane &getPlane(void) const { return plane; } -#endif - - private: - void updateTransform(const vrpn_HapticMatrix &xfm) { - xform = xfm;}; - vrpn_HapticMatrix getTransform() const { - return xform;}; - -#ifdef VRPN_USE_HDAPI - public: - virtual void updateDynamics(); -#else - gstInternal public: - static int initClass(); - virtual void updateDynamics(); -#endif - - private: - vrpn_HapticMatrix xform; -// MB: for SGI compilation with pthreads -#if defined(SGI) || defined (__CYGWIN__) || defined(linux) - pthread_mutex_t xform_mutex; -#else - CRITICAL_SECTION xform_mutex; -#endif - -#ifndef VRPN_USE_HDAPI - static gstType DynamicPlaneClassTypeId; -#endif - TexturePlane *fixedPlane; - BuzzForceField *buzzForce; - vrpn_HapticPlane plane; - vrpn_HapticPlane lastPlane; - - bool _using_buzz; - bool _active; - bool _is_new_plane; -}; - -#endif -#endif diff --git a/src/vrpn/server_src/timecode_generator_server/.cvsignore b/src/vrpn/server_src/timecode_generator_server/.cvsignore deleted file mode 100644 index 04367b61e78c31fdb509a134a9a91940f9fd101d..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/timecode_generator_server/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.vcproj.*.user \ No newline at end of file diff --git a/src/vrpn/server_src/timecode_generator_server/CMakeLists.txt b/src/vrpn/server_src/timecode_generator_server/CMakeLists.txt deleted file mode 100644 index 5f8dce6ccdd0f8eb5d3c30a24ab1947d9bcec094..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/timecode_generator_server/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -# XXX TODO: -# Do something reasonable with the runtime DLL. - -include_directories(${ADRIENNE_INCLUDE_DIRS}) - -set(TIMECODE_GENSERV_SOURCES vrpn_timecode_generator.cpp) - -set(TIMECODE_GENSERV_PUBLIC_HEADERS vrpn_timecode_generator.h) - -add_library(vrpn_timecode_generator - ${TIMECODE_GENSERV_SOURCES} - ${TIMECODE_GENSERV_PUBLIC_HEADERS}) -set_property(TARGET - vrpn_timecode_generator - PROPERTY - PUBLIC_HEADER - ${TIMECODE_GENSERV_PUBLIC_HEADERS}) - -target_link_libraries(vrpn_timecode_generator ${ADRIENNE_LIBRARIES}) -set_target_properties(vrpn_timecode_generator - PROPERTIES - FOLDER - "Main Server") - -if(VRPN_INSTALL) - install(TARGETS - vrpn_timecode_generator - ARCHIVE - DESTINATION - lib - COMPONENT - serversdk - PUBLIC_HEADER - DESTINATION - include - COMPONENT - serversdk) -endif() \ No newline at end of file diff --git a/src/vrpn/server_src/timecode_generator_server/ChangeLog b/src/vrpn/server_src/timecode_generator_server/ChangeLog deleted file mode 100644 index 22593678638a9e6f810ccc2b9cfc59f3411e1e6f..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/timecode_generator_server/ChangeLog +++ /dev/null @@ -1,11 +0,0 @@ -2002-12-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * vrpn_timecode_generator.dsp : DSP files have been modified to not do - definitions of VRPN_NO_STREAMS and other constants directly, - rather these are now set by editing vrpn_Configure.h. Also, - made projects compile in both debug and release versions. - * vrpn_timecode_generator.cpp : Whitespace changes. Guard by checking - to see if INCLUDE_TIMECODE_SERVER is defined so that this - file can be safely used during all compilations/links. - * vrpn_timecode_generator.h : Same. - diff --git a/src/vrpn/server_src/timecode_generator_server/Readme b/src/vrpn/server_src/timecode_generator_server/Readme deleted file mode 100644 index 30c4e1f34179fef229f8dd69971d32e58c7b14f3..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/timecode_generator_server/Readme +++ /dev/null @@ -1 +0,0 @@ -To compile this project, make sure the aec_nttc.lib and AECiNTTC.H header files both reside in this directory, along with the corresponding .dll file in the system's path (e.g. \winnt\system32). Build the debug project as normal. diff --git a/src/vrpn/server_src/timecode_generator_server/timecode_generator.dsp b/src/vrpn/server_src/timecode_generator_server/timecode_generator.dsp deleted file mode 100644 index 4b98b62ab487c3a29139887937130c6321ee924c..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/timecode_generator_server/timecode_generator.dsp +++ /dev/null @@ -1,92 +0,0 @@ -# Microsoft Developer Studio Project File - Name="timecode_generator" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=timecode_generator - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "timecode_generator.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "timecode_generator.mak" CFG="timecode_generator - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "timecode_generator - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "timecode_generator - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "timecode_generator - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../../pc_win32/server_src/timecode_generator/Release" -# PROP Intermediate_Dir "../../pc_win32/server_src/timecode_generator/Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "../../../Adrienne/AEC_DLL" /D "_LIB" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "timecode_generator - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../../pc_win32/server_src/timecode_generator/Debug" -# PROP Intermediate_Dir "../../pc_win32/server_src/timecode_generator/Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /I "../../../Adrienne/AEC_DLL" /D "_LIB" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "timecode_generator - Win32 Release" -# Name "timecode_generator - Win32 Debug" -# Begin Source File - -SOURCE=.\vrpn_timecode_generator.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_timecode_generator.h -# End Source File -# End Target -# End Project diff --git a/src/vrpn/server_src/timecode_generator_server/timecode_generator.vcproj b/src/vrpn/server_src/timecode_generator_server/timecode_generator.vcproj deleted file mode 100644 index cc8320d79e20faa3f0d93ebddab9b54f53fa0f79..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/timecode_generator_server/timecode_generator.vcproj +++ /dev/null @@ -1,201 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="timecode_generator" - ProjectGUID="{9D824AA0-9A28-45D1-B387-7CD546533493}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../../pc_win32/server_src/timecode_generator/Debug" - IntermediateDirectory=".\../../pc_win32/server_src/timecode_generator/Debug" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,..\..,../../../Adrienne/AEC_DLL" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../../pc_win32/server_src/timecode_generator/Debug/timecode_generator.pch" - AssemblerListingLocation=".\../../pc_win32/server_src/timecode_generator/Debug/" - ObjectFile=".\../../pc_win32/server_src/timecode_generator/Debug/" - ProgramDataBaseFileName=".\../../pc_win32/server_src/timecode_generator/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile=".\../../pc_win32/server_src/timecode_generator/Debug\timecode_generator.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../../pc_win32/server_src/timecode_generator/Debug/timecode_generator.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../../pc_win32/server_src/timecode_generator/Release" - IntermediateDirectory=".\../../pc_win32/server_src/timecode_generator/Release" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,..\..,../../../Adrienne/AEC_DLL" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../../pc_win32/server_src/timecode_generator/Release/timecode_generator.pch" - AssemblerListingLocation=".\../../pc_win32/server_src/timecode_generator/Release/" - ObjectFile=".\../../pc_win32/server_src/timecode_generator/Release/" - ProgramDataBaseFileName=".\../../pc_win32/server_src/timecode_generator/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile=".\../../pc_win32/server_src/timecode_generator/Release\timecode_generator.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../../pc_win32/server_src/timecode_generator/Release/timecode_generator.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <File - RelativePath="vrpn_timecode_generator.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_timecode_generator.h" - > - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/timecode_generator_server/vrpn_timecode_generator.cpp b/src/vrpn/server_src/timecode_generator_server/vrpn_timecode_generator.cpp deleted file mode 100644 index 701cbbd191aefa8f09ead127c17b0e6bd7d2c65f..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/timecode_generator_server/vrpn_timecode_generator.cpp +++ /dev/null @@ -1,669 +0,0 @@ -#include "vrpn_timecode_generator.h" - -#ifdef VRPN_INCLUDE_TIMECODE_SERVER - - -/* This library is C code. When programming in C++, there may be a problem with - decorated names of the library, C++ can't recognize the C names in a library. */ -#ifndef VRPN_ADRIENNE_INCLUDE_FILENAME -// If we don't have nice customized stuff from CMake, fall back to -// original include style. -# define VRPN_ADRIENNE_INCLUDE_FILENAME "aecinttc.h" -#endif - -#ifndef VRPN_ADRIENNE_INCLUDE_HAS_EXTERN_C -extern "C"{ -#endif - - // PROTOTYPES OF THE AECPC-TC.DLL FUNCTIONS - #include VRPN_ADRIENNE_INCLUDE_FILENAME - -#ifndef VRPN_ADRIENNE_INCLUDE_HAS_EXTERN_C -} -#endif - -/* -//Function Prototypes -int FindAllBoards(void); -void RecordSmart(int, WORD); -void RecordPci(int, WORD); -*/ - - -vrpn_Timecode_Generator::vrpn_Timecode_Generator(const char * name, vrpn_Connection * c) : - vrpn_Analog_Server(name, c) { - -// numBoards = AEC_PCTC_GET_NUMBER_OF_DEVICES (); //# use when dll -// time_gen_server->setNumChannels(numBoards); - - boardsFound = AEC_PCTC_GET_NUMBER_OF_DEVICES (); - -// boardsFound = FindAllBoards(); - - AecBoard = new AECBrdFnd[boardsFound]; - FindAllBoards(); - setNumChannels(boardsFound); - for(vrpn_int32 i=0; i < boardsFound; i++) { - channel[i] = last[i] = -1.0; // initialize all channel values for each board found - } -} - -vrpn_Timecode_Generator::~vrpn_Timecode_Generator(void) { - delete [] AecBoard; -} - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Call the 'Check_board' function for each of the possible addresses -// that a time code board could be at and then store the board Type and -// determine if the board has reading ability (some Smart boards are -// generate only). -// Returns the number of boards that where found. -// -// PC-LTC/IOR BOARDS HAVE STANDARD ADDRESS JUMPER SETTINGS OF... -// (port mapped) 200h, 220h, 280h, 2A0h, 300, 320h, 380h, & 3A0h -// PC-LTC/MMR ... C0(00)h, C4(00)h, C8(00)h, CC(00)h, D0(00)h, D4(00)h -// (memory mapped) D8(00)h, & DC(00)h. -// PC-LTC/(RDR, GEN, RG1) & ALL PC-VITC/XXX & ALL PC-VLTC/XXX HAVE -// ADDRESS... CC00h, CD00h, CE00h, CF00h, DC00h, DD00h, DE00h, & DF00h -// The 'actual' address that the memory mapped boards are 'physically' -// mapped to is four bits higher than the jumper's lable. -// (ie: CC00 -> CC000h address -// PCI-LTC/RDR, all other PCI- TC models, are accessed by calling the -// DLL with address parameter values of 0x1000 and up (increased by 0x0100) -// to 0x2100 (total 18 different addresses). These address are arbitrary -// (defined in the DLL). The first PCI board "found" by scanning of -// the PCI bus by the driver/enumerator will be assigned the 0x1000 -// address "code" by the DLL. Each board after will be assigned the -// next address up to MAX. -int vrpn_Timecode_Generator::FindAllBoards(void) -{ - WORD BrdAddr; - int CkType, FoundCnt; - -//look for and IOR return value at the possible IOR addresses - FoundCnt = 0x00; - BrdAddr = 0x200; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); // returns a 0(none), - // 1(IOR), 2(MMR), 3(Smart) - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - BrdAddr = 0x220; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - BrdAddr = 0x280; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - BrdAddr = 0x2A0; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - BrdAddr = 0x300; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - BrdAddr = 0x320; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - BrdAddr = 0x380; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - BrdAddr = 0x3A0; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - -//look for and MMR/Smart return value at the possible memory map addresses - BrdAddr = 0xC000; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xC400; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xC800; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xCC00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xD000; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xD400; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xD800; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xDC00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xCD00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xCE00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xCF00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xDD00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xDE00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - BrdAddr = 0xDF00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - if (CkType == 2 ) - { - AecBoard[FoundCnt].BrdReads = TRUE; - FoundCnt++; - } - else if (CkType == 3 ) - { - RecordSmart(FoundCnt, BrdAddr); - FoundCnt++; - } - } - - //now see if there are any PCI boards - BrdAddr = 0x1000; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - - BrdAddr = 0x1100; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1200; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1300; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1400; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1500; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1600; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1700; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1800; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1900; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1A00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1B00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1C00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1D00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1E00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x1F00; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x2000; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - BrdAddr = 0x2100; - CkType = AEC_PCTC_CHECK_BOARD (&BrdAddr); - if (CkType != 0 ) - { - AecBoard[FoundCnt].BrdAddr = BrdAddr; - AecBoard[FoundCnt].BrdCkType = CkType; - RecordPci(FoundCnt, BrdAddr); - FoundCnt++; - } - return (boardsFound = FoundCnt); -// return FoundCnt; -} - - -void vrpn_Timecode_Generator::RecordPci(int Cnt, WORD BrdAddr) -{ - WORD Addr, Offset08, OffsetEF; - BYTE bId, bType; // bytes from 3E0, 3E1, 3E2, 3EF. - BYTE bCom, bRet; - BOOL ok; - - Addr = BrdAddr; - Offset08 = 0x08; - OffsetEF = 0x3EF; - - - // read the smart board type id byte ( 0x50 VLTC, 0x93 VITC, 0x98 LTC) - //This offset value is NOT IN THE PCI ADDRESS RANGE, BUT THE DLL MAPS - // this value to a "created" value based upon the data byte at offset - // 0x08 of the PCI device. - if (ok = AEC_PCTC_READ_1BYTE (&bType, &OffsetEF, &Addr)) - AecBoard[Cnt].BrdModel = (WORD)bType; //3ef - - if (ok = AEC_PCTC_READ_1BYTE (&bId, &Offset08, &Addr)) - { - if ((bId & 0x50) != 0x00) //if LTC and/or VITC reader bits4&6 set - { - AecBoard[Cnt].BrdReads = TRUE; - // now make sure that the board is in reader mode - //By sending the "dual" reader mode command, the LTC - // and VITC models will have their available (only) reader enabled - // and the return "bRet" will NOT match, but will be a - // 0x21 (LTC), 0x22 (VITC) or 0x23 (VLTC). - bCom = 0x23; // dual reader mode command vltc board - ok = AEC_PCTC_SEND_COMMAND(&bCom, &bRet, &Addr); - } - else AecBoard[Cnt].BrdReads = FALSE; - } - else AecBoard[Cnt].BrdReads = FALSE; - //no return for 'void' -} - - -void vrpn_Timecode_Generator::RecordSmart(int Cnt, WORD BrdAddr) -{ - WORD Addr, OffsetE0, OffsetE1, OffsetE2, OffsetEF; - BYTE bId0, bId1, bId2, bType; // bytes from 3E0, 3E1, 3E2, 3EF. - BYTE bCom, bRet; - BOOL ok; - - Addr = BrdAddr; - OffsetE0 = 0x3E0; - OffsetE1 = 0x3E1; - OffsetE2 = 0x3E2; - OffsetEF = 0x3EF; - - // read the smart board type id byte ( 0x50 VLTC, 0x93 VITC, 0x98 LTC) - if (ok = AEC_PCTC_READ_1BYTE (&bType, &OffsetEF, &Addr)) - AecBoard[Cnt].BrdModel = (WORD)bType; - - // read the board id bytes to see if this board reads tc. - ok = AEC_PCTC_READ_1BYTE (&bId0, &OffsetE0, &Addr); - ok = AEC_PCTC_READ_1BYTE (&bId1, &OffsetE1, &Addr); - ok = AEC_PCTC_READ_1BYTE (&bId2, &OffsetE2, &Addr); - - if ((bId0 == 'R' ) || (bId1 == 'R' ) || (bId2 == 'R' )) - { - AecBoard[Cnt].BrdReads = TRUE; - // now make sure that the board is in reader mode - bCom = 0x16; // idle command ltc/vitc/vltc - ok = AEC_PCTC_SEND_COMMAND(&bCom, &bRet, &Addr); - if (bType ==0x50) - bCom = 0x23; // dual reader mode command vltc board - else bCom = 0x10; // reader mode command ltc/vitc boards - - ok = AEC_PCTC_SEND_COMMAND(&bCom, &bRet, &Addr); - - } - else AecBoard[Cnt].BrdReads = FALSE; - //no return for 'void' -} - -void vrpn_Timecode_Generator::mainloop() { - do_poll(); - report_changes(); -} - -void vrpn_Timecode_Generator::do_poll(void) { - unsigned long tVal; - vrpn_int32 aecint; - - // this should read a value from the board, call server_mainloop() and note - // whether the value has changed or not - this->server_mainloop(); - - for (vrpn_int32 i=0; i < boardsFound; i++) { - if (AecBoard[i].BrdReads == TRUE) { - aecint = AEC_PCTC_READ_TB(&tVal, &AecBoard[i].BrdAddr); - channel[i] = (vrpn_float64) tVal; - } -// printf("brd %d: %f\n",i, channel[i]); - } -} - -#endif diff --git a/src/vrpn/server_src/timecode_generator_server/vrpn_timecode_generator.h b/src/vrpn/server_src/timecode_generator_server/vrpn_timecode_generator.h deleted file mode 100644 index ef487399a485760131f5df3daadf5ac4dd93a55d..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/timecode_generator_server/vrpn_timecode_generator.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef VRPN_TIMECODE_GENERATOR_H -#define VRPN_TIMECODE_GENERATOR_H - -#include "vrpn_Configure.h" // IWYU pragma: keep -#ifdef VRPN_INCLUDE_TIMECODE_SERVER - -#include "vrpn_Analog.h" - -class vrpn_Timecode_Generator : public vrpn_Analog_Server { -public: - vrpn_Timecode_Generator(const char * name, vrpn_Connection * c); - virtual ~vrpn_Timecode_Generator(void); - - void mainloop(void); - - typedef struct _AECBrdFnd - { - WORD BrdAddr; - int BrdCkType; - WORD BrdModel; - BOOL BrdReads; - PVOID PhysAddr; - } AECBrdFnd, *PAECBrdFnd; - -private: - int FindAllBoards(void); - void RecordPci(int Cnt, WORD BrdAddr); - void RecordSmart(int Cnt, WORD BrdAddr); - void do_poll(void); - - int boardNum, boardsFound; // number of boards found in registry - AECBrdFnd *AecBoard; - char hhmmssff[12]; //data string to hold formated unpacked dataC - char hhmmssffx[30]; - -}; - -#endif - -#endif diff --git a/src/vrpn/server_src/trimesh.C b/src/vrpn/server_src/trimesh.C deleted file mode 100644 index b76fe05c724a9cdffee2666f55f38da1a09f0f0e..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/trimesh.C +++ /dev/null @@ -1,362 +0,0 @@ -#include "vrpn_Configure.h" -#ifdef VRPN_USE_PHANTOM_SERVER -#include "trimesh.h" - -#ifndef VRPN_USE_HDAPI - -//pre: NULL==gstMesh; && NULL==ghostPolyMesh -void Trimesh::getGstMesh(){ - if(GHOST==ourType){ - ghostPolyMesh=new gstTriPolyMesh(); - gstMesh=new gstTriPolyMeshHaptic(ghostPolyMesh); - } -#ifdef USING_HCOLLIDE - else if(HCOLLIDE==ourType){ - gstMesh=new gstHybridHashGridTriMesh(minX,minY,minZ,maxX,maxY,maxZ); - } -#endif - else { - fprintf(stderr,"ERROR: unreckognized type: %d\n",ourType); - } - - if(NULL!=gstMesh){ - // it appears that ghost prefers column major order - gstMesh->setTransformMatrix( - gstTransformMatrix(xFormMat[0],xFormMat[4],xFormMat[8],xFormMat[12], - xFormMat[1],xFormMat[5],xFormMat[9],xFormMat[13], - xFormMat[2],xFormMat[6],xFormMat[10],xFormMat[14], - xFormMat[3],xFormMat[7],xFormMat[11],xFormMat[15])); - } -} - -Trimesh::Trimesh(TrimeshType oT){ - ourType=oT; - - ourNode=NULL; - gstMesh=NULL; - inNode=false; - ghostPolyMesh=NULL; - - // a bounding volume of a cubic meter should work, but is not very tight! - minX=-500; - minY=-500; - minZ=-500; - maxX=500; - maxY=500; - maxZ=500; - - for(int i=1;i<16;i++) - xFormMat[i]=0; - xFormMat[0]=xFormMat[5]=xFormMat[10]=xFormMat[15]=1; - - scpWarn=normWarn=false; -} - -void Trimesh::clear(){ - for(int i=1;i<16;i++) - xFormMat[i]=0; - xFormMat[0]=xFormMat[5]=xFormMat[10]=xFormMat[15]=1; - - if(NULL!=ourNode && inNode) - ourNode->removeChild(gstMesh); - - - delete gstMesh; - gstMesh=NULL; - inNode=false; - - delete ghostPolyMesh; - ghostPolyMesh=NULL; - - // return ourType back to the default - setType(GHOST); -} - -// true if there is a mesh being displayed -bool Trimesh::displayStatus(){ - if(NULL!=ourNode && NULL!=gstMesh){ - return true; - } - else - return false; -} - -void Trimesh::startRecording(){ - if(NULL==gstMesh) - return; -#ifdef MONITOR_TRIMESH - else if(HCOLLIDE==ourType){ - ((gstHybridHashGridTriMesh *)gstMesh)->startRecordSession(); - } -#endif - else - fprintf(stderr, - "trimesh force interaction recording is not supported in this compile of this server\n"); -} - -void Trimesh::stopRecording(){ - if(NULL==gstMesh) - return; -#ifdef MONITOR_TRIMESH - else if(HCOLLIDE==ourType){ - ((gstHybridHashGridTriMesh *)gstMesh)->stopRecordSession(); - return; - } -#endif - else - fprintf(stderr, - "trimesh force interaction recording is not supported in this compile of this server\n"); -} - -// set the new bounding volume for this object, -// that is the smallest cube which will contain all the verts -// for the duration of the modifications -// for HCOLLIDE this should really be called before any of the below functions -void Trimesh::setBoundingVolume(const float &nMinX,const float &nMinY,const float &nMinZ, - const float &nMaxX,const float &nMaxY,const float &nMaxZ){ - minX=nMinX; - minY=nMinY; - minZ=nMinZ; - - maxX=nMaxX; - maxY=nMaxY; - maxZ=nMaxZ; -} - -bool Trimesh::getVertex(int vertNum,float &x,float &y,float &z){ - if(GHOST==ourType){ - gstVertex *curVert; - if(NULL==ghostPolyMesh || NULL==(curVert=ghostPolyMesh->getVertex(vertNum))) - return false; - else { - x = (*curVert)[0]; - y = (*curVert)[1]; - z = (*curVert)[2]; - return true; - } - } -#ifdef USING_HCOLLIDE - else if(HCOLLIDE==ourType){ - if(NULL==gstMesh) - return false; - else - return ((gstHybridHashGridTriMesh *)gstMesh)->getVertex(vertNum,x,y,z); - } -#endif - else { - fprintf(stderr,"ERROR: ourType is not valid\n"); - return false; - } -} - -// if HCOLLIDE = ourType, returns the id of the triangle the probe is contacting -// otherwise it returns -1 -int Trimesh::getScpTriId(){ -#ifdef USING_HCOLLIDE - if(HCOLLIDE==ourType){ - if(NULL==gstMesh) - return -1; - else - return ((gstHybridHashGridTriMesh *)gstMesh)->getScpTriId(); - } -#endif - - // this is not really an error since scp triId is not necessary for haptic display - if(!scpWarn){ - /* temp disaple: - fprintf(stderr, - "Trimesh::WARNING: getScpId is not implemented for the current primitive type\n"); - */ - scpWarn=true; - } - return true; - -} - -bool Trimesh::setVertex(int vertNum,double x,double y,double z){ - if(NULL==gstMesh) - getGstMesh(); - - if(GHOST==ourType){ - - gstVertex *curVert=ghostPolyMesh->getVertex(vertNum); - if(NULL==curVert){ - ghostPolyMesh->createVertex(gstPoint(x,y,z),vertNum); - } - else { - // the way this works with ghost is a bit awkward, maybe I'm not using it right (AG) - // but we do only need to notify of one moved poly right???? - gstTriPoly *movedPoly=NULL; - if(!curVert->isStranded()){ - movedPoly=(curVert->incidentEdgesBegin()._M_node->_M_data.getEdge()-> - incidentPolysBegin()._M_node->_M_data); - ghostPolyMesh->beginModify(movedPoly); - } - - (*curVert)[0]=x; - (*curVert)[1]=y; - (*curVert)[2]=z; - - if(movedPoly){ - ghostPolyMesh->endModify(movedPoly); - } - } - - return true; - } -#ifdef USING_HCOLLIDE - else if(HCOLLIDE==ourType){ - bool retVal=true; - if(x<minX || x>maxX || y<minY || y>maxY || z<minZ || z>maxZ){ - fprintf(stderr,"ERROR: vertex: <%lf,%lf,%lf> is outside the bounding volume\n",x,y,z); - retVal=false; - } - - ((gstHybridHashGridTriMesh *)gstMesh)->setVertex(vertNum,x,y,z); - return retVal; - } -#endif - else { - fprintf(stderr,"ERROR: ourType is not valid\n"); - return false; - } -} - -bool Trimesh::setNormal(int normNum,double x,double y,double z){ - if(NULL==gstMesh) - getGstMesh(); - -#ifdef USING_HCOLLIDE - if(HCOLLIDE==ourType){ - ((gstHybridHashGridTriMesh *)gstMesh)->setNormal(normNum,x,y,z); - return true; - } -#endif - // this is not really an error since norms are not necessary for haptic display - if(!normWarn){ - fprintf(stderr,"Trimesh::WARNING: norms not implemented for the current primitive type\n"); - normWarn=true; - } - return true; -} - -bool Trimesh::setTriangle(int triNum,int vert0,int vert1,int vert2, - int norm0,int norm1,int norm2){ - if(GHOST==ourType){ - if(NULL==ghostPolyMesh) - return false; - - gstTriPoly *curPoly=ghostPolyMesh->getPolygon(triNum); - if(NULL!=curPoly) - ghostPolyMesh->removePolygon(&curPoly); - ghostPolyMesh->createTriPoly(vert0,vert1,vert2,triNum); - return true; - } -#ifdef USING_HCOLLIDE - else if(HCOLLIDE==ourType){ - if(NULL==gstMesh) - return false; - else { - ((gstHybridHashGridTriMesh *)gstMesh)->setTriangle(triNum,vert0,vert1,vert2, - norm0,norm1,norm2); - return true; - } - } -#endif - else { - fprintf(stderr,"ERROR: ourType is not valid\n"); - return false; - } -} - -bool Trimesh::removeTriangle(int triNum){ - if(GHOST==ourType){ - if(NULL==ghostPolyMesh) - return false; - - gstTriPoly *curPoly=ghostPolyMesh->getPolygon(triNum); - if(NULL!=curPoly){ - ghostPolyMesh->removePolygon(&curPoly); - return true; - } - else - return false; - } -#ifdef USING_HCOLLIDE - else if(HCOLLIDE==ourType){ - ((gstHybridHashGridTriMesh *)gstMesh)->removeTriangle(triNum); - return true; - } -#endif - else { - fprintf(stderr,"ERROR: ourType is not valid\n"); - return false; - } -} - -bool Trimesh::updateChanges(){ - if(NULL==gstMesh) - return false; - - if(!inNode && NULL!=ourNode){ - ourNode->addChild(gstMesh); - inNode=true; - } - - - if(GHOST==ourType){ - if(NULL==ghostPolyMesh) - return false; - - ghostPolyMesh->initSpatialPartition(); - ghostPolyMesh->endModifications(); - - return true; - } -#ifdef USING_HCOLLIDE - else if(HCOLLIDE==ourType){ - ((gstHybridHashGridTriMesh *)gstMesh)->updateModifications(); - return true; - } -#endif - else { - fprintf(stderr,"ERROR: ourType is not valid\n"); - return false; - } -} - -void Trimesh::addToScene(gstSeparator *ourScene){ - ourNode=ourScene; - if(NULL!=gstMesh){ - ourNode->addChild(gstMesh); - inNode=true; - } -} - -// set the transformatrix for the mesh (xFormMat is in row major order) -void Trimesh::setTransformMatrix(float xfMat[16]){ - - for(int i=0;i<16;i++) - xFormMat[i]=xfMat[i]; - - if(NULL!=gstMesh){ - // it appears that ghost prefers column major order - gstMesh->setTransformMatrix( - gstTransformMatrix(xFormMat[0],xFormMat[4],xFormMat[8],xFormMat[12], - xFormMat[1],xFormMat[5],xFormMat[9],xFormMat[13], - xFormMat[2],xFormMat[6],xFormMat[10],xFormMat[14], - xFormMat[3],xFormMat[7],xFormMat[11],xFormMat[15])); - } -} - -void Trimesh::setTouchableFromBothSides(bool touch) -{ - if(touch) - gstMesh->setTouchableFrom( gstTriPolyMeshHaptic:: RV_FRONT_AND_BACK ); - else - gstMesh->setTouchableFrom( gstTriPolyMeshHaptic::RV_FRONT ); -} - - -#endif VRPN_USE_HDAPI -#endif diff --git a/src/vrpn/server_src/trimesh.h b/src/vrpn/server_src/trimesh.h deleted file mode 100644 index bfb2402781b5452be0c71ce7bcfa05e11f4d6e9e..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/trimesh.h +++ /dev/null @@ -1,118 +0,0 @@ -/* Trimesh.h - this class represents a triangle mesh for haptic display -*/ - -#ifndef TRIMESH_H -#define TRIMESH_H - -#include "vrpn_Configure.h" -#ifdef VRPN_USE_PHANTOM_SERVER - -#include "ghost.h" - -//XXX There's no easy was to implement this class in the absence of GHOST. -//XXX It may make sense to pull it out of ForceDevice and provide it as a -//XXX separate interface. Who knows? - -#ifndef VRPN_USE_HDAPI - -// the different types of trimeshes we have available for haptic display -enum TrimeshType {GHOST,HCOLLIDE}; -// the GHOST mesh does not properly deal with vertex normals - - -class Trimesh { -protected: - // we actually store our verts as doubles for the sake of gstPolyMesh - TrimeshType ourType; - - // this is the ghost polymesh we allocated (if we got one) - gstTriPolyMesh *ghostPolyMesh; - - // this is the trimesh we are displaying - gstTriPolyMeshHaptic *gstMesh; - // the node containing this trimesh - gstSeparator *ourNode; - // true once we've been added to ourNode - bool inNode; - - float minX,minY,minZ,maxX,maxY,maxZ; - - //pre: NULL==gstMesh; && NULL==ghostPolyMesh - void getGstMesh(); - - float xFormMat[16]; - - // flags to only print warnings once - bool scpWarn,normWarn; -public: - - // display with ghost by default - Trimesh(TrimeshType oT=GHOST); - - ~Trimesh(){ clear(); } - - void clear(); - - // true if there is a mesh being displayed - bool displayStatus(); - - void setType(TrimeshType newType){ - ourType=newType; - scpWarn=normWarn=false; - } - - void startRecording(); - void stopRecording(); - - // set the new bounding volume for this object, - // that is the smallest cube which will contain all the verts - // for the duration of the modifications - // for HCOLLIDE this should really be called before any of the below functions - void setBoundingVolume(const float &nMinX,const float &nMinY,const float &nMinZ, - const float &nMaxX,const float &nMaxY,const float &nMaxZ); - - - // --- modify one step at a time -------------------- - - // vertNum normNum & triNum start at 0, true on success - bool setVertex(int vertNum,double x,double y,double z); - bool setNormal(int normNum,double x,double y,double z); - // pre: specified verts and norms have already been set - bool setTriangle(int triNum,int vert0,int vert1,int vert2, - int norm0=-1,int norm1=-1,int norm2=-1); - bool removeTriangle(int triNum); - bool updateChanges(); - // -------------------------------------------------- - - bool getVertex(int vertNum, float &x,float &y,float &z); - - // if HCOLLIDE = ourType, returns the id of the triangle the probe is contacting - // otherwise it returns -1 - int getScpTriId(); - - void addToScene(gstSeparator *ourScene); - - void setSurfaceKspring(double Ks){ - gstMesh->setSurfaceKspring(Ks); - } - void setSurfaceFstatic(double Fs){ - gstMesh->setSurfaceFstatic(Fs); - } - void setSurfaceFdynamic(double Fd){ - gstMesh->setSurfaceFdynamic(Fd); - } - void setSurfaceKdamping(double Kd){ - gstMesh->setSurfaceKdamping(Kd); - } - - // set the transformatrix for the mesh (xFormMat is in row major order) - void setTransformMatrix(float xFormMat[16]); - - void setTouchableFromBothSides(bool touch=true); -}; - -#endif // VRPN_USE_HDAPI - -#endif -#endif // TRIMESH_H diff --git a/src/vrpn/server_src/vrpn.C b/src/vrpn/server_src/vrpn.C deleted file mode 100644 index feded4f131e553cd44141ae46cce21b1db7498db..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn.C +++ /dev/null @@ -1,330 +0,0 @@ -#include <stdio.h> // for fprintf, stderr, NULL, etc -#include <stdlib.h> // for atoi, exit -#include <string.h> // for strcmp - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_NORMAL, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, etc -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_ForwarderController.h" // for vrpn_Forwarder_Server -#include "vrpn_Generic_server_object.h" // for vrpn_Generic_Server_Object -#include "vrpn_Shared.h" // for vrpn_SleepMsecs - -void Usage(const char *s) -{ - fprintf(stderr, "Usage: %s [-f filename] [-warn] [-v] [port] [-q]\n", s); - fprintf(stderr, " [-millisleep n]\n"); - fprintf(stderr, " [-NIC name] [-li filename] [-lo filename]\n"); - fprintf(stderr, - " -f: Full path to config file (default vrpn.cfg).\n"); - fprintf(stderr, - " -millisleep: Sleep n milliseconds each loop cycle\n"); - fprintf(stderr, " (if no option is specified, the " - "Windows architecture\n"); - fprintf(stderr, " will free the rest of its time slice " - "on each loop\n"); - fprintf(stderr, " but leave the processes available to " - "be run immediately;\n"); - fprintf(stderr, " a 1ms sleep is the default on all " - "other architectures).\n"); - fprintf(stderr, " -millisleep 0 is recommended when " - "using this server and\n"); - fprintf(stderr, " a client on the same uniprocessor " - "CPU Win32 PC.\n"); - fprintf(stderr, " -millisleep -1 will cause the server " - "process to use the\n"); - fprintf(stderr, - " whole CPU on any uniprocessor machine.\n"); - fprintf(stderr, - " -warn: Only warn on errors (default is to bail).\n"); - fprintf(stderr, " -v: Verbose.\n"); - fprintf(stderr, " -q: Quit when last connection is dropped.\n"); - fprintf(stderr, - " -NIC: Use NIC with given IP address or DNS name.\n"); - fprintf(stderr, " -li: Log incoming messages to given filename.\n"); - fprintf(stderr, " -lo: Log outgoing messages to given filename.\n"); - fprintf(stderr, - " -flush: Flush logs to disk after every mainloop().\n"); - exit(0); -} - -static volatile int done = 0; // Done and should exit? - -vrpn_Connection *connection; -vrpn_Generic_Server_Object *generic_server = NULL; - -static char *g_NICname = NULL; - -static const char *g_inLogName = NULL; -static const char *g_outLogName = NULL; - -// TCH October 1998 -// Use Forwarder as remote-controlled multiple connections. -vrpn_Forwarder_Server *forwarderServer; - -static bool verbose = false; - -void shutDown(void) -{ - if (verbose) { - fprintf(stderr, "Deleting forwarder server\n"); - } - if (forwarderServer) { - delete forwarderServer; - forwarderServer = NULL; - } - if (verbose) { - fprintf(stderr, "Deleting generic server object..."); - } - if (generic_server) { - delete generic_server; - generic_server = NULL; - } - if (verbose) { - fprintf(stderr, "Deleting connection\n"); - } - if (connection) { - connection->removeReference(); - connection = NULL; - } - if (verbose) { - fprintf(stderr, "Deleted server and connection, Exiting.\n"); - } - exit(0); -} - -int VRPN_CALLBACK handle_dlc(void *, vrpn_HANDLERPARAM /*p*/) -{ - shutDown(); - return 0; -} - -// install a signal handler to shut down the devices -// On Windows, the signal handler is run in a different thread from -// the main application. We don't want to go destroying things in -// here while they are being used there, so we set a flag telling the -// main program it is time to exit. -#if defined(_WIN32) && !defined(__CYGWIN__) -/** - * Handle exiting cleanly when we get ^C or other signals. - */ -BOOL WINAPI handleConsoleSignalsWin(DWORD signaltype) -{ - switch (signaltype) { - case CTRL_C_EVENT: - case CTRL_BREAK_EVENT: - case CTRL_CLOSE_EVENT: - case CTRL_SHUTDOWN_EVENT: - done = 1; - return TRUE; - // Don't exit, but return FALSE so default handler - // gets called. The default handler, ExitProcess, will exit. - default: - return FALSE; - } -} - -#else -#include <signal.h> // for signal, SIGINT, SIGKILL, etc - -void sighandler(int) { done = 1; } -#endif - -int main(int argc, char *argv[]) -{ - const char *config_file_name = "vrpn.cfg"; - bool bail_on_error = true; - bool auto_quit = false; - bool flush_continuously = false; - int realparams = 0; - int i; - int port = vrpn_DEFAULT_LISTEN_PORT_NO; -#ifdef _WIN32 - // On Windows, the millisleep with 0 option frees up the CPU time slice for - // other jobs - // but does not sleep for a specific time. On Unix, this returns - // immediately and does - // not do anything but waste cycles. - int milli_sleep_time = 0; // How long to sleep each iteration (default: free - // the timeslice but be runnable again - // immediately) -#else - int milli_sleep_time = 1; // How long to sleep each iteration (default: 1ms) -#endif -#ifdef _WIN32 - WSADATA wsaData; - int status; - if ((status = WSAStartup(MAKEWORD(1, 1), &wsaData)) != 0) { - fprintf(stderr, "WSAStartup failed with %d\n", status); - return (1); - } - - // This handles all kinds of signals. - SetConsoleCtrlHandler(handleConsoleSignalsWin, TRUE); - -#else -#ifdef sgi - sigset(SIGINT, sighandler); - sigset(SIGKILL, sighandler); - sigset(SIGTERM, sighandler); - sigset(SIGPIPE, sighandler); -#else - signal(SIGINT, sighandler); - signal(SIGKILL, sighandler); - signal(SIGTERM, sighandler); - signal(SIGPIPE, sighandler); -#endif // not sgi -#endif // not WIN32 - - // Parse the command line - i = 1; - while (i < argc) { - if (!strcmp(argv[i], "-f")) { // Specify config-file name - if (++i > argc) { - Usage(argv[0]); - } - config_file_name = argv[i]; - } - else if (!strcmp(argv[i], - "-millisleep")) { // How long to sleep each loop? - if (++i > argc) { - Usage(argv[0]); - } - milli_sleep_time = atoi(argv[i]); - } - else if (!strcmp(argv[i], "-warn")) { // Don't bail on errors - bail_on_error = false; - } - else if (!strcmp(argv[i], "-v")) { // Verbose - verbose = true; - vrpn_System_TextPrinter.set_min_level_to_print(vrpn_TEXT_NORMAL); - } - else if (!strcmp(argv[i], "-q")) { // quit on dropped last con - auto_quit = true; - } - else if (!strcmp(argv[i], "-NIC")) { // specify a network interface - if (++i > argc) { - Usage(argv[0]); - } - if (verbose) { - fprintf(stderr, "Listening on network interface card %s.\n", - argv[i]); - } - g_NICname = argv[i]; - } - else if (!strcmp(argv[i], "-li")) { // specify server-side logging - if (++i > argc) { - Usage(argv[0]); - } - if (verbose) { - fprintf(stderr, "Incoming logfile name %s.\n", argv[i]); - } - g_inLogName = argv[i]; - } - else if (!strcmp(argv[i], "-lo")) { // specify server-side logging - if (++i > argc) { - Usage(argv[0]); - } - if (verbose) { - fprintf(stderr, "Outgoing logfile name %s.\n", argv[i]); - } - g_outLogName = argv[i]; - } - else if (!strcmp(argv[i], "-flush")) { - flush_continuously = true; - } - else if (argv[i][0] == '-') { // Unknown flag - Usage(argv[0]); - } - else - switch (realparams) { // Non-flag parameters - case 0: - port = atoi(argv[i]); - realparams++; - break; - default: - Usage(argv[0]); - } - i++; - } - - // Need to have a global pointer to the connection so we can shut it down - // in the signal handler (so we can close any open logfiles.) - // Form the name based on the type of connection requested. For a standard - // VRPN UDP/TCP port, we give it the name "NIC:port" if there is a NIC name, - // otherwise just ":port" for the default NIC. - char con_name[1024]; - if (g_NICname) { - sprintf(con_name, "%s:%d", g_NICname, port); - } - else { - sprintf(con_name, ":%d", port); - } - connection = - vrpn_create_server_connection(con_name, g_inLogName, g_outLogName); - - // Create the generic server object and make sure it is doing okay. - generic_server = new vrpn_Generic_Server_Object( - connection, config_file_name, port, verbose, bail_on_error); - if ((generic_server == NULL) || !generic_server->doing_okay()) { - fprintf(stderr, "Could not start generic server, exiting\n"); - shutDown(); - } - - // Open the Forwarder Server - forwarderServer = new vrpn_Forwarder_Server(connection); - - // If we're set to auto-quit, then register a handler for the last - // connection - // dropped that will cause a callback which will exit. - if (auto_quit) { - int dlc_m_id = - connection->register_message_type(vrpn_dropped_last_connection); - connection->register_handler(dlc_m_id, handle_dlc, NULL); - } - - // ******************************************************************** - // ** ** - // ** MAIN LOOP ** - // ** ** - // ******************************************************************** - - // ^C handler sets done to let us know to quit. - while (!done) { - // Let the generic object server do its thing. - if (generic_server) { - generic_server->mainloop(); - } - - // Send and receive all messages. - connection->mainloop(); - - // Save all log messages that are pending so that they are on disk - // in case we end up exiting improperly. This may slow down the - // server waiting for disk writes to complete, but will more reliably - // log messages. - if (flush_continuously) { - connection->save_log_so_far(); - } - - // Bail if the connection is in trouble. - if (!connection->doing_okay()) { - shutDown(); - } - - // Handle forwarding requests; send messages - // on auxiliary connections. - forwarderServer->mainloop(); - -// Sleep so we don't eat the CPU -#if defined(_WIN32) - if (milli_sleep_time >= 0) { -#else - if (milli_sleep_time > 0) { -#endif - vrpn_SleepMsecs(milli_sleep_time); - } - } - - shutDown(); - return 0; -} diff --git a/src/vrpn/server_src/vrpn.cfg b/src/vrpn/server_src/vrpn.cfg deleted file mode 100644 index 30c90733b0175b25f12c36fb1fce08150ee0791a..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn.cfg +++ /dev/null @@ -1,2953 +0,0 @@ -# vrpn.cfg SAMPLE for VRPN version @CONFIG_VERSION@ - -################################################################################ -################################################################################ -# This file provides comments and examples for the vrpn.cfg file that is read -# by the vrpn_server application when it starts up. This is a generic server -# application that can start up many but maybe not all servers. -# -# This has sample lines for a vrpn.cfg file. If you get a new device working, -# add a line for it here. DO NOT remove lines from this file (unless -# devices are declared obsolete) - just change the actual vrpn.cfg to match -# your application. -# -# All examples in the file are preceded by comment characters (#). To actually -# use one of these examples, remove that character from the beginning of all the -# examples that you want to use, and edit those lines to suit your environment. -################################################################################ - -################################################################################ -# NULL Tracker. This is a "device" that reports the Identity transformation for -# each of its sensors at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are three arguments: -# char name_of_this_device[] -# int number_of_sensors -# float rate_at_which_to_report_updates - -#vrpn_Tracker_NULL Tracker0 2 2.0 - -################################################################################ -# WintrackerIII from VR SPace -# Emiliano Pastorelli - Institute of Cybernetics, Tallinn (Estonia) -# -# Several other commands are available to control the device, a future version of the server will implement them too -# -# char name_of_the_device[] -# activate sensor0 activate (1=activated, 0=deactivated) -# activate sensor1 activate (1=activated, 0=deactivated) -# activate sensor2 (1=activated, 0=deactivated) -# activate range extender (1=activated, 0=deactivated) -# hemisphere of operation (X = front hemisphere with X>0; Z = upper hemisphere with Z<0 ) -# - -#vrpn_Tracker_Wintracker Wintracker0 1 0 0 0 X - -################################################################################ -# Example Button server. This is a "device" that reports on and off for -# each of its buttons at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are three arguments: -# char name_of_this_device[] -# int number_of_buttons -# float rate_at_which_the_buttons_toggle (transitions/second) - -#vrpn_Button_Example Button0 2 2.0 - -################################################################################ -# Example Dial server. This is a "device" that reports constant rotations for -# each of its dials at the specified rate. It can be used to verify connections -# are working and for other tests of VRPN. There are four arguments: -# char name_of_this_device[] -# int number_of_dials -# float rate_at_which_the_dials_spin (revolutions/second) -# float rate_at_which_to_report_updates (updates/second) - -#vrpn_Dial_Example Dial0 2 2.0 10.0 - -################################################################################ -# Flock-of-birds Tracker. Runs an Ascension Flock of Birds tracker that is -# attached to a serial port on this machine. Note that there is another driver -# (listed below) that runs the Flock when each sensor is connected to its own -# serial line. Arguments: -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int invert_quaternion (0 = no, 1 = yes) -# char useERT (OPTIONAL; defaults to yes) -# char[2] active_hemisphere (OPTIONAL; defaults to +z) -# -# NOTE: for useERT: use nothing, y or Y if you have an extended range -# transmitter, use N or n if not (added by David Nahon for Virtools -# VRPack/SAS Cube. -# NOTE: The "invert_quaternion" parameter was added because there was a -# conflict between the code that had been around since VRPN started and -# the Flock documentation -- it looks like most people had been using the -# Flock in the "wrong" hemisphere, which inverted the orientation relative -# to the position. The old behavior is obtained by specifying "1". Not -# inverting it is specified using "0". -# NOTE: active hemisphere is one of "+x", "-x", "+y", "-y", "+z", "-z" -# If "active_hemisphere" is not specified, it defaults to +z. - - -#vrpn_Tracker_Flock Tracker0 4 /dev/ttyS0 115200 1 - -# If you have to FOB, with no Extended Range ctrler/transmitter, on Windows, -# with -x as the active hemisphere, use - -#vrpn_Tracker_Flock Tracker0 2 COM1 38400 1 N -x - -# Watch: be sure that the serial baud rate dip switches (the 3 on the left) -# of your master flock are properly set. -# You should try baud rates like 38400 before trying to go higher -# In normal address mode - less than 14 fob units - your switch should be: -# 0 1 2 3 4 5 6 7 -# 0 0 1 X X X X 0 2400 -# 0 1 0 X X X X 0 4800 -# 0 1 1 X X X X 0 9600 -# 1 0 0 X X X X 0 19200 -# 1 0 1 X X X X 0 38400 -# 1 1 0 X X X X 0 57600 -# 1 1 1 X X X X 0 115200 -# -# X X X X are used for coding the FOB address, they must be set correctly, -# even if you are only using 1 unit (standalone mode) -# the settings should be (in normal address mode): -# 3 4 5 6 -# 0 0 0 1 for the first unit -# 0 0 1 0 for the second unit -# 0 0 1 1 for the third -# 0 1 0 0 for the fourth -# 0 1 0 1 for the fifth -# ... -# -############################################################################ -# WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH WATCH -################### -# -# On windows at least, it might be necessary to cut your serial cable so as -# to only have Transmit, Receive and Ground pins. Even if CBIRDS or WINBIRDS -# are fine with a cable, it doesn't mean that this cable will please vrpn. -# This limitation should have been fixed with version 06.05. -# -################### - -################################################################################ -# Flock-of-birds in parallel Tracker. Runs an Ascension Flock of Birds tracker -# that has its source and each sensor plugged into its own serial port on this -# machine (perhaps through a Cyclades multi-port serial card). This mode of -# operation increases the throughput and decreases the latency of tracker reports. -# The arguments match those of the Flock-of-birds tracker from above, with the -# addition of the name of the serial ports for each of the sensors added at the -# end. Arguments (all on the same line): -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device_for_controller[] -# int baud_rate_of_serial_device -# int invert_quaternion (0 = no, 1 = yes) -# [one for each sensor] char name_of_serial_device_for_sensor[] -# -# NOTE: The "invert_quaternion" parameter was added because there was a -# conflict between the code that had been around since VRPN started and -# the Flock documentation -- it looks like most people had been using the -# Flock in the "wrong" hemisphere, which inverted the orientation relative -# to the position. The old behavior is obtained by specifying "1". Not -# inverting it is specified using "0". - -#vrpn_Tracker_Flock_Parallel Tracker0 4 /dev/ttyC4 115200 1 /dev/ttyC0 /dev/ttyC1 /dev/ttyC2 /dev/ttyC3 -#vrpn_Tracker_Flock_Parallel Tracker0 2 COM1 115200 1 COM2 COM3 - -################################################################################ -# Fastrak Tracker. Runs a Polhemus Fastrak tracker that is attached to a serial -# port on this machine. This driver will also run an InterSense IS600 or IS900 -# tracker, but you will want to include extra initialization code (as described -# below) to set up the ultrasonic pip information, wand devices, stylus devices -# and so forth. Arguments that go on the first line: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the Fastrak during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the Fastrak -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. -# -# If one or more sensors on the Fastrak have a stylus button on them, use -# the "FTStylus" command after the reset command lines (if any). There should -# be a front-slash "/" character at the end of the line before the FTStylus -# command. The command takes two arguments: the name of the button device -# that will report the buttons and the sensor number to which the button is -# attached (the first sensor is sensor 0). -# -# Commands to add Joysticks (2 buttons) or Wands (5 buttons and 2 analogs) to -# the various sensors on the Isense900 are done by adding Stylus and -# Wand command lines after the reset command lines. Each of these lines -# takes two arguments: the name of the button (for Stylus) or button and -# analog (for Wand) servers, and the sensor number (starting from 0). The -# Wand line takes eight additional parameters, which specify the scaling -# and clipping behavior of the two directions on the analog joystick. Each -# set of for is the min, lowzero, hizero, and max values: these are mapped -# to -1, 0,0, and 1 (all values between lowzero and hizero are mapped to 0). -# Start with these at -1,0,0,1 and use the 'printcereal' program or some other -# method to read them and see what the range of acheivable values is. Then, -# set them to slightly conservative values so that the whole range is covered -# and the analogs will report zero when the joystick is centered. The -# presence of these lines is indicated by placing them after any additional -# reset command lines, by ending the line preceding them with the front slash -# "/" character. -# -# Remember that the "remote" button object is not the same as the the tracking -# device, so be sure to use a remote button object that connects to the button -# rather than the tracker. The button device name is defined on the stylus or -# wand line in the config file, and should not be the same as the tracker. In -# the case described by the example configuration below, if the name of the -# machine running the server is "myis900server" you would connect to the tracker -# as "Isense900@myis900server" and to the buttons on the stylus as -# "Stylus0@myis900server": -# -# Note that this frontslash and backslash-notation can only be used for the -# Fastrak/Isense tracker, not to extend the line for any other type of device -# listed in this configuration file. - -# Vanilla Fastrak on on a Unix box -#vrpn_Tracker_Fastrak Fastrak0 /dev/ttyS0 19200 - -# Fastrak with a stylus on sensor zero on a Windows box -#vrpn_Tracker_Fastrak Tracker0 COM1 115200 / -#FTStylus Stylus0 0 - -# IS600 and its pip settings -#vrpn_Tracker_Fastrak Isense600 /dev/ttyS0 19200 \ -#MCc\ -#*5\ -#MCM1,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,89\ -#MCM1,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,87\ -#MCM2,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,66\ -#MCM2,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,71\ -#MCM3,1,0.1237,-0.0762,-0.0424,0.00,0.00,-1.00,82\ -#MCM3,2,0.1237,0.0762,-0.0424,0.00,0.00,-1.00,77\ -#MCe\ -#*10 - -# IS900 with a wand on the first sensor and a stylus on the third: -#vrpn_Tracker_Fastrak Isense900 COM1 115200 / -#Wand Wand0 0 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 / -#Stylus Stylus0 2 - -################################################################################ -# Isotrak Tracker. Runs a Polhemus Isotrak tracker that is attached to a serial -# port on this machine. Arguments that go on the first line: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the Isotrak during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the Isotrak -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. - -#vrpn_Tracker_Isotrak TrackerIsotrak /dev/ttyS0 115200 \ -#H1,0,1,0 - -################################################################################ -# Liberty Tracker. Runs a Polhemus Liberty tracker that is attached to a serial -# port (perhaps a USB-to-RS232 adapter) on this machine. Arguments that go on -# the first line. -# char name_of_this_device[] -# char name_of_serial_or_usb_device[] -# int baud_rate_of_serial_device (not used when the device is USB) -# int number_of_chars_in_whoami_response (optional) -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the Liberty during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the Fastrak -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. -# -# If one or more sensors on the Liberty have a stylus button on them, use -# the "Stylus" command after the reset command lines (if any). There should -# be a front-slash "/" character at the end of the line before the Stylus -# command. The command takes two arguments: the name of the button device -# that will report the buttons and the sensor number to which the button is -# attached (the first sensor is sensor 0). -# - -# ------------------------------------------- -# Example when Liberty is attached via USB -# The BAUD Rate is needed, although it is not used - -#vrpn_Tracker_Liberty Liberty /dev/usb/ttyUSB0 115200 - -#-------------------------------------------- -# Example when Liberty is attached via Serial - -#vrpn_Tracker_Liberty Liberty /dev/ttyS0 115200 - -#-------------------------------------------- -# Example when Liberty is attached via Serial with a non-standard whoami length - -#vrpn_Tracker_Liberty Liberty /dev/ttyS0 115200 247 - -#-------------------------------------------- -# Liberty attached via Serial with styluses on sensors zero and three -#vrpn_Tracker_Liberty Tracker0 /dev/ttyS0 115200 / -#Stylus Stylus0 0 / -#Stylus Stylus1 3 - -################################################################################ -# High Speed Liberty Latus Tracker. Runs a Polhemus Liberty Latus tracker that -# is attached to a USB port on this machine. Arguments that go on the first line -# char name_of_this_device[] -# int number_of_markers_to_detect -# int baud_rate_of_usb_device -# int number_of_chars_in_whoami_response (optional) -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the Liberty during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the Fastrak -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. - -# ------------------------------------------- -# Example when Liberty Latus is attached via USB -# The BAUD Rate is needed, although it is not used - -#vrpn_Tracker_LibertyHS LibertyHS 3 115200 - -################################################################################ -# InterSense tracker using the Intersense-provided library to communicate -# with the tracker. This device type is not compiled by default, since it uses -# a proprietary library. However, you can get it to compile by defining -# VRPN_INCLUDE_INTERSENSE when compiling. Note that the Fastrak driver will -# run IS-600 and IS-900 trackers without the proprietary library, so you might -# try that as well. -# -# You can include extra initialization code (as described -# below) to set up the ultrasonic pip information, wand devices, stylus devices -# and so forth. Arguments that go on the first line: -# char name_of_this_device[] -# char name_of_serial_device[] - this can be COM1-4 or AUTO -# AUTO will automatically find USB and -# serial trackers. Use COM1-4 only if you -# have more than one serial tracker. -# You should use COM1-4 on unix as well, -# as these just tell the isense library -# to look in serial port 1-4. -# I guess you can't have >1 USB trackers. -# char "IS900time" - use the IS900 timestamps (optional) -# char "ResetAtStartup" - resets all boresight and heading, on intertrax, -# equivalent to push the reset button -# -# It is possible to add additional commands that will be sent to the tracker -# by putting the backslash character (\) at the end of the config line. This -# will cause the following line to be read in and sent to the InterSense during -# the reset routine. You can add additional lines by putting a slash at the -# end of each command line but the last. Each line will be sent to the InterSense -# with a newline at the end of it. If a line starts with an asterisk (*), then -# it is treated as a line telling how long to sleep, with the integer number of -# seconds following the *. -# -# Commands to add Joysticks (2 buttons) or Wands (5 buttons and 2 analogs) to -# the various sensors on the Isense900 are done by adding Stylus and -# Wand command lines after the reset command lines. Each of these lines -# takes two arguments: the name of the button (for Stylus) or button and -# analog (for Wand) servers, and the sensor number (starting from 0). The -# Wand line takes eight additional parameters, which specify the scaling -# and clipping behavior of the two directions on the analog joystick. Each -# set of for is the min, lowzero, hizero, and max values: these are mapped -# to -1, 0,0, and 1 (all values between lowzero and hizero are mapped to 0). -# Start with these at -1,0,0,1 and use the 'printcereal' program or some other -# method to read them and see what the range of acheivable values is. Then, -# set them to slightly conservative values so that the whole range is covered -# and the analogs will report zero when the joystick is centered. The -# presence of these lines is indicated by placing them after any additional -# reset command lines, by ending the line preceding them with the front slash -# "/" character. -# -# Remember that the "remote" button object is not the same as the the tracking -# device, so be sure to use a remote button object that connects to the button -# rather than the tracker. The button device name is defined on the stylus or -# wand line in the config file, and should not be the same as the tracker. In -# the case described by the example configuration below, if the name of the -# machine running the server is "myis900server" you would connect to the tracker -# as "Isense900@myis900server" and to the buttons on the stylus as -# "Stylus0@myis900server": -# -# Note that this frontslash and backslash-notation can only be used for the -# Fastrak and InterSense tracker, not to extend the line for any other -# type of device -# listed in this configuration file. -# -# Note that this driver expects the device to be set to output centimeters, and will convert -# the positions to meters. It is recommanded to permanently set the units in the eeprom of your device. -# If this is not possible, you should add in this file the "u" reset command so as to have vrpn -# tell your device to use centimeters -# -#Vanilla InterSense -#vrpn_Tracker_InterSense Tracker0 AUTO IS900time - -# Vanilla InterSense using IS900 timing, with wand in port B (and possibly head tracker in port A) -#vrpn_Tracker_InterSense Tracker0 AUTO IS900time / -#Wand Wand0 1 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 - -# IS600 and its pip settings -#vrpn_Tracker_InterSense Isense600 COM1 \ -#MCc\ -#*5\ -#MCM1,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,89\ -#MCM1,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,87\ -#MCM2,1,0.0900,0.0000,-0.2210,0.00,0.00,-1.00,66\ -#MCM2,2,-0.0566,0.0000,-0.2210,0.00,0.00,-1.00,71\ -#MCM3,1,0.1237,-0.0762,-0.0424,0.00,0.00,-1.00,82\ -#MCM3,2,0.1237,0.0762,-0.0424,0.00,0.00,-1.00,77\ -#MCe\ -#*10 - -# IS900 with a wand on the first sensor and a stylus on the third: -#vrpn_Tracker_InterSense Isense900 COM1 / -#Wand Wand0 0 -1.0 0.0 0.0 1.0 -1.0 0.0 0.0 1.0 / -#Stylus Stylus0 2 - -# Intertrax2 on USB, With automatic reset at startup -#vrpn_Tracker_InterSense Tracker0 AUTO ResetAtStartup - -################################################################################ -# Dynasight Tracker. Runs an Origin System's DynaSight tracker connected to a -# serial port on this machine. arguments: -# char name_of_this_device[] -# int number_of_sensors -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tracker_Dyna Tracker0 1 /dev/ttyS0 19200 - -#vrpn_Tracker_Dyna Tracker0 1 COM1 19200 - -################################################################################ -# Crossbow Tracker. Runs a Crossbow Technology RGA300-series tracker that is -# attached to a serial port on this machine. There are four arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device (should be 38400) -# float linear_acceleration_sensitivity (Gs; default is 2.0) -# float angular_rate_sensitivity (degrees per second; default is 100) - -#vrpn_Tracker_Crossbow Tracker0 COM1: 38400 2.0 100 - -############################################################################### -# 3d Microscribe is a mechanical tracker the nesseccary params are -# name port baudrate -# additional params are offsetx offsety offsetz scale -# offsets are in meters. Scale is an abomination in VRPN; all -# trackers report in meters. -# - -#vrpn_3DMicroscribe Microscribe COM1 19200 0.3 -0.1 -0.2 1 - -################################################################################ -# Serial 5DT glove with 16 sensors. This driver reports the 16 channels as analog -# devices. If you want to treat them as buttons, then also add the entry -# for the vrpn_Button_5DT_Server below, connecting it to the output of this -# server. -# -# This server does not work with the previous version of the glove. -# For other variations of 5DT datagloves, see vrpn_5dt and vrpn_Analog_5dtUSB -# -# arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_5dt16 glove_5dt16 COM1 19200 - -################################################################################ -# -# Use the 5dtglove16 as button device. Use in conjunction with the vrpn_5dt16 -# device above to turn the analog reports into button press/release when the -# sensors cross the threshold. -# -# arguments: -# char name_of_this_device[] -# char name_of_the_glove device[] -# double threshold_toggle_point_between_pressed_and_unpressed[16] - -#vrpn_Button_5DT_Server glove_5dt_button glove_5dt16 1794 2171 2110 2610 1707 2673 2459 1493 3029 2301 1936 3007 2302 1635 0 0 - -################################################################################ -# AnalogFly Tracker. This is a tracker that is intended to be used on top of -# a joystick or motion tracker of some kind to turn it into a moving or flying -# device. It could be used on top of any analog device, in fact. -# This device basically takes in analog signals and puts out transformation -# matrices. It should supercede the JoyFly tracker, since it is more general. -# There are two kinds of JoyFly's: absolute ones and differential ones. For -# absolute ones, the analog value is mapped directly to position or orientation -# on each axis. For differential ones, the values are used to create a -# "change" matrix that is applied once per interval, accumulating changes as -# it goes; this enables the user to "fly" along by holding a joystick forward, -# for example. -# One analog channel is associated with each axis (X, Y, Z) and rotation about -# each axis (RX, RY, RZ). For each axis, the value is converted to a position -# (meters) or speed (meters/second) for absolute trackers; or into an -# orientation (revolutions) or angular velocity (revolutions/second) by first -# subtracting an offset, then thresholding it to see if it is far enough from -# zero, then (if it is) scaling it and taking it to a power (to allow nonlinear -# speedup as the stick is pushed far from center). -# A button can be associated with a reset function, which will take the -# device back to center (identity transformation). The device will also recenter -# when the first connection is made to the server it is running on. (Centering -# has no effect on absolute AnalogFlys). -# A button can be associated with a clutch function, which will mean that -# the device will not move unless the clutch is pressed, so you can use it -# like a mouse and continue to move by pulling to the right with the button -# down and then to the left with the button up. For differential analogflys, -# clutching makes the tracker not move unless the button is pressed. For -# absolute ones, it only moves when the button is pressed and the mouse is -# moving; it offsets to enable long-range motions in a finite tracking area, -# as with a mouse. -# Any axis or the reset button can be disabled by setting the name of its -# associated device to the string "NULL". -# Note that you could have multiple of these devices running simultaneously, -# each with a different name and interaction metaphor. The user could then -# connect to their favorite one. Arguments: -# char name_of_this_device[] -# float update_rate_to_send_tracker_reports -# char type[] = "absolute" or "differential" -# [six lines follow, one for X Y Z RX RY RZ, each with: -# char axis_name[] (X Y Z RX RY RZ in that order) -# char name_of_analog_device[] (start with * for local) -# int channel_of_analog_device -# float offset -# float threshold -# float scale -# float power -# ] -# [New line to describe reset button, with: -# char "RESET" -# char name_of_button_device[] (start with * for local) -# int which_button_to_use -# ] -# [New line to describe clutch button, with: -# char "CLUTCH" -# char name_of_button_device[] (start with * for local) -# int which_button_to_use -# ] -# [New line to indicate use of world frame for translation and rotation, -# instead of local frame. Useful for a simulated wand when doing desktop -# testing of immersive apps - easier to keep under control. -# char "WORLDFRAME" -# ] - -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Mouse0 0 0.5 0.0 2.0 1.0 -#Y *Mouse0 1 0.5 0.0 2.0 1.0 -#Z NULL 2 0.0 0.0 1.0 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ NULL 5 0.0 0.0 1.0 1.0 -#RESET NULL 0 -#CLUTCH *Mouse0 0 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *CerealBox0 4 0.0 0.021 1.0 1.0 -#Y *CerealBox0 5 0.0 0.021 1.0 1.0 -#Z *CerealBox0 6 0.0 0.021 3.0 1.0 -#RX *CerealBox0 0 0.0 0.021 1.0 1.0 -#RY *CerealBox0 1 0.0 0.021 1.0 1.0 -#RZ *CerealBox0 2 0.0 0.021 3.0 1.0 -#RESET *CerealBox 3 -#CLUTCH NULL 0 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 differential -#X *Magellan0 0 0.0 0.0 2.0 1.0 -#Y *Magellan0 1 0.0 0.0 2.0 1.0 -#Z *Magellan0 2 0.0 0.0 2.0 1.0 -#RX *Magellan0 3 0.0 0.0 2.0 1.0 -#RY *Magellan0 4 0.0 0.0 2.0 1.0 -#RZ *Magellan0 5 0.0 0.0 2.0 1.0 -#RESET NULL 0 -#CLUTCH NULL 0 - -# For a good simulated wand for testing VR Juggler applications with a SpaceMouse: -#vrpn_Tracker_AnalogFly Tracker0 60.0 differential -#X *Magellan0 0 0.0 0.0 20.0 1 -#Y *Magellan0 1 0.0 0.0 20.0 1 -#Z *Magellan0 2 0.0 0.0 20.0 1 -#RX *Magellan0 3 0.0 0.01 -5 1.0 -#RY *Magellan0 4 0.0 0.01 -5 1.0 -#RZ *Magellan0 5 0.0 0.01 -5 1.0 -#RESET NULL 0 -#CLUTCH NULL 0 -#WORLDFRAME - -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X NULL 0 0.0 0.0 1.0 1.0 -#Y NULL 0 0.0 0.0 1.0 1.0 -#Z NULL 0 0.0 0.0 1.0 1.0 -#RX *Radamec0 1 0.0 0.0 -0.0027777777 1.0 -#RY NULL 0 0.0 0.0 1.0 1.0 -#RZ *Radamec0 0 0.0 0.0 0.0027777777 1.0 -#RESET NULL 0 -#CLUTCH NULL 0 - -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Joystick0 0 0.0 0.0 1.0 1.0 -#Y *Joystick0 1 0.0 0.0 -1.0 1.0 -#Z *Joystick0 6 0.0 0.0 1.0 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Joystick0 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 -#CLUTCH NULL 0 - -# Using a joystick to emulate a Phantom for the -# nanoManipulator, the throttle maps to Z. -#vrpn_Tracker_AnalogFly Phantom 60.0 absolute -#X *Phantom 0 0.0 0.0 0.125 1.0 -#Y *Phantom 1 0.0 0.0 -0.125 1.0 -#Z *Phantom 6 0.0 0.0 0.25 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Phantom 5 0.0 0.0 0.06 1.0 -#RESET NULL 0 -#CLUTCH NULL 0 - -# For DTU/MIC optical nanoHand stage motion, moving over full 300 micron range -# of motion, using the Logitech joystick for the analog -# server and the tracker_to_poser program. -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Joystick0 0 -0.03 0.0 2.53 1.0 -#Y *Joystick0 1 -0.04 0.0 2.53 1.0 -#Z *Joystick0 6 -0.10 0.0 -1.75 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Joystick0 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 -#CLUTCH NULL 0 - -# To drive a Tektronix 4662 full range (Z, RZ ignored) -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Joystick0 0 -1.0 0.0 0.19 1.0 -#Y *Joystick0 1 1.0 0.0 -0.13 1.0 -#Z *Joystick0 6 0.0 0.0 1.0 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Joystick0 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 -#CLUTCH NULL 0 - -# For UNC Mad City Labs stage motion, moving over full 100 micron range -# of motion, using the Microsoft FF joystick for the analog -# server and the tracker_to_poser program. -#vrpn_Tracker_AnalogFly Tracker0 60.0 absolute -#X *Joystick0 0 -1 0.0 50 1.0 -#Y *Joystick0 1 -1 0.0 50 1.0 -#Z *Joystick0 6 -1 0.0 50 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ *Joystick0 5 0.0 0.0 0.5 1.0 -#RESET NULL 0 -#CLUTCH NULL 0 - -# For Artemis or Hercules (mad-city-labs) stages -# Maps 0-10 from the voltage into the range 0-100 microns. -#vrpn_Tracker_AnalogFly StageTracker 60.0 absolute -#X *MCLXYZIN 4 0 0.0 10 1.0 -#Y *MCLXYZIN 5 0 0.0 10 1.0 -#Z *MCLXYZIN 6 0 0.0 10 1.0 -#RX NULL 3 0.0 0.0 1.0 1.0 -#RY NULL 4 0.0 0.0 1.0 1.0 -#RZ NULL 5 0.0 0.0 1.0 1.0 -#RESET NULL 0 -#CLUTCH NULL 0 - -################################################################################ -# XXX This device is superceded by the more-general vrpn_Tracker_AnalogFly. -# JoyFly Tracker. A vrpn_Tracker that translates the vrpn_Joystick into -# Walkthrough- convention tracker reports. This is part of a two-part setup -# that allows you to use a joystick as a flying device. First, a joystick -# device has to be created (named joybox in our example) that will produce -# the analog inputs that the JoyFly tracker uses to determine the transformation. -# Then, the JoyFly device needs to be started and will listen to the device -# and produce tracker reports. If these are both run on the same server, then -# the JoyFly needs to use the "server" connection to hear from the Joystick -# device, which is indicated by placing a '*' in front of the name of the -# joystick device that it is to use. If the joystick device is remote from -# this server, then the full name of it should be used (joystick@foo.cs.unc.edu). -# XXX This device is superceded by the more-general vrpn_Tracker_AnalogFly -# Arguments: -# char name_of_this_device[] -# char source_joystick_name[] (Start with * for one sharing a connection) -# char joystick_configuration_file_name[] - -#vrpn_JoyFly walk-joybox *joybox vrpn_Joyfly.cfg - -################################################################################ -# ButtonFly Tracker. This is a tracker that is intended to be used on top of -# a Global Haptics Orb or other buttond device to turn it into a moving or -# flying device. It basically takes in button signals and puts out -# transformation matrices. -# There are two kinds of Buttons: absolute ones and differential ones. For -# absolute ones, pressing it causes the position or orientation associated with -# it to be stored directly into the transformation. This enables the user to -# "teleport" to given locations by pressing buttons. For differential ones, -# the position or orientation are treated as deltas and are used to create a -# "change" matrix that is applied once per interval, accumulating changes as -# it goes; this enables the user to "fly" along by holding a button down, -# for example. -# Each button is associated with either a position (meters) or speed -# (meters/second) for absolute buttons; or an orientation (revolutions) -# or angular velocity (revolutions/second). -# An analog channel can be associated with a scale function that scales the -# velocity or angular velocity terms uniformly. The entry specifies an -# offset to be applied to the analog channel, a scale to be applied to it, -# and a power to which the result should be taken; the end result is used -# to scale all velocity or angular velocity terms. This channel has no -# effect on the effects of absolute buttons. -# The device will recenter (set itself to the identity transform) when the -# first connection is made to the server it is running on. -# Note that you could have multiple of these devices running simultaneously, -# each with a different name and interaction metaphor. The user could then -# connect to their favorite one. Arguments: -# char name_of_this_device[] -# float update_rate_to_send_tracker_reports -# [one or more lines follow, each of one of two types -# (1) char [] = "absolute" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float X_to_translate_to -# float Y_to_translate_to -# float Z_to_translate_to -# float rotation_about_X -# float rotation_about_Y -# float rotation_about_Z -# (2) char [] = "differential" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float X_translation_meters_per_second -# float Y_translation_meters_per_second -# float Z_translation_meters_per_second -# float spin_about_X_revolutions_per_second -# float spin_about_Y_revolutions_per_second -# float spin_about_Z_revolutions_per_second -# ] -# [An optional line describing an analog to scale the velocity -# char [] = "vel_scale" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float offset -# float scale -# float power -# ] -# [An optional line describing an analog to scale the rotation -# char [] = "rot_scale" -# char name_of_button_device[] (start with * for local) -# int which_button_on_device -# float offset -# float scale -# float power -# ] -# [one more line, consisting of the word "end"] -# Note that the same button can cause more than one action to take place, -# and the same analog can cause scaling of both the velocity and rotation. - -# This example for a Global Haptics Orb pushes the transformation away -# from the button that is pressed -# for all of the standard buttons. It rotates around the Y axis when the -# rocker switch is rocked up and down. It resets to the origin when one -# of the pushbuttons is pressed. Both the velocity and angular velocity -# are controlled by the thumbwheel. - -#vrpn_Tracker_ButtonFly Tracker0 60.0 -#differential *Orb0 0 0 1 0 0 0 0 -#differential *Orb0 1 0.707 0.707 0 0 0 0 -#differential *Orb0 2 1 0 0 0 0 0 -#differential *Orb0 3 0.707 -0.707 0 0 0 0 -#differential *Orb0 4 0 -1 0 0 0 0 -#differential *Orb0 5 -0.707 -0.707 0 0 0 0 -#differential *Orb0 6 -1 0 0 0 0 0 -#differential *Orb0 7 -0.707 0.707 0 0 0 0 -#differential *Orb0 8 0 0.707 -0.707 0 0 0 -#differential *Orb0 9 0.577 0.577 -0.577 0 0 0 -#differential *Orb0 10 0.707 0 -0.707 0 0 0 -#differential *Orb0 11 0.577 -0.577 -0.577 0 0 0 -#differential *Orb0 12 0 -0.707 -0.707 0 0 0 -#differential *Orb0 13 -0.577 -0.577 -0.577 0 0 0 -#differential *Orb0 14 -0.707 0 -0.707 0 0 0 -#differential *Orb0 15 -0.577 0.577 -0.577 0 0 0 -#differential *Orb0 16 0 0.707 0.707 0 0 0 -#differential *Orb0 17 0.577 0.577 0.577 0 0 0 -#differential *Orb0 18 0.707 0 0.707 0 0 0 -#differential *Orb0 19 0.577 -0.577 0.577 0 0 0 -#differential *Orb0 20 0 -0.707 0.707 0 0 0 -#differential *Orb0 21 -0.577 -0.577 0.577 0 0 0 -#differential *Orb0 22 -0.707 0 0.707 0 0 0 -#differential *Orb0 23 -0.577 0.577 0.577 0 0 0 -#differential *Orb0 24 0 0 -1 0 0 0 -#differential *Orb0 25 0 0 1 0 0 0 -#differential *Orb0 28 0 0 0 0 -0.1 0 -#differential *Orb0 29 0 0 0 0 0.1 0 -#absolute *Orb0 27 0 0 0 0 0 0 -#vel_scale *Orb0 0 -1.0 0.5 1.0 -#rot_scale *Orb0 0 -1.0 0.5 1.0 -#end - -################################################################################ -# 3Space Tracker. Runs a Polhemus 3Space (not Fastrak) tracker that is attached -# to a serial port on this machine. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tracker_3Space Tracker0 /dev/ttyS0 19200 - -################################################################################ -# Logitech 3DMouse tracker attached to a serial port on this machine. -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int filtering_count (this parameter is optional) - -#vrpn_Tracker_3DMouse Tracker0 /dev/ttyS0 19200 - -################################################################################ -# NDI Polaris Spectra or Vectra, attached to a serial or USB port -# This server works with the NDI Polaris Spectra and Polaris Vectra -# trackers. It doesn't work with the Optitrak or Aurora. It only -# handles rigid bodies made from passive sphere markers, and does -# not yet support active led markers nor single "stray" passive -# spheres. -# -# Each vrpn "sensor" is a single rigid body (or "tool" in NDI -# terminology), which consists of 3 or more passive spheres in a -# particular geometric arrangement. In order to define a custom -# rigid body (one that didn't come from NDI), you must use the NDI -# Architect software. That software produces .rom files for each -# rigid body. This vrpn tracker class will load those files during -# initialization. -# -# Before configuring the vrpn server here, you should first run -# the NDI software to track the rigid bodies using the NDI's -# interactive GUI. Only after you have configured and tested the -# tracker and rigid bodies to your satisfaction, should you try -# this vrpn server. -# -# This currently only handles an IR strobe rate of 60Hz, not -# 20Hz or 30Hz. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int number of sensors (i.e. num of rigid bodies) -# -# char rigidBody 0's .rom filename -# char rigidBody 1's .rom filename -# char rigidBody 2's ... - -# vrpn_Tracker_NDI_Polaris Tracker0 COM1 2 -# hello.rom -# ../world.rom - -################################################################################ -# CerealBox dial/button/analog. Runs a BG Systems CerealBox device that attaches -# to a serial port on this machine. As of VRPN version 04.07, 19200 is the -# only supported baud rate. The driver has been tested on an LV824-F-8e device. -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int number_of_buttons_to_read (starting from 0) -# int number_of_analogs_to_read -# int number_of_encoders_to_read - -#vrpn_CerealBox Cereal0 /dev/cua0 19200 8 8 8 - -################################################################################ -# Magellan button/analog. Runs a Logitech Magellan device that attaches -# to a serial port on this machine. As of VRPN version 04.12, 9600 is the -# only supported baud rate. -# -# The Magellan is also known in some instances as the Magellan SpaceMouse, -# not to be confused with the 3DConnexion SpaceMouse (later version of the -# same product). -# 3DConnexion Magellan/SpaceMouse Plus XT Serial - -# works with vrpn_Magellan without "altreset" for some. -# requires "altreset" to avoid lots of beeping at startup for others. -# -# Note that if you want to use the Magellan as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device that listens to its analog -# outputs and converts them into tracker reports -# -# John Stone added support for the SpaceBalls in version 06.03, an example -# startup is shown below. -# -# Julien Brisset discovered how to make this work with a slightly older version -# of the Magellan. If the example Magellan line doesn't work, add 'altreset' to -# the line to use the alternative reset string for the device. -# -# If your Magellan is connected through a usb-serial cable on Mac OS X, use -# /dev/tty.usbserial, on Linux you may want to try /dev/ttyUSB0 instead. -# -# NOTE: You should NOT run the driver that comes with the Magellan, since the -# VRPN driver opens the serial port and communicates with the device directly. -# If the Magellan driver from the manufacturer is running, then VRPN may not -# be able to open the port. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# char "altreset" {Optional, for older Magellans} - -#vrpn_Magellan Magellan0 COM1 9600 -#vrpn_Magellan Magellan0 /dev/ttyS0 9600 altreset -#vrpn_Spaceball Spaceball0 /dev/ttyS0 9600 -#vrpn_Magellan Magellan0 /dev/tty.usbserial 9600 altreset - -################################################################################ -# NRL Immersion Box dial/button/analog. Runs a Immersion Interface Box device -# attached to a serial port. As of March 28, 2000 code to read the analog and -# angle encoders has not been implemented. Also, baud rate on many SGI's is -# limited to 38400, but I have run the ibox at 115200 on PCs. -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int number_of_buttons_to_read (i.e. 4 ==> 0,1,2,3) -# int number_of_analogs_to_read -# int number_of_encoders_to_read - -#vrpn_ImmersionBox ibox /dev/ttyd2 38400 4 0 0 -#vrpn_ImmersionBox ibox com1 115200 4 0 0 - -################################################################################ -# Wands button/analog, driver from Brown University. Runs a Wanda device -# attached to a serial port. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port_to_use[] -# int baud_rate_of_serial_device -# float minimum_update_rate - -#vrpn_Wanda Wanda /dev/ttyd2 1200 60.0 -#vrpn_Wanda Wanda COM2 1200 60.0 - -################################################################################ -# Radamec Serial Position Interface analog. Camera tracker that attaches -# to a serial port on this machine. Note that for normal operation, 38400 is the -# only supported baud rate. -# -# Note that if you want to use the Radamec SPI as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device (of the absolute variety) -# that listens to its analog outputs and converts them into tracker reports. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port[] -# int baud_rate_of_serial_port - -#vrpn_Radamec_SPI Analog0 /dev/ttyS16 38400 - -################################################################################ -# Zaber linear positioning element analog/out that attaches -# to a serial port on this machine. -# -# Note that if you want to use the Zaber as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device (of the absolute variety) -# that listens to its analog outputs and converts them into tracker reports. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port[] - -#vrpn_Zaber Analog0 COM1 - -################################################################################ -# Biosciences Tools temperature control unit, analog/out that attaches -# to a serial port on this machine. -# -# This instrument also has a button device that reports whether the -# temperature control is turned on. -# -# Analog channels: (read by client) -# 0 Reading from stage 1 in degrees Celcius -# 1 Reading from bath 1 in degrees Celcius -# 2 Reading external 1 or Setpoint for control in degrees Celcius -# 3 Reading from stage 2 in degrees Celcius -# 4 Reading from bath 2 in degrees Celcius -# 5 Reading external 2 or Setpoint for control in degrees Celcius -# Button channels: (read by client) -# 0 Temperature control is on or off -# Analog_Output channels: (set by client) -# 0 Reference temperature for channel 1 -# 1 Reference temperature for channel 2 -# 2 Turn temperature control on/off (0 = off, otherwise on) -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port[] -# float Temperature to set for channel 1 in degrees Celcius -# float Temperature to set for channel 2 in degrees Celcius -# int Do we turn on temperature control (0 = no, 1 = yes) - -#vrpn_BiosciencesTools Analog0 COM1 37.0 37.0 0 - -################################################################################ -# Omega temperature control unit, analog/out that attaches -# to a serial port on this machine. -# -# This instrument also has a button device that reports whether the -# temperature control is turned on. -# -# XXX Figure out the settings once the code has been finished. - -#vrpn_OmegaTemerature Analog0 COM1 XXX - -################################################################################ -# IDEA-drive linear positioning element analog that attaches -# to a serial port on this machine. -# -# Note that if you want to use the IDEA as a tracking device, you will -# need to run a vrpn_Tracker_AnalogFly device (of the absolute variety) -# that listens to its analog outputs and converts them into tracker reports. -# -# If the drive does not have a limit switch to calibrate against and you need to -# drive it to one rail to find a zero location, use a nonzero initial_move -# value to cause a move. To keep it from getting stuck against that limit, -# change the fractional_c_a value to be less than one -- this will lower -# both the current and the acceleration/deceleration by this fraction for -# this initial move. The location of the device is reset to 0 after the -# move is done. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_port[] -# int run_speed_tics_sec -# int start_speed_tics_sec -# int end_speed_tics_sec -# int accel_rate_tics_sec_sec -# int decel_rate_tics_sec_sec -# int run_current -# int hold_current -# int accel_current -# int decel_current -# int delay -# int step -# int high_limit_index (-1 for none) -# int low_limit_index (-1 for none) -# int output_1_value (0 for off, 1 for on, -1 for don't change) -# int output_2_value (0 for off, 1 for on, -1 for don't change) -# int output_3_value (0 for off, 1 for on, -1 for don't change) -# int output_4_value (0 for off, 1 for on, -1 for don't change) -# double initial_move (0 for no move) -# double fractional_c_a (Fraction of full current and acceleration) -# double reset_location (Where to set location on reset in full ticks) - -#vrpn_IDEA Analog0 COM1 3200 1200 2000 40000 100000 290 0 290 290 50 8 1 -1 0 0 0 0 0 1.0 -60.0 -#vrpn_IDEA Analog1 COM2 3200 1200 2000 40000 100000 290 0 290 290 50 8 1 -1 0 0 0 0 0 1.0 -60.0 -#vrpn_IDEA Analog2 COM3 3200 1200 2000 40000 100000 290 0 290 290 50 8 1 -1 0 0 0 0 0 1.0 -60.0 -#vrpn_IDEA Analog0 /dev/ttyUSB1 3200 1200 2000 40000 100000 290 0 290 290 50 8 -1 -1 0 0 0 0 10000 0.2 -60.0 -#vrpn_IDEA Analog1 /dev/ttyUSB2 3200 1200 2000 40000 100000 290 0 290 290 50 8 -1 -1 0 0 0 0 10000 0.2 -60.0 -#vrpn_IDEA Analog2 /dev/ttyUSB3 3200 1200 2000 40000 100000 290 0 290 290 50 8 -1 -1 0 0 0 0 10000 0.2 -60.0 - -################################################################################ -# SGI Dial and Button box, raw interface. Runs a dial-and-button box from SGI, -# talking to it through the raw serial interface (not using the GL interface -# supplied by SGI). This allows the box to be opened even if there is nobody -# logged on at the console. Note that to use this on an SGI, you will need to -# configure the port as a serial device, not as a button device, to get it to -# run. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# [list of buttons to treat as toggles] int button_to_toggle - -#vrpn_raw_SGIBox Sgibox0 /dev/ttyS0 0 1 2 3 - -################################################################################ -# SGI Dial and Button box, cooked interface. Runs a dial-and-button box from SGI, -# talking to it through the GL interface supplied by SGI. Note that this can -# only be used on an SGI, and the serial port must be configured as a dial/button -# device and the dial/button server from SGI must be running to use it. Arguments: -# char name_of_this_device[] -# [list of buttons to treat as toggles] int button_to_toggle - -#vrpn_SGIBOX Sgibox0 1 2 - -################################################################################ -# UNC Python button device. UNC has developed a custom button input device, which -# is a 5-button controller that attaches to a parallel port and uses the sense -# lines to return the state of the buttons. This runs the device. Note that on -# Windows NT, you need to have installed the GiveIO driver for this code to -# work. It also works on Linux (no extra drivers needed), but on no other -# architecture. Arguments: -# char name_of_this_device[] -# int parallel_port_to_use_starting_with_1 -# int hexadecimal_io_base_number (default address used if left off) - -#vrpn_Button_Python Button0 1 - -################################################################################ -# UNC Joystick driver. UNC has developed a custom-build joybox, with 7 analog -# and 2 button inputs (two 3-axis joysticks and a slider, with a button on top -# of each joystick). This will drive one of these devices, which attaches to -# a serial port on this computer. I'm not sure what the baud rate should be; -# David Harrison might know. -# This driver can be used in conjunction with the JoyFly driver to produce a -# tracker that uses the joystick to fly around. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# float minimum_update_rate_from_analogs_even_if_they_dont_move - -#vrpn_Joystick Joybox0 /dev/ttyd1 19200 10.0 - -################################################################################ -# Linux Joystick. Interface to the Linux Joystick driver by Vojtech Pavlik -# included in several Linux distributions. The server code has been tested -# with Linux Joystick driver version 1.2.14. Yet, there is no way how to -# map a typical joystick's zillion buttons and axes on few buttons and axes -# really used. Unfortunately, even joysticks of the same kind can have -# different button mappings from one to another. -# Arguments: -# char name_of_this_device[] -# char name_of_joystick_device[] - -#vrpn_Joylin Joylin0 /dev/input/js0 - -################################################################################ -# Fakespace Pinch Glove. Drives a Fakespace Pinch Glove device connected to a -# serial port on this machine. This device has ten buttons-two hands and five -# fingers on each hand. Buttons 0-4 are fingers for the right hand-thumb first -# and pinkie last- while buttons 5-9 are for the left hand-thumb first. The -# Button is ON when it is touching another finger. Therefore there cannot -# be just one Button ON. Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Button_PinchGlove PinchGlove0 COM1 9600 - -################################################################################ -# Adrienne Electronics Corporation PCI time code driver. The PCI-VITC board -# for which this driver was developed reads in VITC time codes from an input -# signal. This will drive one of these devices. -# Arguments: -# char name_of_this_device[] - -#vrpn_TimeCode_Generator TimeGen0 - -################################################################################ -# 5DT glove (5 sensors plus optional tilt sensors). -# Drive a 5dt glove connected on a serial Port. This device uses -# optical fiber to get the finger position. -# -# See also vrpn_5DT16 (16-sensor serial) and vrpn_Analog_5dtUSB (5 or 14-sensor -# "Ultra" USB/wireless) -# -# 2 modes are driven: the first one let the driver get data from the glove -# when requested (we advise this mode). The second one makes the glove send -# data continuously. This mode may saturate the input buffer. -# -# The manual states that there will be 9 bytes per report, but one group -# has found that they get an extra one: 0x55 at the end of each report. -# So, you can choose whether to use 9 (the default) or 10 now. -# Gesture management is not implemented yet nor the mouse emulation mode -# -# The standard baud rate for the "wired" glove is 19200. For a "wireless" -# glove (which is send-only), even if directly connected, use baud rate -# 9600. The driver detects this and will adjust its behavior accordingly -# (forcing on continuous mode and 10-bytes-per-report, ignoring the settings -# you specify here). If you aren't sure what kind of glove you have, use the -# Glove Manager app in -# "5DT Data Glove Series: Full Package for Windows 95/98/NT/2000" downloaded from -# http://5dt.com/downloads.html and try to connect, it will tell you. -# Their Glove Manager worked for me on Linux 64-bit with WINE, and is probably the -# easiest way to find out this info if you don't know it. (Or, just try 9600 if -# 19200 doesn't work.) -# -# Reports the digit bend values in order, channels 1-5, in the range 0.0-1.0, -# and the tilt sensors in channels 6 and 7 in the range 0 to 180, if available -# -# arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device -# int mode_of_data_reporting (1 = on request, 2 = continuously) -# int ten_bytes_per_report (0 = no, use 9; 1 = yes) - -#vrpn_5dt glove_5dt /dev/ttyS0 19200 1 0 -#vrpn_5dt glove_5dt COM1 19200 1 0 -#vrpn_5dt glove_5dt_wireless /dev/ttyS1 9600 2 1 - -################################################################################ -# NRL Serial Mouse. A device made by wiring buttons in parallel with the buttons -# on a serial mouse. Both mousesystems or microsoft mouse protocols are -# supported. Note that the server code makes the connection at the standard -# 1200 baud. The mouse can be plugged into any serial port -- this driver goes -# directly through the raw port and does not use the built-in mouse drivers. -# NOTE: The middle button on the 3button type is toggled by moving the mouse -# on a surface while not toggling the other two buttons, strange as this may -# seem. The motion of the mouse is not reported, only the buttons. - -#vrpn_Button_SerialMouse Button0 /dev/ttyd1 mousesystems -#vrpn_Button_SerialMouse Button0 COM1 mousesystems -#vrpn_Button_SerialMouse Button0 COM1 3button -# For a Linux box with a mouse on port 0 -#vrpn_Button_SerialMouse Button0 /dev/ttyS0 3button -# For a mac with a Keyspan 4-port serial-to-USB converter -#vrpn_Button_SerialMouse Button0 /dev/tty.USA49W3b12P1.1 3button - -################################################################################ -# NRL TNG3. (Totally Neat Gadget) A device made by mindtel, available from -# pulsar.org. Powered off the serial port control lines, the TNG3 has 8 digital -# and 8 analog inputs. Analog resolution is 8 bits. Baud rate fixed internally -# at 19200. -# char name_of_this_device[] -# char name_of_serial_device[] -# int number_of_buttons_to_read (i.e. 8 ==> 0,1,2,3,4,5,6,7) -# int number_of_analogs_to_read - -#vrpn_Tng3 tng3name /dev/ttyd2 4 0 -#vrpn_Tng3 tng3name com1 8 8 -#vrpn_Tng3 tng3name com1 1 1 - -################################################################################ -# Microsoft DirectX compatible force-feedback joystick (or non-force-feedback -# joystick). -# char name_of_this_device[] -# int number of times per second to read from the device -# int number of times per second to update force (0 for non-force device) - -#vrpn_DirectXFFJoystick Joystick0 60 200 -#vrpn_DirectXFFJoystick Joystick0 60 0 - - -################################################################################ -# Microsoft DirectX compatible rumble-pad (e.g. Wingman) -# char name_of_this_device[] - -#vrpn_DirectXRumblePad RumblePad0 - -################################################################################ -# Microsoft XInput compatible controller (e.g. Xbox 360 gamepad) -# char name_of_this_device[] -# int userIndex (0 for "Player 1", 1 for "Player 2", etc.) - -#vrpn_XInputGamepad XInput0 0 - - -################################################################################ -# Manager for joysticks under windows using standard win32 calls. -# for force feedback support, see DirectX joystick above -# -# Arguments: -# char name_of_this_device[] -# int joystick Id -# (1 for first joystick JOYSTICKID1 or 2 for second JOYSTICKID2 only) -# int number of times per second to read from the device -# int readmode : 0 = raw data; -# 1 = 0,1 normalized data; -# 2=-1,1 normalized data -# int percentage (0 to 100) of deadzone (used mode 1 and 2 only) - -#vrpn_Joywin32 joyWin32 1 60 2 35 - -################################################################################ -# Global Haptics GeoOrb serial-line device that contains a number of buttons, -# a thumbwheel, and a trackball. For current devices, only 19200 baud works. -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_GlobalHapticsOrb Orb0 COM1 19200 - -################################################################################ -# SensAble Technologies Phantom force-feedback device opened using the -# GHOST software developer's kit. For Phantom Desktop systems, you don't -# need to have the user establish the reset position. For the Premium models, -# you do. -# Arguments: -# char name_of_this_device[] -# int establish_reset_position (0 or 1) -# float rate_to_send_tracker_reports -# char Name of the Phantom in the configuration control panel - -#vrpn_Phantom Phantom 0 60.0 Default PHANToM - -############################################################################## -# Virtual Presence Joystick tracker device. (http://www.vrweb.com) -# Use this driver to read the button states, -# use Flock-of-Birds driver for the position/orientation state -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_VPJoystick VPJoystick0 /dev/ttyS0 9600 - -################################################################################ -# Advanced Realtime Tracking GmbH (http://www.ar-tracking.de) DTrack client -# -# creates as many vrpn_Tracker as there are bodies or Flysticks, starting with the bodies -# creates 2 analogs per Flystick -# creates 8 buttons per Flystick -# -# NOTE: when using DTrack's older output format for Flystick data ('6df'), the numbering -# of Flystick buttons differs from DTrack documentation (for compatibility with -# older vrpn releases) -# -# Arguments: -# char name_of_this_device[] -# int udp_port (DTrack sends data to this UDP port) -# -# Optional arguments: -# float time_to_reach_joy (in seconds; see below) -# int number_of_bodies, number_of_flysticks (fixed numbers of bodies and Flysticks) -# int renumbered_ids[] (vrpn_Tracker IDs of bodies and Flysticks) -# char "3d" (activates 3dof marker output if available; -# always last argument if "-" is not present) -# char "-" (activates tracing; always last argument) -# -# NOTE: time_to_reach_joy is the time needed to reach the maximum value (1.0 or -1.0) of the -# joystick of older 'Flystick' devices when the corresponding button is pressed -# (one of the last buttons amongst the 8); not necessary for newer 'Flystick2' devices -# with its analog joystick -# -# NOTE: if fixed numbers of bodies and Flysticks should be used, both arguments -# number_of_bodies and number_of_flysticks have to be set -# -# NOTE: renumbering of tracker IDs is only possible, if fixed numbers of bodies and -# Flysticks are set; there has to be an argument present for each body/Flystick - -#vrpn_Tracker_DTrack DTrack 5000 -#vrpn_Tracker_DTrack DTrack 5000 - -#vrpn_Tracker_DTrack DTrack 5000 3d -#vrpn_Tracker_DTrack DTrack 5000 3d - -#vrpn_Tracker_DTrack DTrack 5000 0.5 -#vrpn_Tracker_DTrack DTrack 5000 0.5 2 2 -#vrpn_Tracker_DTrack DTrack 5000 0.5 2 2 2 1 0 3 -#vrpn_Tracker_DTrack DTrack 5000 0.5 2 2 2 1 0 3 3d - - -################################################################################ -# National Instruments Analog Output server. This will open the board whose -# name is specified, configure the number of channels specified, and set the -# polarity and maximum voltage range at which to drive the channels. -# -# XXX This server is deprecated, please use the vrpn_National_Instruments -# server listed below. -# -# Arguments: -# char vrpn_name_for_this_device[] -# char name_of_NI_board[] -# int number_of_channels -# int polarity : 0 = unipolar, 1 = bipolar -# float min_voltage -# float max_voltage - -#vrpn_NI_Analog_Output Analog_XY DAQCard-6036E 2 0 -10.0 10.0 -#vrpn_NI_Analog_Output Analog_ZTweeze DAQCard-6036E 2 0 -10.0 10.0 -#vrpn_NI_Analog_Output Analog_XYZ PCI-6733 3 0 -10.0 10.0 - -################################################################################ -# National Instruments A/D, D/A Analog and Analog Output server. This will open -# the board whose name is specified, configure the number of channels specified, -# and set the polarity and maximum voltage range at which to read and -# drive the channels. -## -# Arguments: -# char vrpn_name_for_this_device[] -# char name_of_NationalInstruments_board[] -# int number_of_input_channels (can be zero) -# float mininum_delay_between_Analog_Reports (zero for fastest) -# int input_polarity : 0 = unipolar, 1 = bipolar -# int input_mode : 0 = differential, 1 = ref single-end, 2 = non-ref SE -# int input_range : 5 = 5v, 10 = 10v, 20 = 20v -# int input_drive_ais : 0 = no, 1 = yes -# int input_gain -# int number_of_output_channels (can be zero) -# int output_polarity : 0 = unipolar, 1 = bipolar -# float min_out_voltage (used to guard against overdriving devices) -# float max_out_voltage (used to guard against overdriving devices) - -# Input example -#vrpn_National_Instruments MCLXYZIN PCI-6052E 7 0 0 0 10 0 1 0 0 -10.0 10.0 -# Output examples -#vrpn_National_Instruments MCLXYZOUT PCI-6733 0 0 0 0 10 0 1 3 0 0.0 10.0 -#vrpn_National_Instruments Analog_XY DAQCard-6036E 0 0 0 0 10 0 1 2 1 -10.0 10.0 - -################################################################################ -# Analog Poser. This is a poser that is intended to be used on top of -# an analog output (perhaps a National Instruments board), whose outputs -# directly drive the position of some actuated stage. It could be used on top -# of any analog output device, in fact. This device basically takes in poses -# and puts out analog outputs. -# One analog channel is associated with each axis (X, Y, Z) and rotation about -# each axis (RX, RY, RZ). For each axis, the position (meters) is converted into -# a voltage; the orientation is mapped from a quaternion into Euler angles and -# each of the Euler angles is converted into a voltage (XXX Orientation is not yet -# implemented; the RX,RY, and RZ values must be specified but they are not used). -# XXX Velocity and orientation velocity are not yet supported. -# Any axis can be disabled by setting the name of its associated device to the -# string "NULL". -# -# Arguments: -# char vrpn_name_for_this_device[] -# int send_tracker_reports -# [six lines follow, one for X Y Z RX RY RZ, each with: -# char axis_name[] (X Y Z RX RY RZ in that order) -# char vrpn_name_of_the_analog_output_to_use[] -# (Preface with a * if it uses the same connection) -# int channel_of_analog_output_device (First channel is channel 0) -# float offset -# float scale -# float min_value of workspace -# float max_value of workspace -# ] - -#vrpn_Poser_Analog Poser0 1 -#X *Analog_XY 0 0.0 1.0 -10 10 -#Y *Analog_XY 1 0.0 1.0 -10 10 -#Z *Analog_ZTweeze 0 0.0 1.0 -10 10 -#RX NULL 0 0.0 1.0 -10 10 -#RY NULL 0 0.0 1.0 -10 10 -#RZ NULL 0 0.0 1.0 -10 10 - -# Poser to drive Mad City Labs stage from an input value of -# 0 to 100 microns to an output (through a National Instruments -# D/A card) of 0-10 volts. -#vrpn_Poser_Analog Poser0 1 -#X *MCLXYZOUT 0 0.0 0.1 0 100 -#Y *MCLXYZOUT 1 0.0 0.1 0 100 -#Z *MCLXYZOUT 2 0.0 0.1 0 100 -#RX NULL 0 0.0 1.0 -10 10 -#RY NULL 0 0.0 1.0 -10 10 -#RZ NULL 0 0.0 1.0 -10 10 - -################################################################################ -# Nikon microscope connected to PC via serial port. Currently only controls -# the focus of the microscope using an analogout and reads the focus position -# using an analog. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] - -#vrpn_nikon_controls nikon COM1 - -################################################################################ -# Tektronix 4662 plotter. Attaches to a serial port. Acts as both a poser and -# a tracker. Reports positions 4x per second plus when a move command completes. -# Multiple move commands issued before they complete will result in only the last -# one being executed. -# -# Arguments: -# char name_of_this_device[] -# char name_of_serial_device[] -# int baud_rate_of_serial_device - -#vrpn_Tek4662 Tek4662 COM1 1200 - -############################################################################### -# keyboard and mouse button is a tracker with button system -# XXX These have been removed and replaced with vrpn_Mouse -# and vrpn_Keyboard. Use the clutch option on vrpn_AnalogFly to -# replicate the mouse behavior. The vrpn_Keyboard does not -# enable key mapping, just sends all of the keys' scancodes -# through. - -################################################################################ -# US Digital A2 Absolute Encoder Analog Input server. This will open the COM -# port specified, configure the number of channels specified, and report -# Absolute Encoder values in tenths of a degree from 0 to 3599. -# -# Arguments: -# char name_of_this_device[] -# int COM_port. If 0, search for correct COM port. -# int number_of_channels -# int 0 to report always, 1 to report on change only (optional, default=0) - -#vrpn_Analog_USDigital_A2 Analog0 1 2 - -################################################################################ -# This is a driver for National Instruments DAQCard- -# DIO-24, a PCMCIA card, which provides 24-bit digital I/O. -# -# Arguments: -# char name_of_this_device[] -# int number_of_channls to read: 1-24 (optional. default=24). - -#vrpn_Button_NI_DIO24 Button0 1 - - -############################################################################## -#PhaseSpace OWL server. This device type is not compiled by default, since -#it uses a proprietary library. However, you can get it to compile by -#defining VRPN_INCLUDE_PHASESPACE and including the appropriate libraries -#and headers when compiling (See vrpn_Configure.h). -# -#Arguments: -# char name_of_this_tracker[] #Tracker0, Tracker1, ... etc -# char location_of_OWL_device[] #typically localhost, or ip address -# float frame_rate #between 0.0 and 480.0 -# int read_till_most_recent #0 or 1. -# int slave_mode #0 or 1. -# [Additional lines specifying markers and rigid bodies] -# -#Specifying a frequency >0 will start streaming immediately at startup. -#To delay this, set the frequency to zero and adjust the update rate later. -# -#Specifying 1 for read_till_most_recent will cause the server to drop frames -#in order to get the most recent data on every run through the mainloop. -#This may be desirable for most VR applications and for slower machines. -# -#The format of the additional lines is as follows: -# -#Example: -# -#vrpn_Tracker_PhaseSpace Tracker0 localhost 480.0 1 0 -#<owl> -#0 : rbnew -#1 : rb+ 0 0 300 0 -#2 : rb+ 1 300 0 0 -#3 : rb+ 2 -300 0 0 -#4 : rb+ 3 0 76 -200 -#5 : pt 4 -#6 : pt 5 -#7 : pt 6 #this is a comment -#8 : pt 8 -#9 : pt 9 -#</owl> -# -# -# -# In regular expression syntax: -# sensornumber : spectype led_id [xcoord ycoord zcoord] -# -# The <owl> and </owl> tags indicate the start and end of the marker -# and rigid body specifications. Each line inside the tags correspond -# to a sensor specified by the first number in the line. Register -# callbacks as necessary. The # character will cause the rest of -# the line to be ignored. Do not assign duplicate sensors. -# -# There are 4 spectypes: "rbnew", "rb+", and "pt". -# -# "pt" indicates a normal marker specification. -# The number following it indicates the led id to assign to that sensor. -# No further arguments are needed for the rest of the line. The vrpn -# server will return position data for that marker but no orientation -# data. -# -# "rbnew" indicates a new rigid body specification. The lines following -# it must be "rb+" lines, indicating the addition of markers to the -# rigid body. The "rb+" lines must have the x,y, and z coordinates of -# the rigid body marker specified after the led id. The rigid body -# itself is assigned the sensor of the "rbnew" line, and the markers -# in the rigid body are given the sensor numbers of the "rb+" lines. -# The rigid body specification continues until another "rbnew" line is -# encountered or until the </owl> tag. If "pt" lines are mixed in, they -# do not affect the rigid body. Rigid bodies will return an orientation -# as well as positional data. -# -# Empty or invalid lines inside the <owl> and </owl> tags are also -# ignored. -# -# Care must be taken to AVOID specifying the same led id or sensor twice, -# sensors and led ids should be unique. -# -# The OWL server (not just the vrpn server) must still be configured to -# track the specified markers. Consult the PhaseSpace documentation to -# see how. -# -# -# Velocities and accelerations are not currently supported. -# -# The frequency of streaming can be varied with set_update_rate() -# in vrpn_Tracker_Remote. To stop streaming, set the update rate to -# zero. -# -# For support, questions, comments, or bug reports please send emails -# to: support@phasespace.com - -#vrpn_Tracker_PhaseSpace Tracker0 localhost 480.0 1 0 -#<owl> -#0 : pt 0 #to sensor 0 assign led 0 -#1 : pt 1 #to sensor 1 assign led 1 -#2 : pt 2 #to sensor 2 assign led 2 -#3 : pt 3 #to sensor 3 assign led 3 -#</owl> - -################################################################################ -# Generic Auxiliary Logger. This is a server that will listen for requests to -# produce additional log files and the name of the connection it should make the -# log files for. It can only have one set of such logs open (can be more than -# one log but all for the same connection). There are two arguments: -# char name_of_this_device[] -# char name_of_connection_to_log - -#vrpn_Auxiliary_Logger_Server_Generic Logger0 localhost - -################################################################################ -# Imager Stream Buffer. This is a server that will listen for requests to -# produce additional log files and the name of the connection it should make the -# log files for. It can only have one set of such logs open (can be more than -# one log but all for the same connection). The "local" log files are with -# respect to the machine where this server is running, and the "remote" ones -# are with respect to the vrpn_Imager_Server it has connected to (which may -# be on yet a third machine compared to the client machine). -# There are two arguments: -# char name_of_this_device[] -# char name_of_imager_server_to_log - -#vrpn_Imager_Stream_Buffer ImageStream0 TestImage@localhost - -################################################################################ -# controllers from Futaba. There is one device we have -# drivers for. The only argument is the name of the device to open. -# -# For Interlink Elite: -# Analog channel assignments: -# 0=rudder (left joy X) -# 1=throttle (left joy Y) -# 2=aileron (right joy X) -# 3=elevator (right joy Y) -# 4=Ch6 Flaps Gain -# Button number assignments: -# 0=Ch5 fwd -# 1=Ch7 fwd -# 2=reset -# 3=Ch8 down -# 4=Ch8 up -# 5=<none> -# 6=menu/select -# 7=cancel -# Next eight are for the trim buttons -# 8=aileron right -# 9=aileron left -# 10=elevator up -# 11=elevator down -# 12=rudder right -# 13=rudder left -# 14=throttle up -# 15=throttle down -# Next two are options button -# 16=up -# 17=down -# -# There is one argument: -# char name_of_this_device[] - -#vrpn_Futaba_InterLink_Elite futaba0 - -################################################################################ -# controllers from Griffin Technology. There is one device we have -# drivers for. The only argument is the name of the device to open. -# -# For PowerMate: -# Analog channel assignments: -# none -# Button number assignments: -# 0=only button -# Dial assignments: -# 0=only dial -# -# There is one argument: -# char name_of_this_device[] - -#vrpn_Griffin_PowerMate griffin0 - -################################################################################ -# controllers from Retrolink. There is one device we have -# drivers for. The only argument is the name of the device to open. -# -# For GameCube: -# Analog channel assignments: -# 0=Left joystick X axis; -1 = left, 1 = right -# 1=Left joystick Y axis; -1 = up, 1 = down -# 2=Right joystick X axis; -1 = left, 1 = right -# 3=Right joystick Y axis; -1 = up, 1 = down -# 4=Left rocker switch angle in degrees (-1 if nothing is pressed) -# Button number assignments: -# 0=Y -# 1=X -# 2=A -# 3=B -# 4=left trigger -# 5=right trigger -# 6=Z -# 7=Start/pause -# Buttons 8-11 are duplicate mappings for the rocker-switch; both -# these and the analog angle in degrees will change as they are pressed -# 8 = up -# 9 = right -# 10 = down -# 11 = left -# -# There is one argument: -# char name_of_this_device[] - -# vrpn_Retrolink_GameCube retrolink0 - -################################################################################ -# Controllers from Contour Design. There is one device we have -# drivers for. The only argument is the name of the device to open. -# -# For ShuttleXpress: -# -# There is one argument: -# char name_of_this_device[] - -#vrpn_Contour_ShuttleXpress contour0 - -################################################################################ -# controllers from Microsoft. The devices we have drivers for are listed below. -# The only argument is the name of the device to open. -# -# For SideWinder Precision 2 joystick -# Analog channel assignments: -# 0=joystick X -# 1=joystick Y -# 2=Z rotate -# 3=slider -# 4=Point of View Hat heading (-1=nothing, 0=North, 45=Northeast, etc.) -# Button number assignments -# 0=1 -# 1=2 -# 2=3 -# 3=4 -# 4=5 -# 5=6 -# 6=7 -# 7=8 -# Next four are point of view hat buttons -# 8=Up -# 9=Right -# 10=Down -# 11=Left -# -# For SideWinder joystick -# Analog channel assignments: -# 0=joystick X -# 1=joystick Y -# 2=slider -# Button number assignments -# 0=1 -# 1=2 -# 2=3 -# 3=4 -# 4=5 -# 5=6 -# 6=7 -# 7=8 -# -# For Xbox Controller S: -# Requires USB cable and special driver. -# Analog channel assignments: -# 0=left joystick X -# 1=left joystick Y -# 2=right joystick X -# 3=right joystick Y -# 4=Point of View Hat heading (-1=nothing, 0=North, 45=Northeast, etc.) -# Button number assignments -# 0=A -# 1=B -# 2=X -# 3=Y -# 4=Black -# 5=White -# 6=Start -# 7=Back -# 8=left joystick -# 9=right joytick -# 10=left trigger -# 11=right trigger -# Next four are point of view hat buttons -# 12=Up -# 13=Right -# 14=Down -# 15=Left -# -# For Xbox 360 Controller: -# Analog channel assignments: -# 0=left joystick X -# 1=left joystick Y -# 2=right joystick X -# 3=right joystick Y -# 4=triggers (left goes positive, right goes negative) -# 5=Point of View Hat heading (-1=nothing, 0=North, 45=Northeast, etc.) -# Button number assignments -# 0=A -# 1=B -# 2=X -# 3=Y -# 4=left bump -# 5=right bump -# 6=Back -# 7=Start -# 8=left joystick -# 9=right joytick -# Next four are point of view hat buttons -# 10=Up -# 11=Right -# 12=Down -# 13=Left -# -# There is one argument: -# char name_of_this_device[] - -#vrpn_Microsoft_SideWinder_Precision_2 microsoft0 -#vrpn_Microsoft_SideWinder microsoft0 -#vrpn_Microsoft_Controller_Raw_Xbox_S microsoft0 -#vrpn_Microsoft_Controller_Raw_Xbox_360 microsoft0 -#vrpn_Afterglow_Ax1_For_Xbox_360 microsoft0 - -################################################################################ -# X-Keys devices from P.I. Engineering. There are four devices we have -# drivers for. The only argument is the name of the device to open. The Pro -# and Joystick models have not been tested. The XK3 is a 3-button foot pedal. -# -# There is one argument: -# char name_of_this_device[] - -#vrpn_Xkeys_Desktop xkeys0 -#vrpn_Xkeys_Pro xkeys0 -#vrpn_Xkeys_Joystick xkeys0 -#vrpn_Xkeys_Jog_And_Shuttle xkeys0 -#vrpn_Xkeys_XK3 xkeys0 - -################################################################################ -# controllers from Logitech other than 3Dconnexion which is listed separately. -# The devices we have drivers for are listed below. -# The only argument is the name of the device to open. -# -# For Extreme 3D Pro joystick -# Analog channel assignments: -# 0=joystick X -# 1=joystick Y -# 2=Z rotate -# 3=slider -# 4=Point of View Hat heading (-1=nothing, 0=North, 45=Northeast, etc.) -# Button number assignments -# 0=1 -# 1=2 -# 2=3 -# 3=4 -# 4=5 -# 5=6 -# 6=7 -# 7=8 -# 8=9 -# 9=10 -# 10=11 -# 11=12 -# Next four are point of view hat buttons -# 12=Up -# 13=Right -# 14=Down -# 15=Left -# -# There is one argument: -# char name_of_this_device[] - -#vrpn_Logitech_Extreme_3D_Pro logitech0 - -################################################################################ -# controllers from Saitek. -# The devices we have drivers for are listed below. -# The only argument is the name of the device to open. -# -# For ST290 Pro joystick -# Analog channel assignments: -# 0=joystick X -# 1=joystick Y -# 2=Z rotate -# 3=slider -# 4=Point of View Hat heading (-1=nothing, 0=North, 45=Northeast, etc.) -# Button number assignments -# 0=1 -# 1=2 -# 2=3 -# 3=4 -# 4=5 -# 5=6 -# 6=7 -# Next four are point of view hat buttons -# 7=Up -# 8=Right -# 9=Down -# 10=Left -# -# There is one argument: -# char name_of_this_device[] - -#vrpn_Saitek_ST290_Pro saitek0 - -################################################################################ -# controllers from CH products. -# The devices we have drivers for are listed below. -# The only argument is the name of the device to open. -# -# For Fighterstick USB joystick -# Analog channel assignments: -# 0=joystick X -# 1=joystick Y -# 2=throttle wheel -# 3=Point of View Hat heading (buttons 4-7: -1=nothing, 0=North, 45=Northeast, etc.) -# 4=Hat heading (buttons 8-11: -1=nothing, 0=North, 90=East, etc.) -# 5=Hat heading (buttons 12-15: -1=nothing, 0=North, 90=East, etc.) -# 6=Mode (buttons 2, 16-18): 0=unknown, 1=red, 2=yellow, 3=green) -# 7=Hat heading (buttons 20-23: -1=nothing, 0=North, 90=East, etc.) -# -# Button number assignments -# 0=trigger -# 1=top red button -# 2=red button using index finger (see 16, 17, & 18) -# 3=pinky red button -# Next four are on 8-way POV hat: upper right on top -# 4=up -# 5=right -# 6=down -# 7=left -# Next four are on 4-way hat #2: lower right on top -# 8=up -# 9=right -# 10=down -# 11=left -# Next four are on 4-way hat #1: left on top -# 12=up -# 13=right -# 14=down -# 15=left -# Next three are modes triggered by button 2. -# Mode LEDs show the color listed below when pressed, but releasing with advance the color to the next in the series. -# These "buttons" are all released when unknown. Once the mode is known, one button will always be considered pressed. -# 16=green -# 17=red -# 18=yellow -# 19= -# Next four are on 4-way hat #3: thumb -# 20=Up -# 21=Right -# 22=Down -# 23=Left -# -# There is one argument: -# char name_of_this_device[] - -#vrpn_CHProducts_Fighterstick_USB chproducts0 - -################################################################################ -# Space Navigator, Space Traveler, and Space Mouse devices from 3DConnexion. -# 3Dconnexion is actually made by Logitech. -# Not to be confused with the Magellan Space Mouse, for which there is -# a Magellan driver. -# The only argument is the name of the device to open. -# -# There is one argument: -# char name_of_this_device[] -# -# For the SpaceMouse Pro: -# Analog channel assignments: -# 0=x -# 1=y -# 2=z -# 3=pitch -# 4=roll -# 5=yaw -# Button number assignments: -# (the ones similar to <x> have a graphic on the button and are referred to the text enclosed text in the help) -# 0=Menu -# 1=Fit -# 2=<T> -# 4=<R> -# 5=<F> -# 8=<Roll+> -# 12=1 -# 13=2 -# 14=3 -# 15=4 -# 22=Esc -# 23=Alt -# 24=Shift -# 25=Ctrl -# 26=<Rot> -# -# On Linux, make sure the HID and evdev drivers are running so that these -# devices will be recognized: -# Start a separate Root shell: -# cd .../vrpn/server_src/pc_linux -# lsmod -# modprobe evdev -# modprobe hid -# lsmod -# (check that evdev and hid are running) -# On RedHat Linux, you need the have libusb1-devel installed and configure -# the system for VRPN_USE_LOCAL_HIDAPI to get these to work. - -#vrpn_3DConnexion_Navigator device0 -#vrpn_3DConnexion_Navigator_for_Notebooks device0 -#vrpn_3DConnexion_Traveler device0 -#vrpn_3DConnexion_SpaceMouse device0 -#vrpn_3DConnexion_SpaceMousePro device0 -#vrpn_3DConnexion_SpaceMouseWireless device0 -#vrpn_3DConnexion_SpaceExplorer device0 -#vrpn_3DConnexion_SpaceBall5000 device0 -#vrpn_3DConnexion_SpacePilot spacepilot - -################################################################################ -# Open the mouse as an analog and button devices. There is an implementation -# under Windows and another under Linux (using GPM). There are two analog -# channels, reporting in the range [0..1] as the mouse moves across the screen. -# There are 3 button channels: left, middle, right. -# -# There is one argument: -# char name_of_this_device[] - -#vrpn_Mouse Mouse0 - -################################################################################ -# Open the keyboard as a button device. There is an implementation -# under Windows. There are 256 buttons, and they are triggered according -# to the scan code that they represent. -# -# There is one argument: -# char name_of_this_device[] - -#vrpn_Keyboard Keyboard0 - -################################################################################ -# WARNING : LINUX ONLY ! -# Open the /dev/input devices and treat them as mouse events -# There is as many as available channel (kernel 2.6.38 : 10 channels) -# -# There is three argument: -# char name_of_this_device[] -# char "name of the hardware device" -# char type of the device (must be one of "keyboard", "absolute" and "relative" -# int in case of keyboard : the total number of keys ; in case of absolute mouse : size of the window (ie. to normalize the result) -# The "name of the hardware device" is the Name entry of the device -# from /proc/bus/input/devices -# Due to hardware access through /dev/input/*, there is no notion of window. -# Thus, you must specify the window size. If '-1' is provided, then, this device -# only provide relative displacement of the channel -# -# Keyboard are standard keyboard (ie : the one on which you type elements -# Absolute are pointing devices such as touchpad : the position of the pointer is absolute regarding the size of the touch pad -# Relative are pointing devices such as mouse : the position of the pointer is a relative displacement regarding previous position -# -# BEWARE that you must have read access to the wanted device - -#vrpn_DevInput Input0 "AT Translated keyboard" keyboard 255 -#vrpn_DevInput Input0 "USB Optical Mouse" relative -1 - -################################################################################ -# MotionNode inertial tracking system. -# -# There are four arguments: -# char name_of_this_device[] -# int num_sensors -# char address -# int port - -#vrpn_Tracker_MotionNode Tracker0 1 127.0.0.1 32079 - -################################################################################ -# GPS device. -# This driver reads a GPS connected to the serial port at a given baud rate, and looks for -# the NMEA message providing long/lat/alt, which get copied into x/y/z -# respectively (of the position). Should do a lot more (e.g., get velocity, -# bearing, perhaps convert to UTM). But, for now, this is all it does. - -# Open a GPS on MACOSX at 4800 baud - -#vrpn_Tracker_GPS Tracker0 /dev/tty.KeySerial1 4800 -#vrpn_Tracker_GPS Tracker0 /dev/tty.HOLUXGPSlim236-SPPslave-1 4800 - -#on windows -#vrpn_Tracker_GPS Tracker0 COM1 4800 - -################################################################################ -# Nintendo Wii Remote Controller -# char name_of_this_device[] -# int userIndex (1 for "Player 1", 2 for "Player 2", etc.) -# int useMotionSensing -# int useIR -# int reorderButtons (set to make button ids somewhat more sensible) -# char bluetooth_address[] (optional, only supported on Linux - upper case, -# include colons) - -#vrpn_WiiMote WiiMote0 1 0 0 1 - -################################################################################ -# Two-LED head tracking using Wii Remote Controller -# char name_of_this_device[] -# char name_of_vrpn_WiiMote_device[] -# float min_update_rate (default=60) -# float led_distance (default=0.205) -# -# Note: The WiiMote device must have useMotionSensing = 1 and useIR = 1 - -#vrpn_WiiMote WiiMote0 1 1 1 1 -#vrpn_Tracker_WiimoteHead Tracker0 WiiMote0@localhost - -################################################################################ -# Novint Falcon attached to USB. -# Arguments: -# char name_of_this_device[] -# int device index (starts at 0) -# char name_of_grip (optional, default and only one supported now = "4-button") -# char kinematic_model (optional, default and only one supported now ="stamper") -# float damping_factor (optional, range 1.0-1000.0, default=10.0) -#vrpn_Tracker_NovintFalcon Tracker0 0 4-button stamper 10.0 - -################################################################################ -# Hillcrest Labs Freespace device -# char name_of_this_device[] -# int Index (0 for device 1, 1 for device 2, ...) -# int Send body frames (0 = no, 1 = yes) -# int Send user frames (0 = no, 1 = yes) - -#vrpn_Freespace FreeSpace0 0 1 1 - -################################################################################ -# Dream Cheeky devices, of which only the USB Roll-Up Drum Kit is implemented. -# -# There is one argument: -# char name_of_this_device[] - -#vrpn_Dream_Cheeky_USB_roll_up_drums drums0 - -################################################################################ -# Trivisio Colibri device. This is an inertial tracker that gives orientation -# information, no position (the tracker reports (0, 0, 0) for position). -# -# Arguments: -# char name_of_this_device[] -# int number_of_sensors (Number of connected devices to connect to) -# int Hz (Update rate) -# int bufLen (From the reference manual: -# An short buffer (0) ensures minimal delay until the sensor -# measurement is available at the risk of lost measurements. -# A long buffer guarantees that no data is dropped, at -# the same time if data is not read fast enough there is a -# potential risk of a bufLen frequency before the measurement -# becomes available.) - -#vrpn_Tracker_TrivisioColibri Colibri 1 60 0 - -################################################################################ -# LUDL USBMAC6000 device. This is a vrpn_Analog and a vrpn_Analog_Output device -# that lets you both move the stage by command and get a response when it has -# finished moving. -# -# Arguments: -# char name_of_this_device[] -# int Perform recentering on device (0 = no, 1 = yes) - -#vrpn_LUDL_USBMAC6000 Analog0 1 - -################################################################################ -# GameTrak tracker -# Reports 2 sensors with positions only -# This device uses another joystick device that needs to be configured (PC -# version of GameTrak shows up as a joystick device with 6 axes and a button) -# If the name of the joystick device starts with '*', it will take another -# one on this server, otherwise it will attempt a remote connection -# char name_of_this_device[] -# char name of the joystick device[] -#vrpn_Joylin RawGametrak /dev/input/js1 -#vrpn_Tracker_GameTrak GameTrak0 *RawGametrak - - -################################################################################ -# PNI SpacePoint Fusion 3DOF rotation tracker -# Reports 1 sensor as quaternion -# char name_of_this_device[] - -#vrpn_Tracker_SpacePoint SpacePoint0 - -################################################################################ -# 5DT DataGlove "Ultra" USB/USB Wireless support (based on HID) -# -# Reports 5 or 14 sensors' raw values as analogs 0-4 or 0-13, in range 0.0 - 1.0 -# Note that your code will probably need to perform some scaling/calibration: -# see vrpn_Analog_5dtUSB.h for more info -# -# Four device types as shown in examples below: the server will connect to the -# first device available of that type. -# -# For serial (non-"Ultra") gloves, see vrpn_5dt and vrpn_5DT16 -# -# Arguments: -# char name_of_this_device[] - -#vrpn_Analog_5dtUSB_Glove5Right Glove5Right -#vrpn_Analog_5dtUSB_Glove5Left Glove5Left -#vrpn_Analog_5dtUSB_Glove14Right Glove14Right -#vrpn_Analog_5dtUSB_Glove14Left Glove14Left - -################################################################################ -# JsonNet devices -# -# Any device that send updates formatted as JSON messages over UDP, including -# Vrpn Widgets for Android -# -# Messages are: -# for a tracker: -# { -# 'type': 1, -# 'id': sensor number, -# 'quat': quaternion, -# 'pos': position -# } -# -# for a button: -# { -# 'type': 2, -# 'button': button number, -# 'state': the boolean state -# } -# -# for an analog: -# { -# 'type': 3, -# 'num': channel number, -# 'data': the analog value -# } -# for a text message: -# { -# 'type': 4, -# 'data': the text value -# } -# -# Arguments: -# char name_of_this_device[] -# int udp_port (Device send JSON messages to this port) - -#vrpn_Tracker_JsonNet Jsonnet 7777 - -################################################################################ -# One-Euro Filter Tracker. This is a tracker that is intended to be used on top of -# another tracker to provide filtered output for it. This was originally designed -# for the Razer Hydra, but can be used along with any tracker. -# -# Arguments: -# char name_of_this_device[] -# char name_of_tracker_to_filter[] (start with * for local) -# int number_of_sensors_to_filter -# float vecMinCutoff -# float vecBeta -# float vecDerivativeCutoff -# float quatMinCutoff -# float quatBeta -# float quatDerivativeCutoff - -#vrpn_Tracker_FilterOneEuro Filter0 *Tracker0 2 1.15 1.0 1.2 1.5 5.0 1.2 - -################################################################################ -# Razer Hydra (Sixense TrueMotion) tracker (HID-based driver) -# -# The left wand (the one with LB and LT on its "end" buttons - look from above) -# is sensor 0, and the right wand (with RB and RT on it) is sensor 1. -# The "front" of the base is the side opposite the cables: there's a small -# logo on it. You can have the base in any orientation you want, but the info -# that follows assumes you have the base sitting on a desk, with the front toward you. -# If you have the base in a different coordinate frame in the world, please make -# the appropriate mental transformations yourself. :) -# -# When starting the VRPN server, make sure that the left wand is somewhere to -# the left of the base, and the right wand somewhere right of the base - -# they do not need to be placed on the base or any more complicated homing/calibration -# procedure. This is for the hemisphere tracking: it needs to have an "initial state" -# that is roughly known, so it uses the sign of the X coordinate position. -# -# The base coordinate system is right-handed with the axes: -# X - out the right of the base -# Y - out the front of the base -# Z - down -# -# The wands are also right-handed, with the tracked point somewhere near -# the cable entry to the controller . When held with the joystick vertical, -# the axes are: -# X - to the right -# Y - out the front of the controller (trigger buttons) -# Z - Up, along the joystick -# -# Buttons are as follows, with the right controller's button channels starting -# at 8 instead of 0: -# 0 - "middle" button below joystick -# 1-4 - numbered buttons -# 5 - "bumper" button (above trigger) -# 6 - joystick button (if you push straight down on the joystick) -# There is no button 7 on any controller; the offset of 8 per controller -# was done to make similar buttons differ by a power of 2. -# -# Analog channels are as follows, with the right controller starting at 3 -# instead of 0: -# 0 - joystick left/right: centered at 0, right is positive, in [-1, 1] -# 1 - joystick up/down: centered at 0, up is positive, in [-1, 1] -# 2 - analog trigger, in range 0 (not pressed) to 1 (fully pressed). -# -# Arguments: -# char name_of_this_device[] -# -# NOTE: If using the Hydra on Windows, the server will work with or without the official -# Razer Hydra drivers installed. If you are only using the device with VRPN, don't -# install the official drivers. However, if you do have them installed, make sure that -# the "Hydra Configurator" and the Hydra system tray icon are closed to avoid unexpected -# failure (their software can switch the device out of the mode that VRPN uses). You -# probably want to make sure that the tray icon doesn't auto-run on startup, since it -# can get even messier with Windows 7's "switch users" if you let it auto-run for each -# user. -# -# Works great on Linux (regardless of endianness) - no drivers needed, thanks to USB HID. -# -# NOTE: Because of the jitter in the tracker, you may want to add a -# filter to it and then read the filtered location values; you still read -# the buttons and analogs from the original device. -# - -#vrpn_Tracker_RazerHydra Tracker0 -#vrpn_Tracker_FilterOneEuro Filter0 *Tracker0 2 1.15 1.0 1.2 1.5 5.0 1.2 - -################################################################################ -# Sensics zSight HMD with built-in tracker. This is an inertial tracker that -# gives orientation information, but no position (the tracker reports -# (0, 0, 0) for position). -# -# Arguments: -# char name_of_this_device[] - -#vrpn_Tracker_zSight zSight - -################################################################################ -# Arrington Research ViewPoint EyeTracker. -# -# The VRPN server connects to the eye tracker using the VPX_InterApp DLL. -# Whatever other control software is being used to connect to the eye tracker -# (e.g. the ViewPoint software that comes with the tracker) to perform -# calibration, etc. should link to the same copy of the DLL, so they can share -# information. -# -#------------------------------------------------------------------------------- -# -# Tracker: -# -# The tracker has two sensors, as the ViewPoint can optionally have binocular -# tracking. In the case of monocular tracking, only sensor 0 (EYE_A) will have -# valid information. Retrieving smoothed or raw tracking data is controlled by -# the smoothedData parameter. -# -# Position: The (x,y) gaze point in gaze space (smoothed or raw). -# -# Rotation: The (x,y) gaze angle as a quaternion (smoothed or raw). -# -# Velocity: The x- and y- components of the eye movement velocity in gaze space -# (always smoothed). -# -#------------------------------------------------------------------------------- -# -# Analog: -# -# There are a lot of additional data that can be retrieved from the tracker. -# These values are always calculated from the smoothed gaze point. Currently, -# the following are sent as analog values, but more can be added as needed. -# Please see the ViewPoint documentation regarding what other data are available. -# -# Because each channel needs to be duplicated in the case of a binocular tracker, -# the first n/2 values are for EYE_A, and the second n/2 values are for EYE_B. -# -# EYE_A: -# -# Channel 0: The pupil aspect ratio, from 0.0 to 1.0. Can be used to detect -# blinks when it falls below a given threshold. -# -# Channel 1: The total velocity (magnitude of eye movement velocity). Can be -# used to detect saccades. -# -# Channel 2: The fixation seconds (length of time below the velocity criterion -# used to detect saccades). 0 if saccade is occurring. -# -# EYE_B: -# -# Channels 3-5: See EYE_A. -# -#------------------------------------------------------------------------------- -# -# Arguments: -# char name_of_this_device[] -# int smoothedData - -# vrpn_Tracker_ViewPoint ViewPoint 1 - -################################################################################ -# vrpn_inertiamouse -# (Need a description of how to run this and an example commented-out line.) - -############################################################################### -# $Header: /PDIvrpn.root/2.0.0/PDIVRPN/vrpn_G4.cfg 1 6/05/12 12:23p Ben $ -# -# The command for a G4 requires the tracker name, the server name for the -# tracker, and on the next line, the file path to the .g4c configuration file: -# -# vrpn_Tracker_G4 G4 \ -# C:\filepath\source_config_file.g4c -# -# The '\' at the end of the first line, after the server name, is optional and -# will be disregarded. A '\' on a subsequent line means that further commands -# are to be input. The format is to have one command per line after the file -# path. Each line that isn't the final line must end in a '\'. -# The final line should not have a '\' on the end. -# -# Supported G4 Configuration Commands: -# 'B' Set/Reset Boresight -# 'X' Set/Reset Position Filter -# 'Y' Set/Reset Attitude Filter -# 'T' Set/Reset G4 Translation Frame of Reference -# 'R' Set/Reset G4 Rotation Frame of Reference -# 'I' Set/Reset Sensor Increment/Auto-Increment -# 'N' Set/Reset Sensor Tip Offset -# -# The following commands are not G4 configuration commands but are used to -# create VRPN button server objects for G4 button devices: -# -# 'G4PowerTrak' Creates VRPN button server object with 4 buttons -# 'G4DigIO' Creates VRPN button server object with a configurable button count -# -# Command Syntax: -#------------------------------------------------------------------------------ -# 'B' Boresight Command 'B': -# -# Syntax: Baction,hub,sensor,[x,y,z,w] -# -# Arguments: -# action: -# 1 = Boresight -# 2 = Unboresight -# -# hub: HubID. (0-based.) To apply Boresight/Unboresight to all hubs & sensors, set to * or -1. -# sensor: Sensor Num. (0-based.) To apply Boresight/Unboresight to all sensors on a hub, set to * -# Note: If hub is *, set sensor to * also. -# [x,y,z,w]: Optional Quaternion XYZW Boresight Reference Orientation. -# All 4 values must be set. -# N/A for action=2 -# -# Examples: -# B2,-1,-1 Un-Boresights all sensors on all hubs -# B1,-1,-1 Boresights all sensors on all hubs -# B1,1,-1, -#------------------------------------------------------------------------------ -# 'X' Position Filter Command 'X': -# 'Y' Attitude Filter Command 'Y': -# -# Syntax: Xaction,hub,flevel,[F,FLow,FHigh,Factor] -# Yaction,hub,flevel,[F,FLow,FHigh,Factor] -# -# Arguments: -# action: -# 1 = Set -# 2 = Reset -# -# hub: HubID. (0-based.) To apply filter to all hubs, set to * -# flevel: Filter Level -# 0=None -# 1=Light -# 2=Medium -# 3=Heavy -# 4=Custom -# [F,FLow,FHigh,Factor]: Optional Floating-point Parameters used only if flevel=Custom. -# If custom parameters are used, it is assumed that all four custom parameters are present. -# See Tracker User manual for meaning of Custom Filter Values. -# Examples: -# X*,1 Sets Position Filtering to LIGHT on all hubs -# Y2,0 Sets Attitude Filtering to NONE on hub 2 -# X1,4,0.2,0.2,0.8,0.95 Sets Custom Filter on hub 1 -#------------------------------------------------------------------------------ -# 'T' Translation Frame of Reference Command 'T': -# -# Syntax: Taction,x,y,z -# -# Arguments: -# action: -# 1 = Set -# 2 = Reset -# -# x,y,z: Position Offset, measured in Meters -# All arguments must be present -# -# Examples: -# T1,1.0,1.5,1.0 Sets Translation Frame of Reference to (1.0, 1.5, 1.0) meters -# Y2 Resets Translation Frame of Reference -# -# Note: Frame of Reference commands apply to all G4 output. -#------------------------------------------------------------------------------ -# 'R' Rotation Frame of Reference Command 'R': -# -# Syntax: Raction,hub,x,y,z,w -# -# Arguments: -# action: -# 1 = Set -# 2 = Reset -# -# x,y,z,w: Rotation Quaternion XYZW -# All arguments must be present -# -# Examples: -# R1,0,0,0.707107,0.707107 Sets Rotation Frame of Reference -# R2 Resets Rotation Frame of Reference -# -# Note: Frame of Reference commands apply to all G4 output. -#------------------------------------------------------------------------------ -# 'I' Increment/AutoIncrement Command 'I': -# -# Syntax: Iaction,hub,sensor,fPosIncr,fOriIncr -# -# Arguments: -# action: -# 1 = Set -# 2 = Reset -# -# hub: HubID. (0-based.) To apply command to all hubs & sensors, set to * or -1 -# sensor: Sensor Num. (0-based.) To apply command to all sensors on a hub, set to * or -1 -# Note: If hub is *, set sensor to * also. -# -# posIncr: Position Threshold, Meters -# 0 Disables -# -1 Enables Auto-Increment -# -# oriIncr: Orientation Threshold, DEGREES -# 0 Disables -# -1 Enables Auto-Increment -# -# Examples: -# I1,*,*,0.01,5.0 For all hubs/sensors, sets position increment to 10 cm, -# rotation increment to 5 degrees -# I1,*,*,-1,-1 For all hubs/sensors, enables position and rotation auto-increment -# I2,0,2 For hub0, sensor2, resets/disables increment -# -#------------------------------------------------------------------------------ -# 'N' Tip Offset Command 'N': -# -# Syntax: Iaction,hub,sensor,x,y,z -# -# Arguments: -# action: -# 1 = Set -# 2 = Reset -# -# hub: HubID. (0-based.) To apply command to all hubs & sensors, set to * or -1 -# sensor: Sensor Num. (0-based.) To apply command to all sensors on a hub, set to * or -1 -# Note: If hub is *, set sensor to * also. -# -# x,y,z: Position Offset, measured in Meters -# All arguments must be present -# -# Examples: -# N1,0,0,0.005,0.001,0.001 For hub0,sensor0, sets tip offset to (5,1,1)cm -# N2,*,* For all hubs/sensors, resets tip offset -# -# -#------------------------------------------------------------------------------ -# 'G4PowerTrak' Command : -# If one or more hubs in the polhemus g4 system supports a Polhemus PowerTrak360, use this -# command to create a vrpn button object with 4 buttons. -# -# Syntax: G4PowerTrak name hub -# -# Arguments: -# name: Button Server Name -# hub: HubID. (0-based) Identifier of the hub to which the PowerTrak360 is connected. -# -# Examples: -# G4PowerTrak ptrak0 0 For 4-button server named ptrak0 plugged into Hub 0. -# -# Remember that the "remote" button object is not the same as the the tracking device, so be sure -# to use a remote button object that connects to the button rather than the tracker. -# In this example configuration, if the name of the machine running the server is "mytrackerserver" -# you would connect to the tracker as "myg4@mytrackerserver" and to the powertrak configured -# here as "ptrak0@mytrackerserver" -# -# Note: It is possible to have >1 G4PowerTrak configured on a vrpn_Tracker_G4, but they must be -# on different hubs. -# It is also possible to have a combination of G4PowerTrak and G4DigIO commands, but they -# must be on different hubs. -# -#------------------------------------------------------------------------------ -# 'G4DigIO' Command: -# If one or more hubs in the polhemus g4 system supports a custom digital IO accessory, use this -# command to create a vrpn button object with a configurable number of buttons -# -# Syntax: G4DigIO name hub inputs -# -# Arguments: -# name: Button Server Name -# hub: HubID. (0-based) Identifier of the hub to which the digital IO device is connected. -# inputs: Number of digital inputs (buttons) to capture. -# The G4 Digital I/O interface supports up to 8 digital inputs. The 'inputs' -# argument must be between 1 and 8, inclusive. -# -# Examples: -# G4DigIO 2btn0 0 For 2-button server named 2btnio0 plugged into Hub 0. -# G4DigIO 8sig4 8 For an 8-button server named 8sig4 plugged into Hub 4. -# -# Remember that the "remote" button object is not the same as the the tracking device, so be sure -# to use a remote button object that connects to the button rather than the tracker. -# In this example configuration, if the name of the machine running the server is "mytrackerserver" -# you would connect to the tracker as "myg4@mytrackerserver" and to the G4DigIO configured -# here as "2btn0@mytrackerserver" or "8btn4@mytrackerserver". -# -# Note: It is possible to have >1 G4DigIO configured on a vrpn_Tracker_G4, but they must be -# on different hubs. -# It is also possible to have a combination of G4PowerTrak and G4DigIO commands, but they -# must be on different hubs. -# -#------------------------------------------------------------------------------ -# Example command for setup of a G4 -# -# vrpn_Tracker_G4 G4\ -# C:\Program Files (x86)\Polhemus\G4\G4 Files\mysourceconfig.g4c \ -# G4PowerTrak myptraka 1 -# G4PowerTrak myptrakb 2 -# B1,-1,-1\ -# X1,*,1\ -# Y1,*,4,0.2,0.2,0.8,0.95\ -# T1, 10.0, 10.0, 10.0, 10.0\ -# R1,0,0,0,1\ -# I1,*,*,0.01,5.0\ -# N1,0,*,0.005,0.002,0.001\ -# N2,*,* - -############################################################################### -# The command for a FastrakPDI requires the tracker name, and the server name for the tracker: -# -# vrpn_Tracker_FastrakPDI Fastrak\ <-valid -# vrpn_Tracker_FastrakPDI Highpoint\ <-valid -# -# The '\' at the end of the first line, after the server name, is optional and will be disregarded. -# a '\' on a subsequent line means that further commands are to be input. The format is to have -# one command per line. Each line that isn't the final line must end in a '\'. The final line should not -# have a '\' on the end. -# -# Supported Fastrak Configuration Commands: -# All commands are exposed, except C and c for continuous pno which would conflict with VRPN directly. -# Take note that O<> should be avoided, though it will be sent to the tracker. VRPN clients expect position -# x,y,z and quaternion q,r,s,t by default, so changing the frame structure could result in an overflow. -# The format commands ('F' for ASCII, f for binary) are especially useful since the tracker can mark -# syntax errors in ASCII mode. The tracker must be in binary mode for VRPN to gather data, so if you issue -# an F command at some point in this file (to troubleshoot syntax errors), be sure to issue an f<> -# command later. Not all fastrak commands have a response: boresight, for example. You can confirm -# such settings by requesting a single frame in ASCII mode with the command P (note, P requires no <>). -# Read the fastrak manual for a full list of commands. -# -# Command Syntax: -# Many commands, much like P (gather single pno frame), require no carriage return on the end. Carriage -# returns are represented by '<>'. Control commands, noted as ^$ (where $ is any capitol letter) in the -# manual require a '^' followed by the capital letter for the command. Syntax is precisely as given in -# examples in the fastrak manual. Note that all commands are case sensitive. -# Examples: -# F <-Sets the response frame format to ASCII -# f <-Sets the response frame format to binary -# b*<> <-Removes the boresight setting for all sensors -# B1<> <-Sets the boresight to 0,0,0 as a default or whatever G<> was set to -# G1,0,0,0<> <-Sets the boresight reference angles of station 1 to 0,0,0 -# ^Y <-Sends a reset command to the tracker, note that VRPN defaults for pno will be loaded on -# reconnect -# -# If a sensor on the FasTrak device is a Polhemus FasTrak Stylus, use the "PDIStylus" -# command. This command takes one argument: the station number of the stylus device. Remember that -# the station number is a 1-based index of sensors/'stations' on the Polhemus equipment. -# PDIStylus command syntax: -# -# PDIStylus [station-num] -# -# Use of the PDIStylus command will -# - Cause the Stylus Button Flag to be configured into the output of all stations. -# - Cause the creation of vrpn button device. The name of this device will be a concatenation of -# the server name for the tracker + "Stylus" + the specified station number. -# E.g: -# vrpn_Tracker_FasTrakPDI myFT \ -# PDIStylus 1 -# -# Will produce a button device named "myFTStylus1" -# -# Remember that the "remote" button object is not the same as the the tracking device, so be sure -# to use a remote button object that connects to the button rather than the tracker. -# In this example configuration, if the name of the machine running the server is "mytrackerserver" -# you would connect to the tracker as "myFT@mytrackerserver" and to the button on the stylus as -# "myFTStylus1@mytrackerserver" -# -# NOTE: The FasTrak tracker will only detect stylus input if the stylus is plugged into Station 1! -# However, the stylus flag can be output onto any station on the device. Therefore, it is -# possible to specify station 2 as your PDIStylus button, and the stylus output will be collected -# from the Station 2 output. BUT the actual Stylus device must be plugged into Station 1. -# This means that only one Stylus can be plugged into a FasTrak at any time, but up to 4 vrpn -# button objects can be created/accessed from that Stylus. -# -#------------------------------------------------------------------------------ -# The following example config: -# -specifies that station 1 is a FasTrak Stylus Device -# -sets the tracker to ASCII responses (F), -# -sets the boresight reference on sensor one to 0,0,0, (G1,0,0,0<>) -# -writes this reference to the system with B1<>, -# -confirms the change by collecting a single pno with P, -# -removes the boresight setting (^b1<>), -# -collects a second single pno to confirm this removal (P) and -# -finally returns to binary mode before passing control to VRPN (F1<>). -# The trackers name is TrackerJoe. - -# vrpn_Tracker_FastrakPDI TrackerJoe\ -# PDIStylus 1\ -# F\ -# G1,0,0,0<>\ -# B1<>\ -# P\ -# b1<>\ -# P\ -# f - -#------------------------------------------------------------------------------ -# The default config is below. - -# vrpn_Tracker_FastrakPDI Blueberry - -############################################################################### -# The command for a LibertyPDI or PatriotPDI requires the tracker name, and the server name for the tracker: -# -# vrpn_Tracker_LibertyPDI Liberty\ <-valid -# vrpn_Tracker_LibertyPDI Patriot\ <-valid -# vrpn_Tracker_LibertyPDI BriansTracker\ <-valid -# vrpn_Tracker_PatriotPDI Patriot\ <-Not valid. Use vrpn_Tracker_LibertyPDI for patriot and liberty -# -# The '\' at the end of the first line, after the server name, is optional and will be disregarded. -# a '\' on a subsequent line means that further commands are to be input. The format is to have -# one command per line. Each line that isn't the final line must end in a '\'. The final line should not -# have a '\' on the end. -# -# Supported Liberty/Patriot Configuration Commands: -# All commands are accepted, except C<> for continuous pno output which would conflict with VRPN directly. -# Take note that O<> should be avoided, though it will be sent to the tracker. VRPN clients expect position -# x,y,z and quaternion q,r,s,t by default, so changing the frame structure could result in an overflow. -# The format command (F0<> for ASCII, F1<> for binary) is especially useful since the tracker can mark -# syntax errors in ASCII mode. The tracker must be in binary mode for VRPN to gather data, so if you issue -# an F0<> command at the beginning of this file (to troubleshoot syntax errors), be sure to issue an F1<> -# command later. Not all liberty/patriot commands have a response: boresight, for example. You can confirm -# these settings by requesting a single frame in ASCII mode with the command P (note, P requires no <>). -# Read the patriot or liberty manual for a full list of commands. -# -# Command Syntax: -# Every command, except P (gather single pno frame), requires a carriage return on the end. Carriage -# returns are represented by '<>'. Control commands, noted as ^X (where X is any capitol letter) in the -# manual require a '^' followed by the capital letter for the command. Syntax is precisely as given in -# examples in the patriot/liberty manuals. -# Examples: -# ^V<> <-This command sends a 'whoami' request to the tracker. Requires ascii mode for response -# F<> <-Queries format mode of tracker (binary or ascii) -# F0<> <-Sets the response frame format to ASCII -# F1<> <-Sets the response frame format to binary -# ^B*<> <-Removes the boresight setting for all sensors -# B1<> <-Queries the boresight setting for sensor one -# B1,0,0,0,0 <-Sets the boresight to 0,0,0 without a reset for sensor one -# ^Y<> <-Sends a reset command to the tracker, note that VRPN defaults for pno will be loaded on -# reconnect -# -# If one or more sensors on the polhemus device is a Polhemus Stylus, use the "PDIStylus" -# command. This command takes one argument: the station number of the stylus device. Remember that -# the station number is a 1-based index of sensors/'stations' on the Polhemus equipment. -# PDIStylus command syntax: -# -# PDIStylus [station-num] -# -# Use of the PDIStylus command will -# - Cause the Stylus Button Flag to be configured into the output of all stations. -# - Cause the creation of vrpn button device. The name of this device will be a concatenation of -# the server name for the tracker + "Stylus" + the specified station number. -# E.g: -# vrpn_Tracker_LibertyPDI myliberty \ -# PDIStylus 2 -# -# Will produce a button device named "mylibertyStylus2" -# -# Remember that the "remote" button object is not the same as the the tracking device, so be sure -# to use a remote button object that connects to the button rather than the tracker. -# In this example configuration, if the name of the machine running the server is "mytrackerserver" -# you would connect to the tracker as "myliberty@mytrackerserver" and to the button on this stylus as -# "mylibertyStylus2@mytrackerserver" -# -# NOTE: The Liberty and Patriots tracker will detect stylus button input on any station, and there is -# no limit on the number of Stylus devices that can be connected to the tracker. Only one vrpn -# button object can be created per stylus. -# -#------------------------------------------------------------------------------ -# The following example config: -# -specifies that stations 1 and 2 are Polhemus Stylus Devices -# -sets the tracker to ASCII responses (F0<>), -# -sends the tracker a whoami (^V<>), -# -sets the boresight on sensor one (B1,0,0,0,0<>) to an arbitrary value, -# -confirms the boresight setting with P to collect a single pno, -# -removes the boresight setting (^B1<>), -# -collects a second single pno to confirm (P), -# -enters an invalid command to demonstrate the advantage of ASCII mode (^ZX<>) and finally, -# -most importantly, returns to binary mode before passing control to VRPN (F1<>). -# The tracker server name is TrackerJohn. -# -# vrpn_Tracker_LibertyPDI TrackerJohn\ -# PDIStylus 1\ -# PDIStylus 2\ -# F0<>\ -# ^V<>\ -# B1,0,0,0,0<>\ -# P\ -# ^B1<>\ -# P\ -# ^ZX<>\ -# F1<> -# -#----------------------------------------------------------------------------- -# Finally the default config is below. -############################################################################## - -# vrpn_Tracker_LibertyPDI Strawberry\ -# F0<>\ -# ^V<>\ -# F1<> - -############################################################################### -# This YEI 3Space_Sensor driver is used even for a wireless-capable sensor -# when it is plugged directly into the computer via USB. The Wireless -# driver (see next driver description) is used when the wireless unit is -# plugged into the computer. -# -# On Windows, the driver for the YEI 3-Space Sensor Suite requires installation -# of the device driver that comes with the system, which presents a serial-port -# interface to the device (as a COM port on Windows). On Mac and Linux, you -# can just plug in the device and it will show up as a new port. On Linux, the -# default permissions for the port only allow read access, so you'll need to -# either change the permissions or run vrpn_server as root. -# If the gyroscopes are calibrated at startup, the device should remain still -# while the server is started. -# If the device is set to tare at startup, it should be facing in the correct -# direction when the server is started. This is usually a manufacturing-time -# operation if the tracker is integrated into a larger device. -# -# This device exposes a Tracker interface, with the following inputs. Only the -# orientation portion of the pose is valid; the position is always reported as -# (0,0,0). Sensor 1 also reports linear acceleration. -# 0: Untared orientation -# 1: Tared orientation -# -# This device exports an Analog interface, with the following channels: -# 0: Corrected Gyro rate vector X component (radians/second) -# 1: Corrected Gyro rate vector Y component (radians/second) -# 2: Corrected Gyro rate vector Z component (radians/second) -# 3: Corrected Gravity vector X component (in fraction of g) -# 4: Corrected Gravity vector Y component (in fraction of g) -# 5: Corrected Gravity vector Z component (in fraction of g) -# 6: Corrected Compass vector X component (in Gauss) -# 7: Corrected Compass vector Y component (in Gauss) -# 8: Corrected Compass vector Z component (in Gauss) -# 9: Temperature Celsius -# 10: Confidence factor (1 if completely stationary down to 0 with motion) -# -# This device exports a Button_Filter interface, with the following channels: -# 0: First button (external button on the units in cases) -# 1: Second button (external button on the units in cases) -# 2-7: Other buttons (not installed at the factory) -# -# The device description for a wired device: -# vrpn_YEI_3Space_Sensor -# char name_of_this_device[] -# char port_name -# int baud_rate_of_serial_device -# int calibrate_gyros_on_startup (0 = no, 1 = yes) -# int tare_on_startup (0 = no, 1 = yes) -# double frames_per_second -# float red_LED_color to set (0-1) -# float green_LED_color to set (0-1) -# float blue_LED_color to set (0-1) -# int LED_mode (0 = standard, 1 = static) -# -# If the line ends with a backslash character '\', then the following -# line is an additional ASCII command to send to the tracker every -# time it is reset. There can be more than one such line, so long as -# each previous line ends with backslash. The commands should not include -# the beginning colon ':' character; it will be prepended automatically. -# Note that the decimal command number is used, with commas and then -# additional commands following. Also note that there must not be any -# spaces in the commands, and that there must be a space between the -# command and any trailing backslash. -# -# Note that this slash and backslash notation can only be used for the -# YEI tracker, not to extend the line for all other type of device -# listed in this configuration file. -# -# The device description for the first wireless device using a -# dongle includes the following arguments: -# vrpn_YEI_3Space_Sensor_Wireless -# char name_of_this_device[] -# int logical_id_on_wireless (0-14) -# hex serial_number (From back of device) -# char port_name -# int baud_rate_of_serial_device -# int calibrate_gyros_on_startup (0 = no, 1 = yes) -# int tare_on_startup (0 = no, 1 = yes) -# double frames_per_second -# float red_LED_color to set (0-1) -# float green_LED_color to set (0-1) -# float blue_LED_color to set (0-1) -# int LED_mode (0 = standard, 1 = static) -# -# If the line ends with a slash character '/', then the following line -# starts a description of an additional wireless device sharing the -# same dongle. -# The device description for an additional wireless device using the -# same dongle includes the following arguments: -# vrpn_YEI_3Space_Sensor_Wireless -# char name_of_this_device[] -# int logical_id_on_wireless (0-14) -# hex serial_number (From back of device) -# int calibrate_gyros_on_startup (0 = no, 1 = yes) -# int tare_on_startup (0 = no, 1 = yes) -# double frames_per_second -# float red_LED_color to set (0-1) -# float green_LED_color to set (0-1) -# float blue_LED_color to set (0-1) -# int LED_mode (0 = standard, 1 = static) -# -# Windows example, then mac example, then Linux example. Note: Ports may vary -# Note: Windows ports greater than 9 must be specified using the following -# format (smaller-numbered ones can also do this): \\.\COM21 -# Final example shows how to use an ASCII reset command to set the -# LED color (it actually just sets it to three different colors, -# the last being yellow). -############################################################################### - -#vrpn_YEI_3Space_Sensor YEI0 \\.\COM14 115200 0 0 50.0 0 0 1 0 -#vrpn_YEI_3Space_Sensor YEI0 /dev/cu.usbmodemfa131 115200 0 0 50.0 0 0 1 0 -#vrpn_YEI_3Space_Sensor YEI0 /dev/ttyACM0 115200 0 0 50.0 0 0 1 0 -#vrpn_YEI_3Space_Sensor YEI0 COM7 115200 0 0 50.0 0 0 1 0 \ -#238,1,1,1 \ -#238,1,0,1 \ -#238,1,1,0 - -#vrpn_YEI_3Space_Sensor_Wireless YEI0 0 120004F9 COM9 115200 0 0 50.0 1 0 0 1 - -#vrpn_YEI_3Space_Sensor_Wireless YEI0 0 120004F9 COM9 115200 0 0 50.0 1 0 0 1 \ -#238,1,1,0 / -#vrpn_YEI_3Space_Sensor_Wireless YEI1 1 120004FA 0 0 50.0 1 0 0 1 \ -#238,0,1,1 - diff --git a/src/vrpn/server_src/vrpn.rc b/src/vrpn/server_src/vrpn.rc deleted file mode 100644 index bb8c4f6dc67f4ae1f6e392cca5f921669a69bb4b..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn.rc +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# -# vrpn: Starts the vrpn tracking server -# -# Version: @(#) /etc/rc.d/init.d/vrpn -# -# chkconfig: 2345 95 05 -# description: Starts and stops the vrpn server at boot time and shutdown. -# -# processname: vrpn_server -# config: /usr/local/vrpn/vrpn.cfg - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -VRPN_DIR=/usr/local/vrpn -VRPN_CFG=vrpn.cfg -VRPN_ARGS="-millisleep 1 -f $VRPN_DIR/$VRPN_CFG" -VRPN=vrpn_server - -export PATH=$VRPN_DIR/bin:$PATH - -[ -f $VRPN_DIR/$VRPN_CFG ] || exit 0 -[ -x $VRPN_DIR/bin/$VRPN ] || exit 0 - -# See how we were called. -case "$1" in - start) - # Check if vrpn_server is already running - if [ ! -f /var/lock/subsys/$VRPN ]; then - echo -n "Starting vrpn server: " - $VRPN $VRPN_ARGS >/dev/null 2>&1 & - RETVAL=$? - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$VRPN - [ $RETVAL -eq 0 ] && success || failure - echo - fi - ;; - stop) - echo -n "Shutting down vrpn_server: " - killproc $VRPN - rm -f /var/lock/subsys/$VRPN - echo - ;; - status) - status $VRPN - ;; - restart) - if [ -f /var/lock/subsys/$VRPN ]; then - $0 stop - fi - $0 start - ;; - *) - echo "*** Usage: vrpn {start|stop|status|restart}" - exit 1 -esac - -exit 0 diff --git a/src/vrpn/server_src/vrpn_Generic_server_object.C b/src/vrpn/server_src/vrpn_Generic_server_object.C deleted file mode 100644 index b21ba2dddb4dbdf90c7c2ed3831c877f10a07ffd..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn_Generic_server_object.C +++ /dev/null @@ -1,5236 +0,0 @@ -#include <stdlib.h> // for strtol, atoi, strtod -#include <string.h> // for strcmp, strlen, strtok, etc -#include "vrpn_MainloopContainer.h" // for vrpn_MainloopContainer -#include <locale> // To enable setting parsing for .cfg file - -#include "timecode_generator_server/vrpn_timecode_generator.h" -#include "vrpn_3DConnexion.h" // for vrpn_3DConnexion_Navigator, etc -#include "vrpn_3DMicroscribe.h" -#include "vrpn_3Space.h" // for vrpn_Tracker_3Space -#include "vrpn_5DT16.h" // for vrpn_5dt16, etc -#include "vrpn_ADBox.h" // for vrpn_ADBox -#include "vrpn_Analog_5dt.h" // for vrpn_5dt -#include "vrpn_Analog_5dtUSB.h" -#include "vrpn_Analog.h" // for vrpn_Analog, etc -#include "vrpn_Analog_Output.h" // for vrpn_Analog_Output -#include "vrpn_Analog_Radamec_SPI.h" // for vrpn_Radamec_SPI -#include "vrpn_Analog_USDigital_A2.h" -#include "vrpn_Atmel.h" // for VRPN_ATMEL_MODE_NA, etc -#include "vrpn_Auxiliary_Logger.h" -#include "vrpn_BiosciencesTools.h" // for vrpn_BiosciencesTools -#include "vrpn_Button.h" // for vrpn_Button, etc -#include "vrpn_Button_NI_DIO24.h" -#include "vrpn_Button_USB.h" -#include "vrpn_CerealBox.h" // for vrpn_CerealBox -#include "vrpn_CHProducts_Controller_Raw.h" // for vrpn_CHProducts_Fighterstick_USB -#include "vrpn_Connection.h" -#include "vrpn_Contour.h" // for vrpn_Contour_ShuttleXpress, etc. -#include "vrpn_DevInput.h" // for vrpn_DevInput -#include "vrpn_Dial.h" // for vrpn_Dial, etc -#include "vrpn_DirectXFFJoystick.h" -#include "vrpn_DirectXRumblePad.h" -#include "vrpn_DreamCheeky.h" // for vrpn_DreamCheeky_Drum_Kit -#include "vrpn_Dyna.h" // for vrpn_Tracker_Dyna, etc -#include "vrpn_Event_Mouse.h" // for vrpn_Event_Mouse -#include "vrpn_Flock.h" // for vrpn_Tracker_Flock, etc -#include "vrpn_Flock_Parallel.h" // for vrpn_Tracker_Flock_Parallel -#include "vrpn_Freespace.h" -#include "vrpn_Futaba.h" // for vrpn_Futaba_InterLink_Elite, etc. -#include "vrpn_Generic_server_object.h" -#include "vrpn_GlobalHapticsOrb.h" // for vrpn_GlobalHapticsOrb -#include "vrpn_Griffin.h" // for vrpn_Griffin_PowerMate, etc. -#include "vrpn_IDEA.h" // for vrpn_IDEA -#include "vrpn_Imager_Stream_Buffer.h" // for vrpn_Imager_Stream_Buffer -#include "vrpn_ImmersionBox.h" // for vrpn_ImmersionBox -#include "vrpn_inertiamouse.h" // for vrpn_inertiamouse -#include "vrpn_JoyFly.h" // for vrpn_Tracker_JoyFly -#include "vrpn_Joylin.h" // for vrpn_Joylin -#include "vrpn_Joywin32.h" -#include "vrpn_Keyboard.h" // for vrpn_Keyboard -#include "vrpn_LUDL.h" // for vrpn_LUDL_USBMAC6000 -#include "vrpn_Logitech_Controller_Raw.h" // for vrpn_Logitech_Extreme_3D_Pro, etc. -#include "vrpn_Magellan.h" // for vrpn_Magellan -#include "vrpn_Microsoft_Controller_Raw.h" // for vrpn_Microsoft_Controller_Raw_Xbox_S, vrpn_Microsoft_Controller_Raw_Xbox_360, etc. -#include "vrpn_Mouse.h" // for vrpn_Button_SerialMouse, etc -#include "vrpn_NationalInstruments.h" -#include "vrpn_nikon_controls.h" // for vrpn_Nikon_Controls -#include "vrpn_OmegaTemperature.h" // for vrpn_OmegaTemperature -#include "vrpn_Phantom.h" -#include "vrpn_Poser_Analog.h" // for vrpn_Poser_AnalogParam, etc -#include "vrpn_Poser.h" // for vrpn_Poser -#include "vrpn_Poser_Tek4662.h" // for vrpn_Poser_Tek4662 -#include "vrpn_raw_sgibox.h" // for vrpn_raw_SGIBox, for access to the SGI button & dial box connected to the serial port of an linux PC -#include "vrpn_Retrolink.h" // for vrpn_Retolink_GameCube, etc. -#include "vrpn_Saitek_Controller_Raw.h" // for vrpn_Saitek_ST290_Pro, etc. -#include "vrpn_sgibox.h" //for access to the B&D box connected to an SGI via the IRIX GL drivers -#include "vrpn_Sound.h" // for vrpn_Sound -#include "vrpn_Spaceball.h" // for vrpn_Spaceball -#include "vrpn_Tng3.h" // for vrpn_Tng3 -#include "vrpn_Tracker_3DMouse.h" // for vrpn_Tracker_3DMouse -#include "vrpn_Tracker_AnalogFly.h" // for vrpn_Tracker_AnalogFlyParam, etc -#include "vrpn_Tracker_ButtonFly.h" // for vrpn_TBF_axis, etc -#include "vrpn_Tracker_Crossbow.h" // for vrpn_Tracker_Crossbow -#include "vrpn_Tracker_DTrack.h" // for vrpn_Tracker_DTrack -#include "vrpn_Tracker_Fastrak.h" // for vrpn_Tracker_Fastrak -#include "vrpn_Tracker_GameTrak.h" // for vrpn_Tracker_GameTrak -#include "vrpn_Tracker_GPS.h" // for vrpn_Tracker_GPS -#include "vrpn_Tracker.h" // for vrpn_Tracker, etc -#include "vrpn_Tracker_isense.h" -#include "vrpn_Tracker_Isotrak.h" // for vrpn_Tracker_Isotrak -#include "vrpn_Tracker_JsonNet.h" -#include "vrpn_Tracker_Liberty.h" // for vrpn_Tracker_Liberty -#include "vrpn_Tracker_LibertyHS.h" // for vrpn_Tracker_LibertyHS -#include "vrpn_Tracker_MotionNode.h" -#include "vrpn_Tracker_NDI_Polaris.h" // for vrpn_Tracker_NDI_Polaris -#include "vrpn_Tracker_NovintFalcon.h" -#include "vrpn_Tracker_OSVRHackerDevKit.h" // for vrpn_Tracker_OSVRHackerDevKit -#include "vrpn_Tracker_PDI.h" -#include "vrpn_Tracker_PhaseSpace.h" -#include "vrpn_Tracker_RazerHydra.h" // for vrpn_Tracker_RazerHydra -#include "vrpn_Tracker_Filter.h" // for vrpn_Tracker_FilterOneEuro -#include "vrpn_Tracker_SpacePoint.h" // for vrpn_Tracker_SpacePoint -#include "vrpn_Tracker_TrivisioColibri.h" // added by David Borland -#include "vrpn_Tracker_ViewPoint.h" // added by David Borland -#include "vrpn_Tracker_WiimoteHead.h" // for vrpn_Tracker_WiimoteHead -#include "vrpn_Tracker_Wintracker.h" // for vrpn_Tracker_Wintracker -#include "vrpn_Tracker_zSight.h" // added by David Borland -#include "vrpn_UNC_Joystick.h" // for vrpn_Joystick -#include "vrpn_VPJoystick.h" // for vrpn_VPJoystick -#include "vrpn_Wanda.h" // for vrpn_Wanda -#include "vrpn_WiiMote.h" -#include "vrpn_XInputGamepad.h" -#include "vrpn_Xkeys.h" // for vrpn_Xkeys_Desktop, etc -#include "vrpn_YEI_3Space.h" // for vrpn_YEI_3Space_Sensor, etc -#include "vrpn_Zaber.h" // for vrpn_Zaber - -class VRPN_API vrpn_Connection; - -/// File-static constant of max line size. -static const int LINESIZE = 512; - -#define VRPN_CONFIG_NEXT() pch += strlen(pch) + 1 - -// BUW additions -/* some helper variables to configure the vrpn_Atmel server */ -namespace setup_vrpn_Atmel { - int channel_mode[vrpn_CHANNEL_MAX]; - int channel_count = 0; -} // namespace setup_vrpn_Atmel - -#ifdef SGI_BDBOX -vrpn_SGIBox *vrpn_special_sgibox; -#endif - -void vrpn_Generic_Server_Object::closeDevices(void) -{ - _devices->clear(); - - if (verbose) { - fprintf(stderr, "\nAll devices closed...\n"); - } -} - -template <typename T> -inline int -vrpn_Generic_Server_Object::templated_setup_device_name_only(char *&pch, - char *line, FILE *) -{ - char s2[LINESIZE]; - - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s", s2) != 1) { - fprintf(stderr, "Bad line: %s\n", line); - return -1; - } - T *device = new T(s2, connection); - if (device == NULL) { - fprintf(stderr, "Can't create new device from line %s\n", line); - return -1; - } - if (verbose) { - printf("Opening %s\n", line); - } - _devices->add(device); - - return 0; // successful completion -} - -template <typename T> -inline int vrpn_Generic_Server_Object::templated_setup_HID_device_name_only( - char *&pch, char *line, FILE *) -{ - char s2[LINESIZE]; - - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s", s2) != 1) { - fprintf(stderr, "Bad line: %s\n", line); - return -1; - } -#ifdef VRPN_USE_HID - T *device = new T(s2, connection); - if (device == NULL) { - fprintf(stderr, "Can't create new device from line %s\n", line); - return -1; - } - if (verbose) { - printf("Opening %s\n", line); - } - _devices->add(device); - - return 0; // successful completion -#else - fprintf(stderr, "HID support required for device requested by line %s:\n", - line); - return -1; -#endif -} - -// setup_raw_SGIBox -// uses globals: num_sgiboxes, sgiboxes[], verbose -// imports from main: pch -// returns nonzero on error - -int vrpn_Generic_Server_Object::setup_raw_SGIBox(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char s2[LINESIZE], s3[LINESIZE]; - - // Line will be: vrpn_raw_SGIBox NAME PORT [list of buttons to toggle] - int tbutton; // Button to toggle - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s %511s", s2, s3) != 2) { - fprintf(stderr, "Bad vrpn_raw_SGIBox line: %s\n", line); - return -1; - } - - // Open the raw SGI box - if (verbose) { - printf("Opening vrpn_raw_SGIBox %s on serial port %s\n", s2, s3); - } - vrpn_raw_SGIBox *device = - _devices->add(new vrpn_raw_SGIBox(s2, connection, s3)); - - // setting listed buttons to toggles instead of default momentary - // pch=s3; - pch += strlen(s2) + 1; // advance past the name and port - pch += strlen(s3) + 1; - while (sscanf(pch, "%511s", s2) == 1) { - pch += strlen(s2) + 1; - tbutton = atoi(s2); - // set the button to be a toggle, - // and set the state of that toggle - // to 'off' - device->set_toggle(tbutton, vrpn_BUTTON_TOGGLE_OFF); - // vrpnButton class will make sure I don't set - // an invalid button number - printf("\tButton %d is toggle\n", tbutton); - } - - return 0; // successful completion -} - -int vrpn_Generic_Server_Object::setup_SGIBox(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char s2[LINESIZE]; - - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s", s2) != 1) { - fprintf(stderr, "Bad vrpn_SGIBox line: %s\n", line); - return -1; - } - - // Open the sgibox - if (verbose) { - printf("Opening vrpn_SGIBox on host %s\n", s2); - } -#ifdef SGI_BDBOX - vrpn_special_sgibox = _devices->add(new vrpn_SGIBox(s2, connection)); - - int tbutton; - // setting listed buttons to toggles instead of default momentary - pch += strlen(s2) + 1; - while (sscanf(pch, "%s", s2) == 1) { - pch += strlen(s2) + 1; - tbutton = atoi(s2); - vrpn_special_sgibox->set_toggle(tbutton, vrpn_BUTTON_TOGGLE_OFF); - // vrpnButton class will make sure I don't set - // an invalid button number - printf("Button %d toggles\n", tbutton); - } - printf("Opening vrpn_SGIBox on host %s done\n", s2); - - return 0; // successful completion -#else - fprintf(stderr, "vrpn_server: Can't open SGIbox: not an SGI! Try " - "raw_SGIbox instead.\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_Timecode_Generator(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; - - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s", s2) != 1) { - fprintf(stderr, "Bad vrpn_Timecode_Generator line: %s\n", line); - return -1; - } - -#ifdef VRPN_INCLUDE_TIMECODE_SERVER - // open the timecode generator - if (verbose) { - printf("Opening vrpn_Timecode_Generator on host %s\n", s2); - } - _devices->add(new vrpn_Timecode_Generator(s2, connection)); - return 0; // successful completion -#else - fprintf(stderr, "vrpn_server: Can't open Timecode Generator: " - "INCLUDE_TIMECODE_GENERATOR not defined in " - "vrpn_Configure.h!\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_Phantom(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[512]; // String parameters - int i1; // Integer parameters - float f1; // Float parameters - // Jean SIMARD <jean.simard@limsi.fr> - // Add the variable for the configuration name of the PHANToM interface - char sconf[512]; - - VRPN_CONFIG_NEXT(); - - // Jean SIMARD <jean.simard@limsi.fr> - // Modify the analyse of the configuration name of 'vrpn.cfg' - // The new version use the advantages of 'strtok' function - if (!(sscanf(strtok(pch, " \t"), "%511s", s2) && - sscanf(strtok(NULL, " \t"), "%d", &i1) && - sscanf(strtok(NULL, " \t"), "%f", &f1) && - sscanf(strtok(NULL, "\n"), "%511[^\n]", sconf))) { - fprintf(stderr, "Bad vrpn_Phantom line: %s\n", line); - return -1; - } - -#ifdef VRPN_USE_PHANTOM_SERVER - // Jean SIMARD <jean.simard@limsi.fr> - // Put a more verbose version when a PHANToM connection is opened. - if (verbose) { - printf("Opening vrpn_Phantom:\n"); - printf("\tVRPN name: %s\n", s2); - printf("\tConfiguration name: \"%s\"\n", sconf); - printf("\tCalibration: %s\n", ((i1 == 0) ? "no" : "yes")); - printf("\tFrequence: %.3f\n", f1); - } - - // i1 is a boolean that tells whether to let the user establish the reset - // position or not. - if (i1) { - printf("Initializing phantom, you have 10 seconds to establish reset " - "position\n"); - vrpn_SleepMsecs(10000); - } - - // Jean SIMARD <jean.simard@limsi.fr> - // Modification of the call of the constructor - _devices->add(new vrpn_Phantom(s2, connection, f1, sconf)); - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open Phantom server: " - "VRPN_USE_PHANTOM_SERVER not defined in " - "vrpn_Configure.h!\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_JoyFly(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE], s4[LINESIZE]; - - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s%511s%511s", s2, s3, s4) != 3) { - fprintf(stderr, "Bad vrpn_JoyFly line: %s\n", line); - return -1; - } - -#ifdef _WIN32 - fprintf(stderr, "JoyFly tracker not yet defined for NT\n"); - return -1; -#else - - // Open the tracker - if (verbose) - printf("Opening vrpn_Tracker_JoyFly: " - "%s on server %s with config_file %s\n", - s2, s3, s4); - - // HACK HACK HACK - // Check for illegal character leading '*' to see if it's local - if (s3[0] == '*') { - _devices->add( - new vrpn_Tracker_JoyFly(s2, connection, &s3[1], s4, connection)); - } - else { - _devices->add(new vrpn_Tracker_JoyFly(s2, connection, s3, s4)); - } - - return 0; -#endif -} - -// This function will read one line of the vrpn_AnalogFly configuration -// (matching -// one axis) and fill in the data for that axis. The axis name, the file to read -// from, and the axis to fill in are passed as parameters. It returns 0 on -// success -// and -1 on failure. - -int vrpn_Generic_Server_Object::get_AFline(char *line, vrpn_TAF_axis *axis) -{ - char _axis_name[LINESIZE]; - char *name = - new char[LINESIZE]; // We need this to stay around for the param - int channel; - float offset, thresh, power, scale; - - // Get the values from the line - if (sscanf(line, "%511s%511s%d%g%g%g%g", _axis_name, name, &channel, - &offset, &thresh, &scale, &power) != 7) { - fprintf(stderr, "AnalogFly Axis: Bad axis line\n"); - delete[] name; - return -1; - } - - if (strcmp(name, "NULL") == 0) { - delete [] name; - axis->name = NULL; - } - else { - axis->name = name; - } - axis->channel = channel; - axis->offset = offset; - axis->thresh = thresh; - axis->scale = scale; - axis->power = power; - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_AnalogFly(char *&pch, char *line, - FILE *config_file) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1; - float f1; - vrpn_Tracker_AnalogFlyParam p; - bool absolute; - bool worldFrame = VRPN_FALSE; - - VRPN_CONFIG_NEXT(); - - if (sscanf(pch, "%511s%g%511s", s2, &f1, s3) != 3) { - fprintf(stderr, "Bad vrpn_Tracker_AnalogFly line: %s\n", line); - return -1; - } - - // See if this should be absolute or differential - if (strcmp(s3, "absolute") == 0) { - absolute = vrpn_true; - } - else if (strcmp(s3, "differential") == 0) { - absolute = vrpn_false; - } - else { - fprintf( - stderr, - "vrpn_Tracker_AnalogFly: Expected 'absolute' or 'differential'\n"); - fprintf(stderr, " but got '%s'\n", s3); - return -1; - } - - if (verbose) { - printf("Opening vrpn_Tracker_AnalogFly: " - "%s with update rate %g\n", - s2, f1); - } - - // Scan the following lines in the configuration file to fill - // in the start-up parameters for the different axis. - - // parse lines until an empty line is encountered - while (1) { - char line[LINESIZE]; - - // Read in the line - if (fgets(line, LINESIZE, config_file) == NULL) { - perror("AnalogFly Can't read line!"); - return -1; - } - - // if it is an empty line, finish parsing - if (line[0] == '\n') { - break; - } - - // get the first token - char tok[LINESIZE]; - sscanf(line, "%511s", tok); - - if (strcmp(tok, "X") == 0) { - if (get_AFline(line, &p.x)) { - fprintf(stderr, "Can't read X line for AnalogFly\n"); - return -1; - } - } - else if (strcmp(tok, "Y") == 0) { - if (get_AFline(line, &p.y)) { - fprintf(stderr, "Can't read Y line for AnalogFly\n"); - return -1; - } - } - else if (strcmp(tok, "Z") == 0) { - if (get_AFline(line, &p.z)) { - fprintf(stderr, "Can't read Z line for AnalogFly\n"); - return -1; - } - } - else if (strcmp(tok, "RX") == 0) { - if (get_AFline(line, &p.sx)) { - fprintf(stderr, "Can't read RX line for AnalogFly\n"); - return -1; - } - } - else if (strcmp(tok, "RY") == 0) { - if (get_AFline(line, &p.sy)) { - fprintf(stderr, "Can't read RY line for AnalogFly\n"); - return -1; - } - } - else if (strcmp(tok, "RZ") == 0) { - if (get_AFline(line, &p.sz)) { - fprintf(stderr, "Can't read RZ line for AnalogFly\n"); - return -1; - } - } - else if (strcmp(tok, "RESET") == 0) { - // Read the reset line - if (sscanf(line, "RESET %511s%d", s3, &i1) != 2) { - fprintf(stderr, "Bad RESET line in AnalogFly: %s\n", line); - return -1; - } - - if (strcmp(s3, "NULL") != 0) { - p.reset_name = strdup(s3); - p.reset_which = i1; - } - } - else if (strcmp(tok, "CLUTCH") == 0) { - if (sscanf(line, "CLUTCH %511s%d", s3, &i1) != 2) { - fprintf(stderr, "Bad CLUTCH line in AnalogFly: %s\n", line); - return -1; - } - - if (strcmp(s3, "NULL") != 0) { - p.clutch_name = strdup(s3); - p.clutch_which = i1; - } - } - else if (strcmp(tok, "WORLDFRAME") == 0) { - if (verbose) { - printf("Enabling world-frame mode\n"); - } - worldFrame = VRPN_TRUE; - } - } - - _devices->add(new vrpn_Tracker_AnalogFly(s2, connection, &p, f1, absolute, - false, worldFrame)); - if (p.x.name != NULL) { delete [] p.x.name; } - if (p.y.name != NULL) { delete [] p.y.name; } - if (p.z.name != NULL) { delete [] p.z.name; } - if (p.sx.name != NULL) { delete [] p.sx.name; } - if (p.sy.name != NULL) { delete [] p.sy.name; } - if (p.sz.name != NULL) { delete [] p.sz.name; } - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_ButtonFly(char *&pch, char *line, - FILE *config_file) -{ - char s2[LINESIZE], s3[LINESIZE]; - float f1; - vrpn_Tracker_ButtonFlyParam p; - - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s%g", s2, &f1) != 2) { - fprintf(stderr, "Bad vrpn_Tracker_ButtonFly line: %s\n", line); - return -1; - } - - if (verbose) { - printf("Opening vrpn_Tracker_ButtonFly " - "%s with update rate %g\n", - s2, f1); - } - - // Scan the following lines in the configuration file to fill - // in the start-up parameters for the different axes and the - // analog velocity and rotational velocity setters. The last - // line is "end". - - while (1) { - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf(stderr, "Ran past end of config file in ButtonFly\n"); - return -1; - } - if (sscanf(line, "%511s", s3) != 1) { - fprintf(stderr, "Bad line in config file in ButtonFly\n"); - return -1; - } - if (strcmp(s3, "end") == 0) { - break; // Done with reading the parameters - } - else if (strcmp(s3, "absolute") == 0) { - char name[200]; //< Name of the button device to read from - int which; //< Which button to read from - float x, y, z, rx, ry, rz; //< Position and orientation - vrpn_TBF_axis axis; //< Axis to add to the ButtonFly - - if (sscanf(line, "absolute %199s%d%g%g%g%g%g%g", name, &which, &x, - &y, &z, &rx, &ry, &rz) != 8) { - fprintf(stderr, "ButtonFly: Bad absolute line\n"); - return -1; - } - - float vec[3], rot[3]; - vec[0] = x; - vec[1] = y; - vec[2] = z; - rot[0] = rx; - rot[1] = ry; - rot[2] = rz; - axis.absolute = true; - memcpy(axis.name, name, sizeof(axis.name)); - axis.channel = which; - memcpy(axis.vec, vec, sizeof(axis.vec)); - memcpy(axis.rot, rot, sizeof(axis.rot)); - - if (!p.add_axis(axis)) { - fprintf( - stderr, - "ButtonFly: Could not add absolute axis to parameters\n"); - return -1; - } - } - else if (strcmp(s3, "differential") == 0) { - char name[200]; //< Name of the button device to read from - int which; //< Which button to read from - float x, y, z, rx, ry, rz; //< Position and orientation - vrpn_TBF_axis axis; //< Axis to add to the ButtonFly - - if (sscanf(line, "differential %199s%d%g%g%g%g%g%g", name, &which, - &x, &y, &z, &rx, &ry, &rz) != 8) { - fprintf(stderr, "ButtonFly: Bad differential line\n"); - return -1; - } - - float vec[3], rot[3]; - vec[0] = x; - vec[1] = y; - vec[2] = z; - rot[0] = rx; - rot[1] = ry; - rot[2] = rz; - axis.absolute = false; - memcpy(axis.name, name, sizeof(axis.name)); - axis.channel = which; - memcpy(axis.vec, vec, sizeof(axis.vec)); - memcpy(axis.rot, rot, sizeof(axis.rot)); - - if (!p.add_axis(axis)) { - fprintf(stderr, "ButtonFly: Could not add differential axis to " - "parameters\n"); - return -1; - } - } - else if (strcmp(s3, "vel_scale") == 0) { - char name[200]; //< Name of the analog device to read from - int channel; //< Which analog channel to read from - float offset, scale, power; //< Parameters to apply - - if (sscanf(line, "vel_scale %199s%d%g%g%g", name, &channel, &offset, - &scale, &power) != 5) { - fprintf(stderr, "ButtonFly: Bad vel_scale line\n"); - return -1; - } - - memcpy(p.vel_scale_name, name, sizeof(p.vel_scale_name)); - p.vel_scale_channel = channel; - p.vel_scale_offset = offset; - p.vel_scale_scale = scale; - p.vel_scale_power = power; - } - else if (strcmp(s3, "rot_scale") == 0) { - char name[200]; //< Name of the analog device to read from - int channel; //< Which analog channel to read from - float offset, scale, power; //< Parameters to apply - - if (sscanf(line, "rot_scale %199s%d%g%g%g", name, &channel, &offset, - &scale, &power) != 5) { - fprintf(stderr, "ButtonFly: Bad rot_scale line\n"); - return -1; - } - - memcpy(p.rot_scale_name, name, sizeof(p.rot_scale_name)); - p.rot_scale_channel = channel; - p.rot_scale_offset = offset; - p.rot_scale_scale = scale; - p.rot_scale_power = power; - } - } - - _devices->add(new vrpn_Tracker_ButtonFly(s2, connection, &p, f1)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Joystick(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1; - - float fhz; - // Get the arguments - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s%511s%d %f", s2, s3, &i1, &fhz) != 4) { - fprintf(stderr, "Bad vrpn_Joystick line: %s\n", line); - return -1; - } - - // Open the joystick server - if (verbose) - printf("Opening vrpn_Joystick: " - "%s on port %s baud %d, min update rate = %.2f\n", - s2, s3, i1, fhz); - _devices->add(new vrpn_Joystick(s2, connection, s3, i1, fhz)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Example_Button(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; - int i1; - float f1; - - VRPN_CONFIG_NEXT(); - - // Get the arguments (class, device_name, number_of_buttone, toggle_rate) - if (sscanf(pch, "%511s%d%g", s2, &i1, &f1) != 3) { - fprintf(stderr, "Bad vrpn_Button_Example line: %s\n", line); - return -1; - } - - // Open the button - if (verbose) - printf( - "Opening vrpn_Button_Example: %s with %d sensors, toggle rate %f\n", - s2, i1, f1); - _devices->add(new vrpn_Button_Example_Server(s2, connection, i1, f1)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Example_Dial(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; - int i1; - float f1, f2; - - VRPN_CONFIG_NEXT(); - - // Get the arguments (class, dial_name, dials, spin_rate, update_rate) - if (sscanf(pch, "%511s%d%g%g", s2, &i1, &f1, &f2) != 4) { - fprintf(stderr, "Bad vrpn_Dial_Example line: %s\n", line); - return -1; - } - - // Open the dial - if (verbose) - printf("Opening vrpn_Dial_Example: %s with %d sensors, spinrate %f, " - "update %f\n", - s2, i1, f1, f2); - _devices->add(new vrpn_Dial_Example_Server(s2, connection, i1, f1, f2)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_CerealBox(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1, i2, i3, i4; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, serialbox_name, port, baud, numdig, - // numana, numenc) - if (sscanf(pch, "%511s%511s%d%d%d%d", s2, s3, &i1, &i2, &i3, &i4) != 6) { - fprintf(stderr, "Bad vrpn_Cereal line: %s\n", line); - return -1; - } - - // Open the box - if (verbose) - printf("Opening vrpn_Cereal: %s on port %s, baud %d, %d dig, " - " %d ana, %d enc\n", - s2, s3, i1, i2, i3, i4); - _devices->add(new vrpn_CerealBox(s2, connection, s3, i1, i2, i3, i4)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Magellan(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE], s4[LINESIZE]; - int i1; - int ret; - bool altreset = false; - - VRPN_CONFIG_NEXT(); - - // Get the arguments (class, magellan_name, port, baud, [optionally - // "altreset"] - if ((ret = sscanf(pch, "%511s%511s%d%511s", s2, s3, &i1, s4)) < 3) { - fprintf(stderr, "Bad vrpn_Magellan line: %s\n", line); - return -1; - } - - // See if we are using alternate reset line - if (ret == 4) { - if (strcmp(s4, "altreset") == 0) { - altreset = true; - } - else { - fprintf(stderr, "Bad vrpn_Magellan line: %s\n", line); - return -1; - } - } - - // Open the device - if (verbose) { - printf("Opening vrpn_Magellan: %s on port %s, baud %d\n", s2, s3, i1); - } - _devices->add(new vrpn_Magellan(s2, connection, s3, i1, altreset)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Spaceball(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, magellan_name, port, baud - if (sscanf(pch, "%511s%511s%d", s2, s3, &i1) != 3) { - fprintf(stderr, "Bad vrpn_Spaceball line: %s\n", line); - return -1; - } - - // Open the device - if (verbose) - printf("Opening vrpn_Spaceball: %s on port %s, baud %d\n", s2, s3, i1); - _devices->add(new vrpn_Spaceball(s2, connection, s3, i1)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Radamec_SPI(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, Radamec_name, port, baud - if (sscanf(pch, "%511s%511s%d", s2, s3, &i1) != 3) { - fprintf(stderr, "Bad vrpn_Radamec_SPI line: %s\n", line); - return -1; - } - - // Open the device - if (verbose) - printf("Opening vrpn_Radamec_SPI: %s on port %s, baud %d\n", s2, s3, - i1); - _devices->add(new vrpn_Radamec_SPI(s2, connection, s3, i1)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Zaber(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, Radamec_name, port, baud - if (sscanf(pch, "%511s%511s", s2, s3) != 2) { - fprintf(stderr, "Bad vrpn_Zaber: %s\n", line); - return -1; - } - - // Open the device - if (verbose) { - printf("Opening vrpn_Zaber: %s on port %s\n", s2, s3); - } - _devices->add(new vrpn_Zaber(s2, connection, s3)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_BiosciencesTools(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1; - float f1, f2; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, Radamec_name, port, baud - if (sscanf(pch, "%511s%511s%g%g%i", s2, s3, &f1, &f2, &i1) != 5) { - fprintf(stderr, "Bad vrpn_BiosciencesTools: %s\n", line); - return -1; - } - - // Open the device - if (verbose) { - printf("Opening vrpn_BiosciencesTools: %s on port %s\n", s2, s3); - printf(" Temperatures: %g %g, control %d\n", f1, f2, i1); - } - _devices->add( - new vrpn_BiosciencesTools(s2, connection, s3, f1, f2, (i1 != 0))); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_OmegaTemperature(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1; - float f1, f2; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, Radamec_name, port, baud - if (sscanf(pch, "%511s%511s%g%g%i", s2, s3, &f1, &f2, &i1) != 5) { - fprintf(stderr, "Bad vrpn_OmegaTemperature: %s\n", line); - return -1; - } - - // Open the device - if (verbose) { - printf("Opening vrpn_OmegaTemperature: %s on port %s\n", s2, s3); - printf(" Temperatures: %g %g, control %d\n", f1, f2, i1); - } -#if defined(VRPN_USE_MODBUS) && defined(VRPN_USE_WINSOCK2) - _devices->add( - new vrpn_OmegaTemperature(s2, connection, s3, f1, f2, (i1 != 0))); -#else - fprintf(stderr, "setup_OmegaTemperature: Modbus or Winsock2 support not " - "configured in VRPN, edit vrpn_Configure.h and rebuild\n"); - return -1; -#endif - - return 0; -} - -int vrpn_Generic_Server_Object::setup_IDEA(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int run_speed, start_speed, end_speed, accel_rate, decel_rate; - int run_current, hold_current, accel_current, decel_current; - int delay, step, high_limit, low_limit; - int output_1, output_2, output_3, output_4; - double initial_move, fractional_c_a; - double reset_location; - - VRPN_CONFIG_NEXT(); - - // Get the arguments (class, Radamec_name, port, baud - if (sscanf(pch, "%511s%511s%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%lf%lf%lf", s2, - s3, &run_speed, &start_speed, &end_speed, &accel_rate, - &decel_rate, &run_current, &hold_current, &accel_current, - &decel_current, &delay, &step, &high_limit, &low_limit, - &output_1, &output_2, &output_3, &output_4, &initial_move, - &fractional_c_a, &reset_location) != 22) { - fprintf(stderr, "Bad vrpn_IDEA: %s\n", line); - return -1; - } - - // Open the device - if (verbose) { - printf("Opening vrpn_IDEA: %s on port %s\n", s2, s3); - } - _devices->add(new vrpn_IDEA( - s2, connection, s3, run_speed, start_speed, end_speed, accel_rate, - decel_rate, run_current, hold_current, accel_current, decel_current, - delay, step, high_limit, low_limit, output_1, output_2, output_3, - output_4, initial_move, fractional_c_a, reset_location)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_NationalInstrumentsOutput( - char *&pch, char *line, FILE * /*config_file*/) -{ - - fprintf(stderr, "Warning: vrpn_NI_Analog_Output is deprecated: use " - "vrpn_National_Instruments instead\n"); - char s2[LINESIZE], s3[LINESIZE]; - int i1, i2; - float f1, f2; - - VRPN_CONFIG_NEXT(); - // Get the arguments (vrpn_name, NI_board_type, num_channels, polarity, - // min_voltage, max_voltage - if (sscanf(pch, "%511s%511s%d%d%f%f", s2, s3, &i1, &i2, &f1, &f2) != 6) { - fprintf(stderr, "Bad vrpn_NI_Analog_Output: %s\n", line); - return -1; - } - -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS - // Open the device - if (verbose) { - printf("Opening vrpn_NI_Analog_Output: %s with %d channels\n", s2, i1); - } - _devices->add(new vrpn_Analog_Output_Server_NI(s2, connection, s3, i1, - i2 != 0, f1, f2)); - - return 0; -#else - fprintf( - stderr, - "Attempting to use National Instruments board, but not compiled in\n"); - fprintf( - stderr, - " (Define VRPN_USE_NATIONAL_INSTRUMENTS in vrpn_Configuration.h\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_NationalInstruments( - char *&pch, char *line, FILE * /*config_file*/) -{ - - char s2[LINESIZE], s3[LINESIZE]; - int num_in_channels, in_polarity, in_mode, in_range, in_drive_ais, in_gain; - int num_out_channels, out_polarity; - float minimum_delay, min_out_voltage, max_out_voltage; - - VRPN_CONFIG_NEXT(); - // Get the arguments (vrpn_name, NI_board_type, - // num_in_channels, minimum_delay, in_polarity, in_mode, in_range, - // in_drive_ais, in_gain - // num_out_channels, out_polarity, min_out_voltage, max_out_voltage - if (sscanf(pch, "%511s%511s%d%f%d%d%d%d%d%d%d%f%f", s2, s3, - &num_in_channels, &minimum_delay, &in_polarity, &in_mode, - &in_range, &in_drive_ais, &in_gain, &num_out_channels, - &out_polarity, &min_out_voltage, &max_out_voltage) != 13) { - fprintf(stderr, "Bad vrpn_National_Instruments_Server: %s\n", line); - return -1; - } - -#if defined(VRPN_USE_NATIONAL_INSTRUMENTS) || \ - defined(VRPN_USE_NATIONAL_INSTRUMENTS_MX) - // Open the device - if (verbose) { - printf("Opening vrpn_National_Instruments_Server: %s with %d in and %d " - "out channels\n", - s2, num_in_channels, num_out_channels); - printf(" MinDelay %f, In polarity %d, In mode %d, In range %d\n", - minimum_delay, in_polarity, in_mode, in_range); - printf(" In driveAIS %d, In gain %d\n", in_drive_ais, in_gain); - printf(" Out polarity %d, Min out voltage %f, Max out voltage %f\n", - out_polarity, min_out_voltage, max_out_voltage); - } - _devices->add(new vrpn_National_Instruments_Server( - s2, connection, s3, num_in_channels, num_out_channels, minimum_delay, - in_polarity != 0, in_mode, in_range, in_drive_ais != 0, in_gain, - out_polarity != 0, min_out_voltage, max_out_voltage)); - - return 0; -#else - fprintf( - stderr, - "Attempting to use National Instruments board, but not compiled in\n"); - fprintf( - stderr, - " (Define VRPN_USE_NATIONAL_INSTRUMENTS in vrpn_Configuration.h\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_ImmersionBox(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1, i2, i3, i4; - VRPN_CONFIG_NEXT(); - // Get the arguments (class, iboxbox_name, port, baud, numdig, - // numana, numenc) - if (sscanf(pch, "%511s%511s%d%d%d%d", s2, s3, &i1, &i2, &i3, &i4) != 6) { - fprintf(stderr, "Bad vrpn_ImmersionBox line: %s\n", line); - return -1; - } - - // Open the box - if (verbose) - printf("Opening vrpn_ImmersionBox: %s on port %s, baud %d, %d digital, " - " %d analog, %d encoders\n", - s2, s3, i1, i2, i3, i4); - - _devices->add(new vrpn_ImmersionBox(s2, connection, s3, i1, i2, i3, i4)); - return 0; -} - -int vrpn_Generic_Server_Object::setup_5dt(char *&pch, char *line, - FILE * /*config_file*/) -{ - char name[LINESIZE], device[LINESIZE]; - int baud_rate, mode, tenbytes; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, 5DT_name, port, baud - if (sscanf(pch, "%511s%511s%d%d%d", name, device, &baud_rate, &mode, - &tenbytes) != 5) { - fprintf(stderr, "Bad vrpn_5dt line: %s\n", line); - return -1; - } - - // Open the device - if (verbose) { - printf("Opening vrpn_5dt: %s on port %s, baud %d\n", name, device, - baud_rate); - } - _devices->add( - new vrpn_5dt(name, connection, device, baud_rate, mode, tenbytes != 0)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_5dt16(char *&pch, char *line, - FILE * /*config_file*/) -{ - char name[LINESIZE], device[LINESIZE]; - int baud_rate; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, 5DT_name, port, baud - if (sscanf(pch, "%511s%511s%d", name, device, &baud_rate) != 3) { - fprintf(stderr, "Bad vrpn_5dt16 line: %s\n", line); - return -1; - } - - // Open the device - if (verbose) { - printf("Opening vrpn_5dt16: %s on port %s, baud %d\n", name, device, - baud_rate); - } - _devices->add(new vrpn_5dt16(name, connection, device, baud_rate)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Button_USB(char *&pch, char *line, - FILE * /*config_file*/) -{ - char name[LINESIZE], deviceName[LINESIZE]; - - VRPN_CONFIG_NEXT(); - // Get the arguments (button_name) - if (sscanf(pch, "%511s%511s", name, deviceName) != 2) { - fprintf(stderr, "Bad vrpn_Button_USB line: %s\n", line); - return -1; - } - - // Open the button - if (verbose) { - printf("Opening vrpn_Button_USB: %s \n", name); - } -#ifdef _WIN32 - _devices->add(new vrpn_Button_USB(name, deviceName, connection)); - return 0; -#else - printf("vrpn_Button_USB only compiled for Windows.\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_Button_5DT_Server(char *&pch, char *line, - FILE * /*config_file*/) -{ - char name[LINESIZE], deviceName[LINESIZE]; - double center[16]; - - VRPN_CONFIG_NEXT(); - // Get the arguments (button_name) - if (sscanf(pch, - "%511s%511s%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf", - name, deviceName, ¢er[0], ¢er[1], ¢er[2], ¢er[3], - ¢er[4], ¢er[5], ¢er[6], ¢er[7], ¢er[8], - ¢er[9], ¢er[10], ¢er[11], ¢er[12], ¢er[13], - ¢er[14], ¢er[15]) != 18) { - fprintf(stderr, "Bad vrpn_Button_5dt_Server line: %s\n", line); - return -1; - } - - // Open the button - if (verbose) { - printf("Opening vrpn_Button_5dt_Server: %s \n", name); - } - _devices->add( - new vrpn_Button_5DT_Server(name, deviceName, connection, center)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Wanda(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1; - - float fhz; - // Get the arguments Name, Serial_Port, Baud_Rate, Min_Update_Rate - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s%511s%d %f", s2, s3, &i1, &fhz) != 4) { - fprintf(stderr, "Bad vrpn_Wanda line: %s\n", line); - return -1; - } - - // Create the server - if (verbose) - printf("Opening vrpn_Wanda: " - "%s on port %s baud %d, min update rate = %.2f\n", - s2, s3, i1, fhz); - - _devices->add(new vrpn_Wanda(s2, connection, s3, i1, fhz)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_Dyna(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1, i2; - int ret; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, tracker_name, sensors, port, baud) - if ((ret = sscanf(pch, "%511s%d%511s%d", s2, &i2, s3, &i1)) != 4) { - fprintf(stderr, "Bad vrpn_Tracker_Dyna line (ret %d): %s\n", ret, line); - return -1; - } - - // Open the tracker - if (verbose) - printf("Opening vrpn_Tracker_Dyna: %s on port %s, baud %d, " - "%d sensors\n", - s2, s3, i1, i2); - _devices->add(new vrpn_Tracker_Dyna(s2, connection, i2, s3, i1)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_3DMouse(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE], s4[LINESIZE]; - int i1; - int filtering_count = 1; - int numparms; - - VRPN_CONFIG_NEXT(); - - // Get the arguments (class, tracker_name, port, baud, [optional - // filtering_count]) - if ((numparms = sscanf(pch, "%511s%511s%d%511s", s2, s3, &i1, s4)) < 3) { - fprintf(stderr, "Bad vrpn_Tracker_3DMouse line: %s\n%s %s\n", line, pch, - s3); - return -1; - } - - // See if we got the optional parameter to set the filtering count - if (numparms == 4) { - filtering_count = atoi(s4); - if (filtering_count < 1 || filtering_count > 5) { - fprintf(stderr, "3DMouse: Bad filtering count optional param " - "(expected 1-5, got '%s')\n", - s4); - return -1; - } - } - - // Open the tracker - if (verbose) { - printf("Opening vrpn_Tracker_3DMouse: %s on port %s, baud %d\n", s2, s3, - i1); - } - - _devices->add( - new vrpn_Tracker_3DMouse(s2, connection, s3, i1, filtering_count)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_NovintFalcon( - char *&pch, char *line, FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE], s4[LINESIZE], s5[LINESIZE]; - int i1; - int numparms; - - VRPN_CONFIG_NEXT(); - - // Get the arguments (class, tracker_name, device id, grip, kinematics, - // damp) - if ((numparms = - sscanf(pch, "%511s%d%511s%511s%511s", s2, &i1, s3, s4, s5)) < 2) { - fprintf(stderr, - "Bad vrpn_Tracker_NovintFalcon line: %s\n%s %s %s %s %s\n", - line, pch, s2, s3, s4, s5); - return -1; - } - - // set damping to 0.9. - if (numparms < 5) { - strcpy(s5, "0.9"); - } - // set kinematics model to "stamper", if not set - if (numparms < 4) { - strcpy(s4, "stamper"); - } - // set grip to "4-button" (the default one), if not set. - if (numparms < 3) { - strcpy(s3, "4-button"); - } - -#if defined(VRPN_USE_LIBNIFALCON) - // Open the tracker - if (verbose) { - printf("Opening vrpn_Tracker_NovintFalcon: %s device: %d, grip: %s, " - "kinematics: %s damping: %s\n", - s2, i1, s3, s4, s5); - } - - _devices->add( - new vrpn_Tracker_NovintFalcon(s2, connection, i1, s3, s4, s5)); - return 0; -#else - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_Tracker_Fastrak(char *&pch, char *line, - FILE *config_file) -{ - - char s2[LINESIZE], s3[LINESIZE], s4[LINESIZE]; - int i1; - int numparms; - int do_is900_timing = 0; - - char rcmd[5000]; // Reset command to send to Fastrak - VRPN_CONFIG_NEXT(); - // Get the arguments (class, tracker_name, port, baud, [optional IS900time]) - if ((numparms = sscanf(pch, "%511s%511s%d%511s", s2, s3, &i1, s4)) < 3) { - fprintf(stderr, "Bad vrpn_Tracker_Fastrak line: %s\n%s %s\n", line, pch, - s3); - return -1; - } - - // See if we got the optional parameter to enable IS900 timings - if (numparms == 4) { - if (strncmp(s4, "IS900time", strlen("IS900time")) == 0) { - do_is900_timing = 1; - printf(" ...using IS900 timing information\n"); - } - else if (strcmp(s4, "/") == 0) { - // Nothing to do - } - else if (strcmp(s4, "\\") == 0) { - // Nothing to do - } - else { - fprintf(stderr, "Fastrak/Isense: Bad timing optional param " - "(expected 'IS900time', got '%s')\n", - s4); - return -1; - } - } - - // If the last character in the line is a backslash, '\', then - // the following line is an additional command to send to the - // Fastrak at reset time. So long as we find lines with slashes - // at the ends, we add them to the command string to send. Note - // that there is a newline at the end of the line, following the - // backslash. - rcmd[0] = 0; - while (line[strlen(line) - 2] == '\\') { - // Read the VRPN_CONFIG_NEXT line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf( - stderr, - "Ran past end of config file in Fastrak/Isense description\n"); - return -1; - } - - // Copy the line into the remote command, - // then replace \ with \015 if present - // In any case, make sure we terminate with \015. - strncat(rcmd, line, LINESIZE); - if (rcmd[strlen(rcmd) - 2] == '\\') { - rcmd[strlen(rcmd) - 2] = '\015'; - rcmd[strlen(rcmd) - 1] = '\0'; - } - else if (rcmd[strlen(rcmd) - 2] == '/') { - rcmd[strlen(rcmd) - 2] = '\015'; - rcmd[strlen(rcmd) - 1] = '\0'; - } - else if (rcmd[strlen(rcmd) - 1] == '\n') { - rcmd[strlen(rcmd) - 1] = '\015'; - } - else { // Add one, we reached the EOF before CR - rcmd[strlen(rcmd) + 1] = '\0'; - rcmd[strlen(rcmd)] = '\015'; - } - } - - if (strlen(rcmd) > 0) { - printf("... additional reset commands follow:\n"); - printf("%s\n", rcmd); - } - - // Open the tracker - if (verbose) - printf("Opening vrpn_Tracker_Fastrak: %s on port %s, baud %d\n", s2, s3, - i1); - - vrpn_Tracker_Fastrak *mytracker = new vrpn_Tracker_Fastrak( - s2, connection, s3, i1, 1, 4, rcmd, do_is900_timing); - // If the last character in the line is a front slash, '/', then - // the following line is a command to add a Wand or Stylus to one - // of the sensors on the tracker. Read and parse the line after, - // then add the devices needed to support. Each line has two - // arguments, the string name of the devices and the integer - // sensor number (starting with 0) to attach the device to. - while (line[strlen(line) - 2] == '/') { - char lineCommand[LINESIZE]; - char lineName[LINESIZE]; - int lineSensor; - - // Read the next line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf( - stderr, - "Ran past end of config file in Fastrak/Isense description\n"); - delete mytracker; - return -1; - } - - // Parse the line. Both "Wand" and "Stylus" lines start with the name - // and sensor # - if (sscanf(line, "%511s%511s%d", lineCommand, lineName, &lineSensor) != - 3) { - fprintf( - stderr, - "Bad line in Wand/Stylus description for Fastrak/Isense (%s)\n", - line); - delete mytracker; - return -1; - } - - // See which command it is and act accordingly - if (strcmp(lineCommand, "Wand") == 0) { - double c0min, c0lo0, c0hi0, c0max; - double c1min, c1lo0, c1hi0, c1max; - - // Wand line has additional scale/clip information; read it in - if (sscanf(line, "%511s%511s%d%lf%lf%lf%lf%lf%lf%lf%lf", - lineCommand, lineName, &lineSensor, &c0min, &c0lo0, - &c0hi0, &c0max, &c1min, &c1lo0, &c1hi0, &c1max) != 11) { - fprintf( - stderr, - "Bad line in Wand description for Fastrak/Isense (%s)\n", - line); - delete mytracker; - return -1; - } - - if (mytracker->add_is900_analog(lineName, lineSensor, c0min, c0lo0, - c0hi0, c0max, c1min, c1lo0, c1hi0, - c1max)) { - fprintf(stderr, - "Cannot set Wand analog for Fastrak/Isense (%s)\n", - line); - delete mytracker; - return -1; - } - if (mytracker->add_is900_button(lineName, lineSensor, 6)) { - fprintf(stderr, - "Cannot set Wand buttons for Fastrak/Isense (%s)\n", - line); - delete mytracker; - return -1; - } - printf(" ...added Wand (%s) to sensor %d\n", lineName, lineSensor); - } - else if (strcmp(lineCommand, "Stylus") == 0) { - if (mytracker->add_is900_button(lineName, lineSensor, 2)) { - fprintf(stderr, - "Cannot set Stylus buttons for Fastrak/Isense (%s)\n", - line); - delete mytracker; - return -1; - } - printf(" ...added Stylus (%s) to sensor %d\n", lineName, - lineSensor); - } - else if (strcmp(lineCommand, "FTStylus") == 0) { - if (mytracker->add_fastrak_stylus_button(lineName, lineSensor, 1)) { - fprintf(stderr, "Cannot set Stylus buttons for Fastrak (%s)\n", - line); - delete mytracker; - return -1; - } - printf(" ...added FTStylus (%s) to sensor %d\n", lineName, - lineSensor); - } - else { - fprintf(stderr, "Unknown command in Wand/Stylus description for " - "Fastrak/Isense (%s)\n", - lineCommand); - delete mytracker; - return -1; - } - } - - _devices->add(mytracker); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_Isotrak(char *&pch, char *line, - FILE *config_file) -{ - - char s2[LINESIZE], s3[LINESIZE], s4[LINESIZE]; - int i1; - int numparms; - - char rcmd[5000]; // Reset command to send to Fastrak - VRPN_CONFIG_NEXT(); - // Get the arguments (class, tracker_name, port, baud, [optional IS900time]) - if ((numparms = sscanf(pch, "%511s%511s%d%511s", s2, s3, &i1, s4)) < 3) { - fprintf(stderr, "Bad vrpn_Tracker_Isotrak line: %s\n%s %s\n", line, pch, - s3); - return -1; - } - - // If the last character in the line is a backslash, '\', then - // the following line is an additional command to send to the - // Fastrak at reset time. So long as we find lines with slashes - // at the ends, we add them to the command string to send. Note - // that there is a newline at the end of the line, following the - // backslash. - rcmd[0] = 0; - while (line[strlen(line) - 2] == '\\') { - // Read the next line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf(stderr, - "Ran past end of config file in Isotrak description\n"); - return -1; - } - - // Copy the line into the remote command, - // then replace \ with \015 if present - // In any case, make sure we terminate with \015. - strncat(rcmd, line, LINESIZE); - if (rcmd[strlen(rcmd) - 2] == '\\') { - rcmd[strlen(rcmd) - 2] = '\015'; - rcmd[strlen(rcmd) - 1] = '\0'; - } - else if (rcmd[strlen(rcmd) - 2] == '/') { - rcmd[strlen(rcmd) - 2] = '\015'; - rcmd[strlen(rcmd) - 1] = '\0'; - } - else if (rcmd[strlen(rcmd) - 1] == '\n') { - rcmd[strlen(rcmd) - 1] = '\015'; - } - else { // Add one, we reached the EOF before CR - rcmd[strlen(rcmd) + 1] = '\0'; - rcmd[strlen(rcmd)] = '\015'; - } - } - - if (strlen(rcmd) > 0) { - printf("... additional reset commands follow:\n"); - printf("%s\n", rcmd); - } - - // Open the tracker - if (verbose) - printf("Opening vrpn_Isotrak: %s on port %s, baud %d\n", s2, s3, i1); - - vrpn_Tracker_Isotrak *mytracker = - new vrpn_Tracker_Isotrak(s2, connection, s3, i1, 1, 4, rcmd); - // If the last character in the line is a front slash, '/', then - // the following line is a command to add a Wand or Stylus to one - // of the sensors on the tracker. Read and parse the line after, - // then add the devices needed to support. Each line has two - // arguments, the string name of the devices and the integer - // sensor number (starting with 0) to attach the device to. - while (line[strlen(line) - 2] == '/') { - char lineCommand[LINESIZE]; - char lineName[LINESIZE]; - int lineSensor; - - // Read the next line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf( - stderr, - "Ran past end of config file in Fastrak/Isense description\n"); - delete mytracker; - return -1; - } - - // Parse the line. Both "Wand" and "Stylus" lines start with the name - // and sensor # - if (sscanf(line, "%511s%511s%d", lineCommand, lineName, &lineSensor) != - 3) { - fprintf( - stderr, - "Bad line in Wand/Stylus description for Fastrak/Isense (%s)\n", - line); - delete mytracker; - return -1; - } - - // CBO: Added support to Isotrak stylus - if (strcmp(lineCommand, "Stylus") == 0) { - if (mytracker->add_stylus_button(lineName, lineSensor)) { - fprintf(stderr, "Cannot set Stylus buttons for Isotrak (%s)\n", - line); - delete mytracker; - return -1; - } - printf(" ...added Stylus (%s) to sensor %d\n", lineName, - lineSensor); - } - else { - fprintf(stderr, - "Unknown command in Stylus description for Isotrak (%s)\n", - lineCommand); - delete mytracker; - return -1; - } - } - - _devices->add(mytracker); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_Liberty(char *&pch, char *line, - FILE *config_file) -{ - - char s2[LINESIZE], s3[LINESIZE]; - int i1, i2; - vrpn_Tracker_Liberty *mytracker; - int numparms; - - char rcmd[5000]; // Reset command to send to Liberty - VRPN_CONFIG_NEXT(); - // Get the arguments (class, tracker_name, port, baud, [whoami_len]) - numparms = sscanf(pch, "%511s%511s%d%d", s2, s3, &i1, &i2); - if (numparms < 3) { - fprintf(stderr, "Bad vrpn_Tracker_Liberty line: %s\n%s %s\n", line, pch, - s3); - return -1; - } - - // If the last character in the line is a backslash, '\', then - // the following line is an additional command to send to the - // Liberty at reset time. So long as we find lines with slashes - // at the ends, we add them to the command string to send. Note - // that there is a newline at the end of the line, following the - // backslash. - rcmd[0] = 0; - while (line[strlen(line) - 2] == '\\') { - // Read the next line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf(stderr, - "Ran past end of config file in Liberty description\n"); - return -1; - } - - // Copy the line into the remote command, - // then replace \ with \015 if present - // In any case, make sure we terminate with \015. - strncat(rcmd, line, LINESIZE); - if (rcmd[strlen(rcmd) - 2] == '\\') { - rcmd[strlen(rcmd) - 2] = '\015'; - rcmd[strlen(rcmd) - 1] = '\0'; - } - else if (rcmd[strlen(rcmd) - 2] == '/') { - rcmd[strlen(rcmd) - 2] = '\015'; - rcmd[strlen(rcmd) - 1] = '\0'; - } - else if (rcmd[strlen(rcmd) - 1] == '\n') { - rcmd[strlen(rcmd) - 1] = '\015'; - } - else { // Add one, we reached the EOF before CR - rcmd[strlen(rcmd) + 1] = '\0'; - rcmd[strlen(rcmd)] = '\015'; - } - } - - if (strlen(rcmd) > 0) { - printf("... additional reset commands follow:\n"); - printf("%s\n", rcmd); - } - - // Open the tracker - if (verbose) - printf("Opening vrpn_Tracker_Liberty: %s on port %s, baud %d\n", s2, s3, - i1); - - if (numparms == 3) { - mytracker = - new vrpn_Tracker_Liberty(s2, connection, s3, i1, 0, 8, rcmd); - } - else { - mytracker = - new vrpn_Tracker_Liberty(s2, connection, s3, i1, 0, 8, rcmd, i2); - } - - // If the last character in the line is a front slash, '/', then - // the following line is a command to add a Stylus to one - // of the sensors on the tracker. Read and parse the line after, - // then add the devices needed to support. Each line has two - // arguments, the string name of the devices and the integer - // sensor number (starting with 0) to attach the device to. - while (line[strlen(line) - 2] == '/') { - char lineCommand[LINESIZE]; - char lineName[LINESIZE]; - int lineSensor; - - // Read the next line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf(stderr, - "Ran past end of config file in Liberty description\n"); - delete mytracker; - return -1; - } - - // Parse the line. - if (sscanf(line, "%511s%511s%d", lineCommand, lineName, &lineSensor) != - 3) { - fprintf(stderr, "Bad line in Stylus description for Liberty (%s)\n", - line); - delete mytracker; - return -1; - } - - if (strcmp(lineCommand, "Stylus") == 0) { - if (mytracker->add_stylus_button(lineName, lineSensor, 2)) { - fprintf(stderr, "Cannot set Stylus buttons for Liberty (%s)\n", - line); - delete mytracker; - return -1; - } - printf(" ...added Stylus (%s) to sensor %d\n", lineName, - lineSensor); - } - else { - fprintf(stderr, - "Unknown command inStylus description for Liberty (%s)\n", - lineCommand); - delete mytracker; - return -1; - } - } - _devices->add(mytracker); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_LibertyHS(char *&pch, char *line, - FILE *config_file) -{ - char s2[LINESIZE]; - int i1, i2, i3; - int numparms; - - char rcmd[5000]; // Reset command to send to LibertyHS - VRPN_CONFIG_NEXT(); - // Get the arguments (class, tracker_name, num_sensors, baud, [whoami_len]) - numparms = sscanf(pch, "%511s%d%d%d", s2, &i1, &i2, &i3); - if (numparms < 3) { - fprintf(stderr, "Bad vrpn_Tracker_LibertyHS line: %s\n", line); - return -1; - } - - // If the last character in the line is a backslash, '\', then - // the following line is an additional command to send to the - // LibertyHS at reset time. So long as we find lines with slashes - // at the ends, we add them to the command string to send. Note - // that there is a newline at the end of the line, following the - // backslash. - rcmd[0] = 0; - while (line[strlen(line) - 2] == '\\') { - // Read the next line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf(stderr, - "Ran past end of config file in LibertyHS description\n"); - return -1; - } - - // Copy the line into the remote command, - // then replace \ with \015 if present - // In any case, make sure we terminate with \015. - strncat(rcmd, line, LINESIZE); - if (rcmd[strlen(rcmd) - 2] == '\\') { - rcmd[strlen(rcmd) - 2] = '\015'; - rcmd[strlen(rcmd) - 1] = '\0'; - } - else if (rcmd[strlen(rcmd) - 2] == '/') { - rcmd[strlen(rcmd) - 2] = '\015'; - rcmd[strlen(rcmd) - 1] = '\0'; - } - else if (rcmd[strlen(rcmd) - 1] == '\n') { - rcmd[strlen(rcmd) - 1] = '\015'; - } - else { // Add one, we reached the EOF before CR - rcmd[strlen(rcmd) + 1] = '\0'; - rcmd[strlen(rcmd)] = '\015'; - } - } - - if (strlen(rcmd) > 0) { - printf("... additional reset commands follow:\n"); - printf("%s\n", rcmd); - } - -#if defined(VRPN_USE_LIBUSB_1_0) - // Open the tracker - if (verbose) - printf("Opening vrpn_Tracker_LibertyHS: %s on USB port, baud %d\n", s2, - i2); - - if (numparms == 3) { - _devices->add( - new vrpn_Tracker_LibertyHS(s2, connection, i2, 0, i1, 1, rcmd)); - } - else { - _devices->add( - new vrpn_Tracker_LibertyHS(s2, connection, i2, 0, i1, 1, rcmd, i3)); - } - return 0; -#else - printf("Can't create new vrpn_Tracker_LibertyHS: Server not compiled with " - "VRPN_USE_LIBUSB_1_0 defined.\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_Tracker_3Space(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char s2[LINESIZE], s3[LINESIZE]; - int i1; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, tracker_name, port, baud) - if (sscanf(pch, "%511s%511s%d", s2, s3, &i1) != 3) { - fprintf(stderr, "Bad vrpn_Tracker_3Space line: %s\n", line); - return -1; - } - - // Open the tracker - if (verbose) - printf("Opening vrpn_Tracker_3Space: %s on port %s, baud %d\n", s2, s3, - i1); - _devices->add(new vrpn_Tracker_3Space(s2, connection, s3, i1)); - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_Flock(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char s2[LINESIZE], s3[LINESIZE]; - int i1, i2, i3; - char useERT[LINESIZE]; - strcpy(useERT, "y"); - char hemi[LINESIZE]; - strcpy(hemi, "+z"); - bool invertQuaternion; - - VRPN_CONFIG_NEXT(); - // Get the arguments (tracker_name, sensors, port, baud, invert_quat, - // useERT, active_hemisphere) - int nb = sscanf(pch, "%511s%d%511s%d%d%511s%511s", s2, &i1, s3, &i2, &i3, - useERT, hemi); - if ((nb != 5) && (nb != 6) && (nb != 7)) { - fprintf(stderr, "Bad vrpn_Tracker_Flock line: %s\n", line); - return -1; - } - - // Interpret the active hemisphere parameter - int hemi_id; - if (hemi[0] == '-') { - if (hemi[1] == 'x' || hemi[1] == 'X') { - hemi_id = vrpn_Tracker_Flock::HEMI_MINUSX; - } - else if (hemi[1] == 'y' || hemi[1] == 'Y') { - hemi_id = vrpn_Tracker_Flock::HEMI_MINUSY; - } - else if (hemi[1] == 'z' || hemi[1] == 'Z') { - hemi_id = vrpn_Tracker_Flock::HEMI_MINUSZ; - } - else { - fprintf(stderr, "Bad vrpn_Tracker_Flock line: %s\n", line); - return -1; - } - } - else if (hemi[0] == '+') { - if (hemi[1] == 'x' || hemi[1] == 'X') { - hemi_id = vrpn_Tracker_Flock::HEMI_PLUSX; - } - else if (hemi[1] == 'y' || hemi[1] == 'Y') { - hemi_id = vrpn_Tracker_Flock::HEMI_PLUSY; - } - else if (hemi[1] == 'z' || hemi[1] == 'Z') { - hemi_id = vrpn_Tracker_Flock::HEMI_PLUSZ; - } - else { - fprintf(stderr, "Bad vrpn_Tracker_Flock line: %s\n", line); - return -1; - } - } - else { - fprintf(stderr, "Bad vrpn_Tracker_Flock line: %s\n", line); - return -1; - } - - // Open the tracker - bool buseERT = true; - if ((useERT[0] == 'n') || (useERT[0] == 'N')) { - buseERT = false; - } - invertQuaternion = (i3 != 0); - if (verbose) { - printf("Opening vrpn_Tracker_Flock: " - "%s (%d sensors, on port %s, baud %d) %s ERT\n", - s2, i1, s3, i2, buseERT ? "with" : "without"); - } - _devices->add(new vrpn_Tracker_Flock(s2, connection, i1, s3, i2, 1, buseERT, - invertQuaternion, hemi_id)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_Flock_Parallel( - char *&pch, char *line, FILE * /*config_file*/) -{ - - char s2[LINESIZE], s3[LINESIZE]; - int i1, i2, i3; - bool invertQuaternion; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, tracker_name, sensors, port, baud, - // invertQuaternion - // and parallel sensor ports ) - - if (sscanf(pch, "%511s%d%511s%d%d", s2, &i1, s3, &i2, &i3) != 5) { - fprintf(stderr, "Bad vrpn_Tracker_Flock_Parallel line: %s\n", line); - return -1; - } - - // set up strtok to get the variable num of port names - char rgch[24]; - sprintf(rgch, "%d", i2); - char *pch2 = strstr(pch, rgch); - strtok(pch2, " \t"); - // pch points to baud, next strtok will give invertQuaternion - strtok(NULL, " \t"); - // pch points to invertQuaternion, next strtok will give first port name - - char *rgs[VRPN_FLOCK_MAX_SENSORS]; - // get sensor ports - for (int iSlaves = 0; iSlaves < i1; iSlaves++) { - rgs[iSlaves] = new char[LINESIZE]; - if (!(pch2 = strtok(NULL, " \t"))) { - fprintf(stderr, "Bad vrpn_Tracker_Flock_Parallel line: %s\n", line); - return -1; - } - else { - sscanf(pch2, "%511s", rgs[iSlaves]); - } - } - - // Open the tracker - invertQuaternion = (i3 != 0); - if (verbose) - printf("Opening vrpn_Tracker_Flock_Parallel: " - "%s (%d sensors, on port %s, baud %d)\n", - s2, i1, s3, i2); - _devices->add(new vrpn_Tracker_Flock_Parallel(s2, connection, i1, s3, i2, - rgs, invertQuaternion)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_NULL(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char s2[LINESIZE]; - int i1; - float f1; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, tracker_name, sensors, rate) - if (sscanf(pch, "%511s%d%g", s2, &i1, &f1) != 3) { - fprintf(stderr, "Bad vrpn_Tracker_NULL line: %s\n", line); - return -1; - } - - // Open the tracker - if (verbose) - printf("Opening vrpn_Tracker_NULL: %s with %d sensors, rate %f\n", s2, - i1, f1); - _devices->add(new vrpn_Tracker_NULL(s2, connection, i1, f1)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Button_Python(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char s2[LINESIZE]; - int i1, i2; - - VRPN_CONFIG_NEXT(); - i2 = 0; // Set it to use the default value if we don't read a value from the - // file. - // Get the arguments (class, button_name, which_lpt, - // optional_hex_port_number) - if (sscanf(pch, "%511s%d%x", s2, &i1, &i2) < 2) { - fprintf(stderr, "Bad vrpn_Button_Python line: %s\n", line); - return -1; - } - - // Open the button - if (verbose) printf("Opening vrpn_Button_Python: %s on port %d\n", s2, i1); - _devices->add(new vrpn_Button_Python(s2, connection, i1, i2)); - - return 0; -} - -//================================ -int vrpn_Generic_Server_Object::setup_Button_SerialMouse(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char s2[LINESIZE]; - char s3[LINESIZE]; - char s4[32]; - vrpn_MOUSETYPE mType = MAX_MOUSE_TYPES; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, button_name, portname, type) - if (sscanf(pch, "%511s%511s%31s", s2, s3, s4) != 3) { - fprintf(stderr, "Bad vrpn_Button_SerialMouse line: %s\n", line); - return -1; - } - - if (strcmp(s4, "mousesystems") == 0) { - mType = MOUSESYSTEMS; - } - else if (strcmp(s4, "3button") == 0) { - mType = THREEBUTTON_EMULATION; - } - - if (mType == MAX_MOUSE_TYPES) { - fprintf(stderr, "bad vrpn_SerialMouse_Button type\n"); - return -1; - } - - // Open the button - if (verbose) { - printf("Opening vrpn_SerialMouse_Button: %s on port %s\n", s2, s3); - } - _devices->add(new vrpn_Button_SerialMouse(s2, connection, s3, 1200, mType)); - return 0; -} - -//================================ -int vrpn_Generic_Server_Object::setup_Button_PinchGlove(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char name[LINESIZE], port[LINESIZE]; - int baud; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, button_name, port, baud) - if (sscanf(pch, "%511s%511s%d", name, port, &baud) != 3) { - fprintf(stderr, "Bad vrpn_Button_PinchGlove line: %s\n", line); - return -1; - } - - // Open the button - if (verbose) { - printf("Opening vrpn_Button_PinchGlove: %s on port %s at %d baud\n", - name, port, baud); - } - _devices->add(new vrpn_Button_PinchGlove(name, connection, port, baud)); - - return 0; -} - -//================================ -int vrpn_Generic_Server_Object::setup_DevInput(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE], s4[LINESIZE]; - int int_param = 0; - VRPN_CONFIG_NEXT(); - - // Get the arguments (class, dev_input_name) - if (sscanf(pch, "%511s \"%[^\"]\" %s %d", s2, s3, s4, &int_param) != 4) { - if (sscanf(pch, "%511s \"%[^\"]\" %s", s2, s3, s4) != 3) { - fprintf(stderr, "Bad vrpn_DevInput line: %s\n", line); - return -1; - } - } - -#ifdef VRPN_USE_DEV_INPUT - _devices->add(new vrpn_DevInput(s2, connection, s3, s4, int_param)); - return 0; -#else - fprintf(stderr, "vrpn_DevInput support not compiled in\n"); - return -1; -#endif -} - -//================================ -int vrpn_Generic_Server_Object::setup_Joylin(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; - char s3[LINESIZE]; - - // Get the arguments - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s%511s", s2, s3) != 2) { - fprintf(stderr, "Bad vrpn_Joylin line: %s\n", line); - return -1; - } - -#ifdef VRPN_USE_JOYLIN - // Open the joystick server - if (verbose) { - printf("Opening vrpn_Joylin: %s on port %s\n", s2, s3); - } - _devices->add(new vrpn_Joylin(s2, connection, s3)); - return 0; -#else - fprintf(stderr, "vrpn_Joylin support not compiled in\n"); - return -1; -#endif -} - -//================================ -int vrpn_Generic_Server_Object::setup_Joywin32(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; - int joyId; - int readRate; - int mode; - int deadZone; - - // Get the arguments - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s%d%d%d%d", s2, &joyId, &readRate, &mode, &deadZone) != - 5) { - fprintf(stderr, "Bad vrpn_Joywin32 line: %s\n", line); - return -1; - } -#if defined(_WIN32) - - // Open the joystick server - if (verbose) { - printf("Opening vrpn_Joywin32: %s (device %d), baud rate:%d, mode:%d, " - "dead zone:%d\n", - s2, joyId, readRate, mode, deadZone); - } - _devices->add( - new vrpn_Joywin32(s2, connection, joyId, readRate, mode, deadZone)); - return 0; -#else - fprintf(stderr, "Joywin32 is for use under Windows only"); - return -2; -#endif -} - -//================================ -int vrpn_Generic_Server_Object::setup_Tng3(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1, i2; - VRPN_CONFIG_NEXT(); - // Get the arguments (class, tng3_name, port, numdig, numana) - if (sscanf(pch, "%511s%511s%d%d", s2, s3, &i1, &i2) != 4) { - fprintf(stderr, "Bad vrpn_Tng3 line: %s\n", line); - return -1; - } - // Open the box - if (verbose) - printf("Opening vrpn_Tng3: %s on port %s, baud %d, %d digital, " - " %d analog\n", - s2, s3, 19200, i1, i2); - _devices->add(new vrpn_Tng3(s2, connection, s3, 19200, i1, i2)); - return 0; -} - -//================================ -int vrpn_Generic_Server_Object::setup_Mouse(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; - VRPN_CONFIG_NEXT(); - - // Get the arguments (class, mouse_name) - if (sscanf(pch, "%511s", s2) != 1) { - fprintf(stderr, "Bad vrpn_Mouse line: %s\n", line); - return -1; - } - - // Open the box - if (verbose) { - printf("Opening vrpn_Mouse: %s\n", s2); - } - - try { - _devices->add(new vrpn_Mouse(s2, connection)); - } - catch (...) { - fprintf(stderr, "could not create vrpn_Mouse\n"); -#ifdef linux - fprintf(stderr, "- Is the GPM server running?\n"); - fprintf(stderr, - "- Are you running on a linux console (not an xterm)?\n"); -#endif - return -1; - } - return 0; -} - -//================================ -int vrpn_Generic_Server_Object::setup_Tracker_Crossbow(char *&pch, char *line, - FILE * /*config_file*/) -{ - char port[LINESIZE], name[LINESIZE]; - long baud; - float gRange, aRange; - - VRPN_CONFIG_NEXT(); - - // Get the arguments (class, tracker_name, port, baud, g-range, a-range) - // g-range is the linear acceleration sensitivity in Gs - // a-range is the angular velocity sensitivity in degrees per second - if (sscanf(pch, "%511s%511s%ld%f%f", name, port, &baud, &gRange, &aRange) < - 5) { - fprintf(stderr, "Bad vrpn_Tracker_Crossbow line: %s\n%s %s\n", line, - pch, port); - return -1; - } - - if (verbose) - printf("Opening vrpn_Tracker_Crossbow: %s on %s with baud %ld, G-range " - "%f, and A-range %f\n", - name, port, baud, gRange, aRange); - - _devices->add(new vrpn_Tracker_Crossbow(name, connection, port, baud, - gRange, aRange)); - - return 0; -} - -//================================ -int vrpn_Generic_Server_Object::setup_3DMicroscribe(char *&pch, char *line, - FILE * /*config_file*/) -{ - char name[LINESIZE], device[LINESIZE]; - int baud_rate; - float x, y, z, s; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, 5DT_name, port, baud, xoff, yoff, zoff, scale) - if (sscanf(pch, "%511s%511s%d%f%f%f%f", name, device, &baud_rate, &x, &y, - &z, &s) != 7) { - fprintf(stderr, "Bad vrpn_3dMicroscribe line: %s\n", line); - return -1; - } - - // Open the device - if (verbose) { - printf("Opening 3dMicroscribe: %s on port %s, baud %d\n", name, device, - baud_rate); - } -#ifdef VRPN_USE_MICROSCRIBE - _devices->add(new vrpn_3DMicroscribe(name, connection, device, baud_rate, x, - y, z, s)); - return 0; -#else - fprintf(stderr, "3DMicroscribe support not configured in VRPN, edit " - "vrpn_Configure.h and rebuild\n"); - return -1; -#endif -} - -//================================ -int vrpn_Generic_Server_Object::setup_Tracker_InterSense(char *&pch, char *line, - FILE *config_file) -{ - char trackerName[LINESIZE]; - char commStr[100]; - int commPort; - - char s4[LINESIZE]; - char s5[LINESIZE]; - char s6[LINESIZE]; - int numparms; - int do_is900_timing = 0; - int reset_at_start = 0; // nahon@virtools.com - - char rcmd[5000]; // Reset command to send to Intersense - - VRPN_CONFIG_NEXT(); - - // Get the arguments (class, tracker_name, port, [optional IS900time]) - sscanf(line, "vrpn_Tracker_InterSense %s %s", trackerName, commStr); - if ((numparms = sscanf(pch, "%511s%511s%511s%511s%511s", trackerName, - commStr, s4, s5, s6)) < 2) { - fprintf(stderr, "Bad vrpn_Tracker_InterSense line: %s\n%s %s\n", line, - pch, trackerName); - return -1; - } - - if (!strcmp(commStr, "COM1")) { - commPort = 1; - } - else if (!strcmp(commStr, "COM2")) { - commPort = 2; - } - else if (!strcmp(commStr, "COM3")) { - commPort = 3; - } - else if (!strcmp(commStr, "COM4")) { - commPort = 4; - } - else if (!strcmp(commStr, "AUTO")) { - commPort = 0; // the intersense SDK will find the tracker on any COM or - // USB port. - } - else { - fprintf(stderr, "Error determining COM port: %s not should be either " - "COM1, COM2, COM3, COM4 or AUTO", - commStr); - return -1; - } - int found_a_valid_option = 0; - // See if we got the optional parameter to enable IS900 timings - if (numparms >= 3) { - if ((strncmp(s4, "IS900time", strlen("IS900time")) == 0) || - (strncmp(s5, "IS900time", strlen("IS900time")) == 0) || - (strncmp(s6, "IS900time", strlen("IS900time")) == 0)) { - do_is900_timing = 1; - found_a_valid_option = 1; - printf(" ...using IS900 timing information\n"); - } - if ((strncmp(s4, "ResetAtStartup", strlen("ResetAtStartup")) == 0) || - (strncmp(s5, "ResetAtStartup", strlen("ResetAtStartup")) == 0) || - (strncmp(s6, "ResetAtStartup", strlen("ResetAtStartup")) == 0)) { - reset_at_start = 1; - found_a_valid_option = 1; - printf(" ...Sensor will reset at startup\n"); - } - if (strcmp(s4, "/") == 0) { - found_a_valid_option = 1; - } - if (strcmp(s5, "/") == 0) { - found_a_valid_option = 1; - } - if (strcmp(s6, "/") == 0) { - found_a_valid_option = 1; - } - if (strcmp(s4, "\\") == 0) { - found_a_valid_option = 1; - } - if (strcmp(s5, "\\") == 0) { - found_a_valid_option = 1; - } - if (strcmp(s6, "\\") == 0) { - found_a_valid_option = 1; - } - if (!found_a_valid_option) { - fprintf(stderr, "InterSense: Bad optional param (expected " - "'IS900time', 'ResetAtStartup' and/or " - "'SensorsStartsAtOne', got '%s %s %s')\n", - s4, s5, s6); - return -1; - } - } - - // If the last character in the line is a backslash, '\', then - // the following line is an additional command to send to the - // Fastrak at reset time. So long as we find lines with slashes - // at the ends, we add them to the command string to send. Note - // that there is a newline at the end of the line, following the - // backslash. - sprintf(rcmd, ""); - while (line[strlen(line) - 2] == '\\') { - // Read the next line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf(stderr, - "Ran past end of config file in Isense description\n"); - return -1; - } - - // Copy the line into the remote command, - // then replace \ with \015 if present - // In any case, make sure we terminate with \015. - strncat(rcmd, line, LINESIZE); - if (rcmd[strlen(rcmd) - 2] == '\\') { - rcmd[strlen(rcmd) - 2] = '\015'; - rcmd[strlen(rcmd) - 1] = '\0'; - } - else if (rcmd[strlen(rcmd) - 2] == '/') { - rcmd[strlen(rcmd) - 2] = '\015'; - rcmd[strlen(rcmd) - 1] = '\0'; - } - else if (rcmd[strlen(rcmd) - 1] == '\n') { - rcmd[strlen(rcmd) - 1] = '\015'; - } - else { // Add one, we reached the EOF before CR - rcmd[strlen(rcmd) + 1] = '\0'; - rcmd[strlen(rcmd)] = '\015'; - } - } - - if (strlen(rcmd) > 0) { - printf("... additional reset commands follow:\n"); - printf("%s\n", rcmd); - } - -#ifdef VRPN_INCLUDE_INTERSENSE - - // Open the tracker - if (verbose) - printf("Opening vrpn_Tracker_InterSense: %s on port %s\n", trackerName, - commStr); - - vrpn_Tracker_InterSense *mytracker = - new vrpn_Tracker_InterSense(trackerName, connection, commPort, rcmd, - do_is900_timing, reset_at_start); - - // If the last character in the line is a front slash, '/', then - // the following line is a command to add a Wand or Stylus to one - // of the sensors on the tracker. Read and parse the line after, - // then add the devices needed to support. Each line has two - // arguments, the string name of the devices and the integer - // sensor number (starting with 0) to attach the device to. - while (line[strlen(line) - 2] == '/') { - char lineCommand[LINESIZE]; - char lineName[LINESIZE]; - int lineSensor; - - // Read the next line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf(stderr, - "Ran past end of config file in InterSense description\n"); - delete mytracker; - } - - // Parse the line. Both "Wand" and "Stylus" lines start with the name - // and sensor # - if (sscanf(line, "%511s%511s%d", lineCommand, lineName, &lineSensor) != - 3) { - fprintf(stderr, - "Bad line in Wand/Stylus description for InterSense (%s)\n", - line); - delete mytracker; - return -1; - } - - // See which command it is and act accordingly - if (strcmp(lineCommand, "Wand") == 0) { - double c0min, c0lo0, c0hi0, c0max; - double c1min, c1lo0, c1hi0, c1max; - - // Wand line has additional scale/clip information; read it in - if (sscanf(line, "%511s%511s%d%lf%lf%lf%lf%lf%lf%lf%lf", - lineCommand, lineName, &lineSensor, &c0min, &c0lo0, - &c0hi0, &c0max, &c1min, &c1lo0, &c1hi0, &c1max) != 11) { - fprintf(stderr, - "Bad line in Wand description for InterSense (%s)\n", - line); - delete mytracker; - return -1; - } - - if (mytracker->add_is900_analog(lineName, lineSensor, c0min, c0lo0, - c0hi0, c0max, c1min, c1lo0, c1hi0, - c1max)) { - fprintf(stderr, "Cannot set Wand analog for InterSense (%s)\n", - line); - delete mytracker; - return -1; - } - if (mytracker->add_is900_button(lineName, lineSensor, 6)) { - fprintf(stderr, "Cannot set Wand buttons for InterSense (%s)\n", - line); - delete mytracker; - return -1; - } - printf(" ...added Wand (%s) to sensor %d\n", lineName, lineSensor); - } - else if (strcmp(lineCommand, "Stylus") == 0) { - if (mytracker->add_is900_button(lineName, lineSensor, 2)) { - fprintf(stderr, - "Cannot set Stylus buttons for InterSense (%s)\n", - line); - delete mytracker; - return -1; - } - printf(" ...added Stylus (%s) to sensor %d\n", lineName, - lineSensor); - } - else { - fprintf(stderr, "Unknown command in Wand/Stylus description for " - "InterSense (%s)\n", - lineCommand); - delete mytracker; - return -1; - } - } - - _devices->add(mytracker); - - return 0; - -#else - fprintf(stderr, "vrpn_server: Can't open Intersense native server: " - "VRPN_INCLUDE_INTERSENSE not defined in " - "vrpn_Configure.h!\n"); - return -1; -#endif -} - -//================================ -int vrpn_Generic_Server_Object::setup_DirectXFFJoystick(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; - float f1, f2; - - VRPN_CONFIG_NEXT(); - // Get the arguments (joystick_name, read update rate, force update rate) - if (sscanf(pch, "%511s%g%g", s2, &f1, &f2) != 3) { - fprintf(stderr, "Bad vrpn_DirectXFFJoystick line: %s\n", line); - return -1; - } - -#ifdef VRPN_USE_DIRECTINPUT - // Open the joystick - if (verbose) { - printf( - "Opening vrpn_DirectXFFJoystick: %s, read rate %g, force rate %g\n", - s2, f1, f2); - } - _devices->add(new vrpn_DirectXFFJoystick(s2, connection, f1, f2)); - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open DirectXFFJoystick: " - "VRPN_USE_DIRECTINPUT not defined in vrpn_Configure.h!\n"); - return -1; -#endif -} - -//================================ -int vrpn_Generic_Server_Object::setup_RumblePad(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; - - VRPN_CONFIG_NEXT(); - // Get the arguments (joystick_name, read update rate, force update rate) - if (sscanf(pch, "%511s", s2) != 1) { - fprintf(stderr, "Bad vrpn_DirectXRumblePad line: %s\n", line); - return -1; - } - -#ifdef VRPN_USE_DIRECTINPUT - // Open the joystick - if (verbose) { - printf("Opening vrpn_DirectXRumblePad: %s\n", s2); - } - _devices->add(new vrpn_DirectXRumblePad(s2, connection)); - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open RumblePad: VRPN_USE_DIRECTINPUT " - "not defined in vrpn_Configure.h!\n"); - return -1; -#endif -} - -//================================ -int vrpn_Generic_Server_Object::setup_XInputPad(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; - unsigned controller; - - VRPN_CONFIG_NEXT(); - // Get the arguments (joystick_name, controller index) - if (sscanf(pch, "%511s%u", s2, &controller) != 2) { - fprintf(stderr, "Bad vrpn_XInputGamepad line: %s\n", line); - return -1; - } - -#if defined(VRPN_USE_DIRECTINPUT) && defined(VRPN_USE_WINDOWS_XINPUT) - // Open the joystick - if (verbose) { - printf("Opening vrpn_XInputGamepad: %s\n", s2); - } - _devices->add(new vrpn_XInputGamepad(s2, connection, controller)); - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open XInputGamepad: " - "VRPN_USE_DIRECTINPUT and/or VRPN_USE_WINDOWS_XINPUT not " - "defined in vrpn_Configure.h!\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_GlobalHapticsOrb(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1; - - VRPN_CONFIG_NEXT(); - // Get the arguments (orb_name, port name, baud rate) - if (sscanf(pch, "%511s%s%d", s2, s3, &i1) != 3) { - fprintf(stderr, "Bad vrpn_GlobalHapticsOrb line: %s\n", line); - return -1; - } - - // Open the orb - if (verbose) { - printf("Opening vrpn_GlobalHapticsOrb: %s, port %s, baud rate %d\n", s2, - s3, i1); - } - _devices->add(new vrpn_GlobalHapticsOrb(s2, connection, s3, i1)); - - return 0; -} - -//================================ -int vrpn_Generic_Server_Object::setup_ADBox(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char name[LINESIZE], port[LINESIZE]; - int baud; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, button_name, port, baud) - if (sscanf(pch, "%511s%511s%d", name, port, &baud) != 3) { - fprintf(stderr, "Bad vrpn_ADBox line: %s\n", line); - return -1; - } - - // Open the button - if (verbose) { - printf("Opening vrpn_ADBox: %s on port %s at %d baud\n", name, port, - baud); - } - - _devices->add(new vrpn_ADBox(name, connection, port, baud)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_VPJoystick(char *&pch, char *line, - FILE * /*config_file*/) -{ - char name[LINESIZE], port[LINESIZE]; - int baud; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, button_name, port, baud) - if (sscanf(pch, "%511s%511s%d", name, port, &baud) != 3) { - fprintf(stderr, "Bad vrpn_VPJoystick line: %s\n", line); - return -1; - } - - // Open the button - if (verbose) { - printf("Opening vrpn_VPJoystick: %s on port %s at %d baud\n", name, - port, baud); - } - - _devices->add(new vrpn_VPJoystick(name, connection, port, baud)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_JsonNet(char *&pch, char *line, - FILE * /*config_file*/) -{ - /* - * Parses the section of the configuration file related to the device - #DeviceClass DeviceName ListenPort - Tracker_JsonNet GGG 7777 - * - * Create the device object - */ - char name[LINESIZE]; - int port; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, device_name, port) - if (sscanf(pch, "%511s%d", name, &port) != 2) { - fprintf(stderr, "Bad vrpn_Tracker_JsonNet line: %s\n", line); - return -1; - } - -#ifdef VRPN_USE_JSONNET - // Open vrpn_Tracker_JsonNet: - - if (verbose) { - printf("Opening vrpn_Tracker_JsonNet: %s at port %d\n", name, port); - } - - _devices->add(new vrpn_Tracker_JsonNet(name, connection, port)); - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open vrpn_Tracker_JsonNet: " - "VRPN_USE_JSONNET not defined in vrpn_Configure.h!\n"); - return -1; -#endif // VRPN_USE_JsonNet -} - -int vrpn_Generic_Server_Object::setup_DTrack(char *&pch, char *line, - FILE * /*config_file*/) -{ - char *s2; - char *str[LINESIZE]; - char *s; - char sep[] = " ,\t,\n"; - int count = 0; - int dtrackPort, isok; - float timeToReachJoy; - int nob, nof, nidbf; - int idbf[512]; - bool actTracing, act3DOFout; - - VRPN_CONFIG_NEXT(); - - // Get the arguments: - - str[count] = strtok(pch, sep); - while (str[count] != NULL) { - count++; - // Get next token: - str[count] = strtok(NULL, sep); - } - - if (count < 2) { - fprintf(stderr, "Bad vrpn_Tracker_DTrack line: %s\n", line); - return -1; - } - - s2 = str[0]; - dtrackPort = (int)strtol(str[1], &s, 0); - - // tracing/3dof (optional; always last arguments): - - actTracing = false; - act3DOFout = false; - - isok = 1; - while (isok && count > 2) { - isok = 0; - - if (!strcmp(str[count - 1], "-")) { - actTracing = true; - count--; - isok = 1; - } - else if (!strcmp(str[count - 1], "3d")) { - act3DOFout = true; - count--; - isok = 1; - } - } - - // time needed to reach the maximum value of the joystick (optional): - - timeToReachJoy = 0; - - if (count > 2) { - timeToReachJoy = (float)strtod(str[2], &s); - } - - // number of bodies and flysticks (optional): - - nob = nof = -1; - - if (count > 3) { - if (count < 5) { // there must be two additional arguments at least - fprintf(stderr, "Bad vrpn_Tracker_DTrack line: %s\n", line); - return -1; - } - - nob = (int)strtol(str[3], &s, 0); - nof = (int)strtol(str[4], &s, 0); - } - - // renumbering of targets (optional): - - nidbf = 0; - - if (count > 5) { - if (count < - 5 + nob + nof) { // there must be an argument for each target - fprintf(stderr, "Bad vrpn_Tracker_DTrack line: %s\n", line); - return -1; - } - - for (int i = 0; i < nob + nof; i++) { - idbf[i] = (int)strtol(str[5 + i], &s, 0); - nidbf++; - } - } - - // Open vrpn_Tracker_DTrack: - - int *pidbf = NULL; - - if (nidbf > 0) { - pidbf = idbf; - } - - if (verbose) { - printf( - "Opening vrpn_Tracker_DTrack: %s at port %d, timeToReachJoy %.2f", - s2, dtrackPort, timeToReachJoy); - if (nob >= 0 && nof >= 0) { - printf(", fixNtargets %d %d", nob, nof); - } - if (nidbf > 0) { - printf(", fixId"); - for (int i = 0; i < nidbf; i++) { - printf(" %d", idbf[i]); - } - } - printf("\n"); - } - -#ifndef sgi - - _devices->add(new vrpn_Tracker_DTrack(s2, connection, dtrackPort, - timeToReachJoy, nob, nof, pidbf, - actTracing)); - - return 0; -#else - fprintf(stderr, "vrpn_Tracker_DTrack not supported on this architecture\n"); - return -1; -#endif -} - -// This function will read one line of the vrpn_Poser_Analog configuration -// (matching -// one axis) and fill in the data for that axis. The axis name, the file to read -// from, and the axis to fill in are passed as parameters. It returns 0 on -// success -// and -1 on failure. - -int vrpn_Generic_Server_Object::get_poser_axis_line(FILE *config_file, - const char *axis_name, - vrpn_PA_axis *axis, - vrpn_float64 *min, - vrpn_float64 *max) -{ - char line[LINESIZE]; - char _axis_name[LINESIZE]; - char *name = new char[LINESIZE]; // We need this to stay around for the param - int channel; - float offset, scale; - - // Read in the line - if (fgets(line, LINESIZE, config_file) == NULL) { - perror("Poser Analog Axis: Can't read axis"); - return -1; - } - - // Get the values from the line - if (sscanf(line, "%511s%511s%d%g%g%lg%lg", _axis_name, name, &channel, - &offset, &scale, min, max) != 7) { - fprintf(stderr, "Poser Analog Axis: Bad axis line\n"); - return -1; - } - - // Check to make sure the name of the line matches - if (strcmp(_axis_name, axis_name) != 0) { - fprintf(stderr, "Poser Analog Axis: wrong axis: wanted %s, got %s)\n", - axis_name, name); - return -1; - } - - // Fill in the values if we didn't get the name "NULL". Otherwise, just - // leave them as they are, and they will have no effect. - if (strcmp(name, "NULL") != 0) { - axis->ana_name = name; - axis->channel = channel; - axis->offset = offset; - axis->scale = scale; - } else { - delete [] name; - } - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Poser_Analog(char *&pch, char *line, - FILE *config_file) -{ - char s2[LINESIZE]; - int i1; - vrpn_Poser_AnalogParam p; - - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s%d", s2, &i1) != 2) { - fprintf(stderr, "Bad vrpn_Poser_Analog line: %s\n", line); - return -1; - } - - if (verbose) { - printf("Opening vrpn_Poser_Analog: " - "%s\n", - s2); - } - - // Scan the following lines in the configuration file to fill - // in the start-up parameters for the different axis. - - if (get_poser_axis_line(config_file, "X", &p.x, &p.pos_min[0], - &p.pos_max[0])) { - fprintf(stderr, "Can't read X line for Poser Analog\n"); - return -1; - } - if (get_poser_axis_line(config_file, "Y", &p.y, &p.pos_min[1], - &p.pos_max[1])) { - fprintf(stderr, "Can't read y line for Poser Analog\n"); - return -1; - } - if (get_poser_axis_line(config_file, "Z", &p.z, &p.pos_min[2], - &p.pos_max[2])) { - fprintf(stderr, "Can't read Z line for Poser Analog\n"); - return -1; - } - if (get_poser_axis_line(config_file, "RX", &p.rx, &p.pos_rot_min[0], - &p.pos_rot_max[0])) { - fprintf(stderr, "Can't read RX line for Poser Analog\n"); - return -1; - } - if (get_poser_axis_line(config_file, "RY", &p.ry, &p.pos_rot_min[1], - &p.pos_rot_max[1])) { - fprintf(stderr, "Can't read RY line for Poser Analog\n"); - return -1; - } - if (get_poser_axis_line(config_file, "RZ", &p.rz, &p.pos_rot_min[2], - &p.pos_rot_max[2])) { - fprintf(stderr, "Can't read RZ line for Poser Analog\n"); - return -1; - } - - _devices->add(new vrpn_Poser_Analog(s2, connection, &p, i1 != 0)); - if (p.x.ana_name != NULL) { delete [] p.x.ana_name; } - if (p.y.ana_name != NULL) { delete [] p.y.ana_name; } - if (p.z.ana_name != NULL) { delete [] p.z.ana_name; } - if (p.rx.ana_name != NULL) { delete [] p.rx.ana_name; } - if (p.ry.ana_name != NULL) { delete [] p.ry.ana_name; } - if (p.rz.ana_name != NULL) { delete [] p.rz.ana_name; } - - return 0; -} - -int vrpn_Generic_Server_Object::setup_nikon_controls(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - - // Get the arguments - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s%511s", s2, s3) != 2) { - fprintf(stderr, "Bad vrpn_nikon_controls line: %s\n", line); - return -1; - } - - // Open the server - if (verbose) printf("Opening vrpn_nikon_control %s on port %s \n", s2, s3); - _devices->add(new vrpn_Nikon_Controls(s2, connection, s3)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Poser_Tek4662(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int i1; - - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s%511s%d", s2, s3, &i1) != 3) { - fprintf(stderr, "Bad vrpn_Poser_Tek4662 line: %s\n", line); - return -1; - } - - if (verbose) { - printf("Opening vrpn_Poser_Tek4662 %s on port %s at baud %d\n", s2, s3, - i1); - } - - _devices->add(new vrpn_Poser_Tek4662(s2, connection, s3, i1)); - - return 0; -} - -// ---------------------------------------------------------------------- -// BUW additions -// ---------------------------------------------------------------------- - -/******************************************************************************/ -/* setup Atmel microcontroller */ -/******************************************************************************/ -int vrpn_Generic_Server_Object::setup_Atmel(char *&pch, char *line, - FILE * /*config_file*/) -{ - char name[LINESIZE]; - char port[LINESIZE]; - int baud = 0; - int channel_count = 0; - - VRPN_CONFIG_NEXT(); - - // first line - if (setup_vrpn_Atmel::channel_count == 0) { - - // Get the arguments - if (sscanf(pch, "%511s%511s%d%d", name, port, &baud, &channel_count) != - 4) { - fprintf(stderr, "Bad vrpn_Atmel line: %s\n", line); - return -1; - } - else { - if (verbose) { - printf("name: %s\n", name); - printf("port: %s\n", port); - printf("baud: %d\n", baud); - printf("channel_count: %d\n", channel_count); - } - } - - setup_vrpn_Atmel::channel_count = channel_count; - - // init the channel_mode array - for (int k = 0; k < channel_count; ++k) { - setup_vrpn_Atmel::channel_mode[k] = VRPN_ATMEL_MODE_NA; - } - - return 0; - - } // end of handline first line - - //********************************************************* - - //********************************************************* - - int channel; - char mode[3]; - - // Get the arguments - if (sscanf(pch, "%d%511s", &channel, mode) != 2) { - fprintf(stderr, "Bad vrpn_Atmel line: %s\n", line); - return -1; - } - else { - if (verbose) { - printf("channel: %d - mode: %s\n", channel, mode); - } - } - - // check if it is a valid channel - if (channel >= setup_vrpn_Atmel::channel_count) { - fprintf(stderr, "channel value out of range\n\n"); - return -1; - } - - //************************************************** - // last line of vrpn_Atmel - if (channel == -1) { - -#ifndef _WIN32 - // here we use a factory interface because a lot of init things have to - // be done - _devices->add(vrpn_Atmel::Create(name, connection, port, baud, - channel_count, - setup_vrpn_Atmel::channel_mode)); - - // reset the params so that another atmel can be configured - setup_vrpn_Atmel::channel_count = 0; - - printf("\nAtmel %s started.\n\n", name); - - // the Analog_Output is handled implict by analog like done in Zaber - - return 0; -#else - fprintf(stderr, "vrpn_Generic_Server_Object::setup_Atmel(): Not " - "implemented on this architecture\n"); - return -1; -#endif - } - - // check if it is a valid channel - if (channel < 0) { - fprintf(stderr, "channel value out of range\n\n"); - return -1; - } - - // channel init line - - //************************************************** - // set the mode array - int mode_int; - -#define VRPN_ATMEL_IS_MODE(s) !strcmp(pch = strtok(mode, " \t"), s) - - // convert the char * in an integer - if (VRPN_ATMEL_IS_MODE("RW")) { - mode_int = VRPN_ATMEL_MODE_RW; - } - else if (VRPN_ATMEL_IS_MODE("RO")) { - mode_int = VRPN_ATMEL_MODE_RO; - } - else if (VRPN_ATMEL_IS_MODE("WO")) { - mode_int = VRPN_ATMEL_MODE_WO; - } - else if (VRPN_ATMEL_IS_MODE("NA")) { - mode_int = VRPN_ATMEL_MODE_NA; - } - else { - fprintf(stderr, "unknown io-mode: %s\n\n", mode); - return -1; - } - - // write it to the array - setup_vrpn_Atmel::channel_mode[channel] = mode_int; - -#undef VRPN_ATMEL_IS_MODE - - return 0; -} - -/******************************************************************************/ -/* setup mouse connected via event interface */ -/******************************************************************************/ -int vrpn_Generic_Server_Object::setup_Event_Mouse(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char name[LINESIZE], port[LINESIZE]; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, button_name, port) - if (sscanf(pch, "%511s%511s", name, port) != 2) { - fprintf(stderr, "Bad vrpn_Event_Mouse line: %s\n", line); - return -1; - } - - // Open the button - if (verbose) { - printf("Opening vrpn_Event_Mouse: %s on port %s\n", name, port); - } - - _devices->add(new vrpn_Event_Mouse(name, connection, port)); - - return 0; -} - -/* - * inertiamouse config file setup routine - * - */ -int vrpn_Generic_Server_Object::setup_inertiamouse(char *&pch, char *line, - FILE * /*config_file*/) -{ - char name[LINESIZE], port[LINESIZE]; - int baud; - int ret; - - VRPN_CONFIG_NEXT(); - - // Get the arguments (class, magellan_name, port, baud - if ((ret = sscanf(pch, "%511s%511s%d", name, port, &baud)) < 3) { - fprintf(stderr, "Bad vrpn_inertiamouse line: %s\n", line); - return -1; - } - - // Open the device - if (verbose) { - printf("Opening vrpn_inertiamouse: %s on port %s, baud %d\n", name, - port, baud); - } - _devices->add(vrpn_inertiamouse::create(name, connection, port, baud)); - - return 0; -} - -// ---------------------------------------------------------------------- - -int vrpn_Generic_Server_Object::setup_Analog_USDigital_A2( - char *&pch, char *line, FILE * /*config_file*/) -{ - char A2name[LINESIZE]; - int comPort, numChannels, numArgs, reportChange; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, USD_A2_name, comPort, numChannels, - // [reportChange] - numArgs = sscanf(pch, "%511s%d%d%d", A2name, &comPort, &numChannels, - &reportChange); - if (numArgs != 3 && numArgs != 4) { - fprintf(stderr, "Bad vrpn_Analog_USDigital_A2 line: %s\n", line); - return -1; - } - - // Handle optional parameter - if (numArgs == 3) { - reportChange = 0; - } - - // Make sure the parameters look OK - if (comPort < 0 || comPort > 100) { - fprintf(stderr, - "Invalid COM port %d in vrpn_Analog_USDigital_A2 line: %s\n", - comPort, line); - return -1; - } - if (numChannels < 1 || - (vrpn_uint32)numChannels > - vrpn_Analog_USDigital_A2::vrpn_Analog_USDigital_A2_CHANNEL_MAX || - numChannels > vrpn_CHANNEL_MAX) { - fprintf(stderr, "Invalid number of channels %d in " - "vrpn_Analog_USDigital_A2 line: %s\n", - numChannels, line); - return -1; - } - -#ifdef VRPN_USE_USDIGITAL - // Open the device - if (verbose) - printf("Opening vrpn_Analog_USDigital_A2: %s on port %d (%u=search for " - "port), with %d channels, reporting %s\n", - A2name, comPort, - vrpn_Analog_USDigital_A2::vrpn_Analog_USDigital_A2_FIND_PORT, - numChannels, (reportChange == 0) ? "always" : "on change"); - _devices->add(new vrpn_Analog_USDigital_A2( - A2name, connection, (vrpn_uint32)comPort, (vrpn_uint32)numChannels, - (reportChange != 0))); - - return 0; -#else - printf("Warning: Server not compiled with VRPN_USE_USDIGITAL defined.\n"); - return -1; -#endif -} // setup_USDigital_A2 - -int vrpn_Generic_Server_Object::setup_Button_NI_DIO24(char *&pch, char *line, - FILE * /*config_file*/) -{ - char DIO24name[LINESIZE]; - int numChannels; - int numArgs; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, D24_name, numChannels) - numArgs = sscanf(pch, "%511s%d", DIO24name, &numChannels); - if (numArgs != 1 && numArgs != 2) { - fprintf(stderr, "Bad vrpn_Button_NI_DIO24 line: %s\n", line); - return -1; - } - - // Do error checking on numChannels - if (numArgs > 1 && - (numChannels < 1 || - numChannels > vrpn_Button_NI_DIO24::vrpn_Button_NI_DIO24_CHANNEL_MAX || - numChannels > vrpn_CHANNEL_MAX)) { - fprintf( - stderr, - "Invalid number of channels %d in vrpn_Button_NI_DIO24 line: %s\n", - numChannels, line); - return -1; - } - - // if numChannels is wrong, use default - if (numArgs < 2 || numChannels < 1) { - numChannels = vrpn_Button_NI_DIO24::vrpn_Button_NI_DIO24_CHANNEL_MAX; - } - -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX - // Open the device - if (verbose) - printf("Opening vrpn_Button_NI_DIO24: %s with up to %d buttons\n", - DIO24name, numChannels); - - _devices->add(new vrpn_Button_NI_DIO24(DIO24name, connection, numChannels)); - - return 0; -#else - printf("Warning: Server not compiled with " - "VRPN_USE_NATIONAL_INSTRUMENTS_MX defined.\n"); - return -1; -#endif - -} // setup_Button_NI_DIO24 - -int vrpn_Generic_Server_Object::setup_Tracker_OSVRHackerDevKit(char *&pch, char - *line, FILE - *config_file) -{ - char s2[LINESIZE]; - - VRPN_CONFIG_NEXT(); - int ret = sscanf(pch, "%511s", s2); - if (ret != 1) { - fprintf(stderr, "Bad OSVR Hacker Dev Kit line: %s\n", line); - return -1; - } - - // Open the Razer Hydra - if (verbose) { - printf("Opening vrpn_Tracker_OSVRHackerDevKit\n"); - } - -#ifdef VRPN_USE_HID - // Open the tracker - _devices->add(new vrpn_Tracker_OSVRHackerDevKit(s2, connection)); -#else - fprintf(stderr, - "OSVRHackerDevKit driver works only with VRPN_USE_HID defined!\n"); -#endif - return 0; // successful completion -} - -int vrpn_Generic_Server_Object::setup_Tracker_PhaseSpace(char *&pch, char *line, - FILE *config_file) -{ - - char trackerName[LINESIZE]; - char device[LINESIZE]; - float framerate = 0; - int readflag = 0; - int slaveflag = 0; - - // get tracker name and device - if (sscanf(line, "vrpn_Tracker_PhaseSpace %s %s %f %d %d", trackerName, - device, &framerate, &readflag, &slaveflag) < 5) { - fprintf(stderr, "Bad vrpn_Tracker_PhaseSpace line: %s\nProper format " - "is: vrpn_Tracker_Phasespace [trackerName] [device] " - "[framerate] [readflag] [slaveflag]\n", - line); - return -1; - } - -#ifdef VRPN_INCLUDE_PHASESPACE - vrpn_Tracker_PhaseSpace *pstracker = new vrpn_Tracker_PhaseSpace( - trackerName, connection, device, framerate, readflag, slaveflag); - - char tag[LINESIZE]; - int sensor = 0; - int id = 0; - float x = 0; - float y = 0; - float z = 0; - bool inTag = false; - - // read file for markers and rigid body specifications - // Parse these even if they aren't used in slave mode just to consume their - // place in the input stream. - while (fgets(line, LINESIZE, config_file) != NULL) { - - // cut off comments - for (int i = 0; i < LINESIZE && line[i] != '\0'; i++) { - if (line[i] == '#') { - line[i] = '\0'; - break; - } - } - - // read tags and params - if (sscanf(line, "%s", tag) == 1) { - if (strcmp("<owl>", tag) == 0) { - if (inTag) { - fprintf( - stderr, - "Error, nested <owl> tag encountered. Aborting...\n"); - delete pstracker; - return -1; - } - else { - inTag = true; - continue; - } - } - else if (strcmp("</owl>", tag) == 0) { - if (inTag) { - inTag = false; - break; - } - else { - fprintf( - stderr, - "Error, </owl> tag without <owl> tag. Aborting...\n"); - return -1; - } - } - } - if (inTag) { - if (sscanf(line, "%d : rb+ %d %f %f %f", &sensor, &id, &x, &y, - &z) == 5) { - if (slaveflag) continue; - if (!pstracker->addRigidMarker(sensor, id, x, y, z)) { - fprintf(stderr, "Error, unable to add new rigid body " - "marker: %d:%d %f %f %f\n", - sensor, id, x, y, z); - continue; - } - } - else if (sscanf(line, "%d : pt %d", &sensor, &id) == 2) { - if (slaveflag) continue; - if (!pstracker->addMarker(sensor, id)) { - fprintf(stderr, "Error, unable to add marker %d:%d\n", - sensor, id); - continue; - } - } - else if (sscanf(line, "%d : rbnew", &sensor) == 1) { - if (slaveflag) continue; - if (!pstracker->startNewRigidBody(sensor)) { - fprintf(stderr, "Error, unable to add new rigid body: %d\n", - sensor); - continue; - } - } - else { - fprintf(stderr, "Ignoring line: %s\n", line); - continue; - } - } - } - - if (!pstracker->enableTracker(true)) { - fprintf(stderr, "Error, unable to enable OWL Tracker.\n"); - delete pstracker; - return -1; - } - _devices->add(pstracker); - - return 0; - -#else - fprintf(stderr, "vrpn_server: Can't open PhaseSpace OWL server: " - "VRPN_INCLUDE_PHASESPACE not defined in " - "vrpn_Configure.h!\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_Tracker_RazerHydra(char *&pch, char *line, - FILE *config_file) -{ - char s2[LINESIZE]; - - VRPN_CONFIG_NEXT(); - int ret = sscanf(pch, "%511s", s2); - if (ret != 1) { - fprintf(stderr, "Bad Razer Hydra line: %s\n", line); - return -1; - } - - // Open the Razer Hydra - if (verbose) { - printf("Opening vrpn_Tracker_RazerHydra\n"); - } - -#ifdef VRPN_USE_HID - // Open the tracker - _devices->add(new vrpn_Tracker_RazerHydra(s2, connection)); -#else - fprintf(stderr, - "RazerHydra driver works only with VRPN_USE_HID defined!\n"); -#endif - return 0; // successful completion -} - -int vrpn_Generic_Server_Object::setup_Tracker_NDI_Polaris(char *&pch, - char *line, - FILE *config_file) -{ - char trackerName[LINESIZE]; - char device[LINESIZE]; - int numRigidBodies; - char *rigidBodyFileNames[VRPN_GSO_MAX_NDI_POLARIS_RIGIDBODIES]; - - // get tracker name and device - if (sscanf(line, "vrpn_Tracker_NDI_Polaris %s %s %d", trackerName, device, - &numRigidBodies) < 3) { - fprintf(stderr, "Bad vrpn_Tracker_NDI_Polaris line: %s\n", line); - return -1; - } - printf("DEBUG Tracker_NDI_Polaris: num of rigidbodies %d\n", - numRigidBodies); - - // parse the filename for each rigid body - int rbNum; - for (rbNum = 0; rbNum < numRigidBodies; rbNum++) { - if (fgets(line, LINESIZE, config_file) == - NULL) { // advance to next line of config file - perror("NDI_Polaris RigidBody can't read line!"); - return -1; - } - rigidBodyFileNames[rbNum] = - new char[LINESIZE]; // allocate string for filename - if (sscanf(line, "%s", rigidBodyFileNames[rbNum]) != 1) { - fprintf(stderr, "Tracker_NDI_Polaris: error reading .rom filename " - "#%d from config file in line: %s\n", - rbNum, line); - return -1; - } - else { - printf("DEBUG Tracker_NDI_Polaris: filename >%s<\n", - rigidBodyFileNames[rbNum]); - } - } - - _devices->add(new vrpn_Tracker_NDI_Polaris( - trackerName, connection, device, numRigidBodies, - (const char **)rigidBodyFileNames)); - - // free the .rom filename strings - for (rbNum = 0; rbNum < numRigidBodies; rbNum++) { - delete [] (rigidBodyFileNames[rbNum]); - } - return (0); // success -} - -int vrpn_Generic_Server_Object::setup_Logger(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char s2[LINESIZE], s3[LINESIZE]; - - // Line will be: vrpn_Auxiliary_Logger_Server_Generic NAME CONNECTION_TO_LOG - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s %511s", s2, s3) != 2) { - fprintf(stderr, "Bad vrpn_Auxiliary_Logger_Server_Generic line: %s\n", - line); - return -1; - } - - // Open the logger - if (verbose) { - printf("Opening vrpn_Auxiliary_Logger_Server_Generic %s\n", s2); - } - _devices->add(new vrpn_Auxiliary_Logger_Server_Generic(s2, s3, connection)); - - return 0; // successful completion -} - -int vrpn_Generic_Server_Object::setup_ImageStream(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char s2[LINESIZE], s3[LINESIZE]; - - // Line will be: vrpn_Imager_Stream_Buffer NAME IMAGER_SERVER_TO_LOG - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s %511s", s2, s3) != 2) { - fprintf(stderr, "Bad vrpn_Imager_Stream_Buffer line: %s\n", line); - return -1; - } - - // Open the stream buffer - if (verbose) { - printf("Opening vrpn_Imager_Stream_Buffer %s\n", s2); - } - _devices->add(new vrpn_Imager_Stream_Buffer(s2, s3, connection)); - - return 0; // successful completion -} - -int vrpn_Generic_Server_Object::setup_WiiMote(char *&pch, char *line, - FILE * /*config_file*/) -{ - char sBDADDR[LINESIZE]; - char s2[LINESIZE]; - unsigned controller, useMS, useIR, reorderBtns; - - VRPN_CONFIG_NEXT(); - // Get the arguments (wiimote_name, controller index) - int numParms = sscanf(pch, "%511s%u %u %u %u %511s", s2, &controller, - &useMS, &useIR, &reorderBtns, sBDADDR); - if (numParms < 5) { - fprintf(stderr, "Bad vrpn_WiiMote line: %s\n", line); - return -1; - } - -#ifdef VRPN_USE_WIIUSE - // Open the WiiMote - if (verbose) { - printf("Opening vrpn_WiiMote: %s\n", s2); - } - if (numParms == 5) { - _devices->add(new vrpn_WiiMote(s2, connection, controller, useMS, useIR, - reorderBtns)); - } - else { - _devices->add(new vrpn_WiiMote(s2, connection, controller, useMS, useIR, - reorderBtns, sBDADDR)); - } - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open WiiMote: VRPN_USE_WIIUSE not " - "defined in vrpn_Configure.h!\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_Tracker_WiimoteHead( - char *&pch, char *line, FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - float f1, f2; - int numparms; - - VRPN_CONFIG_NEXT(); - - // Get the arguments (tracker_name, wiimote_name, min_update_rate, - // led_distance) - if ((numparms = sscanf(pch, "%511s%511s%f%f", s2, s3, &f1, &f2)) < 2) { - fprintf(stderr, - "Bad vrpn_Tracker_WiimoteHead line: %s\n%s %s %s %f %f\n", line, - pch, s2, s3, f1, f2); - return -1; - } - - // set LED distance to .205, if not set - if (numparms < 4) { - f2 = .205f; - } - // set min update rate to 60, if not set - if (numparms < 3) { - f1 = 60.0f; - } - - // Open the tracker - if (verbose) { - printf("Opening vrpn_Tracker_WiimoteHead: %s wiimote: %s, updaterate: " - "%f, leddistance: %f\n", - s2, s3, f1, f2); - } - - _devices->add(new vrpn_Tracker_WiimoteHead(s2, connection, s3, f1, f2)); - return 0; -} - -int vrpn_Generic_Server_Object::setup_Freespace(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; - unsigned controller, sendbody, senduser; - - VRPN_CONFIG_NEXT(); - // Get the arguments (wiimote_name, controller index) - if (sscanf(pch, "%511s%u%u%u", s2, &controller, &sendbody, &senduser) != - 4) { - fprintf(stderr, "Bad vrpn_Freespace line: %s\n", line); - return -1; - } - -#ifdef VRPN_USE_FREESPACE - // Open the Freespace if we can. - try { - _devices->add(vrpn_Freespace::create(s2, connection, controller, - (sendbody != 0), (senduser != 0))); - } - catch (vrpn_MainloopObject::CannotWrapNullPointerIntoMainloopObject &) { - fprintf(stderr, "vrpn_server: Can't open Freespace: driver could not " - "connect as configured!\n"); - return -1; - } - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open Freespace: VRPN_USE_FREESPACE not " - "defined in vrpn_Configure.h!\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_SpacePoint(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char s2[LINESIZE]; - - VRPN_CONFIG_NEXT(); - - if (sscanf(pch, "%511s", s2) != 1) { - fprintf(stderr, "Bad SpacePoint line: %s\n", line); - return -1; - } - -// Open the SpacePoint - -#ifdef VRPN_USE_HID - // Open the tracker - if (verbose) { - printf("Opening vrpn_Tracker_SpacePoint %s\n", s2); - } - - _devices->add(new vrpn_Tracker_SpacePoint(s2, connection)); -#else - fprintf(stderr, - "SpacePoint driver works only with VRPN_USE_HID defined!\n"); -#endif - - return 0; // successful completion -} - -int vrpn_Generic_Server_Object::setup_Wintracker(char *&pch, char *line, - FILE * /*config_file*/) -{ - - char name[LINESIZE]; - char s0[LINESIZE], s1[LINESIZE], s2[LINESIZE]; - char ext[LINESIZE]; - char hemi[LINESIZE]; - - VRPN_CONFIG_NEXT(); - - if (sscanf(pch, "%511s%511s%511s%511s%511s%511s", name, s0, s1, s2, ext, - hemi) != 6) { - fprintf(stderr, "Bad Wintracker line: %s\n", line); - fprintf(stderr, "NAME: %s\n", name); - return -1; - } - -// Open the Wintracker - -#ifdef VRPN_USE_HID - // Open the tracker - if (verbose) { - printf("Parameters -> name:%c, s0: %c, s1: %c, s2: %c,ext: %c, hemi: " - "%c\n", - name[0], s0[0], s1[0], s2[0], ext[0], hemi[0]); - printf("Opening vrpn_Tracker_Wintracker %s\n", name); - } - - _devices->add(new vrpn_Tracker_Wintracker(name, connection, s0[0], s1[0], - s2[0], ext[0], hemi[0])); -#else - fprintf(stderr, - "Wintracker driver works only with VRPN_USE_HID defined!\n"); -#endif - - return 0; // successful completion -} - -int vrpn_Generic_Server_Object::setup_Tracker_GameTrak(char *pch, char *line, - FILE *config_file) -{ - char s2[LINESIZE]; - char s3[LINESIZE]; - - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s%511s", s2, s3) != 2) { - fprintf(stderr, "Bad GameTrak line: %s\n", line); - return -1; - } - - // read axis mapping line if present - if (fgets(line, LINESIZE, config_file) == NULL) { - perror("GameTrak Can't read line!"); - return -1; - } - - // if it is an empty line, finish parsing - int mapping[] = {0, 1, 2, 3, 4, 5}; - if (line[0] != '\n') { - // get the first token - char tok[LINESIZE]; - sscanf(line, "%s", tok); - - if (strcmp(tok, "axis_mapping") == 0) { - sscanf(line, "%s %d %d %d %d %d %d", tok, &mapping[0], &mapping[1], - &mapping[2], &mapping[3], &mapping[4], &mapping[5]); - } - else { - fprintf( - stderr, - "Incorrect GameTrak line %s (did you forget an empty line?)\n", - line); - return -1; - } - } - - // Open the GameTrak - - // Open the tracker - if (verbose) { - printf("Opening vrpn_Tracker_GameTrak %s by using joystick device %s\n", - s2, s3); - printf("GameTrak axis mapping: %d %d %d %d %d %d\n", mapping[0], - mapping[1], mapping[2], mapping[3], mapping[4], mapping[5]); - } - - _devices->add(new vrpn_Tracker_GameTrak(s2, connection, s3, mapping)); - - return 0; // successful completion -} - -int vrpn_Generic_Server_Object::setup_Tracker_MotionNode(char *&pch, char *line, - FILE * /*config_file*/) -{ - char name[LINESIZE]; - unsigned num_sensors = 0; - char address[LINESIZE]; - unsigned port = 0; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, tracker_name, sensors, rate) - if (4 != - sscanf(pch, "%511s%u%511s%u", name, &num_sensors, address, &port)) { - fprintf(stderr, "Bad vrpn_Tracker_MotionNode line: %s\n", line); - return -1; - } - -#ifdef VRPN_USE_MOTIONNODE - // Open the tracker - if (verbose) { - printf("Opening vrpn_Tracker_MotionNode: %s with %u sensors, address " - "%s, port %u\n", - name, num_sensors, address, port); - } - - _devices->add(new vrpn_Tracker_MotionNode(name, connection, num_sensors, - address, port)); - return 0; -#else - fprintf(stderr, "vrpn_Tracker_MotionNode: Not compiled in (add " - "VRPN_USE_MOTIONNODE to vrpn_Configure.h and recompile)\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_Tracker_GPS(char *&pch, char *line, - FILE * /*config_file*/) -{ - unsigned num_sensors = 0; - char address[LINESIZE] = "/dev/tty.someserialport"; - - char trackerName[512]; - int baud; - int useUTM = 0; - - int argCount = 0; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, tracker_name, sensors, rate) - argCount = sscanf(pch, "%511s%511s%u", trackerName, address, &baud); - // printf("tracker GPS values: %s, %s, %d\n", trackerName, address, baud); - if (3 != argCount) { - fprintf(stderr, "Bad vrpn_Tracker_GPS line:\n %s\n\targCount is %d\n", - line, argCount); - return -1; - } - - // Open the tracker - if (verbose) { - printf("Opening vrpn_Tracker_GPS: %s with %u sensors, address %s, port " - "%u\n", - trackerName, num_sensors, address, baud); - } - - //_devices->add(new vrpn_Tracker_GPS(name, connection, num_sensors, address, - // port)); - _devices->add(new vrpn_Tracker_GPS(trackerName, connection, address, baud, - useUTM, 0)); - - return 0; -} - -int vrpn_Generic_Server_Object::setup_Tracker_TrivisioColibri( - char *&pch, char *line, FILE * /*config_file*/) -{ - char s2[LINESIZE]; - int numSensors, Hz, bufLen; - - VRPN_CONFIG_NEXT(); - // Get the arguments - if (sscanf(pch, "%511s%d%d%d", s2, &numSensors, &Hz, &bufLen) != 4) { - fprintf(stderr, "Bad vrpn_Tracker_TrivisioColibri line: %s\n", line); - return -1; - } - -#ifdef VRPN_USE_TRIVISIOCOLIBRI - // Open the Trivisio Colibri if we can. - if (verbose) { - printf("Opening vrpn_Tracker_TrivisioColibri: %s with %d sensors, %d " - "Hz, and %d bufLen", - s2, numSensors, Hz, bufLen); - } - - _devices->add(new vrpn_Tracker_TrivisioColibri(s2, connection, numSensors, - Hz, bufLen)); - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open vrpn_Tracker_TrivisioColibri: " - "VRPN_USE_TRIVISIOCOLIBRI not defined in " - "vrpn_Configure.h!\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_LUDL_USBMAC6000(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; - int recenter; - - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s%i", s2, &recenter) != 2) { - fprintf(stderr, "Bad LUDL_USBMAC6000 line: %s\n", line); - return -1; - } - -#if defined(VRPN_USE_LIBUSB_1_0) - - // Open the LUDL_USBMAC6000 - - // Open the button - if (verbose) { - printf("Opening vrpn_LUDL_USBMAC6000 as device %s\n", s2); - } - _devices->add(new vrpn_LUDL_USBMAC6000(s2, connection, recenter != 0)); - - return 0; // successful completion - -#else - fprintf(stderr, - "vrpn_LUDL_USBMAC6000 requires VRPN built with LIBUSB_1_0.\n"); - return -1; -#endif -} - -template <class T> -int setup_Analog_5dtUSB(const char *specialization, bool verbose, - vrpn_Connection *connection, - vrpn_MainloopContainer *_devices, char *&pch, - char *line) -{ - char s2[LINESIZE]; - // Get the arguments - if (sscanf(pch, "%511s", s2) != 1) { - fprintf(stderr, "Bad vrpn_Analog_5dtUSB_%s line: %s\n", specialization, - line); - return -1; - } -#if defined(VRPN_USE_HID) - - // Open the device - if (verbose) { - printf("Opening vrpn_Analog_5dtUSB_%s as device %s\n", specialization, - s2); - } - _devices->add(new T(s2, connection)); - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open vrpn_Analog_5dtUSB_%s: " - "VRPN_USE_HID not defined in vrpn_Configure.h!\n", - specialization); - return -1; -#endif -} - -#if !defined(VRPN_USE_HID) -// Have to make these types exist for the sake of simplifying the calls below. -typedef int vrpn_Analog_5dtUSB_Glove5Left; -typedef int vrpn_Analog_5dtUSB_Glove5Right; -typedef int vrpn_Analog_5dtUSB_Glove14Left; -typedef int vrpn_Analog_5dtUSB_Glove14Right; -#endif -int vrpn_Generic_Server_Object::setup_Analog_5dtUSB_Glove5Left( - char *&pch, char *line, FILE * /*config_file*/) -{ - VRPN_CONFIG_NEXT(); - return setup_Analog_5dtUSB<vrpn_Analog_5dtUSB_Glove5Left>( - "Glove5Left", verbose, connection, _devices, pch, line); -} - -int vrpn_Generic_Server_Object::setup_Analog_5dtUSB_Glove5Right( - char *&pch, char *line, FILE * /*config_file*/) -{ - VRPN_CONFIG_NEXT(); - return setup_Analog_5dtUSB<vrpn_Analog_5dtUSB_Glove5Right>( - "Glove5Right", verbose, connection, _devices, pch, line); -} - -int vrpn_Generic_Server_Object::setup_Analog_5dtUSB_Glove14Left( - char *&pch, char *line, FILE * /*config_file*/) -{ - VRPN_CONFIG_NEXT(); - return setup_Analog_5dtUSB<vrpn_Analog_5dtUSB_Glove14Left>( - "Glove14Left", verbose, connection, _devices, pch, line); -} - -int vrpn_Generic_Server_Object::setup_Analog_5dtUSB_Glove14Right( - char *&pch, char *line, FILE * /*config_file*/) -{ - VRPN_CONFIG_NEXT(); - return setup_Analog_5dtUSB<vrpn_Analog_5dtUSB_Glove14Right>( - "Glove14Right", verbose, connection, _devices, pch, line); -} - -int vrpn_Generic_Server_Object::setup_Tracker_FilterOneEuro( - char *&pch, char *line, FILE * /*config_file*/) -{ - char s2[LINESIZE], s3[LINESIZE]; - int sensors; - double vecMinCutoff, vecBeta, vecDerivativeCutoff; - double quatMinCutoff, quatBeta, quatDerivativeCutoff; - - VRPN_CONFIG_NEXT(); - if (sscanf(pch, "%511s%511s%d%lf%lf%lf%lf%lf%lf", s2, s3, &sensors, - &vecMinCutoff, &vecBeta, &vecDerivativeCutoff, &quatMinCutoff, - &quatBeta, &quatDerivativeCutoff) != 9) { - fprintf(stderr, "Bad FilterOneEuro line: %s\n", line); - return -1; - } - - // Open the Filter - if (verbose) { - printf("Opening vrpn_Tracker_FilterOneEuro as device %s\n", s2); - } - _devices->add(new vrpn_Tracker_FilterOneEuro( - s2, connection, s3, sensors, vecMinCutoff, vecBeta, vecDerivativeCutoff, - quatMinCutoff, quatBeta, quatDerivativeCutoff)); - - return 0; // successful completion -} - -int vrpn_Generic_Server_Object::setup_Tracker_zSight(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; - - VRPN_CONFIG_NEXT(); - // Get the arguments - if (sscanf(pch, "%511s", s2) != 1) { - fprintf(stderr, "Bad vrpn_Tracker_zSight line: %s\n", line); - return -1; - } - -#if defined(_WIN32) && defined(VRPN_USE_DIRECTINPUT) && \ - defined(VRPN_HAVE_ATLBASE) - // Open the zSight if we can. - if (verbose) { - printf("Opening vrpn_Tracker_zSight: %s", s2); - } - - _devices->add(new vrpn_Tracker_zSight(s2, connection)); - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open vrpn_Tracker_zSight: " - "VRPN_USE_DIRECTINPUT and/or VRPN_HAVE_ATLBASE not defined " - "in vrpn_Configure.h!\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_Tracker_ViewPoint(char *&pch, char *line, - FILE * /*config_file*/) -{ - char s2[LINESIZE]; // Get the arguments - int smoothedData; - - VRPN_CONFIG_NEXT(); - // Get the arguments - if (sscanf(pch, "%511s%d", s2, &smoothedData) != 2) { - fprintf(stderr, "Bad vrpn_Tracker_ViewPoint line: %s\n", line); - return -1; - } - -#ifdef VRPN_USE_VIEWPOINT - // Open the ViewPoint EyeTracker if we can. - if (verbose) { - printf("Opening vrpn_Tracker_ViewPoint: %s", s2); - } - - bool smooth = smoothedData == 1; - _devices->add(new vrpn_Tracker_ViewPoint(s2, connection, smooth)); - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open vrpn_Tracker_ViewPoint: " - "VRPN_USE_VIEWPOINT not defined in vrpn_Configure.h!\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_Tracker_G4(char *&pch, char *line, - FILE *config_file) -{ - char name[LINESIZE], filepath[LINESIZE]; - int numparms; - int Hz = 10; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, tracker_name) - numparms = sscanf(pch, "%511s%d", name, &Hz); - if (numparms == 0) { - return -1; - } - - if (name[strlen(name) - 1] == '\\') { - name[strlen(name) - 1] = '\0'; - } - - printf("\n%s Connecting with .g4c file located at:\n", name); - - // get the filepath to the .g4c file - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf(stderr, "Ran past end of config file in G4 description\n"); - return -1; - } - - filepath[0] = 0; - strncat(filepath, line, LINESIZE - 1); - - if (filepath[strlen(filepath) - 2] == '\\') { - filepath[strlen(filepath) - 2] = '\0'; - } - else { - filepath[strlen(filepath) - 1] = '\0'; - } - - printf("%s\n", filepath); - -#ifdef VRPN_USE_PDI - char rcmd[5000]; - vrpn_Tracker_G4_HubMap *pHMap = NULL; - // If the last character in the line is a backslash, '\', then - // the following line is an additional command to send to the - // G4 at reset time. So long as we find lines with slashes - // at the ends, we add them to the command string to send. Note - // that there is a newline at the end of the line, following the - // backslash. - rcmd[0] = 0; - while (line[strlen(line) - 2] == '\\') { - // Read the next line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf(stderr, "Ran past end of config file in G4 description\n"); - return -1; - } - - // G4DigIO name hubID #buttons - if (strncmp(line, "G4DigIO", strlen("G4DigIO")) == 0) { - int nHub = 0; - int nButtons = 0; - char DigIOName[VRPN_G4_HUB_NAME_SIZE]; - - if (3 != sscanf(line, "G4DigIO %64s %d %d", DigIOName, &nHub, - &nButtons)) { - fprintf(stderr, "Invalid G4DigIO argument list: %s\n", line); - } - else { - printf("\nCreating G4DigIO %s on Hub %d with inputs 0-%d\n", - DigIOName, nHub, nButtons - 1); - - if (pHMap == NULL) { - pHMap = new vrpn_Tracker_G4_HubMap(); - } - - pHMap->Add(nHub); - pHMap->ButtonInfo(nHub, DigIOName, nButtons); - } - } - else if (strncmp(line, "G4PowerTrak", strlen("G4PowerTrak")) == 0) { - int nHub = 0; - char PowerTrakName[VRPN_G4_HUB_NAME_SIZE]; - - if (2 != - sscanf(line, "G4PowerTrak %64s %d", PowerTrakName, &nHub)) { - fprintf(stderr, "Invalid G4PowerTrak argument list: %s\n", - line); - } - else { - printf( - "\nCreating G4PowerTrak %s on Hub %d with buttons 0-%d\n", - PowerTrakName, nHub, VRPN_G4_POWERTRAK_BUTTON_COUNT - 1); - - if (pHMap == NULL) { - pHMap = new vrpn_Tracker_G4_HubMap(); - } - - pHMap->Add(nHub); - pHMap->ButtonInfo(nHub, PowerTrakName, - VRPN_G4_POWERTRAK_BUTTON_COUNT); - } - } - else { - // Copy the line into the remote command, - // then replace \ with \0 - strncat(rcmd, line, LINESIZE); - } - } - - if (strlen(rcmd) > 0) { - printf("Additional reset commands found\n"); - } - - _devices->add( - new vrpn_Tracker_G4(name, connection, filepath, Hz, rcmd, pHMap)); - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open vrpn_Tracker_G4: VRPN_USE_PDI not " - "defined in vrpn_Configure.h!\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_Tracker_FastrakPDI(char *&pch, char *line, - FILE *config_file) -{ -#ifdef VRPN_USE_PDI - char name[LINESIZE]; - int Hz = 10; - char rcmd[5000]; // reset commands to send to Liberty - unsigned int nStylusMap = 0; - VRPN_CONFIG_NEXT(); - // Get the arguments (class(already taken), tracker_name, reports per - // second) - sscanf(pch, "%511s%d", name, &Hz); - - // remove the '\' from the end of the name, if it has one - if (name[strlen(name) - 1] == '\\') { - name[strlen(name) - 1] = '\0'; - } - - printf("New FastrakPDI of name: %s\r\n", name); - printf(" ...additional reset commands follow:\r\n"); - - // If the last character in the line is a backslash, '\', then - // the following line is an additional command to send to the - // FastrakPDI at reset time. So long as we find lines with slashes - // at the ends, we add them to the command string to send. Note - // that there is a newline at the end of the line, following the - // backslash. - rcmd[0] = 0; - while (line[strlen(line) - 2] == '\\') { - // Read the next line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf( - stderr, - "Ran past end of config file in FastrakPDI description\r\n"); - return -1; - } - - if (strncmp(line, "PDIStylus", strlen("PDIStylus")) == 0) { - int nStylus = 0; - sscanf(line, "PDIStylus %d", &nStylus); - if (!((nStylus > 0) && (nStylus <= FT_MAX_SENSORS))) { - fprintf(stderr, - "PDIStylus command invalid station number: %s\r\n", - line); - return -1; - } - else { - printf("Creating PDIStylus button on station %d \r\n", nStylus); - nStylusMap |= (1 << (nStylus - 1)); - } - } - // Copy the line into rcmd if it is not a comment, or the tracker name - // line - if (line[0] != '#' && (line[0] != 'v' && line[1] != 'r')) { - strncat(rcmd, line, LINESIZE); - } - } - - if (rcmd[0] == 0) { - printf(" no additional commands found\r\n"); - } - - _devices->add( - new vrpn_Tracker_FastrakPDI(name, connection, Hz, rcmd, nStylusMap)); - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open vrpn_Tracker_FastrakPDI: " - "VRPN_USE_PDI not defined in vrpn_Configure.h!\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_Tracker_LibertyPDI(char *&pch, char *line, - FILE *config_file) -{ -#ifdef VRPN_USE_PDI - char name[LINESIZE]; - int Hz = 10; - unsigned int nStylusMap = 0; - char rcmd[5000]; // reset commands to send to Liberty - - VRPN_CONFIG_NEXT(); - // Get the arguments (class(already taken), tracker_name, reports per - // second) - sscanf(pch, "%511s%d", name, &Hz); - - // remove the '\' from the end of the name, if it has one - if (name[strlen(name) - 1] == '\\') { - name[strlen(name) - 1] = '\0'; - } - - printf("New LibertyPDI of name: %s\r\n", name); - printf(" ...additional reset commands follow:\r\n"); - - // If the last character in the line is a backslash, '\', then - // the following line is an additional command to send to the - // LibertyPDI at reset time. So long as we find lines with slashes - // at the ends, we add them to the command string to send. Note - // that there is a newline at the end of the line, following the - // backslash. - rcmd[0] = 0; - while (line[strlen(line) - 2] == '\\') { - // Read the next line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf( - stderr, - "Ran past end of config file in LibertyPDI description\r\n"); - return -1; - } - - if (strncmp(line, "PDIStylus", strlen("PDIStylus")) == 0) { - int nStylus = 0; - sscanf(line, "PDIStylus %d", &nStylus); - if (!((nStylus > 0) && (nStylus <= LIBERTY_MAX_SENSORS))) { - fprintf(stderr, - "PDIStylus command invalid station number: %s\r\n", - line); - return -1; - } - else { - printf("Creating PDIStylus button on station %d \r\n", nStylus); - nStylusMap |= (1 << (nStylus - 1)); - } - } - // Copy the line into rcmd if it is not a comment, or the tracker name - // line - else if (line[0] != '#' && line[0] != 'v' && line[1] != 'r') { - strncat(rcmd, line, LINESIZE); - } - } - - if (rcmd[0] == 0) { - printf(" no additional commands found\r\n"); - } - - _devices->add( - new vrpn_Tracker_LibertyPDI(name, connection, Hz, rcmd, nStylusMap)); - - return 0; -#else - fprintf(stderr, "vrpn_server: Can't open vrpn_Tracker_LibertyPDI: " - "VRPN_USE_PDI not defined in vrpn_Configure.h!\n"); - return -1; -#endif -} - -int vrpn_Generic_Server_Object::setup_YEI_3Space_Sensor(char *&pch, char *line, - FILE *config_file) -{ - char name[LINESIZE], device[LINESIZE]; - int baud_rate, calibrate_gyros, tare; - double frames_per_second; - float red_LED, green_LED, blue_LED; - int LED_mode; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, name, port, baud, calibrate_gyros, tare, - // frames_per_second - if (sscanf(pch, "%511s%511s%d%d%d%lf%f%f%f%d", name, device, &baud_rate, - &calibrate_gyros, &tare, &frames_per_second, &red_LED, - &green_LED, &blue_LED, &LED_mode) != 10) { - fprintf(stderr, "Bad vrpn_YEI_3Space_Sensor line: %s\n", line); - return -1; - } - - // Allocate space to store pointers to reset commands. Initialize - // all of them to NULL pointers, indicating no commands. - const int MAX_RESET_COMMANDS = 1024; - int num_reset_commands = 0; - const char *reset_commands[MAX_RESET_COMMANDS+1]; - for (int i = 0; i < MAX_RESET_COMMANDS; i++) { - reset_commands[i] = NULL; - } - - // If the last character in the line is a backslash, '\', then - // the following line is an additional command to send to the - // YEI at reset time. So long as we find lines with backslashes - // at the ends, we add them to the command list to send. Note - // that there is a newline at the end of the line, following the - // backslash. - while (line[strlen(line) - 2] == '\\') { - // Read the VRPN_CONFIG_NEXT line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf( - stderr, - "Ran past end of config file in YEI description\n"); - return -1; - } - - // Copy the first string from the line into a new character - // array and then store this into the reset_commands list - // if we haven't run out of room for them. - if (num_reset_commands < MAX_RESET_COMMANDS) { - char command[LINESIZE]; - sscanf(line, "%s", command); - char *command_copy = new char[strlen(command)+1]; - if (command_copy == NULL) { - fprintf(stderr, "Out of memory in YEI description\n"); - return -1; - } - strcpy(command_copy, command); - reset_commands[num_reset_commands++] = command_copy; - } - } - - // Open the device - if (verbose) { - printf("Opening vrpn_YEI_3Space_Sensor: %s on port %s, baud %d\n", name, - device, baud_rate); - if (num_reset_commands > 0) { - printf("... additional reset commands follow:\n"); - for (int i = 0; i < num_reset_commands; i++) { - printf(" %s\n", reset_commands[i]); - } - } - } - _devices->add(new vrpn_YEI_3Space_Sensor( - name, connection, device, baud_rate, calibrate_gyros != 0, tare != 0, - frames_per_second, red_LED, green_LED, blue_LED, LED_mode, - reset_commands)); - - // Free up any additional-reset command data. - for (int i = 0; i < MAX_RESET_COMMANDS; i++) { - if (reset_commands[i] != NULL) { - delete [] reset_commands[i]; - reset_commands[i] = NULL; - } - } - - return 0; -} - -int vrpn_Generic_Server_Object::setup_YEI_3Space_Sensor_Wireless(char *&pch, char *line, - FILE *config_file) -{ - char name[LINESIZE], device[LINESIZE]; - int logical_id, serial_number, baud_rate, calibrate_gyros, tare; - double frames_per_second; - float red_LED, green_LED, blue_LED; - int LED_mode; - - VRPN_CONFIG_NEXT(); - // Get the arguments (class, name, port, baud, calibrate_gyros, tare, - // frames_per_second - if (sscanf(pch, "%511s%d%x%511s%d%d%d%lf%f%f%f%d", name, &logical_id, - &serial_number, device, &baud_rate, - &calibrate_gyros, &tare, &frames_per_second, &red_LED, - &green_LED, &blue_LED, &LED_mode) != 12) { - fprintf(stderr, "Bad setup_YEI_3Space_Sensor_Wireless line: %s\n", line); - return -1; - } - - // Allocate space to store pointers to reset commands. Initialize - // all of them to NULL pointers, indicating no commands. - const int MAX_RESET_COMMANDS = 1024; - int num_reset_commands = 0; - const char *reset_commands[MAX_RESET_COMMANDS+1]; - for (int i = 0; i < MAX_RESET_COMMANDS; i++) { - reset_commands[i] = NULL; - } - - // If the last character in the line is a backslash, '\', then - // the following line is an additional command to send to the - // YEI at reset time. So long as we find lines with backslashes - // at the ends, we add them to the command list to send. Note - // that there is a newline at the end of the line, following the - // backslash. - while (line[strlen(line) - 2] == '\\') { - // Read the VRPN_CONFIG_NEXT line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf( - stderr, - "Ran past end of config file in YEI description\n"); - return -1; - } - - // Copy the first string from the line into a new character - // array and then store this into the reset_commands list - // if we haven't run out of room for them. - if (num_reset_commands < MAX_RESET_COMMANDS) { - char command[LINESIZE]; - sscanf(line, "%s", command); - char *command_copy = new char[strlen(command)+1]; - if (command_copy == NULL) { - fprintf(stderr, "Out of memory in YEI description\n"); - return -1; - } - strcpy(command_copy, command); - reset_commands[num_reset_commands++] = command_copy; - } - } - - // Open the device - if (verbose) { - printf("Opening setup_YEI_3Space_Sensor_Wireless: %s on port %s, baud %d\n", name, - device, baud_rate); - if (num_reset_commands > 0) { - printf("... additional reset commands follow:\n"); - for (int i = 0; i < num_reset_commands; i++) { - printf(" %s\n", reset_commands[i]); - } - } - } - vrpn_YEI_3Space_Sensor_Wireless *dev = new vrpn_YEI_3Space_Sensor_Wireless( - name, connection, - logical_id, serial_number, device, baud_rate, calibrate_gyros != 0, tare != 0, - frames_per_second, red_LED, green_LED, blue_LED, LED_mode, - reset_commands); - _devices->add(dev); - - // Free up any additional-reset command data. - for (int i = 0; i < MAX_RESET_COMMANDS; i++) { - if (reset_commands[i] != NULL) { - delete [] reset_commands[i]; - reset_commands[i] = NULL; - } - } - - // If the last character in the line is a slash, '/', then - // the following line is an additional sensor description. Note - // that there is a newline at the end of the line, following the - // backslash. Re-parse the whole thing, using the second-sensor - // description format and the serial port descriptor from the first - // device. - int serial_fd = dev->get_serial_file_descriptor(); - while (line[strlen(line) - 2] == '/') { - // Read the VRPN_CONFIG_NEXT line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf( - stderr, - "Ran past end of config file in YEI description\n"); - return -1; - } - - // Get the arguments (class, name, port, baud, calibrate_gyros, tare, - // frames_per_second. - char classname[LINESIZE]; // We need to read the class, since we've not pre-parsed - if (sscanf(line, "%511s%511s%d%x%d%d%lf%f%f%f%d", classname, name, &logical_id, - &serial_number, - &calibrate_gyros, &tare, &frames_per_second, &red_LED, - &green_LED, &blue_LED, &LED_mode) != 11) { - fprintf(stderr, "Bad setup_YEI_3Space_Sensor_Wireless line: %s\n", line); - return -1; - } - - // If the last character in the line is a backslash, '\', then - // the following line is an additional command to send to the - // YEI at reset time. So long as we find lines with backslashes - // at the ends, we add them to the command list to send. Note - // that there is a newline at the end of the line, following the - // backslash. - num_reset_commands = 0; - while (line[strlen(line) - 2] == '\\') { - // Read the VRPN_CONFIG_NEXT line - if (fgets(line, LINESIZE, config_file) == NULL) { - fprintf( - stderr, - "Ran past end of config file in YEI description\n"); - return -1; - } - - // Copy the first string from the line into a new character - // array and then store this into the reset_commands list - // if we haven't run out of room for them. - if (num_reset_commands < MAX_RESET_COMMANDS) { - char command[LINESIZE]; - sscanf(line, "%s", command); - char *command_copy = new char[strlen(command)+1]; - if (command_copy == NULL) { - fprintf(stderr, "Out of memory in YEI description\n"); - return -1; - } - strcpy(command_copy, command); - reset_commands[num_reset_commands++] = command_copy; - } - } - - // Open the device - if (verbose) { - printf("Opening setup_YEI_3Space_Sensor_Wireless: %s on port %s, baud %d\n", name, - device, baud_rate); - if (num_reset_commands > 0) { - printf("... additional reset commands follow:\n"); - for (int i = 0; i < num_reset_commands; i++) { - printf(" %s\n", reset_commands[i]); - } - } - } - _devices->add(new vrpn_YEI_3Space_Sensor_Wireless( - name, connection, - logical_id, serial_number, serial_fd, calibrate_gyros != 0, tare != 0, - frames_per_second, red_LED, green_LED, blue_LED, LED_mode, - reset_commands)); - - // Free up any additional-reset command data. - for (int i = 0; i < MAX_RESET_COMMANDS; i++) { - if (reset_commands[i] != NULL) { - delete [] reset_commands[i]; - reset_commands[i] = NULL; - } - } - } // End of while new devices ('/' at and of line) - - return 0; -} - -#undef VRPN_CONFIG_NEXT - -vrpn_Generic_Server_Object::vrpn_Generic_Server_Object( - vrpn_Connection *connection_to_use, const char *config_file_name, int port, - bool be_verbose, bool bail_on_open_error) - : connection(connection_to_use) - , d_doing_okay(true) - , verbose(be_verbose) - , d_bail_on_open_error(bail_on_open_error) - , _devices(new vrpn_MainloopContainer) - -{ - /// @todo warning: unused parameter 'port' [-Wunused-parameter] - FILE *config_file; - - // Open the configuration file - if (verbose) { - printf("Reading from config file %s\n", config_file_name); - } - if ((config_file = fopen(config_file_name, "r")) == NULL) { - perror("vrpn_Generic_Server_Object::vrpn_Generic_Server_Object(): " - "Cannot open config file"); - fprintf(stderr, " (filename %s)\n", config_file_name); - d_doing_okay = false; - return; - } - - // Store the locale that was set before we came in here. - // The global locale is obtained by using the default - // constructor. - std::locale const orig_locale = std::locale(); - - // Read the configuration file, creating a device for each entry. - // Each entry is on one line, which starts with the name of the - // class of the object that is to be created. - // If we fail to open a certain device, print a message and decide - // whether we should bail. - { - char line[LINESIZE]; // Line read from the input file - char *pch; - char scrap[LINESIZE]; - char s1[LINESIZE]; - int retval; - - // Read lines from the file until we run out - while (fgets(line, LINESIZE, config_file) != NULL) { - - // Set the global locale to be "C", the classic one, so that - // when we parse the configuration file it will use dots for - // decimal points even if the local standard is commas. - // putting them into the global locale. We tried putting this - // code above, outside the parsing loop, but it did not have - // the desired effect when placed there. This is the earliest - // we were able to put it and have it work. - std::locale::global(std::locale("C")); - - // Make sure the line wasn't too long - if (strlen(line) >= LINESIZE - 1) { - fprintf(stderr, "vrpn_Generic_Server_Object::vrpn_Generic_" - "Server_Object(): Line too long in config " - "file: %s\n", - line); - if (d_bail_on_open_error) { - d_doing_okay = false; - return; - } - else { - continue; // Skip this line - } - } - - // Ignore comments and empty lines. Skip white space before comment - // mark (#). - if (strlen(line) < 3) { - continue; - } - bool ignore = false; - for (int j = 0; line[j] != '\0'; j++) { - if (line[j] == ' ' || line[j] == '\t') { - continue; - } - if (line[j] == '#') { - ignore = true; - } - break; - } - if (ignore) { - continue; - } - - // copy for strtok work - strncpy(scrap, line, LINESIZE - 1); - scrap[sizeof(scrap) - 1] = '\0'; -// Figure out the device from the name and handle appropriately - -// WARNING: SUBSTRINGS WILL MATCH THE EARLIER STRING, SO -// ADD AN EMPTY SPACE TO THE END OF STATIC STRINGS!!!! - -#define VRPN_ISIT(s) !strcmp(pch = strtok(scrap, " \t"), s) -#define VRPN_CHECK(s) \ - retval = (s)(pch, line, config_file); \ - if (retval && d_bail_on_open_error) { \ - d_doing_okay = false; \ - return; \ - } \ - else { \ - continue; \ - } - - // This is a hack to get around a hard limit on how many - // if-then-else - // clauses you can have in the same function on Microsoft compilers. - // We break the checking into multiple chunks as needed. - // If any of the clauses work, we've found it. Only if the else - // clause - // in the batch has not been called do we continue looking. - bool found_it_yet = true; - - if (VRPN_ISIT("vrpn_raw_SGIBox")) { - VRPN_CHECK(setup_raw_SGIBox); - } - else if (VRPN_ISIT("vrpn_SGIBOX")) { - VRPN_CHECK(setup_SGIBox); - } - else if (VRPN_ISIT("vrpn_JoyFly")) { - VRPN_CHECK(setup_JoyFly); - } - else if (VRPN_ISIT("vrpn_Tracker_AnalogFly")) { - VRPN_CHECK(setup_Tracker_AnalogFly); - } - else if (VRPN_ISIT("vrpn_Tracker_ButtonFly")) { - VRPN_CHECK(setup_Tracker_ButtonFly); - } - else if (VRPN_ISIT("vrpn_Joystick")) { - VRPN_CHECK(setup_Joystick); - } - else if (VRPN_ISIT("vrpn_Joylin")) { - VRPN_CHECK(setup_Joylin); - } - else if (VRPN_ISIT("vrpn_Joywin32")) { - VRPN_CHECK(setup_Joywin32); - } - else if (VRPN_ISIT("vrpn_Button_Example")) { - VRPN_CHECK(setup_Example_Button); - } - else if (VRPN_ISIT("vrpn_Dial_Example")) { - VRPN_CHECK(setup_Example_Dial); - } - else if (VRPN_ISIT("vrpn_CerealBox")) { - VRPN_CHECK(setup_CerealBox); - } - else if (VRPN_ISIT("vrpn_Magellan")) { - VRPN_CHECK(setup_Magellan); - } - else if (VRPN_ISIT("vrpn_Spaceball")) { - VRPN_CHECK(setup_Spaceball); - } - else if (VRPN_ISIT("vrpn_Radamec_SPI")) { - VRPN_CHECK(setup_Radamec_SPI); - } - else if (VRPN_ISIT("vrpn_Zaber")) { - VRPN_CHECK(setup_Zaber); - } - else if (VRPN_ISIT("vrpn_BiosciencesTools")) { - VRPN_CHECK(setup_BiosciencesTools); - } - else if (VRPN_ISIT("vrpn_OmegaTemperature")) { - VRPN_CHECK(setup_OmegaTemperature); - } - else if (VRPN_ISIT("vrpn_IDEA")) { - VRPN_CHECK(setup_IDEA); - } - else if (VRPN_ISIT("vrpn_5dt")) { - VRPN_CHECK(setup_5dt); - } - else if (VRPN_ISIT("vrpn_5dt16")) { - VRPN_CHECK(setup_5dt16); - } - else if (VRPN_ISIT("vrpn_Button_5DT_Server")) { - VRPN_CHECK(setup_Button_5DT_Server); - } - else if (VRPN_ISIT("vrpn_ImmersionBox")) { - VRPN_CHECK(setup_ImmersionBox); - } - else if (VRPN_ISIT("vrpn_Tracker_Dyna")) { - VRPN_CHECK(setup_Tracker_Dyna); - } - else if (VRPN_ISIT("vrpn_Tracker_Fastrak")) { - VRPN_CHECK(setup_Tracker_Fastrak); - } - else if (VRPN_ISIT("vrpn_Tracker_NDI_Polaris")) { - VRPN_CHECK(setup_Tracker_NDI_Polaris); - } - else if (VRPN_ISIT("vrpn_Tracker_Isotrak")) { - VRPN_CHECK(setup_Tracker_Isotrak); - } - else if (VRPN_ISIT("vrpn_Tracker_NDI_Polaris")) { - VRPN_CHECK(setup_Tracker_NDI_Polaris); - } - else if (VRPN_ISIT("vrpn_Tracker_Liberty")) { - VRPN_CHECK(setup_Tracker_Liberty); - } - else if (VRPN_ISIT("vrpn_Tracker_LibertyHS")) { - VRPN_CHECK(setup_Tracker_LibertyHS); - } - else if (VRPN_ISIT("vrpn_Tracker_3Space")) { - VRPN_CHECK(setup_Tracker_3Space); - } - else if (VRPN_ISIT("vrpn_Tracker_Flock")) { - VRPN_CHECK(setup_Tracker_Flock); - } - else if (VRPN_ISIT("vrpn_Tracker_Flock_Parallel")) { - VRPN_CHECK(setup_Tracker_Flock_Parallel); - } - else if (VRPN_ISIT("vrpn_Tracker_3DMouse")) { - VRPN_CHECK(setup_Tracker_3DMouse); - } - else if (VRPN_ISIT("vrpn_Tracker_NULL")) { - VRPN_CHECK(setup_Tracker_NULL); - } - else if (VRPN_ISIT("vrpn_Button_Python")) { - VRPN_CHECK(setup_Button_Python); - } - else if (VRPN_ISIT("vrpn_Button_PinchGlove")) { - VRPN_CHECK(setup_Button_PinchGlove); - } - else if (VRPN_ISIT("vrpn_Button_SerialMouse")) { - VRPN_CHECK(setup_Button_SerialMouse); - } - else if (VRPN_ISIT("vrpn_Wanda")) { - VRPN_CHECK(setup_Wanda); - } - else if (VRPN_ISIT("vrpn_Mouse")) { - VRPN_CHECK(setup_Mouse); - } - else if (VRPN_ISIT("vrpn_DevInput")) { - VRPN_CHECK(setup_DevInput); - } - else if (VRPN_ISIT("vrpn_Tng3")) { - VRPN_CHECK(setup_Tng3); - } - else if (VRPN_ISIT("vrpn_TimeCode_Generator")) { - VRPN_CHECK(setup_Timecode_Generator); - } - else if (VRPN_ISIT("vrpn_Tracker_InterSense")) { - VRPN_CHECK(setup_Tracker_InterSense); - } - else if (VRPN_ISIT("vrpn_DirectXFFJoystick")) { - VRPN_CHECK(setup_DirectXFFJoystick); - } - else if (VRPN_ISIT("vrpn_DirectXRumblePad")) { - VRPN_CHECK(setup_RumblePad); - } - else { - found_it_yet = false; - } - - if (!found_it_yet) { - if (VRPN_ISIT("vrpn_XInputGamepad")) { - VRPN_CHECK(setup_XInputPad); - } - else if (VRPN_ISIT("vrpn_GlobalHapticsOrb")) { - VRPN_CHECK(setup_GlobalHapticsOrb); - } - else if (VRPN_ISIT("vrpn_Phantom")) { - VRPN_CHECK(setup_Phantom); - } - else if (VRPN_ISIT("vrpn_ADBox")) { - VRPN_CHECK(setup_ADBox); - } - else if (VRPN_ISIT("vrpn_VPJoystick")) { - VRPN_CHECK(setup_VPJoystick); - } - else if (VRPN_ISIT("vrpn_Tracker_DTrack")) { - VRPN_CHECK(setup_DTrack); - } - else if (VRPN_ISIT("vrpn_NI_Analog_Output")) { - VRPN_CHECK(setup_NationalInstrumentsOutput); - } - else if (VRPN_ISIT("vrpn_National_Instruments")) { - VRPN_CHECK(setup_NationalInstruments); - } - else if (VRPN_ISIT("vrpn_nikon_controls")) { - VRPN_CHECK(setup_nikon_controls); - } - else if (VRPN_ISIT("vrpn_Tek4662")) { - VRPN_CHECK(setup_Poser_Tek4662); - } - else if (VRPN_ISIT("vrpn_Poser_Analog")) { - VRPN_CHECK(setup_Poser_Analog); - } - else if (VRPN_ISIT("vrpn_Tracker_Crossbow")) { - VRPN_CHECK(setup_Tracker_Crossbow); - } - else if (VRPN_ISIT("vrpn_3DMicroscribe")) { - VRPN_CHECK(setup_3DMicroscribe); - } - else if (VRPN_ISIT("vrpn_Keyboard")) { - VRPN_CHECK(templated_setup_device_name_only<vrpn_Keyboard>); - } - else if (VRPN_ISIT("vrpn_Button_USB")) { - VRPN_CHECK(setup_Button_USB); - } - else if (VRPN_ISIT("vrpn_Analog_USDigital_A2")) { - VRPN_CHECK(setup_Analog_USDigital_A2); - } - else if (VRPN_ISIT("vrpn_Button_NI_DIO24")) { - VRPN_CHECK(setup_Button_NI_DIO24); - } - else if (VRPN_ISIT("vrpn_Tracker_PhaseSpace")) { - VRPN_CHECK(setup_Tracker_PhaseSpace); - } - else if (VRPN_ISIT("vrpn_Auxiliary_Logger_Server_Generic")) { - VRPN_CHECK(setup_Logger); - } - else if (VRPN_ISIT("vrpn_Imager_Stream_Buffer")) { - VRPN_CHECK(setup_ImageStream); - } - else if (VRPN_ISIT("vrpn_Contour_ShuttleXpress")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Contour_ShuttleXpress>); - } - else if (VRPN_ISIT("vrpn_Retrolink_GameCube")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Retrolink_GameCube>); - } - else if (VRPN_ISIT("vrpn_Contour_ShuttleXpress")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Contour_ShuttleXpress>); - } - else if (VRPN_ISIT("vrpn_Futaba_InterLink_Elite")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Futaba_InterLink_Elite>); - } - else if (VRPN_ISIT("vrpn_Griffin_PowerMate")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Griffin_PowerMate>); - } - else if (VRPN_ISIT("vrpn_Xkeys_Desktop")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Xkeys_Desktop>); - } - else if (VRPN_ISIT("vrpn_Xkeys_Pro")) { - VRPN_CHECK( - templated_setup_HID_device_name_only<vrpn_Xkeys_Pro>); - } - else if (VRPN_ISIT("vrpn_Xkeys_Joystick")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Xkeys_Joystick>); - } - else if (VRPN_ISIT("vrpn_Xkeys_Jog_And_Shuttle")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Xkeys_Jog_And_Shuttle>); - } - else if (VRPN_ISIT("vrpn_Xkeys_XK3")) { - VRPN_CHECK( - templated_setup_HID_device_name_only<vrpn_Xkeys_XK3>); - } - else if (VRPN_ISIT("vrpn_Logitech_Extreme_3D_Pro")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Logitech_Extreme_3D_Pro>); - } - else if (VRPN_ISIT("vrpn_Saitek_ST290_Pro")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Saitek_ST290_Pro>); - } - else if (VRPN_ISIT("vrpn_CHProducts_Fighterstick_USB")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_CHProducts_Fighterstick_USB>); - } - else if (VRPN_ISIT("vrpn_3DConnexion_Navigator")) { - VRPN_CHECK(templated_setup_device_name_only< - vrpn_3DConnexion_Navigator>); - } - else if (VRPN_ISIT( - "vrpn_3DConnexion_Navigator_for_Notebooks")) { - VRPN_CHECK(templated_setup_device_name_only< - vrpn_3DConnexion_Navigator_for_Notebooks>); - } - else if (VRPN_ISIT("vrpn_3DConnexion_Traveler")) { - VRPN_CHECK(templated_setup_device_name_only< - vrpn_3DConnexion_Traveler>); - } - else if (VRPN_ISIT("vrpn_3DConnexion_SpaceExplorer")) { - VRPN_CHECK(templated_setup_device_name_only< - vrpn_3DConnexion_SpaceExplorer>); - } - else if (VRPN_ISIT("vrpn_3DConnexion_SpaceMouse")) { - VRPN_CHECK(templated_setup_device_name_only< - vrpn_3DConnexion_SpaceMouse>); - } - else if (VRPN_ISIT("vrpn_3DConnexion_SpaceMousePro")) { - VRPN_CHECK(templated_setup_device_name_only< - vrpn_3DConnexion_SpaceMousePro>); - } - else if (VRPN_ISIT("vrpn_3DConnexion_SpaceMouseWireless")) { - VRPN_CHECK(templated_setup_device_name_only< - vrpn_3DConnexion_SpaceMouseWireless>); - } - else if (VRPN_ISIT("vrpn_3DConnexion_SpaceBall5000")) { - VRPN_CHECK(templated_setup_device_name_only< - vrpn_3DConnexion_SpaceBall5000>); - } - else if (VRPN_ISIT("vrpn_3DConnexion_SpacePilot")) { - VRPN_CHECK(templated_setup_device_name_only< - vrpn_3DConnexion_SpacePilot>); - } - else if (VRPN_ISIT("vrpn_Microsoft_SideWinder_Precision_2")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Microsoft_SideWinder_Precision_2>); - } - else if (VRPN_ISIT("vrpn_Microsoft_SideWinder")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Microsoft_SideWinder>); - } - else if (VRPN_ISIT("vrpn_Microsoft_Controller_Raw_Xbox_S")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Microsoft_Controller_Raw_Xbox_S>); - } - else if (VRPN_ISIT("vrpn_Microsoft_Controller_Raw_Xbox_360")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Microsoft_Controller_Raw_Xbox_360>); - } - else if (VRPN_ISIT("vrpn_Afterglow_Ax1_For_Xbox_360")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_Afterglow_Ax1_For_Xbox_360>); - } - else if (VRPN_ISIT("vrpn_Tracker_MotionNode")) { - VRPN_CHECK(setup_Tracker_MotionNode); - } - else if (VRPN_ISIT("vrpn_Tracker_GPS")) { - VRPN_CHECK(setup_Tracker_GPS); - } - else if (VRPN_ISIT("vrpn_WiiMote")) { - VRPN_CHECK(setup_WiiMote); - } - else if (VRPN_ISIT("vrpn_Tracker_WiimoteHead")) { - VRPN_CHECK(setup_Tracker_WiimoteHead); - } - else if (VRPN_ISIT("vrpn_Freespace")) { - VRPN_CHECK(setup_Freespace); - } - else if (VRPN_ISIT("vrpn_Tracker_NovintFalcon")) { - VRPN_CHECK(setup_Tracker_NovintFalcon); - } - else if (VRPN_ISIT("vrpn_Tracker_TrivisioColibri")) { - VRPN_CHECK(setup_Tracker_TrivisioColibri); - } - else if (VRPN_ISIT("vrpn_Tracker_SpacePoint")) { - VRPN_CHECK(setup_SpacePoint); - } - else if (VRPN_ISIT("vrpn_Tracker_Wintracker")) { - VRPN_CHECK(setup_Wintracker); - } - else if (VRPN_ISIT("vrpn_Tracker_GameTrak")) { - VRPN_CHECK(setup_Tracker_GameTrak); - } - else if (VRPN_ISIT("vrpn_Atmel")) { - VRPN_CHECK(setup_Atmel); - } - else if (VRPN_ISIT("vrpn_inertiamouse")) { - VRPN_CHECK(setup_inertiamouse); - } - else if (VRPN_ISIT("vrpn_Event_Mouse")) { - VRPN_CHECK(setup_Event_Mouse); - } - else if (VRPN_ISIT("vrpn_Dream_Cheeky_USB_roll_up_drums")) { - VRPN_CHECK(templated_setup_HID_device_name_only< - vrpn_DreamCheeky_Drum_Kit>); - } - else if (VRPN_ISIT("vrpn_LUDL_USBMAC6000")) { - VRPN_CHECK(setup_LUDL_USBMAC6000); - } - else if (VRPN_ISIT("vrpn_Analog_5dtUSB_Glove5Left")) { - VRPN_CHECK(setup_Analog_5dtUSB_Glove5Left); - } - else if (VRPN_ISIT("vrpn_Analog_5dtUSB_Glove5Right")) { - VRPN_CHECK(setup_Analog_5dtUSB_Glove5Right); - } - else if (VRPN_ISIT("vrpn_Analog_5dtUSB_Glove14Left")) { - VRPN_CHECK(setup_Analog_5dtUSB_Glove14Left); - } - else if (VRPN_ISIT("vrpn_Analog_5dtUSB_Glove14Right")) { - VRPN_CHECK(setup_Analog_5dtUSB_Glove14Right); - } - else if (VRPN_ISIT("vrpn_Tracker_FilterOneEuro")) { - VRPN_CHECK(setup_Tracker_FilterOneEuro); - } - else if (VRPN_ISIT("vrpn_Tracker_OSVRHackerDevKit")) { - VRPN_CHECK(setup_Tracker_OSVRHackerDevKit); - } - else if (VRPN_ISIT("vrpn_Tracker_RazerHydra")) { - VRPN_CHECK(setup_Tracker_RazerHydra); - } - else if (VRPN_ISIT("vrpn_Tracker_zSight")) { - VRPN_CHECK(setup_Tracker_zSight); - } - else if (VRPN_ISIT("vrpn_Tracker_ViewPoint")) { - VRPN_CHECK(setup_Tracker_ViewPoint); - } - else if (VRPN_ISIT("vrpn_Tracker_G4")) { - VRPN_CHECK(setup_Tracker_G4); - } - else if (VRPN_ISIT("vrpn_Tracker_LibertyPDI")) { - VRPN_CHECK(setup_Tracker_LibertyPDI); - } - else if (VRPN_ISIT("vrpn_Tracker_FastrakPDI")) { - VRPN_CHECK(setup_Tracker_FastrakPDI); - } - else if (VRPN_ISIT("vrpn_Tracker_JsonNet")) { - VRPN_CHECK(setup_Tracker_JsonNet); - } - else if (VRPN_ISIT("vrpn_YEI_3Space_Sensor")) { - VRPN_CHECK(setup_YEI_3Space_Sensor); - } - else if (VRPN_ISIT("vrpn_YEI_3Space_Sensor_Wireless")) { - VRPN_CHECK(setup_YEI_3Space_Sensor_Wireless); - } - else { // Never heard of it - sscanf(line, "%511s", s1); // Find out the class name - fprintf(stderr, "vrpn_server: Unknown Device: %s\n", s1); - if (d_bail_on_open_error) { - d_doing_okay = false; - return; - } - else { - continue; // Skip this line - } - } - } - } - } - -#undef VRPN_ISIT -#undef VRPN_CHECK - - // Restore the original settings into the global locale by - // putting them into the global locale. - std::locale::global(orig_locale); - - // Close the configuration file - fclose(config_file); - -#ifdef SGI_BDBOX - fprintf(stderr, "sgibox: %p\n", vrpn_special_sgibox); -#endif -} - -vrpn_Generic_Server_Object::~vrpn_Generic_Server_Object() -{ - closeDevices(); - delete _devices; - _devices = NULL; -} - -void vrpn_Generic_Server_Object::mainloop(void) { _devices->mainloop(); } diff --git a/src/vrpn/server_src/vrpn_Generic_server_object.h b/src/vrpn/server_src/vrpn_Generic_server_object.h deleted file mode 100644 index 1f7592983c54d927f53d8eb4b75f7a1e305a022c..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn_Generic_server_object.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef VRPN_GENERIC_SERVER_OBJECT_H -#define VRPN_GENERIC_SERVER_OBJECT_H - -#include <stdio.h> // for FILE - -#include "vrpn_Configure.h" // for VRPN_USE_DEV_INPUT, etc -#include "vrpn_Types.h" // for vrpn_float64 - -class vrpn_MainloopContainer; - -const int VRPN_GSO_MAX_NDI_POLARIS_RIGIDBODIES = - 20; // FIXME find out from the NDI specs if there is a maximum; - -class VRPN_API vrpn_TAF_axis; -class VRPN_API vrpn_PA_axis; - -class vrpn_Generic_Server_Object { -public: - vrpn_Generic_Server_Object(vrpn_Connection *connection_to_use, - const char *config_file_name = "vrpn.cfg", - int port = vrpn_DEFAULT_LISTEN_PORT_NO, - bool be_verbose = false, - bool bail_on_open_error = false); - ~vrpn_Generic_Server_Object(); - - void mainloop(void); - inline bool doing_okay(void) const { return d_doing_okay; } - -protected: - vrpn_Connection *connection; //< Connection to communicate on - bool d_doing_okay; //< Is the object working okay? - bool verbose; //< Should we print lots of info? - bool d_bail_on_open_error; //< Should we bail if we have an error opening a - // device? - - // Lists of devices - vrpn_MainloopContainer *_devices; //< semi-pimpl idiom so we can use - //<vector> and not scare Sensable GHOST. - - void closeDevices(void); - - // Helper functions for the functions below - int get_AFline(char *line, vrpn_TAF_axis *axis); - int get_poser_axis_line(FILE *config_file, const char *axis_name, - vrpn_PA_axis *axis, vrpn_float64 *min, - vrpn_float64 *max); - - // Functions to parse each kind of device from the configuration file - // and create a device of that type linked to the appropriate lists. - int setup_raw_SGIBox(char *&pch, char *line, FILE * /*config_file*/); - int setup_SGIBox(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_AnalogFly(char *&pch, char *line, FILE *config_file); - int setup_Tracker_ButtonFly(char *&pch, char *line, FILE *config_file); - int setup_Joystick(char *&pch, char *line, FILE * /*config_file*/); - int setup_Example_Button(char *&pch, char *line, FILE * /*config_file*/); - int setup_Example_Dial(char *&pch, char *line, FILE * /*config_file*/); - int setup_CerealBox(char *&pch, char *line, FILE * /*config_file*/); - int setup_Magellan(char *&pch, char *line, FILE * /*config_file*/); - int setup_Spaceball(char *&pch, char *line, FILE * /*config_file*/); - int setup_Radamec_SPI(char *&pch, char *line, FILE * /*config_file*/); - int setup_Zaber(char *&pch, char *line, FILE * /*config_file*/); - int setup_BiosciencesTools(char *&pch, char *line, FILE * /*config_file*/); - int setup_OmegaTemperature(char *&pch, char *line, FILE * /*config_file*/); - int setup_IDEA(char *&pch, char *line, FILE * /*config_file*/); - int setup_NationalInstruments(char *&pch, char *line, - FILE * /*config_file*/); - int setup_NationalInstrumentsOutput(char *&pch, char *line, - FILE * /*config_file*/); - int setup_ImmersionBox(char *&pch, char *line, FILE * /*config_file*/); - int setup_5dt(char *&pch, char *line, FILE * /*config_file*/); - int setup_Wanda(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_Dyna(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_Fastrak(char *&pch, char *line, FILE *config_file); - int setup_Tracker_Isotrak(char *&pch, char *line, FILE *config_file); - int setup_Tracker_Liberty(char *&pch, char *line, FILE *config_file); - int setup_Tracker_LibertyHS(char *&pch, char *line, FILE *config_file); - int setup_Tracker_3Space(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_Flock(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_Flock_Parallel(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Tracker_NULL(char *&pch, char *line, FILE * /*config_file*/); - int setup_Button_Python(char *&pch, char *line, FILE * /*config_file*/); - int setup_Button_SerialMouse(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Button_PinchGlove(char *&pch, char *line, FILE *config_file); - int setup_Joylin(char *&pch, char *line, FILE * /*config_file*/); - int setup_Joywin32(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tng3(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_InterSense(char *&pch, char *line, FILE *config_file); - int setup_DirectXFFJoystick(char *&pch, char *line, FILE * /*config_file*/); - int setup_RumblePad(char *&pch, char *line, FILE * /*config_file*/); - int setup_XInputPad(char *&pch, char *line, FILE * /*config_file*/); - int setup_GlobalHapticsOrb(char *&pch, char *line, FILE * /*config_file*/); - int setup_ADBox(char *&pch, char *line, FILE *config_file); - int setup_VPJoystick(char *&pch, char *line, FILE *config_file); - int setup_DTrack(char *&pch, char *line, FILE *config_file); - int setup_Poser_Analog(char *&pch, char *line, FILE *config_file); - int setup_nikon_controls(char *&pch, char *line, FILE * /*config_file*/); - int setup_Poser_Tek4662(char *&pch, char *line, FILE * /*config_file*/); - int setup_Timecode_Generator(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Phantom(char *&pch, char *line, FILE * /*config_file*/); - int setup_JoyFly(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_3DMouse(char *&pch, char *line, FILE * /*config_file*/); - int setup_Mouse(char *&pch, char *line, FILE * /*config_file*/); - int setup_DevInput(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_Crossbow(char *&pch, char *line, FILE * /*config_file*/); - int setup_3DMicroscribe(char *&pch, char *line, FILE * /*config_file*/); - int setup_5dt16(char *&pch, char *line, FILE * /*config_file*/); - int setup_Button_5DT_Server(char *&pch, char *line, FILE * /*config_file*/); - int setup_Button_USB(char *&pch, char *line, FILE * /*config_file*/); - int setup_Analog_USDigital_A2(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Button_NI_DIO24(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_PhaseSpace(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Tracker_NDI_Polaris(char *&pch, char *line, FILE *config_file); - int setup_Logger(char *&pch, char *line, FILE * /*config_file*/); - int setup_ImageStream(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_MotionNode(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Tracker_GPS(char *&pch, char *line, FILE * /*config_file*/); - int setup_WiiMote(char *&pch, char *line, FILE * /*config_file*/); - int setup_SpacePoint(char *&pch, char *line, FILE * /*config_file*/); - int setup_Wintracker(char *&pch, char *line, FILE *config_file); - int setup_Tracker_WiimoteHead(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Freespace(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_NovintFalcon(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Tracker_TrivisioColibri(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Tracker_GameTrak(char *pch, char *line, FILE *config_file); - int setup_LUDL_USBMAC6000(char *&pch, char *line, FILE * /*config_file*/); - int setup_Analog_5dtUSB_Glove5Left(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Analog_5dtUSB_Glove5Right(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Analog_5dtUSB_Glove14Left(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Analog_5dtUSB_Glove14Right(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Tracker_FilterOneEuro(char *&pch, char *line, - FILE * /*config_file*/); - int setup_Tracker_zSight(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_ViewPoint(char *&pch, char *line, FILE * /*config_file*/); - int setup_Atmel(char *&pch, char *line, FILE * /*config_file*/); - int setup_Event_Mouse(char *&pch, char *line, FILE * /*config_file*/); - int setup_inertiamouse(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_G4(char *&pch, char *line, FILE *config_file); - int setup_Tracker_LibertyPDI(char *&pch, char *line, FILE *config_file); - int setup_Tracker_FastrakPDI(char *&pch, char *line, FILE *config_file); - int setup_Tracker_JsonNet(char *&pch, char *line, FILE * /*config_file*/); - int setup_Tracker_OSVRHackerDevKit(char *&pch, char *line, FILE *config_file); - int setup_Tracker_RazerHydra(char *&pch, char *line, FILE *config_file); - int setup_YEI_3Space_Sensor(char *&pch, char *line, FILE *config_file); - int setup_YEI_3Space_Sensor_Wireless(char *&pch, char *line, FILE *config_file); - - template <typename T> - int templated_setup_device_name_only(char *&pch, char *line, FILE *); - - template <typename T> - int templated_setup_HID_device_name_only(char *&pch, char *line, FILE *); -}; - -#endif diff --git a/src/vrpn/server_src/vrpn_HID_device_watcher.cpp b/src/vrpn/server_src/vrpn_HID_device_watcher.cpp deleted file mode 100644 index 6a0197404ad7173d01a9ae794a50e67676541a2d..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn_HID_device_watcher.cpp +++ /dev/null @@ -1,146 +0,0 @@ -#include <stddef.h> // for size_t -#include <stdio.h> // for printf, fprintf, puts, NULL, etc - -#include "vrpn_Configure.h" // for VRPN_USE_HID -#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc -#include "vrpn_Types.h" // for vrpn_uint8, vrpn_uint16 -#ifdef _WIN32 -#include <conio.h> -#endif -#include <sstream> // for istringstream, basic_ios, etc -#include <string> // for operator==, string, etc - -#if defined(VRPN_USE_HID) -class HidDebug: public vrpn_HidInterface { - public: - HidDebug(vrpn_HidAcceptor *a); - ~HidDebug() { } - - protected: - void on_data_received(size_t bytes, vrpn_uint8 *buffer); -}; - -HidDebug::HidDebug(vrpn_HidAcceptor *a): vrpn_HidInterface(a) { } - -void HidDebug::on_data_received(size_t bytes, vrpn_uint8 *buffer) { -#ifdef TEST - for (size_t i = 0; i < (bytes / 2); i++) { - if ((i != 0) && ((i % 20) == 0)) - { - printf("\n"); - } - printf("%02X ", buffer[i]); - } -#else - printf("%d bytes: ", static_cast<int>(bytes)); - for (size_t i = 0; i < bytes; i++) { - printf("%02X ", buffer[i]); - } -#endif // TEST - puts(""); -} -#endif - -int usage(char * argv0) { - printf("Usage:\n\n" - "%s -h|--help\n" - " Display this help text.\n\n" - - "%s [N]\n" - " Open HID device number N (default to 0)\n\n" - - "%s VEND PROD [N]\n" - " Open HID device number N (default to 0) that matches\n" - " vendor VEND and product PROD, in _decimal_\n\n" - - -#ifdef _WIN32 - "During runtime:\n" - " Press ESC to exit\n" - " Press r to reconnect\n\n" -#endif - , - argv0, argv0, argv0); - return 1; -} - -int failedOnArgument(int argNum, const char * expected, char * argv[]) { - fprintf(stderr, "Failed to interpret argument %d: expected %s, got '%s' - usage help follows.\n\n", argNum, expected, argv[argNum]); - return usage(argv[0]); -} - -int main(int argc, char * argv[]) { - -#if defined(VRPN_USE_HID) - if (argc > 1 && (std::string("-h") == argv[1] || std::string("--help") == argv[1])) { - return usage(argv[0]); - } - vrpn_HidAcceptor * acceptor = NULL; - unsigned N = 0; // Which device to open? - if (argc >= 3) { - vrpn_uint16 vend; - std::istringstream vendS(argv[1]); - if (!(vendS >> vend)) { - return failedOnArgument(1, "a decimal vendor ID", argv); - } - - vrpn_uint16 prod; - std::istringstream prodS(argv[2]); - if (!(prodS >> prod)) { - return failedOnArgument(2, "a decimal product ID", argv); - } - - if (argc >= 4) { - std::istringstream nS(argv[3]); - if (!(nS >> N)) { - return failedOnArgument(3, "a number indicating which matching device to pick, or nothing for the default '0'", argv); - } - } - printf("Will accept HID device number %u that has vendor:product %04x:%04x\n", N, vend, prod); - acceptor = new vrpn_HidProductAcceptor(vend, prod); - } else { - if (argc == 2) { - std::istringstream nS(argv[1]); - if (!(nS >> N)) { - return failedOnArgument(1, "a number indicating which device to pick, or nothing for the default '0'", argv); - } - } - printf("Will accept HID device number %u\n", N); - acceptor = new vrpn_HidAlwaysAcceptor; - } - - HidDebug hid(new vrpn_HidNthMatchAcceptor(N, acceptor)); - printf("HID initialized.\n"); - if (hid.connected()) { - printf("Connected: HID device vendor ID %u, product ID %u, aka %04x:%04x\n", - static_cast<unsigned>(hid.vendor()), static_cast<unsigned>(hid.product()), - static_cast<unsigned>(hid.vendor()), static_cast<unsigned>(hid.product())); - } else { - printf("Could not connect.\n"); - return 1; - } - - bool go = true; - printf("Entering update loop.\n"); - while (go) { - hid.update(); -#ifdef _WIN32 - if (_kbhit()) - switch (_getch()) { - case 27: - go = false; - break; - case 'r': - case 'R': - hid.reconnect(); - break; - } -#endif // _WIN32 - } - - return 0; -#else - printf("HID support not included.\n"); - return 0; -#endif // defined(VRPN_USE_HID) -} diff --git a/src/vrpn/server_src/vrpn_Phantom.C b/src/vrpn/server_src/vrpn_Phantom.C deleted file mode 100644 index 498c34ac4f0aba3e93a8c357dc8b8018fd4a586b..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn_Phantom.C +++ /dev/null @@ -1,1775 +0,0 @@ -//XXX Problem: Recovery time seems to have gotten itself unimplemented over time. - -//XXX Buzzing and texture are not currently supported on HDAPI planes because -// only the basic Plane has been implemented within HDAPI, rather than the -// texturePlane. This should be changeable in the future. - -#include "vrpn_Configure.h" -#ifdef VRPN_USE_PHANTOM_SERVER -#include "vrpn_Shared.h" -#include <math.h> -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <fcntl.h> -#include "vrpn_Connection.h" -#include "vrpn_Button.h" -#include "vrpn_Tracker.h" -#include "vrpn_ForceDeviceServer.h" -#include "vrpn_Phantom.h" - -#include "ghost.h" -#ifdef VRPN_USE_HDAPI - #include <HD/hd.h> - #include <HDU/hduError.h> - #include <HL/hl.h> - #include <GL/gl.h> // Needed to deal with the fact that HL ties in to the OpenGL state. - #pragma comment (lib, "opengl32.lib") // Needed for the OpenGL calls we use. -#endif - -#include "plane.h" -#include "texture_plane.h" -#include "trimesh.h" -#include "constraint.h" -#include "forcefield.h" -#include "quat.h" - -// XXX Make sure to guard the setting of parameters to various effects when -// using HDAPI so that we don't get a partial update for them and then have -// the real-time loop run in the middle. - -// This pragma tells the compiler not to tell us about truncated debugging info -// due to name expansion within the string, list, and vector classes. -#pragma warning( disable : 4786 ) -#include <vector> -using namespace std; - -// ajout ONDIM -/* -# instantBuzzEffect : instantaneous buzz "custom" effect for Phantom server -# written by Sebastien MARAUX, ONDIM SA (France) -# maraux@ondim.fr -*/ -// add each ghost effect header -#include "ghostEffects/InstantBuzzEffect.h" -// fin ajout ONDIM - -#ifndef _WIN32 -#include <netinet/in.h> -#include <sys/ioctl.h> -#endif - -#define CHECK(a) if (a == -1) return -1 - -#ifdef VRPN_USE_HDAPI -//-------------------------------------------------------------------------------- -// BEGIN HDAPI large chunk - -// Originally, all of the OpenHaptics code was implemented using HDAPI. However, -// when the proxy-geometry code was needed that does friction for the planes, it -// was switched over to HL. All of the low-level HDAPI force effects were turned -// into an HL custom force effect to avoid fighting between the HL and HDAPI -// servo callbacks. The HDAPI servo callback was basically turned into an HL -// custom force callback. This custom force callback handles everything but the -// planes. The planes are handled within the Plane class, which knows how to -// render itself in HL. - -// Structure to hold pointers to active force-generating objects, -// and the current force and surface contact point. - -static void HLCALLBACK computeForceCB(HDdouble force[3], HLcache *cache, void *userdata); - -class ACTIVE_FORCE_OBJECT_LIST { -public: -#ifdef DYNAMIC_PLANES - vector<DynamicPlane*> Planes; -#else - vector<Plane*> Planes; -#endif - vector<ForceFieldEffect*> ForceFieldEffects; - vector<ConstraintEffect*> ConstraintEffects; - vector<InstantBuzzEffect*> InstantBuzzEffects; - - vrpn_HapticVector CurrentForce; - vrpn_HapticPosition SCP; //< Surface Contact Point - - ACTIVE_FORCE_OBJECT_LIST() { CurrentForce.set(0,0,0); SCP.set(0,0,0); }; -}; - -static ACTIVE_FORCE_OBJECT_LIST g_active_force_object_list; - -// Initialize the HL library, so that we can do custom shapes (the -// plane is implemented this way) and later maybe add in the -// polygonal-object implementation. -void vrpn_Phantom::initHL(HHD phantom) -{ - // Create a haptic context for the device. The haptic context maintains - // the state that persists between frame intervals and is used for - // haptic rendering. - hHLRC = hlCreateContext(phantom); - hlMakeCurrent(hHLRC); - - hlTouchableFace(HL_FRONT); - hlTouchModel(HL_CONTACT); - - // Get IDs for all of the planes and other objects - int i; - for(i=0; i<MAXPLANE; i++ ) { - planes[i]->getHLId(); - } - - effectId = hlGenEffects(1); -} - -void vrpn_Phantom::tearDownHL(void) -{ - // Release the IDs for the planes and other objects - // Get IDs for all of the planes and other objects - int i; - for(i=0; i<MAXPLANE; i++ ) { - planes[i]->releaseHLId(); - } - - hlDeleteEffects(effectId, 1); - - // No longer using the context. - hlMakeCurrent(NULL); - hlDeleteContext(hHLRC); -} - -// The work of reading the entire device state is done in a callback -// handler that is scheduled synchronously between the force-calculation -// thread and the main (communication) thread. This makes sure we don't -// have a collision between the two. - -static HDCallbackCode HDCALLBACK readDeviceState(void *pUserData) -{ - HDAPI_state *state = (HDAPI_state *)pUserData; - - hdGetIntegerv(HD_CURRENT_BUTTONS, &state->buttons); - hdGetDoublev(HD_CURRENT_TRANSFORM, &state->pose[0][0]); - hdGetDoublev(HD_LAST_TRANSFORM, &state->last_pose[0][0]); - hdGetIntegerv(HD_INSTANTANEOUS_UPDATE_RATE, &state->instant_rate); - hdGetDoublev(HD_NOMINAL_MAX_STIFFNESS, &state->max_stiffness); - hdGetDoublev(HD_CURRENT_FORCE, &state->current_force[0]); - - return HD_CALLBACK_DONE; -} - -// This callback handler is called once during each haptic schedule frame. -// It handles calculation of the force based on the currently-active -// forcefields, constraints, effects, and other force-generating objects. -// It relies on the above static global data structure to keep track of -// which objects are active. -// The planes are handled as objects with custom intersection routines -// so they can make use of the HL-supplied friction and so forth. They -// are not handled in this function. - -static void HLCALLBACK computeForceCB(HDdouble force[3], HLcache *cache, void *userdata) -{ - //--------------------------------------------------------------- - // Handle the custom force calculation. - - // Is there a better, HL way to read this state? There is a cache version, - // but then we end up with two different ways to read the state: one from the - // main routine to get data to send back to the client and another to read it - // for our use here. Unless this is a problem, lets stick with the HDAPI method - // in both places to avoid code drift. Actually, we can't get the last state - // using HL, so we can't compute things like velocity, so we're better off - // sticking with HDAPI if we can. - HDAPI_state state; - hdScheduleSynchronous(readDeviceState, &state, HD_MAX_SCHEDULER_PRIORITY); - - // Remember: g_active_force_object_list holds both the lists - // of objects that generate forces and the current status of - // both the force and the surface contact point, if any. - // To start with, we have no force. - g_active_force_object_list.CurrentForce.set(0,0,0); - - // The plane forces are computed separately: they are included in the HL - // display as their own objects and they will add in their contributions - // through that mechanism. - - // Need to add in any constraint forces - unsigned i; - for (i = 0; i < g_active_force_object_list.ConstraintEffects.size(); i++) { - g_active_force_object_list.CurrentForce += g_active_force_object_list.ConstraintEffects[i]->calcEffectForce(&state); - } - - // Need to add in any effect forces - for (i = 0; i < g_active_force_object_list.ForceFieldEffects.size(); i++) { - g_active_force_object_list.CurrentForce += g_active_force_object_list.ForceFieldEffects[i]->calcEffectForce(&state); - } - - // Need to add in any instant buzzing effect - for (i = 0; i < g_active_force_object_list.InstantBuzzEffects.size(); i++) { - g_active_force_object_list.CurrentForce += g_active_force_object_list.InstantBuzzEffects[i]->calcEffectForce(); - } - - // Add the results of the above force calculations to the currently-displayed on - // within the standard HL rendering. - force[0] += g_active_force_object_list.CurrentForce[0]; - force[1] += g_active_force_object_list.CurrentForce[1]; - force[2] += g_active_force_object_list.CurrentForce[2]; -} - -// END HDAPI large chunk -//-------------------------------------------------------------------------------- -#endif - -void vrpn_Phantom::handle_plane(void *userdata,const vrpn_Plane_PHANTOMCB &p) -{ -/* printf("MY Plane is %lfX + %lfY + %lfZ + %lf = 0 \n",p.plane[0], - p.plane[1],p.plane[2],p.plane[3]); - printf("surface is %lf,%lf,%lf,%lf\n",p.SurfaceKspring,p.SurfaceKdamping, - p.SurfaceFdynamic, p.SurfaceFstatic); - printf("which plane = %d\n", p.which_plane); -*/ - vrpn_Phantom *me = (vrpn_Phantom *) userdata; - -#ifndef VRPN_USE_HDAPI - gstPHANToM *phan = me->phantom; -#endif - int which_plane = p.which_plane; -#ifdef DYNAMIC_PLANES - DynamicPlane *plane = (me->planes)[which_plane]; -#else - Plane *plane = (me->planes)[which_plane]; -#endif - - // If the plane's normal is (0,0,0), it is a stop surface command - // turn off the surface. - if( (p.plane[0] == 0) && (p.plane[1] == 0) && (p.plane[2] == 0) ) { - plane->setActive(FALSE); - } else { - vrpn_Plane_PHANTOMCB p2 = p; - check_parameters(&p2); - plane->update(p2.plane[0],p2.plane[1], - p2.plane[2],p2.plane[3]*1000.0);//convert m to mm - plane->setSurfaceKspring(p2.SurfaceKspring); - plane->setSurfaceFstatic(p2.SurfaceFstatic); - plane->setSurfaceFdynamic(p2.SurfaceFdynamic); - plane->setSurfaceKdamping(p2.SurfaceKdamping); - //plane->setNumRecCycles((int)p2.numRecCycles); - plane->setActive(TRUE); - } -} - -// This function reports errors if surface friction, compliance parameters -// are not in valid ranges for the GHOST library and sets them as -// close as it can to the requested values. - -void vrpn_Phantom::check_parameters(vrpn_Plane_PHANTOMCB *p) -{ - // only prints out errors every 5 seconds so that - // we don't take too much time from servo loop - static bool recentError = false; - static timeval timeOfLastReport; - timeval currTime; - - vrpn_gettimeofday(&currTime, NULL); - - // if this is the first time check_parameters has been called then initialize - // timeOfLastReport, otherwise this has no effect on behavior - if (!recentError) { - timeOfLastReport.tv_sec = currTime.tv_sec; - - // if recentError is true then change it to false if enough time has elapsed - } else if (currTime.tv_sec - timeOfLastReport.tv_sec > 5) { - recentError = false; - timeOfLastReport.tv_sec = currTime.tv_sec; - } - - if (p->SurfaceKspring <= 0){ - if (!recentError) - fprintf(stderr,"Error: Kspring = %f <= 0\n", p->SurfaceKspring); - p->SurfaceKspring = 0.001f; - recentError = true; - } else if (p->SurfaceKspring > 1.0){ - if (!recentError) - printf("Error: Kspring = %f > 1.0\n", p->SurfaceKspring); - p->SurfaceKspring = 1.0; - recentError = true; - } - if (p->SurfaceFstatic < 0){ - if (!recentError) - printf("Error: Fstatic = %f < 0\n", p->SurfaceFstatic); - p->SurfaceFstatic = 0.0; - recentError = true; - } else if (p->SurfaceFstatic > 1.0){ - if (!recentError) - printf("Error: Fstatic = %f > 1.0\n", p->SurfaceFstatic); - p->SurfaceFstatic = 1.0; - recentError = true; - } - if (p->SurfaceFdynamic > p->SurfaceFstatic){ - if (!recentError) - printf("Error: Fdynamic > Fstatic\n"); - p->SurfaceFdynamic = 0.0; - recentError = true; - } - if (p->SurfaceKdamping < 0){ - if (!recentError) - printf("Error: Kdamping = %f < 0\n", p->SurfaceKdamping); - p->SurfaceKdamping = 0; - recentError = true; - } else if (p->SurfaceKdamping > 0.005){ - if (!recentError) - printf("Error: Kdamping = %f > 0.005\n", p->SurfaceKdamping); - p->SurfaceKdamping = 0.005f; - recentError = true; - } - if (p->numRecCycles < 1) { - if (!recentError) - printf("Error: numRecCycles < 1\n"); - p->numRecCycles = 1; - recentError = true; - } -} - -// This function reinitializes the PHANToM (resets the origin) -void vrpn_Phantom::resetPHANToM(void) -{ -#ifdef VRPN_USE_HDAPI - - // Turn off everything in HL. - tearDownHL(); - - hdDisableDevice(phantom); - - HDErrorInfo error; - phantom = hdInitDevice(HD_DEFAULT_DEVICE); - if (HD_DEVICE_ERROR(error = hdGetError())) { - hduPrintError(stderr, &error, "Failed to initialize haptic device"); - phantom = -1; - } else { - initHL(phantom); - } - -#else - // Ghost 3.0 manual says you don't have to do this - // with the Desktop Phantom... - scene->stopServoLoop(); - rootH->removeChild(phantom); - delete(phantom); - phantom = new gstPHANToM("Default PHANToM", TRUE); - rootH->addChild(phantom); - Sleep(500); - scene->startServoLoop(); -#endif -} - -int vrpn_Phantom::handle_dropConnection(void * userdata, vrpn_HANDLERPARAM) -{ - printf("vrpn_Phantom: Dropped last connection, resetting force effects\n"); - ((vrpn_Phantom *)(userdata))->reset(); - - // Always return 0 here, because nonzero return means that the input data - // was garbage, not that there was an error. If we return nonzero from a - // vrpn_Connection handler, it shuts down the connection. - return 0; -} - -// return the position of the phantom stylus relative to base -// coordinate system -void vrpn_Phantom::getPosition(double *vec, double *orient) -{ - for (int i = 0; i < 3; i++){ - vec[i] = pos[i]; - orient[i] = d_quat[i]; - } - orient[3] = d_quat[3]; -} - -vrpn_Phantom::vrpn_Phantom(char *name, vrpn_Connection *c, float hz, const char * newsconf) - :vrpn_Tracker(name, c),vrpn_Button_Filter(name,c), - vrpn_ForceDeviceServer(name,c), update_rate(hz), -#ifndef VRPN_USE_HDAPI - scene(NULL), - rootH(NULL), - hapticScene(NULL), - phantom(NULL), - //HHLRC(NULL), - //trimesh(NULL), -#endif - pointConstraint(NULL), - forceField(NULL), - plane_change_list(NULL), - // ajout ONDIM - // add each effect - instantBuzzEffect(NULL) - // fin ajout ONDIM -{ -#ifdef VRPN_USE_HDAPI - // Jean SIMARD <jean.simard@limsi.fr> - // Initialize the 'sconf' field - strcpy( sconf, newsconf ); - vrpn_Button_Filter::num_buttons = 2; // Omni has 2 buttons, others have 1. XXX This overestimates it - button_0_bounce_count = 0; - button_1_bounce_count = 0; -#else - vrpn_Button_Filter::num_buttons = 1; -#endif - - timestamp.tv_sec = 0; - timestamp.tv_usec = 0; - // Initialization to NULL necessary if construction of Phantom fails below. - // Error handler gets called, and it references planes[] array. - int i; - for (i = 0; i < MAXPLANE; i++){ - planes[i]= NULL; - } - -#ifndef VRPN_USE_HDAPI - scene = new gstScene; - - /* make it so simulation loop doesn't exit if remote switch is released */ -#ifdef VRPN_USE_GHOST_31 - scene->setQuitOnDevFault((vrpn_HapticBoolean)FALSE); -#endif - /* this function is removed in Ghost 4.0. From Ryan Toohil, SensAble support: - "SetQuitOnDevFault() was removed and replaced by a far better method of - managing device faults. In GHOST v4, device faults are handled - automatically, with the servo loop restarting itself. It's a far less - invasive method of handling errors, but you can override that behavior if - desired (by creating your own error handler)." - */ - - /* disable popup error dialogs */ - printErrorMessages(FALSE); - setErrorCallback(phantomErrorHandler, (void *)this); - - /* Create the root separator. */ - rootH = new gstSeparator; - scene->setRoot(rootH); - - /* Create the phantom object. When this line is processed, - the phantom position is zeroed. */ - // Jean SIMARD <jean.simard@limsi.fr> - // I don't made some modifications here because I never used Ghost but I - // suppose that 'sconf' should be use instead of "Default PHANToM". - phantom = new gstPHANToM("Default PHANToM"); - phantomAxis = new gstSeparator; - phantomAxis->addChild(phantom); - // Ghost 3.0 spec says we should make sure construction succeeded. - if(!phantom->getValidConstruction()) { - fprintf(stderr, "ERROR: Invalid Phantom object created\n"); - } - /* We add the phantom to the root instead of the hapticScene (which - is the child of the root) because when we turn haptics off - via the 'H' key, we do not want to remove the phantom from the - scene. Pressing the 'H' key removes hapticScene and - its children from the scene graph. */ - rootH->addChild(phantomAxis); - hapticScene = new gstSeparator; - rootH->addChild(hapticScene); -#endif - - pointConstraint = new ConstraintEffect(); -#ifdef VRPN_USE_HDAPI - g_active_force_object_list.ConstraintEffects.push_back(pointConstraint); - pointConstraint->stop(); -#else - phantom->setEffect(pointConstraint); -#endif - forceField = new ForceFieldEffect(); -#ifdef VRPN_USE_HDAPI - g_active_force_object_list.ForceFieldEffects.push_back(forceField); - forceField->stop(); -#endif - // ajout ONDIM - // add each custom effect instance here - instantBuzzEffect = new InstantBuzzEffect(); -#ifdef VRPN_USE_HDAPI - g_active_force_object_list.InstantBuzzEffects.push_back(instantBuzzEffect); - instantBuzzEffect->stop(); -#endif - // fin ajout ONDIM - - SurfaceKspring= 0.8f; - SurfaceFdynamic = 0.3f; - SurfaceFstatic = 0.7f; - SurfaceKdamping = 0.001f; - - SurfaceKadhesionNormal = 0.0f; - SurfaceKadhesionLateral = 0.0f; - SurfaceBuzzFreq = 60.0f; - SurfaceBuzzAmp = 0.0f; - SurfaceTextureWavelength = 0.01f; - SurfaceTextureAmplitude = 0.0f; - - for(i=0; i<MAXPLANE; i++ ) { -#ifdef DYNAMIC_PLANES - planes[i] = new DynamicPlane(); - planes[i]->setBuzzAmplitude(1000.0*SurfaceBuzzAmp); - planes[i]->setBuzzFrequency(SurfaceBuzzFreq); - planes[i]->setTextureAmplitude(1000.0*SurfaceTextureAmplitude); - planes[i]->setTextureWavelength(1000.0*SurfaceTextureWavelength); -#else - planes[i] = new Plane(0,1,0,0); -#endif - planes[i]->setActive(FALSE); - planes[i]->setSurfaceKspring(SurfaceKspring); - planes[i]->setSurfaceFdynamic(SurfaceFdynamic); - planes[i]->setSurfaceFstatic(SurfaceFstatic); - planes[i]->setSurfaceKdamping(SurfaceKdamping); -#ifdef VRPN_USE_HDAPI - g_active_force_object_list.Planes.push_back(planes[i]); -#else - hapticScene->addChild(planes[i]); -#endif - } - - which_plane = 0; - -#ifndef VRPN_USE_HDAPI - addObject(0,-1); - //trimesh = new Trimesh(); - //trimesh->addToScene(hapticScene); -#endif - - // status= TRACKER_RESETTING; - vrpn_gettimeofday(&(vrpn_ForceDevice::timestamp),NULL); - - if (register_autodeleted_handler(plane_message_id, - handle_plane_change_message, this, vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr,"vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(plane_effects_message_id, - handle_effects_change_message, this, vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr,"vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - - if (register_autodeleted_handler(forcefield_message_id, - handle_forcefield_change_message, this, vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr,"vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(reset_origin_m_id, - handle_resetOrigin_change_message, this, vrpn_Tracker::d_sender_id)) { - fprintf(stderr,"vrpn_Phantom:can't register handler\n"); - vrpn_Tracker::d_connection = NULL; - } - if (register_autodeleted_handler(custom_effect_message_id, - handle_custom_effect_change_message, this, vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr,"vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - - this->register_plane_change_handler(this, handle_plane); - - if (vrpn_Tracker::register_server_handlers()) - fprintf(stderr, "vrpn_Phantom: couldn't register xform request handlers\n"); - - if (register_autodeleted_handler - (update_rate_id, handle_update_rate_request, this, - vrpn_Tracker::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom: " - "Can't register update-rate handler\n"); - vrpn_Tracker::d_connection = NULL; - } - - //-------------------------------------------------------------------- - // Whenever we drop the last connection to this server, we also - // want to reset all of the planes and other active effects so that - // forces are zeroed. - register_autodeleted_handler(d_connection->register_message_type - (vrpn_dropped_last_connection), - handle_dropConnection, this); - - // Open the Phantom and get all of the contexts we need. - // This is also done in resetPHANToM. -#ifdef VRPN_USE_HDAPI - HDErrorInfo error; - // Jean SIMARD <jean.simard@limsi.fr> - // Modify the configuration name called by 'hdInitDevice' - phantom = hdInitDevice(sconf); - if (HD_DEVICE_ERROR(error = hdGetError())) { - hduPrintError(stderr, &error, "Failed to initialize haptic device"); - phantom = -1; - } else { - - // XXX When this is removed, we lose the fighting - initHL(phantom); - } -#else - scene->startServoLoop(); -#endif -} - -vrpn_Phantom::~vrpn_Phantom() -{ -#ifdef VRPN_USE_HDAPI - if (phantom != -1) { - tearDownHL(); - hdDisableDevice(phantom); - } -#endif -} - -void vrpn_Phantom::print_report(void) -{ - printf("----------------------------------------------------\n"); - vrpn_ForceDevice::print_report(); - - // printf("Timestamp:%ld:%ld\n",timestamp.tv_sec, timestamp.tv_usec); - printf("Pos :%lf, %lf, %lf\n", pos[0],pos[1],pos[2]); - printf("Quat :%lf, %lf, %lf, %lf\n", d_quat[0],d_quat[1],d_quat[2],d_quat[3]); - //printf("Force :%lf, %lf, %lf\n", d_force[0],d_force[1], d_force[2]); -} - -// mainloop: -// get button status from GHOST -// send button message (done in vrpn_Button_Filter::report_changes) -// NOT vrpn_Button::report_changes. -// get position from GHOST (done in vrpn_Phantom::get_report()) -// get force from GHOST (done in vrpn_Phantom::get_report()) -// send position message -// send force message - -void vrpn_Phantom::mainloop(void) { - struct timeval current_time; - char msgbuf[1000]; - char *buf; - vrpn_int32 len; - - // Allow the base server class to do its thing - server_mainloop(); - -#ifdef VRPN_USE_HDAPI - // Okay, this is REALLY HORRIBLE. It turns out that HL ties itself - // intimately into OpenGL. It gets its original workspace to haptic - // mapping by looking at the OpenGL Modelview matrix when the haptic - // frame is begun. To avoid having the graphics code interfere with - // the haptic code in an application that runs this server within - // the same process, we set the ModelView matrix to the identity here - // (after storing it). We then restore it after the haptic rendering - // loop. We also store the current matrix mode so that we can restore - // it afterwards. We want to leave the OpenGL state exactly like it - // was before we did the haptic rendering. - glPushAttrib(GL_TRANSFORM_BIT); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); - - //--------------------------------------------------------------- - // Handle the HL portion of the force calculation. This currently - // includes only the planes. This rendering does not work if we - // put it inside the HD force callback routine, so we do it here - // in the mainloop() function. In fact, we should only have to - // re-render when something changes, but it doesn't seem to hurt - // to re-render all the time. - - hlBeginFrame(); - - // Render each of the active force objects. - unsigned i; - for (i = 0; i < g_active_force_object_list.Planes.size(); i++) { - g_active_force_object_list.Planes[i]->renderHL(); - } - - // Render the effect forces - hlCallback(HL_EFFECT_COMPUTE_FORCE, (HLcallbackProc) computeForceCB, NULL); - hlStartEffect(HL_EFFECT_CALLBACK, effectId); - - hlEndFrame(); - - // Put the OpenGL state back where it was. - glPopMatrix(); - glPopAttrib(); -#endif - - //set if it is time to generate a new report - vrpn_gettimeofday(¤t_time, NULL); - if(vrpn_TimevalDuration(current_time,timestamp) >= 1000000.0/update_rate) { - - //update the time - timestamp = current_time; - - //------------------------------------------------------------------------ - // Read the device state and convert all values into the appropriate - // units for VRPN and store them into local state. -#ifdef VRPN_USE_HDAPI - HDAPI_state state; - // if phantom is null, next call crashes. - if (phantom == -1) return; - hdScheduleSynchronous(readDeviceState, &state, HD_MIN_SCHEDULER_PRIORITY); - - // Convert buttons to VRPN. Debounce them, making sure they have - // stabilized at their current value for at least 5 cycles before - // switching (this was needed for a particular Phantom Omni whose - // button glitched a lot). This is done by setting bounce count to - // zero whenever the button matches what is stored and incrementing - // it whenever it is different until 5 is reached. - int button_0_state = ((state.buttons & HD_DEVICE_BUTTON_1) == 0) ? 0 : 1; - int button_1_state = ((state.buttons & HD_DEVICE_BUTTON_2) == 0) ? 0 : 1; - - if (button_0_state == buttons[0]) { - button_0_bounce_count = 0; - } else if (++button_0_bounce_count >= 5) { - buttons[0] = button_0_state; - button_0_bounce_count = 0; - } - if (button_1_state == buttons[1]) { - button_1_bounce_count = 0; - } else if (++button_1_bounce_count >= 5) { - buttons[1] = button_1_state; - button_1_bounce_count = 0; - } - - // Convert position and orientation to VRPN (meters and quaternion) - q_type rot; - pos[0] = state.pose[3][0] / 1000.0; // mm to meters - pos[1] = state.pose[3][1] / 1000.0; // mm to meters - pos[2] = state.pose[3][2] / 1000.0; // mm to meters - q_from_row_matrix(rot, state.pose); - q_copy(d_quat, rot); - - // Convert velocity to VRPN - double deltaT = 1.0 / state.instant_rate; - vel[0] = (pos[0] - state.last_pose[3][0] / 1000.0) / deltaT; - vel[1] = (pos[1] - state.last_pose[3][1] / 1000.0) / deltaT; - vel[2] = (pos[2] - state.last_pose[3][2] / 1000.0) / deltaT; - - // Convert orientation rate to VRPN. - // First, find the change in rotation from last to now, - // then scale this by the time (scaling is done in an axis/angle - // representation; we convert to and from this to get the quaternion - // corresponding that the resulting rotation). - q_type last_rot; - q_from_row_matrix(last_rot, state.last_pose); - q_type delta_rot; - q_invert(last_rot, last_rot); - q_mult(delta_rot, rot, last_rot); // Find the change in orientation - double x,y,z, angle; //< The axis-angle representation - q_to_axis_angle(&x, &y, &z, &angle, delta_rot); - angle /= deltaT; //< Divide by change in time to get change per unit time - q_from_axis_angle(delta_rot, x,y,z, angle); //< Convert back to Quaternion. - - // Store the surface contact point - scp_pos[0] = g_active_force_object_list.SCP[0]; - scp_pos[1] = g_active_force_object_list.SCP[1]; - scp_pos[2] = g_active_force_object_list.SCP[2]; - scp_quat[0] = scp_quat[1] = scp_quat[2] = 0; scp_quat[3] = 1; - - // Store the current force being generated. - // XXX This does not include forces being generated by the - // plane objects within HL. - d_force[0] = state.current_force[0]; - d_force[1] = state.current_force[1]; - d_force[2] = state.current_force[2]; - -#else - //check button status - if(phantom->getStylusSwitch() ) { - buttons[0] = 1; //button is pressed - // printf("button is pressed.\n"); - } else { - buttons[0]= 0; - // printf("button is released. \n"); - } - - // Read the current PHANToM position, velocity, and force - // Put the information into pos/quat - double x,y,z; - double dt_vel = .10, dt_acc = .10; - q_matrix_type rot_matrix; - q_type p_quat, v_quat; - //q_type a_quat; // angular information (pos, vel, acc) - double angVelNorm; - // double angAccNorm; - int i,j; - - // SCP means "surface contact point" - vrpn_HapticPosition scpt, pt; - vrpn_HapticVector phantomVel; - vrpn_HapticVector phantomAcc; - vrpn_HapticVector phantomForce; - vrpn_HapticMatrix phantomRot; - - phantom->getPosition_WC(pt); - phantom->getSCP_WC(scpt); - - scpt.getValue(x,y,z); - scp_pos[0] = x/1000.0; // convert from mm to m - scp_pos[1] = y/1000.0; - scp_pos[2] = z/1000.0; - - pt.getValue(x,y,z); - pos[0] = x/1000.0; //converts from mm to meter - pos[1] = y/1000.0; - pos[2] = z/1000.0; - - phantomVel = phantom->getVelocity();//mm/sec - phantomVel.getValue(x, y, z); - vel[0] = x/1000.0; // convert from mm to m - vel[1] = y/1000.0; - vel[2] = z/1000.0; - - phantomForce = phantom->getReactionForce(); - phantomForce.getValue(x,y,z); - d_force[0] = x; - d_force[1] = y; - d_force[2] = z; - - // transform rotation matrix to quaternion - phantomRot = phantom->getRotationMatrix(); - for(i=0; i<4; i++) { - for(j=0;j<4;j++) { - rot_matrix[i][j] = phantomRot.get(i,j); - } - } - q_from_row_matrix(p_quat,rot_matrix); - - vrpn_HapticVector phantomAngVel = phantom->getAngularVelocity();//rad/sec - angVelNorm = phantomAngVel.norm(); - phantomAngVel.normalize(); - - // compute angular velocity quaternion - phantomAngVel.getValue(x,y,z); - q_make(v_quat, x, y, z, angVelNorm*dt_vel); - // set v_quat = v_quat*d_quat - q_mult(v_quat, v_quat, d_quat); - - - for(i=0;i<4;i++ ) { - d_quat[i] = p_quat[i]; - vel_quat[i] = v_quat[i]; - scp_quat[i] = 0.0; // no torque with PHANToM - } - scp_quat[3] = 1.0; - - vel_quat_dt = dt_vel; -#endif -//printf("get report pos = %lf, %lf, %lf\n",pos[0],pos[1],pos[2]); - - // If button a event has happened, report changes - // we have to use vrpn_Button_Filter, not vrpn_Button, or - // we lose the toggle functionality. - vrpn_Button_Filter::report_changes(); - - //Encode the position/orientation if there is a connection - if(vrpn_Tracker::d_connection) { - len = vrpn_Tracker::encode_to(msgbuf); - if(vrpn_Tracker::d_connection->pack_message(len, - timestamp,vrpn_Tracker::position_m_id, - vrpn_Tracker::d_sender_id, msgbuf, vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"Phantom: cannot write message: tossing\n"); - } - } - - //Encode the velocity/angular velocity if there is a connection - if(vrpn_Tracker::d_connection) { - len = vrpn_Tracker::encode_vel_to(msgbuf); - if(vrpn_Tracker::d_connection->pack_message(len, - timestamp,vrpn_Tracker::velocity_m_id, - vrpn_Tracker::d_sender_id, msgbuf,vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"Phantom: cannot write message: tossing\n"); - } - } - - //Encode the force if there is a connection - // Yes, the strange deletion of the returned buffer does make sense - // given the semantics of the encode_to in ForceDevice, which for some - // reason are different than those for other devices. - if(vrpn_ForceDevice::d_connection) { - buf = vrpn_ForceDevice::encode_force(len, d_force); - if(vrpn_ForceDevice::d_connection->pack_message(len,timestamp, - force_message_id,vrpn_ForceDevice::d_sender_id, - buf,vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"Phantom: cannot write message: tossing\n"); - } - delete buf; - } - // Encode the SCP (surface contact point) if there is a connection - if (vrpn_ForceDevice::d_connection) { - buf = vrpn_ForceDevice::encode_scp(len, scp_pos, scp_quat); - if (vrpn_ForceDevice::d_connection->pack_message(len, timestamp, - scp_message_id, vrpn_ForceDevice::d_sender_id, - buf, vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"Phantom: cannot write message: tossing\n"); - } - delete buf; - } - - // print_report(); - } -} - - - -void vrpn_Phantom::reset(){ -#ifdef VRPN_USE_HDAPI - instantBuzzEffect->stop(); - pointConstraint->stop(); -#else -/* Trimesh *mesh=GetObjectMesh(0); - if(mesh) - { - if(mesh->displayStatus()) - mesh->clear(); - }*/ - scene->stopServoLoop(); - bool found = m_hObjectList.MoveFirst(); - while(found) - { - removeObject(m_hObjectList.GetCurrentKey()); - found=m_hObjectList.MoveFirst(); - } - m_hObjectList.Clear(); - scene->startServoLoop(); - phantom->stopEffect(); - pointConstraint->stop(); -#endif - for (int i = 0; i < MAXPLANE; i++) { - if (planes[i]) { - planes[i]->setActive(FALSE); - } - } - forceField->stop(); -} - -int vrpn_Phantom::register_change_handler(void *userdata, - vrpn_PHANTOMPLANECHANGEHANDLER handler, - vrpn_PHANTOMCHANGELIST *&change_list) -{ - vrpn_PHANTOMCHANGELIST *new_entry; - - // Ensure that the handler is non-NULL - if (handler == NULL) { - printf("vrpn_Phantom::register_handler: NULL handler\n"); - return -1; - } - - // Allocate and initialize the new entry - if ( (new_entry = new vrpn_PHANTOMCHANGELIST) == NULL) { - printf( "vrpn_Phantom::register_handler: Out of memory\n"); - return -1; - } - new_entry->handler = handler; - new_entry->userdata = userdata; - - // Add this handler to the chain at the beginning (don't check to see - // if it is already there, since duplication is okay). - new_entry->next = change_list; - change_list = new_entry; - - return 0; -} - -int vrpn_Phantom::unregister_change_handler(void *userdata, - vrpn_PHANTOMPLANECHANGEHANDLER handler, - vrpn_PHANTOMCHANGELIST *&change_list){ - // The pointer at *snitch points to victim - vrpn_PHANTOMCHANGELIST *victim, **snitch; - - // Find a handler with this registry in the list (any one will do, - // since all duplicates are the same). - snitch = &change_list; - victim = *snitch; - while ( (victim != NULL) && - ( (victim->handler != handler) || - (victim->userdata != userdata) )) { - snitch = &( (*snitch)->next ); - victim = victim->next; - } - - // Make sure we found one - if (victim == NULL) { - printf("vrpn_Phantom::unregister_handler: No such handler\n"); - return -1; - } - - // Remove the entry from the list - *snitch = victim->next; - delete victim; - - return 0; -} - -int vrpn_Phantom::register_plane_change_handler(void *userdata, - vrpn_PHANTOMPLANECHANGEHANDLER handler){ - return register_change_handler(userdata, handler, - plane_change_list); -} - -int vrpn_Phantom::unregister_plane_change_handler(void *userdata, - vrpn_PHANTOMPLANECHANGEHANDLER handler){ - return unregister_change_handler(userdata, handler, - plane_change_list); -} - -int vrpn_Phantom::handle_plane_change_message(void *userdata, - vrpn_HANDLERPARAM p){ - vrpn_Phantom *me = (vrpn_Phantom *)userdata; - vrpn_Plane_PHANTOMCB tp; - vrpn_PHANTOMCHANGELIST *handler = me->plane_change_list; - - tp.msg_time = p.msg_time; - - decode_plane(p.buffer, p.payload_len, tp.plane, - &(tp.SurfaceKspring), &(tp.SurfaceKdamping), - &(tp.SurfaceFdynamic), &(tp.SurfaceFstatic), - &(tp.which_plane), &(tp.numRecCycles)); - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - while (handler != NULL) { - handler->handler(handler->userdata, tp); - handler = handler->next; - } - - return 0; -} - -int vrpn_Phantom::handle_effects_change_message(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Phantom *me = (vrpn_Phantom *) userdata; - -#ifdef DYNAMIC_PLANES - DynamicPlane *plane = (me->planes)[0]; -#else - Plane *plane = (me->planes)[0]; -#endif - - float k_adhesion_norm, k_adhesion_lat, tex_amp, tex_wl, - buzz_amp, buzz_freq; - - if (decode_surface_effects(p.buffer, p.payload_len, &k_adhesion_norm, - &k_adhesion_lat, &tex_amp, &tex_wl, &buzz_amp, &buzz_freq)){ - fprintf(stderr, "Error: handle_effects_change_message(): can't decode\n"); - } - -#ifdef DYNAMIC_PLANES - plane->setTextureAmplitude(tex_amp*1000.0); - plane->setTextureWavelength(tex_wl*1000.0); - plane->setBuzzAmplitude(buzz_amp*1000.0); - plane->setBuzzFrequency(buzz_freq); - plane->enableTexture(TRUE); - plane->enableBuzzing(TRUE); -#endif - - return 0; -} - -#ifndef VRPN_USE_HDAPI -gstSeparator *vrpn_Phantom::GetObject(vrpn_int32 objNum) -{ - vrpn_DISPLAYABLEOBJECT *obj=m_hObjectList.Find(objNum); - if(obj) - { - return (gstSeparator*)(obj->m_pObject); - } - return 0; -} -#endif - -#ifndef VRPN_USE_HDAPI -Trimesh *vrpn_Phantom::GetObjectMesh(vrpn_int32 objNum) -{ - vrpn_DISPLAYABLEOBJECT *obj=m_hObjectList.Find(objNum); - if(obj) - { - return (Trimesh*)(obj->m_pObjectMesh); - } - return 0; -} -#endif - -bool vrpn_Phantom::addObject(vrpn_int32 objNum, vrpn_int32 ParentNum) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::addObject: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - Trimesh *newObjectMesh= GetObjectMesh(objNum); - if( newObjectMesh) - removeObject(objNum); - newObjectMesh = new Trimesh(); - gstSeparator *newObject = new gstSeparator(); - vrpn_DISPLAYABLEOBJECT *elem= new vrpn_DISPLAYABLEOBJECT; - elem->m_ObjectType=1; - elem->m_pObject=newObject; - elem->m_pObjectMesh=newObjectMesh; - newObjectMesh->addToScene(newObject); - m_hObjectList.Add(objNum,elem); - gstSeparator *parentObj=GetObject(ParentNum); - if(parentObj) - parentObj->addChild(newObject); - else - hapticScene->addChild(newObject); - - return true; -#endif -} - - -bool vrpn_Phantom::addObjectExScene(vrpn_int32 objNum) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::addObjectExScene: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - Trimesh *newObjectMesh= GetObjectMesh(objNum); - if( newObjectMesh) - removeObject(objNum); - newObjectMesh = new Trimesh(); - gstSeparator *newObject = new gstSeparator(); - vrpn_DISPLAYABLEOBJECT *elem= new vrpn_DISPLAYABLEOBJECT; - elem->m_ObjectType=1; - elem->m_pObject=newObject; - elem->m_pObjectMesh=newObjectMesh; - newObjectMesh->addToScene(newObject); - m_hObjectList.Add(objNum,elem); - rootH->addChild(newObject); - - return true; -#endif -} - -bool vrpn_Phantom::setVertex(vrpn_int32 objNum, vrpn_int32 vertNum,vrpn_float32 x,vrpn_float32 y,vrpn_float32 z) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setVertex: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - Trimesh *obj=GetObjectMesh(objNum); - if(obj) - return obj->setVertex(vertNum,x*1000.0f,y*1000.0f,z*1000.0f); - else - return false; -#endif -} - -bool vrpn_Phantom::setNormal(vrpn_int32 objNum, vrpn_int32 normNum,vrpn_float32 x,vrpn_float32 y,vrpn_float32 z) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setNormal: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - Trimesh *obj=GetObjectMesh(objNum); - if(obj) - return obj->setNormal(normNum,x*1000.0f,y*1000.0f,z*1000.0f); - else - return false; -#endif -} - -bool vrpn_Phantom::setTriangle(vrpn_int32 objNum, vrpn_int32 triNum,vrpn_int32 vert0,vrpn_int32 vert1,vrpn_int32 vert2, - vrpn_int32 norm0,vrpn_int32 norm1,vrpn_int32 norm2) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setTriangle: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - Trimesh *obj=GetObjectMesh(objNum); - if(obj) - return obj->setTriangle(triNum,vert0,vert1,vert2,norm0,norm1,norm2); - else - return false; -#endif -} - -bool vrpn_Phantom::removeTriangle(vrpn_int32 objNum, vrpn_int32 triNum) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::removeTriangle: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - Trimesh *obj=GetObjectMesh(objNum); - if(obj) - return obj->removeTriangle(triNum); - else - return false; -#endif -} - -// should be called to incorporate the above changes into the -// displayed trimesh -bool vrpn_Phantom::updateTrimeshChanges(vrpn_int32 objNum,vrpn_float32 kspring, vrpn_float32 kdamp, vrpn_float32 fdyn, vrpn_float32 fstat) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::updateTrimeshChanges: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - Trimesh *obj=GetObjectMesh(objNum); - if(obj) - { - if(obj->updateChanges()) - { - obj->setSurfaceKspring(kspring); - obj->setSurfaceFstatic(kdamp); - obj->setSurfaceFdynamic(fdyn); - obj->setSurfaceKdamping(fstat); - return true; - } - return true; - } - else - return false; - -#endif -} - -// set the type of trimesh -bool vrpn_Phantom::setTrimeshType(vrpn_int32 objNum,vrpn_int32 type) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setTrimeshType: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - Trimesh *obj=GetObjectMesh(objNum); - if(obj) - { - obj->setType((TrimeshType)type); - return true; - } - else - return false; -#endif -} - -// set the trimesh's homogen transform matrix (in row major order) -bool vrpn_Phantom::setTrimeshTransform(vrpn_int32 objNum, vrpn_float32 homMatrix[16]) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setTrimeshTransform: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - Trimesh *obj=GetObjectMesh(objNum); - /* now we need to scale the transformation vector of our matrix from meters - to millimeters */ - homMatrix[3]*=1000.0; - homMatrix[7]*=1000.0; - homMatrix[11]*=1000.0; - if(obj) - { - obj->setTransformMatrix(homMatrix); - return true; - } - else - return false; -#endif -} - -// set position of an object -bool vrpn_Phantom::setObjectPosition(vrpn_int32 objNum, vrpn_float32 Pos[3]) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setObjectPosition: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - gstSeparator *obj=GetObject(objNum); - if(obj) - { - obj->setTranslate(Pos[0]*1000.0f,Pos[1]*1000.0f,Pos[2]*1000.0f); - return true; - } - else - return false; -#endif -} - -// set orientation of an object -bool vrpn_Phantom::setObjectOrientation(vrpn_int32 objNum, vrpn_float32 axis[3], vrpn_float32 angle) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setObjectOrientation: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - gstSeparator *obj=GetObject(objNum); - if(obj) - { - gstVector Axis(axis[0],axis[1],axis[2]); - obj->setRotation(Axis,angle); - return true; - } - else - return false; -#endif -} - -// set Scale of an object -bool vrpn_Phantom::setObjectScale(vrpn_int32 objNum, vrpn_float32 Scale[3]) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setObjectScale: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - gstSeparator *obj=GetObject(objNum); - if(obj) - { - obj->setScale(Scale[0]/*,Scale[1],Scale[2]*/); - return true; - } - else - return false; -#endif -} - -// remove an object from the scene -bool vrpn_Phantom::removeObject(vrpn_int32 objNum) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::removeObject: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - gstSeparator *obj=GetObject(objNum); - if(obj) - { - // Lock the scene when doing this change and then unlock it - // when we're done to avoid errors caused by our changes during - // a traversal of the scene. Do not stop the servoloop here, which will - // remove the other objects from the scene. - scene->lock(); - gstSeparator *parent = ( gstSeparator* )obj->getParent(); - parent->removeChild( obj ); - - for ( int i = obj->getNumChildren() ; i > 0 ; i-- ) - { - gstSeparator *child = (gstSeparator*)obj->getChild( i - 1 ); - if(!child->isOfType(gstShape::getClassTypeId() )) - { - obj->removeChild( i - 1 ); - parent->addChild(child); - //delete child; - } - /*if ( child->isOfType( gwpVRmentPolyMesh::getClassTypeId() ) ) - delete child; - else - parent->addChild( child->AsTransform() );*/ - } - - Trimesh *m=GetObjectMesh(objNum); - delete m; - delete obj; - m_hObjectList.Remove( objNum ); - scene->unlock(); - return true; - } - else - return false; -#endif -} - -bool vrpn_Phantom::clearTrimesh(vrpn_int32 objNum) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::clearTrimesh: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - Trimesh *objmesh=GetObjectMesh(objNum); - if(objmesh) - { - objmesh->clear(); - return true; - } - else - return false; -#endif -} - - -/** Functions to organize the scene **********************************************************/ -// Change The parent of an object -bool vrpn_Phantom::moveToParent(vrpn_int32 objNum, vrpn_int32 ParentNum) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::moveToParent: Trimesh not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - gstSeparator *obj=GetObject(objNum); - if(obj) - { - gstSeparator *parent = (gstSeparator*)obj->getParent(); - parent->removeChild((gstTransform*)obj); - parent = GetObject(ParentNum); - if(parent) - parent->addChild(obj); - else - hapticScene->addChild(obj); - return true; - } - else - return false; -#endif -} - -// Set the Origin of the haptic device -bool vrpn_Phantom::setHapticOrigin(vrpn_float32 Pos[3], vrpn_float32 axis[3], vrpn_float32 angle) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setHapticOrigin: Not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - phantomAxis->setPosition(Pos[0]*1000.0f,Pos[1]*1000.0f,Pos[2]*1000.0f); - phantomAxis->setRotation(gstVector(axis[0],axis[1],axis[2]),angle); - return true; -#endif -} - -// Set the scale factor of the haptic device -bool vrpn_Phantom::setHapticScale(vrpn_float32 Scale) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setHapticScale: Not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - phantomAxis->setScale(Scale); - return true; -#endif -} - -// Set the Origin of the haptic scene -bool vrpn_Phantom::setSceneOrigin(vrpn_float32 Pos[3], vrpn_float32 axis[3], vrpn_float32 angle) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setSceneOrigin: Not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else -// static FILE *f=fopen( "sceneorigin.txt", "w" ); - - gstTransformMatrix matrix; - matrix.setTranslation( Pos[0]*1000.0f, Pos[1]*1000.0f, Pos[2]*1000.0f ); - - matrix.setRotation(gstVector( axis[0], axis[1], axis[2] ), angle ); - - hapticScene->setTransformMatrix( matrix.getInverse() ); - return true; -#endif -} - -// make an object touchable or not -bool vrpn_Phantom::setObjectIsTouchable(vrpn_int32 objNum, vrpn_bool IsTouchable) -{ -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setObjectIsTouchable: Not supported under HDAPI",now, vrpn_TEXT_ERROR); - return false; -#else - #ifdef sgi - // For some reason, this function seems to be missing from GHOST 3.1 on the - // SGI architecture, even though it is described in the manual. - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_Phantom::setObjectIsTouchable: Not supported under SGI",now, vrpn_TEXT_ERROR); - #else - gstSeparator *obj=GetObject(objNum); - obj->setTouchableByPHANToM(IsTouchable) ; - return true; - #endif -#endif -} - - - -int vrpn_Phantom::handle_forcefield_change_message(void *userdata, - vrpn_HANDLERPARAM p){ - - vrpn_Phantom *me = (vrpn_Phantom *)userdata; - - int i,j; - - decode_forcefield(p.buffer, p.payload_len,me->ff_origin, - me->ff_force, me->ff_jacobian, &(me->ff_radius)); - - for (i=0;i<3;i++){ - me->ff_origin[i] *= (1000); // convert from meters->mm - for (j=0;j<3;j++){ - me->ff_jacobian[i][j] *= (0.001f); // convert from - // dyne/m to dyne/mm - } - } - - me->ff_radius *= (1000); // convert meters to mm - me->forceField->setForce(me->ff_origin, me->ff_force, - me->ff_jacobian, me->ff_radius); - if (!me->forceField->isActive()){ -#ifdef VRPN_USE_HDAPI -#else - me->phantom->setEffect(me->forceField); - me->phantom->startEffect(); -#endif - me->forceField->start(); - //XXX Where is the associated stop, other than when the Phantom is destroyed? - } - return 0; -} - -// static -int vrpn_Phantom::handle_resetOrigin_change_message(void * userdata, - vrpn_HANDLERPARAM p) { - vrpn_Phantom * me = (vrpn_Phantom *) userdata; - me->resetPHANToM(); - return 0; - -} - -// ajout ONDIM -// check processing of each effect -int vrpn_Phantom::handle_custom_effect_change_message(void *userdata, - vrpn_HANDLERPARAM p){ - - vrpn_Phantom *me = (vrpn_Phantom *)userdata; - - vrpn_uint32 effectId; - vrpn_float32* params = NULL; - vrpn_uint32 nbParams; - - decode_custom_effect(p.buffer, p.payload_len,&effectId,¶ms,&nbParams); - - switch(effectId) { - case BUZZ_EFFECT_ID: - if (nbParams >= 1) { - me->instantBuzzEffect->setAmplitude(params[0]); - } - if (nbParams >= 2) { - me->instantBuzzEffect->setFrequency(params[1]); - } - if (nbParams >= 3) { - me->instantBuzzEffect->setDuration(params[2]); - } - if (nbParams >= 6) { - me->instantBuzzEffect->setDirection(params[3], params[4], params[5]); - } - -#ifdef VRPN_USE_HDAPI - me->instantBuzzEffect->start(); -#else - me->phantom->setEffect(me->instantBuzzEffect); - me->phantom->startEffect(); -#endif - - break; - default: -#ifdef VRPN_USE_HDAPI - me->instantBuzzEffect->stop(); -#else - me->phantom->stopEffect(); -#endif - break; - } - - return 0; -} - -// fin ajout ONDIM - -#if 0 - -// -// constraint -// -// -// Would like to implement with gstConstraintEffect, but that has a -// THREE SECOND relaxation on startup and instant cutoff. We need -// relaxation closer to tenth-second on startup and cutoff. -// - -//static -int vrpn_Phantom::handle_enableConstraint_message - (void * userdata, vrpn_HANDLERPARAM p) { - int enable; - - CHECK(decode_enableConstraint(p.buffer, p.payload_len, &enable)); - - // TODO - - return 0; -} - -//static -int vrpn_Phantom::handle_setConstraintMode_message - (void * userdata, vrpn_HANDLERPARAM p) { - ConstraintGeometry mode; - - CHECK(decode_setConstraintMode(p.buffer, p.payload_len, &mode)); - - // TODO - - return 0; -} - -//static -int vrpn_Phantom::handle_setConstraintPoint_message - (void * userdata, vrpn_HANDLERPARAM p) { - float x, y, z; - - CHECK(decode_setConstraintPoint(p.buffer, p.payload_len, &x, &y, &z)); - - // convert m to mm - x *= 1000.0f; y *= 1000.0f; z *= 1000.0f; - - // TODO - - return 0; -} - -//static -int vrpn_Phantom::handle_setConstraintLinePoint_message - (void * userdata, vrpn_HANDLERPARAM p) { - float x, y, z; - - CHECK(decode_setConstraintLinePoint(p.buffer, p.payload_len, &x, &y, &z)); - - // convert m to mm - x *= 1000.0f; y *= 1000.0f; z *= 1000.0f; - - // TODO - - return 0; -} - -//static -int vrpn_Phantom::handle_setConstraintLineDirection_message - (void * userdata, vrpn_HANDLERPARAM p) { - float x, y, z; - - CHECK(decode_setConstraintLineDirection(p.buffer, p.payload_len, &x, &y, &z)); - - // convert m to mm - x *= 1000.0f; y *= 1000.0f; z *= 1000.0f; - - // TODO - - return 0; -} - -//static -int vrpn_Phantom::handle_setConstraintPlanePoint_message - (void * userdata, vrpn_HANDLERPARAM p) { - float x, y, z; - - CHECK(decode_setConstraintPlanePoint(p.buffer, p.payload_len, &x, &y, &z)); - - // convert m to mm - x *= 1000.0f; y *= 1000.0f; z *= 1000.0f; - - // TODO - - return 0; -} - -//static -int vrpn_Phantom::handle_setConstraintPlaneNormal_message - (void * userdata, vrpn_HANDLERPARAM p) { - float x, y, z; - - CHECK(decode_setConstraintPlaneNormal(p.buffer, p.payload_len, &x, &y, &z)); - - // convert m to mm - x *= 1000.0f; y *= 1000.0f; z *= 1000.0f; - - // TODO - - return 0; -} - -//static -int vrpn_Phantom::handle_setConstraintKSpring_message - (void * userdata, vrpn_HANDLERPARAM p) { - float k; - - CHECK(decode_setConstraintKSpring(p.buffer, p.payload_len, &k)); - - // TODO - - return 0; -} - -#endif // 0 - - -// static -int vrpn_Phantom::handle_update_rate_request (void * userdata, - vrpn_HANDLERPARAM p) { - vrpn_Phantom * me = (vrpn_Phantom *) userdata; - - if (p.payload_len != sizeof(double)) { - fprintf(stderr, "vrpn_Phantom::handle_update_rate_request: " - "Got %d-byte message, expected %d bytes.\n", - p.payload_len, sizeof(double)); - return -1; // XXXshould this be a fatal error? - } - - me->update_rate = ntohd(*((double *) p.buffer)); - fprintf(stderr, "vrpn_Phantom: set update rate to %.2f hertz.\n", - me->update_rate); - return 0; -} - - -#ifndef HDAPI -void phantomErrorHandler( int errnum, char *description, void *userdata) -{ - vrpn_Phantom *me = (vrpn_Phantom *) userdata; - fprintf(stderr, "PHANTOM ERROR: %s\n", description); - int i; - for (i = 0; i < MAXPLANE; i++){ - if (me->planes[i] != NULL) { - me->planes[i]->cleanUpAfterError(); - } - } - - switch(errnum) { - case GST_OUT_OF_RANGE_ERROR: - me->sendError(FD_VALUE_OUT_OF_RANGE); - me->errorCode = FD_VALUE_OUT_OF_RANGE; - break; - case GST_DUTY_CYCLE_ERROR: - me->sendError(FD_DUTY_CYCLE_ERROR); - me->errorCode = FD_DUTY_CYCLE_ERROR; - break; - case GST_PHANTOM_FORCE_ERROR: - case -2: // This is the number I get when I push through the surface. - me->sendError(FD_FORCE_ERROR); - me->errorCode = FD_FORCE_ERROR; - break; - default: - me->sendError(FD_MISC_ERROR); - me->errorCode = FD_MISC_ERROR; - break; - } -} -#endif - -#endif diff --git a/src/vrpn/server_src/vrpn_Phantom.h b/src/vrpn/server_src/vrpn_Phantom.h deleted file mode 100644 index 4b6abeb071ec1c45ed56db361c652970177290d9..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn_Phantom.h +++ /dev/null @@ -1,213 +0,0 @@ -#ifndef VRPN_PHANTOM_H -#define VRPN_PHANTOM_H - -#include "vrpn_Configure.h" -#ifdef VRPN_USE_PHANTOM_SERVER - -// Hide the include files which use the old version of iostreams -// by only defining the types we need from them here and doing -// the includes in the .C file. Yucky and frought with danger. -// I've asked SensAble to hide the includes. -#ifdef VRPN_USE_HDAPI -typedef unsigned int HHD; -typedef unsigned long HDSchedulerHandle; -typedef void *HHLRC; -typedef unsigned int HLuint; -#else -class gstScene; -class gstSeparator; -class gstPHANToM; -#endif - -class Plane; -class DynamicPlane; -class Trimesh; -class ConstraintEffect; -class ForceFieldEffect; - -// XXX HDAPI uses Planes rather than DynamicPlanes because I couldn't debug the -// more complicated plane port. Symptoms of the broken-ness for the Dynamic -// plane: The sphere_client program puts a plane facing -// in the positive Y direction (at Y=0) which never moves. Check the -// updateDynamics() call, perhaps. -#ifdef VRPN_USE_HDAPI -#undef DYNAMIC_PLANES -#else -#define DYNAMIC_PLANES -#endif - -// ajout ONDIM -/* -# instantBuzzEffect : instantaneous buzz "custom" effect for Phantom server -# written by Sebastien MARAUX, ONDIM SA (France) -# maraux@ondim.fr -*/ -const unsigned int NB_CUSTOM_EFFECTS = 1; -class InstantBuzzEffect; -const unsigned BUZZ_EFFECT_ID = 0; -// fin ajout ONDIM - -#include "vrpn_Button.h" -#include "vrpn_Tracker.h" -#include "vrpn_ForceDeviceServer.h" - -class vrpn_Plane_PHANTOMCB { -public: - struct timeval msg_time; // Time of the report - float SurfaceKspring; //surface spring coefficient - float SurfaceFdynamic; //surface dynamic friction coefficient - float SurfaceFstatic; //surface static friction coefficient - float SurfaceKdamping; //surface damping coefficient - - - vrpn_int32 which_plane; - float plane[4]; // plane equation, ax+by+cz+d = 0 - vrpn_int32 numRecCycles; // number of recovery cycles -}; - -typedef void (VRPN_CALLBACK *vrpn_PHANTOMPLANECHANGEHANDLER)(void *userdata, - const vrpn_Plane_PHANTOMCB &info); - -class vrpn_Phantom: public vrpn_ForceDeviceServer,public vrpn_Tracker, - public vrpn_Button_Filter { - friend void phantomErrorHandler( int errnum, char *description, - void *userdata); -protected: - double update_rate; -#ifdef VRPN_USE_HDAPI - HHD phantom; //< The Phantom hardware device we are using - HHLRC hHLRC; //< handle to haptic rendering context - HLuint effectId; //< Effect ID of HL custom force effect - int button_0_bounce_count, button_1_bounce_count; //< Used to remove button "bounce" - // Jean SIMARD <jean.simard@limsi.fr> - // Add a field which contain the name of the PHANToM configuration - char sconf[512]; - -#else - gstScene *scene; - gstSeparator *rootH; //< The haptics root separator attached to the scene. - gstSeparator *hapticScene; //< The next separator containing the entire scene graph. - gstSeparator *phantomAxis; //< The axis of the phantom is moved - gstPHANToM *phantom; -#endif - struct timeval timestamp; -#ifdef DYNAMIC_PLANES - DynamicPlane *planes[MAXPLANE]; -#else - Plane *planes[MAXPLANE]; -#endif -// Trimesh *trimesh; - - ConstraintEffect *pointConstraint; // this is a force appended to - // other forces exerted by phantom - // (Superceded by ForceFieldEffect) - ForceFieldEffect *forceField; //< general purpose force field approximation - - // ajout ONDIM - // add each effect pointer - InstantBuzzEffect *instantBuzzEffect; - // fin ajout ONDIM - - typedef struct vrpn_RPCS { - void *userdata; - vrpn_PHANTOMPLANECHANGEHANDLER handler; - struct vrpn_RPCS *next; - } vrpn_PHANTOMCHANGELIST; - vrpn_PHANTOMCHANGELIST *plane_change_list; - - static int VRPN_CALLBACK handle_plane_change_message(void *userdata, - vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK handle_effects_change_message(void *userdata, - vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK handle_forcefield_change_message(void *userdata, - vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK handle_custom_effect_change_message(void *userdata, - vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK handle_dropConnection (void *, vrpn_HANDLERPARAM); - - // from vrpn_Tracker - - static int VRPN_CALLBACK handle_update_rate_request (void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_resetOrigin_change_message(void * userdata, - vrpn_HANDLERPARAM p); - - // Add an object to the haptic scene as root (parent -1 = default) or as child (ParentNum =the number of the parent) - virtual bool addObject(vrpn_int32 objNum, vrpn_int32 ParentNum); - // Add an object next to the haptic scene as root - virtual bool addObjectExScene(vrpn_int32 objNum); - // vertNum normNum and triNum start at 0 - virtual bool setVertex(vrpn_int32 objNum, vrpn_int32 vertNum,vrpn_float32 x,vrpn_float32 y,vrpn_float32 z); - // NOTE: ghost doesn't take normals, - // and normals still aren't implemented for Hcollide - virtual bool setNormal(vrpn_int32 objNum, vrpn_int32 normNum,vrpn_float32 x,vrpn_float32 y,vrpn_float32 z); - virtual bool setTriangle(vrpn_int32 objNum, vrpn_int32 triNum,vrpn_int32 vert0,vrpn_int32 vert1,vrpn_int32 vert2, - vrpn_int32 norm0,vrpn_int32 norm1,vrpn_int32 norm2); - virtual bool removeTriangle(vrpn_int32 objNum, vrpn_int32 triNum); - // should be called to incorporate the above changes into the - // displayed trimesh - virtual bool updateTrimeshChanges(vrpn_int32 objNum,vrpn_float32 kspring, vrpn_float32 kdamp, vrpn_float32 fdyn, vrpn_float32 fstat); - // set the type of trimesh - virtual bool setTrimeshType(vrpn_int32 objNum,vrpn_int32 type); - // set the trimesh's homogen transform matrix (in row major order) - virtual bool setTrimeshTransform(vrpn_int32 objNum, vrpn_float32 homMatrix[16]); - // set position of an object - virtual bool setObjectPosition(vrpn_int32 objNum, vrpn_float32 Pos[3]); - // set orientation of an object - virtual bool setObjectOrientation(vrpn_int32 objNum, vrpn_float32 axis[3], vrpn_float32 angle); - // set Scale of an object - virtual bool setObjectScale(vrpn_int32 objNum, vrpn_float32 Scale[3]); - // remove an object from the scene - virtual bool removeObject(vrpn_int32 objNum); - virtual bool clearTrimesh(vrpn_int32 objNum); - - /** Functions to organize the scene **********************************************************/ - // Change The parent of an object - virtual bool moveToParent(vrpn_int32 objNum, vrpn_int32 ParentNum); - // Set the Origin of the haptic scene - virtual bool setHapticOrigin(vrpn_float32 Pos[3], vrpn_float32 axis[3], vrpn_float32 angle); - // Set the Scale factor of the haptic scene - virtual bool setHapticScale(vrpn_float32 Scale); - // Set the Origin of the haptic scene - virtual bool setSceneOrigin(vrpn_float32 Pos[3], vrpn_float32 axis[3], vrpn_float32 angle); - // get new ID, use only if wish to use vrpn ids and do not want to manage them yourself: ids need to be unique - //virtual vrpn_int32 getNewObjectID(); - // make an object touchable or not - virtual bool setObjectIsTouchable(vrpn_int32 objNum, vrpn_bool IsTouchable); - -#ifdef VRPN_USE_HDAPI - void initHL(HHD phantom); - void tearDownHL(void); -#else - gstSeparator *GetObject(vrpn_int32 objNum); -#endif - Trimesh *GetObjectMesh(vrpn_int32 objNum); -public: - // Jean SIMARD <jean.simard@limsi.fr> - // Modification of the constructor - // The default value is the default value use by the tool of SensAble - vrpn_Phantom(char *name, vrpn_Connection *c, float hz=1.0, const char * newsconf="Default PHANToM"); - ~vrpn_Phantom(); - - virtual void mainloop(void); - virtual void reset(); - void resetPHANToM(void); - void getPosition(double *vec, double *quat); - virtual void print_report(void); - virtual int register_change_handler(void *userdata, - vrpn_PHANTOMPLANECHANGEHANDLER handler, - vrpn_PHANTOMCHANGELIST *&change_list); - virtual int unregister_change_handler(void *userdata, - vrpn_PHANTOMPLANECHANGEHANDLER handler, - vrpn_PHANTOMCHANGELIST *&change_list); - - virtual int register_plane_change_handler(void *userdata, - vrpn_PHANTOMPLANECHANGEHANDLER handler); - virtual int unregister_plane_change_handler(void *userdata, - vrpn_PHANTOMPLANECHANGEHANDLER handler); - - static void VRPN_CALLBACK handle_plane(void *userdata,const vrpn_Plane_PHANTOMCB &p); - static void VRPN_CALLBACK check_parameters(vrpn_Plane_PHANTOMCB *p); -}; - -#endif -#endif diff --git a/src/vrpn/server_src/vrpn_Tracker.cfg.UNC b/src/vrpn/server_src/vrpn_Tracker.cfg.UNC deleted file mode 100644 index 6f4107666404cda08ec95394c042d4d164b4c61e..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn_Tracker.cfg.UNC +++ /dev/null @@ -1,71 +0,0 @@ -Phantom@phantom3 -0.0 0.0 -0.28 -0.0 0.0 0.0 1.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -Phantom@phantom -0.0 0.0 -0.28 -0.0 0.0 0.0 1.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -Phantom@phantom1 -0.0 0.0 -0.28 -0.0 0.0 0.0 1.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -Phantom@tantalum-cs -0.0 0.0 -0.28 -0.0 0.0 0.0 1.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -Phantom@phantom2 # nWB phantom, values from .tracker, not sure if right --0.424 -0.1146 -0.0166 -0.130526 0.0 -0.991445 0.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -Tracker0@ionanowb # nWB dynasight head tracker, values from .tracker --0.49 0.251 0.486 -0.521334 0.521334 0.477714 0.477714 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -PhantomNULLhead@phantom -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 --0.2 -0.2 -0.1 0.2 0.2 0.2 -1 -0 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 - - all PHANToMs have only 1 sensor, (sensor number 0) - This is a sample vrpn_Tracker.cfg file - format: - -<tracker name> -<room from tracker translation (x,y,z)> -<room from tracker quaternion (x,y,z,w)> -<workspace (xmin,ymin,zmin) (xmax,ymax,zmax) in tracker coordinate system> -<number of sensors> -<sensor #> -<sensor from unit translation (x,y,z)> -<sensor from unit quaternion (x,y,z,w)> -... -... diff --git a/src/vrpn/server_src/vrpn_hid_device_watcher.dsp b/src/vrpn/server_src/vrpn_hid_device_watcher.dsp deleted file mode 100644 index 62d1db1d69117a10c2c468cfeff94b3de719e57a..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn_hid_device_watcher.dsp +++ /dev/null @@ -1,90 +0,0 @@ -# Microsoft Developer Studio Project File - Name="vrpn_hid_device_watcher" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=vrpn_hid_device_watcher - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "vrpn_hid_device_watcher.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "vrpn_hid_device_watcher.mak" CFG="vrpn_hid_device_watcher - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "vrpn_hid_device_watcher - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "vrpn_hid_device_watcher - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "vrpn_hid_device_watcher - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/vrpn_hid_device_watcher/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/vrpn_hid_device_watcher/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\..\quat" /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "vrpn_hid_device_watcher - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "client_a" -# PROP BASE Intermediate_Dir "client_a" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/vrpn_hid_device_watcher/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/vrpn_hid_device_watcher/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".." /I "..\..\quat" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "vrpn_hid_device_watcher - Win32 Release" -# Name "vrpn_hid_device_watcher - Win32 Debug" -# Begin Source File - -SOURCE=vrpn_hid_device_watcher.cpp -# End Source File -# End Target -# End Project diff --git a/src/vrpn/server_src/vrpn_hid_device_watcher.vcproj b/src/vrpn/server_src/vrpn_hid_device_watcher.vcproj deleted file mode 100644 index 51a926941ce8dcc31233caf2676e3023c39075b9..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn_hid_device_watcher.vcproj +++ /dev/null @@ -1,198 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="vrpn_hid_device_watcher" - ProjectGUID="{64ABF6C2-FEC3-4F0E-A164-AE2179F334DB}" - RootNamespace="vrpn_hid_device_watcher" - Keyword="Win32Proj" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/Debug" - IntermediateDirectory=".\../pc_win32/server_src/Debug" - ConfigurationType="1" - CharacterSet="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="..\" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - GenerateDebugInformation="true" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/Release" - IntermediateDirectory=".\../pc_win32/server_src/Release" - ConfigurationType="1" - CharacterSet="1" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="..\" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\vrpn_HID_device_watcher.cpp" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/vrpn_phantom.dsp b/src/vrpn/server_src/vrpn_phantom.dsp deleted file mode 100644 index c57cabfb29af48dc79860a5ba6e2c80d1e530ec5..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn_phantom.dsp +++ /dev/null @@ -1,168 +0,0 @@ -# Microsoft Developer Studio Project File - Name="vrpn_phantom" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=vrpn_phantom - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "vrpn_phantom.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "vrpn_phantom.mak" CFG="vrpn_phantom - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "vrpn_phantom - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "vrpn_phantom - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "vrpn_phantom - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/include" /I "$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/utilities/include" /I "../../quat" /I "../" /I "./" /D "_LIB" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /TP /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "vrpn_phantom - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/include" /I "$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/utilities/include" /I "../../quat" /I "../" /I "./" /D "_LIB" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /GZ /TP /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "vrpn_phantom - Win32 Release" -# Name "vrpn_phantom - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Group "Ghost effects" - -# PROP Default_Filter ".cpp" -# Begin Source File - -SOURCE=.\ghostEffects\InstantBuzzEffect.cpp -# End Source File -# End Group -# Begin Source File - -SOURCE=.\buzzForceField.C -# End Source File -# Begin Source File - -SOURCE=.\constraint.C -# End Source File -# Begin Source File - -SOURCE=.\forcefield.C -# End Source File -# Begin Source File - -SOURCE=.\plane.C -# End Source File -# Begin Source File - -SOURCE=.\texture_plane.C -# End Source File -# Begin Source File - -SOURCE=.\trimesh.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Phantom.C -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Group "Ghost Effects headers" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=.\ghostEffects\InstantBuzzEffect.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\buzzForceField.h -# End Source File -# Begin Source File - -SOURCE=.\constraint.h -# End Source File -# Begin Source File - -SOURCE=.\forcefield.h -# End Source File -# Begin Source File - -SOURCE=.\ghost.h -# End Source File -# Begin Source File - -SOURCE=.\plane.h -# End Source File -# Begin Source File - -SOURCE=.\texture_plane.h -# End Source File -# Begin Source File - -SOURCE=.\trimesh.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Phantom.h -# End Source File -# End Group -# End Target -# End Project diff --git a/src/vrpn/server_src/vrpn_phantom.vcproj b/src/vrpn/server_src/vrpn_phantom.vcproj deleted file mode 100644 index 70d9fffc83dc318da974fe3448be9b281dc6be4d..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn_phantom.vcproj +++ /dev/null @@ -1,421 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="vrpn_phantom" - ProjectGUID="{92F85D1B-4F9A-4C68-AFE2-8763A7BFDF49}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/Debug" - IntermediateDirectory=".\../pc_win32/server_src/Debug" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/include,$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/utilities/include,../quat,../,./" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/Debug/vrpn_phantom.pch" - AssemblerListingLocation=".\../pc_win32/server_src/Debug/" - ObjectFile=".\../pc_win32/server_src/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile=".\../pc_win32/server_src/Debug\vrpn_phantom.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/Debug/vrpn_phantom.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/Release" - IntermediateDirectory=".\../pc_win32/server_src/Release" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include,$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/include,$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/utilities/include,../quat,../,./" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/server_src/Release/vrpn_phantom.pch" - AssemblerListingLocation=".\../pc_win32/server_src/Release/" - ObjectFile=".\../pc_win32/server_src/Release/" - ProgramDataBaseFileName=".\../pc_win32/server_src/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile=".\../pc_win32/server_src/Release\vrpn_phantom.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/Release/vrpn_phantom.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="buzzForceField.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="constraint.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="forcefield.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="plane.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="texture_plane.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="trimesh.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Phantom.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <Filter - Name="Ghost effects" - Filter=".cpp" - > - <File - RelativePath="ghostEffects\InstantBuzzEffect.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - </Filter> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - <File - RelativePath="buzzForceField.h" - > - </File> - <File - RelativePath="constraint.h" - > - </File> - <File - RelativePath="forcefield.h" - > - </File> - <File - RelativePath="ghost.h" - > - </File> - <File - RelativePath="plane.h" - > - </File> - <File - RelativePath="texture_plane.h" - > - </File> - <File - RelativePath="trimesh.h" - > - </File> - <File - RelativePath="vrpn_Phantom.h" - > - </File> - <Filter - Name="Ghost Effects headers" - Filter=".h" - > - <File - RelativePath="ghostEffects\InstantBuzzEffect.h" - > - </File> - </Filter> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/server_src/vrpn_server.dsp b/src/vrpn/server_src/vrpn_server.dsp deleted file mode 100644 index e87005bfd248295e2a690362222d374534fbab04..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn_server.dsp +++ /dev/null @@ -1,99 +0,0 @@ -# Microsoft Developer Studio Project File - Name="vrpn_server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=vrpn_server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "vrpn_server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "vrpn_server.mak" CFG="vrpn_server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "vrpn_server - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "vrpn_server - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "vrpn_server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../pc_win32/server_src/vrpn_server/Release" -# PROP Intermediate_Dir "../pc_win32/server_src/vrpn_server/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../Adrienne/AEC_DLL" /I "$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include" /I "$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/include" /I "$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/utilities/include" /I "../../isense" /I ".." /I "../../quat" /I "../../Dtrack" /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ELSEIF "$(CFG)" == "vrpn_server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../pc_win32/server_src/vrpn_server/Debug" -# PROP Intermediate_Dir "../pc_win32/server_src/vrpn_server/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../Adrienne/AEC_DLL" /I "$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include" /I "$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/include" /I "$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/utilities/include" /I "../../isense" /I ".." /I "../../quat" /I "../../Dtrack" /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /TP /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" -# SUBTRACT LINK32 /verbose - -!ENDIF - -# Begin Target - -# Name "vrpn_server - Win32 Release" -# Name "vrpn_server - Win32 Debug" -# Begin Source File - -SOURCE=vrpn.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Generic_server_object.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Generic_server_object.h -# End Source File -# End Target -# End Project diff --git a/src/vrpn/server_src/vrpn_server.vcproj b/src/vrpn/server_src/vrpn_server.vcproj deleted file mode 100644 index dbadcdd11161693766fffba8f0a5bce89181d014..0000000000000000000000000000000000000000 --- a/src/vrpn/server_src/vrpn_server.vcproj +++ /dev/null @@ -1,258 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="vrpn_server" - ProjectGUID="{92162D21-8739-4DF2-89AC-7629B294F1C4}" - RootNamespace="vrpn_server" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../pc_win32/server_src/vrpn_server/Debug" - IntermediateDirectory=".\../pc_win32/server_src/vrpn_server/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/vrpn_server/Debug/vrpn_server.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";../../dtrack;"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include";"$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/include";"$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/utilities/include";../../isense;..;../quat;../../Dtrack;../../libfreespace/include;"$(SYSTEMDRIVE)\Program Files\libusb-1.0\libusb";"C:\Program Files (x86)\Polhemus\PDI\PDI_90\Inc"" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../pc_win32/server_src/vrpn_server/Debug/vrpn_server.pch" - AssemblerListingLocation=".\../pc_win32/server_src/vrpn_server/Debug/" - ObjectFile=".\../pc_win32/server_src/vrpn_server/Debug/" - ProgramDataBaseFileName=".\../pc_win32/server_src/vrpn_server/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/vrpn_server/Debug/vrpn_server.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories=""$(SYSTEMDRIVE)\sdk\cpp";"$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1\lib"" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../pc_win32/server_src/vrpn_server/Debug/vrpn_server.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/vrpn_server/Debug/vrpn_server.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../pc_win32/server_src/vrpn_server/Release" - IntermediateDirectory=".\../pc_win32/server_src/vrpn_server/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../pc_win32/server_src/vrpn_server/Release/vrpn_server.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";../../dtrack;"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include";"$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/include";"$(SYSTEMDRIVE)/Program Files/SensAble/3DTouch/utilities/include";../../isense;..;../quat;../../Dtrack;../../libfreespace/include;"$(SYSTEMDRIVE)\Program Files\libusb-1.0\libusb";"C:\Program Files (x86)\Polhemus\PDI\PDI_90\Inc"" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../pc_win32/server_src/vrpn_server/Release/vrpn_server.pch" - AssemblerListingLocation=".\../pc_win32/server_src/vrpn_server/Release/" - ObjectFile=".\../pc_win32/server_src/vrpn_server/Release/" - ProgramDataBaseFileName=".\../pc_win32/server_src/vrpn_server/Release/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../pc_win32/server_src/vrpn_server/Release/vrpn_server.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories=""$(SYSTEMDRIVE)\sdk\cpp";"$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1\lib"" - ProgramDatabaseFile=".\../pc_win32/server_src/vrpn_server/Release/vrpn_server.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../pc_win32/server_src/vrpn_server/Release/vrpn_server.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <File - RelativePath="vrpn.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Generic_server_object.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Generic_server_object.h" - > - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/submodules/CMakeLists.txt b/src/vrpn/submodules/CMakeLists.txt deleted file mode 100644 index 5e69be46bf43bb01c35ff8df3965616ff060b442..0000000000000000000000000000000000000000 --- a/src/vrpn/submodules/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ - -# This file includes a cmake file per submodule, and then -# sends the variables it sets to the parent scope, which is the parent -# (main) directory. - -### -# HIDAPI -### - -include("hidapi.cmake") -if(VRPN_USE_LOCAL_HIDAPI) - set(HIDAPI_FOUND ${HIDAPI_FOUND} PARENT_SCOPE) - set(HIDAPI_INCLUDE_DIRS ${HIDAPI_INCLUDE_DIRS} PARENT_SCOPE) - set(HIDAPI_LIBRARIES ${HIDAPI_LIBRARIES} PARENT_SCOPE) - set(HIDAPI_SOURCES ${HIDAPI_SOURCES} PARENT_SCOPE) -endif() - -### -# JSONCPP -### -include("jsoncpp.cmake") -if(VRPN_USE_LOCAL_JSONCPP) - set(JSONCPP_FOUND ${JSONCPP_FOUND} PARENT_SCOPE) - set(JSONCPP_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIRS} PARENT_SCOPE) - set(JSONCPP_LIBRARIES ${JSONCPP_LIBRARIES} PARENT_SCOPE) - set(JSONCPP_SOURCES ${JSONCPP_SOURCES} PARENT_SCOPE) -endif() diff --git a/src/vrpn/submodules/hidapi.cmake b/src/vrpn/submodules/hidapi.cmake deleted file mode 100644 index 6fbc6517eb9fc9718165d7ca7119969ffd06ed5f..0000000000000000000000000000000000000000 --- a/src/vrpn/submodules/hidapi.cmake +++ /dev/null @@ -1,142 +0,0 @@ -### -# HID and HIDAPI -### - -set(HIDAPI_BACKEND_FOUND NO) -# Local HIDAPI requirements -if(WIN32) - set(HIDAPI_BACKEND_FOUND YES) - -elseif(APPLE) - find_package(MacHID) - if(MACHID_FOUND) - set(HIDAPI_BACKEND_FOUND YES) - endif() - -else() - find_package(Libusb1) - if(LIBUSB1_FOUND) - set(HIDAPI_BACKEND_FOUND YES) - endif() - - set(HIDAPI_LIBUDEV_FOUND NO) - if(CMAKE_SYSTEM_NAME MATCHES "Linux") - find_library(HIDAPI_LIBUDEV udev) - find_path(HIDAPI_HIDRAW_INCLUDE_DIR linux/hidraw.h) - find_path(HIDAPI_LIBUDEV_INCLUDE_DIR libudev.h) - if(HIDAPI_LIBUDEV AND HIDAPI_HIDRAW_INCLUDE_DIR AND HIDAPI_LIBUDEV_INCLUDE_DIR) - mark_as_advanced(HIDAPI_LIBUDEV - HIDAPI_HIDRAW_INCLUDE_DIR - HIDAPI_LIBUDEV_INCLUDE_DIR) - set(HIDAPI_LIBUDEV_FOUND YES) - set(HIDAPI_BACKEND_FOUND YES) - endif() - endif() - -endif() - -if(EXISTS "${VRPN_SOURCE_DIR}/submodules/hidapi/hidapi/hidapi.h") - set(LOCAL_HIDAPI_SUBMODULE_RETRIEVED TRUE) -else() - message(STATUS - "Local HIDAPI submodule not found. To download with Git, run git submodule update --init") -endif() - -option_requires(VRPN_USE_LOCAL_HIDAPI - "Build with HIDAPI code from within VRPN source directory" - LOCAL_HIDAPI_SUBMODULE_RETRIEVED - HIDAPI_BACKEND_FOUND) - -if(VRPN_USE_LOCAL_HIDAPI) - set(HIDAPI_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/hidapi/hidapi") - set(HIDAPI_SOURCES - "${CMAKE_CURRENT_SOURCE_DIR}/hidapi/hidapi/hidapi.h") - set(HIDAPI_FOUND TRUE) - - set(VRPN_HIDAPI_USE_LINUXUDEV NO) - # Permit choice between backends, when possible. - if(HIDAPI_LIBUDEV_FOUND AND LIBUSB1_FOUND) - option(VRPN_HIDAPI_USE_LIBUSB - "Should the LibUSB implementation of HIDAPI be used? If not, the (less reliable) hidraw version is used." - ON) - if(NOT VRPN_HIDAPI_USE_LIBUSB) - set(VRPN_HIDAPI_USE_LINUXUDEV YES) - endif() - elseif(LIBUSB1_FOUND) - set(VRPN_HIDAPI_USE_LIBUSB YES) - - elseif(HIDAPI_LIBUDEV_FOUND) - set(VRPN_HIDAPI_USE_LIBUSB NO) - set(VRPN_HIDAPI_USE_LINUXUDEV YES) - endif() - - # Set up desired backends - if(APPLE) - list(APPEND - HIDAPI_SOURCES - "${CMAKE_CURRENT_SOURCE_DIR}/hidapi/mac/hid.c") - set(HIDAPI_LIBRARIES ${MACHID_LIBRARIES}) - - elseif(WIN32) - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/hidapi/windows/hid.cpp) - # Old hidapi - list(APPEND - HIDAPI_SOURCES - "${PROJECT_SOURCE_DIR}/vrpn_Local_HIDAPI.C") - elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/hidapi/windows/hid.c") - # New hidapi - list(APPEND - HIDAPI_SOURCES - "${CMAKE_CURRENT_SOURCE_DIR}/hidapi/windows/hid.c") - else() - message(STATUS - "ERROR: Can't use local HIDAPI - can't find the source file! Perhaps an unknown upstream version?") - set(HIDAPI_FOUND FALSE) - endif() - set(HIDAPI_LIBRARIES setupapi) - - elseif(VRPN_HIDAPI_USE_LIBUSB) - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/hidapi/libusb/hid.c") - # Newest version - FreeBSD-compatible libusb backend - list(APPEND - HIDAPI_SOURCES - "${CMAKE_CURRENT_SOURCE_DIR}/hidapi/libusb/hid.c") - elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/hidapi/linux/hid-libusb.c") - # Earlier version - before FreeBSD support - list(APPEND - HIDAPI_SOURCES - "${CMAKE_CURRENT_SOURCE_DIR}/hidapi/linux/hid-libusb.c") - else() - message(STATUS - "ERROR: Can't use local HIDAPI - can't find the source file! Perhaps an unknown upstream version?") - set(HIDAPI_FOUND FALSE) - endif() - set(HIDAPI_LIBRARIES ${LIBUSB1_LIBRARIES}) - list(APPEND HIDAPI_INCLUDE_DIRS ${LIBUSB1_INCLUDE_DIRS}) - - elseif(VRPN_HIDAPI_USE_LINUXUDEV) - list(APPEND - HIDAPI_SOURCES - "${CMAKE_CURRENT_SOURCE_DIR}/hidapi/linux/hid.c") - set(HIDAPI_LIBRARIES ${HIDAPI_LIBUDEV}) - list(APPEND - HIDAPI_INCLUDE_DIRS - ${HIDAPI_HIDRAW_INCLUDE_DIR} - ${HIDAPI_LIBUDEV_INCLUDE_DIR}) - - else() - message(STATUS - "ERROR: Can't use local HIDAPI without either libusb1 or udev!") - set(HIDAPI_FOUND FALSE) - - endif() - if(VRPN_HIDAPI_USE_LIBUSB OR VRPN_HIDAPI_USE_LINUXUDEV) - find_library(HIDAPI_LIBRT rt) - if(HIDAPI_LIBRT) - mark_as_advanced(HIDAPI_LIBRT) - list(APPEND HIDAPI_LIBRARIES ${HIDAPI_LIBRT}) - endif() - endif() - - source_group("HIDAPI Submodule" FILES ${HIDAPI_SOURCES}) -endif() diff --git a/src/vrpn/submodules/jsoncpp.cmake b/src/vrpn/submodules/jsoncpp.cmake deleted file mode 100644 index c27645944192368a24aa66385b4cbf1e895a9869..0000000000000000000000000000000000000000 --- a/src/vrpn/submodules/jsoncpp.cmake +++ /dev/null @@ -1,31 +0,0 @@ -### -# HID and HIDAPI -### - -if(EXISTS "${VRPN_SOURCE_DIR}/submodules/jsoncpp/jsoncpp/include/json/json.h") - set(LOCAL_JSONCPP_SUBMODULE_RETRIEVED TRUE) -else() - message(STATUS - "Local JSONCPP submodule not found. To download with Git, run git submodule update --init") -endif() - -option_requires(VRPN_USE_LOCAL_JSONCPP - "Build with HIDAPI code from within VRPN source directory" - LOCAL_HIDAPI_SUBMODULE_RETRIEVED) - -if(VRPN_USE_LOCAL_JSONCPP) - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/jsoncpp/jsoncpp") - set(_jsoncpp_base "${CMAKE_CURRENT_SOURCE_DIR}/jsoncpp/jsoncpp") - else() - set(_jsoncpp_base "${CMAKE_CURRENT_SOURCE_DIR}/jsoncpp") - endif() - set(JSONCPP_INCLUDE_DIRS "${_jsoncpp_base}/include/") - file(GLOB JSONCPP_SOURCES - "${_jsoncpp_base}/include/json/*.h" - "${_jsoncpp_base}/src/lib_json/*.inl" - "${_jsoncpp_base}/src/lib_json/*.h" - "${_jsoncpp_base}/src/lib_json/*.cpp") - source_group("JSONCPP Submodule" FILES ${JSONCPP_SOURCES}) - set(JSONCPP_LIBRARIES "") - set(JSONCPP_FOUND TRUE) -endif() diff --git a/src/vrpn/time_test.cpp b/src/vrpn/time_test.cpp deleted file mode 100644 index 2c0c8e6a8c50dd9f0d42640af57c72c438e09c50..0000000000000000000000000000000000000000 --- a/src/vrpn/time_test.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// Avoid warning on the call of _ftime() -#ifdef _WIN32 -#define _CRT_SECURE_NO_WARNINGS - -#include "vrpn_Shared.h" -#include <winbase.h> -#include <stdio.h> -#include <math.h> -#include <sys/types.h> -#include <sys/timeb.h> -#include "vrpn_Types.h" - -/* -void get_time_using_GetLocalTime(unsigned long &sec, unsigned long &usec) -{ - SYSTEMTIME stime; // System time in funky structure - FILETIME ftime; // Time in 100-nsec intervals since Jan 1 1601 - LARGE_INTEGER tics; // ftime stored into a 64-bit quantity - - GetLocalTime(&stime); - SystemTimeToFileTime(&stime, &ftime); - tics.HighPart = ftime.dwHighDateTime; - tics.LowPart = ftime.dwLowDateTime; - sec = (long)( tics.QuadPart / 10000000L ); - usec = (long)( ( tics.QuadPart - ( ((LONGLONG)(sec)) * 10000000L ) ) / 10 ); -} -*/ - -static void get_time_using_GetLocalTime(unsigned long &sec, unsigned long &usec) -{ - SYSTEMTIME stime; // System time in funky structure - FILETIME ftime; // Time in 100-nsec intervals since Jan 1 1601 - LARGE_INTEGER tics; // ftime stored into a 64-bit quantity - - GetLocalTime(&stime); - SystemTimeToFileTime(&stime, &ftime); - - // Copy the data into a structure that can be treated as a 64-bit integer - tics.HighPart = ftime.dwHighDateTime; - tics.LowPart = ftime.dwLowDateTime; - - // Convert the 64-bit time into seconds and microseconds since July 1 1601 - sec = (long)( tics.QuadPart / 10000000L ); - usec = (long)( ( tics.QuadPart - ( ((LONGLONG)(sec)) * 10000000L ) ) / 10 ); - - // Translate the time to be based on January 1, 1970 (_ftime base) - // The offset here is gotten by using the "time_test" program to report the - // difference in seconds between the two clocks. - sec -= 3054524608L; -} - -void get_time_using_ftime(unsigned long &sec, unsigned long &usec) -{ - struct _timeb t; - _ftime(&t); - sec = static_cast<unsigned long>(t.time); - usec = (long)t. millitm * 1000; -} - -int main(int argc, char *argv[]) { - - /* XXX Checking how well the two clocks track each other - unsigned long lsec, lusec; - unsigned long fsec, fusec; - long dsec, dusec; - int i; - for (i = 0; i < 10; i++) { - get_time_using_GetLocalTime(lsec, lusec); - get_time_using_ftime(fsec, fusec); - dsec = lsec - fsec; - dusec = lusec - fusec; - - printf("L: %u:%u, F: %u:%u, Difference: %u:%ld\n", - lsec, lusec, fsec, fusec, dsec, dusec); - - Sleep(1000); - } - */ - - /* Checking the vrpn_gettimeofday() function for monotonicity and step size */ - struct timeval last_time, this_time; - double skip; - vrpn_gettimeofday(&last_time, NULL); - printf("Should be no further output if things are working\n"); - while (true) { - vrpn_gettimeofday(&this_time, NULL); - skip = vrpn_TimevalMsecs(vrpn_TimevalDiff(this_time, last_time)); - if (skip > 50) { - printf("Skipped forward %lg microseconds\n", skip); - } - if (skip < 0) { - printf("** Backwards %lg microseconds\n", skip); - } - if (skip == 0) { - printf("Twice the same time\n"); - } - last_time = this_time; - } - - return 0; -} - -#else -#include <stdio.h> -int main(void) -{ - fprintf(stderr,"Program not ported to other than Windows\n"); - return -1; -} -#endif diff --git a/src/vrpn/time_test.dsp b/src/vrpn/time_test.dsp deleted file mode 100644 index 67b9cb5633f76de94669f846700d793b0a6d1613..0000000000000000000000000000000000000000 --- a/src/vrpn/time_test.dsp +++ /dev/null @@ -1,95 +0,0 @@ -# Microsoft Developer Studio Project File - Name="time_test" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=time_test - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "time_test.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "time_test.mak" CFG="time_test - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "time_test - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "time_test - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "time_test - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "pc_win32/time_test/Release" -# PROP Intermediate_Dir "pc_win32/time_test/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /TP /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /machine:I386 /libpath:"pc_win32/Release" /libpath:"pc_win32/DLL/Release" -# SUBTRACT LINK32 /debug - -!ELSEIF "$(CFG)" == "time_test - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "pc_win32/time_test/Debug" -# PROP Intermediate_Dir "pc_win32/time_test/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /GZ /TP /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"pc_win32/Debug" /libpath:"pc_win32/DLL/Debug" - -!ENDIF - -# Begin Target - -# Name "time_test - Win32 Release" -# Name "time_test - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=time_test.cpp -# End Source File -# End Group -# End Target -# End Project diff --git a/src/vrpn/time_test.vcproj b/src/vrpn/time_test.vcproj deleted file mode 100644 index 06cf7934e46aebd8b7372b02b01d3dbddf5f8fca..0000000000000000000000000000000000000000 --- a/src/vrpn/time_test.vcproj +++ /dev/null @@ -1,231 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="time_test" - ProjectGUID="{AF7B0B97-2F3F-419A-81C6-ED55FE6ADD50}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\pc_win32/time_test/Release" - IntermediateDirectory=".\pc_win32/time_test/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\pc_win32/time_test/Release/time_test.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include";"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include"" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\pc_win32/time_test/Release/time_test.pch" - AssemblerListingLocation=".\pc_win32/time_test/Release/" - ObjectFile=".\pc_win32/time_test/Release/" - ProgramDataBaseFileName=".\pc_win32/time_test/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\pc_win32/time_test/Release/time_test.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - ProgramDatabaseFile=".\pc_win32/time_test/Release/time_test.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32/time_test/Release/time_test.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\pc_win32/time_test/Debug" - IntermediateDirectory=".\pc_win32/time_test/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\pc_win32/time_test/Debug/time_test.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include";"$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include"" - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\pc_win32/time_test/Debug/time_test.pch" - AssemblerListingLocation=".\pc_win32/time_test/Debug/" - ObjectFile=".\pc_win32/time_test/Debug/" - ProgramDataBaseFileName=".\pc_win32/time_test/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\pc_win32/time_test/Debug/time_test.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\pc_win32/time_test/Debug/time_test.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32/time_test/Debug/time_test.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="time_test.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/util/astyle.rc b/src/vrpn/util/astyle.rc deleted file mode 100644 index b7050fbb67b2755858632e51643748cbac4c0b32..0000000000000000000000000000000000000000 --- a/src/vrpn/util/astyle.rc +++ /dev/null @@ -1,12 +0,0 @@ ---indent-classes ---indent-switches ---indent-cases ---indent-namespaces ---pad-oper ---pad-header ---pad-paren-out ---unpad-paren ---indent=spaces=2 ---brackets=linux ---add-brackets ---lineend=linux diff --git a/src/vrpn/util/cleanupBeforeCommit.sh b/src/vrpn/util/cleanupBeforeCommit.sh deleted file mode 100755 index 2c84f1b03bdfcfa78235f705eecb1c1f762fb7cb..0000000000000000000000000000000000000000 --- a/src/vrpn/util/cleanupBeforeCommit.sh +++ /dev/null @@ -1,260 +0,0 @@ -set -e - -### -# Auto-Configuration -### - -# Find the VRPN source root relative to this script's known location. -VRPN=$(cd $(dirname $0) && cd .. && pwd) -# Relative path to script -SCRIPT="util/$(basename $0)" -# Verboseness - just use the environment -VERBOSE=${VERBOSE:-false} - -# Pick the DOS endline remover -if ! DOS2UNIX=$(which dos2unix || which fromdos); then - echo "Can't find dos2unix or fromdos! Must exit!" >&2 - exit 1 -fi - -# Pick the DOS endline adder -if ! UNIX2DOS=$(which unix2dos || which todos); then - echo "Can't find unix2dos or todos! Must exit!" >&2 - exit 1 -fi - -# Check for sed -if ! which sed > /dev/null; then - echo "Can't find 'sed'!" >&2 - exit 1 -fi - -# Check for find -if ! which find > /dev/null; then - echo "Can't find 'find'!" >&2 - exit 1 -fi - -### -# Startup Message -### - -echo -if ${VERBOSE}; then - echo "VRPN Source Root: ${VRPN}" - echo "Cleanup script: ${SCRIPT}" -else - echo "(Run with environment variable VERBOSE=true for full output)" -fi -echo - - -### -# Status message functions -### - -# Internal use only - don't call from the main script -# Wrapper for echo that prefixes the filename, a colon, and a tab. -DisplayMessageInternal() { - echo "${FILETOPROCESS}: $*" -} - -# Display a message only seen in verbose mose -StatusMessage() { - if ${VERBOSE}; then - DisplayMessageInternal "$*" - fi -} - -# Display a message always seen, with extra indent -ResultMessage() { - DisplayMessageInternal " $*" -} - -# Display a message always seen on standard error -ErrorMessage() { - ResultMessage "$*" >&2 -} - -### -# Functions for file processing -# -# Must always start by calling StartProcessingFile with the filename. -# Then, any other function may be called: the cleaning functions do -# not need a filename passed to them because of StartProcessingFile. -### - -# Must be called before each new file processing begins. -StartProcessingFile() { - export FILETOPROCESS=$1 -} - -RemoveDosEndlines() { - StatusMessage "Removing DOS endlines with ${DOS2UNIX}" - ${DOS2UNIX} ${FILETOPROCESS} > /dev/null -} - -AddDosEndlines() { - StatusMessage "Adding DOS endlines with ${UNIX2DOS}" - ${UNIX2DOS} ${FILETOPROCESS} > /dev/null -} - -TrimTrailingWhitespace() { - StatusMessage "Trimming trailing whitespace with sed" - sed -i 's/[ \t]*$//' ${FILETOPROCESS} -} - -LeadingFourSpacesToTabs() { - # sed tip from http://kvz.io/blog/2011/03/31/spaces-vs-tabs/ - StatusMessage "Converting leading four-space groups into tabs with sed" - sed -i -e ':repeat; s/^\(\t*\) /\1\t/; t repeat' ${FILETOPROCESS} -} - -# Greps for lines that aren't all whitespace and don't start with # as a comment marker -# such as in vrpn.cfg -CheckForUncommentedLines() { - StatusMessage "Checking for un-commented, non-empty lines" - if grep --with-filename --line-number -v -E '^(#.*)?\s*$' ${FILETOPROCESS} >&2; then - ErrorMessage "Oops - you have uncommented lines (see above) - don't commit this file!" - else - ResultMessage "No un-commented lines found - OK to commit this file!" - fi -} - -RemoveExecutablePrivilege() { - StatusMessage "Ensuring file is not marked as executable" - chmod a-x ${FILETOPROCESS} -} - -AddExecutablePrivilege() { - StatusMessage "Ensuring file is marked as executable" - chmod a+x ${FILETOPROCESS} -} - -# Excludes submodules directory -FindFilesNamed() { - find * -path submodules -prune -o -name "$1" -print -} - -# Excludes submodules directory -FindFilesNamedCaseInsensitive() { - find * -path submodules -prune -o -iname "$1" -print -} - -### -# Main script - process files! -### - -# Open a subshell in which we'll change directories to VRPN root to process -# files relative to there. -( - cd ${VRPN} - - # Clean up this script first, but only if we're not on Windows - if uname | grep "_NT-" >/dev/null; then - StatusMessage "Skipping script self-clean because Windows was detected" - else - StartProcessingFile ${SCRIPT} - RemoveDosEndlines - TrimTrailingWhitespace - AddExecutablePrivilege - fi - - # Git config file - StartProcessingFile .gitmodules - RemoveDosEndlines - #TrimTrailingWhitespace # Is this safe to do? - RemoveExecutablePrivilege - - # Server config file - StartProcessingFile server_src/vrpn.cfg - RemoveDosEndlines - #TrimTrailingWhitespace # Is this safe to do? - CheckForUncommentedLines - RemoveExecutablePrivilege - - # Clean up all CMake files we control - for fn in $(FindFilesNamed "CMakeLists.txt") *.cmake cmake/*.cmake submodules/*.cmake submodules/CMakeLists.txt; do - StartProcessingFile ${fn} - RemoveDosEndlines - LeadingFourSpacesToTabs - TrimTrailingWhitespace - RemoveExecutablePrivilege - done - - # Clean up lots of files without trimming whitespace. - ( - FindFilesNamed "Format" - FindFilesNamed Doxyfile - FindFilesNamed GNUmakefile - FindFilesNamed Makefile.python - FindFilesNamed package-list - FindFilesNamed Readme - FindFilesNamed set_instruments_for_sound_server - FindFilesNamed \*.afm-plus - FindFilesNamed \*.afm-plus_imd - FindFilesNamed \*.c - FindFilesNamed \*.C - FindFilesNamed \*.Cdef - FindFilesNamed \*.cfg - FindFilesNamed \*.classpath - FindFilesNamed \*.cmake_in - FindFilesNamed \*.cpp - FindFilesNamed \*.css - FindFilesNamed \*.cvsignore - FindFilesNamed \*.h - FindFilesNamed \*.hdef - FindFilesNamed \*.hpp - FindFilesNamed \*.htm - FindFilesNamed \*.html - FindFilesNamed \*.i - FindFilesNamed \*.imp - FindFilesNamed \*.in - FindFilesNamed \*.inf - FindFilesNamed \*.java - FindFilesNamed \*.jconf - FindFilesNamed \*.mk - FindFilesNamed \*.pl - FindFilesNamed \*.prefs - FindFilesNamed \*.project - FindFilesNamed \*.properties - FindFilesNamed \*.psf - FindFilesNamed \*.py - FindFilesNamed \*.qsp - FindFilesNamed \*.rc - FindFilesNamed \*.tcl - FindFilesNamed \*.txt - FindFilesNamed \*.ui - FindFilesNamed \*.UNC - FindFilesNamed \*.vmd - FindFilesNamed \*.vrpndef - FindFilesNamed \*.xml - FindFilesNamedCaseInsensitive "ChangeLog" - FindFilesNamedCaseInsensitive "Makefile" - FindFilesNamedCaseInsensitive README\* - ) | while read fn; do - StartProcessingFile ${fn} - RemoveDosEndlines - RemoveExecutablePrivilege - done - - ######################################################################### - # Clean up all .dsp and .dsw files. These should be DOS format when done. - # Clean up all .sln and .vcproj files. These should be DOS format when done. - # Clean up all .vcp and .vcw files. These should be DOS format when done. - ( - FindFilesNamed \*.dsw - FindFilesNamed \*.dsp - FindFilesNamed \*.sln - FindFilesNamed \*.vcproj - FindFilesNamed \*.vcp - FindFilesNamed \*.vcw - ) | while read fn; do - StartProcessingFile ${fn} - AddDosEndlines - RemoveExecutablePrivilege - done - - -) - diff --git a/src/vrpn/util/formatCode.sh b/src/vrpn/util/formatCode.sh deleted file mode 100755 index 1533ff0d29174f5cf520ec2cce6de4ef930804f7..0000000000000000000000000000000000000000 --- a/src/vrpn/util/formatCode.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -e -stylescript=$(cd $(dirname $0) && pwd)/formatFile.sh -filelist=$(cd $(dirname $0) && pwd)/sharedcode.txt -#stylescript="echo" - -( -cd $(dirname $0) && cd .. - -# This list is all the modules considered to be "common/shared" and thus -# normalized to a standard formatting -cat $filelist | while read module; do - for ext in C h h.cmake_in; do - if [ -f ${module}.${ext} ]; then - ${stylescript} ${module}.${ext} - fi - done -done -) - diff --git a/src/vrpn/util/formatFile.sh b/src/vrpn/util/formatFile.sh deleted file mode 100755 index e0e78d6a225082d33734e923663aeb58919a9d67..0000000000000000000000000000000000000000 --- a/src/vrpn/util/formatFile.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -e -CLANG_FORMAT=${CLANG_FORMAT-$(which clang-format || which clang-format-3.6 || which clang-format-3.5 || which clang-format-3.4)} -${CLANG_FORMAT} -i \ - -style="file" \ - "$@" diff --git a/src/vrpn/util/gen_rpc/.cvsignore b/src/vrpn/util/gen_rpc/.cvsignore deleted file mode 100644 index 12f8fcbb5455f06c346781c03e119d7534f485c1..0000000000000000000000000000000000000000 --- a/src/vrpn/util/gen_rpc/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -pc_win32_MTd -printmsg.C -rpc_Test.C -rpc_Test.h -rpc_Test_Remote.C -rpc_Test_Remote.h -test_gen_rpc.plg -*.vcproj.*.user \ No newline at end of file diff --git a/src/vrpn/util/gen_rpc/CMakeLists.txt b/src/vrpn/util/gen_rpc/CMakeLists.txt deleted file mode 100644 index 6362f643b13715dd69caeb617c50edcfee9041d0..0000000000000000000000000000000000000000 --- a/src/vrpn/util/gen_rpc/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -if(NOT VRPN_CLIENT_LIBRARY) - message(FATAL_ERROR - "Cannot compile RPC test without either the client or full library. Enable one and try again.") -endif() - -#----------------------------------------------------------------------------- -# Include directories needed -include_directories(${CMAKE_CURRENT_BINARY_DIR} - ${VRPN_SOURCE_DIR} - ${QUATLIB_INCLUDE_DIR}) - -#----------------------------------------------------------------------------- -# Custom build steps to generate RPC code. -# Executable built from these. -set(SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/gen_vrpn_rpc.pl") - -set(MESSAGE_DEF rpc_Test.vrpndef) - -# Must copy the message def to the binary directory -add_custom_command(OUTPUT - "${CMAKE_CURRENT_BINARY_DIR}/${MESSAGE_DEF}" - COMMAND - "${CMAKE_COMMAND}" - -E - copy_if_different - "${CMAKE_CURRENT_SOURCE_DIR}/${MESSAGE_DEF}" - "${CMAKE_CURRENT_BINARY_DIR}/${MESSAGE_DEF}" - DEPENDS - "${CMAKE_CURRENT_SOURCE_DIR}/${MESSAGE_DEF}" - COMMENT - "Copying message definition file ${MESSAGE_DEF}") - -# This generates the source files -function(gen_vrpn_rpc OUTVAR OUT IN) - add_custom_command(OUTPUT - "${CMAKE_CURRENT_BINARY_DIR}/${OUT}" - COMMAND - ${PERL} - "${SCRIPT}" - ${ARGN} - "${CMAKE_CURRENT_SOURCE_DIR}/${IN}" - DEPENDS - "${SCRIPT}" - "${CMAKE_CURRENT_SOURCE_DIR}/${IN}" - "${CMAKE_CURRENT_BINARY_DIR}/${MESSAGE_DEF}" - WORKING_DIRECTORY - "${CMAKE_CURRENT_BINARY_DIR}" - COMMENT - "Generating ${OUT} from ${IN}" - VERBATIM) - list(APPEND ${OUTVAR} "${CMAKE_CURRENT_BINARY_DIR}/${OUT}") - set(${OUTVAR} ${${OUTVAR}} PARENT_SCOPE) -endfunction() - -set(GENERATED_SOURCES) -gen_vrpn_rpc(GENERATED_SOURCES rpc_Test_Remote.C rpc_Test_Remote.Cdef) -gen_vrpn_rpc(GENERATED_SOURCES rpc_Test_Remote.h rpc_Test_Remote.hdef) -gen_vrpn_rpc(GENERATED_SOURCES rpc_Test.h rpc_Test.vrpndef -h) -gen_vrpn_rpc(GENERATED_SOURCES rpc_Test.C rpc_Test.vrpndef -C) - -add_executable(test_gen_rpc main_test.C ${GENERATED_SOURCES}) - -target_link_libraries(test_gen_rpc ${VRPN_CLIENT_LIBRARY}) - -if(PTHREAD_LIBRARY) - target_link_libraries(test_gen_rpc ${PTHREAD_LIBRARY}) -endif() diff --git a/src/vrpn/util/gen_rpc/ChangeLog b/src/vrpn/util/gen_rpc/ChangeLog deleted file mode 100644 index d570376c0c9253478483a26b2cf03f56eadfcd0a..0000000000000000000000000000000000000000 --- a/src/vrpn/util/gen_rpc/ChangeLog +++ /dev/null @@ -1,56 +0,0 @@ -2004-09-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - * gen_vrpn_rpc.pl : Making it add VRPN_CALLBACK where it should. - -2004-09-16 Russell M. Taylor II <taylorr@cs.unc.edu> - - Adding Chris VanderKnyff's changes that enable DLL linkage - for applications. Heading towards enabling C# and other language - support. - - * test_gen_rpc.dsp : Making it depend on the project - that causes both VRPN and VRPNDLL projects to be built, rather - than on VRPN. If you try to make it depend on both - VRPN and VRPNDLL, you get linking trouble. - -2004-04-07 Russell M. Taylor II <taylorr@cs.unc.edu> - - * main_tes.C : Using vrpn_gettimeofday() not gettimeofday(). - -2004-03-15 Russell M. Taylor II <taylorr@cs.unc.edu> - - * test_gen_rpc.dsp : Point to Cygwin installed in C: rather than - on the E: drive. - -2002-12-06 Russell M. Taylor II <taylorr@cs.unc.edu> - - * test_gen_rpc.dsp : DSP files have been modified to not do definitions - of VRPN_NO_STREAMS and other constants directly, rather these - are now set by editing vrpn_Configure.h. Also, made projects - compile in both debug and release versions. - -2002-03-20 Aron Helser <helser@cs.unc.edu> - - * test_gen_rpc.dsp: Standardized settings, object files and - executable live in ../../pc_win32/util/gen_rpc/Debug - -2001-11-20 Aron Helser <helser@cs.unc.edu> - - * gen_vrpn_rpc.pl (emitHandler): Changed generated variable names - to allow "p" and "me" in user code. - -2001-03-02 Aron Helser <helser@cs.unc.edu> - - * gen_vrpn_rpc.pl (outputGrammar): Changes USE_MSG_GROUP so it - will handle filenames with paths. - -2001-03-01 Aron Helser <helser@cs.unc.edu> - - * gen_vrpn_rpc.pl: new. Perl script. Generates vrpn rpc .C and .h - files from message lists or def files. - - * main_test.C: new. Tests rpn generation - * rpc_Test_Remote.hdef: new. Test rpc generation - * rpc_Test_Remote.Cdef: new. Test rpc generation - - diff --git a/src/vrpn/util/gen_rpc/gen_vrpn_rpc.pl b/src/vrpn/util/gen_rpc/gen_vrpn_rpc.pl deleted file mode 100644 index 84ea6f553e4ab073d54465c500048d2f042ba5d0..0000000000000000000000000000000000000000 --- a/src/vrpn/util/gen_rpc/gen_vrpn_rpc.pl +++ /dev/null @@ -1,1703 +0,0 @@ -#! /bin/perl -w -#/*===3rdtech=== -# Copyright (c) 2000 by 3rdTech, Inc. -# All Rights Reserved. -# -# This file may not be distributed without the permission of -# 3rdTech, Inc. -# ===3rdtech===*/ -#use strict; - -# Parse vrpn message definitions to a "list of lists" parse tree -# and then print them out, or pass to the next section. - -# The grammar defined below should make it obvious what is legal - -# basically messages with a list of parameters. - -# Any variable length arrays should have their length included earlier -# in the parameter list (obviously), but this is not checked for. - -# A message can have only one structure included, and it must be -# the last parameter, and it must be an array (otherwise, you'd just -# use a normal list of parameters, right?). - -# "pretty print" the parse tree, so the ARRAYs don't show. -# Mostly borrowed from "demo_parsetree.pl" distributed with -# the RecDescent module. -sub printtree -{ - if (defined($_[1])) { - if (!ref($_[1]) ) { - print " " x $_[0]; - print "$_[1]:\n"; - foreach ( @_[2..$#_] ) - { - if (ref($_)) { print " " x $_[0], "$_\n"; printtree($_[0]+1,@$_); } - else { print " " x $_[0], "$_\n" } - } - print "\n"; - } else { - foreach ( @_[1..$#_] ) { - #print "."; - if (ref($_)) { print " " x $_[0], "$_\n"; printtree($_[0],@$_); } - else { print " " x $_[0], "$_\n" } - } - } - } -} - -# Literal print of the parse tree, showing position of all ARRAYs -# Most useful for writing code to interpret the parse tree. -sub printtree2 -{ - if (defined($_[1])) { - foreach ( @_[1..$#_] ) { - #print "."; - if (ref($_)) { print " " x $_[0], "$_\n"; printtree2($_[0]+1,@$_); } - else { print " " x $_[0], "$_\n" } - } - } -} - -# Package that produces the parse tree. -# At UNC, perl in /contrib/bin has this package installed. -# Otherwise, go to www.cpan.org and download it. -# unpack, run "perl Makefile.pl" "make" "make install" to install it. -use Parse::RecDescent; - -#$::RD_HINT = 1; # turn on hints about problems/errors. -#$::RD_TRACE = 1; # turn on very verbose debugging - -# This rule forms a "list of lists" parse tree automatically from -# the grammar. -# One funky thing - any rule with a (?), (s) or (s?) returns an array ref, -# which has a member for each time the rule matched. If it didn't match at -# all, the array is empty. -$RD_AUTOACTION = q{ [@item] }; - -$grammar = -q{ - start: msg_group msg_prefix(?) defines(s?) line(s) - - msg_group: /MESSAGE_GROUP/ /(\w)+/ - - # Prefix is used for the identifying string when registering - # a message type with VRPN. For compatibility with legacy - # stream files, mostly. - msg_prefix: /MESSAGE_PREFIX/ /".*"/ - - # Define is for fixed counts used in message definitions. - # No checks are made later to see if a fixed count is defined, though. - defines: /DEFINE/ /[A-Z][A-Z0-9_]+/ /[^\n]*\n/ - - line: /VRPN_MESSAGE/ typeName /{/ structOrField /}/ -# | /[^\n]*\n/ - - typeName: /(\w)+/ - - structOrField: - field(s) structDefinition - | field(s?) - - structDefinition: - /struct/ structTypeName /{/ - field(s) - /}/ structName count - # Note that count is required - must be an array. - - structName: - /(\w)+/ - - structTypeName: - /(\w)+/ - - field: - /(\w)+/ /(\w)+/ fixedCount(s?) variableCount(s?) <reject: $item[1] eq "struct"> - # Reject directive is necessary, otherwise field rule will - # gobble "struct typename" and leave { ... } - - count: - fixedCount - | variableCount - - # One kind is not allowed - mixed case that starts with a CAP - fixedCount: - /\[/ /(\d)+/ /\]/ # fixed, numeric count - | /\[/ /[A-Z][A-Z0-9_]+/ /\]/ # fixed, all caps and "_" #defined count - - variableCount: - /\[/ /[a-z](\w)+/ /\]/ # variable count, starts with lower case. - -}; -$definitionParser = $definitionParser; -$definitionParser = new Parse::RecDescent ($grammar); -#$definitionInput = ""; -# Get rid of the autoaction so we don't interfere with other grammars -$RD_AUTOACTION = ""; - -# Parse tree is not generated until requested by second grammar below. - -# VERY USEFUL view of the parse tree, shows how the grammar -# above is made into a parse tree for a particular set of messages. -#printtree2(0,@$tree) if $tree; - -sub parseMsgDefFile ($) -{ - my $msg_def_file = $_[0]; - if ($msg_def_file !~ /.*\.vrpndef$/) { - $msg_def_file .= ".vrpndef"; - } - my $definitionInput = ""; - my $line = ""; - print "//Message definitions from file " . $msg_def_file . "\n"; - open(DEFHANDLE, "< " . $msg_def_file ) || - die "Couldn't open vrpn msg definition file ". $msg_def_file ; - while (defined($line = <DEFHANDLE>)) { - #chomp $line; - $line =~ s#//.*$##; # remove comments - $definitionInput .= $line if $line !~ /^\s*$/; # return if not white-space - } - close(DEFHANDLE); - - # Remove /* */ comments - non-greedy "*?" regexp, - # global replace "g" on the string including newlines "s". - $definitionInput =~ s#/\*.*?\*/##gs; - - my $tree = $::definitionParser->start($definitionInput); - if (!$tree) { - die "Unable to parse vrpn rpc msg definition file ". $msg_def_file ; - } - - # VERY USEFUL view of the parse tree, shows how the grammar - # above is made into a parse tree for a particular set of messages. - #printtree2(0,@$tree) if $tree; - - # Get a reference to the list of messages from the parse tree - my $tmp_msgs = @$tree[4]; - # Get a reference to the (possibly empty) list of defines, too. - my $tmp_defines = @$tree[3]; - # Get a reference to the (possibly empty) msg prefix, too. - my $tmp_msg_prefix = ""; - if (defined(@$tree[2]->[0])) { - $tmp_msg_prefix = @$tree[2]->[0]->[2]; - $tmp_msg_prefix =~ tr/\"//d; - #print STDOUT "Prefix found: $tmp_msg_prefix \n"; - } - - # Global hash to contain msg group names and the parse tree generated. - $::msg_trees{@$tree[1]->[2]} = $tmp_msgs; - $::msg_trees{@$tree[1]->[2] . "_defines"} = $tmp_defines; - $::msg_trees{@$tree[1]->[2] . "_msg_prefix"} = $tmp_msg_prefix; - $::most_recent_tree = @$tree[1]->[2]; -} - -#-------------------------------------------------------------- -# This section uses the parse tree generated above to -# output various C++ function declarations and definitions. - -# If set, function declarations and definitions are C++ style using -# the specified className. -$className = ""; -$classPrefix = ""; - -# If headerFlag is 1, emit functions will only emit declarations -$headerFlag = 0; - - -# Emit the parameter list, for encoder, decoder, receiver fcns. -sub emitParamList ($;$$) { - my $fieldarray = $_[0]; - my $varPrefix = $_[1]; - my $pointerFlag = 0; - if ($_[2]) { $pointerFlag = $_[2] }; - foreach $thisarg (@$fieldarray) { - print " "; - my $vartype = @$thisarg[1]; - my $varname = @$thisarg[2]; - - if (($vartype ne "char") && ($vartype ne "timeval")) { - print "vrpn_"; - } - # print the type. - print $vartype . " " ; - - if ($pointerFlag) { - # Print a "*" for each dimension of an array. - if (defined(@$thisarg[3]->[0])|| - defined(@$thisarg[4]->[0])) { - print "*" x ($#{@$thisarg[4]} + $#{@$thisarg[3]} + 2); - } - } else { - # Find out if we have a variable array - if (defined(@$thisarg[4]->[0])) { - # print one star for each dimension - print "*" x ($#{@$thisarg[4]} +1); - } - } - print "". ($varPrefix ? "(":"") . $varPrefix . $varname - . ($varPrefix ? ")":"") ; - if (!$pointerFlag) { - # NOTE: for some reason these declarations cause problems. - # C++ compiler complains about passing in an array instead of pointer. - # Find out if we have a fixed array - if (defined(@$thisarg[3]->[0])) { - # print the fixed array spec - foreach $dim (@{@$thisarg[3]}) { - print @$dim[1..3]; - } - } - } - # Skip comma on last parameter - if ($thisarg != @$fieldarray[$#$fieldarray]) { - print ","; - } - - print "\n"; - } - # On to the special case - an array has a variable count which - # is not specified in one of the other args - it must be passed - # in separately. So add it to the param list. - foreach $thisarg (@$fieldarray) { - # Check for variable count(s) - if (defined(@$thisarg[4]->[0])) { - foreach (@{@$thisarg[4]}) { - my $countvar = @$_[2]; -# print STDOUT $countvar . " "; - my $foundit = 0; - foreach $morearg (@$fieldarray) { -# print STDOUT @$morearg[2] . " "; - $foundit = 1 if ($countvar eq @$morearg[2]); - } -# print STDOUT "\n"; - # If we didn't find it, add it to the arg list. - # NOTE force to vrpn_int32 - is this the right thing? - if (!$foundit) { - print " , vrpn_int32 " . ($varPrefix ? "(":"") - . $varPrefix . $countvar . ($varPrefix ? ")":"") ."\n" ; - } - } - } - } - -} - -# Emits a function to decode the named type into network form. -# Returns 0, or -1 on error. -# -# int myClass::decode_foo (const char * buffer, ...) { -# if (!buffer || ...) return -1; -# vrpn_unbuffer(&buffer, ...); -# return 0; -# } -# However, a message that includes a structure needs two decoders, -# one for the simple parameters, and another to be called in a loop -# to decode the structure parameters. -sub emitDecoders ($) { - my $msgarray = $_[0]; - # Array contains (line VRPN_MESSAGE (typeName InContactMode) { ... } - # Extract the value of typeName and the arg list array (...) - my $typeName = @$msgarray[2]->[1]; - my $fieldarray = @$msgarray[4]->[1]; - my $structarray = []; my $structfieldarray = []; - # If this message contains a struct array, do more complicated things. - if (defined(@$msgarray[4]->[2])) { - $structarray = @$msgarray[4]->[2]; - $structfieldarray = @$structarray[4]; - } - - # Structure requires two decode functions, for header and struct body. - if ($#$structarray >= 0) { - if ( $#$fieldarray <0) { - # We have a struct with no fields before it - - # the struct must be repeated a const number of times - # in the message. Just emit the decode_X_body - emitDecoderFromFields($structfieldarray, $typeName , "_body"); - } else { - # Emit decoder for both header and struct body. - # handler will call _body from inside appropriate loop. - emitDecoderFromFields($fieldarray, $typeName , "_header"); - emitDecoderFromFields($structfieldarray, $typeName , "_body"); - } - return 1; - } - # If the message has no fields, no decode function is needed. - if ( $#$fieldarray <0) { - print "// decode_$typeName not needed - empty message.\n"; - return 1; - } - # Emit decoder for a message that doesn't contain a structure. - emitDecoderFromFields($fieldarray, $typeName , ""); - 1; -}; - -# Emits a decoder from an array of fields and a typename. Appends -# the namePostfix to the end of the function name. -sub emitDecoderFromFields ($$;$) { - my $fieldarray = $_[0]; - my $typeName = $_[1]; - my $namePostfix = ""; - if ($_[2]) { $namePostfix = $_[2]; } - - # Emit function declaration / parameter list - if ($headerFlag) { print " "; } - print "int " . ($headerFlag ? "" : $classPrefix) - . "decode_${typeName}${namePostfix} (\n"; - print " const char ** buffer,\n"; - - # Loop over parameter list - emitParamList($fieldarray, "*", 0); - - if ($headerFlag) { print " "; } - print ")"; - # If this is just a declaration, we are done. - if ($headerFlag) { print ";\n"; return 1; } - print " {\n"; - - # Emit function body - - # Emit test for non-NULL - print " if (!buffer"; - foreach $thisarg (@$fieldarray) { - my $varname = @$thisarg[2]; - print "\n || !" . $varname; - } - print ") return -1;\n"; - - # OK, tough stuff: unbuffer each entry. - foreach $thisarg (@$fieldarray) { - my $vartype = @$thisarg[1]; - my $varname = @$thisarg[2]; - - my $vardim = $#{@$thisarg[3]} +1 + $#{@$thisarg[4]} +1; - if ($vartype eq "char") { $vardim -= 1; } - - if ($vardim > 0) { - # We have an array. - my $prefix = " "; - my $dimcount = $vardim; - # appending lists like this means we do fixed arrays first. - my @countlist = ( @{@$thisarg[3]} , @{@$thisarg[4]}); - my $charcount; - if ($vartype eq "char") { - # Last array dimension handled by "vrpn_unbuffer" for char - $charcount = $countlist[$#countlist]; - @countlist = @countlist[0..($#countlist-1)]; - } - #print @countlist, "\n"; - foreach ( @countlist) { - my $countvar = @$_[2]; - # variable count arrays require memory allocation. - if (@$_[0] eq "variableCount") { - # De-reference the parameter passed in. - print $prefix . "(*$varname)"; - for ($i = $vardim; $i >$dimcount ; $i--) { - print "[lv_$i]"; - } - print " = new " . ((($vartype eq "char") || ($vartype eq "timeval")) ? "" : "vrpn_") - . $vartype . " "; - print "*" x ($vartype eq "char" ? $dimcount : $dimcount -1); - print " [".(@$_[0] eq "variableCount" ? "*":"") . @$_[2] . "];\n"; - } - print $prefix . "for (int lv_${dimcount} = 0" . - "; lv_${dimcount} < ". - (@$_[0] eq "variableCount" ? "*":"")."$countvar ". - "; lv_${dimcount}++ ) {\n"; - $dimcount -= 1; - $prefix = $prefix . " "; - } - if ($vartype eq "char") { - # If a variable length character string, allocate space. - if (@$charcount[0] eq "variableCount" ) { - print $prefix . "(*$varname)"; - for ($i = $vardim; $i >0 ; $i--) { - print "[lv_$i]"; - } - print " = new char[" .(@$charcount[0] eq "variableCount" ? "*":"") - . @$charcount[2] . "];\n"; - } - } - print $prefix . "if (vrpn_unbuffer(buffer, "; - if ($vartype ne "char") { - print "&("; - } - print "(*$varname)"; - for ($i = $vardim; $i >0 ; $i--) { - print "[lv_$i]"; - } - if ($vartype ne "char") { - print ")"; - } - if ($vartype eq "char") { - print ", " .(@$charcount[0] eq "variableCount" ? "*":"") - . @$charcount[2] ; - } - print ")) return -1;\n"; - for ($i = $vardim; $i >0 ; $i--) { - print " " x $i; - print "}\n"; - } - - } else { - # Normal variable, might be character array. - if ($vartype eq "char") { - # If a variable length character string, allocate space. - if (defined(@$thisarg[4]->[0])) { - print " *" . $varname . " = new char[" - . (@$thisarg[4]->[0]->[0] eq "variableCount" ? "*":"") - . @$thisarg[4]->[0]->[2] . "];\n"; - } - } - print " if (vrpn_unbuffer(buffer, "; - if ($vartype eq "char") { - print "*" ; - } - print $varname; - if ($vartype eq "char") { - print ", " ; - my $vardim = 0; - # Print fixed or variable array count - if (defined(@$thisarg[3]->[0])) { - print "" . (@$thisarg[3]->[0]->[0] eq "variableCount" ? "*":"") - . @$thisarg[3]->[0]->[2]; - } elsif (defined(@$thisarg[4]->[0])) { - print "" . (@$thisarg[4]->[0]->[0] eq "variableCount" ? "*":"") - . @$thisarg[4]->[0]->[2]; - } - } - print ")) return -1;\n"; - } - } - - print " return 0;\n"; - print "}\n"; - print "\n"; - - 1; -}; - -# Given a field list, emit a sum of sizeof() calls. -# Handle multi-dimensional arrays, too. -sub emitFieldSizes ($) -{ - my $fieldarray = $_[0]; - print "("; - foreach $thisarg (@$fieldarray) { - my $vartype = @$thisarg[1]; - my $varname = @$thisarg[2]; - my $vardim = $#{@$thisarg[3]} +1 + $#{@$thisarg[4]} +1; - - print "sizeof(" . ((($vartype eq "char") || ($vartype eq "timeval")) ? "" : "vrpn_") . $vartype . ")"; - if ($vardim > 0) { - my @countlist = ( @{@$thisarg[3]} , @{@$thisarg[4]}); - foreach ( @countlist) { - my $countvar = @$_[2]; - print " * " . $countvar; - } - } - if ($thisarg != @$fieldarray[$#$fieldarray]) { - print " + "; - } - } - print ")"; - 1; -}; - -# Given a list of fields, emit a "vrpn_buffer" call for each one. -# Handle arrays by emitting a "for" loop to buffer each element. -sub emitBufferList ($) -{ - my $fieldarray = $_[0]; - foreach $thisarg (@$fieldarray) { - my $vartype = @$thisarg[1]; - my $varname = @$thisarg[2]; - - my $vardim = $#{@$thisarg[3]} +1 + $#{@$thisarg[4]} +1; - if ($vartype eq "char") { $vardim -= 1; } - - if ($vardim > 0) { - # We have an array. - my $prefix = " "; - my $dimcount = $vardim; - # appending lists like this means we do fixed arrays first. - my @countlist = ( @{@$thisarg[3]} , @{@$thisarg[4]}); - my $charcount; - if ($vartype eq "char") { - # Last array dimension handled by "vrpn_buffer" for char - $charcount = $countlist[$#countlist]; - @countlist = @countlist[0..($#countlist-1)]; - } - #print @countlist, "\n"; - foreach ( @countlist) { - my $countvar = @$_[2]; - print $prefix . "for (int lv_${dimcount} = 0" . - "; lv_${dimcount} < $countvar" . - "; lv_${dimcount}++ ) {\n"; - $dimcount -= 1; - $prefix = $prefix . " "; - } - print $prefix . "vrpn_buffer(mptr, mlen, "; - print $varname; - for ($i = $vardim; $i >0 ; $i--) { - print "[lv_" . $i . "]"; - } - if ($vartype eq "char") { - print ", " . @$charcount[2] ; - } - print ");\n"; - for ($i = $vardim; $i >0 ; $i--) { - print " " x ($i+1); - print "}\n"; - } - - } else { - # Normal variable, might be character array. - print " vrpn_buffer(mptr, mlen, "; - print $varname; - if ($vartype eq "char") { - print ", " ; - # Print fixed or variable array count - if (defined(@$thisarg[3]->[0])) { - print @$thisarg[3]->[0]->[2]; - } elsif (defined(@$thisarg[4]->[0])) { - print @$thisarg[4]->[0]->[2]; - } - } - print ");\n"; - } - } - 1; -}; - -# Emits a function to encode the named type into network form. -# Returns a buffer which it is the caller's responsibility to -# delete []. Places the length of the buffer in the parameter -# len. -# -# char * myClass::encode_foo (int * len, ...) { -# char * msgbuf = NULL; -# char * mptr; -# int mlen; -# if (!len) return NULL; -# *len = sizeof(...); -# msgbuf = new char [*len]; -# if (!msgbuf) { -# fprintf(stderr, "encode_foo: Out of memory.\n"); -# *len = 0; -# } else { -# mptr = msgbuf; -# mlen = *len; -# vrpn_buffer(&mptr, &mlen, ...); -# } -# return msgbuf; -# } -# However, a message that includes a structure needs two encoders, -# one for the simple parameters, and another to be called in a loop -# to encode the structure parameters. -sub emitEncoders ($) { - my $msgarray = $_[0]; - # Array contains (line VRPN_MESSAGE (typeName InContactMode) { ... } - # Extract the value of typeName and the arg list array (...) - my $typeName = @$msgarray[2]->[1]; - my $fieldarray = @$msgarray[4]->[1]; - my $structarray = []; my $structfieldarray = []; - # If this message contains a struct array, do more complicated things. - if (defined(@$msgarray[4]->[2])) { - $structarray = @$msgarray[4]->[2]; - $structfieldarray = @$structarray[4]; - } - # Structure requires two encode functions, for header and struct body. - if ($#$structarray >= 0) { - if ( $#$fieldarray <0) { - # We have a struct with no fields before it - - # the struct must be repeated a const number of times - # in the message. Just emit the encode_X_body - emitBodyEncoderFromFields($structfieldarray, $typeName, "_body"); - } else { - # Emit encoder for both header and struct body. - # handler will call _body from inside appropriate loop. - emitEncoderFromFields($fieldarray, $typeName, - $structarray, "_header"); - emitBodyEncoderFromFields($structfieldarray, $typeName, "_body"); - } - return 1; - } - # If the message has no fields, no encode function is needed. - if ( $#$fieldarray <0) { - print "// encode_$typeName not needed - empty message.\n"; - return 1; - } - # Emit encoder for a message that doesn't contain a structure. - emitEncoderFromFields($fieldarray, $typeName , $structfieldarray, ""); - 1; -}; - -# Emits a encoder from an array of fields and a typename. Appends -# the optional namePostfix to the end of the function name. -# If the structure array parameter is not empty, emit the -# encoder for the non-struct parameters in the message, -# and include extra parameters so the incomplete encoding can be tracked. -sub emitEncoderFromFields ($$$;$) { - my $fieldarray = $_[0]; - my $typeName = $_[1]; - my $structarray = $_[2]; my $structfieldarray = []; - my $structCount = 0; - my $namePostfix = $_[3]; - if ($#$structarray >= 0) { - $structfieldarray = @$structarray[4]; - $structCount = @$structarray[7]->[1]->[2]; - } - - # function declaration / parameter list - - if ($headerFlag) { print " "; } - print "char * " . ($headerFlag ? "" : $classPrefix) - . "encode_${typeName}${namePostfix} (\n"; - print " int * len,\n"; - # Return vars with our encoding progress if there's a struct. - if ($#$structarray >= 0) { - print " char ** mptr, int* mlen,\n"; - } - emitParamList($fieldarray, "", 0); - - if ($headerFlag) { print " "; } - print ")"; - # If this is just a declaration, we are done. - if ($headerFlag) { print ";\n"; return 1; } - print " {\n"; - - # Emit function body - - print " char * msgbuf = NULL;\n"; - if ($#$structarray < 0) { - print " char *mptr[1];\n"; - print " int temp; int* mlen = &temp;\n"; - } - print " if (!len) return NULL;\n"; - - # figure out size of message by adding up types of every entry. - - print " *len =\n "; - emitFieldSizes($fieldarray); - if ($#$structarray >= 0) { - print "\n+ "; - emitFieldSizes($structfieldarray); - print " * " . $structCount ; - } - print ";\n"; - - print " msgbuf = new char [*len];\n" - . " if (!msgbuf) {\n" - . " fprintf(stderr, \"encode_${typeName}${namePostfix}: " . - "Out of memory.\\n\");\n" - . " *len = 0;\n" - . " } else {\n" - . " *mptr = msgbuf;\n" - . " *mlen = *len;\n"; - - # OK, tough stuff: buffer each entry. - # Need to handle nested loops! - - emitBufferList($fieldarray); - - print " }\n"; - print " return msgbuf;\n"; - print "}\n"; - print "\n"; - - 1; -}; - -# Emits a encoder for a structure body from an array of fields and a -# typename. Appends the optional namePostfix to the end of the -# function name. -# Pass in the existing buffer, progress pointer, and length. -# This function keeps track of encoding progress by returning a -# char pointer and length in extra parameters. -sub emitBodyEncoderFromFields ($$;$) { - my $fieldarray = $_[0]; - my $typeName = $_[1]; - my $namePostfix = $_[2]; - - # function declaration / parameter list - if ($headerFlag) { print " "; } - print "char * " . ($headerFlag ? "" : $classPrefix) - . "encode_${typeName}${namePostfix} (\n"; - print " int * len, char * msgbuf, char ** mptr, int *mlen, \n"; - - emitParamList($fieldarray, "", 0); - - if ($headerFlag) { print " "; } - print ")"; - # If this is just a declaration, we are done. - if ($headerFlag) { print ";\n"; return 1; } - print " {\n"; - - # Emit function body - - print " if (!len || !msgbuf || !mptr || !mlen) return NULL;\n"; - - # OK, tough stuff: buffer each entry. - emitBufferList($fieldarray); - - print " return msgbuf;\n"; - print "}\n"; - print "\n"; - - 1; -}; - -# Variable declarations for handler. -sub emitVarDecl ($) { - my $thisarg = $_[0]; - - my $vartype = @$thisarg[1]; - my $varname = @$thisarg[2]; - - if (($vartype ne "char") && ($vartype ne "timeval")) { - print "vrpn_"; - } - # print the type. - print $vartype . " "; - # Find out if we have a variable array - if (defined(@$thisarg[4]->[0])) { - # print one star for each dimension - print "*" x ($#{@$thisarg[4]} +1); - } - print $varname; - # Find out if we have a fixed array - if (defined(@$thisarg[3]->[0])) { - # print the fixed array spec - foreach $dim (@{@$thisarg[3]}) { - print @$dim[1..3]; - } - } - - print ";\n"; - - -} - -# Emit an arg list for calling an encode, decode or receive fcn. -sub emitArgList ($;$) -{ - my $fieldarray = $_[0]; - my $varPrefix = ""; - if ($_[1]) { $varPrefix = $_[1]; } - foreach $thisarg (@$fieldarray) { - my $vartype = @$thisarg[1]; - my $varname = @$thisarg[2]; - # Array params DON'T need cast. -# if (defined(@$thisarg[3]->[0]) || -# defined(@$thisarg[4]->[0])) { -# print "(" .((($vartype eq "char") || ($vartype eq "timeval")) ? "" : "vrpn_") . "$vartype "; -# # One star for each dimension, plus one extra. -# print "*" x ($#{@$thisarg[4]} + $#{@$thisarg[3]} + 3); -# print ")"; -# } - print $varPrefix . $varname ; - if ($thisarg != @$fieldarray[$#$fieldarray]) { - print ", "; - } - } - # On to the special case - an array has a variable count which - # is not specified in one of the other args - it must be passed - # in separately. So add it to the arg list. - foreach $thisarg (@$fieldarray) { - # Check for variable count(s) - if (defined(@$thisarg[4]->[0])) { - foreach (@{@$thisarg[4]}) { - my $countvar = @$_[2]; - my $foundit = 0; - foreach $morearg (@$fieldarray) { - $foundit = 1 if ($countvar eq @$morearg[2]); - } - # If we didn't find it, add it to the arg list. - if (!$foundit) { - print ", " . $varPrefix . $countvar ; - } - } - } - } -} - -# Emit a call to decode_TYPE, then rcv_TYPE, for a particular message -# namePostix modifies the function names so they are right for structs. -# prefix is spacing for pretty-printing. -sub emitDecodeRcvCall ($$$$) -{ - my $fieldarray = $_[0]; - my $typeName = $_[1]; - my $namePostfix = $_[2]; - my $prefix = $_[3]; - # Call decode/Rcv for simple arg lists and first part of struct msg - # Only decode if there are args to decode. - if (defined(@$fieldarray[0])) { - print $prefix. "decode_${typeName}${namePostfix} ( &buffer, "; - emitArgList($fieldarray, "&"); - print " );\n"; - } - - print $prefix. "Rcv${typeName}${namePostfix} ( "; - emitArgList($fieldarray); - print " );\n"; - # Delete allocated memory for var length arrays. - foreach $thisarg (@$fieldarray) { - my $vartype = @$thisarg[1]; - my $varname = @$thisarg[2]; - # Variable arrays get dynamic memory deleted. - if (defined(@$thisarg[4]->[0])) { - my $vardim = $#{@$thisarg[3]} +1 + $#{@$thisarg[4]} +1; - my $prefix = " "; - # appending lists like this means we do fixed arrays first. - my @countlist = ( @{@$thisarg[3]} , @{@$thisarg[4]}); - # Last array dimension handled by delete [] - @countlist = @countlist[0..($#countlist-1)]; - $vardim -= 1; - my $dimcount = $vardim; - foreach ( @countlist) { - my $countvar = @$_[2]; - print $prefix . "for (int lv_${dimcount} = 0" . - "; lv_${dimcount} < $countvar ". - "; lv_${dimcount}++ ) {\n"; - $dimcount -= 1; - $prefix = $prefix . " "; - } - print $prefix . "delete [] " . $varname; - for ($i = $vardim; $i >0 ; $i--) { - print "[lv_$i]"; - } - print ";\n"; - - $dimcount = 1; - foreach ( reverse @countlist) { - # Chop two spaces off prefix. - $prefix =~ s/(.*) $/$1/; - print $prefix . "}\n"; - if (@$_[0] eq "variableCount") { - print $prefix . "delete [] " . $varname; - for ($i = $vardim; $i >$dimcount ; $i--) { - print "[lv_$i]"; - } - print ";\n"; - } - $dimcount += 1; - } - - } - } - -} - -# Emits a function that unmarshalls (see decode_foo) onto the stack -# then call a Rcv function. Rcv function will contain user code. -# Simple case looks roughly like this: -#//static -#int nmm_Microscope_Remote::handle_InScanlineMode (void *userdata, -# vrpn_HANDLERPARAM param) { -# nmm_Microscope_Remote * ms = (nmm_Microscope_Remote *) userdata; -# vrpn_int32 enabled; -# -# ms->decode_InScanlineMode(¶m.buffer, &enabled); -# ms->RcvInScanlineMode(enabled); -# -# return 0; -#} - -# Structure case adds a loop to the calls: -# me->decode_ReportScanDatasets_header( &count ); -# me->RcvReportScanDatasets_header( count ); -# for (int lv_1 = 0; lv_1 < count; lv_1++) { -# me->decode_ReportScanDatasets_body( &name, &units, &offset, &scale ); -# me->RcvReportScanDatasets_body( name, units, offset, scale ); -# } - -sub emitHandler ($) { - my $msgarray = $_[0]; - # Array contains (line VRPN_MESSAGE (typeName InContactMode) { ... } - # Extract the value of typeName and the arg list array (...) - my $typeName = @$msgarray[2]->[1]; - my $fieldarray = @$msgarray[4]->[1]; - my $structarray = []; my $structfieldarray = []; - # If this message contains a struct array, do more complicated things. - if (defined(@$msgarray[4]->[2])) { - $structarray = @$msgarray[4]->[2]; - $structfieldarray = @$structarray[4]; - } - # Emit function declaration / parameter list - - - print "" . ($headerFlag ? " static ": "\n"); - print "int " . ($headerFlag ? "VRPN_CALLBACK " : $classPrefix) - . "handle_${typeName} (void * userdata, vrpn_HANDLERPARAM grpc_p)"; - - # If this is just a declaration, we are done. - if ($headerFlag) { print ";\n"; return 1; } - - print " {\n"; - if (($#$fieldarray >= 0)||($#$structarray >= 0)) { - print " const char * buffer = grpc_p.buffer;\n"; - } - if ((defined($className)) && ($className ne "")) { - print " " . $className . "* grpc_me = (" . $className . " *) userdata;\n"; - } - foreach $thisarg (@$fieldarray) { - print " "; - emitVarDecl( $thisarg ); - } - if ($#$structarray >= 0) { - foreach $structarg ( @$structfieldarray) { - print " "; - emitVarDecl( $structarg ); - } - } - - print "\n"; - - # Emit function body - - my $prefix = " "; - if ((defined($className)) && ($className ne "")) { - $prefix .= "grpc_me->"; - } - - if ($#$structarray < 0) { - emitDecodeRcvCall ($fieldarray, $typeName, "", $prefix); - } else { - emitDecodeRcvCall ($fieldarray, $typeName, "_header", $prefix); - # Call decode_header/Rcv_header loop { decode_body/Rcv_body } - # for messages that end in structure arrays. - print " for (int lv_1 = 0; lv_1 < " . - @$structarray[7]->[1]->[2] . "; lv_1++) {\n"; - emitDecodeRcvCall ($structfieldarray, $typeName, "_body", " " . $prefix); - print " }\n"; - } - - print " return 0;\n"; - print "}\n"; - - 1; -}; - -# Emits a function to receive the msg type -# and either print all the fields, or expect user code to follow. -# -# void myClass::receive_foo (vrpn_int32 bar, ...) { -# OR -# void myClass::receive_foo (vrpn_int32 bar, ...) { -# print ("msg foo, bar = %d, ...", bar, ...); -# } -# However, a message that includes a structure needs two receivers, -# one for the simple parameters, and another to be called in a loop -# to receive the structure parameters. -sub emitReceivers ($;$$) { - my $msgarray = $_[0]; - my $namePostfix = ""; - if ($_[1]) { $namePostfix = $_[1]; } - my $printParams = 1; - if (defined($_[2])) { $printParams = $_[2]; } - # Array contains (line VRPN_MESSAGE (typeName InContactMode) { ... } - # Extract the value of typeName and the arg list array (...) - my $typeName = @$msgarray[2]->[1]; - my $fieldarray = @$msgarray[4]->[1]; - my $structarray = []; my $structfieldarray = []; - # If this message contains a struct array, do more complicated things. - if (defined(@$msgarray[4]->[2])) { - $structarray = @$msgarray[4]->[2]; - $structfieldarray = @$structarray[4]; - } - # Structure requires two receive functions, for header and struct body. - if ($#$structarray >= 0) { - # Figure out which to emit from - if($namePostfix eq "_body") { - emitReceiverFromFields($structfieldarray, $typeName, "_body", 1, $printParams); - } elsif($namePostfix eq "_header") { - emitReceiverFromFields($fieldarray, $typeName, "_header", 0, $printParams); - } else { - if ( $#$fieldarray <0) { - # We have a struct with no fields before it - - # the struct must be repeated a const number of times - # in the message. Just emit the receive_X_body - emitReceiverFromFields($structfieldarray, $typeName, "_body", 1, $printParams); - } else { - print "Probable error, two incomplete rcv fcns emitted\n" if (!$printParams) ; - # Emit receiver for both header and struct body. - # handler will call _body from inside appropriate loop. - emitReceiverFromFields($fieldarray, $typeName, "_header", 0, $printParams); - emitReceiverFromFields($structfieldarray, $typeName, "_body", 1, $printParams); - } - } - return 1; - } - # Emit receiver for a message that doesn't contain a structure. - emitReceiverFromFields($fieldarray, $typeName , "", 0, $printParams); - 1; -}; - -# Emits a receiver from an array of fields and a typename. Appends -# the namePostfix to the end of the function name. -sub emitReceiverFromFields ($$;$$$) { - my $fieldarray = $_[0]; - my $typeName = $_[1]; - my $namePostfix = ""; - if ($_[2]) { $namePostfix = $_[2]; } - my $structFlag = 0; - if ($_[3]) { $structFlag = $_[3]; } - my $printParams = 1; - if (defined($_[4])) { $printParams = $_[4]; } - - # Emit function declaration / parameter list - if ($headerFlag) { print " "; } - print "void " . ($headerFlag ? "" : $classPrefix) - . "Rcv${typeName}${namePostfix} (\n"; - - # Loop over parameter list - emitParamList($fieldarray, "", 0); - - if ($headerFlag) { print " "; } - print ")"; - # If this is just a declaration, we are done. - if ($headerFlag) { print ";\n"; return 1; } - print " {\n"; - - # If we are not going to print the parameters, we are done - user - # code must follow - if (!$printParams) { return 1; } - - # Otherwise, Emit function body - - if ($structFlag) { - print " printf(\" struct $typeName: \"); \n"; - } else { - print " printf(\"MSG $typeName: \"); \n"; - } - foreach $thisarg (@$fieldarray) { - my $vartype = @$thisarg[1]; - my $varname = @$thisarg[2]; - - my $vardim = $#{@$thisarg[3]} +1 + $#{@$thisarg[4]} +1; - if ($vartype eq "char") { $vardim -= 1; } - - if ($vardim > 0) { - # We have an array. - my $prefix = " "; - my $dimcount = $vardim; - # appending lists like this means we do fixed arrays first. - my @countlist = ( @{@$thisarg[3]} , @{@$thisarg[4]}); - my $charcount; - if ($vartype eq "char") { - # Last array dimension handled by "vrpn_unbuffer" for char - $charcount = $countlist[$#countlist]; - @countlist = @countlist[0..($#countlist-1)]; - } - #print @countlist, "\n"; - print " printf(\"" . $varname . " = \");\n"; - foreach ( @countlist) { - print $prefix . "printf(\"(\");\n"; - my $countvar = @$_[2]; - print $prefix . "for (int lv_${dimcount} = 0" . - "; lv_${dimcount} < $countvar" . - "; lv_${dimcount}++ ) {\n"; - $dimcount -= 1; - $prefix = $prefix . " "; - } - print $prefix . " printf(\""; - if ($vartype eq "char") { - print "%s" ; - } elsif ($vartype eq "int32") { - print "%d" ; - } elsif ($vartype eq "float32") { - print "%g" ; - } - print ", \", " . $varname; - for ($i = $vardim; $i >0 ; $i--) { - print "[lv_" . $i . "]"; - } - print " );\n"; - for ($i = $vardim; $i >0 ; $i--) { - print " " x $i ; - print "}\n"; - print " " x $i ; - print q{printf(")");} . "\n"; - } - } else { - # Normal variable, might be character array. - print " printf(\"" . $varname . " = "; - if ($vartype eq "char") { - print "%s" ; - } elsif ($vartype eq "int32") { - print "%d" ; - } elsif ($vartype eq "float32") { - print "%g" ; - } - # Last parameter - if ($thisarg != @$fieldarray[$#$fieldarray]) { - print ", "; - } - print "\", $varname );\n"; - } - } - print -q{ printf("\n"); - return ; -\} - -}; - - 1; -}; - - -sub emitMsgType ($;$) -{ - my $msgarray = $_[0]; - # optional string arg can replace the class name in the - # message identifier string passed to VRPN - my $msg_string_prefix = ""; - if (defined($_[1])) { - $msg_string_prefix = $_[1]; - } - # Array contains (line VRPN_MESSAGE (typeName InContactMode) { ... } - # Extract the value of typeName and the arg list array (...) - my $typeName = @$msgarray[2]->[1]; -# print STDOUT "$typeName, $msg_string_prefix\n"; - if ($headerFlag) { - print " vrpn_int32 d_" . $typeName . "_type;\n"; - } else { - print " d_" . $typeName . "_type = connection->register_message_type\n" - . " (\"" . ($msg_string_prefix ? "$msg_string_prefix" : - ($className ? "$className ": "")) - . "$typeName\");\n" - } - 1; -} - -sub emitRegister ($) -{ - my $msgarray = $_[0]; - my $typeName = @$msgarray[2]->[1]; - if ($headerFlag) { - print " Register " . $typeName . "called in header ????\n"; - } else { - print " connection->register_handler(d_" . $typeName . "_type,\n" - . " handle_" .$typeName . ",\n" - . " " . ($className eq "" ? "NULL" : "this") . ");\n" - } - 1; -} - -#-------------------------------------------------------------- -# Emit the encode/decode/handlers at the right time from -# a pattern file. -sub emitWriteWarning -{ - print "//Warning: this file automatically generated using" . - " the command line\n" ; - print "// ", $0, " ", join (' ',@ARGV), "\n"; - print "//DO NOT EDIT! Edit the source file instead.\n"; - 1; -} - -sub emitBaseClassHeader ($) -{ - local $className = $_[0]; - local $classPrefix = $className . "::"; - - my $caps_class = $className; - $caps_class =~ tr/[a-z]/[A-Z]/; - print "#ifndef " . $caps_class . "_H\n"; - print "#define " . $caps_class . "_H\n"; - emitWriteWarning(); -# print "//Base class file generated with BASECLASS ". $_[0] . -# " directive.\n\n"; - print -q{ -/*===3rdtech=== - Copyright (c) 2001 by 3rdTech, Inc. - All Rights Reserved. - - This file may not be distributed without the permission of - 3rdTech, Inc. - ===3rdtech===*/ - -#include <vrpn_Connection.h> - -} ; - - emitAllDefines($className); - - print "\n\nclass $className \n{\n"; - print " public:\n\n"; - print " $className" . - " (vrpn_Connection * = NULL);\n" . - " // Constructor.\n"; - - print " virtual ~$className (void);\n" . - " // Destructor. HP compiler doesn't like it with '= 0;'\n\n"; - emitAllMsgType($className ); - print "\n\n"; - emitAllEnDecoders($className ); - print "};\n"; - print "#endif // ${caps_class}_H\n"; -} - -sub emitBaseClassCode ($) -{ - local $className = $_[0]; - local $classPrefix = $className . "::"; - - my $caps_class = $className; - $caps_class =~ tr/[a-z]/[A-Z]/; - emitWriteWarning(); -# print "//Base class file generated with BASECLASS ". $_[0] . -# " directive.\n\n"; - print -q{ -/*===3rdtech=== - Copyright (c) 2001 by 3rdTech, Inc. - All Rights Reserved. - - This file may not be distributed without the permission of - 3rdTech, Inc. - ===3rdtech===*/ - -#include <vrpn_Connection.h> -} ; - print "#include \"${className}.h\"\n\n"; - print $classPrefix . $className . " (\n" . - " vrpn_Connection * connection)\n" . - "{\n"; - - print " if (connection) {\n"; - - emitAllMsgType($className ); - print "\n }\n}\n\n"; - - print $classPrefix . "~" . $className . " (void) { }\n\n"; - emitAllEnDecoders($className ); -} - -# Create header or C file for a base class. -# Base class registers message types, and includes encoders/decoders. -sub writeBaseClassFiles (;$) -{ - my $group_name; - if (defined($_[0])) { - $most_recent_tree = $_[0]; - } - # Warning: we are opening and selecting a new file for output. - # Must go back to old file at end of function. - my $filehandle = select(); - open (BASEOUTF, ">" . $most_recent_tree . ($headerFlag ? ".h" : ".C")) or - die "Can't open base class output file"; - select(BASEOUTF); - if ($headerFlag) { - emitBaseClassHeader ($most_recent_tree); - } else { - emitBaseClassCode ($most_recent_tree); - } - close (BASEOUTF); - - # Go back to old file now. - select($filehandle); - print STDOUT "Output ". $most_recent_tree . ($headerFlag ? ".h" : ".C") - . " base class file.\n"; - 1; -} - -sub emitAllDefines(;$) -{ - if ($_[0]) { - $most_recent_tree = $_[0]; - } - # This is different - we use a different key to get define list. - foreach ( @{$msg_trees{$most_recent_tree . "_defines"}}) { - my $definearray = $_; -# print STDOUT $definearray, "\n"; - my $defineName = @$definearray[2]; - my $defineVal = @$definearray[3]; - - print "#define ${defineName} ${defineVal}\n"; - } - 1; -} - -sub emitAllHandlers (;$) -{ - if ($_[0]) { - $most_recent_tree = $_[0]; - } - foreach ( @{$msg_trees{$most_recent_tree}}) { - #print $_ , "\n"; - emitHandler $_; - } - 1; -} - -sub emitAllMsgType (;$$) -{ - if ($_[0]) { - $most_recent_tree = $_[0]; - } - # Second arg is optional string to use - # when registering message types with the VRPN connection - # Get msg string prefix from the grammar - it's "" if not included - my $msg_string_prefix = $msg_trees{$most_recent_tree . "_msg_prefix"}; - if ($_[1]) { - # Let command line over-ride - $msg_string_prefix = $_[1]; - } - foreach ( @{$msg_trees{$most_recent_tree}}) { - if($msg_string_prefix) { - emitMsgType($_, $msg_string_prefix); - } else { - emitMsgType($_); - } - } - 1; -} - -sub emitAllRegister (;$) -{ - if ($_[0]) { - $most_recent_tree = $_[0]; - } - foreach ( @{$msg_trees{$most_recent_tree}}) { - emitRegister $_; - } - 1; -} - -sub emitAllReceivers (;$) -{ - if ($_[0]) { - $most_recent_tree = $_[0]; - } - foreach ( @{$msg_trees{$most_recent_tree}}) { - emitReceivers ($_); - } - 1; -} - -sub emitSingleReceiver ($;$$) -{ - my $msg_type = $_[0]; - my $namePostfix = ""; - if ($_[1]) { - $namePostfix = $_[1]; - } - if ($_[2]) { - $most_recent_tree = $_[2]; - } - my $found = 0; - foreach ( @{$msg_trees{$most_recent_tree}}) { - #print STDOUT @$_[2]->[1] , "\n"; - if ($msg_type eq @$_[2]->[1]) { - $found = 1; - emitReceivers($_, $namePostfix, 0); - last; - } - } - if (!$found) { - print STDOUT "Warning: Message $msg_type not found in message " - . "group $most_recent_tree\n"; - } - 1; -} - -sub emitAllEnDecoders (;$) -{ - if ($_[0]) { - $most_recent_tree = $_[0]; - } - foreach ( @{$msg_trees{$most_recent_tree}}) { - emitEncoders $_; - emitDecoders $_; - } - 1; -} - -# outputGrammar: -# Parses C++ source files for directives to insert code fragments. -# Recognized directives: -# CLASSNAME <class name> -# Subsequent functions definitions should be prefixed with <class name>:: -# NO CLASS -# Cancels a CLASSNAME directive -# ENCODE <type name> -# Inserts a code fragment for a function -# char * encode_<type name> (int * len, ...) -# Allocates and returns a pointer to a character buffer holding -# the marshalled message; returns the length of the message in -# len. Components of the message are passed as the "..." arguments; -# arrays should be passed as pointers. -# DECODE <type name> -# Inserts a code fragment for a function -# int decode_<type name> (const char * buffer, ...) -# Unpacks the buffer into its components, which should be passed -# as pointers. All arrays, whether fixed or variable-sized, -# will be allocated on the heap and returned in pointers. -# HANDLE <type name> -# ... -# } -# Inserts a code fragment for a function -# int handle_<type name> (void * userdata, vrpn_HANDLERPARAM p) -# Declares the message's components on the stack and unpacks the -# buffer into them. Then falls through into the user code -# indicated by "..." and terminated by "}". -# REGISTER <type name> -# Generates the following fragment: -# vrpn_int32 <type name>_type; -# <type name>_type = connection->register_message_type("<type name>"); -# connection->register_handler("<type name>", handle_<type name>, -# NULL); -# BUGS: Does not allow specification of the userdata pointer (forces -# it to NULL) or other parameters. - - -$outputGrammar = -q{ - - start: outfilename line(s) - - outfilename: - /OUTPUT_FILENAME/ /(\S)+/ - { - # Filename is not just word characters, but any non-space characters. - $::outputFileName = $item[2]; - open (FH, ">" . $item[2]) || die "Can't open output file"; - select(FH); - ::emitWriteWarning(); - } - line: - # Order is important - _decl must come first or it won't be matched. - msggroup - | classname - | defines - | endecoders_decl - | endecoders - | handlers_decl - | handlers - | receivers_decl - | receivers - | receive_msg_header - | receive_msg_body - | receive_msg - | register - | msg_type_decl - | msg_type - | /[^\n]*\n/ - { # Print anything we don't recognize directly to the output file. - print " " x (1 + $prevcolumn - length($item[1])); - print $item[1]; } - - msggroup: - /USE_MSG_GROUP/ /(\S)+/ - { - ::parseMsgDefFile($item[2]); - } - - classname: - /CLASSNAME/ className - { $::className = $item[2]; - $::classPrefix = $item[2] . "::"; } - | /NO CLASS/ - { $::className = ""; - $::classPrefix = ""; } - -# prototype: -# /DECLARE STRUCTURES/ messageName -# { ::emitStructures ($item[2]); } - - defines: - /DEFINES/ optGroupName - { $::headerFlag = 0; - ::emitAllDefines ($item[2]); } - - endecoders: - /ENDECODERS/ optGroupName - { $::headerFlag = 0; - ::emitAllEnDecoders ($item[2]); } - - endecoders_decl: - /ENDECODERS_DECL/ optGroupName - { $::headerFlag = 1; - ::emitAllEnDecoders ($item[2]); } - - handlers: - /HANDLERS/ optGroupName - { $::headerFlag = 0; - ::emitAllHandlers($item[2]); } - - handlers_decl: - /HANDLERS_DECL/ optGroupName - { $::headerFlag = 1; - ::emitAllHandlers($item[2]); } - - receivers: - /RECEIVERS/ optGroupName - { $::headerFlag = 0; - ::emitAllReceivers($item[2]); } - - receive_msg_header: - /RECEIVE_MSG_HEADER/ messageName optGroupName - { $::headerFlag = 0; - ::emitSingleReceiver($item[2], "_header", $item[3]); } - - receive_msg_body: - /RECEIVE_MSG_BODY/ messageName optGroupName - { $::headerFlag = 0; - ::emitSingleReceiver($item[2], "_body", $item[3]); } - - receive_msg: - /RECEIVE_MSG/ messageName optGroupName - { $::headerFlag = 0; - ::emitSingleReceiver($item[2], "", $item[3]); } - - receivers_decl: - /RECEIVERS_DECL/ optGroupName - { $::headerFlag = 1; - ::emitAllReceivers($item[2]); } - - register: - /REGISTER/ optGroupName - { $::headerFlag = 0; - ::emitAllRegister ($item[2]); } - - msg_type: - /MSG_TYPE/ /".*"/ optGroupName - { $::headerFlag = 0; - $item[2] =~ tr/\"//d; - ::emitAllMsgType ($item[3], $item[2] ); } - | /MSG_TYPE/ optGroupName - { $::headerFlag = 0; - ::emitAllMsgType ($item[2]); } - - msg_type_decl: - /MSG_TYPE_DECL/ optGroupName - { $::headerFlag = 1; - ::emitAllMsgType ($item[2]); } - - groupName: - /(\w)+/ - { $return = $item[1]; } - - optGroupName: - # Group name is optional - just uses previous if blank. - /(\w)+/ /[;\{]/ - { $return = $item[1]; } - | /[;\{]/ - { $return = ""; } - - className: - /(\w)+/ - { $return = $item[1]; } - - messageName: - /(\w)+/ - { $return = $item[1]; } - - optionalVariableName: - /(\w)+/ /;/ - { $return = $item[1]; } - | /;/ - { $return = "NULL"; } -}; - -$outputParser = new Parse::RecDescent ($outputGrammar); - -#$::RD_HINT = 1; # turn on verbose debugging -#$::RD_TRACE = 1; # turn on verbose debugging - -#-------------------------------------------------------------- -# Do the actual work. -$outputInput = ""; -$outputFileName = ""; -$base_c_flag = 0; -$base_h_flag = 0; -$msg_def_file = ""; -$spec_file = ""; -process_args(); - -if ($base_h_flag) { - # Create a base-class header. - $headerFlag = 1; - parseMsgDefFile($msg_def_file); - writeBaseClassFiles(); -} -if ($base_c_flag) { - # Create a base-class C. - $headerFlag = 0; - parseMsgDefFile($msg_def_file); - writeBaseClassFiles(); -} - -if ($spec_file) { - $headerFlag = 0; - open(FH, "< " . $spec_file); - while (<FH>) { - $outputInput .= $_; - }; - close(FH); - - # Parse the file, and output modified file using grammar - # $outputParser->start returns undef if it can't parse the file. - if(defined( $outputParser->start($outputInput))) { - # Close the file that was opened by the grammar. - close(FH); - print STDOUT "Parsed " .$spec_file . " and output ". $outputFileName . "\n"; - exit 0; - } else { - die "Unable to parse the input file " . $spec_file . "\n"; - } -} - -#---------------------------------------------------------------------------- -sub process_args { - $verbose = 1; #$debugging = 0; - my @myargv = @ARGV; - while (@myargv) { - $a = shift @myargv; - if (($a eq "-c")||($a eq "-C")) { - $base_c_flag = 1; - $msg_def_file = shift @myargv ; - } elsif ($a eq "-h") { - $base_h_flag = 1; - $msg_def_file = shift @myargv ; - } elsif ($a eq "-q") { - $verbose = 0; - } else { - $spec_file = $a; - } - } - if (!$spec_file && !$base_c_flag && !$base_h_flag) { - print "No files specified, no output produced\n"; - Usage(); - } - if ($base_c_flag && !(-e $msg_def_file)) { - print "Non-existent message definition file specified with -c option\n."; - Usage(); - } - if ($base_h_flag && !(-e $msg_def_file)) { - print "Non-existent message definition file specified with -h option\n."; - Usage(); - } - if ($spec_file && !(-e $spec_file)) { - print "Non-existent input file specified \n."; - Usage(); - } -} - -#---------------------------------------------------------------------------- -sub Usage { - print STDERR <<"_EOT_"; - -Usage: gen_vrpn_rpc <options> - where options are: - -c <msg def file> : Output a base class C file from a msg def file - -h <msg def file> : Output a base class header file from a msg def file - <code file> : file with vrpn_rpc directives to be translated - -Generally, specify only one of the options to output one file. -_EOT_ - exit(1); -} diff --git a/src/vrpn/util/gen_rpc/main_test.C b/src/vrpn/util/gen_rpc/main_test.C deleted file mode 100644 index b36fad6ddbeec543c52b5fb39a7f7b6340a52c5a..0000000000000000000000000000000000000000 --- a/src/vrpn/util/gen_rpc/main_test.C +++ /dev/null @@ -1,124 +0,0 @@ -#include <stdio.h> // for NULL, printf, sprintf -#include <vrpn_Connection.h> // for vrpn_Connection, etc -#include <vrpn_Shared.h> // for vrpn_gettimeofday, timeval - -#include "rpc_Test.h" // for rpc_Test, NAME_LENGTH -#include "rpc_Test_Remote.h" // for rpc_Test_Remote -#include "vrpn_Types.h" // for vrpn_int32, vrpn_float32 - -int main (int argc, char ** argv) { - - vrpn_Connection * connection; - - connection = vrpn_create_server_connection(4999); - - int myID = connection->register_sender("rpc_Test"); - - rpc_Test_Remote * nmTR = new rpc_Test_Remote(connection); - - rpc_Test * enc_out = new rpc_Test(connection); - - connection->mainloop(); - - struct timeval now; - char * buf = NULL; - vrpn_int32 len = 0; - vrpn_gettimeofday(&now, NULL); - printf("Expect Empty\n"); - connection->pack_message(len, now, enc_out->d_Empty_type, myID, - (char *) buf, vrpn_CONNECTION_RELIABLE); - connection->mainloop(); - - buf = enc_out->encode_Simple(&len, 2, 1.85f, 3.23f); - vrpn_gettimeofday(&now, NULL); - printf("Expect Simple, 2, 1.85, 3.23\n"); - connection->pack_message(len, now, enc_out->d_Simple_type, myID, - (char *) buf, vrpn_CONNECTION_RELIABLE); - delete [] buf; buf = NULL; - connection->mainloop(); - - const vrpn_int32 cnt = 3; - char nm[NAME_LENGTH] = "Jones"; - char nm2[cnt]= "nM"; - char doublenm[4][NAME_LENGTH] = {"one", "two", "three", "four"}; - int i; - -// char *p_to_char[4]= {"one", "two", "three", "four"}; -// char (*arr_of_p)[4] ; -// printf ("size %d %d\n", sizeof(p_to_char), sizeof(arr_of_p)); - - char **triplenm[4]; //char **(*p_t)[4] = &triplenm; - for (i =0; i<4; i++) { - triplenm[i] = new char *[cnt]; - for (int j=0; j< cnt; j++) { - triplenm[i][j] = new char[cnt]; - sprintf (triplenm[i][j], "%c%c", (char)((int)'a' + i), - (char)((int)'j' + j)); - } - } -// char triplenm[4][cnt][cnt] = { {"aa", "ab", "ac" } , -// {"ba", "bb", "bc" } , -// {"ca", "cb", "cc" } , -// {"da", "db", "dc" } }; - buf = enc_out->encode_CharArray(&len, cnt, nm, nm2, - doublenm, triplenm); - vrpn_gettimeofday(&now, NULL); - printf("Expect CharArray ...\n"); - connection->pack_message(len, now, enc_out->d_CharArray_type, myID, - (char *) buf, vrpn_CONNECTION_RELIABLE); - delete [] buf; buf = NULL; - connection->mainloop(); - - // vrpn_int32 cnt; - vrpn_int32 shortstuff[] = {1,2,3}; - vrpn_int32 constdouble[6][4]; - vrpn_int32 *triple[4][NAME_LENGTH]; - for ( i =0; i<6; i++) { - for (int j=0; j< 4; j++) { - constdouble[i][j] = i+j; - } - } - for ( i =0; i<4; i++) { - for (int j=0; j< NAME_LENGTH; j++) { - triple[i][j] = new vrpn_int32[cnt]; - for (int k=0; k< cnt; k++) { - triple[i][j][k] = i+j+k; - } - } - } - - buf = enc_out->encode_IntArray(&len, cnt, &(shortstuff[0]), - constdouble, triple); - vrpn_gettimeofday(&now, NULL); - printf("Expect IntArray ...\n"); - connection->pack_message(len, now, enc_out->d_IntArray_type, myID, - (char *) buf, vrpn_CONNECTION_RELIABLE); - delete [] buf; buf = NULL; - connection->mainloop(); - - - vrpn_int32 count = 3; - char name[64] = "Z Piezo"; - char units[64]= "nm"; - vrpn_float32 offset = 1.3f; - vrpn_float32 scale = 0.025f; - - char * mptr; int mlen; - buf = enc_out->encode_ReportScanDatasets_header ( &len, &mptr, &mlen, count ); - for (int lv_1 = 0; lv_1 < count; lv_1++) { - enc_out->encode_ReportScanDatasets_body ( &len, buf, &mptr, &mlen, - name, units, offset, scale ); - offset *= 2; - scale *=3; - } - - vrpn_gettimeofday(&now, NULL); - printf("Expect ReportScanDatasets ...\n"); - connection->pack_message(len, now, enc_out->d_ReportScanDatasets_type, myID, - (char *) buf, vrpn_CONNECTION_RELIABLE); - delete [] buf; buf = NULL; - connection->mainloop(); - - return 0; -} - diff --git a/src/vrpn/util/gen_rpc/rpc_Test.vrpndef b/src/vrpn/util/gen_rpc/rpc_Test.vrpndef deleted file mode 100644 index 20706f6c3cc1707b2af71cf2002cbeb3d369edcb..0000000000000000000000000000000000000000 --- a/src/vrpn/util/gen_rpc/rpc_Test.vrpndef +++ /dev/null @@ -1,52 +0,0 @@ -/* This is a group of test message definitions, - used in the test suite for vrpn RPC generator. -*/ - -// MESSAGE_GROUP must come first, before any VRPN_MESSAGE directives. -MESSAGE_GROUP rpc_Test - -DEFINE NAME_LENGTH 16 - -// Empty message -VRPN_MESSAGE Empty { -} - -VRPN_MESSAGE Simple { - int32 num - float32 P - float32 setpoint -} - -/* Another comment */ -VRPN_MESSAGE CharArray { - int32 cnt - char nm [NAME_LENGTH] - char nm2 [cnt] - char doublenm [4][NAME_LENGTH] - char triplenm [4][cnt][cnt] -} - -VRPN_MESSAGE IntArray { - int32 cnt - int32 shortstuff [cnt] - int32 constdouble [6][4] - int32 triple [4][NAME_LENGTH][cnt] -} - -VRPN_MESSAGE WindowLineData { - int32 reports - int32 fields - float32 data [reports][fields] -} - -VRPN_MESSAGE ReportScanDatasets { - int32 count - struct ScanDataset { - char name [64] - char units [64] - float32 offset - float32 scale - } datasets [count] -} - - diff --git a/src/vrpn/util/gen_rpc/rpc_Test_Remote.Cdef b/src/vrpn/util/gen_rpc/rpc_Test_Remote.Cdef deleted file mode 100644 index 6e74f823500cab223768a39b72f7bcdad4de1eef..0000000000000000000000000000000000000000 --- a/src/vrpn/util/gen_rpc/rpc_Test_Remote.Cdef +++ /dev/null @@ -1,34 +0,0 @@ -OUTPUT_FILENAME rpc_Test_Remote.C -/*===3rdtech=== - Copyright (c) 2001 by 3rdTech, Inc. - All Rights Reserved. - - This file may not be distributed without the permission of - 3rdTech, Inc. - ===3rdtech===*/ -#include <stdio.h> -#include <vrpn_Connection.h> -#include "rpc_Test_Remote.h" - -USE_MSG_GROUP rpc_Test - -CLASSNAME rpc_Test_Remote - -rpc_Test_Remote::rpc_Test_Remote ( - vrpn_Connection * connection) : - rpc_Test(connection), - d_connection(connection) -{ - if (!d_connection) { - return; - } - REGISTER rpc_Test; -} - -rpc_Test_Remote::~rpc_Test_Remote () { } - -RECEIVERS rpc_Test; - -HANDLERS rpc_Test; - -NO CLASS diff --git a/src/vrpn/util/gen_rpc/rpc_Test_Remote.hdef b/src/vrpn/util/gen_rpc/rpc_Test_Remote.hdef deleted file mode 100644 index 69dc6cb2a8c66f3e1427835ff599dd29d6399e02..0000000000000000000000000000000000000000 --- a/src/vrpn/util/gen_rpc/rpc_Test_Remote.hdef +++ /dev/null @@ -1,37 +0,0 @@ -OUTPUT_FILENAME rpc_Test_Remote.h -#ifndef NM_TEST_REMOTE_H -#define NM_TEST_REMOTE_H -/*===3rdtech=== - Copyright (c) 2001 by 3rdTech, Inc. - All Rights Reserved. - - This file may not be distributed without the permission of - 3rdTech, Inc. - ===3rdtech===*/ -USE_MSG_GROUP rpc_Test - -CLASSNAME rpc_Test_Remote - -#include <vrpn_Connection.h> -#include "rpc_Test.h" - -class rpc_Test_Remote : protected rpc_Test -{ -private: - vrpn_Connection * d_connection; - -public: - rpc_Test_Remote(vrpn_Connection *); - - ~rpc_Test_Remote(); - - //virtual int mainloop(); - -RECEIVERS_DECL rpc_Test; -HANDLERS_DECL rpc_Test; - -}; - -NO CLASS - -#endif diff --git a/src/vrpn/util/gen_rpc/test_gen_rpc.dsp b/src/vrpn/util/gen_rpc/test_gen_rpc.dsp deleted file mode 100644 index 1446661a1c55f910b7ca0bd2bccf3a6c970a76a0..0000000000000000000000000000000000000000 --- a/src/vrpn/util/gen_rpc/test_gen_rpc.dsp +++ /dev/null @@ -1,202 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_gen_rpc" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_gen_rpc - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_gen_rpc.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_gen_rpc.mak" CFG="test_gen_rpc - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_gen_rpc - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "test_gen_rpc - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_gen_rpc - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../../pc_win32/util/test_gen_rpc/Debug" -# PROP Intermediate_Dir "../../pc_win32/util/test_gen_rpc/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../.." /D "_CONSOLE" /D "_DEBUG" /D "_MBCS" /D "WIN32" /FR /YX /FD /GZ /TP /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Debug" /libpath:"../pc_win32/DLL/Debug" - -!ELSEIF "$(CFG)" == "test_gen_rpc - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../../pc_win32/util/test_gen_rpc/Release" -# PROP Intermediate_Dir "../../pc_win32/util/test_gen_rpc/Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../.." /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32" /D "$(VRPN_COMPILE_DEF)" /YX /FD /GZ /TP /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../.." /D "_CONSOLE" /D "NDEBUG" /D "_MBCS" /D "WIN32" /YX /FD /TP /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../pc_win32/Release" /libpath:"../pc_win32/DLL/Release" - -!ENDIF - -# Begin Target - -# Name "test_gen_rpc - Win32 Debug" -# Name "test_gen_rpc - Win32 Release" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\main_test.C -# End Source File -# Begin Source File - -SOURCE=.\rpc_Test.C -# End Source File -# Begin Source File - -SOURCE=.\rpc_Test_Remote.C -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Source File - -SOURCE=.\rpc_Test.vrpndef - -!IF "$(CFG)" == "test_gen_rpc - Win32 Debug" - -# Begin Custom Build -InputPath=.\rpc_Test.vrpndef - -BuildCmds= \ - E:\cygwin\bin\perl.exe gen_vrpn_rpc.pl -h rpc_Test.vrpndef \ - E:\cygwin\bin\perl.exe gen_vrpn_rpc.pl -c rpc_Test.vrpndef \ - - -"rpc_Test.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"rpc_Test.C" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "test_gen_rpc - Win32 Release" - -# Begin Custom Build -InputPath=.\rpc_Test.vrpndef - -BuildCmds= \ - C:\cygwin\bin\perl.exe gen_vrpn_rpc.pl -h rpc_Test.vrpndef \ - C:\cygwin\bin\perl.exe gen_vrpn_rpc.pl -c rpc_Test.vrpndef \ - - -"rpc_Test.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"rpc_Test.C" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\rpc_Test_Remote.Cdef - -!IF "$(CFG)" == "test_gen_rpc - Win32 Debug" - -# Begin Custom Build -InputPath=.\rpc_Test_Remote.Cdef - -"rpc_Test_Remote.C" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - E:\cygwin\bin\perl.exe gen_vrpn_rpc.pl rpc_Test_Remote.Cdef - -# End Custom Build - -!ELSEIF "$(CFG)" == "test_gen_rpc - Win32 Release" - -# Begin Custom Build -InputPath=.\rpc_Test_Remote.Cdef - -"rpc_Test_Remote.C" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - C:\cygwin\bin\perl.exe gen_vrpn_rpc.pl rpc_Test_Remote.Cdef - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\rpc_Test_Remote.hdef - -!IF "$(CFG)" == "test_gen_rpc - Win32 Debug" - -# Begin Custom Build -InputPath=.\rpc_Test_Remote.hdef - -"rpc_Test_Remote.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - E:\cygwin\bin\perl.exe gen_vrpn_rpc.pl rpc_Test_Remote.hdef - -# End Custom Build - -!ELSEIF "$(CFG)" == "test_gen_rpc - Win32 Release" - -# Begin Custom Build -InputPath=.\rpc_Test_Remote.hdef - -"rpc_Test_Remote.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - C:\cygwin\bin\perl.exe gen_vrpn_rpc.pl rpc_Test_Remote.hdef - -# End Custom Build - -!ENDIF - -# End Source File -# End Target -# End Project diff --git a/src/vrpn/util/gen_rpc/test_gen_rpc.vcproj b/src/vrpn/util/gen_rpc/test_gen_rpc.vcproj deleted file mode 100644 index f865053aacb70ca052d2c289d049d989c7eb18ae..0000000000000000000000000000000000000000 --- a/src/vrpn/util/gen_rpc/test_gen_rpc.vcproj +++ /dev/null @@ -1,355 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="test_gen_rpc" - ProjectGUID="{5A5C3F75-C370-4620-8068-4CEDEB89F035}" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\../../pc_win32/util/test_gen_rpc/Debug" - IntermediateDirectory=".\../../pc_win32/util/test_gen_rpc/Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../../pc_win32/util/test_gen_rpc/Debug/test_gen_rpc.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,../.." - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\../../pc_win32/util/test_gen_rpc/Debug/test_gen_rpc.pch" - AssemblerListingLocation=".\../../pc_win32/util/test_gen_rpc/Debug/" - ObjectFile=".\../../pc_win32/util/test_gen_rpc/Debug/" - ProgramDataBaseFileName=".\../../pc_win32/util/test_gen_rpc/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../../pc_win32/util/test_gen_rpc/Debug/test_gen_rpc.exe" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Lib,../pc_win32/Debug,../pc_win32/DLL/Debug" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../../pc_win32/util/test_gen_rpc/Debug/test_gen_rpc.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../../pc_win32/util/test_gen_rpc/Debug/test_gen_rpc.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\../../pc_win32/util/test_gen_rpc/Release" - IntermediateDirectory=".\../../pc_win32/util/test_gen_rpc/Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - TypeLibraryName=".\../../pc_win32/util/test_gen_rpc/Release/test_gen_rpc.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Include,../.." - PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\../../pc_win32/util/test_gen_rpc/Release/test_gen_rpc.pch" - AssemblerListingLocation=".\../../pc_win32/util/test_gen_rpc/Release/" - ObjectFile=".\../../pc_win32/util/test_gen_rpc/Release/" - ProgramDataBaseFileName=".\../../pc_win32/util/test_gen_rpc/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - OutputFile=".\../../pc_win32/util/test_gen_rpc/Release/test_gen_rpc.exe" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK\Lib,../pc_win32/Release,../pc_win32/DLL/Release" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\../../pc_win32/util/test_gen_rpc/Release/test_gen_rpc.pdb" - SubSystem="1" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\../../pc_win32/util/test_gen_rpc/Release/test_gen_rpc.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="main_test.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="rpc_Test.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="rpc_Test_Remote.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - </Filter> - <File - RelativePath="rpc_Test.vrpndef" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(SYSTEMDRIVE)\cygwin\bin\perl.exe gen_vrpn_rpc.pl -h rpc_Test.vrpndef
$(SYSTEMDRIVE)\cygwin\bin\perl.exe gen_vrpn_rpc.pl -c rpc_Test.vrpndef
" - Outputs="rpc_Test.h;rpc_Test.C" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(SYSTEMDRIVE)\cygwin\bin\perl.exe gen_vrpn_rpc.pl -h rpc_Test.vrpndef
$(SYSTEMDRIVE)\cygwin\bin\perl.exe gen_vrpn_rpc.pl -c rpc_Test.vrpndef
" - Outputs="rpc_Test.h;rpc_Test.C" - /> - </FileConfiguration> - </File> - <File - RelativePath="rpc_Test_Remote.Cdef" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(SYSTEMDRIVE)\cygwin\bin\perl.exe gen_vrpn_rpc.pl rpc_Test_Remote.Cdef
" - Outputs="rpc_Test_Remote.C" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(SYSTEMDRIVE)\cygwin\bin\perl.exe gen_vrpn_rpc.pl rpc_Test_Remote.Cdef
" - Outputs="rpc_Test_Remote.C" - /> - </FileConfiguration> - </File> - <File - RelativePath="rpc_Test_Remote.hdef" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(SYSTEMDRIVE)\cygwin\bin\perl.exe gen_vrpn_rpc.pl rpc_Test_Remote.hdef
" - Outputs="rpc_Test_Remote.h" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(SYSTEMDRIVE)\cygwin\bin\perl.exe gen_vrpn_rpc.pl rpc_Test_Remote.hdef
" - Outputs="rpc_Test_Remote.h" - /> - </FileConfiguration> - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/util/iwyu-mapping.imp b/src/vrpn/util/iwyu-mapping.imp deleted file mode 100644 index 752516ee3e69be9c22504a2cdcb0b308b608f1f8..0000000000000000000000000000000000000000 --- a/src/vrpn/util/iwyu-mapping.imp +++ /dev/null @@ -1,4 +0,0 @@ -[ - { symbol: [ "timeval", private, "\"vrpn_Shared.h\"", public ] }, - { include: ["@\".+vrpn_Configure.h\"", private, "\"vrpn_Configure.h\"", public ] } -] diff --git a/src/vrpn/util/listSharedCode.sh b/src/vrpn/util/listSharedCode.sh deleted file mode 100755 index 33b4d992f5f85e399741bf5888cce7743637444d..0000000000000000000000000000000000000000 --- a/src/vrpn/util/listSharedCode.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -e - -# List originally generated by removing some files from the list created by -# find * -name "vrpn*.C" -o -name "vrpn*.h" -o -name "vrpn*.h.cmake_in" | sed 's/[.].*//' |sort |uniq - -filelist=$(cd $(dirname $0) && pwd)/sharedcode.txt - -( -cd $(dirname $0) && cd .. - -# This list is all the modules considered to be "common/shared" and thus -# normalized to a standard formatting -cat $filelist | while read module; do - for ext in C h h.cmake_in; do - if [ -f ${module}.${ext} ]; then - echo "${module}.${ext}" - fi - done -done -) - diff --git a/src/vrpn/util/printStream/CMakeLists.txt b/src/vrpn/util/printStream/CMakeLists.txt deleted file mode 100644 index 7339b25f3e54e1e7e0bba6ffe953a29137b0f260..0000000000000000000000000000000000000000 --- a/src/vrpn/util/printStream/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ - -add_executable(vrpn_streamPrint vrpn_streamPrint.cpp) -target_link_libraries(vrpn_streamPrint ${VRPN_CLIENT_LIBRARY}) - -set_target_properties(vrpn_streamPrint PROPERTIES FOLDER Clients) - -if(VRPN_INSTALL) - install(TARGETS vrpn_streamPrint RUNTIME DESTINATION bin COMPONENT clients) -endif() diff --git a/src/vrpn/util/printStream/ChangeLog b/src/vrpn/util/printStream/ChangeLog deleted file mode 100644 index 5fb16ec33e4df8bc7084e4e0f3bbe4720d043fc1..0000000000000000000000000000000000000000 --- a/src/vrpn/util/printStream/ChangeLog +++ /dev/null @@ -1,10 +0,0 @@ -2006-06-05 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_streamPrint.cpp: added VRPN_CALLBACK in front of - the handler. - -2004-04-13 David Marshburn <marshbur@cs.unc.edu> - - * vrpn_streamPrint.cpp: correctly handles the -head option - - diff --git a/src/vrpn/util/printStream/vrpn_streamPrint.cpp b/src/vrpn/util/printStream/vrpn_streamPrint.cpp deleted file mode 100644 index 3e3b83dfe216f10e36f52b47aa9f13fd9e298b32..0000000000000000000000000000000000000000 --- a/src/vrpn/util/printStream/vrpn_streamPrint.cpp +++ /dev/null @@ -1,152 +0,0 @@ - -#include <stdlib.h> -#include <limits.h> -#include <signal.h> -#include <stdio.h> -#include <string.h> -#include <vrpn_Connection.h> -#include <vrpn_FileConnection.h> - - -// Written 12/18/03 by David Marshburn - -static vrpn_Connection * connection = NULL; -static vrpn_File_Connection *fcon = NULL; - -static char * device_name = NULL; - -static bool doHead = false; -static unsigned long msgs_to_print = ULONG_MAX; - -static bool done = false; - -//-------------------------------------------------------------------------- - -static void handle_cntl_c(int ) -{ - done = true; -} - - -// This handler gets every message, presumably from a stream file -int VRPN_CALLBACK handle_any_print (void * userdata, vrpn_HANDLERPARAM p) -{ - static unsigned long msg_number = 0 ; - if( doHead && ( msg_number > msgs_to_print - 1 ) ) - { return 0; } - vrpn_Connection * c = (vrpn_Connection *) userdata; - struct timeval el; - if(fcon) { - fcon->time_since_connection_open(&el); - } else { - connection->time_since_connection_open(&el); - } - - printf("Msg %lu \"%s\" from \"%s\" time %ld.%ld timestamp %ld.%ld\n", - msg_number++, c->message_type_name(p.type), c->sender_name(p.sender), - static_cast<long>(el.tv_sec), - static_cast<long>(el.tv_usec), - static_cast<long>(p.msg_time.tv_sec), - static_cast<long>(p.msg_time.tv_usec)); - fflush( stdout ); - - if( doHead && ( msgs_to_print - msg_number - 1 <= 0 ) ) - done = true; - - return 0; -} - - -// Argument handling -void usage(char *program_name) -{ - fprintf(stderr, "Error: bad or incomlete arguments.\n"); - fprintf(stderr, "usage: %s -i in-streamfile [-head num-msgs-to-print]\n", program_name); - fflush( stderr ); - exit(-1); -} - - -void parseArguments(int argc, char **argv) -{ - int i; - if( argc < 3 ) usage( argv[0] ); - - for (i = 1; i < argc; i++) - { - if (!strcmp(argv[i], "-i")) - { - if (++i >= argc) usage(argv[0]); - device_name = new char[14 + strlen(argv[i])+1]; - sprintf(device_name,"file://%s", argv[i]); - } - else if( !strcmp( argv[i], "-head" ) ) - { - if (++i >= argc) usage(argv[0]); - if( atoi( argv[i] ) < 0 ) usage( argv[0] ); - msgs_to_print = atoi( argv[i] ); - doHead = true; - } - else - { - usage(argv[0]); - } - } - printf("Device_name is %s\n", device_name); -} - - -int main(int argc, char *argv[]) -{ - parseArguments(argc, argv); - - // Initialize our connections to the things we are going to control. - if (device_name == NULL) { return -1; } - - printf( "device to open: %s\n", device_name ); - - connection = vrpn_get_connection_by_name( device_name ); - if( connection == NULL ) - { - // connection failed. VRPN prints error message. - return -1; - } - - fcon = connection->get_File_Connection(); - if (fcon==NULL) - { - fprintf(stderr, "Error: expected but didn't get file connection\n"); - exit(-1); - } - fcon->set_replay_rate(200.0); - - signal(SIGINT, handle_cntl_c); - - // DEBUG print all messages, incoming and outgoing, - // sent over our VRPN connection. - connection->register_handler(vrpn_ANY_TYPE, handle_any_print, connection); - - while (!done) - { - //------------------------------------------------------------ - // Send/receive message from our vrpn connections. - connection->mainloop(); - //fprintf(stderr, "After mainloop, fcon is doing %d.\n", fcon->doing_okay()); - if (fcon && fcon->eof()) - { - done = true; - connection->unregister_handler(vrpn_ANY_TYPE, handle_any_print, connection); - } - vrpn_SleepMsecs( 10 ); - } - - if (connection) - delete connection; // needed to make stream file write out - if( device_name ) - delete device_name; - - return 0; -} - - - diff --git a/src/vrpn/util/printStream/vrpn_streamPrint.dsp b/src/vrpn/util/printStream/vrpn_streamPrint.dsp deleted file mode 100644 index afd1159e38d139b772d122f7bff5cde72b7dc3db..0000000000000000000000000000000000000000 --- a/src/vrpn/util/printStream/vrpn_streamPrint.dsp +++ /dev/null @@ -1,89 +0,0 @@ -# Microsoft Developer Studio Project File - Name="vrpn_streamPrint" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=vrpn_streamPrint - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "vrpn_streamPrint.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "vrpn_streamPrint.mak" CFG="vrpn_streamPrint - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "vrpn_streamPrint - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "vrpn_streamPrint - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "vrpn_streamPrint - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 vrpn.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"../../pc_win32/Release" - -!ELSEIF "$(CFG)" == "vrpn_streamPrint - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 vrpn.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../pc_win32/Debug" - -!ENDIF - -# Begin Target - -# Name "vrpn_streamPrint - Win32 Release" -# Name "vrpn_streamPrint - Win32 Debug" -# Begin Source File - -SOURCE=.\vrpn_streamPrint.cpp -# End Source File -# End Target -# End Project diff --git a/src/vrpn/util/printStream/vrpn_streamPrint.dsw b/src/vrpn/util/printStream/vrpn_streamPrint.dsw deleted file mode 100644 index 1fda305d3e0bc672c7f180b26ce46eee60377f8c..0000000000000000000000000000000000000000 --- a/src/vrpn/util/printStream/vrpn_streamPrint.dsw +++ /dev/null @@ -1,44 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "vrpn"=..\..\vrpn.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "vrpn_streamPrint"=.\vrpn_streamPrint.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/vrpn/util/sharedcode.txt b/src/vrpn/util/sharedcode.txt deleted file mode 100644 index a8f57136910e342ff265e37396dd20ea2986b2db..0000000000000000000000000000000000000000 --- a/src/vrpn/util/sharedcode.txt +++ /dev/null @@ -1,42 +0,0 @@ -client_src/vrpn_ping -client_src/vrpn_print_devices -client_src/vrpn_print_messages -client_src/vrpn_print_performance -server_src/vrpn -server_src/vrpn_Generic_server_object -vrpn_Analog -vrpn_Analog_Output -vrpn_Auxiliary_Logger -vrpn_BaseClass -vrpn_Button -vrpn_Button_USB -vrpn_Configure -vrpn_Connection -vrpn_ConnectionPtr -vrpn_Dial -vrpn_FileConnection -vrpn_FileController -vrpn_ForceDevice -vrpn_ForceDeviceServer -vrpn_Forwarder -vrpn_ForwarderController -vrpn_HumanInterface -vrpn_Imager -vrpn_Imager_Stream_Buffer -vrpn_Log -vrpn_MainloopContainer -vrpn_MainloopObject -vrpn_MessageMacros -vrpn_Mutex -vrpn_Poser -vrpn_Poser_Analog -vrpn_RedundantTransmission -vrpn_SendTextMessageStreamProxy -vrpn_Serial -vrpn_SerialPort -vrpn_Shared -vrpn_SharedObject -vrpn_Sound -vrpn_Text -vrpn_Tracker -vrpn_Types diff --git a/src/vrpn/vrpn.dsp b/src/vrpn/vrpn.dsp deleted file mode 100644 index 7d12dc3a85b84cf0a2e59504c489270adfc4db7d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn.dsp +++ /dev/null @@ -1,757 +0,0 @@ -# Microsoft Developer Studio Project File - Name="vrpn" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=vrpn - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "vrpn.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "vrpn.mak" CFG="vrpn - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "vrpn - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "vrpn - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "vrpn - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "pc_win32/Release" -# PROP Intermediate_Dir "pc_win32/Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../dtrack" /I "./atmellib" /I "../quat" /I "../isense" /I "../Dtrack" /I "$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include" /I "$(SYSTEMDRIVE)\sdk\cpp" /D "NDEBUG" /D "_LIB" /D "_WINDOWS" /D "_MBCS" /D "WIN32" /D "VRPNDLL_NOEXPORTS" /FR /YX /FD /c /Tp -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "vrpn - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "pc_win32/Debug" -# PROP Intermediate_Dir "pc_win32/Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "./atmellib" /I "../quat" /I "../isense" /I "../Dtrack" /I "$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include" /I "$(SYSTEMDRIVE)\sdk\cpp" /D "_DEBUG" /D "_LIB" /D "_WINDOWS" /D "_MBCS" /D "WIN32" /D "VRPNDLL_NOEXPORTS" /FR /YX /FD /TP /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "vrpn - Win32 Release" -# Name "vrpn - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\vrpn_3DConnexion.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_3DMicroscribe.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_3Space.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_5DT16.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ADBox.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_5dt.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_YEI_3Space.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_Output.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_Radamec_SPI.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_USDigital_A2.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Auxiliary_Logger.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_BaseClass.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Button.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Button_NI_DIO24.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Button_USB.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_CerealBox.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Connection.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Dial.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_DirectXFFJoystick.C - -!IF "$(CFG)" == "vrpn - Win32 Release" - -# ADD CPP /FR - -!ELSEIF "$(CFG)" == "vrpn - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\vrpn_DirectXRumblePad.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Dyna.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Event.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Event_Analog.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Event_Mouse.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_FileConnection.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_FileController.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Flock.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Flock_Parallel.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForceDevice.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForceDeviceServer.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Forwarder.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForwarderController.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_FunctionGenerator.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_GlobalHapticsOrb.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_HumanInterface.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Imager.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Imager_Stream_Buffer.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ImmersionBox.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_inertiamouse.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Joylin.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Joywin32.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Keyboard.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_LamportClock.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Magellan.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Mouse.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Mutex.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_NationalInstruments.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_nikon_controls.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Poser.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Poser_Analog.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Poser_Tek4662.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_raw_sgibox.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_RedundantTransmission.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Serial.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Shared.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_SharedObject.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Sound.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Spaceball.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Text.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tng3.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_CHProducts_Controller_Raw.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_3DMouse.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_AnalogFly.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_ButtonFly.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Crossbow.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_DTrack.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Fastrak.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_isense.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Isotrak.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Liberty.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_MotionNode.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_NDI_Polaris.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_PhaseSpace.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_UNC_Joystick.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_VPJoystick.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Wanda.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Xkeys.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Zaber.C -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\isense\isense.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_3DConnexion.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_3DMicroscribe.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_3Space.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_5DT16.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ADBox.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_YEI_3Space.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_5dt.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_Output.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_Radamec_SPI.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_USDigital_A2.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Auxiliary_Logger.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_BaseClass.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Button.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Button_NI_DIO24.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Button_USB.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_CerealBox.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Configure.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Connection.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Dial.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_DirectXFFJoystick.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_DirectXRumblePad.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Dyna.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Event.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Event_Analog.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Event_Mouse.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_FileConnection.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_FileController.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Flock.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Flock_Parallel.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForceDevice.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForceDeviceServer.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Forwarder.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForwarderController.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_FunctionGenerator.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_GlobalHapticsOrb.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_HashST.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_HumanInterface.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Imager.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Imager_Stream_Buffer.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ImmersionBox.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_inertiamouse.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Joylin.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Joywin32.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Keyboard.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_LamportClock.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Magellan.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Mouse.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Mutex.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_NationalInstruments.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_nikon_controls.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Poser.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Poser_Analog.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Poser_Tek4662.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_raw_sgibox.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_RedundantTransmission.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Serial.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Shared.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_SharedObject.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Sound.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Spaceball.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Text.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tng3.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_CHProducts_Controller_Raw.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_3DMouse.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_AnalogFly.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_ButtonFly.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Crossbow.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_DTrack.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Fastrak.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_isense.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Isotrak.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Liberty.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_MotionNode.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_NDI_Polaris.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_PhaseSpace.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Types.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_UNC_Joystick.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_VPJoystick.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Wanda.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Xkeys.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Zaber.h -# End Source File -# End Group -# End Target -# End Project diff --git a/src/vrpn/vrpn.dsw b/src/vrpn/vrpn.dsw deleted file mode 100644 index ee6a59c096ac8b1d70ddec0069c13f33b2c5efb5..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn.dsw +++ /dev/null @@ -1,566 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "DirectShow_baseclasses"=.\server_src\directshow_video_server\DirectShow_baseclasses.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "client_and_server"=.\server_src\client_and_server.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name quatlib - End Project Dependency - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "clock_drift_estimator"=.\client_src\clock_drift_estimator.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "daq_server"=.\server_src\daq_server.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "directshow_video_server"=.\SERVER_SRC\directshow_video_server\directshow_video_server.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name DirectShow_baseclasses - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "forcedevice_test_client"=.\client_src\forcedevice_test_client.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name quatlib - End Project Dependency - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "make_vrpn_libs_build"=.\make_vrpn_libs_build.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpndll - End Project Dependency -}}} - -############################################################################### - -Project: "printcereal"=.\client_src\printcereal.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "printvals"=.\client_src\printvals.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "quatlib"=..\quat\quatlib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "run_auxiliary_logger"=.\client_src\run_auxiliary_logger.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "sphere_client"=.\client_src\sphere_client.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "test_analogfly"=.\server_src\test_analogfly.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name quatlib - End Project Dependency - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "test_auxiliary_logger"=.\server_src\test_auxiliary_logger.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "test_gen_rpc"=.\UTIL\gen_rpc\test_gen_rpc.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "test_imager"=.\CLIENT_SRC\test_imager.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "test_logging"=.\server_src\test_logging.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "test_radamec_spi"=.\server_src\test_radamec_spi.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "test_vrpn"=.\server_src\test_vrpn.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "test_zaber"=.\client_src\test_zaber.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name quatlib - End Project Dependency - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "testimager_client"=.\client_src\testimager_client.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "testimager_server"=.\server_src\testimager_server.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "time_test"=.\time_test.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "timecode_generator"=.\server_src\timecode_generator_server\timecode_generator.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency -}}} - -############################################################################### - -Project: "tracker_to_poser"=.\CLIENT_SRC\tracker_to_poser.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name quatlib - End Project Dependency - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "vrpn"=.\vrpn.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name quatlib - End Project Dependency -}}} - -############################################################################### - -Project: "vrpn_hid_device_watcher"=.\server_src\vrpn_hid_device_watcher.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "vrpn_phantom"=.\server_src\vrpn_phantom.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "vrpn_print_devices"=.\client_src\vrpn_print_devices.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "vrpn_server"=.\server_src\vrpn_server.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name timecode_generator - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn_phantom - End Project Dependency - Begin Project Dependency - Project_Dep_Name quatlib - End Project Dependency - Begin Project Dependency - Project_Dep_Name make_vrpn_libs_build - End Project Dependency - Begin Project Dependency - Project_Dep_Name vrpn - End Project Dependency -}}} - -############################################################################### - -Project: "vrpndll"=.\vrpndll.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name quatlib - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/vrpn/vrpn.sln b/src/vrpn/vrpn.sln deleted file mode 100644 index 9b1aeba7937b246b550f3831d2ebe3704e66cc29..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn.sln +++ /dev/null @@ -1,498 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{75C9A5FE-75B1-4462-AD62-A03476E1935B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{D0EA1EF6-1E10-4DA1-8CA7-7AB288412650}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{1BEEE31E-C293-4DB6-9790-4EF575747A1D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main_Server", "Main_Server", "{0B1F0287-8AEF-4D18-BF73-466D8ACA18D1}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Other_Servers", "Other_Servers", "{B215CEE5-020A-4F34-88C6-5565792A72FD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client_and_server", "server_src\client_and_server.vcproj", "{E99FB2FA-3281-4DBE-905E-F4C7F4183F09}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {0C16E98C-A372-4E58-990D-EE276B32644E} = {0C16E98C-A372-4E58-990D-EE276B32644E} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clock_drift_estimator", "client_src\clock_drift_estimator.vcproj", "{9B18AC3E-2CA6-425A-9049-228821F3D081}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "daq_server", "server_src\daq_server.vcproj", "{49248084-B6D2-4E33-BA43-BF51953377AC}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "forcedevice_test_client", "client_src\forcedevice_test_client.vcproj", "{91042ED0-E0EC-40E1-9AEB-FD5296EA11A7}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {0C16E98C-A372-4E58-990D-EE276B32644E} = {0C16E98C-A372-4E58-990D-EE276B32644E} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_vrpn_libs_build", "make_vrpn_libs_build.vcproj", "{7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {5F38B32E-B5AE-4316-B15E-9E21D033B1BE} = {5F38B32E-B5AE-4316-B15E-9E21D033B1BE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "printcereal", "client_src\printcereal.vcproj", "{4FC1C71E-8977-438B-AE1D-F1CD7D2C2D03}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "printvals", "client_src\printvals.vcproj", "{A1B0D907-E30D-4CB9-B313-D342AD5CC3E7}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {0C16E98C-A372-4E58-990D-EE276B32644E} = {0C16E98C-A372-4E58-990D-EE276B32644E} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sphere_client", "client_src\sphere_client.vcproj", "{14E21AB6-F3E9-4CA9-BF51-1E9443979B3C}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {0C16E98C-A372-4E58-990D-EE276B32644E} = {0C16E98C-A372-4E58-990D-EE276B32644E} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_analogfly", "server_src\test_analogfly.vcproj", "{ACD7DC44-3F1B-4321-86E0-2623B7CA0971}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {0C16E98C-A372-4E58-990D-EE276B32644E} = {0C16E98C-A372-4E58-990D-EE276B32644E} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_gen_rpc", "util\gen_rpc\test_gen_rpc.vcproj", "{5A5C3F75-C370-4620-8068-4CEDEB89F035}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_imager", "CLIENT_SRC\test_imager.vcproj", "{3A77BE37-0660-4CC9-A7F8-CE83070278CB}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_radamec_spi", "server_src\test_radamec_spi.vcproj", "{65E26214-D2DE-4577-93E7-9A34C968C341}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_vrpn", "server_src\test_vrpn.vcproj", "{5AFB984D-A654-4957-A2C8-387083A6FFDC}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {0C16E98C-A372-4E58-990D-EE276B32644E} = {0C16E98C-A372-4E58-990D-EE276B32644E} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_zaber", "client_src\test_zaber.vcproj", "{218270DA-87E3-4DF5-9550-FE9A9B07BFBB}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testimager_client", "client_src\testimager_client.vcproj", "{AC3D4ACE-C143-484A-B4E7-2EC70AA12781}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testimager_server", "server_src\testimager_server.vcproj", "{922B4D4C-396E-46A7-91BB-FE9BBB80FE78}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "time_test", "time_test.vcproj", "{AF7B0B97-2F3F-419A-81C6-ED55FE6ADD50}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "timecode_generator", "server_src\timecode_generator_server\timecode_generator.vcproj", "{9D824AA0-9A28-45D1-B387-7CD546533493}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tracker_to_poser", "CLIENT_SRC\tracker_to_poser.vcproj", "{1AC1C1EB-400A-4838-AC5E-48F3F9CE7D5C}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {0C16E98C-A372-4E58-990D-EE276B32644E} = {0C16E98C-A372-4E58-990D-EE276B32644E} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vrpn", "vrpn.vcproj", "{7EE1DB03-16A5-4465-9164-061BE0C88B8C}" - ProjectSection(ProjectDependencies) = postProject - {D60E311B-657F-444E-9A0E-5218B37D5551} = {D60E311B-657F-444E-9A0E-5218B37D5551} - {0C16E98C-A372-4E58-990D-EE276B32644E} = {0C16E98C-A372-4E58-990D-EE276B32644E} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vrpn_phantom", "server_src\vrpn_phantom.vcproj", "{92F85D1B-4F9A-4C68-AFE2-8763A7BFDF49}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vrpn_print_devices", "client_src\vrpn_print_devices.vcproj", "{AED1729B-0600-4ECD-BE20-9F1964FFD2C8}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {0C16E98C-A372-4E58-990D-EE276B32644E} = {0C16E98C-A372-4E58-990D-EE276B32644E} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vrpn_server", "server_src\vrpn_server.vcproj", "{92162D21-8739-4DF2-89AC-7629B294F1C4}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {92F85D1B-4F9A-4C68-AFE2-8763A7BFDF49} = {92F85D1B-4F9A-4C68-AFE2-8763A7BFDF49} - {0C16E98C-A372-4E58-990D-EE276B32644E} = {0C16E98C-A372-4E58-990D-EE276B32644E} - {9D824AA0-9A28-45D1-B387-7CD546533493} = {9D824AA0-9A28-45D1-B387-7CD546533493} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vrpndll", "vrpndll.vcproj", "{5F38B32E-B5AE-4316-B15E-9E21D033B1BE}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {D60E311B-657F-444E-9A0E-5218B37D5551} = {D60E311B-657F-444E-9A0E-5218B37D5551} - {0C16E98C-A372-4E58-990D-EE276B32644E} = {0C16E98C-A372-4E58-990D-EE276B32644E} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectShow_baseclasses", "server_src\directshow_video_server\DirectShow_baseclasses.vcproj", "{C3262E68-CC9B-4EA3-9AA5-43417526FE5B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "directshow_video_server", "server_src\directshow_video_server\directshow_video_server.vcproj", "{F7E929EB-6422-40BF-84FF-C8D74E192567}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {C3262E68-CC9B-4EA3-9AA5-43417526FE5B} = {C3262E68-CC9B-4EA3-9AA5-43417526FE5B} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vrpn_hid_device_watcher", "server_src\vrpn_hid_device_watcher.vcproj", "{64ABF6C2-FEC3-4F0E-A164-AE2179F334DB}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_auxiliary_logger", "server_src\test_auxiliary_logger.vcproj", "{D3E2077E-765E-42D6-AD31-B41EE6630DF3}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_logging", "server_src\test_logging.vcproj", "{BC7D2A06-CDC7-45AC-9CD9-4911B7A65059}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_rumble", "server_src\test_rumble.vcproj", "{25163426-6EF1-461C-84BC-DA4FD6BDC88A}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "run_auxiliary_logger", "client_src\run_auxiliary_logger.vcproj", "{1D303E7B-DBBD-409B-BBEC-2A11AF9847A9}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_freespace", "server_src\test_freespace.vcproj", "{E78DD78A-4E96-44EA-975E-55D647DF7270}" - ProjectSection(ProjectDependencies) = postProject - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {7EE1DB03-16A5-4465-9164-061BE0C88B8C} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quatlib", "quat\quatlib.vcproj", "{0C16E98C-A372-4E58-990D-EE276B32644E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gpsnmealib", "gpsnmealib\gpsnmealib.vcproj", "{D60E311B-657F-444E-9A0E-5218B37D5551}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|Win32 Release = Debug|Win32 Release - Release|Win32 = Release|Win32 - Release|Win32 Release = Release|Win32 Release - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E99FB2FA-3281-4DBE-905E-F4C7F4183F09}.Debug|Win32.ActiveCfg = Debug|Win32 - {E99FB2FA-3281-4DBE-905E-F4C7F4183F09}.Debug|Win32.Build.0 = Debug|Win32 - {E99FB2FA-3281-4DBE-905E-F4C7F4183F09}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {E99FB2FA-3281-4DBE-905E-F4C7F4183F09}.Debug|Win32 Release.Build.0 = Debug|Win32 - {E99FB2FA-3281-4DBE-905E-F4C7F4183F09}.Release|Win32.ActiveCfg = Release|Win32 - {E99FB2FA-3281-4DBE-905E-F4C7F4183F09}.Release|Win32.Build.0 = Release|Win32 - {E99FB2FA-3281-4DBE-905E-F4C7F4183F09}.Release|Win32 Release.ActiveCfg = Release|Win32 - {9B18AC3E-2CA6-425A-9049-228821F3D081}.Debug|Win32.ActiveCfg = Debug|Win32 - {9B18AC3E-2CA6-425A-9049-228821F3D081}.Debug|Win32.Build.0 = Debug|Win32 - {9B18AC3E-2CA6-425A-9049-228821F3D081}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {9B18AC3E-2CA6-425A-9049-228821F3D081}.Debug|Win32 Release.Build.0 = Debug|Win32 - {9B18AC3E-2CA6-425A-9049-228821F3D081}.Release|Win32.ActiveCfg = Release|Win32 - {9B18AC3E-2CA6-425A-9049-228821F3D081}.Release|Win32.Build.0 = Release|Win32 - {9B18AC3E-2CA6-425A-9049-228821F3D081}.Release|Win32 Release.ActiveCfg = Debug|Win32 - {9B18AC3E-2CA6-425A-9049-228821F3D081}.Release|Win32 Release.Build.0 = Debug|Win32 - {49248084-B6D2-4E33-BA43-BF51953377AC}.Debug|Win32.ActiveCfg = Debug|Win32 - {49248084-B6D2-4E33-BA43-BF51953377AC}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {49248084-B6D2-4E33-BA43-BF51953377AC}.Release|Win32.ActiveCfg = Release|Win32 - {49248084-B6D2-4E33-BA43-BF51953377AC}.Release|Win32 Release.ActiveCfg = Debug|Win32 - {91042ED0-E0EC-40E1-9AEB-FD5296EA11A7}.Debug|Win32.ActiveCfg = Debug|Win32 - {91042ED0-E0EC-40E1-9AEB-FD5296EA11A7}.Debug|Win32.Build.0 = Debug|Win32 - {91042ED0-E0EC-40E1-9AEB-FD5296EA11A7}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {91042ED0-E0EC-40E1-9AEB-FD5296EA11A7}.Debug|Win32 Release.Build.0 = Debug|Win32 - {91042ED0-E0EC-40E1-9AEB-FD5296EA11A7}.Release|Win32.ActiveCfg = Release|Win32 - {91042ED0-E0EC-40E1-9AEB-FD5296EA11A7}.Release|Win32.Build.0 = Release|Win32 - {91042ED0-E0EC-40E1-9AEB-FD5296EA11A7}.Release|Win32 Release.ActiveCfg = Debug|Win32 - {91042ED0-E0EC-40E1-9AEB-FD5296EA11A7}.Release|Win32 Release.Build.0 = Debug|Win32 - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF}.Debug|Win32.ActiveCfg = Debug|Win32 - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF}.Debug|Win32.Build.0 = Debug|Win32 - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF}.Debug|Win32 Release.Build.0 = Debug|Win32 - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF}.Release|Win32.ActiveCfg = Release|Win32 - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF}.Release|Win32.Build.0 = Release|Win32 - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF}.Release|Win32 Release.ActiveCfg = Debug|Win32 - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF}.Release|Win32 Release.Build.0 = Debug|Win32 - {4FC1C71E-8977-438B-AE1D-F1CD7D2C2D03}.Debug|Win32.ActiveCfg = Debug|Win32 - {4FC1C71E-8977-438B-AE1D-F1CD7D2C2D03}.Debug|Win32.Build.0 = Debug|Win32 - {4FC1C71E-8977-438B-AE1D-F1CD7D2C2D03}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {4FC1C71E-8977-438B-AE1D-F1CD7D2C2D03}.Debug|Win32 Release.Build.0 = Debug|Win32 - {4FC1C71E-8977-438B-AE1D-F1CD7D2C2D03}.Release|Win32.ActiveCfg = Release|Win32 - {4FC1C71E-8977-438B-AE1D-F1CD7D2C2D03}.Release|Win32.Build.0 = Release|Win32 - {4FC1C71E-8977-438B-AE1D-F1CD7D2C2D03}.Release|Win32 Release.ActiveCfg = Debug|Win32 - {4FC1C71E-8977-438B-AE1D-F1CD7D2C2D03}.Release|Win32 Release.Build.0 = Debug|Win32 - {A1B0D907-E30D-4CB9-B313-D342AD5CC3E7}.Debug|Win32.ActiveCfg = Debug|Win32 - {A1B0D907-E30D-4CB9-B313-D342AD5CC3E7}.Debug|Win32.Build.0 = Debug|Win32 - {A1B0D907-E30D-4CB9-B313-D342AD5CC3E7}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {A1B0D907-E30D-4CB9-B313-D342AD5CC3E7}.Debug|Win32 Release.Build.0 = Debug|Win32 - {A1B0D907-E30D-4CB9-B313-D342AD5CC3E7}.Release|Win32.ActiveCfg = Release|Win32 - {A1B0D907-E30D-4CB9-B313-D342AD5CC3E7}.Release|Win32.Build.0 = Release|Win32 - {A1B0D907-E30D-4CB9-B313-D342AD5CC3E7}.Release|Win32 Release.ActiveCfg = Debug|Win32 - {A1B0D907-E30D-4CB9-B313-D342AD5CC3E7}.Release|Win32 Release.Build.0 = Debug|Win32 - {14E21AB6-F3E9-4CA9-BF51-1E9443979B3C}.Debug|Win32.ActiveCfg = Debug|Win32 - {14E21AB6-F3E9-4CA9-BF51-1E9443979B3C}.Debug|Win32.Build.0 = Debug|Win32 - {14E21AB6-F3E9-4CA9-BF51-1E9443979B3C}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {14E21AB6-F3E9-4CA9-BF51-1E9443979B3C}.Debug|Win32 Release.Build.0 = Debug|Win32 - {14E21AB6-F3E9-4CA9-BF51-1E9443979B3C}.Release|Win32.ActiveCfg = Release|Win32 - {14E21AB6-F3E9-4CA9-BF51-1E9443979B3C}.Release|Win32.Build.0 = Release|Win32 - {14E21AB6-F3E9-4CA9-BF51-1E9443979B3C}.Release|Win32 Release.ActiveCfg = Debug|Win32 - {14E21AB6-F3E9-4CA9-BF51-1E9443979B3C}.Release|Win32 Release.Build.0 = Debug|Win32 - {ACD7DC44-3F1B-4321-86E0-2623B7CA0971}.Debug|Win32.ActiveCfg = Debug|Win32 - {ACD7DC44-3F1B-4321-86E0-2623B7CA0971}.Debug|Win32.Build.0 = Debug|Win32 - {ACD7DC44-3F1B-4321-86E0-2623B7CA0971}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {ACD7DC44-3F1B-4321-86E0-2623B7CA0971}.Debug|Win32 Release.Build.0 = Debug|Win32 - {ACD7DC44-3F1B-4321-86E0-2623B7CA0971}.Release|Win32.ActiveCfg = Release|Win32 - {ACD7DC44-3F1B-4321-86E0-2623B7CA0971}.Release|Win32.Build.0 = Release|Win32 - {ACD7DC44-3F1B-4321-86E0-2623B7CA0971}.Release|Win32 Release.ActiveCfg = Debug|Win32 - {ACD7DC44-3F1B-4321-86E0-2623B7CA0971}.Release|Win32 Release.Build.0 = Debug|Win32 - {5A5C3F75-C370-4620-8068-4CEDEB89F035}.Debug|Win32.ActiveCfg = Debug|Win32 - {5A5C3F75-C370-4620-8068-4CEDEB89F035}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {5A5C3F75-C370-4620-8068-4CEDEB89F035}.Release|Win32.ActiveCfg = Release|Win32 - {5A5C3F75-C370-4620-8068-4CEDEB89F035}.Release|Win32 Release.ActiveCfg = Release|Win32 - {3A77BE37-0660-4CC9-A7F8-CE83070278CB}.Debug|Win32.ActiveCfg = Debug|Win32 - {3A77BE37-0660-4CC9-A7F8-CE83070278CB}.Debug|Win32.Build.0 = Debug|Win32 - {3A77BE37-0660-4CC9-A7F8-CE83070278CB}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {3A77BE37-0660-4CC9-A7F8-CE83070278CB}.Debug|Win32 Release.Build.0 = Debug|Win32 - {3A77BE37-0660-4CC9-A7F8-CE83070278CB}.Release|Win32.ActiveCfg = Release|Win32 - {3A77BE37-0660-4CC9-A7F8-CE83070278CB}.Release|Win32.Build.0 = Release|Win32 - {3A77BE37-0660-4CC9-A7F8-CE83070278CB}.Release|Win32 Release.ActiveCfg = Release|Win32 - {3A77BE37-0660-4CC9-A7F8-CE83070278CB}.Release|Win32 Release.Build.0 = Release|Win32 - {65E26214-D2DE-4577-93E7-9A34C968C341}.Debug|Win32.ActiveCfg = Debug|Win32 - {65E26214-D2DE-4577-93E7-9A34C968C341}.Debug|Win32.Build.0 = Debug|Win32 - {65E26214-D2DE-4577-93E7-9A34C968C341}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {65E26214-D2DE-4577-93E7-9A34C968C341}.Debug|Win32 Release.Build.0 = Debug|Win32 - {65E26214-D2DE-4577-93E7-9A34C968C341}.Release|Win32.ActiveCfg = Release|Win32 - {65E26214-D2DE-4577-93E7-9A34C968C341}.Release|Win32.Build.0 = Release|Win32 - {65E26214-D2DE-4577-93E7-9A34C968C341}.Release|Win32 Release.ActiveCfg = Release|Win32 - {65E26214-D2DE-4577-93E7-9A34C968C341}.Release|Win32 Release.Build.0 = Release|Win32 - {5AFB984D-A654-4957-A2C8-387083A6FFDC}.Debug|Win32.ActiveCfg = Debug|Win32 - {5AFB984D-A654-4957-A2C8-387083A6FFDC}.Debug|Win32.Build.0 = Debug|Win32 - {5AFB984D-A654-4957-A2C8-387083A6FFDC}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {5AFB984D-A654-4957-A2C8-387083A6FFDC}.Debug|Win32 Release.Build.0 = Debug|Win32 - {5AFB984D-A654-4957-A2C8-387083A6FFDC}.Release|Win32.ActiveCfg = Release|Win32 - {5AFB984D-A654-4957-A2C8-387083A6FFDC}.Release|Win32.Build.0 = Release|Win32 - {5AFB984D-A654-4957-A2C8-387083A6FFDC}.Release|Win32 Release.ActiveCfg = Release|Win32 - {5AFB984D-A654-4957-A2C8-387083A6FFDC}.Release|Win32 Release.Build.0 = Release|Win32 - {218270DA-87E3-4DF5-9550-FE9A9B07BFBB}.Debug|Win32.ActiveCfg = Debug|Win32 - {218270DA-87E3-4DF5-9550-FE9A9B07BFBB}.Debug|Win32.Build.0 = Debug|Win32 - {218270DA-87E3-4DF5-9550-FE9A9B07BFBB}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {218270DA-87E3-4DF5-9550-FE9A9B07BFBB}.Release|Win32.ActiveCfg = Release|Win32 - {218270DA-87E3-4DF5-9550-FE9A9B07BFBB}.Release|Win32.Build.0 = Release|Win32 - {218270DA-87E3-4DF5-9550-FE9A9B07BFBB}.Release|Win32 Release.ActiveCfg = Release|Win32 - {218270DA-87E3-4DF5-9550-FE9A9B07BFBB}.Release|Win32 Release.Build.0 = Release|Win32 - {AC3D4ACE-C143-484A-B4E7-2EC70AA12781}.Debug|Win32.ActiveCfg = Debug|Win32 - {AC3D4ACE-C143-484A-B4E7-2EC70AA12781}.Debug|Win32.Build.0 = Debug|Win32 - {AC3D4ACE-C143-484A-B4E7-2EC70AA12781}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {AC3D4ACE-C143-484A-B4E7-2EC70AA12781}.Debug|Win32 Release.Build.0 = Debug|Win32 - {AC3D4ACE-C143-484A-B4E7-2EC70AA12781}.Release|Win32.ActiveCfg = Release|Win32 - {AC3D4ACE-C143-484A-B4E7-2EC70AA12781}.Release|Win32.Build.0 = Release|Win32 - {AC3D4ACE-C143-484A-B4E7-2EC70AA12781}.Release|Win32 Release.ActiveCfg = Release|Win32 - {AC3D4ACE-C143-484A-B4E7-2EC70AA12781}.Release|Win32 Release.Build.0 = Release|Win32 - {922B4D4C-396E-46A7-91BB-FE9BBB80FE78}.Debug|Win32.ActiveCfg = Debug|Win32 - {922B4D4C-396E-46A7-91BB-FE9BBB80FE78}.Debug|Win32.Build.0 = Debug|Win32 - {922B4D4C-396E-46A7-91BB-FE9BBB80FE78}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {922B4D4C-396E-46A7-91BB-FE9BBB80FE78}.Debug|Win32 Release.Build.0 = Debug|Win32 - {922B4D4C-396E-46A7-91BB-FE9BBB80FE78}.Release|Win32.ActiveCfg = Release|Win32 - {922B4D4C-396E-46A7-91BB-FE9BBB80FE78}.Release|Win32.Build.0 = Release|Win32 - {922B4D4C-396E-46A7-91BB-FE9BBB80FE78}.Release|Win32 Release.ActiveCfg = Release|Win32 - {922B4D4C-396E-46A7-91BB-FE9BBB80FE78}.Release|Win32 Release.Build.0 = Release|Win32 - {AF7B0B97-2F3F-419A-81C6-ED55FE6ADD50}.Debug|Win32.ActiveCfg = Debug|Win32 - {AF7B0B97-2F3F-419A-81C6-ED55FE6ADD50}.Debug|Win32.Build.0 = Debug|Win32 - {AF7B0B97-2F3F-419A-81C6-ED55FE6ADD50}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {AF7B0B97-2F3F-419A-81C6-ED55FE6ADD50}.Debug|Win32 Release.Build.0 = Debug|Win32 - {AF7B0B97-2F3F-419A-81C6-ED55FE6ADD50}.Release|Win32.ActiveCfg = Release|Win32 - {AF7B0B97-2F3F-419A-81C6-ED55FE6ADD50}.Release|Win32.Build.0 = Release|Win32 - {AF7B0B97-2F3F-419A-81C6-ED55FE6ADD50}.Release|Win32 Release.ActiveCfg = Release|Win32 - {AF7B0B97-2F3F-419A-81C6-ED55FE6ADD50}.Release|Win32 Release.Build.0 = Release|Win32 - {9D824AA0-9A28-45D1-B387-7CD546533493}.Debug|Win32.ActiveCfg = Debug|Win32 - {9D824AA0-9A28-45D1-B387-7CD546533493}.Debug|Win32.Build.0 = Debug|Win32 - {9D824AA0-9A28-45D1-B387-7CD546533493}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {9D824AA0-9A28-45D1-B387-7CD546533493}.Debug|Win32 Release.Build.0 = Debug|Win32 - {9D824AA0-9A28-45D1-B387-7CD546533493}.Release|Win32.ActiveCfg = Release|Win32 - {9D824AA0-9A28-45D1-B387-7CD546533493}.Release|Win32.Build.0 = Release|Win32 - {9D824AA0-9A28-45D1-B387-7CD546533493}.Release|Win32 Release.ActiveCfg = Release|Win32 - {9D824AA0-9A28-45D1-B387-7CD546533493}.Release|Win32 Release.Build.0 = Release|Win32 - {1AC1C1EB-400A-4838-AC5E-48F3F9CE7D5C}.Debug|Win32.ActiveCfg = Debug|Win32 - {1AC1C1EB-400A-4838-AC5E-48F3F9CE7D5C}.Debug|Win32.Build.0 = Debug|Win32 - {1AC1C1EB-400A-4838-AC5E-48F3F9CE7D5C}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {1AC1C1EB-400A-4838-AC5E-48F3F9CE7D5C}.Debug|Win32 Release.Build.0 = Debug|Win32 - {1AC1C1EB-400A-4838-AC5E-48F3F9CE7D5C}.Release|Win32.ActiveCfg = Release|Win32 - {1AC1C1EB-400A-4838-AC5E-48F3F9CE7D5C}.Release|Win32.Build.0 = Release|Win32 - {1AC1C1EB-400A-4838-AC5E-48F3F9CE7D5C}.Release|Win32 Release.ActiveCfg = Release|Win32 - {1AC1C1EB-400A-4838-AC5E-48F3F9CE7D5C}.Release|Win32 Release.Build.0 = Release|Win32 - {7EE1DB03-16A5-4465-9164-061BE0C88B8C}.Debug|Win32.ActiveCfg = Debug|Win32 - {7EE1DB03-16A5-4465-9164-061BE0C88B8C}.Debug|Win32.Build.0 = Debug|Win32 - {7EE1DB03-16A5-4465-9164-061BE0C88B8C}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {7EE1DB03-16A5-4465-9164-061BE0C88B8C}.Debug|Win32 Release.Build.0 = Debug|Win32 - {7EE1DB03-16A5-4465-9164-061BE0C88B8C}.Release|Win32.ActiveCfg = Release|Win32 - {7EE1DB03-16A5-4465-9164-061BE0C88B8C}.Release|Win32.Build.0 = Release|Win32 - {7EE1DB03-16A5-4465-9164-061BE0C88B8C}.Release|Win32 Release.ActiveCfg = Release|Win32 - {7EE1DB03-16A5-4465-9164-061BE0C88B8C}.Release|Win32 Release.Build.0 = Release|Win32 - {92F85D1B-4F9A-4C68-AFE2-8763A7BFDF49}.Debug|Win32.ActiveCfg = Debug|Win32 - {92F85D1B-4F9A-4C68-AFE2-8763A7BFDF49}.Debug|Win32.Build.0 = Debug|Win32 - {92F85D1B-4F9A-4C68-AFE2-8763A7BFDF49}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {92F85D1B-4F9A-4C68-AFE2-8763A7BFDF49}.Release|Win32.ActiveCfg = Release|Win32 - {92F85D1B-4F9A-4C68-AFE2-8763A7BFDF49}.Release|Win32.Build.0 = Release|Win32 - {92F85D1B-4F9A-4C68-AFE2-8763A7BFDF49}.Release|Win32 Release.ActiveCfg = Release|Win32 - {AED1729B-0600-4ECD-BE20-9F1964FFD2C8}.Debug|Win32.ActiveCfg = Debug|Win32 - {AED1729B-0600-4ECD-BE20-9F1964FFD2C8}.Debug|Win32.Build.0 = Debug|Win32 - {AED1729B-0600-4ECD-BE20-9F1964FFD2C8}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {AED1729B-0600-4ECD-BE20-9F1964FFD2C8}.Debug|Win32 Release.Build.0 = Debug|Win32 - {AED1729B-0600-4ECD-BE20-9F1964FFD2C8}.Release|Win32.ActiveCfg = Release|Win32 - {AED1729B-0600-4ECD-BE20-9F1964FFD2C8}.Release|Win32.Build.0 = Release|Win32 - {AED1729B-0600-4ECD-BE20-9F1964FFD2C8}.Release|Win32 Release.ActiveCfg = Release|Win32 - {AED1729B-0600-4ECD-BE20-9F1964FFD2C8}.Release|Win32 Release.Build.0 = Release|Win32 - {92162D21-8739-4DF2-89AC-7629B294F1C4}.Debug|Win32.ActiveCfg = Debug|Win32 - {92162D21-8739-4DF2-89AC-7629B294F1C4}.Debug|Win32.Build.0 = Debug|Win32 - {92162D21-8739-4DF2-89AC-7629B294F1C4}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {92162D21-8739-4DF2-89AC-7629B294F1C4}.Debug|Win32 Release.Build.0 = Debug|Win32 - {92162D21-8739-4DF2-89AC-7629B294F1C4}.Release|Win32.ActiveCfg = Release|Win32 - {92162D21-8739-4DF2-89AC-7629B294F1C4}.Release|Win32.Build.0 = Release|Win32 - {92162D21-8739-4DF2-89AC-7629B294F1C4}.Release|Win32 Release.ActiveCfg = Release|Win32 - {92162D21-8739-4DF2-89AC-7629B294F1C4}.Release|Win32 Release.Build.0 = Release|Win32 - {5F38B32E-B5AE-4316-B15E-9E21D033B1BE}.Debug|Win32.ActiveCfg = Debug|Win32 - {5F38B32E-B5AE-4316-B15E-9E21D033B1BE}.Debug|Win32.Build.0 = Debug|Win32 - {5F38B32E-B5AE-4316-B15E-9E21D033B1BE}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {5F38B32E-B5AE-4316-B15E-9E21D033B1BE}.Debug|Win32 Release.Build.0 = Debug|Win32 - {5F38B32E-B5AE-4316-B15E-9E21D033B1BE}.Release|Win32.ActiveCfg = Release|Win32 - {5F38B32E-B5AE-4316-B15E-9E21D033B1BE}.Release|Win32.Build.0 = Release|Win32 - {5F38B32E-B5AE-4316-B15E-9E21D033B1BE}.Release|Win32 Release.ActiveCfg = Release|Win32 - {5F38B32E-B5AE-4316-B15E-9E21D033B1BE}.Release|Win32 Release.Build.0 = Release|Win32 - {C3262E68-CC9B-4EA3-9AA5-43417526FE5B}.Debug|Win32.ActiveCfg = Debug|Win32 - {C3262E68-CC9B-4EA3-9AA5-43417526FE5B}.Debug|Win32.Build.0 = Debug|Win32 - {C3262E68-CC9B-4EA3-9AA5-43417526FE5B}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {C3262E68-CC9B-4EA3-9AA5-43417526FE5B}.Release|Win32.ActiveCfg = Release|Win32 - {C3262E68-CC9B-4EA3-9AA5-43417526FE5B}.Release|Win32.Build.0 = Release|Win32 - {C3262E68-CC9B-4EA3-9AA5-43417526FE5B}.Release|Win32 Release.ActiveCfg = Release|Win32 - {F7E929EB-6422-40BF-84FF-C8D74E192567}.Debug|Win32.ActiveCfg = Debug|Win32 - {F7E929EB-6422-40BF-84FF-C8D74E192567}.Debug|Win32.Build.0 = Debug|Win32 - {F7E929EB-6422-40BF-84FF-C8D74E192567}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {F7E929EB-6422-40BF-84FF-C8D74E192567}.Release|Win32.ActiveCfg = Release|Win32 - {F7E929EB-6422-40BF-84FF-C8D74E192567}.Release|Win32.Build.0 = Release|Win32 - {F7E929EB-6422-40BF-84FF-C8D74E192567}.Release|Win32 Release.ActiveCfg = Release|Win32 - {64ABF6C2-FEC3-4F0E-A164-AE2179F334DB}.Debug|Win32.ActiveCfg = Debug|Win32 - {64ABF6C2-FEC3-4F0E-A164-AE2179F334DB}.Debug|Win32.Build.0 = Debug|Win32 - {64ABF6C2-FEC3-4F0E-A164-AE2179F334DB}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {64ABF6C2-FEC3-4F0E-A164-AE2179F334DB}.Release|Win32.ActiveCfg = Release|Win32 - {64ABF6C2-FEC3-4F0E-A164-AE2179F334DB}.Release|Win32.Build.0 = Release|Win32 - {64ABF6C2-FEC3-4F0E-A164-AE2179F334DB}.Release|Win32 Release.ActiveCfg = Release|Win32 - {D3E2077E-765E-42D6-AD31-B41EE6630DF3}.Debug|Win32.ActiveCfg = Debug|Win32 - {D3E2077E-765E-42D6-AD31-B41EE6630DF3}.Debug|Win32.Build.0 = Debug|Win32 - {D3E2077E-765E-42D6-AD31-B41EE6630DF3}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {D3E2077E-765E-42D6-AD31-B41EE6630DF3}.Release|Win32.ActiveCfg = Release|Win32 - {D3E2077E-765E-42D6-AD31-B41EE6630DF3}.Release|Win32.Build.0 = Release|Win32 - {D3E2077E-765E-42D6-AD31-B41EE6630DF3}.Release|Win32 Release.ActiveCfg = Release|Win32 - {BC7D2A06-CDC7-45AC-9CD9-4911B7A65059}.Debug|Win32.ActiveCfg = Debug|Win32 - {BC7D2A06-CDC7-45AC-9CD9-4911B7A65059}.Debug|Win32.Build.0 = Debug|Win32 - {BC7D2A06-CDC7-45AC-9CD9-4911B7A65059}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {BC7D2A06-CDC7-45AC-9CD9-4911B7A65059}.Release|Win32.ActiveCfg = Release|Win32 - {BC7D2A06-CDC7-45AC-9CD9-4911B7A65059}.Release|Win32.Build.0 = Release|Win32 - {BC7D2A06-CDC7-45AC-9CD9-4911B7A65059}.Release|Win32 Release.ActiveCfg = Release|Win32 - {25163426-6EF1-461C-84BC-DA4FD6BDC88A}.Debug|Win32.ActiveCfg = Debug|Win32 - {25163426-6EF1-461C-84BC-DA4FD6BDC88A}.Debug|Win32.Build.0 = Debug|Win32 - {25163426-6EF1-461C-84BC-DA4FD6BDC88A}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {25163426-6EF1-461C-84BC-DA4FD6BDC88A}.Release|Win32.ActiveCfg = Release|Win32 - {25163426-6EF1-461C-84BC-DA4FD6BDC88A}.Release|Win32.Build.0 = Release|Win32 - {25163426-6EF1-461C-84BC-DA4FD6BDC88A}.Release|Win32 Release.ActiveCfg = Release|Win32 - {1D303E7B-DBBD-409B-BBEC-2A11AF9847A9}.Debug|Win32.ActiveCfg = Debug|Win32 - {1D303E7B-DBBD-409B-BBEC-2A11AF9847A9}.Debug|Win32.Build.0 = Debug|Win32 - {1D303E7B-DBBD-409B-BBEC-2A11AF9847A9}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {1D303E7B-DBBD-409B-BBEC-2A11AF9847A9}.Release|Win32.ActiveCfg = Release|Win32 - {1D303E7B-DBBD-409B-BBEC-2A11AF9847A9}.Release|Win32.Build.0 = Release|Win32 - {1D303E7B-DBBD-409B-BBEC-2A11AF9847A9}.Release|Win32 Release.ActiveCfg = Release|Win32 - {E78DD78A-4E96-44EA-975E-55D647DF7270}.Debug|Win32.ActiveCfg = Debug|Win32 - {E78DD78A-4E96-44EA-975E-55D647DF7270}.Debug|Win32.Build.0 = Debug|Win32 - {E78DD78A-4E96-44EA-975E-55D647DF7270}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {E78DD78A-4E96-44EA-975E-55D647DF7270}.Release|Win32.ActiveCfg = Release|Win32 - {E78DD78A-4E96-44EA-975E-55D647DF7270}.Release|Win32.Build.0 = Release|Win32 - {E78DD78A-4E96-44EA-975E-55D647DF7270}.Release|Win32 Release.ActiveCfg = Release|Win32 - {0C16E98C-A372-4E58-990D-EE276B32644E}.Debug|Win32.ActiveCfg = Debug|Win32 - {0C16E98C-A372-4E58-990D-EE276B32644E}.Debug|Win32.Build.0 = Debug|Win32 - {0C16E98C-A372-4E58-990D-EE276B32644E}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {0C16E98C-A372-4E58-990D-EE276B32644E}.Release|Win32.ActiveCfg = Release|Win32 - {0C16E98C-A372-4E58-990D-EE276B32644E}.Release|Win32.Build.0 = Release|Win32 - {0C16E98C-A372-4E58-990D-EE276B32644E}.Release|Win32 Release.ActiveCfg = Release|Win32 - {D60E311B-657F-444E-9A0E-5218B37D5551}.Debug|Win32.ActiveCfg = Debug|Win32 - {D60E311B-657F-444E-9A0E-5218B37D5551}.Debug|Win32.Build.0 = Debug|Win32 - {D60E311B-657F-444E-9A0E-5218B37D5551}.Debug|Win32 Release.ActiveCfg = Debug|Win32 - {D60E311B-657F-444E-9A0E-5218B37D5551}.Release|Win32.ActiveCfg = Release|Win32 - {D60E311B-657F-444E-9A0E-5218B37D5551}.Release|Win32.Build.0 = Release|Win32 - {D60E311B-657F-444E-9A0E-5218B37D5551}.Release|Win32 Release.ActiveCfg = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {E99FB2FA-3281-4DBE-905E-F4C7F4183F09} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {91042ED0-E0EC-40E1-9AEB-FD5296EA11A7} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {14E21AB6-F3E9-4CA9-BF51-1E9443979B3C} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {ACD7DC44-3F1B-4321-86E0-2623B7CA0971} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {5A5C3F75-C370-4620-8068-4CEDEB89F035} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {3A77BE37-0660-4CC9-A7F8-CE83070278CB} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {65E26214-D2DE-4577-93E7-9A34C968C341} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {5AFB984D-A654-4957-A2C8-387083A6FFDC} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {218270DA-87E3-4DF5-9550-FE9A9B07BFBB} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {AC3D4ACE-C143-484A-B4E7-2EC70AA12781} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {922B4D4C-396E-46A7-91BB-FE9BBB80FE78} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {AF7B0B97-2F3F-419A-81C6-ED55FE6ADD50} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {D3E2077E-765E-42D6-AD31-B41EE6630DF3} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {BC7D2A06-CDC7-45AC-9CD9-4911B7A65059} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {25163426-6EF1-461C-84BC-DA4FD6BDC88A} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {1D303E7B-DBBD-409B-BBEC-2A11AF9847A9} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {E78DD78A-4E96-44EA-975E-55D647DF7270} = {75C9A5FE-75B1-4462-AD62-A03476E1935B} - {9B18AC3E-2CA6-425A-9049-228821F3D081} = {D0EA1EF6-1E10-4DA1-8CA7-7AB288412650} - {4FC1C71E-8977-438B-AE1D-F1CD7D2C2D03} = {D0EA1EF6-1E10-4DA1-8CA7-7AB288412650} - {A1B0D907-E30D-4CB9-B313-D342AD5CC3E7} = {D0EA1EF6-1E10-4DA1-8CA7-7AB288412650} - {AED1729B-0600-4ECD-BE20-9F1964FFD2C8} = {D0EA1EF6-1E10-4DA1-8CA7-7AB288412650} - {64ABF6C2-FEC3-4F0E-A164-AE2179F334DB} = {D0EA1EF6-1E10-4DA1-8CA7-7AB288412650} - {7E69F3AB-E629-4AD4-A1FA-BE6BF678CDFF} = {1BEEE31E-C293-4DB6-9790-4EF575747A1D} - {7EE1DB03-16A5-4465-9164-061BE0C88B8C} = {1BEEE31E-C293-4DB6-9790-4EF575747A1D} - {5F38B32E-B5AE-4316-B15E-9E21D033B1BE} = {1BEEE31E-C293-4DB6-9790-4EF575747A1D} - {0C16E98C-A372-4E58-990D-EE276B32644E} = {1BEEE31E-C293-4DB6-9790-4EF575747A1D} - {D60E311B-657F-444E-9A0E-5218B37D5551} = {1BEEE31E-C293-4DB6-9790-4EF575747A1D} - {9D824AA0-9A28-45D1-B387-7CD546533493} = {0B1F0287-8AEF-4D18-BF73-466D8ACA18D1} - {92162D21-8739-4DF2-89AC-7629B294F1C4} = {0B1F0287-8AEF-4D18-BF73-466D8ACA18D1} - {49248084-B6D2-4E33-BA43-BF51953377AC} = {B215CEE5-020A-4F34-88C6-5565792A72FD} - {1AC1C1EB-400A-4838-AC5E-48F3F9CE7D5C} = {B215CEE5-020A-4F34-88C6-5565792A72FD} - {C3262E68-CC9B-4EA3-9AA5-43417526FE5B} = {B215CEE5-020A-4F34-88C6-5565792A72FD} - {F7E929EB-6422-40BF-84FF-C8D74E192567} = {B215CEE5-020A-4F34-88C6-5565792A72FD} - EndGlobalSection -EndGlobal diff --git a/src/vrpn/vrpn.vcproj b/src/vrpn/vrpn.vcproj deleted file mode 100644 index ff8ef58c13fd6915f14ae122b2413a96130f6422..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn.vcproj +++ /dev/null @@ -1,2940 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="vrpn" - ProjectGUID="{7EE1DB03-16A5-4465-9164-061BE0C88B8C}" - RootNamespace="vrpn" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Release|Win32" - OutputDirectory=".\pc_win32/Release" - IntermediateDirectory=".\pc_win32/Release" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";../dtrack;quat;../isense;../Dtrack;../libfreespace/include;"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include";"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include";"$(SYSTEMDRIVE)\sdk\cpp";"$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1";./submodules/hidapi/hidapi;"$(SYSTEMDRIVE)\Program Files\libusb-1.0\libusb";"C:\Program Files (x86)\Polhemus\PDI\PDI_90\Inc"" - PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS,VRPNDLL_NOEXPORTS" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\pc_win32/Release/vrpn.pch" - AssemblerListingLocation=".\pc_win32/Release/" - ObjectFile=".\pc_win32/Release/" - ProgramDataBaseFileName=".\pc_win32/Release/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile=".\pc_win32/Release\vrpn.lib" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32/Release/vrpn.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\pc_win32/Debug" - IntermediateDirectory=".\pc_win32/Debug" - ConfigurationType="4" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";../dtrack;quat;../isense;../Dtrack;../libfreespace/include;"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include";"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include";"$(SYSTEMDRIVE)\sdk\cpp";"$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1";./submodules/hidapi/hidapi;"$(SYSTEMDRIVE)\Program Files\libusb-1.0\libusb";"C:\Program Files (x86)\Polhemus\PDI\PDI_90\Inc"" - PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS,VRPNDLL_NOEXPORTS" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\pc_win32/Debug/vrpn.pch" - AssemblerListingLocation=".\pc_win32/Debug/" - ObjectFile=".\pc_win32/Debug/" - ProgramDataBaseFileName=".\pc_win32/Debug/" - BrowseInformation="1" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="3" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile=".\pc_win32/Debug\vrpn.lib" - AdditionalLibraryDirectories=""C:\Program Files (x86)\Polhemus\PDI\PDI_90\Lib\Win32"" - SuppressStartupBanner="true" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32/Debug/vrpn.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="vrpn_3DConnexion.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_3DMicroscribe.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_3Space.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_5DT16.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_ADBox.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Analog.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Analog_5dt.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Analog_5dtUSB.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Analog_Output.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Analog_Radamec_SPI.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Analog_USDigital_A2.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Auxiliary_Logger.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_BaseClass.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_OmegaTemperature.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_BiosciencesTools.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Button.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Button_NI_DIO24.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Button_USB.cpp" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_CerealBox.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Connection.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_Contour.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_CHProducts_Controller_Raw.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Dial.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_DirectXFFJoystick.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_DirectXRumblePad.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_DreamCheeky.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Dyna.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Event.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Event_Analog.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Event_Mouse.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_FileConnection.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_FileController.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Flock.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Flock_Parallel.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_ForceDevice.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_ForceDeviceServer.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Forwarder.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_ForwarderController.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Freespace.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_FunctionGenerator.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_Futaba.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_GlobalHapticsOrb.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_Griffin.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_HumanInterface.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_IDEA.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Imager.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Imager_Stream_Buffer.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_ImmersionBox.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_inertiamouse.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_JoyFly.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Joylin.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Joywin32.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Keyboard.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_LamportClock.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Local_HIDAPI.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_Logitech_Controller_Raw.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_LUDL.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Magellan.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_Microsoft_Controller_Raw.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Mouse.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Mutex.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_NationalInstruments.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Nidaq.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_nikon_controls.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Poser.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Poser_Analog.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Poser_Tek4662.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_raw_sgibox.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_RetroLink.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_RedundantTransmission.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_Saitek_Controller_Raw.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Serial.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_sgibox.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Shared.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_SharedObject.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Sound.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Spaceball.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Text.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tng3.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_3DMouse.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_AnalogFly.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_ButtonFly.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_Crossbow.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_DTrack.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_Fastrak.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_Filter.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_GameTrak.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_GPS.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_isense.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_Isotrak.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_JsonNet.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_Liberty.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_LibertyHS.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_MotionNode.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_NDI_Polaris.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_NovintFalcon.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_PDI.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_PhaseSpace.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_RazerHydra.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_SpacePoint.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_TrivisioColibri.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_ViewPoint.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_WiimoteHead.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_Wintracker.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_zSight.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_UNC_Joystick.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_VPJoystick.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Wanda.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_WiiMote.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_XInputGamepad.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Xkeys.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_YEI_3Space.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Zaber.C" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - <File - RelativePath="vrpn_3DConnexion.h" - > - </File> - <File - RelativePath="vrpn_3DMicroscribe.h" - > - </File> - <File - RelativePath="vrpn_3Space.h" - > - </File> - <File - RelativePath="vrpn_5DT16.h" - > - </File> - <File - RelativePath="vrpn_ADBox.h" - > - </File> - <File - RelativePath="vrpn_Analog.h" - > - </File> - <File - RelativePath="vrpn_Analog_5dt.h" - > - </File> - <File - RelativePath="vrpn_Analog_5dtUSB.h" - > - </File> - <File - RelativePath="vrpn_Analog_Output.h" - > - </File> - <File - RelativePath="vrpn_Analog_Radamec_SPI.h" - > - </File> - <File - RelativePath="vrpn_Analog_USDigital_A2.h" - > - </File> - <File - RelativePath="vrpn_Auxiliary_Logger.h" - > - </File> - <File - RelativePath="vrpn_BaseClass.h" - > - </File> - <File - RelativePath="vrpn_OmegaTemperature.h" - > - </File> - <File - RelativePath="vrpn_BiosciencesTools.h" - > - </File> - <File - RelativePath="vrpn_Button.h" - > - </File> - <File - RelativePath="vrpn_Button_NI_DIO24.h" - > - </File> - <File - RelativePath="vrpn_Button_USB.h" - > - </File> - <File - RelativePath="vrpn_CerealBox.h" - > - </File> - <File - RelativePath="vrpn_Configure.h" - > - </File> - <File - RelativePath="vrpn_Connection.h" - > - </File> - <File - RelativePath=".\vrpn_Contour.h" - > - </File> - <File - RelativePath=".\vrpn_CHProducts_Controller_Raw.h" - > - </File> - <File - RelativePath="vrpn_Dial.h" - > - </File> - <File - RelativePath="vrpn_DirectXFFJoystick.h" - > - </File> - <File - RelativePath="vrpn_DirectXRumblePad.h" - > - </File> - <File - RelativePath="vrpn_DreamCheeky.h" - > - </File> - <File - RelativePath="vrpn_Dyna.h" - > - </File> - <File - RelativePath="vrpn_Event.h" - > - </File> - <File - RelativePath="vrpn_Event_Analog.h" - > - </File> - <File - RelativePath="vrpn_Event_Mouse.h" - > - </File> - <File - RelativePath="vrpn_FileConnection.h" - > - </File> - <File - RelativePath="vrpn_FileController.h" - > - </File> - <File - RelativePath="vrpn_Flock.h" - > - </File> - <File - RelativePath="vrpn_Flock_Parallel.h" - > - </File> - <File - RelativePath="vrpn_ForceDevice.h" - > - </File> - <File - RelativePath="vrpn_ForceDeviceServer.h" - > - </File> - <File - RelativePath="vrpn_Forwarder.h" - > - </File> - <File - RelativePath="vrpn_ForwarderController.h" - > - </File> - <File - RelativePath="vrpn_Freespace.h" - > - </File> - <File - RelativePath="vrpn_FunctionGenerator.h" - > - </File> - <File - RelativePath=".\vrpn_Futaba.h" - > - </File> - <File - RelativePath="vrpn_GlobalHapticsOrb.h" - > - </File> - <File - RelativePath=".\vrpn_Griffin.h" - > - </File> - <File - RelativePath="vrpn_HashST.h" - > - </File> - <File - RelativePath="vrpn_HumanInterface.h" - > - </File> - <File - RelativePath="vrpn_IDEA.h" - > - </File> - <File - RelativePath="vrpn_Imager.h" - > - </File> - <File - RelativePath="vrpn_Imager_Stream_Buffer.h" - > - </File> - <File - RelativePath="vrpn_ImmersionBox.h" - > - </File> - <File - RelativePath="vrpn_inertiamouse.h" - > - </File> - <File - RelativePath="vrpn_JoyFly.h" - > - </File> - <File - RelativePath="vrpn_Joylin.h" - > - </File> - <File - RelativePath="vrpn_Joywin32.h" - > - </File> - <File - RelativePath="vrpn_Keyboard.h" - > - </File> - <File - RelativePath="vrpn_LamportClock.h" - > - </File> - <File - RelativePath="vrpn_Log.h" - > - </File> - <File - RelativePath=".\vrpn_Logitech_Controller_Raw.h" - > - </File> - <File - RelativePath="vrpn_LUDL.h" - > - </File> - <File - RelativePath="vrpn_Magellan.h" - > - </File> - <File - RelativePath="vrpn_MainloopContainer.h" - > - </File> - <File - RelativePath="vrpn_MainloopObject.h" - > - </File> - <File - RelativePath=".\vrpn_Microsoft_Controller_Raw.h" - > - </File> - <File - RelativePath="vrpn_Mouse.h" - > - </File> - <File - RelativePath="vrpn_Mutex.h" - > - </File> - <File - RelativePath="vrpn_NationalInstruments.h" - > - </File> - <File - RelativePath="vrpn_Nidaq.h" - > - </File> - <File - RelativePath="vrpn_nikon_controls.h" - > - </File> - <File - RelativePath="vrpn_Poser.h" - > - </File> - <File - RelativePath="vrpn_Poser_Analog.h" - > - </File> - <File - RelativePath="vrpn_Poser_Tek4662.h" - > - </File> - <File - RelativePath="vrpn_raw_sgibox.h" - > - </File> - <File - RelativePath="vrpn_RetroLink.h" - > - </File> - <File - RelativePath="vrpn_RedundantTransmission.h" - > - </File> - <File - RelativePath=".\vrpn_Saitek_Controller_Raw.h" - > - </File> - <File - RelativePath="vrpn_Serial.h" - > - </File> - <File - RelativePath="vrpn_sgibox.h" - > - </File> - <File - RelativePath="vrpn_Shared.h" - > - </File> - <File - RelativePath="vrpn_SharedObject.h" - > - </File> - <File - RelativePath="vrpn_Sound.h" - > - </File> - <File - RelativePath="vrpn_Spaceball.h" - > - </File> - <File - RelativePath="vrpn_Text.h" - > - </File> - <File - RelativePath="vrpn_Tng3.h" - > - </File> - <File - RelativePath="vrpn_Tracker.h" - > - </File> - <File - RelativePath="vrpn_Tracker_3DMouse.h" - > - </File> - <File - RelativePath="vrpn_Tracker_AnalogFly.h" - > - </File> - <File - RelativePath="vrpn_Tracker_ButtonFly.h" - > - </File> - <File - RelativePath="vrpn_Tracker_Crossbow.h" - > - </File> - <File - RelativePath="vrpn_Tracker_DTrack.h" - > - </File> - <File - RelativePath="vrpn_Tracker_Fastrak.h" - > - </File> - <File - RelativePath="vrpn_Tracker_Filter.h" - > - </File> - <File - RelativePath="vrpn_Tracker_GameTrak.h" - > - </File> - <File - RelativePath="vrpn_Tracker_GPS.h" - > - </File> - <File - RelativePath="vrpn_Tracker_isense.h" - > - </File> - <File - RelativePath="vrpn_Tracker_Isotrak.h" - > - </File> - <File - RelativePath="vrpn_Tracker_JsonNet.h" - > - </File> - <File - RelativePath="vrpn_Tracker_Liberty.h" - > - </File> - <File - RelativePath="vrpn_Tracker_LibertyHS.h" - > - </File> - <File - RelativePath="vrpn_Tracker_MotionNode.h" - > - </File> - <File - RelativePath="vrpn_Tracker_NDI_Polaris.h" - > - </File> - <File - RelativePath="vrpn_Tracker_NovintFalcon.h" - > - </File> - <File - RelativePath="vrpn_Tracker_PDI.h" - > - </File> - <File - RelativePath="vrpn_Tracker_PhaseSpace.h" - > - </File> - <File - RelativePath="vrpn_Tracker_RazerHydra.h" - > - </File> - <File - RelativePath="vrpn_Tracker_SpacePoint.h" - > - </File> - <File - RelativePath="vrpn_Tracker_TrivisioColibri.h" - > - </File> - <File - RelativePath="vrpn_Tracker_ViewPoint.h" - > - </File> - <File - RelativePath="vrpn_Tracker_WiimoteHead.h" - > - </File> - <File - RelativePath="vrpn_Tracker_Wintracker.h" - > - </File> - <File - RelativePath="vrpn_Tracker_zSight.h" - > - </File> - <File - RelativePath="vrpn_Types.h" - > - </File> - <File - RelativePath="vrpn_UNC_Joystick.h" - > - </File> - <File - RelativePath="vrpn_VPJoystick.h" - > - </File> - <File - RelativePath="vrpn_Wanda.h" - > - </File> - <File - RelativePath="vrpn_WiiMote.h" - > - </File> - <File - RelativePath="vrpn_XInputGamepad.h" - > - </File> - <File - RelativePath="vrpn_Xkeys.h" - > - </File> - <File - RelativePath="vrpn_YEI_3Space.h" - > - </File> - <File - RelativePath="vrpn_Zaber.h" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn/vrpn_3DConnexion.C b/src/vrpn/vrpn_3DConnexion.C deleted file mode 100644 index ce5639f27a36a4a68a6d8e76e74ac33c182d1741..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_3DConnexion.C +++ /dev/null @@ -1,356 +0,0 @@ -// vrpn_3DConnexion.C: VRPN driver for 3DConnexion -// Space Navigator, Space Traveler, Space Explorer, Space Mouse, Spaceball 5000 -#include <string.h> // for memset - -#include "vrpn_3DConnexion.h" -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_WARNING - -// There is a non-HID Linux-based driver for this device that has a capability -// not implemented in the HID interface. It uses the input.h interface. -#if defined(linux) && !defined(VRPN_USE_HID) -#define VRPN_USING_3DCONNEXION_EVENT_IFACE -#include <linux/input.h> -#include <stdlib.h> // for malloc, free, etc -#include <unistd.h> // for write, etc -#endif - -typedef struct input_devinfo { - vrpn_uint16 bustype; - vrpn_uint16 vendor; - vrpn_uint16 product; - vrpn_uint16 version; -} XXX_should_have_been_in_system_includes; - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 vrpn_3DCONNEXION_VENDOR = 0x046d; //1133; // 3Dconnexion is made by Logitech -static const vrpn_uint16 vrpn_SPACEMOUSEWIRELESS_VENDOR = 9583; // Made by a different vendor... -static const vrpn_uint16 vrpn_3DCONNEXION_TRAVELER = 50723; -static const vrpn_uint16 vrpn_3DCONNEXION_NAVIGATOR = 50726; -static const vrpn_uint16 vrpn_3DCONNEXION_NAVIGATOR_FOR_NOTEBOOKS = 0xc628; // 50728; -static const vrpn_uint16 vrpn_3DCONNEXION_SPACEEXPLORER = 0xc627; // 50727 -static const vrpn_uint16 vrpn_3DCONNEXION_SPACEMOUSE = 50691; -static const vrpn_uint16 vrpn_3DCONNEXION_SPACEMOUSEPRO = 50731; -static const vrpn_uint16 vrpn_3DCONNEXION_SPACEMOUSEWIRELESS = 50735; -static const vrpn_uint16 vrpn_3DCONNEXION_SPACEBALL5000 = 0xc621; // 50721; -static const vrpn_uint16 vrpn_3DCONNEXION_SPACEPILOT = 0xc625; - -vrpn_3DConnexion::vrpn_3DConnexion(vrpn_HidAcceptor *filter, unsigned num_buttons, - const char *name, vrpn_Connection *c) - : vrpn_Button_Filter(name, c) - , vrpn_Analog(name, c) -#if defined(VRPN_USE_HID) - , vrpn_HidInterface(filter) -#endif - , _filter(filter) -{ - vrpn_Analog::num_channel = 6; - vrpn_Button::num_buttons = num_buttons; - - // Initialize the state of all the analogs and buttons - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); - -// There is a non-HID Linux-based driver for this device that has a capability -// not implemented in the HID interface. It is implemented using the Event -// interface. -#if defined(VRPN_USING_3DCONNEXION_EVENT_IFACE) - // Use the Event interface to open devices looking for the one - // we want. Call the acceptor with all the devices we find - // until we get one that we want. - fd = -1; - FILE *f; - int i = 0; - - // try to autodetect the device - char *fname = (char *)malloc(1000*sizeof(char)); - while(i < 256) { - sprintf(fname, "/dev/input/event%d", i++); - f = fopen(fname, "r+b"); - if(f) { - // We got an active device. Fill in its values and see if it - // is acceptable to the filter. - struct input_devinfo ID; - ioctl(fileno(f), EVIOCGID, &ID); - vrpn_HIDDEVINFO info; - info.product = ID.product; - info.vendor = ID.vendor; - if (_filter->accept(info)) { - fd = fileno(f); - set_led(1); - break; - } else { - fclose(f); - f = NULL; - } - } - } - - if(!f) { - perror("Could not open the device"); - exit(1); - } - - fclose(f); - free(fname); - - // turn the LED on - set_led(1); -#endif -} - -vrpn_3DConnexion::~vrpn_3DConnexion() -{ -#if defined(VRPN_USING_3DCONNEXION_EVENT_IFACE) - set_led(0); -#endif - delete _filter; -} - -#if defined(VRPN_USE_HID) -void vrpn_3DConnexion::on_data_received(size_t bytes, vrpn_uint8 *buffer) -{ - decodePacket(bytes, buffer); -} -#endif - -void vrpn_3DConnexion::mainloop() -{ -#if defined(VRPN_USE_HID) - // Full reports are 7 bytes long. - // XXX If we get a 2-byte report mixed in, then something is going to get - // truncated. - update(); -#elif defined(VRPN_USING_3DCONNEXION_EVENT_IFACE) - struct timeval zerotime; - fd_set fdset; - struct input_event ev; - int i; - - zerotime.tv_sec = 0; - zerotime.tv_usec = 0; - - FD_ZERO(&fdset); /* clear fdset */ - FD_SET(fd, &fdset); /* include fd in fdset */ - int moreData = 0; - do { - vrpn_noint_select(fd + 1, &fdset, NULL, NULL, &zerotime); - moreData = 0; - if (FD_ISSET(fd, &fdset)) { - moreData = 1; - if (vrpn_noint_block_read(fd, reinterpret_cast<char*>(&ev), sizeof(struct input_event)) != sizeof(struct input_event)) { - send_text_message("Error reading from vrpn_3DConnexion", vrpn_Analog::timestamp, vrpn_TEXT_ERROR); - if (d_connection) { d_connection->send_pending_reports(); } - return; - } - switch (ev.type) { - case EV_KEY: // button movement - vrpn_gettimeofday((timeval *)&this->vrpn_Button::timestamp, NULL); - buttons[ev.code & 0x0ff] = ev.value; - break; - - case EV_REL: // axis movement - case EV_ABS: // new kernels send more logical _ABS instead of _REL - vrpn_gettimeofday((timeval *)&this->vrpn_Analog::timestamp, NULL); - // Convert from short to int to avoid a short/double conversion - // bug in GCC 3.2. - i = ev.value; - channel[ev.code] = static_cast<double>(i)/400.0; - break; - - default: - break; - } - } - report_changes(); - } while (moreData == 1); -#endif - - server_mainloop(); - vrpn_gettimeofday(&_timestamp, NULL); -} - -void vrpn_3DConnexion::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_3DConnexion::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -#if defined(linux) && !defined(VRPN_USE_HID) -int vrpn_3DConnexion::set_led(int led_state) -{ - struct input_event event; - int ret; - - event.type = EV_LED; - event.code = LED_MISC; - event.value = led_state; - - ret = write(fd, &event, sizeof(struct input_event)); - if (ret < 0) { - perror ("setting led state failed"); - } - return ret < static_cast<int>(sizeof(struct input_event)); -} -#endif - -#if defined(VRPN_USE_HID) -void vrpn_3DConnexion::decodePacket(size_t bytes, vrpn_uint8 *buffer) -{ - // Force 'small' buffers (ie button under linux - 3 bytes - and apple - 2 bytes - into 7 bytes - // so we get through the report loop once. XXX Problem: this is skipping 7 bytes per report - // regardless of how many bytes were in the report. This is going to get us into trouble for - // multi-report packets. Instead, we should go until we've parsed all characters and add the - // number of characters parsed each time rather than a constant 7 reports. - if(bytes<7) bytes=7; - if (bytes > 7) { - fprintf(stderr, "vrpn_3DConnexion::decodePacket(): Long packet (%d bytes), may mis-parse\n", - static_cast<int>(bytes)); - } - // Decode all full reports. - // Full reports for all of the pro devices are 7 bytes long (the first - // byte is the report type, because this device has multiple ones the - // HIDAPI library leaves it in the report). - for (size_t i = 0; i < bytes / 7; i++) { - vrpn_uint8 *report = buffer + (i * 7); - - // There are three types of reports. Parse whichever type - // this is. - char report_type = report[0]; - vrpn_uint8 *bufptr = &report[1]; - const float scale = 1.0f/400.0f; - switch (report_type) { - // Report types 1 and 2 come one after the other. Each seems - // to change when the puck is moved. It looks like each pair - // of values records a signed value for one channel; report - // type 1 is translation and report type 2 is rotation. - // The minimum and maximum values seem to vary somewhat. - // They all seem to be able to get over 400, so we scale - // by 400 and then clamp to (-1..1). - // The first byte is the low-order byte and the second is the - // high-order byte. - case 1: - channel[0] = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr) * scale; - if (channel[0] < -1.0) { channel[0] = -1.0; } - if (channel[0] > 1.0) { channel[0] = 1.0; } - channel[1] = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr) * scale; - if (channel[1] < -1.0) { channel[1] = -1.0; } - if (channel[1] > 1.0) { channel[1] = 1.0; } - channel[2] = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr) * scale; - if (channel[2] < -1.0) { channel[2] = -1.0; } - if (channel[2] > 1.0) { channel[2] = 1.0; } - break; - - case 2: - channel[3] = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr) * scale; - if (channel[3] < -1.0) { channel[3] = -1.0; } - if (channel[3] > 1.0) { channel[3] = 1.0; } - channel[4] = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr) * scale; - if (channel[4] < -1.0) { channel[4] = -1.0; } - if (channel[4] > 1.0) { channel[4] = 1.0; } - channel[5] = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr) * scale; - if (channel[5] < -1.0) { channel[5] = -1.0; } - if (channel[5] > 1.0) { channel[5] = 1.0; } - break; - - case 3: { // Button report - int btn; - - // Button reports are encoded as bits in the first 2 bytes - // after the type. There can be more than one byte if there - // are more than 8 buttons such as on SpaceExplorer or SpaceBall5000. - // If 8 or less, we don't look at 2nd byte. - // SpaceExplorer buttons are (for example): - // Name Number - // 1 0 - // 2 1 - // T 2 - // L 3 - // R 4 - // F 5 - // ESC 6 - // ALT 7 - // SHIFT 8 - // CTRL 9 - // FIT 10 - // PANEL 11 - // + 12 - // - 13 - // 2D 14 - - for (btn = 0; btn < vrpn_Button::num_buttons; btn++) { - vrpn_uint8 *location, mask; - location = report + 1 + (btn / 8); - mask = 1 << (btn % 8); - buttons[btn] = ( (*location) & mask) != 0; - } - break; - } - - default: - vrpn_gettimeofday(&_timestamp, NULL); - send_text_message("Unknown report type", _timestamp, vrpn_TEXT_WARNING); - } - // Report this event before parsing the next. - report_changes(); - } -} -#endif - -vrpn_3DConnexion_Navigator::vrpn_3DConnexion_Navigator(const char *name, vrpn_Connection *c) - : vrpn_3DConnexion(_filter = new vrpn_HidProductAcceptor(vrpn_3DCONNEXION_VENDOR, vrpn_3DCONNEXION_NAVIGATOR), 2, name, c) -{ -} - -vrpn_3DConnexion_Navigator_for_Notebooks::vrpn_3DConnexion_Navigator_for_Notebooks(const char *name, vrpn_Connection *c) - : vrpn_3DConnexion(_filter = new vrpn_HidProductAcceptor(vrpn_3DCONNEXION_VENDOR, vrpn_3DCONNEXION_NAVIGATOR_FOR_NOTEBOOKS), 2, name, c) -{ -} - -vrpn_3DConnexion_Traveler::vrpn_3DConnexion_Traveler(const char *name, vrpn_Connection *c) - : vrpn_3DConnexion(_filter = new vrpn_HidProductAcceptor(vrpn_3DCONNEXION_VENDOR, vrpn_3DCONNEXION_TRAVELER), 8, name, c) -{ -} - -vrpn_3DConnexion_SpaceMouse::vrpn_3DConnexion_SpaceMouse(const char *name, vrpn_Connection *c) - : vrpn_3DConnexion(_filter = new vrpn_HidProductAcceptor(vrpn_3DCONNEXION_VENDOR, vrpn_3DCONNEXION_SPACEMOUSE), 11, name, c) -{ -} - -vrpn_3DConnexion_SpaceMousePro::vrpn_3DConnexion_SpaceMousePro(const char *name, vrpn_Connection *c) -: vrpn_3DConnexion(_filter = new vrpn_HidProductAcceptor(vrpn_3DCONNEXION_VENDOR, vrpn_3DCONNEXION_SPACEMOUSEPRO), 27, name, c) -{ // 15 physical buttons are numbered: 0-2, 4-5, 8, 12-15, 22-26 -} - -vrpn_3DConnexion_SpaceMouseWireless::vrpn_3DConnexion_SpaceMouseWireless(const char *name, vrpn_Connection *c) - : vrpn_3DConnexion(_filter = new vrpn_HidProductAcceptor(vrpn_SPACEMOUSEWIRELESS_VENDOR, vrpn_3DCONNEXION_SPACEMOUSEWIRELESS), 2, name, c) -{ -} - -vrpn_3DConnexion_SpaceExplorer::vrpn_3DConnexion_SpaceExplorer(const char *name, vrpn_Connection *c) - : vrpn_3DConnexion(_filter = new vrpn_HidProductAcceptor(vrpn_3DCONNEXION_VENDOR, vrpn_3DCONNEXION_SPACEEXPLORER), 15, name, c) -{ -} - -vrpn_3DConnexion_SpaceBall5000::vrpn_3DConnexion_SpaceBall5000(const char *name, vrpn_Connection *c) - : vrpn_3DConnexion(_filter = new vrpn_HidProductAcceptor(vrpn_3DCONNEXION_VENDOR, vrpn_3DCONNEXION_SPACEBALL5000), 12, name, c) -{ -} - -vrpn_3DConnexion_SpacePilot::vrpn_3DConnexion_SpacePilot(const char *name, vrpn_Connection *c) - : vrpn_3DConnexion(_filter = new vrpn_HidProductAcceptor(vrpn_3DCONNEXION_VENDOR, vrpn_3DCONNEXION_SPACEPILOT), 21, name, c) -{ -} diff --git a/src/vrpn/vrpn_3DConnexion.h b/src/vrpn/vrpn_3DConnexion.h deleted file mode 100644 index 2a97436fa9a596f8d8775b33313d522fa943c399..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_3DConnexion.h +++ /dev/null @@ -1,173 +0,0 @@ -#ifndef VRPN_3DCONNEXION_H -#define VRPN_3DCONNEXION_H - -#include <stddef.h> // for size_t - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API, VRPN_USE_HID -#include "vrpn_Connection.h" // for vrpn_Connection (ptr only), etc -#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32, vrpn_uint8 - -// Device drivers for the 3DConnexion SpaceNavigator and SpaceTraveler -// SpaceExplorer, SpaceMouse, SpaceMousePro, Spaceball5000, SpacePilot -// devices, connecting to them as HID devices (USB). - -// Exposes two VRPN device classes: Button and Analog. -// Analogs are mapped to the six channels, each in the range (-1..1). - -// This is the base driver for the devices. The Navigator has -// only two buttons and has product ID 50726, the traveler has 8 -// buttons and ID 50723. The derived classes just construct with -// the appropriate number of buttons and an acceptor for the proper -// product ID; the baseclass does all the work. - -#if defined(VRPN_USE_HID) -class VRPN_API vrpn_3DConnexion: public vrpn_Button_Filter, public vrpn_Analog, protected vrpn_HidInterface { -public: - vrpn_3DConnexion(vrpn_HidAcceptor *filter, unsigned num_buttons, - const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_3DConnexion(); - - virtual void mainloop(); - -protected: - // Set up message handlers, etc. - void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer); - struct timeval _timestamp; - vrpn_HidAcceptor *_filter; - - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button or vrpn_Dial -}; -#else // not VRPN_USE_HID -class VRPN_API vrpn_3DConnexion: public vrpn_Button_Filter, public vrpn_Analog { -public: - vrpn_3DConnexion(vrpn_HidAcceptor *filter, unsigned num_buttons, - const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_3DConnexion(); - - virtual void mainloop(); - -protected: - struct timeval _timestamp; - vrpn_HidAcceptor *_filter; - int fd; - - // Send report iff changed - void report_changes(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button or vrpn_Dial - -// There is a non-HID Linux-based driver for this device that has a capability -// not implemented in the HID interface. -#if defined(linux) && !defined(VRPN_USE_HID) - int set_led(int led_state); -#endif -}; -#endif // not VRPN_USE_HID - -class VRPN_API vrpn_3DConnexion_Navigator: public vrpn_3DConnexion { -public: - vrpn_3DConnexion_Navigator(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_3DConnexion_Navigator() {}; - -protected: -}; - -class VRPN_API vrpn_3DConnexion_Navigator_for_Notebooks: public vrpn_3DConnexion { -public: - vrpn_3DConnexion_Navigator_for_Notebooks(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_3DConnexion_Navigator_for_Notebooks() {}; - -protected: -}; - -class VRPN_API vrpn_3DConnexion_Traveler: public vrpn_3DConnexion { -public: - vrpn_3DConnexion_Traveler(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_3DConnexion_Traveler() {}; - -protected: -}; - -class VRPN_API vrpn_3DConnexion_SpaceMouse: public vrpn_3DConnexion { -public: - vrpn_3DConnexion_SpaceMouse(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_3DConnexion_SpaceMouse() {}; - -protected: -}; - -/* -The button numbers are labeled as follows (the ones similar to <x> have a graphic on the button and are referred to the text enclosed text in the help): -0=Menu -1=Fit -2=<T> -4=<R> -5=<F> -8=<Roll+> -12=1 -13=2 -14=3 -15=4 -22=Esc -23=Alt -24=Shift -25=Ctrl -26=<Rot> -*/ - -class VRPN_API vrpn_3DConnexion_SpaceMousePro: public vrpn_3DConnexion { -public: - vrpn_3DConnexion_SpaceMousePro(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_3DConnexion_SpaceMousePro() {}; - -protected: -}; - -class VRPN_API vrpn_3DConnexion_SpaceMouseWireless : public vrpn_3DConnexion { -public: - vrpn_3DConnexion_SpaceMouseWireless(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_3DConnexion_SpaceMouseWireless() {}; - -protected: -}; - -class VRPN_API vrpn_3DConnexion_SpaceExplorer : public vrpn_3DConnexion { -public: - vrpn_3DConnexion_SpaceExplorer(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_3DConnexion_SpaceExplorer() {}; - -protected: -}; - -class VRPN_API vrpn_3DConnexion_SpaceBall5000: public vrpn_3DConnexion { -public: - vrpn_3DConnexion_SpaceBall5000(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_3DConnexion_SpaceBall5000() {}; - -protected: -}; - -class VRPN_API vrpn_3DConnexion_SpacePilot: public vrpn_3DConnexion { -public: - vrpn_3DConnexion_SpacePilot(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_3DConnexion_SpacePilot() {}; - -protected: -}; - -// end of VRPN_3DCONNEXION_H -#endif - diff --git a/src/vrpn/vrpn_3DMicroscribe.C b/src/vrpn/vrpn_3DMicroscribe.C deleted file mode 100644 index 3cf3dd198262455112a79eb9239fbbffdfd54406..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_3DMicroscribe.C +++ /dev/null @@ -1,304 +0,0 @@ - -#include <math.h> // for cos, sin -#include <stdio.h> // for fprintf, stderr -#include <string.h> // for strcmp, NULL - -#include "vrpn_3DMicroscribe.h" -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday -#include "vrpn_MessageMacros.h" - -#ifdef VRPN_USE_MICROSCRIBE -#include "armdll32.h" -#endif - - -// turn on for debugging code, leave off otherwise -#undef VERBOSE - -#if defined(VERBOSE) -#include <ctype.h> // for isprint() - -#define DEBUG 1 -#endif - -// Defines the modes in which the box can find itself. -#define STATUS_RESETTING (-1) // Resetting the device -#define STATUS_SYNCING (0) // Looking for the first char of report -#define STATUS_READING (1) // Looking for the rest of the report -#define MAX_TIME_INTERVAL (2000000) // max time between reports (usec) - -#define MM_TO_METERS 0.001 - -#define VR_PI 3.14159265359 -inline float pcos(float x) {return (float)cos(double(x)*VR_PI/180.0f);} -inline float psin(float x) {return (float)sin(double(x)*VR_PI/180.0f);} - -// This creates a vrpn_3DMicroscribe and sets it to reset mode. -vrpn_3DMicroscribe::vrpn_3DMicroscribe (const char * name, vrpn_Connection * c, - const char * Port, long int BaudRate, - float OffsetX/* = 0.0f*/, - float OffsetY/* = 0.0f*/, - float OffsetZ/* = 0.0f*/, - float Scale/*=1.0f*/): - vrpn_Tracker(name, c), - vrpn_Button_Filter(name, c), - _numbuttons(2) -{ - // Set the parameters in the parent classes - vrpn_Button::num_buttons = _numbuttons; - - if(!strcmp(Port, "COM1") ) - m_PortNumber=1; - else if(!strcmp(Port, "COM2") ) - m_PortNumber=2; - else if(!strcmp(Port, "COM3") ) - m_PortNumber=3; - else if(!strcmp(Port, "COM4") ) - m_PortNumber=4; - m_BaudRate=BaudRate; - m_OffSet[0]=OffsetX; m_OffSet[1]=OffsetY; m_OffSet[2]=OffsetZ; - m_Scale=Scale; - - // Set the status of the buttons and analogs to 0 to start - clear_values(); - -#ifdef VRPN_USE_MICROSCRIBE - int iResult; - iResult=ArmStart(NULL); - if(ARM_SUCCESS != iResult) - { - //error starting the MicroScribe drivers - VRPN_MSG_ERROR( "Unable to start MicroScribe ArmDll32." ); - return; - } - - //don't use error handlers - iResult = ArmSetErrorHandlerFunction(NO_HCI_HANDLER, NULL); - iResult = ArmSetErrorHandlerFunction(BAD_PORT_HANDLER, NULL); - iResult = ArmSetErrorHandlerFunction(CANT_OPEN_HANDLER, NULL); - iResult = ArmSetErrorHandlerFunction(CANT_BEGIN_HANDLER, NULL); - - //connect to the correct port - switch(m_PortNumber) - { - case 1: - iResult = ArmConnect(1, m_BaudRate); - break; - case 2: - iResult = ArmConnect(2, m_BaudRate); - break; - case 3: - iResult = ArmConnect(3, m_BaudRate); - break; - case 4: - iResult = ArmConnect(4, m_BaudRate); - break; - default: - iResult = ArmConnect(0, 0); //try all available ports and baud rates - break; - } - - if(ARM_SUCCESS != iResult) - { - //error connecting, end the thread - ArmEnd(); - VRPN_MSG_ERROR( "Unable to connect to the MicroScribe." ); - return; - } - -#endif - // Set the mode to reset - status = STATUS_RESETTING; -} - -void vrpn_3DMicroscribe::clear_values(void) -{ -} - -// This routine will reset the 3DMicroscribe, zeroing the Origin position, -// mode. -int vrpn_3DMicroscribe::reset(void) -{ -#ifdef VRPN_USE_MICROSCRIBE - int iResult; - // ARM_FULL: ArmDll32 calculates and updates the Cartesian position and orientation of the stylus tip. - iResult = ArmSetUpdate(ARM_FULL); - - if(iResult != ARM_SUCCESS) - { - //error setting the update type, disconnect and end the thread - VRPN_MSG_ERROR( "Unable to set the update type for the MicroScribe." ); - return -1; - } - - //use mm instead of inches - ArmSetLengthUnits(ARM_MM); - //use radians instead of degrees - //ArmSetAngleUnits(ARM_RADIANS); - - //get the position of the tip - length_3D tipPosition; - angle_3D tipVector; - - iResult = ArmGetTipPosition(&tipPosition); //retrieves the current stylus tip position in Cartesian coordinates - iResult = ArmGetTipOrientationUnitVector(&tipVector); //retrieves the current stylus tip's unit vector orientation - - if(iResult == ARM_NOT_CONNECTED) - { - //error connecting - VRPN_MSG_ERROR( "MicroScribe connection lost!" ); - return -1; - } - -#endif - // We're now waiting for a response from the box - status = STATUS_SYNCING; - - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - return 0; -} - - - -// This function will read characters until it has a full report, then -// put that report into the time, analog, or button fields and call -// the report methods on these. The time stored is that of -// the first character received as part of the report. -// Reports start with different characters, and the length of the report -// depends on what the first character of the report is. We switch based -// on the first character of the report to see how many more to expect and -// to see how to handle the report. -// Returns 1 if there is a complete report found, 0 otherwise. This is -// so that the calling routine can know to check again at the end of complete -// reports to see if there is more than one report buffered up. - -int vrpn_3DMicroscribe::get_report(void) -{ -#ifdef VRPN_USE_MICROSCRIBE - length_3D tipPosition; - angle_3D tipOri; - DWORD buts; - int iResult = ArmGetTipPosition(&tipPosition); //retrieves the current stylus tip position in Cartesian coordinates - iResult = ArmGetTipOrientation(&tipOri); //retrieves the current stylus tip's unit vector orientation - iResult = ArmGetButtonsState(&buts); - if(iResult == ARM_NOT_CONNECTED) - { - //error connecting - VRPN_MSG_ERROR( "MicroScribe connection lost!" ); - return 0; - } - - //set the position, considering the scale, offset and origin matrix - pos[0] = (tipPosition.y * m_Scale + m_OffSet[0])* MM_TO_METERS ; - pos[1] = (tipPosition.z * m_Scale + m_OffSet[1])* MM_TO_METERS; - pos[2] = (tipPosition.x * m_Scale + m_OffSet[2])* MM_TO_METERS; - //vPosition = m_Matrix * vPosition + m_vPlaneOffset; extending the microscribe onto a plane - - //set the orientation, considering the origin matrix - float ori[3]={tipOri.y, tipOri.z, tipOri.x}; - ConvertOriToQuat(ori); - - - status = STATUS_READING; // ready to process event packet - vrpn_gettimeofday(×tamp, NULL); // set timestamp of this event - - buttons[0] = ((buts & 0x02) != 0); // button 1 - buttons[1] = ((buts & 0x01) != 0); // button 2 - -#endif - - report_changes(); // Report updates to VRPN - return 0; -} - -void vrpn_3DMicroscribe::ConvertOriToQuat(float ori[3]) -{ - float real0,real1,real2,real; - float imag0,imag1,imag2,imag[3]; - - real0= pcos(ori[0]/2); - real1= pcos(ori[1]/2); - real2= pcos(ori[2]/2); - - imag0 = psin(ori[0]/2); - imag1 = psin(ori[1]/2); - imag2 = psin(ori[2]/2); - - // merge the first two quats - real = real0 * real1 ; - - if ( real > 1 ) - real = 1; - else if ( real < -1 ) - real = -1; - - imag[0] = imag0 * real1; - imag[1] = real0 * imag1; - imag[2] = imag0 * imag1; - - // merge previous result with last quat - - d_quat[0] = real * real2 - imag[2] * imag2 ; - - if ( d_quat[0] > 1 ) - d_quat[0] = 1; - else if ( d_quat[0] < -1 ) - d_quat[0] = -1; - - d_quat[1] = imag[0] * real2 + imag[1] * imag2; - d_quat[2] = imag[1] * real2 - imag[0] * imag2; - d_quat[3] = real * imag2 + imag[2] * real2; - -} - -void vrpn_3DMicroscribe::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Button::timestamp = timestamp; - vrpn_Tracker::timestamp = timestamp; - - vrpn_Button::report_changes(); - if (d_connection) { - char msgbuf[1000]; - int len = vrpn_Tracker::encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, - position_m_id, d_sender_id, msgbuf, - class_of_service)) { - VRPN_MSG_ERROR("Tracker: cannot write message: tossing\n"); - } - } else { - VRPN_MSG_ERROR("Tracker: No valid connection\n"); - } -} - -void vrpn_3DMicroscribe::report(vrpn_uint32 /*class_of_service*/) -{ - vrpn_Button::timestamp = timestamp; - vrpn_Button::report_changes(); -} - -// This routine is called each time through the server's main loop. It will -// take a course of action depending on the current status of the 3DMicroscribe, -// either trying to reset it or trying to get a reading from it. -void vrpn_3DMicroscribe::mainloop() -{ - server_mainloop(); - - switch(status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - // Keep getting reports until all full reports are read. - while (get_report()) {}; - break; - - default: - fprintf(stderr,"vrpn_3DMicroscribe: Unknown mode (internal error)\n"); - break; - } -} - - diff --git a/src/vrpn/vrpn_3DMicroscribe.h b/src/vrpn/vrpn_3DMicroscribe.h deleted file mode 100644 index 819878b561f9ada2470942f1fe4e0e6b0565fbc4..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_3DMicroscribe.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef VRPN_3DMICROSCRIBE_H -#define VRPN_3DMICROSCRIBE_H - -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker -#include "vrpn_Types.h" // for vrpn_uint32 - -class VRPN_API vrpn_3DMicroscribe: public vrpn_Tracker - ,public vrpn_Button_Filter -{ - public: - // Offset is in meters. Scale is an abomination and should not be - // used. All tracker reports should be in meters in VRPN. - vrpn_3DMicroscribe (const char * name, vrpn_Connection * c, - const char * Port, long int BaudRate, - float OffsetX = 0.0f, float OffsetY = 0.0f, float OffsetZ = 0.0f, - float Scale=1.0f); - - ~vrpn_3DMicroscribe () {}; - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - - virtual int reset(void); ///< Set device back to starting config - - protected: - float m_OffSet[3]; - float m_Scale; - int m_PortNumber; //!< port number - long int m_BaudRate; //!< baud rate - - - int _numbuttons; ///< How many buttons to open - unsigned char buf[512]; ///< Buffer of characters in report, - int bufpos; ///< Current char pos in buffer - int packtype; ///< What kind of packet we are decoding - int packlen; ///< Expected packet length - int escapedchar; ///< We're processing an escaped char - int erroroccured; ///< A device error has occurred - int resetoccured; ///< A reset event has occurred - struct timeval timestamp; ///< Time of the last report from the device - - void ConvertOriToQuat(float ori[3]); //< directly put the values in the quat for message sending - virtual void clear_values(void); ///< Set all buttons, analogs and encoders back to 0 - - /// Try to read reports from the device. Returns 1 if a complete - /// report received, 0 otherwise. Sets status to current mode. - virtual int get_report(void); - - /// send report if changed - virtual void report_changes (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - - /// send report whether or not changed - virtual void report (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - - // NOTE: class_of_service is only applied to vrpn_Tracker - // values, not vrpn_Button, which are always vrpn_RELIABLE -}; - -#endif diff --git a/src/vrpn/vrpn_3Space.C b/src/vrpn/vrpn_3Space.C deleted file mode 100644 index bd78bd3c42cd6aaefbab5de5d06500d1893d785f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_3Space.C +++ /dev/null @@ -1,266 +0,0 @@ -#include <ctype.h> // for isprint -#include <math.h> // for sqrt -#include <stdio.h> // for fprintf, stderr, perror, etc - -#include "quat.h" // for Q_W, Q_X, Q_Y, Q_Z -#include "vrpn_3Space.h" -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR, etc -#include "vrpn_Serial.h" // for vrpn_write_characters, etc -#include "vrpn_Shared.h" // for vrpn_SleepMsecs, etc -#include "vrpn_Tracker.h" // for vrpn_TRACKER_FAIL, etc -#include "vrpn_Types.h" // for vrpn_int16, vrpn_float64 - -// This constant turns the tracker binary values in the range -32768 to -// 32768 to meters. -#define T_3_DATA_MAX (32768.0) -#define T_3_INCH_RANGE (65.48) -#define T_3_CM_RANGE (T_3_INCH_RANGE * 2.54) -#define T_3_METER_RANGE (T_3_CM_RANGE / 100.0) -#define T_3_BINARY_TO_METERS (T_3_METER_RANGE / T_3_DATA_MAX) - -void vrpn_Tracker_3Space::reset() -{ - int i,resetLen,ret; - unsigned char reset[10]; - - // Send the tracker a string that should reset it. The first time we - // try this, just do the normal ^Y reset. Later, try to reset - // to the factory defaults. Then toggle the extended mode. - // Then put in a carriage return to try and break it out of - // a query mode if it is in one. These additions are cumulative: by the - // end, we're doing them all. - resetLen = 0; - d_numResets++; // We're trying another reset - if (d_numResets > 1) { // Try to get it out of a query loop if its in one - reset[resetLen++] = (char) (13); // Return key -> get ready - } - if (d_numResets > 7) { - reset[resetLen++] = 'Y'; // Put tracker into tracking (not point) mode - } - if (d_numResets > 3) { // Get a little more aggressive - if (d_numResets > 4) { // Even more aggressive - reset[resetLen++] = 't'; // Toggle extended mode (in case it is on) - } - reset[resetLen++] = 'W'; // Reset to factory defaults - reset[resetLen++] = (char) (11); // Ctrl + k --> Burn settings into EPROM - } - reset[resetLen++] = (char) (25); // Ctrl + Y -> reset the tracker - send_text_message("Resetting", timestamp, vrpn_TEXT_ERROR, d_numResets); - for (i = 0; i < resetLen; i++) { - if (vrpn_write_characters(serial_fd, &reset[i], 1) == 1) { - vrpn_SleepMsecs(1000*2); // Wait 2 seconds each character - } else { - send_text_message("Failed writing to tracker", timestamp, vrpn_TEXT_ERROR, d_numResets); - perror("3Space: Failed writing to tracker"); - status = vrpn_TRACKER_FAIL; - return; - } - } - vrpn_SleepMsecs(1000.0*10); // Sleep to let the reset happen - - // Get rid of the characters left over from before the reset - vrpn_flush_input_buffer(serial_fd); - - // Make sure that the tracker has stopped sending characters - vrpn_SleepMsecs(1000.0*2); - unsigned char scrap[80]; - if ( (ret = vrpn_read_available_characters(serial_fd, scrap, 80)) != 0) { - fprintf(stderr," 3Space warning: got >=%d characters after reset:\n",ret); - for (i = 0; i < ret; i++) { - if (isprint(scrap[i])) { - fprintf(stderr,"%c",scrap[i]); - } else { - fprintf(stderr,"[0x%02X]",scrap[i]); - } - } - fprintf(stderr, "\n"); - vrpn_flush_input_buffer(serial_fd); // Flush what's left - } - - // Asking for tracker status - if (vrpn_write_characters(serial_fd, (const unsigned char *) "S", 1) == 1) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" 3Space write failed"); - status = vrpn_TRACKER_FAIL; - return; - } - - // Read Status - unsigned char statusmsg[56]; - if ( (ret = vrpn_read_available_characters(serial_fd, statusmsg, 55)) != 55){ - fprintf(stderr, " Got %d of 55 characters for status\n",ret); - } - if ( (statusmsg[0]!='2') || (statusmsg[54]!=(char)(10)) ) { - int i; - statusmsg[55] = '\0'; // Null-terminate the string - fprintf(stderr, " Tracker: status is ("); - for (i = 0; i < 55; i++) { - if (isprint(statusmsg[i])) { - fprintf(stderr,"%c",statusmsg[i]); - } else { - fprintf(stderr,"[0x%02X]",statusmsg[i]); - } - } - fprintf(stderr, ")\n Bad status report from tracker, retrying reset\n"); - return; - } else { - send_text_message("Got status (tracker back up)!", timestamp, vrpn_TEXT_ERROR, 0); - d_numResets = 0; // Success, use simple reset next time - } - - // Set output format to be position,quaternion - // These are a capitol 'o' followed by comma-separated values that - // indicate data sets according to appendix F of the 3Space manual, - // then followed by character 13 (octal 15). - if (vrpn_write_characters(serial_fd, (const unsigned char *)"O2,11\015", 6) == 6) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" 3Space write failed"); - status = vrpn_TRACKER_FAIL; - return; - } - - // Set data format to BINARY mode - vrpn_write_characters(serial_fd, (const unsigned char *)"f", 1); - - // Set tracker to continuous mode - if (vrpn_write_characters(serial_fd,(const unsigned char *) "C", 1) != 1) - perror(" 3Space write failed"); - else { - fprintf(stderr, " 3Space set to continuous mode\n"); - } - - fprintf(stderr, " (at the end of 3Space reset routine)\n"); - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - status = vrpn_TRACKER_SYNCING; // We're trying for a new reading -} - - -int vrpn_Tracker_3Space::get_report(void) -{ - int ret; - - // The reports are each 20 characters long, and each start with a - // byte that has the high bit set and no other bytes have the high - // bit set. If we're synching, read a byte at a time until we find - // one with the high bit set. - if (status == vrpn_TRACKER_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, buffer, 1) != 1) { - return 0; - } - - // If the high bit isn't set, we don't want it we - // need to look at the next one, so just return - if ( (buffer[0] & 0x80) == 0) { - send_text_message("Syncing (high bit not set)", timestamp, vrpn_TEXT_WARNING); - return 0; - } - - // Got the first character of a report -- go into PARTIAL mode - // and say that we got one character at this time. - bufcount = 1; - vrpn_gettimeofday(×tamp, NULL); - status = vrpn_TRACKER_PARTIAL; - } - - // Read as many bytes of this 20 as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. The routine that calls this one - // makes sure we get a full reading often enough (ie, it is responsible - // for doing the watchdog timing to make sure the tracker hasn't simply - // stopped sending characters). - ret = vrpn_read_available_characters(serial_fd, &buffer[bufcount], - 20-bufcount); - if (ret == -1) { - send_text_message("Error reading, resetting", timestamp, vrpn_TEXT_ERROR); - status = vrpn_TRACKER_FAIL; - return 0; - } - bufcount += ret; - if (bufcount < 20) { // Not done -- go back for more - return 0; - } - - { // Decode the report - unsigned char decode[17]; - int i; - - const unsigned char mask[8] = {0x01, 0x02, 0x04, 0x08, - 0x10, 0x20, 0x40, 0x80 }; - // Clear the MSB in the first byte - buffer[0] &= 0x7F; - - // Decode the 3Space binary representation into standard - // 8-bit bytes. This is done according to page 4-4 of the - // 3Space user's manual, which says that the high-order bits - // of each group of 7 bytes is packed into the 8th byte of the - // group. Decoding involves setting those bits in the bytes - // iff their encoded counterpart is set and then skipping the - // byte that holds the encoded bits. - // We decode from buffer[] into decode[] (which is 3 bytes - // shorter due to the removal of the bit-encoding bytes). - - // decoding from buffer[0-6] into decode[0-6] - for (i=0; i<7; i++) { - decode[i] = buffer[i]; - if ( (buffer[7] & mask[i]) != 0) { - decode[i] |= (unsigned char)(0x80); - } - } - - // decoding from buffer[8-14] into decode[7-13] - for (i=7; i<14; i++) { - decode[i] = buffer[i+1]; - if ( (buffer[15] & mask[i-7]) != 0) { - decode[i] |= (unsigned char)(0x80); - } - } - - // decoding from buffer[16-18] into decode[14-16] - for (i=14; i<17; i++) { - decode[i] = buffer[i+2]; - if ( (buffer[19] & mask[i-14]) != 0) { - decode[i] |= (unsigned char)(0x80); - } - } - - // Parse out sensor number, which is the second byte and is - // stored as the ASCII number of the sensor, with numbers - // starting from '1'. We turn it into a zero-based unit number. - d_sensor = decode[1] - '1'; - - // Position - unsigned char * unbufPtr = &decode[3]; - pos[0] = vrpn_unbuffer_from_little_endian<vrpn_int16>(unbufPtr) * T_3_BINARY_TO_METERS; - pos[1] = vrpn_unbuffer_from_little_endian<vrpn_int16>(unbufPtr) * T_3_BINARY_TO_METERS; - pos[2] = vrpn_unbuffer_from_little_endian<vrpn_int16>(unbufPtr) * T_3_BINARY_TO_METERS; - - // Quarternion orientation. The 3Space gives quaternions - // as w,x,y,z while the VR code handles them as x,y,z,w, - // so we need to switch the order when decoding. Also the - // tracker does not normalize the quaternions. - d_quat[Q_W] = vrpn_unbuffer_from_little_endian<vrpn_int16>(unbufPtr); - d_quat[Q_X] = vrpn_unbuffer_from_little_endian<vrpn_int16>(unbufPtr); - d_quat[Q_Y] = vrpn_unbuffer_from_little_endian<vrpn_int16>(unbufPtr); - d_quat[Q_Z] = vrpn_unbuffer_from_little_endian<vrpn_int16>(unbufPtr); - - //Normalize quaternion - double norm = sqrt ( d_quat[0]*d_quat[0] + d_quat[1]*d_quat[1] - + d_quat[2]*d_quat[2] + d_quat[3]*d_quat[3]); - for (i=0; i<4; i++) { - d_quat[i] /= norm; - } - - // Done with the decoding, set the report to ready - // Ready for another report - status = vrpn_TRACKER_SYNCING; - bufcount = 0; - } - - return 1; // Got a report. -#ifdef VERBOSE - print_latest_report(); -#endif -} diff --git a/src/vrpn/vrpn_3Space.h b/src/vrpn/vrpn_3Space.h deleted file mode 100644 index baecd22a7512ceca5d3142e2a73ce99f7d71eaac..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_3Space.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef SPACE_H -#define SPACE_H - -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Tracker.h" // for vrpn_Tracker_Serial - -class VRPN_API vrpn_Connection; - -class VRPN_API vrpn_Tracker_3Space: public vrpn_Tracker_Serial { - - public: - - vrpn_Tracker_3Space(char *name, vrpn_Connection *c, - const char *port = "/dev/ttyS1", long baud = 19200) : - vrpn_Tracker_Serial(name,c,port,baud), d_numResets(0) {}; - - protected: - - /// Returns 0 if didn't get a complete report, 1 if it did. - virtual int get_report(void); - - virtual void reset(); - int d_numResets; - -}; - -#endif diff --git a/src/vrpn/vrpn_5DT16.C b/src/vrpn/vrpn_5DT16.C deleted file mode 100644 index e12025367e0d6d7d23b7992cfd6182aa895eeb36..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_5DT16.C +++ /dev/null @@ -1,353 +0,0 @@ -// This is a driver for the 5dt Data Glove 16 sensors -// Look at www.5dt.com for more informations about this product -// Manuals are avalaible freely from this site -// The original code for 5dt was written by Philippe DAVID with the help of Yves GAUVIN -// This version for the 16 sensor version was written by Tom De Weyer -// naming convention used in this file: -// l_ is the prefixe for local variables -// g_ is the prefixe for global variables -// p_ is the prefixe for parameters - -#include <stdio.h> // for sprintf, fprintf, stderr - -#include "vrpn_5DT16.h" -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR, etc -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_SleepMsecs, etc -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -#undef VERBOSE - -// Defines the modes in which the device can find itself. -#define STATUS_RESETTING (-1) // Resetting the device -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report - -#define MAX_TIME_INTERVAL (2000000) // max time between reports (usec) - - -/****************************************************************************** - * NAME : vrpn_5dt16::vrpn_5dt16 - * ROLE : This creates a vrpn_5dt16 and sets it to reset mode. It opens - * the serial device using the code in the vrpn_Serial_Analog constructor. - * ARGUMENTS : - * RETURN : - ******************************************************************************/ -vrpn_5dt16::vrpn_5dt16 (const char * p_name, vrpn_Connection * p_c, const char * p_port, int p_baud): - vrpn_Serial_Analog (p_name, p_c, p_port, p_baud, 8, vrpn_SER_PARITY_NONE), - _numchannels (17) // This is an estimate; will change when reports come -{ - // Set the parameters in the parent classes - vrpn_Analog::num_channel = _numchannels; - - // Set the status of the buttons and analogs to 0 to start - clear_values(); - - // Set the mode to reset - _status = STATUS_RESETTING; -} - - -/****************************************************************************** - * NAME : vrpn_5dt16::clear_values - * ROLE : - * ARGUMENTS : - * RETURN : - ******************************************************************************/ -void vrpn_5dt16::clear_values (void) -{ - int i; - - for (i = 0; i < _numchannels; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } -} - - -/****************************************************************************** - * NAME : vrpn_5dt16::reset - * ROLE : This routine will reset the 5DT - * ARGUMENTS : - * RETURN : 0 else -1 in case of error - ******************************************************************************/ -int vrpn_5dt16::reset (void) -{ - unsigned char l_inbuf [45]; - int l_ret; - bool found=false; - struct timeval start, now; - - vrpn_gettimeofday(&start, NULL); - while(!found) // read the begin sequence of an info packet "<I" - { - l_ret = vrpn_read_available_characters (serial_fd, l_inbuf, 1); - if(l_ret!=1) { - vrpn_SleepMsecs (100); //Give it time to send data - } else if(l_inbuf[0] == '<' ) { - while(!vrpn_read_available_characters (serial_fd, l_inbuf, 1)) { - vrpn_SleepMsecs (100); //Give it time to send data - } - if(l_inbuf[0]=='I') { - found=true; - } - } - // See if we've timed out on the reset - vrpn_gettimeofday(&now, NULL); - if (now.tv_sec > start.tv_sec + 2) { - fprintf(stderr,"vrpn_5dt16::reset(): Timeout during reset\n"); - return -1; - } - } - vrpn_SleepMsecs (100); //Give it time to send data - l_ret=vrpn_read_available_characters (serial_fd, l_inbuf, 5); // read the rest of the data - char text[50]; - sprintf(text,"Hardware Version %i.0%i",l_inbuf[0],l_inbuf[1]); // hardware version - VRPN_MSG_WARNING(text); - if (l_inbuf[2] | 1) //right or left glove - { - VRPN_MSG_WARNING ("A right glove is ready"); - } else { - VRPN_MSG_WARNING ("A left glove is ready"); - } - if (l_inbuf[3] | 1) //wireless glove or wired - { - VRPN_MSG_WARNING ("no wireless glove"); - } else { - VRPN_MSG_WARNING ("wireless glove"); - } - - // We're now entering the syncing mode which send the read command to the glove - _status = STATUS_READING; - _bufcount = 0; - - vrpn_gettimeofday (×tamp, NULL); // Set watchdog now - return 0; -} - -/****************************************************************************** - * NAME : vrpn_5dt16::get_report - * ROLE : This function will read characters until it has a full report, then - * put that report into analog fields and call the report methods on these. - * ARGUMENTS : void - * RETURN : void - ******************************************************************************/ -void vrpn_5dt16::get_report (void) -{ - int l_ret; // Return value from function call to be checked - - // The official doc (http://www.5dt.com/downloads/5DTDataGlove5Manual.pdf) - // says we should get 36 bytes, but once in a while an info packet arrives and we should - // ignore that packet. - _expected_chars = 36; - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. - //-------------------------------------------------------------------- - - l_ret = vrpn_read_available_characters (serial_fd, &_buffer [_bufcount], - _expected_chars - _bufcount); - if (l_ret == -1) { - VRPN_MSG_ERROR ("Error reading the glove"); - _status = STATUS_RESETTING; - return; - } -#ifdef VERBOSE - if (l_ret != 0) printf("... got %d characters (%d total)\n",l_ret, _bufcount); -#endif - - //-------------------------------------------------------------------- - // The time of the report is the time at which the first character for - // the report is read. - //-------------------------------------------------------------------- - - if ( (l_ret > 0) && (_bufcount == 0) ) { - vrpn_gettimeofday(×tamp, NULL); - } - - //-------------------------------------------------------------------- - // We keep track of how many characters we have received and keep - // going back until we get as many as we expect. - //-------------------------------------------------------------------- - - _bufcount += l_ret; - if (_bufcount < _expected_chars) { // Not done -- go back for more - return; - } - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. First check to - // make sure that the first one is what we expect. - - if (!( (_buffer[0] == '<') && (_buffer[1] == 'D') ) ) //first characters need to be <D - { - VRPN_MSG_INFO ("Unexpected first character in report, probably info packet (recovering)"); - for(int i=0;i<29;i++) { - _buffer[i]=_buffer[i+7]; - } - _bufcount=29; - return; - } - -#ifdef VERBOSE - printf ("Got a complete report (%d of %d)!\n", _bufcount, _expected_chars); -#endif - - //-------------------------------------------------------------------- - // Decode the report and store the values in it into the analog values - // if appropriate. - //-------------------------------------------------------------------- - - for(int i=0;i<16;i++) { - channel[i]=_buffer[i*2+2]*256+_buffer[i*2+3]; - } - char text[512]; - - sprintf(text,"original %f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f|%f\n",channel[0],channel[1],channel[2],channel[3],channel[4], - channel[5],channel[6],channel[7],channel[8],channel[9], - channel[10],channel[11],channel[12],channel[13],channel[14], - channel[15]); - VRPN_MSG_ERROR(text); - - //-------------------------------------------------------------------- - // Done with the decoding, send the reports and go back to syncing - //-------------------------------------------------------------------- - - report_changes(); - _bufcount =0; -} - - -/****************************************************************************** - * NAME : vrpn_5dt16::report_changes - * ROLE : - * ARGUMENTS : - * RETURN : void - ******************************************************************************/ -void vrpn_5dt16::report_changes (vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Analog::report_changes(class_of_service); -} - - -/****************************************************************************** - * NAME : vrpn_5dt16::report - * ROLE : - * ARGUMENTS : - * RETURN : void - ******************************************************************************/ -void vrpn_5dt16::report (vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Analog::report(class_of_service); -} - - -/****************************************************************************** - * NAME : vrpn_5dt16::mainloop - * ROLE : This routine is called each time through the server's main loop. It will - * take a course of action depending on the current status of the device, - * either trying to reset it or trying to get a reading from it. It will - * try to reset the device if no data has come from it for a couple of - * seconds - * ARGUMENTS : - * RETURN : void - ******************************************************************************/ -void vrpn_5dt16::mainloop () -{ - char l_errmsg[256]; - - server_mainloop(); - - switch (_status) { - case STATUS_RESETTING: - if (reset()== -1) - { - VRPN_MSG_ERROR ("vrpn_Analog_5dt: Cannot reset the glove!"); - } - break; - - case STATUS_READING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - get_report(); - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) > MAX_TIME_INTERVAL) - { - sprintf (l_errmsg, "vrpn_5dt16::mainloop: Timeout... current_time=%ld:%ld, timestamp=%ld:%ld", - current_time.tv_sec, - static_cast<long>(current_time.tv_usec), - timestamp.tv_sec, - static_cast<long>(timestamp.tv_usec)); - VRPN_MSG_ERROR (l_errmsg); - _status = STATUS_RESETTING; - } - } - break; - - default: - VRPN_MSG_ERROR ("vrpn_5dt16::mainloop: Unknown mode (internal error)"); - break; - } -} - -vrpn_Button_5DT_Server::vrpn_Button_5DT_Server(const char *name, const char *deviceName,vrpn_Connection *c, double threshold[16]) : vrpn_Button_Filter(name, c) -{ - num_buttons = 16; - for(int i=0;i<num_buttons;i++) { - m_threshold[i]=threshold[i]; - } - d_5dt_button=new vrpn_Analog_Remote(deviceName, d_connection); -#ifdef VERBOSE - printf("vrpn_Button_5DT_Server: Adding local analog %s\n",name); -#endif - // Set up the callback handler for the channel - d_5dt_button->register_change_handler(this, handle_analog_update); -} - -vrpn_Button_5DT_Server::~vrpn_Button_5DT_Server(void) -{ -} - -// This routine handles updates of the analog values. The value coming in is -// adjusted per the parameters in the full axis description, and then used to -// update the value there. The value is used by the matrix-generation code in -// mainloop() to update the transformations; that work is not done here. - -void vrpn_Button_5DT_Server::handle_analog_update (void *userdata, const vrpn_ANALOGCB info) -{ - vrpn_Button_5DT_Server *full = (vrpn_Button_5DT_Server *)userdata; - for(int i=0;i<16;i++) { // adjust with range and center value - if(info.channel[i]>full->m_threshold[i] ) { - full->buttons[i]=true; - } else { - full->buttons[i]=false; - } - } -} - -void vrpn_Button_5DT_Server::mainloop() -{ - struct timeval current_time; - - // Call the generic server mainloop, since we are a server - server_mainloop(); - - d_5dt_button->mainloop(); - - vrpn_gettimeofday(¤t_time, NULL); - // Send reports. Stays the same in a real server. - report_changes(); -} - diff --git a/src/vrpn/vrpn_5DT16.h b/src/vrpn/vrpn_5DT16.h deleted file mode 100644 index 83f6a0c345a14507fc03041b7219cfea2c8141c5..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_5DT16.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef vrpn_5dt16_H -#define vrpn_5dt16_H - -#include "vrpn_Analog.h" // for vrpn_ANALOGCB, etc -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32 - -// This class will read the finger-pad values of the 5DT glove as analogs -// and send them. Use the vrpn_Button_5DT_Server class below if you want -// to turn them into buttons by thresholding them. - -class VRPN_API vrpn_5dt16: public vrpn_Serial_Analog -{ -public: - vrpn_5dt16 (const char * name, - vrpn_Connection * c, - const char * port, - int baud = 19200); - - ~vrpn_5dt16 () {}; - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - - protected: - int _status; //< Reset, Syncing, or Reading - int _numchannels; //< How many analog channels to open - int _mode ; //< glove mode for reporting data (see glove manual) - unsigned _expected_chars; //< How many characters to expect in the report - unsigned char _buffer[512]; //< Buffer of characters in report - unsigned _bufcount; //< How many characters we have so far - bool _tenbytes; //< Whether there are 10-byte responses (unusual, but seen) - - struct timeval timestamp; //< Time of the last report from the device - - virtual int reset(void); //< Set device back to starting config - virtual void get_report(void); //< Try to read a report from the device - - virtual void clear_values(void); //< Clears all channels to 0 - - /// send report iff changed - virtual void report_changes - (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - /// send report whether or not changed - virtual void report - (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); -}; - -#include "vrpn_Button.h" // for vrpn_Button_Filter - -// 5dt16 button server code. This device will listen to a 5dt16 analog server -// and report button press and release event when the analog pass a threshold -// value. -// This class is derived from the vrpn_Button_Filter class, so that it -// can be made to toggle its buttons using messages from the client. -class VRPN_API vrpn_Button_5DT_Server : public vrpn_Button_Filter -{ -public: - // Buttons are considered pressed when their analog value exceeds the - // threshold value. - vrpn_Button_5DT_Server(const char *name, const char *deviceName, vrpn_Connection *c, - double threshold[16]); - ~vrpn_Button_5DT_Server(); - - virtual void mainloop(); - -protected: - static void VRPN_CALLBACK handle_analog_update (void * userdata, const vrpn_ANALOGCB info); - vrpn_Analog_Remote *d_5dt_button; - double m_threshold[16]; -}; - -#endif - diff --git a/src/vrpn/vrpn_ADBox.C b/src/vrpn/vrpn_ADBox.C deleted file mode 100644 index 1c78bff0268f37bd44419802da0dab8bccc840a9..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_ADBox.C +++ /dev/null @@ -1,158 +0,0 @@ -// -*- Mode:C++ -*- - -/* - * ad-box driver - * works with Fraunhofer IMK AD-Box and Fakespace Cubic Mouse - * - * for additional information see: - * http://www.imk.fraunhofer.de - * http://www.fakespace.com - * - * written by Sascha Scholz <sascha.scholz@imk.fraunhofer.de> - */ - -#include <stdio.h> // for fprintf, stderr - -#include "vrpn_ADBox.h" -#include "vrpn_Serial.h" // for vrpn_write_characters, etc -#include "vrpn_Types.h" // for vrpn_float64, vrpn_int32 - -class VRPN_API vrpn_Connection; - -vrpn_ADBox::vrpn_ADBox(char* name, vrpn_Connection *c, - const char *port, long baud) - : vrpn_Analog(name, c), vrpn_Button_Filter(name, c), - ready(1), serial_fd(0), iNumBytes(0), iNumDigBytes(0), iFilterPos(0) -{ - // Open the serial port - if ( (serial_fd=vrpn_open_commport(port, baud)) == -1) { - fprintf(stderr,"vrpn_ADBox: Cannot Open serial port\n"); - ready = 0; - } - - // find out what time it is - needed? - vrpn_gettimeofday(×tamp, 0); - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; -} - - -vrpn_ADBox::~vrpn_ADBox() -{ - vrpn_close_commport(serial_fd); -} - - -void vrpn_ADBox::mainloop() -{ - // Call the generic server mainloop, since we are a server - server_mainloop(); - - struct timeval timeout = {0,200000}; - float fAnalog(0.0f); - - if(!ready) return; - - if (iNumBytes == 0) - { - vrpn_flush_output_buffer(serial_fd); - vrpn_flush_input_buffer(serial_fd); - - buffer[0] = 'U'; - vrpn_write_characters(serial_fd, buffer, 1); - - while (iNumBytes < 100 && vrpn_read_available_characters(serial_fd, buffer, 1,&timeout) == 1) - iNumBytes++; - - switch (iNumBytes) - { - case 14: - case 18: iNumDigBytes = 2; break; - case 19: iNumDigBytes = 3; break; - default: iNumBytes = 0; iNumDigBytes = 0; break; - } - - if (iNumBytes != 0) - { - num_buttons = iNumDigBytes * 8; - num_channel = (iNumBytes - iNumDigBytes) / 2; - - fprintf(stderr, - "vrpn_ADBox: ad-box with %d digital and %d analog ports detected\n", - num_buttons, num_channel); - - buffer[0] = 'U'; - vrpn_write_characters(serial_fd, buffer, 1); - ready = 1; - - // initialize the buttons and channels - for (vrpn_int32 i=0; i<num_buttons; i++) - buttons[i] = lastbuttons[i] = VRPN_BUTTON_OFF; - for (vrpn_int32 j=0; j<num_channel; j++) { - channel[j] = last[j] = 0; - } - - - } - else - { - fprintf(stderr,"vrpn_ADBox: trying to detect ad-box\n"); - vrpn_SleepMsecs(1000.0*1); - } - } - else - { - buffer[0] = 'U'; - vrpn_write_characters(serial_fd, buffer, 1); - - for (int c = 0; c < iNumBytes; c++) - { - if (vrpn_read_available_characters(serial_fd, &buffer[c], 1,&timeout) != 1) - { - fprintf(stderr,"vrpn_ADBox: could only read %d chars, %d expected\n",c,iNumBytes+1); - iNumBytes = 0; - iNumDigBytes = 0; - break; - } - } - - vrpn_gettimeofday(×tamp, 0); - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; - - if (iNumBytes != 0) - { - int i(0); - for (i = 0; i < iNumDigBytes; i++) - for (int b = 0; b < 8; b++) - buttons[8 * i + b] = (unsigned char) ((buffer[i] & (1 << b)) != 0 ? VRPN_BUTTON_OFF : VRPN_BUTTON_ON); - - for (i = 0; i < (iNumBytes - iNumDigBytes) / 2; i++) - { - int iOrg = iFilter[i][iFilterPos] = - (int(buffer[iNumDigBytes + i * 2]) << 8) | int(buffer[iNumDigBytes + 1 + i * 2]); - fAnalog = float(iOrg) / 1023.0f; - - int p(iFilterPos); - do p = (p + 29) % 30; while (p != iFilterPos && iFilter[i][p] == iOrg); - if (p != iFilterPos) - { - int iLast(iFilter[i][p]); - if (iOrg - iLast == 1 || iLast - iOrg == 1) - { - do p = (p + 29) % 30; while (p != iFilterPos && iFilter[i][p] == iLast); - if (p != iFilterPos && iFilter[i][p] == iOrg) - fAnalog = float(iOrg + iLast) / 2046.0f; - } - } - - channel[i] = fAnalog; - } - - iFilterPos = (iFilterPos + 1) % 30; - - vrpn_Button::report_changes(); - vrpn_Analog::report_changes(); - } - } -} diff --git a/src/vrpn/vrpn_ADBox.h b/src/vrpn/vrpn_ADBox.h deleted file mode 100644 index a89f56d08e8a17f82ce4c93de0879e33f5f4ce21..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_ADBox.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- Mode:C++ -*- - -/* - * ad-box driver - * works with Fraunhofer IMK AD-Box and Fakespace Cubic Mouse - * - * for additional information see: - * http://www.imk.fraunhofer.de - * http://www.fakespace.com - * - * written by Sascha Scholz <sascha.scholz@imk.fraunhofer.de> - */ - -#ifndef VRPN_ADBOX_H -#define VRPN_ADBOX_H - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Button.h" // for VRPN_BUTTON_BUF_SIZE, etc -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Shared.h" // for timeval - -class VRPN_API vrpn_Connection; - -class VRPN_API vrpn_ADBox : public vrpn_Analog, public vrpn_Button_Filter { - - public: - vrpn_ADBox(char* name, vrpn_Connection *c, - const char *port="/dev/ttyS1/", long baud=9600); - - ~vrpn_ADBox(); - - void mainloop(); - - private: - int ready; - - struct timeval timestamp; // time of the last report from the device - - int serial_fd; - unsigned char buffer[VRPN_BUTTON_BUF_SIZE]; - - int iNumBytes; - int iNumDigBytes; - int iFilter[8][30]; - int iFilterPos; -}; - -#endif // #ifndef VRPN_ADBOX diff --git a/src/vrpn/vrpn_Analog.C b/src/vrpn/vrpn_Analog.C deleted file mode 100644 index 3e31432a87dff827098e33e9f80ad493fdb5bd69..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Analog.C +++ /dev/null @@ -1,357 +0,0 @@ -#include "vrpn_Analog.h" -#include <stdio.h> -#include <string.h> -// Include vrpn_Shared.h _first_ to avoid conflicts with sys/time.h -// and netinet/in.h and ... -#include "vrpn_Shared.h" - -#ifndef VRPN_CLIENT_ONLY -#include "vrpn_Serial.h" -#endif - -//#define VERBOSE - -vrpn_Analog::vrpn_Analog(const char *name, vrpn_Connection *c) - : vrpn_BaseClass(name, c) - , num_channel(0) -{ - // Call the base class' init routine - vrpn_BaseClass::init(); - - // Set the time to 0 just to have something there. - timestamp.tv_usec = timestamp.tv_sec = 0; - // Initialize the values in the channels, - // gets rid of uninitialized memory read error in Purify - // and makes sure any initial value change gets reported. - for (vrpn_int32 i = 0; i < vrpn_CHANNEL_MAX; i++) { - channel[i] = last[i] = 0; - } -} - -int vrpn_Analog::register_types(void) -{ - channel_m_id = d_connection->register_message_type("vrpn_Analog Channel"); - if (channel_m_id == -1) { - return -1; - } - else { - return 0; - } -} - -void vrpn_Analog::print(void) -{ - printf("Analog Report: "); - for (vrpn_int32 i = 0; i < num_channel; i++) { - // printf("Channel[%d]= %f\t", i, channel[i]); - printf("%f\t", channel[i]); - } - printf("\n"); -} - -vrpn_int32 vrpn_Analog::getNumChannels(void) const { return num_channel; } - -vrpn_int32 vrpn_Analog::encode_to(char *buf) -{ - // Message includes: vrpn_float64 AnalogNum, vrpn_float64 state - // Byte order of each needs to be reversed to match network standard - - vrpn_float64 double_chan = num_channel; - int buflen = (vrpn_CHANNEL_MAX + 1) * sizeof(vrpn_float64); - - vrpn_buffer(&buf, &buflen, double_chan); - for (int i = 0; i < num_channel; i++) { - vrpn_buffer(&buf, &buflen, channel[i]); - last[i] = channel[i]; - } - - return (num_channel + 1) * sizeof(vrpn_float64); -} - -void vrpn_Analog::report_changes(vrpn_uint32 class_of_service, - const struct timeval time) -{ - vrpn_int32 i; - vrpn_int32 change = 0; - - if (d_connection) { - for (i = 0; i < num_channel; i++) { - if (channel[i] != last[i]) change = 1; - last[i] = channel[i]; - } - if (!change) { -#ifdef VERBOSE - fprintf(stderr, "No change.\n"); -#endif - return; - } - } - - // there is indeed some change, send it; - vrpn_Analog::report(class_of_service, time); -} - -void vrpn_Analog::report(vrpn_uint32 class_of_service, - const struct timeval time) -{ - // msgbuf must be float64-aligned! - vrpn_float64 fbuf[vrpn_CHANNEL_MAX + 1]; - char *msgbuf = (char *)fbuf; - - vrpn_int32 len; - - // Replace the time value with the current time if the user passed in the - // constant time referring to "now". - if ((time.tv_sec == vrpn_ANALOG_NOW.tv_sec) && - (time.tv_usec == vrpn_ANALOG_NOW.tv_usec)) { - vrpn_gettimeofday(×tamp, NULL); - } - else { - timestamp = time; - } - len = vrpn_Analog::encode_to(msgbuf); -#ifdef VERBOSE - print(); -#endif - if (d_connection && - d_connection->pack_message(len, timestamp, channel_m_id, d_sender_id, - msgbuf, class_of_service)) { - fprintf(stderr, "vrpn_Analog: cannot write message: tossing\n"); - } -} - -#ifndef VRPN_CLIENT_ONLY -vrpn_Serial_Analog::vrpn_Serial_Analog(const char *name, vrpn_Connection *c, - const char *port, int baud, int bits, - vrpn_SER_PARITY parity, bool rts_flow) - : vrpn_Analog(name, c) - , serial_fd(-1) - , baudrate(0) - , bufcounter(0) -{ - // Initialize - portname[0] = '\0'; - buffer[0] = '\0'; - // Find out the port name and baud rate; - if (port == NULL) { - fprintf(stderr, "vrpn_Serial_Analog: NULL port name\n"); - status = vrpn_ANALOG_FAIL; - return; - } - else { - strncpy(portname, port, sizeof(portname)); - portname[sizeof(portname) - 1] = '\0'; - } - baudrate = baud; - - // Open the serial port we're going to use - if ((serial_fd = vrpn_open_commport(portname, baudrate, bits, parity, - rts_flow)) == -1) { - fprintf(stderr, "vrpn_Serial_Analog: Cannot Open serial port\n"); - status = vrpn_ANALOG_FAIL; - } - - // Reset the tracker and find out what time it is - status = vrpn_ANALOG_RESETTING; - vrpn_gettimeofday(×tamp, NULL); -} - -vrpn_Serial_Analog::~vrpn_Serial_Analog() -{ - // Close com port when destroyed. - if (serial_fd != -1) { - vrpn_close_commport(serial_fd); - } -} - -#endif // VRPN_CLIENT_ONLY - -vrpn_Analog_Server::vrpn_Analog_Server(const char *name, vrpn_Connection *c, - vrpn_int32 numChannels) - : vrpn_Analog(name, c) -{ - this->setNumChannels(numChannels); - - // Check if we got a connection. - if (d_connection == NULL) { - fprintf(stderr, "vrpn_Analog_Server: Can't get connection!\n"); - } -} - -// virtual -void vrpn_Analog_Server::report_changes(vrpn_uint32 class_of_service, - const struct timeval time) -{ - vrpn_Analog::report_changes(class_of_service, time); -} - -// virtual -void vrpn_Analog_Server::report(vrpn_uint32 class_of_service, - const struct timeval time) -{ - vrpn_Analog::report(class_of_service, time); -} - -vrpn_int32 vrpn_Analog_Server::setNumChannels(vrpn_int32 sizeRequested) -{ - if (sizeRequested < 0) sizeRequested = 0; - if (sizeRequested > vrpn_CHANNEL_MAX) sizeRequested = vrpn_CHANNEL_MAX; - num_channel = sizeRequested; - return num_channel; -} - -vrpn_Clipping_Analog_Server::vrpn_Clipping_Analog_Server(const char *name, - vrpn_Connection *c, - vrpn_int32 numChannels) - : vrpn_Analog_Server(name, c, numChannels) -{ - int i; - - for (i = 0; i < vrpn_CHANNEL_MAX; i++) { - clipvals[i].minimum_val = -1.0; - clipvals[i].lower_zero = 0.0; - clipvals[i].upper_zero = 0.0; - clipvals[i].maximum_val = 1.0; - } -} - -/// Set the clipping values for the specified channel. -/// min maps to -1, values between lowzero and highzero map to 0, -/// max maps to 1. Values less than min map to -1, values larger -/// than max map to 1. Default for each channel is -1,0,0,1 -/// It is possible to compress the range to [0..1] by setting the -/// minimum equal to the lowzero. -/// Returns 0 on success, -1 on failure. -int vrpn_Clipping_Analog_Server::setClipValues(int chan, double min, - double lowzero, double highzero, - double max) -{ - if ((chan < 0) || (chan >= vrpn_CHANNEL_MAX)) { - fprintf( - stderr, - "vrpn_Clipping_Analog_Server::setClipValues: Bad channel (%d)\n", - chan); - return -1; - } - if ((lowzero < min) || (highzero < lowzero) || (max < highzero)) { - fprintf(stderr, "vrpn_Clipping_Analog_Server::setClipValues: Out of " - "order mapping\n"); - return -1; - } - - clipvals[chan].minimum_val = min; - clipvals[chan].lower_zero = lowzero; - clipvals[chan].upper_zero = highzero; - clipvals[chan].maximum_val = max; - - return 0; -} - -/// This method should be used to set the value of a channel. -/// It will be scaled and clipped as described in setClipValues. -/// It returns 0 on success and -1 on failure. -int vrpn_Clipping_Analog_Server::setChannelValue(int chan, double value) -{ - if ((chan < 0) || (chan >= vrpn_CHANNEL_MAX)) { - fprintf( - stderr, - "vrpn_Clipping_Analog_Server::setChannelValue: Bad channel (%d)\n", - chan); - return -1; - } - - // Figure out which clipping values to use - clipvals_struct clips = clipvals[chan]; - - // See if it should be clipped to zero, high, or low. Zero is checked - // first so that the range can be compress to [0..1] or [-1..0] by setting - // a zero value equal to a clip value. - if ((value >= clips.lower_zero) && (value <= clips.upper_zero)) { - channel[chan] = 0.0; - } - else if (value <= clips.minimum_val) { - channel[chan] = -1.0; - } - else if (value >= clips.maximum_val) { - channel[chan] = 1.0; - - // If we are below the minzero, then we should map to the -1..0 range. - // Otherwise, map to the 0..1 range. Note that if we have reached this - // point, the range we are mapped to has not been collapsed, so we won't - // get divide-by-zero problems and such. - } - else if (value > clips.lower_zero) { - channel[chan] = - (value - clips.upper_zero) / (clips.maximum_val - clips.upper_zero); - } - else { - // Larger negative number (minus smaller negative [net positive]) is - // negative - // Negative number divided by positive number is negative. - channel[chan] = - (value - clips.lower_zero) / (clips.lower_zero - clips.minimum_val); - } - - return 0; -} - -// ************* CLIENT ROUTINES **************************** - -vrpn_Analog_Remote::vrpn_Analog_Remote(const char *name, vrpn_Connection *c) - : vrpn_Analog(name, c) -{ - vrpn_int32 i; - - // Register a handler for the change callback from this device, - // if we got a connection. - if (d_connection != NULL) { - if (register_autodeleted_handler(channel_m_id, handle_change_message, - this, d_sender_id)) { - fprintf(stderr, "vrpn_Analog_Remote: can't register handler\n"); - d_connection = NULL; - } - } - else { - fprintf(stderr, "vrpn_Analog_Remote: Can't get connection!\n"); - } - - // At the start, as far as the client knows, the device could have - // max channels -- the number of channels is specified in each - // message. - num_channel = vrpn_CHANNEL_MAX; - for (i = 0; i < vrpn_CHANNEL_MAX; i++) { - channel[i] = last[i] = 0; - } - vrpn_gettimeofday(×tamp, NULL); -} - -void vrpn_Analog_Remote::mainloop() -{ - if (d_connection) { - d_connection->mainloop(); - client_mainloop(); - } -} - -int vrpn_Analog_Remote::handle_change_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_float64 numchannelD; //< Number of channels passed in a double (yuck!) - vrpn_Analog_Remote *me = (vrpn_Analog_Remote *)userdata; - vrpn_ANALOGCB cp; - - cp.msg_time = p.msg_time; - vrpn_unbuffer(&bufptr, &numchannelD); - cp.num_channel = (long)numchannelD; - me->num_channel = cp.num_channel; - for (vrpn_int32 i = 0; i < cp.num_channel; i++) { - vrpn_unbuffer(&bufptr, &cp.channel[i]); - } - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->d_callback_list.call_handlers(cp); - - return 0; -} diff --git a/src/vrpn/vrpn_Analog.h b/src/vrpn/vrpn_Analog.h deleted file mode 100644 index 1d0f7a286ba27a0039119dca88503a06bd8c0764..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Analog.h +++ /dev/null @@ -1,210 +0,0 @@ -#ifndef VRPN_ANALOG_H -#define VRPN_ANALOG_H - -#include <stddef.h> // for NULL - -#include "vrpn_BaseClass.h" // for vrpn_Callback_List, etc -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_int32, vrpn_float64, etc - -#ifndef VRPN_CLIENT_ONLY -#include "vrpn_Serial.h" // for ::vrpn_SER_PARITY_NONE, etc -#endif - -#define vrpn_CHANNEL_MAX 128 - -// analog status flags -const int vrpn_ANALOG_SYNCING = (2); -const int vrpn_ANALOG_REPORT_READY = (1); -const int vrpn_ANALOG_PARTIAL = (0); -const int vrpn_ANALOG_RESETTING = (-1); -const int vrpn_ANALOG_FAIL = (-2); - -// Analog time value meaning "go find out what time it is right now" -const struct timeval vrpn_ANALOG_NOW = {0, 0}; - -class VRPN_API vrpn_Analog : public vrpn_BaseClass { -public: - vrpn_Analog(const char *name, vrpn_Connection *c = NULL); - - // Print the status of the analog device - void print(void); - - vrpn_int32 getNumChannels(void) const; - -protected: - vrpn_float64 channel[vrpn_CHANNEL_MAX]; - vrpn_float64 last[vrpn_CHANNEL_MAX]; - vrpn_int32 num_channel; - struct timeval timestamp; - vrpn_int32 channel_m_id; //< channel message id (message from server) - int status; - - virtual int register_types(void); - - //------------------------------------------------------------------ - // Routines used to send data from the server - virtual vrpn_int32 encode_to(char *buf); - /// Send a report only if something has changed (for servers) - /// Optionally, tell what time to stamp the value with - virtual void - report_changes(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY, - const struct timeval time = vrpn_ANALOG_NOW); - /// Send a report whether something has changed or not (for servers) - /// Optionally, tell what time to stamp the value with - virtual void - report(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY, - const struct timeval time = vrpn_ANALOG_NOW); -}; - -#ifndef VRPN_CLIENT_ONLY -class VRPN_API vrpn_Serial_Analog : public vrpn_Analog { -public: - vrpn_Serial_Analog(const char *name, vrpn_Connection *connection, - const char *port, int baud = 9600, int bits = 8, - vrpn_SER_PARITY parity = vrpn_SER_PARITY_NONE, - bool rts_flow = false); - ~vrpn_Serial_Analog(); - -protected: - int serial_fd; - char portname[1024]; - int baudrate; - unsigned char buffer[1024]; - int bufcounter; - - int read_available_characters(char *buffer, int bytes); -}; -#endif - -// vrpn_Analog_Server -// Tom Hudson, March 1999 -// -// A *Sample* Analog server. Use this or derive your own from vrpn_Analog with -// this as a guide. -// -// Write whatever values you want into channels(), then call report() -// or report_changes(). (Original spec only called for report_changes(), -// but vrpn_Analog's assumption that "no new data = same data" doesn't -// match the BLT stripchart assumption of "no intervening data = ramp". -// -// For a sample application, see server_src/sample_analog.C - -class VRPN_API vrpn_Analog_Server : public vrpn_Analog { - -public: - vrpn_Analog_Server(const char *name, vrpn_Connection *c, - vrpn_int32 numChannels = vrpn_CHANNEL_MAX); - - /// Makes public the protected base class function - virtual void - report_changes(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY, - const struct timeval time = vrpn_ANALOG_NOW); - - /// Makes public the protected base class function - virtual void - report(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY, - const struct timeval time = vrpn_ANALOG_NOW); - - /// For this server, the user must normally call report() or - /// report_changes() directly. This mainloop() only takes - /// care of the things any server object should do. - virtual void mainloop() { server_mainloop(); }; - - /// Exposes an array of values for the user to write into. - vrpn_float64 *channels(void) { return channel; } - - /// Sets the size of the array; returns the size actually set. - /// (May be clamped to vrpn_CHANNEL_MAX) - /// This should be used before mainloop is ever called. - vrpn_int32 setNumChannels(vrpn_int32 sizeRequested); -}; - -/// Analog server that can scale and clip its range to -1..1. -// This is useful for joysticks, to allow them to be centered and -// scaled to cover the whole range. Rather than writing directly -// into the channels array, call the setChannel() method. - -class VRPN_API vrpn_Clipping_Analog_Server : public vrpn_Analog_Server { -public: - vrpn_Clipping_Analog_Server(const char *name, vrpn_Connection *c, - vrpn_int32 numChannels = vrpn_CHANNEL_MAX); - - /// Set the clipping values for the specified channel. - /// min maps to -1, values between lowzero and highzero map to 0, - /// max maps to 1. Values less than min map to -1, values larger - /// than max map to 1. Default for each channel is -1,0,0,1 - /// It is possible to compress the range to [0..1] by setting the - /// minimum equal to the lowzero. - /// Returns 0 on success, -1 on failure. - int setClipValues(int channel, double min, double lowzero, double highzero, - double max); - - /// This method should be used to set the value of a channel. - /// It will be scaled and clipped as described in setClipValues. - /// It returns 0 on success and -1 on failure. - int setChannelValue(int channel, double value); - -protected: - typedef struct { - double minimum_val; // Value mapped to -1 - double lower_zero; // Minimum value mapped to 0 - double upper_zero; // Maximum value mapped to 0 - double maximum_val; // Value mapped to 1 - } clipvals_struct; - - clipvals_struct clipvals[vrpn_CHANNEL_MAX]; -}; - -//---------------------------------------------------------- -//************** Users deal with the following ************* - -// User routine to handle a change in analog values. This is called when -// the analog callback is called (when a message from its counterpart -// across the connection arrives). - -typedef struct _vrpn_ANALOGCB { - struct timeval msg_time; // Timestamp of analog data - vrpn_int32 num_channel; // how many channels - vrpn_float64 channel[vrpn_CHANNEL_MAX]; // analog values -} vrpn_ANALOGCB; - -typedef void(VRPN_CALLBACK *vrpn_ANALOGCHANGEHANDLER)(void *userdata, - const vrpn_ANALOGCB info); - -// Open an analog device that is on the other end of a connection -// and handle updates from it. This is the type of analog device -// that user code will deal with. - -class VRPN_API vrpn_Analog_Remote : public vrpn_Analog { -public: - // The name of the analog device to connect to - // Optional argument to be used when the Remote should listen on - // a connection that is already open. - vrpn_Analog_Remote(const char *name, vrpn_Connection *c = NULL); - - // This routine calls the mainloop of the connection it's on - virtual void mainloop(); - - // (un)Register a callback handler to handle analog value change - virtual int register_change_handler(void *userdata, - vrpn_ANALOGCHANGEHANDLER handler) - { - return d_callback_list.register_handler(userdata, handler); - }; - virtual int unregister_change_handler(void *userdata, - vrpn_ANALOGCHANGEHANDLER handler) - { - return d_callback_list.unregister_handler(userdata, handler); - } - -protected: - vrpn_Callback_List<vrpn_ANALOGCB> d_callback_list; - - static int VRPN_CALLBACK - handle_change_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -#endif diff --git a/src/vrpn/vrpn_Analog_5dt.C b/src/vrpn/vrpn_Analog_5dt.C deleted file mode 100644 index 62ade1e12da97813b0c8666a1f0c5a77a01c2718..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Analog_5dt.C +++ /dev/null @@ -1,480 +0,0 @@ -// This is a driver for the 5dt Data Glove -// Look at www.5dt.com for more informations about this product -// Manuals are avalaible freely from this site -// This code was written by Philippe DAVID with the help of Yves GAUVIN -// naming convention used int this file: -// l_ is the prefixe for local variables -// g_ is the prefixe for global variables -// p_ is the prefixe for parameters - -#include <stdio.h> // for sprintf, printf - -#include "vrpn_Analog_5dt.h" -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR, etc -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_SleepMsecs, etc -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -#undef VERBOSE - -// Defines the modes in which the device can find itself. -#define STATUS_RESETTING (-1) // Resetting the device -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report - -#define MAX_TIME_INTERVAL (2000000) // max time between reports (usec) - - -/****************************************************************************** - * NAME : vrpn_5DT::vrpn_5DT - * ROLE : This creates a vrpn_5DT and sets it to reset mode. It opens - * the serial device using the code in the vrpn_Serial_Analog constructor. - * ARGUMENTS : - * RETURN : - ******************************************************************************/ -vrpn_5dt::vrpn_5dt (const char * p_name, vrpn_Connection * p_c, const char * p_port, int p_baud, int p_mode, bool tenbytes): - vrpn_Serial_Analog (p_name, p_c, p_port, p_baud, 8, vrpn_SER_PARITY_NONE), - _announced(false), // Not yet announced our warning. - _numchannels (8), // This is an estimate; will change when reports come - _tenbytes (tenbytes), // Do we expect ten-byte messages? - _wireless (p_baud == 9600), // 9600 baud implies a wireless glove. - _gotInfo (false) // used to know if we have gotten a first full wireless report. -{ - if (_wireless) { - // All wireless gloves continually send 10 byte reports and ignore - // all requests. - _tenbytes = true; - p_mode = 2; - } - // Set the parameters in the parent classes - vrpn_Analog::num_channel = _numchannels; - - // Set the status of the buttons and analogs to 0 to start - clear_values(); - - // Set the mode to reset - _status = STATUS_RESETTING; - - //Init the mode - _mode = p_mode; - - // Sebastien Kuntz reports the following about the driver they have - // written: It works great except for one small detail : - // for unknown reasons, there's an extra byte hanging around in the data - // stream sent by the 5DT glove in stream mode. - // We have the header, finger infos, pitch and roll, checksum and after - // that we receive a 0x55 Byte. - // The official doc (http://www.5dt.com/downloads/5DTDataGlove5Manual.pdf) - // says we should get only 9 bytes, so I don't know if it's a response - // from a command somewhere; but the fact is we receive 10 bytes. - if (_tenbytes) { - _expected_chars = 10; - } else { - _expected_chars = 9; - } -} - - -/****************************************************************************** - * NAME : vrpn_5dt::clear_values - * ROLE : - * ARGUMENTS : - * RETURN : - ******************************************************************************/ -void -vrpn_5dt::clear_values (void) -{ - int i; - - for (i = 0; i < _numchannels; i++) - { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } -} - - -/****************************************************************************** - * NAME : vrpn_5dt:: - * ROLE : - * ARGUMENTS : char *cmd : the command to be sent - * int len : Length of the command to be sent - * RETURN : 0 on success, -1 on failure. - ******************************************************************************/ -int -vrpn_5dt::send_command (const unsigned char *p_cmd, int p_len) -{ - int l_ret; - - // Send the command - l_ret = vrpn_write_characters (serial_fd, p_cmd, p_len); - // Tell if this all worked. - if (l_ret == p_len) { - return 0; - } else { - return -1; - } -} - - -/****************************************************************************** - * NAME : vrpn_5dt::reset - * ROLE : This routine will reset the 5DT - * ARGUMENTS : - * RETURN : 0 else -1 in case of error - ******************************************************************************/ -int -vrpn_5dt::reset (void) -{ - struct timeval l_timeout; - unsigned char l_inbuf [45]; - int l_ret; - char l_errmsg[256]; - - if (_wireless) { - // Wireless gloves can't be reset, but we do need to wait for a header byte. - // Then, syncing will wait to see if we get a capability byte as expected - // at the end of a report. - _gotInfo = false; - vrpn_SleepMsecs (100); //Give it time to respond - - // Will wait at most 2 seconds - l_timeout.tv_sec = 2; - l_timeout.tv_usec = 0; - l_ret = vrpn_read_available_characters (serial_fd, l_inbuf, 1, &l_timeout); - if (l_ret != 1) { - VRPN_MSG_ERROR ("vrpn_5dt: Unable to read from the glove\n"); - return -1; - } - if (l_inbuf[0] == 0x80) { - _status = STATUS_SYNCING; - _buffer[0] = l_inbuf[0]; - _bufcount = 1; - vrpn_gettimeofday (×tamp, NULL); // Set watchdog now - VRPN_MSG_INFO ("vrpn_5dt: Got a possible header byte!"); - return 0; - } - return 0; - } - vrpn_flush_input_buffer (serial_fd); - send_command ((unsigned char *) "A", 1); // Command to init the glove - vrpn_SleepMsecs (100); //Give it time to respond - l_timeout.tv_sec = 2; - l_timeout.tv_usec = 0; - l_ret = vrpn_read_available_characters (serial_fd, l_inbuf, 1, &l_timeout); - - if (l_ret != 1) { - VRPN_MSG_ERROR ("vrpn_5dt: Unable to read from the glove\n"); - return -1; - } - - if (l_inbuf[0] != 85) { - VRPN_MSG_ERROR ("vrpn_5dt: Cannot get response on init command"); - return -1; - } else { - vrpn_flush_input_buffer (serial_fd); - send_command ( (unsigned char *) "G", 1); //Command to Query informations from the glove - vrpn_SleepMsecs (100); //Give it time to respond - l_timeout.tv_sec = 2; - l_timeout.tv_usec = 0; - l_ret = vrpn_read_available_characters (serial_fd, l_inbuf, 32, &l_timeout); - - if (l_ret != 32) { - VRPN_MSG_ERROR ("vrpn_5dt: Cannot get info. from the glove"); - return -1; - } - if ( (l_inbuf[0] != 66) || (l_inbuf[1] != 82)) { - VRPN_MSG_ERROR ("vrpn_5dt: Cannot get good header on info command"); - return -1; - } - - sprintf (l_errmsg, "vrpn_5dt: glove \"%s\"version %d.%d\n", &l_inbuf [16], l_inbuf [2], l_inbuf [3]); - VRPN_MSG_INFO (l_errmsg); - - if (l_inbuf[4] | 1) { - VRPN_MSG_INFO ("A right glove is ready"); - } else { - VRPN_MSG_INFO ("A left glove is ready"); - } - if (l_inbuf[5] | 16) { - VRPN_MSG_INFO ("Pitch and Roll are available"); - } else { - VRPN_MSG_INFO ("Pitch and Roll are not available"); - } - } - - // If we're in continuous mode, request continuous sends - if (_mode == 2) { - send_command ( (unsigned char *) "D", 1); // Command to query streaming data from the glove - } - - // We're now entering the syncing mode which send the read command to the glove - _status = STATUS_SYNCING; - - vrpn_gettimeofday (×tamp, NULL); // Set watchdog now - return 0; -} - - -/****************************************************************************** - * NAME : vrpn_5dt::syncing - * ROLE : Send the "C" command to ask for new data from the glove - * ARGUMENTS : void - * RETURN : void - ******************************************************************************/ -void vrpn_5dt::syncing (void) -{ - - if (_wireless) { - // For a wireless glove, syncing means we got a header byte and need - // to wait for the end of the report to see if we guessed right and - // will get a capability byte. - int l_ret; - l_ret = vrpn_read_available_characters (serial_fd, &_buffer [_bufcount], - _expected_chars - _bufcount); - if (l_ret == -1) { - VRPN_MSG_ERROR ("Error reading the glove"); - _status = STATUS_RESETTING; - return; - } - _bufcount += l_ret; - if (_bufcount < _expected_chars) { // Not done -- go back for more - return; - } - if (_buffer[_bufcount - 1] == 0x40 || _buffer[_bufcount - 1] == 0x01) { - VRPN_MSG_INFO ("Got capability byte as expected - switching into read mode."); - _bufcount = 0; - _status = STATUS_READING; - } else { - VRPN_MSG_WARNING ("Got a header byte, but capability byte not found - resetting."); - _status = STATUS_RESETTING; - } - return; - } - - switch (_mode) - { - case 1: - send_command ((unsigned char *) "C", 1); // Command to query data from the glove - break; - case 2: - // Nothing to be done here -- continuous mode was requested in the reset. - break; - default : - VRPN_MSG_ERROR ("vrpn_5dt::syncing : internal error : unknown state"); - printf ("mode %d\n", _mode); - break; - } - _bufcount = 0; - _status = STATUS_READING; -} - - -/****************************************************************************** - * NAME : vrpn_5dt::get_report - * ROLE : This function will read characters until it has a full report, then - * put that report into analog fields and call the report methods on these. - * ARGUMENTS : void - * RETURN : void - ******************************************************************************/ -void vrpn_5dt::get_report (void) -{ - int l_ret; // Return value from function call to be checked - - // XXX This should be called when the first character of a report is read. - vrpn_gettimeofday(×tamp, NULL); - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. - //-------------------------------------------------------------------- - - l_ret = vrpn_read_available_characters (serial_fd, &_buffer [_bufcount], - _expected_chars - _bufcount); - if (l_ret == -1) { - VRPN_MSG_ERROR ("Error reading the glove"); - _status = STATUS_RESETTING; - return; - } -#ifdef VERBOSE - if (l_ret != 0) printf("... got %d characters (%d total)\n",l_ret, _bufcount); -#endif - - //-------------------------------------------------------------------- - // The time of the report is the time at which the first character for - // the report is read. - //-------------------------------------------------------------------- - - if ( (l_ret > 0) && (_bufcount == 0) ) { - vrpn_gettimeofday(×tamp, NULL); - } - - //-------------------------------------------------------------------- - // We keep track of how many characters we have received and keep - // going back until we get as many as we expect. - //-------------------------------------------------------------------- - - _bufcount += l_ret; - if (_bufcount < _expected_chars) { // Not done -- go back for more - return; - } - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. First check to - // make sure that the first one is what we expect. - - if (_buffer[0] != 128) { - VRPN_MSG_WARNING ("Unexpected first character in report, resetting"); - _status = STATUS_RESETTING; - _bufcount = 0; - return; - } - - if (_wireless) { - if (_buffer[_bufcount - 1] != 0x40 && _buffer[_bufcount - 1] != 0x01) { - // The last byte wasn't a capability byte, so this report is invalid. - // Reset! - VRPN_MSG_WARNING ("Unexpected last character in report, resetting"); - _status = STATUS_RESETTING; - _bufcount = 0; - return; - } - } - -#ifdef VERBOSE - printf ("Got a complete report (%d of %d)!\n", _bufcount, _expected_chars); -#endif - - //-------------------------------------------------------------------- - // Decode the report and store the values in it into the analog values - // if appropriate. - //-------------------------------------------------------------------- - - channel[1] = _buffer[1] / 255.0; //Thumb - channel[2] = _buffer[2] / 255.0; - channel[3] = _buffer[3] / 255.0; - channel[4] = _buffer[4] / 255.0; - channel[5] = _buffer[5] / 255.0; // Pinkie - channel[6] = 180 * _buffer[6] / 255.0; // Pitch - channel[7] = 180 * _buffer[7] / 255.0; // Roll - - if (_wireless && !_gotInfo) { - _gotInfo = true; - // Bit 0 set in the capability byte implies a right-hand glove. - if (_buffer[9] == 0x01) { - VRPN_MSG_INFO ("A 'wireless-type' right glove is ready and reporting"); - } else { - VRPN_MSG_INFO ("A 'wireless-type' left glove is ready and reporting"); - } - } - - //-------------------------------------------------------------------- - // Done with the decoding, send the reports and go back to syncing - //-------------------------------------------------------------------- - - report_changes(); - switch (_mode) { - case 1: - _status = STATUS_SYNCING; - break; - case 2: // Streaming Mode, just go back for the next report. - _bufcount = 0; - break; - default : - VRPN_MSG_ERROR ("vrpn_5dt::get_report : internal error : unknown state"); - break; - } -} - - -/****************************************************************************** - * NAME : vrpn_5dt::report_changes - * ROLE : - * ARGUMENTS : - * RETURN : void - ******************************************************************************/ -void vrpn_5dt::report_changes (vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Analog::report_changes(class_of_service); -} - - -/****************************************************************************** - * NAME : vrpn_5dt::report - * ROLE : - * ARGUMENTS : - * RETURN : void - ******************************************************************************/ -void vrpn_5dt::report (vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Analog::report(class_of_service); -} - - -/****************************************************************************** - * NAME : vrpn_5dt::mainloop - * ROLE : This routine is called each time through the server's main loop. It will - * take a course of action depending on the current status of the device, - * either trying to reset it or trying to get a reading from it. It will - * try to reset the device if no data has come from it for a couple of - * seconds - * ARGUMENTS : - * RETURN : void - ******************************************************************************/ -void vrpn_5dt::mainloop () -{ - char l_errmsg[256]; - - server_mainloop(); - if (_wireless) { - if (!_announced) { - VRPN_MSG_INFO ("Will connect to a receive-only 'wireless-type' glove - there may be a few warnings before we succeed."); - _announced = true; - } - } - switch (_status) - { - case STATUS_RESETTING: - if (reset()== -1) - { - VRPN_MSG_ERROR ("vrpn_Analog_5dt: Cannot reset the glove!"); - } - break; - - case STATUS_SYNCING: - syncing (); - break; - - case STATUS_READING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - get_report(); - struct timeval current_time; - vrpn_gettimeofday (¤t_time, NULL); - if (vrpn_TimevalDuration (current_time, timestamp) > MAX_TIME_INTERVAL) { - sprintf (l_errmsg, "vrpn_5dt::mainloop: Timeout... current_time=%ld:%ld, timestamp=%ld:%ld", - current_time.tv_sec, - static_cast<long> (current_time.tv_usec), - timestamp.tv_sec, - static_cast<long> (timestamp.tv_usec)); - VRPN_MSG_ERROR (l_errmsg); - _status = STATUS_RESETTING; - } - } - break; - - default: - VRPN_MSG_ERROR ("vrpn_5dt::mainloop: Unknown mode (internal error)"); - break; - } -} diff --git a/src/vrpn/vrpn_Analog_5dt.h b/src/vrpn/vrpn_Analog_5dt.h deleted file mode 100644 index 286fc74ba272dbae5a5aad8713bb44392666c6f1..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Analog_5dt.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef VRPN_5DT_H -#define VRPN_5DT_H - -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32 - -/** @brief Class to support reading data from serial 5DT data gloves. -*/ -class VRPN_API vrpn_5dt: public vrpn_Serial_Analog -{ -public: - /** @brief Constructor. - @param name Name for the device - @param c Connection to use. - @param port serial port to connect to - @param baud Baud rate - 19200 for "wired"-type gloves (send/receive), - 9600 implies a "wireless" (may be wired, but is send-only) glove - @param mode Set to 1 for the driver to request reports, set to 2 - to stream them. (wireless implies 2, overriding value passed here) - @param tenbytes Whether reports should be 10 bytes instead of - the documented 9. (wireless implies true, overriding value passed here) - */ - vrpn_5dt (const char * name, - vrpn_Connection * c, - const char * port, - int baud = 19200, - int mode = 1, - bool tenbytes = false); - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - - void syncing (void); - - protected: - bool _announced; //< Did we make the note about potential warnings yet? - bool _wireless; //< Whether this glove is using the wireless protocol - bool _gotInfo; //< Whether we've sent a message about this wireless glove - int _status; //< Reset, Syncing, or Reading - int _numchannels; //< How many analog channels to open - int _mode ; //< glove mode for reporting data (see glove manual) - unsigned _expected_chars; //< How many characters to expect in the report - unsigned char _buffer[512]; //< Buffer of characters in report - unsigned _bufcount; //< How many characters we have so far - bool _tenbytes; //< Whether there are 10-byte responses (unusual, but seen) - - struct timeval timestamp; //< Time of the last report from the device - - virtual int reset(void); //< Set device back to starting config - virtual void get_report(void); //< Try to read a report from the device - - virtual void clear_values(void); //< Clears all channels to 0 - - /// Compute the CRC for the message, append it, and send message. - /// Returns 0 on success, -1 on failure. - int send_command(const unsigned char *cmd, int len); - - /// send report iff changed - virtual void report_changes - (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - /// send report whether or not changed - virtual void report - (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); -}; - -#endif diff --git a/src/vrpn/vrpn_Analog_5dtUSB.C b/src/vrpn/vrpn_Analog_5dtUSB.C deleted file mode 100644 index ce620de2e99a19b95554fda8a0b7089061e83a8c..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Analog_5dtUSB.C +++ /dev/null @@ -1,201 +0,0 @@ -/** @file vrpn_Analog_5dtUSB.C - @brief Implemendation of 5DT USB (HID) dataglove driver - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -#include <string.h> // for memset -#include <iostream> // for operator<<, ostringstream, etc -#include <sstream> -#include <stdexcept> // for logic_error - -#include "vrpn_Analog_5dtUSB.h" -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_NORMAL, etc - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_HID) - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 vrpn_5DT_VENDOR = 0x5d70; - -static const vrpn_uint16 vrpn_5DT_LEFT_MASK = 0x0001; -static const vrpn_uint16 vrpn_5DT_RIGHT = 0x0000; -static const vrpn_uint16 vrpn_5DT_LEFT = 0x0001; -static const vrpn_uint16 vrpn_5DT_WIRELESS_PORTA_MASK = 0x0002; -static const vrpn_uint16 vrpn_5DT_WIRELESS_PORTB_MASK = 0x0006; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE5_MASK = 0x0010; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE5 = 0x0010; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE14 = 0x0000; - - -static const vrpn_uint16 vrpn_5DT_DATAGLOVE14_RIGHT_WIRED = 0x0000; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE14_LEFT_WIRED = 0x0001; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE14_RIGHT_WIRELESS_PORTA = 0x0002; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE14_LEFT_WIRELESS_PORTA = 0x0003; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE14_RIGHT_WIRELESS_PORTB = 0x0006; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE14_LEFT_WIRELESS_PORTB = 0x0007; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE5_RIGHT_WIRED = 0x0010; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE5_LEFT_WIRED = 0x0011; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE5_RIGHT_WIRELESS_PORTA = 0x0012; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE5_LEFT_WIRELESS_PORTA = 0x0013; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE5_RIGHT_WIRELESS_PORTB = 0x0016; -static const vrpn_uint16 vrpn_5DT_DATAGLOVE5_LEFT_WIRELESS_PORTB = 0x0017; - - -vrpn_Analog_5dtUSB::vrpn_Analog_5dtUSB(vrpn_HidAcceptor *filter, - int num_sensors, - bool isLeftHand, - const char *name, - vrpn_Connection *c) : - vrpn_Analog(name, c), - vrpn_HidInterface(filter), - _isLeftHand(isLeftHand), - _wasConnected(false) { - - if (num_sensors != 5 && num_sensors != 14) { - throw std::logic_error("The vrpn_Analog_5dtUSB driver only supports 5 or 14 sensors, and a different number was passed!"); - } - - vrpn_Analog::num_channel = num_sensors; - - // Initialize the state of all the analogs - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); - - // Set the timestamp - vrpn_gettimeofday(&_timestamp, NULL); -} - -vrpn_Analog_5dtUSB::~vrpn_Analog_5dtUSB() { - delete _acceptor; -} -std::string vrpn_Analog_5dtUSB::get_description() const { - std::ostringstream ss; - if (product() & vrpn_5DT_LEFT_MASK) { - ss << "left"; - } else { - ss << "right"; - } - - ss << " hand, "; - if (product() & vrpn_5DT_DATAGLOVE5_MASK) { - ss << "5"; - } else { - ss << "14"; - } - - ss << " sensors, "; - if (product() & vrpn_5DT_WIRELESS_PORTA_MASK) { - ss << "wireless port A"; - } else if (product() & vrpn_5DT_WIRELESS_PORTB_MASK) { - ss << "wireless port B"; - } else { - ss << "wired USB"; - } - return ss.str(); -} - -void vrpn_Analog_5dtUSB::on_data_received(size_t bytes, vrpn_uint8 *buffer) { - if (bytes != 64) { - std::ostringstream ss; - ss << "Received a too-short report: " << bytes; - struct timeval ts; - vrpn_gettimeofday(&ts, NULL); - send_text_message(ss.str().c_str(), ts, vrpn_TEXT_WARNING); - return; - } - - // Decode all full reports. - const float scale = 1.0f / 4096.0f; - vrpn_uint8 * bufptr = buffer; - for (size_t i = 0; i < 16; i++) { - _rawVals[i] = vrpn_unbuffer<vrpn_int16>(bufptr) * scale; - } - - switch (vrpn_Analog::num_channel) { - case 5: - for (size_t i = 0; i < 5; ++i) { - channel[i] = _rawVals[i * 3]; - // Report this event before parsing the next. - report_changes(); - } - break; - - case 14: - for (size_t i = 0; i < 14; ++i) { - channel[i] = _rawVals[i]; - // Report this event before parsing the next. - report_changes(); - } - break; - default: - std::cerr << "Internal error - should not happen: Unrecognized number of channels!" << std::endl; - } -} - -void vrpn_Analog_5dtUSB::mainloop() { - vrpn_gettimeofday(&_timestamp, NULL); - - update(); - - if (connected() && !_wasConnected) { - std::ostringstream ss; - ss << "Successfully connected to 5DT glove, " << get_description(); - send_text_message(ss.str().c_str(), _timestamp, vrpn_TEXT_NORMAL); - } - _wasConnected = connected(); - - server_mainloop(); -} - -void vrpn_Analog_5dtUSB::report_changes(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - - vrpn_Analog::report_changes(class_of_service); -} - -void vrpn_Analog_5dtUSB::report(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - - vrpn_Analog::report(class_of_service); -} - - -vrpn_Analog_5dtUSB_Glove5Left::vrpn_Analog_5dtUSB_Glove5Left(const char *name, vrpn_Connection *c) : - vrpn_Analog_5dtUSB(new vrpn_HidProductMaskAcceptor(vrpn_5DT_VENDOR, vrpn_5DT_LEFT_MASK | vrpn_5DT_DATAGLOVE5_MASK, vrpn_5DT_LEFT | vrpn_5DT_DATAGLOVE5), - 5, - true, - name, - c) { } - -vrpn_Analog_5dtUSB_Glove5Right::vrpn_Analog_5dtUSB_Glove5Right(const char *name, vrpn_Connection *c) : - vrpn_Analog_5dtUSB(new vrpn_HidProductMaskAcceptor(vrpn_5DT_VENDOR, vrpn_5DT_LEFT_MASK | vrpn_5DT_DATAGLOVE5_MASK, vrpn_5DT_RIGHT | vrpn_5DT_DATAGLOVE5), - 5, - false, - name, - c) { } - -vrpn_Analog_5dtUSB_Glove14Left::vrpn_Analog_5dtUSB_Glove14Left(const char *name, vrpn_Connection *c) : - vrpn_Analog_5dtUSB(new vrpn_HidProductMaskAcceptor(vrpn_5DT_VENDOR, vrpn_5DT_LEFT_MASK | vrpn_5DT_DATAGLOVE5_MASK, vrpn_5DT_LEFT | vrpn_5DT_DATAGLOVE14), - 14, - true, - name, - c) { } - -vrpn_Analog_5dtUSB_Glove14Right::vrpn_Analog_5dtUSB_Glove14Right(const char *name, vrpn_Connection *c) : - vrpn_Analog_5dtUSB(new vrpn_HidProductMaskAcceptor(vrpn_5DT_VENDOR, vrpn_5DT_LEFT_MASK | vrpn_5DT_DATAGLOVE5_MASK, vrpn_5DT_RIGHT | vrpn_5DT_DATAGLOVE14), - 14, - false, - name, - c) { } - -#endif - diff --git a/src/vrpn/vrpn_Analog_5dtUSB.h b/src/vrpn/vrpn_Analog_5dtUSB.h deleted file mode 100644 index 24aba0616b8b3a7507e5bb95098b4006f096afbb..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Analog_5dtUSB.h +++ /dev/null @@ -1,151 +0,0 @@ -/** @file vrpn_Analog_5dtUSB.h - @brief header for 5DT USB (HID) dataglove driver - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -#ifndef VRPN_ANALOG_5DTUSB_H -#define VRPN_ANALOG_5DTUSB_H - -#include <stddef.h> // for size_t -#include <string> // for string - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Configure.h" // for VRPN_API, VRPN_USE_HID -#include "vrpn_Connection.h" // for vrpn_Connection (ptr only), etc -#include "vrpn_HumanInterface.h" // for vrpn_HIDDEVINFO, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint16, vrpn_uint32, etc - -#if defined(VRPN_USE_HID) - -/** @brief 5th Dimension Technologies (5dt) "Ultra" USB data glove driver - - This supports connecting to 5dt gloves over USB that present a HID device interface. - This includes the 5DT Data Glove 5 Ultra and the 5DT Data Glove 14 Ultra, as well - as either of those using the wireless kit. (I, Ryan Pavlik, have only tested this - with the 5DT Data Glove 5 Ultras since that's all I have access to, but support based - on what I would expect from a 14-sensor glove is included.) - - Each sensor's raw values are exposed as an analog channel (5 or 14) between 0.0 and 1.0. - Note that there is pretty significant need for calibration since the used range within the - entire representable range is pretty small and seemingly device-dependent. - Your code will probably have to at least perform some scaling based on establishing a - "min" and "max" for each sensor. - - For serial 5dt glove access, see the vrpn_5DT16 (for the 16-sensor model) and - vrpn_5dt (for the 5-sensor wired or wireless model, in vrpn_Analog_5dt.h) classes. - - The inherited method vrpn_Analog::getNumChannels() - - This base class does all the work: the inherited classes just create the right filters - and input for the base class. -*/ -class VRPN_API vrpn_Analog_5dtUSB : public vrpn_Analog, protected vrpn_HidInterface { - public: - /// Destructor - virtual ~vrpn_Analog_5dtUSB(); - - /// Standard VRPN mainloop method. - virtual void mainloop(); - - /// Returns a string description of the device we've connected to. Used internally, - /// but also possibly useful externally. - std::string get_description() const; - - /// Accessor to know if this is a left hand glove. - bool isLeftHand() const { return _isLeftHand; } - - /// Accessor to know if this is a right hand glove. - bool isRightHand() const { return !_isLeftHand; } - - protected: - /// Protected constructor: use a subclass to specify the glove variant to use. - vrpn_Analog_5dtUSB(vrpn_HidAcceptor *filter, int num_sensors, - bool isLeftHand, const char *name, vrpn_Connection *c = 0); - /// Extracts the sensor values from each report. - void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - /// Timestamp updated during mainloop() - struct timeval _timestamp; - - /// The raw values extracted from the report: which ones we use to set - /// analog channels varies based on the kind of device this is. - double _rawVals[16]; - - /// Flag for left handedness. - bool _isLeftHand; - - /// Flag indicating whether we were connected last time through the mainloop. - /// Used to send a "normal"-severity message when we connect with info on the - /// device. - bool _wasConnected; - - /// Send report iff changed - void report_changes(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - /// Send report whether or not changed - void report(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); -}; - -/// Specialization of vrpn_Analog_5dtUSB for a 5-sensor, left-hand glove. -class VRPN_API vrpn_Analog_5dtUSB_Glove5Left: public vrpn_Analog_5dtUSB { - public: - vrpn_Analog_5dtUSB_Glove5Left(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Analog_5dtUSB_Glove5Left() {}; -}; - -/// Specialization of vrpn_Analog_5dtUSB for a 5-sensor, right-hand glove. -class VRPN_API vrpn_Analog_5dtUSB_Glove5Right: public vrpn_Analog_5dtUSB { - public: - vrpn_Analog_5dtUSB_Glove5Right(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Analog_5dtUSB_Glove5Right() {}; -}; - -/// Specialization of vrpn_Analog_5dtUSB for a 14-sensor, left-hand glove. -/// Not tested as of 8-Mar-2011 because I don't have access to one. -class VRPN_API vrpn_Analog_5dtUSB_Glove14Left: public vrpn_Analog_5dtUSB { - public: - vrpn_Analog_5dtUSB_Glove14Left(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Analog_5dtUSB_Glove14Left() {}; -}; - -/// Specialization of vrpn_Analog_5dtUSB for a 14-sensor, right-hand glove. -/// Not tested as of 8-Mar-2011 because I don't have access to one. -class VRPN_API vrpn_Analog_5dtUSB_Glove14Right: public vrpn_Analog_5dtUSB { - public: - vrpn_Analog_5dtUSB_Glove14Right(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Analog_5dtUSB_Glove14Right() {}; -}; - -/// HID acceptor subclass used by vrpn_Analog_5dtUSB since the bits of -/// the product ID for these devices describe the device in a useful way. -class VRPN_API vrpn_HidProductMaskAcceptor: public vrpn_HidAcceptor { - public: - vrpn_HidProductMaskAcceptor(vrpn_uint16 vendorId, vrpn_uint16 productMask = 0x0000, vrpn_uint16 desiredProduct = 0x0000) : - vendor(vendorId), - product(desiredProduct), - mask(productMask) {} - - ~vrpn_HidProductMaskAcceptor() {} - - bool accept(const vrpn_HIDDEVINFO &device) { - return (device.vendor == vendor) && ((device.product & mask) == (product & mask)); - } - private: - vrpn_uint16 vendor; - vrpn_uint16 product; - vrpn_uint16 mask; -}; - -#endif // end of ifdef VRPN_USE_HID - -// end of VRPN_ANALOG_5DTUSB_H -#endif - diff --git a/src/vrpn/vrpn_Analog_Output.C b/src/vrpn/vrpn_Analog_Output.C deleted file mode 100644 index 002eb0eb59f26d39cb452ad6c80ecdb799670b8d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Analog_Output.C +++ /dev/null @@ -1,397 +0,0 @@ -#include "vrpn_Analog_Output.h" -#include <stdio.h> - -vrpn_Analog_Output::vrpn_Analog_Output(const char* name, vrpn_Connection* c) - : vrpn_BaseClass(name, c) - , o_num_channel(0) -{ - int i; - - // Call the base class' init routine - vrpn_BaseClass::init(); - - // Set the time to 0 just to have something there. - o_timestamp.tv_usec = o_timestamp.tv_sec = 0; - // Initialize the values in the channels, - // gets rid of uninitialized memory read error in Purify - // and makes sure any initial value change gets reported. - for (i = 0; i < vrpn_CHANNEL_MAX; i++) { - o_channel[i] = 0; - } -} - -int vrpn_Analog_Output::register_types(void) -{ - request_m_id = d_connection->register_message_type( - "vrpn_Analog_Output Change_request"); - request_channels_m_id = d_connection->register_message_type( - "vrpn_Analog_Output Change_Channels_request"); - report_num_channels_m_id = d_connection->register_message_type( - "vrpn_Analog_Output Num_Channels_report"); - got_connection_m_id = - d_connection->register_message_type(vrpn_got_connection); - if ((request_m_id == -1) || (request_channels_m_id == -1) || - (report_num_channels_m_id == -1) || (got_connection_m_id == -1)) { - return -1; - } - else { - return 0; - } -} - -void vrpn_Analog_Output::o_print(void) -{ - printf("Analog_Output Report: "); - for (vrpn_int32 i = 0; i < o_num_channel; i++) { - // printf("Channel[%d]= %f\t", i, o_channel[i]); - printf("%f\t", o_channel[i]); - } - printf("\n"); -} - -vrpn_Analog_Output_Server::vrpn_Analog_Output_Server(const char* name, - vrpn_Connection* c, - vrpn_int32 numChannels) - : vrpn_Analog_Output(name, c) -{ - this->setNumChannels(numChannels); - - // Check if we have a connection - if (d_connection == NULL) { - fprintf(stderr, "vrpn_Analog_Output: Can't get connection!\n"); - } - - // Register a handler for the request channel change message - if (register_autodeleted_handler(request_m_id, handle_request_message, this, - d_sender_id)) { - fprintf(stderr, "vrpn_Analog_Output_Server: can't register change " - "channel request handler\n"); - d_connection = NULL; - } - - // Register a handler for the request channels change message - if (register_autodeleted_handler(request_channels_m_id, - handle_request_channels_message, this, - d_sender_id)) { - fprintf(stderr, "vrpn_Analog_Output_Server: can't register change " - "channels request handler\n"); - d_connection = NULL; - } - - // Register a handler for vrpn_got_connection, so we can tell the - // client how many channels are active - if (register_autodeleted_handler(got_connection_m_id, handle_got_connection, - this)) { - fprintf(stderr, "vrpn_Analog_Output_Server: can't register new " - "connection handler\n"); - d_connection = NULL; - } -} - -// virtual -vrpn_Analog_Output_Server::~vrpn_Analog_Output_Server(void) {} - -vrpn_int32 vrpn_Analog_Output_Server::setNumChannels(vrpn_int32 sizeRequested) -{ - if (sizeRequested < 0) sizeRequested = 0; - if (sizeRequested > vrpn_CHANNEL_MAX) sizeRequested = vrpn_CHANNEL_MAX; - - o_num_channel = sizeRequested; - - return o_num_channel; -} - -/* static */ -int vrpn_Analog_Output_Server::handle_request_message(void* userdata, - vrpn_HANDLERPARAM p) -{ - const char* bufptr = p.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_float64 value; - vrpn_Analog_Output_Server* me = (vrpn_Analog_Output_Server*)userdata; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - vrpn_unbuffer(&bufptr, &value); - - // Set the appropriate value, if the channel number is in the - // range of the ones we have. - if ((chan_num < 0) || (chan_num >= me->o_num_channel)) { - fprintf(stderr, "vrpn_Analog_Output_Server::handle_request_message(): " - "Index out of bounds\n"); - char msg[1024]; - sprintf(msg, "Error: (handle_request_message): channel %d is not " - "active. Squelching.", - chan_num); - me->send_text_message(msg, p.msg_time, vrpn_TEXT_ERROR); - return 0; - } - me->o_channel[chan_num] = value; - - return 0; -} - -/* static */ -int vrpn_Analog_Output_Server::handle_request_channels_message( - void* userdata, vrpn_HANDLERPARAM p) -{ - int i; - const char* bufptr = p.buffer; - vrpn_int32 num; - vrpn_int32 pad; - vrpn_Analog_Output_Server* me = (vrpn_Analog_Output_Server*)userdata; - - // Read the values from the buffer - vrpn_unbuffer(&bufptr, &num); - vrpn_unbuffer(&bufptr, &pad); - if (num > me->o_num_channel) { - char msg[1024]; - sprintf(msg, "Error: (handle_request_channels_message): channels " - "above %d not active; " - "bad request up to channel %d. Squelching.", - me->o_num_channel, num); - me->send_text_message(msg, p.msg_time, vrpn_TEXT_ERROR); - num = me->o_num_channel; - } - if (num < 0) { - char msg[1024]; - sprintf(msg, "Error: (handle_request_channels_message): invalid " - "channel %d. Squelching.", - num); - me->send_text_message(msg, p.msg_time, vrpn_TEXT_ERROR); - return 0; - } - for (i = 0; i < num; i++) { - vrpn_unbuffer(&bufptr, &(me->o_channel[i])); - } - - return 0; -} - -/* static */ -int vrpn_Analog_Output_Server::handle_got_connection(void* userdata, - vrpn_HANDLERPARAM) -{ - vrpn_Analog_Output_Server* me = (vrpn_Analog_Output_Server*)userdata; - if (me->report_num_channels() == false) { - fprintf(stderr, "Error: failed sending active channels to client.\n"); - } - return 0; -} - -bool vrpn_Analog_Output_Server::report_num_channels( - vrpn_uint32 class_of_service) -{ - char msgbuf[sizeof(vrpn_int32)]; - vrpn_int32 len = sizeof(vrpn_int32); - ; - - encode_num_channels_to(msgbuf, this->o_num_channel); - vrpn_gettimeofday(&o_timestamp, NULL); - if (d_connection && - d_connection->pack_message(len, o_timestamp, report_num_channels_m_id, - d_sender_id, msgbuf, class_of_service)) { - fprintf(stderr, "vrpn_Analog_Output_Server (report_num_channels): " - "cannot write message: tossing\n"); - return false; - } - return true; -} - -vrpn_int32 vrpn_Analog_Output_Server::encode_num_channels_to(char* buf, - vrpn_int32 num) -{ - // Message includes: int32 number of active channels - int buflen = sizeof(vrpn_int32); - - vrpn_buffer(&buf, &buflen, num); - return sizeof(vrpn_int32); -} - -vrpn_Analog_Output_Callback_Server::vrpn_Analog_Output_Callback_Server( - const char* name, vrpn_Connection* c, vrpn_int32 numChannels) - : vrpn_Analog_Output_Server(name, c, numChannels) -{ - // Register a handler for the request channel change message. This will go - // in the list AFTER the one for the base class, so the values will already - // have been filled in. So we just need to call the user-level callbacks - // and pass them a pointer to the data values. - if (register_autodeleted_handler(request_m_id, handle_change_message, this, - d_sender_id)) { - fprintf(stderr, "vrpn_Analog_Output_Callback_Server: can't register " - "change channel request handler\n"); - d_connection = NULL; - } - - // Register a handler for the request channels change message. This will go - // in the list AFTER the one for the base class, so the values will already - // have been filled in. So we just need to call the user-level callbacks - // and pass them a pointer to the data values. - if (register_autodeleted_handler( - request_channels_m_id, handle_change_message, this, d_sender_id)) { - fprintf(stderr, "vrpn_Analog_Output_Callback_Server: can't register " - "change channels request handler\n"); - d_connection = NULL; - } -} - -// virtual -vrpn_Analog_Output_Callback_Server::~vrpn_Analog_Output_Callback_Server(void) {} - -/* static */ -// This is inserted into the list AFTER the -int vrpn_Analog_Output_Callback_Server::handle_change_message( - void* userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Analog_Output_Callback_Server* me = - (vrpn_Analog_Output_Callback_Server*)userdata; - vrpn_ANALOGOUTPUTCB callback_data; - - callback_data.msg_time = p.msg_time; - callback_data.num_channel = me->getNumChannels(); - callback_data.channel = me->o_channels(); - me->d_callback_list.call_handlers(callback_data); - - return 0; -} - -vrpn_Analog_Output_Remote::vrpn_Analog_Output_Remote(const char* name, - vrpn_Connection* c) - : vrpn_Analog_Output(name, c) -{ - vrpn_int32 i; - - o_num_channel = vrpn_CHANNEL_MAX; - for (i = 0; i < vrpn_CHANNEL_MAX; i++) { - o_channel[i] = 0; - } - vrpn_gettimeofday(&o_timestamp, NULL); - - // Register a handler for the report number of active channels message - if (register_autodeleted_handler(report_num_channels_m_id, - handle_report_num_channels, this, - d_sender_id)) { - fprintf(stderr, "vrpn_Analog_Output_Remote: can't register active " - "channel report handler\n"); - d_connection = NULL; - } -} - -// virtual -vrpn_Analog_Output_Remote::~vrpn_Analog_Output_Remote(void) {} - -void vrpn_Analog_Output_Remote::mainloop() -{ - if (d_connection) { - d_connection->mainloop(); - client_mainloop(); - } -} - -/* static */ -int vrpn_Analog_Output_Remote::handle_report_num_channels(void* userdata, - vrpn_HANDLERPARAM p) -{ - const char* bufptr = p.buffer; - vrpn_int32 num; - vrpn_Analog_Output_Remote* me = (vrpn_Analog_Output_Remote*)userdata; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &num); - - if (num >= 0 && num <= vrpn_CHANNEL_MAX) { - me->o_num_channel = num; - } - else { - fprintf( - stderr, - "vrpn_Analog_Output_Remote::handle_report_num_channels_message: " - "Someone sent us a bogus number of channels: %d.\n", - num); - } - return 0; -} - -bool vrpn_Analog_Output_Remote::request_change_channel_value( - unsigned int chan, vrpn_float64 val, vrpn_uint32 class_of_service) -{ - // msgbuf must be float64-aligned! - vrpn_float64 fbuf[2]; - char* msgbuf = (char*)fbuf; - - vrpn_int32 len; - - vrpn_gettimeofday(&o_timestamp, NULL); - len = encode_change_to(msgbuf, chan, val); - if (d_connection && - d_connection->pack_message(len, o_timestamp, request_m_id, d_sender_id, - msgbuf, class_of_service)) { - fprintf(stderr, - "vrpn_Analog_Output_Remote: cannot write message: tossing\n"); - return false; - } - - return true; -} - -bool vrpn_Analog_Output_Remote::request_change_channels( - int num, vrpn_float64* vals, vrpn_uint32 class_of_service) -{ - if (num < 0 || num > vrpn_CHANNEL_MAX) { - fprintf(stderr, "vrpn_Analog_Output_Remote: cannot change channels: " - "number of channels out of range\n"); - return false; - } - - vrpn_float64 fbuf[1 + vrpn_CHANNEL_MAX]; - char* msgbuf = (char*)fbuf; - vrpn_int32 len; - - vrpn_gettimeofday(&o_timestamp, NULL); - len = encode_change_channels_to(msgbuf, num, vals); - if (d_connection && - d_connection->pack_message(len, o_timestamp, request_channels_m_id, - d_sender_id, msgbuf, class_of_service)) { - fprintf(stderr, - "vrpn_Analog_Output_Remote: cannot write message: tossing\n"); - return false; - } - return true; -} - -vrpn_int32 vrpn_Analog_Output_Remote::encode_change_to(char* buf, - vrpn_int32 chan, - vrpn_float64 val) -{ - // Message includes: int32 channel_number, int32 padding, float64 - // request_value - // Byte order of each needs to be reversed to match network standard - - vrpn_int32 pad = 0; - int buflen = 2 * sizeof(vrpn_int32) + sizeof(vrpn_float64); - - vrpn_buffer(&buf, &buflen, chan); - vrpn_buffer(&buf, &buflen, pad); - vrpn_buffer(&buf, &buflen, val); - - return 2 * sizeof(vrpn_int32) + sizeof(vrpn_float64); -} - -vrpn_int32 -vrpn_Analog_Output_Remote::encode_change_channels_to(char* buf, vrpn_int32 num, - vrpn_float64* vals) -{ - int i; - vrpn_int32 pad = 0; - int buflen = 2 * sizeof(vrpn_int32) + num * sizeof(vrpn_float64); - - vrpn_buffer(&buf, &buflen, num); - vrpn_buffer(&buf, &buflen, pad); - for (i = 0; i < num; i++) { - vrpn_buffer(&buf, &buflen, vals[i]); - } - - return 2 * sizeof(vrpn_int32) + num * sizeof(vrpn_float64); -} diff --git a/src/vrpn/vrpn_Analog_Output.h b/src/vrpn/vrpn_Analog_Output.h deleted file mode 100644 index 7da443cfca05779f88c9224da329f0f150deec42..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Analog_Output.h +++ /dev/null @@ -1,193 +0,0 @@ -// vrpn_Analog_Output.h -// David Borland, September 2002 -// -// These classes are for setting values for an analog output device. The -// vrpn_Analog was getting overloaded by trying to have functionality for both -// reading and writing in it. If wanting to read analog values from a device, a -// vrpn_Analog should be used, if wanting to write analog values to a device, a -// vrpn_Analog_Output should be used. This is similar to the Tracker/Poser -// dichotomy. - -#ifndef VRPN_ANALOG_OUTPUT_H -#define VRPN_ANALOG_OUTPUT_H - -#include <stddef.h> // for NULL - -#include "vrpn_Analog.h" // for vrpn_CHANNEL_MAX -#include "vrpn_BaseClass.h" // for vrpn_Callback_List, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_RELIABLE, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_int32, vrpn_float64, etc - -// Similar to vrpn_Analog, but messages are different -// Members beginning with o_ are also found in vrpn_Analog, the o_ is -// so that you can derive a class from both without getting ambiguities -class VRPN_API vrpn_Analog_Output : public vrpn_BaseClass { -public: - vrpn_Analog_Output(const char* name, vrpn_Connection* c = NULL); - - // Print the status of the analog output device - void o_print(void); - - vrpn_int32 getNumChannels() const { return o_num_channel; } - -protected: - vrpn_float64 o_channel[vrpn_CHANNEL_MAX]; - vrpn_int32 o_num_channel; - struct timeval o_timestamp; - vrpn_int32 request_m_id; //< Request to change message from client - vrpn_int32 request_channels_m_id; //< Request to change channels message - // from client - vrpn_int32 report_num_channels_m_id; //< Report of the number of active - // channels, from the server - vrpn_int32 got_connection_m_id; //< new-connection notification - int o_status; - - virtual int register_types(void); -}; - -// A *Sample* Analog output server. Use this, or derive your own server -// from vrpn_Analog_Output with this as a guide. You can remove the -// user-level callback code (both the type before this class and the -// list and the handler register/deregister) if the server is controlling -// a device directly. - -class VRPN_API vrpn_Analog_Output_Server : public vrpn_Analog_Output { -public: - vrpn_Analog_Output_Server(const char* name, vrpn_Connection* c, - vrpn_int32 numChannels = vrpn_CHANNEL_MAX); - virtual ~vrpn_Analog_Output_Server(void); - - virtual void mainloop() { server_mainloop(); } - - /// Sets the size of the array; returns the size actually set. - /// (May be clamped to vrpn_CHANNEL_MAX) - /// This should be used before mainloop is ever called. - vrpn_int32 setNumChannels(vrpn_int32 sizeRequested); - - /// Exposes an array of values for the user to read from. - const vrpn_float64* o_channels(void) const { return o_channel; }; - -protected: - virtual bool report_num_channels( - vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - virtual vrpn_int32 encode_num_channels_to(char* buf, vrpn_int32 num); - - /// Responds to a request to change one of the values by - /// setting the channel to that value. Derived class must - /// either install handlers for this routine or else make - /// its own routines to handle the request message. - static int VRPN_CALLBACK - handle_request_message(void* userdata, vrpn_HANDLERPARAM p); - - /// Responds to a request to change a number of channels - /// Derived class must either install handlers for this - /// routine or else make its own routines to handle the - /// multi-channel request message. - static int VRPN_CALLBACK - handle_request_channels_message(void* userdata, vrpn_HANDLERPARAM p); - - /// Used to notify us when a new connection is requested, so that - /// we can let the client know how many channels are active - static int VRPN_CALLBACK - handle_got_connection(void* userdata, vrpn_HANDLERPARAM p); -}; - -// A more complicated analog server that provides a -// user routine to handle a change in analog values. This is called when -// the analog callback is called (when a message from its counterpart -// across the connection arrives). This callback is called whenever -// EITHER type of change message arrives (either a single-channel change -// or a multiple-channel change. - -typedef struct _vrpn_ANALOGOUTPUTCB { - struct timeval msg_time; // Timestamp of analog data - vrpn_int32 num_channel; // how many channels - const vrpn_float64* channel; // analog values (pointer to channels) -} vrpn_ANALOGOUTPUTCB; - -typedef void(VRPN_CALLBACK* vrpn_ANALOGOUTPUTCHANGEHANDLER)( - void* userdata, const vrpn_ANALOGOUTPUTCB info); - -class VRPN_API vrpn_Analog_Output_Callback_Server - : public vrpn_Analog_Output_Server { -public: - vrpn_Analog_Output_Callback_Server( - const char* name, vrpn_Connection* c, - vrpn_int32 numChannels = vrpn_CHANNEL_MAX); - virtual ~vrpn_Analog_Output_Callback_Server(void); - - // (un)Register a callback handler to handle analog value change. - // These will be called whenever EITHER type of change message is - // received, either a single channel or multiple channels. This is - // useful for applications that "have a" server, rather than derive - // from the server. - virtual int register_change_handler(void* userdata, - vrpn_ANALOGOUTPUTCHANGEHANDLER handler) - { - return d_callback_list.register_handler(userdata, handler); - }; - virtual int - unregister_change_handler(void* userdata, - vrpn_ANALOGOUTPUTCHANGEHANDLER handler) - { - return d_callback_list.unregister_handler(userdata, handler); - } - -protected: - /// Handles BOTH types of changes messages, and will be called - /// after the vrpn_Analog_Output_Server class has already filled - /// in the values. It just calls the user callbacks with the - /// appropriate pointer to the data values. - static int VRPN_CALLBACK - handle_change_message(void* userdata, vrpn_HANDLERPARAM p); - - /// List of user-level routines that need to be called back to let - /// them know that the values have changed. - vrpn_Callback_List<vrpn_ANALOGOUTPUTCB> d_callback_list; -}; - -// Open an analog output device that is on the other end of a connection -// and send updates to it. This is the type of analog output device -// that user code will deal with. -class VRPN_API vrpn_Analog_Output_Remote : public vrpn_Analog_Output { -public: - // The name of the analog device to connect to - // Optional argument to be used when the Remote should listen on - // a connection that is already open. - vrpn_Analog_Output_Remote(const char* name, vrpn_Connection* c = NULL); - virtual ~vrpn_Analog_Output_Remote(void); - - // This routine calls the mainloop of the connection it's on - virtual void mainloop(); - - // Request the analog to change its value to the one specified. - // Returns false on failure. - virtual bool request_change_channel_value( - unsigned int chan, vrpn_float64 val, - vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - - // Request the analog to change values all at once. If more values are - // given - // than we have channels, the extra values are discarded. If less values - // are - // given than we have channels, the extra channels are set to 0. - // Returns false on failure - virtual bool request_change_channels( - int num, vrpn_float64* vals, - vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - -protected: - // How we hear about the number of active channels - static int VRPN_CALLBACK - handle_report_num_channels(void* userdata, vrpn_HANDLERPARAM p); - - // Routines used to send requests from the client - virtual vrpn_int32 encode_change_to(char* buf, vrpn_int32 chan, - vrpn_float64 val); - virtual vrpn_int32 encode_change_channels_to(char* buf, vrpn_int32 num, - vrpn_float64* vals); -}; - -#endif diff --git a/src/vrpn/vrpn_Analog_Radamec_SPI.C b/src/vrpn/vrpn_Analog_Radamec_SPI.C deleted file mode 100644 index b1e7a7653d747c21381c5093f932b38cd4c6e326..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Analog_Radamec_SPI.C +++ /dev/null @@ -1,559 +0,0 @@ -// vrpn_Radamec_SPI.C -// This is a driver for the Radamec Serial Position Interface -// "virtual set" camera tracking rig. It plugs into a serial -// line and communicates using RS-232 (this is a raw-mode driver). -// You can find out more at www.radamec.com. They have a manual with -// a section on the serial interface; this code is based on that and -// communications with the vendor and experimentation. It was written in -// August 2000 by Russ Taylor. - -// INFO about how the device communicates: -// Reports coming from the device have a 1-byte header that tells -// which of 7 possible commands is being sent (0xA0-0xA6). Each then has -// a 1-byte Camera ID, then other parameters specific to the type, then -// a CRC checksum. -// Most of the report types can be sent to the instrument to set -// various parameters. Report type 4 is mainly a command/query message, -// which the device echoes. - - -#include <stdio.h> // for sprintf -#include <string.h> // for NULL, memcpy - -#include "vrpn_Analog_Radamec_SPI.h" -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR, etc -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_unbuffer, etc -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -#undef VERBOSE - -// Defines the modes in which the device can find itself. -#define STATUS_RESETTING (-1) // Resetting the device -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report - -#define MAX_TIME_INTERVAL (2000000) // max time between reports (usec) - -// This creates a vrpn_Radamec_SPI and sets it to reset mode. It opens -// the serial device using the code in the vrpn_Serial_Analog constructor. - -vrpn_Radamec_SPI::vrpn_Radamec_SPI (const char * name, vrpn_Connection * c, - const char * port, int baud): - vrpn_Serial_Analog(name, c, port, baud, 8, vrpn_SER_PARITY_ODD), - _numchannels(4), // This is an estimate; will change when reports come - _camera_id(-1) // Queried from the controller during reset -{ - // Set the parameters in the parent classes - vrpn_Analog::num_channel = _numchannels; - - // Set the status of the buttons and analogs to 0 to start - clear_values(); - - // Set the mode to reset - _status = STATUS_RESETTING; -} - -void vrpn_Radamec_SPI::clear_values(void) -{ - int i; - - for (i = 0; i < _numchannels; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } -} - - -/** This routine will compute the CRC for the message that starts at head - and is of length len. This needs to be added to each message sent to the - device, and should be checked for each command received by the device. - - The manual states that the CRC is "calculated by subtracting the total sum - of each byte of the block from 40H." -*/ - -unsigned char vrpn_Radamec_SPI::compute_crc(const unsigned char *head, int len) -{ - int i; - unsigned char sum; - - // Sum up the bytes, allowing them to overflow the unsigned char - sum = 0; - for (i = 0; i < len; i++) { - sum = (unsigned char)( sum + head[i] ); - } - - // Unsigned subtraction from 40H, again allowing the subtraction to overflow - return (unsigned char)(0x40 - sum); -} - -/** Compute the CRC for the command that is being sent, append that to the - message, and send the message. - - Returns 0 on success, -1 on failure. -*/ - -int vrpn_Radamec_SPI::send_command(const unsigned char *cmd, int len) -{ - int ret; - unsigned char *outbuf = new unsigned char[len+1]; // Leave room for the CRC - - // Put the command into the output buffer - memcpy(outbuf, cmd, len); - - // Add the CRC - outbuf[len] = compute_crc(cmd, len); - - // Send the command - ret = vrpn_write_characters(serial_fd, outbuf, len+1); - - // Tell if this all worked. - if (ret == len+1) { - return 0; - } else { - return -1; - } -} - - -/** Convert a 24-bit value from a buffer into an unsigned integer value. - The value has the most significant byte first in the buffer. -*/ - -vrpn_uint32 vrpn_Radamec_SPI::convert_24bit_unsigned(const unsigned char *buf) -{ - vrpn_uint32 retval; - unsigned char bigend_buf[4]; - const unsigned char *bufptr = bigend_buf; - - // Store the three values into three bytes of a big-endian 32-bit integer - bigend_buf[0] = 0; - bigend_buf[1] = buf[0]; - bigend_buf[2] = buf[1]; - bigend_buf[3] = buf[2]; - - // Convert the value to an integer - vrpn_unbuffer((const char **)&bufptr, &retval); - return retval; -} - - -/** Convert a 16-bit unsigned value from a buffer into an integer value. - The value has the most significant byte first in the buffer. -*/ - -vrpn_int32 vrpn_Radamec_SPI::convert_16bit_unsigned(const unsigned char *buf) -{ - vrpn_int32 retval; - unsigned char bigend_buf[4]; - const unsigned char *bufptr = bigend_buf; - - // Store the three values into two bytes of a big-endian 32-bit integer - bigend_buf[0] = 0; - bigend_buf[1] = 0; - bigend_buf[2] = buf[0]; - bigend_buf[3] = buf[1]; - - // Convert the value to an integer - vrpn_unbuffer((const char **)&bufptr, &retval); - return retval; -} - -/** ------------------- Conversion of encoder indices to values ---------------- - Pan and tilt axis have an encoder index pulse which resets the value to - 7FFFF hex each time the head passes through 0 degrees, the centre of range - of the head. This is indicated by two red dots on the pan axis, which when - aligned show the head is at 0 degrees. Tilt 0 position is when the camera - is horizontal. There are 900 encoder counts per degree and the direction - corresponding to an increase in count depends on the mechanical orientation - of the head and camera but is configurable using the configuration block - anyway. - - Zoom and focus return an encoder count corresponding to the barrel - rotation of the lens. You will have to calibrate this to give a value for - field of view for the virtual set. This is not an easy task as lens - characteristics are non-linear. All virtual studio system suppliers have - varying methods of doing lens calibration, including our own proprietary - method used for Radamec Virtual Scenario. -*/ - -double vrpn_Radamec_SPI::int_to_pan(vrpn_uint32 val) -{ - return (((int)val) - 0x7ffff) / 900.0; -} - -double vrpn_Radamec_SPI::int_to_zoom(vrpn_uint32 val) -{ - //XXX Unknown conversion, return the raw value - return val; -} - -double vrpn_Radamec_SPI::int_to_focus(vrpn_uint32 val) -{ - //XXX Unknown conversion, return the raw value - return val; -} - -double vrpn_Radamec_SPI::int_to_height(vrpn_uint32 val) -{ - //XXX Unknown conversion, send the integer along unchanged - return val; -} - -/** Convert from the millimeter and fraction-of-millimeter - values returned by the device into meters. -*/ -double vrpn_Radamec_SPI::int_to_X(vrpn_uint32 mm, vrpn_uint32 frac) -{ - return 0.001 * (mm + frac/65536.0); -} - -/** Convert from the 1/100 degree increments into degrees. */ - -double vrpn_Radamec_SPI::int_to_orientation(vrpn_uint32 val) -{ - return 0.01 * val; -} - - -// This routine will reset the Radamec_SPI, requesting the camera number from the -// device and then turning on stream mode. XXX The device never seems to return a -// response to these queries, but always seems to go ahead and spew reports, even -// when not genlocked. If you find a device that doesn't send reports, this may -// be a good place to look for the problem. -// Commands Responses Meanings -// <A4><FF><02><CRC> <A4><##><02><CRC> Request camera number; returns camera number in ## -// <A4><##><01><CRC> <A4><##><01><CRC> Start stream mode on the camera we were told we are - -int vrpn_Radamec_SPI::reset(void) -{ - unsigned char command[128]; -/* XXX commented out, since the response doesn't come, but the device still works. - struct timeval timeout; - unsigned char inbuf[128]; - int ret; - char errmsg[256]; -*/ - //----------------------------------------------------------------------- - // Send the command to request the camera ID and then read the response. - // Give it a reasonable amount of time to finish (2 seconds), then timeout - - vrpn_flush_input_buffer(serial_fd); - sprintf((char *)command, "%c%c%c", 0xa4, 0xff, 0x02); - send_command((unsigned char *)command, 3); -/* XXX commented out, since the response doesn't come, but the device still works. - timeout.tv_sec = 2; - timeout.tv_usec = 0; - ret = vrpn_read_available_characters(serial_fd, inbuf, 4, &timeout); - inbuf[4] = 0; // Make sure string is NULL-terminated - if (ret < 0) { - perror("vrpn_Radamec_SPI reset: Error reading camera ID from device\n"); - return -1; - } - if (ret == 0) { - VRPN_MSG_ERROR("reset: No response to camera ID from device"); - return -1; - } - if (ret != 4) { - sprintf(errmsg,"reset: Got %d of %d expected characters for camera ID\n",ret, 4); - VRPN_MSG_ERROR(errmsg); - return -1; - } - - // Make sure the string we got back is what we expected and then find out the camera ID - if ( (inbuf[0] != 0xa4) || (inbuf[2] != 0x02) || (inbuf[3] != compute_crc(inbuf,3)) ) { - VRPN_MSG_ERROR("reset: Bad response to camera # request"); - return -1; - } - _camera_id = inbuf[1]; -*/ - //----------------------------------------------------------------------- - // Send the command to put the camera into stream mode and then read back - // to make sure we got a response. - - sprintf((char *)command, "%c%c%c", 0xa4, _camera_id, 0x01); - send_command(command, 3); -/* XXX commented out, since the response doesn't come, but the device still works. - timeout.tv_sec = 2; - timeout.tv_usec = 0; - ret = vrpn_read_available_characters(serial_fd, inbuf, 4, &timeout); - inbuf[4] = 0; // Make sure string is NULL-terminated - if (ret < 0) { - VRPN_MSG_ERROR("reset: Error reading from device"); - return -1; - } - if (ret == 0) { - VRPN_MSG_ERROR("reset: No response from device"); - return -1; - } - if (ret != 4) { - sprintf(errmsg,"vrpn_Radamec_SPI reset: Got %d of %d expected characters\n",ret, 4); - VRPN_MSG_ERROR(errmsg); - return -1; - } - - // Make sure the string we got back is what we expected - if ( (inbuf[0] != 0xa4) || (inbuf[1] != _camera_id) || (inbuf[2] != 0x01) || - (inbuf[3] != compute_crc(inbuf,3)) ) { - VRPN_MSG_ERROR("reset: Bad response to start stream mode command"); - return -1; - } -*/ - // We're now waiting for a response from the box - status = STATUS_SYNCING; - - VRPN_MSG_WARNING("reset complete (this is good)"); - - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - return 0; -} - -// This function will read characters until it has a full report, then -// put that report into analog fields and call the report methods on these. -// The time stored is that of the first character received as part of the -// report. -// Reports start with different characters, and the length of the report -// depends on what the first character of the report is. We switch based -// on the first character of the report to see how many more to expect and -// to see how to handle the report. - -int vrpn_Radamec_SPI::get_report(void) -{ - int ret; // Return value from function call to be checked - char errmsg[256]; - - //-------------------------------------------------------------------- - // If we're SYNCing, then the next character we get should be the start - // of a report. If we recognize it, go into READing mode and tell how - // many characters we expect total. If we don't recognize it, then we - // must have misinterpreted a command or something; reset the Magellan - // and start over - //-------------------------------------------------------------------- - - if (status == STATUS_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, _buffer, 1) != 1) { - return 0; - } - - switch (_buffer[0]) { - case 0xa0: - _expected_chars = 15; status = STATUS_READING; break; - case 0xa1: - _expected_chars = 18; status = STATUS_READING; break; - case 0xa2: - _expected_chars = 30; status = STATUS_READING; break; - case 0xa3: - _expected_chars = 18; status = STATUS_READING; break; - case 0xa4: - _expected_chars = 4; status = STATUS_READING; break; - case 0xa5: - _expected_chars = 5; status = STATUS_READING; break; - case 0xa6: - _expected_chars = 26; status = STATUS_READING; break; - - default: - // Not a recognized command, keep looking - return 0; - } - - - // Got the first character of a report -- go into READING mode - // and record that we got one character at this time. The next - // bit of code will attempt to read the rest of the report. - // The time stored here is as close as possible to when the - // report was generated. - _bufcount = 1; - vrpn_gettimeofday(×tamp, NULL); - status = STATUS_READING; -#ifdef VERBOSE - printf("... Got the 1st char\n"); -#endif - } - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. - //-------------------------------------------------------------------- - - ret = vrpn_read_available_characters(serial_fd, &_buffer[_bufcount], - _expected_chars-_bufcount); - if (ret == -1) { - VRPN_MSG_ERROR("Error reading"); - status = STATUS_RESETTING; - return 0; - } - _bufcount += ret; -#ifdef VERBOSE - if (ret != 0) printf("... got %d characters (%d total)\n",ret, _bufcount); -#endif - if (_bufcount < _expected_chars) { // Not done -- go back for more - return 0; - } - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. Check to make - // sure that its format matches what we expect. If it does, the next - // section will parse it. If it does not, we need to go back into - // synch mode and ignore this report. A well-formed report has the - // correct CRC as its last character, and has the camera ID matching - // what we expect as its second character. - //-------------------------------------------------------------------- - - if (_buffer[_expected_chars-1] != compute_crc(_buffer, _expected_chars-1) ) { - status = STATUS_SYNCING; - VRPN_MSG_WARNING("Bad CRC in report (ignoring this report)"); - return 0; - } - _camera_id = _buffer[1]; - -#ifdef VERBOSE - printf("got a complete report (%d of %d)!\n", _bufcount, _expected_chars); -#endif - - //-------------------------------------------------------------------- - // Decode the report and store the values in it into the analog values - // if appropriate. - //-------------------------------------------------------------------- - - switch ( _buffer[0] ) { - case 0xa0: // Pan, Tilt, Zoom, Focus - _numchannels = 4; - channel[0] = int_to_pan(convert_24bit_unsigned(&_buffer[2])); - channel[1] = int_to_tilt(convert_24bit_unsigned(&_buffer[5])); - channel[2] = int_to_zoom(convert_24bit_unsigned(&_buffer[8])); - channel[3] = int_to_focus(convert_24bit_unsigned(&_buffer[11])); - break; - - case 0xa1: // Pan, Tilt, Zoom, Focus, Height - _numchannels = 5; - channel[0] = int_to_pan(convert_24bit_unsigned(&_buffer[2])); - channel[1] = int_to_tilt(convert_24bit_unsigned(&_buffer[5])); - channel[2] = int_to_zoom(convert_24bit_unsigned(&_buffer[8])); - channel[3] = int_to_focus(convert_24bit_unsigned(&_buffer[11])); - channel[4] = int_to_height(convert_24bit_unsigned(&_buffer[14])); - break; - - case 0xa2: // Pan, Tilt, Zoom, Focus, Height, X, Y, Orientation - _numchannels = 8; - channel[0] = int_to_pan(convert_24bit_unsigned(&_buffer[2])); - channel[1] = int_to_tilt(convert_24bit_unsigned(&_buffer[5])); - channel[2] = int_to_zoom(convert_24bit_unsigned(&_buffer[8])); - channel[3] = int_to_focus(convert_24bit_unsigned(&_buffer[11])); - channel[4] = int_to_height(convert_24bit_unsigned(&_buffer[14])); - // Note that fraction is first, and is unsigned, in the buffer - channel[5] = int_to_X(convert_16bit_unsigned(&_buffer[19]), - convert_16bit_unsigned(&_buffer[17])); - // Note that fraction is first, and is unsigned, in the buffer - channel[6] = int_to_X(convert_16bit_unsigned(&_buffer[23]), - convert_16bit_unsigned(&_buffer[21])); - channel[7] = int_to_orientation(convert_16bit_unsigned(&_buffer[25])); - break; - - case 0xa4: // Response to our reset commands -- ignore them - break; - - // Note that case 0xa3 should never happen, since we don't send this. - // We'll let the "default" case complain about getting it. - - // Note that 0xa5 should not happen, since we don't send it. - // We'll let the "default" case complain about getting it. - - - case 0xa6: // Pan, Tilt, Zoom, Focus, Height, X, Y, Orientation - // The same as A2, except that fractional X,Y not included. - _numchannels = 8; - channel[0] = int_to_pan(convert_24bit_unsigned(&_buffer[2])); - channel[1] = int_to_tilt(convert_24bit_unsigned(&_buffer[5])); - channel[2] = int_to_zoom(convert_24bit_unsigned(&_buffer[8])); - channel[3] = int_to_focus(convert_24bit_unsigned(&_buffer[11])); - channel[4] = int_to_height(convert_24bit_unsigned(&_buffer[14])); - // Note that fraction is not in the buffer - channel[5] = int_to_X(convert_16bit_unsigned(&_buffer[17]), 0); - // Note that fraction is not in the buffer - channel[6] = int_to_X(convert_16bit_unsigned(&_buffer[19]), 0); - channel[7] = int_to_orientation(convert_16bit_unsigned(&_buffer[21])); - break; - - default: - sprintf(errmsg,"vrpn_Radamec_SPI: Unhandled command (0x%02x), resetting\n", _buffer[0]); - VRPN_MSG_ERROR(errmsg); - status = STATUS_RESETTING; - return 0; - } - - //-------------------------------------------------------------------- - // Done with the decoding, send the reports and go back to syncing - //-------------------------------------------------------------------- - - report(); // Report, rather than report_changes(), since it is an absolute device - status = STATUS_SYNCING; - _bufcount = 0; - - return 1; -} - -void vrpn_Radamec_SPI::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - - vrpn_Analog::report_changes(class_of_service); -} - -void vrpn_Radamec_SPI::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - - vrpn_Analog::report(class_of_service); -} - -/** This routine is called each time through the server's main loop. It will - take a course of action depending on the current status of the device, - either trying to reset it or trying to get a reading from it. It will - try to reset the device if no data has come from it for a couple of - seconds -*/ - -void vrpn_Radamec_SPI::mainloop() -{ - char errmsg[256]; - - server_mainloop(); - - switch(status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - while (get_report()) {}; // Keep getting reports so long as there are more - - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) > MAX_TIME_INTERVAL) { - sprintf(errmsg,"Timeout... current_time=%ld:%ld, timestamp=%ld:%ld", - current_time.tv_sec, static_cast<long>(current_time.tv_usec), - timestamp.tv_sec, static_cast<long>(timestamp.tv_usec)); - VRPN_MSG_ERROR(errmsg); - status = STATUS_RESETTING; - } - } - break; - - default: - VRPN_MSG_ERROR("Unknown mode (internal error)"); - break; - } -} diff --git a/src/vrpn/vrpn_Analog_Radamec_SPI.h b/src/vrpn/vrpn_Analog_Radamec_SPI.h deleted file mode 100644 index 0fd97f4d40e964f2188643b004b92bb2eff68618..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Analog_Radamec_SPI.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef VRPN_RADAMEC_SPI_H -#define VRPN_RADAMEC_SPI_H - -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32, vrpn_int32 - -class VRPN_API vrpn_Radamec_SPI: public vrpn_Serial_Analog -{ -public: - vrpn_Radamec_SPI (const char * name, vrpn_Connection * c, - const char * port, int baud = 38400); - - ~vrpn_Radamec_SPI () {}; - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - - protected: - int _status; //< Reset, Syncing, or Reading - int _camera_id; //< What is our camera ID, queried from device - int _numchannels; //< How many analog channels to open - - unsigned _expected_chars; //< How many characters to expect in the report - unsigned char _buffer[512]; //< Buffer of characters in report - unsigned _bufcount; //< How many characters we have so far - - struct timeval timestamp; //< Time of the last report from the device - - virtual int reset(void); //< Set device back to starting config - virtual int get_report(void); //< Try to read a report from the device - - virtual void clear_values(void); //< Clears all channels to 0 - - /// Compute the CRC for the message or report starting at head with length len. - unsigned char compute_crc(const unsigned char *head, int len); - - /// Convert a 24-bit value from a buffer into an unsigned integer value - vrpn_uint32 convert_24bit_unsigned(const unsigned char *buf); - - /// Convert a 16-bit unsigned value from a buffer into an integer - vrpn_int32 convert_16bit_unsigned(const unsigned char *buf); - - double int_to_pan(vrpn_uint32 val); //< Returns pan in degrees - double int_to_tilt(vrpn_uint32 val) //< Returns tilt in degrees - { return int_to_pan(val); }; - double int_to_zoom(vrpn_uint32 val); //< Returns zoom in meters - double int_to_focus(vrpn_uint32 val); //< Returns focal length in meters - double int_to_height(vrpn_uint32 val); //< Returns height in meters - double int_to_X(vrpn_uint32 mm, vrpn_uint32 frac); //< Returns X location in meters - double int_to_Y(vrpn_uint32 mm, vrpn_uint32 frac) //< Returns Y location in meters - { return int_to_X(mm, frac); }; - double int_to_orientation(vrpn_uint32 val); //< Returns orientation in degrees - - /// Compute the CRC for the message, append it, and send message. - /// Returns 0 on success, -1 on failure. - int send_command(const unsigned char *cmd, int len); - - /// send report iff changed - virtual void report_changes - (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - /// send report whether or not changed - virtual void report - (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); -}; - -#endif diff --git a/src/vrpn/vrpn_Analog_USDigital_A2.C b/src/vrpn/vrpn_Analog_USDigital_A2.C deleted file mode 100644 index 39af3d78373618571c063b7e382dc3c44f0b6603..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Analog_USDigital_A2.C +++ /dev/null @@ -1,226 +0,0 @@ -// vrpn_Analog_USDigital_A2.C -// -// This is a driver for USDigital A2 Absolute Encoders. -// They can be daisy changed together, and utlimately, one or -// more plug into a serial port and communicate using RS-232. -// You can find out more at www.usdigital.com. -// -// To use this class, install the US Digital software, specifying -// the "SEI Explorer Demo Software" to install. -// -// Then uncomment the following line in vrpn_configure.h: -// #define VRPN_USE_USDIGITAL -// -// Note that because the 3rd party library is used, this class -// will only work under Windows. -// -// You must also include the following in your compilers include -// path for the 'vrpn' project: -// $(SYSTEMDRIVE)\Program Files\SEI Explorer -// -// Finally, the following must be included in vrpn.cfg to use -// the generic server: -// -// ################################################################################ -// # US Digital A2 Absolute Encoder Analog Input server. This will open the COM -// # port specified, configure the number of channels specified, and report -// # Absolute Encoder values in tenths of a degree from 0 to 3599. -// # -// # Arguments: -// # char name_of_this_device[] -// # int COM_port. If 0, search for correct COM port. -// # int number_of_channels -// # int 0 to report always, 1 to report on change only (optional, default=0) -// -// vrpn_Analog_USDigital_A2 Analog0 0 2 -// -// This code was written in October 2006 by Bill West, who -// used the vrpn_Analog_Server sample code written by -// Tom Hudson in March 1999 as a starting point. Bill also -// used some ideas from vrpn_Radamec_SPI.[Ch] written by -// Russ Taylor in August 2000. - -#include "vrpn_Analog_USDigital_A2.h" - -class VRPN_API vrpn_Connection; -#ifdef VRPN_USE_USDIGITAL -extern "C" { -#include <SEIDrv32.H> -} -#endif -#include <stdio.h> // for fprintf, stderr - -// Constants used by this class -const vrpn_uint32 vrpn_Analog_USDigital_A2::vrpn_Analog_USDigital_A2_CHANNEL_MAX = - // deallocate the list of device addresses. - (15<vrpn_CHANNEL_MAX) ? 15 : vrpn_CHANNEL_MAX ; // pick the least -const vrpn_uint32 vrpn_Analog_USDigital_A2::vrpn_Analog_USDigital_A2_FIND_PORT = 0 ; - -// Constructor initializes the USDigital's SEI communication, and prepares to read the A2 -vrpn_Analog_USDigital_A2::vrpn_Analog_USDigital_A2 (const char * name, - vrpn_Connection * c, - vrpn_uint32 portNum, - vrpn_uint32 numChannels, - vrpn_int32 reportOnChangeOnly) : -vrpn_Analog (name, c), -_SEIopened(vrpn_false), -_numDevices(0), -_devAddr(NULL), -_reportChange(reportOnChangeOnly!=0) -{ -#ifdef VRPN_USE_USDIGITAL - this->_devAddr = new long[vrpn_Analog_USDigital_A2::vrpn_Analog_USDigital_A2_CHANNEL_MAX] ; - if (this->_devAddr == NULL) { - fprintf(stderr,"vrpn_Analog_USDigital_A2: Out of memory!\n"); - return; - } - - this->setNumChannels( numChannels ); - - // Check if we got a connection. - if (d_connection == NULL) { - fprintf(stderr,"vrpn_Analog_USDigital_A2: Can't get connection!\n"); - return; - } - - // Prepare to get data from the SEI bus - long err; -#ifdef VRPN_USE_USDIGITAL - err = InitializeSEI(portNum, AUTOASSIGN) ; -#else - fprintf(stderr,"vrpn_Analog_USDigital_A2::vrpn_Analog_USDigital_A2(): Not yet implemented for this architecture\n"); - err = -1; -#endif - if (err) { - fprintf(stderr, "vrpn_Analog_USDigital_A2: Can't initialize SEI bus for port %d.\n", -#ifdef VRPN_USE_USDIGITAL - GetCommPort() -#else - 0 -#endif - ); - - return ; - } else { - _SEIopened = vrpn_true ; - } - - // Check if the number of devices matches that expected -#ifdef VRPN_USE_USDIGITAL - _numDevices = GetNumberOfDevices() ; -#endif - if (_numDevices<0 || _numDevices>vrpn_Analog_USDigital_A2::vrpn_Analog_USDigital_A2_CHANNEL_MAX) { - fprintf(stderr, - "vrpn_Analog_USDigital_A2: Error (%d) returned from GetNumberOfDevices call on SEI bus", - _numDevices) ; - _numDevices = 0 ; - } - if (_numDevices != numChannels) - fprintf(stderr, - "vrpn_Analog_USDigital_A2: Warning, number of requested devices (%d) is not the same as found (%d)\n", - numChannels, _numDevices) ; - - // Initialize the addresses - for (int c=0 ; c<vrpn_Analog_USDigital_A2::vrpn_Analog_USDigital_A2_CHANNEL_MAX ; c++) - _devAddr[c] = -1 ; - - // Get the device addresses. - for (vrpn_uint32 d=0 ; d<_numDevices ; d++) { - long deviceInfoErr, model, serialnum, version, addr ; -#ifdef VRPN_USE_USDIGITAL - deviceInfoErr = GetDeviceInfo(d, &model, &serialnum, &version, &addr) ; - if (!deviceInfoErr) - _devAddr[d] = addr ; -#endif - -#ifdef VERBOSE - // Dump out the device data - if (deviceInfoErr) - fprintf(stderr, "vrpn_Analog_USDigital_A2: could not get information on Device #%d!\n", d) ; - else - fprintf(stderr, "vrpn_Analog_USDigital_A2: Device #%d: model=%d, serialnum=%d, version=%d, addr=%d\n", - d, model, serialnum, version, addr) ; -#endif // VERBOSE - } -#else - fprintf(stderr,"vrpn_Analog_USDigital_A2::vrpn_Analog_USDigital_A2(): Not compiled in; define VRPN_USE_USDIGITAL in vrpn_Configure.h and recompile VRPN\n"); -#endif -} // constructor - -// This destructor closes out the SEI bus, and deallocates memory -vrpn_Analog_USDigital_A2::~vrpn_Analog_USDigital_A2() -{ -#ifdef VRPN_USE_USDIGITAL - // close out the SEI bus - if (_SEIopened==vrpn_true) { - (void) CloseSEI() ; - } - - // deallocate the list of device addresses. - delete _devAddr ; - _devAddr = 0 ; -#endif -} // destructor - -/** This routine is called each time through the server's main loop. It will - take a course of action depending on the current status of the device, - either trying to reset it or trying to get a reading from it. It will - try to reset the device if no data has come from it for a couple of - seconds -*/ - -void vrpn_Analog_USDigital_A2::mainloop() -{ - server_mainloop(); // let the server do its stuff -#ifdef VRPN_USE_USDIGITAL - long readErr, readVal ; - - // Read the data from the available channels - for (vrpn_uint32 c=0 ; c<(vrpn_uint32) num_channel ; c++) - { - // see if there's really a readable device there. - if (c<_numDevices && _devAddr[c]>=0) - { - readErr = A2GetPosition(_devAddr[c], &readVal) ; - if (readErr) - { - fprintf(stderr, - "vrpn_Analog_USDigital_A2: Error code %d received while reading channel %d.\n", - readErr, c) ; - fprintf(stderr, "vrpn_Analog_USDigital_A2: Attempting to reinitialize SEI bus...") ; - readErr = ResetSEI() ; - if (readErr) - fprintf(stderr, "failed.") ; - fprintf(stderr, "failed.") ; - // don't flood the log, and give the reset time to work - vrpn_SleepMsecs(1000) ; - } - else - channel[c] = (vrpn_float64) readVal ; - } - else - channel[c] = 0 ; // default to 0 for unreadable/unavailable. - } // for -#endif - - // Finally, the point of all this, deliver the data - if (_reportChange) - report_changes() ; - else - report() ; - -} // mainloop - -vrpn_int32 vrpn_Analog_USDigital_A2::setNumChannels (vrpn_int32 sizeRequested) -{ - if (sizeRequested < 0) - num_channel = 0; - else if (static_cast<unsigned>(sizeRequested) > vrpn_Analog_USDigital_A2::vrpn_Analog_USDigital_A2_CHANNEL_MAX) - num_channel = (vrpn_int32) vrpn_Analog_USDigital_A2::vrpn_Analog_USDigital_A2_CHANNEL_MAX; - else - num_channel = (vrpn_int32) sizeRequested; - - return num_channel; - -} // setNumChannels - diff --git a/src/vrpn/vrpn_Analog_USDigital_A2.h b/src/vrpn/vrpn_Analog_USDigital_A2.h deleted file mode 100644 index 447be0ed78c3c92c318320df67be27df9f78fae2..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Analog_USDigital_A2.h +++ /dev/null @@ -1,93 +0,0 @@ -// vrpn_Analog_USDigital_A2.C -// -// This is a driver for USDigital A2 Absolute Encoders. -// They can be daisy changed together, and utlimately, one or -// more plug into a serial port and communicate using RS-232. -// You can find out more at www.usdigital.com. -// -// To use this class, install the US Digital software, specifying -// the "SEI Explorer Demo Software" to install. -// -// Then uncomment the following line in vrpn_configure.h: -// #define VRPN_USE_USDIGITAL -// -// Note that because the 3rd party library is used, this class -// will only work under Windows. -// -// You must also include the following in your compilers include -// path for the 'vrpn' project: -// $(SYSTEMDRIVE)\Program Files\SEI Explorer -// -// Finally, the following must be included in vrpn.cfg to use -// the generic server: -// -// ################################################################################ -// # US Digital A2 Absolute Encoder Analog Input server. This will open the COM -// # port specified, configure the number of channels specified, and report -// # Absolute Encoder values in tenths of a degree from 0 to 3599. -// # -// # Arguments: -// # char name_of_this_device[] -// # int COM_port. If 0, search for correct COM port. -// # int number_of_channels -// # int 0 to report always, 1 to report on change only (optional, default=0) -// -// vrpn_Analog_USDigital_A2 Analog0 0 2 -// -// This code was written in October 2006 by Bill West, who -// used the vrpn_Analog_Server sample code written by -// Tom Hudson in March 1999 as a starting point. Bill also -// used some ideas from vrpn_Radamec_SPI.[Ch] written by -// Russ Taylor in August 2000. -#ifndef VRPN_ANALOG_USDIGITAL_A2_H -#define VRPN_ANALOG_USDIGITAL_A2_H - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Types.h" // for vrpn_uint32, vrpn_int32, etc - -class VRPN_API vrpn_Connection; - -class VRPN_API vrpn_Analog_USDigital_A2 : public vrpn_Analog { - - public: - - // Constants used by this class - static const vrpn_uint32 vrpn_Analog_USDigital_A2_CHANNEL_MAX ; - static const vrpn_uint32 vrpn_Analog_USDigital_A2_FIND_PORT ; - - // Constructor - vrpn_Analog_USDigital_A2 (const char * name, vrpn_Connection * c, - vrpn_uint32 portNum=vrpn_Analog_USDigital_A2_FIND_PORT, - vrpn_uint32 numChannels=vrpn_Analog_USDigital_A2_CHANNEL_MAX, - vrpn_int32 reportOnChangeOnly=0) ; - - // Destructor - virtual ~vrpn_Analog_USDigital_A2() ; - - // Here's where the encoders are actually read - virtual void mainloop () ; - - private: - // Maintains whether the SEI bus has been opened or not - vrpn_bool _SEIopened ; - - // Addresses of the devices - long *_devAddr ; - - // Whether to report() or report_change() ; - vrpn_bool _reportChange ; - - // Actual number of devices (as opposed to channels) - vrpn_uint32 _numDevices ; - - /// Exposes an array of values for the user to write into. - vrpn_float64* channels (void) { return channel; } - - /// Sets the size of the array; returns the size actually set. - /// (May be clamped to vrpn_CHANNEL_MAX) - /// This should be used before mainloop is ever called. - vrpn_int32 setNumChannels (vrpn_int32 sizeRequested); -}; - -#endif // VRPN_ANALOG_USDIGITAL_A2_H diff --git a/src/vrpn/vrpn_Android.C b/src/vrpn/vrpn_Android.C deleted file mode 100644 index a1f17fd723590ec3e6729cf3f6499c89c2098280..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Android.C +++ /dev/null @@ -1,121 +0,0 @@ -#include "vrpn_Android.h" -#include <sstream> -#include <string> -#include <bitset> - -//////////// Callbacks used by the local clients /////////////// -void VRPN_CALLBACK button_press(void *, const vrpn_BUTTONCB b) -{ - fprintf(stderr, "Button_Server_Remote: button %i state %i\n", b.button, b.state); -} - -void VRPN_CALLBACK handle_analog (void *userdata, const vrpn_ANALOGCB a) -{ - vrpn_int32 i; - const char *name = (const char *)userdata; - - fprintf(stderr, "Analog:\n %5.2f", a.channel[0]); - for (i = 1; i < a.num_channel; i++) { - fprintf(stderr, ", %5.2f\n", a.channel[i]); - } - fprintf(stderr, " (%d chans)\n", a.num_channel); -} -//////////////////////////////////////////////////////////////// - - -vrpn_Android_Server::vrpn_Android_Server(vrpn_int32 num_analogs, vrpn_int32 * analog_sizes, vrpn_int32 num_buttons, vrpn_int32 port) -{ - fprintf(stderr, "C++: vrpn_Android_Server instantiated\n"); - this->port = port; - this->initialize(num_analogs, analog_sizes, num_buttons); -} - -void vrpn_Android_Server::initialize(vrpn_int32 num_analogs, vrpn_int32 * analog_sizes, vrpn_int32 num_buttons) -{ - ANALOG_SERVER_NAME = "Analog"; // Numbers added automatically - BUTTON_SERVER_NAME = "Button0"; - - this->num_analogs = num_analogs; - this->analog_sizes = analog_sizes; - - fprintf(stderr, "vrpn_Android_Server: using port %i\n", port); - - fprintf(stderr, "vrpn_Android_Server: getting server connection...\n"); - connection = vrpn_create_server_connection(port); - fprintf(stderr, (connection == 0) ? "vrpn_Android_Server: Failed to get connection\n" : "vrpn_Android_Server: Got connection\n"); - - // Create analog servers - analog_server = new vrpn_Analog_Server*[num_analogs]; - - for (int i = 0; i < num_analogs; i++) - { - std::stringstream name; - name << ANALOG_SERVER_NAME << i; - analog_server[i] = new vrpn_Analog_Server(name.str().c_str(), connection, analog_sizes[i]); - analog_server[i]->setNumChannels(analog_sizes[i]); - fprintf(stderr, "vrpn_Android_Server: instantiated analog server %i\n", i); - } - - // Create button server - button_server = new vrpn_Button_Server(BUTTON_SERVER_NAME, connection, num_buttons); - fprintf(stderr, "vrpn_Android_Server: instantiated button server\n"); - - // Create analog clients - analog_client = new vrpn_Analog_Remote*[num_analogs]; - - for (int i = 0; i < num_analogs; i++) - { - std::stringstream name; - name << ANALOG_SERVER_NAME << i; - analog_client[i] = new vrpn_Analog_Remote(name.str().c_str(), connection); - analog_client[i]->register_change_handler(const_cast <char*> (name.str().c_str()), handle_analog); - - } - - // Create button client - button_client = new vrpn_Button_Remote(BUTTON_SERVER_NAME, connection); - button_client->register_change_handler(const_cast <char*> (BUTTON_SERVER_NAME), button_press); - - fprintf(stderr, "C++: vrpn_Android_Server initialized\n"); -} - -void vrpn_Android_Server::mainloop() -{ - for (vrpn_int32 i = 0; i < num_analogs; i++) - { - analog_server[i]->mainloop(); - analog_client[i]->mainloop(); - } - button_server->mainloop(); - button_client->mainloop(); - connection->mainloop(); -} - -void vrpn_Android_Server::set_button(vrpn_int32 button_id, vrpn_int32 state) -{ - button_server->set_button(button_id, state); -} - -void vrpn_Android_Server::set_analog(vrpn_int32 analog_id, vrpn_int32 channel, vrpn_float64 val) -{ - vrpn_float64 * channels = analog_server[analog_id]->channels(); - channels[channel] = val; -} - -void vrpn_Android_Server::report_analog_chg(vrpn_int32 analog_id) -{ - analog_server[analog_id]->report(); -} - -vrpn_Android_Server::~vrpn_Android_Server() -{ - for (vrpn_int32 i = 0; i < num_analogs; i++) - { - delete analog_server[i]; - delete analog_client[i]; - } - delete button_server; - delete button_client; - delete connection; - fprintf(stderr, "C++: vrpn_Android_Server destroyed\n"); -} diff --git a/src/vrpn/vrpn_Android.h b/src/vrpn/vrpn_Android.h deleted file mode 100644 index 8d2cbd3171928f7e6a64bb26340f02c734c0666c..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Android.h +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef VRPN_ANDROID_H -#define VRPN_ANDROID_H - -#include <jni.h> -#include <stdlib.h> -#include <stdio.h> -#include <signal.h> -#include <string> -#include <string.h> - -#include "vrpn_Types.h" - -#ifndef VRPN_BUTTON_H -#include "vrpn_Button.h" -#define VRPN_BUTTON_H -#endif - -#ifndef VRPN_ANALOG_H -#include "vrpn_Analog.h" -#define VRPN_ANALOG_H -#endif - -/* - * This is an Android server implementation. It has as members a vrpn_Button_Server - * and some number of vrpn_Analog_Servers, as determined by the Java side. This - * implementation also has vrpn_Button_Remote and vrpn_Analog_Remote clients for - * the sole purpose of testing. All data from the Android is represented here - * as either Analogs or Buttons. - * - * All interaction between this class and the Java side are handled by the jni layer. - * - * It's worth noting that it is possible to pipe stdout to the Android log - directions - * for doing so are in the manual for this project - and all output is in the form of: - * fprintf(stderr, "..."), which we've found to be more reliable than other methods, - * including fprintf(stdout, "..."). - */ - - -class vrpn_Android_Server -{ -public: - - /// Constructor. Takes an array of integers representing the number of channels for each analog server, the number of buttons, and the port number. - vrpn_Android_Server(vrpn_int32 num_analogs, vrpn_int32 * analog_sizes, vrpn_int32 num_buttons, vrpn_int32 port); - - /// Destructor. - ~vrpn_Android_Server(); - - /// Main loop to be called at every time step. Calls the mainloop() functions of the member servers. - void mainloop(); - - /// Set the value for the given channel of the given vrpn_Analog_Server - void set_analog(vrpn_int32 analog_id, vrpn_int32 channel, vrpn_float64 val); - - /// Set the value for the given button - void set_button(vrpn_int32 button_id, vrpn_int32 state); - - /// Called when changes are made to any of the analog values - void report_analog_chg(vrpn_int32 analog_id); - -private: - - /// Sets up the member servers - void initialize(vrpn_int32 num_analogs, vrpn_int32 * analog_sizes, vrpn_int32 num_buttons); - - // Names of the member servers. Only used by the local clients - const char * ANALOG_SERVER_NAME; // with no id number; those are formed automatically - const char * BUTTON_SERVER_NAME; // uses id 0, since there is only one button server - - vrpn_int32 num_analogs; // Number of vrpn_Analog_Servers - vrpn_int32 * analog_sizes; // Array of numbers of channels in the analog servers - - vrpn_Analog_Server ** analog_server; // handles multi-touch x and y as well as any sliders, dials, etc - vrpn_Button_Server * button_server; - - vrpn_Analog_Remote ** analog_client; - vrpn_Button_Remote * button_client; - - vrpn_Connection * connection; - - vrpn_int32 port; -}; - -#endif diff --git a/src/vrpn/vrpn_Atmel.C b/src/vrpn/vrpn_Atmel.C deleted file mode 100644 index 186ac3a0bb34c19fc40de620583ba9cce5d34b86..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Atmel.C +++ /dev/null @@ -1,451 +0,0 @@ -/***************************************************************************************************/ -/* */ -/* Copyright (C) 2003 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/***************************************************************************************************/ -/* */ -/* module : vrpn_Atmel */ -/* project : vrpn_Avango */ -/* description: server for microcontroller based on Atmel chip */ -/* hardware developed by Albotronic: www.albotronic.de */ -/* */ -/***************************************************************************************************/ - -#ifndef _WIN32 - -#include <errno.h> // for errno -#include <stdio.h> // for fprintf, stderr, printf, etc -#include <stdlib.h> // for exit -#include <sys/select.h> // for select, FD_SET, FD_ZERO, etc -#include <vrpn_Shared.h> // for vrpn_gettimeofday - -#include "vrpn_Atmel.h" -#include "vrpn_Connection.h" // for vrpn_Connection -#include "vrpn_Types.h" // for vrpn_float64 -#include "vrpn_atmellib.h" // for getRegister, closePort, etc -#include "vrpn_atmellib_errno.h" // for ATMELLIB_NOERROR - -#include <termios.h> // for tcflush, TCIOFLUSH, termios - -#include <string.h> // for strerror - -/***************************************************************************************************/ -/***************************************************************************************************/ -namespace { - -struct termios init_params; -struct timeval wait; - -/***************************************************************************************************/ -// check if there if the Atmel is connected to the serial -/***************************************************************************************************/ -bool -check_serial(int fd) -{ - int ret=0; - - // make a new fd set to watch - fd_set rfds; - - // clear the set - FD_ZERO( &rfds ); - // ad the current fd to the set - FD_SET( fd, &rfds ); - - wait.tv_sec = 5; - wait.tv_usec = 0; - - ret = select( fd+1 , &rfds , 0 , 0 , &wait); - - if (ret == 0) { - - printf("Atmel not connected to the specified port.\n"); - printf("Connect and try again.\n"); - - return false; - } - else if (ret<0) { - - printf("Error while checking if Atmel is connected.\n"); - printf("Error: %s (%i)\n", strerror(errno), errno ); - - return false; - } - - printf("Atmel started.\n\n"); - - return true; -} - -} // end of namespace - -/***************************************************************************************************/ -/* factory */ -/***************************************************************************************************/ -/* static */ vrpn_Atmel * -vrpn_Atmel::Create(char* name, vrpn_Connection *c, - const char *port, long baud, - int channel_count , - int * channel_mode) -{ - int fd; - -#ifdef VRPN_ATMEL_SERIAL_VRPN - - if ( (fd=vrpn_open_commport(port, baud)) == -1) { - - fprintf(stderr,"vrpn_Atmel: can't Open serial port\n"); - - return NULL; - } -#else - // Open the serial port - if ( (fd=openPort(port, baud, &init_params)) == -1) { - - fprintf(stderr,"vrpn_Atmel: can't Open serial port\n"); - - return NULL; - } - - // look if the atmel is connected - if (! check_serial(fd) ) { - - return NULL; - } -#endif - - vrpn_Atmel * self = new vrpn_Atmel(name, c, fd); - - if ( (self->vrpn_Analog_Server::setNumChannels(channel_count) != channel_count) - || (self->vrpn_Analog_Output_Server::setNumChannels(channel_count) != channel_count) ) { - - fprintf(stderr,"vrpn_Atmel: the requested number of channels is not available\n"); - delete self; - - return NULL; - } - - - // init the channels based on the infos given from the config file - self->init_channel_mode(channel_mode); - - self->_status = VRPN_ATMEL_STATUS_WAITING_FOR_CONNECTION; - - return self; -} - - - -/***************************************************************************************************/ -/* constructor */ -/***************************************************************************************************/ -vrpn_Atmel::vrpn_Atmel(char* name, vrpn_Connection *c, int fd) - : vrpn_Analog_Server(name, c), vrpn_Analog_Output_Server(name, c), - _status(VRPN_ATMEL_STATUS_ERROR), - serial_fd(fd) -{ - // find out what time it is - needed? - vrpn_gettimeofday(×tamp, 0); - vrpn_gettimeofday(&_time_alive, 0); - vrpn_Analog::timestamp = timestamp; -} - - -/***************************************************************************************************/ -/* destructor */ -/***************************************************************************************************/ -vrpn_Atmel::~vrpn_Atmel() -{ -#ifdef VRPN_ATMEL_SERIAL_VRPN - vrpn_close_commport(serial_fd); -#else - closePort(serial_fd , &init_params); -#endif - - -} - -/***************************************************************************************************/ -/* mainloop */ -/***************************************************************************************************/ -void -vrpn_Atmel::mainloop() -{ - if (_status == VRPN_ATMEL_STATUS_ERROR) { - - return; - } - - // o_num_channel is used as reference against num_channel - if (o_num_channel != num_channel) { - - num_channel = o_num_channel; - } - - server_mainloop(); - - // get the pending messages so that the buffer to write down is updated - d_connection->mainloop(); - - if ( ! d_connection->connected()) { - - return; - } - - // it's the first time we are in mainloop after - if ( _status == VRPN_ATMEL_STATUS_WAITING_FOR_CONNECTION) { - - if (handle_new_connection()) { - - _status = VRPN_ATMEL_STATUS_RUNNING; - - fprintf(stderr,"vrpn_Atmel: mainloop()\n"); - fprintf(stderr," new connection. status set to RUNNING\n"); - } - else { - - _status = VRPN_ATMEL_STATUS_ERROR; - - fprintf(stderr,"vrpn_Atmel: mainloop()\n"); - fprintf(stderr," error handling new connection. status set to ERROR\n"); - - return; - } - - } - - // do the read/write operations on the serial port - if ( ! mainloop_serial_io() ) { - - fprintf(stderr,"vrpn_Atmel: mainloop()\n"); - fprintf(stderr," error while io operations ERROR\n"); - - } - - vrpn_Analog::report(); - //vrpn_Analog::report_changes(); - - d_connection->mainloop(); -} - -/***************************************************************************************************/ -/* check if the connection to the Atmel is still reliable */ -/***************************************************************************************************/ -bool -vrpn_Atmel::Check_Serial_Alive() -{ - struct timeval look_time; - - // check serial status every second - if ((timestamp.tv_sec - _time_alive.tv_sec) > VRPN_ATMEL_ALIVE_INTERVAL_SEC) { - - // reset time alive - vrpn_gettimeofday(&_time_alive,0); - - tcflush(serial_fd, TCIOFLUSH); - - // make a new fd set to watch - fd_set rfds; - - // clear the set - FD_ZERO( &rfds ); - // ad the current fd to the set - FD_SET( serial_fd, &rfds ); - - look_time.tv_sec = VRPN_ATMEL_ALIVE_TIME_LOOK_SEC; - look_time.tv_usec = VRPN_ATMEL_ALIVE_TIME_LOOK_USEC; - - if ((select( (serial_fd+1) , &rfds , 0 , 0 , &look_time)) <= 0) { - - fprintf(stderr, "\nExiting...\n"); - - fprintf(stderr, "vrpn_Atmel::Check_Serial_Alive: connection timed out after (sec,msec):"); - fprintf(stderr, "%i,%i\n", VRPN_ATMEL_ALIVE_TIME_LOOK_SEC, VRPN_ATMEL_ALIVE_TIME_LOOK_USEC); - fprintf(stderr, "Killing Program!!!\n"); - - return false; - } - -#ifdef VRPN_ATMEL_VERBOSE - fprintf(stderr, "Connection still available...\n"); -#endif - } - - return true; -} - -/***************************************************************************************************/ -/* io operations on the serial port in mainloop */ -/***************************************************************************************************/ -bool -vrpn_Atmel::mainloop_serial_io() -{ - vrpn_gettimeofday(×tamp, 0); - vrpn_Analog::timestamp = timestamp; - - // check if there is still a valid connection to the Chip - if (!Check_Serial_Alive()) { - - // kill the program - // use e.g. a cron job to init the whole connection mechanism again - exit(0); - } - - // do for all channels - for(int i=0; i<o_num_channel; ++i) { - - if (o_channel[i] == VRPN_ATMEL_CHANNEL_NOT_VALID) { - - // unused channel - continue; - } - - // find out which channels have to been written down to the device - if (o_channel[i] != channel[i]) { - - // test if channel is writable - if ( (_channel_mode[i] != VRPN_ATMEL_MODE_RW) - && (_channel_mode[i] != VRPN_ATMEL_MODE_WO) ) { - - fprintf(stderr,"vrpn_Atmel: mainloop_serial_io()\n"); - fprintf(stderr," channel not writable\n"); - - channel[i] = VRPN_ATMEL_ERROR_NOT_WRITABLE; - - continue; - } - - // test if it is a valid value: atmel uses 8 bit - if ((o_channel[i]<0) || (o_channel[i]>255)) { - - fprintf(stderr,"vrpn_Atmel: mainloop_serial_io()\n"); - fprintf(stderr," value out of range\n"); - - channel[i] = VRPN_ATMEL_ERROR_OUT_OF_RANGE; - - continue; - } - - // try to write down - if (setRegister(serial_fd, i, (unsigned char) o_channel[i]) - != ATMELLIB_NOERROR) { - - fprintf(stderr,"vrpn_Atmel: mainloop_serial_io()\n"); - fprintf(stderr," error writing down value, channel: %d\n",i); - - channel[i] = VRPN_ATMEL_ERROR_WRITING_DOWN; - - continue; - } - else { - - fprintf(stderr,"vrpn_Atmel: mainloop_serial_io()\n"); - fprintf(stderr," written down value, channel: %d\n",i); - } - - // no error - channel[i] = o_channel[i]; - - continue; - } - - // this values are not requested for change -> read them - - if ( (_channel_mode[i] == VRPN_ATMEL_MODE_RO) - || (_channel_mode[i] == VRPN_ATMEL_MODE_RW) ) { - - if ( (channel[i] = getRegister(serial_fd, i)) < 0) { - -#ifdef VRPN_ATMEL_VERBOSE - fprintf(stderr, "Channel read: i=%i val=%f\n",i,channel[i]); - - fprintf(stderr,"vrpn_Atmel: mainloop_serial_io()\n"); - fprintf(stderr," error reading out value. channel=%d\n",i); -#endif - // reset to the old value - don't send the error - // in some cases it's propably useful to know the error - channel[i] = VRPN_ATMEL_ERROR_READING_IN; - //channel[i] = last[i]; - } - } - - } // end of for-loop - - for(int i=0; i<o_num_channel ;++i) { - - o_channel[i] = channel[i]; - } - - return true; -} - - -/***************************************************************************************************/ -/* init the io mode of the channels: */ -/***************************************************************************************************/ -void -vrpn_Atmel::init_channel_mode(int * channel_mode) -{ - int val=0; - - for(int i=0; i<o_num_channel; ++i) { - - _channel_mode.push_back(channel_mode[i]); - - if ( (channel_mode[i] == VRPN_ATMEL_MODE_RO) - || (_channel_mode[i] == VRPN_ATMEL_MODE_RW) ) { - - // read the current value of the register - val=getRegister(serial_fd , i); - if (val < 0) { - - // error while reading register value - fprintf(stderr,"vrpn_Atmel: init_channel_mode()\n"); - fprintf(stderr," error reading out value: %i\n", val); - - o_channel[i] = VRPN_ATMEL_CHANNEL_NOT_VALID; - channel[i] = VRPN_ATMEL_CHANNEL_NOT_VALID; - } - else { - - channel[i] = (float) val; - o_channel[i] = (float) val; - -#ifdef VRPN_ATMEL_VERBOSE - fprintf(stderr, "vrpn_Atmel: i=%d val=%d\n",i ,val); -#endif - - } - } - else { - - // channel is not for reading - o_channel[i] = VRPN_ATMEL_CHANNEL_NOT_VALID; - channel[i] = VRPN_ATMEL_CHANNEL_NOT_VALID; - } - - } // end of for loop -} - - -/***************************************************************************************************/ -/* init the io mode of the channels: */ -/***************************************************************************************************/ -bool -vrpn_Atmel::handle_new_connection() -{ - // request to send the current status of all registers - vrpn_Analog::report(); - - printf("\nconnection received.\n\n"); - - // really send the current status - d_connection->mainloop(); - - return true; -} - -#endif - diff --git a/src/vrpn/vrpn_Atmel.h b/src/vrpn/vrpn_Atmel.h deleted file mode 100644 index aaea8b0fd8e37475ad6771694998cfee12fa36e3..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Atmel.h +++ /dev/null @@ -1,128 +0,0 @@ -// -*- Mode:C++ -*- -/***************************************************************************************************/ -/* */ -/* Copyright (C) 2004 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/***************************************************************************************************/ -/* */ -/* module : vrpn_Atmel.h */ -/* project : vrpn_Avango */ -/* description: server for microcontroller board based on Atmel's ATMEGA32 */ -/* hardware developed by Albotronic: www.albotronic.de */ -/* */ -/***************************************************************************************************/ - -#ifndef VRPN_ATMEL -#define VRPN_ATMEL - -/***************************************************************************************************/ -/* compiler flags */ - -/* serial lib - default is atmellib - can be changed to vrpn_Serial (problems when dropping connection from client side, - read blocks for unknown reason -*/ -//#define VRPN_ATMEL_SERIAL_VRPN - -/* debug flags */ -#define VRPN_ATMEL_VERBOSE -//#define VRPN_ATMEL_TIME_MEASURE - - -/***************************************************************************************************/ -/* vrpn atmellib error values -> reported to the client */ - -#define VRPN_ATMEL_ERROR_READING_IN -21 -#define VRPN_ATMEL_ERROR_WRITING_DOWN -22 -#define VRPN_ATMEL_ERROR_OUT_OF_RANGE -23 -#define VRPN_ATMEL_ERROR_NOT_WRITABLE -24 - -#define VRPN_ATMEL_MODE_RO 101 -#define VRPN_ATMEL_MODE_RW 102 -#define VRPN_ATMEL_MODE_WO 103 -#define VRPN_ATMEL_MODE_NA 104 - -#define VRPN_ATMEL_STATUS_WAITING_FOR_CONNECTION 201 -#define VRPN_ATMEL_STATUS_RUNNING 202 -#define VRPN_ATMEL_STATUS_ERROR -200 - -#define VRPN_ATMEL_CHANNEL_NOT_VALID -1 - -#define VRPN_ATMEL_ALIVE_TIME_LOOK_SEC 3 -#define VRPN_ATMEL_ALIVE_TIME_LOOK_USEC 0 -#define VRPN_ATMEL_ALIVE_INTERVAL_SEC 1 - -/***************************************************************************************************/ -/* system includes */ -#include <vector> // for vector -#include <stddef.h> // for NULL - -/***************************************************************************************************/ -/* project includes */ -#include "vrpn_Analog.h" // for vrpn_Analog_Server -#include "vrpn_Analog_Output.h" // for vrpn_Analog_Output_Server -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Shared.h" // for timeval - -class VRPN_API vrpn_Connection; - -#ifdef VRPN_ATMEL_SERIAL_VRPN -# include "vrpn_Serial.h" -#endif - -/***************************************************************************************************/ -class VRPN_API vrpn_Atmel : public vrpn_Analog_Server, vrpn_Analog_Output_Server { - -public: - - static vrpn_Atmel * - Create(char* name, vrpn_Connection *c, - const char *port="/dev/ttyS0/", long baud=9600, - int channel_count=0, - int * channel_mode=NULL); - - ~vrpn_Atmel(); - - void mainloop(); - -private: - - // constructor - vrpn_Atmel(char* name, vrpn_Connection *c, int fd); - -private: - - void init_channel_mode(int * channel_mode); - - // do the serial communication in mainloop - bool mainloop_serial_io(); - - // things which have to be done when a new connection has been established - bool handle_new_connection(); - - // enable connection reliability checking by additional select - bool Check_Serial_Alive(); - -private: - - // indicator for current status of server - // one of the predefined value: VRPN_ATMEL_STATUS_* - int _status; - - // time of report - struct timeval timestamp; - - int serial_fd; - - // indicator for io-mode of the channels - // one of the predefined values: VRPN_ATMEL_MODE_* - std::vector<int> _channel_mode; - - // helper for Serial_Alive: do the stuff not in every mainloop -> _time_alive - struct timeval _time_alive; -}; - -#endif // #ifndef VRPN_ATMEL diff --git a/src/vrpn/vrpn_Auxiliary_Logger.C b/src/vrpn/vrpn_Auxiliary_Logger.C deleted file mode 100644 index 46ef01a64a264b73932532331c855a93a171587b..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Auxiliary_Logger.C +++ /dev/null @@ -1,513 +0,0 @@ -#include <stddef.h> // for size_t -#include <stdio.h> // for fprintf, stderr - -#include "vrpn_Auxiliary_Logger.h" - -vrpn_Auxiliary_Logger::vrpn_Auxiliary_Logger(const char *name, - vrpn_Connection *c) - : vrpn_BaseClass(name, c) -{ - vrpn_BaseClass::init(); -} - -int vrpn_Auxiliary_Logger::register_types(void) -{ - request_logging_m_id = d_connection->register_message_type( - "vrpn_Auxiliary_Logger Logging_request"); - report_logging_m_id = d_connection->register_message_type( - "vrpn_Auxiliary_Logger Logging_response"); - request_logging_status_m_id = d_connection->register_message_type( - "vrpn_Auxiliary_Logger Logging_status_request"); - - if ((request_logging_m_id == -1) || (report_logging_m_id == -1) || - (request_logging_status_m_id == -1)) { - d_connection = NULL; - return -1; - } - else { - return 0; - } -} - -// Send a message of the specified type. -// Note that the pointers may be NULL, so we need to check for this. -bool vrpn_Auxiliary_Logger::pack_log_message_of_type( - vrpn_int32 type, const char *local_in_logfile_name, - const char *local_out_logfile_name, const char *remote_in_logfile_name, - const char *remote_out_logfile_name) -{ - if (!d_connection) { - return false; - } - - // Figure out the lengths, handling NULL pointers. - vrpn_int32 lil = 0; - if (local_in_logfile_name) { - lil = static_cast<vrpn_int32>(strlen(local_in_logfile_name)); - } - vrpn_int32 lol = 0; - if (local_out_logfile_name) { - lol = static_cast<vrpn_int32>(strlen(local_out_logfile_name)); - } - vrpn_int32 ril = 0; - if (remote_in_logfile_name) { - ril = static_cast<vrpn_int32>(strlen(remote_in_logfile_name)); - } - vrpn_int32 rol = 0; - if (remote_out_logfile_name) { - rol = static_cast<vrpn_int32>(strlen(remote_out_logfile_name)); - } - - struct timeval now; - vrpn_int32 bufsize = - static_cast<vrpn_int32>(4 * sizeof(lil) + lil + lol + ril + rol); - char *buf = new char[bufsize]; - if (buf == NULL) { - fprintf(stderr, "vrpn_Auxiliary_Logger::pack_log_message_of_type(): " - "Out of memory.\n"); - return false; - } - - // Pack a message with the requested type from our sender ID that has - // first the four lengths of the strings and then the four strings. - // Do not include the NULL termination of the strings in the buffer. - - vrpn_gettimeofday(&now, NULL); - char *bpp = buf; - char **bp = &bpp; - vrpn_int32 bufleft = bufsize; - vrpn_buffer(bp, &bufleft, lil); - vrpn_buffer(bp, &bufleft, lol); - vrpn_buffer(bp, &bufleft, ril); - vrpn_buffer(bp, &bufleft, rol); - if (lil) { - vrpn_buffer(bp, &bufleft, local_in_logfile_name, lil); - } - if (lol) { - vrpn_buffer(bp, &bufleft, local_out_logfile_name, lol); - } - if (ril) { - vrpn_buffer(bp, &bufleft, remote_in_logfile_name, ril); - } - if (rol) { - vrpn_buffer(bp, &bufleft, remote_out_logfile_name, rol); - } - int ret = - d_connection->pack_message(bufsize - bufleft, now, type, d_sender_id, - buf, vrpn_CONNECTION_RELIABLE); - delete[] buf; - return (ret == 0); -} - -// Unpack the strings from the buffer. Return non-NULL pointers to -// strings (an empty string when a file name is empty). -bool vrpn_Auxiliary_Logger::unpack_log_message_from_buffer( - const char *buf, vrpn_int32 buflen, char **local_in_logfile_name, - char **local_out_logfile_name, char **remote_in_logfile_name, - char **remote_out_logfile_name) -{ - const char *bufptr = buf; - - // Make sure that the buffer contains at least enough space for the four - // length - // values, then pull the lengths of the strings out of the buffer - vrpn_int32 localInNameLen, localOutNameLen, remoteInNameLen, - remoteOutNameLen; - if (static_cast<size_t>(buflen) < 4 * sizeof(localInNameLen)) { - fprintf(stderr, "vrpn_Auxiliary_Logger::unpack_log_message_from_buffer:" - " Buffer too small for lengths.\n"); - return false; - } - vrpn_unbuffer(&bufptr, &localInNameLen); - vrpn_unbuffer(&bufptr, &localOutNameLen); - vrpn_unbuffer(&bufptr, &remoteInNameLen); - vrpn_unbuffer(&bufptr, &remoteOutNameLen); - - // Make sure we have enough room in the buffer for the four sizes and also - // the four - // strings of the appropriate size. If so, allocate the space for the - // strings and then - // copy them out and NULL-terminate them. They are not NULL-terminated in - // the message - // buffer. - int size = 4 * sizeof(localInNameLen) + localInNameLen + localOutNameLen + - remoteInNameLen + remoteOutNameLen; - if (buflen != size) { - fprintf(stderr, "vrpn_Auxiliary_Logger::unpack_log_message_from_buffer:" - " Buffer size incorrect\n"); - return false; - } - (*local_in_logfile_name) = NULL; - (*local_out_logfile_name) = NULL; - (*remote_in_logfile_name) = NULL; - (*remote_out_logfile_name) = NULL; - if (localInNameLen > 0) { - if (((*local_in_logfile_name) = new char[localInNameLen + 1]) == NULL) { - fprintf(stderr, "vrpn_Auxiliary_Logger::unpack_log_message_from_" - "buffer: Out of memory\n"); - return false; - } - memcpy(*local_in_logfile_name, bufptr, localInNameLen); - (*local_in_logfile_name)[localInNameLen] = '\0'; - bufptr += localInNameLen; - } - else { - if (((*local_in_logfile_name) = new char[2]) == NULL) { - fprintf(stderr, "vrpn_Auxiliary_Logger::unpack_log_message_from_" - "buffer: Out of memory\n"); - return false; - } - (*local_in_logfile_name)[0] = '\0'; - } - if (localOutNameLen > 0) { - if (((*local_out_logfile_name) = new char[localOutNameLen + 1]) == - NULL) { - fprintf(stderr, "vrpn_Auxiliary_Logger::unpack_log_message_from_" - "buffer: Out of memory\n"); - return false; - } - memcpy(*local_out_logfile_name, bufptr, localOutNameLen); - (*local_out_logfile_name)[localOutNameLen] = '\0'; - bufptr += localOutNameLen; - } - else { - if (((*local_out_logfile_name) = new char[2]) == NULL) { - fprintf(stderr, "vrpn_Auxiliary_Logger::unpack_log_message_from_" - "buffer: Out of memory\n"); - return false; - } - (*local_out_logfile_name)[0] = '\0'; - } - if (remoteInNameLen > 0) { - if (((*remote_in_logfile_name) = new char[remoteInNameLen + 1]) == - NULL) { - fprintf(stderr, "vrpn_Auxiliary_Logger::unpack_log_message_from_" - "buffer: Out of memory\n"); - return false; - } - memcpy(*remote_in_logfile_name, bufptr, remoteInNameLen); - (*remote_in_logfile_name)[remoteInNameLen] = '\0'; - bufptr += remoteInNameLen; - } - else { - if (((*remote_in_logfile_name) = new char[2]) == NULL) { - fprintf(stderr, "vrpn_Auxiliary_Logger::unpack_log_message_from_" - "buffer: Out of memory\n"); - return false; - } - (*remote_in_logfile_name)[0] = '\0'; - } - if (remoteOutNameLen > 0) { - if (((*remote_out_logfile_name) = new char[remoteOutNameLen + 1]) == - NULL) { - fprintf(stderr, "vrpn_Auxiliary_Logger::unpack_log_message_from_" - "buffer: Out of memory\n"); - return false; - } - memcpy(*remote_out_logfile_name, bufptr, remoteOutNameLen); - (*remote_out_logfile_name)[remoteOutNameLen] = '\0'; - bufptr += remoteOutNameLen; - } - else { - if (((*remote_out_logfile_name) = new char[2]) == NULL) { - fprintf(stderr, "vrpn_Auxiliary_Logger::unpack_log_message_from_" - "buffer: Out of memory\n"); - return false; - } - (*remote_out_logfile_name)[0] = '\0'; - } - - return true; -} - -vrpn_Auxiliary_Logger_Server::vrpn_Auxiliary_Logger_Server(const char *name, - vrpn_Connection *c) - : vrpn_Auxiliary_Logger(name, c) -{ - // Register a handler for the dropped last connection message. - dropped_last_connection_m_id = - d_connection->register_message_type(vrpn_dropped_last_connection); - if (dropped_last_connection_m_id == -1) { - fprintf(stderr, "vrpn_Auxiliary_Logger_Server::vrpn_Auxiliary_Logger_" - "Server: can't register dropped last connection " - "type\n"); - d_connection = NULL; - return; - } - if (register_autodeleted_handler(dropped_last_connection_m_id, - static_handle_dropped_last_connection, - this, vrpn_ANY_SENDER)) { - fprintf(stderr, "vrpn_Auxiliary_Logger_Server::vrpn_Auxiliary_Logger_" - "Server: can't register dropped last connection " - "handler\n"); - d_connection = NULL; - } - - // Register a handler for the request logging message. - if (register_autodeleted_handler(request_logging_m_id, - static_handle_request_logging, this, - d_sender_id)) { - fprintf(stderr, "vrpn_Auxiliary_Logger_Server::vrpn_Auxiliary_Logger_" - "Server: can't register logging request handler\n"); - d_connection = NULL; - } - - // Register a handler for the request logging-status message - if (register_autodeleted_handler(request_logging_status_m_id, - static_handle_request_logging_status, this, - d_sender_id)) { - fprintf(stderr, "vrpn_Auxiliary_Logger_Server::vrpn_Auxiliary_Logger_" - "Server: can't register logging-status request " - "handler\n"); - d_connection = NULL; - } -} - -// This handles the last dropped connection message by turning off all -// logging. -void vrpn_Auxiliary_Logger_Server::handle_dropped_last_connection(void) -{ - handle_request_logging("", "", "", ""); -} - -/* static */ -// This method just passes the call on to the virtual function. -int vrpn_Auxiliary_Logger_Server::static_handle_dropped_last_connection( - void *userdata, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Auxiliary_Logger_Server *me = - static_cast<vrpn_Auxiliary_Logger_Server *>(userdata); - me->handle_dropped_last_connection(); - return 0; -} - -/* static */ -int vrpn_Auxiliary_Logger_Server::static_handle_request_logging_status( - void *userdata, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Auxiliary_Logger_Server *me = - static_cast<vrpn_Auxiliary_Logger_Server *>(userdata); - me->handle_request_logging_status(); - return 0; -} - -/* static */ -// This method just parses the raw data in the Handlerparam to produce strings -// and then -// passes the call on to the virtual function. -int vrpn_Auxiliary_Logger_Server::static_handle_request_logging( - void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Auxiliary_Logger_Server *me = - static_cast<vrpn_Auxiliary_Logger_Server *>(userdata); - char *localInName = NULL, *localOutName = NULL, *remoteInName = NULL, - *remoteOutName = NULL; - - // Attempt to unpack the names from the buffer - if (!me->unpack_log_message_from_buffer(p.buffer, p.payload_len, - &localInName, &localOutName, - &remoteInName, &remoteOutName)) { - fprintf(stderr, "vrpn_Auxiliary_Logger_Server::static_handle_request_" - "logging: Could not unpack buffer\n"); - return -1; - } - - // Call the virtual function with the strings, then clean up memory and - // return. - me->handle_request_logging(localInName, localOutName, remoteInName, - remoteOutName); - if (localInName) { - delete[] localInName; - }; - if (localOutName) { - delete[] localOutName; - }; - if (remoteInName) { - delete[] remoteInName; - }; - if (remoteOutName) { - delete[] remoteOutName; - }; - return 0; -} - -vrpn_Auxiliary_Logger_Server_Generic::vrpn_Auxiliary_Logger_Server_Generic( - const char *logger_name, const char *connection_to_log, vrpn_Connection *c) - : vrpn_Auxiliary_Logger_Server(logger_name, c) - , d_connection_name(NULL) - , d_logging_connection(NULL) -{ - // Copy the name of the connection to log and its NULL terminator. - if ((connection_to_log == NULL) || (strlen(connection_to_log) == 0)) { - fprintf(stderr, "vrpn_Auxiliary_Logger_Server_Generic::vrpn_Auxiliary_" - "Logger_Server_Generic: Empty logging name passed " - "in\n"); - d_connection = NULL; - return; - } - d_connection_name = new char[strlen(connection_to_log) + 1]; - if (d_connection_name == NULL) { - fprintf(stderr, "vrpn_Auxiliary_Logger_Server_Generic::vrpn_Auxiliary_" - "Logger_Server_Generic: Out of memory\n"); - d_connection = NULL; - return; - } - memcpy(d_connection_name, connection_to_log, strlen(connection_to_log) + 1); -} - -vrpn_Auxiliary_Logger_Server_Generic::~vrpn_Auxiliary_Logger_Server_Generic() -{ - if (d_logging_connection) { - delete d_logging_connection; - d_logging_connection = NULL; - } - - if (d_connection_name) { - delete[] d_connection_name; - d_connection_name = NULL; - } -} - -// Close an existing logging connection, then (if any of the file -// names are non-empty) open a new logging connection to the -// connection we are to log (even if this process already has a -// connection to it) and then send back the report that we've started -// logging if we are able. If we cannot open it, then fill in all -// blank names for the return report. -void vrpn_Auxiliary_Logger_Server_Generic::handle_request_logging( - const char *local_in_logfile_name, const char *local_out_logfile_name, - const char *remote_in_logfile_name, const char *remote_out_logfile_name) -{ - // If we have a logging connection open, reduce its reference - // count (which may delete it but will leave it going if some - // other object has a pointer to it). - if (d_logging_connection) { - d_logging_connection->removeReference(); - d_logging_connection = NULL; - } - - // If at least one of the names passed in is not empty, create - // a new logging connection. If this fails, report no logging. - - // Find the relevant part of the name (skip past last '@' - // if there is one); also find the port number. - const char *cname = d_connection_name; - const char *where_at; // Part of name past last '@' - if ((where_at = strrchr(cname, '@')) != NULL) { - cname = where_at + 1; // Chop off the front of the name - } - - // Pass "true" to force_connection so that it will open a new - // connection even if we already have one with that name. - d_logging_connection = vrpn_get_connection_by_name( - where_at, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name, NULL, true); - if (!d_logging_connection || !d_logging_connection->doing_okay()) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("handle_request_logging: Could not create connection " - "(files already exist?)", - now, vrpn_TEXT_ERROR); - send_report_logging(NULL, NULL, NULL, NULL); - if (d_logging_connection) { - delete d_logging_connection; - d_logging_connection = NULL; - } - return; - } - - // Report the logging that we're doing. - send_report_logging(local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name); -} - -void vrpn_Auxiliary_Logger_Server_Generic::handle_request_logging_status() -{ - char *local_in; - char *local_out; - char *remote_in; - char *remote_out; - d_logging_connection->get_log_names(&local_in, &local_out, &remote_in, - &remote_out); - send_report_logging(local_in, local_out, remote_in, remote_out); - if (local_in) delete[] local_in; - if (local_out) delete[] local_out; - if (remote_in) delete[] remote_in; - if (remote_out) delete[] remote_out; -} - -void vrpn_Auxiliary_Logger_Remote::mainloop(void) -{ - if (d_connection) { - d_connection->mainloop(); - client_mainloop(); - } -} - -vrpn_Auxiliary_Logger_Remote::vrpn_Auxiliary_Logger_Remote(const char *name, - vrpn_Connection *c) - : vrpn_Auxiliary_Logger(name, c) -{ - // Register a handler for the report callback from this device, - // if we got a connection. - if (d_connection != NULL) { - if (register_autodeleted_handler(report_logging_m_id, - handle_report_message, this, - d_sender_id)) { - fprintf(stderr, - "vrpn_Auxiliary_Logger_Remote: can't register handler\n"); - d_connection = NULL; - } - } - else { - fprintf(stderr, - "vrpn_Auxiliary_Logger_Remote: Can't get connection!\n"); - } -} - -/* Static */ -int VRPN_CALLBACK -vrpn_Auxiliary_Logger_Remote::handle_report_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Auxiliary_Logger_Remote *me = - static_cast<vrpn_Auxiliary_Logger_Remote *>(userdata); - char *localInName = NULL, *localOutName = NULL, *remoteInName = NULL, - *remoteOutName = NULL; - - // Attempt to unpack the names from the buffer - if (!me->unpack_log_message_from_buffer(p.buffer, p.payload_len, - &localInName, &localOutName, - &remoteInName, &remoteOutName)) { - fprintf(stderr, "vrpn_Auxiliary_Logger_Remote::handle_report_message: " - "Could not unpack buffer\n"); - return -1; - } - - // Fill in the data type for the callback handlers. - vrpn_AUXLOGGERCB cs; - cs.msg_time = p.msg_time; - cs.local_in_logfile_name = localInName; - cs.local_out_logfile_name = localOutName; - cs.remote_in_logfile_name = remoteInName; - cs.remote_out_logfile_name = remoteOutName; - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->d_callback_list.call_handlers(cs); - - // Clean up memory and return. - if (localInName) { - delete[] localInName; - }; - if (localOutName) { - delete[] localOutName; - }; - if (remoteInName) { - delete[] remoteInName; - }; - if (remoteOutName) { - delete[] remoteOutName; - }; - return 0; -} diff --git a/src/vrpn/vrpn_Auxiliary_Logger.h b/src/vrpn/vrpn_Auxiliary_Logger.h deleted file mode 100644 index e394a598c7ab26ac3c65143b3bc5002142eeb190..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Auxiliary_Logger.h +++ /dev/null @@ -1,253 +0,0 @@ -// This is a base class interface that has been designed for use by -// scientific data-collection applications that make use of VRPN to -// connect to microscope imagers and tracking system for nanoscale -// science research at UNC. - -// The idea of this interface is to enable a client GUI to start and -// stop logging of full-rate data on the server while receiving only -// a subset of the data during the experiment for preview; this keeps -// from overloading the network bandwidth with data and also keeps -// the client-side log files from filling up. When new log file(s) -// are requested, the old log files are closed. - -// Note that a particular implementation of the auxiliary logger server -// may need to know about a second connection (not the one it talks -// to its client over) in case that is where it is doing its logging. - -#ifndef VRPN_AUXILIARY_LOGGER_H -#define VRPN_AUXILIARY_LOGGER_H -#include <string.h> // for NULL - -#include "vrpn_BaseClass.h" // for vrpn_Callback_List, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Connection.h" -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_int32 - -class VRPN_API vrpn_Auxiliary_Logger : public vrpn_BaseClass { -public: - vrpn_Auxiliary_Logger(const char *name, vrpn_Connection *c); - -protected: - // Handle registration of all message types we're going to deal with. - virtual int register_types(void); - vrpn_int32 request_logging_m_id; // ID of remote->server request message - vrpn_int32 report_logging_m_id; // ID of server->client response message - vrpn_int32 request_logging_status_m_id; // ID of remote->server - // status-request message - - // Pack a log description into the message whose type is passed - // as the parameter (this is used to pack both the request and - // report messages. - bool pack_log_message_of_type(vrpn_int32 type, - const char *local_in_logfile_name, - const char *local_out_logfile_name, - const char *remote_in_logfile_name, - const char *remote_out_logfile_name); - - // Unpack a log description from a message into the four strings that - // were passed in (this is used to unpack both the request and the - // report messages). - // NOTE: This routine will allocate space for the strings. The caller - // must delete [] this space when they are done with it to avoid - // memory leaks. - bool unpack_log_message_from_buffer(const char *buf, vrpn_int32 buflen, - char **local_in_logfile_name, - char **local_out_logfile_name, - char **remote_in_logfile_name, - char **remote_out_logfile_name); -}; - -// Virtual base server class for an auxiliiary logger. An implementation must -// implement the specified message-handling functions and must call the base- -// class constructor to set up the calling of them. - -class VRPN_API vrpn_Auxiliary_Logger_Server : public vrpn_Auxiliary_Logger { -public: - vrpn_Auxiliary_Logger_Server(const char *name, vrpn_Connection *c); - - // Required for servers. - virtual void mainloop(void) { server_mainloop(); } - -protected: - // Handle a logging-request message. The request contains four file - // names, two for local (to the Auxiliary server itself) and two for - // remote (the far side of its connection to the server). It must - // also respond to the client with a message saying what logging has - // been set up (using the send_logging_response function). Logging is - // turned off on a particular file by sending an empty-string name (""). - // The in/out local/remote are with respect to the connection that the - // logging is to occur on, which may or may not be the same one that the - // client has connected to the object on using the constructor above. - // Make sure to send a response saying what you did. - virtual void - handle_request_logging(const char *local_in_logfile_name, - const char *local_out_logfile_name, - const char *remote_in_logfile_name, - const char *remote_out_logfile_name) = 0; - - // Send a response to the client telling it what logging has been - // established. - bool send_report_logging(const char *local_in_logfile_name, - const char *local_out_logfile_name, - const char *remote_in_logfile_name, - const char *remote_out_logfile_name) - { - if (!d_connection) { - return false; - } - return pack_log_message_of_type( - report_logging_m_id, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name); - } - - // Handle dropped last connection on server object by turning off - // logging. The static method basically looks up the this - // pointer and calls the virtual method. A derived class should - // re-implement the non-static method below if it doesn't want to drop all - // logging or if it wants to do something else in addition. The static - // method basically just calls the non-static method. - virtual void handle_dropped_last_connection(void); - vrpn_int32 dropped_last_connection_m_id; // ID of message that all - // connections dropped - static int VRPN_CALLBACK - static_handle_dropped_last_connection(void *userdata, vrpn_HANDLERPARAM p); - - // Static portion of handling (unpacking) the request_logging message. It - // then calls the non-static virtual method above. - static int VRPN_CALLBACK - static_handle_request_logging(void *userdata, vrpn_HANDLERPARAM p); - - // Handle request for logging status. - virtual void handle_request_logging_status() = 0; - static int VRPN_CALLBACK - static_handle_request_logging_status(void *userdata, vrpn_HANDLERPARAM p); -}; - -// Generic server that will start auxiliary logs on the connection whose name -// is passed in (which can be the same as the name of the connection it is -// created on, but does not have to be). The "local" in and out are with -// respect to the new connection that is made; the "remote" in and out are with -// respect to the named connection. No logging is started in the constructor. - -class VRPN_API vrpn_Auxiliary_Logger_Server_Generic - : public vrpn_Auxiliary_Logger_Server { -public: - // Does not start logging, just records what to log when it is started. - vrpn_Auxiliary_Logger_Server_Generic(const char *logger_name, - const char *connection_to_log, - vrpn_Connection *c = NULL); - ~vrpn_Auxiliary_Logger_Server_Generic(); - - // Close an existing logging connection, then (if any of the file - // names are non-empty) open a new logging connection to the - // connection we are to log (even if this process already has a - // connection to it) and then send back the report that we've started - // logging if we are able. If we cannot open it, then fill in all - // blank names for the return report. - virtual void handle_request_logging(const char *local_in_logfile_name, - const char *local_out_logfile_name, - const char *remote_in_logfile_name, - const char *remote_out_logfile_name); - - virtual void handle_request_logging_status(); - - // If we have an active logging connection, mainloop it and save all of its - // pending messages in addition to handling the base-class functions. - // Then call the parent class mainloop(). - virtual void mainloop(void) - { - if (d_logging_connection) { - d_logging_connection->mainloop(); - d_logging_connection->save_log_so_far(); - } - vrpn_Auxiliary_Logger_Server::mainloop(); - } - -protected: - char *d_connection_name; // Name to connect to when logging. - vrpn_Connection *d_logging_connection; // Connection to use for logging. -}; - -//----------------------------------------------------------- -//************** Client code uses the following ************* - -// Type of a client routine to request new logging and to handle a -// report of changed logging. This callback is called when the -// logging server reports a new set of files, which should happen -// after each request is made. - -typedef struct _vrpn_AUXLOGGERCB { - struct timeval msg_time; // Timestamp of new logging - const char * - local_in_logfile_name; // Name of the incoming local log ("" if none). - const char *local_out_logfile_name; - const char *remote_in_logfile_name; - const char *remote_out_logfile_name; -} vrpn_AUXLOGGERCB; - -typedef void(VRPN_CALLBACK *vrpn_AUXLOGGERREPORTHANDLER)( - void *userdata, const vrpn_AUXLOGGERCB info); - -class VRPN_API vrpn_Auxiliary_Logger_Remote : public vrpn_Auxiliary_Logger { -public: - vrpn_Auxiliary_Logger_Remote(const char *name, vrpn_Connection *c = NULL); - - // Send a request to the server asking it to log the following. Each of - // these is with respect to the connection that the auxiliary logger server - // is handling, which may or may not be the one that it is connected to to - // receive this message; it refers to the other side of the new connection - // that the server establishes to do its logging. Passing a NULL or empty - // string ("") to any of the entries disables that log. - // WARNING: If the server is set to connect to its own connection and log - // it, then you must explicitly request a set of empty log files to stop - // it logging the last time because otherwise it never gets the message - // that it dropped the last connection and will continue logging after the - // object is destroyed. - bool send_logging_request(const char *local_in_logfile_name, - const char *local_out_logfile_name = "", - const char *remote_in_logfile_name = "", - const char *remote_out_logfile_name = "") - { - if (!d_connection) { - return false; - } - return pack_log_message_of_type( - request_logging_m_id, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name); - } - - bool send_logging_status_request() - { - if (!d_connection) { - return false; - } - return pack_log_message_of_type(request_logging_status_m_id, NULL, NULL, - NULL, NULL); - } - - // Register/unregister a callback handler for the logging response. - virtual int register_report_handler(void *userdata, - vrpn_AUXLOGGERREPORTHANDLER handler) - { - return d_callback_list.register_handler(userdata, handler); - }; - virtual int unregister_report_handler(void *userdata, - vrpn_AUXLOGGERREPORTHANDLER handler) - { - return d_callback_list.unregister_handler(userdata, handler); - } - - // This routine calls the mainloop of the connection it's on - virtual void mainloop(void); - -protected: - // Static handler for the logging report message. - // Use the base-class unpack method to convert the data into strings. - vrpn_Callback_List<vrpn_AUXLOGGERCB> d_callback_list; - - static int VRPN_CALLBACK - handle_report_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -#endif diff --git a/src/vrpn/vrpn_BaseClass.C b/src/vrpn/vrpn_BaseClass.C deleted file mode 100644 index cc031e6c3ac2a46fb586068b4bfd21740897e960..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_BaseClass.C +++ /dev/null @@ -1,789 +0,0 @@ -// vrpn_BaseClass.C - -#include <stddef.h> // for size_t -#include <stdio.h> // for fprintf, NULL, stderr, etc -#include <string.h> // for strcmp, strlen - -#include "vrpn_BaseClass.h" -#include "vrpn_Shared.h" // for timeval, vrpn_buffer, etc - -//#define VERBOSE - -/** Definition of the system TextPrinter object that prints messages for - all created objects. -*/ -vrpn_TextPrinter vrpn_System_TextPrinter; - -vrpn_TextPrinter::vrpn_TextPrinter() - : d_first_watched_object(NULL) - , d_ostream(stdout) - , d_severity_to_print(vrpn_TEXT_WARNING) - , d_level_to_print(0) -{ -} - -/** Deletes any callbacks that are still registered. */ -vrpn_TextPrinter::~vrpn_TextPrinter() -{ - d_semaphore.p(); -/* XXX No longer removes these. We get into trouble with the - system-defined vrpn_System_TextPrinter destructor because it - may run after the vrpn_ConnectionManager destructor has run, - which (if we have some undeleted objects) will leave objects - that don't have a NULL connection pointer, but whose pointers - point to already-deleted connections. This causes a crash. */ -#if 0 - - vrpn_TextPrinter_Watch_Entry *victim, *next; - vrpn_BaseClass *obj; - - victim = d_first_watched_object; - while (victim != NULL) { - next = victim->next; - obj = victim->obj; - - // Guard against the case where the object has set its connection pointer - // to NULL, which is how some objects notify themselves that they are - // broken. - if (obj->connectionPtr()) { - obj->connectionPtr()->unregister_handler(obj->d_text_message_id, text_message_handler, victim, obj->d_sender_id); - } - delete victim; - victim = next; - } -#endif // XXX - d_semaphore.v(); -} - -/** Adds an object to the list of watched objects. Returns 0 on success and - -1 on failure. Registering a watched object is idempotent: doing so again - for an already-registered object has no effect, nor is it an error. Objects - are considered to be the same if they share the same connection and they - have - the same service name. What we're going for here is to get only one - print-out of any - message. -*/ -int vrpn_TextPrinter::add_object(vrpn_BaseClass *o) -{ - d_semaphore.p(); - vrpn_TextPrinter_Watch_Entry *victim; - - // Make sure we have an actual object. - if (o == NULL) { - fprintf(stderr, - "vrpn_TextPrinter::add_object(): NULL pointer passed\n"); - d_semaphore.v(); - return -1; - } - -#ifdef VERBOSE - printf("vrpn_TextPrinter: adding object %s\n", o->d_servicename); -#endif - - // If the object is already in the list, we are done. It is considered the - // same - // object if it has the same connection and the same service name. - victim = d_first_watched_object; - while (victim != NULL) { - if ((o->d_connection == victim->obj->d_connection) && - (strcmp(o->d_servicename, victim->obj->d_servicename) == 0)) { - d_semaphore.v(); - return 0; - } - victim = victim->next; - } - - // Add the object to the beginning of the list. - if ((victim = new vrpn_TextPrinter_Watch_Entry) == NULL) { - fprintf(stderr, "vrpn_TextPrinter::add_object(): out of memory\n"); - d_semaphore.v(); - return -1; - } - victim->obj = o; - victim->me = this; - victim->next = d_first_watched_object; - d_first_watched_object = victim; - - // Register a callback for the object - if (o->d_connection->register_handler(o->d_text_message_id, - text_message_handler, victim, - o->d_sender_id) != 0) { - fprintf(stderr, - "vrpn_TextPrinter::add_object(): Can't register callback\n"); - d_first_watched_object = victim->next; - delete victim; - d_semaphore.v(); - return -1; - } - - d_semaphore.v(); - return 0; -} - -/** Removes an object from the list of watched objects. Returns 0 on success - and - -1 on failure. Unregistering a non-watched object has no effect, nor is it - an error. Objects - are considered to be the same if they share the same connection and they - have - the same service name. -*/ -void vrpn_TextPrinter::remove_object(vrpn_BaseClass *o) -{ - d_semaphore.p(); - vrpn_TextPrinter_Watch_Entry *victim, **snitch; - -#ifdef VERBOSE - printf("vrpn_TextPrinter: removing object %s\n", o->d_servicename); -#endif - - // Make sure we have an actual object. - if (o == NULL) { - fprintf(stderr, - "vrpn_TextPrinter::remove_object(): NULL pointer passed\n"); - d_semaphore.v(); - return; - } - - // Find the entry in the list (if it is there). - // Starts this pointing at the first watched object, so it will - // update that object if it is the one who pointed us at the one - // to be deleted. - snitch = &d_first_watched_object; - victim = *snitch; - while ((victim != NULL) && - ((o->d_connection != victim->obj->d_connection) || - (strcmp(o->d_servicename, victim->obj->d_servicename) != 0))) { - - snitch = &((*snitch)->next); - victim = victim->next; - } - - // If the object is on the list, unregister its callback and delete it. - if (victim != NULL) { - // Unregister the callback for the object, unless its d_connetion - // pointer - // is NULL (which is a convention used by devices to indicate that they - // are broken, so we need to guard against it here). - if (o->d_connection) { - if (o->d_connection->unregister_handler( - o->d_text_message_id, text_message_handler, victim, - o->d_sender_id) != 0) { - fprintf(stderr, "vrpn_TextPrinter::remove_object(): Can't " - "unregister callback\n"); - } - } - - // Remove the entry from the list - *snitch = victim->next; - delete victim; - - // We're done. - d_semaphore.v(); - return; - } - - // Object not in the list, so we're done. - d_semaphore.v(); - return; -} - -/** Prints out a text message that comes in, identifying the severity, level and - sender of the - message. The message is not printed if the severity or level do not pass the - threshold - for severity or level. -*/ - -int vrpn_TextPrinter::text_message_handler(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_TextPrinter_Watch_Entry *entry = - (vrpn_TextPrinter_Watch_Entry *)userdata; - vrpn_TextPrinter *me = entry->me; - vrpn_BaseClass *obj = entry->obj; - vrpn_TEXT_SEVERITY severity; - vrpn_uint32 level; - char message[vrpn_MAX_TEXT_LEN]; - - me->d_semaphore.p(); - -#ifdef VERBOSE - printf("vrpn_TextPrinter: text handler called\n"); -#endif - - // Make sure we have a valid ostream. - if (me->d_ostream == NULL) { - return 0; - }; - - // Decode the message - if (vrpn_BaseClassUnique::decode_text_message_from_buffer( - message, &severity, &level, p.buffer) != 0) { - fprintf( - stderr, - "vrpn_TextPrinter::text_message_handler(): Can't decode message\n"); - me->d_semaphore.v(); - return -1; - } - - // If the severity and level criteria pass, then print the annotated - // message. - // The printing is "VRPN", then one of Message/Warning/Error, then the level - // of the - // text, "from" the name of the service sending the message, and then the - // message. - if ((severity > me->d_severity_to_print) || - ((severity == me->d_severity_to_print) && - (level >= me->d_level_to_print))) { - - fprintf(me->d_ostream, "VRPN "); - - switch (severity) { - case vrpn_TEXT_NORMAL: - fprintf(me->d_ostream, "Message\n"); - break; - case vrpn_TEXT_WARNING: - fprintf(me->d_ostream, "Warning\n"); - break; - case vrpn_TEXT_ERROR: - fprintf(me->d_ostream, "Error\n"); - break; - default: - fprintf(me->d_ostream, "UNKNOWN SEVERITY\n"); - break; - } - - fprintf(me->d_ostream, " (%d) from %s: %s\n", level, - obj->d_connection->sender_name(p.sender), message); - } - - me->d_semaphore.v(); - return 0; -} - -/// Change the level of printing for the object (sets the minimum level to -/// print). Default is Warnings and Errors of all levels. -void vrpn_TextPrinter::set_min_level_to_print(vrpn_TEXT_SEVERITY severity, - vrpn_uint32 level) -{ - d_semaphore.p(); - d_severity_to_print = severity; - d_level_to_print = level; - d_semaphore.v(); -} - -/// Change the ostream that will be used to print messages. Setting a -/// NULL ostream results in no printing. -void vrpn_TextPrinter::set_ostream_to_use(FILE *o) -{ - d_semaphore.p(); - d_ostream = o; - d_semaphore.v(); -} - -/** Assigns the connection passed in to the object, or else tries to - create a new connection based on the object name. If this succeeds, - it calls the sender and type registration routines for the object. - Sets the servicename field to be the part of the name coming before - the "@" sign in the name. - - vrpn_BaseClassUnique is a virtual base class so it will only be called once, - while - vrpn_BaseClass may be called multiple times. - Setting d_connection and d_servicename, only needs to be done once - for each object (even if it inherits from multiple device classes). So - these - things should technically go into the vrpn_BaseClassUnique constructor, - except that - it is unable to accept parameters. If the vrpn_BaseClassUnique constructor - *did* take the service-name, connnection, and use-ref-count parameters - then every derived class (not just those at the top level) would have to - make - an explicit call to the vrpn_BaseClassUnique constructor. As it stands, - these - derived classes will instead use the 0-parameter version of the - vrpn_BaseClassUnique - constructor implicitly. - As a result, this constructor must make sure that it only executes the code - therein once. -*/ - -vrpn_BaseClass::vrpn_BaseClass(const char *name, vrpn_Connection *c) -{ - // Has a constructor on this BaseClassUnique been called before? - // Note that this might also be true if it was called once before but - // failed. - bool firstTimeCalled = (d_connection == NULL); - - if (firstTimeCalled) { - // Get the connection for this object established. If the user passed in - // a - // NULL connection object, then we determine the connection from the - // name of - // the object itself (for example, Tracker0@mumble.cs.unc.edu will make - // a - // connection to the machine mumble on the standard VRPN port). - // - // The vrpn_BaseClassUnique destructor handles telling the connection we - // are no longer referring to it. Since we only add the reference once - // here (when d_connection is NULL), it is okay for the unique - // destructor - // to remove the reference. - if (c) { // using existing connection. - d_connection = c; - d_connection->addReference(); - } - else { - // This will implicitly add the reference to the connection. - d_connection = vrpn_get_connection_by_name(name); - } - - // Get the part of the name for this device that does not include the - // connection. - // The vrpn_BaseClassUnique destructor handles the deletion of the - // space. - d_servicename = vrpn_copy_service_name(name); - } -} - -vrpn_BaseClass::~vrpn_BaseClass() -{ - // Remove us from the list of objects with messages to be printed - vrpn_System_TextPrinter.remove_object(this); -} - -/** This would normally be found in the constructor, but the constructor - cannot call virtual functions in the derived class (since it does not - yet exist). This function needs to be called at the beginning of the - constructor of each class that derives directly from vrpn_BaseClass -....(i.e. the top-level device classes such as Button, Analog, Tracker, etc) -*/ - -int vrpn_BaseClass::init(void) -{ - // In the case of multiple inheritance from this base class, the rest of - // the code in this function will be executed each time init is called. - - if (d_connection) { - // Register the sender and types - // that this device type uses. If one of these fails, set the - // connection - // for this object to NULL to indicate failure, and print an error - // message. - if (register_senders() || register_types()) { - fprintf(stderr, "vrpn_BaseClassUnique: Can't register IDs\n"); - d_connection = NULL; - return -1; - } - - // Register the text and ping/pong types, which will be available to all - // classes for use. - d_text_message_id = - d_connection->register_message_type("vrpn_Base text_message"); - if (d_text_message_id == -1) { - fprintf(stderr, - "vrpn_BaseClassUnique: Can't register Text type ID\n"); - d_connection = NULL; - return -1; - } - d_ping_message_id = - d_connection->register_message_type("vrpn_Base ping_message"); - if (d_ping_message_id == -1) { - fprintf(stderr, - "vrpn_BaseClassUnique: Can't register ping type ID\n"); - d_connection = NULL; - return -1; - } - d_pong_message_id = - d_connection->register_message_type("vrpn_Base pong_message"); - if (d_pong_message_id == -1) { - fprintf(stderr, - "vrpn_BaseClassUnique: Can't register pong type ID\n"); - d_connection = NULL; - return -1; - } - - // Sign us up with the standard print function. - vrpn_System_TextPrinter.add_object(this); - return 0; - } - else { - // Error if we don't have a connection. - return -1; - } -} - -/** Registers the senders (usually only one, that part of the name of the - device coming before the "@" sign). For example, the sender for - Tracker0@mumble.cs.unc.edu is Tracker0. Both the remote device and the - server device will register the same sender. If for some reason, there - is a different sender or more than one sender, this function should be - overridden by both the remote and server objects. - - This routine returns 0 on success and -1 on failure. -*/ - -int vrpn_BaseClass::register_senders() -{ - if (d_connection == NULL) { - return -1; - } - d_sender_id = d_connection->register_sender(d_servicename); - if (d_sender_id == -1) { - return -1; - } - else { - return 0; - } -} - -vrpn_BaseClassUnique::vrpn_BaseClassUnique() - : shutup(false) - , // don't suppress the "No response from server" messages - d_connection(NULL) - , d_servicename(NULL) - , d_num_autodeletions(0) - , d_first_mainloop(1) - , d_unanswered_ping(0) - , d_flatline(0) -{ - // Initialize variables - d_time_first_ping.tv_sec = d_time_first_ping.tv_usec = 0; -} - -/** Unregister all of the message handlers that were to be autodeleted. - Delete space allocated in the constructor. -*/ - -vrpn_BaseClassUnique::~vrpn_BaseClassUnique() -{ - int i; - - // Unregister all of the handlers that were to be autodeleted, - // if we have a connection. - if (d_connection != NULL) { - for (i = 0; i < d_num_autodeletions; i++) { - d_connection->unregister_handler( - d_handler_autodeletion_record[i].type, - d_handler_autodeletion_record[i].handler, - d_handler_autodeletion_record[i].userdata, - d_handler_autodeletion_record[i].sender); - } - d_num_autodeletions = 0; - } - - // notify the connection that this object is no longer using it. - // This was added in the vrpn_BaseClass constructor for exactly one of the - // objects that are sharing this unique destructor. - if (d_connection != NULL) { - d_connection->removeReference(); - } - - // Delete the space allocated in the constructor for the servicename - // Because this destructor may be called multiple times, set the pointer - // to NULL after deleting it, so it won't get deleted again. - if (d_servicename != NULL) { - delete[] d_servicename; - d_servicename = NULL; - } -} - -/** This function is a wrapper for the vrpn_Connection register_handler() - routine. It also keeps track of all of the handlers registered by an - object and unregisters them automatically when the object is destroyed. - This routine should be used, rather than the Connection one, to ensure - that they are all unregistered. If they are not, and a message comes - in after the object is destroyed, it will likely cause a Segmentation - Violation. - - The function returns 0 on success and -1 on failure. -*/ - -int vrpn_BaseClassUnique::register_autodeleted_handler( - vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void *userdata, - vrpn_int32 sender) -{ - // Make sure we have a Connection - if (d_connection == NULL) { - fprintf(stderr, "vrpn_BaseClassUnique::register_autodeleted_handler: " - "No vrpn_Connection.\n"); - return -1; - } - - // Make sure we have an empy entry to fill in. - if (d_num_autodeletions >= vrpn_MAX_BCADRS) { - fprintf(stderr, - "vrpn_BaseClassUnique::register_autodeleted_handler: " - "Too many handlers registered. Increase vrpn_MAX_BCADRS " - "and recompile VRPN. Please report to vrpn@cs.unc.edu.\n"); - return -1; - } - - // Fill in the values so we know what to delete, and bump the count - d_handler_autodeletion_record[d_num_autodeletions].handler = handler; - d_handler_autodeletion_record[d_num_autodeletions].sender = sender; - d_handler_autodeletion_record[d_num_autodeletions].type = type; - d_handler_autodeletion_record[d_num_autodeletions].userdata = userdata; - d_num_autodeletions++; - - // Call the register command. - return d_connection->register_handler(type, handler, userdata, sender); -} - -int vrpn_BaseClassUnique::encode_text_message_to_buffer( - char *buf, vrpn_TEXT_SEVERITY severity, vrpn_uint32 level, const char *msg) -{ - char *bufptr = buf; - int buflen = 2 * sizeof(vrpn_int32) + vrpn_MAX_TEXT_LEN; - vrpn_uint32 severity_as_uint = severity; - - // Send the type, level and string message - vrpn_buffer(&bufptr, &buflen, severity_as_uint); - vrpn_buffer(&bufptr, &buflen, level); - vrpn_buffer(&bufptr, &buflen, msg, -1); // -1 means "pack until NULL" - - return 0; -} - -int vrpn_BaseClassUnique::decode_text_message_from_buffer( - char *msg, vrpn_TEXT_SEVERITY *severity, vrpn_uint32 *level, - const char *buf) -{ - const char *bufptr = buf; - vrpn_uint32 severity_as_uint; - - // Read the type, level and message - vrpn_unbuffer(&bufptr, &severity_as_uint); - *severity = (vrpn_TEXT_SEVERITY)(severity_as_uint); - vrpn_unbuffer(&bufptr, level); - // Negative length means "unpack until NULL" - if (vrpn_unbuffer(&bufptr, msg, -(int)(vrpn_MAX_TEXT_LEN)) != 0) { - return -1; - } - - return 0; -} - -int vrpn_BaseClassUnique::send_text_message(const char *msg, - struct timeval timestamp, - vrpn_TEXT_SEVERITY type, - vrpn_uint32 level) -{ - char buffer[2 * sizeof(vrpn_int32) + vrpn_MAX_TEXT_LEN]; - size_t len = strlen(msg) + 1; // +1 is for the NULL terminator - - if (len > vrpn_MAX_TEXT_LEN) { - fprintf(stderr, "vrpn_BaseClassUnique::send_message: Attempt to encode " - "string that is too long\n"); - return -1; - } - - // send type, level and message - - encode_text_message_to_buffer(buffer, type, level, msg); - if (d_connection) { - d_connection->pack_message(sizeof(buffer), timestamp, d_text_message_id, - d_sender_id, buffer, - vrpn_CONNECTION_RELIABLE); - } - - return 0; -} - -/** This routine handles functions that all servers should perform in their - mainloop(). - It should be called each time through by each server's mainloop() function. - Performed functions include: - Sending pong ("server is alive") messages so that clients can know if they - have - connected to the server. -*/ - -void vrpn_BaseClassUnique::server_mainloop(void) -{ - // Set up to handle pong message. This should be sent whenever there is - // a ping request from a client. - - if (d_first_mainloop && (d_connection != NULL)) { - register_autodeleted_handler(d_ping_message_id, handle_ping, this, - d_sender_id); - d_first_mainloop = 0; - } -} - -/** This routine handles functions that all clients should perform in their - mainloop(). - It should be called each time through a client's mainloop() function. - Performed functions include: - Handling the Ping/Pong messages that tell the client if the server is alive: - Client initiates ping/pong cycle when client is created and when its - connection is dropped - This initiation is done the first time through client_mainloop() - It is done again in a handler for the "dropped_connection" system - message - During ping/pong cycle, client sends ping requests once/second and waits - for response - At the start of the cycle, d_unanswered_ping is set to 1 and - d_first_ping_time is set - Handler for pong message sets d_unanswered_ping to 0 when we get one - Prints warning messages every second after 3+ seconds with no pong - Prints error messages every second after 10+ seconds with no pong - (flatlined) - Server responds to ping message with pong message - Handler for ping set up the first time through server_mainloop() -*/ - -void vrpn_BaseClassUnique::client_mainloop(void) -{ - struct timeval now; - struct timeval diff; - - // The first time through, set up a callback handler for the pong message so - // that we - // know when we are getting them. Also set up a handler for the system - // dropped-connection - // message so that we can initiate a ping cycle when that happens. Also, - // we'll initiate - // the ping cycle here. - - if (d_first_mainloop && (d_connection != NULL)) { - - // Set up handlers for the pong message and for the system - // connection-drop message - register_autodeleted_handler(d_pong_message_id, handle_pong, this, - d_sender_id); - register_autodeleted_handler( - d_connection->register_message_type(vrpn_dropped_connection), - handle_connection_dropped, this); - - // Initiate a ping cycle; - initiate_ping_cycle(); - - // No longer first time through mainloop. - d_first_mainloop = 0; - } - - // If we are in the middle of a ping cycle... - // Check if we've heard, if it has been long enough since we gave a warning - // or error (>= 1 sec). - // If it has been three seconds or more since we sent our first ping, - // start giving warnings. If it has been ten seconds or more since we got - // one, - // switch to errors. New ping requests go out each second. - - if (d_unanswered_ping) { - - vrpn_gettimeofday(&now, NULL); - diff = vrpn_TimevalDiff(now, d_time_last_warned); - vrpn_TimevalNormalize(diff); - - if (diff.tv_sec >= 1) { - - // Send a new ping, since it has been a second since the last one - d_connection->pack_message(0, now, d_ping_message_id, d_sender_id, - NULL, vrpn_CONNECTION_RELIABLE); - - // Send another warning or error, and say if we're flatlined (10+ - // seconds) - d_time_last_warned = now; - if (!shutup) { - diff = vrpn_TimevalDiff(now, d_time_first_ping); - vrpn_TimevalNormalize(diff); - if (diff.tv_sec >= 10) { - send_text_message( - "No response from server for >= 10 seconds", now, - vrpn_TEXT_ERROR, diff.tv_sec); - d_flatline = 1; - } - else if (diff.tv_sec >= 3) { - send_text_message( - "No response from server for >= 3 seconds", now, - vrpn_TEXT_WARNING, diff.tv_sec); - } - } - } - } -} - -void vrpn_BaseClassUnique::initiate_ping_cycle(void) -{ - // Record when we sent the ping and say that we haven't gotten an answer - vrpn_gettimeofday(&d_time_first_ping, NULL); - d_connection->pack_message(0, d_time_first_ping, d_ping_message_id, - d_sender_id, NULL, vrpn_CONNECTION_RELIABLE); - d_unanswered_ping = 1; - - // We didn't send a warning about this one yet... - d_time_last_warned.tv_sec = d_time_last_warned.tv_usec = 0; -} - -/** Store the time at which the last pong occurred. Used by client_mainloop() - to keep - track of how long it has been since we got one. The callback for this - handler is registered - in client_mainloop() the first time through. -*/ - -int vrpn_BaseClassUnique::handle_pong(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_BaseClassUnique *me = (vrpn_BaseClassUnique *)userdata; - - me->d_unanswered_ping = 0; - - // If we were flatlined, report that things are okay again. - if (me->d_flatline) { - me->send_text_message("Server connection re-established!", p.msg_time, - vrpn_TEXT_ERROR); - me->d_flatline = 0; - } - - return 0; -} - -/** Respond with a "pong" (server is here) message, to the client "ping" - (is the server there?) message. This message handler is put in place for - servers - the first time through server_mainloop(). See client_mainloop() header for a - description - of the full algorithm. -*/ - -int vrpn_BaseClassUnique::handle_ping(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_BaseClassUnique *me = (vrpn_BaseClassUnique *)userdata; - struct timeval now; - - vrpn_gettimeofday(&now, NULL); - if (me->d_connection != NULL) { - me->d_connection->pack_message(0, now, me->d_pong_message_id, - me->d_sender_id, NULL, - vrpn_CONNECTION_RELIABLE); - } - - return 0; -} - -/** This handler is called by the client code when the system reports that the - connection has been dropped. It initiates a ping cycle, unless we are - already - within a ping cycle. -*/ - -int vrpn_BaseClassUnique::handle_connection_dropped(void *userdata, - vrpn_HANDLERPARAM) -{ - vrpn_BaseClassUnique *me = (vrpn_BaseClassUnique *)userdata; - struct timeval now; - - if (me->d_unanswered_ping != 0) { - return 0; - } - - vrpn_gettimeofday(&now, NULL); - if (me->d_connection != NULL) { - me->initiate_ping_cycle(); - } - - return 0; -} diff --git a/src/vrpn/vrpn_BaseClass.h b/src/vrpn/vrpn_BaseClass.h deleted file mode 100644 index d03b31bf8ebb30a14cf2ae84658ca4b9c7c70bad..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_BaseClass.h +++ /dev/null @@ -1,484 +0,0 @@ -/** @file vrpn_BaseClass.h - - All types of client/server/peer objects in VRPN should be derived from the - vrpn_BaseClass type described here. This includes Tracker, Button, Analog, - Clock, Dial, ForceDevice, Sound, and Text; it should include any user-defined - objects as well. - - This class both implements code that will be shared by most (if not all) - objects in the system and forms a skeleton for the definition of new objects - by requiring certain virtual member functions to be defined. - - See the VRPN web pages or another simple type (such as vrpn_Analog) for an - example of how to create a new VRPN object type using this as a base class. -*/ - -#ifndef VRPN_BASECLASS -#define VRPN_BASECLASS - -#include <stdio.h> // for NULL, fprintf, stderr, FILE - -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Connection.h" -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday -#include "vrpn_Types.h" // for vrpn_int32, vrpn_uint32 - -/* ------------------------------------------------------------------------------ -Answer to the question: - "Why is there both a UNIQUE and NON-UNIQUE base class?", - or - "Why can't everything from vrpn_BaseClass be moved into -vrpn_BaseClassUnique?" - - The first reason is that removing vrpn_BaseClass would require the - vrpn_BaseClassUnique constructor to take a name and connection object as - parameters, which would cause some problems due to the way virtual base - classes are implemented in C++. - - Any class that inherits from a virtual base (either directly or several - generations removed) must provide an explicit call to the constructor - of the virtual base. This is done because the virtual base constructor - is invoked from the very first class in the constructor chain. - - Take for example vrpn_Tng3, which inherits vrpn_Button and vrpn_Serial_Analog - (and thus vrpn_Analog). Creating a new instance of a vrpn_Tng3 object will - call the constructors in this order: - Tng3 - BaseClassUnique (because it is a virtual base) - Button - BaseClass (coming from Button) - Serial_Analog - Analog - BaseClass (coming from Analog) - - Right now, BaseClassUnique's constructor has no parameters. So the - Tng3 constructor does not have to explicitly invoke BaseClassUnique, although - implicitly it will call BaseClassUnique's 0-parameter constructor before - doing anything else. But if BaseClass is eliminated, then BaseClassUnique's - constructor must do the work of creating the connection and copying the - service name. So BaseClassUnique's constructor must now take a couple - parameters, which means that every class (including Tng3, Button, Analog, and -Serial_Analog) would have to explicitly name the constructor for BaseClassUnique -in the code and specify parameters for connection and service-name, even though -only one such call to the BaseClassUnique's constructor would ever actually -occur at runtime (that of Tng3 since it's located at the lowest level of the -family tree; the rest of the calls would be ignored). This would mean inserting -"vrpn_BaseClassUnique(name,connection)" into the initializer section of every -constructor in *every* class under the BaseClassUnique subtree. - - The second reason we have both a unique and non-unique base class is that - the "register_types" virtual function must be called several times for - multiply-inherited devices, with a different virtual target in each case. - Presently, register_types() is called from vrpn_BaseClass::init(). - init() may be called multiple times using a different vftable entry for - register_types() each time (e.g. for the Tng3 it will refer once to - vrpn_Analog::register_types() and once to vrpn_Button::register_types()). - Both init() and the pure-virtual declaration of register_types() are found - in BaseClass. Moving init() up into BaseClassUnique instead of BaseClass - means that register_types() would have to move up as well. And if - register_types() is declared in the virtual base class, BaseClassUnique, - it can only have one virtual target. - - So it might appear that vrpn_BaseClass has no data members and would - therefore be easy to eliminate. However it actually does have a data - member: the vftable entry for "register_types". And this data member - *must* be duplicated in the case of multiply-inherited device because a - single object will need several distinct virtual targets for - "register_types". - - [Jeff Feasel 19 May 2005] ------------------------------------------------------------------------------ -*/ - -const int vrpn_MAX_BCADRS = 100; -///< Internal value for number of BaseClass addresses - -/// Since the sending of text messages has been pulled into the base class (so -/// that every object can send error/warning/info messages this way), these -/// definitions have been pulled in here as well. -typedef enum { - vrpn_TEXT_NORMAL = 0, - vrpn_TEXT_WARNING = 1, - vrpn_TEXT_ERROR = 2 -} vrpn_TEXT_SEVERITY; -const unsigned vrpn_MAX_TEXT_LEN = 1024; - -class VRPN_API vrpn_BaseClass; - -/// Class that handles text/warning/error printing for all objects in the -/// system. -// It is a system class, with one instance of it in existence. Each object in -// the system registers with this class when it is constructed. By default, -// this class prints all Warning and Error messages to stdout, prefaced by -// "vrpn Warning(0) from MUMBLE: ", where the 0 indicates the level of the -// message and Warning the severity, and MUMBLE the name of the object that sent -// the message. The user could create their own TextPrinter, and attach whatever -// objects they want to it. -// NOTE: Because there is a vrpn_System_TextPrinter that all vrpn_BaseClass -// objects talk to, and because those objects may be in multiple threads, the -// vrpn_TextPrinter class has to be thread-safe. This requires all user- -// callable methods to be thread-safe because the destructor may be called -// during a method call. - -class VRPN_API vrpn_TextPrinter { -public: - vrpn_TextPrinter(); - ~vrpn_TextPrinter(); - - /// Adds an object to the list of watched objects (multiple registration - /// of the same object will result in only one printing for each message - /// from the object). Returns 0 on success and -1 on failure. - /// YOU MUST REMOVE any objects from a vrpn_TextPrinter that you create - /// before destroying the printer if any connection objects survive, - /// otherwise they may call a callback function on the destroyed object. - int add_object(vrpn_BaseClass *o); - - /// Remove an object from the list of watched objects (multiple deletions - /// of the object will not cause any error condition; deletions of - /// unregistered objects will not cause errors). - void remove_object(vrpn_BaseClass *o); - - /// Change the level of printing for the object (sets the minimum level to - /// print). Default is Warnings and Errors of all levels. - void set_min_level_to_print(vrpn_TEXT_SEVERITY severity, - vrpn_uint32 level = 0); - - /// Change the ostream that will be used to print messages. Setting a - /// NULL ostream results in no printing. - void set_ostream_to_use(FILE *o); - -protected: - /// Mutex to ensure thread safety; - vrpn_Semaphore d_semaphore; - - /// Structure to hold the objects that are being watched. - class VRPN_API vrpn_TextPrinter_Watch_Entry { - public: - vrpn_BaseClass *obj; ///< Object being watched - vrpn_TextPrinter *me; - ///< Pointer to this, because used in a static function - vrpn_TextPrinter_Watch_Entry *next; - ///< Pointer to the next one in the list - }; - vrpn_TextPrinter_Watch_Entry *d_first_watched_object; - ///< Head of list of objects being watched - - FILE *d_ostream; ///< Output stream to use - vrpn_TEXT_SEVERITY d_severity_to_print; ///< Minimum severity to print - vrpn_uint32 d_level_to_print; ///< Minimum level to print - - /// Handles the text messages that come from the connections for - /// objects we are watching. - static int VRPN_CALLBACK - text_message_handler(void *userdata, vrpn_HANDLERPARAM p); -}; -extern VRPN_API vrpn_TextPrinter vrpn_System_TextPrinter; - -/// INTERNAL class to hold members that there should only be one copy of -/// even when a class inherits from multiple vrpn_BaseClasses because it -/// inherits from multiple user-level classes. Note that not everything in -/// vrpnBaseClass should be here, because (for example) the registration of -/// types should be done for each parent class. -class VRPN_API vrpn_BaseClassUnique { - friend class VRPN_API vrpn_TextPrinter; - -public: - vrpn_BaseClassUnique(); - virtual ~vrpn_BaseClassUnique(); - - /// Returns a pointer to the connection this object is using - vrpn_Connection *connectionPtr() { return d_connection; }; - - bool shutup; // if True, don't print the "No response from server" messages. - - friend class SendTextMessageBoundCall; - class SendTextMessageBoundCall { - private: - vrpn_BaseClassUnique *_p; - vrpn_TEXT_SEVERITY _severity; - - public: - SendTextMessageBoundCall(vrpn_BaseClassUnique *device, - vrpn_TEXT_SEVERITY type) - : _p(device) - , _severity(type) - { - } - - SendTextMessageBoundCall(SendTextMessageBoundCall const &other) - : _p(other._p) - , _severity(other._severity) - { - } - - int operator()(const char *msg) const - { - struct timeval timestamp; - vrpn_gettimeofday(×tamp, NULL); - return _p->send_text_message(msg, timestamp, _severity); - } - }; - -protected: - vrpn_Connection *d_connection; ///< Connection that this object talks to - char *d_servicename; ///< Name of this device, not including the connection - /// part - - vrpn_int32 d_sender_id; ///< Sender ID registered with the connection - vrpn_int32 d_text_message_id; ///< ID for text messages - vrpn_int32 d_ping_message_id; ///< Ask the server if they are there - vrpn_int32 d_pong_message_id; ///< Server telling that it is there - - /// Registers a handler with the connection, and remembers to delete at - /// destruction. - // This is a wrapper for the vrpn_Connection call that registers - // message handlers. It should be used rather than the connection's - // function because this one will remember to unregister all of its handlers - // at object deletion time. - int register_autodeleted_handler(vrpn_int32 type, - vrpn_MESSAGEHANDLER handler, - void *userdata, - vrpn_int32 sender = vrpn_ANY_SENDER); - - /// Encodes the body of the text message into a buffer, preparing for - /// sending - static int encode_text_message_to_buffer(char *buf, - vrpn_TEXT_SEVERITY severity, - vrpn_uint32 level, - const char *msg); - - /// Decodes the body of the text message from a buffer from the connection - static int decode_text_message_from_buffer(char *msg, - vrpn_TEXT_SEVERITY *severity, - vrpn_uint32 *level, - const char *buf); - - /// Sends a NULL-terminated text message from the device d_sender_id - int send_text_message(const char *msg, struct timeval timestamp, - vrpn_TEXT_SEVERITY type = vrpn_TEXT_NORMAL, - vrpn_uint32 level = 0); - - /// Returns an object you can stream into to send a text message from the - /// device - /// like send_text_message(vrpn_TEXT_WARNING) << "Value of i is: " << i; - /// This use requires including vrpn_SendTextMessageStreamProxy.h - SendTextMessageBoundCall - send_text_message(vrpn_TEXT_SEVERITY type = vrpn_TEXT_NORMAL) - { - return SendTextMessageBoundCall(this, type); - } - - /// Handles functions that all servers should provide in their mainloop() - /// (ping/pong, for example) - /// Should be called by all servers in their mainloop() - void server_mainloop(void); - - /// Handles functions that all clients should provide in their mainloop() - /// (warning of no server, for example) - /// Should be called by all clients in their mainloop() - void client_mainloop(void); - -private: - struct { - vrpn_MESSAGEHANDLER handler; - vrpn_int32 sender; - vrpn_int32 type; - void *userdata; - } d_handler_autodeletion_record[vrpn_MAX_BCADRS]; - int d_num_autodeletions; - - int d_first_mainloop; ///< First time client_mainloop() or server_mainloop() - /// called? - struct timeval d_time_first_ping; ///< When was the first ping of this - /// unanswered group sent? - struct timeval - d_time_last_warned; ///< When is the last time we sent a warning? - int d_unanswered_ping; ///< Do we have an outstanding ping request? - int d_flatline; ///< Has it been 10+ seconds without a response? - - /// Used by client/server code to request/send "server is alive" (pong) - /// message - static int VRPN_CALLBACK handle_ping(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK handle_pong(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_connection_dropped(void *userdata, vrpn_HANDLERPARAM p); - void initiate_ping_cycle(void); -}; - -//--------------------------------------------------------------- -/// Class from which all user-level (and other) classes that communicate -/// with vrpn_Connections should derive. - -class VRPN_API vrpn_BaseClass : virtual public vrpn_BaseClassUnique { - -public: - /// Names the device and assigns or opens connection, - /// calls registration methods - vrpn_BaseClass(const char *name, vrpn_Connection *c = NULL); - - virtual ~vrpn_BaseClass(); - - /// Called once through each main loop iteration to handle updates. - /// Remote object mainloop() should call client_mainloop() and - /// then call d_connection->mainloop(). - /// Server object mainloop() should service the device and then - /// call server_mainloop(), but should not normally call - /// d_connection->mainloop(). - virtual void mainloop() = 0; - -protected: - /// Initialize things that the constructor can't. Returns 0 on - /// success, -1 on failure. - virtual int init(void); - - /// Register the sender for this device (by default, the name of the - /// device). Return 0 on success, -1 on fail. - virtual int register_senders(void); - - /// Register the types of messages this device sends/receives. - /// Return 0 on success, -1 on fail. - virtual int register_types(void) = 0; -}; - -//--------------------------------------------------------------- -// Within VRPN (and other libraries), it is wise to avoid using the -// Standard Template Library. This is very annoying, but required -// by the fact that some systems have incompatible versions of STL. -// This caused problems with any program that uses the GHOST library -// (which had its own STL on Windows), and I've heard tell of problems -// with other systems as well. On the other hand, nothing says that -// we can't have our OWN template types and use them. This next type -// is used to handle callback lists within objects. It is templated -// over the struct that is passed to the user callback. -// See vrpn_Button.h's usage for an example. - -// Disables a warning that the class requires DLL linkage to be -// used by clients of classes that include one: The classes themselves -// have DLL linkage, the code below asks for (but apparently does not -// get) DLL linkage, and the DLL-linked test programs work when things -// are as they are. Do not use this class outside of a derived class. -#ifdef _MSC_VER -#pragma warning(disable : 4251) -#endif -template <class CALLBACK_STRUCT> class VRPN_API vrpn_Callback_List { -public: - typedef void(VRPN_CALLBACK *HANDLER_TYPE)(void *userdata, - const CALLBACK_STRUCT info); - - /// This class requires deep copies. - void operator=(const vrpn_Callback_List &from) - { - // Delete any existing elements in the list. - CHANGELIST_ENTRY *current, *next; - current = d_change_list; - while (current != NULL) { - next = current->next; - delete current; - current = next; - } - - // Copy all elements from the other list. XXX Side effect, this inverts - // the order - current = from.d_change_list; - while (current != NULL) { - register_handler(current->userdata, current->handler); - current = current->next; - } - } - - /// Call this to add a handler to the list. - int register_handler(void *userdata, HANDLER_TYPE handler) - { - CHANGELIST_ENTRY *new_entry; - - // Ensure that the handler is non-NULL - if (handler == NULL) { - fprintf(stderr, - "vrpn_Callback_List::register_handler(): NULL handler\n"); - return -1; - } - - // Allocate and initialize the new entry - if ((new_entry = new CHANGELIST_ENTRY) == NULL) { - fprintf(stderr, - "vrpn_Callback_List::register_handler(): Out of memory\n"); - return -1; - } - new_entry->handler = handler; - new_entry->userdata = userdata; - - // Add this handler to the chain at the beginning (don't check to see - // if it is already there, since duplication is okay). - new_entry->next = d_change_list; - d_change_list = new_entry; - - return 0; - }; - - /// Call this to remove a handler from the list (if it exists) - int unregister_handler(void *userdata, HANDLER_TYPE handler) - { - // The pointer at *snitch points to victim - CHANGELIST_ENTRY *victim, **snitch; - - // Find a handler with this registry in the list (any one will do, - // since all duplicates are the same). - snitch = &d_change_list; - victim = *snitch; - while ((victim != NULL) && ((victim->handler != handler) || - (victim->userdata != userdata))) { - snitch = &((*snitch)->next); - victim = victim->next; - } - - // Make sure we found one - if (victim == NULL) { - fprintf( - stderr, - "vrpn_Callback_List::unregister_handler: No such handler\n"); - return -1; - } - - // Remove the entry from the list - *snitch = victim->next; - delete victim; - - return 0; - }; - - /// This will pass the referenced parameter as a const to all the callbacks. - void call_handlers(const CALLBACK_STRUCT &info) - { - CHANGELIST_ENTRY *handler = d_change_list; - while (handler != NULL) { - handler->handler(handler->userdata, info); - handler = handler->next; - } - }; - - /// The list starts out empty - vrpn_Callback_List() - : d_change_list(NULL){}; - - /// Clear the list upon destruction if it is not empty already - ~vrpn_Callback_List() - { - while (d_change_list != NULL) { - CHANGELIST_ENTRY *next = d_change_list->next; - delete d_change_list; - d_change_list = next; - } - }; - -protected: - typedef struct vrpn_CBS { - void *userdata; - HANDLER_TYPE handler; - struct vrpn_CBS *next; - } CHANGELIST_ENTRY; - CHANGELIST_ENTRY *d_change_list; -}; - -// End of defined VRPN_BASECLASS for vrpn_BaseClass.h -#endif diff --git a/src/vrpn/vrpn_BiosciencesTools.C b/src/vrpn/vrpn_BiosciencesTools.C deleted file mode 100644 index ac63fd2b3b77391cbfad84eb68666218ad3b6695..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_BiosciencesTools.C +++ /dev/null @@ -1,484 +0,0 @@ -// vrpn_BiosciencesTools.C -// This is a driver for the BiosciencesTools temperature controller. -// It was written in October 2012 by Russ Taylor. - -// INFO about how the device communicates, taken from the user manual: -// Note: They say that the device uses <cr>, but they also say that it -// uses \n for this character. In fact, the \r character is <cr> and \n -// is newline. In fact, \r is what works in the end. - -/* -Using a standard DB-9 cable (female-female connectors on both ends with -straight-through connections from each pin) -connect the controller (middle DB-9 connector) to a serial port of your computer. -Set the serial port at 115,200 speed, 8 bits, 1 stop bit, -NONE parity, and Hardware flow control. -The following is the list of text commands supported. -NOTE: Each command should follow by \r <CR> code: -(The following notes LIE: There is no space before the . or before the C, - and sometimes the C is an E. Also, the order is incorrect. The actual - order is stage 1, bath 1, external 1, stage 2, bath 2, external 2.) -T1<CR> returns temperature readings from STAGE1 sensor: 37 .1 C -T2<CR> returns temperature readings from BATH1 sensor: 36 .9 C -T5<CR> returns SET temperature: 37 .0 C -T3<CR> returns temperature readings from STAGE2 sensor: 37 .1 C -T4<CR> returns temperature readings from BATH2 sensor: 36 .9 C -T6<CR> returns SET temperature: 37 .0 C -CTn<CR> returns readings from n (n=1 - STAGE1, 2 - BATH1, 3 - STAGE2, 4 - BATH2) sensor: 37 .1 C -ON<CR> turns temperature control ON -OFF<CR> turns temperature control OFF -S1 037 0<CR> sets reference temperature for channel I (NOTE: all four digits should be sent to the controller) -S2 037 0<CR> sets reference temperature for channel II -*/ - -#include <stddef.h> // for size_t -#include <stdio.h> // for sprintf, fprintf, stderr, etc -#include <string.h> // for strlen, NULL - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR, etc -#include "vrpn_BiosciencesTools.h" -#include "vrpn_Serial.h" // for vrpn_write_characters, etc -#include "vrpn_Shared.h" // for vrpn_unbuffer, timeval, etc -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -#undef VERBOSE - -// Defines the modes in which the device can find itself. -#define STATUS_RESETTING (-1) // Resetting the device -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report - -#define TIMEOUT_TIME_INTERVAL (2000000L) // max time between reports (usec) - - -// This creates a vrpn_BiosciencesTools. It opens -// the serial device using the code in the vrpn_Serial_Analog constructor. -// It uses hardware flow control. - -vrpn_BiosciencesTools::vrpn_BiosciencesTools (const char * name, vrpn_Connection * c, - const char * port, float temp1, float temp2, bool control_on): - vrpn_Serial_Analog(name, c, port, 115200, 8, vrpn_SER_PARITY_NONE, true), - vrpn_Analog_Output(name, c), - vrpn_Button_Filter(name, c) -{ - num_channel = 6; - o_num_channel = 3; - num_buttons = 1; - buttons[0] = control_on; - - // Fill in the arguments to send to the device at reset time. - o_channel[0] = temp1; - o_channel[1] = temp2; - o_channel[2] = control_on; - - // Set the mode to reset - status = STATUS_RESETTING; - - // Register to receive the message to request changes and to receive connection - // messages. - if (d_connection != NULL) { - if (register_autodeleted_handler(request_m_id, handle_request_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_BiosciencesTools: can't register handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler(request_channels_m_id, handle_request_channels_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_BiosciencesTools: can't register handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler(d_ping_message_id, handle_connect_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_BiosciencesTools: can't register handler\n"); - d_connection = NULL; - } - } else { - fprintf(stderr,"vrpn_BiosciencesTools: Can't get connection!\n"); - } - -} - -// Command format described in document: -// S1 037 0<CR> sets reference temperature for channel 1 -// (NOTE: all four digits should be sent to the controller) -// Actual command format: -// S1 0370<CR> Sets reference temperature for channel 1 to 37.0 deg C -// S2 0421<CR> Sets reference temperature for channel 2 to 42.1 deg C - -bool vrpn_BiosciencesTools::set_reference_temperature(unsigned channel, float value) -{ - char command[128]; - - // Fill in the command with the zero-padded integer output for - // above the decimal and then a single value for the first point - // past the decimal. - int whole = static_cast<int>(value); - int dec = static_cast<int>(value*10) - whole*10; - sprintf(command, "S%d %03d%d\r", channel+1, whole,dec); - - // Send the command to the serial port - return (vrpn_write_characters(serial_fd, (unsigned char *)(command), strlen(command)) == strlen(command)); -} - -// Command format: -// ON<CR> sets control on -// OFF<CR> sets control off - -bool vrpn_BiosciencesTools::set_control_status(bool on) -{ - char command[128]; - - if (on) { - sprintf(command, "ON\r"); - } else { - sprintf(command, "OFF\r"); - } - - // Send the command to the serial port - return (vrpn_write_characters(serial_fd, (unsigned char *)(command), strlen(command)) == strlen(command)); -} - -// Command format: -// T1<CR> returns temperature readings from STAGE1 sensor: 37.1C -// T2<CR> returns temperature readings from BATH1 sensor: 36.9C -// T5<CR> returns SET temperature: 37.0C -// T3<CR> returns temperature readings from STAGE2 sensor: 37.1C -// T4<CR> returns temperature readings from BATH2 sensor: 36.9C -// T6<CR> returns SET temperature: 37.0C -// NOTE: Sometimes the C is an E when there is no reading. - -bool vrpn_BiosciencesTools::request_temperature(unsigned channel) -{ - char command[128]; - - sprintf(command, "T%d\r", channel+1); -#ifdef VERBOSE - printf("Sending command: %s", command); -#endif - - // Send the command to the serial port - return (vrpn_write_characters(serial_fd, (unsigned char *)(command), strlen(command)) == strlen(command)); -} - -// Convert the four bytes that have been read into a signed integer value. -// The format (no quotes) looks like: "- 37.1C\r" or " 000.00E\r". -// I don't think that the - means a minus sign, and it has a space -// between it and the number. -// Returns -1000 if there is an error. -float vrpn_BiosciencesTools::convert_bytes_to_reading(const char *buf) -{ - float val; - char c; - - // Skip any leading minus sign. - if (*buf == '-') { buf++; } - - // Read a fractional number. - if (sscanf(buf, "%f%c", &val, &c) != 2) { - return -1000; - } - - // See if we get and E or C after the number, - // or (since E can be part of a floating-point - // number) if we get \r. - if ( (c != 'E') && (c != 'C') && (c != '\r') ) { - return -1000; - } - - return val; -} - - -int vrpn_BiosciencesTools::reset(void) -{ - //----------------------------------------------------------------------- - // Sleep less thana second and then drain the input buffer to make sure we start - // with a fresh slate. - vrpn_SleepMsecs(200); - vrpn_flush_input_buffer(serial_fd); - - //----------------------------------------------------------------------- - // Set the temperatures for channel 1 and 2 and then set the temperature - // control to be on or off depending on what we've been asked to do. - if (!set_reference_temperature(0, static_cast<float>(o_channel[0]))) { - fprintf(stderr,"vrpn_BiosciencesTools::reset(): Cannot send set ref temp 0, trying again\n"); - return -1; - } - if (!set_reference_temperature(1, static_cast<float>(o_channel[1]))) { - fprintf(stderr,"vrpn_BiosciencesTools::reset(): Cannot send set ref temp 1, trying again\n"); - return -1; - } - if (!set_control_status(o_channel[0] != 0)) { - fprintf(stderr,"vrpn_BiosciencesTools::reset(): Cannot send set control status, trying again\n"); - return -1; - } - - //----------------------------------------------------------------------- - // Send the command to request input from the first channel, and set up - // the finite-state machine so we know which thing to request next. - d_next_channel_to_read = 0; - if (!request_temperature(d_next_channel_to_read)) { - fprintf(stderr,"vrpn_BiosciencesTools::reset(): Cannot request temperature, trying again\n"); - return -1; - } - - // We're now waiting for any responses from devices - status = STATUS_SYNCING; - VRPN_MSG_WARNING("reset complete (this is normal)"); - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - return 0; -} - -// This function will read characters until it has a full report, then -// put that report into analog fields and call the report methods on these. -// The time stored is that of the first character received as part of the -// report. - -int vrpn_BiosciencesTools::get_report(void) -{ - int ret; // Return value from function call to be checked - - //-------------------------------------------------------------------- - // If we're SYNCing, then the next character we get should be the start - // of a report. If we recognize it, go into READing mode and tell how - // many characters we expect total. If we don't recognize it, then we - // must have misinterpreted a command or something; reset - // and start over - //-------------------------------------------------------------------- - - if (status == STATUS_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, (unsigned char *)(d_buffer), 1) != 1) { - return 0; - } - - // Got the first character of a report -- go into READING mode - // and record that we got one character at this time. Clear the - // rest of the buffer to 0's so that we won't be looking at old - // data when we parse. - // The time stored here is as close as possible to when the - // report was generated. - d_bufcount = 1; - vrpn_gettimeofday(×tamp, NULL); - status = STATUS_READING; - size_t i; - for (i = 1; i < sizeof(d_buffer); i++) { - d_buffer[i] = 0; - } -#ifdef VERBOSE - printf("... Got the 1st char\n"); -#endif - } - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. - //-------------------------------------------------------------------- - - while ( 1 == (ret = vrpn_read_available_characters(serial_fd, (unsigned char *)(&d_buffer[d_bufcount]), 1))) { - d_bufcount++; - } - if (ret == -1) { - VRPN_MSG_ERROR("Error reading"); - status = STATUS_RESETTING; - return 0; - } -#ifdef VERBOSE - if (ret != 0) printf("... got %d total characters\n", d_bufcount); -#endif - if (d_buffer[d_bufcount-1] != '\r') { // Not done -- go back for more - return 0; - } - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. Check to make - // sure that its format matches what we expect. If it does, the next - // section will parse it. - // Store the report into the appropriate analog channel. - //-------------------------------------------------------------------- - -#ifdef VERBOSE - printf(" Complete report: \n%s\n",d_buffer); -#endif - float value = convert_bytes_to_reading(d_buffer); - if (value == -1000) { - char msg[256]; - sprintf(msg,"Invalid report, channel %d, resetting", d_next_channel_to_read); - VRPN_MSG_ERROR(msg); - status = STATUS_RESETTING; - } - channel[d_next_channel_to_read] = value; - -#ifdef VERBOSE - printf("got a complete report (%d chars)!\n", d_bufcount); -#endif - - //-------------------------------------------------------------------- - // Request a reading from the next channe. - //-------------------------------------------------------------------- - - d_next_channel_to_read = (d_next_channel_to_read + 1) % 6; - if (!request_temperature(d_next_channel_to_read)) { - char msg[256]; - sprintf(msg,"Can't request reading, channel %d, resetting", d_next_channel_to_read); - VRPN_MSG_ERROR(msg); - status = STATUS_RESETTING; - } - - //-------------------------------------------------------------------- - // Done with the decoding, send the reports and go back to syncing - //-------------------------------------------------------------------- - - report_changes(); - status = STATUS_SYNCING; - d_bufcount = 0; - - return 1; -} - -bool vrpn_BiosciencesTools::set_specified_channel(unsigned channel, vrpn_float64 value) -{ - // XXX Check return status of the set commands? - switch (channel) { - case 0: // Reference temperature for channels 1 and 2 - case 1: // Reference temperature for channels 1 and 2 - set_reference_temperature(channel, static_cast<float>(value)); - o_channel[channel] = value; - break; - case 2: // Turn on temperature control if this is nonzero. - o_channel[2] = value; - buttons[0] = ( value != 0 ); - set_control_status( value != 0); - break; - default: - return false; - } - return true; -} - -int vrpn_BiosciencesTools::handle_request_message(void *userdata, vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_float64 value; - vrpn_BiosciencesTools *me = (vrpn_BiosciencesTools *)userdata; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - vrpn_unbuffer(&bufptr, &value); - - // Set the appropriate value, if the channel number is in the - // range of the ones we have. - if ( (chan_num < 0) || (chan_num >= me->o_num_channel) ) { - char msg[1024]; - sprintf(msg,"vrpn_BiosciencesTools::handle_request_message(): Index out of bounds (%d of %d), value %lg\n", - chan_num, me->num_channel, value); - me->send_text_message(msg, me->timestamp, vrpn_TEXT_ERROR); - return 0; - } - - me->set_specified_channel(chan_num, value); - return 0; -} - -int vrpn_BiosciencesTools::handle_request_channels_message(void* userdata, vrpn_HANDLERPARAM p) -{ - int i; - const char* bufptr = p.buffer; - vrpn_int32 num; - vrpn_int32 pad; - vrpn_BiosciencesTools* me = (vrpn_BiosciencesTools *)userdata; - - // Read the values from the buffer - vrpn_unbuffer(&bufptr, &num); - vrpn_unbuffer(&bufptr, &pad); - if (num > me->o_num_channel) { - char msg[1024]; - sprintf(msg,"vrpn_BiosciencesTools::handle_request_channels_message(): Index out of bounds (%d of %d), clipping\n", - num, me->o_num_channel); - me->send_text_message(msg, me->timestamp, vrpn_TEXT_ERROR); - num = me->o_num_channel; - } - for (i = 0; i < num; i++) { - vrpn_unbuffer(&bufptr, &(me->o_channel[i])); - me->set_specified_channel(i, me->o_channel[i]); - } - - return 0; -} - -/** When we get a connection request from a remote object, send our state so - they will know it to start with. */ -int vrpn_BiosciencesTools::handle_connect_message(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_BiosciencesTools *me = (vrpn_BiosciencesTools *)userdata; - - me->report(vrpn_CONNECTION_RELIABLE); - return 0; -} - -void vrpn_BiosciencesTools::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_BiosciencesTools::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -/** This routine is called each time through the server's main loop. It will - take a course of action depending on the current status of the device, - either trying to reset it or trying to get a reading from it. It will - try to reset the device if no data has come from it for a couple of - seconds -*/ - -void vrpn_BiosciencesTools::mainloop() -{ - char errmsg[256]; - - server_mainloop(); - - switch(status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - while (get_report()) {}; // Keep getting reports so long as there are more - - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) > TIMEOUT_TIME_INTERVAL) { - sprintf(errmsg,"Timeout... current_time=%ld:%ld, timestamp=%ld:%ld", - current_time.tv_sec, static_cast<long>(current_time.tv_usec), - timestamp.tv_sec, static_cast<long>(timestamp.tv_usec)); - VRPN_MSG_ERROR(errmsg); - status = STATUS_RESETTING; - } - } - break; - - default: - VRPN_MSG_ERROR("Unknown mode (internal error)"); - break; - } -} diff --git a/src/vrpn/vrpn_BiosciencesTools.h b/src/vrpn/vrpn_BiosciencesTools.h deleted file mode 100644 index efa44da1788da06f4896379c8aa64533715fd3cc..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_BiosciencesTools.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef VRPN_BIOSCIENCES_H -#define VRPN_BIOSCIENCES_H - -// XXX Need to have a VRPN boolean output device. Then we can set the -// temperature control to be on or off based on its value. For now, we're -// doing a horrible thing and packing it into an analog output channel. - -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Analog_Output.h" // for vrpn_Analog_Output -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_RELIABLE, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32, vrpn_float64 - -/* -# Analog channels: (read by client) -# 0 Reading from stage 1 in degrees Celcius -# 1 Reading from bath 1 in degrees Celcius -# 2 External 1 in degrees Celcius (or setpoint if ext not used) -# 3 Reading from stage 2 in degrees Celcius -# 4 Reading from bath 2 in degrees Celcius -# 5 External 1 in degrees Celcius (or setpoint if ext not used) -# Button channels: (read by client) -# 0 Temperature control is on or off -# Analog_Output channels: (set by client) -# 0 Reference temperature for channel 1 -# 1 Reference temperature for channel 2 -# 2 Turn temperature control on/off (0 = off, otherwise on) -*/ - -class VRPN_API vrpn_BiosciencesTools: public vrpn_Serial_Analog, - public vrpn_Analog_Output, public vrpn_Button_Filter -{ -public: - // Tell it the temperature to use to set channels 1 and 2 to - // in Celcius and also whether to turn the temperature control on. - vrpn_BiosciencesTools (const char * name, vrpn_Connection * c, - const char * port, float temp1, float temp2, - bool control_on); - ~vrpn_BiosciencesTools () {}; - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - - protected: - char d_buffer[128]; //< Buffer of characters in report - unsigned d_bufcount; //< How many characters we have so far - - struct timeval timestamp; //< Time of the last report from the device - - virtual int reset(void); //< Set device back to starting config - virtual int get_report(void); //< Try to read a report from the device - - // Channels are zero-referenced. Use 0 for channel 1. - bool set_reference_temperature(unsigned channel, float value); - bool set_control_status(bool on); - bool request_temperature(unsigned channel); - - // Sets a specified channel based on a new value from the Analog_Output. - // Channels 0 and 1 are temperature settings, and channel 2 is our - // hack to turn on and off temperatur control. - bool set_specified_channel(unsigned channel, vrpn_float64 value); - - // This lets us know which channel we're waiting for a reading on. - // It cycles; each time we hear from one, we ask for the next. - unsigned d_next_channel_to_read; - - float convert_bytes_to_reading(const char *buf); - - /// send report iff changed - virtual void report_changes - (vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - /// send report whether or not changed - virtual void report - (vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - - /// Responds to a request to change one of the values by - /// setting the channel to that value. - static int VRPN_CALLBACK handle_request_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Responds to a request to change multiple channels at once. - static int VRPN_CALLBACK handle_request_channels_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Responds to a connection request with a report of the values - static int VRPN_CALLBACK handle_connect_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -#endif diff --git a/src/vrpn/vrpn_Button.C b/src/vrpn/vrpn_Button.C deleted file mode 100644 index 5fbd02cb2111d7dfe93c1a4183f68a1a1383b314..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Button.C +++ /dev/null @@ -1,1059 +0,0 @@ -#include <stdio.h> // for fprintf, stderr, NULL, etc -#ifndef _WIN32_WCE -#include <fcntl.h> // for open, O_RDWR -#endif -#include <string.h> // for strncpy - -#if defined(linux) && !defined(VRPN_CLIENT_ONLY) -#include <linux/lp.h> // for LPGETSTATUS -#include <sys/ioctl.h> // for ioctl -#endif - -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#ifndef VRPN_CLIENT_ONLY -#include "vrpn_Serial.h" -#endif -// Include vrpn_Shared.h _first_ to avoid conflicts with sys/time.h -// and unistd.h -#include "vrpn_Shared.h" // for timeval, vrpn_buffer, etc - -#ifdef linux -#include <unistd.h> -#endif -#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(_WIN32_WCE) -#include <conio.h> // for _inp() -#endif - -#if (defined(sgi) && (!defined(VRPN_CLIENT_ONLY))) -#include <gl/device.h> -// need these for the gl based setdblight calls -#include <gl/gl.h> -#endif - -#include "vrpn_Button.h" - -#define BUTTON_READY (1) -#define BUTTON_FAIL (-1) - -// Bits in the status register -#ifndef VRPN_CLIENT_ONLY -static const unsigned char PORT_ERROR = (1 << 3); -static const unsigned char PORT_SLCT = (1 << 4); -static const unsigned char PORT_PE = (1 << 5); -static const unsigned char PORT_ACK = (1 << 6); -static const unsigned char PORT_BUSY = (1 << 7); -static const unsigned char BIT_MASK = - PORT_ERROR | PORT_SLCT | PORT_PE | PORT_ACK | PORT_BUSY; - -// message constants for the PinchGlove code. -const unsigned char PG_START_BYTE_DATA(0x80); -const unsigned char PG_START_BYTE_DATA_TIME(0x81); -//const unsigned char PG_START_BYTE_TEXT(0x82); -const unsigned char PG_END_BYTE(0x8F); -#endif - -static int VRPN_CALLBACK -client_msg_handler(void *userdata, vrpn_HANDLERPARAM p); - -#define PACK_ADMIN_MESSAGE(i, event) \ - { \ - char msgbuf[1000]; \ - vrpn_int32 len = encode_to(msgbuf, i, event); \ - if (d_connection->pack_message(len, timestamp, admin_message_id, \ - d_sender_id, msgbuf, \ - vrpn_CONNECTION_RELIABLE)) { \ - fprintf(stderr, "vrpn_Button: can't write message: tossing\n"); \ - } \ - } -#define PACK_ALERT_MESSAGE(i, event) \ - { \ - char msgbuf[1000]; \ - vrpn_int32 len = encode_to(msgbuf, i, event); \ - if (d_connection->pack_message(len, timestamp, alert_message_id, \ - d_sender_id, msgbuf, \ - vrpn_CONNECTION_RELIABLE)) { \ - fprintf(stderr, "vrpn_Button: can't write message: tossing\n"); \ - } \ - } - -#define PACK_MESSAGE(i, event) \ - { \ - char msgbuf[1000]; \ - vrpn_int32 len = encode_to(msgbuf, i, event); \ - if (d_connection->pack_message(len, timestamp, change_message_id, \ - d_sender_id, msgbuf, \ - vrpn_CONNECTION_RELIABLE)) { \ - fprintf(stderr, "vrpn_Button: can't write message: tossing\n"); \ - } \ - } - -vrpn_Button::vrpn_Button(const char *name, vrpn_Connection *c) - : vrpn_BaseClass(name, c) - , num_buttons(0) -{ - vrpn_BaseClass::init(); - - // Set the time to 0 just to have something there. - timestamp.tv_usec = timestamp.tv_sec = 0; - for (vrpn_int32 i = 0; i < vrpn_BUTTON_MAX_BUTTONS; i++) { - buttons[i] = lastbuttons[i] = 0; - } -} - -int vrpn_Button::register_types(void) -{ - // used to handle button strikes - change_message_id = - d_connection->register_message_type("vrpn_Button Change"); - - // used to handle button states reports - states_message_id = - d_connection->register_message_type("vrpn_Button States"); - - // to handle button state changes -- see Buton_Filter should register a - // handler - // for this ID -- ideally the message will be ignored otherwise - admin_message_id = d_connection->register_message_type("vrpn_Button Admin"); - - return 0; -} - -// virtual -vrpn_Button::~vrpn_Button(void) -{ - - // do nothing -} - -vrpn_Button_Filter::vrpn_Button_Filter(const char *name, vrpn_Connection *c) - : vrpn_Button(name, c) -{ - if ((d_sender_id == -1) || (admin_message_id == -1)) { - fprintf(stderr, "vrpn_Button: Can't register IDs\n"); - d_connection = NULL; - } - register_autodeleted_handler(admin_message_id, client_msg_handler, this); - - // setup message id type for alert messages to alert a device about changes - alert_message_id = d_connection->register_message_type("vrpn_Button Alert"); - send_alerts = 0; // used to turn on/off alerts -- send and admin message - // from - // remote to turn it on -- or server side call set_alerts(); - - // Set up callback handler for ping message from client so that it - // sends the button states. This will make sure that the other side hears - // the initial button states. Also set this up - // to fire on the "new connection" system message. - - register_autodeleted_handler(d_ping_message_id, handle_ping_message, this, - d_sender_id); - register_autodeleted_handler( - d_connection->register_message_type(vrpn_got_connection), - handle_ping_message, this, vrpn_ANY_SENDER); - - // set button default buttonstates - for (vrpn_int32 i = 0; i < vrpn_BUTTON_MAX_BUTTONS; i++) { - buttonstate[i] = vrpn_BUTTON_MOMENTARY; - } - return; -} - -int vrpn_Button_Filter::handle_ping_message(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_Button_Filter *me = (vrpn_Button_Filter *)userdata; - me->report_states(); - return 0; -} - -void vrpn_Button_Filter::set_alerts(vrpn_int32 i) -{ - if (i == 0 || i == 1) - send_alerts = i; - else - fprintf(stderr, "Invalid send_alert state\n"); - return; -} - -void vrpn_Button_Filter::set_momentary(vrpn_int32 which_button) -{ - if (which_button >= num_buttons) { - char msg[200]; - sprintf(msg, "vrpn_Button::set_momentary() buttons id %d is greater " - "than the number of buttons(%d)\n", - which_button, num_buttons); - send_text_message(msg, timestamp, vrpn_TEXT_ERROR); - return; - } - buttonstate[which_button] = vrpn_BUTTON_MOMENTARY; - if (send_alerts) PACK_ALERT_MESSAGE(which_button, vrpn_BUTTON_TOGGLE_OFF); -} - -void vrpn_Button::set_momentary(vrpn_int32 which_button) -{ - if (which_button >= num_buttons) { - char msg[200]; - sprintf(msg, "vrpn_Button::set_momentary() buttons id %d is greater " - "than the number of buttons(%d)\n", - which_button, num_buttons); - send_text_message(msg, timestamp, vrpn_TEXT_ERROR); - return; - } - PACK_ADMIN_MESSAGE(which_button, vrpn_BUTTON_MOMENTARY); -} - -void vrpn_Button_Filter::set_toggle(vrpn_int32 which_button, - vrpn_int32 current_state) -{ - if (which_button >= num_buttons) { - char msg[200]; - sprintf(msg, "vrpn_Button::set_toggle() buttons id %d is greater then " - "the number of buttons(%d)\n", - which_button, num_buttons); - send_text_message(msg, timestamp, vrpn_TEXT_ERROR); - return; - } - if (current_state == vrpn_BUTTON_TOGGLE_ON) { - buttonstate[which_button] = vrpn_BUTTON_TOGGLE_ON; - if (send_alerts) - PACK_ALERT_MESSAGE(which_button, vrpn_BUTTON_TOGGLE_ON); - } - else { - buttonstate[which_button] = vrpn_BUTTON_TOGGLE_OFF; - if (send_alerts) - PACK_ALERT_MESSAGE(which_button, vrpn_BUTTON_TOGGLE_OFF); - } -} -void vrpn_Button::set_toggle(vrpn_int32 which_button, vrpn_int32 current_state) -{ - if (which_button >= num_buttons) { - char msg[200]; - sprintf(msg, "vrpn_Button::set_toggle() buttons id %d is greater then " - "the number of buttons(%d)\n", - which_button, num_buttons); - send_text_message(msg, timestamp, vrpn_TEXT_ERROR); - return; - } - if (current_state == vrpn_BUTTON_TOGGLE_ON) { - PACK_ADMIN_MESSAGE(which_button, vrpn_BUTTON_TOGGLE_ON); - } - else { - PACK_ADMIN_MESSAGE(which_button, vrpn_BUTTON_TOGGLE_OFF); - } -} - -void vrpn_Button_Filter::set_all_momentary(void) -{ - for (vrpn_int32 i = 0; i < num_buttons; i++) { - if (buttonstate[i] != vrpn_BUTTON_MOMENTARY) { - buttonstate[i] = vrpn_BUTTON_MOMENTARY; - if (send_alerts) PACK_ALERT_MESSAGE(i, vrpn_BUTTON_TOGGLE_OFF); - } - } -} - -void vrpn_Button::set_all_momentary(void) -{ - PACK_ADMIN_MESSAGE(vrpn_ALL_ID, vrpn_BUTTON_MOMENTARY); -} - -void vrpn_Button::set_all_toggle(vrpn_int32 default_state) -{ - PACK_ADMIN_MESSAGE(vrpn_ALL_ID, default_state); -} - -void vrpn_Button_Filter::set_all_toggle(vrpn_int32 default_state) -{ - for (vrpn_int32 i = 0; i < num_buttons; i++) { - if (buttonstate[i] == vrpn_BUTTON_MOMENTARY) { - buttonstate[i] = default_state; - if (send_alerts) { - PACK_ALERT_MESSAGE(i, default_state); - } - } - } -} - -void vrpn_Button::print(void) -{ - vrpn_int32 i; - printf("CurrButtons: "); - for (i = num_buttons - 1; i >= 0; i--) { - printf("%c", buttons[i] ? '1' : '0'); - } - printf("\n"); - - printf("LastButtons: "); - for (i = num_buttons - 1; i >= 0; i--) { - printf("%c", lastbuttons[i] ? '1' : '0'); - } - printf("\n"); -} - -/** Encode a message describing the new state of a button. - Assumes that there is enough room in the buffer to hold - the bytes from the message. Returns the number of bytes - sent. -*/ - -vrpn_int32 vrpn_Button::encode_to(char *buf, vrpn_int32 button, - vrpn_int32 state) -{ - char *bufptr = buf; - int buflen = 1000; - - // Message includes: vrpn_int32 buttonNum, vrpn_int32 state - vrpn_buffer(&bufptr, &buflen, button); - vrpn_buffer(&bufptr, &buflen, state); - - return 1000 - buflen; -} - -/** Encode a message describing the state of all buttons. - Assumes that there is enough room in the buffer to hold - the bytes from the message. Returns the number of bytes - sent. -*/ - -vrpn_int32 vrpn_Button::encode_states_to(char *buf) -{ - // Message includes: vrpn_int32 number_of_buttons, vrpn_int32 states - // Byte order of each needs to be reversed to match network standard - - vrpn_int32 int_btn = num_buttons; - int buflen = (vrpn_BUTTON_MAX_BUTTONS + 1) * sizeof(vrpn_int32); - - vrpn_buffer(&buf, &buflen, int_btn); - for (int i = 0; i < num_buttons; i++) { - vrpn_int32 state = buttons[i]; - vrpn_buffer(&buf, &buflen, state); - } - - return (num_buttons + 1) * sizeof(vrpn_int32); -} - -/** Encode a message describing the state of all buttons. - Assumes that there is enough room in the buffer to hold - the bytes from the message. Returns the number of bytes - sent. -*/ - -vrpn_int32 vrpn_Button_Filter::encode_states_to(char *buf) -{ - // Message includes: vrpn_int32 number_of_buttons, vrpn_int32 state - // Byte order of each needs to be reversed to match network standard - - vrpn_int32 int_btn = num_buttons; - int buflen = (vrpn_BUTTON_MAX_BUTTONS + 1) * sizeof(vrpn_int32); - - vrpn_buffer(&buf, &buflen, int_btn); - for (int i = 0; i < num_buttons; i++) { - vrpn_buffer(&buf, &buflen, buttonstate[i]); - } - - return (num_buttons + 1) * sizeof(vrpn_int32); -} - -static int VRPN_CALLBACK client_msg_handler(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Button_Filter *instance = (vrpn_Button_Filter *)userdata; - const char *bufptr = p.buffer; - vrpn_int32 event; - vrpn_int32 buttonid; - - vrpn_unbuffer(&bufptr, &buttonid); - vrpn_unbuffer(&bufptr, &event); - - if (event == vrpn_BUTTON_MOMENTARY) { - if (buttonid == vrpn_ALL_ID) - instance->set_all_momentary(); - else - instance->set_momentary(buttonid); - } - else if (event == vrpn_BUTTON_TOGGLE_OFF || - event == vrpn_BUTTON_TOGGLE_ON) { - if (buttonid == vrpn_ALL_ID) - instance->set_all_toggle(event); - else - instance->set_toggle(buttonid, event); - } - return 0; -} - -void vrpn_Button_Filter::report_changes(void) -{ - vrpn_int32 i; - - // vrpn_Button::report_changes(); - if (d_connection) { - for (i = 0; i < num_buttons; i++) { - switch (buttonstate[i]) { - case vrpn_BUTTON_MOMENTARY: - if (buttons[i] != lastbuttons[i]) PACK_MESSAGE(i, buttons[i]); - break; - case vrpn_BUTTON_TOGGLE_ON: - if (buttons[i] && !lastbuttons[i]) { - buttonstate[i] = vrpn_BUTTON_TOGGLE_OFF; - if (send_alerts) - PACK_ALERT_MESSAGE(i, vrpn_BUTTON_TOGGLE_OFF); - PACK_MESSAGE(i, 0); - } - break; - case vrpn_BUTTON_TOGGLE_OFF: - if (buttons[i] && !lastbuttons[i]) { - buttonstate[i] = vrpn_BUTTON_TOGGLE_ON; - if (send_alerts) - PACK_ALERT_MESSAGE(i, vrpn_BUTTON_TOGGLE_ON); - PACK_MESSAGE(i, 1); - } - break; - default: - fprintf(stderr, "vrpn_Button::report_changes(): Button %d in \ - invalid state (%d)\n", - i, buttonstate[i]); - } - lastbuttons[i] = buttons[i]; - } - } - else { - fprintf(stderr, "vrpn_Button: No valid connection\n"); - } -} - -void vrpn_Button::report_changes(void) -{ - vrpn_int32 i; - - if (d_connection) { - for (i = 0; i < num_buttons; i++) { - if (buttons[i] != lastbuttons[i]) PACK_MESSAGE(i, buttons[i]); - lastbuttons[i] = buttons[i]; - } - } - else { - fprintf(stderr, "vrpn_Button: No valid connection\n"); - } -} - -void vrpn_Button::report_states(void) -{ - // msgbuf must be int32-aligned! - vrpn_int32 ibuf[vrpn_BUTTON_MAX_BUTTONS + 1]; - char *msgbuf = (char *)ibuf; - - vrpn_int32 len; - - len = vrpn_Button::encode_states_to(msgbuf); - if (d_connection && - d_connection->pack_message(len, timestamp, states_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Button: cannot write states message: tossing\n"); - } -} - -#ifndef VRPN_CLIENT_ONLY - -vrpn_Button_Server::vrpn_Button_Server(const char *name, vrpn_Connection *c, - int numbuttons) - : vrpn_Button_Filter(name, c) -{ - if (numbuttons > vrpn_BUTTON_MAX_BUTTONS) { - num_buttons = vrpn_BUTTON_MAX_BUTTONS; - } - else { - num_buttons = numbuttons; - } -} - -int vrpn_Button_Server::number_of_buttons(void) { return num_buttons; } - -void vrpn_Button_Server::mainloop(void) -{ - server_mainloop(); - report_changes(); -} - -int vrpn_Button_Server::set_button(int button, int new_value) -{ - if ((button < 0) || (button >= num_buttons)) { - return -1; - } - - buttons[button] = (unsigned char)(new_value != 0); - - return 0; -} - -vrpn_Button_Example_Server::vrpn_Button_Example_Server(const char *name, - vrpn_Connection *c, - int numbuttons, - vrpn_float64 rate) - : vrpn_Button_Filter(name, c) -{ - if (numbuttons > vrpn_BUTTON_MAX_BUTTONS) { - num_buttons = vrpn_BUTTON_MAX_BUTTONS; - } - else { - num_buttons = numbuttons; - } - - _update_rate = rate; - - // IN A REAL SERVER, open the device that will service the buttons here -} - -void vrpn_Button_Example_Server::mainloop() -{ - struct timeval current_time; - int i; - - // Call the generic server mainloop, since we are a server - server_mainloop(); - - // See if its time to generate a new report (every 1 second). - // IN A REAL SERVER, this check would not be done; although the - // time of the report would be updated to the current time so - // that the correct timestamp would be issued on the report. - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, timestamp) >= - 1000000.0 / _update_rate) { - - // Update the time - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - // Update the values for the buttons, to say that each one has - // switched its state. - // THIS CODE WILL BE REPLACED by the user code that - // actually reads from the button devices and fills in buttons[] - // appropriately. - for (i = 0; i < num_buttons; i++) { - buttons[i] = !lastbuttons[i]; - } - - // Send reports. Stays the same in a real server. - report_changes(); - } -} - -// changed to take raw port hex address -vrpn_Button_Parallel::vrpn_Button_Parallel(const char *name, vrpn_Connection *c, - int portno, unsigned porthex) - : vrpn_Button_Filter(name, c) -{ -#ifdef linux - const char *portname; - switch (portno) { - case 1: - portname = "/dev/lp0"; - break; - case 2: - portname = "/dev/lp1"; - break; - case 3: - portname = "/dev/lp2"; - break; - default: - fprintf(stderr, "vrpn_Button_Parallel: " - "Bad port number (%x) for Linux lp#\n", - portno); - status = BUTTON_FAIL; - portname = "UNKNOWN"; - break; - } - - // Open the port - if ((port = open(portname, O_RDWR)) < 0) { - perror("vrpn_Button_Parallel::vrpn_Button_Parallel(): " - "Can't open port"); - fprintf(stderr, "vrpn_Button_Parallel::vrpn_Button_Parallel(): " - "Can't open port %s\n", - portname); - status = BUTTON_FAIL; - return; - } -#elif _WIN32 - // if on NT we need a device driver to do direct reads - // from the parallel port - if (!openGiveIO()) { - fprintf(stderr, "vrpn_Button: need giveio driver for port access!\n"); - fprintf(stderr, "vrpn_Button: can't use vrpn_Button()\n"); - status = BUTTON_FAIL; - return; - } - if (porthex != 0) // using direct hex port address - port = porthex; - else { // using old style port 1, 2, or 3 - switch (portno) { - // we use this mapping, although LPT? can actually - // have different addresses. - case 1: - port = 0x378; - break; // usually LPT1 - case 2: - port = 0x3bc; - break; // usually LPT2 - case 3: - port = 0x278; - break; // usually LPT3 - default: - fprintf(stderr, "vrpn_Button_Parallel: Bad port number (%d)\n", - portno); - status = BUTTON_FAIL; - break; - } - } - fprintf(stderr, "vrpn_Button_Parallel: Using port %x\n", port); -#else // _WIN32 - fprintf(stderr, "vrpn_Button_Parallel: not supported on this platform\n?"); - status = BUTTON_FAIL; - portno = portno; // unused argument - return; -#endif - -#if defined(linux) || defined(_WIN32) -// Set the INIT line on the device to provide power to the python -// update: don't need this for builtin LPT1 on DELLs, but do need it -// for warp9 PCI parallel port. Added next lines. BCE Nov07.00 -// Setting Bit 1 high also for a specific HiBall system -// requirement (IR blocking device on same port) -// - BCE 08 July 03 - -#ifdef _outp - const unsigned short DATA_REGISTER_OFFSET = 0; - _outp((unsigned short)(port + DATA_REGISTER_OFFSET), 3); -#else - fprintf(stderr, "vrpn_Button_Parallel: Not setting bit 0 on Linux, may not " - "work with all ports\n"); -#endif - - // Zero the button states - num_buttons = 5; // XXX This is specific to the python - for (vrpn_int32 i = 0; i < num_buttons; i++) { - buttons[i] = lastbuttons[i] = 0; - } - - status = BUTTON_READY; - vrpn_gettimeofday(×tamp, NULL); -#endif -} - -vrpn_Button_Parallel::~vrpn_Button_Parallel() -{ -#ifdef linux - if (port >= 0) { - close(port); - } -#endif -} - -vrpn_Button_Python::vrpn_Button_Python(const char *name, vrpn_Connection *c, - int p) - : vrpn_Button_Parallel(name, c, p) - , d_first_fail(true) -{ -} - -vrpn_Button_Python::vrpn_Button_Python(const char *name, vrpn_Connection *c, - int p, unsigned ph) - : vrpn_Button_Parallel(name, c, p, ph) - , d_first_fail(true) -{ -} - -void vrpn_Button_Python::mainloop() -{ - // Call the generic server mainloop, since we are a server - server_mainloop(); - - switch (status) { - case BUTTON_READY: - read(); - report_changes(); - break; - case BUTTON_FAIL: - if (d_first_fail) { - d_first_fail = false; - fprintf(stderr, "vrpn_Button_Python failure!\n"); - send_text_message("Failure", timestamp, vrpn_TEXT_ERROR); - } - break; - } -} - -// Fill in the buttons[] array with the current value of each of the -// buttons. Debounce the buttons (make sure that they have had the -// same value for the past several times to debounce noise). -void vrpn_Button_Python::read(void) -{ - int i; - const int debounce_count = 30; - int status_register[debounce_count]; - - // Make sure we're ready to read - if (status != BUTTON_READY) { - return; - } - -// Read from the status register, read 3 times to debounce noise. -#ifdef linux - for (i = 0; i < debounce_count; i++) - if (ioctl(port, LPGETSTATUS, &status_register[i]) == -1) { - perror("vrpn_Button_Python::read(): ioctl() failed"); - return; - } - -#elif _WIN32 -#ifndef __CYGWIN__ - const unsigned short STATUS_REGISTER_OFFSET = 1; - for (i = 0; i < debounce_count; i++) { -#ifdef _inp - status_register[i] = - _inp((unsigned short)(port + STATUS_REGISTER_OFFSET)); -#else - status_register[i] = 0; -#endif - } -#else - for (i = 0; i < debounce_count; i++) { - status_register[i] = 0; - } -#endif -#else - for (i = 0; i < debounce_count; i++) { - status_register[i] = 0; - } -#endif - for (i = 0; i < debounce_count; i++) { - status_register[i] = status_register[i] & BIT_MASK; - } - - // Make sure they are all the same; if not, return and assume that - // we are still debouncing. - for (i = 1; i < debounce_count; i++) { - if (status_register[0] != status_register[i]) { - return; - } - } - - // Assign values to the bits based on the control signals - buttons[0] = ((status_register[0] & PORT_SLCT) == 0); - buttons[1] = ((status_register[0] & PORT_BUSY) != 0); - buttons[2] = ((status_register[0] & PORT_PE) == 0); - buttons[3] = ((status_register[0] & PORT_ERROR) == 0); - buttons[4] = ((status_register[0] & PORT_ACK) == 0); - - vrpn_gettimeofday(×tamp, NULL); -} - -vrpn_Button_Serial::vrpn_Button_Serial(const char *name, vrpn_Connection *c, - const char *port, long baud) - : vrpn_Button_Filter(name, c) -{ - // port name and baud rate - if (port == NULL) { - fprintf(stderr, "vrpn_Button_Serial: NULL port name\n"); - status = BUTTON_FAIL; - return; - } - else { - strncpy(portname, port, sizeof(portname)); - portname[sizeof(portname) - 1] = '\0'; - } - baudrate = baud; - - // Open the serial port - if ((serial_fd = vrpn_open_commport(portname, baudrate)) == -1) { - fprintf(stderr, "vrpn_Button_Serial: Cannot Open serial port\n"); - status = BUTTON_FAIL; - } - - // Reset the tracker and find out what time it is - status = BUTTON_READY; - vrpn_gettimeofday(×tamp, NULL); -} - -vrpn_Button_Serial::~vrpn_Button_Serial() { vrpn_close_commport(serial_fd); } - -// init pinch glove to send hand data only -vrpn_Button_PinchGlove::vrpn_Button_PinchGlove(const char *name, - vrpn_Connection *c, - const char *port, long baud) - : vrpn_Button_Serial(name, c, port, baud) - , reported_failure(false) -{ - num_buttons = 10; // 0-4: right, 5-9: left starting from thumb - status = BUTTON_READY; - - // check if the number of buttons is not more than max allowed. - if (num_buttons > vrpn_BUTTON_MAX_BUTTONS) { - fprintf(stderr, - "vrpn_Button_PinchGlove: Too many buttons. The limit is "); - fprintf(stderr, "%i but this device has %i.\n", vrpn_BUTTON_MAX_BUTTONS, - num_buttons); - status = BUTTON_FAIL; - } - - // set glove to report with no timestamp - report_no_timestamp(); - - // initialize the buttons - for (vrpn_int32 i = 0; i < num_buttons; i++) - buttons[i] = lastbuttons[i] = VRPN_BUTTON_OFF; - - // Reset the tracker and find out what time it is - vrpn_gettimeofday(×tamp, NULL); -} - -void vrpn_Button_PinchGlove::mainloop() -{ - // Call the generic server mainloop, since we are a server - server_mainloop(); - - switch (status) { - case BUTTON_READY: - read(); - report_changes(); - break; - case BUTTON_FAIL: { - if (!reported_failure) { - reported_failure = true; - fprintf(stderr, "vrpn_Button_PinchGlove failure!\n"); - } - } break; - } - return; -} - -// Pinch glove should only report hand data(see contructor). If the message has -// time stamp data change the the message type by sending command to just send -// hand data. Any other kind of message is ignored and the buffer is read until -// end of message byte(PG_END_BYTE) is reached. -void vrpn_Button_PinchGlove::read() -{ - // check if button is ready - if (status != BUTTON_READY) return; - - // check if there is something to read - if (vrpn_read_available_characters(serial_fd, buffer, 1) != 1) return; - - // This while loop is to keep reading messages until its empty. - while (buffer[0] != PG_END_BYTE) { - // switch according to its message start byte - if (buffer[0] == PG_START_BYTE_DATA) { - // reset button state - for (vrpn_int32 i = 0; i < num_buttons; i++) - buttons[i] = VRPN_BUTTON_OFF; - - // read next message - bufcount = vrpn_read_available_characters(serial_fd, buffer, 2); - - // read until end of message - while (buffer[0] != PG_END_BYTE) { - - // if only one byte read, read the left hand byte - while (bufcount != 2) - bufcount += vrpn_read_available_characters(serial_fd, - buffer + 1, 1); - - unsigned char mask = 0x10; - // set button states - for (int j = 0; j < 5; j++, mask = (unsigned char)(mask >> 1)) { - if (mask & buffer[1]) { // right hand - buttons[j] = VRPN_BUTTON_ON; - } - if (mask & buffer[0]) { // left hand - buttons[j + 5] = VRPN_BUTTON_ON; - } - } - - // read next bytes - bufcount = vrpn_read_available_characters(serial_fd, buffer, 2); - } // while (buffer[0] != PG_END_BYTE) - // if there is another message read it - if (bufcount != 1) buffer[0] = buffer[1]; - } // if (buffer[0] == PG_START_BYTE_DATA) { - else if (buffer[0] == PG_START_BYTE_DATA_TIME) { - send_text_message( - "vrpn_Button_PinchGlove message start byte: time stamped byte!", - timestamp, vrpn_TEXT_ERROR); - report_no_timestamp(); - } - else { // ignore any other type of messages: empty butter till - // PG_END_BYTE - // clear messages - while (buffer[0] != PG_END_BYTE) - vrpn_read_available_characters(serial_fd, buffer, 1); - send_text_message("vrpn_Button_PinchGlove wrong message start byte", - timestamp, vrpn_TEXT_ERROR); - } // else - } // while (buffer[0] != PG_END_BYTE ) - - vrpn_gettimeofday(×tamp, NULL); - return; -} - -// set the glove to report data without timestamp -void vrpn_Button_PinchGlove::report_no_timestamp() -{ - struct timeval timeout = { - 0, 30000}; // time_out for response from glove: 30 msec - struct timeval timeout_to_pass; - - // read until correct reply is received - do { - vrpn_flush_input_buffer(serial_fd); - vrpn_write_characters(serial_fd, (unsigned char *)"T0", 2); - vrpn_drain_output_buffer(serial_fd); - timeout_to_pass.tv_sec = timeout.tv_sec; - timeout_to_pass.tv_usec = timeout.tv_usec; - bufcount = vrpn_read_available_characters(serial_fd, buffer, 3, - &timeout_to_pass); - } while ((bufcount != 3) || (buffer[1] != '0') || - (buffer[2] != PG_END_BYTE)); - - return; -} - -#endif // VRPN_CLIENT_ONLY - -vrpn_Button_Remote::vrpn_Button_Remote(const char *name, vrpn_Connection *cn) - : vrpn_Button(name, cn) -{ - vrpn_int32 i; - - // Register a handler for the change callback from this device, - // if we got a connection. - if (d_connection != NULL) { - if (register_autodeleted_handler( - change_message_id, handle_change_message, this, d_sender_id)) { - fprintf(stderr, - "vrpn_Button_Remote: can't register change handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler( - states_message_id, handle_states_message, this, d_sender_id)) { - fprintf(stderr, - "vrpn_Button_Remote: can't register states handler\n"); - d_connection = NULL; - } - } - else { - fprintf(stderr, "vrpn_Button_Remote: Can't get connection!\n"); - } - - // Fill in all possible buttons with off. The number of buttons - // will be overwritten when the states message comes in from the - // server. - num_buttons = vrpn_BUTTON_MAX_BUTTONS; - for (i = 0; i < num_buttons; i++) { - buttons[i] = lastbuttons[i] = 0; - } - vrpn_gettimeofday(×tamp, NULL); -} - -// virtual -vrpn_Button_Remote::~vrpn_Button_Remote(void) {} - -void vrpn_Button_Remote::mainloop() -{ - if (d_connection) { - d_connection->mainloop(); - } - client_mainloop(); -} - -int vrpn_Button_Remote::handle_change_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Button_Remote *me = (vrpn_Button_Remote *)userdata; - const char *bufptr = p.buffer; - vrpn_BUTTONCB bp; - - // Fill in the parameters to the button from the message - if (p.payload_len != 2 * sizeof(vrpn_int32)) { - fprintf(stderr, "vrpn_Button: change message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", p.payload_len, - static_cast<unsigned long>(2 * sizeof(vrpn_int32))); - return -1; - } - bp.msg_time = p.msg_time; - vrpn_unbuffer(&bufptr, &bp.button); - vrpn_unbuffer(&bufptr, &bp.state); - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->d_callback_list.call_handlers(bp); - - return 0; -} - -int vrpn_Button_Remote::handle_states_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_int32 numbuttons; //< Number of buttons - vrpn_Button_Remote *me = (vrpn_Button_Remote *)userdata; - vrpn_BUTTONSTATESCB cp; - - cp.msg_time = p.msg_time; - vrpn_unbuffer(&bufptr, &numbuttons); - cp.num_buttons = numbuttons; - me->num_buttons = cp.num_buttons; - for (vrpn_int32 i = 0; i < cp.num_buttons; i++) { - vrpn_unbuffer(&bufptr, &cp.states[i]); - } - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->d_states_callback_list.call_handlers(cp); - - return 0; -} - -// We use _inp (inport) to read the parallel port status register -// since we haven't found a way to do it through the Win32 API. -// On NT we need a special device driver (giveio) to be installed -// so that we can get permission to execute _inp. On Win95 we -// don't need to do anything. -// -// The giveio driver is from the May 1996 issue of Dr. Dobb's, -// an article by Dale Roberts called "Direct Port I/O and Windows NT" -// -// This function returns 1 if either running Win95 or running NT and -// the giveio device was opened. 0 if device not opened. -#ifndef VRPN_CLIENT_ONLY -#ifdef _WIN32 -int vrpn_Button_Parallel::openGiveIO(void) -{ - OSVERSIONINFO osvi; - - memset(&osvi, 0, sizeof(OSVERSIONINFO)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&osvi); - - // if Win95: no initialization required - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { - return 1; - } - - // else if NT: use giveio driver - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { - HANDLE h = CreateFile("\\\\.\\giveio", GENERIC_READ, 0, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (h == INVALID_HANDLE_VALUE) { - // maybe driver not installed? - return 0; - } - CloseHandle(h); - // giveio opened successfully - return 1; - } - - // else GetVersionEx gave unexpected result - fprintf(stderr, - "vrpn_Button_Parallel::openGiveIO: unknown windows version\n"); - return 0; -} -#endif // _WIN32 -#endif // VRPN_CLIENT_ONLY diff --git a/src/vrpn/vrpn_Button.h b/src/vrpn/vrpn_Button.h deleted file mode 100644 index 65d1d1a5e621c8a3626147b9edafba8b1810beeb..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Button.h +++ /dev/null @@ -1,296 +0,0 @@ -#ifndef VRPN_BUTTON_H -#include <stddef.h> // for NULL - -#include "vrpn_BaseClass.h" // for vrpn_Callback_List, etc -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_int32, vrpn_float64, etc - -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -const int vrpn_BUTTON_MAX_BUTTONS = 256; -const int VRPN_BUTTON_BUF_SIZE = 256; - -// Base class for buttons. Definition -// of remote button class for the user is at the end. - -const int vrpn_BUTTON_MOMENTARY = 10; -const int vrpn_BUTTON_TOGGLE_OFF = 20; -const int vrpn_BUTTON_TOGGLE_ON = 21; -const int vrpn_BUTTON_LIGHT_OFF = 30; -const int vrpn_BUTTON_LIGHT_ON = 31; -const int vrpn_ALL_ID = -99; - -/** This is the base class for both the client and server for a button - device (a device with one or more boolean switches). Any server - should actually derive from the vrpn_Button_Filter class, described - next, which enables toggling any of the buttons. **/ - -class VRPN_API vrpn_Button : public vrpn_BaseClass { -public: - vrpn_Button(const char *name, vrpn_Connection *c = NULL); - virtual ~vrpn_Button(void); - - // Print the status of the button - void print(void); - - virtual void set_momentary(vrpn_int32 which_button); - virtual void set_toggle(vrpn_int32 which_button, vrpn_int32 current_state); - virtual void set_all_momentary(void); - virtual void set_all_toggle(vrpn_int32 default_state); - -protected: - unsigned char buttons[vrpn_BUTTON_MAX_BUTTONS]; - unsigned char lastbuttons[vrpn_BUTTON_MAX_BUTTONS]; - vrpn_int32 minrate[vrpn_BUTTON_MAX_BUTTONS]; - vrpn_int32 num_buttons; - struct timeval timestamp; - vrpn_int32 change_message_id; // ID of change button message to connection - vrpn_int32 states_message_id; // ID of button-states message to connection - vrpn_int32 admin_message_id; // ID of admin button message to connection - - virtual int register_types(void); - virtual void report_changes(void); - virtual void report_states(void); // Calls Button or Button_Filter encode - virtual vrpn_int32 encode_to(char *buf, vrpn_int32 button, - vrpn_int32 state); - virtual vrpn_int32 encode_states_to(char *buf); -}; - -/** All button servers should derive from this class, which provides - the ability to turn any of the buttons into toggles (using messages - from the remote button object). **/ - -class VRPN_API vrpn_Button_Filter : public vrpn_Button { -public: - vrpn_int32 buttonstate[vrpn_BUTTON_MAX_BUTTONS]; - virtual void set_momentary(vrpn_int32 which_button); - virtual void set_toggle(vrpn_int32 which_button, vrpn_int32 current_state); - virtual void set_all_momentary(void); - virtual void set_all_toggle(vrpn_int32 default_state); - void set_alerts(vrpn_int32); - -protected: - int send_alerts; - vrpn_Button_Filter(const char *, vrpn_Connection *c = NULL); - vrpn_int32 - alert_message_id; // used to send back to alert button box for lights - virtual vrpn_int32 encode_states_to(char *buf); - virtual void report_changes(void); - - // This method makes sure we send a states message whenever we get a ping - // from - // a client object or a new connection. - static int VRPN_CALLBACK - handle_ping_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -#ifndef VRPN_CLIENT_ONLY - -// Button server that lets you set the values for the buttons directly and -// then have it update if needed. This class should be used by devices that -// can have several sets of buttons in them and don't want to derive from the -// Button class themselves. An example is the InterSense 900 features found in -// the Fastrak server (which may have several button devices, one for each -// sensor). - -class VRPN_API vrpn_Button_Server : public vrpn_Button_Filter { -public: - vrpn_Button_Server(const char *name, vrpn_Connection *c, - int numbuttons = 1); - - /// Tells how many buttons there are (may be clipped to MAX_BUTTONS) - int number_of_buttons(void); - - /// Called once each time through the server program's mainloop to handle - /// various functions (like setting toggles, reporting changes, etc). - virtual void mainloop(); - - /// Allows the server program to set current button states (to 0 or 1) - int set_button(int button, int new_value); -}; - -// Example button server code. This button device causes its buttons to -// be pressed and released at the interval specified (default 1/sec). It -// has the specified number of buttons (default 1). -// This class is derived from the vrpn_Button_Filter class, so that it -// can be made to toggle its buttons using messages from the client. - -class VRPN_API vrpn_Button_Example_Server : public vrpn_Button_Filter { -public: - vrpn_Button_Example_Server(const char *name, vrpn_Connection *c, - int numbuttons = 1, vrpn_float64 rate = 1.0); - - virtual void mainloop(); - -protected: - vrpn_float64 _update_rate; // How often to toggle -}; - -// Button device that is connected to a parallel port and uses the -// status bits to read from the buttons. There can be up to 5 buttons -// read this way. -class VRPN_API vrpn_Button_Parallel : public vrpn_Button_Filter { -public: - // Open a button connected to the local machine, talk to the - // outside world through the connection. - vrpn_Button_Parallel(const char *name, vrpn_Connection *connection, - int portno, unsigned porthex = 0); - ~vrpn_Button_Parallel(); - -protected: - int port; - int status; - - virtual void read(void) = 0; -#ifdef _WIN32 - int openGiveIO(void); -#endif // _WIN32 -}; - -// Open a Python (or Hiball Button) that is connected to a parallel port. -// See www.vrpn.org/UNC_python.html for a description of how to make -// a connector that uses the parallel port this way. Note that this -// use of a parallel port can result in damage to the motherboard if -// voltage spikes (static) are passed through if care is not taken. -// This interface is intended for use at UNC. No warranty is expressed -// or implied for use elsewhere (use at your own risk). -class VRPN_API vrpn_Button_Python : public vrpn_Button_Parallel { -public: - vrpn_Button_Python(const char *name, vrpn_Connection *c, int p); - vrpn_Button_Python(const char *name, vrpn_Connection *c, int p, - unsigned ph); - - virtual void mainloop(); - -protected: - virtual void read(void); - bool d_first_fail; -}; - -// Button device that is connected to the serial port. -class VRPN_API vrpn_Button_Serial : public vrpn_Button_Filter { -public: - vrpn_Button_Serial(const char *name, vrpn_Connection *c, - const char *port = "/dev/ttyS1/", long baud = 38400); - virtual ~vrpn_Button_Serial(); - -protected: - char portname[VRPN_BUTTON_BUF_SIZE]; - long baudrate; - int serial_fd; - int status; - - unsigned char - buffer[VRPN_BUTTON_BUF_SIZE]; // char read from the button so far - vrpn_uint32 bufcount; // number of char in the buffer - - virtual void read() = 0; -}; - -// Open a Fakespace Pinch Glove System that is connected to a serial port. There -// are total of 10 buttons. Buttons 0-4 are fingers for the right hand-thumb -// first and pinkie last-while buttons 5-9 are for the left hand-thumb first. -// The report you get back is the finger is touching. So you will not have a -// state where only one button is ON. -class VRPN_API vrpn_Button_PinchGlove : public vrpn_Button_Serial { -public: - vrpn_Button_PinchGlove(const char *name, vrpn_Connection *c, - const char *port = "/dev/ttyS1/", long baud = 38400); - - virtual void mainloop(); - -protected: - bool reported_failure; - virtual void read(); - void - report_no_timestamp(); // set the glove to report data without timestamp -}; - -#endif // VRPN_CLIENT_ONLY - -//---------------------------------------------------------- -//************** Users deal with the following ************* - -// User routine to handle a change in button state. This is called when -// the button callback is called (when a message from its counterpart -// across the connection arrives). The pinch glove has 5 different states of on -// since it knows which fingers are touching. This pinch glove behavior is -// non-standard and will be removed in a future version. Button states should -// be considered like booleans. -#define VRPN_BUTTON_OFF (0) -#define VRPN_BUTTON_ON (1) - -typedef struct _vrpn_BUTTONCB { - struct timeval msg_time; // Time of button press/release - vrpn_int32 button; // Which button (numbered from zero) - vrpn_int32 state; // button state (0 = off, 1 = on) -} vrpn_BUTTONCB; -typedef void(VRPN_CALLBACK *vrpn_BUTTONCHANGEHANDLER)(void *userdata, - const vrpn_BUTTONCB info); - -// This is a new button callback type that was added in VRPN 7.31. It -// tells the current state of all of the buttons on the device. It is -// called whenever a button server receives a new connection request. It -// is intended to deal with the issue of not knowing what state toggled -// buttons are in when a client connects. -typedef struct _vrpn_BUTTONSTATECB { - struct timeval msg_time; // Timestamp of analog data - vrpn_int32 num_buttons; // how many buttons - vrpn_int32 states[vrpn_BUTTON_MAX_BUTTONS]; // button state values -} vrpn_BUTTONSTATESCB; -typedef void(VRPN_CALLBACK *vrpn_BUTTONSTATESHANDLER)( - void *userdata, const vrpn_BUTTONSTATESCB info); - -// Open a button that is on the other end of a connection -// and handle updates from it. This is the type of button that user code will -// deal with. - -class VRPN_API vrpn_Button_Remote : public vrpn_Button { -public: - // The name of the button device to connect to. Optional second - // argument is used when you already have an open connection you - // want it to listen on. - vrpn_Button_Remote(const char *name, vrpn_Connection *cn = NULL); - virtual ~vrpn_Button_Remote(void); - - // This routine calls the mainloop of the connection it's on - virtual void mainloop(); - - // (un)Register a callback handler to handle a button state change - virtual int register_change_handler(void *userdata, - vrpn_BUTTONCHANGEHANDLER handler) - { - return d_callback_list.register_handler(userdata, handler); - }; - virtual int unregister_change_handler(void *userdata, - vrpn_BUTTONCHANGEHANDLER handler) - { - return d_callback_list.unregister_handler(userdata, handler); - } - - // (un)Register a callback handler to handle buttons states reports - virtual int register_states_handler(void *userdata, - vrpn_BUTTONSTATESHANDLER handler) - { - return d_states_callback_list.register_handler(userdata, handler); - }; - virtual int unregister_states_handler(void *userdata, - vrpn_BUTTONSTATESHANDLER handler) - { - return d_states_callback_list.unregister_handler(userdata, handler); - } - -protected: - vrpn_Callback_List<vrpn_BUTTONCB> d_callback_list; - static int VRPN_CALLBACK - handle_change_message(void *userdata, vrpn_HANDLERPARAM p); - - vrpn_Callback_List<vrpn_BUTTONSTATESCB> d_states_callback_list; - static int VRPN_CALLBACK - handle_states_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -#define VRPN_BUTTON_H -#endif diff --git a/src/vrpn/vrpn_Button_NI_DIO24.C b/src/vrpn/vrpn_Button_NI_DIO24.C deleted file mode 100644 index cf3bedef54e6ab0ebe19d18c4b78cb98126f7542..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Button_NI_DIO24.C +++ /dev/null @@ -1,205 +0,0 @@ -// vrpn_Button_NI_DIO24.C -// -// This is a driver for National Instruments DAQCard -// DIO-24, a PCMCIA card, which provides 24-bit digital I/O. -// The I/O is accessed in 3 "ports" with 8 bits per port, -// though the user is protected from that detail. The -// user of this class need only request inputs 1 through 24. -// -// Unlike the other National Instrument devices currently -// in vrpn, this uses their new "mx" library. To access -// that library, install their software from the NI-DAQmx -// CD. Then uncomment the following line in vrpn_configure.h: -// #define VRPN_USE_NATIONAL_INSTRUMENTS_MX -// -// Note that because the 3rd party library is used, this class -// will only work under Windows. -// -// You must also include the following in your compilers include -// path for the 'vrpn' and 'vrpn_server' projects: -// $(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C DEV\include -// -// Finally, the following must be included in vrpn.cfg to use -// the generic server: -// -// ################################################################################ -// # This is a driver for National Instruments DAQCard- -// # DIO-24, a PCMCIA card, which provides 24-bit digital I/O. -// # -// # Arguments: -// # char name_of_this_device[] -// # int number_of_channls to read: 1-24 (optional. default=24) -// -// vrpn_Button_NI_DIO24 Button0 1 -// -// This code was written in October 2006 by Bill West, based on some example -// code provided by National Instruments. - -#include "vrpn_Button_NI_DIO24.h" - -class VRPN_API vrpn_Connection; -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX -extern "C" { -#include <NIDAQmx.h> -} -#else -typedef vrpn_int32 int32; -#endif -#include <stdio.h> // for fprintf, sprintf, stderr, etc - -// Constants used by this class -const vrpn_int32 vrpn_Button_NI_DIO24::vrpn_Button_NI_DIO24_CHANNEL_MAX = - (24<vrpn_BUTTON_MAX_BUTTONS) ? 24 : vrpn_BUTTON_MAX_BUTTONS ; // pick the least - -vrpn_Button_NI_DIO24::vrpn_Button_NI_DIO24 (const char * name, - vrpn_Connection * c, - vrpn_int32 numChannels) : -vrpn_Button_Filter (name, c) -{ - char portName[127] ; - - this->setNumChannels( numChannels ); - - // Check if we got a connection. - if (d_connection == NULL) { - fprintf(stderr,"vrpn_Button_NI_DIO24: Can't get connection!\n"); - } - - // Initialize the task handles -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX - _taskHandle = 0 ; -#else - fprintf(stderr,"vrpn_Button_NI_DIO24::vrpn_Button_NI_DIO24(): Not compiled into VRPN, edit vrpn_Configure.h and define VRPN_USE_NATIONAL_INSTRUMENTS_MX and then recompile VRPN.\n"); -#endif - - // Initialize the DAQCard-DIO-24 for each of the ports used - // Define various names the library needs - sprintf(portName,"Dev1/line0:%d", num_buttons-1) ; - - /*********************************************/ - // DAQmx Configure Code - /*********************************************/ -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX - int32 error=0; - error = DAQmxCreateTask(d_servicename,&_taskHandle); - - if (!error) - error = DAQmxCreateDIChan(_taskHandle,portName,"",DAQmx_Val_ChanForAllLines); -#endif - -/* The following code *should* make the 0's into 1's, and vice versa, but it only works - * for one channel, and even then, it causes the 1's (button pressed) to "flicker" 1-0-1. - * National Instruments can't explain it. Furthermore, if you try to set this property - * for all inputs, it errors out. - * - * if (!error) - * error = DAQmxSetDIInvertLines(_taskHandle, portName, true) ; - */ - - /*********************************************/ - // DAQmx Start Code - /*********************************************/ -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX - if (!error) - error = DAQmxStartTask(_taskHandle); - - // If error, report it and exit - if (error) - reportError(error, vrpn_true) ; -#endif - -} // constructor - -// This destructor closes out the SEI bus, and deallocates memory -vrpn_Button_NI_DIO24::~vrpn_Button_NI_DIO24() -{ -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX - if( _taskHandle!=0 ) - { - /*********************************************/ - // DAQmx Stop Code - /*********************************************/ - DAQmxStopTask(_taskHandle); - DAQmxClearTask(_taskHandle); - _taskHandle = 0 ; - } -#endif -} // destructor - -/** This routine is called each time through the server's main loop. It will - take a course of action depending on the current status of the device, - either trying to reset it or trying to get a reading from it. It will - try to reset the device if no data has come from it for a couple of - seconds -*/ - -void vrpn_Button_NI_DIO24::mainloop() -{ - - server_mainloop(); // let the server do its stuff - - // Read the data from the available ports - /*********************************************/ - // DAQmx Read Code - /*********************************************/ -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX - int32 error ; - int32 bytesRead,bytesPerSamp; - error = DAQmxReadDigitalLines(_taskHandle,1,5.0,DAQmx_Val_GroupByChannel, - buttons, vrpn_BUTTON_MAX_BUTTONS, - &bytesPerSamp,&bytesRead,NULL); - - // check for obvious errors - if (bytesRead < num_buttons) - fprintf(stderr, - "vrpn_Button_NI_DIO24: Warning, number of bytes read was %d, not %d as expected.\n", - bytesRead, num_buttons) ; - // If other error, report it and sleep - if (error) - reportError(error, vrpn_false) ; -#endif - - // Finally, the point of all this, deliver the data - report_changes() ; - -} // mainloop - -vrpn_int32 vrpn_Button_NI_DIO24::setNumChannels (vrpn_int32 sizeRequested) -{ - // Set the number of buttons we have to read - // If the number is invalid, default to the maximum - if (sizeRequested<1 || sizeRequested > vrpn_Button_NI_DIO24::vrpn_Button_NI_DIO24_CHANNEL_MAX) - num_buttons = vrpn_Button_NI_DIO24::vrpn_Button_NI_DIO24_CHANNEL_MAX; - else - num_buttons = sizeRequested; - - this->set_all_momentary() ; // as the default case anyway - - return num_buttons; - -} // setNumChannels - -// This handles error reporting -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX -void vrpn_Button_NI_DIO24::reportError(int32 errnumber, vrpn_bool exitProgram) -{ - char errBuff[2048]={'\0'}; - - if( DAQmxFailed(errnumber) ) - { - DAQmxGetExtendedErrorInfo(errBuff,2048); - printf("DAQmx Error: %s\n",errBuff); - if (exitProgram==vrpn_true) - { - printf("Exiting...\n") ; - throw(errnumber) ; // this will quit, cause the destructor to be called - } - else - { - printf("Sleeping...\n") ; - vrpn_SleepMsecs(1000.0*1) ; // so at least the log will slow down so someone can see the error - } - } -} // reportError -#endif - diff --git a/src/vrpn/vrpn_Button_NI_DIO24.h b/src/vrpn/vrpn_Button_NI_DIO24.h deleted file mode 100644 index bf7aa0ae6ea1cca3020a357021205994f2741119..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Button_NI_DIO24.h +++ /dev/null @@ -1,84 +0,0 @@ -// vrpn_Button_NI_DIO24.h -// -// This is a driver for National Instruments DAQCard -// DIO-24, a PCMCIA card, which provides 24-bit digital I/O. -// The I/O is accessed in 3 "ports" with 8 bits per port, -// though the user is protected from that detail. The -// user of this class need only request inputs 1 through 24. -// -// Unlike the other National Instrument devices currently -// in vrpn, this uses their new "mx" library. To access -// that library, install their software from the NI-DAQmx -// CD. Then uncomment the following line in vrpn_configure.h: -// #define VRPN_USE_NATIONAL_INSTRUMENTS_MX -// -// Note that because the 3rd party library is used, this class -// will only work under Windows. -// -// You must also include the following in your compilers include -// path for the 'vrpn' and 'vrpn_server' projects: -// $(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C DEV\include -// -// Finally, the following must be included in vrpn.cfg to use -// the generic server: -// -// ################################################################################ -// # This is a driver for National Instruments DAQCard- -// # DIO-24, a PCMCIA card, which provides 24-bit digital I/O. -// # -// # Arguments: -// # char name_of_this_device[] -// # int number_of_channls to read: 1-24 (optional. default=24) -// -// vrpn_Button_NI_DIO24 Button0 1 -// -// This code was written in October 2006 by Bill West, based on some example -// code provided by National Instruments. - -#ifndef VRPN_BUTTON_NI_DIO24_H -#define VRPN_BUTTON_NI_DIO24_H - -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Types.h" // for vrpn_int32 - -class VRPN_API vrpn_Connection; -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX -#include <NIDAQmx.h> -#endif - -class VRPN_API vrpn_Button_NI_DIO24 : public vrpn_Button_Filter { - - public: - - // Public constant used by this class - static const vrpn_int32 vrpn_Button_NI_DIO24_CHANNEL_MAX ; - - // Constructor - vrpn_Button_NI_DIO24 (const char * name, vrpn_Connection * c, - vrpn_int32 numChannels=vrpn_Button_NI_DIO24_CHANNEL_MAX) ; - - // Destructor - virtual ~vrpn_Button_NI_DIO24() ; - - // Here's where the buttons are actually read - virtual void mainloop () ; - - private: - // Addresses of the devices -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX - TaskHandle _taskHandle ; -#endif - - /// Sets the number of channels and ports, clamped to maximums if needed. - /// This should be used before mainloop is ever called. - vrpn_int32 setNumChannels (vrpn_int32 sizeRequested); - - // THis handles error reporting, and halts the - // program if the error is irrecoverable -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX - void reportError(int32 errnumber, vrpn_bool exitProgram) ; -#endif // def(_WIN32) || def(WIN32) -}; - -#endif // VRPN_BUTTON_NI_DIO24_H diff --git a/src/vrpn/vrpn_Button_USB.cpp b/src/vrpn/vrpn_Button_USB.cpp deleted file mode 100644 index 181ae2b2a234e057908c7bb8b18cf5ea6c95ed7d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Button_USB.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include "vrpn_Button_USB.h" -#ifdef _WIN32 - -vrpn_Button_USB::vrpn_Button_USB(const char *name, const char *deviceName,vrpn_Connection *c) - : vrpn_Button_Filter(name, c) -{ - num_buttons = 16; - //setup of usb device - m_hDevice = INVALID_HANDLE_VALUE; - if ( m_hDevice != INVALID_HANDLE_VALUE ) - { - fprintf(stderr, "USB device has already been opened." ); - return; - } - - //--- define the device code - char PortName[20]; - strcpy( PortName, "\\\\.\\" ); - strcat( PortName, deviceName ); - - //--- open the serial port - m_hDevice = CreateFile( PortName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL ); - - if ( m_hDevice == INVALID_HANDLE_VALUE ) - { - fprintf(stderr, "Could not open USB device." ); - return; - } - - return; -} - -vrpn_Button_USB::~vrpn_Button_USB(void) -{ - if ( m_hDevice != INVALID_HANDLE_VALUE ) - CloseHandle( m_hDevice ); -} - -void vrpn_Button_USB::read(void) -{ - unsigned long dat=85; - unsigned long lIn = 65536 * dat; - USBWrite(lIn); - bool ret=USBRead(dat,0); - buttons[0]=!(dat & 1); - buttons[1]=!(dat & 16); -} - -//! writes data to the device -bool vrpn_Button_USB::USBWrite(const unsigned long &data) -{ - unsigned long lOut; - return USB_IO(data,3,lOut,1); -} - -//! reads data from the device -bool vrpn_Button_USB::USBRead(unsigned long &data, int port) -{ - bool res; - unsigned long lOut; - unsigned long lIn = port * 256 + 20; - res=USB_IO(lIn,2,lOut,2); - data=(lOut / 256) & 255; - return res; -} - -bool vrpn_Button_USB::USB_IO(unsigned long lIn, int lInSize, unsigned long &lOut, int lOutSize) -{ - unsigned long lSize; - LPOVERLAPPED gOverlapped=0; - if(!DeviceIoControl(m_hDevice, 0x4, &lIn, lInSize, &lOut, lOutSize, &lSize, gOverlapped)) - { - LPVOID lpMsgBuf; - if (!FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, ::GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language*/ (LPTSTR) &lpMsgBuf, 0, NULL )) - { - // Handle the error. - return false; - } - } - return true; -} - -void vrpn_Button_USB::mainloop() -{ - struct timeval current_time; - - // Call the generic server mainloop, since we are a server - server_mainloop(); - - read(); - - vrpn_gettimeofday(¤t_time, NULL); - // Send reports. Stays the same in a real server. - report_changes(); - -} -#endif diff --git a/src/vrpn/vrpn_Button_USB.h b/src/vrpn/vrpn_Button_USB.h deleted file mode 100644 index 63ec382b350b9700546f629e3a1273ab2388d1e5..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Button_USB.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef VRPN_BUTTON_USB_H -#ifdef _WIN32 -#include "vrpn_Button.h" - -// USB button code. -// This class is derived from the vrpn_Button_Filter class, so that it -// can be made to toggle its buttons using messages from the client. -class VRPN_API vrpn_Button_USB : public vrpn_Button_Filter { -public: - vrpn_Button_USB(const char *name, const char *deviceName, - vrpn_Connection *c); - ~vrpn_Button_USB(); - - virtual void mainloop(); - -protected: - void read(void); - //! writes data to the device - bool USBWrite(const unsigned long &data); - //! reads data from the device - bool USBRead(unsigned long &data, int port); - //! basic io handeling - bool USB_IO(unsigned long lIn, int lInSize, unsigned long &lOut, - int lOutSize); - HANDLE m_hDevice; //!< the usb device -}; -#endif -#endif diff --git a/src/vrpn/vrpn_CHProducts_Controller_Raw.C b/src/vrpn/vrpn_CHProducts_Controller_Raw.C deleted file mode 100644 index 78e4d1c7eb46807422fb30a1fdee0d343c0eafcc..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_CHProducts_Controller_Raw.C +++ /dev/null @@ -1,360 +0,0 @@ -// vrpn_CHProducts_Controller_Raw.C: VRPN driver for CHProducts Controller Raw devices - -#include <stdio.h> // for fprintf, stderr, NULL -#include <string.h> // for memset -#include <math.h> // for sqrt and fabs - -#include "vrpn_CHProducts_Controller_Raw.h" - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_HID) - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 CHPRODUCTS_VENDOR = 0x068e; -static const vrpn_uint16 FIGHTERSTICK_USB = 0x00f3; - -static const double POLL_INTERVAL = 1e+6 / 30.0; // If we have not heard, ask. - -#define GAMEPAD_TRIGGER_THRESHOLD 30 - -////////////////////////////////////////////////////////////////////////// -// helpers -////////////////////////////////////////////////////////////////////////// - -static vrpn_float64 normalize_dpad(unsigned char up, unsigned char right, unsigned char down, unsigned char left) -{ - int x = 0; - int y = 0; - if (right) { - x += 1; - } - if (left) { - x -= 1; - } - if (up) { - y += 1; - } - if (down) { - y -= 1; - } - size_t index = ((x + 1) * 3) + (y + 1); - vrpn_float64 angles[] = {225, 270, 315, 180, -1, 0, 135, 90, 45}; - return (angles[index]); -} - -static void normalize_axis(const unsigned int value, const short deadzone, const vrpn_float64 scale, vrpn_float64& channel, int wordSize = 16) -{ - channel = (static_cast<float>(value) - (float) (1 << (wordSize - 1))); - if (fabs(channel) < (deadzone * 3 / 4)) - { - channel = 0.0f; - } - else - { - channel /= (float) (1 << (wordSize - 1)); - } - channel *= scale; - if (channel < -1.0) { channel = -1.0; } - if (channel > 1.0) { channel = 1.0; } -} - -static void normalize_axes(const unsigned int x, const unsigned int y, const short deadzone, const vrpn_float64 scale, vrpn_float64& channelX, vrpn_float64& channelY, int wordSize = 16) -{ - normalize_axis(x, deadzone, scale, channelX, wordSize); - normalize_axis(y, deadzone, scale, channelY, wordSize); -} - -static vrpn_float64 normalize_trigger(unsigned int trigger) -{ - // Filter out low-intensity signals - int value = trigger - 0x80; - return ((fabs(static_cast<double>(value)) < GAMEPAD_TRIGGER_THRESHOLD) ? 0.0f : (value * 2.0f / 255.0f)); -} - -////////////////////////////////////////////////////////////////////////// -// Common base class -////////////////////////////////////////////////////////////////////////// -vrpn_CHProducts_Controller_Raw::vrpn_CHProducts_Controller_Raw(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c) : - vrpn_HidInterface(filter) - , vrpn_BaseClass(name, c) - , _filter(filter) -{ - init_hid(); -} - -vrpn_CHProducts_Controller_Raw::~vrpn_CHProducts_Controller_Raw(void) -{ - delete _filter; -} - -void vrpn_CHProducts_Controller_Raw::init_hid() -{ - // Get notifications when clients connect and disconnect - register_autodeleted_handler(d_connection->register_message_type(vrpn_dropped_last_connection), on_last_disconnect, this); - register_autodeleted_handler(d_connection->register_message_type(vrpn_got_connection), on_connect, this); -} - -void vrpn_CHProducts_Controller_Raw::on_data_received(size_t bytes, vrpn_uint8 *buffer) -{ - decodePacket(bytes, buffer); -} - -int vrpn_CHProducts_Controller_Raw::on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_CHProducts_Controller_Raw* me = static_cast<vrpn_CHProducts_Controller_Raw*>(thisPtr); - return (0); -} - -int vrpn_CHProducts_Controller_Raw::on_connect(void* thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_CHProducts_Controller_Raw* me = static_cast<vrpn_CHProducts_Controller_Raw*>(thisPtr); - return (0); -} - -////////////////////////////////////////////////////////////////////////// -// ST290 Pro Joystick -////////////////////////////////////////////////////////////////////////// -vrpn_CHProducts_Fighterstick_USB::vrpn_CHProducts_Fighterstick_USB(const char *name, vrpn_Connection *c) : - vrpn_CHProducts_Controller_Raw(_filter = new vrpn_HidProductAcceptor(CHPRODUCTS_VENDOR, FIGHTERSTICK_USB), name, c), - vrpn_Button_Filter(name, c), vrpn_Analog(name, c), vrpn_Dial(name, c) -{ - vrpn_Analog::num_channel = 8; - vrpn_Dial::num_dials = 0; - vrpn_Button::num_buttons = 24; - - // Initialize the state of all the analogs, buttons, and dials - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); -} - -void vrpn_CHProducts_Fighterstick_USB::mainloop(void) -{ - update(); - server_mainloop(); - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, _timestamp) > POLL_INTERVAL) - { - _timestamp = current_time; - report_changes(); - - vrpn_Analog::server_mainloop(); - vrpn_Button::server_mainloop(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::server_mainloop(); - } - } -} - -void vrpn_CHProducts_Fighterstick_USB::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_CHProducts_Fighterstick_USB::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_CHProducts_Fighterstick_USB::decodePacket(size_t bytes, vrpn_uint8 *buffer) -{ - // Fighterstick USB joystick - - // Decode all full reports, each of which is 6 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - /* - [0]: X-axis (left=00, right=ff, center=80) - [1]: Y-axis (up=00, down=ff, center=80) - [2]: throttle wheel (up=00, down=ff) - [3]: buttons high nibble: 0x10=trigger, 0x20=top red, 0x40=upper index red (toggles buttons 17-19), 0x80=pinky red, - - - low nibble 8-way POV hat upper-right on top: none=0x00, N=0x01, NE=0x02, ... NW=0x08 - [4]: high nibble 4-way hat #2 (lower-right on top): none=0x00, N=0x10, E=0x20, S=0x40, W=0x80 - - - low nibble 4-way hat #1 (left on top): none=0x00, N=0x01, E=0x02, S=0x04, W=0x08 - [5]: upper nibble mode bits: 0x10=green, 0x20=red, 0x40=yellow, 0x80=<not used> - - - low nibble 4-way hat #3 (thumb): none=0x00, N=0x01, E=0x02, S=0x04, W=0x08 - */ - // XXX Check to see that this works with HIDAPI, there may be two smaller reports. - if (bytes == 6) - { - normalize_axes(buffer[0], buffer[1], 0x08, 1.0f, channel[0], channel[1], 8); - normalize_axis(buffer[2], 0x08, 1.0f, channel[2], 8); - - vrpn_uint8 value, mask; - value = (buffer[3] >> 4); - for (int btn = 0; btn < 4; btn++) - { - mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[btn] = ((value & mask) != 0); - } - - // Point of View Hat - buttons[4] = buttons[5] = buttons[6] = buttons[7] = 0; - switch (buffer[3] & 0x0f) - { - case 1: // up - buttons[4] = true; - break; - case 2: - buttons[4] = buttons[5] = true; - break; - case 3: // right - buttons[5] = true; - break; - case 4: - buttons[5] = buttons[6] = true; - break; - case 5: // down - buttons[6] = true; - break; - case 6: - buttons[6] = buttons[7] = true; - break; - case 7: // left - buttons[7] = true; - break; - case 8: - buttons[7] = buttons[4] = true; - break; - case 0: - default: - // nothing to do - break; - } - channel[3] = normalize_dpad(buttons[4], buttons[5], buttons[6], buttons[7]); - - // 4-way Hat #2 - buttons[8] = buttons[9] = buttons[10] = buttons[11] = 0; - switch (buffer[4] >> 4) - { - case 1: // up - buttons[8] = true; - break; - case 2: // right - buttons[9] = true; - break; - case 4: // down - buttons[10] = true; - break; - case 8: // left - buttons[11] = true; - break; - case 0: - default: - // nothing to do - break; - } - channel[4] = normalize_dpad(buttons[8], buttons[9], buttons[10], buttons[11]); - // 4-way Hat #1 - buttons[12] = buttons[13] = buttons[14] = buttons[15] = 0; - switch (buffer[4] & 0x0f) - { - case 1: // up - buttons[12] = true; - break; - case 2: // right - buttons[13] = true; - break; - case 4: // down - buttons[14] = true; - break; - case 8: // left - buttons[15] = true; - break; - case 0: - default: - // nothing to do - break; - } - channel[5] = normalize_dpad(buttons[12], buttons[13], buttons[14], buttons[15]); - - // mode - // keep pseudo-button pressed to indicate mode - //buttons[16] = buttons[17] = buttons[18] = buttons[19] = 0; - switch (buffer[5] >> 4) - { - case 1: // green - buttons[16] = true; - buttons[17] = buttons[18] = false; - break; - case 2: // red - buttons[17] = true; - buttons[16] = buttons[18] = false; - break; - case 4: // yellow - buttons[18] = true; - buttons[16] = buttons[17] = false; - break; -/* - case 8: // none - buttons[19] = true; - break; -*/ - case 0: - default: - // nothing to do - break; - } - if (buttons[16] || buttons[17] || buttons[18] || buttons[19]) - { - channel[6] = (normalize_dpad(buttons[16], buttons[17], buttons[18], buttons[19]) / 90.0f) + 1.0f; - } - // 4-way Hat #3 - buttons[20] = buttons[21] = buttons[22] = buttons[23] = 0; - switch (buffer[5] & 0x0f) - { - case 1: // up - buttons[20] = true; - break; - case 2: // right - buttons[21] = true; - break; - case 4: // down - buttons[22] = true; - break; - case 8: // left - buttons[23] = true; - break; - case 0: - default: - // nothing to do - break; - } - channel[7] = normalize_dpad(buttons[20], buttons[21], buttons[22], buttons[23]); - } - else - { - fprintf(stderr, "vrpn_CHProducts_Fighterstick_USB: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - } -} - -// End of VRPN_USE_HID -#endif diff --git a/src/vrpn/vrpn_CHProducts_Controller_Raw.h b/src/vrpn/vrpn_CHProducts_Controller_Raw.h deleted file mode 100644 index 696d7ca408d23bc79db227341bc0dcc52eca0bf0..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_CHProducts_Controller_Raw.h +++ /dev/null @@ -1,66 +0,0 @@ -#pragma once - -#include <stddef.h> // for size_t - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_BaseClass.h" // for vrpn_BaseClass -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_USE_HID -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Dial.h" // for vrpn_Dial -#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint8, vrpn_uint32 - -#if defined(VRPN_USE_HID) - -// Device drivers for the CHProducts Controller Raw USB line of products -// Currently supported: Fighterstick USB -// -// Exposes three major VRPN device classes: Button, Analog, Dial (as appropriate). -// All models expose Buttons for the keys on the device. -// Button 0 is the programming switch; it is set if the switch is in the "red" position. -// - -class vrpn_CHProducts_Controller_Raw: public vrpn_BaseClass, protected vrpn_HidInterface { -public: - vrpn_CHProducts_Controller_Raw(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_CHProducts_Controller_Raw(void); - - virtual void mainloop(void) = 0; -protected: - // Set up message handlers, etc. - void init_hid(void); - void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - static int VRPN_CALLBACK on_connect(void *thisPtr, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM p); - - virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer) = 0; - struct timeval _timestamp; - vrpn_HidAcceptor *_filter; - - // No actual types to register, derived classes will be buttons, analogs, and/or dials - int register_types(void) { return (0); } -}; - -class vrpn_CHProducts_Fighterstick_USB: protected vrpn_CHProducts_Controller_Raw, public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Dial -{ -public: - vrpn_CHProducts_Fighterstick_USB(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_CHProducts_Fighterstick_USB(void) {}; - - virtual void mainloop(void); -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); -}; - -// end of VRPN_USE_HID -#else -class VRPN_API vrpn_CHProducts_Fighterstick_USB; -#endif diff --git a/src/vrpn/vrpn_CerealBox.C b/src/vrpn/vrpn_CerealBox.C deleted file mode 100644 index 70dbcf44df620d416a35a15b8ae8a6ee745e4fed..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_CerealBox.C +++ /dev/null @@ -1,499 +0,0 @@ -// vrpn_CerealBox.C -// This is a driver for the BG Systems CerealBox controller. -// This box is a serial-line device that allows the user to connect -// analog inputs, digital inputs, digital outputs, and digital -// encoders and read from them over RS-232. You can find out more -// at www.bgsystems.com. This code is written for version 3.07 of -// the EEPROM code. -// This code is based on their driver code, which was posted -// on their web site as of the summer of 1999. This code reads the -// characters as they arrive, rather than waiting "long enough" for -// them to get here; this should allow the CerealBox to be used at -// the same time as a tracking device without slowing the tracker -// down. - -#include <stdio.h> // for fprintf, stderr, perror, etc -#include <string.h> // for NULL, strlen, strncmp - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR -#include "vrpn_CerealBox.h" -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday - -#undef VERBOSE - -static const char offset = 0x21; // Offset added to some characters to avoid ctl chars -static const double REV_PER_TICK = 1.0/4096; // How many revolutions per encoder tick? - -// Defines the modes in which the box can find itself. -#define STATUS_RESETTING (-1) // Resetting the box -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report - -#define MAX_TIME_INTERVAL (2000000) // max time between reports (usec) - -// This creates a vrpn_CerealBox and sets it to reset mode. It opens -// the serial device using the code in the vrpn_Serial_Analog constructor. -// The box seems to autodetect the baud rate when the "T" command is sent -// to it. -vrpn_CerealBox::vrpn_CerealBox (const char * name, vrpn_Connection * c, - const char * port, int baud, - const int numbuttons, const int numchannels, const int numencoders): - vrpn_Serial_Analog(name, c, port, baud), - vrpn_Button_Filter(name, c), - vrpn_Dial(name, c), - _numbuttons(numbuttons), - _numchannels(numchannels), - _numencoders(numencoders) -{ - // Verify the validity of the parameters - if (_numbuttons > 24) { - fprintf(stderr,"vrpn_CerealBox: Can only support 24 buttons, not %d\n", - _numbuttons); - _numbuttons = 24; - } - if (_numchannels > 8) { - fprintf(stderr,"vrpn_CerealBox: Can only support 8 analogs, not %d\n", - _numchannels); - _numchannels = 8; - } - if (_numencoders > 8) { - fprintf(stderr,"vrpn_CerealBox: Can only support 8 encoders, not %d\n", - _numencoders); - _numencoders = 8; - } - - // Set the parameters in the parent classes - vrpn_Button::num_buttons = _numbuttons; - vrpn_Analog::num_channel = _numchannels; - vrpn_Dial::num_dials = _numencoders; - - // Set the status of the buttons, analogs and encoders to 0 to start - clear_values(); - - // Set the mode to reset - _status = STATUS_RESETTING; -} - -void vrpn_CerealBox::clear_values(void) -{ - int i; - - for (i = 0; i < _numbuttons; i++) { - vrpn_Button::buttons[i] = vrpn_Button::lastbuttons[i] = 0; - } - for (i = 0; i < _numchannels; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } - for (i = 0; i < _numencoders; i++) { - vrpn_Dial::dials[i] = 0.0; - } -} - -// This routine will reset the CerealBox, asking it to send the requested number -// of analogs, buttons and encoders. It verifies that it can communicate with the -// device and checks the version of the EPROMs in the device is 3.07. - -int vrpn_CerealBox::reset(void) -{ - struct timeval timeout; - unsigned char inbuf[45]; - const char *Cpy = "Copyright (c), BG Systems"; - int major, minor, bug; // Version of the EEPROM - unsigned char reset_str[32]; // Reset string sent to box - int ret; - - //----------------------------------------------------------------------- - // Set the values back to zero for all buttons, analogs and encoders - clear_values(); - - //----------------------------------------------------------------------- - // Check that the box exists and has the correct EEPROM version. The - // "T" command to the box should cause the 44-byte EEPROM string to be - // returned. This string defines the version and type of the box. - // Give it a reasonable amount of time to finish (2 seconds), then timeout - vrpn_flush_input_buffer(serial_fd); - vrpn_write_characters(serial_fd, (const unsigned char *)"T", 1); - timeout.tv_sec = 2; - timeout.tv_usec = 0; - ret = vrpn_read_available_characters(serial_fd, inbuf, 44, &timeout); - inbuf[44] = 0; // Make sure string is NULL-terminated - if (ret < 0) { - perror("vrpn_CerealBox: Error reading from box\n"); - return -1; - } - if (ret == 0) { - fprintf(stderr,"vrpn_CerealBox: No response from box\n"); - return -1; - } - if (ret != 44) { - fprintf(stderr,"vrpn_CerealBox: Got %d of 44 expected characters\n",ret); - return -1; - } - - // Parse the copyright string for the version and other information - // Code here is similar to check_rev() function in the BG example code. - if (strncmp((char *)inbuf, Cpy, strlen(Cpy))) { - fprintf(stderr,"vrpn_CerealBox: Copyright string mismatch: %s\n",inbuf); - return -1; - } - major = inbuf[38] - '0'; - minor = inbuf[40] - '0'; - bug = inbuf[41] - '0'; - if ( (3 != major) || (0 != minor) || (7 != bug) ) { - fprintf(stderr, "vrpn_CerealBox: Bad EEPROM version (want 3.07, got %d.%d%d)\n", - major, minor, bug); - return -1; - } - printf("vrpn_CerealBox: Box of type %c found\n",inbuf[42]); - - //----------------------------------------------------------------------- - // Compute the proper string to initialize the device based on how many - // of each type of input/output that is selected. This follows init_cereal() - // in BG example code. - { int i; - char ana1_4 = 0; // Bits 1-4 do analog channels 1-4 - char ana5_8 = 0; // Bits 1-4 do analog channels 5-8 - char dig1_3 = 0; // Bits 1-3 enable groups of 8 inputs - char enc1_4 = 0; // Bits 1-4 enable encoders 1-4 - char enc5_8 = 0; // Bits 1-4 enable encoders 5-8 - - // Figure out which analog channels to use and set them - for (i = 0; i < 4; i++) { - if (i < _numchannels) { - ana1_4 |= (1<<i); - } - } - for (i = 0; i < 4; i++) { - if (i+4 < _numchannels) { - ana5_8 |= (1<<i); - } - } - - // Figure out which banks of digital inputs to use and set them - for (i = 0; i < _numbuttons; i++) { - dig1_3 |= (1 << (i/8)); - } - - // Figure out which encoder channels to use and set them - for (i = 0; i < 4; i++) { - if (i < _numencoders) { - enc1_4 |= (1<<i); - } - } - for (i = 0; i < 4; i++) { - if (i+4 < _numencoders) { - enc5_8 |= (1<<i); - } - } - - reset_str[0] = 'c'; - reset_str[1] = (unsigned char)(ana1_4 + offset); // Hope we don't need to set baud rate - reset_str[2] = (unsigned char)((ana5_8 | (dig1_3 << 4)) + offset); - reset_str[3] = (unsigned char)(0 + offset); - reset_str[4] = (unsigned char)(0 + offset); - reset_str[5] = (unsigned char)(enc1_4 + offset); - reset_str[6] = (unsigned char)(enc1_4 + offset); // Set encoders 1-4 for incremental - reset_str[7] = (unsigned char)(enc5_8 + offset); - reset_str[8] = (unsigned char)(enc5_8 + offset); // Set encoders 5-8 for incremental - reset_str[9] = '\n'; - reset_str[10] = 0; - } - - // Send the string and then wait for an acknowledgement from the box. - vrpn_write_characters(serial_fd, reset_str, 10); - timeout.tv_sec = 2; - timeout.tv_usec = 0; - ret = vrpn_read_available_characters(serial_fd, inbuf, 2, &timeout); - if (ret < 0) { - perror("vrpn_CerealBox: Error reading ack from box\n"); - return -1; - } - if (ret == 0) { - fprintf(stderr,"vrpn_CerealBox: No ack from box\n"); - return -1; - } - if (ret != 2) { - fprintf(stderr,"vrpn_CerealBox: Got %d of 2 expected ack characters\n",ret); - return -1; - } - if (inbuf[0] != 'a') { - fprintf(stderr,"vrpn_CerealBox: Bad ack: wanted 'a', got '%c'\n",inbuf[0]); - return -1; - } - - //----------------------------------------------------------------------- - // Ask the box to send a report, and go into SYNCING mode to get it. - vrpn_write_characters(serial_fd, (unsigned char *)"pE", 2); - status = STATUS_SYNCING; - printf("CerealBox reset complete.\n"); - - //----------------------------------------------------------------------- - // Figure out how many characters to expect in each report from the device - // There is a 'p' to start and '\n' to finish, two bytes for each analog - // value, 4 bytes for each encoder. Buttons are enabled in banks of 8, - // but each bank of 8 is returned in 2 bytes (4 bits each). - _expected_chars = 2 + 2*_numchannels + _numencoders*4 + - ((_numbuttons+7) / 8) * 2; - - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - return 0; -} - -// This function will read characters until it has a full report, then -// put that report into the time, analog, button and encoder fields and call -// the report methods on these. The time stored is that of -// the first character received as part of the report. Reports start with -// the header "p" and end with "\n", and is of the length _expected_chars. -// If we get a report that is not valid, we assume that we have lost a -// character or something and re-synchronize by waiting -// until the start-of-report character ('p') comes around again. -// The routine that calls this one -// makes sure we get a full reading often enough (ie, it is responsible -// for doing the watchdog timing to make sure the box hasn't simply -// stopped sending characters). -// Returns 1 if got a complete report, 0 otherwise. - -int vrpn_CerealBox::get_report(void) -{ - int ret; // Return value from function call to be checked - int i; // Loop counter - int nextchar = 1; // Index of the next character to read - - //-------------------------------------------------------------------- - // The reports are each _expected_chars characters long, and each start with an - // ASCII 'p' character. If we're synching, read a byte at a time until we - // find a 'p' character. - //-------------------------------------------------------------------- - - if (status == STATUS_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, _buffer, 1) != 1) { - return 0; - } - - // If it is not a 'p', we don't want it but we - // need to look at the next one, so just return and stay - // in Syncing mode so that we will try again next time through. - if ( _buffer[0] != 'p') { - fprintf(stderr,"vrpn_CerealBox: Syncing (looking for 'p', " - "got '%c')\n", _buffer[0]); - return 0; - } - - // Got the first character of a report -- go into READING mode - // and record that we got one character at this time. The next - // bit of code will attempt to read the rest of the report. - // The time stored here is as close as possible to when the - // report was generated. - _bufcount = 1; - vrpn_gettimeofday(×tamp, NULL); - status = STATUS_READING; -#ifdef VERBOSE - printf("... Got the 1st char\n"); -#endif - } - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. The routine that calls this one - // makes sure we get a full reading often enough (ie, it is responsible - // for doing the watchdog timing to make sure the device hasn't simply - // stopped sending characters). - //-------------------------------------------------------------------- - - ret = vrpn_read_available_characters(serial_fd, &_buffer[_bufcount], - _expected_chars-_bufcount); - if (ret == -1) { - send_text_message("vrpn_CerealBox: Error reading", timestamp, vrpn_TEXT_ERROR); - status = STATUS_RESETTING; - return 0; - } - _bufcount += ret; -#ifdef VERBOSE - if (ret != 0) printf("... got %d characters (%d total)\n",ret, _bufcount); -#endif - if (_bufcount < _expected_chars) { // Not done -- go back for more - return 0; - } - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. Check to make - // sure that its format matches what we expect. If it does, the next - // section will parse it. If it does not, we need to go back into - // synch mode and ignore this report. A well-formed report has the - // first character 'p', and the last character is '\n'. - //-------------------------------------------------------------------- - - if (_buffer[0] != 'p') { - status = STATUS_SYNCING; - fprintf(stderr,"vrpn_CerealBox: Not 'p' in record\n"); - return 0; - } - if (_buffer[_expected_chars-1] != '\n') { - status = STATUS_SYNCING; - fprintf(stderr,"vrpn_CerealBox: No carriage return in record\n"); - return 0; - } - -#ifdef VERBOSE - printf("got a complete report (%d of %d)!\n", _bufcount, _expected_chars); -#endif - - //-------------------------------------------------------------------- - // Ask the device to send us another report. Ideally, this would be - // sent earlier so that we can overlap with the previous report. However, - // when we ask after the first character we start losing parts of the - // reports when we've turned on a lot of inputs. So, we do it here - // after the report has come in. - //-------------------------------------------------------------------- - - vrpn_write_characters(serial_fd, (unsigned char *)"pE", 2); - - //-------------------------------------------------------------------- - // Decode the report and store the values in it into the parent classes - // (analog, button and encoder). This code is modelled on the routines - // convert_serial() and unpack_encoders() in the BG systems code. - //-------------------------------------------------------------------- - - { // Digital code. There appear to be 4 bits (four buttons) stored - // in each byte, in the low-order 4 bits after the offset of 0x21 - // has been removed from each byte. They seem to come in highest- - // buttons first, with the highest within each bank in the leftmost - // bit. This assumes we are not using MP for digital inputs. - - int i; - int numbuttonchars; - - // Read two characters for each eight buttons that are on, from the - // highest bank down. - numbuttonchars = ((_numbuttons+7) / 8) * 2; - for (i = numbuttonchars-1; i >= 0; i--) { - // Find the four bits for these buttons by subtracting - // the offset to get them into the low-order 4 bits - char bits = (char)(_buffer[nextchar++] - offset); - - // Set the buttons for each bit - buttons[ i*4 + 3 ] = ( (bits & 0x08) != 0); - buttons[ i*4 + 2 ] = ( (bits & 0x04) != 0); - buttons[ i*4 + 1 ] = ( (bits & 0x02) != 0); - buttons[ i*4 + 0 ] = ( (bits & 0x01) != 0); - } - } - - {// Analog code. Looks like there are two characters for each - // analog value; this conversion code grabbed right from the - // BG code. They seem to come in lowest-numbered first. - - int intval, i; - double realval; - for (i = 0; i < _numchannels; i++) { - intval = (0x3f & (_buffer[nextchar++]-offset)) << 6; - intval |= (0x3f & (_buffer[nextchar++]-offset)); - realval = -1.0 + (2.0 * intval/4095.0); - channel[i] = realval; - } - } - - { // Encoders. They come packed as 24-bit values with 6 bits in - // each byte (offset by 0x21). They seem to come least-significant - // part first. This decoding is valid only for incremental - // encoders. Remember to convert the encoder values into fractions - // of a revolution. - - for (i = 0; i < _numencoders; i++) { - int enc0, enc1, enc2, enc3; - long increment; - - enc0 = (_buffer[nextchar++]-offset) & 0x3f; - increment = enc0; - enc1 = (_buffer[nextchar++]-offset) & 0x3f; - increment |= enc1 << 6; - enc2 = (_buffer[nextchar++]-offset) & 0x3f; - increment |= enc2 << 12; - enc3 = (_buffer[nextchar++]-offset) & 0x3f; - increment |= enc3 << 18; - if ( increment & 0x800000 ) { - dials[i] = (int)(increment - 16777216) * REV_PER_TICK; - } else { - dials[i] = (int)(increment) * REV_PER_TICK; - } - } - } - - //-------------------------------------------------------------------- - // Done with the decoding, send the reports and go back to syncing - //-------------------------------------------------------------------- - - report_changes(); - status = STATUS_SYNCING; - _bufcount = 0; - return 1; -} - -void vrpn_CerealBox::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; - vrpn_Dial::timestamp = timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); - vrpn_Dial::report_changes(); -} - -void vrpn_CerealBox::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; - vrpn_Dial::timestamp = timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); - vrpn_Dial::report(); -} - -// This routine is called each time through the server's main loop. It will -// take a course of action depending on the current status of the cerealbox, -// either trying to reset it or trying to get a reading from it. -void vrpn_CerealBox::mainloop() -{ - // Call the generic server mainloop, since we are a server - server_mainloop(); - - switch(status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - while (get_report()) {}; // Keep getting reports as long as they come - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) > MAX_TIME_INTERVAL) { - fprintf(stderr,"CerealBox failed to read... current_time=%ld:%ld, timestamp=%ld:%ld\n", - current_time.tv_sec, static_cast<long>(current_time.tv_usec), - timestamp.tv_sec, static_cast<long>(timestamp.tv_usec)); - send_text_message("Too long since last report, resetting", current_time, vrpn_TEXT_ERROR); - status = STATUS_RESETTING; - } - } - break; - - default: - fprintf(stderr,"vrpn_CerealBox: Unknown mode (internal error)\n"); - break; - } -} diff --git a/src/vrpn/vrpn_CerealBox.h b/src/vrpn/vrpn_CerealBox.h deleted file mode 100644 index 6f7a33ae43cd2413ecb567425bbcde483c7987ab..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_CerealBox.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef VRPN_CEREALBOX_H -#define VRPN_CEREALBOX_H - -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Dial.h" // for vrpn_Dial -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32 - -class VRPN_API vrpn_CerealBox: public vrpn_Serial_Analog - ,public vrpn_Button_Filter - ,public vrpn_Dial -{ -public: - vrpn_CerealBox (const char * name, vrpn_Connection * c, - const char * port, int baud, - const int numbuttons, const int numchannels, const int numencoders); - - ~vrpn_CerealBox () {}; - - // Called once through each main loop iteration to handle - // updates. - virtual void mainloop (); - - protected: - int _status; - int _numbuttons; // How many buttons to open - int _numchannels; // How many analog channels to open - int _numencoders; // How many encoders to open - - unsigned _expected_chars; // How many characters to expect in the report - unsigned char _buffer[512]; // Buffer of characters in report - unsigned _bufcount; // How many characters we have so far - - struct timeval timestamp; // Time of the last report from the device - - virtual void clear_values(void); // Set all buttons, analogs and encoders back to 0 - virtual int reset(void); // Set device back to starting config - virtual int get_report(void); // Try to read a report from the device - - // send report iff changed - virtual void report_changes - (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - // send report whether or not changed - virtual void report - (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button or vrpn_Dial -}; - -#endif diff --git a/src/vrpn/vrpn_Configure.h b/src/vrpn/vrpn_Configure.h deleted file mode 100644 index aec648c0d7bc7fbfe30b26e1018babf5b0103145..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Configure.h +++ /dev/null @@ -1,668 +0,0 @@ -// -*- c++ -*- - -#ifndef VRPN_USING_CMAKE -// Only using this configuration file if not using CMake. -// An #else follows at the bottom of the file. - -#ifndef VRPN_CONFIGURE_H - -//-------------------------------------------------------------- -/* IMPORTANT NOTE: If you are using CMake to build VRPN, this - file DOES NOT affect your build. vrpn_Configure.h.cmake_in - is processed automatically into a vrpn_Configure.h file - placed in your build directory using the choices you make in - CMake. Until all modules are fully configured using CMake, - you may have to edit the paths that are listed near the - bottom of the first section of that file, then re-run CMake - to regenerate vrpn_Configure.h. */ -//-------------------------------------------------------------- - -//-------------------------------------------------------------- -/* This file contains configuration options for VRPN. The first - section has definition lines that can be commented in or out - at build time. The second session has automaticly-generated - directives and should not be edited. */ -//-------------------------------------------------------------- - -//--------------------------------------------------------// -// EDIT BELOW THIS LINE FOR NORMAL CONFIGURATION SETTING. // -//--------------------------------------------------------// - -//----------------------- -// Default port to listen on for a server. It used to be 4500 -// up through version 6.03, but then all sorts of VPNs started -// using this, as did Microsoft. Port 3883 was assigned to VRPN -// by the Internet Assigned Numbers Authority (IANA) October, 2003. -// Change this to make a location-specific default if you like. -// The parentheses are to keep it from being expanded into something -// unexpected if the code has a dot after it. -#define vrpn_DEFAULT_LISTEN_PORT_NO (3883) - -//----------------------- -// Use compile-time static asserts. -// Should be reasonably portable, but off by default because they -// haven't been tested for extreme portability. -//#define VRPN_USE_STATIC_ASSERTIONS - -//----------------------- -// Use Winsock2 library rather than Winsock. -//#define VRPN_USE_WINSOCK2 - -//----------------------- -// Instructs VRPN to expose the vrpn_gettimeofday() function also -// as gettimeofday() so that external programs can use it. This -// has no effect on any system that already has gettimeofday() -// defined, and is put here for Windows. This function should -// not really be implemented within VRPN, but it was expedient to -// include it when porting applications to Windows. Turn this -// off if you have another implementation, or if you want to call -// vrpn_gettimeofday() directly. -#define VRPN_EXPORT_GETTIMEOFDAY - -//----------------------- -// Tells VRPN to compile with support for the Message-Passing -// Interface (MPI) library. There is a configuration section below -// that has a library path for the MPI library to link against. -// You will need to add the path to mpi.h and other needed files -// into your Visual Studio Tools/Options/Projects and Solutions/ -// C++ Directories include path. The original implementation is -// done with MPICH2, but an attempt has been made to use only -// MPI version 1 basic functions. -//#define VRPN_USE_MPI - -//----------------------- -// Tells VRPN to compile with support for the Modbus -// library. There is a configuration section below -// that has a library path for the Modbus library to link against. -// You will need to add the path to modbus.h and other needed files -// into your Visual Studio Tools/Options/Projects and Solutions/ -// C++ Directories include path. -//#define VRPN_USE_MODBUS - -//----------------------- -// Instructs VRPN to use phantom library to construct a unified -// server, using phantom as a common device, and phantom -// configuration in .cfg file. This will not build (at least -// on Visual Studio 2008) with the 3.1 version of OpenHaptics. -// There will be problems with #include and library directories, -// and then a failure to link due to undefined symbol. Use CMAKE -// if you want to compile with a Phantom -- that version works -// on VS2008 and 3.1 at least. -//#define VRPN_USE_PHANTOM_SERVER - -//------------------------ -// Instructs vrpn to use SensAble's HDAPI rather than GHOST library. -// Only used in conjuntion with VRPN_USE_PHANTOM_SERVER. -// PLEASE SPECIFY PATH TO HDAPI IN NEXT SECTION IF YOU USE THIS. -// Also, you need to go to the vrpn_phantom and vrpn_server projects -// and remove the GHOST include directories from the include paths. -// Yes, HDAPI fails if it even has them in the path (as so many other -// things also fail). At least we're rid of them now. When you -// uncomment it (to use GHOST), add the following to the include -// directories for the vrpn_phantom project: $(SYSTEMDRIVE)\Program -// Files\SensAble\GHOST\v4.0\include,$(SYSTEMDRIVE)\Program -// Files\SensAble\GHOST\v4.0\external\stl, -// On SGI, you need to uncomment the GHOST lines in the Makefile in -// the server_src directory. -#define VRPN_USE_HDAPI - -//------------------------ -// Instructs vrpn to use Ghost 3.1 instead of Ghost 3.4. -// Only used in conjuntion with VRPN_USE_PHANTOM_SERVER. -// PLEASE SPECIFY PATH TO GHOSTLIB IN NEXT SECTION IF YOU USE THIS -// (This is expected to be used on systems where Ghost 4.0 is not -// available, such as the SGI platform. If you are using this on -// a Windows PC with Visual Studio, you will need to alter -// server_src/vrpn_phantom.dsp to reference the Ghost 3.1 include -// paths.) -//#define VRPN_USE_GHOST_31 - -//----------------------- -// Instructs VRPN to use the high-performance timer code on -// Windows, rather than the default clock which has an infrequent -// update. At one point in the past, an implementation of this -// would only work correctly on some flavors of Windows and with -// some types of CPUs. -// There are actually two implementations of the faster windows clock. The -// original one, made by Hans Weber, checks the clock rate to see how fast the -// performance clock runs (it takes a second to do this when the program first -// calls vrpn_gettimeofday()). The second version by Haris Fretzagias relies on -// the timing supplied by Windows. To use the second version, also define -// VRPN_WINDOWS_CLOCK_V2. -#define VRPN_UNSAFE_WINDOWS_CLOCK -#define VRPN_WINDOWS_CLOCK_V2 - -//----------------------- -// Instructs VRPN library and server to include code that uses -// the DirectX SDK. If you set this, you may to edit the -// system configuration section below to point at the correct version -// of DirectX. WARNING: With the August 2006 DirectX SDK, you -// cannot link against the debug library in Visual Studio 6.0, -// only the release. Hopefully, Visual Studio.NET doesn't have -// this problem. -// IMPORTANT! If you define this, you need to edit the Tools/Options -// menu: -// For Visual studio 6, use the Directories tab, and add the -// include and lib paths to the TOP of the lists for all configurations. -// For Visual studio .NET, add to the top of the Projects and Solutions/ -// VC++ Directories entry. -// This will let the code find the right version when it compiles. -//#define VRPN_USE_DIRECTINPUT -//#define VRPN_USE_WINDOWS_XINPUT - -// The DirectInput-based zSight tracker requires ATL for smart pointers, -// which sadly isn't everywhere (VC Express, MXE cross compiling, ...). -//#define VRPN_HAVE_ATLBASE - -//----------------------- -// Instructs VRPN library and server to include code that uses -// the DirectShow SDK. If you set this, you may to edit the -// system configuration section below to point at the correct version -// of the Platform SDK. WARNING: With the August 2006 DirectX SDK, you -// cannot link against the debug library in Visual Studio 6.0, -// only the release. Visual Studio.NET doesn't have this problem. -//#define VRPN_USE_DIRECTSHOW - -//----------------------- -// Instructs the VRPN server to create an entry for the Adrienne -// time-code generator. This is a device that produces time values -// from an analog video stream so that events in the virtual world -// can be synchronized with events on a movie. The Adrienne folder -// should be located at the same level as the VRPN folder for the -// code to find it. -//#define VRPN_INCLUDE_TIMECODE_SERVER - -//----------------------- -// Compiles the InterSense Tracker using the -// InterSense Interface Libraries SDK (tested for version -// 3.45) on windows. This should work with all Intersense trackers, -// both the USB and the serial port versions. The files isense.h, -// types.h and isense.c should be put in a directory called 'isense' -// at the same level as the vrpn directory. The isense.dll should -// be put either in Windows/system32 or in the location where the -// executable lives or somewhere on the path. -//#define VRPN_INCLUDE_INTERSENSE - -//----------------------- -// Instructs VRPN library and server to include code that uses -// the National Instruments Nidaq library to control analog outputs. -// Later in this file, we also instruct the compiler to link with -// the National Instruments libraries if this is defined. Either or -// both of these can be defined, depending on which library you -// need to use. -//#define VRPN_USE_NATIONAL_INSTRUMENTS -//#define VRPN_USE_NATIONAL_INSTRUMENTS_MX - -//----------------------- -// Instructs VRPN library and server to include code that uses -// the US Digital SEI/A2 library to control analog inputs from the -// A2 absolute encoder. -// Later in this file, we also instruct the compiler to link with -// the US Digital library if this is defined. You also need to -// define VRPN_USE_NATIONAL_INSTRUMENTS_MX above if you want to -// use this. -//#define VRPN_USE_USDIGITAL - -//----------------------- -// Instructs VRPN to use the default room space transforms for -// the Desktop Phantom as used in the nanoManipulator application -// rather than the default world-origin with identity rotation. -// Please don't anyone new use the room space transforms built -// into VRPN -- they are a hack pulled forward from Trackerlib. -#define DESKTOP_PHANTOM_DEFAULTS - -//------------------------ -// Instructs VRPN to use microscribe3D library to construct a unified -// server -//#define VRPN_USE_MICROSCRIBE - -//------------------------ -// Compiles the VRPN library with the PhaseSpace Tracker using the -// PhaseSpace OWL API on Linux and Windows. -// -// In Linux: -// The PhaseSpace header files (owl.h, etc) and libraries (libowlsock) -// should be placed in the phasespace directory at the same level as -// the vrpn folder. Also, PHASESPACE needs to be uncommented in the -// server_src/Makefile so that the libraries are properly linked. -// libowlsock.so will need to be present in the directory of the -// final executable or in the default library path such as /usr/lib -// -// In Windows: -// The PhaseSpace header files (owl.h, etc) should be placed in the -// phasespace directory at the same level as the vrpn folder. -// libowlsock.lib will need to be located there as well. -// libowlsock.dll will need to be in the path or with the executable -// at run time. Edit the path below to say where the .lib file -// can be found. -// -//#define VRPN_INCLUDE_PHASESPACE - -//----------------------- -// Instructs VRPN to use a DLL interface on Windows systems. -// When using this, link with VRPNDLL.LIB (and VRPN.DLL) rather -// than VRPN.LIB in user code. This is experimental and is -// under development to enable C# and other languages to pull in -// VRPN. This is only needed when trying to link VRPN with -// languages other than C++ (and not even for Java). If you don't -// have a good reason to, don't define it. -// Not implemented for .so-based Unix systems. -//#define VRPN_USE_SHARED_LIBRARY - -//------------------------ -// Instructs VRPN to use GPM Linux interface mouse interface. -// WARNING: If you define this, then you must also edit the server_src -// Makefile to include "-lgpm" into the SYSLIBS definition line for the -// architecture you use this on. We had to change this because not all -// Linux releases included this library. -//#define VRPN_USE_GPM_MOUSE - -//------------------------ -// Instructs VRPN to use the Motion C API library to interface VRPN to -// the their MotionNode tracker. Requires the shared library at run-time -// to function. No external dependencies to build. -//#define VRPN_USE_MOTIONNODE - -//------------------------ -// Instructs VRPN to compile code for the Nintendo Wii Remote controller, -// getting access to it through the Wiiuse library in Windows and Linux. -// Note that this requires installing a bunch of other stuff, and that some -// bluetooth stacks cause people trouble. See the README file in the WiiUse -// library for more info. Also note that the -// WiiUse library is GPL, which is more restrictive than the VRPN public- -// domain license, so check out its license file before building this driver -// into your code. The original WiiUse library was abandoned and a new -// fork by Ryan Pavlik is available at https://github.com/rpavlik/wiiuse. -// To get the WiiUse library to compile on Visual Studio 2005 (apparently -// not for VS 2008), you need to add the include path -// to the driver developer kit (C:\WINDDK\3790.1830\inc\wxp) and the -// library path to hid.lib (C:\WINDDK\3790.1830\lib\wxp\i386) to the -// include and library directories in Visual Studio. -// Also, edit the configuration below to point to the WiiUse include -// file and library. -// Note that the wiiuse.dll needs to be in the path when running a server -// that uses WiiUse in Windows. -//#define VRPN_USE_WIIUSE - -// Instructs VRPN to compile code to handle Hillcrest Labs' Freespace -// devices such as the Loop, and FRCM. You will also need the libfreespace -// library which is available at -// http://libfreespace.hillcrestlabs.com/content/download. -// There are prebuilt binaries for Windows, and source available that should -// work on Windows, Linux or OS X. You will need to make sure the header files -// and library are accessible to the compiler. libfreespace is released under -// the LGPL and we (Hillcrest Labs) view static and dynamic linking as the same. -// We (Hillcrest Labs) do not require code linked to libfreespace (statically or -// dynamically) to be released under any particular license. -//#define VRPN_USE_FREESPACE - -//------------------------ -// Instructs VRPN to include code for the Novint Falcon haptic device. -// Access is provided through the libnifalcon library library on Windows, -// MacOSX and Linux. This may require additional libraries for programming -// USB devices. Please consult the corresponding homepages. -//#define VRPN_USE_LIBNIFALCON - -//------------------------ -// Instructs VRPN to compile code to use Trivisio's Colibri inertial -// tracker. You will also need the SDK, which is available at -// http://www.trivisio.com/products/motiontracking/colibri#download -// (tested on Windows). VRPN_TRIVISIOCOLIBRI_H and -// VRPN_TRIVISIOCOLIBRI_LIB_PATH -// below point to the default installation locations on Windows. Edit them -// if installed elsewhere. Note that Trivisio.dll and pthreadVC2.dll need to be -// in -// the path when running the server on Windows -//#define VRPN_USE_TRIVISIOCOLIBRI - -//------------------------ -// Instructs VRPN to attempt to use HID. If you don't have libusb installed -// on Linux, you'll want to turn this off so that it doesn't fail to compile. -// This should work fine on Windows, so we define it by default there. -// For the Mac, let CMake configure this; the built-in Makefile doesn't know -// how to compile with local HIDAPI, which we now need. -// For Linux, you need to have HIDAPI (either local or otherwise) for this -// to work, so this definition is not in by default there. -#if defined(_WIN32) -#if !defined(__MINGW__) -#define VRPN_USE_HID -#endif -#endif - -//------------------------ -// Instructs VRPN to link in the source code to a local version of -// hidapi to access HID devices. The source code for this project -// is included as a git submodule under submodule/hidapi. To pull -// this down if it is not present, use the commands: -// 'git submodule init; git submodule update' from the vrpn directory. -// If you have a system hidapi and you prefer to use it, then do not -// define this here. Otherwise, define it so that VRPN will be able -// to access HID devices. -// Note that on Linux you will also need to have the libusb-1.0-0-dev -// package installed so that we can compile the code. You -// will also need to uncommment the SYSLIBS line for HID in the -// server_src/Makefile for this to link. -// On the Mac, this needs to be configured via CMake; the standard -// Makefile doesn't know how to handle HIDAPI. -#if !defined(__MINGW__) && !defined(__APPLE__) -#define VRPN_USE_LOCAL_HIDAPI -#endif - -//------------------------ -// Instructs VRPN to attempt to use LibUSB-1.0. This will compile and -// link servers that use USB directly (as opposed to those that use it -// through the HID interface). -// See http://libusb.sourceforge.net for more on LibUSB-1.0. -// Note that on Linux you will also need to have the libusb-1.0-0-dev -// package installed so that we can compile the code. You -// will also need to uncommment the SYSLIBS line for HID in the -// server_src/Makefile for this to link. -// Note that to compile on Windows you will need to have downloaded and -// installed -// the libusb.h file and libusb-1.0.lib files; the default location for -// the library is C:Program Files\libusb-1.0 and for the include file -// is in C:Program Files\libusb-1.0\libusb. To open a device on Windows, you -// will need to have installed a driver that lets LibUSB open the -// device. Generic HID devices and devices that use a WinUSB driver -// should work without adding a driver. If you need to add a driver, -// consider using the libUSB Zadig.exe program; do not do this for a -// HID device or a device that has another driver, as it can prevent the -// device from operating except through LibUSB. -// Note that on Linux you will also need to have the libusb-1.0-0-dev -// package installed so that we can compile the code. -//#define VRPN_USE_LIBUSB_1_0 - -// Instructs VRPN to compile code to handle JSON network messages. -// This requires jsoncpp. -// JSON Network (UDP) mesages are used by the vrpn widgets for Android, -//#define VRPN_USE_JSONNET - -//------------------------ -// Instructs VRPN to compile code to use the Arrington Research -// ViewPoint EyeTracker. You will also need to set VRPN_VIEWPOINT_H -// and VRPN_VIEWPOINT_LIB_PATH below to point to the correct location -// on your system. Note that the VRPN server and ViewPoint calibration -// software must use the same copy of the VPX_InterApp.dll -//#define VRPN_USE_VIEWPOINT - -//------------------------ -// Use DevInput devices. -#if defined(linux) && !defined(__APPLE__) -#define VRPN_USE_DEV_INPUT -#endif - -//------------------------- -// Use Linux kernel joystick support: -// note that using this kernel header -// makes the GPL apply to the server! -#if defined(linux) -#define VRPN_USE_JOYLIN -#endif - -//------------------------ -// Instructs VRPN to compile code to use the Polhemus Developer -// (PDI) library to enable opening several of their trackers using -// this interface (the G4 was the original one this was written -// for, but new versions are available for the Fastrak and Liberty). -//#define VRPN_USE_PDI - -//------------------------------------------------------------------// -// SYSTEM CONFIGURATION SECTION // -// EDIT THESE DEFINITIONS TO POINT TO OPTIONAL LIBRARIES. THEY ARE // -// USED BELOW TO LOCATE LIBRARIES AND INCLUDE FILES. // -//------------------------------------------------------------------// - -#define VRPN_SYSTEMDRIVE "C:" - -#define VRPN_PHASESPACE_LIB_PATH "../../phasespace/" - -#define VRPN_WIIUSE_H "E:/borland/lib/wiiuse_v0.12_win/wiiuse.h" -#define VRPN_WIIUSE_LIB_PATH "E:/borland/lib/wiiuse_v0.12_win" - -#if defined(VRPNDLL_EXPORTS) && !defined(VRPN_USE_SHARED_LIBRARY) -#define VRPN_FREESPACE_LIB_PATH "../libfreespace/lib" -#else -#define VRPN_FREESPACE_LIB_PATH "../../libfreespace/lib" -#endif - -#define VRPN_TRIVISIOCOLIBRI_H \ - "C:/Program Files/Trivisio/Colibri/include/TrivisioColibri.h" -#define VRPN_TRIVISIOCOLIBRI_LIB_PATH "C:/Program Files/Trivisio/Colibri/lib/" - -#define VRPN_VIEWPOINT_H "E:/borland/lib/ViewPoint 2.8.6.21/SDK/vpx.h" -#define VRPN_VIEWPOINT_LIB_PATH "E:/borland/lib/ViewPoint 2.8.6.21/SDK/" - -#ifdef linux -#define VRPN_HDAPI_PATH "/usr/lib64" -#else -#define VRPN_HDAPI_PATH VRPN_SYSTEMDRIVE "/Program Files/SensAble/3DTouch/lib/" -#endif -#define VRPN_HDAPI_UTIL_PATH \ - VRPN_SYSTEMDRIVE "/Program Files/SensAble/3DTouch/utilities/lib/" -#define VRPN_GHOST_31_PATH \ - VRPN_SYSTEMDRIVE "/Program Files/SensAble/GHOST/v3.1/lib/" -#define VRPN_GHOST_40_PATH \ - VRPN_SYSTEMDRIVE "/Program Files/SensAble/GHOST/v4.0/lib/" - -#define VRPN_NIDAQ_PATH \ - VRPN_SYSTEMDRIVE "/Program Files/National Instruments/NI-DAQ/Lib/" -#define VRPN_NIDAQ_MX_PATH \ - VRPN_SYSTEMDRIVE "/Program Files/National Instruments/NI-DAQ/DAQmx ANSI " \ - "C Dev/lib/msvc/" -#define VRPN_USDIGITAL_PATH VRPN_SYSTEMDRIVE "/Program Files/SEI Explorer/" - -#ifdef VRPN_USE_MPI -#pragma comment(lib, VRPN_SYSTEMDRIVE "/Program Files/MPICH2/lib/mpi.lib") -#endif - -#ifdef VRPN_USE_MODBUS -#ifdef _DEBUG -#pragma comment(lib, VRPN_SYSTEMDRIVE \ - "/Program Files/usr/local/lib/libmodbusd.lib") -#else -#pragma comment(lib, \ - VRPN_SYSTEMDRIVE "/Program Files/usr/local/lib/libmodbus.lib") -#endif -#endif - -// Load Adrienne libraries if we are using the timecode generator. -// If this doesn't match where you have installed these libraries, -// edit the following lines to point at the correct libraries. Do -// this here rather than in the project settings so that it can be -// turned on and off using the definition above. -#ifdef VRPN_INCLUDE_TIMECODE_SERVER -#pragma comment(lib, "../../Adrienne/AEC_DLL/AEC_NTTC.lib") -#endif - -#ifdef VRPN_USE_LIBUSB_1_0 -#define VRPN_LIBUSB_PATH VRPN_SYSTEMDRIVE "/Program Files/libusb-1.0/" -#endif - -//---------------------------------------------------------------// -// DO NOT EDIT BELOW THIS LINE FOR NORMAL CONFIGURATION SETTING. // -//---------------------------------------------------------------// - -// Use this macro in a file if it might be empty (compiling out completely) -// to squash Visual Studio warning LNK4221. -// Inspiration from -// http://stackoverflow.com/questions/1822887/what-is-the-best-way-to-eliminate-ms-visual-c-linker-warning-warning-lnk422 -#ifdef _MSC_VER -#define VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() \ - namespace { \ - char vrpn_SuppressEmptyObjectDummy##__LINE__; \ - } -#else -#define VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() -#endif - -// DirectInput include file and libraries. -// Load DirectX SDK libraries and tell which version we need if we are using it. -#ifdef VRPN_USE_DIRECTINPUT -#define DIRECTINPUT_VERSION 0x0800 -#include <dinput.h> -#endif - -// autolinking pragma only works/makes sense with MSVC -#ifdef _MSC_VER // [ - -// Load the library for WiiUse. -#ifdef VRPN_USE_WIIUSE -#ifdef _DEBUG -#pragma comment(lib, VRPN_WIIUSE_LIB_PATH "/msvc/Debug/wiiuse.lib") -#else -#pragma comment(lib, VRPN_WIIUSE_LIB_PATH "/msvc/Release/wiiuse.lib") -#endif -#endif - -#ifdef VRPN_USE_FREESPACE -#ifdef _DEBUG -// #pragma comment(lib, VRPN_FREESPACE_LIB_PATH "/Debug/libfreespaced.lib") -#pragma comment(lib, VRPN_FREESPACE_LIB_PATH "/Release/libfreespace.lib") -#else -#pragma comment(lib, VRPN_FREESPACE_LIB_PATH "/Release/libfreespace.lib") -#endif -#endif - -// Load VRPN Phantom library if we are using phantom server as unified server -// Load SensAble Technologies GHOST library to run the Phantom -// NOTE: The paths to these libraries are set in the Settings/Link tab of -// the various project files. The paths to the include files are in the -// Settings/C++/preprocessor tab. -#ifdef VRPN_USE_PHANTOM_SERVER -#ifdef VRPN_USE_HDAPI -#pragma comment(lib, VRPN_HDAPI_PATH "hd.lib") -#ifdef _DEBUG -#pragma comment(lib, VRPN_HDAPI_UTIL_PATH "hdud.lib") -#else -#pragma comment(lib, VRPN_HDAPI_UTIL_PATH "hdu.lib") -#endif -#pragma comment(lib, VRPN_HDAPI_PATH "hl.lib") -#else -#ifdef VRPN_USE_GHOST_31 -#pragma comment(lib, VRPN_GHOST_31_PATH "GHOST31.lib") -#else -#pragma comment(lib, VRPN_GHOST_40_PATH "GHOST40.lib") -#endif -#endif -#endif - -#ifdef VRPN_USE_DIRECTINPUT -#pragma comment(lib, "dxguid.lib") -// Newer versions of the SDK have renamed this dxerr.lib; -// dxerr9.lib has also been said to work. -#pragma comment(lib, "dxerr.lib") -#pragma comment(lib, "dinput8.lib") -#endif - -// Load National Instruments libraries if we are using them. -// If this doesn't match where you have installed these libraries, -// edit the following lines to point at the correct libraries. Do -// this here rather than in the project settings so that it can be -// turned on and off using the definition above. -// NOTE: The paths to these libraries are set in the Settings/Link tab of -// the various project files. The paths to the include files are in the -// Settings/C++/preprocessor tab. -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS -#pragma comment(lib, VRPN_NIDAQ_PATH "nidaq32.lib") -#pragma comment(lib, VRPN_NIDAQ_PATH "nidex32.lib") -#endif -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX -#pragma comment(lib, VRPN_NIDAQ_MX_PATH "NIDAQmx.lib") -#endif - -// Load US Digital libraries if we are using them. -// If this doesn't match where you have installed these libraries, -// edit the following lines to point at the correct libraries. Do -// this here rather than in the project settings so that it can be -// turned on and off using the definition above. -// NOTE: The paths to these libraries are set in the Settings/Link tab of -// the various project files. The paths to the include files are in the -// Settings/C++/preprocessor tab. -#ifdef VRPN_USE_USDIGITAL -#pragma comment(lib, VRPN_USDIGITAL_PATH "SEIDrv32.lib") -#endif - -// Load Microscribe-3D SDK libraries -// If this doesn't match where you have installed these libraries, -// edit the following lines to point at the correct libraries. Do -// this here rather than in the project settings so that it can be -// turned on and off using the definition above. -#ifdef VRPN_USE_MICROSCRIBE -#pragma comment(lib, "armdll32.lib") -#endif - -// Load Trivisio Colibri library -#ifdef VRPN_USE_TRIVISIOCOLIBRI -#pragma comment(lib, VRPN_TRIVISIOCOLIBRI_LIB_PATH "Trivisio.lib") -#endif - -// Load Arrington Research ViewPoint EyeTracker library -#ifdef VRPN_USE_VIEWPOINT -#pragma comment(lib, VRPN_VIEWPOINT_LIB_PATH "VPX_InterApp.lib") -#endif - -#ifdef VRPN_USE_LIBUSB_1_0 -#pragma comment(lib, VRPN_LIBUSB_PATH "libusb-1.0.lib") -#endif - -#endif // ] _MSC_VER - -// This will be defined in the VRPN (non-DLL) project and nothing else -// Overrides USE_SHARED_LIBRARY to get rid of "inconsistent DLL linkage" -// warnings. -#ifdef VRPNDLL_NOEXPORTS -#undef VRPN_USE_SHARED_LIBRARY -#endif - -// This will be defined in the VRPN (DLL) project and nothing else -// Forces "USE_SHARED_LIBRARY independent of definition above so that the -// DLL will build -#if defined(VRPNDLL_EXPORTS) && !defined(VRPN_USE_SHARED_LIBRARY) -#define VRPN_USE_SHARED_LIBRARY -#endif - -// For client code, make sure we add the proper library dependency to the linker -#ifdef _WIN32 // [ -#ifdef _MSC_VER // [ -#ifdef VRPN_USE_WINSOCK2 -#pragma comment(lib, "ws2_32.lib") // VRPN requires the Windows Sockets library. -#else -#pragma comment(lib, \ - "wsock32.lib") // VRPN requires the Windows Sockets library. -#endif -#endif // ] _MSC_VER -#ifdef VRPN_USE_SHARED_LIBRARY -#ifdef VRPNDLL_EXPORTS -#define VRPN_API __declspec(dllexport) -#else -#define VRPN_API __declspec(dllimport) -#endif -#else -#define VRPN_API -#endif -#define VRPN_CALLBACK __stdcall -#else // ] WIN32 [ -// In the future, other architectures may need their own sections -#define VRPN_API -#define VRPN_CALLBACK -#endif // ] not WIN32 - -#define VRPN_CONFIGURE_H -#endif - -#else // VRPN_USING_CMAKE - -// When using CMake, we need to use the vrpn_Configure.h generated in the -// build directory instead. - -//#pragma message "NOTE: File included \"vrpn_Configure.h\" from the source dir -// even though this is a CMake build!" -#ifndef VRPN_CONFIGURE_FORWARDING -#define VRPN_CONFIGURE_FORWARDING -#include VRPN_USING_CMAKE -#undef VRPN_CONFIGURE_FORWARDING -#else -#error \ - "Build system error: non-CMake vrpn_Configure.h being repeatedly/recursively included" -#endif -#endif diff --git a/src/vrpn/vrpn_Configure.h.cmake_in b/src/vrpn/vrpn_Configure.h.cmake_in deleted file mode 100644 index 71fd6ac1a4d208a1d65e2f34c97aaa6d46140c85..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Configure.h.cmake_in +++ /dev/null @@ -1,523 +0,0 @@ -#ifndef VRPN_CONFIGURE_H - -//-------------------------------------------------------------- -/* IMPORTANT NOTE: If this file is named vrpn_Configure.h, it is - AUTOMATICALLY GENERATED from vrpn_Configure.h.cmake_in - using the options selected in CMake. Do not edit this - autogenerated vrpn_Configure.h because your changes will be - overwritten. - - Until all modules are fully configured using CMake, you may - have to edit the paths that are listed near the bottom of the - first section of the input file, vrpn_Configure.h.cmake_in - then re-run CMake to regenerate vrpn_Configure.h. */ -//-------------------------------------------------------------- - -// If true, only build the client-side code into the VRPN library. -// This makes it smaller and requires less linking with external -// libraries. -// -// If this is defined in this header file, it means that only the -// client library was built, so the header file was able to show -// this specialization. If it's not defined here, that may mean both -// libraries were built, passing the definition for the client library -// directly to the compiler, meaning that defining it in your app -// is up to you. -// -// The ifndef here means that it's always safe for you to define -// VRPN_CLIENT_ONLY without risking re-definition warnings/errors. -#ifndef VRPN_CLIENT_ONLY -#cmakedefine VRPN_CLIENT_ONLY -#endif - -//-------------------------------------------------------------- -/* This file contains configuration options for VRPN. The first - section has definition lines that can be commented in or out - at build time. The second session has automaticly-generated - directives and should not be edited. */ -//-------------------------------------------------------------- - -//--------------------------------------------------------// -// EDIT BELOW THIS LINE FOR NORMAL CONFIGURATION SETTING. // -//--------------------------------------------------------// - -//----------------------- -// Default port to listen on for a server. It used to be 4500 -// up through version 6.03, but then all sorts of VPNs started -// using this, as did Microsoft. Port 3883 was assigned to VRPN -// by the Internet Assigned Numbers Authority (IANA) October, 2003. -// Change this to make a location-specific default if you like. -// The parentheses are to keep it from being expanded into something -// unexpected if the code has a dot after it. -#define vrpn_DEFAULT_LISTEN_PORT_NO (3883) - -//----------------------- -// Use compile-time static asserts. -#cmakedefine VRPN_USE_STATIC_ASSERTIONS - -//----------------------- -// Use Winsock2 library rather than Winsock. -#cmakedefine VRPN_USE_WINSOCK2 - -//----------------------- -// Instructs VRPN to expose the vrpn_gettimeofday() function also -// as gettimeofday() so that external programs can use it. This -// has no effect on any system that already has gettimeofday() -// defined, and is put here for Windows. This function should -// not really be implemented within VRPN, but it was expedient to -// include it when porting applications to Windows. Turn this -// off if you have another implementation, or if you want to call -// vrpn_gettimeofday() directly. -#define VRPN_EXPORT_GETTIMEOFDAY - -//----------------------- -// Tells VRPN to compile with support for the Message-Passing -// Interface (MPI) library. There is a configuration section below -// that has a library path for the MPI library to link against. -// You will need to add the path to mpi.h and other needed files -// into your Visual Studio Tools/Options/Projects and Solutions/ -// C++ Directories include path. The original implementation is -// done with MPICH2, but an attempt has been made to use only -// MPI version 1 basic functions. -#cmakedefine VRPN_USE_MPI - -//----------------------- -// Tells VRPN to compile with support for the Modbus -// library. -#cmakedefine VRPN_USE_MODBUS - -//----------------------- -// Instructs VRPN to use phantom library to construct a unified -// server, using phantom as a common device, and phantom -// configuration in .cfg file. -#cmakedefine VRPN_USE_PHANTOM_SERVER - -//------------------------ -// Instructs vrpn to use SensAble's HDAPI rather than GHOST library. -// Only used in conjuntion with VRPN_USE_PHANTOM_SERVER. -// PLEASE SPECIFY PATH TO HDAPI IN NEXT SECTION IF YOU USE THIS. -// Also, you need to go to the vrpn_phantom and vrpn_server projects -// and remove the GHOST include directories from the include paths. -// Yes, HDAPI fails if it even has them in the path (as so many other -// things also fail). At least we're rid of them now. When you -// uncomment it (to use GHOST), add the following to the include -// directories for the vrpn_phantom project: $(SYSTEMDRIVE)\Program -// Files\SensAble\GHOST\v4.0\include,$(SYSTEMDRIVE)\Program -// Files\SensAble\GHOST\v4.0\external\stl, -#cmakedefine VRPN_USE_HDAPI - -//------------------------ -// Instructs vrpn to use Ghost 3.1 instead of Ghost 3.4. -// Only used in conjuntion with VRPN_USE_PHANTOM_SERVER. -// PLEASE SPECIFY PATH TO GHOSTLIB IN NEXT SECTION IF YOU USE THIS -// (This is expected to be used on systems where Ghost 4.0 is not -// available, such as the SGI platform. If you are using this on -// a Windows PC with Visual Studio, you will need to alter -// server_src/vrpn_phantom.dsp to reference the Ghost 3.1 include -// paths.) -#cmakedefine VRPN_USE_GHOST_31 - -//----------------------- -// Instructs VRPN to use the high-performance timer code on -// Windows, rather than the default clock which has an infrequent -// update. At one point in the past, an implementation of this -// would only work correctly on some flavors of Windows and with -// some types of CPUs. -// There are actually two implementations -// of the faster windows clock. The original one, made by Hans -// Weber, checks the clock rate to see how fast the performance -// clock runs (it takes a second to do this when the program -// first calls vrpn_gettimeofday()). The second version by Haris -// Fretzagias relies on the timing supplied by Windows. To use -// the second version, also define VRPN_WINDOWS_CLOCK_V2. -#define VRPN_UNSAFE_WINDOWS_CLOCK -#define VRPN_WINDOWS_CLOCK_V2 - -//----------------------- -// Instructs VRPN library and server to include code that uses -// the DirectX SDK. If you set this, you may to edit the -// system configuration section below to point at the correct version -// of DirectX. WARNING: With the August 2006 DirectX SDK, you -// cannot link against the debug library in Visual Studio 6.0, -// only the release. Hopefully, Visual Studio.NET doesn't have -// this problem. -// IMPORTANT! If you define this, you need to edit the Tools/Options -// menu: -// For Visual studio 6, use the Directories tab, and add the -// include and lib paths to the TOP of the lists for all configurations. -// For Visual studio .NET, add to the top of the Projects and Solutions/ -// VC++ Directories entry. -// This will let the code find the right version when it compiles. -#cmakedefine VRPN_USE_DIRECTINPUT -#cmakedefine VRPN_USE_WINDOWS_XINPUT - -// The DirectInput-based zSight tracker requires ATL for smart pointers, -// which sadly isn't everywhere (VC Express, MXE cross compiling, ...). -#cmakedefine VRPN_HAVE_ATLBASE - -//----------------------- -// Instructs VRPN library and server to include code that uses -// the DirectShow SDK. If you set this, you may to edit the -// system configuration section below to point at the correct version -// of the Platform SDK. WARNING: With the August 2006 DirectX SDK, you -// cannot link against the debug library in Visual Studio 6.0, -// only the release. Visual Studio.NET doesn't have this problem. -#cmakedefine VRPN_USE_DIRECTSHOW - -//----------------------- -// Instructs the VRPN server to create an entry for the Adrienne -// time-code generator. This is a device that produces time values -// from an analog video stream so that events in the virtual world -// can be synchronized with events on a movie. The Adrienne folder -// should be located at the same level as the VRPN folder for the -// code to find it. -#cmakedefine VRPN_INCLUDE_TIMECODE_SERVER -#cmakedefine VRPN_ADRIENNE_INCLUDE_FILENAME "@VRPN_ADRIENNE_INCLUDE_FILENAME@" -#cmakedefine VRPN_ADRIENNE_INCLUDE_HAS_EXTERN_C - -//----------------------- -// Compiles the InterSense Tracker using the -// InterSense Interface Libraries SDK (tested for version -// 3.45) on windows. This should work with all Intersense trackers, -// both the USB and the serial port versions. The files isense.h, -// types.h and isense.c should be put in a directory called 'isense' -// at the same level as the vrpn directory. The isense.dll should -// be put either in Windows/system32 or in the location where the -// executable lives or somewhere on the path. -#cmakedefine VRPN_INCLUDE_INTERSENSE - -//----------------------- -// Instructs VRPN library and server to include code that uses -// the National Instruments Nidaq library to control analog outputs. -// Later in this file, we also instruct the compiler to link with -// the National Instruments libraries if this is defined. Either or -// both of these can be defined, depending on which library you -// need to use. -#cmakedefine VRPN_USE_NATIONAL_INSTRUMENTS -#cmakedefine VRPN_USE_NATIONAL_INSTRUMENTS_MX - -//----------------------- -// Instructs VRPN library and server to include code that uses -// the US Digital SEI/A2 library to control analog inputs from the -// A2 absolute encoder. -// Later in this file, we also instruct the compiler to link with -// the US Digital library if this is defined. You also need to -// define VRPN_USE_NATIONAL_INSTRUMENTS_MX above if you want to -// use this. -#cmakedefine VRPN_USE_USDIGITAL - -//----------------------- -// Instructs VRPN to use the default room space transforms for -// the Desktop Phantom as used in the nanoManipulator application -// rather than the default world-origin with identity rotation. -// Please don't anyone new use the room space transforms built -// into VRPN -- they are a hack pulled forward from Trackerlib. -#define DESKTOP_PHANTOM_DEFAULTS - -//------------------------ -// Instructs VRPN to use microscribe3D library to construct a unified -// server -#cmakedefine VRPN_USE_MICROSCRIBE - -//------------------------ -// Compiles the VRPN library with the PhaseSpace Tracker using the -// PhaseSpace OWL API on Linux and Windows. -// -// In Linux: -// The PhaseSpace header files (owl.h, etc) and libraries (libowlsock) -// should be placed in the phasespace directory at the same level as -// the vrpn folder. Also, PHASESPACE needs to be uncommented in the -// server_src/Makefile so that the libraries are properly linked. -// libowlsock.so will need to be present in the directory of the -// final executable or in the default library path such as /usr/lib -// -// In Windows: -// The PhaseSpace header files (owl.h, etc) should be placed in the -// phasespace directory at the same level as the vrpn folder. -// libowlsock.lib will need to be located there as well. -// libowlsock.dll will need to be in the path or with the executable -// at run time. Edit the path below to say where the .lib file -// can be found. -// -#cmakedefine VRPN_INCLUDE_PHASESPACE - -//----------------------- -// Instructs VRPN to use a DLL interface on Windows systems. -// When using this, link with VRPNDLL.LIB (and VRPN.DLL) rather -// than VRPN.LIB in user code. This is experimental and is -// under development to enable C# and other languages to pull in -// VRPN. This is only needed when trying to link VRPN with -// languages other than C++ (and not even for Java). If you don't -// have a good reason to, don't define it. -// Not implemented for .so-based Unix systems. -#cmakedefine VRPN_USE_SHARED_LIBRARY - -//------------------------ -// Instructs VRPN to use GPM Linux interface mouse interface. -// WARNING: If you define this, then you must also edit the server_src -// Makefile to include "-lgpm" into the SYSLIBS definition line for the -// architecture you use this on. We had to change this because not all -// Linux releases included this library. -#cmakedefine VRPN_USE_GPM_MOUSE - -//------------------------ -// Instructs VRPN to use the Motion C API library to interface VRPN to -// the their MotionNode tracker. Requires the shared library at run-time -// to function. No external dependencies to build. -#cmakedefine VRPN_USE_MOTIONNODE - -//------------------------ -// Instructs VRPN to compile code for the Nintendo Wii Remote controller, -// getting access to it through the Wiiuse library in Windows and Linux. -// Note that this requires installing a bunch of other stuff, and that some -// bluetooth stacks cause people trouble. See the README file in the WiiUse -// library for more info. Also note that the -// WiiUse library is GPL, which is more restrictive than the VRPN public- -// domain license, so check out its license file before building this driver -// into your code. The original WiiUse library was abandoned and a new -// fork by Ryan Pavlik is available at https://github.com/rpavlik/wiiuse. -// To get the WiiUse library to compile on Visual Studio 2005 (apparently -// not for VS 2008), you need to add the include path -// to the driver developer kit (C:\WINDDK\3790.1830\inc\wxp) and the -// library path to hid.lib (C:\WINDDK\3790.1830\lib\wxp\i386) to the -// include and library directories in Visual Studio. -// Also, edit the configuration below to point to the WiiUse include -// file and library. -// Note that the wiiuse.dll needs to be in the path when running a server -// that uses WiiUse in Windows. -#cmakedefine VRPN_USE_WIIUSE - -// Instructs VRPN to compile code to handle Hillcrest Labs' Freespace -// devices such as the Loop, and FRCM. You will also need the libfreespace -// library which is available at -// http://libfreespace.hillcrestlabs.com/content/download. -// There are prebuilt binaries for Windows, and source available that should -// work on Windows, Linux or OS X. You will need to make sure the header files -// and library are accessible to the compiler. libfreespace is released under -// the LGPL and we (Hillcrest Labs) view static and dynamic linking as the same. -// We (Hillcrest Labs) do not require code linked to libfreespace (statically or -// dynamically) to be released under any particular license. -#cmakedefine VRPN_USE_FREESPACE - -//------------------------ -// Instructs VRPN to include code for the Novint Falcon haptic device. -// Access is provided through the libnifalcon library library on Windows, -// MacOSX and Linux. This may require additional libraries for programming -// USB devices. Please consult the corresponding homepages. -#cmakedefine VRPN_USE_LIBNIFALCON - -//------------------------ -// Instructs VRPN to compile code to use Trivisio's Colibri inertial -// tracker. You will also need the SDK, which is available at -// http://www.trivisio.com/products/motiontracking/colibri#download -// (tested on Windows). VRPN_TRIVISIOCOLIBRI_H and -// VRPN_TRIVISIOCOLIBRI_LIB_PATH -// below point to the default installation locations on Windows. Edit them -// if installed elsewhere. Note that Trivisio.dll and pthreadVC2.dll need to be -// in -// the path when running the server on Windows -#cmakedefine VRPN_USE_TRIVISIOCOLIBRI - -//------------------------ -// Instructs VRPN to attempt to use HID. If you don't have libusb installed -// on Linux, you'll want to turn this off so that it doesn't fail to compile. -// This should work fine on Windows and Mac. -#cmakedefine VRPN_USE_HID - -//------------------------ -// Instructs VRPN to link in the source code to a local version of -// hidapi to access HID devices. The source code for this project -// is included as a git submodule under submodule/hidapi. To pull -// this down if it is not present, use the commands: -// 'git submodule init; git submodule update' from the vrpn directory. -// If you have a system hidapi and you prefer to use it, then do not -// define this here. Otherwise, define it so that VRPN will be able -// to access HID devices. -// Note that on Linux you will also need to have the libusb package -// installed in order to compile HIDAPI. You'll also need to uncomment -// the Makefile line in server_src that links with usb. -#cmakedefine VRPN_USE_LOCAL_HIDAPI - -//------------------------ -// Instructs VRPN to attempt to use LibUSB-1.0. This will compile and -// link servers that use USB directly (as opposed to those that use it -// through the HID interface). -// See http://libusb.sourceforge.net for more on LibUSB-1.0. -// Note that on Linux you will also need to have the libusb-1.0-0-dev -// package installed so that we can compile the code. You -// will also need to uncommment the SYSLIBS line for HID in the -// server_src/Makefile for this to link. -// Note that to compile on Windows you will need to have downloaded and -// installed -// the libusb.h file and libusb-1.0.lib files; the default location for -// the library is C:Program Files\libusb-1.0 and for the include file -// is in C:Program Files\libusb-1.0\libusb. To open a device on Windows, you -// will need to have installed a driver that lets LibUSB open the -// device. Generic HID devices and devices that use a WinUSB driver -// should work without adding a driver. If you need to add a driver, -// consider using the libUSB Zadig.exe program; do not do this for a -// HID device or a device that has another driver, as it can prevent the -// device from operating except through LibUSB. -// Note that on Linux you will also need to have the libusb-1.0-0-dev -// package installed so that we can compile the code. -#cmakedefine VRPN_USE_LIBUSB_1_0 - -// Instructs VRPN to compile code to handle JSON network messages. -// This requires jsoncpp. -// JSON Network (UDP) mesages are used by the vrpn widgets for Android, -#cmakedefine VRPN_USE_JSONNET - -//------------------------ -// Instructs VRPN to compile code to use the Arrington Research -// ViewPoint EyeTracker. You will also need to set VRPN_VIEWPOINT_H -// and VRPN_VIEWPOINT_LIB_PATH below to point to the correct location -// on your system. Note that the VRPN server and ViewPoint calibration -// software must use the same copy of the VPX_InterApp.dll -#cmakedefine VRPN_USE_VIEWPOINT -#define VRPN_VIEWPOINT_H "vpx.h" -#cmakedefine VRPN_VIEWPOINT_LIB_PATH "@VRPN_VIEWPOINT_LIB_PATH@" - -//------------------------ -// Use DevInput devices. -#cmakedefine VRPN_USE_DEV_INPUT - -//------------------------- -// Use Linux kernel joystick support: -// note that using this kernel header -// makes the GPL apply to the server! -#cmakedefine VRPN_USE_JOYLIN - -//------------------------ -// Instructs VRPN to compile code to use the Polhemus Developer -// (PDI) library to enable opening several of their trackers using -// this interface (the G4 was the original one this was written -// for, but new versions are available for the Fastrak and Liberty). -#cmakedefine VRPN_USE_PDI - -//------------------------------------------------------------------// -// SYSTEM CONFIGURATION SECTION // -// EDIT THESE DEFINITIONS TO POINT TO OPTIONAL LIBRARIES. THEY ARE // -// USED BELOW TO LOCATE LIBRARIES AND INCLUDE FILES. // -//------------------------------------------------------------------// - -#define VRPN_SYSTEMDRIVE "C:" - -#define VRPN_PHASESPACE_LIB_PATH "../../phasespace/" - -#define VRPN_WIIUSE_H "wiiuse.h" - -#define VRPN_TRIVISIOCOLIBRI_H \ - "C:/Program Files/Trivisio/Colibri/include/TrivisioColibri.h" -#define VRPN_TRIVISIOCOLIBRI_LIB_PATH "C:/Program Files/Trivisio/Colibri/lib/" -#define VRPN_GHOST_31_PATH \ - VRPN_SYSTEMDRIVE "/Program Files/SensAble/GHOST/v3.1/lib/" -#define VRPN_GHOST_40_PATH \ - VRPN_SYSTEMDRIVE "/Program Files/SensAble/GHOST/v4.0/lib/" - -#define VRPN_NIDAQ_PATH \ - VRPN_SYSTEMDRIVE "/Program Files/National Instruments/NI-DAQ/Lib/" -#define VRPN_USDIGITAL_PATH VRPN_SYSTEMDRIVE "/Program Files/SEI Explorer/" - -//---------------------------------------------------------------// -// DO NOT EDIT BELOW THIS LINE FOR NORMAL CONFIGURATION SETTING. // -//---------------------------------------------------------------// - -// Use this macro in a file if it might be empty (compiling out completely) -// to squash Visual Studio warning LNK4221. -// Inspiration from -// http://stackoverflow.com/questions/1822887/what-is-the-best-way-to-eliminate-ms-visual-c-linker-warning-warning-lnk422 -#ifdef _MSC_VER -#define VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() \ - namespace { \ - char vrpn_SuppressEmptyObjectDummy##__LINE__; \ - } -#else -#define VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() -#endif - -// autolinking pragma only works/makes sense with MSVC -#ifdef _MSC_VER // [ - -// Load National Instruments libraries if we are using them. -// If this doesn't match where you have installed these libraries, -// edit the following lines to point at the correct libraries. Do -// this here rather than in the project settings so that it can be -// turned on and off using the definition above. -// NOTE: The paths to these libraries are set in the Settings/Link tab of -// the various project files. The paths to the include files are in the -// Settings/C++/preprocessor tab. -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS -#pragma comment(lib, VRPN_NIDAQ_PATH "nidaq32.lib") -#pragma comment(lib, VRPN_NIDAQ_PATH "nidex32.lib") -#endif - -// Load US Digital libraries if we are using them. -// If this doesn't match where you have installed these libraries, -// edit the following lines to point at the correct libraries. Do -// this here rather than in the project settings so that it can be -// turned on and off using the definition above. -// NOTE: The paths to these libraries are set in the Settings/Link tab of -// the various project files. The paths to the include files are in the -// Settings/C++/preprocessor tab. -#ifdef VRPN_USE_USDIGITAL -#pragma comment(lib, VRPN_USDIGITAL_PATH "SEIDrv32.lib") -#endif - -// Load Microscribe-3D SDK libraries -// If this doesn't match where you have installed these libraries, -// edit the following lines to point at the correct libraries. Do -// this here rather than in the project settings so that it can be -// turned on and off using the definition above. -#ifdef VRPN_USE_MICROSCRIBE -#pragma comment(lib, "armdll32.lib") -#endif - -// Load Trivisio Colibri library -#ifdef VRPN_USE_TRIVISIOCOLIBRI -#pragma comment(lib, VRPN_TRIVISIOCOLIBRI_LIB_PATH "Trivisio.lib") -#endif - -#endif // ] _MSC_VER - -// This will be defined in the VRPN (non-DLL) project and nothing else -// Overrides USE_SHARED_LIBRARY to get rid of "inconsistent DLL linkage" -// warnings. -#ifdef VRPNDLL_NOEXPORTS -#undef VRPN_USE_SHARED_LIBRARY -#endif - -// This will be defined in the VRPN (DLL) project and nothing else -// Forces "USE_SHARED_LIBRARY independent of definition above so that the -// DLL will build -#if defined(VRPNDLL_EXPORTS) && !defined(VRPN_USE_SHARED_LIBRARY) -#define VRPN_USE_SHARED_LIBRARY -#endif - -// For client code, make sure we add the proper library dependency to the linker -#ifdef _WIN32 // [ -#ifdef _MSC_VER // [ -#ifdef VRPN_USE_WINSOCK2 -#pragma comment(lib, "ws2_32.lib") // VRPN requires the Windows Sockets library. -#else -#pragma comment(lib, \ - "wsock32.lib") // VRPN requires the Windows Sockets library. -#endif -#endif // ] _MSC_VER -#ifdef VRPN_USE_SHARED_LIBRARY -#ifdef VRPNDLL_EXPORTS -#define VRPN_API __declspec(dllexport) -#else -#define VRPN_API __declspec(dllimport) -#endif -#else -#define VRPN_API -#endif -#define VRPN_CALLBACK __stdcall -#else // ] WIN32 [ -// In the future, other architectures may need their own sections -#define VRPN_API -#define VRPN_CALLBACK -#endif // ] not WIN32 - -#define VRPN_CONFIGURE_H -#endif diff --git a/src/vrpn/vrpn_Connection.C b/src/vrpn/vrpn_Connection.C deleted file mode 100644 index d6ffdc5a89c5ed63178051212f6d812b842431e1..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Connection.C +++ /dev/null @@ -1,6579 +0,0 @@ -// Must be done before stdio.h to avoid conflict for SEEK_SET, at least for -// MPICH2 on -// the Windows platform.. Note that this means we cannot include it in -// vrpn_Connection.h, -// because user code often includes stdio.h before and VRPN includes. -#ifdef VRPN_USE_MPI -#include <mpi.h> -#endif - -#ifndef _WIN32_WCE -#include <errno.h> // for errno, EINTR -#endif -#include <stddef.h> // for size_t -#include <stdio.h> // for fprintf, stderr, NULL, etc -#include <string.h> // for strlen, strcpy, memcpy, etc -#ifndef _WIN32_WCE -#include <signal.h> // for kill, signal, SIGKILL, etc -#ifdef sgi -#include <ctype.h> -#else -#include <cctype> // for isalnum -#endif -#endif - -// malloc.h is deprecated; all the functionality *should* -// be in stdlib.h -#include <stdlib.h> // for exit, atoi, getenv, system - -#include "vrpn_Connection.h" - -#ifdef VRPN_USE_WINSOCK_SOCKETS -// a socket in windows can not be closed like it can in unix-land -#define vrpn_closeSocket closesocket -#else -#define vrpn_closeSocket close -#include <arpa/inet.h> // for inet_addr -#include <netinet/in.h> // for sockaddr_in, ntohl, in_addr, etc -#include <sys/socket.h> // for getsockname, send, AF_INET, etc -#include <unistd.h> // for close, read, fork, etc -#ifdef _AIX -#define _USE_IRS -#endif -#include <netdb.h> // for hostent, gethostbyname, etc -#endif - -#ifdef sparc -#include <arpa/inet.h> // for inet_addr - -#define INADDR_NONE -1 -#endif - -#ifdef sgi -#include <bstring.h> -#endif - -#ifdef hpux -#include <arpa/nameser.h> -#include <resolv.h> // for herror() - but it isn't there? -#endif - -#ifndef VRPN_USE_WINSOCK_SOCKETS -#include <sys/wait.h> // for wait, wait3, WNOHANG -#ifndef __CYGWIN__ -#include <netinet/tcp.h> // for TCP_NODELAY -#endif /* __CYGWIN__ */ -#endif /* VRPN_USE_WINSOCK_SOCKETS */ - -// cast fourth argument to setsockopt() -#ifdef VRPN_USE_WINSOCK_SOCKETS -#define SOCK_CAST (char *) -#ifdef _WIN32_WCE -#define errno WSAGetLastError() -#define EINTR WSAEINTR -#endif -#else -#ifdef sparc -#define SOCK_CAST (const char *) -#else -#define SOCK_CAST -#endif -#endif - -#if defined(_AIX) || defined(__APPLE__) || defined(ANDROID) || defined(__linux) -#define GSN_CAST (socklen_t *) -#else -#if defined(FreeBSD) -#define GSN_CAST (unsigned int *) -#else -#define GSN_CAST -#endif -#endif - -// NOT SUPPORTED ON SPARC_SOLARIS -// gethostname() doesn't seem to want to link out of stdlib -#ifdef sparc -extern "C" { -int gethostname(char *, int); -} -#endif - -#include "vrpn_FileConnection.h" // for vrpn_File_Connection -#include "vrpn_Log.h" // for vrpn_Log - -struct timeval; - -//#define VERBOSE -//#define VERBOSE2 -//#define VERBOSE3 - -// On Win32, this constant is defined as ~0 (sockets are unsigned ints) -#ifndef VRPN_USE_WINSOCK_SOCKETS -#define INVALID_SOCKET -1 -#endif - -// Don't tell us about FD_SET() "conditional expression is constant" -#ifdef _WIN32 -#pragma warning(disable : 4127) -#endif - -// Syntax of vrpn_MAGIC: -// -// o The minor version number must follow the last period ('.') and be the -// only significant thing following the last period in the vrpn_MAGIC string. -// -// o Minor versions should interoperate. So, when establishing a connection, -// vrpn_MAGIC is checked through the last period. If everything up to, and -// including, the last period matches, a connection will be made. -// -// o If everything up to the last period matches, then a second check is -// preformed on everything after the last period (the minor version number). -// If the minor version numbers differ, a connection is still made, but a -// warning is printed to stderr. There is currently no way to suppress this -// warning message if the minor versions differ between the server and the -// client.. -// -// o The version checking described above is performed by the function -// check_vrpn_cookie, found in this file. check_vrpn_cookie returns a -// different value for each of these three cases. -// -[juliano 2000/08] -// -// [juliano 2000/08] Suggestion: -// -// We have the situation today that vrpn5 can read stream files that were -// produced by vrpn-4.x. However, the way the library is written, vrpn -// doesn't know this. Further, it is difficult to change this quickly, -// because vrpn_check_cookie doesn't know if it's being called for a network -// or a file connection. The purpose of this comment is to suggest a -// solution. -// -// Our temporary solution is to change the cookie, rebulid the library, and -// relink into our app. Then, our app can read stream files produced by -// vrpn4.x. -// -// Vrpn currently knows that live network connections between vrpn-4.x and -// vrpn-5.x apps are not possible. But, ideally, it should also know that -// it's ok for a vrpn-5.x app to read a vrpn-4.x streamfile. Unfortunately, -// coding this is difficult in the current framework. -// -// I suggest that check_vrpn_cookie should not be a global function, but -// should instead be a protected member function of vrpn_Connection. The -// default implementation would do what is currently done by the global -// check_vrpn_cookie. However, vrpn_FileConnection would override it and -// perform a more permissive check. -// -// This strategy would scale in the future when we move to vrpn-6.x and -// higher. It would also be useful if we ever realize after a release that -// VRPN-major.minor is actually network incompatible (but not streamfile -// incompatible) with VRPN-major.(minor-1). Then, the vrpn_check_cookie -// implementation in VRPN-major.(minor-1) could test for this incompatibility -// and print an appropriate diagnostic. Similar solution exists if release -// n+1 is file-compatible but later found to be network-incompatible with -// release n. -// -// Again, in our current framework, we cannot distinguish between -// file-compatible and network-compatible. In the future, we may also have -// shared-memory-access-compatible as well as other types of connection. The -// proposed strategy handles both partial major version compatibility as well -// as accidental partial minor version incompatibility. -// -const char *vrpn_MAGIC = (const char *)"vrpn: ver. 07.33"; -const char *vrpn_FILE_MAGIC = (const char *)"vrpn: ver. 04.00"; -const int vrpn_MAGICLEN = 16; // Must be a multiple of vrpn_ALIGN bytes! - -const char *vrpn_got_first_connection = "VRPN_Connection_Got_First_Connection"; -const char *vrpn_got_connection = "VRPN_Connection_Got_Connection"; -const char *vrpn_dropped_connection = "VRPN_Connection_Dropped_Connection"; -const char *vrpn_dropped_last_connection = - "VRPN_Connection_Dropped_Last_Connection"; - -const char *vrpn_CONTROL = "VRPN Control"; - -//********************************************************************** -//** This section has been pulled from the "SDI" library and had its -//** functions renamed to vrpn_ from sdi_. This removes our dependence -//** on libsdi.a for VRPN. - -#ifdef sparc - -// On capefear and swift, getdtablesize() isn't declared in unistd.h -// even though the man page says it should be. Similarly, wait3() -// isn't declared in sys/{wait,time,resource}.h. -extern "C" { -extern int getdtablesize(void); -pid_t wait3(int *statusp, int options, struct rusage *rusage); -} -#endif - -/* On HP's, this defines how many possible open file descriptors can be - * open at once. This is what is returned by the getdtablesize() function - * on other architectures. */ -#ifdef hpux -#define getdtablesize() MAXFUPLIM -#endif - -#ifdef __hpux -#define getdtablesize() MAXFUPLIM -#endif - -/* The version of rsh in /usr/local/bin is the AFS version that passes tokens - * to the remote machine. This will allow remote execution of anything you - * can execute locally. This is the default location from which to get rsh. - * If the VRPN_RSH environment variable is set, that will be used as the full - * path instead. */ -#ifdef linux -#define RSH (char *) "/usr/local/bin/ssh" -#else -#define RSH (char *) "/usr/local/bin/rsh" -#endif - -/* How long to wait for a UDP packet to cause a callback connection, - * and how many times to retry. */ -#define UDP_CALL_TIMEOUT (2) -#define UDP_CALL_RETRIES (5) - -/* How long to wait for the server to connect, and how many times to wait - * this long. The death of the child is checked for between each of the - * waits, in order to allow faster exit if the child quits before calling - * back. */ -#define SERVCOUNT (20) -#define SERVWAIT (120 / SERVCOUNT) - -// From vrpn_CONNECTION_MAX_SENDERS and vrpn_CONNECTION_MAX_TYPES -// in vrpn_Connection.h. - -#define vrpn_CONNECTION_MAX_XLATION_TABLE_SIZE 2000 - -/* - Major refactoring 18-20 April 2000 T. Hudson - - Broke two classes (vrpn_Connection, vrpn_OneConnection) into five: - - vrpn_TranslationTable - vrpn_TypeDispatcher - vrpn_Log - vrpn_Endpoint - vrpn_Connection - - Each Connection manages one Endpoint per Connection that it is - communicating with. Each Endpoint has a Log, and at a future date - some Connections may have their own logs. Each Endpoint has two - TranslationTables to map remote senders and types to their local - identifiers; these tables are also used by Logs. The entire system - shares a single TypeDispatcher to track local types, senders, and callbacks. - - This decomposition let me get rid of the circular references between - Connection and Endpoint and between Endpoint and Log. It lets us - have logs attached to both Endpoints and Connections. It better - isolates and identifies some of the functionality we're using. - - I've always thought the central component of VRPN is the TypeDispatcher, - which I've also seen in the (late '80s) commercial database middleware - I've hacked the internals of. There isn't an example of it in the - Gang-Of-4 "Design Patterns" book, but I'm doing a small Patterns literature - search to try to find it. - - This module's interface still only contains Connection and Endpoint. - The only reason Endpoint is visible is so that it can be used by - vrpn_FileConnection; unfortunately, it isn't easy to factor it out - of there. I'd suggest moving Connection and FileConnection into their - own directory; we can then extract all the classes out of this - file into their own C files. - - TypeDispatcher could certainly use a better name. -*/ - -/** - * @class vrpn_TranslationTable - * Handles translation of type and sender names between local and - * network peer equivalents. - * Used by Endpoints, Logs, and diagnostic code. - */ - -struct cRemoteMapping { - char *name; - vrpn_int32 remote_id; - vrpn_int32 local_id; -}; - -class vrpn_TranslationTable { - -public: - vrpn_TranslationTable(void); - ~vrpn_TranslationTable(void); - - // ACCESSORS - - vrpn_int32 numEntries(void) const; - vrpn_int32 mapToLocalID(vrpn_int32 remote_id) const; - - // MANIPULATORS - - void clear(void); - ///< Deletes every entry in the table. - - vrpn_int32 addRemoteEntry(cName name, vrpn_int32 remote_id, - vrpn_int32 local_id); - ///< Adds a name and local ID to the table, returning its - ///< remote ID. This exposes an UGLY hack in the VRPN internals - - ///< that ID is implicitly carried as the index into this array, - ///< and there isn't much in the way of checking (?). - vrpn_bool addLocalID(const char *name, vrpn_int32 local_id); - ///< Adds a local ID to a name that was already in the table; - ///< returns TRUE on success, FALSE if not found. - -private: - vrpn_int32 d_numEntries; - cRemoteMapping d_entry[vrpn_CONNECTION_MAX_XLATION_TABLE_SIZE]; -}; - -vrpn_TranslationTable::vrpn_TranslationTable(void) - : d_numEntries(0) -{ - int i; - - for (i = 0; i < vrpn_CONNECTION_MAX_XLATION_TABLE_SIZE; i++) { - d_entry[i].name = NULL; - d_entry[i].remote_id = -1; - d_entry[i].local_id = -1; - } -} - -vrpn_TranslationTable::~vrpn_TranslationTable(void) { clear(); } - -vrpn_int32 vrpn_TranslationTable::numEntries(void) const -{ - return d_numEntries; -} - -vrpn_int32 vrpn_TranslationTable::mapToLocalID(vrpn_int32 remote_id) const -{ - if ((remote_id < 0) || (remote_id > d_numEntries)) { - -#ifdef VERBOSE2 - // This isn't an error!? It happens regularly!? - fprintf(stderr, "vrpn_TranslationTable::mapToLocalID: " - "Remote ID %d is illegal!\n", - remote_id); -#endif - - return -1; - } - -#ifdef VERBOSE - fprintf(stderr, "Remote ID %d maps to local ID %d (%s).\n", remote_id, - d_entry[remote_id].local_id, d_entry[remote_id].name); -#endif - - return d_entry[remote_id].local_id; -} - -vrpn_int32 vrpn_TranslationTable::addRemoteEntry(cName name, - vrpn_int32 remote_id, - vrpn_int32 local_id) -{ - vrpn_int32 useEntry; - - useEntry = remote_id; - - if (useEntry >= vrpn_CONNECTION_MAX_XLATION_TABLE_SIZE) { - fprintf(stderr, "vrpn_TranslationTable::addRemoteEntry: " - "Too many entries in table (%d).\n", - d_numEntries); - return -1; - } - - // We do not check to see if this entry is already filled in. Such - // a check caused problems with vrpn_Control when reading from log files. - // Also, it will cause problems with multi-logging, where the connection - // may be requested to send all of its IDs again for a log file is opeened - // at a time other than connection set-up. - - if (!d_entry[useEntry].name) { - d_entry[useEntry].name = new cName; - if (!d_entry[useEntry].name) { - fprintf(stderr, "vrpn_TranslationTable::addRemoteEntry: " - "Out of memory.\n"); - return -1; - } - } - - memcpy(d_entry[useEntry].name, name, sizeof(cName)); - d_entry[useEntry].remote_id = remote_id; - d_entry[useEntry].local_id = local_id; - -#ifdef VERBOSE - fprintf(stderr, "Set up remote ID %d named %s with local equivalent %d.\n", - remote_id, name, local_id); -#endif - - if (d_numEntries <= useEntry) { - d_numEntries = useEntry + 1; - } - - return useEntry; -} - -vrpn_bool vrpn_TranslationTable::addLocalID(const char *name, - vrpn_int32 local_id) -{ - int i; - - for (i = 0; i < d_numEntries; i++) { - if (d_entry[i].name && !strcmp(d_entry[i].name, name)) { - d_entry[i].local_id = local_id; - return VRPN_TRUE; - } - } - return VRPN_FALSE; -} - -void vrpn_TranslationTable::clear(void) -{ - int i; - - for (i = 0; i < d_numEntries; i++) { - if (d_entry[i].name) { - delete[] d_entry[i].name; - d_entry[i].name = NULL; - } - d_entry[i].local_id = -1; - d_entry[i].remote_id = -1; - } - d_numEntries = 0; -} - -vrpn_Log::vrpn_Log(vrpn_TranslationTable *senders, vrpn_TranslationTable *types) - : d_logFileName(NULL) - , d_logmode(vrpn_LOG_NONE) - , d_logTail(NULL) - , d_firstEntry(NULL) - , d_file(NULL) - , d_magicCookie(NULL) - , d_wroteMagicCookie(vrpn_FALSE) - , d_filters(NULL) - , d_senders(senders) - , d_types(types) -{ - - d_lastLogTime.tv_sec = 0; - d_lastLogTime.tv_usec = 0; - - // Set up default value for the cookie received from the server - // because if we are using a file connection and want to - // write a log, we never receive a cookie from the server. - d_magicCookie = new char[vrpn_cookie_size() + 1]; - if (!d_magicCookie) { - fprintf(stderr, "vrpn_Log: Out of memory.\n"); - return; - } - write_vrpn_cookie(d_magicCookie, vrpn_cookie_size() + 1, vrpn_LOG_NONE); -} - -vrpn_Log::~vrpn_Log(void) -{ - if (d_file) { - close(); - } - - if (d_filters) { - vrpnLogFilterEntry *next; - while (d_filters) { - next = d_filters->next; - delete d_filters; - d_filters = next; - } - } - - if (d_magicCookie) { - delete[] d_magicCookie; - } -} - -char *vrpn_Log::getName() -{ - if (this->d_logFileName == NULL) - return NULL; - else { - char *s = new char[strlen(this->d_logFileName) + 1]; - strcpy(s, this->d_logFileName); - return s; - } -} - -int vrpn_Log::open(void) -{ - - if (!d_logFileName) { - fprintf(stderr, "vrpn_Log::open: Log file has no name.\n"); - return -1; - } - if (d_file) { - fprintf(stderr, "vrpn_Log::open: Log file is already open.\n"); - return 0; // not a catastrophic failure - } - - // If we can open the file for reading, then it already exists. If - // so, we don't want to overwrite it. - d_file = fopen(d_logFileName, "r"); - if (d_file) { - fprintf(stderr, "vrpn_Log::open: " - "Log file \"%s\" already exists.\n", - d_logFileName); - fclose(d_file); - d_file = NULL; - } - else { - d_file = fopen(d_logFileName, "wb"); - if (d_file == NULL) { // unable to open the file - fprintf(stderr, "vrpn_Log::open: " - "Couldn't open log file \"%s\": ", - d_logFileName); - perror(NULL /* no additional string */); - } - } - - if (!d_file) { // Try to write to "/tmp/vrpn_emergency_log", unless it - // exists! - d_file = fopen("/tmp/vrpn_emergency_log", "r"); - if (d_file) { - fclose(d_file); - d_file = NULL; - perror("vrpn_Log::open_log: " - "Emergency log file \"/tmp/vrpn_emergency_log\" " - "already exists.\n"); - } - else { - d_file = fopen("/tmp/vrpn_emergency_log", "wb"); - if (d_file == NULL) { - perror("vrpn_Log::open: " - "Couldn't open emergency log file " - "\"/tmp/vrpn_emergency_log\": "); - } - } - - if (!d_file) { - return -1; - } - else { - fprintf(stderr, "Writing to /tmp/vrpn_emergency_log instead.\n"); - } - } - - return 0; -} - -int vrpn_Log::close(void) -{ - int final_retval = 0; - final_retval = saveLogSoFar(); - - if (fclose(d_file)) { - fprintf(stderr, "vrpn_Log::close: " - "close of log file failed!\n"); - final_retval = -1; - } - d_file = NULL; - - if (d_logFileName) { - delete[] d_logFileName; - d_logFileName = NULL; - } - - return final_retval; -} - -int vrpn_Log::saveLogSoFar(void) -{ - vrpn_LOGLIST *lp; - int host_len; - int final_retval = 0; - size_t retval; - - // If we aren't supposed to be logging, return with no error. - if (!logMode()) return 0; - - // Make sure the file is open. If not, then error. - if (!d_file) { - fprintf(stderr, "vrpn_Log::saveLogSoFar: " - "Log file is not open!\n"); - - // Abort writing out log without destroying data needed to - // clean up memory. - - d_firstEntry = NULL; - final_retval = -1; - } - - if (!d_wroteMagicCookie && !final_retval) { - // Write out the log header (magic cookie) - // TCH 20 May 1999 - - // There's at least one hack here: - // What logging mode should a client that plays back the log at a - // later time be forced into? I believe NONE, but there might be - // arguments the other way? So, you may want to adjust the cookie - // to make the log mode 0. - - retval = fwrite(d_magicCookie, 1, vrpn_cookie_size(), d_file); - if (retval != vrpn_cookie_size()) { - fprintf(stderr, "vrpn_Log::saveLogSoFar: " - "Couldn't write magic cookie to log file " - "(got %d, expected %d).\n", - static_cast<int>(retval), - static_cast<int>(vrpn_cookie_size())); - lp = d_logTail; - final_retval = -1; - } - d_wroteMagicCookie = vrpn_TRUE; - } - - // Write out the messages in the log, - // starting at d_firstEntry and working backwards - for (lp = d_firstEntry; lp && !final_retval; lp = lp->prev) { - - // This used to be a horrible hack that wrote the size of the - // structure (which included a pointer) to the file. This broke on - // 64-bit machines, but could also have broken on any architecture - // that packed structures differently from the common packing. - // Here, we pull out the entries in a way that avoids doing any - // sign changes and then write the array of values to disk. - // Unfortunately, to remain backward-compatible with earlier log - // files, we need to write the empty pointer. - vrpn_int32 values[6]; - vrpn_int32 zero = 0; - memcpy(&(values[0]), &lp->data.type, sizeof(vrpn_int32)); - memcpy(&(values[1]), &lp->data.sender, sizeof(vrpn_int32)); - memcpy(&(values[2]), &lp->data.msg_time.tv_sec, sizeof(vrpn_int32)); - memcpy(&(values[3]), &lp->data.msg_time.tv_usec, sizeof(vrpn_int32)); - memcpy(&(values[4]), &lp->data.payload_len, sizeof(vrpn_int32)); - memcpy(&(values[5]), &zero, sizeof(vrpn_int32)); // Bogus pointer. - retval = fwrite(values, sizeof(vrpn_int32), 6, d_file); - - if (retval != 6) { - fprintf(stderr, - "vrpn_Log::saveLogSoFar: " - "Couldn't write log file (got %d, expected %lud).\n", - static_cast<int>(retval), - static_cast<unsigned long>(sizeof(lp->data))); - lp = d_logTail; - final_retval = -1; - continue; - } - - host_len = ntohl(lp->data.payload_len); - - // fprintf(stderr, "type %d, sender %d, payload length %d\n", - // htonl(lp->data.type), htonl(lp->data.sender), host_len); - - retval = fwrite(lp->data.buffer, 1, host_len, d_file); - - if (retval != host_len) { - fprintf(stderr, "vrpn_Log::saveLogSoFar: " - "Couldn't write log file.\n"); - lp = d_logTail; - final_retval = -1; - continue; - } - } - - // clean up the linked list - while (d_logTail) { - lp = d_logTail->next; - if (d_logTail->data.buffer) { - delete[](char *)d_logTail -> data.buffer; // ugly cast - } - delete d_logTail; - d_logTail = lp; - } - - d_firstEntry = NULL; - - return final_retval; -} - -int vrpn_Log::logIncomingMessage(size_t payloadLen, struct timeval time, - vrpn_int32 type, vrpn_int32 sender, - const char *buffer) -{ - - // Log it the same way, whether it's a User or System message. - // (We used to throw away system messages that we didn't have a handler - // for, but I believe that was incorrect.) - - if (logMode() & vrpn_LOG_INCOMING) { - // fprintf(stderr, "Logging incoming message of type %d.\n", type); - return logMessage(static_cast<vrpn_int32>(payloadLen), time, type, - sender, buffer, vrpn_TRUE); - } - // fprintf(stderr, "Not logging incoming messages (type %d)...\n", type); - - return 0; -} - -int vrpn_Log::logOutgoingMessage(vrpn_int32 payloadLen, struct timeval time, - vrpn_int32 type, vrpn_int32 sender, - const char *buffer) -{ - if (logMode() & vrpn_LOG_OUTGOING) { - // fprintf(stderr, "Logging outgoing message of type %d.\n", type); - return logMessage(payloadLen, time, type, sender, buffer); - } - // fprintf(stderr, "Not logging outgoing messages (type %d)...\n", type); - return 0; -} - -int vrpn_Log::logMessage(vrpn_int32 payloadLen, struct timeval time, - vrpn_int32 type, vrpn_int32 sender, const char *buffer, - vrpn_bool isRemote) -{ - vrpn_LOGLIST *lp; - vrpn_int32 effectiveType; - vrpn_int32 effectiveSender; - - if (isRemote) { - effectiveType = d_types->mapToLocalID(type); - effectiveSender = d_senders->mapToLocalID(sender); - } - else { - effectiveType = type; - effectiveSender = sender; - } - - // Filter user messages - if (type >= 0) { - if (checkFilters(payloadLen, time, effectiveType, effectiveSender, - buffer)) { - // This is NOT a failure - do not return nonzero! - return 0; - } - } - - // Make a log structure for the new message - lp = new vrpn_LOGLIST; - if (!lp) { - fprintf(stderr, "vrpn_Log::logMessage: " - "Out of memory!\n"); - return -1; - } - lp->data.type = htonl(type); - lp->data.sender = htonl(sender); - - lp->data.msg_time.tv_sec = htonl(time.tv_sec); - lp->data.msg_time.tv_usec = htonl(time.tv_usec); - - d_lastLogTime.tv_sec = time.tv_sec; - d_lastLogTime.tv_usec = time.tv_usec; - - lp->data.payload_len = htonl(payloadLen); - lp->data.buffer = NULL; - - if (payloadLen > 0) { - lp->data.buffer = new char[payloadLen]; - if (!lp->data.buffer) { - fprintf(stderr, "vrpn_Log::logMessage: " - "Out of memory!\n"); - delete lp; - return -1; - } - - // need to explicitly override the const - memcpy((char *)lp->data.buffer, buffer, payloadLen); - } - - // Insert the new message into the log - lp->next = d_logTail; - lp->prev = NULL; - if (d_logTail) { - d_logTail->prev = lp; - } - d_logTail = lp; - if (!d_firstEntry) { - d_firstEntry = lp; - } - - return 0; -} - -int vrpn_Log::setCompoundName(const char *name, int index) -{ - char newName[2048]; // HACK - const char *dot; - size_t len; - - // Change foo.bar, 5 to foo-5.bar - // and foo, 5 to foo-5 - - dot = strrchr(name, '.'); - - if (dot) { - strncpy(newName, name, dot - name); - newName[dot - name] = 0; - } - else { - strcpy(newName, name); - } - len = strlen(newName); - sprintf(newName + len, "-%d", index); - if (dot) { - strcat(newName, dot); - } - - return setName(newName); -} - -int vrpn_Log::setName(const char *name) { return setName(name, strlen(name)); } - -int vrpn_Log::setName(const char *name, size_t len) -{ - if (d_logFileName) { - delete[] d_logFileName; - } - - d_logFileName = new char[1 + len]; - if (!d_logFileName) { - fprintf(stderr, "vrpn_Log::setName: Out of memory!\n"); - return -1; - } - strncpy(d_logFileName, name, len); - d_logFileName[len] = '\0'; - - return 0; -} - -int vrpn_Log::setCookie(const char *cookieBuffer) -{ - - if (d_magicCookie) { - delete[] d_magicCookie; - } - d_magicCookie = new char[1 + vrpn_cookie_size()]; - if (!d_magicCookie) { - fprintf(stderr, "vrpn_Log::setCookie: Out of memory.\n"); - return -1; - } - strncpy(d_magicCookie, cookieBuffer, vrpn_cookie_size()); - - return 0; -} - -long &vrpn_Log::logMode(void) { return d_logmode; } - -int vrpn_Log::addFilter(vrpn_LOGFILTER filter, void *userdata) -{ - vrpnLogFilterEntry *newEntry; - - newEntry = new vrpnLogFilterEntry; - if (!newEntry) { - fprintf(stderr, "vrpn_Log::addFilter: Out of memory.\n"); - return -1; - } - - newEntry->filter = filter; - newEntry->userdata = userdata; - newEntry->next = d_filters; - d_filters = newEntry; - - return 0; -} - -timeval vrpn_Log::lastLogTime() { return d_lastLogTime; } - -int vrpn_Log::checkFilters(vrpn_int32 payloadLen, struct timeval time, - vrpn_int32 type, vrpn_int32 sender, - const char *buffer) -{ - vrpnLogFilterEntry *next; - - vrpn_HANDLERPARAM p; - p.type = type; - p.sender = sender; - p.msg_time.tv_sec = time.tv_sec; - p.msg_time.tv_usec = time.tv_usec; - p.payload_len = payloadLen; - p.buffer = buffer; - - for (next = d_filters; next; next = next->next) { - if ((*next->filter)(next->userdata, p)) { - // Don't log - return 1; - } - } - - return 0; -} - -/** - * @class vrpn_TypeDispatcher - * Handles types, senders, and callbacks. - * Also handles system messages through the same non-orthogonal technique - * as always. - */ - -class vrpn_TypeDispatcher { - -public: - vrpn_TypeDispatcher(void); - ~vrpn_TypeDispatcher(void); - - // ACCESSORS - - int numTypes(void) const; - const char *typeName(int which) const; - - vrpn_int32 getTypeID(const char *name); - ///< Returns -1 if not found. - - int numSenders(void) const; - const char *senderName(int which) const; - - vrpn_int32 getSenderID(const char *name); - ///< Returns -1 if not found. - - // MANIPULATORS - - vrpn_int32 addType(const char *name); - vrpn_int32 addSender(const char *name); - - vrpn_int32 registerType(const char *name); - ///< Calls addType() iff getTypeID() returns -1. - ///< vrpn_Connection doesn't call this because it needs to know - ///< whether or not to send a type message. - - vrpn_int32 registerSender(const char *name); - ///< Calls addSender() iff getSenderID() returns -1. - ///< vrpn_Connection doesn't call this because it needs to know - ///< whether or not to send a sender message. - - int addHandler(vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void *userdata, - vrpn_int32 sender); - int removeHandler(vrpn_int32 type, vrpn_MESSAGEHANDLER handler, - void *userdata, vrpn_int32 sender); - void setSystemHandler(vrpn_int32 type, vrpn_MESSAGEHANDLER handler); - - // It'd make a certain amount of sense to unify these next few, but - // there are some places in the code that depend on the side effect of - // do_callbacks_for() NOT dispatching system messages. - - int doCallbacksFor(vrpn_int32 type, vrpn_int32 sender, timeval time, - vrpn_uint32 len, const char *buffer); - int doSystemCallbacksFor(vrpn_int32 type, vrpn_int32 sender, timeval time, - vrpn_uint32 len, const char *buffer, - void *userdata); - int doSystemCallbacksFor(vrpn_HANDLERPARAM p, void *userdata); - - void clear(void); - -protected: - struct vrpnLocalMapping { - char *name; // Name of type - vrpnMsgCallbackEntry *who_cares; // Callbacks - vrpn_int32 cCares; // TCH 28 Oct 97 - }; - - int d_numTypes; - vrpnLocalMapping d_types[vrpn_CONNECTION_MAX_TYPES]; - - int d_numSenders; - char *d_senders[vrpn_CONNECTION_MAX_SENDERS]; - - vrpn_MESSAGEHANDLER d_systemMessages[vrpn_CONNECTION_MAX_TYPES]; - - vrpnMsgCallbackEntry *d_genericCallbacks; -}; - -vrpn_TypeDispatcher::vrpn_TypeDispatcher(void) - : d_numTypes(0) - , d_numSenders(0) - , d_genericCallbacks(NULL) -{ - int i; - // Make all of the names NULL pointers so they get allocated later - for (i = 0; i < vrpn_CONNECTION_MAX_SENDERS; i++) { - d_senders[i] = NULL; - } - - // Clear out any entries in the table. - clear(); -} - -vrpn_TypeDispatcher::~vrpn_TypeDispatcher(void) -{ - vrpnMsgCallbackEntry *pVMCB, *pVMCB_Del; - int i; - - for (i = 0; i < d_numTypes; i++) { - if (d_types[i].name) { - delete[] d_types[i].name; - } - pVMCB = d_types[i].who_cares; - while (pVMCB) { - pVMCB_Del = pVMCB; - pVMCB = pVMCB_Del->next; - delete pVMCB_Del; - } - } - - pVMCB = d_genericCallbacks; - - while (pVMCB) { - pVMCB_Del = pVMCB; - pVMCB = pVMCB_Del->next; - delete pVMCB_Del; - } - - // Clear out any entries in the table. - clear(); -} - -int vrpn_TypeDispatcher::numTypes(void) const { return d_numTypes; } - -const char *vrpn_TypeDispatcher::typeName(int i) const -{ - if ((i < 0) || (i >= d_numTypes)) { - return NULL; - } - return d_types[i].name; -} - -vrpn_int32 vrpn_TypeDispatcher::getTypeID(const char *name) -{ - vrpn_int32 i; - - for (i = 0; i < d_numTypes; i++) { - if (!strcmp(name, d_types[i].name)) { - return i; - } - } - - return -1; -} - -int vrpn_TypeDispatcher::numSenders(void) const { return d_numSenders; } - -const char *vrpn_TypeDispatcher::senderName(int i) const -{ - if ((i < 0) || (i >= d_numSenders)) { - return NULL; - } - return d_senders[i]; -} - -vrpn_int32 vrpn_TypeDispatcher::getSenderID(const char *name) -{ - vrpn_int32 i; - - for (i = 0; i < d_numSenders; i++) { - if (!strcmp(name, d_senders[i])) { - return i; - } - } - - return -1; -} - -vrpn_int32 vrpn_TypeDispatcher::addType(const char *name) -{ - - // See if there are too many on the list. If so, return -1. - if (d_numTypes >= vrpn_CONNECTION_MAX_TYPES) { - fprintf(stderr, "vrpn_TypeDispatcher::addType: " - "Too many! (%d)\n", - d_numTypes); - return -1; - } - - if (!d_types[d_numTypes].name) { - d_types[d_numTypes].name = new cName; - if (!d_types[d_numTypes].name) { - fprintf(stderr, "vrpn_TypeDispatcher::addType: " - "Can't allocate memory for new record.\n"); - return -1; - } - } - - // Add this one into the list and return its index - strncpy(d_types[d_numTypes].name, name, sizeof(cName) - 1); - d_types[d_numTypes].who_cares = NULL; - d_types[d_numTypes].cCares = 0; - d_numTypes++; - - return d_numTypes - 1; -} - -vrpn_int32 vrpn_TypeDispatcher::addSender(const char *name) -{ - - // See if there are too many on the list. If so, return -1. - if (d_numSenders >= vrpn_CONNECTION_MAX_SENDERS) { - fprintf(stderr, "vrpn_TypeDispatcher::addSender: " - "Too many! (%d).\n", - d_numSenders); - return -1; - } - - if (!d_senders[d_numSenders]) { - - // fprintf(stderr, "Allocating a new name entry\n"); - - d_senders[d_numSenders] = new cName; - if (!d_senders[d_numSenders]) { - fprintf(stderr, "vrpn_TypeDispatcher::addSender: " - "Can't allocate memory for new record\n"); - return -1; - } - } - - // Add this one into the list - strncpy(d_senders[d_numSenders], name, sizeof(cName) - 1); - d_numSenders++; - - // One more in place -- return its index - return d_numSenders - 1; -} - -vrpn_int32 vrpn_TypeDispatcher::registerType(const char *name) -{ - vrpn_int32 retval; - - // See if the name is already in the list. If so, return it. - retval = getTypeID(name); - if (retval != -1) { - return retval; - } - - return addType(name); -} - -vrpn_int32 vrpn_TypeDispatcher::registerSender(const char *name) -{ - vrpn_int32 retval; - - // See if the name is already in the list. If so, return it. - retval = getSenderID(name); - if (retval != -1) { - return retval; - } - - return addSender(name); -} - -int vrpn_TypeDispatcher::addHandler(vrpn_int32 type, - vrpn_MESSAGEHANDLER handler, void *userdata, - vrpn_int32 sender) -{ - vrpnMsgCallbackEntry *new_entry; - vrpnMsgCallbackEntry **ptr; - - // Ensure that the type is a valid one (one that has been defined) - // OR that it is "any" - if (((type < 0) || (type >= d_numTypes)) && (type != vrpn_ANY_TYPE)) { - fprintf(stderr, "vrpn_TypeDispatcher::addHandler: No such type\n"); - return -1; - } - - // Ensure that the sender is a valid one (or "any") - if ((sender != vrpn_ANY_SENDER) && - ((sender < 0) || (sender >= d_numSenders))) { - fprintf(stderr, "vrpn_TypeDispatcher::addHandler: No such sender\n"); - return -1; - } - - // Ensure that the handler is non-NULL - if (handler == NULL) { - fprintf(stderr, "vrpn_TypeDispatcher::addHandler: NULL handler\n"); - return -1; - } - - // Allocate and initialize the new entry - new_entry = new vrpnMsgCallbackEntry(); - if (new_entry == NULL) { - fprintf(stderr, "vrpn_TypeDispatcher::addHandler: Out of memory\n"); - return -1; - } - new_entry->handler = handler; - new_entry->userdata = userdata; - new_entry->sender = sender; - -#ifdef VERBOSE - printf("Adding user handler for type %ld, sender %ld\n", type, sender); -#endif - - // TCH June 2000 - rewrote to insert at end of list instead of beginning, - // to make sure multiple callbacks on the same type are triggered - // in the order registered. Note that multiple entries with the same - // info is okay. - - if (type == vrpn_ANY_TYPE) { - ptr = &d_genericCallbacks; - } - else { - ptr = &d_types[type].who_cares; - } - - while (*ptr) { - ptr = &((*ptr)->next); - } - *ptr = new_entry; - new_entry->next = NULL; - - return 0; -} - -int vrpn_TypeDispatcher::removeHandler(vrpn_int32 type, - vrpn_MESSAGEHANDLER handler, - void *userdata, vrpn_int32 sender) -{ - // The pointer at *snitch points to victim - vrpnMsgCallbackEntry *victim, **snitch; - - // Ensure that the type is a valid one (one that has been defined) - // OR that it is "any" - if (((type < 0) || (type >= d_numTypes)) && (type != vrpn_ANY_TYPE)) { - fprintf(stderr, "vrpn_TypeDispatcher::removeHandler: No such type\n"); - return -1; - } - - // Find a handler with this registry in the list (any one will do, - // since all duplicates are the same). - if (type == vrpn_ANY_TYPE) { - snitch = &d_genericCallbacks; - } - else { - snitch = &(d_types[type].who_cares); - } - victim = *snitch; - while ((victim != NULL) && - ((victim->handler != handler) || (victim->userdata != userdata) || - (victim->sender != sender))) { - snitch = &((*snitch)->next); - victim = victim->next; - } - - // Make sure we found one - if (victim == NULL) { - fprintf(stderr, - "vrpn_TypeDispatcher::removeHandler: No such handler\n"); - return -1; - } - - // Remove the entry from the list - *snitch = victim->next; - delete victim; - - return 0; -} - -void vrpn_TypeDispatcher::setSystemHandler(vrpn_int32 type, - vrpn_MESSAGEHANDLER handler) -{ - d_systemMessages[-type] = handler; -} - -int vrpn_TypeDispatcher::doCallbacksFor(vrpn_int32 type, vrpn_int32 sender, - timeval time, vrpn_uint32 len, - const char *buffer) -{ - vrpnMsgCallbackEntry *who; - vrpn_HANDLERPARAM p; - - // We don't dispatch system messages (kluge?). - if (type < 0) { - return 0; - } - - if (type >= d_numTypes) { - return -1; - } - - // Fill in the parameter to be passed to the routines - p.type = type; - p.sender = sender; - p.msg_time = time; - p.payload_len = len; - p.buffer = buffer; - - // Do generic callbacks (vrpn_ANY_TYPE) - who = d_genericCallbacks; - - while (who) { // For each callback entry - // Verify that the sender is ANY or matches - if ((who->sender == vrpn_ANY_SENDER) || (who->sender == sender)) { - if (who->handler(who->userdata, p)) { - fprintf(stderr, "vrpn_TypeDispatcher::doCallbacksFor: " - "Nonzero user generic handler return.\n"); - return -1; - } - } - - // Next callback in list - who = who->next; - } - - // Find the head for the list of callbacks to call - who = d_types[type].who_cares; - while (who) { // For each callback entry - // Verify that the sender is ANY or matches - if ((who->sender == vrpn_ANY_SENDER) || (who->sender == sender)) { - if (who->handler(who->userdata, p)) { - fprintf(stderr, "vrpn_TypeDispatcher::doCallbacksFor: " - "Nonzero user handler return.\n"); - return -1; - } - } - - // Next callback in list - who = who->next; - } - - return 0; -} - -int vrpn_TypeDispatcher::doSystemCallbacksFor(vrpn_int32 type, - vrpn_int32 sender, timeval time, - vrpn_uint32 len, - const char *buffer, - void *userdata) -{ - vrpn_HANDLERPARAM p; - - if (type >= 0) { - return 0; - } - if (-type >= vrpn_CONNECTION_MAX_TYPES) { - fprintf(stderr, "vrpn_TypeDispatcher::doSystemCallbacksFor: " - "Illegal type %d.\n", - type); - return -1; - } - - if (!d_systemMessages[-type]) { - return 0; - } - - // Fill in the parameter to be passed to the routines - p.type = type; - p.sender = sender; - p.msg_time = time; - p.payload_len = len; - p.buffer = buffer; - - return doSystemCallbacksFor(p, userdata); -} - -int vrpn_TypeDispatcher::doSystemCallbacksFor(vrpn_HANDLERPARAM p, - void *userdata) -{ - int retval; - - if (p.type >= 0) { - return 0; - } - if (-p.type >= vrpn_CONNECTION_MAX_TYPES) { - fprintf(stderr, "vrpn_TypeDispatcher::doSystemCallbacksFor: " - "Illegal type %d.\n", - p.type); - return -1; - } - - if (!d_systemMessages[-p.type]) { - return 0; - } - - retval = d_systemMessages[-p.type](userdata, p); - if (retval) { - fprintf(stderr, "vrpn_TypeDispatcher::doSystemCallbacksFor: " - "Nonzero system handler return.\n"); - return -1; - } - return 0; -} - -void vrpn_TypeDispatcher::clear(void) -{ - int i; - - for (i = 0; i < vrpn_CONNECTION_MAX_TYPES; i++) { - d_types[i].who_cares = NULL; - d_types[i].cCares = 0; - d_types[i].name = NULL; - - d_systemMessages[i] = NULL; - } - - for (i = 0; i < vrpn_CONNECTION_MAX_SENDERS; i++) { - if (d_senders[i] != NULL) { - delete[] d_senders[i]; - } - d_senders[i] = NULL; - } -} - -vrpn_ConnectionManager::~vrpn_ConnectionManager(void) -{ - // fprintf(stderr, "In ~vrpn_ConnectionManager: tearing down the list.\n"); - - // Call the destructor of every known connection. - // That destructor will call vrpn_ConnectionManager::deleteConnection() - // to remove itself from d_kcList. - while (d_kcList) { - delete d_kcList->connection; - } - while (d_anonList) { - delete d_anonList->connection; - } -} - -// static -vrpn_ConnectionManager &vrpn_ConnectionManager::instance(void) -{ - static vrpn_ConnectionManager manager; - return manager; -} - -void vrpn_ConnectionManager::addConnection(vrpn_Connection *c, const char *name) -{ - knownConnection *p; - - p = new knownConnection; - p->connection = c; - - if (name) { - strncpy(p->name, name, 1000); - p->next = d_kcList; - d_kcList = p; - } - else { - p->name[0] = 0; - p->next = d_anonList; - d_anonList = p; - } -} - -void vrpn_ConnectionManager::deleteConnection(vrpn_Connection *c) -{ - deleteConnection(c, &d_kcList); - deleteConnection(c, &d_anonList); -} - -void vrpn_ConnectionManager::deleteConnection(vrpn_Connection *c, - knownConnection **snitch) -{ - knownConnection *victim = *snitch; - - while (victim && (victim->connection != c)) { - snitch = &((*snitch)->next); - victim = *snitch; - } - - if (!victim) { - // No warning, because this connection might be on the *other* list. - } - else { - *snitch = victim->next; - delete victim; - } -} - -vrpn_Connection *vrpn_ConnectionManager::getByName(const char *name) -{ - knownConnection *p; - for (p = d_kcList; p && strcmp(p->name, name); p = p->next) { - // do nothing - } - if (!p) { - return NULL; - } - return p->connection; -} - -vrpn_ConnectionManager::vrpn_ConnectionManager(void) - : d_kcList(NULL) - , d_anonList(NULL) -{ -} - -/** - * This function returns the host IP address in string form. For example, - * the machine "ioglab.cs.unc.edu" becomes "152.2.130.90." This is done - * so that the remote host can connect back even if it can't resolve the - * DNS name of this host. This is especially useful at conferences, where - * DNS may not even be running. - * If the NIC_IP name is passed in as NULL but the SOCKET passed in is - * valid, then look up the address associated with that socket; this is so - * that when a machine has multiple NICs, it will send the outgoing request - * for UDP connections to the same place that its TCP connection is on. - */ - -static int vrpn_getmyIP(char *myIPchar, unsigned maxlen, - const char *NIC_IP = NULL, - SOCKET incoming_socket = INVALID_SOCKET) -{ - char myname[100]; // Host name of this host - struct hostent *host; // Encoded host IP address, etc. - char myIPstring[100]; // Hold "152.2.130.90" or whatever - - if (myIPchar == NULL) { - fprintf(stderr, "vrpn_getmyIP: NULL pointer passed in\n"); - return -1; - } - - // If we have a specified NIC_IP address, fill it in and return it. - if (NIC_IP) { - if (strlen(NIC_IP) > maxlen) { - fprintf(stderr, "vrpn_getmyIP: Name too long to return\n"); - return -1; - } -#ifdef VERBOSE - fprintf(stderr, "Was given IP address of %s so returning that.\n", - NIC_IP); -#endif - strncpy(myIPchar, NIC_IP, maxlen); - return 0; - } - - // If we have a valid specified SOCKET, then look up its address and - // return it. - if (incoming_socket != INVALID_SOCKET) { - struct sockaddr_in socket_name; - int socket_namelen = sizeof(socket_name); - - if (getsockname(incoming_socket, (struct sockaddr *)&socket_name, - GSN_CAST & socket_namelen)) { - fprintf(stderr, "vrpn_getmyIP: cannot get socket name.\n"); - return -1; - } - - sprintf(myIPstring, "%u.%u.%u.%u", - ntohl(socket_name.sin_addr.s_addr) >> 24, - (ntohl(socket_name.sin_addr.s_addr) >> 16) & 0xff, - (ntohl(socket_name.sin_addr.s_addr) >> 8) & 0xff, - ntohl(socket_name.sin_addr.s_addr) & 0xff); - - // Copy this to the output - if ((unsigned)strlen(myIPstring) > maxlen) { - fprintf(stderr, "vrpn_getmyIP: Name too long to return\n"); - return -1; - } - - strcpy(myIPchar, myIPstring); - -#ifdef VERBOSE - fprintf(stderr, "Decided on IP address of %s.\n", myIPchar); -#endif - return 0; - } - - // Find out what my name is - // gethostname() is guaranteed to produce something gethostbyname() can - // parse. - if (gethostname(myname, sizeof(myname))) { - fprintf(stderr, "vrpn_getmyIP: Error finding local hostname\n"); - return -1; - } - - // Find out what my IP address is - host = gethostbyname(myname); - if (host == NULL) { - fprintf(stderr, "vrpn_getmyIP: error finding host by name (%s)\n", - myname); - return -1; - } - -// Convert this back into a string -#ifndef CRAY - if (host->h_length != 4) { - fprintf(stderr, "vrpn_getmyIP: Host length not 4\n"); - return -1; - } -#endif - sprintf(myIPstring, "%u.%u.%u.%u", - (unsigned int)(unsigned char)host->h_addr_list[0][0], - (unsigned int)(unsigned char)host->h_addr_list[0][1], - (unsigned int)(unsigned char)host->h_addr_list[0][2], - (unsigned int)(unsigned char)host->h_addr_list[0][3]); - - // Copy this to the output - if ((unsigned)strlen(myIPstring) > maxlen) { - fprintf(stderr, "vrpn_getmyIP: Name too long to return\n"); - return -1; - } - - strcpy(myIPchar, myIPstring); -#ifdef VERBOSE - fprintf(stderr, "Decided on IP address of %s.\n", myIPchar); -#endif - return 0; -} - -/** - * This routine will perform like a normal select() call, but it will - * restart if it quit because of an interrupt. This makes it more robust - * in its function, and allows this code to perform properly on pxpl5, which - * sends USER1 interrupts while rendering an image. - */ -int vrpn_noint_select(int width, fd_set *readfds, fd_set *writefds, - fd_set *exceptfds, struct timeval *timeout) -{ - fd_set tmpread, tmpwrite, tmpexcept; - int ret; - int done = 0; - struct timeval timeout2; - struct timeval *timeout2ptr; - struct timeval start, stop, now; - - /* If the timeout parameter is non-NULL and non-zero, then we - * may have to adjust it due to an interrupt. In these cases, - * we will copy the timeout to timeout2, which will be used - * to keep track. Also, the stop time is calculated so that - * we can know when it is time to bail. */ - if ((timeout != NULL) && - ((timeout->tv_sec != 0) || (timeout->tv_usec != 0))) { - timeout2 = *timeout; - timeout2ptr = &timeout2; - vrpn_gettimeofday(&start, NULL); /* Find start time */ - stop = vrpn_TimevalSum(start, *timeout); /* Find stop time */ - } - else { - timeout2ptr = timeout; - stop.tv_sec = 0; - stop.tv_usec = 0; - } - - /* Repeat selects until it returns for a reason other than interrupt */ - do { - /* Set the temp file descriptor sets to match parameters each time - * through. */ - if (readfds != NULL) { - tmpread = *readfds; - } - else { - FD_ZERO(&tmpread); - } - if (writefds != NULL) { - tmpwrite = *writefds; - } - else { - FD_ZERO(&tmpwrite); - } - if (exceptfds != NULL) { - tmpexcept = *exceptfds; - } - else { - FD_ZERO(&tmpexcept); - } - - /* Do the select on the temporary sets of descriptors */ - ret = select(width, &tmpread, &tmpwrite, &tmpexcept, timeout2ptr); - if (ret >= 0) { /* We are done if timeout or found some */ - done = 1; - } - else if (errno != EINTR) { /* Done if non-intr error */ - done = 1; - } - else if ((timeout != NULL) && - ((timeout->tv_sec != 0) || (timeout->tv_usec != 0))) { - - /* Interrupt happened. Find new time timeout value */ - vrpn_gettimeofday(&now, NULL); - if (vrpn_TimevalGreater(now, stop)) { /* Past stop time */ - done = 1; - } - else { /* Still time to go. */ - unsigned long usec_left; - usec_left = (stop.tv_sec - now.tv_sec) * 1000000L; - usec_left += stop.tv_usec - now.tv_usec; - timeout2.tv_sec = usec_left / 1000000L; - timeout2.tv_usec = usec_left % 1000000L; - } - } - } while (!done); - - /* Copy the temporary sets back to the parameter sets */ - if (readfds != NULL) { - *readfds = tmpread; - } - if (writefds != NULL) { - *writefds = tmpwrite; - } - if (exceptfds != NULL) { - *exceptfds = tmpexcept; - } - - return (ret); -} - -/** - * This routine will write a block to a file descriptor. It acts just - * like the write() system call does on files, but it will keep sending to - * a socket until an error or all of the data has gone. - * This will also take care of problems caused by interrupted system - * calls, retrying the write when they occur. It will also work when - * sending large blocks of data through socket connections, since it will - * send all of the data before returning. - * This routine will either write the requested number of bytes and - * return that or return -1 (in the case of an error) or 0 (in the case - * of EOF being reached before all the data is sent). - */ - -#ifndef VRPN_USE_WINSOCK_SOCKETS - -int vrpn_noint_block_write(int outfile, const char buffer[], size_t length) -{ - register int sofar; /* How many characters sent so far */ - register int ret; /* Return value from write() */ - - sofar = 0; - do { - /* Try to write the remaining data */ - ret = write(outfile, buffer + sofar, length - sofar); - sofar += ret; - - /* Ignore interrupted system calls - retry */ - if ((ret == -1) && (errno == EINTR)) { - ret = 1; /* So we go around the loop again */ - sofar += 1; /* Restoring it from above -1 */ - } - - } while ((ret > 0) && (sofar < length)); - - if (ret == -1) return (-1); /* Error during write */ - if (ret == 0) return (0); /* EOF reached */ - - return (sofar); /* All bytes written */ -} - -/** - * This routine will read in a block from the file descriptor. - * It acts just like the read() routine does on normal files, so that - * it hides the fact that the descriptor may point to a socket. - * This will also take care of problems caused by interrupted system - * calls, retrying the read when they occur. - * This routine will either read the requested number of bytes and - * return that or return -1 (in the case of an error) or 0 (in the case - * of EOF being reached before all the data arrives). - */ - -int vrpn_noint_block_read(int infile, char buffer[], size_t length) -{ - register int sofar; /* How many we read so far */ - register int ret; /* Return value from the read() */ - - // TCH 4 Jan 2000 - hackish - Cygwin will block forever on a 0-length - // read(), and from the man pages this is close enough to in-spec that - // other OS may do the same thing. - - if (!length) { - return 0; - } - sofar = 0; - do { - /* Try to read all remaining data */ - ret = read(infile, buffer + sofar, length - sofar); - sofar += ret; - - /* Ignore interrupted system calls - retry */ - if ((ret == -1) && (errno == EINTR)) { - ret = 1; /* So we go around the loop again */ - sofar += 1; /* Restoring it from above -1 */ - } - } while ((ret > 0) && (sofar < length)); - - if (ret == -1) return (-1); /* Error during read */ - if (ret == 0) return (0); /* EOF reached */ - - return (sofar); /* All bytes read */ -} - -#else /* winsock sockets */ - -int vrpn_noint_block_write(SOCKET outsock, char *buffer, size_t length) -{ - int nwritten; - size_t sofar = 0; - do { - /* Try to write the remaining data */ - nwritten = - send(outsock, buffer + sofar, static_cast<int>(length - sofar), 0); - - if (nwritten == SOCKET_ERROR) { - return -1; - } - - sofar += nwritten; - } while (sofar < length); - - return static_cast<int>(sofar); /* All bytes written */ -} - -int vrpn_noint_block_read(SOCKET insock, char *buffer, size_t length) -{ - int nread; - size_t sofar = 0; - - // TCH 4 Jan 2000 - hackish - Cygwin will block forever on a 0-length - // read(), and from the man pages this is close enough to in-spec that - // other OS may do the same thing. - - if (!length) { - return 0; - } - - do { - /* Try to read all remaining data */ - nread = - recv(insock, buffer + sofar, static_cast<int>(length - sofar), 0); - - if (nread == SOCKET_ERROR) { - return -1; - } - if (nread == 0) { /* socket closed */ - return 0; - } - - sofar += nread; - } while (sofar < length); - - return static_cast<int>(sofar); /* All bytes read */ -} - -#endif /* VRPN_USE_WINSOCK_SOCKETS */ - -/** - * This routine will read in a block from the file descriptor. - * It acts just like the read() routine on normal files, except that - * it will time out if the read takes too long. - * This will also take care of problems caused by interrupted system - * calls, retrying the read when they occur. - * This routine will either read the requested number of bytes and - * return that or return -1 (in the case of an error) or 0 (in the case - * of EOF being reached before all the data arrives), or return the number - * of characters read before timeout (in the case of a timeout). - */ - -int vrpn_noint_block_read_timeout(SOCKET infile, char buffer[], size_t length, - struct timeval *timeout) -{ - size_t sofar; /* How many we read so far */ - register int ret; /* Return value from the read() */ - struct timeval timeout2; - struct timeval *timeout2ptr; - struct timeval start, stop, now; - - // TCH 4 Jan 2000 - hackish - Cygwin will block forever on a 0-length - // read(), and from the man pages this is close enough to in-spec that - // other OS may do the same thing. - - if (!length) { - return 0; - } - - /* If the timeout parameter is non-NULL and non-zero, then we - * may have to adjust it due to an interrupt. In these cases, - * we will copy the timeout to timeout2, which will be used - * to keep track. Also, the current time is found so that we - * can track elapsed time. */ - if ((timeout != NULL) && - ((timeout->tv_sec != 0) || (timeout->tv_usec != 0))) { - timeout2 = *timeout; - timeout2ptr = &timeout2; - vrpn_gettimeofday(&start, NULL); /* Find start time */ - stop = vrpn_TimevalSum(start, *timeout); /* Find stop time */ - } - else { - timeout2ptr = timeout; - } - - sofar = 0; - do { - int sel_ret; - fd_set readfds, exceptfds; - - /* See if there is a character ready for read */ - FD_ZERO(&readfds); - FD_SET(infile, &readfds); - FD_ZERO(&exceptfds); - FD_SET(infile, &exceptfds); - sel_ret = vrpn_noint_select(static_cast<int>(infile) + 1, &readfds, - NULL, &exceptfds, timeout2ptr); - if (sel_ret == -1) { /* Some sort of error on select() */ - return -1; - } - if (FD_ISSET(infile, &exceptfds)) { /* Exception */ - return -1; - } - if (!FD_ISSET(infile, &readfds)) { /* No characters */ - if ((timeout != NULL) && (timeout->tv_sec == 0) && - (timeout->tv_usec == 0)) { /* Quick poll */ - return static_cast<int>(sofar); /* Timeout! */ - } - } - - /* See what time it is now and how long we have to go */ - if (timeout2ptr) { - vrpn_gettimeofday(&now, NULL); - if (vrpn_TimevalGreater(now, stop)) { /* Timeout! */ - return static_cast<int>(sofar); - } - else { - timeout2 = vrpn_TimevalDiff(stop, now); - } - } - - if (!FD_ISSET(infile, &readfds)) { /* No chars yet */ - ret = 0; - continue; - } - -#ifndef VRPN_USE_WINSOCK_SOCKETS - ret = read(infile, buffer + sofar, length - sofar); - sofar += ret; - - /* Ignore interrupted system calls - retry */ - if ((ret == -1) && (errno == EINTR)) { - ret = 1; /* So we go around the loop again */ - sofar += 1; /* Restoring it from above -1 */ - } -#else - { - int nread; - nread = recv(infile, buffer + sofar, - static_cast<int>(length - sofar), 0); - sofar += nread; - ret = nread; - } -#endif - - } while ((ret > 0) && (sofar < length)); -#ifndef VRPN_USE_WINSOCK_SOCKETS - if (ret == -1) return (-1); /* Error during read */ -#endif - if (ret == 0) return (0); /* EOF reached */ - - return static_cast<int>(sofar); /* All bytes read */ -} - -/** - * This routine opens a socket with the requested port number. - * The routine returns -1 on failure and the file descriptor on success. - * The portno parameter is filled in with the actual port that is opened - * (this is useful when the address INADDR_ANY is used, since it tells - * what port was opened). - * To select between multiple NICs, we can specify the IP address of the - * socket to open; NULL selects the default NIC. - */ - -static SOCKET open_socket(int type, unsigned short *portno, - const char *IPaddress) -{ - struct sockaddr_in name; - struct hostent *phe; /* pointer to host information entry */ - int namelen; - - // create an Internet socket of the appropriate type - SOCKET sock = socket(AF_INET, type, 0); - if (sock == INVALID_SOCKET) { - fprintf(stderr, "open_socket: can't open socket.\n"); -#ifndef _WIN32_WCE - fprintf(stderr, " -- errno %d (%s).\n", errno, strerror(errno)); -#endif - return INVALID_SOCKET; - } - -// Added by Eric Boren to address socket reconnectivity on the Android -#ifdef __ANDROID__ - vrpn_int32 optval = 1; - vrpn_int32 sockoptsuccess = - setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof optval); - fprintf(stderr, "setsockopt returned %i, optval: %i\n", sockoptsuccess, - optval); -#endif - - namelen = sizeof(name); - - // bind to local address - memset((void *)&name, 0, namelen); - name.sin_family = AF_INET; - if (portno) { - name.sin_port = htons(*portno); - } - else { - name.sin_port = htons(0); - } - - // Map our host name to our IP address, allowing for dotted decimal - if (!IPaddress) { - name.sin_addr.s_addr = INADDR_ANY; - } - else if ((name.sin_addr.s_addr = inet_addr(IPaddress)) == INADDR_NONE) { - if ((phe = gethostbyname(IPaddress)) != NULL) { - memcpy((void *)&name.sin_addr, (const void *)phe->h_addr, - phe->h_length); - } - else { - vrpn_closeSocket(sock); - fprintf(stderr, "open_socket: can't get %s host entry\n", - IPaddress); - return INVALID_SOCKET; - } - } - -#ifdef VERBOSE3 - // NIC will be 0.0.0.0 if we use INADDR_ANY - fprintf(stderr, "open_socket: request port %d, using NIC %d %d %d %d.\n", - portno ? *portno : 0, ntohl(name.sin_addr.s_addr) >> 24, - (ntohl(name.sin_addr.s_addr) >> 16) & 0xff, - (ntohl(name.sin_addr.s_addr) >> 8) & 0xff, - ntohl(name.sin_addr.s_addr) & 0xff); -#endif - - if (bind(sock, (struct sockaddr *)&name, namelen) < 0) { - fprintf(stderr, "open_socket: can't bind address"); - if (portno) { - fprintf(stderr, " %d", *portno); - } -#ifndef _WIN32_WCE - fprintf(stderr, " -- %d -- %s\n", errno, strerror(errno)); -#endif - fprintf(stderr, " (This probably means that another application has " - "the port open already)\n"); - vrpn_closeSocket(sock); - return INVALID_SOCKET; - } - - // Find out which port was actually bound - if (getsockname(sock, (struct sockaddr *)&name, GSN_CAST & namelen)) { - fprintf(stderr, "vrpn: open_socket: cannot get socket name.\n"); - vrpn_closeSocket(sock); - return INVALID_SOCKET; - } - if (portno) { - *portno = ntohs(name.sin_port); - } - -#ifdef VERBOSE3 - // NIC will be 0.0.0.0 if we use INADDR_ANY - fprintf(stderr, "open_socket: got port %d, using NIC %d %d %d %d.\n", - portno ? *portno : ntohs(name.sin_port), - ntohl(name.sin_addr.s_addr) >> 24, - (ntohl(name.sin_addr.s_addr) >> 16) & 0xff, - (ntohl(name.sin_addr.s_addr) >> 8) & 0xff, - ntohl(name.sin_addr.s_addr) & 0xff); -#endif - - return sock; -} - -/** - * Create a UDP socket and bind it to its local address. - */ - -static SOCKET open_udp_socket(unsigned short *portno, const char *IPaddress) -{ - return open_socket(SOCK_DGRAM, portno, IPaddress); -} - -/** - * Create a TCP socket and bind it to its local address. - */ - -static SOCKET open_tcp_socket(unsigned short *portno = NULL, - const char *NIC_IP = NULL) -{ - return open_socket(SOCK_STREAM, portno, NIC_IP); -} - -/** - * Create a UDP socket and connect it to a specified port. - */ - -static SOCKET vrpn_connect_udp_port(const char *machineName, int remotePort, - const char *NIC_IP = NULL) -{ - SOCKET udp_socket; - struct sockaddr_in udp_name; - struct hostent *remoteHost; - int udp_namelen; - - udp_socket = open_udp_socket(NULL, NIC_IP); - - udp_namelen = sizeof(udp_name); - - memset((void *)&udp_name, 0, udp_namelen); - udp_name.sin_family = AF_INET; - - // gethostbyname() fails on SOME Windows NT boxes, but not all, - // if given an IP octet string rather than a true name. - // MS Documentation says it will always fail and inet_addr should - // be called first. Avoids a 30+ second wait for - // gethostbyname() to fail. - - if ((udp_name.sin_addr.s_addr = inet_addr(machineName)) == INADDR_NONE) { - remoteHost = gethostbyname(machineName); - if (remoteHost) { - -#ifdef CRAY - int i; - u_long foo_mark = 0L; - for (i = 0; i < 4; i++) { - u_long one_char = remoteHost->h_addr_list[0][i]; - foo_mark = (foo_mark << 8) | one_char; - } - udp_name.sin_addr.s_addr = foo_mark; -#else - memcpy(&(udp_name.sin_addr.s_addr), remoteHost->h_addr, - remoteHost->h_length); -#endif - } - else { - vrpn_closeSocket(udp_socket); - fprintf(stderr, - "vrpn_connect_udp_port: error finding host by name (%s).\n", - machineName); - return INVALID_SOCKET; - } - } -#ifndef VRPN_USE_WINSOCK_SOCKETS - udp_name.sin_port = htons(remotePort); -#else - udp_name.sin_port = htons((u_short)remotePort); -#endif - - if (connect(udp_socket, (struct sockaddr *)&udp_name, udp_namelen)) { - fprintf(stderr, "vrpn_connect_udp_port: can't bind udp socket.\n"); - vrpn_closeSocket(udp_socket); - return INVALID_SOCKET; - } - - // Find out which port was actually bound - udp_namelen = sizeof(udp_name); - if (getsockname(udp_socket, (struct sockaddr *)&udp_name, - GSN_CAST & udp_namelen)) { - fprintf(stderr, "vrpn_connect_udp_port: cannot get socket name.\n"); - vrpn_closeSocket(udp_socket); - return INVALID_SOCKET; - } - -#ifdef VERBOSE3 - // NOTE NIC will be 0.0.0.0 if we listen on all NICs. - fprintf(stderr, - "vrpn_connect_udp_port: got port %d, using NIC %d %d %d %d.\n", - ntohs(udp_name.sin_port), ntohl(udp_name.sin_addr.s_addr) >> 24, - (ntohl(udp_name.sin_addr.s_addr) >> 16) & 0xff, - (ntohl(udp_name.sin_addr.s_addr) >> 8) & 0xff, - ntohl(udp_name.sin_addr.s_addr) & 0xff); -#endif - - return udp_socket; -} - -/** - * Retrieves the IP address or hostname of the local interface used to connect - * to the specified remote host. - * XXX: This does not always work. See the Github issue with the report from - * Isop W. Alexander showing that a machine with two ports (172.28.0.10 and - * 192.168.191.130) sent a connection request that came from the 172 IP address - * but that had the name of the 192 interface in the message as the host to - * call back. This turned out to be unroutable, so the server failed to call - * back on the correct IP address. Presumably, this happens when the gateway - * is configured to be a single outgoing NIC. This was on a Linux box. We - * need a more reliable way to select the outgoing NIC. XXX Actually, the problem may be that - * we aren't listening on the incorrect port -- the UDP receipt code may - * use the IP address the message came from rather than the machine name - * in the message. - * - * @param local_host A buffer of size 64 that will contain the name of the local interface. - * @param max_length The maximum length of the local_host buffer. - * @param remote_host The name of the remote host. - * - * @return Returns -1 on getsockname() error, or the output of sprintf - * building the local_host string. - */ -static int get_local_socket_name(char *local_host, size_t max_length, const char* remote_host) -{ - const int remote_port = vrpn_DEFAULT_LISTEN_PORT_NO; - struct sockaddr_in udp_name; - int udp_namelen = sizeof(udp_name); - - SOCKET udp_socket = vrpn_connect_udp_port(remote_host, remote_port, NULL); - if (udp_socket == INVALID_SOCKET) { - fprintf(stderr, "get_local_socket_name: cannot connect_udp_port to %s.\n", remote_host); - fprintf(stderr, " (returning 0.0.0.0 so we listen on all ports).\n"); - udp_name.sin_addr.s_addr = 0; - } else { - if (getsockname(udp_socket, (struct sockaddr *)&udp_name, GSN_CAST & udp_namelen)) { - fprintf(stderr, "get_local_socket_name: cannot get socket name.\n"); - vrpn_closeSocket(udp_socket); - return -1; - } - } - - // NOTE NIC will be 0.0.0.0 if we listen on all NICs. - char myIPstring[100]; - int ret = sprintf(myIPstring, "%d.%d.%d.%d", - ntohl(udp_name.sin_addr.s_addr) >> 24, - (ntohl(udp_name.sin_addr.s_addr) >> 16) & 0xff, - (ntohl(udp_name.sin_addr.s_addr) >> 8) & 0xff, - ntohl(udp_name.sin_addr.s_addr) & 0xff); - - // Copy this to the output - if ((unsigned)strlen(myIPstring) > max_length) { - fprintf(stderr, "get_local_socket_name: Name too long to return\n"); - return -1; - } - - strcpy(local_host, myIPstring); - return ret; -} - -/** - * This section deals with implementing a method of connection termed a - * UDP request. This works by having the client open a TCP socket that - * it listens on. It then lobs datagrams to the server asking to be - * called back at the socket. This allows it to timeout on waiting for - * a connection request, resend datagrams in case some got lost, or give - * up at any time. The whole algorithm is implemented in the - * vrpn_udp_request_call() function; the functions before that are helper - * functions that have been broken out to allow a subset of the algorithm - * to be run by a connection whose server has dropped and they want to - * re-establish it. - * - * This routine will lob a datagram to the given port on the given - * machine asking it to call back at the port on this machine that - * is also specified. It returns 0 on success and -1 on failure. - */ - -int vrpn_udp_request_lob_packet( - SOCKET udp_sock, // Socket to use to send - const char *machine, // Name of the machine to call - const int remote_port, // UDP port on remote machine - const int local_port, // TCP port on this machine - const char *NIC_IP = NULL) -{ - char msg[150]; /* Message to send */ - vrpn_int32 msglen; /* How long it is (including \0) */ - char myIPchar[100]; /* IP decription this host */ - - /* Fill in the request message, telling the machine and port that - * the remote server should connect to. These are ASCII, separated - * by a space. vrpn_getmyIP returns the NIC_IP if it is not null, - * or the host name of this machine using gethostname() if it is - * NULL. If the NIC_IP is NULL but we have a socket (as we do here), - * then it returns the address associated with the socket. - */ - if (vrpn_getmyIP(myIPchar, sizeof(myIPchar), NIC_IP, udp_sock)) { - fprintf(stderr, - "vrpn_udp_request_lob_packet: Error finding local hostIP\n"); - vrpn_closeSocket(udp_sock); - return (-1); - } - sprintf(msg, "%s %d", myIPchar, local_port); - msglen = static_cast<vrpn_int32>(strlen(msg) + - 1); /* Include the terminating 0 char */ - - // Lob the message - if (send(udp_sock, msg, msglen, 0) == -1) { - perror("vrpn_udp_request_lob_packet: send() failed"); - vrpn_closeSocket(udp_sock); - return -1; - } - - return 0; -} - -/** - * This routine will get a TCP socket that is ready to accept connections. - * That is, listen() has already been called on it. - * It will get whatever socket is available from the system. It returns - * 0 on success and -1 on failure. On success, it fills in the pointers to - * the socket and the port number of the socket that it obtained. - * To select between multiple network interfaces, we can specify an IPaddress; - * the default value is NULL, which uses the default NIC. - */ - -static int vrpn_get_a_TCP_socket(SOCKET *listen_sock, int *listen_portnum, - const char *NIC_IP = NULL) -{ - struct sockaddr_in listen_name; /* The listen socket binding name */ - int listen_namelen; - - listen_namelen = sizeof(listen_name); - - /* Create a TCP socket to listen for incoming connections from the - * remote server. */ - - *listen_sock = open_tcp_socket(NULL, NIC_IP); - if (*listen_sock < 0) { - fprintf(stderr, "vrpn_get_a_TCP_socket: socket didn't open.\n"); - return -1; - } - - if (listen(*listen_sock, 1)) { - fprintf(stderr, "vrpn_get_a_TCP_socket: listen() failed.\n"); - vrpn_closeSocket(*listen_sock); - return (-1); - } - - if (getsockname(*listen_sock, (struct sockaddr *)&listen_name, - GSN_CAST & listen_namelen)) { - fprintf(stderr, "vrpn_get_a_TCP_socket: cannot get socket name.\n"); - vrpn_closeSocket(*listen_sock); - return (-1); - } - - *listen_portnum = ntohs(listen_name.sin_port); - - // fprintf(stderr, "Listening on port %d, address %d %d %d %d.\n", - //*listen_portnum, listen_name.sin_addr.s_addr >> 24, - //(listen_name.sin_addr.s_addr >> 16) & 0xff, - //(listen_name.sin_addr.s_addr >> 8) & 0xff, - // listen_name.sin_addr.s_addr & 0xff); - - return 0; -} - -/** - * This routine will check the listen socket to see if there has been a - * connection request. If so, it will accept a connection on the accept - * socket and set TCP_NODELAY on that socket. The attempt will timeout - * in the amount of time specified. If the accept and set are - * successful, it returns 1. If there is nothing asking for a connection, - * it returns 0. If there is an error along the way, it returns -1. - */ - -static int vrpn_poll_for_accept(SOCKET listen_sock, SOCKET *accept_sock, - double timeout = 0.0) -{ - fd_set rfds; - struct timeval t; - - // See if we have a connection attempt within the timeout - FD_ZERO(&rfds); - FD_SET(listen_sock, &rfds); /* Check for read (connect) */ - t.tv_sec = (long)(timeout); - t.tv_usec = (long)((timeout - t.tv_sec) * 1000000L); - if (vrpn_noint_select(static_cast<int>(listen_sock) + 1, &rfds, NULL, NULL, - &t) == -1) { - perror("vrpn_poll_for_accept: select() failed"); - return -1; - } - if (FD_ISSET(listen_sock, &rfds)) { /* Got one! */ - /* Accept the connection from the remote machine and set TCP_NODELAY - * on the socket. */ - if ((*accept_sock = accept(listen_sock, 0, 0)) == -1) { - perror("vrpn_poll_for_accept: accept() failed"); - return -1; - } -#if !defined(_WIN32_WCE) && !defined(__ANDROID__) - { - struct protoent *p_entry; - int nonzero = 1; - - if ((p_entry = getprotobyname("TCP")) == NULL) { - fprintf(stderr, - "vrpn_poll_for_accept: getprotobyname() failed.\n"); - vrpn_closeSocket(*accept_sock); - return (-1); - } - - if (setsockopt(*accept_sock, p_entry->p_proto, TCP_NODELAY, - SOCK_CAST & nonzero, sizeof(nonzero)) == -1) { - perror("vrpn_poll_for_accept: setsockopt() failed"); - vrpn_closeSocket(*accept_sock); - return (-1); - } - } -#endif - return 1; // Got one! - } - - return 0; // Nobody called -} - -// This is like sdi_start_server except that the convention for -// passing information on the client machine to the server program is -// different; everything else has been left the same -/** - * This routine will start up a given server on a given machine. The - * name of the machine requesting service and the socket number to connect to - * are supplied after the -client argument. The "args" parameters are - * passed next. They should be space-separated arguments, each of which is - * passed separately. It is NOT POSSIBLE to send parameters with embedded - * spaces. - * This routine returns a file descriptor that points to the socket - * to the server on success and -1 on failure. - */ -static int vrpn_start_server(const char *machine, char *server_name, char *args, - const char *IPaddress = NULL) -{ -#if defined(VRPN_USE_WINSOCK_SOCKETS) || defined(__CYGWIN__) - fprintf(stderr, "VRPN: vrpn_start_server not ported" - " for windows winsocks or cygwin!\n"); - IPaddress = IPaddress; - args = args; - server_name = server_name; - machine = machine; - return -1; -#else - int pid; /* Child's process ID */ - int server_sock; /* Where the accept returns */ - int child_socket; /* Where the final socket is */ - int PortNum; /* Port number we got */ - - /* Open a socket and ensure we can bind it */ - if (vrpn_get_a_TCP_socket(&server_sock, &PortNum, IPaddress)) { - fprintf(stderr, "vrpn_start_server: Cannot get listen socket\n"); - return -1; - } - - if ((pid = fork()) == -1) { - fprintf(stderr, "vrpn_start_server: cannot fork().\n"); - vrpn_closeSocket(server_sock); - return (-1); - } - if (pid == 0) { /* CHILD */ - int loop; - int ret; - int num_descriptors; /* Number of available file descr */ - char myIPchar[100]; /* Host name of this host */ - char command[600]; /* Command passed to system() call */ - char *rsh_to_use; /* Full path to Rsh command. */ - - if (vrpn_getmyIP(myIPchar, sizeof(myIPchar), IPaddress, server_sock)) { - fprintf(stderr, "vrpn_start_server: Error finding my IP\n"); - vrpn_closeSocket(server_sock); - return (-1); - } - - /* Close all files except stdout and stderr. */ - /* This prevents a hung child from keeping devices open */ - num_descriptors = getdtablesize(); - for (loop = 0; loop < num_descriptors; loop++) { - if ((loop != 1) && (loop != 2)) { - close(loop); - } - } - - /* Find the RSH command, either from the environment - * variable or the default, and use it to start up the - * remote server. */ - - if ((rsh_to_use = (char *)getenv("VRPN_RSH")) == NULL) { - rsh_to_use = RSH; - } - sprintf(command, "%s %s %s %s -client %s %d", rsh_to_use, machine, - server_name, args, myIPchar, PortNum); - ret = system(command); - if ((ret == 127) || (ret == -1)) { - fprintf(stderr, "vrpn_start_server: system() failed !!!!!\n"); - perror("Error"); - fprintf(stderr, "Attempted command was: '%s'\n", command); - vrpn_closeSocket(server_sock); - exit(-1); /* This should never occur */ - } - exit(0); - } - else { /* PARENT */ - int waitloop; - - /* Check to see if the child - * is trying to call us back. Do SERVCOUNT waits, each of - * which is SERVWAIT long. - * If the child dies while we are waiting, then we can be - * sure that they will not be calling us back. Check for - * this while waiting for the callback. */ - - for (waitloop = 0; waitloop < (SERVCOUNT); waitloop++) { - int ret; - pid_t deadkid; -#if defined(sparc) || defined(FreeBSD) || defined(_AIX) || defined(__ANDROID__) - int status; // doesn't exist on sparc_solaris or FreeBSD -#else - union wait status; -#endif - - /* Check to see if they called back yet. */ - ret = vrpn_poll_for_accept(server_sock, &child_socket, SERVWAIT); - if (ret == -1) { - fprintf(stderr, "vrpn_start_server: Accept poll failed\n"); - vrpn_closeSocket(server_sock); - return -1; - } - if (ret == 1) { - break; // Got it! - } - -/* Check to see if the child is dead yet */ -#if defined(hpux) || defined(sgi) || defined(__hpux) || defined(__CYGWIN__) || \ - defined(__APPLE__) - /* hpux include files have the wrong declaration */ - deadkid = wait3((int *)&status, WNOHANG, NULL); -#else - deadkid = wait3(&status, WNOHANG, NULL); -#endif - if (deadkid == pid) { - fprintf(stderr, "vrpn_start_server: server process exited\n"); - vrpn_closeSocket(server_sock); - return (-1); - } - } - if (waitloop == SERVCOUNT) { - fprintf(stderr, - "vrpn_start_server: server failed to connect in time\n"); - fprintf(stderr, " (took more than %d seconds)\n", - SERVWAIT * SERVCOUNT); - vrpn_closeSocket(server_sock); - kill(pid, SIGKILL); - wait(0); - return (-1); - } - - vrpn_closeSocket(server_sock); - return (child_socket); - } - return 0; -#endif -} - -//** End of section pulled from SDI library -//********************************************************************* - -// COOKIE MANIPULATION - -/** - * Writes the magic cookie into buffer with given length. - * On failure (if the buffer is too short), returns -1; - * otherwise returns 0. - * - * This is exposed in vrpn_Connection.h so that we can write - * add_vrpn_cookie. - */ - -int write_vrpn_cookie(char *buffer, size_t length, long remote_log_mode) -{ - if (length < vrpn_MAGICLEN + vrpn_ALIGN + 1) return -1; - - sprintf(buffer, "%s %c", vrpn_MAGIC, - static_cast<char>(remote_log_mode + '0')); - return 0; -} - -/** - * Checks to see if the given buffer has the magic cookie. - * Returns -1 on a mismatch, 0 on an exact match, - * 1 on a minor version difference. - */ - -int check_vrpn_cookie(const char *buffer) -{ - const char *bp; - - // Comparison changed 9 Feb 98 by TCH - // We don't care if the minor version numbers don't match, - // so only check the characters through the last '.' in our - // template. (If there is no last '.' in our template, somebody's - // modified this code to break the constraints above, and we just - // use a maximally restrictive check.) - // XXX This pointer arithmetic isn't completely safe. - - bp = strrchr(buffer, '.'); - if (strncmp(buffer, vrpn_MAGIC, - (bp == NULL ? vrpn_MAGICLEN : bp + 1 - buffer))) { - fprintf(stderr, "check_vrpn_cookie: " - "bad cookie (wanted '%s', got '%s'\n", - vrpn_MAGIC, buffer); - return -1; - } - - if (strncmp(buffer, vrpn_MAGIC, vrpn_MAGICLEN)) { - fprintf(stderr, - "check_vrpn_cookie(): " - "VRPN Note: minor version number doesn't match: (prefer '%s', " - "got '%s'). This is not normally a problem.\n", - vrpn_MAGIC, buffer); - return 1; - } - - return 0; -} - -int check_vrpn_file_cookie(const char *buffer) -{ - const char *bp; - - // Comparison changed 9/1/00 by AAS and KTS - // Here the difference is that we let the major version number be - // less than or equal to our major version number as long as the major - // version number is >= 4 - - // We don't care if the minor version numbers don't match, - // so only check the characters through the last '.' in our - // template. (If there is no last '.' in our template, somebody's - // modified this code to break the constraints above, and we just - // use a maximally restrictive check.) - // XXX This pointer arithmetic isn't completely safe. - - bp = strrchr(buffer, '.'); - int majorComparison = strncmp( - buffer, vrpn_MAGIC, (bp == NULL ? vrpn_MAGICLEN : bp + 1 - buffer)); - if (majorComparison > 0 || - strncmp(buffer, vrpn_FILE_MAGIC, - (bp == NULL ? vrpn_MAGICLEN : bp + 1 - buffer)) < 0) { - fprintf(stderr, "check_vrpn_file_cookie: " - "bad cookie (wanted >='%s' and <='%s', " - "got '%s'\n", - vrpn_FILE_MAGIC, vrpn_MAGIC, buffer); - return -1; - } - - if (majorComparison == 0 && strncmp(buffer, vrpn_MAGIC, vrpn_MAGICLEN)) { - fprintf(stderr, "check_vrpn_file_cookie(): " - "Note: Version number doesn't match: (prefer '%s', got " - "'%s'). This is not normally a problem.\n", - vrpn_MAGIC, buffer); - return 1; - } - - return 0; -} - -size_t vrpn_cookie_size(void) { return vrpn_MAGICLEN + vrpn_ALIGN; } - -// END OF COOKIE CODE - -vrpn_Endpoint::vrpn_Endpoint(vrpn_TypeDispatcher *dispatcher, - vrpn_int32 *connectedEndpointCounter) - : status(BROKEN) - , d_remoteLogMode(0) - , d_remoteInLogName(NULL) - , d_remoteOutLogName(NULL) - , d_inLog(NULL) - , d_outLog(NULL) - , d_senders(NULL) - , d_types(NULL) - , d_dispatcher(dispatcher) - , d_connectionCounter(connectedEndpointCounter) -{ - vrpn_Endpoint::init(); -} - -vrpn_Endpoint_IP::vrpn_Endpoint_IP(vrpn_TypeDispatcher *dispatcher, - vrpn_int32 *connectedEndpointCounter) - : vrpn_Endpoint(dispatcher, connectedEndpointCounter) - , d_tcpSocket(INVALID_SOCKET) - , d_tcpListenSocket(INVALID_SOCKET) - , d_tcpListenPort(0) - , d_udpLobSocket(INVALID_SOCKET) - , d_remote_machine_name(NULL) - , d_remote_port_number(0) - , d_tcp_only(vrpn_FALSE) - , d_udpOutboundSocket(INVALID_SOCKET) - , d_udpInboundSocket(INVALID_SOCKET) - , d_tcpOutbuf(new char[vrpn_CONNECTION_TCP_BUFLEN]) - , d_udpOutbuf(new char[vrpn_CONNECTION_UDP_BUFLEN]) - , d_tcpBuflen(d_tcpOutbuf ? vrpn_CONNECTION_TCP_BUFLEN : 0) - , d_udpBuflen(d_udpOutbuf ? vrpn_CONNECTION_UDP_BUFLEN : 0) - , d_tcpNumOut(0) - , d_udpNumOut(0) - , d_tcpSequenceNumber(0) - , d_udpSequenceNumber(0) - , d_tcpInbuf((char *)d_tcpAlignedInbuf) - , d_udpInbuf((char *)d_udpAlignedInbuf) - , d_NICaddress(NULL) -{ - vrpn_Endpoint_IP::init(); -} - -vrpn_Endpoint::~vrpn_Endpoint(void) -{ - - // Delete type and sender arrays - if (d_senders) { - delete d_senders; - } - if (d_types) { - delete d_types; - } - - // Delete the log, if any - if (d_inLog) { - // close() is called by destructor IFF necessary - delete d_inLog; - } - if (d_outLog) { - // close() is called by destructor IFF necessary - delete d_outLog; - } - - // Delete any file names created during the running - if (d_remoteInLogName) { - delete[] d_remoteInLogName; - } - if (d_remoteOutLogName) { - delete[] d_remoteOutLogName; - } -} - -vrpn_Endpoint_IP::~vrpn_Endpoint_IP(void) -{ - // Close all of the sockets that are left open - if (d_tcpSocket != INVALID_SOCKET) { - vrpn_closeSocket(d_tcpSocket); - d_tcpSocket = INVALID_SOCKET; - d_tcpNumOut = 0; // Ignore characters waiting to go - } - if (d_udpOutboundSocket != INVALID_SOCKET) { - vrpn_closeSocket(d_udpOutboundSocket); - d_udpOutboundSocket = INVALID_SOCKET; - d_udpNumOut = 0; // Ignore characters waiting to go - } - if (d_udpInboundSocket != INVALID_SOCKET) { - vrpn_closeSocket(d_udpInboundSocket); - d_udpInboundSocket = INVALID_SOCKET; - } - if (d_tcpListenSocket != INVALID_SOCKET) { - vrpn_closeSocket(d_tcpListenSocket); - d_tcpListenSocket = INVALID_SOCKET; - } - if (d_udpLobSocket != INVALID_SOCKET) { - vrpn_closeSocket(d_udpLobSocket); - d_udpLobSocket = INVALID_SOCKET; - } - - // Delete the buffers created in the constructor - if (d_tcpOutbuf) { - delete[] d_tcpOutbuf; - d_tcpOutbuf = NULL; - } - if (d_udpOutbuf) { - delete[] d_udpOutbuf; - d_udpOutbuf = NULL; - } - - // Delete the remote machine name, if it has been set - if (d_remote_machine_name) { - delete[] d_remote_machine_name; - d_remote_machine_name = NULL; - } -} - -vrpn_bool vrpn_Endpoint_IP::outbound_udp_open(void) const -{ - return (d_udpOutboundSocket != -1); -} - -int vrpn_Endpoint::local_type_id(vrpn_int32 remote_type) const -{ - return d_types->mapToLocalID(remote_type); -} - -int vrpn_Endpoint::local_sender_id(vrpn_int32 remote_sender) const -{ - return d_senders->mapToLocalID(remote_sender); -} - -vrpn_int32 vrpn_Endpoint_IP::tcp_outbuf_size(void) const { return d_tcpBuflen; } - -vrpn_int32 vrpn_Endpoint_IP::udp_outbuf_size(void) const { return d_udpBuflen; } - -vrpn_bool vrpn_Endpoint_IP::doing_okay(void) const -{ - return ((status >= TRYING_TO_CONNECT) || (status == LOGGING)); -} - -void vrpn_Endpoint::init(void) -{ - // Set all of the local IDs to -1, in case the other side - // sends a message of a type that it has not yet defined. - // (for example, arriving on the UDP line ahead of its TCP - // definition). - d_senders = new vrpn_TranslationTable(); - d_types = new vrpn_TranslationTable(); - - if (!d_senders || !d_types) { - fprintf(stderr, "vrpn_Endpoint::init: Out of memory!\n"); - return; - } - - d_inLog = new vrpn_Log(d_senders, d_types); - - if (!d_inLog) { - fprintf(stderr, "vrpn_Endpoint::init: Out of memory!\n"); - return; - } - - d_outLog = new vrpn_Log(d_senders, d_types); - - if (!d_outLog) { - fprintf(stderr, "vrpn_Endpoint::init: Out of memory!\n"); - return; - } -} - -void vrpn_Endpoint_IP::init(void) -{ - d_tcpSocket = INVALID_SOCKET; - d_tcpListenSocket = INVALID_SOCKET; - d_tcpListenPort = 0; - d_udpLobSocket = INVALID_SOCKET; - d_udpOutboundSocket = INVALID_SOCKET; - d_udpInboundSocket = INVALID_SOCKET; - - // Never tried a reconnect yet - d_last_connect_attempt.tv_sec = 0; - d_last_connect_attempt.tv_usec = 0; -} - -int vrpn_Endpoint_IP::mainloop(timeval *timeout) -{ - fd_set readfds, exceptfds; - int tcp_messages_read; - int udp_messages_read; - int fd_max = static_cast<int>(d_tcpSocket); - bool time_to_try_again = false; - - switch (status) { - - case CONNECTED: - - // Send all pending reports on the way out - send_pending_reports(); - - // check for pending incoming tcp or udp reports - // we do this so that we can trigger out of the timeout - // on either type of message without waiting on the other - - FD_ZERO(&readfds); /* Clear the descriptor sets */ - FD_ZERO(&exceptfds); - - // Read incoming messages from both the UDP and TCP channels - - FD_SET(d_tcpSocket, &readfds); - FD_SET(d_tcpSocket, &exceptfds); - - if (d_udpInboundSocket != -1) { - FD_SET(d_udpInboundSocket, &readfds); - FD_SET(d_udpInboundSocket, &exceptfds); - if (d_udpInboundSocket > d_tcpSocket) - fd_max = static_cast<int>(d_udpInboundSocket); - } - - // Select to see if ready to hear from other side, or exception - - if (vrpn_noint_select(fd_max + 1, &readfds, NULL, &exceptfds, - timeout) == -1) { - fprintf(stderr, "vrpn_Endpoint::mainloop: select failed.\n"); -#ifndef _WIN32_WCE - fprintf(stderr, " Errno (%d): %s.\n", errno, strerror(errno)); -#endif - status = BROKEN; - return -1; - } - - // See if exceptional condition on either socket - if (FD_ISSET(d_tcpSocket, &exceptfds) || - ((d_udpInboundSocket != -1) && - FD_ISSET(d_udpInboundSocket, &exceptfds))) { - fprintf(stderr, "vrpn_Endpoint::mainloop: Exception on socket\n"); - status = BROKEN; - return -1; - } - - // Read incoming messages from the UDP channel - if ((d_udpInboundSocket != -1) && - FD_ISSET(d_udpInboundSocket, &readfds)) { - udp_messages_read = handle_udp_messages(NULL); - if (udp_messages_read == -1) { - fprintf(stderr, "vrpn_Endpoint::mainloop: " - "UDP handling failed, dropping connection\n"); - status = BROKEN; - break; - } -#ifdef VERBOSE3 - if (udp_messages_read != 0) - printf("udp message read = %d\n", udp_messages_read); -#endif - } - - // Read incoming messages from the TCP channel - if (FD_ISSET(d_tcpSocket, &readfds)) { - tcp_messages_read = handle_tcp_messages(NULL); - if (tcp_messages_read == -1) { - fprintf(stderr, "vrpn: TCP handling failed, dropping " - "connection (this is normal when a connection " - "is dropped)\n"); - status = BROKEN; - break; - } -#ifdef VERBOSE3 - else { - if (tcp_messages_read) { - printf("tcp_message_read %d bytes\n", tcp_messages_read); - } - } -#endif - } - break; - - case COOKIE_PENDING: - - poll_for_cookie(timeout); - - break; - - case TRYING_TO_CONNECT: - struct timeval now; - int ret; - -#ifdef VERBOSE - printf("TRYING_TO_CONNECT\n"); -#endif - // See if it has been long enough since our last attempt - // to try again. - vrpn_gettimeofday(&now, NULL); - if (now.tv_sec - d_last_connect_attempt.tv_sec >= 2) { - d_last_connect_attempt.tv_sec = now.tv_sec; - time_to_try_again = true; - } - - // If we are a TCP-only connection, then we retry to establish the - // connection whenever it is time to try again. Otherwise, we're done. - if (d_tcp_only) { - if (time_to_try_again) { - status = TRYING_TO_CONNECT; - if (connect_tcp_to(d_remote_machine_name, - d_remote_port_number) == 0) { - status = COOKIE_PENDING; - if (setup_new_connection()) { - fprintf(stderr, "vrpn_Endpoint::mainloop: " - "Can't set up new connection!\n"); - break; - } - } - } - break; - } - - // We are not a TCP-only connect. - // See if we have a connection yet (nonblocking select). - ret = vrpn_poll_for_accept(d_tcpListenSocket, &d_tcpSocket); - if (ret == -1) { - fprintf(stderr, "vrpn_Endpoint: mainloop: Can't poll for accept\n"); - status = BROKEN; - break; - } - if (ret == 1) { // Got one! - status = COOKIE_PENDING; -#ifdef VERBOSE - printf("vrpn: Connection established\n"); -#endif - // Set up the things that need to happen when a new connection - // is established. - if (setup_new_connection()) { - fprintf(stderr, "vrpn_Endpoint: mainloop: " - "Can't set up new connection!\n"); - status = BROKEN; - // fprintf(stderr, "BROKEN - vrpn_Endpoint::mainloop.\n"); - break; - } - break; - } - - // Lob a request-to-connect packet every couple of seconds - // If we don't wait a while between these we flood buffers and - // do BAD THINGS (TM). - - if (time_to_try_again) { - //XXX On Linux, if we are talking to a machine that does not - // have a server running, then our connect eventually tells us - // that is was refused, and we can't communicate on that - // UDP socket anymore. We should switch to a connectionless - // sendto() option instead, but this runs the way it used - // to, which worked, but still leaves the socket open after - // the send; closing it right away broke on some Windows - // machines. - vrpn_closeSocket(d_udpLobSocket); - d_udpLobSocket = vrpn_connect_udp_port(d_remote_machine_name, - d_remote_port_number, d_NICaddress); - - if (vrpn_udp_request_lob_packet(d_udpLobSocket, - d_remote_machine_name, d_remote_port_number, - d_tcpListenPort, d_NICaddress) == -1) { - fprintf(stderr, - "vrpn_Endpoint: mainloop: Can't lob UDP request\n"); - status = BROKEN; - // fprintf(stderr, "BROKEN - vrpn_Endpoint::mainloop.\n"); - break; - } - } - break; - - case BROKEN: - //// XXXX - return -1; - - case LOGGING: // Just logging, so go about your business. - break; - - default: - fprintf(stderr, "vrpn_Endpoint::mainloop(): " - "Unknown status (%d)\n", - status); - status = BROKEN; - return -1; - } - - return 0; -} // MAINLOOP - -// Clear out the remote mapping list. This is done when a -// connection is dropped and we want to try and re-establish -// it. -void vrpn_Endpoint::clear_other_senders_and_types(void) -{ - d_senders->clear(); - d_types->clear(); -} - -// Make the local mapping for the otherside sender with the same -// name, if there is one. Return 1 if there was a mapping; this -// lets the higher-ups know that there is someone that cares -// on the other side. -int vrpn_Endpoint::newLocalSender(const char *name, vrpn_int32 which) -{ - return d_senders->addLocalID(name, which); -} - -// If the other side has declared this type, establish the -// mapping for it. Return 1 if there was a mapping; this -// lets the higher-ups know that there is someone that cares -// on the other side. -int vrpn_Endpoint::newLocalType(const char *name, vrpn_int32 which) -{ - return d_types->addLocalID(name, which); -} - -// Adds a new remote type and returns its index. Returns -1 on error. -int vrpn_Endpoint::newRemoteType(cName type_name, vrpn_int32 remote_id, - vrpn_int32 local_id) -{ - return d_types->addRemoteEntry(type_name, remote_id, local_id); -} - -// Adds a new remote sender and returns its index. Returns -1 on error. -int vrpn_Endpoint::newRemoteSender(cName sender_name, vrpn_int32 remote_id, - vrpn_int32 local_id) -{ - return d_senders->addRemoteEntry(sender_name, remote_id, local_id); -} - -/** Pack a message into the appropriate output buffer (TCP or UDP) - depending on the class of service for the message, and handle - logging for the message (but not filtering). This function - does not handle semantic checking, local callbacks and filtering. - (these must be done in the vrpn_Connection class routine that - calls this one). - - Parameters: The length of the message, the local-clock time value - for the message, the type and sender IDs for the message, the buffer - that holds the message contents, and the class of service (currently, - only reliable/unreliable is used). - - Returns 0 on success and -1 on failure. -*/ - -int vrpn_Endpoint_IP::pack_message(vrpn_uint32 len, timeval time, - vrpn_int32 type, vrpn_int32 sender, - const char *buffer, - vrpn_uint32 class_of_service) -{ - int ret; - - // Any semantic checking needs to have been done by the Connection - // class: the Endpoint doesn't know enough to do it. Similarly - // for any local callbacks that need to be done. Similarly, filtering. - - // Logging must come before filtering and should probably come before - // any other failure-prone action (such as do_callbacks_for()). Only - // semantic checking should precede it. - - if (d_outLog->logOutgoingMessage(len, time, type, sender, buffer)) { - fprintf(stderr, "vrpn_Endpoint::pack_message: " - "Couldn't log outgoing message.!\n"); - return -1; - } - - if (status == LOGGING) { - // No error message; this endpoint is ONLY logging. - return 0; - } - - // TCH 26 April 2000 - if (status != CONNECTED) { -#ifdef VERBOSE2 - fprintf(stderr, "vrpn_Endpoint::pack_message: " - "Not connected, so throwing out message.\n"); -#endif - return 0; - } - - // Determine the class of service and pass it off to the - // appropriate service (TCP for reliable, UDP for everything else). - // If we don't have a UDP outbound channel, send everything TCP - if ((d_udpOutboundSocket == -1) || - (class_of_service & vrpn_CONNECTION_RELIABLE)) { - - // Ensure that we have an outgoing TCP buffer. If not, then - // we don't have anywhere to send it. - if (d_tcpSocket == -1) { - ret = 0; - } - else { - ret = - tryToMarshall(d_tcpOutbuf, d_tcpBuflen, d_tcpNumOut, len, time, - type, sender, buffer, d_tcpSequenceNumber); - d_tcpNumOut += ret; - if (ret > 0) { - d_tcpSequenceNumber++; - } - } - } - else { - - ret = tryToMarshall(d_udpOutbuf, d_udpBuflen, d_udpNumOut, len, time, - type, sender, buffer, d_udpSequenceNumber); - d_udpNumOut += ret; - if (ret > 0) { - d_udpSequenceNumber++; - } - } - return (!ret) ? -1 : 0; -} - -int vrpn_Endpoint_IP::send_pending_reports(void) -{ - vrpn_int32 ret, sent = 0; - int connection; - timeval timeout; - - // Make sure we've got a valid TCP connection; else we can't send them. - if (d_tcpSocket == -1) { - fprintf(stderr, - "vrpn_Endpoint::send_pending_reports(): No TCP connection\n"); - status = BROKEN; - clearBuffers(); - return -1; - } - - // Check for an exception on the socket. If there is one, shut it - // down and go back to listening. - timeout.tv_sec = 0; - timeout.tv_usec = 0; - - fd_set f; - FD_ZERO(&f); - FD_SET(d_tcpSocket, &f); - - connection = vrpn_noint_select(static_cast<int>(d_tcpSocket) + 1, NULL, - NULL, &f, &timeout); - if (connection) { - fprintf(stderr, "vrpn_Endpoint::send_pending_reports(): " - "select() failed.\n"); -#ifdef VRPN_USE_WINSOCK_SOCKETS - char Message[1024]; - FormatMessage( - FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_MAX_WIDTH_MASK, - NULL, WSAGetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPSTR)Message, 1024, NULL); - fprintf(stderr, "Windows Sockets Error (%d): %s.\n", WSAGetLastError(), - Message); -#else - fprintf(stderr, "Errno (%d): %s.\n", errno, strerror(errno)); -#endif - status = BROKEN; - return -1; - } - -// Send all of the messages that have built -// up in the TCP buffer. If there is an error during the send, or -// an exceptional condition, close the accept socket and go back -// to listening for new connections. -#ifdef VERBOSE - if (d_tcpNumOut) printf("TCP Need to send %d bytes\n", d_tcpNumOut); -#endif - while (sent < d_tcpNumOut) { - ret = send(d_tcpSocket, &d_tcpOutbuf[sent], d_tcpNumOut - sent, 0); -#ifdef VERBOSE - printf("TCP Sent %d bytes\n", ret); -#endif - if (ret == -1) { - fprintf(stderr, "vrpn_Endpoint::send_pending_reports: " - "TCP send failed.\n"); - status = BROKEN; - return -1; - } - sent += ret; - } - - // Send all of the messages that have built - // up in the UDP buffer. If there is an error during the send, or - // an exceptional condition, close the accept socket and go back - // to listening for new connections. - - if ((d_udpOutboundSocket != -1) && (d_udpNumOut > 0)) { - - ret = send(d_udpOutboundSocket, d_udpOutbuf, d_udpNumOut, 0); -#ifdef VERBOSE - printf("UDP Sent %d bytes\n", ret); -#endif - if (ret == -1) { - fprintf(stderr, "vrpn_Endpoint::send_pending_reports: " - " UDP send failed."); - status = BROKEN; - return -1; - } - } - - clearBuffers(); - return 0; -} - -// Pack a message telling to call back this host on the specified -// port number. It is important that the IP address of the host -// refers to the one that was used by the original TCP connection -// rather than (for example) the default IP address for the host. -// This is because the remote machine may not have a route to -// that NIC, but only the one used to establish the TCP connection. - -int vrpn_Endpoint_IP::pack_udp_description(int portno) -{ - struct timeval now; - vrpn_uint32 portparam = portno; - char myIPchar[1000]; - int retval; - -#ifdef VERBOSE2 - fprintf(stderr, "Getting IP address of NIC %s.\n", d_NICaddress); -#endif - - // Find the local host name that we should be using to connect. - // If d_NICaddress is set, use it; otherwise, use the d_tcpSocket - // if it is valid. - retval = - vrpn_getmyIP(myIPchar, sizeof(myIPchar), d_NICaddress, d_tcpSocket); - if (retval) { - perror("vrpn_Endpoint::pack_udp_description: can't get host name"); - return -1; - } - -// Pack a message with type vrpn_CONNECTION_UDP_DESCRIPTION -// whose sender ID is the ID of the port that is to be -// used and whose body holds the zero-terminated string -// name of the host to contact. - -#ifdef VERBOSE - fprintf(stderr, "vrpn_Endpoint::pack_udp_description: " - "Packing UDP %s:%d\n", - myIPchar, portno); -#endif - vrpn_gettimeofday(&now, NULL); - - return pack_message(static_cast<vrpn_uint32>(strlen(myIPchar)) + 1, now, - vrpn_CONNECTION_UDP_DESCRIPTION, portparam, myIPchar, - vrpn_CONNECTION_RELIABLE); -} - -int vrpn_Endpoint::pack_log_description(void) -{ - struct timeval now; - - // Handle the case of NULL pointers in the log file names - // by pointing local copies at the empty string if they occur. - const char *inName = ""; - const char *outName = ""; - if (d_remoteInLogName) { - inName = d_remoteInLogName; - } - if (d_remoteOutLogName) { - outName = d_remoteOutLogName; - } - - // Include the NULL termination for the strings in the length of the buffer. - size_t bufsize = - 2 * sizeof(vrpn_int32) + strlen(inName) + 1 + strlen(outName) + 1; - char *buf = new char[bufsize]; - if (buf == NULL) { - fprintf(stderr, - "vrpn_Endpoint::pack_log_description(): Out of memory\n"); - return -1; - } - - // If we're not requesting remote logging, don't send any message. - - if (!d_remoteLogMode) { - delete[] buf; - return 0; - } - - // Pack a message with type vrpn_CONNECTION_LOG_DESCRIPTION whose - // sender ID is the logging mode to be used by the remote connection - // and whose body holds the zero-terminated string name of the file - // to write to. - - vrpn_gettimeofday(&now, NULL); - char *bpp = buf; - char **bp = &bpp; - vrpn_int32 bufleft = static_cast<vrpn_int32>(bufsize); - vrpn_buffer(bp, &bufleft, (vrpn_int32)strlen(inName)); - vrpn_buffer(bp, &bufleft, (vrpn_int32)strlen(outName)); - vrpn_buffer(bp, &bufleft, inName, static_cast<vrpn_int32>(strlen(inName))); - vrpn_buffer(bp, &bufleft, (char)0); - vrpn_buffer(bp, &bufleft, outName, - static_cast<vrpn_int32>(strlen(outName))); - vrpn_buffer(bp, &bufleft, (char)0); - int ret = pack_message(static_cast<vrpn_uint32>(bufsize - bufleft), now, - vrpn_CONNECTION_LOG_DESCRIPTION, d_remoteLogMode, - buf, vrpn_CONNECTION_RELIABLE); - delete[] buf; - return ret; -} - -// Read all messages available on the given file descriptor (a TCP link). -// Handle each message that is received. -// Return the number of messages read, or -1 on failure. - -int vrpn_Endpoint_IP::handle_tcp_messages(const struct timeval *timeout) -{ - timeval localTimeout; - fd_set readfds, exceptfds; - unsigned num_messages_read = 0; - int retval; - int sel_ret; - -#ifdef VERBOSE2 - printf("vrpn_Endpoint::handle_tcp_messages() called\n"); -#endif - - if (timeout) { - localTimeout.tv_sec = timeout->tv_sec; - localTimeout.tv_usec = timeout->tv_usec; - } - else { - localTimeout.tv_sec = 0; - localTimeout.tv_usec = 0; - } - - // Read incoming messages until there are no more characters to - // read from the other side. For each message, determine what - // type it is and then pass it off to the appropriate handler - // routine. If d_stop_processing_messages_after has been set - // to a nonzero value, then stop processing if we have received - // at least that many messages. - - do { - // Select to see if ready to hear from other side, or exception - FD_ZERO(&readfds); /* Clear the descriptor sets */ - FD_ZERO(&exceptfds); - FD_SET(d_tcpSocket, &readfds); /* Check for read */ - FD_SET(d_tcpSocket, &exceptfds); /* Check for exceptions */ - sel_ret = vrpn_noint_select(static_cast<int>(d_tcpSocket) + 1, &readfds, - NULL, &exceptfds, &localTimeout); - if (sel_ret == -1) { - fprintf(stderr, "vrpn_Endpoint::handle_tcp_messages: " - "select failed"); - return (-1); - } - - // See if exceptional condition on socket - if (FD_ISSET(d_tcpSocket, &exceptfds)) { - fprintf(stderr, "vrpn_Endpoint::handle_tcp_messages: " - "Exception on socket\n"); - return (-1); - } - - // If there is anything to read, get the next message - if (FD_ISSET(d_tcpSocket, &readfds)) { - retval = getOneTCPMessage(static_cast<int>(d_tcpSocket), d_tcpInbuf, - sizeof(d_tcpAlignedInbuf)); - if (retval) { - return -1; - } - - // Got one more message - num_messages_read++; - } - - // If we've been asked to process only a certain number of - // messages, then stop if we've gotten at least that many. - if (d_parent->get_Jane_value() != 0) { - if (num_messages_read >= d_parent->get_Jane_value()) { - break; - } - } - } while (sel_ret); - - return num_messages_read; -} - -// Read all messages available on the given file descriptor (a UDP link). -// Handle each message that is received. -// Return the number of messages read, or -1 on failure. -// This routine and the TCP read routine are annoyingly similar, so it -// seems like they should be merged. They can't though: using read() on -// the UDP socket fails, so we need the UDP version. If we use the UDP -// version for the TCP code, it hangs when we the client drops its -// connection, so we need the TCP code as well. -// If d_stop_processing_messages_after has been set -// to a nonzero value, then stop processing if we have received -// at least that many messages. - -int vrpn_Endpoint_IP::handle_udp_messages(const struct timeval *timeout) -{ - timeval localTimeout; - fd_set readfds, exceptfds; - unsigned num_messages_read = 0; - int sel_ret; - int retval; - -#ifdef VERBOSE2 - printf("vrpn_Endpoint::handle_udp_messages() called\n"); -#endif - - if (timeout) { - localTimeout.tv_sec = timeout->tv_sec; - localTimeout.tv_usec = timeout->tv_usec; - } - else { - localTimeout.tv_sec = 0; - localTimeout.tv_usec = 0; - } - - // Read incoming messages until there are no more packets to - // read from the other side. Each packet may have more than one - // message in it. For each message, determine what - // type it is and then pass it off to the appropriate handler - // routine. - - do { - // Select to see if ready to hear from server, or exception - FD_ZERO(&readfds); /* Clear the descriptor sets */ - FD_ZERO(&exceptfds); - FD_SET(d_udpInboundSocket, &readfds); /* Check for read */ - FD_SET(d_udpInboundSocket, &exceptfds); /* Check for exceptions */ - sel_ret = vrpn_noint_select(static_cast<int>(d_udpInboundSocket) + 1, - &readfds, NULL, &exceptfds, &localTimeout); - if (sel_ret == -1) { - perror("vrpn_Endpoint::handle_udp_messages: select failed()"); - return (-1); - } - - // See if exceptional condition on socket - if (FD_ISSET(d_udpInboundSocket, &exceptfds)) { - fprintf(stderr, "vrpn: vrpn_Endpoint::handle_udp_messages: " - "Exception on socket\n"); - return (-1); - } - - // If there is anything to read, get the next message - if (FD_ISSET(d_udpInboundSocket, &readfds)) { - char *inbuf_ptr; - int inbuf_len; - - inbuf_ptr = d_udpInbuf; - inbuf_len = recv(d_udpInboundSocket, d_udpInbuf, - sizeof(d_udpAlignedInbuf), 0); - if (inbuf_len == -1) { - fprintf(stderr, "vrpn_Endpoint::handle_udp_message: " - "recv() failed.\n"); - return -1; - } - - while (inbuf_len) { - retval = getOneUDPMessage(inbuf_ptr, inbuf_len); - if (retval == -1) { - return -1; - } - inbuf_len -= retval; - inbuf_ptr += retval; - // fprintf(stderr, " Advancing inbuf pointer %d bytes.\n", - // retval); - // Got one more message - num_messages_read++; - } - } - - // If we've been asked to process only a certain number of - // messages, then stop if we've gotten at least that many. - if (d_parent->get_Jane_value() != 0) { - if (num_messages_read >= d_parent->get_Jane_value()) { - break; - } - } - - } while (sel_ret); - - return num_messages_read; -} - -//--------------------------------------------------------------------------- -// This routine opens a TCP socket and connects it to the machine and port -// that are passed in the msg parameter. This is a string that contains -// the machine name, a space, then the port number. -// The routine returns -1 on failure and the file descriptor on success. - -int vrpn_Endpoint_IP::connect_tcp_to(const char *msg) -{ - char machine[1000]; - int port; - - // Find the machine name and port number - if (sscanf(msg, "%s %d", machine, &port) != 2) { - return -1; - } - - return connect_tcp_to(machine, port); -} - -int vrpn_Endpoint_IP::connect_tcp_to(const char *addr, int port) -{ - struct sockaddr_in client; /* The name of the client */ - struct hostent *host; /* The host to connect to */ - - /* set up the socket */ - d_tcpSocket = open_tcp_socket(NULL, d_NICaddress); - if (d_tcpSocket < 0) { - fprintf(stderr, "vrpn_Endpoint::connect_tcp_to: " - "can't open socket\n"); - return -1; - } - client.sin_family = AF_INET; - - // gethostbyname() fails on SOME Windows NT boxes, but not all, - // if given an IP octet string rather than a true name. - // MS Documentation says it will always fail and inet_addr should - // be called first. Avoids a 30+ second wait for - // gethostbyname() to fail. - - if ((client.sin_addr.s_addr = inet_addr(addr)) == INADDR_NONE) { - host = gethostbyname(addr); - if (host) { - -#ifdef CRAY - { - int i; - u_long foo_mark = 0; - for (i = 0; i < 4; i++) { - u_long one_char = host->h_addr_list[0][i]; - foo_mark = (foo_mark << 8) | one_char; - } - client.sin_addr.s_addr = foo_mark; - } -#else - memcpy(&(client.sin_addr.s_addr), host->h_addr, host->h_length); -#endif - } - else { - -#if !defined(hpux) && !defined(__hpux) && !defined(_WIN32) && !defined(sparc) - herror("gethostbyname error:"); -#else - perror("gethostbyname error:"); -#endif - fprintf(stderr, "vrpn_Endpoint::connect_tcp_to: " - "error finding host by name (%s)\n", - addr); - return -1; - } - } - -#ifndef VRPN_USE_WINSOCK_SOCKETS - client.sin_port = htons(port); -#else - client.sin_port = htons((u_short)port); -#endif - - if (connect(d_tcpSocket, (struct sockaddr *)&client, sizeof(client)) < 0) { -#ifdef VRPN_USE_WINSOCK_SOCKETS - if (!d_tcp_only) { - fprintf(stderr, "vrpn_Endpoint::connect_tcp_to: Could not connect " - "to machine %d.%d.%d.%d port %d\n", - (int)(client.sin_addr.S_un.S_un_b.s_b1), - (int)(client.sin_addr.S_un.S_un_b.s_b2), - (int)(client.sin_addr.S_un.S_un_b.s_b3), - (int)(client.sin_addr.S_un.S_un_b.s_b4), - (int)(ntohs(client.sin_port))); - int error = WSAGetLastError(); - fprintf(stderr, "Winsock error: %d\n", error); - } -#else - fprintf(stderr, "vrpn_Endpoint::connect_tcp_to: Could not connect to " - "machine %d.%d.%d.%d port %d\n", - (int)((client.sin_addr.s_addr >> 24) & 0xff), - (int)((client.sin_addr.s_addr >> 16) & 0xff), - (int)((client.sin_addr.s_addr >> 8) & 0xff), - (int)((client.sin_addr.s_addr >> 0) & 0xff), - (int)(ntohs(client.sin_port))); -#endif - vrpn_closeSocket(d_tcpSocket); - status = BROKEN; - return (-1); - } - -/* Set the socket for TCP_NODELAY */ -#if !defined(_WIN32_WCE) && !defined(__ANDROID__) - { - struct protoent *p_entry; - int nonzero = 1; - - if ((p_entry = getprotobyname("TCP")) == NULL) { - fprintf( - stderr, - "vrpn_Endpoint::connect_tcp_to: getprotobyname() failed.\n"); - vrpn_closeSocket(d_tcpSocket); - status = BROKEN; - return -1; - } - - if (setsockopt(d_tcpSocket, p_entry->p_proto, TCP_NODELAY, - SOCK_CAST & nonzero, sizeof(nonzero)) == -1) { - perror("vrpn_Endpoint::connect_tcp_to: setsockopt() failed"); - vrpn_closeSocket(d_tcpSocket); - status = BROKEN; - return -1; - } - } -#endif - status = COOKIE_PENDING; - - return 0; -} - -int vrpn_Endpoint_IP::connect_udp_to(const char *addr, int port) -{ - if (!d_tcp_only) { - d_udpOutboundSocket = ::vrpn_connect_udp_port(addr, port, d_NICaddress); - if (d_udpOutboundSocket == -1) { - fprintf(stderr, "vrpn_Endpoint::connect_udp_to: " - "Couldn't open outbound UDP link.\n"); - status = BROKEN; - return -1; - } - } - return 0; -} - -vrpn_int32 vrpn_Endpoint_IP::set_tcp_outbuf_size(vrpn_int32 bytecount) -{ - char *new_outbuf; - - if (bytecount < 0) { - return d_tcpBuflen; - } - - new_outbuf = new char[bytecount]; - - if (!new_outbuf) { - return -1; - } - - if (d_tcpOutbuf) { - delete[] d_tcpOutbuf; - } - - d_tcpOutbuf = new_outbuf; - d_tcpBuflen = bytecount; - - return d_tcpBuflen; -} - -void vrpn_Endpoint_IP::drop_connection(void) -{ - - if (d_tcpSocket != INVALID_SOCKET) { - vrpn_closeSocket(d_tcpSocket); - d_tcpSocket = INVALID_SOCKET; - d_tcpNumOut = 0; // Ignore characters waiting to go - } - if (d_udpOutboundSocket != INVALID_SOCKET) { - vrpn_closeSocket(d_udpOutboundSocket); - d_udpOutboundSocket = INVALID_SOCKET; - d_udpNumOut = 0; // Ignore characters waiting to go - } - if (d_udpInboundSocket != INVALID_SOCKET) { - vrpn_closeSocket(d_udpInboundSocket); - d_udpInboundSocket = INVALID_SOCKET; - } - - // Remove the remote mappings for senders and types. If we - // reconnect, we will want to fill them in again. First, - // free the space allocated for the list of names, then - // set all of the local IDs to -1, in case the other side - // sends a message of a type that it has not yet defined. - // (for example, arriving on the UDP line ahead of its TCP - // definition). - - clear_other_senders_and_types(); - - // Clear out the buffers; nothing to read or send if no connection. - clearBuffers(); - - struct timeval now; - vrpn_gettimeofday(&now, NULL); - - // If we are logging, put a message in the log telling that we - // have had a disconnection. We don't close the logfile here unless - // there is an error logging the message. This is because we'll want - // to keep logging if there is a reconnection. We close the file when - // the endpoint is destroyed. - if (d_outLog->logMode()) { - if (d_outLog->logMessage(0, now, vrpn_CONNECTION_DISCONNECT_MESSAGE, 0, - NULL, 0) == -1) { - fprintf(stderr, "vrpn_Endpoint::drop_connection: Can't log\n"); - d_outLog->close(); // Hope for the best... - } - } - - // Recall that the connection counter is a pointer to our parent - // connection's count of active endpoints. If it exists, we need - // to send disconnect messages to those who care. If this is the - // last endpoint, then we send the last endpoint message; we - // always send a connection dropped message. - // Message needs to be dispatched *locally only*, so we do_callbacks_for() - // and never pack_message() - - if (d_connectionCounter != NULL) { // Do nothing on NULL pointer - - (*d_connectionCounter)--; // One less connection - - d_dispatcher->doCallbacksFor( - d_dispatcher->registerType(vrpn_dropped_connection), - d_dispatcher->registerSender(vrpn_CONTROL), now, 0, NULL); - - if (*d_connectionCounter == 0) { // None more left - d_dispatcher->doCallbacksFor( - d_dispatcher->registerType(vrpn_dropped_last_connection), - d_dispatcher->registerSender(vrpn_CONTROL), now, 0, NULL); - } - } -} - -void vrpn_Endpoint_IP::clearBuffers(void) -{ - d_tcpNumOut = 0; - d_udpNumOut = 0; -} - -void vrpn_Endpoint_IP::setNICaddress(const char *address) -{ - if (d_NICaddress) { - delete[] d_NICaddress; - } - -#ifdef VERBOSE - fprintf(stderr, "Setting endpoint NIC address to %s.\n", address); -#endif - - d_NICaddress = NULL; - if (!address) { - return; - } - d_NICaddress = new char[1 + strlen(address)]; - if (!d_NICaddress) { - fprintf(stderr, "vrpn_Endpoint::setNICaddress: Out of memory.\n"); - return; - } - strcpy(d_NICaddress, address); -} - -int vrpn_Endpoint_IP::setup_new_connection(void) -{ - char sendbuf[501]; - vrpn_int32 sendlen; - int retval; - - retval = - write_vrpn_cookie(sendbuf, vrpn_cookie_size() + 1, d_remoteLogMode); - if (retval < 0) { - perror("vrpn_Endpoint::setup_new_connection: " - "Internal error - array too small. The code's broken."); - return -1; - } - sendlen = static_cast<vrpn_int32>(vrpn_cookie_size()); - - // Write the magic cookie header to the server - // NOTE: Valgrind will complain about this because we didn't fill in all of the - // characters we're writing. But we don't care about the characters that are - // beyond the terminating NULL character in the string. - if (vrpn_noint_block_write(d_tcpSocket, sendbuf, sendlen) != sendlen) { - fprintf(stderr, "vrpn_Endpoint::setup_new_connection: " - "Can't write cookie.\n"); - status = BROKEN; - return -1; - } - - status = COOKIE_PENDING; - poll_for_cookie(); - - return 0; -} - -void vrpn_Endpoint_IP::poll_for_cookie(const timeval *pTimeout) -{ - timeval timeout; - - if (pTimeout) { - timeout = *pTimeout; - } - else { - timeout.tv_sec = 0; - timeout.tv_usec = 0; - } - - fd_set readfds, exceptfds; - - // most of this code copied from mainloop() case CONNECTED - - // check for pending incoming tcp or udp reports - // we do this so that we can trigger out of the timeout - // on either type of message without waiting on the other - - FD_ZERO(&readfds); /* Clear the descriptor sets */ - FD_ZERO(&exceptfds); - - // Read incoming COOKIE from TCP channel - - FD_SET(d_tcpSocket, &readfds); - FD_SET(d_tcpSocket, &exceptfds); - - // Select to see if ready to hear from other side, or exception - - if (vrpn_noint_select(static_cast<int>(d_tcpSocket) + 1, &readfds, NULL, - &exceptfds, &timeout) == -1) { - fprintf(stderr, "vrpn_Endpoint::poll_for_cookie(): select failed.\n"); - status = BROKEN; - return; - } - - // See if exceptional condition on either socket - if (FD_ISSET(d_tcpSocket, &exceptfds)) { - fprintf(stderr, - "vrpn_Endpoint::poll_for_cookie(): Exception on socket\n"); - return; - } - - // Read incoming COOKIE from the TCP channel - if (FD_ISSET(d_tcpSocket, &readfds)) { - finish_new_connection_setup(); - if (!doing_okay()) { - fprintf(stderr, - "vrpn_Endpoint::poll_for_cookie: cookie handling failed\n" - " while connecting to \"%s\"\n", - d_remote_machine_name); - return; - } -#ifdef VERBOSE3 - else if (status == CONNECTED) { - printf("vrpn_Endpoint::poll_for_cookie() got cookie\n"); - } -#endif - } -} - -int vrpn_Endpoint_IP::finish_new_connection_setup(void) -{ - - vrpn_int32 sendlen = static_cast<vrpn_int32>(vrpn_cookie_size()); - char *recvbuf = new char[sendlen]; - if (recvbuf == NULL) { - fprintf(stderr, "vrpn_Endpoint_IP::finish_new_connection_setup(): Out " - "of memory when allocating receiver buffer\n"); - status = BROKEN; - return -1; - } - - // Try to read the magic cookie from the server. - int ret = vrpn_noint_block_read(d_tcpSocket, recvbuf, sendlen); - if (ret != sendlen) { - perror("vrpn_Endpoint::finish_new_connection_setup: Can't read cookie"); - status = BROKEN; - delete[] recvbuf; - return -1; - } - - if (check_vrpn_cookie(recvbuf) < 0) { - status = BROKEN; - delete[] recvbuf; - return -1; - } - - // Store the magic cookie from the other side into a buffer so - // that it can be put into an incoming log file. - d_inLog->setCookie(recvbuf); - - // Find out what log mode they want us to be in BEFORE we pack - // type, sender, and udp descriptions! That is because we will - // need the type and sender messages to go into the log file if - // we're logging outgoing messages. If it's nonzero, the - // filename to use should come in a log_description message later. - - long received_logmode = recvbuf[vrpn_MAGICLEN + 2] - '0'; - if ((received_logmode < 0) || - (received_logmode > (vrpn_LOG_INCOMING | vrpn_LOG_OUTGOING))) { - fprintf(stderr, "vrpn_Endpoint::finish_new_connection_setup: " - "Got invalid log mode %d\n", - static_cast<int>(received_logmode)); - status = BROKEN; - delete[] recvbuf; - return -1; - } - if (received_logmode & vrpn_LOG_INCOMING) { - d_inLog->logMode() |= vrpn_LOG_INCOMING; - } - if (received_logmode & vrpn_LOG_OUTGOING) { - d_outLog->logMode() |= vrpn_LOG_OUTGOING; - } - - // status must be sent to CONNECTED *before* any messages are - // packed; otherwise they're silently discarded in pack_message. - status = CONNECTED; - - if (pack_log_description() == -1) { - fprintf(stderr, "vrpn_Endpoint::finish_new_connection_setup: " - "Can't pack remote logging instructions.\n"); - status = BROKEN; - delete[] recvbuf; - return -1; - } - - // If we do not have a socket for inbound connections open, and if we - // are allowed to do other-than-TCP sockets, then open one and tell the - // other side that it can use it. - if (!d_tcp_only) { - - if (d_udpInboundSocket == INVALID_SOCKET) { - // Open the UDP port to accept time-critical messages on. - - unsigned short udp_portnum = static_cast<unsigned short>(INADDR_ANY); - d_udpInboundSocket = ::open_udp_socket(&udp_portnum, d_NICaddress); - if (d_udpInboundSocket == INVALID_SOCKET) { - fprintf(stderr, "vrpn_Endpoint::finish_new_connection_setup: " - "can't open UDP socket\n"); - status = BROKEN; - delete[] recvbuf; - return -1; - } - - // Tell the other side what port number to send its UDP messages to. - if (pack_udp_description(udp_portnum) == -1) { - fprintf(stderr, "vrpn_Endpoint::finish_new_connection_setup: " - "Can't pack UDP msg\n"); - status = BROKEN; - delete[] recvbuf; - return -1; - } - } - } - -#ifdef VERBOSE - fprintf(stderr, - "CONNECTED - vrpn_Endpoint::finish_new_connection_setup.\n"); -#endif - - // Pack messages that describe the types of messages and sender - // ID mappings that have been described to this connection. These - // messages use special IDs (negative ones). - for (int i = 0; i < d_dispatcher->numSenders(); i++) { - pack_sender_description(i); - } - for (int i = 0; i < d_dispatcher->numTypes(); i++) { - pack_type_description(i); - } - - // Send the messages - if (send_pending_reports() == -1) { - fprintf( - stderr, - "vrpn_Endpoint::finish_new_connection_setup: Can't send UDP msg\n"); - status = BROKEN; - delete[] recvbuf; - return -1; - } - - // The connection-established messages need to be dispatched *locally only*, - // so we do_callbacks_for and never pack_message() - struct timeval now; - vrpn_gettimeofday(&now, NULL); - - // Connection counter gives us a single point to count connections that - // actually make it to CONNECTED, not just constructed, so we send - // got-first-/dropped-last-connection messages properly. - - if (d_connectionCounter && !*d_connectionCounter) { - d_dispatcher->doCallbacksFor( - d_dispatcher->registerType(vrpn_got_first_connection), - d_dispatcher->registerSender(vrpn_CONTROL), now, 0, NULL); - } - - d_dispatcher->doCallbacksFor( - d_dispatcher->registerType(vrpn_got_connection), - d_dispatcher->registerSender(vrpn_CONTROL), now, 0, NULL); - - if (d_connectionCounter) { - (*d_connectionCounter)++; - } - - delete[] recvbuf; - return 0; -} - -int vrpn_Endpoint_IP::getOneTCPMessage(int fd, char *buf, size_t buflen) -{ - vrpn_int32 header[5]; - struct timeval time; - vrpn_int32 sender, type; - size_t len, payload_len, ceil_len; - int retval; - -#ifdef VERBOSE2 - fprintf(stderr, - "vrpn_Endpoint::handle_tcp_messages(): something to read\n"); -#endif - - // Read and parse the header - if (vrpn_noint_block_read(fd, (char *)header, sizeof(header)) != - sizeof(header)) { - fprintf(stderr, "vrpn_Endpoint::handle_tcp_messages: " - "Can't read header (this is normal when a connection " - "is dropped)\n"); - return -1; - } - len = ntohl(header[0]); - time.tv_sec = ntohl(header[1]); - time.tv_usec = ntohl(header[2]); - sender = ntohl(header[3]); - type = ntohl(header[4]); -#ifdef VERBOSE2 - fprintf(stderr, " header: Len %d, Sender %d, Type %d\n", (int)len, - (int)sender, (int)type); -#endif - - // skip up to alignment - vrpn_int32 header_len = sizeof(header); - if (header_len % vrpn_ALIGN) { - header_len += vrpn_ALIGN - header_len % vrpn_ALIGN; - } - if (header_len > static_cast<vrpn_int32>(sizeof(header))) { - // the difference can be no larger than this - char rgch[vrpn_ALIGN]; - if (vrpn_noint_block_read(fd, (char *)rgch, - header_len - sizeof(header)) != - (int)(header_len - sizeof(header))) { - fprintf(stderr, "vrpn_Endpoint::handle_tcp_messages: " - "Can't read header + alignment\n"); - return -1; - } - } - - // Figure out how long the message body is, and how long it - // is including any padding to make sure that it is a - // multiple of four bytes long. - payload_len = len - header_len; - ceil_len = payload_len; - if (ceil_len % vrpn_ALIGN) { - ceil_len += vrpn_ALIGN - ceil_len % vrpn_ALIGN; - } - - // Make sure the buffer is long enough to hold the whole - // message body. - if (buflen < ceil_len) { - fprintf(stderr, - "vrpn: vrpn_Endpoint::handle_tcp_messages: Message too long\n"); - return -1; - } - - // Read the body of the message - if (vrpn_noint_block_read(fd, buf, ceil_len) != ceil_len) { - perror("vrpn: vrpn_Endpoint::handle_tcp_messages: Can't read body"); - return -1; - } - - if (d_inLog->logIncomingMessage(payload_len, time, type, sender, buf)) { - fprintf(stderr, "Couldn't log incoming message.!\n"); - return -1; - } - - retval = dispatch(type, sender, time, static_cast<vrpn_uint32>(payload_len), - buf); - if (retval) { - return -1; - } - - return 0; -} - -int vrpn_Endpoint_IP::getOneUDPMessage(char *inbuf_ptr, size_t inbuf_len) -{ - vrpn_int32 header[5]; - struct timeval time; - vrpn_int32 sender, type; - vrpn_uint32 len, payload_len, ceil_len; - int retval; - - // Read and parse the header - // skip up to alignment - vrpn_uint32 header_len = sizeof(header); - if (header_len % vrpn_ALIGN) { - header_len += vrpn_ALIGN - header_len % vrpn_ALIGN; - } - - if (header_len > (vrpn_uint32)inbuf_len) { - fprintf(stderr, "vrpn_Endpoint::getOneUDPMessage: Can't read header"); - return -1; - } - memcpy(header, inbuf_ptr, sizeof(header)); - inbuf_ptr += header_len; - len = ntohl(header[0]); - time.tv_sec = ntohl(header[1]); - time.tv_usec = ntohl(header[2]); - sender = ntohl(header[3]); - type = ntohl(header[4]); - -#ifdef VERBOSE - fprintf(stderr, "Message type %ld (local type %ld), sender %ld received\n", - type, local_type_id(type), sender); - fprintf(stderr, "Message length is %d (buffer length %d).\n", len, - inbuf_len); -#endif - - // Figure out how long the message body is, and how long it - // is including any padding to make sure that it is a - // multiple of vrpn_ALIGN bytes long. - payload_len = len - header_len; - ceil_len = payload_len; - if (ceil_len % vrpn_ALIGN) { - ceil_len += vrpn_ALIGN - ceil_len % vrpn_ALIGN; - } - - // Make sure we received enough to cover the entire payload - if (header_len + ceil_len > (vrpn_uint32)inbuf_len) { - fprintf(stderr, "vrpn_Endpoint::getOneUDPMessage: Can't read payload"); - return -1; - } - - if (d_inLog->logIncomingMessage(payload_len, time, type, sender, - inbuf_ptr)) { - fprintf(stderr, "Couldn't log incoming message.!\n"); - return -1; - } - - retval = dispatch(type, sender, time, payload_len, inbuf_ptr); - if (retval) { - return -1; - } - - return ceil_len + header_len; -} - -int vrpn_Endpoint::dispatch(vrpn_int32 type, vrpn_int32 sender, timeval time, - vrpn_uint32 payload_len, char *bufptr) -{ - - // Call the handler for this message type - // If it returns nonzero, return an error. - if (type >= 0) { // User handler, map to local id - - // Only process if local id has been set. - - if (local_type_id(type) >= 0) { - if (d_dispatcher->doCallbacksFor(local_type_id(type), - local_sender_id(sender), time, - payload_len, bufptr)) { - return -1; - } - } - } - else { // System handler - - if (d_dispatcher->doSystemCallbacksFor(type, sender, time, payload_len, - bufptr, this)) { - fprintf(stderr, "vrpn_Endpoint::dispatch: " - "Nonzero system return\n"); - return -1; - } - } - - return 0; -} - -int vrpn_Endpoint::tryToMarshall(char *outbuf, vrpn_int32 &buflen, - vrpn_int32 &numOut, vrpn_uint32 len, - timeval time, vrpn_int32 type, - vrpn_int32 sender, const char *buffer, - vrpn_uint32 sequenceNumber) -{ - int retval; - - retval = marshall_message(outbuf, buflen, numOut, len, time, type, sender, - buffer, sequenceNumber); - - // If the marshalling failed, try clearing the outgoing buffers - // by sending the stuff in them to see if this makes enough - // room. If not, we'll have to give up. - if (!retval) { - if (send_pending_reports() != 0) { - return 0; - } - retval = marshall_message(outbuf, buflen, numOut, len, time, type, - sender, buffer, sequenceNumber); - } - - return retval; -} - -/** Marshal the message into the buffer if it will fit. Return the number - of characters sent (either 0 or the number requested). This function - should not be called directly; rather, call tryToMarshall, which will - flush the outgoing buffer if the marshalling attempt fails. -*/ - -// TCH 22 Feb 99 -// Marshall the sequence number, but never unmarshall it - it's currently -// only provided for the benefit of sniffers. - -int vrpn_Endpoint::marshall_message( - char *outbuf, // Base pointer to the output buffer - vrpn_uint32 outbuf_size, // Total size of the output buffer - vrpn_uint32 initial_out, // How many characters are already in outbuf - vrpn_uint32 len, // Length of the message payload - struct timeval time, // Time the message was generated - vrpn_int32 type, // Type of the message - vrpn_int32 sender, // Sender of the message - const char *buffer, // Message payload - vrpn_uint32 seqNo) // Sequence number -{ - vrpn_uint32 ceil_len, header_len, total_len; - vrpn_uint32 curr_out = initial_out; // How many out total so far - - // Compute the length of the message plus its padding to make it - // an even multiple of vrpn_ALIGN bytes. - - // Compute the total message length and put the message - // into the message buffer (if we have room for the whole message) - ceil_len = len; - if (len % vrpn_ALIGN) { - ceil_len += vrpn_ALIGN - len % vrpn_ALIGN; - } - header_len = 5 * sizeof(vrpn_int32); - if (header_len % vrpn_ALIGN) { - header_len += vrpn_ALIGN - header_len % vrpn_ALIGN; - } - total_len = header_len + ceil_len; - if ((curr_out + total_len) > (vrpn_uint32)outbuf_size) { - return 0; - } - - // fprintf(stderr, " Marshalling message type %d, sender %d, length %d.\n", - // type, sender, len); - - // The packet header len field does not include the padding bytes, - // these are inferred on the other side. - // Later, to make things clearer, we should probably infer the header - // len on the other side (in the same way the padding is done) - // The reason we don't include the padding in the len is that we - // would not be able to figure out the size of the padding on the - // far side) - *(vrpn_uint32 *)(void *)(&outbuf[curr_out]) = htonl(header_len + len); - curr_out += sizeof(vrpn_uint32); - - // Pack the time (using gettimeofday() format) into the buffer - // and do network byte ordering. - *(vrpn_uint32 *)(void *)(&outbuf[curr_out]) = htonl(time.tv_sec); - curr_out += sizeof(vrpn_uint32); - *(vrpn_uint32 *)(void *)(&outbuf[curr_out]) = htonl(time.tv_usec); - curr_out += sizeof(vrpn_uint32); - - // Pack the sender and type and do network byte-ordering - *(vrpn_uint32 *)(void *)(&outbuf[curr_out]) = htonl(sender); - curr_out += sizeof(vrpn_uint32); - *(vrpn_uint32 *)(void *)(&outbuf[curr_out]) = htonl(type); - curr_out += sizeof(vrpn_uint32); - - // Pack the sequence number. If something's really screwy with - // our sizes/types and there isn't room for the sequence number, - // skipping for alignment below will overwrite it! - *(vrpn_uint32 *)(void *)(&outbuf[curr_out]) = htonl(seqNo); - curr_out += sizeof(vrpn_uint32); - - // skip chars if needed for alignment - curr_out = initial_out + header_len; - - // Pack the message from the buffer. Then skip as many characters - // as needed to make the end of the buffer fall on an even alignment - // of vrpn_ALIGN bytes (the size of largest element sent via vrpn. - if (buffer != NULL) { - memcpy(&outbuf[curr_out], buffer, len); - } - curr_out += ceil_len; -#ifdef VERBOSE - printf("Marshalled: len %d, ceil_len %d: '", len, ceil_len); - printf("'\n"); -#endif - return curr_out - initial_out; // How many extra bytes we sent -} - -// static -int vrpn_Endpoint::handle_type_message(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Endpoint *endpoint = static_cast<vrpn_Endpoint *>(userdata); - cName type_name; - vrpn_int32 i; - vrpn_int32 local_id; - - if (static_cast<unsigned>(p.payload_len) > sizeof(cName)) { - fprintf(stderr, "vrpn: vrpn_Endpoint::handle_type_message: " - "Type name too long\n"); - return -1; - } - - // Find out the name of the type (skip the length) - strncpy(type_name, p.buffer + sizeof(vrpn_int32), - p.payload_len - sizeof(vrpn_int32)); - - // Use the exact length packed into the start of the buffer - // to figure out where to put the trailing '\0' - i = ntohl(*((vrpn_int32 *)p.buffer)); - type_name[i] = '\0'; - -#ifdef VERBOSE - printf("Registering other-side type: '%s'\n", type_name); -#endif - // If there is a corresponding local type defined, find the mapping. - local_id = endpoint->d_dispatcher->getTypeID(type_name); - // If not, add this type locally - if (local_id == -1) { - if (endpoint->d_parent != NULL) { - local_id = endpoint->d_parent->register_message_type(type_name); - } -#ifdef VERBOSE - else { - printf("vrpn_Endpoint::handle_type_message: NULL d_parent " - "when trying to auto-register remote message type %s.\n", - type_name); - } -#endif - } - if (endpoint->newRemoteType(type_name, p.sender, local_id) == -1) { - fprintf(stderr, "vrpn: Failed to add remote type %s\n", type_name); - return -1; - } - - return 0; -} - -void vrpn_Endpoint::setLogNames(const char *inName, const char *outName) -{ - if (inName != NULL) { - d_inLog->setName(inName); - } - if (outName != NULL) { - d_outLog->setName(outName); - } -} - -int vrpn_Endpoint::openLogs(void) -{ - - if (d_inLog->open()) { - return -1; - } - if (d_outLog->open()) { - return -1; - } - - return 0; -} - -// static -int vrpn_Endpoint::handle_sender_message(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Endpoint *endpoint = static_cast<vrpn_Endpoint *>(userdata); - cName sender_name; - vrpn_int32 i; - vrpn_int32 local_id; - - if (static_cast<size_t>(p.payload_len) > sizeof(cName)) { - fprintf(stderr, "vrpn: vrpn_Endpoint::handle_sender_message():Sender " - "name too long\n"); - return -1; - } - - // Find out the name of the sender (skip the length) - strncpy(sender_name, p.buffer + sizeof(vrpn_int32), - p.payload_len - sizeof(vrpn_int32)); - - // Use the exact length packed into the start of the buffer - // to figure out where to put the trailing '\0' - i = ntohl(*((vrpn_int32 *)p.buffer)); - sender_name[i] = '\0'; - -#ifdef VERBOSE - printf("Registering other-side sender: '%s'\n", sender_name); -#endif - // If there is a corresponding local sender defined, find the mapping. - local_id = endpoint->d_dispatcher->getSenderID(sender_name); - // If not, add this sender locally - if (local_id == -1) { - if (endpoint->d_parent != NULL) { - local_id = endpoint->d_parent->register_sender(sender_name); - } -#ifdef VERBOSE - else { - printf("vrpn_Endpoint::handle_sender_message: NULL d_parent " - "when trying to auto-register remote message sender %s\n", - sender_name); - } -#endif - } - if (endpoint->newRemoteSender(sender_name, p.sender, local_id) == -1) { - fprintf(stderr, "vrpn: Failed to add remote sender %s\n", sender_name); - return -1; - } - - return 0; -} - -int vrpn_Endpoint::pack_type_description(vrpn_int32 which) -{ - struct timeval now; - - // need to pack the null char as well - vrpn_uint32 len = - static_cast<vrpn_int32>(strlen(d_dispatcher->typeName(which)) + 1); - vrpn_uint32 netlen; - char buffer[sizeof(len) + sizeof(cName)]; - - netlen = htonl(len); -// Pack a message with type vrpn_CONNECTION_TYPE_DESCRIPTION -// whose sender ID is the ID of the type that is being -// described and whose body contains the length of the name -// and then the name of the type. - -#ifdef VERBOSE - printf(" vrpn_Connection: Packing type '%s', %d\n", - d_dispatcher->typeName(which), which); -#endif - memcpy(buffer, &netlen, sizeof(netlen)); - memcpy(&buffer[sizeof(len)], d_dispatcher->typeName(which), - (vrpn_int32)len); - vrpn_gettimeofday(&now, NULL); - - return pack_message((vrpn_uint32)(len + sizeof(len)), now, - vrpn_CONNECTION_TYPE_DESCRIPTION, which, buffer, - vrpn_CONNECTION_RELIABLE); -} - -int vrpn_Endpoint::pack_sender_description(vrpn_int32 which) -{ - struct timeval now; - - // need to pack the null char as well - vrpn_uint32 len = - static_cast<vrpn_int32>(strlen(d_dispatcher->senderName(which)) + 1); - vrpn_uint32 netlen; - char buffer[sizeof(len) + sizeof(cName)]; - - netlen = htonl(len); -// Pack a message with type vrpn_CONNECTION_SENDER_DESCRIPTION -// whose sender ID is the ID of the sender that is being -// described and whose body contains the length of the name -// and then the name of the sender. - -#ifdef VERBOSE - printf(" vrpn_Connection: Packing sender '%s'\n", - d_dispatcher->senderName(which)); -#endif - memcpy(buffer, &netlen, sizeof(netlen)); - memcpy(&buffer[sizeof(len)], d_dispatcher->senderName(which), - (vrpn_int32)len); - vrpn_gettimeofday(&now, NULL); - - return pack_message((vrpn_uint32)(len + sizeof(len)), now, - vrpn_CONNECTION_SENDER_DESCRIPTION, which, buffer, - vrpn_CONNECTION_RELIABLE); -} - -static int flush_udp_socket(SOCKET fd) -{ - timeval localTimeout; - fd_set readfds, exceptfds; - char buf[10000]; - int sel_ret; - - // fprintf(stderr, "flush_udp_socket().\n"); - - localTimeout.tv_sec = 0; - localTimeout.tv_usec = 0; - - // Empty out any pending UDP messages by reading the socket and - // then throwing it away. - - do { - // Select to see if ready to hear from server, or exception - FD_ZERO(&readfds); /* Clear the descriptor sets */ - FD_ZERO(&exceptfds); - FD_SET(fd, &readfds); /* Check for read */ - FD_SET(fd, &exceptfds); /* Check for exceptions */ - sel_ret = vrpn_noint_select(static_cast<int>(fd) + 1, &readfds, NULL, - &exceptfds, &localTimeout); - if (sel_ret == -1) { - fprintf(stderr, "flush_udp_socket: select failed()."); - return -1; - } - - // See if exceptional condition on socket - if (FD_ISSET(fd, &exceptfds)) { - fprintf(stderr, "flush_udp_socket: Exception on socket.\n"); - return -1; - } - - // If there is anything to read, get the next message - if (FD_ISSET(fd, &readfds)) { - int inbuf_len; - - inbuf_len = recv(fd, buf, 10000, 0); - if (inbuf_len == -1) { - fprintf(stderr, "flush_udp_socket: recv() failed.\n"); - return -1; - } - } - - } while (sel_ret); - - return 0; -} - -int vrpn_Connection::pack_type_description(vrpn_int32 which) -{ - int retval; - int i; - - for (i = 0; i < d_numEndpoints; i++) { - if (d_endpoints[i]) { - retval = d_endpoints[i]->pack_type_description(which); - if (retval) { - return -1; - } - } - } - - return 0; -} - -int vrpn_Connection::pack_sender_description(vrpn_int32 which) -{ - int retval; - int i; - - for (i = 0; i < d_numEndpoints; i++) { - if (d_endpoints[i]) { - retval = d_endpoints[i]->pack_sender_description(which); - if (retval) { - return -1; - } - } - } - - return 0; -} - -// static -int vrpn_Connection::handle_log_message(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Endpoint *endpoint = (vrpn_Endpoint *)userdata; - int retval = 0; - vrpn_int32 inNameLen, outNameLen; - const char **bp = &p.buffer; - - // TCH 16 Feb 01 - vrpn_unbuffer(bp, &inNameLen); - vrpn_unbuffer(bp, &outNameLen); - - // must deal properly with only opening one log file - // the log message contains "" (an empty string) if - // there is no desire to log that file. - endpoint->setLogNames(inNameLen == 0 ? NULL : *bp, - outNameLen == 0 ? NULL : *bp + inNameLen + 1); - if (inNameLen > 0) retval = endpoint->d_inLog->open(); - if (outNameLen > 0) retval = endpoint->d_outLog->open(); - - // Safety check: - // If we can't log when the client asks us to, close the connection. - // Something more talkative would be useful. - // The problem with implementing this is that it's over-strict: clients - // that assume logging succeeded unless the connection was dropped - // will be running on the wrong assumption if we later change this to - // be a notification message. - - if (retval == -1) { - // Will be dropped automatically on next pass through mainloop - endpoint->status = BROKEN; - } - else { - fprintf(stderr, "vrpn_Connection::handle_log_message: " - "Remote connection requested logging.\n"); - } - - // OR the remotely-requested logging mode with whatever we've - // been told to do locally - if (p.sender & vrpn_LOG_INCOMING) { - endpoint->d_inLog->logMode() |= vrpn_LOG_INCOMING; - } - if (p.sender & vrpn_LOG_OUTGOING) { - endpoint->d_outLog->logMode() |= vrpn_LOG_OUTGOING; - } - - return retval; -} - -// Pack a message to all open endpoints. If the pack fails for any of -// the endpoints, return failure. - -int vrpn_Connection::pack_message(vrpn_uint32 len, struct timeval time, - vrpn_int32 type, vrpn_int32 sender, - const char *buffer, - vrpn_uint32 class_of_service) -{ - int i, ret; - - // Make sure I'm not broken - if (connectionStatus == BROKEN) { - printf("vrpn_Connection::pack_message: Can't pack because the " - "connection is broken\n"); - return -1; - } - - // Make sure type is either a system type (-) or a legal user type - if (type >= d_dispatcher->numTypes()) { - printf("vrpn_Connection::pack_message: bad type (%d)\n", type); - return -1; - } - - // If this is not a system message, make sure the sender is legal. - if (type >= 0) { - if ((sender < 0) || (sender >= d_dispatcher->numSenders())) { - printf("vrpn_Connection::pack_message: bad sender (%d)\n", sender); - return -1; - } - } - - // Pack the message to all open endpoints This must be done before - // yanking local callbacks in order to have message delivery be the - // same on local and remote systems in the case where a local handler - // packs one or more messages in response to this message. - ret = 0; - for (i = 0; i < d_numEndpoints; i++) { - if (d_endpoints[i] && - (d_endpoints[i]->pack_message(len, time, type, sender, buffer, - class_of_service) != 0)) { - ret = -1; - } - } - - // See if there are any local handlers for this message type from - // this sender. If so, yank the callbacks. This needs to be done - // AFTER the message is packed to open endpoints so that messages - // will be sent in the same order from local and remote senders - // (since a local message handler may pack its own messages before - // returning). - - if (do_callbacks_for(type, sender, time, len, buffer)) { - return -1; - } - - return ret; -} - -// Returns the time since the connection opened. -// Some subclasses may redefine time. - -// virtual -int vrpn_Connection::time_since_connection_open(struct timeval *elapsed_time) -{ - struct timeval now; - vrpn_gettimeofday(&now, NULL); - *elapsed_time = vrpn_TimevalDiff(now, start_time); - - return 0; -} - -// returns the current time in the connection since the epoch (UTC time). -// virtual -timeval vrpn_Connection::get_time() -{ - struct timeval now; - vrpn_gettimeofday(&now, NULL); - return now; -} - -// Returns the name of the specified sender/type, or NULL -// if the parameter is invalid. -// virtual -const char *vrpn_Connection::sender_name(vrpn_int32 sender) -{ - return d_dispatcher->senderName(sender); -} - -// virtual -const char *vrpn_Connection::message_type_name(vrpn_int32 type) -{ - return d_dispatcher->typeName(type); -} - -// virtual -int vrpn_Connection::register_log_filter(vrpn_LOGFILTER filter, void *userdata) -{ - int i; - for (i = 0; i < d_numEndpoints; i++) { - d_endpoints[i]->d_inLog->addFilter(filter, userdata); - d_endpoints[i]->d_outLog->addFilter(filter, userdata); - } - return 0; -} - -// virtual -int vrpn_Connection::save_log_so_far() -{ - int i; - int final_retval = 0; - for (i = 0; i < d_numEndpoints; i++) { - final_retval |= d_endpoints[i]->d_inLog->saveLogSoFar(); - final_retval |= d_endpoints[i]->d_outLog->saveLogSoFar(); - } - return final_retval; -} - -// virtual -vrpn_File_Connection *vrpn_Connection::get_File_Connection(void) -{ - return NULL; -} - -void vrpn_Connection::init(void) -{ - vrpn_int32 i; - - // Lots of constants used to be set up here. They were moved - // into the constructors in 02.10; this will create a slight - // increase in maintenance burden keeping the constructors consistient. - - for (i = 0; i < vrpn_MAX_ENDPOINTS; i++) { - d_endpoints[i] = NULL; - } - - vrpn_gettimeofday(&start_time, NULL); - - d_dispatcher = new vrpn_TypeDispatcher; - - // These should be among the first senders & types sent over the wire - d_dispatcher->registerSender(vrpn_CONTROL); - d_dispatcher->registerType(vrpn_got_first_connection); - d_dispatcher->registerType(vrpn_got_connection); - d_dispatcher->registerType(vrpn_dropped_connection); - d_dispatcher->registerType(vrpn_dropped_last_connection); - - d_dispatcher->setSystemHandler(vrpn_CONNECTION_SENDER_DESCRIPTION, - vrpn_Endpoint::handle_sender_message); - d_dispatcher->setSystemHandler(vrpn_CONNECTION_TYPE_DESCRIPTION, - vrpn_Endpoint::handle_type_message); - d_dispatcher->setSystemHandler(vrpn_CONNECTION_DISCONNECT_MESSAGE, - handle_disconnect_message); - - d_stop_processing_messages_after = 0; -} - -/** - * Deletes the endpoint and NULLs the entry in the list of open endpoints. - */ - -int vrpn_Connection::delete_endpoint(int endpointIndex) -{ - - vrpn_Endpoint *endpoint = d_endpoints[endpointIndex]; - - if (endpoint) { - delete endpoint; - } - d_endpoints[endpointIndex] = NULL; - - return 0; -} - -/** - * Makes sure the endpoint array is set up cleanly for the next pass through. - */ - -int vrpn_Connection::compact_endpoints(void) -{ - int i; - - for (i = 0; i < d_numEndpoints; i++) { - if (!d_endpoints[i]) { - d_endpoints[i] = d_endpoints[d_numEndpoints - 1]; - d_endpoints[d_numEndpoints - 1] = NULL; - - d_numEndpoints--; - } - } - - return 0; -} - -// Set up to be a server connection, creating a logging connection if -// asked for. -vrpn_Connection::vrpn_Connection(const char *local_in_logfile_name, - const char *local_out_logfile_name, - vrpn_Endpoint_IP *(*epa)(vrpn_Connection *, - vrpn_int32 *)) - : d_numEndpoints(0) - , d_numConnectedEndpoints(0) - , d_references(0) - , d_autoDeleteStatus(false) - , d_dispatcher(NULL) - , d_serverLogCount(0) - , d_serverLogMode( - (local_in_logfile_name ? vrpn_LOG_INCOMING : vrpn_LOG_NONE) | - (local_out_logfile_name ? vrpn_LOG_OUTGOING : vrpn_LOG_NONE)) - , d_serverLogName(NULL) - , d_endpointAllocator(epa) - , d_updateEndpoint(vrpn_FALSE) -{ - int retval; - vrpn_Endpoint *endpoint; // shorthand for d_endpoints[0] - - // Initialize the things that must be for any constructor - vrpn_Connection::init(); - - // Server connections should handle log messages. - d_dispatcher->setSystemHandler(vrpn_CONNECTION_LOG_DESCRIPTION, - handle_log_message); - - if (local_out_logfile_name) { - d_endpoints[0] = (*d_endpointAllocator)(this, NULL); - if (!d_endpoints[0]) { - fprintf(stderr, "vrpn_Connection::vrpn_Connection:%d " - "Couldn't create endpoint for log file.\n", - __LINE__); - connectionStatus = BROKEN; - return; - } - endpoint = d_endpoints[0]; - endpoint->setConnection(this); - d_updateEndpoint = vrpn_TRUE; - endpoint->d_outLog->setName(local_out_logfile_name); - endpoint->d_outLog->logMode() = d_serverLogMode; - retval = endpoint->d_outLog->open(); - if (retval == -1) { - fprintf(stderr, "vrpn_Connection::vrpn_Connection:%d " - "Couldn't open outgoing log file.\n", - __LINE__); - delete d_endpoints[0]; - d_endpoints[0] = NULL; - connectionStatus = BROKEN; - return; - } - d_numEndpoints = 1; - endpoint->d_remoteLogMode = vrpn_LOG_NONE; - endpoint->d_remoteInLogName = new char[10]; - strcpy(endpoint->d_remoteInLogName, ""); - endpoint->d_remoteOutLogName = new char[10]; - strcpy(endpoint->d_remoteOutLogName, ""); - // Outgoing messages are logged regardless of connection status. - endpoint->status = LOGGING; - } - - if (local_in_logfile_name) { - d_serverLogName = new char[1 + strlen(local_in_logfile_name)]; - if (!d_serverLogName) { - fprintf(stderr, "vrpn_Connection::vrpn_Connection:%d " - "Out of memory.\n", - __LINE__); - connectionStatus = BROKEN; - return; - } - strcpy(d_serverLogName, local_in_logfile_name); - } -} - -vrpn_Connection::vrpn_Connection( - const char *local_in_logfile_name, const char *local_out_logfile_name, - const char *remote_in_logfile_name, const char *remote_out_logfile_name, - vrpn_Endpoint_IP *(*epa)(vrpn_Connection *, vrpn_int32 *)) - : connectionStatus(BROKEN) - , // default value if not otherwise set in ctr - d_numEndpoints(0) - , d_numConnectedEndpoints(0) - , d_references(0) - , d_autoDeleteStatus(false) - , d_dispatcher(NULL) - , d_serverLogCount(0) - , d_serverLogMode(vrpn_LOG_NONE) - , d_serverLogName(NULL) - , d_endpointAllocator(epa) - , d_updateEndpoint(vrpn_FALSE) -{ - vrpn_Endpoint *endpoint; - int retval; - - // Initialize the things that must be for any constructor - vrpn_Connection::init(); - - // We're a client; create our single endpoint and initialize it. - d_endpoints[0] = (*d_endpointAllocator)(this, &d_numConnectedEndpoints); - d_endpoints[0]->setConnection(this); - d_updateEndpoint = vrpn_TRUE; - if (!d_endpoints[0]) { - fprintf(stderr, "vrpn_Connection:%d Out of memory.\n", __LINE__); - connectionStatus = BROKEN; - return; - } - - d_numEndpoints = 1; - endpoint = d_endpoints[0]; // shorthand - - // Store the remote log file name and the remote log mode - endpoint->d_remoteLogMode = - (((remote_in_logfile_name && strlen(remote_in_logfile_name) > 0) - ? vrpn_LOG_INCOMING - : vrpn_LOG_NONE) | - ((remote_out_logfile_name && strlen(remote_out_logfile_name) > 0) - ? vrpn_LOG_OUTGOING - : vrpn_LOG_NONE)); - if (!remote_in_logfile_name) { - endpoint->d_remoteInLogName = new char[10]; - strcpy(endpoint->d_remoteInLogName, ""); - } - else { - endpoint->d_remoteInLogName = - new char[strlen(remote_in_logfile_name) + 1]; - strcpy(endpoint->d_remoteInLogName, remote_in_logfile_name); - } - - if (!remote_out_logfile_name) { - endpoint->d_remoteOutLogName = new char[10]; - strcpy(endpoint->d_remoteOutLogName, ""); - } - else { - endpoint->d_remoteOutLogName = - new char[strlen(remote_out_logfile_name) + 1]; - strcpy(endpoint->d_remoteOutLogName, remote_out_logfile_name); - } - - // If we are doing local logging, turn it on here. If we - // can't open the file, then the connection is broken. - - if (local_in_logfile_name && (strlen(local_in_logfile_name) != 0)) { - endpoint->d_inLog->setName(local_in_logfile_name); - endpoint->d_inLog->logMode() = vrpn_LOG_INCOMING; - retval = endpoint->d_inLog->open(); - if (retval == -1) { - fprintf(stderr, "vrpn_Connection::vrpn_Connection:%d " - "Couldn't open incoming log file.\n", - __LINE__); - connectionStatus = BROKEN; - // fprintf(stderr, "BROKEN - vrpn_Connection::vrpn_Connection.\n"); - return; - } - // fprintf(stderr, "vrpn_Connection: opened logfile.\n"); - } - - if (local_out_logfile_name && (strlen(local_out_logfile_name) != 0)) { - endpoint->d_outLog->setName(local_out_logfile_name); - endpoint->d_outLog->logMode() = vrpn_LOG_OUTGOING; - retval = endpoint->d_outLog->open(); - if (retval == -1) { - fprintf(stderr, "vrpn_Connection::vrpn_Connection:%d " - "Couldn't open local outgoing log file.\n", - __LINE__); - connectionStatus = BROKEN; - // fprintf(stderr, "BROKEN - vrpn_Connection::vrpn_Connection.\n"); - return; - } - // fprintf(stderr, "vrpn_Connection: opened logfile.\n"); - } -} - -vrpn_Connection::~vrpn_Connection(void) -{ - - // Clean up types, senders, and callbacks. - if (d_dispatcher) { - delete d_dispatcher; - d_dispatcher = NULL; - } - - if (d_references > 0) { - fprintf(stderr, - "Connection was deleted while %d references still remain.\n", - d_references); - } -} - -// Some object is now using this connection. -void vrpn_Connection::addReference() { d_references++; } - -// Some object has stopped using this connection. Decrement the ref counter. -// If there aren't any references, this connection is no longer in use. -// Once it's no longer in use destroy the connection iff d_autoDeleteStatus -// has been set to TRUE. If d_autoDeleteStatus is FALSE, the user must -// destroy the connection explicitly. -void vrpn_Connection::removeReference() -{ - d_references--; - if (d_references == 0 && d_autoDeleteStatus == true) { - delete this; - } - else if (d_references < 0) { // this shouldn't happen. - // sanity check - fprintf(stderr, "Negative reference count. This shouldn't happen."); - } -} - -vrpn_int32 vrpn_Connection::register_sender(const char *name) -{ - vrpn_int32 retval; - vrpn_int32 i; - -#ifdef VERBOSE - fprintf(stderr, "vrpn_Connection::register_sender: " - "%d senders; new name \"%s\"\n", - d_dispatcher->numSenders(), name); -#endif - - // See if the name is already in the list. If so, return it. - retval = d_dispatcher->getSenderID(name); - if (retval != -1) { -#ifdef VERBOSE - fprintf(stderr, "Sender already defined as id %d.\n", retval); -#endif - return retval; - } - - retval = d_dispatcher->addSender(name); - -#ifdef VERBOSE - fprintf(stderr, "Packing sender description for %s, type %d.\n", name, - retval); -#endif - - // Pack the sender description. - // TCH 24 Jan 00 - Need to do this even if not connected so - // that it goes into the logs (if we're keeping any). - pack_sender_description(retval); - - // If the other side has declared this sender, establish the - // mapping for it. - for (i = 0; i < d_numEndpoints; i++) { - d_endpoints[i]->newLocalSender(name, retval); - } - - // One more in place -- return its index - return retval; -} - -vrpn_int32 vrpn_Connection::register_message_type(const char *name) -{ - vrpn_int32 retval; - vrpn_int32 i; - -#ifdef VERBOSE - fprintf(stderr, "vrpn_Connection::register_message_type: " - "%d type; new name \"%s\"\n", - d_dispatcher->numTypes(), name); -#endif - - // See if the name is already in the list. If so, return it. - retval = d_dispatcher->getTypeID(name); - if (retval != -1) { -#ifdef VERBOSE - fprintf(stderr, "Type already defined as id %d.\n", retval); -#endif - return retval; - } - - retval = d_dispatcher->addType(name); - -// Pack the type description. -// TCH 24 Jan 00 - Need to do this even if not connected so -// that it goes into the logs (if we're keeping any). - -#ifdef VERBOSE - fprintf(stderr, "Packing type description for %s, type %d.\n", name, - retval); -#endif - - pack_type_description(retval); - - // If the other side has declared this type, establish the - // mapping for it. - for (i = 0; i < d_numEndpoints; i++) { - d_endpoints[i]->newLocalType(name, retval); - } - - // One more in place -- return its index - return retval; -} - -// Yank the callback chain for a message type. Call all handlers that -// are interested in messages from this sender. Return 0 if they all -// return 0, -1 otherwise. - -int vrpn_Connection::do_callbacks_for(vrpn_int32 type, vrpn_int32 sender, - struct timeval time, - vrpn_uint32 payload_len, const char *buf) -{ - return d_dispatcher->doCallbacksFor(type, sender, time, payload_len, buf); -} - -int vrpn_Connection::doSystemCallbacksFor(vrpn_HANDLERPARAM p, void *ud) -{ - return d_dispatcher->doSystemCallbacksFor(p, ud); -} - -void vrpn_Connection::get_log_names(char **local_in_logname, - char **local_out_logname, - char **remote_in_logname, - char **remote_out_logname) -{ - if (!(d_endpoints[0])) return; - vrpn_Endpoint *endpoint = d_endpoints[0]; - // XXX it is possible to have more than one endpoint, and other endpoints - // may have other log names - - if (local_in_logname != NULL) - *local_in_logname = endpoint->d_inLog->getName(); - if (local_out_logname != NULL) - *local_out_logname = endpoint->d_outLog->getName(); - - if (remote_in_logname != NULL) { - if (endpoint->d_remoteInLogName != NULL) { - *remote_in_logname = - new char[strlen(endpoint->d_remoteInLogName) + 1]; - strcpy(*remote_in_logname, endpoint->d_remoteInLogName); - } - else { - *remote_in_logname = NULL; - } - } - - if (remote_out_logname != NULL) { - if (endpoint->d_remoteOutLogName != NULL) { - *remote_out_logname = - new char[strlen(endpoint->d_remoteOutLogName) + 1]; - strcpy(*remote_out_logname, endpoint->d_remoteOutLogName); - } - else { - *remote_out_logname = NULL; - } - } -} - -// virtual -void vrpn_Connection::updateEndpoints(void) {} - -// static -vrpn_Endpoint_IP *vrpn_Connection::allocateEndpoint(vrpn_Connection *me, - vrpn_int32 *connectedEC) -{ - return new vrpn_Endpoint_IP(me->d_dispatcher, connectedEC); -} - -// This is called when a disconnect message is found in the logfile. -// It causes the other-side sender and type messages to be cleared, -// in anticipation of a possible new set of messages caused by a -// reconnected server. - -int vrpn_Connection::handle_disconnect_message(void *userdata, - vrpn_HANDLERPARAM) -{ - vrpn_Endpoint *endpoint = (vrpn_Endpoint *)userdata; - -#ifdef VERBOSE - printf("Just read disconnect message from logfile\n"); -#endif - endpoint->clear_other_senders_and_types(); - - return 0; -} - -int vrpn_Connection::register_handler(vrpn_int32 type, - vrpn_MESSAGEHANDLER handler, - void *userdata, vrpn_int32 sender) -{ - return d_dispatcher->addHandler(type, handler, userdata, sender); -} - -int vrpn_Connection::unregister_handler(vrpn_int32 type, - vrpn_MESSAGEHANDLER handler, - void *userdata, vrpn_int32 sender) -{ - return d_dispatcher->removeHandler(type, handler, userdata, sender); -} - -int vrpn_Connection::message_type_is_registered(const char *name) const -{ - return d_dispatcher->getTypeID(name); -} - -// Changed 8 November 1999 by TCH -// With multiple connections allowed, TRYING_TO_CONNECT is an -// "ok" status, so we need to admit it. (Used to check >= 0) -// XXX What if one endpoint is BROKEN? Don't we need to loop? -vrpn_bool vrpn_Connection::doing_okay(void) const -{ - - int endpointIndex; - - for (endpointIndex = 0; endpointIndex < d_numEndpoints; endpointIndex++) { - if (d_endpoints[endpointIndex] && - (!d_endpoints[endpointIndex]->doing_okay())) { - return VRPN_FALSE; - } - } - return (connectionStatus > BROKEN); -} - -// Loop over endpoints and return TRUE if any of them are connected. -vrpn_bool vrpn_Connection::connected(void) const -{ - int endpointIndex; - - for (endpointIndex = 0; endpointIndex < d_numEndpoints; endpointIndex++) { - if (d_endpoints[endpointIndex] && - (d_endpoints[endpointIndex]->status == CONNECTED)) { - return VRPN_TRUE; - } - } - return VRPN_FALSE; -} - -//------------------------------------------------------------------------ -// This section holds data structures and functions to open -// connections by name. -// The intention of this section is that it can open connections for -// objects that are of different types (trackers, buttons and sound), -// even if they all refer to the same connection. - -// This routine will return a pointer to the connection whose name -// is passed in. If the routine is called multiple times with the same -// name, it will return the same pointer, rather than trying to make -// multiple of the same connection (unless force_connection = true). -// If the connection is in a bad way, it returns NULL. -// This routine will strip off any part of the string before and -// including the '@' character, considering this to be the local part -// of a device name, rather than part of the connection name. This allows -// the opening of a connection to "Tracker0@ioglab" for example, which will -// open a connection to ioglab. - -// This routine adds to the reference count of the connection in question. -// This happens regardless of whether the connection already exists -// or it is to be created. -// Any user code that calls vrpn_get_connection_by_name() directly -// should call vrpn_Connection::removeReference() when it is finished -// with the pointer. It's ok if you have old code that doesn't do this; -// it just means the connection will remain open until the program quits, -// which isn't so bad. - -vrpn_Connection *vrpn_get_connection_by_name( - const char *cname, const char *local_in_logfile_name, - const char *local_out_logfile_name, const char *remote_in_logfile_name, - const char *remote_out_logfile_name, const char *NIC_IPaddress, - bool force_connection) -{ - if (cname == NULL) { - fprintf(stderr, "vrpn_get_connection_by_name(): NULL name\n"); - return NULL; - } - - // Find the relevant part of the name (skip past last '@' - // if there is one) - const char *where_at; // Part of name past last '@' - if ((where_at = strrchr(cname, '@')) != NULL) { - cname = where_at + 1; // Chop off the front of the name - } - - vrpn_Connection *c = NULL; - if (!force_connection) { - c = vrpn_ConnectionManager::instance().getByName(cname); - } - - // If its not already open, open it. - // Its constructor will add it to the list (?). - if (!c) { - - // connections now self-register in the known list -- - // this is kind of odd, but oh well (can probably be done - // more cleanly later). - - int is_file = !strncmp(cname, "file:", 5); - - if (is_file) { - c = new vrpn_File_Connection(cname, local_in_logfile_name, - local_out_logfile_name); - } else { - int port = vrpn_get_port_number(cname); - c = new vrpn_Connection_IP( - cname, port, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name, NIC_IPaddress); - } - - if (c) { // creation succeeded - c->setAutoDeleteStatus(true); // destroy when refcount hits zero. - } - else { // creation failed - fprintf(stderr, "Could not create new connection."); - return NULL; - } - } - // else the connection was already open. - - c->addReference(); // increment the reference count either way. - - // Return a pointer to the connection, even if it is not doing - // okay. This will allow a connection to retry over and over - // again before connecting to the server. - return c; -} - -// Create a server connection that will listen for client connections. -// To create a VRPN TCP/UDP server, use a name like: -// x-vrpn:machine_name_or_ip:port -// x-vrpn::port -// machine_name_or_ip:port -// machine_name_or_ip -// :port -// To create a loopback (networkless) server, use the name: -// loopback: -// To create an MPI server, use a name like: -// mpi:MPI_COMM_WORLD -// mpi:comm_number -// -// This routine will strip off any part of the string before and -// including the '@' character, considering this to be the local part -// of a device name, rather than part of the connection name. This allows -// the opening of a connection to "Tracker0@ioglab" for example, which will -// open a connection to ioglab. - -vrpn_Connection * -vrpn_create_server_connection(const char *cname, - const char *local_in_logfile_name, - const char *local_out_logfile_name) -{ - vrpn_Connection *c = NULL; - - // Parse the name to find out what kind of connection we are to make. - if (cname == NULL) { - fprintf(stderr, "vrpn_create_server_connection(): NULL name\n"); - return NULL; - } - char *location = vrpn_copy_service_location(cname); - if (location == NULL) { - return NULL; - } - int is_loopback = !strncmp(cname, "loopback:", 9); - int is_mpi = !strncmp(cname, "mpi:", 4); - if (is_mpi) { -#ifdef VRPN_USE_MPI - XXX_implement_MPI_server_connection; -#else - fprintf(stderr, "vrpn_create_server_connection(): MPI support not " - "compiled in. Set VRPN_USE_MPI in vrpn_Configure.h " - "and recompile.\n"); - delete[] location; - return NULL; -#endif - } else if (is_loopback) { - c = new vrpn_Connection_Loopback(); - } else { - // Not Loopback or MPI port, so we presume that we are a standard VRPN UDP/TCP - // port. Open that kind, based on the machine and port name. If we - // don't - // have a machine name, then we pass NULL to the NIC address. If we do - // have - // one, we pass it to the NIC address. - if (strlen(location) == 0) { - c = new vrpn_Connection_IP(vrpn_DEFAULT_LISTEN_PORT_NO, - local_in_logfile_name, - local_out_logfile_name); - } - else { - // Find machine name and port number. Port number returns default - // if there is not one specified. If the machine name is zero - // length - // (just got :port) then use NULL, which means the default NIC. - char *machine = vrpn_copy_machine_name(location); - if (strlen(machine) == 0) { - delete[] machine; - machine = NULL; - } - unsigned short port = - static_cast<unsigned short>(vrpn_get_port_number(location)); - c = new vrpn_Connection_IP(port, local_in_logfile_name, - local_out_logfile_name, machine); - if (machine) { - delete[] machine; - } - } - } - delete[] location; - - if (!c) { // creation failed - fprintf(stderr, "vrpn_create_server_connection(): Could not create new " - "connection."); - return NULL; - } - - c->setAutoDeleteStatus(true); // destroy when refcount hits zero. - c->addReference(); // increment the reference count for the connection. - - // Return a pointer to the connection, even if it is not doing - // okay. This will allow a connection to retry over and over - // again before connecting to the server. - return c; -} - -/** Create a new endpoint for this connection and connect to using a - TCP connection directly to the specified machine and port. This - bypasses the UDP send, and is used as part of the vrpn "RSH" startup, - where the server is started by the client program and calls it back - at a specified port. - - Returns 0 on success and -1 on failure. -*/ - -int vrpn_Connection_IP::connect_to_client(const char *machine, int port) -{ - if (connectionStatus != LISTEN) { - return -1; - }; - - int which_end = d_numEndpoints; - - // Make sure that we have room for a new connection - if (which_end >= vrpn_MAX_ENDPOINTS) { - fprintf(stderr, "vrpn_Connection_IP::connect_to_client:" - " Too many existing connections.\n"); - return -1; - } - - d_endpoints[which_end] = - (*d_endpointAllocator)(this, &d_numConnectedEndpoints); - d_endpoints[which_end]->setConnection(this); - d_updateEndpoint = vrpn_TRUE; - vrpn_Endpoint_IP *endpoint = d_endpoints[which_end]; - - if (!endpoint) { - fprintf(stderr, "vrpn_Connection_IP::connect_to_client:" - " Out of memory on new endpoint\n"); - return -1; - } - - char msg[100]; - sprintf(msg, "%s %d", machine, port); - printf("vrpn_Connection_IP::connect_to_client: " - "Connection request received: %s\n", - msg); - endpoint->connect_tcp_to(msg); - if (endpoint->status != COOKIE_PENDING) { // Something broke - endpoint->status = BROKEN; - return -1; - } - else { - d_numEndpoints++; - handle_connection(which_end); - } - - return 0; -} - -void vrpn_Connection_IP::handle_connection(int endpointIndex) -{ - - vrpn_Endpoint *endpoint = d_endpoints[endpointIndex]; - - // Set up the things that need to happen when a new connection is - // started. - if (endpoint->setup_new_connection()) { - fprintf(stderr, "vrpn_Connection_IP::handle_connection(): " - "Can't set up new connection!\n"); - drop_connection(endpointIndex); - return; - } -} - -// Get the UDP port description from the other side and connect the -// outgoing UDP socket to that port so we can send lossy but time- -// critical (tracker) messages that way. - -// static -int vrpn_Connection_IP::handle_UDP_message(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Endpoint_IP *endpoint = (vrpn_Endpoint_IP *)userdata; - char rhostname[1000]; // name of remote host - -#ifdef VERBOSE - printf(" Received request for UDP channel to %s\n", p.buffer); -#endif - - // Get the name of the remote host from the buffer (ensure terminated) - strncpy(rhostname, p.buffer, sizeof(rhostname)); - rhostname[sizeof(rhostname) - 1] = '\0'; - - // Open the UDP outbound port and connect it to the port on the - // remote machine. - // (remember that the sender field holds the UDP port number) - endpoint->connect_udp_to(rhostname, (int)p.sender); - if (endpoint->status == BROKEN) { - return -1; - } - - // Put this here because currently every connection opens a UDP - // port and every host will get this data. Previous implementation - // did it in connect_tcp_to, which only gets called by servers. - - strncpy(endpoint->rhostname, rhostname, sizeof(endpoint->rhostname)); - -#ifdef VERBOSE - printf(" Opened UDP channel to %s:%d\n", rhostname, p.sender); -#endif - return 0; -} - -int vrpn_Connection_IP::send_pending_reports(void) -{ - int i; - - for (i = 0; i < d_numEndpoints; i++) { - if (d_endpoints[i] && (d_endpoints[i]->send_pending_reports() != 0)) { - fprintf(stderr, "vrpn_Connection_IP::send_pending_reports: " - "Closing failed endpoint.\n"); - drop_connection(i); - } - } - - compact_endpoints(); - - return 0; -} - -void vrpn_Connection_IP::init(void) -{ - -#ifdef VRPN_USE_WINSOCK_SOCKETS - // Make sure sockets are set up - // TCH 2 Nov 98 after Phil Winston - - WSADATA wsaData; - int winStatus; - - winStatus = WSAStartup(MAKEWORD(1, 1), &wsaData); - if (winStatus) { - fprintf(stderr, "vrpn_Connection_IP::init(): " - "Failed to set up sockets.\n"); - fprintf(stderr, "WSAStartup failed with error code %d\n", winStatus); - exit(0); - } -#endif // windows sockets - -// Ignore SIGPIPE, so that the program does not crash when a -// remote client OR SERVER shuts down its TCP connection. We'll find out -// about it as an exception on the socket when we select() for -// read. -// Mips/Ultrix header file signal.h appears to be broken and -// require the following cast -#ifndef _WIN32 // XXX what about cygwin? -#ifdef ultrix - signal(SIGPIPE, (void (*)(int))SIG_IGN); -#else - signal(SIGPIPE, SIG_IGN); -#endif -#endif - - // Set up to handle the UDP-request system message. - d_dispatcher->setSystemHandler(vrpn_CONNECTION_UDP_DESCRIPTION, - handle_UDP_message); -} - -//--------------------------------------------------------------------------- -// This routine checks for a request for attention from a remote machine. -// The requests come as datagrams to the well-known port number on this -// machine. -// The datagram includes the machine name and port number on the remote -// machine to which this one should establish a connection. -// This routine establishes the TCP connection and then sends a magic -// cookie describing this as a VRPN connection and telling which port to -// use for incoming UDP packets of data associated with the current TCP -// session. It reads the associated information from the other side and -// sets up the local UDP sender. -// It then sends descriptions for all of the known packet types. - -void vrpn_Connection_IP::server_check_for_incoming_connections( - const struct timeval *pTimeout) -{ - vrpn_Endpoint_IP *endpoint; // shorthand for d_endpoints[which_end] - int request; - timeval timeout; - int which_end = d_numEndpoints; - int retval; - int port; - - if (pTimeout) { - timeout = *pTimeout; - } - else { - timeout.tv_sec = 0; - timeout.tv_usec = 0; - } - - // Do a select() with timeout (perhaps zero timeout) to see if - // there is an incoming packet on the UDP socket. - - fd_set f; - FD_ZERO(&f); - FD_SET(listen_udp_sock, &f); - request = vrpn_noint_select(static_cast<int>(listen_udp_sock) + 1, &f, NULL, - NULL, &timeout); - if (request == -1) { // Error in the select() - fprintf(stderr, - "vrpn_Connection_IP::server_check_for_incoming_connections(): " - "select failed.\n"); - connectionStatus = BROKEN; - // fprintf(stderr, "BROKEN - - // vrpn_Connection::server_check_for_incoming_connections.\n"); - return; - } - else if (request != 0) { // Some data to read! Go get it. - struct sockaddr_in from; - int fromlen = sizeof(from); - - char msg[200]; // Message received on the request channel - if (recvfrom(listen_udp_sock, msg, sizeof(msg) - 1, 0, - (struct sockaddr *)&from, GSN_CAST & fromlen) == -1) { - fprintf(stderr, - "vrpn: Error on recvfrom: Bad connection attempt\n"); - return; - } - else { - // Force null termination - msg[sizeof(msg) - 1] = '\0'; - } - - // Because we sometimes use multiple NICs, we are ignoring the IP from - // the - // client, and filling in the NIC that the udp request arrived on. - char fromname[1024]; - unsigned long addr_num = ntohl(from.sin_addr.s_addr); - sprintf(fromname, "%lu.%lu.%lu.%lu", (addr_num) >> 24, - (addr_num >> 16) & 0xff, (addr_num >> 8) & 0xff, - addr_num & 0xff); - printf("vrpn: Connection request received from %s: %s\n", fromname, - msg); - - // Make sure that the request is well-formed. That is, it - // has an ASCII string name of a host followed by an integer - // that is larger than 1024 (ports < 1024 are reserved for - // use by the root process). If it is not well-formed, then - // don't go off trying to connect to it because this slows - // things down. This was happening to one user who had a - // network device that was lobbing mal-formed UDP packets at - // the incoming port on his machine. - char *checkHost = new char[strlen(msg) + 1]; - int checkPort; - if (checkHost == NULL) { - fprintf(stderr, - "server_check_for_incoming_connections(): Out of memory\n"); - return; - } - if (sscanf(msg, "%s %d", checkHost, &checkPort) != 2) { - fprintf( - stderr, - "server_check_for_incoming_connections(): Malformed request\n"); - delete[] checkHost; - return; - } - if (checkPort < 1024) { - fprintf(stderr, - "server_check_for_incoming_connections(): Bad port\n"); - delete[] checkHost; - return; - } - // Check all of the characters in the hostname to make sure they are - // either a letter, a digit, or a dot (.). - size_t checkLoop; - for (checkLoop = 0; checkLoop < strlen(checkHost); checkLoop++) { - char checkChar = checkHost[checkLoop]; - if (!isalnum(checkChar) && (checkChar != '.')) { - fprintf( - stderr, - "server_check_for_incoming_connections(): Bad hostname\n"); - delete[] checkHost; - return; - } - } - delete[] checkHost; - - // Make sure that we have room for a new connection - if (which_end >= vrpn_MAX_ENDPOINTS) { - fprintf(stderr, "vrpn: Too many existing connections; " - "ignoring request from %s\n", - msg); - return; - } - - // Create a new endpoint and start trying to connect it to - // the client. - d_endpoints[which_end] = - (*d_endpointAllocator)(this, &d_numConnectedEndpoints); - d_endpoints[which_end]->setConnection(this); - d_updateEndpoint = vrpn_TRUE; - endpoint = d_endpoints[which_end]; - if (!endpoint) { - fprintf( - stderr, - "vrpn_Connection_IP::server_check_for_incoming_connections:\n" - " Out of memory on new endpoint\n"); - return; - } - - // Server-side logging under multiconnection - TCH July 2000 - // Check for NULL server log name, which happens when the log file - // already exists and it can't save it. - if ((d_serverLogMode & vrpn_LOG_INCOMING) && - (d_serverLogName != NULL)) { - d_serverLogCount++; - endpoint->d_inLog->setCompoundName(d_serverLogName, - d_serverLogCount); - endpoint->d_inLog->logMode() = vrpn_LOG_INCOMING; - retval = endpoint->d_inLog->open(); - if (retval == -1) { - fprintf(stderr, "vrpn_Connection_IP::server_check_for_incoming_" - "connections: " - "Couldn't open log file.\n"); - connectionStatus = BROKEN; - return; - } - } - - endpoint->setNICaddress(d_NIC_IP); - endpoint->status = TRYING_TO_CONNECT; - - // d_numEndpoints must be incremented before handle_connection is called - // otherwise the functions doing_okay and connected do not check all - // the endpoints. Because of this topo was unable to send the header - // information and nano crashed... - d_numEndpoints++; - - // Because we sometimes use multiple NICs, we are ignoring the IP from - // the - // client, and filling in the NIC that the udp request arrived on. - sscanf(msg, "%*s %d", &port); // get the port - // Fill in NIC address. Copy the machine name so that we can delete it - // in the destructor. - endpoint->d_remote_machine_name = vrpn_copy_service_location(fromname); - endpoint->connect_tcp_to(msg); - handle_connection(which_end); - - // HACK - // We don't want to do this, but connection requests are soft state - // that will be restored in 1 second; meanwhile, if we accept multiple - // connection requests from the same source we try to open multiple - // connections to it, which invariably makes SOMEBODY crash sooner or - // later. - flush_udp_socket(listen_udp_sock); - } - - // Do a zero-time select() to see if there are incoming TCP requests on - // the listen socket. This is used when the client needs to punch through - // a firewall. - - SOCKET newSocket; - retval = vrpn_poll_for_accept(listen_tcp_sock, &newSocket); - - if (retval == -1) { - fprintf(stderr, "Error accepting on TCP socket.\n"); - return; - } - else if (retval) { // Some data to read! Go get it. - - printf("vrpn: TCP connection request received.\n"); - - if (which_end >= vrpn_MAX_ENDPOINTS) { - fprintf(stderr, "vrpn: Too many existing connections; " - "ignoring request.\n"); - return; - } - - d_endpoints[which_end] = - (*d_endpointAllocator)(this, &d_numConnectedEndpoints); - d_endpoints[which_end]->setConnection(this); - d_updateEndpoint = vrpn_TRUE; - endpoint = d_endpoints[which_end]; - if (!endpoint) { - fprintf( - stderr, - "vrpn_Connection_IP::server_check_for_incoming_connections:\n" - " Out of memory on new endpoint\n"); - return; - } - - // Since we're being connected to using a TCP request, tell the endpoint - // not to try and establish any other connections (since the client is - // presumably coming through a firewall or NAT and UDP packets won't get - // through). - endpoint->d_tcp_only = vrpn_TRUE; - - // Find out the remote port number and store it. - struct sockaddr_in peer; -#ifdef VRPN_USE_WINSOCK_SOCKETS - int peerlen = sizeof(peer); -#else -#if defined(sgi) - int peerlen = sizeof(peer); -#else - socklen_t peerlen = sizeof(peer); -#endif -#endif - unsigned short peer_port = 0; - if (getpeername(newSocket, static_cast<struct sockaddr *>( - static_cast<void *>(&peer)), - &peerlen) == 0) { - peer_port = ntohs(peer.sin_port); - } - endpoint->d_remote_port_number = peer_port; - - // Server-side logging under multiconnection - TCH July 2000 - if (d_serverLogMode & vrpn_LOG_INCOMING) { - d_serverLogCount++; - endpoint->d_inLog->setCompoundName(d_serverLogName, - d_serverLogCount); - endpoint->d_inLog->logMode() = vrpn_LOG_INCOMING; - retval = endpoint->d_inLog->open(); - if (retval == -1) { - fprintf(stderr, "vrpn_Connection_IP::server_check_for_incoming_" - "connections: " - "Couldn't open incoming log file.\n"); - connectionStatus = BROKEN; - return; - } - } - - endpoint->setNICaddress(d_NIC_IP); - endpoint->d_tcpSocket = newSocket; - - d_numEndpoints++; - - handle_connection(which_end); - } - - return; -} - -void vrpn_Connection_IP::drop_connection(int whichEndpoint) -{ - vrpn_Endpoint *endpoint = d_endpoints[whichEndpoint]; - - endpoint->drop_connection(); - - // If we're a client, try to reconnect to the server - // that just dropped its connection. - // If we're a server, delete the endpoint. - if (listen_udp_sock == INVALID_SOCKET) { - endpoint->status = TRYING_TO_CONNECT; - } - else { - delete_endpoint(whichEndpoint); - } -} - -int vrpn_Connection_IP::mainloop(const struct timeval *pTimeout) -{ - vrpn_Endpoint *endpoint; - timeval timeout; - int endpointIndex; - - if (d_updateEndpoint) { - updateEndpoints(); - d_updateEndpoint = vrpn_FALSE; - } - // struct timeval perSocketTimeout; - // const int numSockets = 2; - // divide timeout over all selects() - // if (timeout) { - // perSocketTimeout.tv_sec = timeout->tv_sec / numSockets; - // perSocketTimeout.tv_usec = timeout->tv_usec / numSockets - // + (timeout->tv_sec % numSockets) * - // (1000000L / numSockets); - // } else { - // perSocketTimeout.tv_sec = 0; - // perSocketTimeout.tv_usec = 0; - // } - - // BETTER IDEA: do one select rather than multiple -- otherwise you are - // potentially holding up one or the other. This allows clients which - // should not do anything until they get messages to request infinite - // waits (servers can't usually do infinite waits this because they need - // to service other devices to generate info which they then send to - // clients) . weberh 3/20/99 - - if (connectionStatus == LISTEN) { - server_check_for_incoming_connections(pTimeout); - } - - for (endpointIndex = 0; endpointIndex < d_numEndpoints; endpointIndex++) { - endpoint = d_endpoints[endpointIndex]; - - // The current array-sorting code is liable to break when unexpected - // things happen, so we have to double-check it here. - if (!endpoint) { - continue; - } - - if (pTimeout) { - timeout = *pTimeout; - } - else { - timeout.tv_sec = 0; - timeout.tv_usec = 0; - } - - endpoint->mainloop(&timeout); - - if (endpoint->status == BROKEN) { - drop_connection(endpointIndex); - } - } - - // Do housekeeping on the endpoint array - compact_endpoints(); - - return 0; -} - -vrpn_Connection_IP::vrpn_Connection_IP( - unsigned short listen_port_no, const char *local_in_logfile_name, - const char *local_out_logfile_name, const char *NIC_IPaddress, - vrpn_Endpoint_IP *(*epa)(vrpn_Connection *, vrpn_int32 *)) - : vrpn_Connection(local_in_logfile_name, local_out_logfile_name, epa) - , listen_udp_sock(INVALID_SOCKET) - , listen_tcp_sock(INVALID_SOCKET) - , d_NIC_IP(NULL) -{ - // Copy the NIC_IPaddress so that we do not have to rely on the caller - // to keep it from changing. - if (NIC_IPaddress != NULL) { - char *IP = new char[strlen(NIC_IPaddress) + 1]; - if (IP == NULL) { - fprintf( - stderr, - "vrpn_Connection_IP::vrpn_Connection_IP(): Out of memory\n"); - } - else { - strcpy(IP, NIC_IPaddress); - d_NIC_IP = IP; - } - } - - // Initialize the things that must be for any constructor - vrpn_Connection_IP::init(); - - listen_udp_sock = ::open_udp_socket(&listen_port_no, NIC_IPaddress); - // TCH OHS HACK - listen_tcp_sock = ::open_tcp_socket(&listen_port_no, NIC_IPaddress); - if ((listen_udp_sock == INVALID_SOCKET) || - (listen_tcp_sock == INVALID_SOCKET)) { - connectionStatus = BROKEN; - return; - // fprintf(stderr, "BROKEN - - // vrpn_Connection_IP::vrpn_Connection_I{.\n"); - } - else { - connectionStatus = LISTEN; -// fprintf(stderr, "LISTEN - vrpn_Connection_IP::vrpn_Connection_IP.\n"); -#ifdef VERBOSE - printf("vrpn: Listening for requests on port %d\n", listen_port_no); -#endif - } - - // TCH OHS HACK - if (listen(listen_tcp_sock, 1)) { - fprintf(stderr, "Couldn't listen on TCP listening socket.\n"); - connectionStatus = BROKEN; - return; - } - - flush_udp_socket(listen_udp_sock); - - vrpn_ConnectionManager::instance().addConnection(this, NULL); -} - -vrpn_Connection_IP::vrpn_Connection_IP( - const char *station_name, int port, const char *local_in_logfile_name, - const char *local_out_logfile_name, const char *remote_in_logfile_name, - const char *remote_out_logfile_name, const char *NIC_IPaddress, - vrpn_Endpoint_IP *(*epa)(vrpn_Connection *, vrpn_int32 *)) - : vrpn_Connection(local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name, epa) - , listen_udp_sock(INVALID_SOCKET) - , listen_tcp_sock(INVALID_SOCKET) - , d_NIC_IP(NULL) -{ - vrpn_Endpoint_IP *endpoint; - vrpn_bool isrsh; - vrpn_bool istcp; - int retval; - - // Copy the NIC_IPaddress so that we do not have to rely on the caller - // to keep it from changing. - if (NIC_IPaddress != NULL) { - char *IP = new char[strlen(NIC_IPaddress) + 1]; - if (IP == NULL) { - fprintf( - stderr, - "vrpn_Connection_IP::vrpn_Connection_IP(): Out of memory\n"); - } - else { - strcpy(IP, NIC_IPaddress); - d_NIC_IP = IP; - } - } - - isrsh = (strstr(station_name, "x-vrsh:") ? VRPN_TRUE : VRPN_FALSE); - istcp = (strstr(station_name, "tcp:") ? VRPN_TRUE : VRPN_FALSE); - - // Initialize the things that must be for any constructor - vrpn_Connection_IP::init(); - - endpoint = d_endpoints[0]; // shorthand - endpoint->setNICaddress(d_NIC_IP); - - // If we are not a TCP-only or remote-server-starting - // type of connection, then set up to lob UDP packets - // to the other side and put us in the mode that will - // wait for the responses. Go ahead and set up the TCP - // socket that we will listen on and lob a packet. - - if (!isrsh && !istcp) { - // Open a connection to the station using a UDP request - // that asks to machine to call us back here. - endpoint->d_remote_machine_name = vrpn_copy_machine_name(station_name); - if (!endpoint->d_remote_machine_name) { - fprintf(stderr, - "vrpn_Connection_IP: Can't get remote machine name!\n"); - connectionStatus = BROKEN; - // fprintf(stderr, "BROKEN - - // vrpn_Connection_IP::vrpn_Connection_IP.\n"); - return; - } - if (port < 0) { - endpoint->d_remote_port_number = vrpn_DEFAULT_LISTEN_PORT_NO; - } - else { - endpoint->d_remote_port_number = port; - } - - endpoint->status = TRYING_TO_CONNECT; - - /* Create a UDP socket and connect it to the port on the remote - * machine. */ - - endpoint->d_udpLobSocket = vrpn_connect_udp_port(endpoint->d_remote_machine_name, - endpoint->d_remote_port_number, d_NIC_IP); - if (endpoint->d_udpLobSocket == INVALID_SOCKET) { - fprintf(stderr, - "vrpn_Connection_IP: Can't Set up socket to lob UDP packets!\n"); - connectionStatus = BROKEN; - // fprintf(stderr, "BROKEN - - // vrpn_Connection_IP::vrpn_Connection_IP.\n"); - return; - } - -#ifdef VERBOSE - printf("vrpn_Connection_IP: Getting the TCP port to listen on\n"); -#endif - // Determine which IP address we should listen on. - // By listening on only localhost (as opposed to all interfaces, - // i.e., 0.0.0.0), we can avoid complaints from the Windows firewall. - char local_host[64]; - get_local_socket_name(local_host, sizeof(local_host), endpoint->d_remote_machine_name); - - // Set up the connection that we will listen on. - if (vrpn_get_a_TCP_socket(&endpoint->d_tcpListenSocket, - &endpoint->d_tcpListenPort, - local_host) == -1) { - fprintf(stderr, "vrpn_Connection_IP: Can't create listen socket\n"); - endpoint->status = BROKEN; - endpoint->d_tcpListenSocket = INVALID_SOCKET; - // fprintf(stderr, "BROKEN - - // vrpn_Connection_IP::vrpn_Connection_IP.\n"); - return; - } - - // Lob a packet asking for a connection on that port. - vrpn_gettimeofday(&endpoint->d_last_connect_attempt, NULL); - if (vrpn_udp_request_lob_packet(endpoint->d_udpLobSocket, - endpoint->d_remote_machine_name, endpoint->d_remote_port_number, - endpoint->d_tcpListenPort, NIC_IPaddress) == -1) { - fprintf(stderr, "vrpn_Connection_IP: Can't lob UDP request\n"); - endpoint->status = BROKEN; - // fprintf(stderr, "BROKEN - - // vrpn_Connection_IP::vrpn_Connection_IP.\n"); - return; - } - - // the next line is something jeff added to get vrpn to work on his - // PC. Tom Hudson independently added a line that is similar, but - // different. I'm (jeff) am not sure what the right thing is here. - // - // Let's do both, because otherwise connectionStatus is - // never initialized, and doing_ok() returns FALSE sometimes. - connectionStatus = TRYING_TO_CONNECT; - - // here is the line that Tom added - endpoint->status = TRYING_TO_CONNECT; - - // See if we have a connection yet (wait for 1 sec at most). - // This will allow the connection to come up fast if things are - // all set. Otherwise, we'll drop into re-sends when we get - // to mainloop(). - retval = vrpn_poll_for_accept(endpoint->d_tcpListenSocket, - &endpoint->d_tcpSocket, 1.0); - if (retval == -1) { - fprintf(stderr, "vrpn_Connection_IP: Can't poll for accept\n"); - connectionStatus = BROKEN; - // fprintf(stderr, "BROKEN - - // vrpn_Connection_IP::vrpn_Connection_IP.\n"); - return; - } - if (retval == 1) { // Got one! - endpoint->status = COOKIE_PENDING; -// fprintf(stderr, "COOKIE_PENDING - -// vrpn_Connection_IP::vrpn_Connection_IP.\n"); -#ifdef VERBOSE - printf("vrpn: Connection established on initial try\n"); -#endif - // Set up the things that need to happen when a new connection - // is established. - if (endpoint->setup_new_connection()) { - fprintf(stderr, "vrpn_Connection_IP: " - "Can't set up new connection!\n"); - drop_connection(0); - // status = BROKEN; - // fprintf(stderr, "BROKEN - - // vrpn_Connection_IP::vrpn_Connection_IP.\n"); - return; - } - } - } - - // TCH OHS HACK - if (istcp) { - endpoint->d_remote_machine_name = vrpn_copy_machine_name(station_name); - if (!endpoint->d_remote_machine_name) { - fprintf(stderr, "vrpn_Connection_IP: Can't get remote machine name " - "for tcp: connection!\n"); - connectionStatus = BROKEN; - return; - } - endpoint->d_remote_port_number = port; - - // Since we are doing a TCP connection, tell the endpoint not to try and - // use any other communication mechanism to get to the server. - endpoint->d_tcp_only = vrpn_TRUE; - - endpoint->status = TRYING_TO_CONNECT; - -#ifdef VERBOSE - printf("vrpn_Connection_IP: Getting the TCP port to connect with.\n"); -#endif - - // Set up the connection that we will connect with. - // Blocks, doesn't it? - retval = - endpoint->connect_tcp_to(endpoint->d_remote_machine_name, port); - - if (retval == -1) { - fprintf(stderr, - "vrpn_Connection_IP: Can't create TCP connection.\n"); - endpoint->status = BROKEN; - return; - } - - connectionStatus = TRYING_TO_CONNECT; - endpoint->status = TRYING_TO_CONNECT; - - if (endpoint->setup_new_connection()) { - fprintf(stderr, "vrpn_Connection_IP: " - "Can't set up new connection!\n"); - drop_connection(0); - return; - } - } - - // If we are a remote-server-starting type of connection, - // Try to start the remote server and connect to it. If - // we fail, then the connection is broken. Otherwise, we - // are connected. - - if (isrsh) { - // Start up the server and wait for it to connect back - char *machinename; - char *server_program; - char *server_args; // server program plus its arguments - char *token; - - machinename = vrpn_copy_machine_name(station_name); - server_program = vrpn_copy_rsh_program(station_name); - server_args = vrpn_copy_rsh_arguments(station_name); - token = server_args; - // replace all argument separators (',') with spaces (' ') - while ((token = strchr(token, ',')) != NULL) { - *token = ' '; - } - - endpoint->d_tcpSocket = vrpn_start_server(machinename, server_program, - server_args, NIC_IPaddress); - if (machinename) delete[](char *)machinename; - if (server_program) delete[](char *)server_program; - if (server_args) delete[](char *)server_args; - - if (endpoint->d_tcpSocket < 0) { - fprintf(stderr, "vrpn_Connection_IP: " - "Can't open %s\n", - station_name); - endpoint->status = BROKEN; - // fprintf(stderr, "BROKEN - - // vrpn_Connection_IP::vrpn_Connection_IP.\n"); - return; - } - else { - endpoint->status = COOKIE_PENDING; - // fprintf(stderr, "COOKIE_PENDING - - // vrpn_Connection_IP::vrpn_Connection_IP.\n"); - - if (endpoint->setup_new_connection()) { - fprintf(stderr, "vrpn_Connection_IP: " - "Can't set up new connection!\n"); - drop_connection(0); - connectionStatus = BROKEN; - // fprintf(stderr, "BROKEN - - // vrpn_Connection_IP::vrpn_Connection_IP.\n"); - return; - } - } - } - - vrpn_ConnectionManager::instance().addConnection(this, station_name); -} - -vrpn_Connection_IP::~vrpn_Connection_IP(void) -{ - - vrpn_int32 i; - - // Remove myself from the "known connections" list - // (or the "anonymous connections" list). - vrpn_ConnectionManager::instance().deleteConnection(this); - - // Send any pending messages - send_pending_reports(); - - // Close the UDP and TCP listen endpoints if we're a server - if (listen_udp_sock != INVALID_SOCKET) { - vrpn_closeSocket(listen_udp_sock); - } - if (listen_tcp_sock != INVALID_SOCKET) { - vrpn_closeSocket(listen_tcp_sock); - } - - if (d_NIC_IP) { - delete[] d_NIC_IP; - d_NIC_IP = NULL; - } - - for (i = 0; i < d_numEndpoints; i++) { - if (d_endpoints[i]) { - d_endpoints[i]->drop_connection(); - delete d_endpoints[i]; - } - } - -#ifdef VRPN_USE_WINSOCK_SOCKETS - - if (WSACleanup() == SOCKET_ERROR) { - fprintf(stderr, "~vrpn_Connection_IP(): " - "WSACleanup() failed with error code %d\n", - WSAGetLastError()); - } - -#endif // VRPN_USE_WINSOCK_SOCKETS -} - -// Set up to be a server connection, which is the only kind we can be. -vrpn_Connection_Loopback::vrpn_Connection_Loopback() - : vrpn_Connection(NULL, NULL, NULL, NULL) -{ - // We're always "connected." - connectionStatus = CONNECTED; - - // Add this to the list of known connections. - vrpn_ConnectionManager::instance().addConnection(this, "Loopback"); -} - -vrpn_Connection_Loopback::~vrpn_Connection_Loopback(void) -{ - // Remove myself from the "known connections" list - // (or the "anonymous connections" list). - vrpn_ConnectionManager::instance().deleteConnection(this); -} - -int vrpn_Connection_Loopback::mainloop(const timeval * /*timeout*/) -{ - return 0; -} - -// utility routines to parse names (<service>@<URL>) -char *vrpn_copy_service_name(const char *fullname) -{ - if (fullname == NULL) { - return NULL; - } - else { - size_t len = 1 + strcspn(fullname, "@"); - char *tbuf = new char[len]; - if (!tbuf) - fprintf(stderr, "vrpn_copy_service_name: Out of memory!\n"); - else { - strncpy(tbuf, fullname, len - 1); - tbuf[len - 1] = 0; - } - return tbuf; - } -} - -char *vrpn_copy_service_location(const char *fullname) -{ - // If there is no "@" sign in the string, copy the whole string. - int offset = static_cast<int>(strcspn(fullname, "@")); - size_t len = strlen(fullname) - offset; - if (len == 0) { - offset = -1; // We add one to it below. - len = strlen(fullname) + 1; // We subtract one from it below. - } - char *tbuf = new char[len]; - if (!tbuf) - fprintf(stderr, "vrpn_copy_service_name: Out of memory!\n"); - else { - strncpy(tbuf, fullname + offset + 1, len - 1); - tbuf[len - 1] = 0; - } - return tbuf; -} - -char *vrpn_copy_file_name(const char *filespecifier) -{ - char *filename; - const char *fp; - size_t len; - - fp = filespecifier; - if (!fp) return NULL; - - if (!strncmp(fp, "file://", 7)) { - fp += 7; - } - else if (!strncmp(fp, "file:", 5)) { - fp += 5; - } - - len = 1 + strlen(fp); - filename = new char[len]; - if (!filename) - fprintf(stderr, "vrpn_copy_file_name: Out of memory!\n"); - else { - strncpy(filename, fp, len - 1); - filename[len - 1] = 0; - } - return filename; -} - -// Returns the length in characters of the header on the name that is -// passed to it. Helper routine for those that follow. - -static int header_len(const char *hostspecifier) -{ - // If the name begins with "x-vrpn://" or "x-vrsh://" or "tcp://" skip that - // (also handle the case where there is no // after the colon). - if (!strncmp(hostspecifier, "x-vrpn://", 9) || - !strncmp(hostspecifier, "x-vrsh://", 9)) { - return 9; - } - else if (!strncmp(hostspecifier, "x-vrpn:", 7) || - !strncmp(hostspecifier, "x-vrsh:", 7)) { - return 7; - } - else if (!strncmp(hostspecifier, "tcp://", 6)) { - return 6; - } - else if (!strncmp(hostspecifier, "tcp:", 4)) { - return 4; - } - else if (!strncmp(hostspecifier, "mpi://", 6)) { - return 6; - } - else if (!strncmp(hostspecifier, "mpi:", 4)) { - return 4; - } - - // No header found. - return 0; -} - -// The caller is responsible for calling delete [] on the -// returned pointer if it is not null. - -char *vrpn_copy_machine_name(const char *hostspecifier) -{ - size_t nearoffset = 0; - size_t faroffset; - // if it contains a ':', copy only the prefix before the last ':' - // otherwise copy all of it - size_t len; - char *tbuf; - - // Skip past the header, if any; this includes any tcp:// or tcp: - // at the beginning of the string. - nearoffset = header_len(hostspecifier); - - // stop at first occurrence of :<port #> or /<rsh arguments>. - // Note that this may be the beginning of the string, right at - // nearoffset. - faroffset = strcspn(hostspecifier + nearoffset, ":/"); - len = 1 + faroffset; - - tbuf = new char[len]; - if (!tbuf) { - fprintf(stderr, "vrpn_copy_machine_name: Out of memory!\n"); - } - else { - strncpy(tbuf, hostspecifier + nearoffset, len - 1); - tbuf[len - 1] = 0; - } - return tbuf; -} - -int vrpn_get_port_number(const char *hostspecifier) -{ - const char *pn; - int port = vrpn_DEFAULT_LISTEN_PORT_NO; - - pn = hostspecifier; - if (!pn) return -1; - - // Skip over the header, if present - pn += header_len(hostspecifier); - - pn = strrchr(pn, ':'); - if (pn) { - pn++; - port = atoi(pn); - } - - return port; -} - -char *vrpn_copy_rsh_program(const char *hostspecifier) -{ - size_t nearoffset = 0; // location of first char after machine name - size_t faroffset; // location of last character of program name - size_t len; - char *tbuf; - - nearoffset += header_len(hostspecifier); - - nearoffset += strcspn(hostspecifier + nearoffset, "/"); - nearoffset++; // step past the '/' - faroffset = strcspn(hostspecifier + nearoffset, ","); - len = 1 + (faroffset ? faroffset : strlen(hostspecifier) - nearoffset); - tbuf = new char[len]; - - if (!tbuf) - fprintf(stderr, "vrpn_copy_rsh_program: Out of memory!\n"); - else { - strncpy(tbuf, hostspecifier + nearoffset, len - 1); - tbuf[len - 1] = 0; - // fprintf(stderr, "server program: '%s'.\n", tbuf); - } - return tbuf; -} - -char *vrpn_copy_rsh_arguments(const char *hostspecifier) -{ - size_t nearoffset = 0; // location of first char after server name - size_t faroffset; // location of last character - size_t len; - char *tbuf; - - nearoffset += header_len(hostspecifier); - - nearoffset += strcspn(hostspecifier + nearoffset, "/"); - nearoffset += strcspn(hostspecifier + nearoffset, ","); - faroffset = strlen(hostspecifier); - len = 1 + faroffset - nearoffset; - tbuf = new char[len]; - - if (!tbuf) - fprintf(stderr, "vrpn_copy_rsh_arguments: Out of memory!\n"); - else { - strncpy(tbuf, hostspecifier + nearoffset, len - 1); - tbuf[len - 1] = 0; - // fprintf(stderr, "server args: '%s'.\n", tbuf); - } - return tbuf; -} - -// For a host specifier without a service name, this routine prepends -// the given string newServiceName to it. -// For a host specifier with a service name (e.g. "service@URL"), -// this routine strips off the service name and adds the given -// string newServiceName in its place (e.g. "newServiceName@URL"). -// This routine allocates memory for the return value. Caller is -// responsible for freeing the memory. -char *vrpn_set_service_name(const char *specifier, const char *newServiceName) -{ - size_t inputLength = strlen(specifier); - size_t atSymbolIndex = strcspn(specifier, "@"); - - char *location = NULL; - - if (atSymbolIndex == inputLength) { - // no @ symbol present; just a location. - location = new char[inputLength + 1]; - strcpy(location, specifier); // take the whole thing to be the location - } - else { - // take everything after the @ symbol to be the location - location = vrpn_copy_service_location(specifier); - } - - // prepend newServiceName to location. - size_t len = strlen(location) + strlen(newServiceName); - char *newSpecifier = new char[len + 2]; // extra space for '@' - // and terminal '/0' - strcpy(newSpecifier, newServiceName); - strcat(newSpecifier, "@"); - strcat(newSpecifier, location); - delete[] location; - return newSpecifier; -} - - diff --git a/src/vrpn/vrpn_Connection.h b/src/vrpn/vrpn_Connection.h deleted file mode 100644 index d8a3beefe8ee28cd1edc468b9bfdc0064ef0104d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Connection.h +++ /dev/null @@ -1,1106 +0,0 @@ -#ifndef VRPN_CONNECTION_H -#define VRPN_CONNECTION_H - -#include <stdio.h> // for NULL, sprintf - -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK, etc -#include "vrpn_Shared.h" // for SOCKET, timeval -#include "vrpn_Types.h" // for vrpn_int32, vrpn_uint32, etc - -#if !(defined(_WIN32) && defined(VRPN_USE_WINSOCK_SOCKETS)) -#include <sys/select.h> // for fd_set -#endif - -struct timeval; - -// Don't complain about using sprintf() when using Visual Studio. -#ifdef _MSC_VER -#pragma warning(disable : 4995 4996) -#endif - -#if defined(__ANDROID__) -#include <bitset> -#endif - -/// This is the list of states that a connection can be in -/// (possible values for status). doing_okay() returns VRPN_TRUE -/// for connections > BROKEN. -enum vrpn_ConnectionStatus { - LISTEN = (1), - CONNECTED = (0), - COOKIE_PENDING = (-1), - TRYING_TO_CONNECT = (-2), - BROKEN = (-3), - LOGGING = (-4) -}; - -class VRPN_API - vrpn_File_Connection; // Forward declaration for get_File_Connection() - -/// @brief This structure is what is passed to a vrpn_Connection message -/// callback. -/// -/// It is used by objects, but not normally by user code. -struct vrpn_HANDLERPARAM { - vrpn_int32 type; - vrpn_int32 sender; - struct timeval msg_time; - vrpn_int32 payload_len; - const char *buffer; -}; - -/// @brief Type of a message handler for vrpn_Connection messages. -typedef int(VRPN_CALLBACK *vrpn_MESSAGEHANDLER)(void *userdata, - vrpn_HANDLERPARAM p); - -/// @brief Type of handler for filters on logfiles is the same as connection -/// handler -typedef vrpn_MESSAGEHANDLER vrpn_LOGFILTER; - -/// VRPN buffers are aligned on 8 byte boundaries so that we can pack and -/// unpack doubles into them on architectures that cannot handle unaligned -/// access. -const unsigned vrpn_ALIGN = 8; - -/// Types now have their storage dynamically allocated, so we can afford -/// to have large tables. We need at least 150-200 for the microscope -/// project as of Jan 98, and will eventually need two to three times that -/// number. -/// @{ -const int vrpn_CONNECTION_MAX_SENDERS = 2000; -const int vrpn_CONNECTION_MAX_TYPES = 2000; -/// @} - -/// @brief vrpn_ANY_SENDER can be used to register callbacks on a given message -/// type from any sender. - -const int vrpn_ANY_SENDER = -1; - -/// @brief vrpn_ANY_TYPE can be used to register callbacks for any USER type of -/// message from a given sender. System messages are handled separately. - -const int vrpn_ANY_TYPE = -1; - -/// @name Buffer lengths for TCP and UDP. -/// -/// TCP is an arbitrary number that can be changed by the user -/// using vrpn_Connection::set_tcp_outbuf_size(). -/// UDP is set based on Ethernet maximum transmission size; trying -/// to send a message via UDP which is longer than the MTU of any -/// intervening physical network may cause untraceable failures, -/// so for now we do not expose any way to change the UDP output -/// buffer size. (MTU = 1500 bytes, - 28 bytes of IP+UDP header) -/// @{ - -const int vrpn_CONNECTION_TCP_BUFLEN = 64000; -const int vrpn_CONNECTION_UDP_BUFLEN = 1472; -/// @} - -/// @brief Number of endpoints that a server connection can have. Arbitrary -/// limit. - -const int vrpn_MAX_ENDPOINTS = 256; - -/// @name System message types -/// @{ -const vrpn_int32 vrpn_CONNECTION_SENDER_DESCRIPTION = (-1); -const vrpn_int32 vrpn_CONNECTION_TYPE_DESCRIPTION = (-2); -const vrpn_int32 vrpn_CONNECTION_UDP_DESCRIPTION = (-3); -const vrpn_int32 vrpn_CONNECTION_LOG_DESCRIPTION = (-4); -const vrpn_int32 vrpn_CONNECTION_DISCONNECT_MESSAGE = (-5); -/// @} - -/// Classes of service for messages, specify multiple by ORing them together -/// Priority of satisfying these should go from the top down (RELIABLE will -/// override all others). -/// Most of these flags may be ignored, but RELIABLE is guaranteed -/// to be available. -/// @{ - -const vrpn_uint32 vrpn_CONNECTION_RELIABLE = (1 << 0); -const vrpn_uint32 vrpn_CONNECTION_FIXED_LATENCY = (1 << 1); -const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY = (1 << 2); -const vrpn_uint32 vrpn_CONNECTION_FIXED_THROUGHPUT = (1 << 3); -const vrpn_uint32 vrpn_CONNECTION_HIGH_THROUGHPUT = (1 << 4); - -/// @} - -/// @name What to log -/// @{ -const long vrpn_LOG_NONE = (0); -const long vrpn_LOG_INCOMING = (1 << 0); -const long vrpn_LOG_OUTGOING = (1 << 1); -/// @} - -// If defined, will filter out messages: if the remote side hasn't -// registered a type, messages of that type won't be sent over the -// link. WARNING: auto-type-registration breaks this. -//#define vrpn_FILTER_MESSAGES - -/// These are the strings that define the system-generated message -/// types that tell when connections are received and dropped. -/// @{ -extern VRPN_API const char *vrpn_got_first_connection; -extern VRPN_API const char *vrpn_got_connection; -extern VRPN_API const char *vrpn_dropped_connection; -extern VRPN_API const char *vrpn_dropped_last_connection; -/// @} - -/// @brief vrpn_CONTROL is the sender used for notification messages sent to the -/// user -/// from the local VRPN implementation (got_first_connection, etc.) -/// and for control messages sent by auxiliary services. (Such as -/// class vrpn_Controller, which will be introduced in a future revision.) - -extern VRPN_API const char *vrpn_CONTROL; - -/// @brief Length of names within VRPN -typedef char cName[100]; - -/// Placed here so vrpn_FileConnection can use it too. -struct VRPN_API vrpn_LOGLIST { - vrpn_HANDLERPARAM data; - vrpn_LOGLIST *next; - vrpn_LOGLIST *prev; -}; - -/// @todo HACK -/// These structs must be declared outside of vrpn_Connection -/// (although we'd like to make them protected/private members) -/// because aCC on PixelFlow doesn't handle nested classes correctly. -/// @{ - -/// @brief Description of a callback entry for a user type. -struct vrpnMsgCallbackEntry { - vrpn_MESSAGEHANDLER handler; ///< Routine to call - void *userdata; ///< Passed along - vrpn_int32 sender; ///< Only if from sender - vrpnMsgCallbackEntry *next; ///< Next handler -}; - -struct vrpnLogFilterEntry { - vrpn_LOGFILTER filter; ///< routine to call - void *userdata; ///< passed along - vrpnLogFilterEntry *next; -}; -/// @} - -class VRPN_API vrpn_Connection; -class VRPN_API vrpn_Log; -class VRPN_API vrpn_TranslationTable; -class VRPN_API vrpn_TypeDispatcher; - -/// @brief Encapsulation of the data and methods for a single generic connection -/// to take care of one part of many clients talking to a single server. -/// -/// This will only be used from within the vrpn_Connection class; it should -/// not be instantiated by users or devices. -/// Should not be visible! - -class VRPN_API vrpn_Endpoint { - -public: - vrpn_Endpoint(vrpn_TypeDispatcher *dispatcher, - vrpn_int32 *connectedEndpointCounter); - virtual ~vrpn_Endpoint(void); - - /// @name Accessors - /// @{ - - /// Returns the local mapping for the remote type (-1 if none). - int local_type_id(vrpn_int32 remote_type) const; - - /// Returns the local mapping for the remote sender (-1 if none). - int local_sender_id(vrpn_int32 remote_sender) const; - - virtual vrpn_bool doing_okay(void) const = 0; - /// @} - - /// @name Manipulators - /// @{ - - void init(void); - - virtual int mainloop(timeval *timeout) = 0; - - /// Clear out the remote mapping list. This is done when a - /// connection is dropped and we want to try and re-establish - /// it. - void clear_other_senders_and_types(void); - - /// A new local sender or type has been established; set - /// the local type for it if the other side has declared it. - /// Return 1 if the other side has one, 0 if not. - int newLocalSender(const char *name, vrpn_int32 which); - int newLocalType(const char *name, vrpn_int32 which); - - /// Adds a new remote type/sender and returns its index. - /// Returns -1 on error. - /// @{ - int newRemoteType(cName type_name, vrpn_int32 remote_id, - vrpn_int32 local_id); - int newRemoteSender(cName sender_name, vrpn_int32 remote_id, - vrpn_int32 local_id); - /// @} - - /// Pack a message that will be sent the next time mainloop() is called. - /// Turn off the RELIABLE flag if you want low-latency (UDP) send. - virtual int pack_message(vrpn_uint32 len, struct timeval time, - vrpn_int32 type, vrpn_int32 sender, - const char *buffer, - vrpn_uint32 class_of_service) = 0; - - /// send pending report, clear the buffer. - /// This function was protected, now is public, so we can use it - /// to send out intermediate results without calling mainloop - virtual int send_pending_reports(void) = 0; - - int pack_log_description(void); - ///< Packs the log description set by setup_new_connection(). - - virtual int setup_new_connection(void) = 0; - ///< Sends the magic cookie and other information to its - ///< peer. It is called by both the client and server setup routines. - - virtual void poll_for_cookie(const timeval *timeout = NULL) = 0; - virtual int finish_new_connection_setup(void) = 0; - - virtual void drop_connection(void) = 0; - ///< Should only be called by vrpn_Connection::drop_connection(), - ///< since there's more housecleaning to do at that level. I suppose - ///< that argues against separating this function out. - - virtual void clearBuffers(void) = 0; - ///< Empties out the TCP and UDP send buffers. - ///< Needed by vrpn_FileConnection to get at {udp,tcp}NumOut. - - int pack_sender_description(vrpn_int32 which); - ///< Packs a sender description over our socket. - - int pack_type_description(vrpn_int32 which); - ///< Packs a type description. - - /// @} - int status; - - /// @todo XXX These should be protected; making them so will lead to making - /// the code split the functions between Endpoint and Connection - /// protected: - - long d_remoteLogMode; ///< Mode to put the remote logging in - char *d_remoteInLogName; ///< Name of the remote log file - char *d_remoteOutLogName; ///< Name of the remote log file - - ///< Name of the remote host we are connected to. This is kept for - ///< informational purposes. It is printed by the ceiling server, - ///< for example. - char rhostname[150]; - - /// @name Logging - /// - /// TCH 19 April 00; changed into two logs 16 Feb 01 - /// @{ - - vrpn_Log *d_inLog; - vrpn_Log *d_outLog; - - void setLogNames(const char *inName, const char *outName); - int openLogs(void); - /// @} - - /// @name Routines that handle system messages - /// - /// Visible so that vrpn_Connection can pass them to the Dispatcher - /// @{ - static int VRPN_CALLBACK - handle_sender_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_type_message(void *userdata, vrpn_HANDLERPARAM p); - /// @} - - /// @name Routines to inform the endpoint of the connection of - /// which it is a part. - /// @{ - void setConnection(vrpn_Connection *conn) { d_parent = conn; } - vrpn_Connection *getConnection() { return d_parent; } - /// @} - -protected: - virtual int dispatch(vrpn_int32 type, vrpn_int32 sender, timeval time, - vrpn_uint32 payload_len, char *bufptr); - - int tryToMarshall(char *outbuf, vrpn_int32 &buflen, vrpn_int32 &numOut, - vrpn_uint32 len, timeval time, vrpn_int32 type, - vrpn_int32 sender, const char *buffer, - vrpn_uint32 classOfService); - ///< Calls marshall_message(); if that fails, calls - ///< send_pending_reports() and then marshalls again. - ///< Returns the number of characters successfully marshalled. - - int marshall_message(char *outbuf, vrpn_uint32 outbuf_size, - vrpn_uint32 initial_out, vrpn_uint32 len, - struct timeval time, vrpn_int32 type, - vrpn_int32 sender, const char *buffer, - vrpn_uint32 sequenceNumber); - - // The senders and types we know about that have been described by - // the other end of the connection. Also, record the local mapping - // for ones that have been described with the same name locally. - // The arrays are indexed by the ID from the other side, and store - // the name and local ID that corresponds to each. - - vrpn_TranslationTable *d_senders; - vrpn_TranslationTable *d_types; - - vrpn_TypeDispatcher *d_dispatcher; - vrpn_int32 *d_connectionCounter; - - vrpn_Connection *d_parent; -}; - -/// @brief Encapsulation of the data and methods for a single IP-based -/// connection -/// to take care of one part of many clients talking to a single server. -/// -/// This will only be used from within the vrpn_Connection_IP class; it should -/// not be instantiated by users or devices. -/// Should not be visible! - -class VRPN_API vrpn_Endpoint_IP : public vrpn_Endpoint { - -public: - vrpn_Endpoint_IP(vrpn_TypeDispatcher *dispatcher, - vrpn_int32 *connectedEndpointCounter); - virtual ~vrpn_Endpoint_IP(void); - - /// @name Accessors - /// @{ - virtual vrpn_bool doing_okay(void) const; - - /// True if the UDP outbound is open, False if not. - vrpn_bool outbound_udp_open(void) const; - - vrpn_int32 tcp_outbuf_size(void) const; - vrpn_int32 udp_outbuf_size(void) const; - /// @} - - /// @name Manipulators - /// @{ - - void init(void); - - int mainloop(timeval *timeout); - - /// @brief Pack a message that will be sent the next time mainloop() is - /// called. - /// - /// Turn off the RELIABLE flag if you want low-latency (UDP) send. - int pack_message(vrpn_uint32 len, struct timeval time, vrpn_int32 type, - vrpn_int32 sender, const char *buffer, - vrpn_uint32 class_of_service); - - /// @brief send pending report, clear the buffer. - /// - /// This function was protected, now is public, so we can use it - /// to send out intermediate results without calling mainloop - virtual int send_pending_reports(void); - - int pack_udp_description(int portno); - - int handle_tcp_messages(const timeval *timeout); - int handle_udp_messages(const timeval *timeout); - - int connect_tcp_to(const char *msg); - int connect_tcp_to(const char *addr, int port); - ///< Connects d_tcpSocket to the specified address (msg = "IP port"); - ///< sets status to COOKIE_PENDING; returns 0 on success, -1 on failure - int connect_udp_to(const char *addr, int port); - ///< Connects d_udpSocket to the specified address and port; - ///< returns 0 on success, sets status to BROKEN and returns -1 - ///< on failure. - - vrpn_int32 set_tcp_outbuf_size(vrpn_int32 bytecount); - - int setup_new_connection(void); - ///< Sends the magic cookie and other information to its - ///< peer. It is called by both the client and server setup routines. - - void poll_for_cookie(const timeval *timeout = NULL); - int finish_new_connection_setup(void); - - void drop_connection(void); - ///< Should only be called by vrpn_Connection::drop_connection(), - ///< since there's more housecleaning to do at that level. I suppose - ///< that argues against separating this function out. - - void clearBuffers(void); - ///< Empties out the TCP and UDP send buffers. - ///< Needed by vrpn_FileConnection to get at {udp,tcp}NumOut. - - void setNICaddress(const char *); - - /// @todo XXX These should be protected; making them so will lead to making - /// the code split the functions between Endpoint and Connection - /// protected: - - SOCKET d_tcpSocket; - - /// This section deals with when a client connection is trying to - /// establish (or re-establish) a connection with its server. It - /// keeps track of what we need to know to make this happen. - - SOCKET d_tcpListenSocket; - int d_tcpListenPort; - ///< Socket and port that the client listens on - ///< when lobbing datagrams at the server and - ///< waiting for it to call back. - - /// Socket to use to lob UDP requests asking for the server to - /// call us back. - SOCKET d_udpLobSocket; - - char *d_remote_machine_name; ///< Machine to call - int d_remote_port_number; ///< Port to connect to on remote machine - timeval d_last_connect_attempt; ///< When the last UDP lob occurred - - vrpn_bool d_tcp_only; - ///< For connections made through firewalls or NAT with the - ///< tcp: URL, we do not want to allow the endpoints on either - ///< end to open a UDP link to their counterparts. If this is - ///< the case, then this flag should be set to true. - -protected: - int getOneTCPMessage(int fd, char *buf, size_t buflen); - int getOneUDPMessage(char *buf, size_t buflen); - - SOCKET d_udpOutboundSocket; - SOCKET d_udpInboundSocket; - ///< Inbound unreliable messages come here. - ///< Need one for each due to different - ///< clock synchronization for each; we - ///< need to know which server each message is from. - ///< @todo XXX Now that we don't need multiple clocks, can we collapse this? - - char *d_tcpOutbuf; - char *d_udpOutbuf; - vrpn_int32 d_tcpBuflen; - vrpn_int32 d_udpBuflen; - vrpn_int32 d_tcpNumOut; - vrpn_int32 d_udpNumOut; - - vrpn_int32 d_tcpSequenceNumber; - vrpn_int32 d_udpSequenceNumber; - - vrpn_float64 - d_tcpAlignedInbuf[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64) + - 1]; - vrpn_float64 - d_udpAlignedInbuf[vrpn_CONNECTION_UDP_BUFLEN / sizeof(vrpn_float64) + - 1]; - char *d_tcpInbuf; - char *d_udpInbuf; - - char *d_NICaddress; -}; - -/// @brief Generic connection class not specific to the transport mechanism. -/// -/// It abstracts all of the common functions. Specific implementations -/// for IP, MPI, and other transport mechanisms follow. -class VRPN_API vrpn_Connection { - -protected: - /// Constructor for server connection. This cannot be called - /// directly any more because vrpn_Connection is an abstract base - /// class. Call vrpn_create_server_connection() to make a server - /// of arbitrary type based on a name. - vrpn_Connection(const char *local_in_logfile_name, - const char *local_out_logfile_name, - vrpn_Endpoint_IP *(*epa)(vrpn_Connection *, - vrpn_int32 *) = allocateEndpoint); - - /// Constructor for client connection. This cannot be called - /// directly because vrpn_Connection is an abstract base class. - /// Call vrpn_get_connection_by_name() to create a client connection. - vrpn_Connection(const char *local_in_logfile_name, - const char *local_out_logfile_name, - const char *remote_in_logfile_name, - const char *remote_out_logfile_name, - vrpn_Endpoint_IP *(*epa)(vrpn_Connection *, - vrpn_int32 *) = allocateEndpoint); - -public: - virtual ~vrpn_Connection(void); - - /// Returns vrpn_true if the connection is okay, vrpn_false if not - virtual vrpn_bool doing_okay(void) const; - - /// Returns vrpn_true if the connection has been established, vrpn_false if not - /// (For a networkless connection, this is equivalent to doing_okay()). - virtual vrpn_bool connected(void) const; - - /// This function returns the logfile names of this connection in - /// the parameters. It will allocate memory for the name of each - /// log file in use. If no logging of a particular type is happening, - /// then *(X_Y_logname) will be set to NULL. - /// IMPORTANT: code calling this function is responsible for freeing - /// the memory allocated for these strings. - void get_log_names(char **local_in_logname, char **local_out_logname, - char **remote_in_logname, char **remote_out_logname); - - /// Call each time through program main loop to handle receiving any - /// incoming messages and sending any packed messages. - /// Returns -1 when connection dropped due to error, 0 otherwise. - /// (only returns -1 once per connection drop). - /// Optional argument is TOTAL time to block on select() calls; - /// there may be multiple calls to select() per call to mainloop(), - /// and this timeout will be divided evenly between them. - virtual int mainloop(const struct timeval *timeout = NULL) = 0; - - /// Get a token to use for the string name of the sender or type. - /// Remember to check for -1 meaning failure. - virtual vrpn_int32 register_sender(const char *name); - virtual vrpn_int32 register_message_type(const char *name); - - /// Set up (or remove) a handler for a message of a given type. - /// Optionally, specify which sender to handle messages from. - /// Handlers will be called during mainloop(). - /// Your handler should return 0 or a communication error is assumed - /// and the connection will be shut down. - virtual int register_handler(vrpn_int32 type, vrpn_MESSAGEHANDLER handler, - void *userdata, - vrpn_int32 sender = vrpn_ANY_SENDER); - virtual int unregister_handler(vrpn_int32 type, vrpn_MESSAGEHANDLER handler, - void *userdata, - vrpn_int32 sender = vrpn_ANY_SENDER); - - /// Pack a message that will be sent the next time mainloop() is called. - /// Turn off the RELIABLE flag if you want low-latency (UDP) send. - virtual int pack_message(vrpn_uint32 len, struct timeval time, - vrpn_int32 type, vrpn_int32 sender, - const char *buffer, vrpn_uint32 class_of_service); - - /// send pending report, clear the buffer. - /// This function was protected, now is public, so we can use it - /// to send out intermediate results without calling mainloop - virtual int send_pending_reports(void) = 0; - - /// Returns the time since the connection opened. - /// Some subclasses may redefine time. - virtual int time_since_connection_open(struct timeval *elapsed_time); - - /// returns the current time in the connection (since the epoch -- UTC - /// time). - virtual timeval get_time(); - - /// Returns the name of the specified sender/type, or NULL - /// if the parameter is invalid. Only works for user - /// messages (type >= 0). - virtual const char *sender_name(vrpn_int32 sender); - virtual const char *message_type_name(vrpn_int32 type); - - /// @brief Sets up a filter function for logging. - /// Any user message to be logged is first passed to this function, - /// and will only be logged if the function returns zero (XXX). - /// NOTE: this only affects local logging - remote logging - /// is unfiltered! Only user messages are filtered; all system - /// messages are logged. - /// Returns nonzero on failure. - virtual int register_log_filter(vrpn_LOGFILTER filter, void *userdata); - - /// Save any messages on any endpoints which have been logged so far. - virtual int save_log_so_far(); - - /// vrpn_File_Connection implements this as "return this" so it - /// can be used to detect a File_Connection and get the pointer for it - virtual vrpn_File_Connection *get_File_Connection(void); - - /// This function should be seldom used. It is here for the case of - /// the vrpn_Imager, whose servers do not follow "The VRPN Way" because - /// they try to jam more data into the network than there is bandwidth - /// to support it. As a result, a client may call mainloop() on the - /// connection and have it never return -- there is always more data - /// in the network to read, so we never hand control back to the main - /// program. The reason for the name comes from an old U.S. cartoon - /// called "The Jetsons". In it, George Jetson is running on a - /// treadmill when it goes out of control and starts spinning so fast - /// that he can't even run fast enough to reach the controls and turn - /// it off. He cries out to his wife, "Jane! Stop this crazy thing!" - /// The parameter specifies a trigger: if more than the specified number - /// of messages come in on a given input channel during one mainloop() - /// call, the connection should stop looking for more messages. NOTE: - /// this does not guarantee that only this many messages will be received, - /// only that the connection will stop looking for new ones on a given - /// channel once that many have been received (for example, UDP channels - /// will parse all the rest of the messages in a packet before stopping). - /// A value of 0 turns off the limit, and will cause all incoming messages - /// to be handled before returning. - void Jane_stop_this_crazy_thing(vrpn_uint32 stop_looking_after) - { - d_stop_processing_messages_after = stop_looking_after; - }; - vrpn_uint32 get_Jane_value(void) - { - return d_stop_processing_messages_after; - }; - -protected: - /// If this value is greater than zero, the connection should stop - /// looking for new messages on a given endpoint after this many - /// are found. - vrpn_uint32 d_stop_processing_messages_after; - - int connectionStatus; ///< Status of the connection - - static vrpn_Endpoint_IP *allocateEndpoint(vrpn_Connection *, - vrpn_int32 *connectedEC); - ///< Redefining this and passing it to constructors - ///< allows a subclass to use a different subclass of Endpoint. - ///< It should do NOTHING but return an endpoint - ///< of the appropriate class; it may not access subclass data, - ///< since it'll be called from a constructor - - /// Sockets used to talk to remote Connection(s) - /// and other information needed on a per-connection basis - vrpn_Endpoint_IP *d_endpoints[vrpn_MAX_ENDPOINTS]; - vrpn_int32 d_numEndpoints; - - vrpn_int32 d_numConnectedEndpoints; - ///< We need to track the number of connected endpoints separately - ///< to properly send out got-first-connection/dropped-last-connection - ///< messages. This value is *managed* by the Endpoints, but we - ///< need exactly one copy per Connection, so it's on the Connection. - - /// @brief Routines that handle system messages - /// @{ - static int VRPN_CALLBACK - handle_log_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_disconnect_message(void *userdata, vrpn_HANDLERPARAM p); - /// @} - - virtual void init(void); ///< Base initialization for all constructors. - - int delete_endpoint(int whichEndpoint); - int compact_endpoints(void); - - virtual int pack_sender_description(vrpn_int32 which); - ///< Send the sender description to ALL endpoints. - - virtual int pack_type_description(vrpn_int32 which); - ///< Send the type description to ALL endpoints. - - virtual int do_callbacks_for(vrpn_int32 type, vrpn_int32 sender, - struct timeval time, vrpn_uint32 len, - const char *buffer); - - /// Returns message type ID, or -1 if unregistered - int message_type_is_registered(const char *) const; - - /// Timekeeping - TCH 30 June 98 - timeval start_time; - - // - /// Counting references to this connection. -public: - void addReference(); - void removeReference(); - -private: - int d_references; - - // - /// Specify whether this connection should be deleted automatically when - /// it is no longer need (reference count reaches zero). - /// For connections created by the VRPN code (as is done in - /// get_connection_by_name) these should be auto-deleted. - /// Connections created by user code should not be auto-deleted; - /// that is up to the user to decide when finished. - /// By default, the constructor sets this to FALSE. - /// VRPN code (or user code) can set this to TRUE if it wants the - /// connection to be deleted automatically when the last service on it - /// is deleted -public: - void setAutoDeleteStatus(bool setvalue) { d_autoDeleteStatus = setvalue; } - -private: - bool d_autoDeleteStatus; ///< FALSE by default. - -public: - /// Derived classes need access to d_dispatcher in their - /// allocateEndpoint() routine. Several compilers won't give it to - /// them, even if they do inherit publicly. Until we figure that - /// out, d_dispatcher needs to be public. - - vrpn_TypeDispatcher *d_dispatcher; - -protected: - int doSystemCallbacksFor(vrpn_HANDLERPARAM, void *); - - /// Server logging w. multiconnection - TCH July 00 - /// Use one "hidden" endpoint for outgoing logs (?), - /// standard per-endpoint logs with augmented names for incoming. - /// To make a hidden endpoint we create d_endpoints[0] and increment - /// the d_numEndpoints, but DON'T pass it d_numConnectedEndpoints - /// (although it should be safe to do so, since it should never truly - /// become connected, but we might have to "fake" it to get it to log - /// correctly). - - // vrpn_Endpoint * d_serverLogEndpoint; - int d_serverLogCount; - vrpn_int32 d_serverLogMode; - char *d_serverLogName; - - vrpn_Endpoint_IP *(*d_endpointAllocator)(vrpn_Connection *, vrpn_int32 *); - vrpn_bool d_updateEndpoint; - - virtual void updateEndpoints(void); - ///< This function will be called on the mainloop() iteration - ///< after *d_endpointAllocator is called, which lets subclasses - ///< do initialization. (They can't do so during allocateEndpoint - ///< because it's called during the Connection constructor when - ///< their constructors haven't executed yet.) -}; - -class VRPN_API vrpn_Connection_IP : public vrpn_Connection { - -protected: - /// Make a client connection. To access this from user code, - /// call vrpn_get_connection_by_name(). - /// Create a connection - if server_name is not a file: name, - /// makes an SDI-like connection to the named remote server - /// (otherwise functions as a non-networked messaging hub). - /// Port less than zero forces default. - /// Currently, server_name is an extended URL that defaults - /// to VRPN connections at the port, but can be file:: to read - /// from a file. Other extensions should maintain this, so - /// that VRPN uses URLs to name things that are to be connected - /// to. - vrpn_Connection_IP(const char *server_name, - int port = vrpn_DEFAULT_LISTEN_PORT_NO, - const char *local_in_logfile_name = NULL, - const char *local_out_logfile_name = NULL, - const char *remote_in_logfile_name = NULL, - const char *remote_out_logfile_name = NULL, - const char *NIC_IPaddress = NULL, - vrpn_Endpoint_IP *(*epa)( - vrpn_Connection *, vrpn_int32 *) = allocateEndpoint); - -public: - /// Make a server that listens for client connections. - /// DEPRECATED: Call vrpn_create_server_connection() with the - /// NIC name and port number you want. - vrpn_Connection_IP( - unsigned short listen_port_no = vrpn_DEFAULT_LISTEN_PORT_NO, - const char *local_in_logfile_name = NULL, - const char *local_out_logfile_name = NULL, - const char *NIC_IPaddress = NULL, - vrpn_Endpoint_IP *(*epa)(vrpn_Connection *, - vrpn_int32 *) = allocateEndpoint); - - virtual ~vrpn_Connection_IP(void); - - /// This is similar to check connection except that it can be - /// used to receive requests from before a server starts up - virtual int connect_to_client(const char *machine, int port); - - /// Call each time through program main loop to handle receiving any - /// incoming messages and sending any packed messages. - /// Returns -1 when connection dropped due to error, 0 otherwise. - /// (only returns -1 once per connection drop). - /// Optional argument is TOTAL time to block on select() calls; - /// there may be multiple calls to select() per call to mainloop(), - /// and this timeout will be divided evenly between them. - virtual int mainloop(const struct timeval *timeout = NULL); - -protected: - /// If this value is greater than zero, the connection should stop - /// looking for new messages on a given endpoint after this many - /// are found. - vrpn_uint32 d_stop_processing_messages_after; - -protected: - friend VRPN_API vrpn_Connection *vrpn_get_connection_by_name( - const char *cname, const char *local_in_logfile_name, - const char *local_out_logfile_name, const char *remote_in_logfile_name, - const char *remote_out_logfile_name, const char *NIC_IPaddress, - bool force_connection); - friend VRPN_API vrpn_Connection * - vrpn_create_server_connection(const char *cname, - const char *local_in_logfile_name, - const char *local_out_logfile_name); - -/// @name Only used for a vrpn_Connection that awaits incoming connections -/// @{ - SOCKET listen_udp_sock; ///< UDP Connect requests come here - SOCKET listen_tcp_sock; ///< TCP Connection requests come here - /// @} - - /// Routines that handle system messages - static int VRPN_CALLBACK - handle_UDP_message(void *userdata, vrpn_HANDLERPARAM p); - - /// @brief Called by all constructors - virtual void init(void); - - /// @brief send pending report, clear the buffer. - /// - /// This function was protected, now is public, so we can use it - /// to send out intermediate results without calling mainloop - virtual int send_pending_reports(void); - - //// This is called by a server-side process to see if there have - //// been any UDP packets come in asking for a connection. If there - //// are, it connects the TCP port and then calls handle_connection(). - virtual void - server_check_for_incoming_connections(const struct timeval *timeout = NULL); - - /// This routine is called by a server-side connection when a - /// new connection has just been established, and the tcp port - /// has been connected to it. - virtual void handle_connection(int whichEndpoint); - - virtual void drop_connection(int whichEndpoint); - - char *d_NIC_IP; -}; - -/// @brief Constructor for a Loopback connection that will basically just -/// pass messages between objects that are connected to it. It offers no -/// external connections, via IP or any other mechanism. It is useful -/// if you want to make the client and server in the same connection and -/// you don't need to have anything else connect. - -class VRPN_API vrpn_Connection_Loopback : public vrpn_Connection { - -protected: - /// Make a client connection. To access this from user code, - /// call vrpn_create_server_connection() with a service name - /// of 'loopback:'. - /// For now, we don't enable logging on a Loopback connection. - vrpn_Connection_Loopback(); -public: - virtual ~vrpn_Connection_Loopback(void); - - /// Call each time through program main loop to handle receiving any - /// incoming messages and sending any packed messages. - /// Returns -1 on error, 0 otherwise. - /// Optional argument is TOTAL time to block on select() calls; - /// there may be multiple calls to select() per call to mainloop(), - /// and this timeout will be divided evenly between them. - virtual int mainloop(const struct timeval *timeout = NULL); - - /// Returns vrpn_true if the connection is okay, vrpn_false if not - virtual vrpn_bool doing_okay(void) const { return vrpn_true; } - - /// Returns vrpn_true if the connection has been established, vrpn_false if not - /// (For a networkless connection, this is equivalent to doing_okay()). - virtual vrpn_bool connected(void) const { return vrpn_true; } - -protected: - friend VRPN_API vrpn_Connection * - vrpn_create_server_connection(const char *cname, - const char *local_in_logfile_name, - const char *local_out_logfile_name); - - /// @brief send pending report, clear the buffer. - /// - /// This function was protected, now is public, so we can use it - /// to send out intermediate results without calling mainloop - virtual int send_pending_reports(void) {return 0;} -}; - -/// @brief Create a client connection of arbitrary type (VRPN UDP/TCP, TCP, -/// File, Loopback, MPI). -/// -/// WARNING: May not be thread safe. -/// If no IP address for the NIC to use is specified, uses the default -/// NIC. If the force_reopen flag is set, a new connection will be -/// made even if there was already one to that server. -/// When done with the object, call removeReference() on it (which will -/// delete it if there are no other references). -VRPN_API vrpn_Connection *vrpn_get_connection_by_name( - const char *cname, const char *local_in_logfile_name = NULL, - const char *local_out_logfile_name = NULL, - const char *remote_in_logfile_name = NULL, - const char *remote_out_logfile_name = NULL, - const char *NIC_IPaddress = NULL, bool force_reopen = false); - -/// @brief Create a server connection of arbitrary type (VRPN UDP/TCP, -/// TCP, File, Loopback, MPI). -/// -/// Returns NULL if the name is not understood or the connection cannot -/// be created. -/// WARNING: May not be thread safe. -/// To create a VRPN TCP/UDP server, use a name like: -/// vrpn:machine_name_or_ip:port -/// machine_name_or_ip:port -/// machine_name_or_ip -/// :port (This port on any network card.) -/// To create an MPI server, use a name like: -/// mpi:MPI_COMM_WORLD -/// mpi:comm_number -/// When done with the object, call removeReference() on it (which will -/// delete it if there are no other references). -VRPN_API vrpn_Connection * -vrpn_create_server_connection(const char *cname, - const char *local_in_logfile_name = NULL, - const char *local_out_logfile_name = NULL); - -/// Lets you make one with the default settings, or just ask for a specific -/// port number on the default NIC on this machine. This matches the -/// signature on the old constructor to make it easier to port existing -/// servers. -inline VRPN_API vrpn_Connection * -vrpn_create_server_connection(int port = vrpn_DEFAULT_LISTEN_PORT_NO, - const char *local_in_logfile_name = NULL, - const char *local_out_logfile_name = NULL, - const char *NIC_NAME = NULL) -{ - char name[256]; - if (NIC_NAME == NULL) { - sprintf(name, ":%d", port); - } - else { - sprintf(name, "%s:%d", NIC_NAME, port); - } - return vrpn_create_server_connection(name, local_in_logfile_name, - local_out_logfile_name); -} - -/// @name Utility routines to parse names (<service>@<location specifier>) -/// Both return new char [], and it is the caller's responsibility -/// to delete this memory! -/// @{ -VRPN_API char *vrpn_copy_service_name(const char *fullname); -VRPN_API char *vrpn_copy_service_location(const char *fullname); -/// @} - -/// @brief Utility routines to parse file specifiers FROM service locations -/// -/// file:<filename> -/// -/// file://<hostname>/<filename> -/// -/// file:///<filename> -VRPN_API char *vrpn_copy_file_name(const char *filespecifier); - -/// @name Utility routines to parse host specifiers FROM service locations -/// -/// <hostname> -/// -/// <hostname>:<port number> -/// -/// x-vrpn://<hostname> -/// -/// x-vrpn://<hostname>:<port number> -/// -/// x-vrsh://<hostname>/<server program>,<comma-separated server arguments> -/// -/// The caller is responsible for calling delete [] on the returned character -/// pointer if it is not NULL. -/// @{ -VRPN_API char *vrpn_copy_machine_name(const char *hostspecifier); -VRPN_API int vrpn_get_port_number(const char *hostspecifier); -VRPN_API char *vrpn_copy_rsh_program(const char *hostspecifier); -VRPN_API char *vrpn_copy_rsh_arguments(const char *hostspecifier); -/// @} - -/// @brief Utility routine to rename the service name of a given host specifier. -char *vrpn_set_service_name(const char *specifier, const char *newServiceName); - -/// Checks the buffer to see if it is a valid VRPN header cookie. -/// Returns -1 on total mismatch, -/// 1 on minor version mismatch or other acceptable difference, -/// and 0 on exact match. -/// @{ -VRPN_API int check_vrpn_cookie(const char *buffer); -VRPN_API int check_vrpn_file_cookie(const char *buffer); -/// @} - -/// @brief Returns the size of the magic cookie buffer, plus any alignment -/// overhead. -VRPN_API size_t vrpn_cookie_size(void); - -VRPN_API int write_vrpn_cookie(char *buffer, size_t length, - long remote_log_mode); - -/// @name Utility routines for reading from and writing to sockets/file -/// descriptors -/// @{ -#ifndef VRPN_USE_WINSOCK_SOCKETS -int VRPN_API -vrpn_noint_block_write(int outfile, const char buffer[], size_t length); -int VRPN_API vrpn_noint_block_read(int infile, char buffer[], size_t length); -int VRPN_API vrpn_noint_select(int width, fd_set *readfds, fd_set *writefds, - fd_set *exceptfds, struct timeval *timeout); -#else /* winsock sockets */ -int VRPN_API -vrpn_noint_block_write(SOCKET outsock, char *buffer, size_t length); -int VRPN_API vrpn_noint_block_read(SOCKET insock, char *buffer, size_t length); -#endif /* VRPN_USE_WINSOCK_SOCKETS */ - /// @} - -/** - * @brief Singleton class that keeps track of all known VRPN connections - * and makes sure they're deleted on shutdown. - * - * We make it static to guarantee that the destructor is called - * on program close so that the destructors of all the vrpn_Connections - * that have been allocated are called so that all open logs are flushed - * to disk. Each connection should add itself to this list in its - * constructor and should remove itself from this list in its - * destructor. - */ - -// This section holds data structures and functions to open -// connections by name. -// The intention of this section is that it can open connections for -// objects that are in different libraries (trackers, buttons and sound), -// even if they all refer to the same connection. - -class VRPN_API vrpn_ConnectionManager { - -public: - ~vrpn_ConnectionManager(void); - - /// @brief The only way to get access to an instance of this class. - /// Guarantees that there is only one, global object. - /// Also guarantees that it will be constructed the first time - /// this function is called, and (hopefully?) destructed when - /// the program terminates. - static vrpn_ConnectionManager &instance(void); - - /// NB implementation is not particularly efficient; we expect - /// to have O(10) connections, not O(1000). - /// @{ - void addConnection(vrpn_Connection *, const char *name); - void deleteConnection(vrpn_Connection *); - /// @} - - /// Searches through d_kcList but NOT d_anonList - /// (Connections constructed with no name) - vrpn_Connection *getByName(const char *name); - -private: - struct knownConnection { - char name[1000]; - vrpn_Connection *connection; - knownConnection *next; - }; - - /// @brief named connections - knownConnection *d_kcList; - - /// @brief unnamed (server) connections - knownConnection *d_anonList; - - vrpn_ConnectionManager(void); - - // @brief copy constructor undefined to prevent instantiations - vrpn_ConnectionManager(const vrpn_ConnectionManager &); - - static void deleteConnection(vrpn_Connection *, knownConnection **); -}; - -#endif // VRPN_CONNECTION_H diff --git a/src/vrpn/vrpn_ConnectionPtr.h b/src/vrpn/vrpn_ConnectionPtr.h deleted file mode 100644 index d907332018dd8882bd171dd16e10479ab2e63bde..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_ConnectionPtr.h +++ /dev/null @@ -1,254 +0,0 @@ -/** @file - @brief Header - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef INCLUDED_vrpn_ConnectionPtr_h_GUID_52044DCC_1409_4F8B_FC18_0F80285ABDBE -#define INCLUDED_vrpn_ConnectionPtr_h_GUID_52044DCC_1409_4F8B_FC18_0F80285ABDBE - -// Internal Includes -// - none - -// Library/third-party includes -#include <vrpn_Connection.h> -#include <vrpn_MainloopObject.h> - -// Standard includes -// - none - -/// @brief A shared pointer class for holding on to vrpn_Connection instances, -/// using the existing "intrusive reference counting" automatically. -class vrpn_ConnectionPtr { -public: - /// Explicit constructor from a non-smart connection pointer - explicit vrpn_ConnectionPtr(vrpn_Connection* c = NULL) - : _p(c) - { - if (_p) { - _p->addReference(); - } - } - - /// Copy constructor from smart pointer - vrpn_ConnectionPtr(vrpn_ConnectionPtr const& other) - : _p(other._p) - { - if (_p) { - _p->addReference(); - } - } - - /// Assignment operator from smart pointer - vrpn_ConnectionPtr& operator=(vrpn_ConnectionPtr const& other) - { - if (this == &other || _p == other._p) { - /// self-assignment is a no-op - return *this; - } - - reset(); - if (other._p) { - _p = other._p; - _p->addReference(); - } - return *this; - } - - /// Assignment operator from non-smart pointer - vrpn_ConnectionPtr& operator=(vrpn_Connection* other) - { - if (_p == other) { - /// self-assignment is a no-op - return *this; - } - - reset(); - if (other) { - _p = other; - _p->addReference(); - } - return *this; - } - - /// Destructor - decrements the contained reference count, if applicable - ~vrpn_ConnectionPtr() { reset(); } - - /// Clears the contained pointer and decrements the reference count, if - /// applicable - void reset() - { - if (_p) { - _p->removeReference(); - } - _p = NULL; - } - - /// Gets the contained "non-smart" pointer. You are responsible - /// for calling vrpn_Connection::addReference() if you want to - /// affect connection lifetime with this pointer! - /// (Included VRPN devices take care of this by default) - vrpn_Connection* get() const { return _p; } - - /// @name Smart Pointer operators - /// @{ - vrpn_Connection& operator*() { return *_p; } - - vrpn_Connection const& operator*() const { return *_p; } - - vrpn_Connection* operator->() { return _p; } - - vrpn_Connection const* operator->() const { return _p; } - /// @} - - bool operator!() const { return !_p; } - - /// @name Safe Bool Idiom - /// @{ - typedef vrpn_Connection* vrpn_ConnectionPtr::*unspecified_bool_type; - operator unspecified_bool_type() const - { - return (this->operator!()) ? &vrpn_ConnectionPtr::_p : NULL; - } - /// @} - - /// @name Connection creation functions - /// Use these function, rather than initializing a vrpn_ConnectionPtr with - /// results of vrpn_create_server_connection() - this will correctly handle - /// the default reference added by the vrpn_create_server_connection() - /// function. Identical signatures are provided for your convenience - /// @{ - static vrpn_ConnectionPtr - create_server_connection(int port = vrpn_DEFAULT_LISTEN_PORT_NO, - const char* local_in_logfile_name = NULL, - const char* local_out_logfile_name = NULL, - const char* NIC_NAME = NULL) - { - return vrpn_ConnectionPtr( - vrpn_create_server_connection(port, local_in_logfile_name, - local_out_logfile_name, NIC_NAME), - false); - } - - static vrpn_ConnectionPtr - create_server_connection(const char* cname, - const char* local_in_logfile_name = NULL, - const char* local_out_logfile_name = NULL) - { - return vrpn_ConnectionPtr( - vrpn_create_server_connection(cname, local_in_logfile_name, - local_out_logfile_name), - false); - } - /// @} - -private: - /// Private constructor used by the connection creation functions, allowing - /// creation of a vrpn_ConnectionPtr without increasing the reference count - /// since the construction functions in VRPN automatically do this once. - vrpn_ConnectionPtr(vrpn_Connection* c, bool needsAddRef) - : _p(c) - { - if (_p && needsAddRef) { - _p->addReference(); - } - } - - /// Contained pointer - vrpn_Connection* _p; - - /// Dummy function supporting the safe bool idiom - void this_type_does_not_support_comparisons() const {} -}; - -/// Equality operator for connection smart pointers -/// @relates vrpn_ConnectionPtr -inline bool operator==(const vrpn_ConnectionPtr& lhs, - const vrpn_ConnectionPtr& rhs) -{ - return lhs.get() == rhs.get(); -} - -/// Inequality operator for connection smart pointers -/// @relates vrpn_ConnectionPtr -inline bool operator!=(const vrpn_ConnectionPtr& lhs, - const vrpn_ConnectionPtr& rhs) -{ - return lhs.get() != rhs.get(); -} - -#if 0 -/// @name Poisoning operators for connection smart pointers -/// Supporting the safe bool idiom -/// @todo why does this not work right? -/// @relates vrpn_ConnectionPtr -/// @{ -template <typename T> -bool operator!=(const T& lhs, const vrpn_ConnectionPtr& rhs) { - rhs.this_type_does_not_support_comparisons(); - return false; -} - -template <typename T> -bool operator==(const T& lhs, const vrpn_ConnectionPtr& rhs) { - rhs.this_type_does_not_support_comparisons(); - return false; -} - -template <typename T> -bool operator!=(const vrpn_ConnectionPtr& lhs, const T& rhs) { - lhs.this_type_does_not_support_comparisons(); - return false; -} - -template <typename T> -bool operator==(const vrpn_ConnectionPtr& lhs, const T& rhs) { - lhs.this_type_does_not_support_comparisons(); - return false; -} -/// @} -#endif - -/// Namespace enclosing internal implementation details -namespace detail { - template <class T> class TypedMainloopObject; - - /// Specialization of vrpn_MainloopObject for holding connections that - /// are maintained by vrpn_ConnectionPtr smart pointers. - template <> - class TypedMainloopObject<vrpn_ConnectionPtr> : public vrpn_MainloopObject { - public: - explicit TypedMainloopObject(vrpn_ConnectionPtr o) - : _instance(o) - { - if (!o) { - throw vrpn_MainloopObject:: - CannotWrapNullPointerIntoMainloopObject(); - } - } - - virtual bool broken() { return (!_instance->doing_okay()); } - - virtual void mainloop() { _instance->mainloop(); } - - protected: - virtual void* _returnContained() const { return _instance.get(); } - - private: - vrpn_ConnectionPtr _instance; - }; -} // end of namespace detail - -#endif // INCLUDED_vrpn_ConnectionPtr_h_GUID_52044DCC_1409_4F8B_FC18_0F80285ABDBE diff --git a/src/vrpn/vrpn_Contour.C b/src/vrpn/vrpn_Contour.C deleted file mode 100644 index 7b76689f222b359a9138c31758d67af30f022595..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Contour.C +++ /dev/null @@ -1,214 +0,0 @@ -// vrpn_Contour.C: VRPN driver for Contour Design devices - -#include <stdio.h> // for fprintf, stderr, NULL -#include <string.h> // for memset -#include <math.h> // for fabs - -#include "vrpn_Contour.h" -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_HID) - -static const double POLL_INTERVAL = 1e+6 / 30.0; // If we have not heard, ask. - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 CONTOUR_VENDOR = 0x0b33; -static const vrpn_uint16 CONTOUR_SHUTTLEXPRESS = 0x0020; - -static void normalize_axis(const unsigned int value, const short deadzone, const vrpn_float64 scale, vrpn_float64& channel) { - channel = (static_cast<float>(value) - 128.0f); - if (fabs(channel) < deadzone) - { - channel = 0.0f; - } - else - { - channel /= 128.0f; - } - channel *= scale; - if (channel < -1.0) { channel = -1.0; } - if (channel > 1.0) { channel = 1.0; } -} - -static void normalize_axes(const unsigned int x, const unsigned int y, const short deadzone, const vrpn_float64 scale, vrpn_float64& channelX, vrpn_float64& channelY) { - normalize_axis(x, deadzone, scale, channelX); - normalize_axis(y, deadzone, scale, channelY); -} - -vrpn_Contour::vrpn_Contour(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c) - : vrpn_HidInterface(filter) - , vrpn_BaseClass(name, c) - , _filter(filter) -{ - init_hid(); -} - -vrpn_Contour::~vrpn_Contour(void) -{ - delete _filter; -} - -void vrpn_Contour::init_hid(void) { - // Get notifications when clients connect and disconnect - register_autodeleted_handler(d_connection->register_message_type(vrpn_dropped_last_connection), on_last_disconnect, this); - register_autodeleted_handler(d_connection->register_message_type(vrpn_got_connection), on_connect, this); -} - -void vrpn_Contour::on_data_received(size_t bytes, vrpn_uint8 *buffer) -{ - decodePacket(bytes, buffer); -} - -int vrpn_Contour::on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Contour *me = static_cast<vrpn_Contour *>(thisPtr); - return 0; -} - -int vrpn_Contour::on_connect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Contour *me = static_cast<vrpn_Contour *>(thisPtr); - return 0; -} - -vrpn_Contour_ShuttleXpress::vrpn_Contour_ShuttleXpress(const char *name, vrpn_Connection *c) - : vrpn_Contour(_filter = new vrpn_HidProductAcceptor(CONTOUR_VENDOR, CONTOUR_SHUTTLEXPRESS), name, c) - , vrpn_Button_Filter(name, c) - , vrpn_Analog(name, c) - , vrpn_Dial(name, c) -{ - vrpn_Analog::num_channel = 1; - vrpn_Dial::num_dials = 1; - vrpn_Button::num_buttons = 5; - - // Initialize the state of all the analogs, buttons, and dials - _lastDial = 0; - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); -} - -void vrpn_Contour_ShuttleXpress::mainloop(void) -{ - update(); - server_mainloop(); - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, _timestamp) > POLL_INTERVAL ) { - _timestamp = current_time; - report_changes(); - - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::server_mainloop(); - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::server_mainloop(); - } - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::server_mainloop(); - } - } -} - -void vrpn_Contour_ShuttleXpress::report(vrpn_uint32 class_of_service) { - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::timestamp = _timestamp; - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::timestamp = _timestamp; - } - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::report(class_of_service); - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::report_changes(); - } - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Contour_ShuttleXpress::report_changes(vrpn_uint32 class_of_service) { - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::timestamp = _timestamp; - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::timestamp = _timestamp; - } - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::report(class_of_service); - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::report_changes(); - } - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Contour_ShuttleXpress::decodePacket(size_t bytes, vrpn_uint8 *buffer) { - // Decode all full reports, each of which is 5 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - // XXX Check to see that this works with HIDAPI, there may be two smaller reports. - if (bytes == 5) { - // analog (1st byte): 0 center, 1..7 right, -1..-7 left - normalize_axis((unsigned int) ((static_cast<float>(static_cast<vrpn_int8>(buffer[0])) * 128.0f / 7.0f) + 128.0f), 0, 1.0f, channel[0]); - - if (vrpn_Dial::num_dials > 0) - { - // dial (2nd byte) - // Do the unsigned/signed conversion at the last minute so the signed values work properly. - dials[0] = static_cast<vrpn_int8>(buffer[1] - _lastDial); - _lastDial = buffer[1]; - } - else - { - // dial (2nd byte) - normalize_axis((unsigned int) (static_cast<float>(static_cast<vrpn_int8>(buffer[1])) + 128.0f), 0, 1.0f, channel[1]); - } - - vrpn_uint8 value; - // buttons (4th byte): - value = buffer[3]; - for (int btn = 0; btn < 4; btn++) { - vrpn_uint8 mask = static_cast<vrpn_uint8>((1 << (btn % 8)) << 4); - buttons[btn] = ((value & mask) != 0); - } - // buttons (5th byte): - value = buffer[4]; - for (int btn = 0; btn < 1; btn++) { - vrpn_uint8 mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[btn + 4] = ((value & mask) != 0); - } - } else { - fprintf(stderr, "vrpn_Contour_ShuttleXpress: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - } -} - -// End of VRPN_USE_HID -#endif diff --git a/src/vrpn/vrpn_Contour.h b/src/vrpn/vrpn_Contour.h deleted file mode 100644 index 0cffcfea9b3013594bbb94b3fd13fa63df96ac98..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Contour.h +++ /dev/null @@ -1,71 +0,0 @@ -#pragma once - -#include <stddef.h> // for size_t - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_BaseClass.h" // for vrpn_BaseClass -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_USE_HID -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Dial.h" // for vrpn_Dial -#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint8, vrpn_uint32 - -#if defined(VRPN_USE_HID) - -// Device drivers for the Contour Design USB line of products -// Currently supported: ShuttleXpress -// -// Exposes three major VRPN device classes: Button, Analog, Dial (as appropriate). -// All models expose Buttons for the keys on the device. -// Button 0 is the programming switch; it is set if the switch is in the "red" position. -// - -class vrpn_Contour: public vrpn_BaseClass, protected vrpn_HidInterface { -public: - vrpn_Contour(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Contour(void); - - virtual void mainloop(void) = 0; - -protected: - // Set up message handlers, etc. - void init_hid(void); - void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - static int VRPN_CALLBACK on_connect(void *thisPtr, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM p); - - virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer) = 0; - struct timeval _timestamp; - vrpn_HidAcceptor *_filter; - - // No actual types to register, derived classes will be buttons, analogs, and/or dials - int register_types(void) { return 0; } -}; - -class vrpn_Contour_ShuttleXpress: protected vrpn_Contour, public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Dial { -public: - vrpn_Contour_ShuttleXpress(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Contour_ShuttleXpress(void) {}; - - virtual void mainloop(void); - -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); - - // Previous dial value, used to determine delta to send when it changes. - vrpn_uint8 _lastDial; -}; - -// end of VRPN_USE_HID -#else -class VRPN_API vrpn_Contour; -class VRPN_API vrpn_Contour_ShuttleXpress; -#endif diff --git a/src/vrpn/vrpn_DevInput.C b/src/vrpn/vrpn_DevInput.C deleted file mode 100644 index 2fba280ff86b737b1969ff98e86f961fc9d13812..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_DevInput.C +++ /dev/null @@ -1,244 +0,0 @@ -/* file: vrpn_DevInput.cpp - * author: Mike Weiblen mew@mew.cx 2004-01-14 - * copyright: (C) 2003,2004 Michael Weiblen - * license: Released to the Public Domain. - * depends: gpm 1.19.6, VRPN 06_04 - * tested on: Linux w/ gcc 2.95.4 - * references: http://mew.cx/ http://vrpn.org/ - * http://linux.schottelius.org/gpm/ -*/ - -#include "vrpn_DevInput.h" - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#ifdef VRPN_USE_DEV_INPUT -#include <sys/select.h> // for select, FD_ISSET, FD_SET, etc -#include <vrpn_Shared.h> // for vrpn_gettimeofday -#include <unistd.h> // for close, read -#include <utility> // for pair -#include <fcntl.h> // for open, O_RDONLY -#include <linux/input.h> // for input_event, ABS_MAX, etc -#include <errno.h> // for errno, EACCES, ENOENT -#include <string.h> // for strcmp, NULL, strerror -#include <sys/ioctl.h> // for ioctl -#include <iostream> // for operator<<, ostringstream, etc -#include <map> // for map, _Rb_tree_iterator, etc -#include <string> // for string, operator+, etc -#include <sstream> - -#define REPORT_ERROR(msg) { send_text_message(msg, timestamp, vrpn_TEXT_ERROR); } - -static const std::string EMPTY_STRING(""); - -static const std::string &getDeviceNodes(const std::string &device_name) -{ - std::map<std::string, std::string> s_devicesNodes; - - bool permission_missing = false; - unsigned int id = 0; - while (1) { - std::ostringstream oss; - oss << "/dev/input/event" << id; - - int fd = open(oss.str().c_str(), O_RDONLY); - if(fd >= 0){ - char name[512]; - if(ioctl(fd, EVIOCGNAME(sizeof(name)), name) >= 0) { - s_devicesNodes[name] = oss.str(); - } - - close(fd); - } else { - if (errno == ENOENT) break; - if (errno == EACCES) permission_missing = true; - } - errno = 0; - id++; - } - if (permission_missing) { - std::cout << "vrpn_DevInput device scan warning : permission denied for some nodes !" << std::endl; - } - - std::map<std::string, std::string>::iterator node_name = s_devicesNodes.find(device_name); - if (node_name != s_devicesNodes.end()) { - return node_name->second; - } - - return EMPTY_STRING; -} - -/////////////////////////////////////////////////////////////////////////// - -vrpn_DevInput::vrpn_DevInput( const char* name, vrpn_Connection * cxn, const char *device_name, const char * type, int int_param ) - : vrpn_Analog( name, cxn ) - , vrpn_Button_Filter( name, cxn ) - , d_fileDescriptor(-1) // None found yet, device broken. -{ - int i; - - if (strcmp(type, "keyboard") == 0) { - d_type = DEVICE_KEYBOARD; - } else if (strcmp(type, "absolute") == 0) { - d_type = DEVICE_MOUSE_ABSOLUTE; - } else if (strcmp(type, "relative") == 0) { - d_type = DEVICE_MOUSE_RELATIVE; - } else { - REPORT_ERROR("Third parameter must be keyboard, absolute or relative"); - return; - } - - vrpn_Button_Filter::num_buttons = 0; - vrpn_Analog::num_channel = 0; - - switch (d_type) { - case DEVICE_KEYBOARD: - if ((int_param < 1) || (int_param >= vrpn_BUTTON_MAX_BUTTONS)) { - REPORT_ERROR("In case of keyboard, the value must be between 1 and 256"); - return; - } - vrpn_Button_Filter::num_buttons = int_param; - break; - case DEVICE_MOUSE_ABSOLUTE: - vrpn_Analog::num_channel = REL_MAX; - vrpn_Button_Filter::num_buttons = 0x50; - d_absolute_min = 0; - d_absolute_range = int_param; - break; - case DEVICE_MOUSE_RELATIVE: - vrpn_Analog::num_channel = ABS_MAX; - vrpn_Button_Filter::num_buttons = 0x50; - break; - }; - - // initialize the vrpn_Analog - for( i = 0; i < vrpn_Analog::num_channel; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } - - // initialize the vrpn_Button_Filter - for( i = 0; i < vrpn_Button_Filter::num_buttons; i++) { - vrpn_Button_Filter::buttons[i] = vrpn_Button_Filter::lastbuttons[i] = 0; - } - - std::string node = getDeviceNodes(device_name); - if (node.length() == 0) { - char msg[4096]; - sprintf(msg, "vrpn_DevInput::vrpn_DevInput(): Could not get device %s", - device_name); - REPORT_ERROR(msg); - return; - } - - d_fileDescriptor = open(node.c_str(), O_RDONLY); - if(d_fileDescriptor < 0){ - char msg[4096]; - sprintf(msg, "vrpn_DevInput::vrpn_DevInput(): Could not open device %s (%s)", - device_name, strerror(errno)); - REPORT_ERROR(msg); - return; - } -} - -/////////////////////////////////////////////////////////////////////////// - -vrpn_DevInput::~vrpn_DevInput() -{ - if (d_fileDescriptor >= 0) { - close(d_fileDescriptor); - } - d_fileDescriptor = -1; -} - -/////////////////////////////////////////////////////////////////////////// - -void vrpn_DevInput::mainloop() -{ - get_report(); - - server_mainloop(); - - report_changes(); -} - -/////////////////////////////////////////////////////////////////////////// - -int vrpn_DevInput::get_report() -{ - fd_set readset; - - if (d_fileDescriptor < 0) { - return 0; - } - - FD_ZERO( &readset ); - FD_SET( d_fileDescriptor, &readset ); - struct timeval timeout = { 0, 0 }; - select( d_fileDescriptor+1, &readset, NULL, NULL, &timeout ); - - vrpn_gettimeofday( ×tamp, NULL ); - - if( ! FD_ISSET( d_fileDescriptor, &readset ) ) - return 0; - - struct input_event event; - if (read(d_fileDescriptor, &event, sizeof(event)) < sizeof(event)) { - return 0; - } - - switch (event.type) { - case EV_KEY: { - int button_number = event.code; - if ((d_type == DEVICE_MOUSE_RELATIVE) || (d_type == DEVICE_MOUSE_ABSOLUTE)) { - button_number -= BTN_MOUSE; - } - if ((button_number >= 0) && (button_number < vrpn_Button_Filter::num_buttons)) { - buttons[button_number] = event.value; - } - } break; - case EV_REL: { - int channel_number = event.code; - if ((channel_number >= 0) && (channel_number < vrpn_Analog::num_channel)) { - for (unsigned int i = 0 ; i < vrpn_Analog::num_channel ; i++) { - vrpn_Analog::last[i] = 0; - } - vrpn_Analog::channel[channel_number] = (vrpn_float64)event.value; - } - } break; - case EV_ABS: - int channel_number = event.code; - if ((channel_number >= 0) && (channel_number < vrpn_Analog::num_channel)) { - vrpn_float64 value = ((vrpn_float64)event.value - d_absolute_min) / d_absolute_range; - vrpn_Analog::channel[channel_number] = value; - } - break; - }; - - return 1; -} - -/////////////////////////////////////////////////////////////////////////// - -void vrpn_DevInput::report_changes( vrpn_uint32 class_of_service ) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button_Filter::timestamp = timestamp; - - vrpn_Analog::report_changes( class_of_service ); - vrpn_Button_Filter::report_changes(); -} - -/////////////////////////////////////////////////////////////////////////// - -void vrpn_DevInput::report( vrpn_uint32 class_of_service ) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button_Filter::timestamp = timestamp; - - vrpn_Analog::report( class_of_service ); - vrpn_Button_Filter::report_changes(); -} - -#endif - -/*EOF*/ diff --git a/src/vrpn/vrpn_DevInput.h b/src/vrpn/vrpn_DevInput.h deleted file mode 100644 index d075d2ba7097c67942436881faca808418754999..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_DevInput.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef VRPN_DEV_INPUT_H -#define VRPN_DEV_INPUT_H - -/////////////////////////////////////////////////////////////////////////// -// This file contains a distillation of the various DevInput classes that had -// been spread throughout VRPN. The interfaces have been rationalized, so -// that they are the same between operating systems and are factored into -// independent interfaces. -/////////////////////////////////////////////////////////////////////////// - -/* file: vrpn_DevInput.h - * author: Damien Touraine vrpn-python@limsi.fr 2012-06-20 - * copyright: (C) 2012 Damien TOUraine - * license: Released to the Public Domain. - * depends: VRPN 07_30 - * tested on: Linux w/ gcc 4.6.1 - * references: -*/ - -/////////////////////////////////////////////////////////////////////////// -// vrpn_DevInput is a VRPN server class to publish events from the PC's input. -// It provides a many channels or buttons provided by mice, keyboards and whatever HID device that can be connected found in the /dev/input/event*. -// -// vrpn_DevInput makes it easy to use the diverse array of commodity input -// devices that are managed by Linux through /proc/bus/input/devices -// -// vrpn_DevInput can be run from X-window term or console. -// -// Beware that keyboards are not mapped in locale setting (ie. regional keyboards) -/////////////////////////////////////////////////////////////////////////// - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API, etc -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_float64, vrpn_uint32 - -#ifdef VRPN_USE_DEV_INPUT - -class VRPN_API vrpn_DevInput : - public vrpn_Analog, - public vrpn_Button_Filter -{ - enum DEVICE_TYPE { DEVICE_KEYBOARD, DEVICE_MOUSE_RELATIVE, DEVICE_MOUSE_ABSOLUTE } d_type; - -public: - vrpn_DevInput( const char* name, vrpn_Connection* cxn, const char *device, const char *type, int mouse_length ); - virtual ~vrpn_DevInput(); - - virtual void mainloop(); - -protected: // methods - /// Try to read reports from the device. - /// Returns 1 if msg received, or 0 if none received. - virtual int get_report(); - - /// send report iff changed - virtual void report_changes( vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY ); - - /// send report whether or not changed - virtual void report( vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY ); - -protected: // data - struct timeval timestamp; ///< time of last report from device - -private: // disable unwanted default methods - vrpn_DevInput(); - vrpn_DevInput(const vrpn_DevInput&); - const vrpn_DevInput& operator=(const vrpn_DevInput&); - - private: - int d_fileDescriptor; - vrpn_float64 d_absolute_min; - vrpn_float64 d_absolute_range; -}; - -#endif - -#endif diff --git a/src/vrpn/vrpn_Dial.C b/src/vrpn/vrpn_Dial.C deleted file mode 100644 index d9861e38f81aeada190016012034783dd1a45c7d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Dial.C +++ /dev/null @@ -1,220 +0,0 @@ -#include <stdio.h> // for fprintf, stderr, NULL - -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_Dial.h" - -//#define VERBOSE - -vrpn_Dial::vrpn_Dial(const char *name, vrpn_Connection *c) - : vrpn_BaseClass(name, c) -{ - vrpn_BaseClass::init(); - - num_dials = 0; - // Set the time to 0 just to have something there. - timestamp.tv_usec = timestamp.tv_sec = 0; -} - -int vrpn_Dial::register_types(void) -{ - if (d_connection == NULL) { - return 0; - } - change_m_id = d_connection->register_message_type("vrpn_Dial update"); - if (change_m_id == -1) { - fprintf(stderr, "vrpn_Dial: Can't register type IDs\n"); - d_connection = NULL; - } - return 0; -} - -vrpn_int32 vrpn_Dial::encode_to(char *buf, vrpn_int32 buflen, vrpn_int32 dial, - vrpn_float64 delta) -{ - vrpn_int32 buflensofar = buflen; - - // Message includes: vrpn_int32 dialNum, vrpn_float64 delta - // We pack them with the delta first, so that everything is aligned - // on the proper boundary. - - if (vrpn_buffer(&buf, &buflensofar, delta)) { - fprintf(stderr, "vrpn_Dial::encode_to: Can't buffer delta\n"); - return -1; - } - if (vrpn_buffer(&buf, &buflensofar, dial)) { - fprintf(stderr, "vrpn_Dial::encode_to: Can't buffer dial\n"); - return -1; - } - return sizeof(vrpn_float64) + sizeof(vrpn_int32); -} - -// This will report any changes that have appeared in the dial values, -// and then clear the dials back to 0. It only sends dials that have -// changed (nonzero values) -void vrpn_Dial::report_changes(void) -{ - - char msgbuf[1000]; - vrpn_int32 i; - vrpn_int32 len; - - if (d_connection) { - for (i = 0; i < num_dials; i++) { - if (dials[i] != 0) { - len = encode_to(msgbuf, sizeof(msgbuf), i, dials[i]); - if (d_connection->pack_message(len, timestamp, change_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, - "vrpn_Dial: can't write message: tossing\n"); - } - dials[i] = 0; // We've reported it the change. - } - } - } -} - -// This will report the dials whether they have changed or not; this -// will result in some 0 dial values being sent. Normally, code will -// use the report_changes method to avoid flooding the system with -// un-needed messages. -// It then clears the dials back to 0. -void vrpn_Dial::report(void) -{ - - char msgbuf[1000]; - vrpn_int32 i; - vrpn_int32 len; - - if (d_connection) { - for (i = 0; i < num_dials; i++) { - len = encode_to(msgbuf, sizeof(msgbuf), i, dials[i]); - if (d_connection->pack_message(len, timestamp, change_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Dial: can't write message: tossing\n"); - } - dials[i] = 0; // We've reported it the change. - } - } -} - -// ************* EXAMPLE SERVER ROUTINES **************************** - -vrpn_Dial_Example_Server::vrpn_Dial_Example_Server(const char *name, - vrpn_Connection *c, - vrpn_int32 numdials, - vrpn_float64 spin_rate, - vrpn_float64 update_rate) - : vrpn_Dial(name, c) - , // Construct the base class, which registers message/sender - _spin_rate(spin_rate) - , // Set the rate at which the dials will spin - _update_rate(update_rate) // Set the rate at which to generate reports -{ - // Make sure we asked for a legal number of dials - if (num_dials > vrpn_DIAL_MAX) { - fprintf(stderr, "vrpn_Dial_Example_Server: Only using %d dials\n", - vrpn_DIAL_MAX); - num_dials = vrpn_DIAL_MAX; - } - else { - num_dials = numdials; - } - - // IN A REAL SERVER, open the device that will service the dials here -} - -void vrpn_Dial_Example_Server::mainloop() -{ - struct timeval current_time; - int i; - - // Call the generic server mainloop, since we are a server - server_mainloop(); - - // See if its time to generate a new report - // IN A REAL SERVER, this check would not be done; although the - // time of the report would be updated to the current time so - // that the correct timestamp would be issued on the report. - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, timestamp) >= - 1000000.0 / _update_rate) { - - // Update the time - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - // Update the values for the dials, to say that each one has - // moved the appropriate rotation (spin rate is revolutions per - // second, update rate is report/second, the quotient is the number - // of revolutions since the last report). When the changes are - // reported, these values are set back to zero. - - // THIS CODE WILL BE REPLACED by the user code that tells how - // many revolutions each dial has changed since the last report. - for (i = 0; i < num_dials; i++) { - dials[i] = _spin_rate / _update_rate; - } - - // Send reports. Stays the same in a real server. - report_changes(); - } -} - -// ************* CLIENT ROUTINES **************************** - -vrpn_Dial_Remote::vrpn_Dial_Remote(const char *name, vrpn_Connection *c) - : vrpn_Dial(name, c) -{ - vrpn_int32 i; - - // Register a handler for the change callback from this device, - // if we got a connection. - if (d_connection) { - if (register_autodeleted_handler(change_m_id, handle_change_message, - this, d_sender_id)) { - fprintf(stderr, "vrpn_Dial_Remote: can't register handler\n"); - d_connection = NULL; - } - } - else { - fprintf(stderr, "vrpn_Dial_Remote: Can't get connection!\n"); - } - - // At the start, as far as the client knows, the device could have - // max channels -- the number of channels is specified in each - // message. - num_dials = vrpn_DIAL_MAX; - for (i = 0; i < vrpn_DIAL_MAX; i++) { - dials[i] = 0.0; - } - vrpn_gettimeofday(×tamp, NULL); -} - -vrpn_Dial_Remote::~vrpn_Dial_Remote() {} - -void vrpn_Dial_Remote::mainloop() -{ - client_mainloop(); - if (d_connection) { - d_connection->mainloop(); - } -} - -int vrpn_Dial_Remote::handle_change_message(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Dial_Remote *me = (vrpn_Dial_Remote *)userdata; - vrpn_DIALCB cp; - const char *bufptr = p.buffer; - - cp.msg_time = p.msg_time; - vrpn_unbuffer(&bufptr, &cp.change); - vrpn_unbuffer(&bufptr, &cp.dial); - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->d_callback_list.call_handlers(cp); - - return 0; -} diff --git a/src/vrpn/vrpn_Dial.h b/src/vrpn/vrpn_Dial.h deleted file mode 100644 index 829d67368e2d55b3d2e4375aee3200dd3fbd135c..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Dial.h +++ /dev/null @@ -1,116 +0,0 @@ -// vrpn_Dial.h -// This implements a Dial class. A dial is an object that spins, -// possibly without bound. It returns the fraction of a revolution that -// it has turned as its message type. - -#ifndef VRPN_DIAL_H -#define VRPN_DIAL_H - -const int vrpn_DIAL_MAX = 128; - -#include <stddef.h> // for NULL - -#include "vrpn_BaseClass.h" // for vrpn_Callback_List, etc -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_float64, vrpn_int32 - -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -class VRPN_API vrpn_Dial : public vrpn_BaseClass { -public: - vrpn_Dial(const char *name, vrpn_Connection *c = NULL); - -protected: - vrpn_float64 dials[vrpn_DIAL_MAX]; - vrpn_int32 num_dials; - struct timeval timestamp; - vrpn_int32 change_m_id; // change message id - - virtual int register_types(void); - virtual vrpn_int32 encode_to(char *buf, vrpn_int32 buflen, vrpn_int32 dial, - vrpn_float64 delta); - virtual void report_changes(void); // send report iff changed - virtual void report(void); // send report -}; - -//---------------------------------------------------------- -// Example server for an array of dials -// This will generate an array of dials that all spin at the same -// rate (revolutions/second), and which send reports at a different rate -// (updates/second). A real server would send reports whenever it saw -// dials changing, and would not have the spin_rate or update_rate parameters. -// This server can be used for testing to make sure a client is -// working correctly, and to ensure that a connection to a remote server -// is working (by running the example server with the name of the device that -// the real server would use). - -class VRPN_API vrpn_Dial_Example_Server : public vrpn_Dial { -public: - vrpn_Dial_Example_Server(const char *name, vrpn_Connection *c, - vrpn_int32 numdials = 1, - vrpn_float64 spin_rate = 1.0, - vrpn_float64 update_rate = 10.0); - virtual void mainloop(); - -protected: - vrpn_float64 _spin_rate; // The rate at which to spin (revolutions/sec) - vrpn_float64 _update_rate; // The rate at which to update (reports/sec) - // The dials[] array within the parent is used for the values - // The num_dials within the parent is used - // The timestamp field within the parent structure is used for timing - // The report_changes() or report() functions within the parent are used -}; - -//---------------------------------------------------------- -//************** Users deal with the following ************* - -// User routine to handle a change in dial values. This is called when -// the dial callback is called (when a message from its counterpart -// across the connetion arrives). - -typedef struct _vrpn_DIALCB { - struct timeval msg_time; // Timestamp when change happened - vrpn_int32 dial; // which dial changed - vrpn_float64 change; // Fraction of a revolution it changed -} vrpn_DIALCB; - -typedef void(VRPN_CALLBACK *vrpn_DIALCHANGEHANDLER)(void *userdata, - const vrpn_DIALCB info); - -// Open a dial device that is on the other end of a connection -// and handle updates from it. This is the type of device -// that user code will deal with. - -class VRPN_API vrpn_Dial_Remote : public vrpn_Dial { -public: - // The name of the device to connect to. - // Optional argument to be used when the Remote MUST listen on - // a connection that is already open. - vrpn_Dial_Remote(const char *name, vrpn_Connection *c = NULL); - ~vrpn_Dial_Remote(); - - // This routine calls the mainloop of the connection it's on - virtual void mainloop(); - - // (un)Register a callback handler to handle dial updates - virtual int register_change_handler(void *userdata, - vrpn_DIALCHANGEHANDLER handler) - { - return d_callback_list.register_handler(userdata, handler); - }; - virtual int unregister_change_handler(void *userdata, - vrpn_DIALCHANGEHANDLER handler) - { - return d_callback_list.unregister_handler(userdata, handler); - } - -protected: - vrpn_Callback_List<vrpn_DIALCB> d_callback_list; - - static int VRPN_CALLBACK - handle_change_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -#endif diff --git a/src/vrpn/vrpn_DirectXFFJoystick.C b/src/vrpn/vrpn_DirectXFFJoystick.C deleted file mode 100644 index 0ed9f31df4aa8990fd21334be6f0efb4ac2b70b2..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_DirectXFFJoystick.C +++ /dev/null @@ -1,707 +0,0 @@ -#include "vrpn_DirectXFFJoystick.h" -#if defined(_WIN32) && defined(VRPN_USE_DIRECTINPUT) -#include <math.h> -#include <algorithm> // for min -using std::min; -// vrpn_DirectXFFJoystick.C -// This is a driver for joysticks being used through the -// DirectX interface, both for input and for force feedback. -// The driver portions of this code are based on the Microsoft -// DirectInput example code from the DirectX SDK. - -#undef DEBUG -#undef VERBOSE - -// Defines the modes in which the box can find itself. -const int STATUS_BROKEN = -1; // Broken joystick -const int STATUS_READING = 1; // Looking for a report - -#define MAX_TIME_INTERVAL (2000000) // max time to try and reacquire - -// This creates a vrpn_CerealBox and sets it to reset mode. It opens -// the serial device using the code in the vrpn_Serial_Analog constructor. -// The box seems to autodetect the baud rate when the "T" command is sent -// to it. -vrpn_DirectXFFJoystick::vrpn_DirectXFFJoystick (const char * name, vrpn_Connection * c, - double readRate, double forceRate) : - vrpn_Analog(name, c), - vrpn_Button_Filter(name, c), - vrpn_ForceDeviceServer(name, c), - _read_rate(readRate), - _force_rate(forceRate), - _DirectInput(NULL), - _Joystick(NULL), - _ForceEffect(NULL), - _numchannels(min(12,vrpn_CHANNEL_MAX)), // Maximum available - _numbuttons(min(128,vrpn_BUTTON_MAX_BUTTONS)), // Maximum available - _numforceaxes(0) // Filles in later. -{ - // Never yet sent forces. - _forcetime.tv_sec = 0; - _forcetime.tv_usec = 0; - - // Never sent a report - _last_report.tv_sec = 0; - _last_report.tv_usec = 0; - - // No nonzero previous forces. - _fx_1 = _fy_1 = 0.0; - _fx_2 = _fy_2 = 0.0; - - // In case we exit early for some reason. - _status = STATUS_BROKEN; - - // Set the parameters in the parent classes - vrpn_Button::num_buttons = _numbuttons; - vrpn_Analog::num_channel = _numchannels; - if (_numchannels < 12) { - fprintf(stderr,"vrpn_DirectXFFJoystick::vrpn_DirectXFFJoystick(): Not enough analog channels!\n"); - _hWnd = NULL; - return; - } - - // Set the status of the buttons and analogs to 0 to start - clear_values(); - - // We need a non-console window handle to give to the function if we are - // asking for exclusive access (I don't know why, but we do). - _hWnd = CreateWindow("STATIC", "JoystickWindow", WS_ICONIC, 0,0, 10,10, NULL, NULL, NULL, NULL); - - // Initialize DirectInput and set the axes to return numbers in the range - // -1000 to 1000. We make the same mapping for analogs and sliders, so we - // don't care how many this particular joystick has. This enables users of - // joysticks to keep the same mappings (but does not pass on the list of - // what is actually intalled, unfortunately). - // If we're using a forceDevice, then set it up as well. -#ifdef DEBUG - printf("vrpn_DirectXFFJoystick::vrpn_DirectXFFJoystick(): Window handle %ld\n", _hWnd); -#endif - if( FAILED( InitDirectJoystick() ) ) { - fprintf(stderr,"vrpn_DirectXFFJoystick::vrpn_DirectXFFJoystick(): Failed to open direct joystick\n"); - _hWnd = NULL; - return; - } - - // Zero the forces on the device, if we have one. - if (_force_rate > 0) { - _fX = _fY = 0; - send_normalized_force(0,0); - } - - // Register an autodeleted handler on the "last connection dropped" system message - // and have it call a routine that zeroes the forces when it is called. - register_autodeleted_handler(d_connection->register_message_type(vrpn_dropped_last_connection), handle_last_connection_dropped, this); - - // Register handlers for the force-feedback messages coming from the remote object. - // XXX Eventually, fill out this list. For now, we have only planes. - if (_force_rate > 0) { - if (register_autodeleted_handler(plane_message_id, - handle_plane_change_message, this, vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr,"vrpn_DirectXFFJoystick:can't register plane handler\n"); - return; - } - if (register_autodeleted_handler(forcefield_message_id, - handle_forcefield_change_message, this, vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr,"vrpn_DirectXFFJoystick:can't register force handler\n"); - return; - } - } - - // Set the mode to reading. Set time to zero, so we'll try to read - _status = STATUS_READING; - vrpn_gettimeofday(&_timestamp, NULL); -} - -vrpn_DirectXFFJoystick::~vrpn_DirectXFFJoystick() -{ - // Remove the ForceEffect if there is one - if ( _ForceEffect ) { - send_normalized_force(0,0); - _ForceEffect->Release(); - _ForceEffect = NULL; - } - - // Unacquire the device one last time just in case - // the app tried to exit while the device is still acquired. - if( _Joystick ) { - _Joystick->Unacquire(); - _Joystick->Release(); - _Joystick = NULL; - } - - // Release any DirectInput objects. - if ( _DirectInput ) { - _DirectInput->Release(); - _DirectInput = NULL; - } -} - -HRESULT vrpn_DirectXFFJoystick::InitDirectJoystick( void ) -{ - HRESULT hr; - - // Register with the DirectInput subsystem and get a pointer - // to a IDirectInput interface we can use. - // Create a DInput object - if( FAILED( hr = DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION, - IID_IDirectInput8, (VOID**)&_DirectInput, NULL ) ) ) { - fprintf(stderr, "vrpn_DirectXFFJoystick::InitDirectJoystick(): Cannot open DirectInput\n"); - _status = STATUS_BROKEN; - return hr; - } - - // Look for a simple joystick we can use for this sample program; if we want force feedback, - // then also look for one that has this feature. - long device_type = DIEDFL_ATTACHEDONLY; - if (_force_rate > 0) { device_type |= DIEDFL_FORCEFEEDBACK; } - if( FAILED( hr = _DirectInput->EnumDevices( DI8DEVCLASS_GAMECTRL, - EnumJoysticksCallback, - this, device_type ) ) ) { - fprintf(stderr, "vrpn_DirectXFFJoystick::InitDirectJoystick(): Cannot Enumerate devices\n"); - _status = STATUS_BROKEN; - return hr; - } - - // Make sure we got a joystick of the type we wanted - if( NULL == _Joystick ) { - fprintf(stderr, "vrpn_DirectXFFJoystick::InitDirectJoystick(): No joystick found\n"); - _status = STATUS_BROKEN; - return E_FAIL; - } - - // Set the data format to "simple joystick" - a predefined data format - // - // A data format specifies which controls on a device we are interested in, - // and how they should be reported. This tells DInput that we will be - // passing a DIJOYSTATE2 structure to IDirectInputDevice::GetDeviceState(). - if( FAILED( hr = _Joystick->SetDataFormat( &c_dfDIJoystick2 ) ) ) { - fprintf(stderr, "vrpn_DirectXFFJoystick::InitDirectJoystick(): Cannot set data format\n"); - _status = STATUS_BROKEN; - return hr; - } - - // Set the cooperative level to let DInput know how this device should - // interact with the system and with other DInput applications. - // Exclusive access is required in order to perform force feedback. - // Exclusive access is also required to keep other applications (like VMD) - // from opening the same joystick, so we'll use it all the time. - long access_type = DISCL_EXCLUSIVE | DISCL_BACKGROUND; - if( FAILED( hr = _Joystick->SetCooperativeLevel( _hWnd, access_type) ) ) { - fprintf(stderr, "vrpn_DirectXFFJoystick::InitDirectJoystick(): Cannot set cooperative level\n"); - _status = STATUS_BROKEN; - return hr; - } - - // Enumerate the joystick objects. The callback function enabled user - // interface elements for objects that are found, and sets the min/max - // values property for discovered axes. - if( FAILED( hr = _Joystick->EnumObjects( EnumObjectsCallback, this, DIDFT_ALL ) ) ) { - fprintf(stderr, "vrpn_DirectXFFJoystick::InitDirectJoystick(): Cannot enumerate objects\n"); - _status = STATUS_BROKEN; - return hr; - } - if (_force_rate > 0) { - if (_numforceaxes != 2) { - fprintf(stderr, "vrpn_DirectXFFJoystick::InitDirectJoystick(): Not two force axes, disabling forces\n"); - _force_rate = 0; - } else { -#ifdef DEBUG - printf("vrpn_DirectXFFJoystick::InitDirectJoystick(): found %d force axes\n", _numforceaxes); -#endif - // Since we will be playing force feedback effects, we should disable the - // auto-centering spring. - DIPROPDWORD dipdw; - dipdw.diph.dwSize = sizeof(DIPROPDWORD); - dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); - dipdw.diph.dwObj = 0; - dipdw.diph.dwHow = DIPH_DEVICE; - dipdw.dwData = FALSE; - -#ifdef DEBUG - printf("vrpn_DirectXFFJoystick::InitDirectJoystick(): disabling autocenter\n"); -#endif - if( FAILED( hr = _Joystick->SetProperty( DIPROP_AUTOCENTER, &dipdw.diph ) ) ) { - fprintf(stderr, "vrpn_DirectXFFJoystick::InitDirectJoystick(): Can't disable autocenter, disabling forces\n"); - _force_rate = 0; - } else { - // This application needs only one effect: Applying raw forces. - DWORD rgdwAxes[2] = { DIJOFS_X, DIJOFS_Y }; - LONG rglDirection[2] = { 0, 0 }; - DICONSTANTFORCE cf = { 0 }; - -/* - DIENVELOPE diEnvelope; // envelope - diEnvelope.dwSize = sizeof(DIENVELOPE); - diEnvelope.dwAttackLevel = 0; - diEnvelope.dwAttackTime = (DWORD)(0.005 * DI_SECONDS); - diEnvelope.dwFadeLevel = 0; - diEnvelope.dwFadeTime = (DWORD)(0.005 * DI_SECONDS); -*/ - - DIEFFECT eff; - ZeroMemory( &eff, sizeof(eff) ); - eff.dwSize = sizeof(DIEFFECT); - eff.dwFlags = DIEFF_CARTESIAN | DIEFF_OBJECTOFFSETS; -// eff.dwDuration = INFINITE; - eff.dwDuration = (DWORD)(0.02 * DI_SECONDS); - eff.dwSamplePeriod = 0; - eff.dwGain = DI_FFNOMINALMAX; - eff.dwTriggerButton = DIEB_NOTRIGGER; - eff.dwTriggerRepeatInterval = 0; - eff.cAxes = _numforceaxes; - eff.rgdwAxes = rgdwAxes; - eff.rglDirection = rglDirection; -// eff.lpEnvelope = &diEnvelope; - eff.lpEnvelope = 0; - eff.cbTypeSpecificParams = sizeof(DICONSTANTFORCE); - eff.lpvTypeSpecificParams = &cf; - eff.dwStartDelay = 0; - - // Create the prepared effect - if( FAILED( hr = _Joystick->CreateEffect( GUID_ConstantForce, &eff, &_ForceEffect, NULL ) ) || - (_ForceEffect == NULL) ) { - fprintf(stderr,"vrpn_DirectXFFJoystick::InitDirectJoystick(): Can't create force effect, disabling forces\n"); - _force_rate = 0; - } - } - } - } - - // Acquire the joystick - if( FAILED( hr = _Joystick->Acquire() ) ) { - char *reason; - switch (hr) { - case DIERR_INVALIDPARAM: - reason = "Invalid parameter"; - break; - case DIERR_NOTINITIALIZED: - reason = "Not Initialized"; - break; - case DIERR_OTHERAPPHASPRIO: - reason = "Another application has priority"; - break; - default: - reason = "Unknown"; - } - fprintf(stderr, "vrpn_DirectXFFJoystick::InitDirectJoystick(): Cannot acquire joystick because %s\n", reason); - _status = STATUS_BROKEN; - return hr; - } - return S_OK; -} - -//----------------------------------------------------------------------------- -// Desc: Called once for each enumerated joystick. If we find one, create a -// device interface on it so we can play with it, then tell that we -// don't want to hear about any more. - -BOOL CALLBACK vrpn_DirectXFFJoystick::EnumJoysticksCallback( const DIDEVICEINSTANCE* pdidInstance, - VOID* selfPtr ) -{ - vrpn_DirectXFFJoystick *me = (vrpn_DirectXFFJoystick*)(selfPtr); - HRESULT hr; - -#ifdef DEBUG - printf("vrpn_DirectXFFJoystick::EnumJoysticksCallback(): Found joystick\n"); -#endif - - // Obtain an interface to the enumerated joystick. - hr = me->_DirectInput->CreateDevice( pdidInstance->guidInstance, &me->_Joystick, NULL ); - - // If it failed, then we can't use this joystick. (Maybe the user unplugged - // it while we were in the middle of enumerating it.) - if( FAILED(hr) ) return DIENUM_CONTINUE; - - // Stop enumeration. Note: we're just taking the first joystick we get. You - // could store all the enumerated joysticks and let the user pick. - return DIENUM_STOP; -} - -//----------------------------------------------------------------------------- -// Desc: Callback function for enumerating objects (axes, buttons, POVs) on a -// joystick. This function records how many there are and scales axes -// min/max values. -//----------------------------------------------------------------------------- -BOOL CALLBACK vrpn_DirectXFFJoystick::EnumObjectsCallback( const DIDEVICEOBJECTINSTANCE* pdidoi, - VOID* selfPtr ) -{ - vrpn_DirectXFFJoystick *me = (vrpn_DirectXFFJoystick*)(selfPtr); - -#ifdef DEBUG - printf("vrpn_DirectXFFJoystick::EnumObjectsCallback(): Found type %d object\n", pdidoi->dwType); -#endif - // For axes that are returned, set the DIPROP_RANGE property for the - // enumerated axis in order to scale min/max values to -1000 to 1000. - if (pdidoi->dwType & DIDFT_AXIS) { - DIPROPRANGE diprg; - diprg.diph.dwSize = sizeof(DIPROPRANGE); - diprg.diph.dwHeaderSize = sizeof(DIPROPHEADER); - diprg.diph.dwHow = DIPH_BYID; - diprg.diph.dwObj = pdidoi->dwType; // Specify the enumerated axis - diprg.lMin = -1000; - diprg.lMax = +1000; - - // Set the range for the axis - if( FAILED( me->_Joystick->SetProperty( DIPROP_RANGE, &diprg.diph ) ) ) - return DIENUM_STOP; - } - - // For each force-feedback actuator returned, add one to the count. - if (pdidoi->dwFlags & DIDOI_FFACTUATOR) { - me->_numforceaxes++; - } - - return DIENUM_CONTINUE; -} - - -void vrpn_DirectXFFJoystick::clear_values(void) -{ - int i; - - for (i = 0; i < _numbuttons; i++) { - vrpn_Button::buttons[i] = vrpn_Button::lastbuttons[i] = 0; - } - for (i = 0; i < _numchannels; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } -} - -// This function will send a report if any of the analog or button values -// have changed. This reads from the joystick _read_rate times per second, returns -// right away at other times. -// Returns 0 on success, -1 (and sets _status) on failure. - -int vrpn_DirectXFFJoystick::get_report(void) -{ - HRESULT hr; - - // If it has been long enough, update the force sent to the user. - { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - if (vrpn_TimevalDuration(now, _forcetime) >= 1000000.0 / _force_rate) { - send_normalized_force(_fX, _fY); - _forcetime = now; - } - } - - // If it is not time for the next read, just return - struct timeval reporttime; - vrpn_gettimeofday(&reporttime, NULL); - if (vrpn_TimevalDuration(reporttime, _timestamp) < 1000000.0 / _read_rate) { - return 0; - } -#ifdef VERBOSE - printf(" now: %ld:%ld, last %ld:%ld\n", reporttime.tv_sec, reporttime.tv_usec, - _timestamp.tv_sec, static_cast<long>(_timestamp.tv_usec)); - printf(" DirectX joystick: Getting report\n"); -#endif - - // Poll the joystick. If we can't poll it then try to reacquire - // until that times out. - hr = _Joystick->Poll(); - if( FAILED(hr) ) { - // DInput is telling us that the input stream has been - // interrupted. We aren't tracking any state between polls, so - // we don't have any special reset that needs to be done. We - // just re-acquire and try again. - hr = _Joystick->Acquire(); - if ( hr == DIERR_INPUTLOST ) { - struct timeval resettime; - vrpn_gettimeofday(&resettime, NULL); - while ( ( hr == DIERR_INPUTLOST) && (vrpn_TimevalDuration(resettime, reporttime) <= MAX_TIME_INTERVAL) ) { - vrpn_gettimeofday(&resettime, NULL); - hr = _Joystick->Acquire(); - } - if (hr == DIERR_INPUTLOST) { - fprintf(stderr, "vrpn_DirectXFFJoystick::get_report::vrpn_DirectXFFJoystick::get_report(): Can't Acquire joystick\n"); - _status = STATUS_BROKEN; - return -1; - } - reporttime = resettime; - } - - // hr may be DIERR_OTHERAPPHASPRIO or other errors. This - // may occur when the app is minimized or in the process of - // switching, so just try again later - fprintf(stderr, "Error other than INPUTLOST\n"); - return 0; - } - - // Read the values from the joystick and put them into the internal structures. - // Map the analogs representing sliders and axes to the range (-1...1). - // Map the POVs to degrees by dividing by 100. - DIJOYSTATE2 js; // DInput joystick state - if( FAILED( hr = _Joystick->GetDeviceState( sizeof(DIJOYSTATE2), &js ) ) ) { - fprintf(stderr, "vrpn_DirectXFFJoystick::get_report(): Can't read joystick\n"); - _status = STATUS_BROKEN; - return -1; - } - channel[0] = js.lX / 1000.0; - channel[1] = js.lY / 1000.0; - channel[2] = js.lZ / 1000.0; - - channel[3] = js.lRx / 1000.0; - channel[4] = js.lRy / 1000.0; - channel[5] = js.lRz / 1000.0; - - channel[6] = js.rglSlider[0] / 1000.0; - channel[7] = js.rglSlider[1] / 1000.0; - - channel[8] = (long)js.rgdwPOV[0] / 100.0; - channel[9] = (long)js.rgdwPOV[1] / 100.0; - channel[10] = (long)js.rgdwPOV[2] / 100.0; - channel[11] = (long)js.rgdwPOV[3] / 100.0; - - int i; - for (i = 0; i < min(128,vrpn_BUTTON_MAX_BUTTONS); i++) { - buttons[i] = ( (js.rgbButtons[i] & 0x80) != 0); - } - - // Send the new values out over the connection. - _timestamp = reporttime; - report(); - return 0; -} - -void vrpn_DirectXFFJoystick::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_DirectXFFJoystick::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -// A force of 1 goes the the right in X and up in Y -void vrpn_DirectXFFJoystick::send_normalized_force(double fx, double fy) -{ - // Make sure we have force capability. If not, then set our status to - // broken. - if ( (_force_rate <= 0) || (_ForceEffect == NULL) ) { - send_text_message("Asked to send force when no force enabled", _timestamp, vrpn_TEXT_ERROR); - return; - } - - // Set the forces to match a right-handed coordinate system - fx *= -1; - - // If the total force vector is more than unit length, scale down by that - // length. - double len = sqrt(fx*fx + fy*fy); - if (len > 1) { - fx /= len; - fy /= len; - } - - // This version of the driver averages the last three force commands - // before setting the force. - - double fx_avg = (fx + _fx_1 + _fx_2 )/3.0; - double fy_avg = (fy + _fy_1 + _fy_2 )/3.0; - - // Convert the force from (-1..1) into the maximum range for each axis and then send it to - // the device. -/* INT xForce = (INT)(fx * DI_FFNOMINALMAX); */ -/* INT yForce = (INT)(fy * DI_FFNOMINALMAX); */ - - INT xForce = (INT)(fx_avg * DI_FFNOMINALMAX); - INT yForce = (INT)(fy_avg * DI_FFNOMINALMAX); - - _fx_2 = _fx_1; _fy_2 = _fy_1; - _fx_1 = fx; _fy_1 = fy; - - LONG rglDirection[2]; // Direction for the force (does not carry magnitude) - DICONSTANTFORCE cf; // Magnitude of the force - - rglDirection[0] = xForce; - rglDirection[1] = yForce; - cf.lMagnitude = (DWORD)(sqrt( (double)xForce * (double)xForce + - (double)yForce * (double)yForce )); - -/* - DIENVELOPE diEnvelope; // envelope - diEnvelope.dwSize = sizeof(DIENVELOPE); - diEnvelope.dwAttackLevel = 0; - diEnvelope.dwAttackTime = (DWORD)(0.005 * DI_SECONDS); - diEnvelope.dwFadeLevel = 0; - diEnvelope.dwFadeTime = (DWORD)(0.005 * DI_SECONDS); -*/ - - DIEFFECT eff; - ZeroMemory( &eff, sizeof(eff) ); - eff.dwSize = sizeof(DIEFFECT); - eff.dwFlags = DIEFF_CARTESIAN | DIEFF_OBJECTOFFSETS; - eff.cAxes = _numforceaxes; - eff.rglDirection = rglDirection; - eff.lpEnvelope = 0; -// eff.lpEnvelope = &diEnvelope; - eff.cbTypeSpecificParams = sizeof(DICONSTANTFORCE); - eff.lpvTypeSpecificParams = &cf; - eff.dwStartDelay = 0; - - // Now set the new parameters and start the effect immediately. - if ( FAILED ( _ForceEffect->SetParameters( &eff, DIEP_DIRECTION | - DIEP_TYPESPECIFICPARAMS | - DIEP_START) ) ) { - send_text_message("Can't send force", _timestamp, vrpn_TEXT_ERROR); - return; - } -} - - -// This routine is called each time through the server's main loop. It will -// take a course of action depending on the current status of the joystick, -// either trying to reset it or trying to get a reading from it. -void vrpn_DirectXFFJoystick::mainloop() -{ - // Call the generic server mainloop, since we are a server - server_mainloop(); - - switch(_status) { - case STATUS_BROKEN: - { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - if (vrpn_TimevalDuration(now, _last_report) > MAX_TIME_INTERVAL) { - send_text_message("Cannot talk to joystick", now, vrpn_TEXT_ERROR); - _last_report = now; - } - } - break; - - case STATUS_READING: - get_report(); - break; - - default: - fprintf(stderr,"vrpn_DirectXFFJoystick: Unknown mode (internal error)\n"); - break; - } -} - -/*XXX -// Set the force to match the X and Y components of the gradient of the plane. -int vrpn_DirectXFFJoystick::handle_plane_change_message(void *selfPtr, - vrpn_HANDLERPARAM p) -{ - vrpn_DirectXFFJoystick *me = (vrpn_DirectXFFJoystick *)selfPtr; - vrpn_float32 abcd[4]; - vrpn_float32 kspring, kdamp, fricdynamic, fricstatic; - vrpn_int32 plane_index, plane_recovery_cycles; - - // XXX We are ignoring the plane index and treating it as if there is - // only one plane. - decode_plane(p.buffer, p.payload_len, abcd, - &kspring, &kdamp, &fricdynamic, &fricstatic, - &plane_index, &plane_recovery_cycles); - - // If the plane normal is (0,0,0) this is a command to stop the surface - if ( (abcd[0] == 0) && (abcd[1] == 0) && (abcd[2] == 0) ) { - me->_fX = me->_fY = 0; - return 0; - } - - // Since the plane equation is (AX + BY + CZ + D = 0), the normalized A and B - // coefficients determine the amount of force in X and Y. We normalize by the - // plane's direction vector not counting D (we send the force no matter where - // we are with respect to the plane, since we are a 2D device in a 3D space). - double norm = sqrt(abcd[0]*abcd[0] + abcd[1]*abcd[1] + abcd[2]*abcd[2]); - me->_fX = abcd[0] / norm; - me->_fY = abcd[1] / norm; - - return 0; -} -XXX*/ - -// Margaret Minsky's dissertation suggests using the slope of the plane, -// which is the equivalent of the step size in Z for a unit step in X and -// a unit step in Y. This turns out to be equivalent to A/C and B/C. -// Note that this can increase without bound, so we have to find some -// scaling factor and then clip if the step size in Z gets too large -// (clipping happens in the code that writes the value to the device -// when the length of the force vector exceeds 1). -int vrpn_DirectXFFJoystick::handle_plane_change_message(void *selfPtr, - vrpn_HANDLERPARAM p) -{ - vrpn_DirectXFFJoystick *me = (vrpn_DirectXFFJoystick *)selfPtr; - vrpn_float32 abcd[4]; - vrpn_float32 kspring, kdamp, fricdynamic, fricstatic; - vrpn_int32 plane_index, plane_recovery_cycles; - double fscale = 0.25; // Maximum force at four times slope for 45 degrees - - // XXX We are ignoring the plane index and treating it as if there is - // only one plane. - decode_plane(p.buffer, p.payload_len, abcd, - &kspring, &kdamp, &fricdynamic, &fricstatic, - &plane_index, &plane_recovery_cycles); - - // If the plane normal is (0,0,0) this is a command to stop the surface - if ( (abcd[0] == 0) && (abcd[1] == 0) && (abcd[2] == 0) ) { - me->_fX = me->_fY = 0; - return 0; - } - - // If C is zero, then we set the forces to unit length in the direction of - // the vector (A, B). This preserves the direction of the force and makes it - // be the maximum force (would be infinite if we divided by C). - if (abcd[2] == 0) { - double len = sqrt(abcd[0]*abcd[0] + abcd[1]*abcd[1]); - me->_fX = abcd[0] / len; - me->_fY = abcd[1] / len; - - // Since the plane equation is (AX + BY + CZ + D = 0), A/C and B/C - // determine the amount of force in X and Y. We do not count D - // (we send the force no matter where we are with respect to the plane, - // since we are a 2D device in a 3D space). - } else { - - me->_fX = fscale * abcd[0] / abcd[2]; - me->_fY = fscale * abcd[1] / abcd[2]; - } - - return 0; -} - -int vrpn_DirectXFFJoystick::handle_forcefield_change_message(void *selfPtr, - vrpn_HANDLERPARAM p) -{ - vrpn_DirectXFFJoystick *me = (vrpn_DirectXFFJoystick *)selfPtr; - - vrpn_float32 center[3]; - vrpn_float32 force[3]; - vrpn_float32 jacobian[3][3]; - vrpn_float32 radius; - - decode_forcefield(p.buffer, p.payload_len, center, force, jacobian, &radius); - - // XXX We are ignoring the center, jacobian, and radius for now. Just use the force. - me->_fX = force[0]; - me->_fY = force[1]; - - return 0; -} - -// Zero the force sent to the device when the last connection is dropped. -int vrpn_DirectXFFJoystick::handle_last_connection_dropped(void *selfPtr, vrpn_HANDLERPARAM) -{ - vrpn_DirectXFFJoystick *me = (vrpn_DirectXFFJoystick*)selfPtr; - if (me->_force_rate > 0) { - me->_fX = me->_fY = 0; - me->send_normalized_force(0,0); - } - return 0; -} - - -#endif diff --git a/src/vrpn/vrpn_DirectXFFJoystick.h b/src/vrpn/vrpn_DirectXFFJoystick.h deleted file mode 100644 index bd8008215d3649ed82c4bb58606dd10352f6b2c4..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_DirectXFFJoystick.h +++ /dev/null @@ -1,240 +0,0 @@ -#ifndef VRPN_DIRECTXFFJOYSTICK_H -#define VRPN_DIRECTXFFJOYSTICK_H - -#include "vrpn_Configure.h" // IWYU pragma: keep - -#if defined(_WIN32) && defined(VRPN_USE_DIRECTINPUT) -#ifndef DIRECTINPUT_VERSION -#define DIRECTINPUT_VERSION 0x0800 -#endif - -#include "vrpn_Connection.h" -#include "vrpn_Analog.h" -#include "vrpn_Button.h" -#include "vrpn_ForceDevice.h" -#include "vrpn_ForceDeviceServer.h" - -#include <basetsd.h> -#include <dinput.h> - -class VRPN_API vrpn_DirectXFFJoystick: public vrpn_Analog - ,public vrpn_Button_Filter - ,public vrpn_ForceDeviceServer -{ -public: - /// Set forceRate to 0 to disable force feedback - vrpn_DirectXFFJoystick (const char * name, vrpn_Connection * c, - double readRate = 60, double forceRate = 200); - - ~vrpn_DirectXFFJoystick (); - - // Called once through each main loop iteration to handle - // updates. - virtual void mainloop (); - -protected: - HWND _hWnd; // Handle to the console window - int _status; - - int _numbuttons; // How many buttons - int _numchannels; // How many analog channels - int _numforceaxes; // How many force-feedback channels we have - - struct timeval _timestamp; // Time of the last report from the device - struct timeval _forcetime; // Last time we sent a force. - struct timeval _last_report;// Last time we sent a report. - double _read_rate; // How many times per second to read the device - double _force_rate; // How many times per second to update forces - - double _fX, _fY; // Force to display in X and Y - double _fx_1, _fy_1; // Force applied last time - double _fx_2, _fy_2; // Force applied two times ago - - virtual int get_report(void); // Try to read a report from the device - void clear_values(void); // Clear the Analog and Button values - - // send report iff changed - virtual void report_changes (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - // send report whether or not changed - virtual void report (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button - - // Send forces to joystick, where forces range from -1 to 1 on X and Y axes. - void send_normalized_force(double fx, double fy); - - HRESULT InitDirectJoystick( void ); - LPDIRECTINPUT8 _DirectInput; // Handle to Direct Input - LPDIRECTINPUTDEVICE8 _Joystick; // Handle to the joystick we are using - LPDIRECTINPUTEFFECT _ForceEffect; // Handle to the constant force effect - static BOOL CALLBACK EnumJoysticksCallback( const DIDEVICEINSTANCE* pdidInstance, VOID* selfPtr ); - static BOOL CALLBACK EnumObjectsCallback( const DIDEVICEOBJECTINSTANCE* pdidoi, VOID* selfPtr ); - - static int VRPN_CALLBACK handle_last_connection_dropped(void *selfPtr, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK handle_plane_change_message(void *selfPtr, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK handle_forcefield_change_message(void *selfPtr, vrpn_HANDLERPARAM p); - - //------------------------------------------------------------------------------- - // None of the scene-orienting or object-creation methods are supported yet, but - // we need to create non-empty functions to handle them. - - // Add an object to the haptic scene as root (parent -1 = default) or as child (ParentNum =the number of the parent) - virtual bool addObject(vrpn_int32 objNum, vrpn_int32 ParentNum=-1) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // Add an object next to the haptic scene as root - virtual bool addObjectExScene(vrpn_int32 objNum) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // vertNum normNum and triNum start at 0 - virtual bool setVertex(vrpn_int32 objNum, vrpn_int32 vertNum,vrpn_float32 x,vrpn_float32 y,vrpn_float32 z) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // NOTE: ghost doesn't take normals, - // and normals still aren't implemented for Hcollide - virtual bool setNormal(vrpn_int32 objNum, vrpn_int32 normNum,vrpn_float32 x,vrpn_float32 y,vrpn_float32 z) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - virtual bool setTriangle(vrpn_int32 objNum, vrpn_int32 triNum,vrpn_int32 vert0,vrpn_int32 vert1,vrpn_int32 vert2, - vrpn_int32 norm0=-1,vrpn_int32 norm1=-1,vrpn_int32 norm2=-1) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - virtual bool removeTriangle(vrpn_int32 objNum, vrpn_int32 triNum) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // should be called to incorporate the above changes into the - // displayed trimesh - virtual bool updateTrimeshChanges(vrpn_int32 objNum,vrpn_float32 kspring, vrpn_float32 kdamp, vrpn_float32 fdyn, vrpn_float32 fstat) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // set trimesh type - virtual bool setTrimeshType(vrpn_int32 objNum,vrpn_int32 type) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // set the trimesh's homogen transform matrix (in row major order) - virtual bool setTrimeshTransform(vrpn_int32 objNum, vrpn_float32 homMatrix[16]) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // set position of an object - virtual bool setObjectPosition(vrpn_int32 objNum, vrpn_float32 Pos[3]) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // set orientation of an object - virtual bool setObjectOrientation(vrpn_int32 objNum, vrpn_float32 axis[3], vrpn_float32 angle) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // set Scale of an object - virtual bool setObjectScale(vrpn_int32 objNum, vrpn_float32 Scale[3]) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // remove an object from the scene - virtual bool removeObject(vrpn_int32 objNum) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - virtual bool clearTrimesh(vrpn_int32 objNum) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - /** Functions to organize the scene **********************************************************/ - // Change The parent of an object - virtual bool moveToParent(vrpn_int32 objNum, vrpn_int32 ParentNum) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // Set the Origin of the haptic scene - virtual bool setHapticOrigin(vrpn_float32 Pos[3], vrpn_float32 axis[3], vrpn_float32 angle) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // Set the Scale factor of the haptic scene - virtual bool setHapticScale(vrpn_float32 Scale) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // Set the Origin of the haptic scene - virtual bool setSceneOrigin(vrpn_float32 Pos[3], vrpn_float32 axis[3], vrpn_float32 angle) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - - // make an object touchable or not - virtual bool setObjectIsTouchable(vrpn_int32 objNum, vrpn_bool IsTouchable=true) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message("vrpn_DirectXFFJoystick: Called a function not supported",now, vrpn_TEXT_ERROR); - return false; - }; - -}; - -#endif -#endif - diff --git a/src/vrpn/vrpn_DirectXRumblePad.C b/src/vrpn/vrpn_DirectXRumblePad.C deleted file mode 100644 index cb4d5aab93ab6dcf5a5d354bf42c0c5bac2c7601..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_DirectXRumblePad.C +++ /dev/null @@ -1,543 +0,0 @@ -// vrpn_DirectXRumblePad.C: This is another driver for force-feedback -// joysticks under Windows such as the Logitech Cordless RumblePad. -// -// Note that if you ARE using a Logitech gamepad, it is almost a -// certainty that this code will not work without Logitech's drivers -// installed. Without them you will not be able to find any available -// force feedback effects, though polling joystick axes and the POV hat -// should work fine. -// -// Chris VanderKnyff, revised July 2007 - -#include "vrpn_DirectXRumblePad.h" - -#if defined(_WIN32) && defined(VRPN_USE_DIRECTINPUT) -#include <stdio.h> -#include <time.h> // for time -#include <algorithm> // for min -using std::min; - -// Hacks to maintain VC++6 compatibility while preserving 64-bitness -// Also cleans up the annoying (and in this case meaningless) warnings under Win32 -#ifdef _WIN64 -# if !defined(GetWindowLongPtr) || !defined(SetWindowLongPtr) -# error 64-bit compilation requires an SDK that supports LONG_PTRs. -# endif -#else -# ifndef LONG_PTR -# define LONG_PTR LONG -# endif -# ifdef GetWindowLongPtr -# undef GetWindowLongPtr -# undef GWLP_USERDATA -# endif -# ifdef SetWindowLongPtr -# undef SetWindowLongPtr -# endif -# define GetWindowLongPtr GetWindowLong -# define SetWindowLongPtr SetWindowLong -# define GWLP_USERDATA GWL_USERDATA -#endif -#ifndef HWND_MESSAGE -# define HWND_MESSAGE ((HWND) -3) -#endif - -// __ImageBase allows us to get the HINSTANCE for the specific component -// we've been compiled into. This is actually the correct way for static -// libraries, because GetModuleHandle(NULL) returns the HINSTANCE for the -// hosting EXE. In the case where VRPN is a DLL itself or has been linked -// into a DLL, GetModuleHandle(NULL) is the wrong process's HINSTANCE. -// -// By using the pseudo-variable __ImageBase provided by the Visual C++ -// compiler, we know exactly what our proper HINSTANCE is. -// -// More info: http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx -EXTERN_C IMAGE_DOS_HEADER __ImageBase; -#define HINST_THISCOMPONENT ((HINSTANCE)&__ImageBase) - -namespace { - const char *CLASS_NAME = "vrpn_DirectXRumblePad"; // Win32 window class name - const int MSG_POLL = WM_APP + 101; // app-specific "polling" message - const int MSG_SETMAGNITUDE = WM_APP + 102; // app-specific "set magnitude" message - const int POLL_SUCCESS = 1701; // private value to indicate polling success - - // Quick-and-dirty GUID comparison function - // Arguments: Two Win32 GUID structures - // Returns: true iff the two GUIDs are identical - inline bool guid_equals(const GUID &a, const GUID &b) { - return !memcmp(&a, &b, sizeof(GUID)); - } -} - -// Device constructor. -// Parameters: -// - name: VRPN name to assign to this server -// - c: VRPN connection this device should be attached to -// - device_guid: If provided, the specific DirectInput device GUID we want to use -// If not provided (or the null GUID), we'll bind to the first available joystick -vrpn_DirectXRumblePad::vrpn_DirectXRumblePad(const char *name, vrpn_Connection *c, - GUID device_guid) - : vrpn_Analog(name, c) - , vrpn_Button_Filter(name, c) - , vrpn_Analog_Output(name, c) - , _target_device(device_guid) - , _wnd(NULL) - , _thread(INVALID_HANDLE_VALUE) - , _directInput(NULL) - , _effect(NULL) - , _gamepad(NULL) -{ - last_error = time(NULL); - - vrpn_Analog::num_channel = 12; - vrpn_Button::num_buttons = min(128, vrpn_BUTTON_MAX_BUTTONS); - vrpn_Analog_Output::o_num_channel = 1; - - // Register a handler for the request channel change message - if (register_autodeleted_handler(request_m_id, - handle_request_message, this, d_sender_id)) { - FAIL("vrpn_DirectXRumblePad: can't register change channel request handler"); - return; - } - - // Register a handler for the request channels change message - if (register_autodeleted_handler(request_channels_m_id, - handle_request_channels_message, this, d_sender_id)) { - FAIL("vrpn_DirectXRumblePad: can't register change channels request handler"); - return; - } - - // Register a handler for the no-one's-connected-now message - if (register_autodeleted_handler( - d_connection->register_message_type(vrpn_dropped_last_connection), - handle_last_connection_dropped, this)) { - FAIL("Can't register self-destruct handler"); - return; - } - - _thread = CreateThread(NULL, 0, thread_proc, this, 0, NULL); - if (_thread == INVALID_HANDLE_VALUE) { - FAIL("Unable to create thread."); - return; - } -} - -// Device destructor -vrpn_DirectXRumblePad::~vrpn_DirectXRumblePad() { - // Tell the thread window to close itself - if (_wnd) { - SendMessage(_wnd, WM_CLOSE, 0, 0); - } - - // Wait for the worker thread to terminate - // Spinlocks are suboptimal, but I know no easy way to "join" to a thread's termination. - if (_thread != INVALID_HANDLE_VALUE) { - DWORD code; - do { - GetExitCodeThread(_thread, &code); - } while (code == STILL_ACTIVE); - } -} - -// joystick_enum_cb: Callback function for joystick enumeration -// Tries to find the desired device GUID if provided. -// Otherwise it will match on the first joystick enumerated. -BOOL CALLBACK vrpn_DirectXRumblePad::joystick_enum_cb(LPCDIDEVICEINSTANCE lpddi, LPVOID ref) { - vrpn_DirectXRumblePad *me = reinterpret_cast<vrpn_DirectXRumblePad *>(ref); - - if (guid_equals(me->_target_device, GUID_NULL) - || guid_equals(me->_target_device, lpddi->guidInstance)) { - if (SUCCEEDED(me->_directInput->CreateDevice(lpddi->guidInstance, &me->_gamepad, 0))) { - return DIENUM_STOP; - } - else { - me->FAIL("Unable to create device instance! Attempting to find another one."); - return DIENUM_CONTINUE; - } - } - return DIENUM_CONTINUE; -} - -// Main thread procedure. Registers a window class, creates a worker window -// (so we have an HWND for DirectInput), and runs a message pump. -// We move all this onto another thread to prevent the host application -// from accidentally being flagged as a GUI thread. Enough DirectX things -// have thread affinity that it's safer to isolate things this way. -// All userland APIs are just wrappers around SendMessage to make sure all -// DirectX calls are executed in the context of the proper thread. -// -// LPVOID parameter is the generic "user data" passed to CreateThread API. -// In this case, it's our C++ this pointer--everything is static in the other thread. -// Multiple vrpn_DirectXRumblePads simply create multiple threads with their own local storage. -DWORD CALLBACK vrpn_DirectXRumblePad::thread_proc(LPVOID ref) { - // Retrieve C++ this pointer - vrpn_DirectXRumblePad *me = reinterpret_cast<vrpn_DirectXRumblePad *>(ref); - - // Register a simple window class - WNDCLASS wc = {0}; - wc.lpfnWndProc = window_proc; - wc.cbWndExtra = sizeof(vrpn_DirectXRumblePad *); - wc.hInstance = HINST_THISCOMPONENT; - wc.lpszClassName = CLASS_NAME; - - if (!RegisterClass(&wc)) { - me->FAIL("Unable to register class."); - return 1; - } - - // Create our window - me->_wnd = CreateWindow(CLASS_NAME, "VRPN Worker Thread", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, ref); - - if (!me->_wnd) { - me->FAIL("Unable to create window."); - return 1; - } - - // Fire up DirectInput - if (FAILED(DirectInput8Create(HINST_THISCOMPONENT, DIRECTINPUT_VERSION, - IID_IDirectInput8, (void**)&me->_directInput, NULL))) { - me->FAIL("Unable to connect DirectInput."); - return 1; - } - - // Enumerate force-feedback joysticks - if (FAILED(me->_directInput->EnumDevices(DI8DEVCLASS_GAMECTRL, - joystick_enum_cb, me, DIEDFL_ATTACHEDONLY | DIEDFL_FORCEFEEDBACK))) { - me->FAIL("Unable to enumerate joysticks."); - return 1; - } - - // Make sure we found something - if (!me->_gamepad) { - me->FAIL("No compatible joystick found!"); - return 1; - } - - // Set data format for retrieving axis values - if (FAILED(me->_gamepad->SetDataFormat(&c_dfDIJoystick2))) { - me->FAIL("Unable to set data format."); - return 1; - } - - // Grab exclusive access to the joystick - if (FAILED(me->_gamepad->SetCooperativeLevel(me->_wnd, DISCL_EXCLUSIVE | DISCL_BACKGROUND))) { - me->FAIL("Unable to set cooperative level."); - return 1; - } - - // Find all the axes and set their ranges to [-1000, 1000] - if (FAILED(me->_gamepad->EnumObjects(axis_enum_cb, me->_gamepad, DIDFT_AXIS))) { - me->FAIL("Unable to enumerate axes."); - return 1; - } - - // Load the force effect onto the joystick - if (FAILED(me->init_force())) { - me->FAIL("Unable to initialize forces."); - return 1; - } - - // Acquire the joystick for polling - if (FAILED(me->_gamepad->Acquire())) { - me->FAIL("Unable to acquire joystick."); - return 1; - } - - // Start the main message loop - BOOL ret; - MSG msg; - while ((ret = GetMessage(&msg, me->_wnd, 0, 0)) != 0) { - if (ret == -1) { - me->FAIL("GetMessage() threw an error."); - return 1; - } - else { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } - - // Clean up after ourselves - if (me->_effect) - me->_effect->Release(); - if (me->_gamepad) - me->_gamepad->Release(); - if (me->_directInput) - me->_directInput->Release(); - - return 0; -} - -// Window procedure for the worker thread's helper window -// Standard WindowProc semantics for a message-only window -LRESULT CALLBACK vrpn_DirectXRumblePad::window_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { - // Retrieve "this" pointer - // Guaranteed to be garbage until WM_CREATE finishes, but - // we don't actually use this value until WM_CREATE writes a valid one - vrpn_DirectXRumblePad *me = reinterpret_cast<vrpn_DirectXRumblePad *> - (GetWindowLongPtr(hwnd, GWLP_USERDATA)); - - switch (msg) { - // Window is being created; store "this" pointer for future retrieval - case WM_CREATE: { - CREATESTRUCT *s = reinterpret_cast<CREATESTRUCT *>(lp); - me = reinterpret_cast<vrpn_DirectXRumblePad *>(s->lpCreateParams); - SetWindowLongPtr(hwnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(me)); - return 0; - } - - // Something (most likely ~vrpn_DirectXRumblePad) wants to close the window - // Go ahead and signal shutdown - case WM_CLOSE: - DestroyWindow(hwnd); - PostQuitMessage(0); - break; - - // Main thread wants to poll the joystick. Do so. - case MSG_POLL: - if (FAILED(me->_gamepad->Poll())) { - // Keep trying to acquire the joystick if necessary - do { - me->_gamepad->Acquire(); - } while (me->_gamepad->Poll() == DIERR_INPUTLOST); - } - // Read data from the joystick - if (SUCCEEDED(me->_gamepad->GetDeviceState(sizeof(DIJOYSTATE2), reinterpret_cast<DIJOYSTATE2 *>(lp)))) { - return POLL_SUCCESS; // Make sure main thread knows we're running here - } - else { - me->FAIL("GetDeviceState() returned error result."); - break; - } - - // Main thread wants to change rumble magnitude. Do so. - case MSG_SETMAGNITUDE: { - float mag = *reinterpret_cast<float*>(&wp); - - if (me->_effect) - me->_effect->Stop(); - - if (mag > 0) { - HRESULT hr; - - me->_diPeriodic.dwMagnitude = (DWORD) (DI_FFNOMINALMAX * mag); - hr = me->_effect->SetParameters(&me->_diEffect, DIEP_TYPESPECIFICPARAMS); - hr = me->_effect->Download(); - hr = me->_effect->Start(1, 0); - hr = hr; - } - break; - } - - // Everything not explicitly handled goes to DefWindowProc as per usual - default: - return DefWindowProc(hwnd, msg, wp, lp); - } - - return 0; -} - -// Axis enumeration callback -// For each joystick axis we can find, tell it to report values in [-1000, 1000] -BOOL CALLBACK vrpn_DirectXRumblePad::axis_enum_cb(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID ref) { - LPDIRECTINPUTDEVICE8 gamepad = reinterpret_cast<LPDIRECTINPUTDEVICE8>(ref); - - DIPROPRANGE prop; - prop.diph.dwSize = sizeof(DIPROPRANGE); - prop.diph.dwHeaderSize = sizeof(DIPROPHEADER); - prop.diph.dwHow = DIPH_BYID; - prop.diph.dwObj = lpddoi->dwType; - prop.lMin = -1000; - prop.lMax = 1000; - - if (FAILED(gamepad->SetProperty(DIPROP_RANGE, &prop.diph))) { - return DIENUM_STOP; - } - - return DIENUM_CONTINUE; -} - -// VRPN main loop -// Poll the joystick, update the axes, and let the VRPN change notifications fire -void vrpn_DirectXRumblePad::mainloop() { - DIJOYSTATE2 js; - - server_mainloop(); - - if (SendMessage(_wnd, MSG_POLL, 0, reinterpret_cast<LPARAM>(&js)) != POLL_SUCCESS) { - if ((time(NULL) - last_error) > 2) { - struct timeval now; - - time(&last_error); - vrpn_gettimeofday(&now, NULL); - send_text_message("Cannot talk to joystick", now, vrpn_TEXT_ERROR); - } - return; - } - - channel[0] = js.lX / 1000.0; - channel[1] = js.lY / 1000.0; - channel[2] = js.lZ / 1000.0; - - channel[3] = js.lRx / 1000.0; - channel[4] = js.lRy / 1000.0; - channel[5] = js.lRz / 1000.0; - - channel[6] = js.rglSlider[0] / 1000.0; - channel[7] = js.rglSlider[1] / 1000.0; - - int i; - for (i = 0; i < 4; i++) { - long v = (long) js.rgdwPOV[i]; - channel[8+i] = (v == -1) ? -1 : (v / 100.0); - } - - for (i = 0; i < vrpn_Analog::num_channel/*min(128,vrpn_BUTTON_MAX_BUTTONS)*/; i++) { - buttons[i] = ( (js.rgbButtons[i] & 0x80) != 0); - } - - // Send any changes out over the connection. - vrpn_gettimeofday(&_timestamp, NULL); - report_changes(); -} - -void vrpn_DirectXRumblePad::report(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_DirectXRumblePad::report_changes(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -/* static */ -int vrpn_DirectXRumblePad::handle_request_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - const char* bufptr = p.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_float64 value; - vrpn_DirectXRumblePad* me = (vrpn_DirectXRumblePad*)userdata; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - vrpn_unbuffer(&bufptr, &value); - - // Set the appropriate value, if the channel number is in the - // range of the ones we have. - if ( (chan_num < 0) || (chan_num >= me->o_num_channel) ) { - fprintf(stderr,"vrpn_Analog_Output_Server::handle_request_message(): Index out of bounds\n"); - char msg[1024]; - sprintf( msg, "Error: (handle_request_message): channel %d is not active. Squelching.", chan_num ); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_ERROR ); - return 0; - } - me->o_channel[chan_num] = value; - - float mag = static_cast<float>(value); - mag = (mag < 0) ? 0 : (mag > 1) ? 1 : mag; - SendMessage(me->_wnd, MSG_SETMAGNITUDE, *reinterpret_cast<WPARAM*>(&mag), 0); - - return 0; -} - -/* static */ -int vrpn_DirectXRumblePad::handle_request_channels_message(void* userdata, - vrpn_HANDLERPARAM p) -{ - const char* bufptr = p.buffer; - vrpn_int32 num; - vrpn_int32 pad; - vrpn_DirectXRumblePad* me = (vrpn_DirectXRumblePad*)userdata; - - // Read the values from the buffer - vrpn_unbuffer(&bufptr, &num); - vrpn_unbuffer(&bufptr, &pad); - if (num > me->o_num_channel) - { - char msg[1024]; - sprintf( msg, "Error: (handle_request_channels_message): channels above %d not active; " - "bad request up to channel %d. Squelching.", me->o_num_channel, num ); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_ERROR ); - num = me->o_num_channel; - } - if (num < 0) - { - char msg[1024]; - sprintf( msg, "Error: (handle_request_channels_message): invalid channel %d. Squelching.", num ); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_ERROR ); - return 0; - } - - // Pull only channel 0 from the buffer, no matter how many values we received. - vrpn_float64 value; - vrpn_unbuffer(&bufptr, &value); - float mag = static_cast<float>(value); - mag = (mag < 0) ? 0 : (mag > 1) ? 1 : mag; - SendMessage(me->_wnd, MSG_SETMAGNITUDE, *reinterpret_cast<WPARAM*>(&mag), 0); - - return 0; -} - -int VRPN_CALLBACK vrpn_DirectXRumblePad::handle_last_connection_dropped(void *selfPtr, vrpn_HANDLERPARAM data) { - // Kill force feedback if no one is connected - SendMessage(((vrpn_DirectXRumblePad *)selfPtr)->_wnd, MSG_SETMAGNITUDE, 0, 0); - return 0; -} - -// Initializes the joystick with a force feedback effect -HRESULT vrpn_DirectXRumblePad::init_force() { - HRESULT hr; - - // Turn off autocentering - DIPROPDWORD prop; - prop.diph.dwSize = sizeof(prop); - prop.diph.dwHeaderSize = sizeof(DIPROPHEADER); - prop.diph.dwObj = 0; - prop.diph.dwHow = DIPH_DEVICE; - prop.dwData = DIPROPAUTOCENTER_OFF; - - hr = _gamepad->SetProperty(DIPROP_AUTOCENTER, &prop.diph); - if (FAILED(hr)) - return hr; - - // Create the actual effect - DWORD dwAxes[2] = {DIJOFS_X, DIJOFS_Y}; - LONG lDirection[2] = {0, 0}; - - _diPeriodic.dwMagnitude = DI_FFNOMINALMAX; - _diPeriodic.lOffset = 0; - _diPeriodic.dwPhase = 0; - _diPeriodic.dwPeriod = static_cast<DWORD>(0.05 * DI_SECONDS); - - _diEffect.dwSize = sizeof(DIEFFECT); - _diEffect.dwFlags = DIEFF_POLAR | DIEFF_OBJECTOFFSETS; - _diEffect.dwDuration = INFINITE; - _diEffect.dwSamplePeriod = 0; - _diEffect.dwGain = DI_FFNOMINALMAX; - _diEffect.dwTriggerButton = DIEB_NOTRIGGER; - _diEffect.dwTriggerRepeatInterval = 0; - _diEffect.cAxes = 2; - _diEffect.rgdwAxes = dwAxes; - _diEffect.rglDirection = &lDirection[0]; - _diEffect.lpEnvelope = NULL; - _diEffect.cbTypeSpecificParams = sizeof(_diPeriodic); - _diEffect.lpvTypeSpecificParams = &_diPeriodic; - _diEffect.dwStartDelay = 0; - - hr = _gamepad->CreateEffect(GUID_Square, &_diEffect, &_effect, NULL); - - return hr; -} - - -#endif // _WIN32 and VRPN_USE_DIRECTINPUT diff --git a/src/vrpn/vrpn_DirectXRumblePad.h b/src/vrpn/vrpn_DirectXRumblePad.h deleted file mode 100644 index 13ca461b1add11a8f1de15b39d26bec84ca04feb..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_DirectXRumblePad.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef VRPN_RUMBLEPAD_H - -#include "vrpn_Configure.h" // IWYU pragma: keep - -#if defined(_WIN32) && defined(VRPN_USE_DIRECTINPUT) - -#include "vrpn_Analog.h" -#include "vrpn_Analog_Output.h" -#include "vrpn_Button.h" -#include "vrpn_Connection.h" - -#ifndef DIRECTINPUT_VERSION -#define DIRECTINPUT_VERSION 0x0800 -#endif -#include "vrpn_Shared.h" -#include <dinput.h> -#include <windows.h> - -// This implements a RumblePad, which has analog outputs and button outputs -// but also enables the user to set a rumble magnitude using an Analog_Output -// (channel zero controls the rumble magnitude). - -class VRPN_API vrpn_DirectXRumblePad: public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Analog_Output { -public: - vrpn_DirectXRumblePad(const char *name, vrpn_Connection *c = NULL, - GUID device_guid = GUID_NULL); - - ~vrpn_DirectXRumblePad(); - - virtual void mainloop(); - -protected: - // Handle the rumble-magnitude setting (channel 0). - static int VRPN_CALLBACK handle_request_message( void *userdata, - vrpn_HANDLERPARAM p ); - static int VRPN_CALLBACK handle_request_channels_message( void* userdata, - vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK handle_last_connection_dropped(void *selfPtr, vrpn_HANDLERPARAM data); - - //static void FAIL(vrpn_DirectXRumblePad *obj, const char *msg) { struct timeval now; vrpn_gettimeofday(&now, NULL); obj->send_text_message(msg, now, vrpn_TEXT_ERROR); } - -private: - time_t last_error; - - // Windows enumeration/window callback functions - static BOOL CALLBACK joystick_enum_cb(LPCDIDEVICEINSTANCE lpddi, LPVOID ref); - static DWORD CALLBACK thread_proc(LPVOID ref); - static LRESULT CALLBACK window_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp); - static BOOL CALLBACK axis_enum_cb(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID ref); - - // Error-handling procedure (spit out a message and die) - inline void FAIL(const char *msg) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message(msg, now, vrpn_TEXT_ERROR); - d_connection = NULL; - } - - // send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button - - // Create basic rumble effect and load onto device - HRESULT init_force(); - - // Data storage - - // Identifies the specific joystick device GUID the user is connected to - GUID _target_device; - - // Window and thread handles for inter-thread communication - HWND _wnd; - HANDLE _thread; - - // Root IDirectInput8 instance - LPDIRECTINPUT8 _directInput; - - // Various DirectInput COM objects - LPDIRECTINPUTDEVICE8 _gamepad; - LPDIRECTINPUTEFFECT _effect; - timeval _timestamp; - DIPERIODIC _diPeriodic; - DIEFFECT _diEffect; -}; - -#endif // _WIN32 and VRPN_USE_DIRECTINPUT - -#define VRPN_RUMBLEPAD_H -#endif - diff --git a/src/vrpn/vrpn_DreamCheeky.C b/src/vrpn/vrpn_DreamCheeky.C deleted file mode 100644 index 28343268ae60dc9316cda261a3619f1a148d7377..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_DreamCheeky.C +++ /dev/null @@ -1,125 +0,0 @@ -// vrpn_dreamcheeky.C: VRPN driver for Dream Cheeky USB roll-up drum kit - -#include <string.h> // for memset - -#include "vrpn_DreamCheeky.h" - -class VRPN_API vrpn_Connection; - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_HID) - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 DREAMCHEEKY_VENDOR = 6465; -static const vrpn_uint16 USB_ROLL_UP_DRUM_KIT = 32801; - -vrpn_DreamCheeky::vrpn_DreamCheeky(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c) - : vrpn_HidInterface(filter) - , vrpn_BaseClass(name, c) - , _filter(filter) -{ - vrpn_gettimeofday(&_timestamp, NULL); -} - -vrpn_DreamCheeky::~vrpn_DreamCheeky() -{ - delete _filter; -} - -void vrpn_DreamCheeky::on_data_received(size_t bytes, vrpn_uint8 *buffer) -{ - decodePacket(bytes, buffer); -} - -vrpn_DreamCheeky_Drum_Kit::vrpn_DreamCheeky_Drum_Kit(const char *name, vrpn_Connection *c, - bool debounce) - : vrpn_DreamCheeky(_filter = new vrpn_HidProductAcceptor(DREAMCHEEKY_VENDOR, USB_ROLL_UP_DRUM_KIT), name, c) - , vrpn_Button_Filter(name, c) - , d_debounce(debounce) -{ - vrpn_Button::num_buttons = 6; - - // Initialize the state of all the buttons - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); -} - -void vrpn_DreamCheeky_Drum_Kit::mainloop() -{ - update(); - server_mainloop(); - vrpn_gettimeofday(&_timestamp, NULL); - report_changes(); - - vrpn_Button::server_mainloop(); -} - -void vrpn_DreamCheeky_Drum_Kit::report(void) { - vrpn_Button::timestamp = _timestamp; - vrpn_Button::report_changes(); -} - -void vrpn_DreamCheeky_Drum_Kit::report_changes(void) { - vrpn_Button::timestamp = _timestamp; - vrpn_Button::report_changes(); -} - -void vrpn_DreamCheeky_Drum_Kit::decodePacket(size_t bytes, vrpn_uint8 *buffer) -{ - // The reports are each 8 bytes long. Since there is only one type of - // report for this device, the report type is not included (stripped by - // the HIDAPI driver). The bytes are 8 identical reports. - // There is one byte per report, and it holds a binary encoding of - // the buttons. Button 0 is in the LSB, and the others proceed up - // the bit chain. Parse each report and then send any changes on. - // need to send between each report so we don't miss a button press/release - // all in one packet. - - size_t i, r; - // Truncate the count to an even number of 8 bytes. This will - // throw out any partial reports (which is not necessarily what - // we want, because this will start us off parsing at the wrong - // place if the rest of the report comes next, but it is not - // clear how to handle that cleanly). - bytes -= (bytes % 8); - - // Decode all full reports, each of which is 8 bytes long. - for (i = 0; i < (bytes / 8); i++) { - - // If we're debouncing the buttons, then we set the button - // to "pressed" if it has 4 or more pressed events in the - // set of 8 and to "released" if it has less than 4. - if (d_debounce) { - int btn; - for (btn = 0; btn < vrpn_Button::num_buttons; btn++) { - unsigned count = 0; - vrpn_uint8 mask = 1 << btn; - for (r = 0; r < 8; r++) { // Skip the all-zeroes byte - vrpn_uint8 *report = buffer + 9*i + r; - count += ((*report & mask) != 0); - } - buttons[btn] = (count >= 4); - vrpn_gettimeofday(&_timestamp, NULL); - report_changes(); - } - - // If we're not debouncing, then we report each button event - // independently. - }else { - for (r = 0; r < 8; r++) { // Skip the all-zeroes byte - vrpn_uint8 *report = buffer + 9*i + r; - int btn; - for (btn = 0; btn < vrpn_Button::num_buttons; btn++) { - vrpn_uint8 mask = 1 << btn; - buttons[btn] = ((*report & mask) != 0); - } - vrpn_gettimeofday(&_timestamp, NULL); - report_changes(); - } - } - } -} - -#endif - diff --git a/src/vrpn/vrpn_DreamCheeky.h b/src/vrpn/vrpn_DreamCheeky.h deleted file mode 100644 index 0f59651192efac8e4b2cf84b4dbb37612d0e79f5..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_DreamCheeky.h +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once - -#include <stddef.h> // for size_t - -#include "vrpn_BaseClass.h" // for vrpn_BaseClass -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_USE_HID -#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint8 - -// Device drivers for the Dream Cheeky USB Roll-Up Drum Kit; done in such a -// way that any other USB devices from this vendow should be easy to add. -// Based on the X-Keys driver. -// -// For the Dreamcheeky: -// Button 0 is the upper-left triangle -// Button 1 is hte upper-right triangle -// Button 2 is the upper center round pad -// Button 3 is the lower-right round pad -// Button 4 is the lower-center round pad -// Button 5 is the lower-left round pad - -#if defined(VRPN_USE_HID) - -class VRPN_API vrpn_DreamCheeky: public vrpn_BaseClass, protected vrpn_HidInterface { -public: - vrpn_DreamCheeky(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_DreamCheeky(); - - virtual void mainloop() = 0; - -protected: - // Set up message handlers, etc. - void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer) = 0; - struct timeval _timestamp; - vrpn_HidAcceptor *_filter; - - // No actual types to register, derived classes will be buttons, analogs, and/or dials - int register_types(void) { return 0; } -}; - -class VRPN_API vrpn_DreamCheeky_Drum_Kit: protected vrpn_DreamCheeky, public vrpn_Button_Filter { -public: - // The sensors "bounce" a lot when the buttons are pressed and released, - // causing spurious readings of press/release. Debouncing looks at ensembles - // of events to make sure that the buttons have settled before reporting - // events. - vrpn_DreamCheeky_Drum_Kit(const char *name, vrpn_Connection *c = 0, bool debounce = true); - virtual ~vrpn_DreamCheeky_Drum_Kit() {}; - - virtual void mainloop(); - -protected: - // Do we try to debounce the buttons? - bool d_debounce; - - // Send report iff changed - void report_changes (void); - // Send report whether or not changed - void report (void); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); -}; - -#else -class vrpn_DreamCheeky_Drum_Kit; -#endif - - diff --git a/src/vrpn/vrpn_Dyna.C b/src/vrpn/vrpn_Dyna.C deleted file mode 100644 index 78f24712118536042948071241401c2d0a59a641..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Dyna.C +++ /dev/null @@ -1,301 +0,0 @@ -/* Modification to make it work with the SeerReal D4D Headtracker, - needs to send "0" instead of "V" to set it to continuous mode. - Untested if this still works with the Dynasight Tracker.*/ -#ifdef _WIN32 -#include <io.h> -#else -#endif -#include <stdio.h> // for fprintf, stderr, NULL -#include <string.h> // for strlen - -#include "vrpn_Dyna.h" -#include "vrpn_Serial.h" // for vrpn_write_characters, etc -#include "vrpn_Shared.h" // for vrpn_SleepMsecs, timeval, etc -#include "vrpn_Types.h" // for vrpn_float64 - -class VRPN_API vrpn_Connection; - -#define T_ERROR (-1) -#define T_OK (0) - -/* return codes for status check */ -#define T_PDYN_SPEW_MODE (-50) -#define T_PDYN_NO_DATA (-51) - -#define lOOO_OOOO (0x80) -#define llll_OOOO (0xf0) -#define OOOO_OOll (0x03) -#define OOOO_llOO (0x0c) - -vrpn_Tracker_Dyna::vrpn_Tracker_Dyna( - char *name, vrpn_Connection *c, int cSensors, - const char *port, long baud ) : -vrpn_Tracker_Serial(name,c,port,baud), cSensors(cSensors), cResets(0) -{ - if (cSensors>VRPN_DYNA_MAX_SENSORS) { - fprintf(stderr, "\nvrpn_Tracker_Dyna: too many sensors requested ... only %d allowed (%d specified)", VRPN_DYNA_MAX_SENSORS, cSensors ); - cSensors = VRPN_DYNA_MAX_SENSORS; - } - fprintf(stderr, "\nvrpn_Tracker_Dyna: starting up ..."); - d_sensor = 0 ; // sensor id is always 0 (first sensor is 0); -} - -vrpn_Tracker_Dyna::~vrpn_Tracker_Dyna() { - fprintf(stderr, "vrpn_Tracker_Dyna:Shutting down...\n"); -} - - -int vrpn_Tracker_Dyna::get_status() -{ - int bytesRead; - unsigned char statusBuffer[256]; - - my_flush(); - - /* send request for status record */ - - vrpn_write_characters(serial_fd,(const unsigned char *) "\021", 1); - vrpn_drain_output_buffer(serial_fd); - vrpn_SleepMsecs(1000.0*2); - - /* do non-blocking read of status record */ - bytesRead = vrpn_read_available_characters(serial_fd, statusBuffer, 8); - // T_PDYN_STATUS_RECORD_LENGTH =8; - - if ( bytesRead == 8 ) - { - /* we have correct length- check a few chars to make sure this is a valid - * record - */ - if ( ((statusBuffer[0] & lOOO_OOOO) != lOOO_OOOO) || - ((statusBuffer[1] & lOOO_OOOO) != lOOO_OOOO) ) - return(T_ERROR); - - /* otherwise, all is well */ - return(T_OK); - } - - /* if we get here, we either got too much data or not enough */ - - /* no data means it's probably disconnected or not turned on */ - if ( bytesRead == 0 ) - { -// fprintf(stderr, "No data\n"); - return(T_PDYN_NO_DATA); - } - - /* if we got too much data, chances are that it's in continuous mode */ - if ( bytesRead > 8) - { - fprintf(stderr, "3\n"); - return(T_PDYN_SPEW_MODE); - } - - /* if we get here, i have no idea what's going on- could be garbage on the - * serial line, wrong baud rate, or that the Dynasight is flaking out. - */ - return(T_ERROR); - -} /* t_pdyn_get_status */ - -#define MAX_TRIAL 10 - -void vrpn_Tracker_Dyna::reset() { - //static int numResets = 0; // How many resets have we tried?; - static const char T_PDYN_C_CTL_C[4] ="\003\003\003"; - static const int T_PDYN_RECORD_LENGTH = 8; - - vrpn_write_characters(serial_fd, (unsigned char*)T_PDYN_C_CTL_C, strlen(T_PDYN_C_CTL_C)); - vrpn_write_characters(serial_fd,(const unsigned char *) "4", 1); // set to polling mode; - - /* pause 1 second to allow the Dynasight buffer to stabilize */ - vrpn_SleepMsecs(1000.0*1); - - status = get_status(); - - if ( status != T_OK ) { - - /* if no data, tracker probably not connected. just bag it. */ - if ( status == T_PDYN_NO_DATA ) - { - fprintf(stderr, "vrpn_Tracker_Dyna::reset(): no data (is tracker turned on?)\n"); - status = vrpn_TRACKER_RESETTING; - return; - - } - - }else { - fprintf(stderr, "vrpn_Tracker_Dyna: return valid status report\n"); - reportLength = T_PDYN_RECORD_LENGTH; - - // set it to continues mode; - /* clear any leftover data */ - my_flush(); - - /* set the Dynasight to continuous mode */ - vrpn_write_characters(serial_fd, (unsigned char*)T_PDYN_C_CTL_C, strlen(T_PDYN_C_CTL_C)); - //vrpn_write_characters(serial_fd, (const unsigned char *)"V", 1); - vrpn_write_characters(serial_fd, (const unsigned char *)"0", 1); - //T_PDYN_C_CONTINUOUS = "V" - vrpn_SleepMsecs(1000.0*1); - //vrpn_gettimeofday(×tamp, NULL); // Set watchdog now; - timestamp.tv_sec = -1; - status = vrpn_TRACKER_SYNCING; // We are trying for a new reading; - return; - } - -} - -int vrpn_Tracker_Dyna::get_report(void) { - int ret; - if (status == vrpn_TRACKER_SYNCING) { - if ((ret=vrpn_read_available_characters(serial_fd, buffer, 1)) != 1 || - (buffer[0] & llll_OOOO) != lOOO_OOOO) { - return 0; - } - vrpn_gettimeofday(×tamp, NULL); - status = vrpn_TRACKER_PARTIAL; - bufcount= ret; - } - if (status == vrpn_TRACKER_PARTIAL) { - ret=vrpn_read_available_characters(serial_fd, &(buffer[bufcount]), - reportLength-bufcount); - if (ret < 0) { - fprintf(stderr,"%s@%d: Error reading\n", __FILE__, __LINE__); - status = vrpn_TRACKER_FAIL; - return 0; - } - bufcount += ret; - if (bufcount < reportLength) { // Not done -- go back for more - return 0; - } - } - - if (!valid_report()) { - //fprintf(stderr,"no valid report"); - bufcount = 0; - status = vrpn_TRACKER_SYNCING; - return 0; - } - //else fprintf(stderr,"got valid report"); - decode_record(); - status = vrpn_TRACKER_SYNCING; - bufcount=0; - - return 1; -} - -int vrpn_Tracker_Dyna::valid_report() { - - /* Check to see that the first four bits of the * - * first two bytes correspond to 1000. */ - if ( ( (buffer[0] & llll_OOOO) != lOOO_OOOO) || - ( (buffer[1] & llll_OOOO) != lOOO_OOOO) ) - return (0); - - - /* Make sure no other consecutive bytes have 1000 in the high nibble */ - for (unsigned i = 2; i <reportLength-1; i += 2) - { - if ( ( (buffer[i] & llll_OOOO) == lOOO_OOOO) && - ( (buffer[i+1] & llll_OOOO) == lOOO_OOOO)) - { - fprintf(stderr, - "vrpn_Tracker_Dyna: found two more status bytes in the Dynasight's output list\n"); - return (0); - } - } - - /* Next, check that the Dynasight is tracking or in caution mode. If * - * it is not, then we can't be sure of what data is being sent back, * - * copy the most recent tracked data into the buffer. */ - if ( ( (buffer[1] & OOOO_OOll) == 0 ) || - ( (buffer[1] & OOOO_OOll) == 1 ) ) - { - return (1); - } - - /* Also, for this passive Dynasight mode, we want to make sure that we * - * only getting records from the single (00) sensor, not any active * - * sensors. */ - if ( (buffer[0] & OOOO_llOO) != 0) - { - fprintf(stderr, "trackerlib: Invalid target number for passive Dynasight\n"); - return (0); - } - - /* If we've made it this far, we have a target that is being tracked, * - * and it is the correct target. So, copy this into the * - * lastTrackedData array. - for (i = 0; i < trackerPtr->reportLength; i++) - lastTrackedData[i] = buffer[bufIndex + i]; - */ - return (1); -} - - -/***************************************************************************** - * - decode_record - decodes a continuous binary encoded record - for one station. - - output: - decodedMatrix- represents the row_matrix to transform the receiver - coordinates to tracker coordinates - - - T_ERROR is returned if the record is munged, T_OK otherwise - * - *****************************************************************************/ - -int vrpn_Tracker_Dyna::decode_record() -// q_vec_type decoded_pos; -{ - unsigned i; - - unsigned char exp; - char x_high, y_high, z_high; - unsigned char x_low, y_low, z_low; - long x, y, z; - - if ( (buffer[0] & lOOO_OOOO) == 0 ) - { - fprintf(stderr, "bogus data to vrpn_Tracker_Dyna_decode_record:\n"); - for ( i = 0; i < reportLength; i++ ) - fprintf(stderr, "%x ", buffer[i]); - fprintf(stderr, "\n"); - return(T_ERROR); - } - - /* Pull out the exponent to shift by */ - //exp = ( (buffer[0] & OOOO_OOlO)<<1 ) | (buffer[0] & OOOO_OOOl); - exp = (unsigned char)( ( (buffer[0] & 0x2)<<1 ) | (buffer[0] & 0x1) ); - - x_high = (char)buffer[2]; - x_low = (char)buffer[3]; - y_high = (char)buffer[4]; - y_low = (char)buffer[5]; - z_high = (char)buffer[6]; - z_low = (char)buffer[7]; - - /* Shift high order byte, combine with low order, and then * - * shift by the exponent. */ - x = (long)( ((short)x_high<<8) | ((short)x_low) ) << exp; - y = (long)( ((short)y_high<<8) | ((short)y_low) ) << exp; - z = (long)( ((short)z_high<<8) | ((short)z_low) ) << exp; - //fprintf(stderr,"x,y,z: %i,%i,%i\n",x,y,z); - - /* Convert to meters -- 1 unit = 0.05mm = 0.00005m */ - pos[0] = (double)x * 0.00005; - pos[1] = (double)y * 0.00005; - pos[2] = (double)z * 0.00005; - - /* For the single-target Dynasight, we assume that the orientation * - * the target is that same as that of the Dynasight. */ - d_quat[0] = 0.0; - d_quat[1] = 0.0; - d_quat[2] = 0.0; - d_quat[3] = 1.0; - - return(T_OK); - -} /* t_pdyn_decode_record */ diff --git a/src/vrpn/vrpn_Dyna.h b/src/vrpn/vrpn_Dyna.h deleted file mode 100644 index 25dca356889f09f22245c59d8731808a194f4d07..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Dyna.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef INCLUDED_DYNA -#define INCLUDED_DYNA - -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Serial.h" -#include "vrpn_Tracker.h" // for vrpn_Tracker_Serial - -class VRPN_API vrpn_Connection; - -// only 13 receivers allowed in normal addressing mode -#define VRPN_DYNA_MAX_SENSORS 13 - -// This is a class which provides a server for an ascension -// DynaSight. The server will send out messages -// The timestamp is the time when the first character was read -// from the serial driver with "read". No adjustment is currently -// made to this time stamp. - -// If this is running on a non-linux system, then the serial port driver -// is probably adding more latency -- see the vrpn README for more info. - -class VRPN_API vrpn_Tracker_Dyna: public vrpn_Tracker_Serial { -private: - unsigned reportLength; - unsigned totalReportLength; - - public: - - vrpn_Tracker_Dyna(char *name, vrpn_Connection *c, int cSensors=1, - const char *port = "/dev/ttyd3", long baud = 38400); - - virtual ~vrpn_Tracker_Dyna(); - -private: - void my_flush() { - // clear the input data buffer - unsigned char foo[128]; - while (vrpn_read_available_characters(serial_fd, foo, 1) > 0) ; - } - int valid_report(); - int decode_record(); - int get_status(); - protected: - - virtual int get_report(void); - virtual void reset(); - void printError(unsigned char uchErrCode, unsigned char uchExpandedErrCode); - int checkError(); - int cResets; - int cSensors; -}; - - -#endif diff --git a/src/vrpn/vrpn_Event.C b/src/vrpn/vrpn_Event.C deleted file mode 100644 index 00d1ed67f82395a517c6026d2db4b78177ba325c..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Event.C +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************************************/ -/* */ -/* Copyright (C) 2004 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/**************************************************************************************************/ -/* */ -/* module : vrpn_Linux.h */ -/* project : */ -/* description: provide functionality for Event interface */ -/* */ -/**************************************************************************************************/ - -// includes, system - -#include <stdio.h> // for perror -#if ! defined(_WIN32) - #include <fcntl.h> // for open, O_RDONLY - #include <unistd.h> // for close, read -#endif - -// includes project -#include "vrpn_Event.h" - - -namespace vrpn_Event { - - /************************************************************************************************/ - /* open the specified event interface */ - /************************************************************************************************/ - int - vrpn_open_event( const char* file) { - - #if defined(_WIN32) - - fprintf( stderr, "vrpn_Event::vrpn_open_event(): Not yet implemented on this architecture."); - return -1; - - #else // #if defined(LINUX) - - return open( file, O_RDONLY); - - #endif - } - - /************************************************************************************************/ - /* close the event interface */ - /************************************************************************************************/ - void - vrpn_close_event( const int fd) { - - #if defined(_WIN32) - - fprintf( stderr, "vrpn_Event::vrpn_close_event(): Not yet implemented on this architecture."); - - #else // #if defined(LINUX) - - close(fd); - - #endif - } - - /************************************************************************************************/ - /* read data from the interface */ - /************************************************************************************************/ - int - vrpn_read_event( int fd, input_event * data, int max_elements) { - - #if defined(_WIN32) - - fprintf( stderr, "vrpn_Event::vrpn_read_event(): Not yet implemented on this architecture."); - return -1; - - #else /// #if defined(LINUX) - - int read_bytes = read(fd, data, sizeof(struct input_event) * max_elements); - - if (read_bytes < (int) sizeof(struct input_event)) { - - perror("vrpn_Event_Linux::vrpn_read_event() : short read"); - } - - return (read_bytes / sizeof(struct input_event)); - - #endif - } - -} // end namespace vrpn_Event - diff --git a/src/vrpn/vrpn_Event.h b/src/vrpn/vrpn_Event.h deleted file mode 100644 index 311a5cbc44a3840e287373f51e11bfc777ae9eb1..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Event.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************************************/ -/* */ -/* Copyright (C) 2004 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/*************************************************************************************************/ -/* */ -/* module : vrpn_Event.h */ -/* project : */ -/* description: provide functionality for event interface */ -/* */ -/**************************************************************************************************/ - -#ifndef _VRPN_EVENT_H_ -#define _VRPN_EVENT_H_ - -#include "vrpn_Shared.h" // For struct timeval - -namespace vrpn_Event { - - // the struct read by the system when reading - struct input_event { - - struct timeval time; - unsigned short type; - unsigned short code; - unsigned int value; - }; - - // open the specified event interface - // return a valid handle to the event interface or -1 if the open fails - // file - full path of the event interface file - int vrpn_open_event( const char* file); - - // close the event interface - // fd - handle to the event interface - void vrpn_close_event( const int fd); - - // read from the interface - // returns the number of bytes read successfully - // fd - handle for the event interface - // data - handle to the read data - // max_elements - maximum number of elements to read - int vrpn_read_event( int fd, - input_event * data, - int max_elements); -} - -#endif // _VRPN_EVENT_H_ diff --git a/src/vrpn/vrpn_Event_Analog.C b/src/vrpn/vrpn_Event_Analog.C deleted file mode 100644 index ab9c3a8f48554257e2f1a197498cfbec74ac7b88..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Event_Analog.C +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************************************/ -/* */ -/* Copyright (C) 2004 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/**************************************************************************************************/ -/* */ -/* module : vrpn_Event_Analog.h */ -/* project : */ -/* description: base class for devices using event interface */ -/* */ -/**************************************************************************************************/ - - -// includes, system -#include <stdio.h> // for fprintf, stderr, NULL -#include "vrpn_Shared.h" // for vrpn_gettimeofday - -// includes, file -#include "vrpn_Event_Analog.h" - -class VRPN_API vrpn_Connection; - - -/**************************************************************************************************/ -/* constructor */ -/**************************************************************************************************/ -vrpn_Event_Analog::vrpn_Event_Analog ( const char * name, - vrpn_Connection * c, - const char* evdev_name) : - vrpn_Analog( name, c), - fd(-1), - event_data( event_vector_t( 16)), - max_num_events( 16) -{ - #if defined(_WIN32) - - fprintf( stderr, "vrpn_Event_Analog(): Not yet implemented on this architecture."); - - #else // #if defined(LINUX) - - // check if filename valid - if (0 == evdev_name) { - - fprintf(stderr,"vrpn_Event_Analog: No file name.\n"); - status = vrpn_ANALOG_FAIL; - - return; - } - - // open event interface - if ( -1 == (fd = vrpn_Event::vrpn_open_event( evdev_name))) { - - fprintf(stderr,"vrpn_Event_Analog: Failed to open event interface file.\n"); - - status = vrpn_ANALOG_FAIL; - } - else { - - // Reset the tracker - status = vrpn_ANALOG_RESETTING; - } - - // set the time - vrpn_gettimeofday(×tamp, NULL); - - #endif // #if defined(LINUX) -} - -/**************************************************************************************************/ -/* destructor */ -/**************************************************************************************************/ -vrpn_Event_Analog::~vrpn_Event_Analog () { - - #if defined(_WIN32) - - fprintf( stderr, "~vrpn_Event_Analog(): Not yet implemented on this architecture."); - - #else // #if defined(LINUX) - - // close handle if still valid - if ( -1 != fd) { - - vrpn_Event::vrpn_close_event( fd); - } - - #endif // #if defined(LINUX) -} - -/***************************************************************************************************/ -/* read the data */ -/***************************************************************************************************/ -int -vrpn_Event_Analog::read_available_data () { - - #if defined(_WIN32) - - return vrpn_Event::vrpn_read_event( fd, &(event_data.front()), max_num_events); - - #else // if defined(LINUX) - - // check for updates at max_num_events - if (max_num_events != event_data.size()) { - - event_data.resize( max_num_events); - - max_num_events = event_data.size(); - } - - // read data - return vrpn_Event::vrpn_read_event( fd, &(event_data.front()), max_num_events); - - #endif // #if defined(LINUX) -} diff --git a/src/vrpn/vrpn_Event_Analog.h b/src/vrpn/vrpn_Event_Analog.h deleted file mode 100644 index de6d92e52513e850099f77777383ed75278a559d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Event_Analog.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************************************/ -/* */ -/* Copyright (C) 2004 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/**************************************************************************************************/ -/* */ -/* module : vrpn_Event_Analog.h */ -/* project : */ -/* description: base class for devices using event interface */ -/* */ -/**************************************************************************************************/ - -#ifndef _VRPN_EVENT_ANALOG_H_ -#define _VRPN_EVENT_ANALOG_H_ - -// includes, system -#include <vector> // for vector - -// includes, project -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Event.h" // for input_event - -class VRPN_API vrpn_Connection; - -class VRPN_API vrpn_Event_Analog: public vrpn_Analog { - -public: - - // constructor - // evdev is the event file name - vrpn_Event_Analog( const char * name, - vrpn_Connection * connection, - const char * evdev_name); - - ~vrpn_Event_Analog(); - -protected: - - // read available events - // returns number of structs read successfully - int read_available_data(); - -protected: - - // typedefs for convenience - typedef std::vector<struct vrpn_Event::input_event> event_vector_t; - typedef event_vector_t::iterator event_iter_t; - - // handle to the event interface - int fd; - - // maximal number of event structs read at once - int max_num_events; - - // container for the event structs read - event_vector_t event_data; - -}; - -#endif // _VRPN_EVENT_ANALOG_H_ diff --git a/src/vrpn/vrpn_Event_Mouse.C b/src/vrpn/vrpn_Event_Mouse.C deleted file mode 100644 index 9ce6d1612529d0780bba101bd10d72b8ffa3f489..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Event_Mouse.C +++ /dev/null @@ -1,211 +0,0 @@ -/**************************************************************************************************/ -/* */ -/* Copyright (C) 2004 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/**************************************************************************************************/ -/* */ -/* module : vrpn_Event_Mouse.h */ -/* project : */ -/* description: mouse input using the event interface */ -/* */ -/***************************************************************************************************/ - - -#include "vrpn_Shared.h" // for vrpn_gettimeofday -#include <vector> // for vector - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Connection.h" // for vrpn_Connection -#include "vrpn_Event.h" // for input_event -// includes, file -#include "vrpn_Event_Mouse.h" -#include "vrpn_Types.h" // for vrpn_float64 - -// includes, system - -// includes, project - -#ifndef _WIN32 - - // defines, local - #define EV_KEY 0x01 - #define EV_REL 0x02 - #define REL_X 0x00 - #define REL_Y 0x01 - #define REL_Z 0x02 - #define BTN_LEFT 0x110 - #define BTN_RIGHT 0x111 - #define BTN_MIDDLE 0x112 - #define REL_WHEEL 0x08 - -#endif - - -/**************************************************************************************************/ -/* constructor (private) */ -/**************************************************************************************************/ -vrpn_Event_Mouse::vrpn_Event_Mouse( const char *name, - vrpn_Connection *c, - const char* evdev_name) : - vrpn_Event_Analog( name, c, evdev_name), - vrpn_Button_Server(name,c) -{ - vrpn_Button::num_buttons = 3; - vrpn_Analog::num_channel = 3; - - vrpn_gettimeofday(×tamp, 0); - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; - - clear_values(); -} - -/**************************************************************************************************/ -/* destructor */ -/* the work is done in the destructor of the base class */ -/**************************************************************************************************/ -vrpn_Event_Mouse::~vrpn_Event_Mouse() { - -} - -/**************************************************************************************************/ -/* mainloop */ -/**************************************************************************************************/ -void -vrpn_Event_Mouse::mainloop() { - - server_mainloop(); - - if ( ! d_connection->connected()) { - - return; - } - - // read and interpret data from the event interface - process_mouse_data(); - - // update message buffer - vrpn_Analog::report_changes(); - vrpn_Button::report_changes(); - - // send messages - d_connection->mainloop(); -} - -/**************************************************************************************************/ -/* helper function for mainloop */ -/**************************************************************************************************/ -void -vrpn_Event_Mouse::process_mouse_data() { - - // try to read data - if ( 0 == vrpn_Event_Analog::read_available_data()) { - - return; - } - - #if defined(_WIN32) - - fprintf( stderr, "vrpn_Event_Mouse::process_mouse_data(): Not yet implemented on this architecture."); - - #else // if defined(LINUX) - - int index; - - // process data stored by the base class - for( event_iter_t iter = event_data.begin(); iter != event_data.end(); ++iter) { - - switch ((*iter).type) { - case EV_REL: - switch ((*iter).code) { - case REL_X: - channel[0] = (signed int)(*iter).value; - break; - case REL_Y: - channel[1] = (signed int)(*iter).value; - break; - case REL_WHEEL: - channel[2] = (signed int)(*iter).value; - break; - } - break; - case EV_KEY: - switch ((*iter).code) { - case BTN_LEFT: - index = 0; - break; - case BTN_RIGHT: - index = 1; - break; - case BTN_MIDDLE: - index = 2; - break; - default: - return; - } - switch ((*iter).value) { - case 0: - case 1: - buttons[index]=(*iter).value; - break; - case 2: - break; - default: - return; - } - break; - } - } // end for loop - - #ifdef DEBUG - { - int i; - - printf("channel: "); - for (i = 0; i < vrpn_Analog::num_channel; ++i) { - - //printf("float %4.2f ",channel[i]); - printf("channel %d mit %f; ",i, channel[i]); - } - printf("\n"); - - printf("buttons: "); - for (i = 0; i < vrpn_Button::num_buttons; ++i) { - - //printf("float %4.2f ",buttons[i]); - printf("button %d mit %d; ",i,buttons[i]); - } - printf("\n"); - } - #endif - - #endif // if defined(LINUX) - - vrpn_gettimeofday(×tamp, 0); - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; -} - - - -/**************************************************************************************************/ -/* clear values, reset to 0 */ -/**************************************************************************************************/ -void -vrpn_Event_Mouse::clear_values() { - - int i; - for ( i = 0; i < vrpn_Button::num_buttons; ++i) { - - vrpn_Button::buttons[i] = 0; - vrpn_Button::lastbuttons[i] = 0; - } - - for ( i = 0; i < vrpn_Analog::num_channel; ++i) { - - vrpn_Analog::channel[i] = 0; - vrpn_Analog::last[i] = 0; - } -} diff --git a/src/vrpn/vrpn_Event_Mouse.h b/src/vrpn/vrpn_Event_Mouse.h deleted file mode 100644 index 7e6e62d3e639df208ce288b1a3f73fc2f697c8d3..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Event_Mouse.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************************************/ -/* */ -/* Copyright (C) 2004 Bauhaus University Weimar */ -/* Released into the public domain on 6/23/2007 as part of the VRPN project */ -/* by Jan P. Springer. */ -/* */ -/**************************************************************************************************/ -/* */ -/* module : vrpn_Event_Mouse.h */ -/* project : */ -/* description: mouse input using the event interface */ -/* */ -/**************************************************************************************************/ - - -#ifndef _VRPN_EVENT_MOUSE_H_ -#define _VRPN_EVENT_MOUSE_H_ - -#include "vrpn_Button.h" // for vrpn_Button_Server -#include "vrpn_Configure.h" // for VRPN_API -// includes, project -#include "vrpn_Event_Analog.h" // for vrpn_Event_Analog -#include "vrpn_Shared.h" // for timeval - -class VRPN_API vrpn_Connection; - - -class VRPN_API vrpn_Event_Mouse: public vrpn_Event_Analog, - public vrpn_Button_Server -{ - -public: - - // creates a vrpn_Event_Mouse - vrpn_Event_Mouse ( const char *name, vrpn_Connection *c = 0, - const char* evdev_name = "/dev/input/event0" ); - - // default dtor - ~vrpn_Event_Mouse(); - - // This routine is called each time through the server's main loop. It will - // read from the mouse. - void mainloop (void); - -private: - - // This routine interpret data from the device - void process_mouse_data (); - - // set all buttons and analogs to 0 - void clear_values(); - -private: - - struct timeval timestamp; -}; - -#endif // _VRPN_EVENT_MOUSE_H_ diff --git a/src/vrpn/vrpn_FileConnection.C b/src/vrpn/vrpn_FileConnection.C deleted file mode 100644 index ff163664d797f1fdc00a11b736073351409e5e2e..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_FileConnection.C +++ /dev/null @@ -1,1252 +0,0 @@ -// vrpn_FileConnection.C - -// {{{ includes and defines - -#include "vrpn_FileConnection.h" - -#ifndef _WIN32_WCE -#include <fcntl.h> // for SEEK_SET -#endif -#include <limits.h> // for LONG_MAX, LONG_MIN -#include <stdio.h> // for NULL, fprintf, stderr, etc -#include <string.h> // for memcpy - -// Include vrpn_Shared.h _first_ to avoid conflicts with sys/time.h -// and netinet/in.h and ... -#include "vrpn_Shared.h" // for timeval, etc -#if !(defined(_WIN32) && defined(VRPN_USE_WINSOCK_SOCKETS)) -#include <netinet/in.h> // for ntohl -#endif - -// Global variable used to indicate whether File Connections should -// pre-load all of their records into memory when opened. This is the -// default behavior, but fails on very large files that eat up all -// of the memory. -// This is used to initialize the data member for each new file connection -// so that it will do what is expected. This setting is stored per file -// connection so that a given file connection will behave consistently. - -bool vrpn_FILE_CONNECTIONS_SHOULD_PRELOAD = true; - -// Global variable used to indicate whether File Connections should -// keep already-read messages stored in memory. If not, then we have -// to re-load the file starting at the beginning on rewind. -// This is used to initialize the data member for each new file connection -// so that it will do what is expected. This setting is stored per file -// connection so that a given file connection will behave consistently. - -bool vrpn_FILE_CONNECTIONS_SHOULD_ACCUMULATE = true; - -// Global variable used to indicate whether File Connections should -// play through all system messages and get to the first user message -// when opened or reset to the beginning. This defaults to "true". -// User code should set this -// to "false" before calling vrpn_open_client_connection() or creating -// a new vrpn_File_Connection object if it wants that file connection -// to not skip the messages. The value is only checked at connection creation -// time; -// the connection behaves consistently once created. Leaving this true -// can help with offsets in time that happen at the beginning of files. - -bool vrpn_FILE_CONNECTIONS_SHOULD_SKIP_TO_USER_MESSAGES = true; - -#define CHECK(x) \ - if (x == -1) return -1 - -#include "vrpn_Log.h" // for vrpn_Log - -struct timeval; - -// }}} -// {{{ constructor - -vrpn_File_Connection::vrpn_File_Connection(const char *station_name, - const char *local_in_logfile_name, - const char *local_out_logfile_name) - : vrpn_Connection(local_in_logfile_name, local_out_logfile_name, NULL, NULL) - , d_controllerId(register_sender("vrpn File Controller")) - , d_set_replay_rate_type(register_message_type("vrpn_File set_replay_rate")) - , d_reset_type(register_message_type("vrpn_File reset")) - , d_play_to_time_type(register_message_type("vrpn_File play_to_time")) - , d_fileName(NULL) - , d_file(NULL) - , d_logHead(NULL) - , d_logTail(NULL) - , d_currentLogEntry(NULL) - , d_startEntry(NULL) - , d_preload(vrpn_FILE_CONNECTIONS_SHOULD_PRELOAD) - , d_accumulate(vrpn_FILE_CONNECTIONS_SHOULD_ACCUMULATE) -{ - d_last_told.tv_sec = 0; - d_last_told.tv_usec = 0; - - // Because we are a file connection, our status should be CONNECTED - // Later set this to BROKEN if there is a problem opening/reading the file. - if (d_endpoints[0] == NULL) { - fprintf(stderr, "vrpn_File_Connection::vrpn_File_Connection(): NULL " - "zeroeth endpoint\n"); - } - else { - connectionStatus = CONNECTED; - d_endpoints[0]->status = CONNECTED; - } - - // If we are preloading, then we must accumulate messages. - if (d_preload) { - d_accumulate = true; - } - - // These are handlers for messages that may be sent from a - // vrpn_File_Controller object that may attach itself to us. - register_handler(d_set_replay_rate_type, handle_set_replay_rate, this, - d_controllerId); - register_handler(d_reset_type, handle_reset, this, d_controllerId); - register_handler(d_play_to_time_type, handle_play_to_time, this, - d_controllerId); - - // necessary to initialize properly in mainloop() - d_last_time.tv_usec = d_last_time.tv_sec = 0; - - d_fileName = vrpn_copy_file_name(station_name); - if (!d_fileName) { - fprintf(stderr, "vrpn_File_Connection: Out of memory!\n"); - connectionStatus = BROKEN; - return; - } - - d_file = fopen(d_fileName, "rb"); - if (!d_file) { - fprintf(stderr, "vrpn_File_Connection: " - "Could not open file \"%s\".\n", - d_fileName); - connectionStatus = BROKEN; - return; - } - - // Read the cookie from the file. It will print an error message if it - // can't read it, so we just pass the broken status on up the chain. - if (read_cookie() < 0) { - connectionStatus = BROKEN; - return; - } - - // If we are supposed to preload the entire file into memory buffers, - // then keep reading until we get to the end. Otherwise, just read the - // first message to get things going. - if (d_preload) { - while (!read_entry()) { - } - } - else { - read_entry(); - } - - // Initialize the "current message" pointer to the first log-file - // entry that was read, and set the start time for the file and - // the current time to the one in this message. - if (d_logHead) { - d_currentLogEntry = d_logHead; - d_startEntry = d_logHead; - d_start_time = d_startEntry->data.msg_time; - d_time = d_start_time; - d_earliest_user_time.tv_sec = d_earliest_user_time.tv_usec = 0; - d_earliest_user_time_valid = false; - d_highest_user_time.tv_sec = d_highest_user_time.tv_usec = 0; - d_highest_user_time_valid = false; - } - else { - fprintf(stderr, "vrpn_File_Connection: Can't read first message\n"); - connectionStatus = BROKEN; - return; - } - - // This is useful to play the initial system messages - // (the sender/type ones) automatically. These might not be - // time synched so if we don't play them automatically they - // can mess up playback if their timestamps are later than - // the first user message. - if (vrpn_FILE_CONNECTIONS_SHOULD_SKIP_TO_USER_MESSAGES) { - play_to_user_message(); - if (d_currentLogEntry) { - d_start_time = d_currentLogEntry->data.msg_time; - d_time = d_start_time; - } - } - - // Add this to the list of known connections. - vrpn_ConnectionManager::instance().addConnection(this, station_name); -} - -// }}} -// {{{ play_to_user_message - -// Advances through the file, calling callbacks, up until -// a user message (type >= 0) is encountered) -void vrpn_File_Connection::play_to_user_message(void) -{ - // As long as the current message is a system message, play it. - // Also stop if we get to the end of the file. - while (d_currentLogEntry && (d_currentLogEntry->data.type < 0)) { - playone(); - } - - // we advance d_time one ahead because they're may be - // a large gap in the file (forward or backwards) between - // the last system message and first user one - if (d_currentLogEntry) { - d_time = d_currentLogEntry->data.msg_time; - } -} - -// }}} -// {{{ destructor - -// virtual -vrpn_File_Connection::~vrpn_File_Connection(void) -{ - vrpn_LOGLIST *np; - - // Remove myself from the "known connections" list - // (or the "anonymous connections" list). - vrpn_ConnectionManager::instance().deleteConnection(this); - - close_file(); - delete[] d_fileName; - d_fileName = NULL; - - // Delete any messages that are in memory, and their data buffers. - while (d_logHead) { - np = d_logHead->next; - if (d_logHead->data.buffer) { - delete[](char *)d_logHead -> data.buffer; - } - delete d_logHead; - d_logHead = np; - } -} - -// }}} -// {{{ jump_to_time - -// newtime is an elapsed time from the start of the file -int vrpn_File_Connection::jump_to_time(vrpn_float64 newtime) -{ - return jump_to_time(vrpn_MsecsTimeval(newtime * 1000)); -} - -// If the time is before our current time (or there is no current -// time) then reset back to the beginning. Whether or not we did -// that, search forwards until we get to or past the time we are -// searching for. -// newtime is an elapsed time from the start of the file -int vrpn_File_Connection::jump_to_time(timeval newtime) -{ - if (d_earliest_user_time_valid) { - d_time = vrpn_TimevalSum(d_earliest_user_time, newtime); - } - else { - d_time = vrpn_TimevalSum(d_start_time, newtime); - } // XXX get rid of this option - dtm - - // If the time is earlier than where we are, or if we have - // run past the end (no current entry), jump back to - // the beginning of the file before searching. - if (!d_currentLogEntry || - vrpn_TimevalGreater(d_currentLogEntry->data.msg_time, d_time)) { - reset(); - } - - // Search forwards, as needed. Do not play the messages as they are - // passed, just skip over them until we get to a message that has a - // time greater than or equal to the one we are looking for. That is, - // one whose time is not less than ours. - while (!vrpn_TimevalGreater(d_currentLogEntry->data.msg_time, d_time)) { - int ret = advance_currentLogEntry(); - if (ret != 0) { - return 0; // Didn't get where we were going! - } - } - - return 1; // Got where we were going! -} - -int vrpn_File_Connection::jump_to_filetime(timeval absolute_time) -{ - if (d_earliest_user_time_valid) { - return jump_to_time( - vrpn_TimevalDiff(absolute_time, d_earliest_user_time)); - } - else { - return jump_to_time(vrpn_TimevalDiff(absolute_time, d_start_time)); - } // XX get rid of this option - dtm -} - -// }}} -// {{{ vrpn_File_Connection::FileTime_Accumulator -vrpn_File_Connection::FileTime_Accumulator::FileTime_Accumulator() - : d_replay_rate(1.0) -{ - d_filetime_accum_since_last_playback.tv_sec = 0; - d_filetime_accum_since_last_playback.tv_usec = 0; - - d_time_of_last_accum.tv_sec = 0; - d_time_of_last_accum.tv_usec = 0; -} - -void vrpn_File_Connection::FileTime_Accumulator::accumulate_to( - const timeval &now_time) -{ - timeval &accum = d_filetime_accum_since_last_playback; - timeval &last_accum = d_time_of_last_accum; - - accum // updated elapsed filetime - = vrpn_TimevalSum( // summed with previous elapsed time - accum, - vrpn_TimevalScale( // scaled by replay rate - vrpn_TimevalDiff( // elapsed wallclock time - now_time, d_time_of_last_accum), - d_replay_rate)); - last_accum = now_time; // wallclock time of this whole mess -} - -void vrpn_File_Connection::FileTime_Accumulator::set_replay_rate( - vrpn_float32 new_rate) -{ - timeval now_time; - vrpn_gettimeofday(&now_time, NULL); - accumulate_to(now_time); - - d_replay_rate = new_rate; - // fprintf(stderr, "Set replay rate!\n"); -} - -void vrpn_File_Connection::FileTime_Accumulator::reset_at_time( - const timeval &now_time) -{ - // this function is confusing. It doesn't appear to do anything. - // (I added the next three lines. did I delete what was previously there?) - d_filetime_accum_since_last_playback.tv_sec = 0; - d_filetime_accum_since_last_playback.tv_usec = 0; - d_time_of_last_accum = now_time; -} -// {{{ end vrpn_File_Connection::FileTime_Accumulator -// }}} - -// }}} -// {{{ mainloop - -// {{{ -- comment - -// [juliano 10/11/99] the problem described below is now fixed -// [juliano 8/26/99] I believe there to be a bug in mainloop. -// -// Essentially, the computation of end_time is sample-and-hold -// integration, using the value of d_rate at the end of the integration -// window. Consider the case where you are happily playing from your -// file, then pause it. Pausing is accomplished by setting d_rate to -// zero. Then, 10 minutes later, you unpause by setting d_rate to one. -// -// Now, you have an integration window of 10 minutes. The way it's -// currently implemented, you will compute end_time as d_rate * 10 -// minutes. This is obviously not correct. -// -// So, what is the ideal way this would work? Well, if you had continuous -// integration and asynchronous events, then the new message would come at -// the same time as it would if we executed the same scenerio with a VCR. -// -// Since our value of d_rate changes by impulses at specified times (it -// only changes from inside set_replay_rate) sample-and-hold integration -// can still be used to do exact computation. What we need to do is -// accumulate "virtial time", and compare with it. By "virtual time" I -// mean the analog to VITC timestamps on a videotape in a VCR. We will -// accumulate it in d_virtual_time_elapsed_since_last_event. The units -// need to have enough precision that we won't run into any of the -// problems that have already been worked around in the code below. It -// represents the amount of time elapsed sice d_last_time was last set. -// -// set_replay_rate will do sample-and-hold integration over the window -// from d_last_time to the result of vrpn_gettimeofday(), and it will -// accumulate the result into d_virtual_time_elapsed_since_last_event. -// then it will set d_last_time to the result of vrpn_gettimeofday(). -// -// mainloop will also do sample-and-hold integration over the window -// [d_last_time:vrpn_gettimeofday()], and accumulate the result into -// d_virtual_time_elapsed_since_last_event. Then it will compute end_time -// by adding d_time and d_virtual_time_elapsed_since_last_event. iff an -// event is played from the file, d_last_time will be set to now_time and -// d_virtual_time_elapsed_since_last_event will be zero'd. - -// }}} - -// virtual -int vrpn_File_Connection::mainloop(const timeval * /*timeout*/) -{ - // XXX timeout ignored for now, needs to be added - - timeval now_time; - vrpn_gettimeofday(&now_time, NULL); - - if ((d_last_time.tv_sec == 0) && (d_last_time.tv_usec == 0)) { - // If first iteration, consider 0 time elapsed - d_last_time = now_time; - d_filetime_accum.reset_at_time(now_time); - return 0; - } - - // now_time: current wallclock time (on method entry) - // d_last_time: wallclock time of last call to mainloop - // (juliano-8/26/99) NO! It is the time the - // wallclock read (at the top of mainloop) when the - // last event was played back from the file. - // If you call mainloop frequently enough, - // these are not necessarily the same! - // (may call mainloop too soon and then no event - // is played back from the file) - // d_time: current time in file - // end_time: computed time in file - // d_rate: wallclock -> fileclock rate scale factor - // goal: compute end_time, then advance to it - // - // scale elapsed time by d_rate (rate of replay); - // this gives us the time to advance (skip_time) - // our clock to (next_time). - // -- see note above! - // - // const timeval real_elapsed_time // amount of ellapsed wallclock time - // = vrpn_TimevalDiff( now_time, d_last_time ); - // const timeval skip_time // scale it by d_rate - // = vrpn_TimevalScale( real_elapsed_time, d_rate ); - // const timeval end_time // add it to the last file-time - // = vrpn_TimevalSum( d_time, skip_time ); - // - // ------ new way of calculating end_time ------------ - - d_filetime_accum.accumulate_to(now_time); - const timeval end_time = - vrpn_TimevalSum(d_time, d_filetime_accum.accumulated()); - - // (winston) Had to add need_to_play() because at fractional rates - // (even just 1/10th) the d_time didn't accumulate properly - // because tiny intervals after scaling were too small - // for a timeval to represent (1us minimum). - // - // (juliano-8/26/99) if ((end_time - timestamp of next event) < 1us) - // then you have run out of precision in the struct timeval when - // need_to_play differences those two timevals. I.e., they - // appear to be the same time. - // need_to_play will return n:n>1 only if this difference - // is non-zero. - // - // (juliano-8/25/99) need_to_play is not a boolean function! - // it returns n:n>0 if you need to play - // n=0 if the timevals compare equal - // n=-1 if there was an error reading the next event - // from the log file - const int need_to_play_retval = need_to_play(end_time); - - if (need_to_play_retval > 0) { - d_last_time = now_time; - d_filetime_accum.reset_at_time(now_time); - const int rv = play_to_filetime(end_time); - return rv; - } - else if (need_to_play_retval == 0) { - // (winston) we don't set d_last_time so that we can more - // accurately measure the (larger) interval next time around - // - // (juliano-8/26/99) sounds right. Only set d_last_time - // if you actually played some event from the file. - // You may get here if you have your data in more than one - // file, and are trying to play back from the files in lockstep. - // The tracker group does this to run the hybrid tracking - // algorithm on both an inertial data file and a hiball - // tracker file that were recorded with synchronized clocks. - return 0; - } - else { - // return something to indicate there was an error - // reading the file - return -1; - - // an error occurred while reading the next event from the file - // let's close the connection. - // XXX(jj) is this the right thing to do? - // XXX(jj) for now, let's leave it how it was - // XXX(jj) come back to this and do it right - /* - fprintf( stderr, "vrpn_File_Connection::mainloop(): error - reading " - "next event from file. Skipping to end of file. " - "XXX Please edit this function and fix it. It should - probably" - " close the connection right here and now.\n"); - d_last_time = now_time; - d_filetime_accum.reset_at_time( now_time ); - return play_to_filetime(end_time); - */ - } -} - -// }}} -// {{{ need_to_play - -// checks if there is at least one log entry that occurs -// between the current d_time and the given filetime -// -// [juliano 9/24/99] the above comment is almost right -// the upper bound of the interval is not open, -// but closed at time_we_want_to_play_to. -// -// this function checks if the next message to play back -// from the stream file has a timestamp LESSTHAN OR EQUAL TO -// the argument to this function (which is the time that we -// wish to play to). If it does, then a pos value is returned -// -// you can pause playback of a streamfile by ceasing to increment -// the value that is passed to this function. However, if the next -// message in the streamfile has the same timestamp as the previous -// one, it will get played anyway. Pause will not be achieved until -// all such messages have been played. -// -// Beware: make sure you put the correct timestamps on individual -// messages when recording them in chunks (batches) -// to a time to a streamfile. -// -int vrpn_File_Connection::need_to_play(timeval time_we_want_to_play_to) -{ - // This read_entry() call may be useful to test the state, but - // it should be the case that d_currentLogEntry is non-NULL except - // when we are at the end. This is because read_entry() and the - // constructor now both read the next one in when they are finished. - if (!d_currentLogEntry) { - int retval = read_entry(); - if (retval < 0) { - return -1; - } // error reading from file - if (retval > 0) { - return 0; - } // end of file; nothing to replay - d_currentLogEntry = - d_logTail; // If read_entry() returns 0, this will be non-NULL - } - - vrpn_HANDLERPARAM &header = d_currentLogEntry->data; - - // [juliano 9/24/99] is this right? - // this is a ">" test, not a ">=" test - // consequently, this function keeps returning true until the - // next message is timestamped greater. So, if a group of - // messages share a timestamp, you cannot pause streamfile - // replay anywhere inside the group. - // - // this is true, but do you ever want to pause in the middle of - // such a group? This was a problem prior to fixing the - // timeval overflow bug, but now that it's fixed, (who cares?) - - return vrpn_TimevalGreater(time_we_want_to_play_to, header.msg_time); -} - -// }}} -// {{{ play_to_time and play_to_filetime - -// plays to an elapsed end_time (in seconds) -int vrpn_File_Connection::play_to_time(vrpn_float64 end_time) -{ - return play_to_time(vrpn_MsecsTimeval(end_time * 1000)); -} - -// plays to an elapsed end_time -int vrpn_File_Connection::play_to_time(timeval end_time) -{ - if (d_earliest_user_time_valid) { - return play_to_filetime( - vrpn_TimevalSum(d_earliest_user_time, end_time)); - } - else { - return play_to_filetime(vrpn_TimevalSum(d_start_time, end_time)); - } -} - -// plays all entries between d_time and end_filetime -// returns -1 on error, 0 on success -int vrpn_File_Connection::play_to_filetime(const timeval end_filetime) -{ - vrpn_uint32 playback_this_iteration = 0; - - if (vrpn_TimevalGreater(d_time, end_filetime)) { - // end_filetime is BEFORE d_time (our current time in the stream) - // so, we need to go backwards in the stream - // currently, this is implemented by - // * rewinding the stream to the beginning - // * playing log messages one at a time until we get to end_filetime - reset(); - } - - int ret; - while ((ret = playone_to_filetime(end_filetime)) == 0) { - // * you get here ONLY IF playone_to_filetime returned 0 - // * that means that it played one entry - - playback_this_iteration++; - if ((get_Jane_value() > 0) && - (playback_this_iteration >= get_Jane_value())) { - // Early exit from the loop - // Don't reset d_time to end_filetime - return 0; - } - } - - if (ret == 1) { - // playone_to_filetime finished or EOF no error for us - // Set log position to the exact requested ending time, - // don't leave it at the last log entry time - d_time = end_filetime; - ret = 0; - } - - return ret; -} - -// }}} -// {{{ rest - -// returns 1 if we're at the EOF, -1 on error -int vrpn_File_Connection::eof() -{ - if (d_currentLogEntry) { - return 0; - } - // read from disk if not in memory - int ret = read_entry(); - if (ret == 0) { - d_currentLogEntry = - d_logTail; // If read_entry() returns zero, this will be non-NULL - } - - return ret; -} - -// plays at most one entry which comes before end_filetime -// returns -// -1 on error (including EOF, call eof() to test) -// 0 for normal result (played one entry) -int vrpn_File_Connection::playone() -{ - static const timeval tvMAX = {LONG_MAX, 999999L}; - - int ret = playone_to_filetime(tvMAX); - if (ret != 0) { - // consider a 1 return from playone_to_filetime() to be - // an error since it should never reach tvMAX - return -1; - } - else { - return 0; - } -} - -// plays at most one entry which comes before end_filetime -// returns -// -1 on error (including EOF, call eof() to test) -// 0 for normal result (played one entry) -// 1 if we hit end_filetime -int vrpn_File_Connection::playone_to_filetime(timeval end_filetime) -{ - vrpn_Endpoint *endpoint = d_endpoints[0]; - timeval now; - int retval; - - // If we don't have a currentLogEntry, then we've gone past the end of the - // file. - if (!d_currentLogEntry) { - return 1; - } - - vrpn_HANDLERPARAM &header = d_currentLogEntry->data; - - if (vrpn_TimevalGreater(header.msg_time, end_filetime)) { - // there are no entries to play after the current - // but before end_filetime - return 1; - } - - // TCH July 2001 - // XXX A big design decision: do we re-log messages exactly, - // or do we mark them with the time they were played back? - // Maybe this should be switchable, but the latter is what - // I need yesterday. - vrpn_gettimeofday(&now, NULL); - retval = endpoint->d_inLog->logIncomingMessage( - header.payload_len, now, header.type, header.sender, header.buffer); - if (retval) { - fprintf(stderr, "Couldn't log \"incoming\" message during replay!\n"); - return -1; - } - - // advance current file position - d_time = header.msg_time; - - // Handle this log entry - if (header.type >= 0) { -#ifdef VERBOSE - printf("vrpn_FC: Msg Sender (%s), Type (%s), at (%ld:%ld)\n", - endpoint->other_senders[header.sender].name, - endpoint->other_types[header.type].name, header.msg_time.tv_sec, - header.msg_time.tv_usec); -#endif - if (endpoint->local_type_id(header.type) >= 0) { - if (do_callbacks_for(endpoint->local_type_id(header.type), - endpoint->local_sender_id(header.sender), - header.msg_time, header.payload_len, - header.buffer)) { - return -1; - } - } - } - else { // system handler - - if (header.type != vrpn_CONNECTION_UDP_DESCRIPTION) { - if (doSystemCallbacksFor(header, endpoint)) { - fprintf(stderr, "vrpn_File_Connection::playone_to_filename: " - "Nonzero system return.\n"); - return -1; - } - } - } - - return advance_currentLogEntry(); -} - -// Advance to next entry. If there is no next entry, and if we have -// not preloaded, then try to read one in. -int vrpn_File_Connection::advance_currentLogEntry(void) -{ - // If we don't have a currentLogEntry, then we've gone past the end of the - // file. - if (!d_currentLogEntry) { - return 1; - } - - d_currentLogEntry = d_currentLogEntry->next; - if (!d_currentLogEntry && !d_preload) { - int retval = read_entry(); - if (retval != 0) { - return -1; // error reading from file or EOF - } - d_currentLogEntry = - d_logTail; // If read_entry() returns zero, this will be non-NULL - } - - return 0; -} - -double vrpn_File_Connection::get_length_secs() -{ - return vrpn_TimevalMsecs(get_length()) / 1000; -} - -// virtual -timeval vrpn_File_Connection::get_length() -{ - timeval len = {0, 0}; - - if (!d_earliest_user_time_valid || !d_highest_user_time_valid) { - this->get_lowest_user_timestamp(); - this->get_highest_user_timestamp(); - } - - len = vrpn_TimevalDiff(d_highest_user_time, d_earliest_user_time); - return len; -} - -timeval vrpn_File_Connection::get_lowest_user_timestamp() -{ - if (!d_earliest_user_time_valid) find_superlative_user_times(); - return d_earliest_user_time; -} - -timeval vrpn_File_Connection::get_highest_user_timestamp() -{ - if (!d_highest_user_time_valid) find_superlative_user_times(); - return d_highest_user_time; -} - -void vrpn_File_Connection::find_superlative_user_times() -{ - timeval high = {0, 0}; - timeval low = {LONG_MAX, 999999L}; - - // Remember where we were when we asked this question - bool retval = store_stream_bookmark(); - if (retval == false) { -#ifdef VERBOSE - printf("vrpn_File_Connection::find_superlative_user_times: didn't " - "successfully save bookmark.\n"); -#endif - return; - } - - // Go to the beginning of the file and then run through all - // of the messages to find the one with the lowest/highest value - reset(); - do { - if (d_currentLogEntry && (d_currentLogEntry->data.type >= 0)) { - if (vrpn_TimevalGreater(d_currentLogEntry->data.msg_time, high)) { - high = d_currentLogEntry->data.msg_time; - } - if (vrpn_TimevalGreater(low, d_currentLogEntry->data.msg_time)) { - low = d_currentLogEntry->data.msg_time; - } - } - } while (d_currentLogEntry && (advance_currentLogEntry() == 0)); - - // We have our value. Set it and go back where - // we came from, but don't play the records along - // the way. - retval = return_to_bookmark(); - if (retval == false) { - // oops. we've really screwed things up. - fprintf(stderr, "vrpn_File_Connection::find_superlative_user_times " - "messed up the location in the file stream.\n"); - reset(); - return; - } - - if (high.tv_sec != LONG_MIN) // we found something - { - d_highest_user_time = high; - d_highest_user_time_valid = true; - } -#ifdef VERBOSE - else { - fprintf( stderr, "vrpn_File_Connection::find_superlative_user_times: did not find a highest-time user message\n" - } -#endif - - if (low.tv_sec != LONG_MAX) // we found something - { - d_earliest_user_time = low; - d_earliest_user_time_valid = true; - } -#ifdef VERBOSE - else { - fprintf( stderr, "vrpn_File_Connection::find_superlative_user_times: did not find an earliest user message\n" - } -#endif - -} // end find_superlative_user_times - -vrpn_File_Connection::vrpn_FileBookmark::vrpn_FileBookmark() -{ - valid = false; - file_pos = -1; - oldTime.tv_sec = 0; - oldTime.tv_usec = 0; - oldCurrentLogEntryPtr = NULL; - oldCurrentLogEntryCopy = NULL; -} - -vrpn_File_Connection::vrpn_FileBookmark::~vrpn_FileBookmark() -{ - if (oldCurrentLogEntryCopy == NULL) return; - if (oldCurrentLogEntryCopy->data.buffer != NULL) - delete[](char *)(oldCurrentLogEntryCopy->data.buffer); - delete oldCurrentLogEntryCopy; -} - -bool vrpn_File_Connection::store_stream_bookmark() -{ - if (d_preload) { - // everything is already in memory, so just remember where we were - d_bookmark.oldCurrentLogEntryPtr = d_currentLogEntry; - d_bookmark.oldTime = d_time; - } - else if (d_accumulate) // but not pre-load - { - // our current location will remain in memory - d_bookmark.oldCurrentLogEntryPtr = d_currentLogEntry; - d_bookmark.file_pos = ftell(d_file); - d_bookmark.oldTime = d_time; - } - else // !preload and !accumulate - { - d_bookmark.oldTime = d_time; - d_bookmark.file_pos = ftell(d_file); - if (d_currentLogEntry == NULL) // at the end of the file - { - if (d_bookmark.oldCurrentLogEntryCopy != NULL) { - if (d_bookmark.oldCurrentLogEntryCopy->data.buffer != NULL) - delete[]( - char *)(d_bookmark.oldCurrentLogEntryCopy->data.buffer); - delete d_bookmark.oldCurrentLogEntryCopy; - } - d_bookmark.oldCurrentLogEntryCopy = NULL; - } - else { - if (d_bookmark.oldCurrentLogEntryCopy == NULL) { - d_bookmark.oldCurrentLogEntryCopy = new vrpn_LOGLIST(); - if (d_bookmark.oldCurrentLogEntryCopy == NULL) { - fprintf(stderr, "Out of memory error: " - "vrpn_File_Connection::store_stream_" - "bookmark\n"); - d_bookmark.valid = false; - return false; - } - d_bookmark.oldCurrentLogEntryCopy->next = - d_bookmark.oldCurrentLogEntryCopy->prev = NULL; - d_bookmark.oldCurrentLogEntryCopy->data.buffer = NULL; - } - d_bookmark.oldCurrentLogEntryCopy->next = d_currentLogEntry->next; - d_bookmark.oldCurrentLogEntryCopy->prev = d_currentLogEntry->prev; - d_bookmark.oldCurrentLogEntryCopy->data.type = - d_currentLogEntry->data.type; - d_bookmark.oldCurrentLogEntryCopy->data.sender = - d_currentLogEntry->data.sender; - d_bookmark.oldCurrentLogEntryCopy->data.msg_time = - d_currentLogEntry->data.msg_time; - d_bookmark.oldCurrentLogEntryCopy->data.payload_len = - d_currentLogEntry->data.payload_len; - if (d_bookmark.oldCurrentLogEntryCopy->data.buffer != NULL) { - delete[](char *)d_bookmark.oldCurrentLogEntryCopy->data.buffer; - } - d_bookmark.oldCurrentLogEntryCopy->data.buffer = - new char[d_currentLogEntry->data.payload_len]; - if (d_bookmark.oldCurrentLogEntryCopy->data.buffer == NULL) { - d_bookmark.valid = false; - return false; - } - memcpy((char *)d_bookmark.oldCurrentLogEntryCopy->data.buffer, - d_currentLogEntry->data.buffer, - d_currentLogEntry->data.payload_len); - } - } - d_bookmark.valid = true; - return true; -} - -bool vrpn_File_Connection::return_to_bookmark() -{ - int retval = 0; - if (!d_bookmark.valid) return false; - if (d_preload) { - d_time = d_bookmark.oldTime; - d_currentLogEntry = d_bookmark.oldCurrentLogEntryPtr; - } - else if (d_accumulate) // but not pre-load - { - d_time = d_bookmark.oldTime; - d_currentLogEntry = d_bookmark.oldCurrentLogEntryPtr; - retval |= fseek(d_file, d_bookmark.file_pos, SEEK_SET); - } - else // !preload and !accumulate - { - if (d_bookmark.oldCurrentLogEntryCopy == NULL) { - // we were at the end of the file. - d_currentLogEntry = d_logHead = d_logTail = NULL; - d_time = d_bookmark.oldTime; - retval |= fseek(d_file, d_bookmark.file_pos, SEEK_SET); - } - else { - char *newBuffer = - new char[d_bookmark.oldCurrentLogEntryCopy->data.payload_len]; - if (newBuffer == NULL) { // make sure we can allocate the memory - // before we do anything else - return false; - } - d_time = d_bookmark.oldTime; - retval |= fseek(d_file, d_bookmark.file_pos, SEEK_SET); - if (d_currentLogEntry == NULL) // we are at the end of the file - { - d_currentLogEntry = new vrpn_LOGLIST(); - d_currentLogEntry->data.buffer = 0; - } - d_currentLogEntry->next = d_bookmark.oldCurrentLogEntryCopy->next; - d_currentLogEntry->prev = d_bookmark.oldCurrentLogEntryCopy->prev; - d_currentLogEntry->data.type = - d_bookmark.oldCurrentLogEntryCopy->data.type; - d_currentLogEntry->data.sender = - d_bookmark.oldCurrentLogEntryCopy->data.sender; - d_currentLogEntry->data.msg_time = - d_bookmark.oldCurrentLogEntryCopy->data.msg_time; - d_currentLogEntry->data.payload_len = - d_bookmark.oldCurrentLogEntryCopy->data.payload_len; - char *temp = (char *)d_currentLogEntry->data.buffer; - d_currentLogEntry->data.buffer = newBuffer; - memcpy((char *)d_currentLogEntry->data.buffer, - d_bookmark.oldCurrentLogEntryCopy->data.buffer, - d_currentLogEntry->data.payload_len); - if (temp) delete[] temp; - d_logHead = d_logTail = d_currentLogEntry; - } - } - return (retval == 0); -} - -const char *vrpn_File_Connection::get_filename() { return d_fileName; } - -// Returns the time since the connection opened. -// Some subclasses may redefine time. -// virtual -int vrpn_File_Connection::time_since_connection_open(timeval *elapsed_time) -{ - if (!d_earliest_user_time_valid) { - this->find_superlative_user_times(); - } - if (d_earliest_user_time_valid) { - *elapsed_time = vrpn_TimevalDiff(d_time, d_earliest_user_time); - } - else { - *elapsed_time = vrpn_TimevalDiff(d_time, d_start_time); - } // XXX get rid of this option - dtm - - return 0; -} - -// virtual -vrpn_File_Connection *vrpn_File_Connection::get_File_Connection(void) -{ - return this; -} - -// {{{ read_cookie and read_entry - -// Reads a cookie from the logfile and calls check_vrpn_cookie() -// (from vrpn_Connection.C) to check it. -// Returns -1 on no cookie or cookie mismatch (which should cause abort), -// 0 otherwise. - -// virtual -int vrpn_File_Connection::read_cookie(void) -{ - char readbuf[2048]; // HACK! - size_t bytes = fread(readbuf, vrpn_cookie_size(), 1, d_file); - if (bytes == 0) { - fprintf(stderr, "vrpn_File_Connection::read_cookie: " - "No cookie. If you're sure this is a logfile, " - "run add_vrpn_cookie on it and try again.\n"); - return -1; - } - - int retval = check_vrpn_file_cookie(readbuf); - if (retval < 0) { - return -1; - } - - // TCH July 2001 - if (!d_endpoints[0]) { - fprintf(stderr, "vrpn_File_Connection::read_cookie: " - "No endpoints[0]. Internal failure.\n"); - return -1; - } - d_endpoints[0]->d_inLog->setCookie(readbuf); - - return 0; -} - -// virtual -int vrpn_File_Connection::read_entry(void) -{ - vrpn_LOGLIST *newEntry; - size_t retval; - - newEntry = new vrpn_LOGLIST; - if (!newEntry) { - fprintf(stderr, "vrpn_File_Connection::read_entry: Out of memory.\n"); - return -1; - } - - // Only print this message every second or so - if (!d_file) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - if (now.tv_sec != d_last_told.tv_sec) { - fprintf(stderr, "vrpn_File_Connection::read_entry: no open file\n"); - memcpy(&d_last_told, &now, sizeof(d_last_told)); - } - delete newEntry; - return -1; - } - - // Get the header of the next message. This was done as a horrible - // hack in the past, where we read the sizeof a struct from the file, - // including a pointer. This of course changed on 64-bit architectures. - // The pointer value was not needed. We now read it as an array of - // 32-bit values and then stuff these into the structure. Unfortunately, - // we now need to both send and read the bogus pointer value if we want - // to be compatible with old versions of log files. - - vrpn_HANDLERPARAM &header = newEntry->data; - vrpn_int32 values[6]; - retval = fread(values, sizeof(vrpn_int32), 6, d_file); - - // return 1 if nothing to read OR end-of-file; - // the latter isn't an error state - if (retval <= 0) { - // Don't close the file because we might get a reset message... - delete newEntry; - return 1; - } - - header.type = ntohl(values[0]); - header.sender = ntohl(values[1]); - header.msg_time.tv_sec = ntohl(values[2]); - header.msg_time.tv_usec = ntohl(values[3]); - header.payload_len = ntohl(values[4]); - header.buffer = - NULL; // values[5] is ignored -- it used to hold the bogus pointer. - - // get the body of the next message - - if (header.payload_len > 0) { - header.buffer = new char[header.payload_len]; - if (!header.buffer) { - fprintf(stderr, "vrpn_File_Connection::read_entry: " - "Out of memory.\n"); - return -1; - } - - retval = fread((char *)header.buffer, 1, header.payload_len, d_file); - } - - // return 1 if nothing to read OR end-of-file; - // the latter isn't an error state - if (retval <= 0) { - // Don't close the file because we might get a reset message... - return 1; - } - - // If we are accumulating messages, keep the list of them up to - // date. If we are not, toss the old to make way for the new. - // Whenever this function returns 0, we need to have set the - // Head and Tail to something non-NULL. - - if (d_accumulate) { - - // doubly-linked list maintenance, putting this one at the tail. - newEntry->next = NULL; - newEntry->prev = d_logTail; - if (d_logTail) { - d_logTail->next = newEntry; - } - d_logTail = newEntry; - - // If we've not gotten any messages yet, this one is also the - // head. - if (!d_logHead) { - d_logHead = d_logTail; - } - } - else { // Don't keep old list entries. - - // If we had a message before, get rid of it and its data now. We - // could use either Head or Tail here because they will point - // to the same message. - if (d_logTail) { - if (d_logTail->data.buffer) { - delete[](char *)d_logTail -> data.buffer; - } - delete d_logTail; - } - - // This is the only message in memory, so it is both the - // head and the tail of the memory list. - d_logHead = d_logTail = newEntry; - - // The new entry is not linked to any others (there are no others) - newEntry->next = NULL; - newEntry->prev = NULL; - } - - return 0; -} -// }}} - -// virtual -int vrpn_File_Connection::close_file() -{ - if (d_file) { - fclose(d_file); - } - d_file = NULL; - return 0; -} - -int vrpn_File_Connection::reset() -{ - // make it as if we never saw any messages from our previous activity - d_endpoints[0]->drop_connection(); - - // If we are accumulating, reset us back to the beginning of the memory - // buffer chain. Otherwise, go back to the beginning of the file and - // then read the magic cookie and then the first entry again. - if (d_accumulate) { - d_currentLogEntry = d_startEntry; - } - else { - rewind(d_file); - read_cookie(); - read_entry(); - d_startEntry = d_currentLogEntry = d_logHead; - } - d_time = d_startEntry->data.msg_time; - // reset for mainloop() - d_last_time.tv_usec = d_last_time.tv_sec = 0; - d_filetime_accum.reset_at_time(d_last_time); - - // This is useful to play the initial system messages - // (the sender/type ones) automatically. These might not be - // time synched so if we don't play them automatically they - // can mess up playback if their timestamps are later then - // the first user message. - if (vrpn_FILE_CONNECTIONS_SHOULD_SKIP_TO_USER_MESSAGES) { - play_to_user_message(); - } - - return 0; -} - -// static -int vrpn_File_Connection::handle_set_replay_rate(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_File_Connection *me = (vrpn_File_Connection *)userdata; - - const char *bufPtr = p.buffer; - me->set_replay_rate(vrpn_unbuffer<vrpn_float32>(bufPtr)); - - return 0; -} - -// static -int vrpn_File_Connection::handle_reset(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_File_Connection *me = (vrpn_File_Connection *)userdata; - - // fprintf(stderr, "In vrpn_File_Connection::handle_reset().\n"); - - return me->reset(); -} - -// static -int vrpn_File_Connection::handle_play_to_time(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_File_Connection *me = (vrpn_File_Connection *)userdata; - timeval newtime; - - newtime.tv_sec = ((vrpn_int32 *)(p.buffer))[0]; - newtime.tv_usec = ((vrpn_int32 *)(p.buffer))[1]; - - return me->play_to_time(newtime); -} - -int vrpn_File_Connection::send_pending_reports(void) -{ - // Do nothing except clear the buffer - - // file connections aren't really connected to anything. - - d_endpoints[0]->clearBuffers(); // Clear the buffer for the next time - return 0; -} - -// }}} diff --git a/src/vrpn/vrpn_FileConnection.h b/src/vrpn/vrpn_FileConnection.h deleted file mode 100644 index be0a44d99f20cf54a4592e0c9d682d00343ceb47..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_FileConnection.h +++ /dev/null @@ -1,326 +0,0 @@ -#ifndef VRPN_FILE_CONNECTION_H -#define VRPN_FILE_CONNECTION_H - -// {{{ vrpn_File_Connection -// -// Tom Hudson, June 1998 - -// This class *reads* a file written out by vrpn_Connection's logging hooks. - -// The interface exactly matches that of vrpn_Connection. To do things that -// are meaningful on log replay but not on live networks, create a -// vrpn_File_Controller and pass your vrpn_File_Connection to its constructor, -// or just ask the Connection for its file connection pointer and do the -// operations directly on the FileConnection if the pointer is non-NULL. - -// Logfiles are recorded as *sent*, not as translated by the receiver, -// so we still need to have all the correct names for senders and types -// registered. - -// September 1998: by default preloads the entire log file on startup. -// This causes a delay (nontrivial for large logs) but should help smooth -// playback. -// }}} - -#include <stdio.h> // for NULL, FILE - -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Connection.h" // for vrpn_LOGLIST (ptr only), etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_float32, vrpn_int32, etc - -struct timeval; - -// Global variable used to indicate whether File Connections should -// pre-load all of their records into memory when opened. This is the -// default behavior, but fails on very large files that eat up all -// of the memory. This defaults to "true". User code should set this -// to "false" before calling vrpn_get_connection_by_name() or creating -// a new vrpn_File_Connection object if it wants that file connection -// to not preload. The value is only checked at connection creation time; -// the connection behaves consistently once created. This operation is -// useful for applications that load large data files and don't want to -// wait for them to pre-load. - -extern VRPN_API bool vrpn_FILE_CONNECTIONS_SHOULD_PRELOAD; - -// Global variable used to indicate whether File Connections should -// keep already-read messages stored in memory. If not, then we have -// to re-load the file starting at the beginning on rewind. This -// defaults to "true". User code should set this -// to "false" before calling vrpn_get_connection_by_name() or creating -// a new vrpn_File_Connection object if it wants that file connection -// to not preload. The value is only checked at connection creation time; -// the connection behaves consistently once created. This operation is -// useful for applications that read through large data files and -// don't have enough memory to keep them in memory at once, or for applications -// that read through only once and have no need to go back and check. - -extern VRPN_API bool vrpn_FILE_CONNECTIONS_SHOULD_ACCUMULATE; - -// Global variable used to indicate whether File Connections should -// play through all system messages and get to the first user message -// when opened or reset to the beginning. This defaults to "true". -// User code should set this -// to "false" before calling vrpn_get_connection_by_name() or creating -// a new vrpn_File_Connection object if it wants that file connection -// to not preload. The value is only checked at connection creation time; -// the connection behaves consistently once created. Leaving this true -// can help with offsets in time that happen at the beginning of files. - -extern VRPN_API bool vrpn_FILE_CONNECTIONS_SHOULD_SKIP_TO_USER_MESSAGES; - -class VRPN_API vrpn_File_Connection : public vrpn_Connection { -public: - vrpn_File_Connection(const char *station_name, - const char *local_in_logfile_name = NULL, - const char *local_out_logfile_name = NULL); - virtual ~vrpn_File_Connection(void); - - virtual int mainloop(const timeval *timeout = NULL); - - // returns the elapsed time in the file - virtual int time_since_connection_open(timeval *elapsed_time); - - // returns the current time in the file since the epoch (UTC time). - virtual timeval get_time() { return d_time; } - - virtual vrpn_File_Connection *get_File_Connection(void); - - // Pretend to send pending report, really just clear the buffer. - virtual int send_pending_reports(void); - - // {{{ fileconnections-specific methods (playback control) -public: - // XXX the following should not be public if we want vrpn_File_Connection - // to have the same interface as vrpn_Connection - // - // If so handler functions for messages for these operations - // should be made, and functions added to vrpn_File_Controller which - // generate the messages. This seemed like it would be messy - // since most of these functions have return values - - // rate of 0.0 is paused, 1.0 is normal speed - void set_replay_rate(vrpn_float32 rate) - { - d_filetime_accum.set_replay_rate(rate); - } - - vrpn_float32 get_replay_rate() { return d_filetime_accum.replay_rate(); } - - // resets to the beginning of the file - // returns 0 on success - int reset(void); - - // returns 1 if we're at the end of file - int eof(); - - // end_time for play_to_time() is an elapsed time - // returns -1 on error or EOF, 0 on success - int play_to_time(vrpn_float64 end_time); - int play_to_time(timeval end_time); - - // end_filetime is an absolute time, corresponding to the - // timestamps of the entries in the file, - // returns -1 on error or EOF, 0 on success - int play_to_filetime(const timeval end_filetime); - - // plays the next entry, returns -1 or error or EOF, 0 otherwise - int playone(); - - // plays at most one entry, but won't play past end_filetime - // returns 0 on success, 1 if at end_filetime, -1 on error or EOF - int playone_to_filetime(timeval end_filetime); - - // returns the elapsed time of the file - timeval get_length(); - double get_length_secs(); - - // returns the timestamp of the earliest in time user message - timeval get_lowest_user_timestamp(); - - // returns the timestamp of the greatest-in-time user message - timeval get_highest_user_timestamp(); - - // returns the name of the file - const char *get_filename(); - - // jump_to_time sets the current position to the given elapsed time - // return 1 if we got to the specified time and 0 if we didn't - int jump_to_time(vrpn_float64 newtime); - int jump_to_time(timeval newtime); - - // jump_to_filetime sets the current position to the given absolute time - // return 1 if we got to the specified time and 0 if we didn't - int jump_to_filetime(timeval absolute_time); - - // Limits the number of messages played out on any one call to mainloop. - // 0 => no limit. - // Used to stop continuous callback-handling when messages arrive - // at a very high rate (such as from a vrpn_Imager) or to make sure - // that we are able to pause after each frame in frame-by-frame - // playback for tracking analysis programs. - void limit_messages_played_back(vrpn_uint32 max_playback) - { - Jane_stop_this_crazy_thing(max_playback); - }; - - // }}} - // {{{ tokens for VRPN control messages (data members) -protected: - vrpn_int32 d_controllerId; - - vrpn_int32 d_set_replay_rate_type; - vrpn_int32 d_reset_type; - vrpn_int32 d_play_to_time_type; - // long d_jump_to_time_type; - - // }}} - // {{{ time-keeping -protected: - timeval d_last_told; // Last time we printed error about no open file. - timeval d_time; // current time in file - timeval d_start_time; // time of first record in file - timeval d_earliest_user_time; // time of first user message - vrpn_bool d_earliest_user_time_valid; - timeval d_highest_user_time; // time of last user message - vrpn_bool d_highest_user_time_valid; - - // finds the timestamps of the earliest and highest-time user messages - void find_superlative_user_times(); - - // these are to be used internally when jumping around in the - // stream (e.g., for finding the earliest and latest timed - // user messages). They assume - // 1) that only functions such as advance_currentLogEntry, - // read_entry and manual traversal of d_logHead/d_logTail - // will be used. - // the functions return false if they don't save or restore the bookmark - class VRPN_API vrpn_FileBookmark { - public: - vrpn_FileBookmark(); - ~vrpn_FileBookmark(); - bool valid; - timeval oldTime; - long int file_pos; // ftell result - vrpn_LOGLIST *oldCurrentLogEntryPtr; // just a pointer, useful for accum - // or preload - vrpn_LOGLIST *oldCurrentLogEntryCopy; // a deep copy, useful for - // no-accum, no-preload - }; - bool store_stream_bookmark(); - bool return_to_bookmark(); - vrpn_FileBookmark d_bookmark; - - // wallclock time at the (beginning of the) last call - // to mainloop that played back an event - timeval d_last_time; // XXX remove - - class VRPN_API FileTime_Accumulator { - // accumulates the amount of time that we will advance - // filetime by when we next play back messages. - timeval d_filetime_accum_since_last_playback; - - // wallclock time when d_filetime_accum_since_last_playback - // was last updated - timeval d_time_of_last_accum; - - // scale factor between stream time and wallclock time - vrpn_float32 d_replay_rate; - - public: - FileTime_Accumulator(); - - // return accumulated time since last reset - const timeval &accumulated(void) - { - return d_filetime_accum_since_last_playback; - } - - // return last time accumulate_to was called - const timeval &time_of_last_accum(void) { return d_time_of_last_accum; } - - vrpn_float32 replay_rate(void) { return d_replay_rate; } - - // add (d_replay_rate * (now_time - d_time_of_last_accum)) - // to d_filetime_accum_since_last_playback - // then set d_time_of_last_accum to now_time - void accumulate_to(const timeval &now_time); - - // if current rate is non-zero, then time is accumulated - // before d_replay_rate is set to new_rate - void set_replay_rate(vrpn_float32 new_rate); - - // set d_time_of_last_accum to now_time - // and set d_filetime_accum_since_last_playback to zero - void reset_at_time(const timeval &now_time); - }; - FileTime_Accumulator d_filetime_accum; - - // }}} - // {{{ actual mechanics of the logfile -protected: - char *d_fileName; - FILE *d_file; - - void play_to_user_message(); - - // helper function for mainloop() - int need_to_play(timeval filetime); - - // checks the cookie at - // the head of the log file; - // exit on error! - virtual int read_cookie(void); - - virtual int read_entry(void); // appends entry to d_logTail - // returns 0 on success, 1 on EOF, -1 on error - - // Steps the currentLogEntry pointer forward one. - // It handles both cases of preload and non-preload. - // returns 0 on success, 1 on EOF, -1 on error - virtual int advance_currentLogEntry(void); - - virtual int close_file(void); - - // }}} - // {{{ handlers for VRPN control messages that might come from - // a File Controller object that wants to control this - // File Connection. -protected: - static int VRPN_CALLBACK handle_set_replay_rate(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_reset(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_play_to_time(void *, vrpn_HANDLERPARAM); - - // }}} - // {{{ Maintains a doubly-linked list structure that keeps - // copies of the messages from the file in memory. If - // d_accumulate is false, then there is only ever one entry - // in memory (d_currentLogEntry == d_logHead == d_logTail). - // If d_preload is true, then all of the records from the file - // are read into the list in the constructor and we merely step - // through memory when playing the streamfile. If d_preload is - // false and d_accumulate is true, then we have all of the - // records up the d_currentLogEntry in memory (d_logTail points - // to d_currentLogEntry but not to the last entry in the file - // until we get to the end of the file). - // The d_currentLogEntry should always be non-NULL unless we are - // past the end of all messages... we will either have preloaded - // all of them or else the read routine will attempt to load the - // next message each time one is played. The constructor fills it - // in with the first message, which makes it non-NULL initially. - // HOWEVER, if there are no user messages and we're asked to skip - // to the first user message then it can be NULL right after the - // constructor is called. -protected: - vrpn_LOGLIST *d_logHead; // the first read-in record - vrpn_LOGLIST *d_logTail; // the last read-in record - vrpn_LOGLIST *d_currentLogEntry; // Message that we've just loaded, or are - // at right now - vrpn_LOGLIST *d_startEntry; // potentially after initial system messages - bool d_preload; // Should THIS File Connection pre-load? - bool d_accumulate; // Should THIS File Connection accumulate? - // }}} -}; - -#endif // VRPN_FILE_CONNECTION_H diff --git a/src/vrpn/vrpn_FileController.C b/src/vrpn/vrpn_FileController.C deleted file mode 100644 index 2545e3e7630aeaac31398b2340e5de2e432796a0..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_FileController.C +++ /dev/null @@ -1,62 +0,0 @@ -#include <stddef.h> // for NULL - -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_FileController.h" -// Include vrpn_Shared.h _first_ to avoid conflicts with sys/time.h -// and netinet/in.h and ... -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday, etc - -vrpn_File_Controller::vrpn_File_Controller(vrpn_Connection *c) - : d_connection(c) -{ - - if (!c) return; - - d_myId = c->register_sender("vrpn File Controller"); - - d_set_replay_rate_type = - c->register_message_type("vrpn_File set_replay_rate"); - d_reset_type = c->register_message_type("vrpn_File reset"); - d_play_to_time_type = c->register_message_type("vrpn_File play_to_time"); -} - -vrpn_File_Controller::~vrpn_File_Controller(void) {} - -void vrpn_File_Controller::set_replay_rate(vrpn_float32 rate) -{ - struct timeval now; - - char buf[sizeof(vrpn_float32)]; - - vrpn_int32 bufLen = sizeof(vrpn_float32); - char *bufPtr = buf; - - if (vrpn_buffer(&bufPtr, &bufLen, rate)) { - return; - } - vrpn_gettimeofday(&now, NULL); - d_connection->pack_message( - sizeof(vrpn_float32), now, d_set_replay_rate_type, d_myId, buf, - vrpn_CONNECTION_RELIABLE); // | vrpn_CONNECTION_LOCAL_ONLY -}; - -void vrpn_File_Controller::reset(void) -{ - struct timeval now; - - vrpn_gettimeofday(&now, NULL); - d_connection->pack_message( - 0, now, d_reset_type, d_myId, NULL, - vrpn_CONNECTION_RELIABLE); // | vrpn_CONNECTION_LOCAL_ONLY -}; - -void vrpn_File_Controller::play_to_time(struct timeval t) -{ - struct timeval now; - - vrpn_gettimeofday(&now, NULL); - d_connection->pack_message( - sizeof(struct timeval), now, d_play_to_time_type, d_myId, - (const char *)&t, - vrpn_CONNECTION_RELIABLE); // | vrpn_CONNECTION_LOCAL_ONLY -}; diff --git a/src/vrpn/vrpn_FileController.h b/src/vrpn/vrpn_FileController.h deleted file mode 100644 index 1e19c06337eb23224f39c64eb2b85573901ac160..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_FileController.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef VRPN_FILE_CONTROLLER_H -#define VRPN_FILE_CONTROLLER_H -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Types.h" // for vrpn_int32, vrpn_float32 - -class VRPN_API vrpn_Connection; // from vrpn_Connection.h - -// class vrpn_File_Controller -// Tom Hudson, July 1998 - -// Controls a file connection (logfile playback). -// Can be attached to any vrpn_Connection. -// vrpn_File_Connections will respond to the messages. - -class VRPN_API vrpn_File_Controller { - -public: - vrpn_File_Controller(vrpn_Connection *); - ~vrpn_File_Controller(void); - - void set_replay_rate(vrpn_float32 = 1.0); - // Sets the rate at which the file is replayed. - - void reset(void); - // Returns to the beginning of the file. - // Does NOT reset rate to 1.0. - // Equivalent to set_to_time(< 0L, 0L >) - - void play_to_time(struct timeval t); - // Goes to an arbitrary elapsed time t in the file, - // triggering all events between the current time and t. - // Does not work in the past (use reset() first). - - // void jump_to_time (struct timeval t); - -protected: - vrpn_Connection *d_connection; - - vrpn_int32 d_myId; - - vrpn_int32 d_set_replay_rate_type; - vrpn_int32 d_reset_type; - vrpn_int32 d_play_to_time_type; - // long d_jump_to_time_type; -}; - -#endif // VRPN_FILE_CONTROLLER_H diff --git a/src/vrpn/vrpn_FixedPoint.h b/src/vrpn/vrpn_FixedPoint.h deleted file mode 100644 index c8f16ed004099a883b5743c0ba7cdd58a964aee4..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_FixedPoint.h +++ /dev/null @@ -1,171 +0,0 @@ -/** @file vrpn_FixedPoint.h - @brief Header - - @date 2014 - - @author - Kevin M. Godby - <kevin@godby.org> -*/ - -#ifndef VRPN_FIXED_POINT_H_ -#define VRPN_FIXED_POINT_H_ - -// Internal Includes -#include "vrpn_Types.h" - -// Library/third-party includes -// - none - -// Standard includes -#include <cstddef> // for NULL - -namespace vrpn { - - namespace detail { - /** - * Set as the type member of vrpn_IntegerOfSize if too many bits are - * required. - * We only support up to 32 bits currently. - */ - struct IntegerOverflow; - - /** - * \name Integer types. - * - * In the general case, we'll start adding bits to the required size - *until we - * land on one of the specialized cases below, then return that - *specialized - * case. The end result is that we return an integer type that can - *contain a - * value require NUM_BITS bits. - */ - ///@{ - template <int NUM_BITS> struct IntegerOfSize { - // An integer requiring n bits can be represented by an integer of - // size n+1 bits. - typedef typename IntegerOfSize<NUM_BITS + 1>::type type; - }; - - template <> struct IntegerOfSize<8> { - typedef vrpn_int8 type; - }; - - template <> struct IntegerOfSize<16> { - typedef vrpn_int16 type; - }; - - template <> struct IntegerOfSize<32> { - typedef vrpn_int32 type; - }; - - template <> struct IntegerOfSize<64> { - typedef IntegerOfSize type; - }; - - /// @todo allow for larger types if we can establish VRPN versions of - /// them (e.g., - /// equivalents to int64_t). - - ///@} - } // namespace detail - - /** - * A fixed-point value class. All values are signed, two's-complement. - * - * @tparam INTEGER_BITS The number of bits devoted to the integer part. - * @tparam FRACTIONAL_BITS The number of bits devoted to the fractioal part. - */ - template <int INTEGER_BITS, int FRACTIONAL_BITS> class FixedPoint { - public: - /** - * Find an integer type large enough to hold INTEGER_BITS. - */ - typedef typename detail::IntegerOfSize<INTEGER_BITS>::type IntegerType; - - typedef typename detail::IntegerOfSize<INTEGER_BITS + - FRACTIONAL_BITS>::type RawType; - - /** - * \name Constructors. - * - * The bits of an integral type passed to the constructor will be - * interpreted as as fixed-point value. A floating-point type passed to - *the - * constructor will be converted to a fixed-point value. - */ - //@{ - FixedPoint() - : value_(0) - { - } - explicit FixedPoint(vrpn_int8 x) - : value_(x) - { - } - explicit FixedPoint(vrpn_int16 x) - : value_(x) - { - } - explicit FixedPoint(vrpn_int32 x) - : value_(x) - { - } - explicit FixedPoint(vrpn_uint8 x) - : value_(x) - { - } - explicit FixedPoint(vrpn_uint16 x) - : value_(x) - { - } - explicit FixedPoint(vrpn_uint32 x) - : value_(x) - { - } - explicit FixedPoint(double x) - : value_(x * (1 << FRACTIONAL_BITS)) - { - } - explicit FixedPoint(float x) - : value_(x * (1 << FRACTIONAL_BITS)) - { - } - //@} - - /// @todo add operators, lots and lots of operators? - - /** - * Returns a floating-point representation of this - * fixed-point value. - */ - template <typename T> T get() const - { - return get(reinterpret_cast<TypeWrapper<T> *>(NULL)); - } - - /** \name Debugging functions. */ - ///@{ - /// @todo remove these functions after debugging - RawType value() const { return value_; } - ///@} - - private: - template <typename T> struct TypeWrapper; - vrpn_float32 get(TypeWrapper<vrpn_float32> *) const - { - return static_cast<vrpn_float32>(value_) / (1 << FRACTIONAL_BITS); - } - - vrpn_float64 get(TypeWrapper<vrpn_float64> *) const - { - return static_cast<vrpn_float64>(value_) / (1 << FRACTIONAL_BITS); - } - - RawType value_; - }; - -} // namespace vrpn - -#endif // VRPN_FIXED_POINT_H_ diff --git a/src/vrpn/vrpn_Flock.C b/src/vrpn/vrpn_Flock.C deleted file mode 100644 index 71b2b84ff726457d293b151e5cd27f95f84be5b3..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Flock.C +++ /dev/null @@ -1,746 +0,0 @@ -// The structure of this code came from vrpn_3Space.[Ch] -// Most of the flock specific code comes from snippets in: -// ~hmd/src/libs/tracker/apps/ascension/FLOCK232/C -// That directory includes a program called cbird which allows you -// to send almost any command to the flock. -// If you are having trouble with the flock, compile and run that program. -// Things to remember: -// Drain or flush i/o buffers as appropriate -// If the flock is in stream mode ('@'), put it into point mode ('B') -// before trying to send other commands -// Even if you are running in group mode, you need to preface data -// specification commands with the RS232TOFBB command. -// (weberh 1/11/98) - -#include <stdio.h> // for fprintf, stderr, perror, etc -#include <time.h> // for ctime, time, time_t - -#include "quat.h" // for q_invert -#include "vrpn_Flock.h" -#include "vrpn_Serial.h" // for vrpn_drain_output_buffer, etc -#include "vrpn_Tracker.h" // for vrpn_TRACKER_FAIL, etc -#include "vrpn_Types.h" // for vrpn_float64 - -class VRPN_API vrpn_Connection; - -// output a status msg every status_msg_secs -#define STATUS_MSG -#define STATUS_MSG_SECS 600 - -void vrpn_Tracker_Flock::printError( unsigned char uchErrCode, - unsigned char uchExpandedErrCode ) { - - fprintf(stderr,"\n\rError Code is %u (decimal) ", uchErrCode); - /* - Display a message describing the Error - */ - switch (uchErrCode) { - case 0: - fprintf(stderr,"...No Errors Have Occurred"); - break; - case 1: - fprintf(stderr,"...System RAM Test Error"); - break; - case 2: - fprintf(stderr,"...Non-Volatile Storage Write Failure"); - break; - case 3: - fprintf(stderr,"...System EEPROM Configuration Corrupt"); - break; - case 4: - fprintf(stderr,"...Transmitter EEPROM Configuration Corrupt"); - break; - case 5: - fprintf(stderr,"...Receiver EEPROM Configuration Corrupt"); - break; - case 6: - fprintf(stderr,"...Invalid RS232 Command"); - break; - case 7: - fprintf(stderr,"...Not an FBB Master"); - break; - case 8: - fprintf(stderr,"...No 6DFOBs are Active"); - break; - case 9: - fprintf(stderr,"...6DFOB has not been Initialized"); - break; - case 10: - fprintf(stderr,"...FBB Receive Error - Intra Bird Bus"); - break; - case 11: - fprintf(stderr,"...RS232 Overrun and/or Framing Error"); - break; - case 12: - fprintf(stderr,"...FBB Receive Error - FBB Host Bus"); - break; - case 13: - fprintf(stderr, - "...No FBB Command Response from Device at address %d (decimal)", - uchExpandedErrCode & 0x0f); - break; - case 14: - fprintf(stderr,"...Invalid FBB Host Command"); - break; - case 15: - fprintf(stderr,"...FBB Run Time Error"); - break; - case 16: - fprintf(stderr,"...Invalid CPU Speed"); - break; - case 17: - fprintf(stderr,"...Slave No Data Error"); - break; - case 18: - fprintf(stderr,"...Illegal Baud Rate"); - break; - case 19: - fprintf(stderr,"...Slave Acknowledge Error"); - break; - case 20: - fprintf(stderr,"...CPU Overflow Error - call factory"); - break; - case 21: - fprintf(stderr,"...Array Bounds Error - call factory"); - break; - case 22: - fprintf(stderr,"...Unused Opcode Error - call factory"); - break; - case 23: - fprintf(stderr,"...Escape Opcode Error - call factory"); - break; - case 24: - fprintf(stderr,"...Reserved Int 9 - call factory"); - break; - case 25: - fprintf(stderr,"...Reserved Int 10 - call factory"); - break; - case 26: - fprintf(stderr,"...Reserved Int 11 - call factory"); - break; - case 27: - fprintf(stderr,"...Numeric CPU Error - call factory"); - break; - case 28: - fprintf(stderr,"...CRT Synchronization Error"); - break; - case 29: - fprintf(stderr,"...Transmitter Not Active Error"); - break; - case 30: - fprintf(stderr,"...ERC Extended Range Transmitter Not Attached Error"); - break; - case 31: - fprintf(stderr,"...CPU Time Overflow Error"); - break; - case 32: - fprintf(stderr,"...Receiver Saturated Error"); - break; - case 33: - fprintf(stderr,"...Slave Configuration Error"); - break; - case 34: - fprintf(stderr,"...ERC Watchdog Error"); - break; - case 35: - fprintf(stderr,"...ERC Overtemp Error"); - break; - default: - fprintf(stderr,"...UNKNOWN ERROR... check user manual"); - break; - } -} - -// check for flock error, return err number if there is an error -// zero if no error -int vrpn_Tracker_Flock::checkError() { - - // Some compilers (CenterLine CC on sunos!?) still don't support - // automatic aggregate initialization - - //unsigned char rguch[4]={'B','G','O',10}; - - int cLen=0; - unsigned char rguch[2]; - rguch[cLen++] = 'B'; - rguch[cLen++] = 'G'; - - // put the flock to sleep (B to get out of stream mode, G to sleep) - - if (vrpn_write_characters(serial_fd, (const unsigned char *) &rguch, cLen )!=cLen) { - perror("\nvrpn_Tracker_Flock: failed writing cmds to tracker"); - return -1; - } - - // make sure the command is sent out - vrpn_drain_output_buffer( serial_fd ); - - vrpn_SleepMsecs(500); - - // clear in buffer - vrpn_flush_input_buffer( serial_fd ); - - // now get error code and clear error status - // we want error code 16, not 10 -- we want the expanded error code - // prepare error status query (expanded error codes) - cLen=0; - rguch[cLen++] = 'O'; - rguch[cLen++] = 16; - if (vrpn_write_characters(serial_fd, (const unsigned char *)rguch, cLen )!=cLen) { - perror("\nvrpn_Tracker_Flock: failed writing cmds to tracker"); - return -1; - } - - // make sure the command is sent out - vrpn_drain_output_buffer( serial_fd ); - - vrpn_SleepMsecs(500); - - // read response (2 char response to error query 16), - // 1 char response to 10 - int cRet; - if ((cRet=vrpn_read_available_characters(serial_fd, rguch, 2))!=2) { - fprintf(stderr, - "\nvrpn_Tracker_Flock: received only %d of 2 chars for err code", - cRet); - return -1; - } - - // if first byte is 0, there is no error - // if (rguch[0]) { - printError( rguch[0], rguch[1] ); - // } - return rguch[0]; -} - -vrpn_Tracker_Flock::vrpn_Tracker_Flock(char *name, vrpn_Connection *c, - int cSensors, const char *port, long baud, - int fStreamMode, int useERT, bool invertQuaternion, int active_hemisphere) : - vrpn_Tracker_Serial(name,c,port,baud), cSensors(cSensors), cResets(0), - fStream(fStreamMode), fGroupMode(1), cSyncs(0), fFirstStatusReport(1), d_useERT(useERT), - activeHemisphere(active_hemisphere), - d_invertQuaternion(invertQuaternion) { - if (cSensors>VRPN_FLOCK_MAX_SENSORS) { - fprintf(stderr, "\nvrpn_Tracker_Flock: too many sensors requested ... only %d allowed (%d specified)", VRPN_FLOCK_MAX_SENSORS, cSensors ); - cSensors = VRPN_FLOCK_MAX_SENSORS; - } - fprintf(stderr, "\nvrpn_Tracker_Flock: starting up (FOBHack)..."); -} - - -double vrpn_Tracker_Flock::getMeasurementRate() { - // the cbird code shows how to read these - int resetLen = 0; - unsigned char reset[5]; - unsigned char response[5]; - - // get crystal freq and measurement rate - reset[resetLen++]='O'; - reset[resetLen++]=2; - reset[resetLen++]='O'; - reset[resetLen++]=6; - - if (vrpn_write_characters(serial_fd, (const unsigned char *) reset, resetLen )!=resetLen) { - perror("\nvrpn_Tracker_Flock: failed writing set mode cmds to tracker"); - status = vrpn_TRACKER_FAIL; - return 1; - } - - // make sure the commands are sent out - vrpn_drain_output_buffer( serial_fd ); - - // let the tracker respond - vrpn_SleepMsecs(500); - - int cRetF; - if ((cRetF=vrpn_read_available_characters(serial_fd, response, 4))!=4) { - fprintf(stderr, - "\nvrpn_Tracker_Flock: received only %d of 4 chars as freq", - cRetF); - status = vrpn_TRACKER_FAIL; - return 1; - } - - fprintf(stderr, "\nvrpn_Tracker_Flock: crystal freq is %d Mhz", - (unsigned int)response[0]); - unsigned int iCount = response[2] + (((unsigned int)response[3]) << 8); - return (1000.0/((4*(iCount*(8.0/response[0])/1000.0)) + 0.3)); -} - -vrpn_Tracker_Flock::~vrpn_Tracker_Flock() { - - // Some compilers (CenterLine CC on sunos!?) still don't support - // automatic aggregate initialization - - int cLen=0; - //unsigned char rgch[2]={'B','G'}; - unsigned char rgch [2]; - rgch[cLen++] = 'B'; - rgch[cLen++] = 'G'; - - fprintf(stderr,"\nvrpn_Tracker_Flock: shutting down ..."); - // clear output buffer - vrpn_flush_output_buffer( serial_fd ); - - // put the flock to sleep (B to get out of stream mode, G to sleep) - if (vrpn_write_characters(serial_fd, (const unsigned char *) rgch, cLen )!=cLen) { - perror("\nvrpn_Tracker_Flock: failed writing sleep cmd to tracker"); - status = vrpn_TRACKER_FAIL; - return; - } - // make sure the command is sent out - vrpn_drain_output_buffer( serial_fd ); - fprintf(stderr, " done.\n"); -} - -void vrpn_Tracker_Flock::reset() -{ - int i; - int resetLen; - unsigned char reset[6*(VRPN_FLOCK_MAX_SENSORS+1)+10]; - - // If the RTS/CTS pins are in the cable that connects the Flock - // to the computer, we need to raise and drop the RTS/CTS line - // to make the communications on the Flock reset. We need to give - // it time to reset. If these wires are not installed (ie, if only - // send, receive and ground are connected) then we don't need this. - // To be more general, we put it in. The following code snippet - // comes from Kyle at Ascension. - vrpn_set_rts( serial_fd ); - vrpn_SleepMsecs(1000); - vrpn_clear_rts( serial_fd ); - vrpn_SleepMsecs(2000); - - // set vars for error handling - // set them right away so they are set properly in the - // event that we fail during the reset. - cResets++; - cSyncs=0; - fFirstStatusReport=1; - - // Get rid of the characters left over from before the reset - // (make sure they are processed) - vrpn_drain_output_buffer(serial_fd); - - // put back into polled mode (need to stop stream mode - // before doing an auto-config) - resetLen=0; - reset[resetLen++]='B'; - - // send the poll mode command (cmd and cmd_size are args) - fprintf(stderr," vrpn_Flock: Sending POLL mode command...\n"); - if (vrpn_write_characters(serial_fd, (const unsigned char *) reset, resetLen )!=resetLen) { - perror("\nvrpn_Tracker_Flock: failed writing poll cmd to tracker"); - status = vrpn_TRACKER_FAIL; - return; - } - // make sure the command is sent out - vrpn_drain_output_buffer( serial_fd ); - - // wait for tracker to respond and flush buffers - vrpn_SleepMsecs(5000); - - // Send the tracker a string that should reset it. - - // we will try to do an auto-reconfigure of all units of the flock - // then set the flock into pos/quat stream mode (this requires group - // mode, so we set that as well). - - resetLen=0; - - // "change value" cmd - reset[resetLen++]='P'; - - // flock of birds auto-configure code - reset[resetLen++]=50; - - // number of units (xmitter + receivers) - reset[resetLen++]= (unsigned char)(cSensors+d_useERT); - - // as per pg 59 of the jan 31, 1995 FOB manual, we need to pause at - // least 300 ms before and after sending the autoconfig (paused above) - - // send the reset command (cmd and cmd_size are args) - fprintf(stderr," vrpn_Flock: Sending RESET command...\n"); - if (vrpn_write_characters(serial_fd, (const unsigned char *) reset, resetLen )!=resetLen) { - perror("\nvrpn_Tracker_Flock: failed writing auto-config to tracker"); - status = vrpn_TRACKER_FAIL; - return; - } - // make sure the command is sent out - vrpn_drain_output_buffer( serial_fd ); - - // wait for auto reconfig - vrpn_SleepMsecs(10000); - - // now set modes: pos/quat, group, stream - resetLen=0; - - // group mode - reset[resetLen++] = 'P'; - reset[resetLen++] = 35; - reset[resetLen++] = 1; - // pos/quat mode sent to each receiver (transmitter is unit 1) - // 0xf0 + addr is the cmd to tell the master to forward a cmd - for (i=1;i<=cSensors;i++) { - reset[resetLen++] = (unsigned char)(0xf0 + i + d_useERT); - reset[resetLen++] = ']'; - } - - // - // Set the active hemisphere based on what's in the config file. - - unsigned char hem, sign; - switch (activeHemisphere) - { - case HEMI_PLUSX : hem = 0x00; sign = 0x00; break; - case HEMI_MINUSX: hem = 0x00; sign = 0x01; break; - case HEMI_PLUSY : hem = 0x06; sign = 0x00; break; - case HEMI_MINUSY: hem = 0x06; sign = 0x01; break; - case HEMI_PLUSZ : hem = 0x0c; sign = 0x00; break; - case HEMI_MINUSZ: hem = 0x0c; sign = 0x01; break; - } - // prepare the command - for (i=1;i<=cSensors;i++) { - reset[resetLen++] = (unsigned char)(0xf0 + i + d_useERT); - reset[resetLen++] = 'L'; - reset[resetLen++] = hem; - reset[resetLen++] = sign; - } - - // write it all out - fprintf(stderr," vrpn_Flock: Setting parameters...\n"); - if (vrpn_write_characters(serial_fd, (const unsigned char *) reset, resetLen )!=resetLen) { - perror("\nvrpn_Tracker_Flock: failed writing set mode cmds to tracker"); - status = vrpn_TRACKER_FAIL; - return; - } - - // make sure the commands are sent out - vrpn_drain_output_buffer( serial_fd ); - - // clear the input buffer (it will contain a single point - // record from the poll command above and garbage from before reset) - vrpn_flush_input_buffer(serial_fd); - - resetLen=0; - // get the system status to check that it opened correctly - // examine value cmd is 'O' - reset[resetLen++]='O'; - - // flock system status is 36 - reset[resetLen++]=36; - - // write the cmd and get response - if (vrpn_write_characters(serial_fd, (const unsigned char *) reset, resetLen )!=resetLen) { - perror("\nvrpn_Tracker_Flock: failed writing get sys config to tracker"); - status = vrpn_TRACKER_FAIL; - return; - } - - // make sure the command is sent out - vrpn_drain_output_buffer( serial_fd ); - - // let the tracker respond - vrpn_SleepMsecs(500); - - fprintf(stderr," vrpn_Flock: Checking for response...\n"); - unsigned char response[14]; - int cRet; - if ((cRet=vrpn_read_available_characters(serial_fd, response, 14))!=14) { - fprintf(stderr, - "\nvrpn_Tracker_Flock: received only %d of 14 chars as status", - cRet); - status = vrpn_TRACKER_FAIL; - return; - } - - // check the configuration ... - int fOk=1; - for (i=0;i<=cSensors-1+d_useERT;i++) { - fprintf(stderr, "\nvrpn_Tracker_Flock: unit %d", i); - if (response[i] & 0x20) { - fprintf(stderr," (a receiver)"); - } else { - fprintf(stderr," (a transmitter)"); -// now we allow non transmitters at fisrt address !!!! -// if (i != 0) { -// fprintf(stderr,"\nError: VRPN Flock driver can only accept transmitter as first unit\n"); -// status = vrpn_TRACKER_FAIL; -// fOk=0; -// return; -// } - } - if (response[i] & 0x80) { - fprintf(stderr," is accessible"); - } else { - fprintf(stderr," is not accessible"); - fOk=0; - } - if (response[i] & 0x40) { - fprintf(stderr," and is running"); - } else { - fprintf(stderr," and is not running"); - fOk=0; - } - } - - fprintf(stderr, "\n"); - - if (!fOk) { - perror("\nvrpn_Tracker_Flock: problems resetting tracker."); - status = vrpn_TRACKER_FAIL; - return; - } - -#define GET_FREQ -#ifdef GET_FREQ - fprintf(stderr, "\nvrpn_Tracker_Flock: sensor measurement rate is %lf hz.", - getMeasurementRate()); -#endif - - // now start it running - resetLen = 0; - - if (fStream==1) { - // stream mode - reset[resetLen++] = '@'; - if (vrpn_write_characters(serial_fd, (const unsigned char *) reset, resetLen )!=resetLen) { - perror("\nvrpn_Tracker_Flock: failed writing set mode cmds to tracker"); - status = vrpn_TRACKER_FAIL; - return; - } - - // make sure the commands are sent out - vrpn_drain_output_buffer( serial_fd ); - } - - fprintf(stderr,"\nvrpn_Tracker_Flock: done with reset ... running.\n"); - - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - status = vrpn_TRACKER_SYNCING; // We're trying for a new reading -} - - -int vrpn_Tracker_Flock::get_report(void) -{ - int ret; - unsigned RECORD_SIZE = 15; - - // The reports are 15 bytes long each (Pos/Quat format plus - // group address), with a phasing bit set in the first byte - // of each sensor. - // If not in group mode, then reports are just 14 bytes - // VRPN sends every tracker report for every sensor. - - if (!fGroupMode) { - RECORD_SIZE = 14; - } - - // We need to search for the phasing bit because if the input - // buffer overflows then it will be emptied and overwritten. - - // If we're synching, read a byte at a time until we find - // one with the high bit set. - - if (status == vrpn_TRACKER_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, buffer, 1) != 1) { - return 0; - } - - // If the high bit isn't set, we don't want it we - // need to look at the next one, so just return - if ( (buffer[0] & 0x80) == 0) { - fprintf(stderr,"\nvrpn_Tracker_Flock: Syncing (high bit not set)"); - cSyncs++; - if (cSyncs>RECORD_SIZE) { - // reset the tracker if more than a few syncs occur - status = vrpn_TRACKER_RESETTING; - } - return 0; - } - cSyncs=0; - - // Got the first character of a report -- go into PARTIAL mode - // and say that we got one character at this time. - bufcount = 1; - vrpn_gettimeofday(×tamp, NULL); - status = vrpn_TRACKER_PARTIAL; - } - - // Read as many bytes of this record as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. The routine that calls this one - // makes sure we get a full reading often enough (ie, it is responsible - // for doing the watchdog timing to make sure the tracker hasn't simply - // stopped sending characters). - ret = vrpn_read_available_characters(serial_fd, &buffer[bufcount], - RECORD_SIZE-bufcount); - if (ret == -1) { - fprintf(stderr,"\nvrpn_Tracker_Flock: Error reading"); - status = vrpn_TRACKER_FAIL; - return 0; - } - bufcount += ret; - if (bufcount < RECORD_SIZE) { // Not done -- go back for more - return 0; - } - - // confirm that we are still synched ... - if ( (buffer[0] & 0x80) == 0) { - fprintf(stderr,"\nvrpn_Tracker_Flock: lost sync, resyncing."); - status = vrpn_TRACKER_SYNCING; - return 0; - } - - // Now decode the report - - // from the flock manual (page 28) and ascension's code ... - - // they use 14 bit ints - short *rgs= (short *)buffer; - short cs = (short)(RECORD_SIZE/2); - - // Go though the flock data and make into two's complemented - // 16 bit integers by: - // 1) getting rid of the lsb phasing bit - // 2) shifting the lsbyte left one bit - // 3) recombining msb/lsb into words - // 4) shifting each word left one more bit - // These are then scaled appropriately. - - unsigned char uchLsb; - unsigned char uchMsb; - - for (int irgs=0;irgs<cs;irgs++) { - // The data is dealt with as bytes so that the host byte ordering - // will not affect the operation - uchLsb = (unsigned char)(buffer[irgs*2] & 0x7F); - uchLsb <<= 1; - uchMsb = buffer[irgs*2+1]; - rgs[irgs] = (short)( ((unsigned short) uchLsb) + (((unsigned short) uchMsb) << 8) ); - rgs[irgs] <<= 1; - } - - // scale factor for position. - // According to Jo Skermo, this depends on whether we're using the - // extended-range transmitter or not. - double int_to_inches; - if (d_useERT) { - int_to_inches = 144.0/32768.0; - } else { - int_to_inches = 36.0/32768.0; - } - - int i; - for (i=0;i<3;i++) { - // scale and convert to meters - pos[i] = (double)(rgs[i] * int_to_inches * 0.0254); - } - - // they code quats as w,x,y,z, we need to give out x,y,z,w - // The quats are already normalized -#define WTF (float)(1.0/32768.0) /* float to word integer */ - for (i=4;i<7;i++) { - // quat[i-4] = (double)(((short *)buffer)[i] * WTF); - d_quat[i-4] = (double)(rgs[i] * WTF); - } - d_quat[3] = (double)(rgs[3] * WTF); - - // Because the Flock was used at UNC by having the transmitter - // above the user, we were always operating in the wrong hemisphere. - // According to the Flock manual, the Flock should report things - // in the same way other trackers do. The original code inverted - // the Quaternion value before returning it, probably because of this - // hemisphere problem. Sebastien Maraux pointed out the confusion. - // To Enable either mode to work, the code now has an optional parameter - // that will invert the quaternion, but it is not the default anymore. - // Others must have been using the Flock in the same manner, because - // they didn't see a problem with this code. - - if (d_invertQuaternion) { q_invert(d_quat, d_quat); } - - if (fGroupMode) { - // sensor addr are 0 indexed in vrpn, but start at 2 in the flock - // (1 is the transmitter) -// d_sensor = buffer[RECORD_SIZE-1]-2; - d_sensor = buffer[RECORD_SIZE-1]-1-d_useERT; - } - - // all set for this sensor, so cycle - status = vrpn_TRACKER_SYNCING; - bufcount = 0; - -#ifdef VERBOSE - print_latest_report(); -#endif - return 1; -} - -#define poll() { \ -char chPoint = 'B';\ -fprintf(stderr,"."); \ -if (vrpn_write_characters(serial_fd, (const unsigned char *) &chPoint, 1 )!=1) {\ - perror("\nvrpn_Tracker_Flock: failed writing set mode cmds to tracker");\ - status = vrpn_TRACKER_FAIL;\ - return;\ -} \ -vrpn_gettimeofday(×tamp, NULL);\ -} - -void vrpn_Tracker_Flock::send_report(void) { - vrpn_Tracker_Serial::send_report(); - - // NOTE: the flock behavior is very finicky -- if you try to poll - // again before most of the last response has been read, then - // it will complain. You need to wait and issue the next - // group poll only once you have read out the previous one entirely - // As a result, polling is very slow with multiple sensors. - if (fStream==0) { - if (d_sensor==(cSensors-1)) { - poll(); - } - } - - // successful read, so reset the reset count - cResets = 0; - -#ifdef STATUS_MSG - // data to calc report rate - struct timeval tvNow; - - // get curr time - vrpn_gettimeofday(&tvNow, NULL); - - if (fFirstStatusReport) { - // print a status message in cStatusInterval seconds - cStatusInterval=3; - tvLastStatusReport=tvNow; - cReports=0; - fFirstStatusReport=0; - fprintf(stderr, "\nFlock: status will be printed every %d seconds.", - STATUS_MSG_SECS); - } - - cReports++; - - if (vrpn_TimevalMsecs(vrpn_TimevalDiff(tvNow, tvLastStatusReport)) > - cStatusInterval*1000){ - - double dRate = cReports / - (vrpn_TimevalMsecs(vrpn_TimevalDiff(tvNow, - tvLastStatusReport))/1000.0); - time_t tNow = time(NULL); - char *pch = ctime(&tNow); - pch[24]='\0'; - fprintf(stderr, "\nFlock: reports being sent at %6.2lf hz " - "(%d sensors, so ~%6.2lf hz per sensor) ( %s )", - dRate, cSensors, dRate/cSensors, pch); - tvLastStatusReport = tvNow; - cReports=0; - // display the rate every STATUS_MSG_SECS seconds - cStatusInterval=STATUS_MSG_SECS; - } -#endif -} diff --git a/src/vrpn/vrpn_Flock.h b/src/vrpn/vrpn_Flock.h deleted file mode 100644 index 57abc5d5b7b37fdd97780c3c391477a7293381e5..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Flock.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef FLOCK_H -#define FLOCK_H - -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker_Serial - -class VRPN_API vrpn_Connection; - -// only 13 receivers allowed in normal addressing mode -#define VRPN_FLOCK_MAX_SENSORS 13 - -// This is a class which provides a server for an Ascension -// Flock of Birds tracker. The server will send out messages -// at whatever rate the flock of bird's stream mode feeds them. -// Default filtering is active. -// The timestamp is the time when the first character was read -// from the serial driver with "read". No adjustment is currently -// made to this time stamp. - -// Adelstein, et al, "Dynamic response of electromagnetic spatial -// displacement trackers", Presence 5(3) found that if all of the filters -// are turned off, and the time required to transport the data to the -// server is ignored, then the latency of the flock is about 2 ms for ori, -// 7.5 ms for pos for the 0-4hz range (ie, when the data is ready to leave -// the flock in stream mode, the pos is 7.5 ms old, and the ori is 2 ms -// old). Later this data will be combined with the baud rate to provide a -// more accurate time stamp for certain flock modes. - -// If this is running on a non-linux system, then the serial port driver -// is probably adding more latency -- see the vrpn README for more info. - -// The FOB now doesn't need to be used in a chain starting with an Exteded -// range controller. You may use the optionnal useERT to set whether this -// is the case or not. Added by David Nahon, for Virtools VR Pack, -// david@z-a.net, support@virtools.com - -class VRPN_API vrpn_Tracker_Flock: public vrpn_Tracker_Serial { - - public: - vrpn_Tracker_Flock(char *name, vrpn_Connection *c, int cSensors=1, - const char *port = "/dev/ttyd3", long baud = 38400, - int fStreamMode = 1, int useERT=1, bool invertQuaternion = false, int active_hemisphere=HEMI_PLUSZ); - virtual ~vrpn_Tracker_Flock(); - - enum {HEMI_PLUSX, HEMI_MINUSX, HEMI_PLUSY, HEMI_MINUSY, HEMI_PLUSZ, HEMI_MINUSZ}; - - protected: - - int activeHemisphere; - - virtual int get_report(void); - virtual void send_report(void); - virtual void reset(); - void printError(unsigned char uchErrCode, unsigned char uchExpandedErrCode); - int checkError(); - int cSensors; - int fStream; // stream or polled mode - int fGroupMode; // for get_report -- group report mode or individual - - int d_useERT; // do we have an extended range transmitter, this was the default - bool d_invertQuaternion; // Do we invert the Quaternion before returning it? - - // class members used to help with error recovery - unsigned cResets; - unsigned cSyncs; - - // class members used for statistics only - int fFirstStatusReport; - struct timeval tvLastStatusReport; - int cReports; - int cStatusInterval; - double getMeasurementRate(); -}; - -#endif diff --git a/src/vrpn/vrpn_Flock_Parallel.C b/src/vrpn/vrpn_Flock_Parallel.C deleted file mode 100644 index 680c9ae7c7cb8dc26a0a70c5da1c393c0e169311..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Flock_Parallel.C +++ /dev/null @@ -1,364 +0,0 @@ -/*****************************************************************************\ - vrpn_Flock_Parallel.C - -- - Description : A master and slave class are defined in this file. - The master class connects to a flock controller and - manages the slave receivers. - - ---------------------------------------------------------------------------- - Author: weberh - Created: Thu Mar 5 19:38:55 1998 - Revised: Fri Mar 19 15:05:56 1999 by weberh -\*****************************************************************************/ - -// The structure of this code came from vrpn_3Space.[Ch] -// Most of the flock specific code comes from snippets in: -// ~hmd/src/libs/tracker/apps/ascension/FLOCK232/C -// That directory includes a program called cbird which allows you -// to send almost any command to the flock. -// If you are having trouble with the flock, compile and run that program. -// Things to remember: -// Drain or flush i/o buffers as appropriate -// If the flock is in stream mode ('@'), put it into point mode ('B') -// before trying to send other commands -// Even if you are running in group mode, you need to preface data -// specification commands with the RS232TOFBB command. -// (weberh 1/11/98) - -// If you want to try polling instead of stream mode, just set define POLL -// #define POLL - -#include <stdio.h> // for fprintf, stderr, NULL, etc - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR -#include "vrpn_Flock_Parallel.h" -#include "vrpn_Serial.h" // for vrpn_drain_output_buffer, etc -#include "vrpn_Shared.h" // for timeval, vrpn_SleepMsecs, etc -#include "vrpn_Tracker.h" // for vrpn_TRACKER_FAIL, etc - -class VRPN_API vrpn_Connection; - -// output a status msg every status_msg_secs -#define STATUS_MSG -#define STATUS_MSG_SECS 600 - -// we create a vrpn_Tracker_Flock in polling mode as the master -vrpn_Tracker_Flock_Parallel::vrpn_Tracker_Flock_Parallel(char *name, - vrpn_Connection *c, - int cSensors, - char *port, - long baud, - char *slavePortArray[], - bool invertQuaternion) : - vrpn_Tracker_Flock(name,c,cSensors,port,baud,0, 1, invertQuaternion) -{ - if (cSensors<=0) { - fprintf(stderr, "\nvrpn_Tracker_Flock_Parallel: must ask for pos num " - "of sensors"); - cSensors = 0; - return; - } - fprintf(stderr, "\nvrpn_Tracker_Flock_Parallel: starting up ..."); - - if (!slavePortArray) { - fprintf(stderr, "\nvrpn_Tracker_Flock_Parallel: null slave port array."); - return; - } - - for (int i=0;i<cSensors;i++) { - char rgch[15]; - fprintf(stderr, "\nvrpn_Tracker_Flock_Parallel: initing slave %d ...", i); - if (!slavePortArray[i]) { - fprintf(stderr, "\nvrpn_Tracker_Flock_Parallel:slave %d: null port array" - " entry.", i); - return; - } else { - // create a traker name - sprintf(rgch, "flockSlave%d", i); - rgSlaves[i] = new vrpn_Tracker_Flock_Parallel_Slave( rgch, - d_connection, - slavePortArray[i], - baud, - d_sender_id, - i ); - } - } -} - -vrpn_Tracker_Flock_Parallel::~vrpn_Tracker_Flock_Parallel() { - - // have all slaves shut down (they just send a 'B' -- slaves - // can't run or sleep - for (int i=0;i<cSensors;i++) { - delete rgSlaves[i]; - } - - // now regular flock destructor will be called (just as we need) -} - -// reset is a little different because we don't want it to go into -// stream mode. -void vrpn_Tracker_Flock_Parallel::reset() -{ - // call the base class reset (won't stream -- this is a polling - // vrpn_Tracker_Flock) - vrpn_Tracker_Flock::reset(); - - // Now, call slave reset(s) - for (int i=0;i<cSensors;i++) { - rgSlaves[i]->reset(); - } -} - -int vrpn_Tracker_Flock_Parallel::get_report(void) -{ - // this could either do nothing or call slave get_report(s) - return 0; -} - -void vrpn_Tracker_Flock_Parallel::mainloop() -{ - int i; - - // Call the generic server code, since we are a server. - server_mainloop(); - - // call slave mainloops - for (i=0;i<cSensors;i++) { - rgSlaves[i]->mainloop(); - } - - // check slave status (master fails if any slave does - // and the master resets the slaves) - for (i=0;i<cSensors;i++) { - // first check for failure - if (rgSlaves[i]->status==vrpn_TRACKER_FAIL) { - status=vrpn_TRACKER_FAIL; - break; - } - // now check for reset being needed (cont to check for failures) - if (rgSlaves[i]->status==vrpn_TRACKER_RESETTING) { - status=vrpn_TRACKER_RESETTING; - continue; - } - } - - // the master never has reports ready -- it is always either in - // fail, reset, or sync mode - // The slaves send messages on the master's connection - switch (status) { - case vrpn_TRACKER_SYNCING: - // everything is a-ok - break; - - case vrpn_TRACKER_RESETTING: - reset(); - break; - - case vrpn_TRACKER_FAIL: - checkError(); - if (cResets==4) { - fprintf(stderr, "\nvrpn_Tracker_Flock_Parallel: problems resetting ... check that: a) all cables are attached, b) all units have FLY/STANDBY switches in FLY mode, and c) no receiver is laying too close to the transmitter. When done checking, power cycle the flock.\nWill attempt to reset in 15 seconds.\n"); - vrpn_SleepMsecs(1000.0*15); - cResets=0; - } - fprintf(stderr, - "\nvrpn_Tracker_Flock_Parallel: tracker failed, trying to reset ..."); - - // reset master serial i/o - vrpn_close_commport(serial_fd); - serial_fd = vrpn_open_commport(portname, baudrate); - - // reset slave serial i/o - for (i=0;i<cSensors;i++) { - vrpn_close_commport(rgSlaves[i]->serial_fd); - rgSlaves[i]->serial_fd = vrpn_open_commport(rgSlaves[i]->portname, - rgSlaves[i]->baudrate); - rgSlaves[i]->status = vrpn_TRACKER_RESETTING; - } - status = vrpn_TRACKER_RESETTING; - break; - } -} - -/******************************************************************************* - HERE IS THE VRPN SLAVE CODE -*******************************************************************************/ - - -// stream mode flock, one sensor, same connection as master -// it will send faked messages from the master -vrpn_Tracker_Flock_Parallel_Slave:: -vrpn_Tracker_Flock_Parallel_Slave( char *name, vrpn_Connection *c, - char *port, long baud, - vrpn_int32 masterID, - int iSensorID ) : - vrpn_Tracker_Flock(name,c,1,port,baud,1) -{ - d_sender_id = masterID; // Spoofing the master - d_sensor=iSensorID; - fprintf(stderr, "\nvrpn_Tracker_Flock_Parallel_Slave %d: starting up ...", - d_sensor); - // get_report should operate in non-group mode - fGroupMode = 0; -} - -vrpn_Tracker_Flock_Parallel_Slave::~vrpn_Tracker_Flock_Parallel_Slave() { - - // Some compilers (CenterLine CC on sunos!?) still don't support - // automatic aggregate initialization - - int cLen=0; - //unsigned char rgch[2]={'B','G'}; - unsigned char rgch [2]; - rgch[cLen++] = 'B'; - - // slaves can't do a sleep - // rgch[cLen++] = 'G'; - - fprintf(stderr,"\nvrpn_Tracker_Flock_Parallel_Slave %d: shutting down ...", d_sensor); - // clear output buffer - vrpn_flush_output_buffer( serial_fd ); - - // put the flock to sleep (B to get out of stream mode, G to sleep) - if (vrpn_write_characters(serial_fd, (const unsigned char *) rgch, cLen )!=cLen) { - fprintf(stderr,"\nvrpn_Tracker_Flock_Parallel_Slave %d: " - "failed writing sleep cmd to tracker", d_sensor); - status = vrpn_TRACKER_FAIL; - return; - } - // make sure the command is sent out - vrpn_drain_output_buffer( serial_fd ); - fprintf(stderr, " done.\n"); -} - -#define poll() { \ -char chPoint = 'B';\ -fprintf(stderr,"."); \ -if (vrpn_write_characters(serial_fd, (const unsigned char *) &chPoint, 1 )!=1) {\ - fprintf(stderr,"\nvrpn_Tracker_Flock_Parallel_Slave %d: failed writing set mode cmds to tracker", d_sensor);\ - status = vrpn_TRACKER_FAIL;\ - return;\ -} \ -vrpn_gettimeofday(×tamp, NULL);\ -} - - -// slave resets are ONLY called by the master -void vrpn_Tracker_Flock_Parallel_Slave::reset() -{ - // slaves just flush on a reset and then stream (or poll) - // master does all the real resetting - - // set vars for error handling - // set them right away so they are set properly in the - // event that we fail during the reset. - cResets++; - cSyncs=0; - fFirstStatusReport=1; - - // Get rid of the characters left over from before the reset - // (make sure they are processed) - vrpn_drain_output_buffer(serial_fd); - - // put back into polled mode (need to stop stream mode - // before doing an auto-config) - int resetLen=0; - unsigned char reset[3]; - reset[resetLen++]='B'; - - // send the poll mode command (cmd and cmd_size are args) - if (vrpn_write_characters(serial_fd, (const unsigned char *) reset, resetLen )!=resetLen) { - fprintf(stderr,"\nvrpn_Tracker_Flock_Parallel_Slave %d: " - "failed writing poll cmd to tracker", d_sensor); - status = vrpn_TRACKER_FAIL; - return; - } - - // make sure the command is sent out - vrpn_drain_output_buffer( serial_fd ); - - // wait for tracker to respond and flush buffers - vrpn_SleepMsecs(500); - - // clear the input buffer (it will contain a single point - // record from the poll command above and garbage from before reset) - vrpn_flush_input_buffer(serial_fd); - - // now start it running - resetLen = 0; - - // either stream or let poll take place later - if (fStream==1) { - // stream mode - reset[resetLen++] = '@'; - - if (vrpn_write_characters(serial_fd, (const unsigned char *) reset, resetLen )!=resetLen) { - fprintf(stderr,"\nvrpn_Tracker_Flock_Parallel_Slave %d: " - "failed writing set mode cmds to tracker", d_sensor); - status = vrpn_TRACKER_FAIL; - return; - } - - // make sure the commands are sent out - vrpn_drain_output_buffer( serial_fd ); - } else { - poll(); - } - - fprintf(stderr,"\nvrpn_Tracker_Flock_Parallel_Slave %d: " - "done with reset ... running.\n", d_sensor); - - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - status = vrpn_TRACKER_SYNCING; // We're trying for a new reading -} - -// max time between start of a report and the finish (or time to -// wait for first report) - -// Allow enough time for startup of many sensors -- 1 second per sensor -#define MAX_TIME_INTERVAL (VRPN_FLOCK_MAX_SENSORS*1000000) - -void vrpn_Tracker_Flock_Parallel_Slave::mainloop() -{ - // We don't call the generic server mainloop code, because the master unit - // will have done that for us. - - switch (status) { - case vrpn_TRACKER_SYNCING: - case vrpn_TRACKER_PARTIAL: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - while (get_report()) { - send_report(); - } - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) > MAX_TIME_INTERVAL) { - fprintf(stderr,"Tracker failed to read... current_time=%ld:%ld, timestamp=%ld:%ld\n", - current_time.tv_sec, static_cast<long>(current_time.tv_usec), - timestamp.tv_sec, static_cast<long>(timestamp.tv_usec)); - send_text_message("Too long since last report, resetting", current_time, vrpn_TEXT_ERROR); - status = vrpn_TRACKER_FAIL; - } - } - break; - // master resets us - case vrpn_TRACKER_RESETTING: - break; - case vrpn_TRACKER_FAIL: - // here we just fail and let the master figure out that we have - // failed and need to be reset - fprintf(stderr, "\nvrpn_Tracker_Flock_Parallel_Slave %d: tracker " - "failed, trying to reset ...", d_sensor); - break; - } -} diff --git a/src/vrpn/vrpn_Flock_Parallel.h b/src/vrpn/vrpn_Flock_Parallel.h deleted file mode 100644 index 83bd82d6858a4c3c53a447f2794cf37d1ef260de..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Flock_Parallel.h +++ /dev/null @@ -1,89 +0,0 @@ -/*****************************************************************************\ - vrpn_Flock_Parallel.h - -- - Description : implements a class which runs an ascension flock of birds - tracker in multiple rs232 mode. - - ---------------------------------------------------------------------------- - Author: weberh - Created: Thu Mar 5 19:38:55 1998 - Revised: Fri Mar 19 15:05:28 1999 by weberh -\*****************************************************************************/ -#ifndef _VRPN_FLOCK_PARALLEL_H_ -#define _VRPN_FLOCK_PARALLEL_H_ - -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Flock.h" // for vrpn_Tracker_Flock, etc -#include "vrpn_Types.h" // for vrpn_int32 - -class VRPN_API vrpn_Connection; - -// This is a class which provides a server for an ascension -// Flock of Birds tracker. The server will send out messages -// at whatever rate the flock of bird's stream mode feeds them. -// Default filtering is active. -// The timestamp is the time when the first character was read -// from the serial driver with "read". No adjustment is currently -// made to this time stamp. - -// Adelstein, et al, "Dynamic response of electromagnetic spatial -// displacement trackers", Presence 5(3) found that if all of the filters -// are turned off, and the time required to transport the data to the -// server is ignored, then the latency of the flock is about 2 ms for ori, -// 7.5 ms for pos for the 0-4hz range (ie, when the data is ready to leave -// the flock in stream mode, the pos is 7.5 ms old, and the ori is 2 ms -// old). Later this data will be combined with the baud rate to provide a -// more accurate time stamp for certain flock modes. - -// If this is running on a non-linux system, then the serial port driver -// is probably adding more latency -- see the vrpn README for more info. - -// forward decl -class VRPN_API vrpn_Tracker_Flock_Parallel_Slave; - -// this class acts as the master -// these are both derived from vrpn_Tracker_Flock to take advantage -// of some of the data and functionality, but they replace the major -// functions -class VRPN_API vrpn_Tracker_Flock_Parallel: public vrpn_Tracker_Flock { - - public: - - // for parallel, you supply the master port and then the - // slave ports in a array with cSensors elements - vrpn_Tracker_Flock_Parallel(char *name, vrpn_Connection *c, int cSensors, - char *port, long baud, - char *slavePortArray[], - bool invertQuaternion = false); - - virtual ~vrpn_Tracker_Flock_Parallel(); - virtual void mainloop(); - - protected: - virtual int get_report(void); - virtual void reset(); - - // slave ptrs - vrpn_Tracker_Flock_Parallel_Slave *rgSlaves[VRPN_FLOCK_MAX_SENSORS]; -}; - -// the special args are the master's vrpn id and tracker pos msg id -// The slave masquerades as the master when sending out reports -class VRPN_API vrpn_Tracker_Flock_Parallel_Slave : public vrpn_Tracker_Flock { -public: - vrpn_Tracker_Flock_Parallel_Slave( char *name, - vrpn_Connection *c, - char *port, - long baud, - vrpn_int32 vrpnMasterID, - int iSensorID ); - virtual ~vrpn_Tracker_Flock_Parallel_Slave(); - virtual void mainloop(); - - protected: - virtual void reset(); - - friend class VRPN_API vrpn_Tracker_Flock_Parallel; -}; - -#endif // _VRPN_FLOCK_PARALLEL_H_ diff --git a/src/vrpn/vrpn_ForceDevice.C b/src/vrpn/vrpn_ForceDevice.C deleted file mode 100644 index dfd7135d887788e6e62de22c76297e5e8b1bf27c..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_ForceDevice.C +++ /dev/null @@ -1,2895 +0,0 @@ -// Include vrpn_Shared.h _first_ to avoid conflicts with sys/time.h -// and unistd.h -#include <math.h> // for sqrt -#include <stdio.h> // for fprintf, stderr, NULL, etc - -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_Shared.h" // for vrpn_buffer, vrpn_unbuffer, etc - -#if defined(linux) || defined(__sparc) || defined(hpux) || defined(__GNUC__) -#include <string.h> // for memcpy -#endif - -#include <quat.h> // for q_matrix_type, etc - -#include "vrpn_ForceDevice.h" - -/* cheezy hack to make sure this enum is defined in the case we didn't - include trimesh.h */ -#ifndef TRIMESH_H -// the different types of trimeshes we have available for haptic display -enum TrimeshType { GHOST, HCOLLIDE }; -#endif - -#define CHECK(a) \ - if (a == -1) return -1 - -#if 0 -// c = a x b -static void vector_cross (const vrpn_float64 a [3], const vrpn_float64 b [3], - vrpn_float64 c [3]) { - - c[0] = a[1] * b[2] - a[2] * b[1]; - c[1] = a[2] * b[0] - a[0] * b[2]; - c[2] = a[0] * b[1] - a[1] * b[0]; - -} - -// vprime = v * T -static void rotate_vector (const vrpn_float64 v [3], const vrpn_float64 T [9], - vrpn_float64 vprime [3]) { - vprime[0] = v[0] * T[0] + v[1] * T[3] + v[2] * T[6]; - vprime[1] = v[0] * T[1] + v[1] * T[4] + v[2] * T[7]; - vprime[2] = v[0] * T[2] + v[1] * T[5] + v[2] * T[8]; -} - -static vrpn_float64 vector_dot (const vrpn_float64 a [3], - const vrpn_float64 b [3]) { - return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; -} -#endif - -vrpn_ForceDevice::vrpn_ForceDevice(const char *name, vrpn_Connection *c) - : vrpn_BaseClass(name, c) -{ - vrpn_BaseClass::init(); - - // set the current time to zero - timestamp.tv_sec = 0; - timestamp.tv_usec = 0; - - // set the force to zero - // d_force[0] = d_force[1] = d_force[2] = 0.0; - SurfaceKspring = 0.8f; - SurfaceFdynamic = 0.3f; - SurfaceFstatic = 0.7f; - SurfaceKdamping = 0.001f; - - numRecCycles = 1; - errorCode = FD_OK; - - SurfaceKadhesionNormal = 0.0001f; - SurfaceKadhesionLateral = 0.0002f; - SurfaceBuzzFreq = 0.0003f; - SurfaceBuzzAmp = 0.0004f; - SurfaceTextureWavelength = 0.01f; - SurfaceTextureAmplitude = 0.0005f; - - // ajout ONDIM - customEffectId = -1; - customEffectParams = NULL; - nbCustomEffectParams = 0; - // fin ajout ONDIM -} - -// ajout ONDIM -void vrpn_ForceDevice::setCustomEffect(vrpn_int32 effectId, - vrpn_float32 *params, - vrpn_uint32 nbParams) -{ - customEffectId = effectId; - if (customEffectParams != NULL) { - delete[] customEffectParams; - } - customEffectParams = new vrpn_float32[nbParams]; - memcpy(customEffectParams, params, sizeof(vrpn_float32) * nbParams); - nbCustomEffectParams = nbParams; -} -// fin ajout ondim - -int vrpn_ForceDevice::register_types(void) -{ - force_message_id = - d_connection->register_message_type("vrpn_ForceDevice Force"); - forcefield_message_id = - d_connection->register_message_type("vrpn_ForceDevice Force_Field"); - plane_message_id = - d_connection->register_message_type("vrpn_ForceDevice Plane"); - plane_effects_message_id = - d_connection->register_message_type("vrpn_ForceDevice Plane2"); - addObject_message_id = - d_connection->register_message_type("vrpn_ForceDevice addObject"); - addObjectExScene_message_id = d_connection->register_message_type( - "vrpn_ForceDevice addObjectExScene"); - moveToParent_message_id = - d_connection->register_message_type("vrpn_ForceDevice moveToParent"); - setObjectPosition_message_id = d_connection->register_message_type( - "vrpn_ForceDevice setObjectPosition"); - setObjectOrientation_message_id = d_connection->register_message_type( - "vrpn_ForceDevice setObjectOrientation"); - setObjectScale_message_id = - d_connection->register_message_type("vrpn_ForceDevice setObjectScale"); - removeObject_message_id = - d_connection->register_message_type("vrpn_ForceDevice removeObject"); - setVertex_message_id = - d_connection->register_message_type("vrpn_ForceDevice setVertex"); - setNormal_message_id = - d_connection->register_message_type("vrpn_ForceDevice setNormal"); - setTriangle_message_id = - d_connection->register_message_type("vrpn_ForceDevice setTriangle"); - removeTriangle_message_id = - d_connection->register_message_type("vrpn_ForceDevice removeTriangle"); - updateTrimeshChanges_message_id = d_connection->register_message_type( - "vrpn_ForceDevice updateTrimeshChanges"); - transformTrimesh_message_id = d_connection->register_message_type( - "vrpn_ForceDevice transformTrimesh"); - setTrimeshType_message_id = - d_connection->register_message_type("vrpn_ForceDevice setTrimeshType"); - clearTrimesh_message_id = - d_connection->register_message_type("vrpn_ForceDevice clearTrimesh"); - - setHapticOrigin_message_id = - d_connection->register_message_type("vrpn_ForceDevice setHapticOrigin"); - setHapticScale_message_id = - d_connection->register_message_type("vrpn_ForceDevice setHapticScale"); - setSceneOrigin_message_id = - d_connection->register_message_type("vrpn_ForceDevice setSceneOrigin"); - - getNewObjectID_message_id = - d_connection->register_message_type("vrpn_ForceDevice getNewObjectID"); - setObjectIsTouchable_message_id = d_connection->register_message_type( - "vrpn_ForceDevice setObjectIsTouchable"); - scp_message_id = - d_connection->register_message_type("vrpn_ForceDevice SCP"); - error_message_id = - d_connection->register_message_type("vrpn_ForceDevice Force_Error"); - - enableConstraint_message_id = d_connection->register_message_type( - "vrpn_ForceDevice constraint_enable"); - setConstraintMode_message_id = - d_connection->register_message_type("vrpn_ForceDevice constraint_mode"); - setConstraintPoint_message_id = d_connection->register_message_type( - "vrpn_ForceDevice constraint_point"); - setConstraintLinePoint_message_id = d_connection->register_message_type( - "vrpn_ForceDevice constraint_linept"); - setConstraintLineDirection_message_id = d_connection->register_message_type( - "vrpn_ForceDevice constraint_linedir"); - setConstraintPlanePoint_message_id = - d_connection->register_message_type("vrpn_ForceDevice constraint_plpt"); - setConstraintPlaneNormal_message_id = d_connection->register_message_type( - "vrpn_ForceDevice constraint_plnorm"); - setConstraintKSpring_message_id = d_connection->register_message_type( - "vrpn_ForceDevice constraint_KSpring"); - - // ajout ONDIM - custom_effect_message_id = - d_connection->register_message_type("vrpn_ForceDevice Custom Effect"); - // fin ajout ONDIM - - return 0; -} - -// virtual -vrpn_ForceDevice::~vrpn_ForceDevice(void) -{ - if (customEffectParams != NULL) { - delete[] customEffectParams; - } -} - -void vrpn_ForceDevice::print_plane(void) -{ - printf("plane: %f, %f, %f, %f\n", plane[0], plane[1], plane[2], plane[3]); -} - -void vrpn_ForceDevice::print_report(void) -{ - // Nothing sets d_force any more! - printf("Timestamp:%ld:%ld\n", timestamp.tv_sec, - static_cast<long>(timestamp.tv_usec)); - // printf("Force :%lf, %lf, %lf\n", d_force[0],d_force[1],d_force[2]); -} - -// static -char *vrpn_ForceDevice::encode_force(vrpn_int32 &length, - const vrpn_float64 *force) -{ - // Message includes: vrpn_float64 force[3] - // Byte order of each needs to be reversed to match network standard - - int i; - char *buf; - char *mptr; - vrpn_int32 mlen; - - length = 3 * sizeof(vrpn_float64); - mlen = length; - - buf = new char[length]; - mptr = buf; - - // Move the force there - for (i = 0; i < 3; i++) { - vrpn_buffer(&mptr, &mlen, force[i]); - } - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_force(const char *buffer, - const vrpn_int32 len, - vrpn_float64 *force) -{ - int i; - const char *mptr = buffer; - - if (len != (3 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_ForceDevice: force message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", len, - static_cast<unsigned long>(3 * sizeof(vrpn_float64))); - return -1; - } - - for (i = 0; i < 3; i++) - CHECK(vrpn_unbuffer(&mptr, &(force[i]))); - - return 0; -} - -// ajout ONDIM -char *vrpn_ForceDevice::encode_custom_effect(vrpn_int32 &len, - vrpn_uint32 effectId, - const vrpn_float32 *params, - vrpn_uint32 nbParams) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_uint32) * 2 + nbParams * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, effectId); - vrpn_buffer(&mptr, &mlen, nbParams); - - for (unsigned int i = 0; i < nbParams; i++) { - vrpn_buffer(&mptr, &mlen, params[i]); - } - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_custom_effect(const char *buffer, - const vrpn_int32 len, - vrpn_uint32 *effectId, - vrpn_float32 **params, - vrpn_uint32 *nbParams) -{ - const char *mptr = buffer; - - // OutputDebugString("decoding custom effect\n"); - - if (static_cast<size_t>(len) < (sizeof(vrpn_uint32) * 2)) { - fprintf(stderr, - "vrpn_ForceDevice: custom effect message payload error\n"); - fprintf(stderr, " (got %d, expected at least %lud)\n", len, - static_cast<unsigned long>(2 * sizeof(vrpn_uint32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, effectId)); - CHECK(vrpn_unbuffer(&mptr, nbParams)); - - if ((vrpn_uint32)(len) < - (2 * sizeof(vrpn_uint32) + (*nbParams) * sizeof(vrpn_float32))) { - fprintf(stderr, - "vrpn_ForceDevice: custom effect message payload error\n"); - fprintf(stderr, " (got %d, expected at least %lud)\n", len, - static_cast<unsigned long>(2 * sizeof(vrpn_uint32) + - (*nbParams) * sizeof(vrpn_float32))); - return -2; - } - - if (*params != NULL) delete[] * params; - *params = new vrpn_float32[(*nbParams)]; - - for (vrpn_uint32 i = 0; i < (*nbParams); i++) { - CHECK(vrpn_unbuffer(&mptr, &((*params)[i]))); - } - - return 0; -} -// fin ajout ONDIM - -// static -char *vrpn_ForceDevice::encode_scp(vrpn_int32 &length, const vrpn_float64 *pos, - const vrpn_float64 *quat) -{ - int i; - char *buf; - char *mptr; - vrpn_int32 mlen; - - length = 7 * sizeof(vrpn_float64); - mlen = length; - - buf = new char[length]; - mptr = buf; - - for (i = 0; i < 3; i++) { - vrpn_buffer(&mptr, &mlen, pos[i]); - } - for (i = 0; i < 4; i++) { - vrpn_buffer(&mptr, &mlen, quat[i]); - } - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_scp(const char *buffer, - const vrpn_int32 len, vrpn_float64 *pos, - vrpn_float64 *quat) -{ - int i; - const char *mptr = buffer; - int desiredLen = 7 * sizeof(vrpn_float64); - - if (len != desiredLen) { - fprintf(stderr, "vrpn_ForceDevice: scp message payload error\n"); - fprintf(stderr, " (got %d, expected %d)\n", len, - desiredLen); - return -1; - } - - for (i = 0; i < 3; i++) - CHECK(vrpn_unbuffer(&mptr, &(pos[i]))); - for (i = 0; i < 4; i++) - CHECK(vrpn_unbuffer(&mptr, &(quat[i]))); - - return 0; -} - -// static -char *vrpn_ForceDevice::encode_plane( - vrpn_int32 &len, const vrpn_float32 *plane, const vrpn_float32 kspring, - const vrpn_float32 kdamp, const vrpn_float32 fdyn, const vrpn_float32 fstat, - const vrpn_int32 plane_index, const vrpn_int32 n_rec_cycles) -{ - // Message includes: vrpn_float32 plane[4], - - int i; - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = 8 * sizeof(vrpn_float32) + 2 * sizeof(vrpn_int32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - for (i = 0; i < 4; i++) { - vrpn_buffer(&mptr, &mlen, plane[i]); - } - - vrpn_buffer(&mptr, &mlen, kspring); - vrpn_buffer(&mptr, &mlen, kdamp); - vrpn_buffer(&mptr, &mlen, fdyn); - vrpn_buffer(&mptr, &mlen, fstat); - vrpn_buffer(&mptr, &mlen, plane_index); - vrpn_buffer(&mptr, &mlen, n_rec_cycles); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_plane( - const char *buffer, const vrpn_int32 len, vrpn_float32 *plane, - vrpn_float32 *kspring, vrpn_float32 *kdamp, vrpn_float32 *fdyn, - vrpn_float32 *fstat, vrpn_int32 *plane_index, vrpn_int32 *n_rec_cycles) -{ - int i; - const char *mptr = buffer; - - if (len != 8 * sizeof(vrpn_float32) + 2 * sizeof(vrpn_int32)) { - fprintf(stderr, "vrpn_ForceDevice: plane message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", len, - static_cast<unsigned long>(8 * sizeof(vrpn_float32) + - 2 * sizeof(vrpn_int32))); - return -1; - } - - for (i = 0; i < 4; i++) - CHECK(vrpn_unbuffer(&mptr, &(plane[i]))); - CHECK(vrpn_unbuffer(&mptr, kspring)); - CHECK(vrpn_unbuffer(&mptr, kdamp)); - CHECK(vrpn_unbuffer(&mptr, fdyn)); - CHECK(vrpn_unbuffer(&mptr, fstat)); - CHECK(vrpn_unbuffer(&mptr, plane_index)); - CHECK(vrpn_unbuffer(&mptr, n_rec_cycles)); - - return 0; -} - -// static -char *vrpn_ForceDevice::encode_surface_effects( - vrpn_int32 &len, const vrpn_float32 k_adhesion_normal, - const vrpn_float32 k_adhesion_lateral, const vrpn_float32 tex_amp, - const vrpn_float32 tex_wl, const vrpn_float32 buzz_amp, - const vrpn_float32 buzz_freq) -{ - - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = 6 * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, k_adhesion_normal); - vrpn_buffer(&mptr, &mlen, k_adhesion_lateral); - vrpn_buffer(&mptr, &mlen, tex_amp); - vrpn_buffer(&mptr, &mlen, tex_wl); - vrpn_buffer(&mptr, &mlen, buzz_amp); - vrpn_buffer(&mptr, &mlen, buzz_freq); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_surface_effects( - const char *buffer, const vrpn_int32 len, vrpn_float32 *k_adhesion_normal, - vrpn_float32 *k_adhesion_lateral, vrpn_float32 *tex_amp, - vrpn_float32 *tex_wl, vrpn_float32 *buzz_amp, vrpn_float32 *buzz_freq) -{ - - const char *mptr = buffer; - - if (len != 6 * sizeof(vrpn_float32)) { - fprintf(stderr, "vrpn_ForceDevice: surface effects message payload "); - fprintf(stderr, "error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(6 * sizeof(vrpn_float32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, k_adhesion_normal)); - CHECK(vrpn_unbuffer(&mptr, k_adhesion_lateral)); - CHECK(vrpn_unbuffer(&mptr, tex_amp)); - CHECK(vrpn_unbuffer(&mptr, tex_wl)); - CHECK(vrpn_unbuffer(&mptr, buzz_amp)); - CHECK(vrpn_unbuffer(&mptr, buzz_freq)); - - return 0; -} - -// static -char *vrpn_ForceDevice::encode_vertex(vrpn_int32 &len, const vrpn_int32 objNum, - const vrpn_int32 vertNum, - const vrpn_float32 x, - const vrpn_float32 y, - const vrpn_float32 z) -{ - - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(objNum) + sizeof(vertNum) + 3 * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - vrpn_buffer(&mptr, &mlen, vertNum); - vrpn_buffer(&mptr, &mlen, x); - vrpn_buffer(&mptr, &mlen, y); - vrpn_buffer(&mptr, &mlen, z); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_vertex(const char *buffer, - const vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_int32 *vertNum, vrpn_float32 *x, - vrpn_float32 *y, vrpn_float32 *z) -{ - const char *mptr = buffer; - - if (len != (sizeof(objNum) + sizeof(vertNum) + 3 * sizeof(vrpn_float32))) { - fprintf(stderr, "vrpn_ForceDevice: vertex message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(objNum) + sizeof(vertNum) + - 3 * sizeof(vrpn_float32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - CHECK(vrpn_unbuffer(&mptr, vertNum)); - CHECK(vrpn_unbuffer(&mptr, x)); - CHECK(vrpn_unbuffer(&mptr, y)); - CHECK(vrpn_unbuffer(&mptr, z)); - - return 0; -} - -// static -char *vrpn_ForceDevice::encode_normal(vrpn_int32 &len, const vrpn_int32 objNum, - const vrpn_int32 normNum, - const vrpn_float32 x, - const vrpn_float32 y, - const vrpn_float32 z) -{ - - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32) + sizeof(vrpn_int32) + 3 * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - vrpn_buffer(&mptr, &mlen, objNum); - vrpn_buffer(&mptr, &mlen, normNum); - vrpn_buffer(&mptr, &mlen, x); - vrpn_buffer(&mptr, &mlen, y); - vrpn_buffer(&mptr, &mlen, z); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_normal(const char *buffer, - const vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_int32 *vertNum, vrpn_float32 *x, - vrpn_float32 *y, vrpn_float32 *z) -{ - - const char *mptr = buffer; - - if (len != - (sizeof(vrpn_int32) + sizeof(vrpn_int32) + 3 * sizeof(vrpn_float32))) { - fprintf(stderr, "vrpn_ForceDevice: normal message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32) + - sizeof(vrpn_int32) + - 3 * sizeof(vrpn_float32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - CHECK(vrpn_unbuffer(&mptr, vertNum)); - CHECK(vrpn_unbuffer(&mptr, x)); - CHECK(vrpn_unbuffer(&mptr, y)); - CHECK(vrpn_unbuffer(&mptr, z)); - - return 0; -} - -// static -char *vrpn_ForceDevice::encode_triangle( - vrpn_int32 &len, const vrpn_int32 objNum, const vrpn_int32 triNum, - const vrpn_int32 vert0, const vrpn_int32 vert1, const vrpn_int32 vert2, - const vrpn_int32 norm0, const vrpn_int32 norm1, const vrpn_int32 norm2) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32) + 7 * sizeof(vrpn_int32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - vrpn_buffer(&mptr, &mlen, triNum); - vrpn_buffer(&mptr, &mlen, vert0); - vrpn_buffer(&mptr, &mlen, vert1); - vrpn_buffer(&mptr, &mlen, vert2); - vrpn_buffer(&mptr, &mlen, norm0); - vrpn_buffer(&mptr, &mlen, norm1); - vrpn_buffer(&mptr, &mlen, norm2); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_triangle( - const char *buffer, const vrpn_int32 len, vrpn_int32 *objNum, - vrpn_int32 *triNum, vrpn_int32 *vert0, vrpn_int32 *vert1, vrpn_int32 *vert2, - vrpn_int32 *norm0, vrpn_int32 *norm1, vrpn_int32 *norm2) -{ - const char *mptr = buffer; - - if (len != (sizeof(vrpn_int32) + 7 * sizeof(vrpn_int32))) { - fprintf(stderr, "vrpn_ForceDevice: triangle message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32) + - 7 * sizeof(vrpn_int32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - CHECK(vrpn_unbuffer(&mptr, triNum)); - CHECK(vrpn_unbuffer(&mptr, vert0)); - CHECK(vrpn_unbuffer(&mptr, vert1)); - CHECK(vrpn_unbuffer(&mptr, vert2)); - CHECK(vrpn_unbuffer(&mptr, norm0)); - CHECK(vrpn_unbuffer(&mptr, norm1)); - CHECK(vrpn_unbuffer(&mptr, norm2)); - - return 0; -} - -// static -char *vrpn_ForceDevice::encode_removeTriangle(vrpn_int32 &len, - const vrpn_int32 objNum, - const vrpn_int32 triNum) -{ - - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32) + sizeof(vrpn_int32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - vrpn_buffer(&mptr, &mlen, triNum); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_removeTriangle(const char *buffer, - const vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_int32 *triNum) -{ - const char *mptr = buffer; - - if (len != (sizeof(vrpn_int32) + sizeof(vrpn_int32))) { - fprintf(stderr, "vrpn_ForceDevice: remove triangle message payload"); - fprintf(stderr, " error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32) + - sizeof(vrpn_int32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - CHECK(vrpn_unbuffer(&mptr, triNum)); - - return 0; -} - -// static -// this is where we send down our surface parameters -char *vrpn_ForceDevice::encode_updateTrimeshChanges( - vrpn_int32 &len, const vrpn_int32 objNum, const vrpn_float32 kspring, - const vrpn_float32 kdamp, const vrpn_float32 fstat, const vrpn_float32 fdyn) -{ - - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32) + 4 * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - vrpn_buffer(&mptr, &mlen, kspring); - vrpn_buffer(&mptr, &mlen, kdamp); - vrpn_buffer(&mptr, &mlen, fstat); - vrpn_buffer(&mptr, &mlen, fdyn); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_updateTrimeshChanges( - const char *buffer, const vrpn_int32 len, vrpn_int32 *objNum, - vrpn_float32 *kspring, vrpn_float32 *kdamp, vrpn_float32 *fstat, - vrpn_float32 *fdyn) -{ - - const char *mptr = buffer; - - if (len != (sizeof(vrpn_int32) + 4 * sizeof(vrpn_float32))) { - fprintf(stderr, "vrpn_ForceDevice: update trimesh message payload"); - fprintf(stderr, " error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32) + - 4 * sizeof(vrpn_float32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - CHECK(vrpn_unbuffer(&mptr, kspring)); - CHECK(vrpn_unbuffer(&mptr, kdamp)); - CHECK(vrpn_unbuffer(&mptr, fstat)); - CHECK(vrpn_unbuffer(&mptr, fdyn)); - - return 0; -} - -// static -char *vrpn_ForceDevice::encode_setTrimeshType(vrpn_int32 &len, - const vrpn_int32 objNum, - const vrpn_int32 type) -{ - - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32) + sizeof(vrpn_int32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - vrpn_buffer(&mptr, &mlen, type); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_setTrimeshType(const char *buffer, - const vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_int32 *type) -{ - - const char *mptr = buffer; - - if (len != (sizeof(vrpn_int32) + sizeof(vrpn_int32))) { - fprintf(stderr, "vrpn_ForceDevice: trimesh type message payload"); - fprintf(stderr, " error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32) + - sizeof(vrpn_int32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - CHECK(vrpn_unbuffer(&mptr, type)); - - return 0; -} - -// static -char *vrpn_ForceDevice::encode_trimeshTransform( - vrpn_int32 &len, const vrpn_int32 objNum, const vrpn_float32 homMatrix[16]) -{ - int i; - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32) + 16 * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - for (i = 0; i < 16; i++) - vrpn_buffer(&mptr, &mlen, homMatrix[i]); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_trimeshTransform(const char *buffer, - const vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_float32 homMatrix[16]) -{ - int i; - const char *mptr = buffer; - - if (len != (sizeof(vrpn_int32) + 16 * sizeof(vrpn_float32))) { - fprintf(stderr, "vrpn_ForceDevice: trimesh transform message payload "); - fprintf(stderr, "error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32) + - 16 * sizeof(vrpn_float32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - for (i = 0; i < 16; i++) - CHECK(vrpn_unbuffer(&mptr, &(homMatrix[i]))); - - return 0; -} - -char *vrpn_ForceDevice::encode_addObject(vrpn_int32 &len, - const vrpn_int32 objNum, - const vrpn_int32 ParentNum) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = 2 * sizeof(vrpn_int32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - vrpn_buffer(&mptr, &mlen, ParentNum); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_addObject(const char *buffer, - vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_int32 *ParentNum) -{ - const char *mptr = buffer; - - if (len != 2 * sizeof(vrpn_int32)) { - fprintf(stderr, "vrpn_ForceDevice: add object message payload "); - fprintf(stderr, "error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(2 * sizeof(vrpn_int32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - CHECK(vrpn_unbuffer(&mptr, ParentNum)); - - return 0; -} - -char *vrpn_ForceDevice::encode_addObjectExScene(vrpn_int32 &len, - const vrpn_int32 objNum) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(objNum); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_addObjectExScene(const char *buffer, - vrpn_int32 len, - vrpn_int32 *objNum) -{ - const char *mptr = buffer; - - if (len != sizeof(vrpn_int32)) { - fprintf(stderr, "vrpn_ForceDevice: add object message payload "); - fprintf(stderr, "error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - - return 0; -} - -char *vrpn_ForceDevice::encode_objectPosition(vrpn_int32 &len, - const vrpn_int32 objNum, - const vrpn_float32 Pos[3]) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32) + 3 * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - vrpn_buffer(&mptr, &mlen, Pos[0]); - vrpn_buffer(&mptr, &mlen, Pos[1]); - vrpn_buffer(&mptr, &mlen, Pos[2]); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_objectPosition(const char *buffer, - vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_float32 Pos[3]) -{ - const char *mptr = buffer; - - if (len != (sizeof(vrpn_int32) + 3 * sizeof(vrpn_float32))) { - fprintf(stderr, "vrpn_ForceDevice: object position message payload "); - fprintf(stderr, "error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32) + - 3 * sizeof(vrpn_float32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - CHECK(vrpn_unbuffer(&mptr, &Pos[0])); - CHECK(vrpn_unbuffer(&mptr, &Pos[1])); - CHECK(vrpn_unbuffer(&mptr, &Pos[2])); - - return 0; -} - -char *vrpn_ForceDevice::encode_objectOrientation(vrpn_int32 &len, - const vrpn_int32 objNum, - const vrpn_float32 axis[3], - const vrpn_float32 angle) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32) + 4 * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - vrpn_buffer(&mptr, &mlen, axis[0]); - vrpn_buffer(&mptr, &mlen, axis[1]); - vrpn_buffer(&mptr, &mlen, axis[2]); - vrpn_buffer(&mptr, &mlen, angle); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_objectOrientation(const char *buffer, - vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_float32 axis[3], - vrpn_float32 *angle) -{ - const char *mptr = buffer; - - if (len != (sizeof(vrpn_int32) + 4 * sizeof(vrpn_float32))) { - fprintf(stderr, - "vrpn_ForceDevice: object orientation message payload "); - fprintf(stderr, "error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32) + - 4 * sizeof(vrpn_float32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - CHECK(vrpn_unbuffer(&mptr, &axis[0])); - CHECK(vrpn_unbuffer(&mptr, &axis[1])); - CHECK(vrpn_unbuffer(&mptr, &axis[2])); - CHECK(vrpn_unbuffer(&mptr, angle)); - - return 0; -} - -char *vrpn_ForceDevice::encode_objectScale(vrpn_int32 &len, - const vrpn_int32 objNum, - const vrpn_float32 Scale[3]) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32) + 3 * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - vrpn_buffer(&mptr, &mlen, Scale[0]); - vrpn_buffer(&mptr, &mlen, Scale[1]); - vrpn_buffer(&mptr, &mlen, Scale[2]); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_objectScale(const char *buffer, - vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_float32 Scale[3]) -{ - const char *mptr = buffer; - - if (len != (sizeof(vrpn_int32) + 3 * sizeof(vrpn_float32))) { - fprintf(stderr, "vrpn_ForceDevice: object scale message payload "); - fprintf(stderr, "error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32) + - 3 * sizeof(vrpn_float32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - CHECK(vrpn_unbuffer(&mptr, &Scale[0])); - CHECK(vrpn_unbuffer(&mptr, &Scale[1])); - CHECK(vrpn_unbuffer(&mptr, &Scale[2])); - - return 0; -} - -char *vrpn_ForceDevice::encode_removeObject(vrpn_int32 &len, - const vrpn_int32 objNum) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_removeObject(const char *buffer, - vrpn_int32 len, - vrpn_int32 *objNum) -{ - const char *mptr = buffer; - - if (len != sizeof(vrpn_int32)) { - fprintf(stderr, "vrpn_ForceDevice: remove object message payload "); - fprintf(stderr, "error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - - return 0; -} - -char *vrpn_ForceDevice::encode_clearTrimesh(vrpn_int32 &len, - const vrpn_int32 objNum) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_clearTrimesh(const char *buffer, - vrpn_int32 len, - vrpn_int32 *objNum) -{ - const char *mptr = buffer; - - if (len != sizeof(vrpn_int32)) { - fprintf(stderr, "vrpn_ForceDevice: clear TriMesh message payload "); - fprintf(stderr, "error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - - return 0; -} - -char *vrpn_ForceDevice::encode_moveToParent(vrpn_int32 &len, - const vrpn_int32 objNum, - const vrpn_int32 parentNum) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32) + sizeof(vrpn_int32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - vrpn_buffer(&mptr, &mlen, parentNum); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_moveToParent(const char *buffer, - vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_int32 *parentNum) -{ - const char *mptr = buffer; - - if (len != (sizeof(vrpn_int32) + sizeof(vrpn_int32))) { - fprintf(stderr, - "vrpn_ForceDevice: move object to parent message payload "); - fprintf(stderr, "error\n (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32) + - sizeof(vrpn_int32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - CHECK(vrpn_unbuffer(&mptr, parentNum)); - - return 0; -} - -char *vrpn_ForceDevice::encode_setHapticOrigin(vrpn_int32 &len, - const vrpn_float32 Pos[3], - const vrpn_float32 axis[3], - const vrpn_float32 angle) -{ - int i; - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = 7 * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - for (i = 0; i < 3; i++) - vrpn_buffer(&mptr, &mlen, Pos[i]); - - for (i = 0; i < 3; i++) - vrpn_buffer(&mptr, &mlen, axis[i]); - - vrpn_buffer(&mptr, &mlen, angle); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_setHapticOrigin(const char *buffer, - vrpn_int32 len, - vrpn_float32 Pos[3], - vrpn_float32 axis[3], - vrpn_float32 *angle) -{ - int i; - const char *mptr = buffer; - - if (len != 7 * sizeof(vrpn_int32)) { - fprintf(stderr, - "vrpn_ForceDevice: sethapticorigin message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", len, - static_cast<unsigned long>(7 * sizeof(vrpn_int32))); - return -1; - } - - for (i = 0; i < 3; i++) - CHECK(vrpn_unbuffer(&mptr, &Pos[i])); - - for (i = 0; i < 3; i++) - CHECK(vrpn_unbuffer(&mptr, &axis[i])); - - CHECK(vrpn_unbuffer(&mptr, angle)); - return 0; -} - -char *vrpn_ForceDevice::encode_setHapticScale(vrpn_int32 &len, - const vrpn_float32 scale) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, scale); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_setHapticScale(const char *buffer, - vrpn_int32 len, - vrpn_float32 *scale) -{ - const char *mptr = buffer; - - if (len != sizeof(vrpn_float32)) { - fprintf(stderr, - "vrpn_ForceDevice: sethapticscale message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", len, - static_cast<unsigned long>(7 * sizeof(vrpn_float32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, scale)); - - return 0; -} - -char *vrpn_ForceDevice::encode_setSceneOrigin(vrpn_int32 &len, - const vrpn_float32 Pos[3], - const vrpn_float32 axis[3], - const vrpn_float32 angle) -{ - int i; - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = 7 * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - for (i = 0; i < 3; i++) - vrpn_buffer(&mptr, &mlen, Pos[i]); - - for (i = 0; i < 3; i++) - vrpn_buffer(&mptr, &mlen, axis[i]); - - vrpn_buffer(&mptr, &mlen, angle); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_setSceneOrigin(const char *buffer, - vrpn_int32 len, - vrpn_float32 Pos[3], - vrpn_float32 axis[3], - vrpn_float32 *angle) -{ - int i; - const char *mptr = buffer; - - if (len != 7 * sizeof(vrpn_int32)) { - fprintf(stderr, - "vrpn_ForceDevice: setsceneorigin message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", len, - static_cast<unsigned long>(7 * sizeof(vrpn_int32))); - return -1; - } - - for (i = 0; i < 3; i++) - CHECK(vrpn_unbuffer(&mptr, &Pos[i])); - - for (i = 0; i < 3; i++) - CHECK(vrpn_unbuffer(&mptr, &axis[i])); - - CHECK(vrpn_unbuffer(&mptr, angle)); - - return 0; -} - -char *vrpn_ForceDevice::encode_setObjectIsTouchable(vrpn_int32 &len, - const vrpn_int32 objNum, - const vrpn_bool IsTouchable) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32) + sizeof(vrpn_bool); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, objNum); - vrpn_buffer(&mptr, &mlen, IsTouchable); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_setObjectIsTouchable(const char *buffer, - vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_bool *IsTouchable) -{ - const char *mptr = buffer; - - if (len != (sizeof(vrpn_int32) + sizeof(vrpn_bool))) { - fprintf(stderr, "vrpn_ForceDevice: set object is touchable message " - "payload error\n"); - fprintf( - stderr, " (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32) + sizeof(vrpn_bool))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, objNum)); - CHECK(vrpn_unbuffer(&mptr, IsTouchable)); - - return 0; -} - -// static -char *vrpn_ForceDevice::encode_forcefield(vrpn_int32 &len, - const vrpn_float32 origin[3], - const vrpn_float32 force[3], - const vrpn_float32 jacobian[3][3], - const vrpn_float32 radius) -{ - int i, j; - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = 16 * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - for (i = 0; i < 3; i++) - vrpn_buffer(&mptr, &mlen, origin[i]); - - for (i = 0; i < 3; i++) - vrpn_buffer(&mptr, &mlen, force[i]); - - for (i = 0; i < 3; i++) - for (j = 0; j < 3; j++) - vrpn_buffer(&mptr, &mlen, jacobian[i][j]); - - vrpn_buffer(&mptr, &mlen, radius); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_forcefield( - const char *buffer, const vrpn_int32 len, vrpn_float32 origin[3], - vrpn_float32 force[3], vrpn_float32 jacobian[3][3], vrpn_float32 *radius) -{ - int i, j; - const char *mptr = buffer; - - if (len != 16 * sizeof(vrpn_float32)) { - fprintf(stderr, - "vrpn_ForceDevice: force field message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", len, - static_cast<unsigned long>(16 * sizeof(vrpn_float32))); - return -1; - } - - for (i = 0; i < 3; i++) - CHECK(vrpn_unbuffer(&mptr, &(origin[i]))); - - for (i = 0; i < 3; i++) - CHECK(vrpn_unbuffer(&mptr, &(force[i]))); - - for (i = 0; i < 3; i++) - for (j = 0; j < 3; j++) - CHECK(vrpn_unbuffer(&mptr, &(jacobian[i][j]))); - - CHECK(vrpn_unbuffer(&mptr, radius)); - - return 0; -} - -char *vrpn_ForceDevice::encode_error(vrpn_int32 &len, - const vrpn_int32 error_code) -{ - - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, error_code); - - return buf; -} - -vrpn_int32 vrpn_ForceDevice::decode_error(const char *buffer, - const vrpn_int32 len, - vrpn_int32 *error_code) -{ - - const char *mptr = buffer; - - if (len != sizeof(vrpn_int32)) { - fprintf(stderr, "vrpn_ForceDevice: error message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", len, - static_cast<unsigned long>(sizeof(vrpn_int32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, error_code)); - - return 0; -} - -void vrpn_ForceDevice::set_plane(vrpn_float32 *p) -{ - for (int i = 0; i < 4; i++) { - plane[i] = p[i]; - } -} - -void vrpn_ForceDevice::set_plane(vrpn_float32 a, vrpn_float32 b, vrpn_float32 c, - vrpn_float32 d) -{ - plane[0] = a; - plane[1] = b; - plane[2] = c; - plane[3] = d; -} - -void vrpn_ForceDevice::set_plane(vrpn_float32 *normal, vrpn_float32 d) -{ - for (int i = 0; i < 3; i++) { - plane[i] = normal[i]; - } - - plane[3] = d; -} - -void vrpn_ForceDevice::sendError(int error_code) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_error(len, error_code); - if (d_connection->pack_message(len, timestamp, error_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// constraint message encode/decode methods - -// static -char *vrpn_ForceDevice::encode_enableConstraint(vrpn_int32 &len, - vrpn_int32 enable) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, enable); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_enableConstraint(const char *buffer, - const vrpn_int32 len, - vrpn_int32 *enable) -{ - const char *mptr = buffer; - - if (len != sizeof(vrpn_int32)) { - fprintf(stderr, "vrpn_ForceDevice: " - "enable constraint message payload error\n" - " (got %d, expected %lud)\n", - len, static_cast<unsigned long>(sizeof(vrpn_int32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, enable)); - - return 0; -} - -// static -char *vrpn_ForceDevice::encode_setConstraintMode(vrpn_int32 &len, - ConstraintGeometry mode) -{ - char *buf; - char *mptr; - vrpn_int32 modeint; - vrpn_int32 mlen; - - len = sizeof(vrpn_int32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - switch (mode) { - case NO_CONSTRAINT: - modeint = 0; - break; - case POINT_CONSTRAINT: - modeint = 1; - break; - case LINE_CONSTRAINT: - modeint = 2; - break; - case PLANE_CONSTRAINT: - modeint = 3; - break; - default: - fprintf(stderr, "vrpn_ForceDevice: " - "Unknown or illegal constraint mode.\n"); - modeint = 0; - break; - } - - vrpn_buffer(&mptr, &mlen, modeint); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_setConstraintMode(const char *buffer, - const vrpn_int32 len, - ConstraintGeometry *mode) -{ - const char *mptr = buffer; - vrpn_int32 modeint; - - if (len != sizeof(vrpn_int32)) { - fprintf(stderr, "vrpn_ForceDevice: " - "constraint mode payload error\n" - " (got %d, expected %lud)\n", - len, static_cast<unsigned long>(sizeof(vrpn_int32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, &modeint)); - - switch (modeint) { - case 0: - *mode = NO_CONSTRAINT; - break; - case 1: - *mode = POINT_CONSTRAINT; - break; - case 2: - *mode = LINE_CONSTRAINT; - break; - case 3: - *mode = PLANE_CONSTRAINT; - break; - default: - fprintf(stderr, "vrpn_ForceDevice: " - "Unknown or illegal constraint mode.\n"); - *mode = NO_CONSTRAINT; - return -1; - } - - return 0; -} - -// static -char *vrpn_ForceDevice::encode_setConstraintPoint(vrpn_int32 &len, - vrpn_float32 x, - vrpn_float32 y, - vrpn_float32 z) -{ - return encodePoint(len, x, y, z); -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_setConstraintPoint(const char *buffer, - const vrpn_int32 len, - vrpn_float32 *x, - vrpn_float32 *y, - vrpn_float32 *z) -{ - return decodePoint(buffer, len, x, y, z); -} - -// static -char *vrpn_ForceDevice::encode_setConstraintLinePoint(vrpn_int32 &len, - vrpn_float32 x, - vrpn_float32 y, - vrpn_float32 z) -{ - return encodePoint(len, x, y, z); -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_setConstraintLinePoint(const char *buffer, - const vrpn_int32 len, - vrpn_float32 *x, - vrpn_float32 *y, - vrpn_float32 *z) -{ - return decodePoint(buffer, len, x, y, z); -} - -// static -char *vrpn_ForceDevice::encode_setConstraintLineDirection(vrpn_int32 &len, - vrpn_float32 x, - vrpn_float32 y, - vrpn_float32 z) -{ - return encodePoint(len, x, y, z); -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_setConstraintLineDirection( - const char *buffer, const vrpn_int32 len, vrpn_float32 *x, vrpn_float32 *y, - vrpn_float32 *z) -{ - return decodePoint(buffer, len, x, y, z); -} - -// static -char *vrpn_ForceDevice::encode_setConstraintPlanePoint(vrpn_int32 &len, - vrpn_float32 x, - vrpn_float32 y, - vrpn_float32 z) -{ - return encodePoint(len, x, y, z); -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_setConstraintPlanePoint( - const char *buffer, const vrpn_int32 len, vrpn_float32 *x, vrpn_float32 *y, - vrpn_float32 *z) -{ - return decodePoint(buffer, len, x, y, z); -} - -// static -char *vrpn_ForceDevice::encode_setConstraintPlaneNormal(vrpn_int32 &len, - vrpn_float32 x, - vrpn_float32 y, - vrpn_float32 z) -{ - return encodePoint(len, x, y, z); -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_setConstraintPlaneNormal( - const char *buffer, const vrpn_int32 len, vrpn_float32 *x, vrpn_float32 *y, - vrpn_float32 *z) -{ - return decodePoint(buffer, len, x, y, z); -} - -// static -char *vrpn_ForceDevice::encode_setConstraintKSpring(vrpn_int32 &len, - vrpn_float32 k) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, k); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decode_setConstraintKSpring(const char *buffer, - const vrpn_int32 len, - vrpn_float32 *k) -{ - const char *mptr = buffer; - - if (len != sizeof(vrpn_float32)) { - fprintf(stderr, "vrpn_ForceDevice: " - "set constraint spring message payload error\n" - " (got %d, expected %lud)\n", - len, static_cast<unsigned long>(sizeof(vrpn_float32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, k)); - - return 0; -} - -// -// utility functions -// - -// static -char *vrpn_ForceDevice::encodePoint(vrpn_int32 &len, vrpn_float32 x, - vrpn_float32 y, vrpn_float32 z) -{ - char *buf; - char *mptr; - vrpn_int32 mlen; - - len = 3 * sizeof(vrpn_float32); - mlen = len; - - buf = new char[len]; - mptr = buf; - - vrpn_buffer(&mptr, &mlen, x); - vrpn_buffer(&mptr, &mlen, y); - vrpn_buffer(&mptr, &mlen, z); - - return buf; -} - -// static -vrpn_int32 vrpn_ForceDevice::decodePoint(const char *buffer, - const vrpn_int32 len, vrpn_float32 *x, - vrpn_float32 *y, vrpn_float32 *z) -{ - const char *mptr = buffer; - - if (len != 3 * sizeof(vrpn_float32)) { - fprintf(stderr, "vrpn_ForceDevice: " - "decode point message payload error\n" - " (got size %d, expected %lud)\n", - len, static_cast<unsigned long>(3 * sizeof(vrpn_float32))); - return -1; - } - - CHECK(vrpn_unbuffer(&mptr, x)); - CHECK(vrpn_unbuffer(&mptr, y)); - CHECK(vrpn_unbuffer(&mptr, z)); - - return 0; -} - -/* ******************** vrpn_ForceDevice_Remote ********************** */ - -vrpn_ForceDevice_Remote::vrpn_ForceDevice_Remote(const char *name, - vrpn_Connection *cn) - : vrpn_ForceDevice(name, cn) - , d_conEnabled(0) - , d_conMode(POINT_CONSTRAINT) -{ - which_plane = 0; - - // Make sure that we have a valid connection - if (d_connection == NULL) { - fprintf(stderr, "vrpn_ForceDevice_Remote: No connection\n"); - return; - } - - // Register a handler for the change callback from this device. - if (register_autodeleted_handler( - force_message_id, handle_force_change_message, this, d_sender_id)) { - fprintf(stderr, "vrpn_ForceDevice_Remote:can't register handler\n"); - d_connection = NULL; - } - - // Register a handler for the scp change callback from this device. - if (register_autodeleted_handler(scp_message_id, handle_scp_change_message, - this, d_sender_id)) { - fprintf(stderr, "vrpn_ForceDevice_Remote:can't register handler\n"); - d_connection = NULL; - } - - // Register a handler for the error change callback from this device. - if (register_autodeleted_handler( - error_message_id, handle_error_change_message, this, d_sender_id)) { - fprintf(stderr, "vrpn_ForceDevice_Remote:can't register handler\n"); - d_connection = NULL; - } - - // Find out what time it is and put this into the timestamp - vrpn_gettimeofday(×tamp, NULL); -} - -// virtual -vrpn_ForceDevice_Remote::~vrpn_ForceDevice_Remote(void) {} - -void vrpn_ForceDevice_Remote::sendSurface(void) -{ // Encode the plane if there is a connection - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_plane(len, plane, SurfaceKspring, SurfaceKdamping, - SurfaceFdynamic, SurfaceFstatic, which_plane, - numRecCycles); - if (d_connection->pack_message(len, timestamp, plane_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - - msgbuf = encode_surface_effects( - len, SurfaceKadhesionNormal, SurfaceKadhesionLateral, - SurfaceTextureAmplitude, SurfaceTextureWavelength, SurfaceBuzzAmp, - SurfaceBuzzFreq); - if (d_connection->pack_message(len, timestamp, plane_effects_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -void vrpn_ForceDevice_Remote::startSurface(void) -{ // Encode the plane if there is a connection - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_plane(len, plane, SurfaceKspring, SurfaceKdamping, - SurfaceFdynamic, SurfaceFstatic, which_plane, - numRecCycles); - if (d_connection->pack_message(len, timestamp, plane_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -void vrpn_ForceDevice_Remote::stopSurface(void) -{ // Encode the plane if there is a connection - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - set_plane(0, 0, 0, 0); - - if (d_connection) { - msgbuf = encode_plane(len, plane, SurfaceKspring, SurfaceKdamping, - SurfaceFdynamic, SurfaceFstatic, which_plane, - numRecCycles); - if (d_connection->pack_message(len, timestamp, plane_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -void vrpn_ForceDevice_Remote::setVertex(vrpn_int32 vertNum, vrpn_float32 x, - vrpn_float32 y, vrpn_float32 z) -{ - setObjectVertex(0, vertNum, x, y, z); -} - -void vrpn_ForceDevice_Remote::setNormal(vrpn_int32 normNum, vrpn_float32 x, - vrpn_float32 y, vrpn_float32 z) -{ - setObjectNormal(0, normNum, x, y, z); -} - -void vrpn_ForceDevice_Remote::setTriangle(vrpn_int32 triNum, vrpn_int32 vert0, - vrpn_int32 vert1, vrpn_int32 vert2, - vrpn_int32 norm0, vrpn_int32 norm1, - vrpn_int32 norm2) -{ - setObjectTriangle(0, triNum, vert0, vert1, vert2, norm0, norm1, norm2); -} - -void vrpn_ForceDevice_Remote::removeTriangle(vrpn_int32 triNum) -{ - removeObjectTriangle(0, triNum); -} - -void vrpn_ForceDevice_Remote::updateTrimeshChanges() -{ - updateObjectTrimeshChanges(0); -} - -// set the trimesh's homogen transform matrix (in row major order) -void vrpn_ForceDevice_Remote::setTrimeshTransform(vrpn_float32 homMatrix[16]) -{ - setObjectTrimeshTransform(0, homMatrix); -} - -// clear the triMesh if connection -void vrpn_ForceDevice_Remote::clearTrimesh(void) { clearObjectTrimesh(0); } - -/** functions for multiple objects in the haptic scene - * *************************************/ -// Add an object to the haptic scene as root (parent -1 = default) or as child -// (ParentNum =the number of the parent) -void vrpn_ForceDevice_Remote::addObject(vrpn_int32 objNum, - vrpn_int32 ParentNum /*=-1*/) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - if (objNum > m_NextAvailableObjectID) m_NextAvailableObjectID = objNum + 1; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_addObject(len, objNum, ParentNum); - if (d_connection->pack_message(len, timestamp, addObject_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// Add an object next to the haptic scene as root -void vrpn_ForceDevice_Remote::addObjectExScene(vrpn_int32 objNum) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - if (objNum > m_NextAvailableObjectID) m_NextAvailableObjectID = objNum + 1; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_addObjectExScene(len, objNum); - if (d_connection->pack_message(len, timestamp, - addObjectExScene_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// vertNum normNum and triNum start at 0 -void vrpn_ForceDevice_Remote::setObjectVertex(vrpn_int32 objNum, - vrpn_int32 vertNum, - vrpn_float32 x, vrpn_float32 y, - vrpn_float32 z) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_vertex(len, objNum, vertNum, x, y, z); - if (d_connection->pack_message(len, timestamp, setVertex_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// NOTE: ghost doesn't take normals, -// and normals still aren't implemented for Hcollide -void vrpn_ForceDevice_Remote::setObjectNormal(vrpn_int32 objNum, - vrpn_int32 normNum, - vrpn_float32 x, vrpn_float32 y, - vrpn_float32 z) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_normal(len, objNum, normNum, x, y, z); - if (d_connection->pack_message(len, timestamp, setNormal_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -void vrpn_ForceDevice_Remote::setObjectTriangle( - vrpn_int32 objNum, vrpn_int32 triNum, vrpn_int32 vert0, vrpn_int32 vert1, - vrpn_int32 vert2, vrpn_int32 norm0 /*=-1*/, vrpn_int32 norm1 /*=-1*/, - vrpn_int32 norm2 /*=-1*/) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_triangle(len, objNum, triNum, vert0, vert1, vert2, - norm0, norm1, norm2); - if (d_connection->pack_message(len, timestamp, setTriangle_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -void vrpn_ForceDevice_Remote::removeObjectTriangle(vrpn_int32 objNum, - vrpn_int32 triNum) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_removeTriangle(len, objNum, triNum); - if (d_connection->pack_message(len, timestamp, - removeTriangle_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// should be called to incorporate the above changes into the -// displayed trimesh -void vrpn_ForceDevice_Remote::updateObjectTrimeshChanges(vrpn_int32 objNum) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_updateTrimeshChanges(len, objNum, SurfaceKspring, - SurfaceKdamping, SurfaceFstatic, - SurfaceFdynamic); - if (d_connection->pack_message( - len, timestamp, updateTrimeshChanges_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// set the trimesh's homogen transform matrix (in row major order) -void vrpn_ForceDevice_Remote::setObjectTrimeshTransform( - vrpn_int32 objNum, vrpn_float32 homMatrix[16]) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_trimeshTransform(len, objNum, homMatrix); - if (d_connection->pack_message(len, timestamp, - transformTrimesh_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// set position of an object -void vrpn_ForceDevice_Remote::setObjectPosition(vrpn_int32 objNum, - vrpn_float32 Pos[3]) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_objectPosition(len, objNum, Pos); - if (d_connection->pack_message( - len, timestamp, setObjectPosition_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// set orientation of an object -void vrpn_ForceDevice_Remote::setObjectOrientation(vrpn_int32 objNum, - vrpn_float32 axis[3], - vrpn_float32 angle) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_objectOrientation(len, objNum, axis, angle); - if (d_connection->pack_message( - len, timestamp, setObjectOrientation_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// set Scale of an object -void vrpn_ForceDevice_Remote::setObjectScale(vrpn_int32 objNum, - vrpn_float32 Scale[3]) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_objectScale(len, objNum, Scale); - if (d_connection->pack_message(len, timestamp, - setObjectScale_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// remove an object from the scene -void vrpn_ForceDevice_Remote::removeObject(vrpn_int32 objNum) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_removeObject(len, objNum); - if (d_connection->pack_message(len, timestamp, removeObject_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -void vrpn_ForceDevice_Remote::clearObjectTrimesh(vrpn_int32 objNum) -{ - char *msgbuf = NULL; - vrpn_int32 len = 0; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_clearTrimesh(len, objNum); - if (d_connection->pack_message(len, timestamp, clearTrimesh_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -/** Functions to organize the scene - * **********************************************************/ -// Change The parent of an object -void vrpn_ForceDevice_Remote::moveToParent(vrpn_int32 objNum, - vrpn_int32 ParentNum) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_moveToParent(len, objNum, ParentNum); - if (d_connection->pack_message(len, timestamp, moveToParent_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// Set the Origin of the haptic scene -void vrpn_ForceDevice_Remote::setHapticOrigin(vrpn_float32 Pos[3], - vrpn_float32 axis[3], - vrpn_float32 angle) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_setHapticOrigin(len, Pos, axis, angle); - if (d_connection->pack_message(len, timestamp, - setHapticOrigin_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// Set the scale of the haptic scene -void vrpn_ForceDevice_Remote::setHapticScale(vrpn_float32 Scale) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_setHapticScale(len, Scale); - if (d_connection->pack_message(len, timestamp, - setHapticScale_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -void vrpn_ForceDevice_Remote::setSceneOrigin(vrpn_float32 Pos[3], - vrpn_float32 axis[3], - vrpn_float32 angle) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_setSceneOrigin(len, Pos, axis, angle); - if (d_connection->pack_message(len, timestamp, - setSceneOrigin_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// get new ID, use only if wish to use vrpn ids and do not want to manage them -// yourself: ids need to be unique -vrpn_int32 vrpn_ForceDevice_Remote::getNewObjectID() -{ - return m_NextAvailableObjectID++; -} - -// make an object touchable or not -void vrpn_ForceDevice_Remote::setObjectIsTouchable( - vrpn_int32 objNum, vrpn_bool IsTouchable /*=true*/) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_setObjectIsTouchable(len, objNum, IsTouchable); - if (d_connection->pack_message( - len, timestamp, setObjectIsTouchable_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// the next time we send a trimesh we will use the following type -void vrpn_ForceDevice_Remote::useHcollide(void) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_setTrimeshType(len, -1, HCOLLIDE); - if (d_connection->pack_message(len, timestamp, - setTrimeshType_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -void vrpn_ForceDevice_Remote::useGhost(void) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_setTrimeshType(len, -1, GHOST); - if (d_connection->pack_message(len, timestamp, - setTrimeshType_message_id, d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// ajout ONDIM -void vrpn_ForceDevice_Remote::startEffect(void) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_custom_effect(len, customEffectId, customEffectParams, - nbCustomEffectParams); - if (d_connection->pack_message(len, timestamp, custom_effect_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -void vrpn_ForceDevice_Remote::stopEffect(void) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - setCustomEffect(-1, NULL, 0); - - if (d_connection) { - msgbuf = encode_custom_effect(len, customEffectId, customEffectParams, - nbCustomEffectParams); - if (d_connection->pack_message(len, timestamp, custom_effect_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} -// fin ajout ONDIM - -// -// constraint methods -// - -#ifndef FD_SPRINGS_AS_FIELDS - -#if 0 -void vrpn_ForceDevice_Remote::enableConstraint (vrpn_int32 enable) { -} - -void vrpn_ForceDevice_Remote::setConstraintMode (ConstraintGeometry mode) { -} - -void vrpn_ForceDevice_Remote::setConstraintPoint -} - -void vrpn_ForceDevice_Remote::setConstraintLinePoint -} - -void vrpn_ForceDevice_Remote::setConstraintLineDirection -} - -void vrpn_ForceDevice_Remote::setConstraintPlanePoint -} - -void vrpn_ForceDevice_Remote::setConstraintPlaneNormal -} - -void vrpn_ForceDevice_Remote::setConstraintKSpring (vrpn_float32 k) { -} -#endif // 0 - -#else - -void vrpn_ForceDevice_Remote::enableConstraint(vrpn_int32 enable) -{ - if (enable == d_conEnabled) return; - d_conEnabled = enable; - - switch (d_conEnabled) { - case 0: - stopForceField(); - break; - case 1: - constraintToForceField(); - sendForceField(); - break; - default: - fprintf(stderr, "vrpn_ForceDevice_Remote::enableConstraint: " - "Illegal value of enable (%d).\n", - enable); - break; - } -} - -void vrpn_ForceDevice_Remote::setConstraintMode(ConstraintGeometry mode) -{ - d_conMode = mode; - constraintToForceField(); - if (d_conEnabled) { - sendForceField(); - } -} - -void vrpn_ForceDevice_Remote::setConstraintPoint(vrpn_float32 point[3]) -{ - d_conPoint[0] = point[0]; - d_conPoint[1] = point[1]; - d_conPoint[2] = point[2]; - constraintToForceField(); - if (d_conEnabled) { - sendForceField(); - } -} - -void vrpn_ForceDevice_Remote::setConstraintLinePoint(vrpn_float32 point[3]) -{ - d_conLinePoint[0] = point[0]; - d_conLinePoint[1] = point[1]; - d_conLinePoint[2] = point[2]; - constraintToForceField(); - if (d_conEnabled) { - sendForceField(); - } -} - -void vrpn_ForceDevice_Remote::setConstraintLineDirection( - vrpn_float32 direction[3]) -{ - d_conLineDirection[0] = direction[0]; - d_conLineDirection[1] = direction[1]; - d_conLineDirection[2] = direction[2]; - constraintToForceField(); - if (d_conEnabled) { - sendForceField(); - } -} - -void vrpn_ForceDevice_Remote::setConstraintPlanePoint(vrpn_float32 point[3]) -{ - d_conPlanePoint[0] = point[0]; - d_conPlanePoint[1] = point[1]; - d_conPlanePoint[2] = point[2]; - constraintToForceField(); - if (d_conEnabled) { - sendForceField(); - } -} - -void vrpn_ForceDevice_Remote::setConstraintPlaneNormal(vrpn_float32 normal[3]) -{ - d_conPlaneNormal[0] = normal[0]; - d_conPlaneNormal[1] = normal[1]; - d_conPlaneNormal[2] = normal[2]; - constraintToForceField(); - if (d_conEnabled) { - sendForceField(); - } -} - -void vrpn_ForceDevice_Remote::setConstraintKSpring(vrpn_float32 k) -{ - d_conKSpring = k; - constraintToForceField(); - if (d_conEnabled) { - sendForceField(); - } -} - -#endif // FD_SPRINGS_AS_FIELDS - -void vrpn_ForceDevice_Remote::sendForceField(void) -{ - sendForceField(ff_origin, ff_force, ff_jacobian, ff_radius); -} - -void vrpn_ForceDevice_Remote::sendForceField(vrpn_float32 origin[3], - vrpn_float32 force[3], - vrpn_float32 jacobian[3][3], - vrpn_float32 radius) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_forcefield(len, origin, force, jacobian, radius); - if (d_connection->pack_message(len, timestamp, forcefield_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -// same as sendForceField but sets force to 0 and sends RELIABLY -void vrpn_ForceDevice_Remote::stopForceField(void) -{ - vrpn_float32 origin[3] = {0, 0, 0}; - vrpn_float32 force[3] = {0, 0, 0}; - vrpn_float32 jacobian[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; - vrpn_float32 radius = 0; - - char *msgbuf; - vrpn_int32 len; - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - msgbuf = encode_forcefield(len, origin, force, jacobian, radius); - if (d_connection->pack_message(len, timestamp, forcefield_message_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "Phantom: cannot write message: tossing\n"); - } - delete[] msgbuf; - } -} - -void vrpn_ForceDevice_Remote::mainloop() -{ - if (d_connection) { - d_connection->mainloop(); - } - client_mainloop(); -} - -int vrpn_ForceDevice_Remote::handle_force_change_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_ForceDevice_Remote *me = (vrpn_ForceDevice_Remote *)userdata; - vrpn_FORCECB tp; - - tp.msg_time = p.msg_time; - decode_force(p.buffer, p.payload_len, tp.force); - me->d_change_list.call_handlers(tp); - - return 0; -} - -int vrpn_ForceDevice_Remote::handle_scp_change_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_ForceDevice_Remote *me = (vrpn_ForceDevice_Remote *)userdata; - vrpn_FORCESCPCB tp; - - tp.msg_time = p.msg_time; - decode_scp(p.buffer, p.payload_len, tp.pos, tp.quat); - me->d_scp_change_list.call_handlers(tp); - - return 0; -} - -int vrpn_ForceDevice_Remote::handle_error_change_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_ForceDevice_Remote *me = (vrpn_ForceDevice_Remote *)userdata; - vrpn_FORCEERRORCB tp; - - if (p.payload_len != sizeof(vrpn_int32)) { - fprintf(stderr, "vrpn_ForceDevice: error message payload" - " error\n(got %d, expected %lud)\n", - p.payload_len, static_cast<unsigned long>(sizeof(vrpn_int32))); - return -1; - } - tp.msg_time = p.msg_time; - decode_error(p.buffer, p.payload_len, &(tp.error_code)); - me->d_error_change_list.call_handlers(tp); - return 0; -} - -void vrpn_ForceDevice_Remote::send(const char *msgbuf, vrpn_int32 len, - vrpn_int32 type) -{ - struct timeval now; - - vrpn_gettimeofday(&now, NULL); - timestamp.tv_sec = now.tv_sec; - timestamp.tv_usec = now.tv_usec; - - if (d_connection) { - if (d_connection->pack_message(len, now, type, d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, - "vrpn_ForceDevice_Remote::send: Can't pack message.\n"); - } - } - - // HP compiler won't let you delete a const argument. - delete[](char *)msgbuf; -} - -#ifdef FD_SPRINGS_AS_FIELDS - -void vrpn_ForceDevice_Remote::constraintToForceField(void) -{ - - vrpn_float32 c[9]; // scratch matrix - int i, j; - - // quatlib wants 64-bit reals; the forcefield code wants 32-bit - // reals. We do most of our math in 64 bits, then copy into 32 - // for output to force field. - - const float largeRadius = 100.0f; // infinity - - switch (d_conMode) { - - case NO_CONSTRAINT: - break; - - case POINT_CONSTRAINT: - setFF_Origin(d_conPoint); - setFF_Force(0.0f, 0.0f, 0.0f); - setFF_Jacobian(-d_conKSpring, 0.0f, 0.0f, 0.0f, -d_conKSpring, 0.0f, - 0.0f, 0.0f, -d_conKSpring); - setFF_Radius(largeRadius); - break; - - case LINE_CONSTRAINT: { - setFF_Origin(d_conLinePoint); - setFF_Force(0.0f, 0.0f, 0.0f); - - // Paul Grayson (pdg@mit.edu) points out that rotating the Jacobian - // won't work and we should use something simpler here. - // Unfortunately, it's because of the apparent difficulty of this - // case that we'd tried rotating a Jacobian in the first place. - // Time to hit the books again looking for something that'll work. - - //------------------------------------------------------------------ - // We want to generate a force that is in the opposite direction - // of the offset between where the pen is and where the line is - // defined to be. Because we are going to multiply the jacobian by - // this offset vector, we want it to hold values that produce a - // force that is in the direction of -OFFSET, but we want the - // force to be scaled by the amount by which OFFSET is perpendicular - // to the line direction (it should be zero along the line). So, - // along the line direction it should always evaluate to (0,0,0) - // independent of OFFSET, and perpendicular to this it should - // always be OFFSET in length in direction -OFFSET, - // which is just -OFFSET, which makes the matrix act like - // -1 scaled by the spring constant. This means that we want a - // matrix with Eigenvalues (-1, -1, 0) whose 0 Eigenvector lies - // along the line direction. We get this by compositing a matrix - // that rotates this vector to lie along Z, then applying the diagonal - // (-1, -1, 0) matrix, then a matrix that rotates Z back to the - // line direction. Remember to scale all of this by the spring - // constant; - // we do this during the diagonal matrix construction. - - // Normalize the direction to avoid having its length scale the force - q_vec_type norm_line_dir; - vrpn_float64 norm_len = - sqrt((d_conLineDirection[0] * d_conLineDirection[0]) + - (d_conLineDirection[1] * d_conLineDirection[1]) + - (d_conLineDirection[2] * d_conLineDirection[2])); - if (norm_len == 0) { - norm_len = 1; - } - for (i = 0; i < 3; i++) { - norm_line_dir[i] = d_conLineDirection[i] / norm_len; - } - - // Construct the rotation from the normalized direction to +Z - // and the rotation back. - q_vec_type z_dir = {0, 0, 1}; - q_type q_forward; - q_matrix_type forward; - q_type q_reverse; - q_matrix_type reverse; - q_from_two_vecs(q_forward, norm_line_dir, z_dir); - q_to_row_matrix(forward, q_forward); - q_invert(q_reverse, q_forward); - q_to_row_matrix(reverse, q_reverse); - - // Construct the (-d_conKSpring, -d_conKSpring, 0) matrix and catenate - // the - // matrices to form the final jacobian. - q_matrix_type diagonal, temp, jacobian; - for (i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { - if ((i == j) && (i < 2)) { - diagonal[i][j] = -d_conKSpring; - } - else { - diagonal[i][j] = 0.0; - } - } - } - q_matrix_mult(temp, diagonal, forward); - q_matrix_mult(jacobian, reverse, temp); - - // Grab the upper-left 3x3 portion of the jacobian and put it into - // the coefficients. - for (i = 0; i < 3; i++) { - for (j = 0; j < 3; j++) { - c[i + j * 3] = (vrpn_float32)jacobian[i][j]; - } - } - - setFF_Jacobian(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8]); - - setFF_Radius(largeRadius); - }; break; - - case PLANE_CONSTRAINT: { - setFF_Origin(d_conPlanePoint); - setFF_Force(0.0f, 0.0f, 0.0f); - - // Normalize the direction to avoid having its length scale the force - vrpn_float64 norm_plane_dir[3]; - vrpn_float64 norm_len = - sqrt((d_conPlaneNormal[0] * d_conPlaneNormal[0]) + - (d_conPlaneNormal[1] * d_conPlaneNormal[1]) + - (d_conPlaneNormal[2] * d_conPlaneNormal[2])); - if (norm_len == 0) { - norm_len = 1; - } - for (i = 0; i < 3; i++) { - norm_plane_dir[i] = d_conPlaneNormal[i] / norm_len; - } - - // Paul Grayson (pdg@mit.edu) points out that rotating the Jacobian - // won't work and we should use something simpler here. The below - // is his code. - - for (i = 0; i < 3; i++) - for (j = 0; j < 3; j++) - c[i + j * 3] = (vrpn_float32)( - -d_conKSpring * norm_plane_dir[i] * norm_plane_dir[j]); - - setFF_Jacobian(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8]); - - setFF_Radius(largeRadius); - }; break; - } -} - -#endif // FD_SPRINGS_AS_FIELDS diff --git a/src/vrpn/vrpn_ForceDevice.h b/src/vrpn/vrpn_ForceDevice.h deleted file mode 100644 index c3cbc4df5e498cb7d11cc6dacc9d4daa0ad4a073..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_ForceDevice.h +++ /dev/null @@ -1,730 +0,0 @@ -#ifndef FORCEDEVICE_H -#define FORCEDEVICE_H - -#include <stddef.h> // for NULL - -#include "vrpn_BaseClass.h" // for vrpn_Callback_List, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_int32, vrpn_float32, etc - -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -#define MAXPLANE 4 // maximum number of planes in the scene - -// for recovery: -#define DEFAULT_NUM_REC_CYCLES (10) - -// possible values for errorCode: -#define FD_VALUE_OUT_OF_RANGE 0 // surface parameter out of range -#define FD_DUTY_CYCLE_ERROR 1 // servo loop is taking too long -#define FD_FORCE_ERROR 2 // max force exceeded, or motors overheated - // or amplifiers not enabled -#define FD_MISC_ERROR 3 // everything else -#define FD_OK 4 // no error - -// If defined, springs are implemented in the client as force fields. -// If not, springs are implemented with special messages -// and extra Ghost classes. Either way support for the messages -// is compiled into the parent class so that servers can support -// both kinds of clients. - -// (Springs as force fields require some knotty mathematical programming -// at the clients that I can't seem to get right, but avoid lots of -// extra message types and an awful lot of bug-prone Ghost.) - -#define FD_SPRINGS_AS_FIELDS - -class VRPN_API vrpn_ForceDevice : public vrpn_BaseClass { - -public: - vrpn_ForceDevice(const char *name, vrpn_Connection *c); - virtual ~vrpn_ForceDevice(void); - - void print_report(void); - void print_plane(void); - - void setSurfaceKspring(vrpn_float32 k) { SurfaceKspring = k; } - void setSurfaceKdamping(vrpn_float32 d) { SurfaceKdamping = d; } - void setSurfaceFstatic(vrpn_float32 ks) { SurfaceFstatic = ks; } - void setSurfaceFdynamic(vrpn_float32 kd) { SurfaceFdynamic = kd; } - void setRecoveryTime(int rt) { numRecCycles = rt; } - - // additional surface properties - void setSurfaceKadhesionNormal(vrpn_float32 k) - { - SurfaceKadhesionNormal = k; - } - void setSurfaceKadhesionLateral(vrpn_float32 k) - { - SurfaceKadhesionLateral = k; - } - void setSurfaceBuzzFrequency(vrpn_float32 freq) { SurfaceBuzzFreq = freq; } - void setSurfaceBuzzAmplitude(vrpn_float32 amp) { SurfaceBuzzAmp = amp; } - void setSurfaceTextureWavelength(vrpn_float32 wl) - { - SurfaceTextureWavelength = wl; - } - void setSurfaceTextureAmplitude(vrpn_float32 amp) - { - SurfaceTextureAmplitude = amp; - } - - void setCustomEffect(vrpn_int32 effectId, vrpn_float32 *params = NULL, - vrpn_uint32 nbParams = 0); - - void setFF_Origin(vrpn_float32 x, vrpn_float32 y, vrpn_float32 z) - { - ff_origin[0] = x; - ff_origin[1] = y; - ff_origin[2] = z; - } - void setFF_Origin(vrpn_float32 x[3]) - { - ff_origin[0] = x[0]; - ff_origin[1] = x[1]; - ff_origin[2] = x[2]; - } - void setFF_Force(vrpn_float32 fx, vrpn_float32 fy, vrpn_float32 fz) - { - ff_force[0] = fx; - ff_force[1] = fy; - ff_force[2] = fz; - } - void setFF_Force(vrpn_float32 f[3]) - { - ff_force[0] = f[0]; - ff_force[1] = f[1]; - ff_force[2] = f[2]; - } - void setFF_Jacobian(vrpn_float32 dfxdx, vrpn_float32 dfxdy, - vrpn_float32 dfxdz, vrpn_float32 dfydx, - vrpn_float32 dfydy, vrpn_float32 dfydz, - vrpn_float32 dfzdx, vrpn_float32 dfzdy, - vrpn_float32 dfzdz) - { - ff_jacobian[0][0] = dfxdx; - ff_jacobian[0][1] = dfxdy; - ff_jacobian[0][2] = dfxdz; - ff_jacobian[1][0] = dfydx; - ff_jacobian[1][1] = dfydy; - ff_jacobian[1][2] = dfydz; - ff_jacobian[2][0] = dfzdx; - ff_jacobian[2][1] = dfzdy; - ff_jacobian[2][2] = dfzdz; - } - void setFF_Radius(vrpn_float32 r) { ff_radius = r; } - - void set_plane(vrpn_float32 *p); - void set_plane(vrpn_float32 *p, vrpn_float32 d); - void set_plane(vrpn_float32 a, vrpn_float32 b, vrpn_float32 c, - vrpn_float32 d); - - void sendError(int error_code); - - int getRecoveryTime(void) { return numRecCycles; } - int connectionAvailable(void) { return (d_connection != NULL); } - - // constants for constraint messages - - enum ConstraintGeometry { - NO_CONSTRAINT, - POINT_CONSTRAINT, - LINE_CONSTRAINT, - PLANE_CONSTRAINT - }; - -protected: - virtual int register_types(void); - - vrpn_int32 force_message_id; // ID of force message to connection - vrpn_int32 plane_message_id; // ID of plane equation message - vrpn_int32 plane_effects_message_id; // additional plane properties - vrpn_int32 forcefield_message_id; // ID of force field message - vrpn_int32 scp_message_id; // ID of surface contact point message - - // constraint messages - - vrpn_int32 enableConstraint_message_id; - vrpn_int32 setConstraintMode_message_id; - vrpn_int32 setConstraintPoint_message_id; - vrpn_int32 setConstraintLinePoint_message_id; - vrpn_int32 setConstraintLineDirection_message_id; - vrpn_int32 setConstraintPlanePoint_message_id; - vrpn_int32 setConstraintPlaneNormal_message_id; - vrpn_int32 setConstraintKSpring_message_id; - // vrpn_int32 set_constraint_message_id;// ID of constraint force message - - // XXX - error messages should be put into the vrpn base class - // whenever someone makes one - - vrpn_int32 error_message_id; // ID of force device error message - - // IDs for trimesh messages - - vrpn_int32 addObject_message_id; - vrpn_int32 addObjectExScene_message_id; - vrpn_int32 moveToParent_message_id; - vrpn_int32 setObjectPosition_message_id; - vrpn_int32 setObjectOrientation_message_id; - vrpn_int32 setObjectScale_message_id; - vrpn_int32 removeObject_message_id; - vrpn_int32 setVertex_message_id; - vrpn_int32 setNormal_message_id; - vrpn_int32 setTriangle_message_id; - vrpn_int32 removeTriangle_message_id; - vrpn_int32 updateTrimeshChanges_message_id; - vrpn_int32 transformTrimesh_message_id; - vrpn_int32 setTrimeshType_message_id; - vrpn_int32 clearTrimesh_message_id; - - // IDs for scene messages - vrpn_int32 setHapticOrigin_message_id; - vrpn_int32 setHapticScale_message_id; - vrpn_int32 setSceneOrigin_message_id; - vrpn_int32 getNewObjectID_message_id; - vrpn_int32 setObjectIsTouchable_message_id; - - // ajout ONDIM - vrpn_int32 custom_effect_message_id; - // fni ajout ONDIM - - // ENCODING - // ajout ONDIM - static char *encode_custom_effect(vrpn_int32 &len, vrpn_uint32 effectId, - const vrpn_float32 *params, - vrpn_uint32 nbParams); - // fin ajout ONDIM - static char *encode_force(vrpn_int32 &length, const vrpn_float64 *force); - static char *encode_scp(vrpn_int32 &length, const vrpn_float64 *pos, - const vrpn_float64 *quat); - static char *encode_plane(vrpn_int32 &length, const vrpn_float32 *plane, - const vrpn_float32 kspring, - const vrpn_float32 kdamp, const vrpn_float32 fdyn, - const vrpn_float32 fstat, - const vrpn_int32 plane_index, - const vrpn_int32 n_rec_cycles); - static char *encode_surface_effects(vrpn_int32 &len, - const vrpn_float32 k_adhesion_norm, - const vrpn_float32 k_adhesion_lat, - const vrpn_float32 tex_amp, - const vrpn_float32 tex_wl, - const vrpn_float32 buzz_amp, - const vrpn_float32 buzz_freq); - static char *encode_vertex(vrpn_int32 &len, const vrpn_int32 objNum, - const vrpn_int32 vertNum, const vrpn_float32 x, - const vrpn_float32 y, const vrpn_float32 z); - static char *encode_normal(vrpn_int32 &len, const vrpn_int32 objNum, - const vrpn_int32 vertNum, const vrpn_float32 x, - const vrpn_float32 y, const vrpn_float32 z); - static char *encode_triangle(vrpn_int32 &len, const vrpn_int32 objNum, - const vrpn_int32 triNum, - const vrpn_int32 vert0, const vrpn_int32 vert1, - const vrpn_int32 vert2, const vrpn_int32 norm0, - const vrpn_int32 norm1, - const vrpn_int32 norm2); - static char *encode_removeTriangle(vrpn_int32 &len, const vrpn_int32 objNum, - const vrpn_int32 triNum); - static char *encode_updateTrimeshChanges(vrpn_int32 &len, - const vrpn_int32 objNum, - const vrpn_float32 kspring, - const vrpn_float32 kdamp, - const vrpn_float32 fdyn, - const vrpn_float32 fstat); - static char *encode_setTrimeshType(vrpn_int32 &len, const vrpn_int32 objNum, - const vrpn_int32 type); - static char *encode_trimeshTransform(vrpn_int32 &len, - const vrpn_int32 objNum, - const vrpn_float32 homMatrix[16]); - - //*added encodes*// - static char *encode_addObject(vrpn_int32 &len, const vrpn_int32 objNum, - const vrpn_int32 ParentNum); - static char *encode_addObjectExScene(vrpn_int32 &len, - const vrpn_int32 objNum); - static char *encode_objectPosition(vrpn_int32 &len, const vrpn_int32 objNum, - const vrpn_float32 Pos[3]); - static char *encode_objectOrientation(vrpn_int32 &len, - const vrpn_int32 objNum, - const vrpn_float32 axis[3], - const vrpn_float32 angle); - static char *encode_objectScale(vrpn_int32 &len, const vrpn_int32 objNum, - const vrpn_float32 Scale[3]); - static char *encode_removeObject(vrpn_int32 &len, const vrpn_int32 objNum); - static char *encode_clearTrimesh(vrpn_int32 &len, const vrpn_int32 objNum); - static char *encode_moveToParent(vrpn_int32 &len, const vrpn_int32 objNum, - const vrpn_int32 parentNum); - - static char *encode_setHapticOrigin(vrpn_int32 &len, - const vrpn_float32 Pos[3], - const vrpn_float32 axis[3], - const vrpn_float32 angle); - static char *encode_setSceneOrigin(vrpn_int32 &len, - const vrpn_float32 Pos[3], - const vrpn_float32 axis[3], - const vrpn_float32 angle); - static char *encode_setHapticScale(vrpn_int32 &len, - const vrpn_float32 Scale); - static char *encode_setObjectIsTouchable(vrpn_int32 &len, - const vrpn_int32 objNum, - const vrpn_bool isTouchable); - - static char *encode_forcefield(vrpn_int32 &len, - const vrpn_float32 origin[3], - const vrpn_float32 force[3], - const vrpn_float32 jacobian[3][3], - const vrpn_float32 radius); - static char *encode_error(vrpn_int32 &len, const vrpn_int32 error_code); - - // DECODING - // ajout ONDIM - static vrpn_int32 decode_custom_effect(const char *buffer, - const vrpn_int32 len, - vrpn_uint32 *effectId, - vrpn_float32 **params, - vrpn_uint32 *nbParams); - // fin ajout ONDIM - static vrpn_int32 decode_force(const char *buffer, const vrpn_int32 len, - vrpn_float64 *force); - static vrpn_int32 decode_scp(const char *buffer, const vrpn_int32 len, - vrpn_float64 *pos, vrpn_float64 *quat); - static vrpn_int32 decode_plane(const char *buffer, const vrpn_int32 len, - vrpn_float32 *plane, vrpn_float32 *kspring, - vrpn_float32 *kdamp, vrpn_float32 *fdyn, - vrpn_float32 *fstat, vrpn_int32 *plane_index, - vrpn_int32 *n_rec_cycles); - static vrpn_int32 decode_surface_effects( - const char *buffer, const vrpn_int32 len, vrpn_float32 *k_adhesion_norm, - vrpn_float32 *k_adhesion_lat, vrpn_float32 *tex_amp, - vrpn_float32 *tex_wl, vrpn_float32 *buzz_amp, vrpn_float32 *buzz_freq); - static vrpn_int32 decode_vertex(const char *buffer, const vrpn_int32 len, - vrpn_int32 *objNum, vrpn_int32 *vertNum, - vrpn_float32 *x, vrpn_float32 *y, - vrpn_float32 *z); - static vrpn_int32 decode_normal(const char *buffer, const vrpn_int32 len, - vrpn_int32 *objNum, vrpn_int32 *vertNum, - vrpn_float32 *x, vrpn_float32 *y, - vrpn_float32 *z); - static vrpn_int32 decode_triangle(const char *buffer, const vrpn_int32 len, - vrpn_int32 *objNum, vrpn_int32 *triNum, - vrpn_int32 *vert0, vrpn_int32 *vert1, - vrpn_int32 *vert2, vrpn_int32 *norm0, - vrpn_int32 *norm1, vrpn_int32 *norm2); - static vrpn_int32 decode_removeTriangle(const char *buffer, - const vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_int32 *triNum); - static vrpn_int32 - decode_updateTrimeshChanges(const char *buffer, const vrpn_int32 len, - vrpn_int32 *objNum, vrpn_float32 *kspring, - vrpn_float32 *kdamp, vrpn_float32 *fdyn, - vrpn_float32 *fstat); - static vrpn_int32 decode_setTrimeshType(const char *buffer, - const vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_int32 *type); - static vrpn_int32 decode_trimeshTransform(const char *buffer, - const vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_float32 homMatrix[16]); - - //*added decodes*// - static vrpn_int32 decode_addObject(const char *buffer, vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_int32 *ParentNum); - static vrpn_int32 decode_addObjectExScene(const char *buffer, - vrpn_int32 len, - vrpn_int32 *objNum); - static vrpn_int32 decode_objectPosition(const char *buffer, vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_float32 Pos[3]); - static vrpn_int32 decode_objectOrientation(const char *buffer, - vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_float32 axis[3], - vrpn_float32 *angle); - static vrpn_int32 decode_objectScale(const char *buffer, vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_float32 Scale[3]); - static vrpn_int32 decode_removeObject(const char *buffer, vrpn_int32 len, - vrpn_int32 *objNum); - static vrpn_int32 decode_clearTrimesh(const char *buffer, vrpn_int32 len, - vrpn_int32 *objNum); - static vrpn_int32 decode_moveToParent(const char *buffer, vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_int32 *parentNum); - - static vrpn_int32 decode_setHapticOrigin(const char *buffer, vrpn_int32 len, - vrpn_float32 Pos[3], - vrpn_float32 axis[3], - vrpn_float32 *angle); - static vrpn_int32 decode_setHapticScale(const char *buffer, vrpn_int32 len, - vrpn_float32 *Scale); - static vrpn_int32 decode_setSceneOrigin(const char *buffer, vrpn_int32 len, - vrpn_float32 Pos[3], - vrpn_float32 axis[3], - vrpn_float32 *angle); - static vrpn_int32 decode_setObjectIsTouchable(const char *buffer, - vrpn_int32 len, - vrpn_int32 *objNum, - vrpn_bool *isTouchable); - - static vrpn_int32 - decode_forcefield(const char *buffer, const vrpn_int32 len, - vrpn_float32 origin[3], vrpn_float32 force[3], - vrpn_float32 jacobian[3][3], vrpn_float32 *radius); - static vrpn_int32 decode_error(const char *buffer, const vrpn_int32 len, - vrpn_int32 *error_code); - - // constraint encoding & decoding - - static char *encode_enableConstraint(vrpn_int32 &len, vrpn_int32 enable); - static vrpn_int32 decode_enableConstraint(const char *buffer, - const vrpn_int32 len, - vrpn_int32 *enable); - - static char *encode_setConstraintMode(vrpn_int32 &len, - ConstraintGeometry mode); - static vrpn_int32 decode_setConstraintMode(const char *buffer, - const vrpn_int32 len, - ConstraintGeometry *mode); - - static char *encode_setConstraintPoint(vrpn_int32 &len, vrpn_float32 x, - vrpn_float32 y, vrpn_float32 z); - static vrpn_int32 decode_setConstraintPoint(const char *buffer, - const vrpn_int32 len, - vrpn_float32 *x, - vrpn_float32 *y, - vrpn_float32 *z); - - static char *encode_setConstraintLinePoint(vrpn_int32 &len, vrpn_float32 x, - vrpn_float32 y, vrpn_float32 z); - static vrpn_int32 decode_setConstraintLinePoint(const char *buffer, - const vrpn_int32 len, - vrpn_float32 *x, - vrpn_float32 *y, - vrpn_float32 *z); - - static char *encode_setConstraintLineDirection(vrpn_int32 &len, - vrpn_float32 x, - vrpn_float32 y, - vrpn_float32 z); - static vrpn_int32 decode_setConstraintLineDirection(const char *buffer, - const vrpn_int32 len, - vrpn_float32 *x, - vrpn_float32 *y, - vrpn_float32 *z); - - static char *encode_setConstraintPlanePoint(vrpn_int32 &len, vrpn_float32 x, - vrpn_float32 y, vrpn_float32 z); - static vrpn_int32 decode_setConstraintPlanePoint(const char *buffer, - const vrpn_int32 len, - vrpn_float32 *x, - vrpn_float32 *y, - vrpn_float32 *z); - - static char *encode_setConstraintPlaneNormal(vrpn_int32 &len, - vrpn_float32 x, vrpn_float32 y, - vrpn_float32 z); - static vrpn_int32 decode_setConstraintPlaneNormal(const char *buffer, - const vrpn_int32 len, - vrpn_float32 *x, - vrpn_float32 *y, - vrpn_float32 *z); - - static char *encode_setConstraintKSpring(vrpn_int32 &len, vrpn_float32 k); - static vrpn_int32 decode_setConstraintKSpring(const char *buffer, - const vrpn_int32 len, - vrpn_float32 *k); - - // utility functions - - static char *encodePoint(vrpn_int32 &len, vrpn_float32 x, vrpn_float32 y, - vrpn_float32 z); - static vrpn_int32 decodePoint(const char *buffer, const vrpn_int32 len, - vrpn_float32 *x, vrpn_float32 *y, - vrpn_float32 *z); - - struct timeval timestamp; - - vrpn_int32 which_plane; - - vrpn_float64 d_force[3]; - ///< d_force isn't used in vrpn_ForceDevice, but seems to be used - ///< by derived classes? What's the meaning? - - vrpn_float64 scp_pos[3]; - vrpn_float64 scp_quat[4]; // for torque - vrpn_float32 plane[4]; - - vrpn_float32 ff_origin[3]; - vrpn_float32 ff_force[3]; - vrpn_float32 ff_jacobian[3][3]; // J[i][j] = dF[i]/dx[j] - vrpn_float32 ff_radius; - - vrpn_float32 SurfaceKspring; - vrpn_float32 SurfaceKdamping; - vrpn_float32 SurfaceFstatic; - vrpn_float32 SurfaceFdynamic; - vrpn_int32 numRecCycles; - vrpn_int32 errorCode; - - vrpn_float32 SurfaceKadhesionLateral; - vrpn_float32 SurfaceKadhesionNormal; - vrpn_float32 SurfaceBuzzFreq; - vrpn_float32 SurfaceBuzzAmp; - vrpn_float32 SurfaceTextureWavelength; - vrpn_float32 SurfaceTextureAmplitude; - - // ajout ONDIM - vrpn_int32 customEffectId; - vrpn_float32 *customEffectParams; - vrpn_uint32 nbCustomEffectParams; - // fin ajout ONDIM -}; - -// User routine to handle position reports for surface contact point (SCP) -// This is in vrpn_ForceDevice rather than vrpn_Tracker because only -// a force feedback device should know anything about SCPs as this is a -// part of the force feedback model. It may be preferable to use the SCP -// rather than the tracker position for graphics so the hand position -// doesn't appear to go below the surface making the surface look very -// compliant. -typedef struct _vrpn_FORCESCPCB { - struct timeval msg_time; // Time of the report - vrpn_float64 pos[3]; // position of SCP - vrpn_float64 quat[4]; // orientation of SCP -} vrpn_FORCESCPCB; -typedef void(VRPN_CALLBACK *vrpn_FORCESCPHANDLER)(void *userdata, - const vrpn_FORCESCPCB info); - -typedef struct _vrpn_FORCECB { - struct timeval msg_time; // Time of the report - vrpn_float64 force[3]; // force value -} vrpn_FORCECB; -typedef void(VRPN_CALLBACK *vrpn_FORCECHANGEHANDLER)(void *userdata, - const vrpn_FORCECB info); - -typedef struct _vrpn_FORCEERRORCB { - struct timeval msg_time; // time of the report - vrpn_int32 error_code; // type of error -} vrpn_FORCEERRORCB; -typedef void(VRPN_CALLBACK *vrpn_FORCEERRORHANDLER)( - void *userdata, const vrpn_FORCEERRORCB info); - -class VRPN_API vrpn_ForceDevice_Remote : public vrpn_ForceDevice { -public: - // The name of the force device to connect to. - // The connection argument is used only if you already have a connection - // the device must listen on (it is not normally used). - vrpn_ForceDevice_Remote(const char *name, vrpn_Connection *cn = NULL); - virtual ~vrpn_ForceDevice_Remote(void); - - void sendSurface(void); - void startSurface(void); - void stopSurface(void); - - /** functions for a single object - * **********************************************************/ - // vertNum normNum and triNum start at 0 - void setVertex(vrpn_int32 vertNum, vrpn_float32 x, vrpn_float32 y, - vrpn_float32 z); - // NOTE: ghost doesn't take normals, - // and normals still aren't implemented for Hcollide - void setNormal(vrpn_int32 normNum, vrpn_float32 x, vrpn_float32 y, - vrpn_float32 z); - void setTriangle(vrpn_int32 triNum, vrpn_int32 vert0, vrpn_int32 vert1, - vrpn_int32 vert2, vrpn_int32 norm0 = -1, - vrpn_int32 norm1 = -1, vrpn_int32 norm2 = -1); - void removeTriangle(vrpn_int32 triNum); - // should be called to incorporate the above changes into the - // displayed trimesh - void updateTrimeshChanges(); - // set the trimesh's homogen transform matrix (in row major order) - void setTrimeshTransform(vrpn_float32 homMatrix[16]); - void clearTrimesh(void); - - /** functions for multiple objects in the haptic scene - * *************************************/ - // Add an object to the haptic scene as root (parent -1 = default) or as - // child (ParentNum =the number of the parent) - void addObject(vrpn_int32 objNum, vrpn_int32 ParentNum = -1); - // Add an object next to the haptic scene as root - void addObjectExScene(vrpn_int32 objNum); - // vertNum normNum and triNum start at 0 - void setObjectVertex(vrpn_int32 objNum, vrpn_int32 vertNum, vrpn_float32 x, - vrpn_float32 y, vrpn_float32 z); - // NOTE: ghost doesn't take normals, - // and normals still aren't implemented for Hcollide - void setObjectNormal(vrpn_int32 objNum, vrpn_int32 normNum, vrpn_float32 x, - vrpn_float32 y, vrpn_float32 z); - void setObjectTriangle(vrpn_int32 objNum, vrpn_int32 triNum, - vrpn_int32 vert0, vrpn_int32 vert1, vrpn_int32 vert2, - vrpn_int32 norm0 = -1, vrpn_int32 norm1 = -1, - vrpn_int32 norm2 = -1); - void removeObjectTriangle(vrpn_int32 objNum, vrpn_int32 triNum); - // should be called to incorporate the above changes into the - // displayed trimesh - void updateObjectTrimeshChanges(vrpn_int32 objNum); - // set the trimesh's homogen transform matrix (in row major order) - void setObjectTrimeshTransform(vrpn_int32 objNum, - vrpn_float32 homMatrix[16]); - // set position of an object - void setObjectPosition(vrpn_int32 objNum, vrpn_float32 Pos[3]); - // set orientation of an object - void setObjectOrientation(vrpn_int32 objNum, vrpn_float32 axis[3], - vrpn_float32 angle); - // set Scale of an object only x scale is supported at the moment - void setObjectScale(vrpn_int32 objNum, vrpn_float32 Scale[3]); - // remove an object from the scene - void removeObject(vrpn_int32 objNum); - void clearObjectTrimesh(vrpn_int32 objNum); - - /** Functions to organize the scene - * **********************************************************/ - // Change The parent of an object - void moveToParent(vrpn_int32 objNum, vrpn_int32 ParentNum); - // Set the Origin of the haptic device - void setHapticOrigin(vrpn_float32 Pos[3], vrpn_float32 axis[3], - vrpn_float32 angle); - // Set the scale factor of the haptic device - void setHapticScale(vrpn_float32 Scale); - // Set the Origin of the scene - void setSceneOrigin(vrpn_float32 Pos[3], vrpn_float32 axis[3], - vrpn_float32 angle); - // get new ID, use only if wish to use vrpn ids and do not want to manage - // them yourself: ids need to be unique - vrpn_int32 getNewObjectID(); - // make an object touchable or not - void setObjectIsTouchable(vrpn_int32 objNum, vrpn_bool IsTouchable = true); - - // the next time we send a trimesh we will use the following type - void useHcollide(); - void useGhost(); - - // Generalized constraint code. - // Constrains as a spring connected to a point, sliding along a line - // (constraint forces in a plane perpendicular to the line), or - // sliding along a plane (constraint forces only along the plane's - // normal). LineDirection and PlaneNormal should be normalized - // (vector length == 1). - - // Constraints are implemented as force fields, so both cannot - // run at once. - - // XXX it would be safer if changes (especially enable/disable) - // had better relaxation support - - void enableConstraint(vrpn_int32 enable); // zero disables - void setConstraintMode(ConstraintGeometry mode); - void setConstraintPoint(vrpn_float32 point[3]); - void setConstraintLinePoint(vrpn_float32 point[3]); - void setConstraintLineDirection(vrpn_float32 direction[3]); - void setConstraintPlanePoint(vrpn_float32 point[3]); - void setConstraintPlaneNormal(vrpn_float32 normal[3]); - void setConstraintKSpring(vrpn_float32 k); - - // void sendConstraint (vrpn_int32 enable, vrpn_float32 x, - // vrpn_float32 y, vrpn_float32 z, vrpn_float32 kSpr); - - // At the <origin> of the field, user feels the specified <force>. - // As the user moves away from the origin, the force felt changes - // according to the jacobian. If the user moves further than <radius> - // from <origin>, the field cuts out. - - // XXX it would be safer for the field to attenuate rapidly - // from the value at the radius if the user moves beyond the radius - - void sendForceField(vrpn_float32 origin[3], vrpn_float32 force[3], - vrpn_float32 jacobian[3][3], vrpn_float32 radius); - void sendForceField(void); - void stopForceField(void); - - // ajout ONDIM - void startEffect(void); - void stopEffect(void); - // fin ajout ONDIM - - // This routine calls the mainloop of the connection it is on - virtual void mainloop(); - - // (un)Register a callback handler to handle a force change - // and plane equation change and trimesh change - virtual int register_force_change_handler(void *userdata, - vrpn_FORCECHANGEHANDLER handler) - { - return d_change_list.register_handler(userdata, handler); - }; - virtual int unregister_force_change_handler(void *userdata, - vrpn_FORCECHANGEHANDLER handler) - { - return d_change_list.unregister_handler(userdata, handler); - }; - - virtual int register_scp_change_handler(void *userdata, - vrpn_FORCESCPHANDLER handler) - { - return d_scp_change_list.register_handler(userdata, handler); - }; - virtual int unregister_scp_change_handler(void *userdata, - vrpn_FORCESCPHANDLER handler) - { - return d_scp_change_list.unregister_handler(userdata, handler); - }; - - virtual int register_error_handler(void *userdata, - vrpn_FORCEERRORHANDLER handler) - { - return d_error_change_list.register_handler(userdata, handler); - }; - virtual int unregister_error_handler(void *userdata, - vrpn_FORCEERRORHANDLER handler) - { - return d_error_change_list.unregister_handler(userdata, handler); - }; - -protected: - vrpn_Callback_List<vrpn_FORCECB> d_change_list; - static int VRPN_CALLBACK - handle_force_change_message(void *userdata, vrpn_HANDLERPARAM p); - - vrpn_Callback_List<vrpn_FORCESCPCB> d_scp_change_list; - static int VRPN_CALLBACK - handle_scp_change_message(void *userdata, vrpn_HANDLERPARAM p); - - vrpn_Callback_List<vrpn_FORCEERRORCB> d_error_change_list; - static int VRPN_CALLBACK - handle_error_change_message(void *userdata, vrpn_HANDLERPARAM p); - - // constraint types - - vrpn_int32 d_conEnabled; - ConstraintGeometry d_conMode; - vrpn_float32 d_conPoint[3]; - vrpn_float32 d_conLinePoint[3]; - vrpn_float64 d_conLineDirection[3]; // (assumed) normalized - vrpn_float32 d_conPlanePoint[3]; - vrpn_float64 d_conPlaneNormal[3]; // (assumed) normalized - vrpn_float32 d_conKSpring; - - // haptic scene variables - vrpn_int32 m_NextAvailableObjectID; - - // utility functions - - void send(const char *msgbuf, vrpn_int32 len, vrpn_int32 type); -// Takes a pointer to a buffer, the length of the buffer, and the -// vrpn message type id to send. Sends the buffer reliably -// over connection AND DELETES THE BUFFER. - -#ifdef FD_SPRINGS_AS_FIELDS - - void constraintToForceField(void); -// takes the current cs_* settings and translates them into -// a force field. - -#endif // FD_SPRINGS_AS_FIELDS -}; - -#endif diff --git a/src/vrpn/vrpn_ForceDeviceServer.C b/src/vrpn/vrpn_ForceDeviceServer.C deleted file mode 100644 index c7ed49a92a14c9e3f52e1d6244bc5d3ebacc3ded..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_ForceDeviceServer.C +++ /dev/null @@ -1,587 +0,0 @@ -// vrpn_ForceDeviceServer.cpp: implementation of the vrpn_ForceDeviceServer -// class. -// -////////////////////////////////////////////////////////////////////// - -#include <stdio.h> // for fprintf, stderr, NULL - -#include "vrpn_Connection.h" // for vrpn_HANDLERPARAM, etc -#include "vrpn_ForceDeviceServer.h" - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -vrpn_ForceDeviceServer::vrpn_ForceDeviceServer(const char *name, - vrpn_Connection *c) - : vrpn_ForceDevice(name, c) -{ - if (register_autodeleted_handler(addObject_message_id, - handle_addObject_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(addObjectExScene_message_id, - handle_addObjectExScene_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(setVertex_message_id, - handle_setVertex_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(setNormal_message_id, - handle_setNormal_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(setTriangle_message_id, - handle_setTriangle_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(removeTriangle_message_id, - handle_removeTriangle_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(updateTrimeshChanges_message_id, - handle_updateTrimeshChanges_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(transformTrimesh_message_id, - handle_transformTrimesh_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(setTrimeshType_message_id, - handle_setTrimeshType_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(setObjectPosition_message_id, - handle_setObjectPosition_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(setObjectOrientation_message_id, - handle_setObjectOrientation_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(setObjectScale_message_id, - handle_setObjectScale_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(removeObject_message_id, - handle_removeObject_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(moveToParent_message_id, - handle_moveToParent_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(setHapticOrigin_message_id, - handle_setHapticOrigin_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(setHapticScale_message_id, - handle_setHapticScale_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(setSceneOrigin_message_id, - handle_setSceneOrigin_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(setObjectIsTouchable_message_id, - handle_setObjectIsTouchable_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } - if (register_autodeleted_handler(clearTrimesh_message_id, - handle_clearTrimesh_message, this, - vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr, "vrpn_Phantom:can't register handler\n"); - vrpn_ForceDevice::d_connection = NULL; - } -} - -vrpn_ForceDeviceServer::~vrpn_ForceDeviceServer() {} - -int vrpn_ForceDeviceServer::handle_addObject_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_int32 objNum, parentNum; - decode_addObject(p.buffer, p.payload_len, &objNum, &parentNum); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - if (me->addObject(objNum, parentNum)) { - return 0; - } - else { - fprintf(stderr, "vrpn_Phantom: error in trimesh::addObject\n"); - return -1; - } -#endif -} - -int vrpn_ForceDeviceServer::handle_addObjectExScene_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_int32 objNum; - decode_addObjectExScene(p.buffer, p.payload_len, &objNum); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - if (me->addObjectExScene(objNum)) { - return 0; - } - else { - fprintf(stderr, "vrpn_Phantom: error in trimesh::addObjectExScene\n"); - return -1; - } -#endif -} - -int vrpn_ForceDeviceServer::handle_setVertex_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_int32 temp; - vrpn_int32 objNum; - int vertNum; - float x, y, z; - decode_vertex(p.buffer, p.payload_len, &objNum, &temp, &x, &y, &z); - vertNum = temp; - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - if (me->setVertex(objNum, vertNum, x, y, z)) { - return 0; - } - else { - fprintf(stderr, "vrpn_Phantom: error in trimesh::setVertex\n"); - return -1; - } -#endif -} - -int vrpn_ForceDeviceServer::handle_setNormal_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_int32 temp; - vrpn_int32 objNum; - int normNum; - float x, y, z; - - decode_normal(p.buffer, p.payload_len, &objNum, &temp, &x, &y, &z); - normNum = temp; - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - if (me->setNormal(objNum, normNum, x, y, z)) - return 0; - else { - fprintf(stderr, "vrpn_Phantom: error in trimesh::setNormal\n"); - return -1; - } -#endif -} - -int vrpn_ForceDeviceServer::handle_setTriangle_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_int32 triNum, v0, v1, v2, n0, n1, n2; - vrpn_int32 objNum; - decode_triangle(p.buffer, p.payload_len, &objNum, &triNum, &v0, &v1, &v2, - &n0, &n1, &n2); -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - if (me->setTriangle(objNum, triNum, v0, v1, v2, n0, n1, n2)) - return 0; - else { - fprintf(stderr, "vrpn_Phantom: error in trimesh::setTriangle\n"); - return -1; - } -#endif -} - -int vrpn_ForceDeviceServer::handle_removeTriangle_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_int32 triNum; - vrpn_int32 objNum; - - decode_removeTriangle(p.buffer, p.payload_len, &objNum, &triNum); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - if (me->removeTriangle(objNum, triNum)) - return 0; - else { - fprintf(stderr, "vrpn_Phantom: error in trimesh::removeTriangle\n"); - return -1; - } -#endif -} - -int vrpn_ForceDeviceServer::handle_updateTrimeshChanges_message( - void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - float SurfaceKspring, SurfaceKdamping, SurfaceFdynamic, SurfaceFstatic; - vrpn_int32 objNum; - - decode_updateTrimeshChanges(p.buffer, p.payload_len, &objNum, - &SurfaceKspring, &SurfaceKdamping, - &SurfaceFdynamic, &SurfaceFstatic); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->updateTrimeshChanges(objNum, SurfaceKspring, SurfaceFstatic, - SurfaceFdynamic, SurfaceKdamping); - - return 0; -#endif -} - -int vrpn_ForceDeviceServer::handle_setTrimeshType_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_int32 temp; - vrpn_int32 objNum; - - decode_setTrimeshType(p.buffer, p.payload_len, &objNum, &temp); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->setTrimeshType(objNum, temp); - return 0; -#endif -} - -int vrpn_ForceDeviceServer::handle_clearTrimesh_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_int32 objNum; - - decode_clearTrimesh(p.buffer, p.payload_len, &objNum); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->clearTrimesh(objNum); - return 0; -#endif -} - -int vrpn_ForceDeviceServer::handle_transformTrimesh_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - float xformMatrix[16]; - vrpn_int32 objNum; - - decode_trimeshTransform(p.buffer, p.payload_len, &objNum, xformMatrix); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->setTrimeshTransform(objNum, xformMatrix); - return 0; -#endif -} - -int vrpn_ForceDeviceServer::handle_setObjectPosition_message( - void *userdata, vrpn_HANDLERPARAM p) -{ - - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_int32 objNum; - vrpn_float32 pos[3]; - - decode_objectPosition(p.buffer, p.payload_len, &objNum, pos); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->setObjectPosition(objNum, pos); - return 0; -#endif -} - -int vrpn_ForceDeviceServer::handle_setObjectOrientation_message( - void *userdata, vrpn_HANDLERPARAM p) -{ - - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_int32 objNum; - vrpn_float32 axis[3]; - vrpn_float32 angle; - - decode_objectOrientation(p.buffer, p.payload_len, &objNum, axis, &angle); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->setObjectOrientation(objNum, axis, angle); - return 0; -#endif -} - -int vrpn_ForceDeviceServer::handle_setObjectScale_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_float32 scale[3]; - vrpn_int32 objNum; - - decode_objectScale(p.buffer, p.payload_len, &objNum, scale); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->setObjectScale(objNum, scale); - return 0; -#endif -} - -int vrpn_ForceDeviceServer::handle_removeObject_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_int32 objNum; - - decode_removeObject(p.buffer, p.payload_len, &objNum); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->removeObject(objNum); - return 0; -#endif -} - -int vrpn_ForceDeviceServer::handle_moveToParent_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_int32 objNum, parentNum; - - decode_moveToParent(p.buffer, p.payload_len, &objNum, &parentNum); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->moveToParent(objNum, parentNum); - return 0; -#endif -} - -int vrpn_ForceDeviceServer::handle_setHapticOrigin_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_float32 pos[3]; - vrpn_float32 axis[3], angle; - - decode_setHapticOrigin(p.buffer, p.payload_len, pos, axis, &angle); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->setHapticOrigin(pos, axis, angle); - return 0; -#endif -} -int vrpn_ForceDeviceServer::handle_setHapticScale_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_float32 scale; - - decode_setHapticScale(p.buffer, p.payload_len, &scale); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->setHapticScale(scale); - return 0; -#endif -} -int vrpn_ForceDeviceServer::handle_setSceneOrigin_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_float32 pos[3]; - vrpn_float32 axis[3], angle; - - decode_setSceneOrigin(p.buffer, p.payload_len, pos, axis, &angle); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->setSceneOrigin(pos, axis, angle); - return 0; -#endif -} -int vrpn_ForceDeviceServer::handle_setObjectIsTouchable_message( - void *userdata, vrpn_HANDLERPARAM p) -{ - - vrpn_ForceDeviceServer *me = (vrpn_ForceDeviceServer *)userdata; - - vrpn_bool touch; - vrpn_int32 objNum; - - decode_setObjectIsTouchable(p.buffer, p.payload_len, &objNum, &touch); - -#ifdef VRPN_USE_HDAPI - struct timeval now; - vrpn_gettimeofday(&now, NULL); - me->send_text_message("Trimesh not supported under HDAPI", now, - vrpn_TEXT_ERROR); - return 0; -#else - me->setObjectIsTouchable(objNum, touch); - return 0; -#endif -} diff --git a/src/vrpn/vrpn_ForceDeviceServer.h b/src/vrpn/vrpn_ForceDeviceServer.h deleted file mode 100644 index 61441af2ae54a3a591aaddbb18929b115c8e0bfa..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_ForceDeviceServer.h +++ /dev/null @@ -1,129 +0,0 @@ -// vrpn_ForceDeviceServer.h: interface for the vrpn_ForceDeviceServer class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined( \ - AFX_VRPN_FORCEDEVICESERVER_H__E5B0D6FA_E426_45E5_97C7_B2169BEBF90A__INCLUDED_) -#define AFX_VRPN_FORCEDEVICESERVER_H__E5B0D6FA_E426_45E5_97C7_B2169BEBF90A__INCLUDED_ - -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_ForceDevice.h" // for vrpn_ForceDevice -#include "vrpn_HashST.h" // for vrpn_Hash -#include "vrpn_Types.h" // for vrpn_int32, vrpn_float32, etc - -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -typedef vrpn_Hash<unsigned int, void *> vrpn_VoidHash; -typedef struct _vrpn_DisplayableObject { - int m_ObjectType; - void *m_pObject; - void *m_pObjectMesh; - -} vrpn_DISPLAYABLEOBJECT; - -typedef vrpn_Hash<unsigned int, vrpn_DISPLAYABLEOBJECT *> vrpn_DISPLAYABLEHASH; - -class VRPN_API vrpn_ForceDeviceServer : public vrpn_ForceDevice { -public: - vrpn_ForceDeviceServer(const char *name, vrpn_Connection *c); - virtual ~vrpn_ForceDeviceServer(); - -protected: - static int VRPN_CALLBACK - handle_addObject_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_addObjectExScene_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setVertex_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setNormal_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setTriangle_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_removeTriangle_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_updateTrimeshChanges_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_transformTrimesh_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setTrimeshType_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setObjectPosition_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setObjectOrientation_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setObjectScale_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_removeObject_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_moveToParent_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setHapticOrigin_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setHapticScale_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setSceneOrigin_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setObjectIsTouchable_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_clearTrimesh_message(void *userdata, vrpn_HANDLERPARAM p); - // Add an object to the haptic scene as root (parent -1 = default) or as - // child (ParentNum =the number of the parent) - virtual bool addObject(vrpn_int32 objNum, vrpn_int32 ParentNum = -1) = 0; - // Add an object next to the haptic scene as root - virtual bool addObjectExScene(vrpn_int32 objNum) = 0; - // vertNum normNum and triNum start at 0 - virtual bool setVertex(vrpn_int32 objNum, vrpn_int32 vertNum, - vrpn_float32 x, vrpn_float32 y, vrpn_float32 z) = 0; - // NOTE: ghost doesn't take normals, - // and normals still aren't implemented for Hcollide - virtual bool setNormal(vrpn_int32 objNum, vrpn_int32 normNum, - vrpn_float32 x, vrpn_float32 y, vrpn_float32 z) = 0; - virtual bool setTriangle(vrpn_int32 objNum, vrpn_int32 triNum, - vrpn_int32 vert0, vrpn_int32 vert1, - vrpn_int32 vert2, vrpn_int32 norm0 = -1, - vrpn_int32 norm1 = -1, vrpn_int32 norm2 = -1) = 0; - virtual bool removeTriangle(vrpn_int32 objNum, vrpn_int32 triNum) = 0; - // should be called to incorporate the above changes into the - // displayed trimesh - virtual bool updateTrimeshChanges(vrpn_int32 objNum, vrpn_float32 kspring, - vrpn_float32 kdamp, vrpn_float32 fdyn, - vrpn_float32 fstat) = 0; - // set trimesh type - virtual bool setTrimeshType(vrpn_int32 objNum, vrpn_int32 type) = 0; - // set the trimesh's homogen transform matrix (in row major order) - virtual bool setTrimeshTransform(vrpn_int32 objNum, - vrpn_float32 homMatrix[16]) = 0; - // set position of an object - virtual bool setObjectPosition(vrpn_int32 objNum, vrpn_float32 Pos[3]) = 0; - // set orientation of an object - virtual bool setObjectOrientation(vrpn_int32 objNum, vrpn_float32 axis[3], - vrpn_float32 angle) = 0; - // set Scale of an object - virtual bool setObjectScale(vrpn_int32 objNum, vrpn_float32 Scale[3]) = 0; - // remove an object from the scene - virtual bool removeObject(vrpn_int32 objNum) = 0; - virtual bool clearTrimesh(vrpn_int32 objNum) = 0; - - /** Functions to organize the scene - * **********************************************************/ - // Change The parent of an object - virtual bool moveToParent(vrpn_int32 objNum, vrpn_int32 ParentNum) = 0; - // Set the Origin of the haptic scene - virtual bool setHapticOrigin(vrpn_float32 Pos[3], vrpn_float32 axis[3], - vrpn_float32 angle) = 0; - // Set the Scale factor of the haptic scene - virtual bool setHapticScale(vrpn_float32 Scale) = 0; - // Set the Origin of the haptic scene - virtual bool setSceneOrigin(vrpn_float32 Pos[3], vrpn_float32 axis[3], - vrpn_float32 angle) = 0; - // make an object touchable or not - virtual bool setObjectIsTouchable(vrpn_int32 objNum, - vrpn_bool IsTouchable = true) = 0; - -protected: - vrpn_DISPLAYABLEHASH m_hObjectList; -}; - -#endif // !defined(AFX_VRPN_FORCEDEVICESERVER_H__E5B0D6FA_E426_45E5_97C7_B2169BEBF90A__INCLUDED_) diff --git a/src/vrpn/vrpn_Forwarder.C b/src/vrpn/vrpn_Forwarder.C deleted file mode 100644 index 4ada38e0ad098de5892a66f8d4de4ae0b15a58ab..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Forwarder.C +++ /dev/null @@ -1,314 +0,0 @@ -#include <stddef.h> // for NULL - -#include "vrpn_Forwarder.h" - -vrpn_ConnectionForwarder::vrpn_ConnectionForwarder(vrpn_Connection *source, - vrpn_Connection *destination) - : d_source(source) - , d_destination(destination) - , d_list(NULL) -{ - - if (d_source) { - d_source->addReference(); - } - if (d_destination) { - d_destination->addReference(); - } -} - -vrpn_ConnectionForwarder::~vrpn_ConnectionForwarder(void) -{ - - vrpn_CONNECTIONFORWARDERRECORD *dlp; - - while (d_list) { - dlp = d_list->next; - - if (d_source) - d_source->unregister_handler(d_list->sourceId, handle_message, this, - d_list->sourceServiceId); - - delete d_list; - d_list = dlp; - } - - if (d_source) { - d_source->removeReference(); - } - if (d_destination) { - d_destination->removeReference(); - } -} - -int vrpn_ConnectionForwarder::forward(const char *sourceName, - const char *sourceServiceId, - const char *destinationName, - const char *destinationServiceId, - vrpn_uint32 classOfService) -{ - - vrpn_CONNECTIONFORWARDERRECORD *newList = - new vrpn_CONNECTIONFORWARDERRECORD( - d_source, d_destination, sourceName, sourceServiceId, - destinationName, destinationServiceId, classOfService); - - if (!newList) return -1; - - newList->next = d_list; - d_list = newList; - - if (d_source) - d_source->register_handler(newList->sourceId, handle_message, this, - newList->sourceServiceId); - - return 0; -} - -int vrpn_ConnectionForwarder::unforward(const char *sourceName, - const char *sourceServiceId, - const char *destinationName, - const char *destinationServiceId, - vrpn_uint32 classOfService) -{ - - vrpn_CONNECTIONFORWARDERRECORD **snitch; - vrpn_CONNECTIONFORWARDERRECORD *victim; - - vrpn_int32 st, ss, dt, ds; - - st = d_source->register_message_type(sourceName); - ss = d_source->register_sender(sourceServiceId); - dt = d_destination->register_message_type(destinationName); - ds = d_source->register_sender(destinationServiceId); - - for (snitch = &d_list, victim = *snitch; victim; - snitch = &(victim->next), victim = *snitch) { - - if ((victim->sourceId == st) && (victim->sourceServiceId == ss) && - (victim->destinationId == dt) && - (victim->destinationServiceId == ds) && - (victim->classOfService == classOfService)) { - (*snitch)->next = victim->next; - delete victim; - victim = *snitch; - } - } - - return 0; -} - -// static -int vrpn_ConnectionForwarder::handle_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - - vrpn_ConnectionForwarder *me = (vrpn_ConnectionForwarder *)userdata; - - vrpn_int32 id = p.type; - vrpn_int32 serviceId = p.sender; - vrpn_uint32 serviceClass; - - int retval; - - // Convert from source's representation for type & sender ID to - // that of destination; look up service class to use (defaulted to - // vrpn_CONNECTION_RELIABLE). - - retval = me->map(&id, &serviceId, &serviceClass); - if (retval) return -1; - - if (me->d_destination) { - me->d_destination->pack_message(p.payload_len, p.msg_time, id, - serviceId, p.buffer, serviceClass); - - // HACK: should we have this here? - me->d_destination->mainloop(); - } - - return 0; -} - -vrpn_int32 vrpn_ConnectionForwarder::map(vrpn_int32 *id, vrpn_int32 *serviceId, - vrpn_uint32 *classOfService) -{ - - vrpn_CONNECTIONFORWARDERRECORD *dlp; - - for (dlp = d_list; dlp; dlp = dlp->next) - if ((*id == dlp->sourceId) && (*serviceId == dlp->sourceServiceId)) { - *id = dlp->destinationId; - *serviceId = dlp->destinationServiceId; - *classOfService = dlp->classOfService; - return 0; - } - - return -1; -} - -// Build a mapping from the source Connection's types to the destination -// Connection's. Store the class of service to be used on forwarding. - -vrpn_ConnectionForwarder::vrpn_CONNECTIONFORWARDERRECORD:: - vrpn_CONNECTIONFORWARDERRECORD(vrpn_Connection *source, - vrpn_Connection *dest, const char *iSourceId, - const char *iSourceServiceId, - const char *iDestId, - const char *iDestServiceId, vrpn_uint32 cos) - : sourceId(source->register_message_type(iSourceId)) - , sourceServiceId(source->register_sender(iSourceServiceId)) - , destinationId(dest->register_message_type(iDestId)) - , destinationServiceId(dest->register_sender(iDestServiceId)) - , classOfService(cos) - , next(NULL) -{ -} - -vrpn_StreamForwarder::vrpn_StreamForwarder(vrpn_Connection *source, - const char *sourceServiceName, - vrpn_Connection *destination, - const char *destinationServiceName) - : d_source(source) - , d_sourceService(source->register_sender(sourceServiceName)) - , d_destination(destination) - , d_destinationService(destination->register_sender(destinationServiceName)) - , d_list(NULL) -{ - - if (d_source) { - d_source->addReference(); - } - if (d_destination) { - d_destination->addReference(); - } -} - -vrpn_StreamForwarder::~vrpn_StreamForwarder(void) -{ - - vrpn_STREAMFORWARDERRECORD *dlp; - - while (d_list) { - dlp = d_list->next; - - if (d_source) - d_source->unregister_handler(d_list->sourceId, handle_message, this, - d_sourceService); - - delete d_list; - d_list = dlp; - } - - if (d_source) { - d_source->removeReference(); - } - if (d_destination) { - d_destination->removeReference(); - } -} - -int vrpn_StreamForwarder::forward(const char *sourceName, - const char *destinationName, - vrpn_uint32 classOfService) -{ - - vrpn_STREAMFORWARDERRECORD *newList = new vrpn_STREAMFORWARDERRECORD( - d_source, d_destination, sourceName, destinationName, classOfService); - - if (!newList) return -1; - - newList->next = d_list; - d_list = newList; - - if (d_source) - d_source->register_handler(newList->sourceId, handle_message, this, - d_sourceService); - - return 0; -} - -int vrpn_StreamForwarder::unforward(const char *sourceName, - const char *destinationName, - vrpn_uint32 classOfService) -{ - - vrpn_STREAMFORWARDERRECORD **snitch; - vrpn_STREAMFORWARDERRECORD *victim; - - vrpn_int32 st, dt; - - st = d_source->register_message_type(sourceName); - dt = d_destination->register_message_type(destinationName); - - for (snitch = &d_list, victim = *snitch; victim; - snitch = &(victim->next), victim = *snitch) { - - if ((victim->sourceId == st) && (victim->destinationId == dt) && - (victim->classOfService == classOfService)) { - (*snitch)->next = victim->next; - delete victim; - victim = *snitch; - } - } - - return 0; -} - -// static -int vrpn_StreamForwarder::handle_message(void *userdata, vrpn_HANDLERPARAM p) -{ - - vrpn_StreamForwarder *me = (vrpn_StreamForwarder *)userdata; - - vrpn_int32 id = p.type; - vrpn_uint32 serviceClass; - - int retval; - - // Convert from source's representation for type & sender ID to - // that of destination; look up service class to use (defaulted to - // vrpn_CONNECTION_RELIABLE). - - retval = me->map(&id, &serviceClass); - if (retval) return -1; - - if (me->d_destination) { - me->d_destination->pack_message(p.payload_len, p.msg_time, id, - me->d_destinationService, p.buffer, - serviceClass); - - // HACK: should we have this here? - me->d_destination->mainloop(); - } - - return 0; -} - -vrpn_int32 vrpn_StreamForwarder::map(vrpn_int32 *id, - vrpn_uint32 *classOfService) -{ - - vrpn_STREAMFORWARDERRECORD *dlp; - - for (dlp = d_list; dlp; dlp = dlp->next) - if (*id == dlp->sourceId) { - *id = dlp->destinationId; - *classOfService = dlp->classOfService; - return 0; - } - - return -1; -} - -// Build a mapping from the source Connection's types to the destination -// Connection's. Store the class of service to be used on forwarding. - -vrpn_StreamForwarder::vrpn_STREAMFORWARDERRECORD::vrpn_STREAMFORWARDERRECORD( - vrpn_Connection *source, vrpn_Connection *dest, const char *iSourceId, - const char *iDestId, vrpn_uint32 cos) - : sourceId(source->register_message_type(iSourceId)) - , destinationId(dest->register_message_type(iDestId)) - , classOfService(cos) - , next(NULL) -{ -} diff --git a/src/vrpn/vrpn_Forwarder.h b/src/vrpn/vrpn_Forwarder.h deleted file mode 100644 index df9f08f8bcbb7208d1ab8c23d7fb3a4622469bd0..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Forwarder.h +++ /dev/null @@ -1,132 +0,0 @@ -#ifndef VRPN_FORWARDER_H -#define VRPN_FORWARDER_H - -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Connection.h" // for vrpn_Connection (ptr only), etc -#include "vrpn_Types.h" // for vrpn_int32, vrpn_uint32 - -// vrpn_Forwarder -// Tom Hudson, August 1998 -// -// Class to take messages from one VRPN connection and send them out -// on another. - -// Design decisions: -// Scale of forwarding: -// Could write a forwarder per stream (serviceName per instantiation) -// or per connection (serviceName per forward() call). Latter is -// more flexible, but takes up more memory if few distinct streams need -// to be forwarded, has a clunkier syntax, ... -// Flexibility of naming: -// We allow users to take in a message of one name and send it out -// with another name; this is useful and dangerous. - -// Faults: -// There is currently no way to specify vrpn_SENDER_ANY as a source. -// If we do, it isn't clear what sender to specify to the destination. - -class VRPN_API vrpn_ConnectionForwarder { - -public: - // Set up to forward messages from <source> to <destination> - vrpn_ConnectionForwarder(vrpn_Connection *source, - vrpn_Connection *destination); - - ~vrpn_ConnectionForwarder(void); - - // Begins forwarding of a message type. - // Forwards messages of type <sourceName> and sender <sourceServiceName>, - // sending them out as type <destinationName> from sender - // <destinationServiceName>. - // Return nonzero on failure. - int forward(const char *sourceName, const char *sourceServiceName, - const char *destinationName, const char *destinationServiceName, - vrpn_uint32 classOfService = vrpn_CONNECTION_RELIABLE); - - // Stops forwarding of a message type. - // Return nonzero on failure. - int unforward(const char *sourceName, const char *sourceServiceName, - const char *destinationName, - const char *destinationServiceName, - vrpn_uint32 classOfService = vrpn_CONNECTION_RELIABLE); - -private: - static int VRPN_CALLBACK handle_message(void *, vrpn_HANDLERPARAM); - - // Translates (id, serviceId) from source to destination - // and looks up intended class of service. - // Returns nonzero if lookup fails. - vrpn_int32 map(vrpn_int32 *id, vrpn_int32 *serviceId, - vrpn_uint32 *serviceClass); - - vrpn_Connection *d_source; - vrpn_Connection *d_destination; - - struct vrpn_CONNECTIONFORWARDERRECORD { - - vrpn_CONNECTIONFORWARDERRECORD(vrpn_Connection *, vrpn_Connection *, - const char *, const char *, const char *, - const char *, vrpn_uint32); - - vrpn_int32 sourceId; // source's type id - vrpn_int32 sourceServiceId; // source's sender id - vrpn_int32 destinationId; // destination's type id - vrpn_int32 destinationServiceId; // destination's sender id - vrpn_uint32 classOfService; // class of service to send - - vrpn_CONNECTIONFORWARDERRECORD *next; - }; - - vrpn_CONNECTIONFORWARDERRECORD *d_list; -}; - -class VRPN_API vrpn_StreamForwarder { - -public: - // Set up to forward messages from sender <sourceServiceName> on <source> - // to <destination>, as if from sender <destinationServiceName> - vrpn_StreamForwarder(vrpn_Connection *source, const char *sourceServiceName, - vrpn_Connection *destination, - const char *destinationServiceName); - - ~vrpn_StreamForwarder(void); - - // Begins forwarding of a message type. - // Return nonzero on failure. - int forward(const char *sourceName, const char *destinationName, - vrpn_uint32 classOfService = vrpn_CONNECTION_RELIABLE); - - // Stops forwarding of a message type. - // Return nonzero on failure. - int unforward(const char *sourceName, const char *destinationName, - vrpn_uint32 classOfService = vrpn_CONNECTION_RELIABLE); - -private: - static int VRPN_CALLBACK handle_message(void *, vrpn_HANDLERPARAM); - - // Translates (id, serviceId) from source to destination - // and looks up intended class of service. - // Returns nonzero if lookup fails. - vrpn_int32 map(vrpn_int32 *id, vrpn_uint32 *serviceClass); - - vrpn_Connection *d_source; - vrpn_int32 d_sourceService; - vrpn_Connection *d_destination; - vrpn_int32 d_destinationService; - - struct vrpn_STREAMFORWARDERRECORD { - - vrpn_STREAMFORWARDERRECORD(vrpn_Connection *, vrpn_Connection *, - const char *, const char *, vrpn_uint32); - - vrpn_int32 sourceId; // source's type id - vrpn_int32 destinationId; // destination's type id - vrpn_uint32 classOfService; // class of service to send - - vrpn_STREAMFORWARDERRECORD *next; - }; - - vrpn_STREAMFORWARDERRECORD *d_list; -}; - -#endif // VRPN_FORWARDER_H diff --git a/src/vrpn/vrpn_ForwarderController.C b/src/vrpn/vrpn_ForwarderController.C deleted file mode 100644 index 467cedc13ac1c88471cff6048225b412937aa2ba..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_ForwarderController.C +++ /dev/null @@ -1,318 +0,0 @@ -#include <stdio.h> // for fprintf, stderr -#include <string.h> // for memcpy, strlen, NULL, etc - -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_ForwarderController.h" -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday -#if !(defined(_WIN32) && defined(VRPN_USE_WINSOCK_SOCKETS)) -#include <netinet/in.h> // for htonl, ntohl -#endif - -#include "vrpn_Forwarder.h" // for vrpn_ConnectionForwarder - -vrpn_Forwarder_Brain::vrpn_Forwarder_Brain(vrpn_Connection *c) - : d_connection(c) - , d_myId(-1) -{ - - if (!c) return; - - d_connection->addReference(); - - d_myId = c->register_sender("vrpn_Forwarder_Brain"); - - d_start_forwarding_type = - c->register_message_type("vrpn_Forwarder_Brain start_forwarding"); - d_forward_type = c->register_message_type("vrpn_Forwarder_Brain forward"); -} - -vrpn_Forwarder_Brain::~vrpn_Forwarder_Brain(void) -{ - - if (d_connection) { - d_connection->removeReference(); - } -} - -// static -char * -vrpn_Forwarder_Brain::encode_start_remote_forwarding(vrpn_int32 *length, - vrpn_int32 remote_port) -{ - char *outbuf; - - vrpn_int32 nPort; - - *length = sizeof(vrpn_int32); - outbuf = new char[*length]; - if (!outbuf) { - *length = 0; - return NULL; - } - - nPort = htonl(remote_port); - memcpy(outbuf, &nPort, sizeof(vrpn_int32)); - - return outbuf; -} - -// static -void vrpn_Forwarder_Brain::decode_start_remote_forwarding( - const char *buffer, vrpn_int32 *remote_port) -{ - vrpn_int32 port; - - if (!buffer || !remote_port) return; - - memcpy(&port, buffer, sizeof(vrpn_int32)); - *remote_port = ntohl(port); -} - -// static -char *vrpn_Forwarder_Brain::encode_forward_message_type( - vrpn_int32 *length, vrpn_int32 remote_port, const char *service_name, - const char *message_type) -{ - char *outbuf; - - vrpn_int32 nPort; - vrpn_int32 nSLen; - vrpn_int32 nTLen; - - *length = static_cast<int>(3 * sizeof(vrpn_int32) + strlen(service_name) + - strlen(message_type)); - outbuf = new char[*length]; - if (!outbuf) { - *length = 0; - return NULL; - } - - // fprintf(stderr, "Encoding forward %s of %s on port %d.\n", - // message_type, service_name, remote_port); - - // Put all the char [] at the end of the message so we don't have to - // worry about padding and alignment. - - nPort = htonl(remote_port); - nSLen = htonl(static_cast<vrpn_int32>(strlen(service_name))); - nTLen = htonl(static_cast<vrpn_int32>(strlen(message_type))); - memcpy(outbuf, &nPort, sizeof(vrpn_int32)); - memcpy(outbuf + sizeof(vrpn_int32), &nSLen, sizeof(vrpn_int32)); - memcpy(outbuf + 2 * sizeof(vrpn_int32), &nTLen, sizeof(vrpn_int32)); - strcpy(outbuf + 3 * sizeof(vrpn_int32), service_name); - strcpy(outbuf + 3 * sizeof(vrpn_int32) + strlen(service_name), - message_type); - - return outbuf; -} - -// static -void vrpn_Forwarder_Brain::decode_forward_message_type(const char *buffer, - vrpn_int32 *remote_port, - char **service_name, - char **message_type) -{ - vrpn_int32 port; - vrpn_int32 Slength; - vrpn_int32 Tlength; - char *Soutbuf; - char *Toutbuf; - - if (!buffer || !remote_port || !message_type) return; - - // All the char [] are at the end of the message so we don't have to - // worry about padding and alignment. - - memcpy(&port, buffer, sizeof(vrpn_int32)); - *remote_port = ntohl(port); - memcpy(&Slength, buffer + sizeof(vrpn_int32), sizeof(vrpn_int32)); - Slength = ntohl(Slength); - Soutbuf = new char[1 + Slength]; - memcpy(&Tlength, buffer + 2 * sizeof(vrpn_int32), sizeof(vrpn_int32)); - Tlength = ntohl(Tlength); - Toutbuf = new char[1 + Tlength]; - if (!Soutbuf || !Toutbuf) { - *remote_port = -1; - *service_name = NULL; - *message_type = NULL; - return; - } - strncpy(Soutbuf, buffer + 3 * sizeof(vrpn_int32), Slength); - Soutbuf[Slength] = '\0'; - *service_name = Soutbuf; - strncpy(Toutbuf, buffer + 3 * sizeof(vrpn_int32) + Slength, Tlength); - Toutbuf[Tlength] = '\0'; - *message_type = Toutbuf; -} - -vrpn_Forwarder_Server::vrpn_Forwarder_Server(vrpn_Connection *c) - : vrpn_Forwarder_Brain(c) - , d_myForwarders(NULL) -{ - - if (!c) return; - - c->register_handler(d_start_forwarding_type, handle_start, this, d_myId); - c->register_handler(d_forward_type, handle_forward, this, d_myId); -} - -vrpn_Forwarder_Server::~vrpn_Forwarder_Server(void) -{ - - if (!d_connection) return; - - d_connection->unregister_handler(d_start_forwarding_type, handle_start, - this, d_myId); - d_connection->unregister_handler(d_forward_type, handle_forward, this, - d_myId); - - // Destroy my list of forwarders - vrpn_Forwarder_List *fp; - for (fp = d_myForwarders; fp; fp = fp->next) { - if (fp->connection) delete fp->connection; - if (fp->forwarder) delete fp->forwarder; - } -} - -void vrpn_Forwarder_Server::mainloop(void) -{ - - vrpn_Forwarder_List *fp; - - for (fp = d_myForwarders; fp; fp = fp->next) - if (fp->connection) fp->connection->mainloop(); -} - -void vrpn_Forwarder_Server::start_remote_forwarding(vrpn_int32 remote_port) -{ - - vrpn_Forwarder_List *fp; - - // Make sure it isn't already there - - for (fp = d_myForwarders; fp; fp = fp->next) - if (fp->port == remote_port) { - fprintf(stderr, "vrpn_Forwarder_Server::start_remote_forwarding: " - "Already open on port %d.\n", - remote_port); - return; - } - - // Create it and add it to the list - - fp = new vrpn_Forwarder_List; - - fp->port = remote_port; - fp->connection = vrpn_create_server_connection(remote_port); - fp->forwarder = new vrpn_ConnectionForwarder(d_connection, fp->connection); - - fp->next = d_myForwarders; - d_myForwarders = fp; - - // fprintf(stderr, "vrpn_Forwarder_Server::start_remote_forwarding: " - //"On port %d.\n", remote_port); -} - -void vrpn_Forwarder_Server::forward_message_type(vrpn_int32 remote_port, - const char *service_name, - const char *message_type) -{ - - vrpn_Forwarder_List *fp; - vrpn_Forwarder_List *it = NULL; - int retval; - - // Find the forwarder requested - - for (fp = d_myForwarders; fp; fp = fp->next) - if (fp->port == remote_port) it = fp; - - if (!it) { - fprintf(stderr, - "vrpn_Forwarder_Server: No forwarder open on port %d.\n", - remote_port); - return; - } - - // Forward that message type from that service - - retval = it->forwarder->forward(message_type, service_name, message_type, - service_name); - if (retval) { - fprintf(stderr, "vrpn_Forwarder_Server: Couldn't forward messages of " - "type \"%s\" on port %d.\n", - message_type, remote_port); - return; - } -} - -// static -int vrpn_Forwarder_Server::handle_start(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Forwarder_Server *me = (vrpn_Forwarder_Server *)userdata; - vrpn_int32 port; - - decode_start_remote_forwarding(p.buffer, &port); - me->start_remote_forwarding(port); - return 0; -} - -// static -int vrpn_Forwarder_Server::handle_forward(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Forwarder_Server *me = (vrpn_Forwarder_Server *)userdata; - vrpn_int32 port; - char *typebuffer; - char *servicebuffer; - - decode_forward_message_type(p.buffer, &port, &servicebuffer, &typebuffer); - if (!servicebuffer || !typebuffer) return -1; // memory allocation failure - me->forward_message_type(port, servicebuffer, typebuffer); - - delete[] servicebuffer; - delete[] typebuffer; - return 0; -} - -vrpn_Forwarder_Controller::vrpn_Forwarder_Controller(vrpn_Connection *c) - : vrpn_Forwarder_Brain(c) -{ -} - -vrpn_Forwarder_Controller::~vrpn_Forwarder_Controller(void) {} - -void vrpn_Forwarder_Controller::start_remote_forwarding(vrpn_int32 remote_port) -{ - - struct timeval now; - char *buffer; - vrpn_int32 length; - - vrpn_gettimeofday(&now, NULL); - buffer = encode_start_remote_forwarding(&length, remote_port); - - if (!buffer) return; // memory allocation failure - - d_connection->pack_message(length, now, d_start_forwarding_type, d_myId, - buffer, vrpn_CONNECTION_RELIABLE); - delete[] buffer; -} - -void vrpn_Forwarder_Controller::forward_message_type(vrpn_int32 remote_port, - const char *service_name, - const char *message_type) -{ - struct timeval now; - char *buffer; - vrpn_int32 length; - - vrpn_gettimeofday(&now, NULL); - buffer = encode_forward_message_type(&length, remote_port, service_name, - message_type); - - if (!buffer) return; // memory allocation failure - - d_connection->pack_message(length, now, d_forward_type, d_myId, buffer, - vrpn_CONNECTION_RELIABLE); - delete[] buffer; -} diff --git a/src/vrpn/vrpn_ForwarderController.h b/src/vrpn/vrpn_ForwarderController.h deleted file mode 100644 index 807b49618f848f254f95318ec487529576680cef..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_ForwarderController.h +++ /dev/null @@ -1,131 +0,0 @@ -#ifndef VRPN_FORWARDER_CONTROLLER_H -#define VRPN_FORWARDER_CONTROLLER_H - -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Types.h" // for vrpn_int32 -// vrpn_Forwarder_Controller -// -// Tom Hudson, September 1998 - -// Written to allow remote a client to tell a server to open another port -// and forward some messages on it to a friend of the client's. - -// Any server that wishes to implement this needs only construct a -// vrpn_Forwarder_Server for each server connection it has open and -// to call the vrpn_Forwarder_Server mainloop frequently. - -// Clients can construct a vrpn_Forwarder_Controller on a connection -// and call start_remote_forwarding(port) to tell the server to open -// <port>, then call forward_message_type(port, name) to start forwarding -// messages of the given name. - -// This isn't an ideal solution, because it means clients need access to -// the names of the message, which they are normally insulated from. - -// Some of the fancier options of the Forwarder (renaming services or -// types, changing class of service) are hidden from the user; this -// is meant to be a simple interface and simple first implementation. - -// New Forwarder_Servers are NOT constructed on connections that a -// Forwarder_Server opens, so clients that are only listening to a -// forwarded stream cannot open new forwarders for still other clients to -// listen to. - -class VRPN_API vrpn_ConnectionForwarder; -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -class VRPN_API vrpn_Forwarder_Brain { - -public: - vrpn_Forwarder_Brain(vrpn_Connection *); - virtual ~vrpn_Forwarder_Brain(void); - - // Tell a Forwarder_Server to open a vrpn_Connection on remote_port. - - virtual void start_remote_forwarding(vrpn_int32 remote_port) = 0; - - // Tell a Forwarder_Server to begin forwarding messages of type - // message_type from the sender named service_name over remote_port. - - virtual void forward_message_type(vrpn_int32 remote_port, - const char *service_name, - const char *message_type) = 0; - -protected: - vrpn_Connection *d_connection; - - vrpn_int32 d_myId; - - vrpn_int32 d_start_forwarding_type; - vrpn_int32 d_forward_type; - - static char *encode_start_remote_forwarding(vrpn_int32 *length, - vrpn_int32 remote_port); - static char *encode_forward_message_type(vrpn_int32 *length, - vrpn_int32 remote_port, - const char *service_name, - const char *message_type); - - static void decode_start_remote_forwarding(const char *buffer, - vrpn_int32 *remote_port); - static void decode_forward_message_type(const char *buffer, - vrpn_int32 *remote_port, - char **service_name, - char **message_type); -}; - -// Server class - -// VRPN server builders who want to enable remotely-controlled forwarding in -// their server need only create a Forwarder_Server on their server Connections -// and call its mainloop() regularly. - -struct vrpn_Forwarder_List { - vrpn_Forwarder_List *next; - vrpn_int32 port; - vrpn_Connection *connection; - vrpn_ConnectionForwarder *forwarder; -}; - -class VRPN_API vrpn_Forwarder_Server : public vrpn_Forwarder_Brain { - -public: - vrpn_Forwarder_Server(vrpn_Connection *); - virtual ~vrpn_Forwarder_Server(void); - - virtual void mainloop(void); - - virtual void start_remote_forwarding(vrpn_int32 remote_port); - - virtual void forward_message_type(vrpn_int32 remote_port, - const char *service_name, - const char *message_type); - -protected: - vrpn_Forwarder_List *d_myForwarders; - -private: - static int VRPN_CALLBACK handle_start(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_forward(void *, vrpn_HANDLERPARAM); -}; - -// Client class - -// Construct a Forwarder_Controller on a connection to control a -// Forwarder_Server on its far end. - -class VRPN_API vrpn_Forwarder_Controller : public vrpn_Forwarder_Brain { - -public: - vrpn_Forwarder_Controller(vrpn_Connection *); - ~vrpn_Forwarder_Controller(void); - - virtual void start_remote_forwarding(vrpn_int32 remote_port); - - virtual void forward_message_type(vrpn_int32 remote_port, - const char *service_name, - const char *message_type); -}; - -#endif // VRPN_FORWARDER_CONTROLLER_H diff --git a/src/vrpn/vrpn_Freespace.C b/src/vrpn/vrpn_Freespace.C deleted file mode 100644 index 5eedd4075518aee6c0d6f8b8342ed13c558a661e..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Freespace.C +++ /dev/null @@ -1,301 +0,0 @@ -#include "vrpn_Freespace.h" -#ifdef VRPN_USE_FREESPACE -#include "quat.h" -#include <freespace/freespace_codecs.h> -#include <cstring> -static const q_type gs_qIdent = Q_ID_QUAT; - -// We've not yet initialized the FreeSpace library. -bool vrpn_Freespace::_freespace_initialized = false; - -// libfreespace provides linear acceleration values in (mm/(s^2))^-3 -// VRPN wants these in meters/(s^2) -static vrpn_float64 convertFreespaceLinearAccelation(int16_t mmpss) { - return mmpss / ((vrpn_float64) 1000); -} -// freespace reports in milliradians per second, so need to convert -// to meters per second... -// The radius to use is a bit arbitrary, and would depend on -// what exactly this device is 'attached' to. Additionally, this may -// be different for each axis. In general, the radius shouldn't really -// matter since the device may be representing a larger/smaller object in -// the virtual world. -static vrpn_float64 convertFreespaceAngularVelocity(int16_t mrps, double radius) { - return mrps * radius / ((vrpn_float64) 1000); -} -#define MILLIS_TO_SECONDS(x) (x / ((vrpn_float64) 1000000)) - - -vrpn_Freespace::vrpn_Freespace(FreespaceDeviceId freespaceId, - struct FreespaceDeviceInfo* deviceInfo, - const char *name, vrpn_Connection *conn): - vrpn_Tracker_Server(name, conn), - vrpn_Button_Filter(name, conn), - vrpn_Dial(name, conn) -{ - memcpy(&_deviceInfo, deviceInfo, sizeof(_deviceInfo)); - // 5 buttons + a scroll wheel - vrpn_Button::num_buttons = 5; - vrpn_Dial::num_dials = 1; - memset(&_lastBodyFrameTime, 0, sizeof(_lastBodyFrameTime)); - _timestamp.tv_sec = 0; -} - -void vrpn_Freespace::freespaceInit() { - if (!_freespace_initialized) { - _freespace_initialized = true; - int rc = freespace_init(); - if (rc != FREESPACE_SUCCESS) { - fprintf(stderr, "vrpn_Freespace::freespaceInit: failed to init freespace lib. rc=%d\n", rc); - _freespace_initialized = false; - } - } -} - -void vrpn_Freespace::deviceSetConfiguration(bool send_body_frames, bool send_user_frames) { - _sendBodyFrames = send_body_frames; - _sendUserFrames = send_user_frames; -} - -void vrpn_Freespace::deviceConfigure() { - int rc = 0; - - // Send the data mode request - struct freespace_message message; - memset(&message, 0, sizeof(message)); - if (_deviceInfo.hVer == 1) { - message.messageType = FREESPACE_MESSAGE_DATAMOTIONCONTROL; - struct freespace_DataMotionControl * req; - req = &message.dataMotionControl; - if (_sendBodyFrames) { req->enableBodyMotion = 1; } - if (_sendUserFrames) { req->enableUserPosition = 1; } - req->inhibitPowerManager = 1; - req->enableMouseMovement = 0; - req->disableFreespace = 0; - } else { - message.messageType = FREESPACE_MESSAGE_DATAMODEREQUEST; - struct freespace_DataModeRequest * req; - req = &message.dataModeRequest; - if (_sendBodyFrames) { req->enableBodyMotion = 1; } - if (_sendUserFrames) { req->enableUserPosition = 1; } - req->inhibitPowerManager = 1; - req->enableMouseMovement = 0; - req->disableFreespace = 0; - } - - rc = freespace_sendMessage(_freespaceDevice, &message); - if (rc != FREESPACE_SUCCESS) { - fprintf(stderr, "vrpn_Freespace::deviceConfigure: Could not send message: %d.\n", rc); - } -} - -void vrpn_Freespace::deviceUnconfigure() { - int rc = 0; - - // Send the data mode request - struct freespace_message message; - memset(&message, 0, sizeof(message)); - if (_deviceInfo.hVer == 1) { - message.messageType = FREESPACE_MESSAGE_DATAMOTIONCONTROL; - struct freespace_DataMotionControl * req; - req = &message.dataMotionControl; - req->enableBodyMotion = 0; - req->enableUserPosition = 0; - req->inhibitPowerManager = 0; - req->enableMouseMovement = 1; - req->disableFreespace = 0; - } else { - message.messageType = FREESPACE_MESSAGE_DATAMODEREQUEST; - struct freespace_DataModeRequest * req; - req = &message.dataModeRequest; - req->enableBodyMotion = 0; - req->enableUserPosition = 0; - req->inhibitPowerManager = 0; - req->enableMouseMovement = 1; - req->disableFreespace = 0; - } - - rc = freespace_sendMessage(_freespaceDevice, &message); - if (rc != FREESPACE_SUCCESS) { - fprintf(stderr, "vrpn_Freespace::deviceUnconfigure: Could not send message: %d.\n", rc); - } -} - -vrpn_Freespace* vrpn_Freespace::create(const char *name, vrpn_Connection *conn, - int device_index, - bool send_body_frames, bool send_user_frames) -{ - // initialize libfreespace - vrpn_Freespace::freespaceInit(); - - const unsigned MAX_DEVICES = 100; - FreespaceDeviceId devices[MAX_DEVICES]; - int numIds = 0; - int rc; - rc = freespace_getDeviceList(devices, MAX_DEVICES, &numIds); - if ( (rc != FREESPACE_SUCCESS) || (numIds < (device_index+1)) ) { - fprintf(stderr, "vrpn_Freespace::create: Didn't find enough devices: %d.\n", numIds); - return NULL; - } - FreespaceDeviceId freespaceId = devices[device_index]; - - rc = freespace_openDevice(freespaceId); - if (rc != FREESPACE_SUCCESS) { - fprintf(stderr, "vrpn_Freespace::create: Could not open device %d.\n", device_index); - return NULL; - } - struct FreespaceDeviceInfo deviceInfo; - rc = freespace_getDeviceInfo(freespaceId, &deviceInfo); - if (rc != FREESPACE_SUCCESS) { - return NULL; - } - rc = freespace_flush(freespaceId); - if (rc != FREESPACE_SUCCESS) { - fprintf(stderr, "vrpn_Freespace::create: Error flushing device: %d\n", rc); - return NULL; - } - - vrpn_Freespace* dev = new vrpn_Freespace(freespaceId, &deviceInfo, name, conn); - dev->deviceSetConfiguration(send_body_frames, send_user_frames); - printf("Added freespace device: %s : \n", name); - return dev; -} - -void vrpn_Freespace::mainloop(void) -{ - server_mainloop(); - struct freespace_message s; - - /* - * Send configuration information to the device repeatedly to force the - * device into the correct mode. This method ensures the correct mode - * even if the Freespace device was asleep during initialization or if - * the tracker resets. - */ - struct timeval timestamp; - vrpn_gettimeofday(×tamp, NULL); - if (_timestamp.tv_sec != timestamp.tv_sec) { - _timestamp.tv_sec = timestamp.tv_sec; - deviceConfigure(); - } - - // Do not block, read as many messages as - while (FREESPACE_SUCCESS == freespace_readMessage(_freespaceDevice, &s, 0)) { - switch(s.messageType) { - case FREESPACE_MESSAGE_LINKSTATUS: - handleLinkStatus(s.linkStatus); - break; - case FREESPACE_MESSAGE_BODYFRAME: - handleBodyFrame(s.bodyFrame); - break; - case FREESPACE_MESSAGE_USERFRAME: - handleUserFrame(s.userFrame); - break; - case FREESPACE_MESSAGE_ALWAYSONRESPONSE: - break; - case FREESPACE_MESSAGE_DATAMODERESPONSE: - break; - default: - send_text_message("Received an unhandled message from freespace device", timestamp, vrpn_TEXT_WARNING); - break; - } - } -} -vrpn_Freespace::~vrpn_Freespace(void) -{ - // as part of cleanup, disable user and body frame messages, and - // put back to just mouse movement. - int rc = freespace_flush(_freespaceDevice); - if (rc != FREESPACE_SUCCESS) { - printf("freespaceInputThread: Error flushing device: %d\n", rc); - } - - deviceUnconfigure(); - freespace_closeDevice(_freespaceDevice); -} - -void vrpn_Freespace::handleBodyFrame(const struct freespace_BodyFrame& body) { - vrpn_gettimeofday(&(vrpn_Tracker::timestamp), NULL); - vrpn_float64 now = vrpn_Tracker::timestamp.tv_sec + MILLIS_TO_SECONDS(vrpn_Tracker::timestamp.tv_usec); - vrpn_float64 delta = now - _lastBodyFrameTime; - _lastBodyFrameTime = now; - - vrpn_Tracker::acc[0] = convertFreespaceLinearAccelation(body.linearAccelX); - vrpn_Tracker::acc[1] = convertFreespaceLinearAccelation(body.linearAccelY); - vrpn_Tracker::acc[2] = convertFreespaceLinearAccelation(body.linearAccelZ); - q_copy(vrpn_Tracker::acc_quat, gs_qIdent); - vrpn_Tracker::acc_quat_dt = delta; - vrpn_Tracker_Server::report_pose_acceleration(0, vrpn_Tracker::timestamp, - vrpn_Tracker::acc, vrpn_Tracker::acc_quat, delta); - - vrpn_Tracker::vel[0] = convertFreespaceAngularVelocity(body.angularVelX, 1); - vrpn_Tracker::vel[1] = convertFreespaceAngularVelocity(body.angularVelY, 1); - vrpn_Tracker::vel[2] = convertFreespaceAngularVelocity(body.angularVelZ, 1); - q_copy(vrpn_Tracker::vel_quat, gs_qIdent); - vrpn_Tracker::vel_quat_dt = delta; - vrpn_Tracker_Server::report_pose_velocity(0, vrpn_Tracker::timestamp, - vrpn_Tracker::vel, vrpn_Tracker::vel_quat, vrpn_Tracker::vel_quat_dt); - - vrpn_Button::buttons[0] = body.button1; - vrpn_Button::buttons[1] = body.button2; - vrpn_Button::buttons[2] = body.button3; - vrpn_Button::buttons[3] = body.button4; - vrpn_Button::buttons[4] = body.button5; - - vrpn_Button::timestamp = vrpn_Tracker::timestamp; - vrpn_Button::report_changes(); - - // this is totally arbitrary - // I'm not sure how exactly the 'deltaWheel' should be interpreted, but it seems - // like it would be the number of 'clicks' while turning the scroll wheel... - // vrpn was this as a 'fraction of a revolution' so I would assume that a return of 1 means - // the dial was spun 360 degrees. I'm going to pretend it takes 16 clicks to make a full - // revolution....' - // this values should probably set in a configuration file. - vrpn_Dial::dials[0] = body.deltaWheel / (vrpn_float64) 16; - vrpn_Dial::timestamp = vrpn_Tracker::timestamp; - vrpn_Dial::report_changes(); -} - -void vrpn_Freespace::handleUserFrame(const struct freespace_UserFrame& user) { - vrpn_gettimeofday(&(vrpn_Tracker::timestamp), NULL); - - // Translate the Freespace linear position into VRPN linear position. - vrpn_Tracker::pos[0] = user.linearPosY; - vrpn_Tracker::pos[1] = user.linearPosZ; - vrpn_Tracker::pos[2] = user.linearPosX; - - // Transfer the Freespace coordinate system angular position quanternion - // into the VRPN coordinate system. - vrpn_Tracker::d_quat[Q_W] = user.angularPosA; - vrpn_Tracker::d_quat[Q_X] = user.angularPosC; - vrpn_Tracker::d_quat[Q_Y] = -user.angularPosD; - vrpn_Tracker::d_quat[Q_Z] = user.angularPosB; - q_normalize(vrpn_Tracker::d_quat, vrpn_Tracker::d_quat); - - vrpn_Tracker_Server::report_pose(0, vrpn_Tracker::timestamp, vrpn_Tracker::pos, vrpn_Tracker::d_quat); - - vrpn_Button::buttons[0] = user.button1; - vrpn_Button::buttons[1] = user.button2; - vrpn_Button::buttons[2] = user.button3; - vrpn_Button::buttons[3] = user.button4; - vrpn_Button::buttons[4] = user.button5; - - vrpn_Button::timestamp = vrpn_Tracker::timestamp; - vrpn_Button::report_changes(); - - // this is totally arbitrary - // I'm not sure how exactly the 'deltaWheel' should be interpreted, but it seems - // like it would be the number of 'clicks' while turning the scroll wheel... - // vrpn was this as a 'fraction of a revolution' so I would assume that a return of 1 means - // the dial was spun 360 degrees. I'm going to pretend it takes 16 clicks to make a full - // revolution....' - // this values should probably set in a configuration file. - vrpn_Dial::dials[0] = user.deltaWheel / (vrpn_float64) 16; - vrpn_Dial::timestamp = vrpn_Tracker::timestamp; - vrpn_Dial::report_changes(); -} -void vrpn_Freespace::handleLinkStatus(const struct freespace_LinkStatus& l) { - // Could be used to send messages when the loop is powered off/unavailable. -} -#endif //VRPN_USE_FREESPACE diff --git a/src/vrpn/vrpn_Freespace.h b/src/vrpn/vrpn_Freespace.h deleted file mode 100644 index b6985df9d760d8b470d309f4052721bb86c6561a..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Freespace.h +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This provides an interface to devices powered by Hillcrest Lab's Freespace. - * Freespace is a sensor technology for tracking relative movement of a handheld device. - * A Freespace device exposes itself as a combination of 3 VRPN interfaces. - * as a tracker, with linear acceleration and angular velocity, - * as a Dial, with a single dial for an on-board scroll wheel (loop pointer) - * and as a Button for the various buttons on the device. - * - * The implementation here uses the synchronous API to read data from the device, - * but could fairly easily be modified to use the asynchronous API. This may be desired as - * a cleaner way to provide access to multiple Freespace devices and/or handle hot-plugging - * of devices (such as the loop, which uses a USB dongle for communications). - * - * More info on libfreespace can be found at https://launchpad.net/libfreespace - * or http://hillcrestlabs.com/products/tools/ - * - */ - -#ifndef VRPN_FREESPACE_H -#define VRPN_FREESPACE_H - -#include "vrpn_Configure.h" // IWYU pragma: keep - -#ifdef VRPN_USE_FREESPACE - -#include <freespace/freespace.h> - -#include "vrpn_Button.h" -#include "vrpn_Dial.h" -#include "vrpn_Tracker.h" - - -class VRPN_API vrpn_Freespace : - public vrpn_Tracker_Server, // for the positional data - public vrpn_Button_Filter, // for the actual buttons - public vrpn_Dial // for the scroll wheel -{ -public: - /** - * Create a freespace server using the given FreespaceDeviceId. This - * factory will automatically initialize the libfreespace library as needed. - * This method will open the device and configure it to receive relavant - * messages. See the test_freespace.C, or libfreespace-examples, for steps to - * initialize the library and enumerate devices. - */ - - // Freespace devices may report User frames (position and orientation in a quaternion), - // Body frames (angular velocity and linear acceleration), Mouse reports (delta X, delta Y) - // or some combination of them. You will probably want at least body or user frame - // messages. - // Another thing to note is that for some devices, enabling multiple reports diminishes - // the effective rate of data since the device can only send so many bits per second. - // This could fairly easily get added as a configuration setting. - - static vrpn_Freespace* create(const char *name, - vrpn_Connection *conn, - int device_index = 0, - bool send_body_frames = false, - bool send_user_frames = true); - virtual ~vrpn_Freespace(void); - /** - * Main loop. This will try to read data from the loop, and send - * appropriate messages - * to a VRPN client. - */ - virtual void mainloop(void); - -private: - static bool _freespace_initialized; - static void freespaceInit(); - /** - * private constructor since opening of the device can fail. - */ - vrpn_Freespace(FreespaceDeviceId freespaceId, - struct FreespaceDeviceInfo* deviceInfo, - const char *name, - vrpn_Connection *c); - - void handleUserFrame(const struct freespace_UserFrame&); - void handleBodyFrame(const struct freespace_BodyFrame&); - void handleLinkStatus(const struct freespace_LinkStatus&); - - void deviceSetConfiguration(bool send_body_frames, bool send_user_frames); - void deviceConfigure(); - void deviceUnconfigure(); - - bool _sendBodyFrames; - bool _sendUserFrames; - struct timeval _timestamp; - -protected: - FreespaceDeviceId _freespaceDevice; - FreespaceDeviceInfo _deviceInfo; - vrpn_float64 _lastBodyFrameTime; -}; -#endif //VRPN_USE_FREESPACE - -#endif // VRPN_FREESPACE_H diff --git a/src/vrpn/vrpn_FunctionGenerator.C b/src/vrpn/vrpn_FunctionGenerator.C deleted file mode 100644 index c782b96a036c34c8d35d9f870a01582958e59adc..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_FunctionGenerator.C +++ /dev/null @@ -1,2022 +0,0 @@ - -#include <stdio.h> // for fflush, fprintf, stderr -#include <string.h> // for NULL, strlen, strcpy - -#include "vrpn_FunctionGenerator.h" - -//#define DEBUG_VRPN_FUNCTION_GENERATOR - -const char* vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL = "vrpn_FunctionGenerator channel"; -const char* vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL_REQUEST = "vrpn_FunctionGenerator channel request"; -const char* vrpn_FUNCTION_MESSAGE_TYPE_ALL_CHANNEL_REQUEST = "vrpn_FunctionGenerator all channel request"; -const char* vrpn_FUNCTION_MESSAGE_TYPE_SAMPLE_RATE = "vrpn_FunctionGenerator sample rate"; -const char* vrpn_FUNCTION_MESSAGE_TYPE_START = "vrpn_FunctionGenerator start"; -const char* vrpn_FUNCTION_MESSAGE_TYPE_STOP = "vrpn_FunctionGenerator stop"; -const char* vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL_REPLY = "vrpn_FunctionGenerator channel reply"; -const char* vrpn_FUNCTION_MESSAGE_TYPE_START_REPLY = "vrpn_FunctionGenerator start reply"; -const char* vrpn_FUNCTION_MESSAGE_TYPE_STOP_REPLY = "vrpn_FunctionGenerator stop reply"; -const char* vrpn_FUNCTION_MESSAGE_TYPE_SAMPLE_RATE_REPLY = "vrpn_FunctionGenerator sample rate reply"; -const char* vrpn_FUNCTION_MESSAGE_TYPE_INTERPRETER_REQUEST = "vrpn_FunctionGenerator interpreter-description request"; -const char* vrpn_FUNCTION_MESSAGE_TYPE_INTERPRETER_REPLY = "vrpn_FunctionGenerator interpreter-description reply"; -const char* vrpn_FUNCTION_MESSAGE_TYPE_ERROR = "vrpn_FunctionGenerator error report"; - -vrpn_FunctionGenerator_function::~vrpn_FunctionGenerator_function() {} - -///////////////////////////////////////// -///////////////////////////////////////// -// -// class vrpn_FunctionGenerator_function_NULL - -vrpn_float32 vrpn_FunctionGenerator_function_NULL:: -generateValues( vrpn_float32* buf, vrpn_uint32 nValues, - vrpn_float32 startTime, vrpn_float32 sampleRate, - vrpn_FunctionGenerator_channel* ) const -{ - for( vrpn_uint32 i = 0; i <= nValues - 1; i++ ) - { - buf[i] = 0; - } - return startTime + nValues / sampleRate; -} - - -vrpn_int32 vrpn_FunctionGenerator_function_NULL:: -encode_to( char** , vrpn_int32& ) const -{ - return 0; -} - - -vrpn_int32 vrpn_FunctionGenerator_function_NULL:: -decode_from( const char** , vrpn_int32& ) -{ - return 0; -} - -vrpn_FunctionGenerator_function* vrpn_FunctionGenerator_function_NULL:: -clone( ) const -{ - return new vrpn_FunctionGenerator_function_NULL(); -} - - -// -// end vrpn_FunctionGenerator_function_NULL -//////////////////////////////////////// -//////////////////////////////////////// - - -//////////////////////////////////////// -//////////////////////////////////////// -// -// class vrpn_FunctionGenerator_function_script -vrpn_FunctionGenerator_function_script:: -vrpn_FunctionGenerator_function_script( ) -: script( NULL ) -{ - this->script = new char[1]; - script[0] = '\0'; -} - - -vrpn_FunctionGenerator_function_script:: -vrpn_FunctionGenerator_function_script( const char* script ) -{ - this->script = new char[ strlen( script ) + 1 ]; - strcpy( this->script, script ); -} - - -vrpn_FunctionGenerator_function_script:: -vrpn_FunctionGenerator_function_script( const vrpn_FunctionGenerator_function_script& s ) -{ - this->script = new char[ strlen( s.script ) + 1 ]; - strcpy( this->script, s.script ); -} - - -vrpn_FunctionGenerator_function_script:: -~vrpn_FunctionGenerator_function_script( ) -{ - if( script != NULL ) - { - delete [] script; - script = NULL; - } -} - -vrpn_float32 vrpn_FunctionGenerator_function_script:: -generateValues( vrpn_float32* buf, vrpn_uint32 nValues, vrpn_float32 startTime, - vrpn_float32 sampleRate, vrpn_FunctionGenerator_channel* /*channel*/ ) const -{ - for( vrpn_uint32 i = 0; i <= nValues - 1; i++ ) - { - buf[i] = 0; - } - return startTime + nValues / sampleRate; -}; - - -vrpn_int32 vrpn_FunctionGenerator_function_script:: -encode_to( char** buf, vrpn_int32& len ) const -{ - vrpn_uint32 length = static_cast<vrpn_uint32>(strlen( this->script )); - vrpn_int32 bytes = length + sizeof( vrpn_uint32 ); - if( len < bytes ) - { - fprintf( stderr, "vrpn_FunctionGenerator_function_script::encode_to: " - "payload error (wanted %d got %d).\n", bytes, len ); - fflush( stderr ); - return -1; - } - if( 0 > vrpn_buffer( buf, &len, length ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_function_script::encode_to: " - "payload error (couldn't buffer length).\n" ); - fflush( stderr ); - return -1; - } - if( 0 > vrpn_buffer( buf, &len, this->script, length ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_function_script::encode_to: " - "payload error (couldn't buffer script).\n" ); - fflush( stderr ); - return -1; - } - return bytes; -} - - -vrpn_int32 vrpn_FunctionGenerator_function_script:: -decode_from( const char** buf, vrpn_int32& len ) -{ - vrpn_int32 newlen; - if( 0 > vrpn_unbuffer( buf, &newlen ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_function_script::decode_from: " - "payload error (couldn't unbuffer length).\n" ); - fflush( stderr ); - return -1; - } - len -= sizeof( vrpn_uint32); - - if( len < newlen ) - { - fprintf( stderr, "vrpn_FunctionGenerator_function_script::decode_from: " - "payload error (wanted %d got %d).\n", newlen, len ); - fflush( stderr ); - return -1; - } - - char* newscript = new char[ newlen + 1 ]; - if( 0 > vrpn_unbuffer( buf, newscript, newlen ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_function_script::decode_from: " - "payload error (couldn't unbuffer).\n" ); - delete [] newscript; - fflush( stderr ); - return -1; - } - newscript[newlen] = '\0'; - if( this->script != NULL ) - delete [] this->script; - this->script = newscript; - len -= newlen; - return newlen + sizeof( vrpn_uint32 ); -} - - -vrpn_FunctionGenerator_function* vrpn_FunctionGenerator_function_script:: -clone( ) const -{ - return new vrpn_FunctionGenerator_function_script( *this ); -} - -char* vrpn_FunctionGenerator_function_script:: -getScript( ) const -{ - char* retval = new char[ strlen( this->script ) + 1 ]; - strcpy( retval, this->script ); - return retval; -} - - -vrpn_bool vrpn_FunctionGenerator_function_script:: -setScript( char* script ) -{ - if( script == NULL ) return false; - if( this->script != NULL ) - delete [] this->script; - this->script = new char[ strlen( script ) + 1 ]; - strcpy( this->script, script ); - return true; -} - -// -// end vrpn_FunctionGenerator_function_script -//////////////////////////////////////// -//////////////////////////////////////// - - -///////////////////////////////////////// -///////////////////////////////////////// -// -// class vrpn_FunctionGenerator_channel - -vrpn_FunctionGenerator_channel:: -vrpn_FunctionGenerator_channel( ) -{ - function = new vrpn_FunctionGenerator_function_NULL( ); -} - - -vrpn_FunctionGenerator_channel:: -vrpn_FunctionGenerator_channel( vrpn_FunctionGenerator_function* function ) -{ - this->function = function->clone(); -} - - -vrpn_FunctionGenerator_channel:: -~vrpn_FunctionGenerator_channel( ) -{ - delete function; -} - - -void vrpn_FunctionGenerator_channel:: -setFunction( vrpn_FunctionGenerator_function* function ) -{ - delete (this->function); - this->function = function->clone(); -} - - -vrpn_int32 vrpn_FunctionGenerator_channel:: -encode_to( char** buf, vrpn_int32& len ) const -{ - if( static_cast<unsigned>(len) < sizeof( vrpn_FunctionGenerator_function::FunctionCode ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_channel::encode_to: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_FunctionGenerator_function::FunctionCode )) ); - fflush( stderr ); - return -1; - } - if( 0 > vrpn_buffer( buf, &len, (int) this->function->getFunctionCode() ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_channel::encode_to: " - "unable to buffer function type.\n" ); - fflush( stderr ); - return -1; - } - return function->encode_to( buf, len ); -} - - -vrpn_int32 vrpn_FunctionGenerator_channel:: -decode_from( const char** buf, vrpn_int32& len ) -{ - if( static_cast<unsigned>(len) < sizeof( vrpn_FunctionGenerator_function::FunctionCode ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_channel::decode_from: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_FunctionGenerator_function::FunctionCode )) ); - fflush( stderr ); - return -1; - } - int myCode; - if( 0 > vrpn_unbuffer( buf, &myCode ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_channel::decode_from: " - "unable to unbuffer function type.\n" ); - fflush( stderr ); - return -1; - } - // if we don't have the right function type, create a new - // one of the appropriate type and delete the old one - if( myCode != function->getFunctionCode() ) - { - vrpn_FunctionGenerator_function* oldFunc = this->function; - vrpn_FunctionGenerator_function::FunctionCode newCode - = vrpn_FunctionGenerator_function::FunctionCode( myCode ); - switch( newCode ) - { - case vrpn_FunctionGenerator_function::FUNCTION_NULL: - this->function = new vrpn_FunctionGenerator_function_NULL(); - break; - case vrpn_FunctionGenerator_function::FUNCTION_SCRIPT: - this->function = new vrpn_FunctionGenerator_function_script(); - break; - default: - fprintf( stderr, "vrpn_FunctionGenerator_channel::decode_from: " - "unknown function type.\n" ); - fflush( stderr ); - return -1; - } - delete oldFunc; - } - return this->function->decode_from( buf, len ); -} - -// -// end vrpn_FunctionGenerator_channel -//////////////////////////////////////// -//////////////////////////////////////// - - -///////////////////////////////////////// -///////////////////////////////////////// -// -// class vrpn_FunctionGenerator - -vrpn_FunctionGenerator:: -vrpn_FunctionGenerator( const char* name, vrpn_Connection * c ) -: vrpn_BaseClass( name, c ), - sampleRate( 0 ), - numChannels( 0 ) -{ - vrpn_BaseClass::init( ); - - unsigned i; - for( i = 0; i <= vrpn_FUNCTION_CHANNELS_MAX - 1; i++ ) - { - channels[i] = new vrpn_FunctionGenerator_channel( ); - } -} - - -vrpn_FunctionGenerator:: -~vrpn_FunctionGenerator( ) -{ - unsigned i; - for( i = 0; i <= vrpn_FUNCTION_CHANNELS_MAX - 1; i++ ) - { - delete channels[i]; - } -} - - -const vrpn_FunctionGenerator_channel* vrpn_FunctionGenerator:: -getChannel( vrpn_uint32 channelNum ) -{ - if( channelNum > vrpn_FUNCTION_CHANNELS_MAX - 1 ) - return NULL; - return channels[channelNum]; -} - - -int vrpn_FunctionGenerator:: -register_types( ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::register_types\n" ); - fflush( stdout ); -#endif - channelMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL ); - requestChannelMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL_REQUEST ); - requestAllChannelsMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_ALL_CHANNEL_REQUEST ); - sampleRateMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_SAMPLE_RATE ); - startFunctionMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_START ); - stopFunctionMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_STOP ); - requestInterpreterMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_INTERPRETER_REQUEST ); - - channelReplyMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL_REPLY ); - startFunctionReplyMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_START_REPLY ); - stopFunctionReplyMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_STOP_REPLY ); - sampleRateReplyMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_SAMPLE_RATE_REPLY ); - interpreterReplyMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_INTERPRETER_REPLY ); - errorMessageID = d_connection->register_message_type( vrpn_FUNCTION_MESSAGE_TYPE_ERROR ); - - gotConnectionMessageID = d_connection->register_message_type( vrpn_got_connection ); - - if( channelMessageID == -1 || requestChannelMessageID == -1 - || requestAllChannelsMessageID == -1 - || sampleRateMessageID == -1 || startFunctionMessageID == -1 - || stopFunctionMessageID == -1 || channelReplyMessageID == -1 - || startFunctionReplyMessageID == -1 || stopFunctionReplyMessageID == -1 - || sampleRateReplyMessageID == -1 || gotConnectionMessageID == -1 - || requestInterpreterMessageID == -1 || interpreterReplyMessageID == -1 - || errorMessageID == -1 ) - { - fprintf( stderr, "vrpn_FunctionGenerator::register_types: error registering types.\n" ); - fflush( stderr ); - return -1; - } - return 0; -} - -// -// end of vrpn_FunctionGenerator -// -////////////////////////////////////////// -////////////////////////////////////////// - - - -/////////////////////////////////////////// -/////////////////////////////////////////// -// -// vrpn_FunctionGenerator_Server -// - -vrpn_FunctionGenerator_Server:: -vrpn_FunctionGenerator_Server( const char* name, vrpn_uint32 numChannels, vrpn_Connection * c ) -: vrpn_FunctionGenerator( name, c ) -{ - this->numChannels = numChannels; - // Check if we have a connection - if( d_connection == NULL ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server: Can't get connection!\n" ); - fflush( stderr ); - return; - } - - if( register_autodeleted_handler( channelMessageID, handle_channel_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server: can't register change channel request handler\n" ); - fflush( stderr ); - d_connection = NULL; - } - - if( register_autodeleted_handler( requestChannelMessageID, handle_channelRequest_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server: can't register channel request handler\n" ); - fflush( stderr ); - d_connection = NULL; - } - - if( register_autodeleted_handler( requestAllChannelsMessageID, handle_allChannelRequest_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server: can't register all-channel request handler\n" ); - fflush( stderr ); - d_connection = NULL; - } - - if( register_autodeleted_handler( startFunctionMessageID, handle_start_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server: can't register start request handler\n" ); - fflush( stderr ); - d_connection = NULL; - } - - if( register_autodeleted_handler( stopFunctionMessageID, handle_stop_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server: can't register stop request handler\n" ); - fflush( stderr ); - d_connection = NULL; - } - - if( register_autodeleted_handler( sampleRateMessageID, handle_sample_rate_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server: can't register sample-rate request handler\n" ); - fflush( stderr ); - d_connection = NULL; - } - - if( register_autodeleted_handler( requestInterpreterMessageID, handle_interpreter_request_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server: can't register interpreter request handler\n" ); - fflush( stderr ); - d_connection = NULL; - } -} - - -vrpn_FunctionGenerator_Server:: -~vrpn_FunctionGenerator_Server( ) -{ - -} - - -vrpn_uint32 vrpn_FunctionGenerator_Server:: -setNumChannels( vrpn_uint32 numChannels ) -{ - if( numChannels > vrpn_FUNCTION_CHANNELS_MAX ) - numChannels = vrpn_FUNCTION_CHANNELS_MAX; - this->numChannels = numChannels; - return this->numChannels; -} - - -void vrpn_FunctionGenerator_Server:: -mainloop( ) -{ - // call the base class' server mainloop - server_mainloop( ); -} - - -//static -int VRPN_CALLBACK vrpn_FunctionGenerator_Server:: -handle_channel_message( void* userdata, vrpn_HANDLERPARAM p ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_channel_message\n" ); - fflush( stdout ); -#endif - vrpn_FunctionGenerator_Server* me = (vrpn_FunctionGenerator_Server*) userdata; - vrpn_FunctionGenerator_channel* channel = new vrpn_FunctionGenerator_channel( ); - vrpn_uint32 channelNum = vrpn_FUNCTION_CHANNELS_MAX + 1; // an invalid number - if( 0 > me->decode_channel( p.buffer, p.payload_len, channelNum, *channel ) ) - { - if( channelNum < vrpn_FUNCTION_CHANNELS_MAX ) - { - // the decode function was able to decode the channel - // number, but must have had some problem decoding the channel. - // let the remotes know the channel didn't change - me->sendChannelReply( channelNum ); - } - // else, we couldn't even decode the channel number - } - - // let the server implementation see if this channel is acceptable - me->setChannel( channelNum, channel ); - return 0; -} - - -//static -int VRPN_CALLBACK vrpn_FunctionGenerator_Server:: -handle_channelRequest_message( void* userdata, vrpn_HANDLERPARAM p ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_channelRequest_message\n" ); - fflush( stdout ); -#endif - vrpn_FunctionGenerator_Server* me = (vrpn_FunctionGenerator_Server*) userdata; - vrpn_uint32 channelNum = vrpn_FUNCTION_CHANNELS_MAX + 1; // an invalid number - if( 0 > me->decode_channel_request( p.buffer, p.payload_len, channelNum ) ) - { - // the decode failed - fprintf( stderr, "vrpn_FunctionGenerator_Server::handle_channelRequest_message: " - "unable to decode channel number.\n" ); - fflush( stderr ); - return -1; - } - if( channelNum > vrpn_FUNCTION_CHANNELS_MAX ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::handle_channelRequest_message: " - "invalid channel number %d.\n", channelNum ); - fflush( stderr ); - return -1; - } - me->sendChannelReply( channelNum ); - - return 0; -} - - -//static -int VRPN_CALLBACK vrpn_FunctionGenerator_Server:: -handle_allChannelRequest_message( void* userdata, vrpn_HANDLERPARAM) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_allChannelRequest_message\n" ); - fflush( stdout ); -#endif - vrpn_FunctionGenerator_Server* me = (vrpn_FunctionGenerator_Server*) userdata; - unsigned i; - for( i = 0; i < vrpn_FUNCTION_CHANNELS_MAX; i++ ) - { - // XXX will this work as-is, or do we need to - // force buffers to be flushed periodically? - me->sendChannelReply( i ); - } - return 0; -} - - -//static -int VRPN_CALLBACK vrpn_FunctionGenerator_Server:: -handle_start_message( void* userdata, vrpn_HANDLERPARAM) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_start_message\n" ); - fflush( stdout ); -#endif - vrpn_FunctionGenerator_Server* me = (vrpn_FunctionGenerator_Server*) userdata; - me->start( ); - return 0; -} - - -//static -int VRPN_CALLBACK vrpn_FunctionGenerator_Server:: -handle_stop_message( void* userdata, vrpn_HANDLERPARAM) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_stop_message\n" ); - fflush( stdout ); -#endif - vrpn_FunctionGenerator_Server* me = (vrpn_FunctionGenerator_Server*) userdata; - me->stop( ); - return 0; -} - - -//static -int VRPN_CALLBACK vrpn_FunctionGenerator_Server:: -handle_sample_rate_message( void* userdata, vrpn_HANDLERPARAM p ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_sample_rate_message\n" ); - fflush( stdout ); -#endif - vrpn_FunctionGenerator_Server* me = (vrpn_FunctionGenerator_Server*) userdata; - vrpn_float32 rate = 0; - if( 0 > me->decode_sampleRate_request( p.buffer, p.payload_len, rate ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::handle_sample_rate_message: " - "unable to decode.\n" ); - fflush( stderr ); - me->sendSampleRateReply( ); - return -1; - } - me->setSampleRate( rate ); - return 0; -} - - -//static -int VRPN_CALLBACK vrpn_FunctionGenerator_Server:: -handle_interpreter_request_message( void* userdata, vrpn_HANDLERPARAM /*p*/) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_interpreter_request_message\n" ); - fflush( stdout ); -#endif - vrpn_FunctionGenerator_Server* me = (vrpn_FunctionGenerator_Server*) userdata; - me->sendInterpreterDescription( ); - return 0; -} - - - -int vrpn_FunctionGenerator_Server:: -sendChannelReply( vrpn_uint32 channelNum ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::sendChannelReply\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - if( 0 > this->encode_channel_reply( &buf, buflen, channelNum ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::sendChannelReply: " - "could not buffer message.\n" ); - fflush( stderr ); - return -1; - } - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->channelReplyMessageID, this->d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::sendChannelReply: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - return 0; -} - - -int vrpn_FunctionGenerator_Server:: -sendSampleRateReply( ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::sendSampleRateReply\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - if( this->encode_sampleRate_reply( &buf, buflen, sampleRate ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::sendSampleRateReply: " - "could not buffer message.\n" ); - fflush( stderr ); - return -1; - } - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->sampleRateReplyMessageID, this->d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::sendSampleRateReply: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - return 0; -} - - -int vrpn_FunctionGenerator_Server:: -sendStartReply( vrpn_bool started ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::sendStartReply\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - if( 0 > this->encode_start_reply( &buf, buflen, started ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::sendStartReply: " - "could not buffer message.\n" ); - fflush( stderr ); - return -1; - } - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->startFunctionReplyMessageID, this->d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::sendStartReply: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - return 0; -} - - -int vrpn_FunctionGenerator_Server:: -sendStopReply( vrpn_bool stopped ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::sendStopReply\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - if( 0 > this->encode_stop_reply( &buf, buflen, stopped ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::sendStopReply: " - "could not buffer message.\n" ); - fflush( stderr ); - return -1; - } - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->stopFunctionReplyMessageID, this->d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::sendStopReply: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - return 0; -} - - -int vrpn_FunctionGenerator_Server:: -sendInterpreterDescription( ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::sendInterpreterDescription\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - if( 0 > this->encode_interpreterDescription_reply( &buf, buflen, getInterpreterDescription() ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::sendInterpreterDescription: " - "could not buffer message.\n" ); - fflush( stderr ); - return -1; - } - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->interpreterReplyMessageID, this->d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::sendInterpreterDescription: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - return 0; -} - - -int vrpn_FunctionGenerator_Server:: -sendError( FGError error, vrpn_int32 channel ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::sendError\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - if( this->encode_error_report( &buf, buflen, error, channel ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::sendError: " - "could not buffer message.\n" ); - fflush( stderr ); - return -1; - } - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->errorMessageID, this->d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::sendError: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - return 0; -} - -// -// end vrpn_FunctionGenerator_Server -// (except for encode and decode functions) -////////////////////////////////////////// -////////////////////////////////////////// - - - - -/////////////////////////////////////////// -/////////////////////////////////////////// -// -// vrpn_FunctionGenerator_Remote -// - -vrpn_FunctionGenerator_Remote:: -vrpn_FunctionGenerator_Remote( const char* name, vrpn_Connection * c ) -: vrpn_FunctionGenerator( name, c ) -{ - // Check if we have a connection - if( d_connection == NULL ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote: Can't get connection!\n" ); - fflush( stderr ); - return; - } - - if( register_autodeleted_handler( channelReplyMessageID, handle_channelReply_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote: can't register channel reply handler\n" ); - fflush( stderr ); - d_connection = NULL; - } - - if( register_autodeleted_handler( startFunctionReplyMessageID, handle_startReply_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote: can't register start reply handler\n" ); - fflush( stderr ); - d_connection = NULL; - } - - if( register_autodeleted_handler( stopFunctionReplyMessageID, handle_stopReply_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote: can't register stop reply handler\n" ); - fflush( stderr ); - d_connection = NULL; - } - - if( register_autodeleted_handler( sampleRateReplyMessageID, handle_sampleRateReply_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote: can't register sample-rate reply handler\n" ); - fflush( stderr ); - d_connection = NULL; - } - - if( register_autodeleted_handler( interpreterReplyMessageID, handle_interpreterReply_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote: can't register interpreter reply handler\n" ); - fflush( stderr ); - d_connection = NULL; - } - - if( register_autodeleted_handler( errorMessageID, handle_error_message, this, d_sender_id ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote: can't register error message handler\n" ); - fflush( stderr ); - d_connection = NULL; - } - -} - - -int vrpn_FunctionGenerator_Remote:: -setChannel( const vrpn_uint32 channelNum, const vrpn_FunctionGenerator_channel* channel ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::setChannel\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - if( 0 > this->encode_channel( &buf, buflen, channelNum, channel ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::setChannel: " - "could not buffer message.\n" ); - fflush( stderr ); - return -1; - } - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->channelMessageID, this->d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::setChannel: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - else - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::setChannel: " - "no connection.\n" ); - fflush( stderr ); - return -1; - } - return 0; -} - - -int vrpn_FunctionGenerator_Remote:: -requestChannel( const vrpn_uint32 channelNum ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::requestChannel\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - if( 0 > this->encode_channel_request( &buf, buflen, channelNum ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestChannel: " - "could not buffer message.\n" ); - fflush( stderr ); - return -1; - } - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->requestChannelMessageID, this->d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestChannel: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - else - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestChannel: " - "no connection.\n" ); - fflush( stderr ); - return -1; - } - return 0; -} - - - -int vrpn_FunctionGenerator_Remote:: -requestAllChannels( ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::requestAllChannels\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - // nothing to encode; the message type is the symbol - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->requestAllChannelsMessageID, this->d_sender_id, buf, - vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestAllChannels: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - else - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestAllChannels: " - "no connection.\n" ); - fflush( stderr ); - return -1; - } - return 0; -} - - -int vrpn_FunctionGenerator_Remote:: -requestStart( ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::requestStart\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - // nothing to encode; the message type is the symbol - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->startFunctionMessageID, this->d_sender_id, buf, - vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestStart: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - else - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestStart: " - "no connection.\n" ); - fflush( stderr ); - return -1; - } - return 0; -} - - -int vrpn_FunctionGenerator_Remote:: -requestStop( ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::requestStop\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - // nothing to encode; the message type is the symbol - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->stopFunctionMessageID, this->d_sender_id, buf, - vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestStop: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - else - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestStop: " - "no connection.\n" ); - fflush( stderr ); - return -1; - } - return 0; -} - - -int vrpn_FunctionGenerator_Remote:: -requestSampleRate( vrpn_float32 rate ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::requestSampleRate\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - if( 0 > this->encode_sampleRate_request( &buf, buflen, rate ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestSampleRate: " - "could not buffer message.\n" ); - fflush( stderr ); - return -1; - } - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->sampleRateMessageID, this->d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestSampleRate: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - else - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestSampleRate: " - "no connection.\n" ); - fflush( stderr ); - return -1; - } - return 0; -} - - -int vrpn_FunctionGenerator_Remote:: -requestInterpreterDescription( ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::requestInterpreterDescription\n" ); - fflush( stdout ); -#endif - vrpn_gettimeofday( ×tamp, NULL ); - if( this->d_connection ) - { - int buflen = vrpn_CONNECTION_TCP_BUFLEN; - char* buf = &msgbuf[0]; - // nothing to encode; the message type is the symbol - if( d_connection->pack_message( vrpn_CONNECTION_TCP_BUFLEN - buflen, timestamp, - this->requestInterpreterMessageID, this->d_sender_id, buf, - vrpn_CONNECTION_RELIABLE ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestInterpreterDescription: " - "could not write message.\n" ); - fflush( stderr ); - return -1; - } - } - else - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::requestInterpreterDescription: " - "no connection.\n" ); - fflush( stderr ); - return -1; - } - return 0; -} - - -void vrpn_FunctionGenerator_Remote:: -mainloop( ) -{ - if( d_connection != NULL ) - { - d_connection->mainloop( ); - client_mainloop( ); - } -} - - -int vrpn_FunctionGenerator_Remote:: -register_channel_reply_handler( void *userdata, - vrpn_FUNCTION_CHANGE_REPLY_HANDLER handler ) -{ - return channel_reply_list.register_handler(userdata, handler); -} - - -int vrpn_FunctionGenerator_Remote:: -unregister_channel_reply_handler( void *userdata, - vrpn_FUNCTION_CHANGE_REPLY_HANDLER handler ) -{ - return channel_reply_list.unregister_handler(userdata, handler); -} - - -int vrpn_FunctionGenerator_Remote:: -register_start_reply_handler( void *userdata, - vrpn_FUNCTION_START_REPLY_HANDLER handler ) -{ - return start_reply_list.register_handler(userdata, handler); -} - - -int vrpn_FunctionGenerator_Remote:: -unregister_start_reply_handler( void *userdata, - vrpn_FUNCTION_START_REPLY_HANDLER handler ) -{ - return start_reply_list.unregister_handler(userdata, handler); -} - - -int vrpn_FunctionGenerator_Remote:: -register_stop_reply_handler( void *userdata, - vrpn_FUNCTION_STOP_REPLY_HANDLER handler ) -{ - return stop_reply_list.register_handler(userdata, handler); -} - - -int vrpn_FunctionGenerator_Remote:: -unregister_stop_reply_handler( void *userdata, - vrpn_FUNCTION_STOP_REPLY_HANDLER handler ) -{ - return stop_reply_list.unregister_handler(userdata, handler); -} - - -int vrpn_FunctionGenerator_Remote:: -register_sample_rate_reply_handler( void *userdata, - vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER handler ) -{ - return sample_rate_reply_list.register_handler(userdata, handler); -} - - -int vrpn_FunctionGenerator_Remote:: -unregister_sample_rate_reply_handler( void *userdata, - vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER handler ) -{ - return sample_rate_reply_list.unregister_handler(userdata, handler); -} - - -int vrpn_FunctionGenerator_Remote:: -register_interpreter_reply_handler( void *userdata, - vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER handler ) -{ - return interpreter_reply_list.register_handler(userdata, handler); -} - - -int vrpn_FunctionGenerator_Remote:: -unregister_interpreter_reply_handler( void *userdata, - vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER handler ) -{ - return interpreter_reply_list.unregister_handler(userdata, handler); -} - - -int vrpn_FunctionGenerator_Remote:: -register_error_handler( void *userdata, - vrpn_FUNCTION_ERROR_HANDLER handler ) -{ - return error_list.register_handler(userdata, handler); -} - - -int vrpn_FunctionGenerator_Remote:: -unregister_error_handler( void *userdata, - vrpn_FUNCTION_ERROR_HANDLER handler ) -{ - return error_list.unregister_handler(userdata, handler); -} - - -//static -int vrpn_FunctionGenerator_Remote:: -handle_channelReply_message( void* userdata, vrpn_HANDLERPARAM p ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_channelReply_message\n" ); - fflush( stdout ); -#endif - vrpn_FunctionGenerator_Remote* me = (vrpn_FunctionGenerator_Remote*) userdata; - vrpn_uint32 channelNum = vrpn_FUNCTION_CHANNELS_MAX + 1; // an invalid number - if( 0 > me->decode_channel_reply( p.buffer, p.payload_len, channelNum ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::handle_channelReply_message: " - "unable to decode.\n" ); - fflush( stderr ); - return -1; - } - if( channelNum >= vrpn_FUNCTION_CHANNELS_MAX ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::handle_channelReply_message: " - "invalid channel %d.\n", channelNum ); - fflush( stderr ); - return -1; - } - - vrpn_FUNCTION_CHANNEL_REPLY_CB cb; - cb.msg_time.tv_sec = p.msg_time.tv_sec; - cb.msg_time.tv_usec = p.msg_time.tv_usec; - cb.channelNum = channelNum; - cb.channel = me->channels[channelNum]; - - me->channel_reply_list.call_handlers( cb ); - return 0; -} - - -//static -int vrpn_FunctionGenerator_Remote:: -handle_startReply_message( void* userdata, vrpn_HANDLERPARAM p ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_startReply_message\n" ); - fflush( stdout ); -#endif - vrpn_FunctionGenerator_Remote* me = (vrpn_FunctionGenerator_Remote*) userdata; - vrpn_bool isStarted = false; - if( 0 > me->decode_start_reply( p.buffer, p.payload_len, isStarted ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::handle_startReply_message: " - "unable to decode.\n" ); - fflush( stderr ); - return -1; - } - - vrpn_FUNCTION_START_REPLY_CB cb; - cb.msg_time.tv_sec = p.msg_time.tv_sec; - cb.msg_time.tv_usec = p.msg_time.tv_usec; - cb.isStarted = isStarted; - - me->start_reply_list.call_handlers( cb ); - return 0; -} - - -//static -int vrpn_FunctionGenerator_Remote:: -handle_stopReply_message( void* userdata, vrpn_HANDLERPARAM p ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_stopReply_message\n" ); - fflush( stdout ); -#endif - vrpn_FunctionGenerator_Remote* me = (vrpn_FunctionGenerator_Remote*) userdata; - vrpn_bool isStopped = false; - if( 0 > me->decode_stop_reply( p.buffer, p.payload_len, isStopped ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::handle_stopReply_message: " - "unable to decode.\n" ); - fflush( stderr ); - return -1; - } - - vrpn_FUNCTION_STOP_REPLY_CB cb; - cb.msg_time.tv_sec = p.msg_time.tv_sec; - cb.msg_time.tv_usec = p.msg_time.tv_usec; - cb.isStopped = isStopped; - - me->stop_reply_list.call_handlers( cb ); - return 0; -} - - -//static -int vrpn_FunctionGenerator_Remote:: -handle_sampleRateReply_message( void* userdata, vrpn_HANDLERPARAM p ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_sampleRateReply_message\n" ); - fflush( stdout ); -#endif - vrpn_FunctionGenerator_Remote* me = (vrpn_FunctionGenerator_Remote*) userdata; - if( 0 > me->decode_sampleRate_reply( p.buffer, p.payload_len ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::handle_sampleRateReply_message: " - "unable to decode.\n" ); - fflush( stderr ); - return -1; - } - - vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB cb; - cb.msg_time.tv_sec = p.msg_time.tv_sec; - cb.msg_time.tv_usec = p.msg_time.tv_usec; - cb.sampleRate = me->sampleRate; - - me->sample_rate_reply_list.call_handlers( cb ); - return 0; -} - - -//static -int vrpn_FunctionGenerator_Remote:: -handle_interpreterReply_message( void* userdata, vrpn_HANDLERPARAM p ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_interpreterReply_message\n" ); - fflush( stdout ); -#endif - vrpn_FUNCTION_INTERPRETER_REPLY_CB cb; - vrpn_FunctionGenerator_Remote* me = (vrpn_FunctionGenerator_Remote*) userdata; - if( 0 > me->decode_interpreterDescription_reply( p.buffer, p.payload_len, &(cb.description) ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::handle_interpreterReply_message: " - "unable to decode.\n" ); - fflush( stderr ); - return -1; - } - - cb.msg_time.tv_sec = p.msg_time.tv_sec; - cb.msg_time.tv_usec = p.msg_time.tv_usec; - - me->interpreter_reply_list.call_handlers( cb ); - return 0; -} - - -// static -int vrpn_FunctionGenerator_Remote:: -handle_error_message( void* userdata, vrpn_HANDLERPARAM p ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::handle_error_message\n" ); - fflush( stdout ); -#endif - vrpn_FUNCTION_ERROR_CB cb; - vrpn_FunctionGenerator_Remote* me = (vrpn_FunctionGenerator_Remote*) userdata; - if( 0 > me->decode_error_reply( p.buffer, p.payload_len, cb.err, cb.channel ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::handle_error_message: " - "unable to decode.\n" ); - fflush( stderr ); - return -1; - } - - cb.msg_time.tv_sec = p.msg_time.tv_sec; - cb.msg_time.tv_usec = p.msg_time.tv_usec; - - me->error_list.call_handlers( cb ); - return 0; -} - -// -// end vrpn_FunctionGenerator_Remote -// (except for encode and decode functions) -///////////////////////////////////////////// -///////////////////////////////////////////// - - - -//////////////////////////////////////// -//////////////////////////////////////// -// -// encode and decode functions for -// vrpn_FunctionGenerator_Server and -// vrpn_FunctionGenerator_Remote -// - -vrpn_int32 vrpn_FunctionGenerator_Remote:: -encode_channel( char** buf, vrpn_int32& len, const vrpn_uint32 channelNum, - const vrpn_FunctionGenerator_channel* channel ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::encode_channel\n" ); - fflush( stdout ); -#endif - if( channelNum > vrpn_FUNCTION_CHANNELS_MAX ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::encode_channel: " - "invalid channel nubmer %d.\n", channelNum ); - fflush( stderr ); - return -1; - } - if( static_cast<unsigned>(len) < sizeof( vrpn_uint32 ) ) - { - // the channel's encode_to function will check that the length is - // sufficient for the channel's info, so just check that we can - // at least encode the channel number. - fprintf( stderr, "vrpn_FunctionGenerator_Remote::encode_channel: " - "couldn't buffer (got %d, wanted at least %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_int32)) ); - fflush( stderr ); - return -1; - } - if( 0 > vrpn_buffer( buf, &len, channelNum ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::encode_channel: " - "message payload error (couldn't buffer channel number).\n" ); - fflush( stderr ); - return -1; - } - if( 0 > channel->encode_to( buf, len ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::encode_channel: " - "message payload error (couldn't buffer channel).\n" ); - fflush( stderr ); - return -1; - } - return 0; -} - - -vrpn_int32 vrpn_FunctionGenerator_Server:: -decode_channel( const char* buf, const vrpn_int32 len, vrpn_uint32& channelNum, - vrpn_FunctionGenerator_channel& channel ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::decode_channel\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_uint32 ) ) - { - // the channel's decode_from function will check that the length is - // sufficient for the channel's info, so just check that we can - // at least decode the channel number. - fprintf( stderr, "vrpn_FunctionGenerator_Server::decode_channel: " - "channel message payload error (got %d, wanted at least %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_int32)) ); - fflush( stderr ); - return -1; - } - const char* mybuf = buf; - vrpn_int32 mylen = len; - vrpn_uint32 myNum = 0; - if( 0 > vrpn_unbuffer( &mybuf, &myNum ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::decode_channel: " - "message payload error (couldn't unbuffer)\n" ); - fflush( stderr ); - return -1; - } - mylen -= sizeof( myNum ); - channelNum = myNum; - if( 0 > channel.decode_from( &mybuf, mylen ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::decode_channel: " - "error while decoding channel %d\n", channelNum ); - fflush( stderr ); - return -1; - } - - return 0; -} - - -vrpn_int32 vrpn_FunctionGenerator_Server:: -encode_channel_reply( char** buf, vrpn_int32& len, const vrpn_uint32 channelNum ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::encode_channel_reply\n" ); - fflush( stdout ); -#endif - if( channelNum >= vrpn_FUNCTION_CHANNELS_MAX ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::encode_channel_reply: " - "invalid channel\n" ); - fflush( stderr ); - return -1; - } - if( static_cast<unsigned>(len) < sizeof( vrpn_uint32 ) ) - { - // the channel's encode_to function will check that the length is - // sufficient for the channel's info, so just check that we can - // at least encode the channel number. - fprintf( stderr, "vrpn_FunctionGenerator_Server::encode_channel_reply: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_uint32)) ); - fflush( stderr ); - return -1; - } - if( 0 > vrpn_buffer( buf, &len, channelNum ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::encode_channel_reply: " - "unable to buffer channel number.\n" ); - fflush( stderr ); - return -1; - } - if( 0 > channels[channelNum]->encode_to( buf, len ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::encode_channel_reply: " - "unable to encode channel.\n" ); - fflush( stderr ); - return -1; - } - return 0; -} - - -vrpn_int32 vrpn_FunctionGenerator_Remote:: -decode_channel_reply( const char* buf, const vrpn_int32 len, vrpn_uint32& channelNum ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::decode_channel_reply\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_uint32 ) ) - { - // the channel's decode_to function will check that the length is - // sufficient for the channel's info, so just check that we can - // at least decode the channel number. - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_channel_reply: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_uint32)) ); - fflush( stderr ); - return -1; - } - const char* mybuf = buf; - vrpn_int32 mylen = len; - vrpn_uint32 myNum = 0; - if( 0 > vrpn_unbuffer( &mybuf, &myNum ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_channel_reply: " - "unable to unbuffer channel number.\n" ); - fflush( stderr ); - return -1; - } - if( myNum >= vrpn_FUNCTION_CHANNELS_MAX ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_channel_reply: " - "invalid channel: %d\n", myNum ); - fflush( stderr ); - return -1; - } - channelNum = myNum; - mylen -= sizeof( vrpn_uint32 ); - return channels[channelNum]->decode_from( &mybuf, mylen ); -} - - -vrpn_int32 vrpn_FunctionGenerator_Remote:: -encode_channel_request( char** buf, vrpn_int32& len, const vrpn_uint32 channelNum ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::encode_channel_request\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_uint32 ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::encode_channel_request: " - "channel message payload error (got %d, wanted at least %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_int32)) ); - fflush( stderr ); - return -1; - } - vrpn_int32 mylen = len; - if( 0 > vrpn_buffer( buf, &mylen, channelNum ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::encode_channel_request: " - "unable to buffer channel %d", channelNum ); - fflush( stderr ); - return -1; - } - len = mylen; - return 0; -} - - -vrpn_int32 vrpn_FunctionGenerator_Server:: -decode_channel_request( const char* buf, const vrpn_int32 len, vrpn_uint32& channelNum ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::decode_channel_request\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_uint32 ) ) - { - // the channel's encode_to function will check that the length is - // sufficient for the channel's info, so just check that we can - // at least encode the channel number. - fprintf( stderr, "vrpn_FunctionGenerator_Server::decode_channel_request: " - "channel message payload error (got %d, wanted at least %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_int32)) ); - fflush( stderr ); - return -1; - } - const char* mybuf = buf; - if( 0 > vrpn_unbuffer( &mybuf, &channelNum ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::decode_channel_request: " - "unable to unbuffer channel %d", channelNum ); - fflush( stderr ); - return -1; - } - return 0; -} - - -vrpn_int32 vrpn_FunctionGenerator_Remote:: -encode_sampleRate_request( char** buf, vrpn_int32& len, const vrpn_float32 sampleRate ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::encode_sampleRate_request\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_float32 ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::encode_sampleRate_request: " - "channel message payload error (got %d, wanted at least %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_float32)) ); - fflush( stderr ); - return -1; - } - vrpn_int32 mylen = len; - if( 0 > vrpn_buffer( buf, &mylen, sampleRate ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::encode_sampleRate_request: " - "unable to buffer sample rate" ); - fflush( stderr ); - return -1; - } - len = mylen; - return 0; -} - - -vrpn_int32 vrpn_FunctionGenerator_Server:: -decode_sampleRate_request( const char* buf, const vrpn_int32 len, vrpn_float32& sampleRate ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::decode_sampleRate_request\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_float32 ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::decode_sampleRate_request: " - "channel message payload error (got %d, wanted at least %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_float32)) ); - fflush( stderr ); - return -1; - } - const char* mybuf = buf; - if( 0 > vrpn_unbuffer( &mybuf, &sampleRate ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::decode_sampleRate_request: " - "unable to unbuffer sample rate" ); - fflush( stderr ); - return -1; - } - return 0; -} - - -vrpn_int32 vrpn_FunctionGenerator_Server:: -encode_start_reply( char** buf, vrpn_int32& len, const vrpn_bool isStarted ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::encode_start_reply\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_bool ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::encode_start_reply: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_bool)) ); - fflush( stderr ); - return -1; - } - return vrpn_buffer( buf, &len, isStarted ); -} - - -vrpn_int32 vrpn_FunctionGenerator_Remote:: -decode_start_reply( const char* buf, const vrpn_int32 len, vrpn_bool& isStarted ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::decode_start_reply\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_bool ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_start_reply: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_bool)) ); - fflush( stderr ); - return -1; - } - const char* mybuf = buf; - if( 0 > vrpn_unbuffer( &mybuf, &isStarted ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_start_reply: " - "unable to unbuffer stop condition.\n" ); - fflush( stderr ); - return -1; - } - return 0; -} - - -vrpn_int32 vrpn_FunctionGenerator_Server:: -encode_stop_reply( char** buf, vrpn_int32& len, const vrpn_bool isStopped ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::encode_stop_reply\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_bool ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::encode_stop_reply: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_bool)) ); - fflush( stderr ); - return -1; - } - return vrpn_buffer( buf, &len, isStopped ); -} - - -vrpn_int32 vrpn_FunctionGenerator_Remote:: -decode_stop_reply( const char* buf, const vrpn_int32 len, vrpn_bool& isStopped ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::decode_stop_reply\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_bool ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_stop_reply: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_bool)) ); - fflush( stderr ); - return -1; - } - if( 0 > vrpn_unbuffer( &buf, &isStopped ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_stop_reply: " - "unable to unbuffer stop condition.\n" ); - fflush( stderr ); - return -1; - } - return 0; -} - - -vrpn_int32 vrpn_FunctionGenerator_Server:: -encode_sampleRate_reply( char** buf, vrpn_int32& len, const vrpn_float32 sampleRate ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::encode_sampleRate_reply\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_float32 ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::encode_sampleRate_reply: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_float32)) ); - fflush( stderr ); - return -1; - } - return vrpn_buffer( buf, &len, sampleRate ); -} - - -vrpn_int32 vrpn_FunctionGenerator_Remote:: -decode_sampleRate_reply( const char* buf, const vrpn_int32 len ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::decode_sampleRate_reply\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_float32 ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_sampleRate_reply: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_float32)) ); - fflush( stderr ); - return -1; - } - vrpn_float32 myRate = 0; - if( 0 > vrpn_unbuffer( &buf, &myRate ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_sampleRate_reply: " - "unable to unbuffer sample rate.\n" ); - fflush( stderr ); - return -1; - } - this->sampleRate = myRate; - return 0; -} - - -vrpn_int32 vrpn_FunctionGenerator_Server:: -encode_interpreterDescription_reply( char** buf, vrpn_int32& len, const char* desc ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::encode_interpreterDescription_reply\n" ); - fflush( stdout ); -#endif - vrpn_int32 dlength = static_cast<vrpn_int32>(strlen( desc )); - if( len < dlength + (vrpn_int32) sizeof( vrpn_int32 ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::encode_interpreterDescription_reply: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, dlength + static_cast<unsigned long>(sizeof( vrpn_int32 )) ); - fflush( stderr ); - return -1; - } - if( 0 > vrpn_buffer( buf, &len, dlength ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::encode_interpreterDescription_reply: " - "unable to buffer description length.\n" ); - fflush( stderr ); - return -1; - } - - return vrpn_buffer( buf, &len, desc, dlength ); -} - - -vrpn_int32 vrpn_FunctionGenerator_Remote:: -decode_interpreterDescription_reply( const char* buf, const vrpn_int32 len, char** desc ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::decode_interpreterDescription_reply\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( vrpn_int32 ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_interpreterDescription_reply: " - "insufficient buffer space given (got %d, wanted at least %lud).\n", - len, static_cast<unsigned long>(sizeof( vrpn_int32)) ); - fflush( stderr ); - return -1; - } - vrpn_int32 dlength = 0; - if( 0 > vrpn_unbuffer( &buf, &dlength ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_interpreterDescription_reply: " - "unable to unbuffer description length.\n" ); - fflush( stderr ); - return -1; - } - *desc = new char[ dlength + 1 ]; - int retval = vrpn_unbuffer( &buf, *desc, dlength ); - (*desc)[dlength] = '\0'; - return retval; -} - - -vrpn_int32 vrpn_FunctionGenerator_Server:: -encode_error_report( char** buf, vrpn_int32& len, const FGError error, const vrpn_int32 channel ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::encode_error_report\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( FGError ) + sizeof( vrpn_int32 ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::encode_error_report: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, static_cast<unsigned long>(sizeof( FGError) + sizeof( vrpn_int32 )) ); - fflush( stderr ); - return -1; - } - vrpn_int32 mylen = len; - if( 0 > vrpn_buffer( buf, &mylen, error ) || 0 > vrpn_buffer( buf, &mylen, channel ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Server::encode_error_report: " - "unable to buffer error & channel" ); - fflush( stderr ); - return -1; - } - len = mylen; - return 0; -} - - -vrpn_int32 vrpn_FunctionGenerator_Remote:: -decode_error_reply( const char* buf, const vrpn_int32 len, FGError& error, vrpn_int32& channel ) -{ -#ifdef DEBUG_VRPN_FUNCTION_GENERATOR - fprintf( stdout, "FG::decode_error_reply\n" ); - fflush( stdout ); -#endif - if( static_cast<unsigned>(len) < sizeof( FGError ) + sizeof( vrpn_int32 ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_error_reply: " - "insufficient buffer space given (got %d, wanted %lud).\n", - len, static_cast<unsigned long>(sizeof( FGError) + sizeof( vrpn_int32 )) ); - fflush( stderr ); - return -1; - } - int myError = NO_FG_ERROR; - vrpn_int32 myChannel = -1; - if( 0 > vrpn_unbuffer( &buf, &myError ) - || 0 > vrpn_unbuffer( &buf, &myChannel ) ) - { - fprintf( stderr, "vrpn_FunctionGenerator_Remote::decode_error_reply: " - "unable to unbuffer error & channel.\n" ); - fflush( stderr ); - return -1; - } - error = FGError( myError ); - channel = myChannel; - return 0; -} - - - -// -// end encode & decode functions for -// vrpn_FunctionGenerator_Remote and -// vrpn_FunctionGenerator_Server -/////////////////////////////////////// - diff --git a/src/vrpn/vrpn_FunctionGenerator.h b/src/vrpn/vrpn_FunctionGenerator.h deleted file mode 100644 index 21919ea38a99aa30b7eaaed2ac9c19daa395cb11..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_FunctionGenerator.h +++ /dev/null @@ -1,429 +0,0 @@ -#ifndef VRPN_FUNCTIONGENERATOR_H -#define VRPN_FUNCTIONGENERATOR_H - -#include <stddef.h> // for NULL - -#include "vrpn_Analog.h" // for vrpn_CHANNEL_MAX -#include "vrpn_BaseClass.h" // for vrpn_Callback_List, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Connection.h" -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_int32, vrpn_uint32, etc - - -const vrpn_uint32 vrpn_FUNCTION_CHANNELS_MAX = vrpn_CHANNEL_MAX; - -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL; -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL_REQUEST; -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_ALL_CHANNEL_REQUEST; -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_SAMPLE_RATE; -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_START; -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_STOP; -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL_REPLY; -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_START_REPLY; -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_STOP_REPLY; -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_SAMPLE_RATE_REPLY; -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_INTERPRETER_REQUEST; -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_INTERPRETER_REPLY; -extern const char* vrpn_FUNCTION_MESSAGE_TYPE_ERROR; - -class VRPN_API vrpn_FunctionGenerator_channel; - -// a base class for all functions that vrpn_FunctionGenerator -// can generate -class VRPN_API vrpn_FunctionGenerator_function -{ -public: - virtual ~vrpn_FunctionGenerator_function() = 0; - - // concrete classes should implement this to generate the appropriate - // values for the function the class represents. nValue samples should be - // generated beginning at time startTime, and these samples should be placed - // in the provided buffer. several data members of 'channel' can modify the - // times for which values are generated. - // returns the time of the last sample generated. - virtual vrpn_float32 generateValues( vrpn_float32* buf, vrpn_uint32 nValues, - vrpn_float32 startTime, vrpn_float32 sampleRate, - vrpn_FunctionGenerator_channel* channel ) const = 0; - - // concrete classes should implement this to encode their - // function information into the specified buffer 'buf'. The - // remaining length in the buffer is stored in 'len'. At return, - // 'len' should be set to the number of characters remaining in the - // buffer and the number of characters written should be returned, - // save in case of failure, when negative should be returned. - virtual vrpn_int32 encode_to( char** buf, vrpn_int32& len ) const = 0; - - // concrete classes should implement this to decode their - // function information from the specified buffer. The remaining - // length in the buffer is stored in 'len'. At return, 'len' should - // be set to the number of characters remaining in the the buffer - // and the number of characters read should be returned, save in case - // of failure, when negative should be returned - virtual vrpn_int32 decode_from( const char** buf, vrpn_int32& len ) = 0; - - virtual vrpn_FunctionGenerator_function* clone( ) const = 0; - - // used when encoding/decoding to specify function type - enum FunctionCode - { - FUNCTION_NULL = 0, - FUNCTION_SCRIPT = 1 - }; - - // concrete classes should implement this to return the - // appropriate FunctionCode, from above - virtual FunctionCode getFunctionCode( ) const = 0; - - -}; - - -// the NULL function: generate all zeros -class VRPN_API vrpn_FunctionGenerator_function_NULL -: public virtual vrpn_FunctionGenerator_function -{ -public: - vrpn_FunctionGenerator_function_NULL( ) { } - virtual ~vrpn_FunctionGenerator_function_NULL( ) { } - - vrpn_float32 generateValues( vrpn_float32* buf, vrpn_uint32 nValues, - vrpn_float32 startTime, vrpn_float32 sampleRate, - vrpn_FunctionGenerator_channel* channel ) const; - - vrpn_int32 encode_to( char** buf, vrpn_int32& len ) const; - vrpn_int32 decode_from( const char** buf, vrpn_int32& len ); - vrpn_FunctionGenerator_function* clone( ) const; -protected: - FunctionCode getFunctionCode( ) const { return FUNCTION_NULL; } - -}; - - -class VRPN_API vrpn_FunctionGenerator_function_script -: public virtual vrpn_FunctionGenerator_function -{ -public: - vrpn_FunctionGenerator_function_script( ); - vrpn_FunctionGenerator_function_script( const char* script ); - vrpn_FunctionGenerator_function_script( const vrpn_FunctionGenerator_function_script& ); - virtual ~vrpn_FunctionGenerator_function_script(); - - virtual vrpn_float32 generateValues( vrpn_float32* buf, vrpn_uint32 nValues, - vrpn_float32 startTime, vrpn_float32 sampleRate, - vrpn_FunctionGenerator_channel* channel ) const; - - vrpn_int32 encode_to( char** buf, vrpn_int32& len ) const; - vrpn_int32 decode_from( const char** buf, vrpn_int32& len ); - vrpn_FunctionGenerator_function* clone( ) const; - - // returns a copy of the script. caller is responsible for - // calling 'delete []' to free the returned string. - char* getScript( ) const; - - const char* getConstScript( ) const - { return script; } - - vrpn_bool setScript( char* script ); - -protected: - FunctionCode getFunctionCode( ) const { return FUNCTION_SCRIPT; } - char* script; - -}; - - -class VRPN_API vrpn_FunctionGenerator_channel -{ - // note: the channel will delete its function when the function is - // no longer needed (e.g., when the channel is destroyed or the function changed) -public: - vrpn_FunctionGenerator_channel( ); - vrpn_FunctionGenerator_channel( vrpn_FunctionGenerator_function* function ); - virtual ~vrpn_FunctionGenerator_channel( ); - - const vrpn_FunctionGenerator_function* getFunction( ) const { return function; } - void setFunction( vrpn_FunctionGenerator_function* function ); - - // these return zero on success and negative on some failure. - vrpn_int32 encode_to( char** buf, vrpn_int32& len ) const; - vrpn_int32 decode_from( const char** buf, vrpn_int32& len ); - -protected: - vrpn_FunctionGenerator_function* function; - -}; - - -class VRPN_API vrpn_FunctionGenerator : public vrpn_BaseClass -{ -public: - vrpn_FunctionGenerator( const char* name, vrpn_Connection* c = NULL ); - virtual ~vrpn_FunctionGenerator( ); - - // returns the requested channel, or null if channelNum is - // greater than the maximum number of channels. - const vrpn_FunctionGenerator_channel* getChannel( vrpn_uint32 channelNum ); - - vrpn_uint32 getNumChannels( ) const { return numChannels; } - - vrpn_float32 getSampleRate( ) - { return sampleRate; } - - enum FGError - { - NO_FG_ERROR = 0, - INTERPRETER_ERROR = 1, // the interpreter (for script) had some problem - TAKING_TOO_LONG = 2, // samples were not generated quickly enough - INVALID_RESULT_QUANTITY = 3, // an incorrect number of values was generated - INVALID_RESULT_RANGE = 4 // generated values were out of range - }; - -protected: - vrpn_float32 sampleRate; // samples per second - vrpn_uint32 numChannels; - vrpn_FunctionGenerator_channel* channels[vrpn_FUNCTION_CHANNELS_MAX]; - - vrpn_int32 channelMessageID; // id for channel message (remote -> server) - vrpn_int32 requestChannelMessageID; // id for messages requesting channel info be sent (remote -> server) - vrpn_int32 requestAllChannelsMessageID; // id for messages requesting channel info of all channels be sent (remote -> server) - vrpn_int32 sampleRateMessageID; // id for message to request a sampling rate (remote -> server) - vrpn_int32 startFunctionMessageID; // id for message to start generating the function (remote -> server) - vrpn_int32 stopFunctionMessageID; // id for message to stop generating the function (remote -> server) - vrpn_int32 requestInterpreterMessageID; // id for message to request interpreter description (remote -> server) - - vrpn_int32 channelReplyMessageID; // id for reply for channel message (server -> remote) - vrpn_int32 startFunctionReplyMessageID; // id for reply to start-function message (server -> remote) - vrpn_int32 stopFunctionReplyMessageID; // id for reply to stop-function message (server -> remote) - vrpn_int32 sampleRateReplyMessageID; // id for reply to request-sample-rate message (server -> remote) - vrpn_int32 interpreterReplyMessageID; // id for reply to request-interpreter message (server -> remote) - vrpn_int32 errorMessageID; // id for error reports - - vrpn_int32 gotConnectionMessageID; // for new-connection message - - virtual int register_types( ); - - char msgbuf[vrpn_CONNECTION_TCP_BUFLEN]; - struct timeval timestamp; -}; // end class vrpn_FunctionGenerator - - -class VRPN_API vrpn_FunctionGenerator_Server : public vrpn_FunctionGenerator -{ -public: - vrpn_FunctionGenerator_Server( const char* name, vrpn_uint32 numChannels = vrpn_FUNCTION_CHANNELS_MAX, vrpn_Connection* c = NULL ); - virtual ~vrpn_FunctionGenerator_Server( ); - - virtual void mainloop( ); - - // sub-classes should implement these functions. they will be called when messages - // are received for the particular request. at the end of these functions, servers - // should call the appropriate send*Reply function, even (especially!) if the requested - // change was rejected. - virtual void setChannel( vrpn_uint32 channelNum, vrpn_FunctionGenerator_channel* channel ) = 0; - virtual void start( ) = 0; - virtual void stop( ) = 0; - virtual void setSampleRate( vrpn_float32 rate ) = 0; - - vrpn_uint32 setNumChannels( vrpn_uint32 numChannels ); - - // sub-classes should implement this function to provide a description of the type - // of interpreter used to interpret vrpn_FunctionGenerator_function_script - virtual const char* getInterpreterDescription( ) = 0; - - // sub-classes should not override these methods; these take care of - // receiving requests - static int VRPN_CALLBACK handle_channel_message( void* userdata, vrpn_HANDLERPARAM p ); - static int VRPN_CALLBACK handle_channelRequest_message( void* userdata, vrpn_HANDLERPARAM p ); - static int VRPN_CALLBACK handle_allChannelRequest_message( void* userdata, vrpn_HANDLERPARAM p ); - static int VRPN_CALLBACK handle_start_message( void* userdata, vrpn_HANDLERPARAM p ); - static int VRPN_CALLBACK handle_stop_message( void* userdata, vrpn_HANDLERPARAM p ); - static int VRPN_CALLBACK handle_sample_rate_message( void* userdata, vrpn_HANDLERPARAM p ); - static int VRPN_CALLBACK handle_interpreter_request_message( void* userdata, vrpn_HANDLERPARAM p ); - -protected: - - // sub-classes should call these functions to inform the remote side of - // changes (or of non-changes, when a requested change cannot be accepted). - // returns 0 on success and negative on failure. - int sendChannelReply( vrpn_uint32 channelNum ); - int sendSampleRateReply( ); - int sendStartReply( vrpn_bool started ); - int sendStopReply( vrpn_bool stopped ); - int sendInterpreterDescription( ); - - // sub-classes should use this function to report an error in function generation - int sendError( FGError error, vrpn_int32 channel ); - - vrpn_int32 decode_channel( const char* buf, const vrpn_int32 len, vrpn_uint32& channelNum, - vrpn_FunctionGenerator_channel& channel ); - vrpn_int32 decode_channel_request( const char* buf, const vrpn_int32 len, vrpn_uint32& channelNum ); - vrpn_int32 decode_sampleRate_request( const char* buf, const vrpn_int32 len, vrpn_float32& sampleRate ); - - vrpn_int32 encode_channel_reply( char** buf, vrpn_int32& len, const vrpn_uint32 channelNum ); - vrpn_int32 encode_start_reply( char** buf, vrpn_int32& len, const vrpn_bool isStarted ); - vrpn_int32 encode_stop_reply( char** buf, vrpn_int32& len, const vrpn_bool isStopped ); - vrpn_int32 encode_sampleRate_reply( char** buf, vrpn_int32& len, const vrpn_float32 sampleRate ); - vrpn_int32 encode_interpreterDescription_reply( char** buf, vrpn_int32& len, const char* desc ); - vrpn_int32 encode_error_report( char** buf, vrpn_int32& len, const FGError err, const vrpn_int32 channel ); - -}; // end class vrpn_FunctionGenerator_Server - - -//---------------------------------------------------------- -// ************** Users deal with the following ************* - -// User routine to handle function-generator channel replies. This -// is called when the function-generator server replies with new -// setting for some channel. -typedef struct _vrpn_FUNCTION_CHANNEL_REPLY_CB -{ - struct timeval msg_time; // Time of the report - vrpn_uint32 channelNum; // Which channel is being reported - vrpn_FunctionGenerator_channel* channel; -} vrpn_FUNCTION_CHANNEL_REPLY_CB; -typedef void (VRPN_CALLBACK *vrpn_FUNCTION_CHANGE_REPLY_HANDLER)( void *userdata, - const vrpn_FUNCTION_CHANNEL_REPLY_CB info ); - -// User routine to handle function-generator start replies. This -// is called when the function-generator server reports that it -// has started generating functions. -typedef struct _vrpn_FUNCTION_START_REPLY_CB -{ - struct timeval msg_time; // Time of the report - vrpn_bool isStarted; // did the function generation start? -} vrpn_FUNCTION_START_REPLY_CB; -typedef void (VRPN_CALLBACK *vrpn_FUNCTION_START_REPLY_HANDLER)( void *userdata, - const vrpn_FUNCTION_START_REPLY_CB info ); - -// User routine to handle function-generator stop replies. This -// is called when the function-generator server reports that it -// has stopped generating functions. -typedef struct _vrpn_FUNCTION_STOP_REPLY_CB -{ - struct timeval msg_time; // Time of the report - vrpn_bool isStopped; // did the function generation stop? -} vrpn_FUNCTION_STOP_REPLY_CB; -typedef void (VRPN_CALLBACK *vrpn_FUNCTION_STOP_REPLY_HANDLER)( void *userdata, - const vrpn_FUNCTION_STOP_REPLY_CB info ); - -// User routine to handle function-generator sample-rate replies. -// This is called when the function-generator server reports that -// the function-generation sample rate has changed. -typedef struct _vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB -{ - struct timeval msg_time; // Time of the report - vrpn_float32 sampleRate; -} vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB; -typedef void (VRPN_CALLBACK *vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER)( void *userdata, - const vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB info ); - - -// User routine to handle function-generator interpreter-description replies. -// This is called when the function-generator server reports the description -// of its interpreter. -typedef struct _vrpn_FUNCTION_INTERPRETER_REPLY_CB -{ - struct timeval msg_time; // Time of the report - char* description; -} vrpn_FUNCTION_INTERPRETER_REPLY_CB; -typedef void (VRPN_CALLBACK *vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER)( void *userdata, - const vrpn_FUNCTION_INTERPRETER_REPLY_CB info ); - - -// User routine to handle function-generator error notifications. -// This is called when the function-generator server reports some -// error in the generation of a function. -typedef struct _vrpn_FUNCTION_ERROR_CB -{ - struct timeval msg_time; // Time of the report - vrpn_FunctionGenerator::FGError err; - vrpn_int32 channel; -} vrpn_FUNCTION_ERROR_CB; -typedef void (VRPN_CALLBACK *vrpn_FUNCTION_ERROR_HANDLER)( void *userdata, - const vrpn_FUNCTION_ERROR_CB info ); - - -class VRPN_API vrpn_FunctionGenerator_Remote : public vrpn_FunctionGenerator -{ -public: - vrpn_FunctionGenerator_Remote( const char* name, vrpn_Connection* c = NULL ); - virtual ~vrpn_FunctionGenerator_Remote( ) { } - - int setChannel( const vrpn_uint32 channelNum, const vrpn_FunctionGenerator_channel* channel ); - int requestChannel( const vrpn_uint32 channelNum ); - int requestAllChannels( ); - int requestStart( ); - int requestStop( ); - int requestSampleRate( const vrpn_float32 rate ); - int requestInterpreterDescription( ); - - virtual void mainloop( ); - - // (un)Register a callback handler to handle a channel reply - virtual int register_channel_reply_handler( void *userdata, - vrpn_FUNCTION_CHANGE_REPLY_HANDLER handler ); - virtual int unregister_channel_reply_handler( void *userdata, - vrpn_FUNCTION_CHANGE_REPLY_HANDLER handler ); - - // (un)Register a callback handler to handle a start reply - virtual int register_start_reply_handler( void *userdata, - vrpn_FUNCTION_START_REPLY_HANDLER handler ); - virtual int unregister_start_reply_handler( void *userdata, - vrpn_FUNCTION_START_REPLY_HANDLER handler ); - - // (un)Register a callback handler to handle a stop reply - virtual int register_stop_reply_handler( void *userdata, - vrpn_FUNCTION_STOP_REPLY_HANDLER handler ); - virtual int unregister_stop_reply_handler( void *userdata, - vrpn_FUNCTION_STOP_REPLY_HANDLER handler ); - - // (un)Register a callback handler to handle a sample-rate reply - virtual int register_sample_rate_reply_handler( void *userdata, - vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER handler ); - virtual int unregister_sample_rate_reply_handler( void *userdata, - vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER handler ); - - // (un)Register a callback handler to handle an interpreter message - virtual int register_interpreter_reply_handler( void *userdata, - vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER handler ); - virtual int unregister_interpreter_reply_handler( void *userdata, - vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER handler ); - - virtual int register_error_handler( void* userdata, - vrpn_FUNCTION_ERROR_HANDLER handler ); - virtual int unregister_error_handler( void* userdata, - vrpn_FUNCTION_ERROR_HANDLER handler ); - - static int VRPN_CALLBACK handle_channelReply_message( void* userdata, vrpn_HANDLERPARAM p ); - static int VRPN_CALLBACK handle_startReply_message( void* userdata, vrpn_HANDLERPARAM p ); - static int VRPN_CALLBACK handle_stopReply_message( void* userdata, vrpn_HANDLERPARAM p ); - static int VRPN_CALLBACK handle_sampleRateReply_message( void* userdata, vrpn_HANDLERPARAM p ); - static int VRPN_CALLBACK handle_interpreterReply_message( void* userdata, vrpn_HANDLERPARAM p ); - static int VRPN_CALLBACK handle_error_message( void* userdata, vrpn_HANDLERPARAM p ); - -protected: - vrpn_Callback_List<vrpn_FUNCTION_CHANNEL_REPLY_CB> channel_reply_list; - vrpn_Callback_List<vrpn_FUNCTION_START_REPLY_CB> start_reply_list; - vrpn_Callback_List<vrpn_FUNCTION_STOP_REPLY_CB> stop_reply_list; - vrpn_Callback_List<vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB> sample_rate_reply_list; - vrpn_Callback_List<vrpn_FUNCTION_INTERPRETER_REPLY_CB> interpreter_reply_list; - vrpn_Callback_List<vrpn_FUNCTION_ERROR_CB> error_list; - - - vrpn_int32 decode_channel_reply( const char* buf, const vrpn_int32 len, vrpn_uint32& channelNum ); - vrpn_int32 decode_start_reply( const char* buf, const vrpn_int32 len, vrpn_bool& isStarted ); - vrpn_int32 decode_stop_reply( const char* buf, const vrpn_int32 len, vrpn_bool& isStopped ); - vrpn_int32 decode_sampleRate_reply( const char* buf, const vrpn_int32 len ); - vrpn_int32 decode_interpreterDescription_reply( const char* buf, const vrpn_int32 len, char** desc ); - vrpn_int32 decode_error_reply( const char* buf, const vrpn_int32 len, FGError& error, vrpn_int32& channel ); - - vrpn_int32 encode_channel( char** buf, vrpn_int32& len, const vrpn_uint32 channelNum, - const vrpn_FunctionGenerator_channel* channel ); - vrpn_int32 encode_channel_request( char** buf, vrpn_int32& len, const vrpn_uint32 channelNum ); - vrpn_int32 encode_sampleRate_request( char** buf, vrpn_int32& len, const vrpn_float32 sampleRate ); - -}; // end class vrpn_FunctionGenerator_Remote - - -#endif // VRPN_FUNCTIONGENERATOR_H diff --git a/src/vrpn/vrpn_Futaba.C b/src/vrpn/vrpn_Futaba.C deleted file mode 100644 index c4539caed457c1443d852c9499cd5fe44514034b..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Futaba.C +++ /dev/null @@ -1,232 +0,0 @@ -// vrpn_Futaba.C: VRPN driver for Futaba devices - -#include <stdio.h> // for fprintf, stderr, NULL -#include <string.h> // for memset -#include <math.h> // for fabs - -#include "vrpn_Futaba.h" - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_HID) - -static const double POLL_INTERVAL = 1e+6 / 30.0; // If we have not heard, ask. - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 FUTABA_VENDOR = 0x1781; -static const vrpn_uint16 FUTABA_ELITE = 0x0e56; - -static void normalize_axis(const unsigned int value, const short deadzone, const vrpn_float64 scale, vrpn_float64& channel) { - channel = (static_cast<float>(value) - 128.0f); - if (fabs(channel) < deadzone) - { - channel = 0.0f; - } - else - { - channel /= 128.0f; - } - channel *= scale; - if (channel < -1.0) { channel = -1.0; } - if (channel > 1.0) { channel = 1.0; } -} - -static void normalize_axes(const unsigned int x, const unsigned int y, const short deadzone, const vrpn_float64 scale, vrpn_float64& channelX, vrpn_float64& channelY) { - normalize_axis(x, deadzone, scale, channelX); - normalize_axis(y, deadzone, scale, channelY); -} - -vrpn_Futaba::vrpn_Futaba(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c) - : vrpn_HidInterface(filter) - , vrpn_BaseClass(name, c) - , _filter(filter) -{ - init_hid(); -} - -vrpn_Futaba::~vrpn_Futaba(void) -{ - delete _filter; -} - -void vrpn_Futaba::init_hid(void) { - // Get notifications when clients connect and disconnect - register_autodeleted_handler(d_connection->register_message_type(vrpn_dropped_last_connection), on_last_disconnect, this); - register_autodeleted_handler(d_connection->register_message_type(vrpn_got_connection), on_connect, this); -} - -void vrpn_Futaba::on_data_received(size_t bytes, vrpn_uint8 *buffer) -{ - decodePacket(bytes, buffer); -} - -int vrpn_Futaba::on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Futaba *me = static_cast<vrpn_Futaba *>(thisPtr); - return 0; -} - -int vrpn_Futaba::on_connect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Futaba *me = static_cast<vrpn_Futaba *>(thisPtr); - return 0; -} - -vrpn_Futaba_InterLink_Elite::vrpn_Futaba_InterLink_Elite(const char *name, vrpn_Connection *c) - : vrpn_Futaba(_filter = new vrpn_HidProductAcceptor(FUTABA_VENDOR, FUTABA_ELITE), name, c) - , vrpn_Button_Filter(name, c) - , vrpn_Analog(name, c) - , vrpn_Dial(name, c) -{ - vrpn_Analog::num_channel = 5; - vrpn_Dial::num_dials = ((vrpn_Analog::num_channel == 4) ? 1 : 0); - vrpn_Button::num_buttons = 18; - - // Initialize the state of all the analogs, buttons, and dials - _lastDial = 0; - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); -} - -void vrpn_Futaba_InterLink_Elite::mainloop(void) -{ - update(); - server_mainloop(); - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, _timestamp) > POLL_INTERVAL ) { - _timestamp = current_time; - report_changes(); - - vrpn_Analog::server_mainloop(); - vrpn_Button::server_mainloop(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::server_mainloop(); - } - } -} - -void vrpn_Futaba_InterLink_Elite::report(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Futaba_InterLink_Elite::report_changes(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Futaba_InterLink_Elite::decodePacket(size_t bytes, vrpn_uint8 *buffer) { - // Decode all full reports, each of which is 8 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - // XXX Check to see that this works with HIDAPI, there may be two smaller reports. - if (bytes == 8) { - if (buffer[0] == 5) { - - // Report joystick axes as analogs - // rudder (6th byte, left joy left/right, left/right): Left 2B, center (normal) 82 (calc 84), right DC - // throttle (4th byte, left joy up/down): Up 32, (center calc 7f), down CC - normalize_axes(buffer[5], buffer[3], 5, (1.0f / 0.70f), channel[0], channel[1]); - // aileron (2nd byte, right joy left/right, roll): Left 27, center (normal) 81 (calc 7e), right D5 - // elevator (3rd byte, right joy up/down, forward/back): Up 34, center (normal) 81 (calc 81), down CF - normalize_axes(buffer[1], buffer[2], 5, (1.0f / 0.70f), channel[2], channel[3]); - - if (vrpn_Dial::num_dials > 0) { - // dial (5th byte): Ch6 00-FF - // Do the unsigned/signed conversion at the last minute so the - // signed values work properly. - dials[0] = static_cast<vrpn_int8>(buffer[4] - _lastDial) / 128.0; - // Store the current dial position for the next delta - _lastDial = buffer[4]; - } - else - { - // dial (5th byte): Ch6 Flaps Gain 00-FF - normalize_axis(buffer[4], 5, 1.0f, channel[4]); - } - - vrpn_uint8 value; - // switches (8th byte): - value = buffer[7]; - // button #0: 01 Ch5 fwd - // button #1: 02 Ch7 fwd - // button #2: 04 reset - // button #3: 08 Ch8 down - // button #4: 10 Ch8 up - // button #5: 20 <none> - // button #6: 40 menu/select - // button #7: 80 cancel - for (int btn = 0; btn < 8; btn++) { - vrpn_uint8 mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[btn] = ((value & mask) != 0); - } - - // trim switches (7th byte): it is not possible to have the odd button at the same times as the previous even button - value = buffer[6]; - // button #8: 01 aileron right - // button #9: 02 aileron left - // button #10:03 elevator up - // button #11:06 elevator down - // button #12:09 rudder right - // button #13:12 rudder left - // button #14:1B throttle up - // button #15:36 throttle down - // button #16:51 up - // button #17:a2 down - //0000 0001 1 - //0000 0010 2 - //0000 0011 3,4,5 - //0000 0110 6,7,8 - //0000 1001 9,a,b,c,d,e,f,10,11 - //0001 0010 12,13,14,15,16,17,18,19,1a - //0001 1011 1b,...,35 - //0011 0110 36,...,50 - //0101 0001 51,...,a1 - //1010 0010 a2,...,f2 - //start with highest and work down. - const vrpn_uint8 btnCount = 10; - const vrpn_uint8 btnValues[btnCount] = {0xa2, 0x51, 0x36, 0x1b, 0x12, 0x09, 0x06, 0x03, 0x02, 0x01}; - for (int i = 0; i < btnCount; i++) { - if ((value & btnValues[i]) == btnValues[i]) { - value ^= btnValues[i]; - buttons[17 - i] = 1; - } else { - buttons[17 - i] = 0; - } - } - } else { - fprintf(stderr, "vrpn_Futaba_InterLink_Elite: Unknown report = %u\n", static_cast<unsigned>(buffer[0])); - } - } else { - fprintf(stderr, "vrpn_Futaba_InterLink_Elite: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - } -} - -// End of VRPN_USE_HID -#endif diff --git a/src/vrpn/vrpn_Futaba.h b/src/vrpn/vrpn_Futaba.h deleted file mode 100644 index 971fb2f1ad827518fa392c020a21aae73277dd06..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Futaba.h +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once - -#include <stddef.h> // for size_t - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_BaseClass.h" // for vrpn_BaseClass -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_USE_HID -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Dial.h" // for vrpn_Dial -#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint8, vrpn_uint32 - -#if defined(VRPN_USE_HID) - -// Device drivers for the Futaba USB line of products -// Currently supported: InterLink Elite Controller -// -// Exposes three major VRPN device classes: Button, Analog, Dial (as appropriate). -// All models expose Buttons for the keys on the device. -// Button 0 is the programming switch; it is set if the switch is in the "red" position. -// - -class vrpn_Futaba: public vrpn_BaseClass, protected vrpn_HidInterface { -public: - vrpn_Futaba(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Futaba(void); - - virtual void mainloop(void) = 0; - -protected: - // Set up message handlers, etc. - void init_hid(void); - void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - static int VRPN_CALLBACK on_connect(void *thisPtr, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM p); - - virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer) = 0; - struct timeval _timestamp; - vrpn_HidAcceptor *_filter; - - // No actual types to register, derived classes will be buttons, analogs, and/or dials - int register_types(void) { return 0; } -}; - -class vrpn_Futaba_InterLink_Elite: protected vrpn_Futaba, public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Dial { -public: - vrpn_Futaba_InterLink_Elite(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Futaba_InterLink_Elite(void) {}; - - virtual void mainloop(void); - -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); - - // Previous dial value, used to determine delta to send when it changes. - vrpn_uint8 _lastDial; -}; - -// end of VRPN_USE_HID -#else -class VRPN_API vrpn_Futaba; -class VRPN_API vrpn_Futaba_InterLink_Elite; -#endif - diff --git a/src/vrpn/vrpn_GTK/GNUmakefile b/src/vrpn/vrpn_GTK/GNUmakefile deleted file mode 100644 index 8bb28c7502283b7ad0ab13e60ee176fe28440353..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GTK/GNUmakefile +++ /dev/null @@ -1,74 +0,0 @@ - -########################## -# common definitions. For non-UNC sites, uncomment one of the lines -# that defines hw_os for the machine you are on in the section just -# below. Then, the code should compile in your environment. -# -#HW_OS := sgi_irix -#HW_OS := pc_linux -#HW_OS := pc_linux64 -#HW_OS := pc_linux_ia64 -# Try this to cross-compile on a Linux PC for an ARM embedded controller. -#HW_OS := pc_linux_arm -# Try this to cross-compile on a Cygwin PC for an ARM embedded controller. -#HW_OS := pc_cygwin_arm -#HW_OS := pc_cygwin -#HW_OS := pc_FreeBSD -#HW_OS := sparc_solaris -#HW_OS := sparc_solaris_64 -#HW_OS := powerpc_aix -#HW_OS := powerpc_macosx -#HW_OS := universal_macosx -########################## - -########################## -# Mac OS X-specific options. If HW_OS is powerpc_macosx or universal_macosx, -# uncomment one line below to choose the minimum targeted OS X version and -# corresponding SDK. If none of the lines below is commented out, 10.5 will -# be the minimum version. -########################## -#MAC_OS_MIN_VERSION := 10.4 -#MAC_OS_MIN_VERSION := 10.5 -#MAC_OS_MIN_VERSION := 10.6 - -EXEC_NAME=vrpn_GTK -GTK_BUILDER_FILE := vrpn_GTK.xml - -CXXFLAGS := $(shell pkg-config gtk+-3.0 --cflags) -I ./ -I ../ -I ./include -I ../quat -g -DGTK_BUILDER_FILE=$(GTK_BUILDER_FILE) -LD_FLAGS := $(shell pkg-config gtk+-3.0 --libs-only-L) -L ../$(HW_OS) -L ../quat/$(HW_OS) -g -LIBSUP := $(shell pkg-config gtk+-3.0 --libs-only-l) -lvrpn -lquat - -INSTALL_DIR := /usr/local -BIN_DIR := $(INSTALL_DIR)/bin -ETC_DIR := $(INSTALL_DIR)/etc - -SRCS=main.cpp tracker_GTK.cpp analog_GTK.cpp button_GTK.cpp -OBJS=$(SRCS:%.cpp=$(HW_OS)/%.o) - -NAME = $(HW_OS)/$(EXEC_NAME) - -all: $(NAME) - -$(NAME): $(OBJS) - $(CXX) $(LD_FLAGS) -o $@ $(OBJS) $(LIBSUP) - -$(HW_OS)/%.o: %.cpp - mkdir -p $(shell dirname $@) - $(CXX) $(CXXFLAGS) -o $@ -c $< - -%.C: %.cpp - $(CXX) $(CXXFLAGS) ??? -o $@ -E $< - -clean: - rm -Rf $(HW_OS) - find . -name "*~" -delete - -depend: - @makedepend -- $(CXXFLAGS) $(SRCS) 2> /dev/null - -install: $(NAME) - -mkdir -p $(BIN_DIR) - ( cd $(BIN_DIR) ; rm -f $(EXEC_NAME) ) - ( cp $(NAME) $(BIN_DIR) ) - -mkdir -p $(ETC_DIR) - cp $(GTK_BUILDER_FILE) $(ETC_DIR) diff --git a/src/vrpn/vrpn_GTK/README.txt b/src/vrpn/vrpn_GTK/README.txt deleted file mode 100644 index 2ccca68e50e418fc252943c3e19c25903a1e8460..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GTK/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains submissions from Damien Touraine that implements a GTK interface that includes mimicking a tracker, several buttons, and analogs. This is like the Qt interface, in that it provides a server that you can design using a GUI. - diff --git a/src/vrpn/vrpn_GTK/analog_GTK.cpp b/src/vrpn/vrpn_GTK/analog_GTK.cpp deleted file mode 100644 index 349db8e820d99e84ac7f1be0ea36093e6585b1c6..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GTK/analog_GTK.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "analog_GTK.h" -#include "quat.h" -#include <iostream> -#include <vrpn_Shared.h> // for vrpn_gettimeofday - -analog_GTK::analog_GTK(vrpn_Connection *connection, const char *name, GtkBuilder *builder) : vrpn_Analog(name, connection) { - g_signal_connect (gtk_builder_get_object (builder, "analog"), "destroy", G_CALLBACK (gtk_main_quit), NULL); - - GtkAdjustment *analog = NULL; - unsigned int index = 1; - do { - char name[128]; - sprintf(name, "v analog %d", index); - analog = GTK_ADJUSTMENT(gtk_builder_get_object (builder, name)); - if (analog) { - d_analogs.push_back(analog); - g_signal_connect (analog, "value-changed", G_CALLBACK (analog_cb), this); - } - index ++; - } while (analog != NULL); - - num_channel = d_analogs.size(); - - for(unsigned int i = 0; i < num_channel; i++) { - channel[i] = last[i] = 0; - } -} - -void analog_GTK::analog_cb(GtkAdjustment *analog, analog_GTK *obj) { - vrpn_gettimeofday( &obj->timestamp, NULL ); - - for (unsigned int i = 0 ; i < obj->d_analogs.size() ; i++) { - if (obj->d_analogs[i] == analog) { - obj->channel[i] = gtk_adjustment_get_value(analog); - } - } - obj->mainloop(); -} - -void analog_GTK::mainloop () { - server_mainloop(); - - report_changes(); -} diff --git a/src/vrpn/vrpn_GTK/button_GTK.cpp b/src/vrpn/vrpn_GTK/button_GTK.cpp deleted file mode 100644 index 16bd84f217039244b87c92cdfa9b54f87aab52b8..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GTK/button_GTK.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "button_GTK.h" -#include "quat.h" -#include <iostream> -#include <vrpn_Shared.h> // for vrpn_gettimeofday - -button_GTK::button_GTK(vrpn_Connection *connection, const char *name, GtkBuilder *builder) : vrpn_Button(name, connection) { - g_signal_connect (gtk_builder_get_object (builder, "button"), "destroy", G_CALLBACK (gtk_main_quit), NULL); - - GtkToggleButton *button = NULL; - unsigned int index = 1; - do { - char name[128]; - sprintf(name, "button %d", index); - button = GTK_TOGGLE_BUTTON(gtk_builder_get_object (builder, name)); - if (button) { - d_buttons.push_back(button); - g_signal_connect (button, "clicked", G_CALLBACK (button_cb), this); - } - index ++; - } while (button != NULL); - - num_buttons = d_buttons.size(); - - for(unsigned int i = 0; i < num_buttons; i++) { - buttons[i] = lastbuttons[i] = 0; - } -} - -void button_GTK::button_cb(GtkToggleButton *button, button_GTK *obj) { - vrpn_gettimeofday( &obj->timestamp, NULL ); - - for (unsigned int i = 0 ; i < obj->d_buttons.size() ; i++) { - if (obj->d_buttons[i] == button) { - obj->buttons[i] = (gtk_toggle_button_get_active (button) ? 1 : 0); - } - } - obj->mainloop(); -} - -void button_GTK::mainloop () { - server_mainloop(); - - report_changes(); -} diff --git a/src/vrpn/vrpn_GTK/essai.py b/src/vrpn/vrpn_GTK/essai.py deleted file mode 100644 index 80c184c40f5990779440fe85c20f0646f43a0774..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GTK/essai.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/python3.2 - -import vrpn - -def callback(userdata, data): - print(userdata, " => ", data); - -tracker=vrpn.receiver.Tracker("GTK@localhost") -tracker.register_change_handler("tracker", callback, "position") -analog=vrpn.receiver.Analog("GTK@localhost") -analog.register_change_handler("analog", callback) -button=vrpn.receiver.Button("GTK@localhost") -button.register_change_handler("button", callback) - -while 1: - tracker.mainloop() - analog.mainloop() - button.mainloop() - -#del(essai) diff --git a/src/vrpn/vrpn_GTK/include/analog_GTK.h b/src/vrpn/vrpn_GTK/include/analog_GTK.h deleted file mode 100644 index 43d1488eb1635907793bac389af4e4cd88fedaaf..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GTK/include/analog_GTK.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef ANALOG_GTK_H -#define ANALOG_GTK_H - -#include <vrpn_Analog.h> -#include <gtk/gtk.h> -#include <vector> - -class analog_GTK : public vrpn_Analog { - - virtual void mainloop (); - - std::vector<GtkAdjustment *> d_analogs; - - static void analog_cb(GtkAdjustment *button, analog_GTK *obj); - - public: - analog_GTK(vrpn_Connection *connection, const char *name, GtkBuilder *builder); -}; - -#endif // defined(ANALOG_GTK_H) diff --git a/src/vrpn/vrpn_GTK/include/button_GTK.h b/src/vrpn/vrpn_GTK/include/button_GTK.h deleted file mode 100644 index 474a774bb32511c3e691037db435f941d671f667..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GTK/include/button_GTK.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef BUTTON_GTK_H -#define BUTTON_GTK_H - -#include <vrpn_Button.h> -#include <gtk/gtk.h> -#include <vector> - -class button_GTK : public vrpn_Button { - - virtual void mainloop (); - std::vector<GtkToggleButton *> d_buttons; - - static void button_cb(GtkToggleButton *button, button_GTK *obj); - - public: - button_GTK(vrpn_Connection *connection, const char *name, GtkBuilder *builder); -}; - -#endif // defined(BUTTON_GTK_H) diff --git a/src/vrpn/vrpn_GTK/include/tracker_GTK.h b/src/vrpn/vrpn_GTK/include/tracker_GTK.h deleted file mode 100644 index 7939539607808654594214794cb5f4d6516ef129..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GTK/include/tracker_GTK.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef TRACKER_GTK_H -#define TRACKER_GTK_H - -#include <vrpn_Tracker.h> -#include <gtk/gtk.h> - -class tracker_GTK : public vrpn_Tracker { - GtkComboBox * d_frequency_box; - GtkTreeModel * d_frequency_model; - GtkAdjustment *d_sensors; - GtkAdjustment *d_positionAdjustment[3]; - GtkAdjustment *d_orientationAdjustment[3]; - - float **d_positions; - float **d_orientations; - - bool d_sendValues; - - timespec d_previous; - - virtual void mainloop (); - - gboolean idle(); - static gboolean idle_cb(gpointer data); - - void sensors(unsigned int newSensor); - static void sensors_cb(GtkAdjustment *widget, tracker_GTK *obj); - - static void reset_cb(GtkWidget *widget, tracker_GTK *obj); - static void adjustments_cb(GtkAdjustment *widget, tracker_GTK *obj); - - void setPositionRange(float min, float max, GtkAdjustment *component); - - public: - tracker_GTK(vrpn_Connection *connection, const char *name, GtkBuilder *builder, unsigned int numberSensors = UINT_MAX); - void setPositionRange(float min, float max, char component = ' '); -}; - -#endif // defined(TRACKER_GTK_H) diff --git a/src/vrpn/vrpn_GTK/main.cpp b/src/vrpn/vrpn_GTK/main.cpp deleted file mode 100644 index 5de3ca5532477fdddced52c91860cdf8d39ca6dd..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GTK/main.cpp +++ /dev/null @@ -1,91 +0,0 @@ -#include <gtk/gtk.h> -#include <iostream> -#include <time.h> -#include <unistd.h> -#include <vrpn_Tracker.h> -#include <string.h> -#include "tracker_GTK.h" -#include "button_GTK.h" -#include "analog_GTK.h" - -#define Q(x) #x -#define QUOTE(x) Q(x) - -#ifndef GTK_BUILDER_FILE -# define GTK_BUILDER_FILE vrpn_GTK.xml -#endif - -const char usage[] = " [-serverName name] [-vrpnPort portNumber] [-numberSensors numberSensors] [-min_max min_max_values]"; - -int main (int argc, char *argv[]) { - const char* name = "GTK"; - int port = vrpn_DEFAULT_LISTEN_PORT_NO; - int numberSensors = UINT_MAX; - float min_position = -3.0; - float max_position = 3.0; - - for (int i = 1; i < argc; i++) { - if (strcmp(argv[i], "-serverName") == 0) { - name = argv[++i]; - } else if (strcmp(argv[i], "-vrpnPort") == 0) { - char *endptr; - port = strtol(argv[++i], &endptr, 0); - if ((*endptr) != '\0') { - std::cout << "Error parsing command line.\n" << "Usage: " << argv[0] << usage << std::endl; - port = vrpn_DEFAULT_LISTEN_PORT_NO; - } - //port = QString(argv[++i]).toInt(); - } else if (strcmp(argv[i], "-numberSensors") == 0) { - char *endptr; - numberSensors = strtol(argv[++i], &endptr, 0); - if ((*endptr) != '\0') { - std::cout << "Error parsing command line.\n" << "Usage: " << argv[0] << usage << std::endl; - numberSensors = UINT_MAX; - } - //port = QString(argv[++i]).toInt(); - } else if (strcmp(argv[i], "-min_max") == 0) { - char *endptr; - float value = strtod(argv[++i], &endptr); - if ((*endptr) != '\0') { - std::cout << "Error parsing command line.\n" << "Usage: " << argv[0] << usage << std::endl; - } else { - if (value > 0) { - max_position = value; - min_position = -value; - } else { - min_position = value; - max_position = -value; - } - } - //port = QString(argv[++i]).toInt(); - } else { - std::cout << "Error parsing command line.\n" << "Usage: " << argv[0] << usage << std::endl; - } - } - - vrpn_Connection* connection = vrpn_create_server_connection(port); - - gtk_init (&argc, &argv); - - setlocale(LC_NUMERIC,"C"); // GTK update "locales" ... - - /* Construct a GtkBuilder instance and load our UI description */ - GtkBuilder *builder = gtk_builder_new (); - GError *p_err = NULL; - gtk_builder_add_from_file (builder, QUOTE(GTK_BUILDER_FILE) , &p_err); - - if (p_err != NULL) { - std::cerr << "GTK error : " << p_err->message << std::endl; - return -1; - } - - /* Connect signal handlers to the constructed widgets. */ - tracker_GTK tracker(connection, name, builder, numberSensors); - tracker.setPositionRange(min_position, max_position, ' '); - button_GTK button(connection, name, builder); - analog_GTK analog(connection, name, builder); - - gtk_main (); - - return 0; -} diff --git a/src/vrpn/vrpn_GTK/tracker_GTK.cpp b/src/vrpn/vrpn_GTK/tracker_GTK.cpp deleted file mode 100644 index c00440fd70b2565301e6edc65ed139f63985fcda..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GTK/tracker_GTK.cpp +++ /dev/null @@ -1,199 +0,0 @@ -#include "tracker_GTK.h" -#include "quat.h" -#include <iostream> - -tracker_GTK::tracker_GTK(vrpn_Connection *connection, const char *name, GtkBuilder *builder, unsigned int numberSensors) : vrpn_Tracker(name, connection) { - g_signal_connect (gtk_builder_get_object (builder, "tracker"), "destroy", G_CALLBACK (gtk_main_quit), NULL); - - d_previous.tv_sec = 0; - d_previous.tv_nsec = 0; - - d_sensors = GTK_ADJUSTMENT(gtk_builder_get_object (builder, "target")); - g_signal_connect (d_sensors, "value-changed", G_CALLBACK (sensors_cb), this); - - d_frequency_box = GTK_COMBO_BOX(gtk_builder_get_object (builder, "Frequency box")); - d_frequency_model = gtk_combo_box_get_model (d_frequency_box); - - d_positionAdjustment[0] = GTK_ADJUSTMENT(gtk_builder_get_object (builder, "x position")); - d_positionAdjustment[1] = GTK_ADJUSTMENT(gtk_builder_get_object (builder, "y position")); - d_positionAdjustment[2] = GTK_ADJUSTMENT(gtk_builder_get_object (builder, "z position")); - - d_orientationAdjustment[0] = GTK_ADJUSTMENT(gtk_builder_get_object (builder, "x orientation")); - d_orientationAdjustment[1] = GTK_ADJUSTMENT(gtk_builder_get_object (builder, "y orientation")); - d_orientationAdjustment[2] = GTK_ADJUSTMENT(gtk_builder_get_object (builder, "z orientation")); - - for (unsigned int i = 0 ; i < 3 ; i++) { - g_signal_connect (d_positionAdjustment[i], "value-changed", G_CALLBACK (adjustments_cb), this); - g_signal_connect (d_orientationAdjustment[i], "value-changed", G_CALLBACK (adjustments_cb), this); - } - - gtk_adjustment_set_lower(d_sensors, 0); - if (numberSensors < UINT_MAX) { - num_sensors = numberSensors; - gtk_adjustment_set_upper(d_sensors, num_sensors); - } else { - num_sensors = gtk_adjustment_get_upper(d_sensors); - } - - d_positions = (float**) malloc(num_sensors * sizeof(float*)); - d_orientations = (float**) malloc(num_sensors * sizeof(float*)); - for (unsigned int i = 0 ; i < num_sensors ; i ++) { - d_positions[i] = (float*)malloc(3 * sizeof(float)); - d_orientations[i] = (float*)malloc(3 * sizeof(float)); - for (unsigned int j = 0 ; j < 3 ; j++) { - d_positions [i][j] = 0; - d_orientations[i][j] = 0; - } - } - - g_idle_add(idle_cb, this); - - g_signal_connect (gtk_builder_get_object (builder, "reset"), "clicked", G_CALLBACK (reset_cb), this); - - - - d_sendValues = false; - - setPositionRange(-3.0, 3.0, ' '); - - register_server_handlers(); - -} - -void tracker_GTK::setPositionRange(float min, float max, GtkAdjustment *component) { - gtk_adjustment_set_lower(component, min); - gtk_adjustment_set_upper(component, max); - - for (unsigned int i = 0 ; i < 3 ; i++) { - workspace_min[i] = min; - workspace_max[i] = max; - } -} - -void tracker_GTK::setPositionRange(float min, float max, char component) { - switch (component) { - case 'x' : setPositionRange(min, max, d_positionAdjustment[0]); break; - case 'y' : setPositionRange(min, max, d_positionAdjustment[1]); break; - case 'z' : setPositionRange(min, max, d_positionAdjustment[2]); break; - default: - setPositionRange(min, max, d_positionAdjustment[0]); - setPositionRange(min, max, d_positionAdjustment[1]); - setPositionRange(min, max, d_positionAdjustment[2]); - break; - } -} - -void tracker_GTK::sensors(unsigned int newSensor) { - for (unsigned int i = 0 ; i < 3 ; i++) { - gtk_adjustment_set_value(d_positionAdjustment[i], d_positions[newSensor][i]); - gtk_adjustment_set_value(d_orientationAdjustment[i], d_orientations[newSensor][i]); - } -} - -gboolean tracker_GTK::idle() { - GtkTreeIter iter; - - if (gtk_combo_box_get_active_iter (d_frequency_box, & iter)) { - gfloat freq; - gtk_tree_model_get (d_frequency_model, & iter, 1, &freq, -1); - - - if (freq != 0) { - long long int period = (long long int)(1000.0 / freq); // In millisecond - struct timespec current; - clock_gettime(CLOCK_PROCESS_CPUTIME_ID, ¤t); - current.tv_nsec /= 1000000; // Transform tv_nsec to millisecond ! - - unsigned long long int delta = (current.tv_sec - d_previous.tv_sec) * 1000 + current.tv_nsec - d_previous.tv_nsec; - - if (delta > period) { - d_sendValues = true; - d_previous.tv_sec = current.tv_sec; - d_previous.tv_nsec = current.tv_nsec; - } - } - } - - mainloop(); - - return true; -} - -void tracker_GTK::reset_cb(GtkWidget *widget, tracker_GTK *obj) { - unsigned int sensor = gtk_adjustment_get_value(obj->d_sensors); - if (sensor < obj->num_sensors) { - for (unsigned int i = 0 ; i < 3 ; i++) { - obj->d_positions[sensor][i] = 0.0; - obj->d_orientations[sensor][i] = 0.0; - } - obj->sensors(sensor); - } -} - -void tracker_GTK::sensors_cb(GtkAdjustment *widget, tracker_GTK *obj) { - unsigned int newSensor = gtk_adjustment_get_value(widget); - if (newSensor < obj->num_sensors) { - obj->sensors(newSensor); - } -} - -void tracker_GTK::adjustments_cb(GtkAdjustment *widget, tracker_GTK *obj) { - unsigned int currentSensor = gtk_adjustment_get_value(obj->d_sensors); - for (unsigned int i = 0 ; i < 3 ; i++) { - if (obj->d_positionAdjustment[i] == widget) { - obj->d_positions[currentSensor][i] = gtk_adjustment_get_value(widget); - break; - } - if (obj->d_orientationAdjustment[i] == widget) { - obj->d_orientations[currentSensor][i] = gtk_adjustment_get_value(widget); - break; - } - } -} - -gboolean tracker_GTK::idle_cb(gpointer data) { - return ((tracker_GTK*)data)->idle(); -} - -void tracker_GTK::mainloop () { - d_connection->mainloop(); - - server_mainloop(); - - if (d_sendValues) { - - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - - char msgbuf[1000]; - unsigned int len; - for (unsigned int i = 0 ; i < num_sensors ; i++) { - d_sensor = i; - - q_from_euler (d_quat, d_orientations[i][2], d_orientations[i][1], d_orientations[i][0]); - - for (unsigned int j = 0 ; j < 3 ; j++) { - pos[j] = d_positions[i][j]; - } - - // Même chose pour les quaternions ! - - // Pack position report - len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, - position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"NULL tracker: can't write message: tossing\n"); - } - } - } - - d_sendValues = false; - - // Send updates - //vrpn_Tracker::report_changes(); -} diff --git a/src/vrpn/vrpn_GTK/vrpn_GTK.xml b/src/vrpn/vrpn_GTK/vrpn_GTK.xml deleted file mode 100644 index cc549c387a9c1bf5b1af76e6a3526f7582652f68..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GTK/vrpn_GTK.xml +++ /dev/null @@ -1,615 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<interface> - <!-- interface-requires gtk+ 3.0 --> - <object class="GtkListStore" id="Frequencies"> - <columns> - <!-- column-name Display --> - <column type="gchararray"/> - <!-- column-name Frequency --> - <column type="gfloat"/> - </columns> - <data> - <row> - <col id="0" translatable="yes">Stop</col> - <col id="1">0</col> - </row> - <row> - <col id="0">0,5 Hz</col> - <col id="1">0.5</col> - </row> - <row> - <col id="0">1 Hz</col> - <col id="1">1</col> - </row> - <row> - <col id="0">10 Hz</col> - <col id="1">10</col> - </row> - <row> - <col id="0">20 Hz</col> - <col id="1">20</col> - </row> - <row> - <col id="0">50 Hz</col> - <col id="1">50</col> - </row> - <row> - <col id="0">100 Hz</col> - <col id="1">100</col> - </row> - <row> - <col id="0">200 Hz</col> - <col id="1">200</col> - </row> - <row> - <col id="0">500 Hz</col> - <col id="1">500</col> - </row> - </data> - </object> - <object class="GtkWindow" id="analog"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="title" translatable="yes">Analog</property> - <child> - <object class="GtkBox" id="box3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="homogeneous">True</property> - <child> - <object class="GtkScale" id="analog 1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">v analog 1</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkScale" id="analog 2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">v analog 2</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkScale" id="analog 3"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">v analog 3</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkScale" id="analog 4"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">v analog 4</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkScale" id="analog 5"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">v analog 5</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">4</property> - </packing> - </child> - <child> - <object class="GtkScale" id="analog 6"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">v analog 6</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">5</property> - </packing> - </child> - <child> - <object class="GtkScale" id="analog 7"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">v analog 7</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">6</property> - </packing> - </child> - <child> - <object class="GtkScale" id="analog 8"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">v analog 8</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">7</property> - </packing> - </child> - <child> - <object class="GtkScale" id="analog 9"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">v analog 9</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">8</property> - </packing> - </child> - </object> - </child> - </object> - <object class="GtkWindow" id="button"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="title" translatable="yes">Button</property> - <child> - <object class="GtkGrid" id="grid1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_homogeneous">True</property> - <property name="column_homogeneous">True</property> - <child> - <object class="GtkToggleButton" id="button 1"> - <property name="label" translatable="yes">Button 1</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkToggleButton" id="button 2"> - <property name="label" translatable="yes">Button 2</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkToggleButton" id="button 3"> - <property name="label" translatable="yes">Button 3</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkToggleButton" id="button 4"> - <property name="label" translatable="yes">Button 4</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkToggleButton" id="button 5"> - <property name="label" translatable="yes">Button 5</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkToggleButton" id="button 6"> - <property name="label" translatable="yes">Button 6</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkToggleButton" id="button 7"> - <property name="label" translatable="yes">Button 7</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkToggleButton" id="button 8"> - <property name="label" translatable="yes">Button 8</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkToggleButton" id="button 9"> - <property name="label" translatable="yes">Button 9</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - </object> - </child> - </object> - <object class="GtkAdjustment" id="target"> - <property name="upper">10</property> - <property name="step_increment">1</property> - <property name="page_increment">1</property> - </object> - <object class="GtkWindow" id="tracker"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="title" translatable="yes">Tracker</property> - <child> - <object class="GtkBox" id="box1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="homogeneous">True</property> - <child> - <object class="GtkBox" id="box2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Frequency:</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkComboBox" id="Frequency box"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="model">Frequencies</property> - <property name="has_entry">True</property> - <property name="entry_text_column">0</property> - <property name="id_column">1</property> - <child internal-child="entry"> - <object class="GtkEntry" id="combobox-entry"> - <property name="can_focus">False</property> - <property name="invisible_char">â—</property> - </object> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkButton" id="reset"> - <property name="label" translatable="yes">Reset the values</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_action_appearance">False</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Sensor number:</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="spinbutton1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">â—</property> - <property name="invisible_char_set">True</property> - <property name="adjustment">target</property> - <property name="numeric">True</property> - <property name="wrap">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">4</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkScale" id="scale1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">x position</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkScale" id="scale2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">y position</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkScale" id="scale3"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">z position</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkScale" id="scale4"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">x orientation</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">4</property> - </packing> - </child> - <child> - <object class="GtkScale" id="scale5"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">y orientation</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">5</property> - </packing> - </child> - <child> - <object class="GtkScale" id="scale6"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">z orientation</property> - <property name="round_digits">1</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">6</property> - </packing> - </child> - </object> - </child> - </object> - <object class="GtkAdjustment" id="v analog 1"> - <property name="lower">-1</property> - <property name="upper">1</property> - <property name="step_increment">1</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="v analog 2"> - <property name="lower">-1</property> - <property name="upper">1</property> - <property name="step_increment">1</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="v analog 3"> - <property name="lower">-1</property> - <property name="upper">1</property> - <property name="step_increment">1</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="v analog 4"> - <property name="lower">-1</property> - <property name="upper">1</property> - <property name="step_increment">1</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="v analog 5"> - <property name="lower">-1</property> - <property name="upper">1</property> - <property name="step_increment">1</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="v analog 6"> - <property name="lower">-1</property> - <property name="upper">1</property> - <property name="step_increment">1</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="v analog 7"> - <property name="lower">-1</property> - <property name="upper">1</property> - <property name="step_increment">1</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="v analog 8"> - <property name="lower">-1</property> - <property name="upper">1</property> - <property name="step_increment">1</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="v analog 9"> - <property name="lower">-1</property> - <property name="upper">1</property> - <property name="step_increment">1</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="x orientation"> - <property name="lower">-3.1415926000000001</property> - <property name="upper">3.1415926000000001</property> - <property name="step_increment">0.10000000000000001</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="x position"> - <property name="lower">-3</property> - <property name="upper">3</property> - <property name="step_increment">0.10000000000000001</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="y orientation"> - <property name="lower">-3.1415926000000001</property> - <property name="upper">3.1415926000000001</property> - <property name="step_increment">0.10000000000000001</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="y position"> - <property name="lower">-3</property> - <property name="upper">3</property> - <property name="step_increment">0.10000000000000001</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="z orientation"> - <property name="lower">-3.1415926000000001</property> - <property name="upper">3.1415926000000001</property> - <property name="step_increment">0.10000000000000001</property> - <property name="page_increment">1</property> - </object> - <object class="GtkAdjustment" id="z position"> - <property name="lower">-3</property> - <property name="upper">3</property> - <property name="step_increment">0.10000000000000001</property> - <property name="page_increment">1</property> - </object> -</interface> diff --git a/src/vrpn/vrpn_GTK/vrpn_Tracker.cfg b/src/vrpn/vrpn_GTK/vrpn_Tracker.cfg deleted file mode 100644 index 4cef6d6928a6ca352e62548a4ccd827260f7aad9..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GTK/vrpn_Tracker.cfg +++ /dev/null @@ -1,17 +0,0 @@ -GTK -0.0 -1.6 0.0 #17.0 25.6 152.0 # Room position -0.5 0.5 0.5 0.5 # Room orientation --3.0 -3.0 -3.0 3.0 3.0 1.0 # Room min and max position -4 # Number of sensors -0 # Sensor number 0 -0.0 0.0 0.0 # Its position -0.0 0.0 0.0 1.0 # Its orientation -1 # ... -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -2 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 -3 -0.0 0.0 0.0 -0.0 0.0 0.0 1.0 diff --git a/src/vrpn/vrpn_GlobalHapticsOrb.C b/src/vrpn/vrpn_GlobalHapticsOrb.C deleted file mode 100644 index 8625db5d9f23181f4d9f98aba6d6d3eb41f7e466..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GlobalHapticsOrb.C +++ /dev/null @@ -1,352 +0,0 @@ -// vrpn_GlobalHapticsOrb.C -// This is a driver for the Global Haptics "Orb" device. -// This box is a serial-line device that provides a sphere -// with many buttons, a trackball, and a spinning valuator that -// is treated here as a dial. -// This code is based on their driver code, which they -// sent to Russ Taylor to help get a public-domain driver -// written for the device. - -#include <stdio.h> // for perror, sprintf - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR -#include "vrpn_GlobalHapticsOrb.h" -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday - -#undef VERBOSE - -static const double POLL_INTERVAL = 5e+6; // If we haven't heard, ask. -static const double TIMEOUT_INTERVAL = 10e+6; // If we haven't heard, complain. - -static const double REV_PER_TICK_WHEEL = 1.0/15; // How many revolutions per encoder tick (checked) -static const double REV_PER_TICK_BALL = 1.0/164; // How many revolutions per encoder tick (guess) - -static const unsigned char reset_char = 0x81; // Reset string sent to Orb - -// Defines the modes in which the box can find itself. -#define STATUS_RESETTING (-1) // Resetting the box -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report - -// static -int vrpn_GlobalHapticsOrb::handle_firstConnection(void * userdata, - vrpn_HANDLERPARAM) -{ - ((vrpn_GlobalHapticsOrb *) userdata)->clear_values(); - - // Always return 0 here, because nonzero return means that the input data - // was garbage, not that there was an error. If we return nonzero from a - // vrpn_Connection handler, it shuts down the connection. - return 0; -} - - -// This creates a vrpn_GlobalHapticsOrb and sets it to reset mode. It opens -// the serial device using the code in the vrpn_Serial_Analog constructor. -vrpn_GlobalHapticsOrb::vrpn_GlobalHapticsOrb(const char * name, vrpn_Connection * c, - const char * port, int baud) : - vrpn_Serial_Analog(name, c, port, baud), - vrpn_Button_Filter(name, c), - vrpn_Dial(name, c) -{ - // Set the parameters in the parent classes - vrpn_Button::num_buttons = 30; - vrpn_Analog::num_channel = 3; - vrpn_Dial::num_dials = 3; - - // Set the status of the buttons, analogs and encoders to 0 to start - clear_values(); - - // Set a callback handler for when the first connection is made so - // that it can reset the analogs and buttons whenever this happens. - register_autodeleted_handler( - d_connection->register_message_type(vrpn_got_first_connection), - handle_firstConnection, this); - - // Set the mode to reset - d_status = STATUS_RESETTING; -} - -void vrpn_GlobalHapticsOrb::clear_values(void) -{ - int i; - - for (i = 0; i < num_buttons; i++) { - vrpn_Button::buttons[i] = vrpn_Button::lastbuttons[i] = 0; - } - for (i = 0; i < num_channel; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } - for (i = 0; i < num_dials; i++) { - vrpn_Dial::dials[i] = 0.0; - } -} - -// This routine will reset the GlobalHapticsOrb. It verifies that it can -// communicate with the device by sending it the "enter direct mode" -// command (0x81) and waiting for it to respond with the single-byte -// message 0xFC. - -int vrpn_GlobalHapticsOrb::reset(void) -{ - struct timeval timeout; - unsigned char inbuf[1]; // Response from the Orb - int ret; - - //----------------------------------------------------------------------- - // Set the values back to zero for all buttons, analogs and encoders - clear_values(); - - //----------------------------------------------------------------------- - // Clear the input buffer to make sure we're starting with a clean slate. - // Send the "reset" command to the box, then wait for a response and - // make sure it matches what we expect. - vrpn_flush_input_buffer(serial_fd); - vrpn_write_characters(serial_fd, &reset_char, 1); - timeout.tv_sec = 2; - timeout.tv_usec = 0; - ret = vrpn_read_available_characters(serial_fd, inbuf, 1, &timeout); - if (ret < 0) { - perror("vrpn_GlobalHapticsOrb::reset(): Error reading from Orb\n"); - return -1; - } - if (ret == 0) { - send_text_message("vrpn_GlobalHapticsOrb::reset(): No response from Orb", d_timestamp, vrpn_TEXT_ERROR); - return -1; - } - if (inbuf[0] != 0xfc) { - char message[1024]; - sprintf(message, "vrpn_GlobalHapticsOrb::reset(): Bad response from Orb (%02X)", inbuf[0]); - send_text_message(message, d_timestamp, vrpn_TEXT_ERROR); - return -1; - } - - //----------------------------------------------------------------------- - // Figure out how many characters to expect in each report from the device, - // which is just 1 for the Orb. - d_expected_chars = 1; - - vrpn_gettimeofday(&d_timestamp, NULL); // Set watchdog now - - send_text_message("vrpn_GlobalHapticsOrb::reset(): Reset complete (this is good)", d_timestamp, vrpn_TEXT_ERROR); - - // Set the mode to synchronizing - d_status = STATUS_SYNCING; - return 0; -} - -// See if we have a report from the Orb. Each report is one character. There -// are separate characters for button up and button down for each button, and -// for the rocker switches. There are separate characters for left and right -// for the thumbwheel going left one tick and right one tick. There are -// separate characters for north, south, east, and west for the trackball. -// There are also a bunch of characters that are supposed to be ignored when -// they come. Previous versions of the Orb didn't send the release messages. -// The routine that calls this one -// makes sure we get a full reading often enough (ie, it is responsible -// for doing the watchdog timing to make sure the box hasn't simply -// stopped sending characters). -// Returns 1 if got a complete report, 0 otherwise. - -int vrpn_GlobalHapticsOrb::get_report(void) -{ - //-------------------------------------------------------------------- - // The reports are each _expected_chars characters long (for the Orb, - // this is only one character so it is not very exciting. - //-------------------------------------------------------------------- - - if (d_status == STATUS_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, d_buffer, 1) != 1) { - return 0; - } - - d_bufcount = 1; - vrpn_gettimeofday(&d_timestamp, NULL); - - // Respond to the command, ignore it, or throw an error if it is - // one we don't know how to deal with. - switch (d_buffer[0]) { - // Button press and release codes for buttons 0 through 25 - case 0x89: buttons[0] = 1; break; case 0xb9: buttons[0] = 0; break; - case 0x88: buttons[1] = 1; break; case 0xb8: buttons[1] = 0; break; - case 0x90: buttons[2] = 1; break; case 0xc0: buttons[2] = 0; break; - case 0x8e: buttons[3] = 1; break; case 0xbe: buttons[3] = 0; break; - case 0x8d: buttons[4] = 1; break; case 0xbd: buttons[4] = 0; break; - case 0x8c: buttons[5] = 1; break; case 0xbc: buttons[5] = 0; break; - case 0x8b: buttons[6] = 1; break; case 0xbb: buttons[6] = 0; break; - case 0x8a: buttons[7] = 1; break; case 0xba: buttons[7] = 0; break; - case 0x9b: buttons[8] = 1; break; case 0xcb: buttons[8] = 0; break; - case 0x9a: buttons[9] = 1; break; case 0xca: buttons[9] = 0; break; - case 0x99: buttons[10] = 1; break; case 0xc9: buttons[10] = 0; break; - case 0x98: buttons[11] = 1; break; case 0xc8: buttons[11] = 0; break; - case 0x9f: buttons[12] = 1; break; case 0xcf: buttons[12] = 0; break; - case 0x9e: buttons[13] = 1; break; case 0xce: buttons[13] = 0; break; - case 0x9d: buttons[14] = 1; break; case 0xcd: buttons[14] = 0; break; - case 0x9c: buttons[15] = 1; break; case 0xcc: buttons[15] = 0; break; - case 0x81: buttons[16] = 1; break; case 0xb1: buttons[16] = 0; break; - case 0x80: buttons[17] = 1; break; case 0xb0: buttons[17] = 0; break; - case 0x8f: buttons[18] = 1; break; case 0xbf: buttons[18] = 0; break; - case 0x86: buttons[19] = 1; break; case 0xb6: buttons[19] = 0; break; - case 0x85: buttons[20] = 1; break; case 0xb5: buttons[20] = 0; break; - case 0x84: buttons[21] = 1; break; case 0xb4: buttons[21] = 0; break; - case 0x83: buttons[22] = 1; break; case 0xb3: buttons[22] = 0; break; - case 0x82: buttons[23] = 1; break; case 0xb2: buttons[23] = 0; break; - case 0xa0: buttons[24] = 1; break; case 0xd0: buttons[24] = 0; break; - case 0x87: buttons[25] = 1; break; case 0xb7: buttons[25] = 0; break; - - // Pushbuttons are mapped as buttons 26 (left) and 27 (right) - case 0xa1: buttons[26] = 1; break; case 0xd1: buttons[26] = 0; break; - case 0xa2: buttons[27] = 1; break; case 0xd2: buttons[27] = 0; break; - - // Rocker up is mapped as buttons 28; rocker down is button 29 - case 0x92: buttons[28] = 1; break; case 0xc2: buttons[28] = 0; break; - case 0x91: buttons[29] = 1; break; case 0xc1: buttons[29] = 0; break; - - // Thumbwheel left is negative, right is positive for dial 0. - // Increment/decrement by the number revolutions per tick to - // turn it into a dial value. - case 0xE1: - dials[0] -= REV_PER_TICK_WHEEL; - channel[0] -= REV_PER_TICK_WHEEL; - if (channel[0] < -1.0) { channel[0] = -1.0; }; - break; - case 0xE0: - dials[0] += REV_PER_TICK_WHEEL; - channel[0] += REV_PER_TICK_WHEEL; - if (channel[0] > 1.0) { channel[0] = 1.0; }; - break; - - // Trackball is two analogs and two dials: analog/dial 1 - // is positive for north and negative for south. - // Analog/dial 2 is positive for east and - // negative for west. Increment/decrement by the number of - // revolutions per tick for the trackball. - case 0xF2: - dials[1] += REV_PER_TICK_BALL; - channel[1] += REV_PER_TICK_BALL; - if (channel[1] > 1.0) { channel[1] = 1.0; }; - break; - case 0xF3: - dials[1] -= REV_PER_TICK_BALL; - channel[1] -= REV_PER_TICK_BALL; - if (channel[1] < -1.0) { channel[1] = -1.0; }; - break; - case 0xF0: - dials[2] += REV_PER_TICK_BALL; - channel[2] += REV_PER_TICK_BALL; - if (channel[2] > 1.0) { channel[2] = 1.0; }; - break; - case 0xF1: - dials[2] -= REV_PER_TICK_BALL; - channel[2] -= REV_PER_TICK_BALL; - if (channel[2] < -1.0) { channel[2] = -1.0; }; - break; - - // There are several commands that are marked as "to be ignored." - case 0xfd: - case 0x00: - case 0xfe: - case 0x10: - case 0xfb: - case 0xfc: - return 1; // We got a report, we're just not doing anything about it. - - default: - send_text_message("vrpn_GlobalHapticsOrb::get_report(): Unknown character", d_timestamp, vrpn_TEXT_ERROR); - d_status = STATUS_RESETTING; - return 0; - } - } else { - send_text_message("vrpn_GlobalHapticsOrb::get_report(): Unknown mode, programming error.", d_timestamp, vrpn_TEXT_ERROR); - d_status = STATUS_RESETTING; - return 0; - } - - //-------------------------------------------------------------------- - // Done with the decoding, send the reports and go back to syncing. - //-------------------------------------------------------------------- - - report_changes(); - d_status = STATUS_SYNCING; - d_bufcount = 0; - return 1; -} - -void vrpn_GlobalHapticsOrb::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = d_timestamp; - vrpn_Button::timestamp = d_timestamp; - vrpn_Dial::timestamp = d_timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); - vrpn_Dial::report_changes(); -} - -void vrpn_GlobalHapticsOrb::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = d_timestamp; - vrpn_Button::timestamp = d_timestamp; - vrpn_Dial::timestamp = d_timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); - vrpn_Dial::report(); -} - -// This routine is called each time through the server's main loop. It will -// take a course of action depending on the current status of the Orb, -// either trying to reset it or trying to get a reading from it. -void vrpn_GlobalHapticsOrb::mainloop() -{ - struct timeval last_poll_sent = {0,0}; - - // Call the generic server mainloop, since we are a server - server_mainloop(); - - switch(d_status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - while (get_report()) {}; // Keep getting reports as long as they come - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - - // If we haven't heard in a while (this can be normal), send a reset - // request to the device -- this will cause a response of 0xfc, which - // will be ignored when it arrives. Reset the poll interval when a - // poll is sent. - if ( vrpn_TimevalDuration(current_time, d_timestamp) > POLL_INTERVAL ) { - last_poll_sent = current_time; - vrpn_write_characters(serial_fd, &reset_char, 1); - } - - // If we still haven't heard from the device after a longer time, - // fail and go into reset mode. - if ( vrpn_TimevalDuration(current_time, d_timestamp) > TIMEOUT_INTERVAL ) { - send_text_message("Too long since last report, resetting", current_time, vrpn_TEXT_ERROR); - d_status = STATUS_RESETTING; - } - } - break; - - default: - send_text_message("vrpn_GlobalHapticsOrb: Unknown mode (internal error), resetting", d_timestamp, vrpn_TEXT_ERROR); - d_status = STATUS_RESETTING; - break; - } -} diff --git a/src/vrpn/vrpn_GlobalHapticsOrb.h b/src/vrpn/vrpn_GlobalHapticsOrb.h deleted file mode 100644 index 24f813f7b9049fd7b51a18a73611dcd76873e0e4..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_GlobalHapticsOrb.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef VRPN_GLOBALHAPTICSORB_H -#define VRPN_GLOBALHAPTICSORB_H - -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Connection.h" // for vrpn_CONNECTION_RELIABLE, etc -#include "vrpn_Dial.h" // for vrpn_Dial -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32 - -// Exports buttons 0-25 as 0-25. -// Exports left pushbutton as 26, right pushbutton as 27. -// Exports rocker up as 28, rocker down as 29. -// Exports Thumbwheel both as clamping analog (-1..1) 0 and as dial 0. -// Exports Trackball both as clamping analogs 1 and 2 and as dials 1 and 2. - -class VRPN_API vrpn_GlobalHapticsOrb: public vrpn_Serial_Analog - ,public vrpn_Button_Filter - ,public vrpn_Dial -{ -public: - vrpn_GlobalHapticsOrb (const char * name, vrpn_Connection * c, - const char * port, int baud); - ~vrpn_GlobalHapticsOrb () {}; - - // Called once through each main loop iteration to handle - // updates. - virtual void mainloop (); - - protected: - int d_status; - - unsigned d_expected_chars; //< How many characters to expect in the report - unsigned char d_buffer[512]; //< Buffer of characters in report - unsigned d_bufcount; //< How many characters we have so far - - struct timeval d_timestamp; //< Time of the last report from the device - - virtual void clear_values(void); //< Set all buttons, analogs and encoders back to 0 - virtual int reset(void); //< Set device back to starting config - virtual int get_report(void); //< Try to read a report from the device - - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button or vrpn_Dial - /// Send report iff changed - virtual void report_changes(vrpn_uint32 class_of_service - = vrpn_CONNECTION_RELIABLE); - /// Send report whether or not changed - virtual void report(vrpn_uint32 class_of_service - = vrpn_CONNECTION_RELIABLE); - - /// Clear all of the values when we get our first client connection request - static int VRPN_CALLBACK handle_firstConnection(void * userdata, vrpn_HANDLERPARAM); -}; - -#endif diff --git a/src/vrpn/vrpn_Griffin.C b/src/vrpn/vrpn_Griffin.C deleted file mode 100644 index d071eee8e27578f99308404bd86cd69f93dfe44d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Griffin.C +++ /dev/null @@ -1,205 +0,0 @@ -// vrpn_Griffin.C: VRPN driver for Griffin Technologies devices - -#include <stdio.h> // for fprintf, stderr, NULL -#include <string.h> // for memset -#include <math.h> // for fabs - -#include "vrpn_Griffin.h" - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_HID) - -static const double POLL_INTERVAL = 1e+6 / 30.0; // If we have not heard, ask. - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 GRIFFIN_VENDOR = 0x077d; -static const vrpn_uint16 GRIFFIN_POWERMATE = 0x0410; - -static void normalize_axis(const unsigned int value, const short deadzone, const vrpn_float64 scale, vrpn_float64& channel) { - channel = (static_cast<float>(value) - 128.0f); - if (fabs(channel) < deadzone) - { - channel = 0.0f; - } - else - { - channel /= 128.0f; - } - channel *= scale; - if (channel < -1.0) { channel = -1.0; } - if (channel > 1.0) { channel = 1.0; } -} - -static void normalize_axes(const unsigned int x, const unsigned int y, const short deadzone, const vrpn_float64 scale, vrpn_float64& channelX, vrpn_float64& channelY) { - normalize_axis(x, deadzone, scale, channelX); - normalize_axis(y, deadzone, scale, channelY); -} - -vrpn_Griffin::vrpn_Griffin(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c) - : vrpn_HidInterface(filter) - , vrpn_BaseClass(name, c) - , _filter(filter) -{ - init_hid(); -} - -vrpn_Griffin::~vrpn_Griffin(void) -{ - delete _filter; -} - -void vrpn_Griffin::init_hid(void) { - // Get notifications when clients connect and disconnect - register_autodeleted_handler(d_connection->register_message_type(vrpn_dropped_last_connection), on_last_disconnect, this); - register_autodeleted_handler(d_connection->register_message_type(vrpn_got_connection), on_connect, this); -} - -void vrpn_Griffin::on_data_received(size_t bytes, vrpn_uint8 *buffer) -{ - decodePacket(bytes, buffer); -} - -int vrpn_Griffin::on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Griffin *me = static_cast<vrpn_Griffin *>(thisPtr); - return 0; -} - -int vrpn_Griffin::on_connect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Griffin *me = static_cast<vrpn_Griffin *>(thisPtr); - return 0; -} - -vrpn_Griffin_PowerMate::vrpn_Griffin_PowerMate(const char *name, vrpn_Connection *c) - : vrpn_Griffin(_filter = new vrpn_HidProductAcceptor(GRIFFIN_VENDOR, GRIFFIN_POWERMATE), name, c) - , vrpn_Button_Filter(name, c) - , vrpn_Analog(name, c) - , vrpn_Dial(name, c) -{ - vrpn_Analog::num_channel = 0; - vrpn_Dial::num_dials = 1; - vrpn_Button::num_buttons = 1; - - // Initialize the state of all the analogs, buttons, and dials - _lastDial = 0; - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); -} - -void vrpn_Griffin_PowerMate::mainloop(void) -{ - update(); - server_mainloop(); - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, _timestamp) > POLL_INTERVAL ) { - _timestamp = current_time; - report_changes(); - - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::server_mainloop(); - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::server_mainloop(); - } - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::server_mainloop(); - } - } -} - -void vrpn_Griffin_PowerMate::report(vrpn_uint32 class_of_service) { - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::timestamp = _timestamp; - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::timestamp = _timestamp; - } - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::report(class_of_service); - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::report_changes(); - } - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Griffin_PowerMate::report_changes(vrpn_uint32 class_of_service) { - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::timestamp = _timestamp; - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::timestamp = _timestamp; - } - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::report(class_of_service); - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::report_changes(); - } - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Griffin_PowerMate::decodePacket(size_t bytes, vrpn_uint8 *buffer) { - // Decode all full reports, each of which is 8 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - // XXX Check to see that this works with HIDAPI, there may be two smaller reports. - if (bytes == 6) { - - if (vrpn_Dial::num_dials > 0) { - // dial (2nd byte) - // Do the unsigned/signed conversion at the last minute so the - // signed values work properly. - dials[0] = static_cast<vrpn_int8>(buffer[1]); - } else { - // dial (2nd byte) - normalize_axis(buffer[1], 5, 1.0f, channel[0]); - } - - vrpn_uint8 value; - // switches (1st byte): - value = buffer[0]; - // button #0: 01 button - for (int btn = 0; btn < 1; btn++) { - vrpn_uint8 mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[btn] = ((value & mask) != 0); - } - } else { - fprintf(stderr, "vrpn_Griffin_PowerMate: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - } -} - -// End of VRPN_USE_HID -#endif diff --git a/src/vrpn/vrpn_Griffin.h b/src/vrpn/vrpn_Griffin.h deleted file mode 100644 index ba19490a147fc11665b72ecff397e672b504feec..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Griffin.h +++ /dev/null @@ -1,71 +0,0 @@ -#pragma once - -#include <stddef.h> // for size_t - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_BaseClass.h" // for vrpn_BaseClass -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_USE_HID -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Dial.h" // for vrpn_Dial -#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint8, vrpn_uint32 - -#if defined(VRPN_USE_HID) - -// Device drivers for the Griffin Technology USB line of products -// Currently supported: PowerMate Controller -// -// Exposes three major VRPN device classes: Button, Analog, Dial (as appropriate). -// All models expose Buttons for the keys on the device. -// Button 0 is the programming switch; it is set if the switch is in the "red" position. -// - -class vrpn_Griffin: public vrpn_BaseClass, protected vrpn_HidInterface { -public: - vrpn_Griffin(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Griffin(void); - - virtual void mainloop(void) = 0; - -protected: - // Set up message handlers, etc. - void init_hid(void); - void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - static int VRPN_CALLBACK on_connect(void *thisPtr, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM p); - - virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer) = 0; - struct timeval _timestamp; - vrpn_HidAcceptor *_filter; - - // No actual types to register, derived classes will be buttons, analogs, and/or dials - int register_types(void) { return 0; } -}; - -class vrpn_Griffin_PowerMate: protected vrpn_Griffin, public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Dial { -public: - vrpn_Griffin_PowerMate(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Griffin_PowerMate(void) {}; - - virtual void mainloop(void); - -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); - - // Previous dial value, used to determine delta to send when it changes. - vrpn_uint8 _lastDial; -}; - -// end of VRPN_USE_HID -#else -class VRPN_API vrpn_Griffin; -class VRPN_API vrpn_Griffin_PowerMate; -#endif diff --git a/src/vrpn/vrpn_HIDAPI_Linux_Hack.c b/src/vrpn/vrpn_HIDAPI_Linux_Hack.c deleted file mode 100644 index 18ba5dcc06ec24fc575ab13963bd4b24bef4c4a5..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_HIDAPI_Linux_Hack.c +++ /dev/null @@ -1,3 +0,0 @@ -// This is here to get the correct .c file. - -#include "submodules/hidapi/linux/hid-libusb.c" diff --git a/src/vrpn/vrpn_HashST.h b/src/vrpn/vrpn_HashST.h deleted file mode 100644 index 2448861623fca036b3d05c44778910aa751ffb0b..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_HashST.h +++ /dev/null @@ -1,378 +0,0 @@ -/* - * vrpn_HashST.H - * - */ - - -#ifndef _VRPN_HASHST_H -#define _VRPN_HASHST_H - -inline unsigned int vrpn_LinearUnsignedIntHashFunction(const unsigned int &i) -{ - return i; -} - -template <class T> -inline unsigned int vrpn_LinearHashFunction(const T &value) -{ - return (unsigned int)value; -} - -//! Hash class (not thread-safe) -/** - * This class implements a NON thread-safe template Hash. Both the key as the value are templates. - * It is possible to iterate over this Hash, but no guarantee is given about the order in which the items are returned. - * All keys must be unique. - * \attention In order to use the \e find function, the value template must support a cast from 0. - * \author Joan De Boeck - * \author Chris Raymaekers - */ -template <class TKey,class TValue> -class vrpn_Hash -{ -public: - //! constructor - vrpn_Hash(int init=16); - //! constructor - vrpn_Hash(unsigned int (*func)(const TKey &key), int init=16); - //! destructor - virtual ~vrpn_Hash(); - //! clears the Hash - void Clear(); - - //! returns the number of items in the Hash - unsigned int GetNrItems() const { return m_NrItems; } - //! returns the value that belongs to this key - TValue& Find(const TKey &key); - //! returns the value that belongs to this key - const TValue& Find(const TKey &key) const; - //! checks if the Hash contains a value and returns its key - bool IsPresent(const TValue &value, TKey &key) const; - - bool MoveFirst() const; //!< moves an iterator to the first element and returns false if no element is present - bool MoveNext() const; //!< moves the iterator to the next element and returns false if no more element is present - TValue GetCurrentValue() const; //!< returns the value of the current item - TKey GetCurrentKey() const; //!< returns the key of the current item - void SetCurrentValue(TValue theValue); //!< sets the Value of the current key - bool GetCurrentKeyAndValue(TKey &theKey, TValue &theValue) const; //!< returns the key and the value of the current item - - bool Add(TKey key, TValue value); //!< adds a new (key, value) pair, returns true if succeeded - bool Remove(TKey key); //!< removes the value that belongs to this key, returns true if succeeded - -private: - //! Hash item struct - /** - * This struct implements a Hash item for use in Hash. - */ - struct HashItem - { - TKey key; //!< the item's key - TValue value; //!< the item's value - struct HashItem *next; //!< the next Hash item, used when iterating the Hash - }; - - void ClearItems(); //!< helper function that clears all items in the Hash, for use within a thread safe function - void ReHash(); //!< reHashes the keys when the Hash size changes - void MakeNull(HashItem **table,int size); //!< makes all (key, value) pairs null - - unsigned int m_NrItems; //!< number of items in the Hash - unsigned int m_SizeHash; //!< current Hash size - unsigned int m_InitialSize; //!< initial Hash size - - HashItem **m_Items; //!< the actual Hash - HashItem *m_First; //!< the first Hash item, used for the iterator - - unsigned int (*HashFunction)(const TKey &key); //!< the function that is used to calculate the Hash values from the keys - - mutable HashItem *m_CurrentItem; //!< the current Hash item - - unsigned int m_Owner; //!< the thread ID of the owner -}; - -/** - * Constructs a new Hash - * \param init Hash's initial size and grow size - */ -template <class TKey,class TValue> -vrpn_Hash<TKey, TValue>::vrpn_Hash(int init) -{ - HashFunction = vrpn_LinearHashFunction<TKey>; - m_NrItems = 0; - m_InitialSize = m_SizeHash = init; - m_Items = new HashItem*[m_SizeHash]; - MakeNull( m_Items, m_SizeHash ); - m_CurrentItem = 0; - - m_First=0L; -} - -/** - * Constructs a new Hash - * \param func the function that used to calculate Hash values from the keys - * \param init Hash's initial size and grow size - */ -template <class TKey,class TValue> -vrpn_Hash<TKey, TValue>::vrpn_Hash(unsigned int (*func)(const TKey &key), int init) -{ - HashFunction = func; - m_NrItems = 0; - m_InitialSize = m_SizeHash = init; - m_Items = new HashItem*[m_SizeHash]; - MakeNull( m_Items, m_SizeHash ); - m_CurrentItem = 0; - - m_First=0L; -} - -template <class TKey,class TValue> -vrpn_Hash<TKey, TValue>::~vrpn_Hash() -{ - - ClearItems(); - delete[] m_Items; -} - -template <class TKey,class TValue> -void vrpn_Hash<TKey, TValue>::Clear() -{ - ClearItems(); - - m_NrItems = 0; - delete m_Items; - - m_SizeHash = m_InitialSize; - m_Items = new HashItem*[m_SizeHash]; - MakeNull( m_Items, m_SizeHash ); - m_First = 0; - m_CurrentItem = 0; -} - -template <class TKey,class TValue> -TValue& vrpn_Hash<TKey, TValue>::Find(const TKey &key) -{ - TValue zero = 0; - TValue &result = zero ; - - unsigned int HashValue = HashFunction( key ) % m_SizeHash; - if ( m_Items[ HashValue ] != 0 ) - if ( m_Items[ HashValue ]->key == key ) - { - result = m_Items[ HashValue ]->value; - m_CurrentItem = m_Items[ HashValue ]; - } - - return result; -} - -template <class TKey,class TValue> -const TValue& vrpn_Hash<TKey, TValue>::Find(const TKey &key) const -{ - TValue zero = 0; - TValue &result = zero ; - - unsigned int HashValue = HashFunction( key ) % m_SizeHash; - if ( m_Items[ HashValue ] != 0 ) - if ( m_Items[ HashValue ]->key == key ) - result = m_Items[ HashValue ]->value; - - return result; -} - -template <class TKey,class TValue> -bool vrpn_Hash<TKey, TValue>::IsPresent(const TValue &value, TKey &key) const -{ - bool searching = MoveFirst(); - - while( searching ) - { - if( GetCurrentValue() == value ) - { - key = GetCurrentKey(); - return true; - } - searching = MoveNext(); - } - - return false; - -} - -template <class TKey,class TValue> -bool vrpn_Hash<TKey, TValue>::Add(TKey key, TValue value) -{ - bool result; - TKey theKey; - - unsigned int HashValue = HashFunction( key ) % m_SizeHash; - HashItem* elementPointer = m_Items[ HashValue ]; - if (elementPointer != 0) - theKey = m_Items[ HashValue ]->key; - - //---- if object already exists - if ( elementPointer != 0 ) - { - if ( theKey == key ) - result = false; - else - { - ReHash(); //--- private function does not have mutex in this class... - - result = Add( key, value ); //---- mutex must be released here when calling recursively - } - } - - //---- if object does not exits in the table - else - { - m_NrItems++; - HashItem *item = new HashItem; //( HashItem * ) malloc( sizeof( HashItem ) ); - item->key = key; - item->value = value; - item->next = m_First; - m_First = item; - m_Items[ HashValue ] = item; - m_CurrentItem = m_Items[ HashValue ]; - - result = true; - } - - return result; -} - -template <class TKey,class TValue> -bool vrpn_Hash<TKey, TValue>::Remove(TKey key) -{ - bool result = false; - - unsigned int HashValue = HashFunction( key ) % m_SizeHash; - if ( m_Items[ HashValue ] != 0 ) { - if ( m_Items[ HashValue ]->key == key ) { - m_NrItems--; - result = true; - - //--adjust pointers - if ( m_Items[ HashValue ] == m_First ) { - m_First = m_First->next; - } else { - HashItem *item; - for ( item = m_First ; item->next != m_Items[ HashValue ]; item = item->next ); - item->next = item->next->next; - } - - //--free memory - delete m_Items[ HashValue ]; //free( m_Items[ HashValue ] ); - m_Items[ HashValue ] = 0; - } - } - - return result; -} - -template <class TKey,class TValue> -bool vrpn_Hash<TKey, TValue>::MoveFirst() const -{ - m_CurrentItem = m_First; - - return ( m_First==NULL ) ? false : true; -} - -template <class TKey,class TValue> -bool vrpn_Hash<TKey, TValue>::MoveNext() const -{ - if ( m_CurrentItem == NULL ) - return false; - - m_CurrentItem = m_CurrentItem->next; - return ( m_CurrentItem != NULL ) ; -} - -template <class TKey,class TValue> -TValue vrpn_Hash<TKey, TValue>::GetCurrentValue() const -{ - if ( m_CurrentItem ) - return m_CurrentItem->value; - else - return 0; -} - -template <class TKey,class TValue> -void vrpn_Hash<TKey, TValue>::SetCurrentValue(TValue theValue) -{ - if ( m_CurrentItem ) - m_CurrentItem->value=theValue; -} - -template <class TKey,class TValue> -TKey vrpn_Hash<TKey, TValue>::GetCurrentKey() const -{ - - if ( m_CurrentItem ) - return m_CurrentItem->key; - else - return 0; -} - -template <class TKey,class TValue> -bool vrpn_Hash<TKey, TValue>::GetCurrentKeyAndValue(TKey &theKey, TValue &theValue) const -{ - bool result; - - - if ( m_CurrentItem ) - { - theKey = m_CurrentItem->key; - theValue = m_CurrentItem->value; - return true; - } - else - return false; -} - -template <class TKey,class TValue> //--- these functions do not implement the mutex (this is done in the calling function) -void vrpn_Hash<TKey, TValue>::MakeNull(HashItem **table, int size) -{ - for ( int i = 0 ; i < size ; i++ ) - table[i]=0; -} - -template <class TKey,class TValue> -void vrpn_Hash<TKey, TValue>::ReHash() //--- these functions do not implement the mutex (this is done in the calling function) -{ - HashItem **temp; - int OldSizeHash = m_SizeHash; - m_SizeHash *= 2; - temp = new HashItem*[m_SizeHash]; - MakeNull( temp, m_SizeHash ); - HashItem *NewFirst = 0; - for ( HashItem *item = m_First ; item != 0 ; item = item->next ) - { - unsigned int HashValue = HashFunction( item->key )% OldSizeHash; - HashItem *NewItem = new HashItem; - NewItem->key = item->key; - NewItem->value = item->value; - NewItem->next = NewFirst; - NewFirst = NewItem; - HashValue = HashFunction( item->key ) % m_SizeHash; - temp[ HashValue ] = NewItem; - } - ClearItems(); - m_First = NewFirst; - - delete m_Items; //free( m_Items ); - m_Items = temp; -} - - -template <class TKey,class TValue> -void vrpn_Hash<TKey, TValue>::ClearItems() -{ - for ( HashItem *item = m_First ; item != 0 ; ) - { - HashItem *it = item; - item = item->next; - delete it; - } - m_CurrentItem = 0; -} - -#endif diff --git a/src/vrpn/vrpn_HumanInterface.C b/src/vrpn/vrpn_HumanInterface.C deleted file mode 100644 index 55e9705720baf986686095ffabc0e3a38550d110..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_HumanInterface.C +++ /dev/null @@ -1,256 +0,0 @@ -#include <stdio.h> // for fprintf, stderr - -#include "vrpn_HumanInterface.h" - -#if defined(VRPN_USE_HID) - -#ifdef VRPN_USE_LOCAL_HIDAPI -#include "./submodules/hidapi/hidapi/hidapi.h" // for hid_device -#else -#include "hidapi.h" -#endif - -// Accessor for USB vendor ID of connected device -vrpn_uint16 vrpn_HidInterface::vendor() const { return _vendor; } - -// Accessor for USB product ID of connected device -vrpn_uint16 vrpn_HidInterface::product() const { return _product; } - -// Accessor for USB interface number of connected device -int vrpn_HidInterface::interface_number() const { return _interface; } - -// Returns true iff everything was working last time we checked -bool vrpn_HidInterface::connected() const { return _working; } - -vrpn_HidInterface::vrpn_HidInterface(vrpn_HidAcceptor *acceptor) - : _acceptor(acceptor) - , _device(NULL) - , _working(false) - , _vendor(0) - , _product(0) - , _interface(0) -{ - if (_acceptor == NULL) { - fprintf(stderr, - "vrpn_HidInterface::vrpn_HidInterface(): NULL acceptor\n"); - return; - } - - // Reset the acceptor and then attempt to connect to a device. - _acceptor->reset(); - reconnect(); -} - -vrpn_HidInterface::~vrpn_HidInterface() -{ - if (_device) { - hid_close(_device); - _device = NULL; - } -} - -// Reconnects the device I/O for the first acceptable device -// Called automatically by constructor, but userland code can -// use it to reacquire a hotplugged device. -bool vrpn_HidInterface::reconnect() -{ - // Enumerate all devices and pass each one to the acceptor to see if it - // is the one that we want. - struct hid_device_info *devs = hid_enumerate(0, 0); - struct hid_device_info *loop = devs; - bool found = false; - const wchar_t *serial; - const char *path; - while ((loop != NULL) && !found) { - vrpn_HIDDEVINFO device_info; - device_info.vendor = loop->vendor_id; - device_info.product = loop->product_id; - device_info.serial_number = loop->serial_number; - device_info.manufacturer_string = loop->manufacturer_string; - device_info.product_string = loop->product_string; - device_info.interface_number = loop->interface_number; - // printf("XXX Found vendor 0x%x, product 0x%x, interface %d\n", - // (unsigned)(loop->vendor_id), (unsigned)(loop->product_id), - // (int)(loop->interface_number) ); - - if (_acceptor->accept(device_info)) { - _vendor = loop->vendor_id; - _product = loop->product_id; - _interface = loop->interface_number; - serial = loop->serial_number; - path = loop->path; - found = true; -#ifdef VRPN_HID_DEBUGGING - fprintf(stderr, "vrpn_HidInterface::reconnect(): Found %ls %ls " - "(%04hx:%04hx) at path %s - will attempt to " - "open.\n", - loop->manufacturer_string, loop->product_string, _vendor, - _product, loop->path); -#endif - } - loop = loop->next; - } - if (!found) { - fprintf(stderr, "vrpn_HidInterface::reconnect(): Device not found\n"); - hid_free_enumeration(devs); - devs = NULL; - return false; - } - - // Initialize the HID interface and open the device. - _device = hid_open_path(path); - if (_device == NULL) { - fprintf(stderr, - "vrpn_HidInterface::reconnect(): Could not open device %s\n", - path); -#ifdef linux - fprintf(stderr, " (Did you remember to run as root?)\n"); -#endif - hid_free_enumeration(devs); - devs = NULL; - return false; - } - - // We cannot do this before the call to open because the serial number - // is a pointer to a string down in there, which forms a race condition. - // This will be a memory leak if the device fails to open. - if (devs != NULL) { - hid_free_enumeration(devs); - devs = NULL; - } - - // Set the device to non-blocking mode. - if (hid_set_nonblocking(_device, 1) != 0) { - fprintf(stderr, "vrpn_HidInterface::reconnect(): Could not set device " - "to nonblocking\n"); - return false; - } - -#ifdef VRPN_HID_DEBUGGING - fprintf(stderr, - "vrpn_HidInterface::reconnect(): Device successfully opened.\n"); -#endif - _working = true; - return _working; -} - -// Check for incoming characters. If we get some, pass them on to the handler -// code. - -void vrpn_HidInterface::update() -{ - if (!_working) { - // fprintf(stderr,"vrpn_HidInterface::update(): Interface not currently - // working\n"); - return; - } - - // Maximum packet size for USB is 512 characters. - vrpn_uint8 inbuf[512]; - - // Continue reading until we eat up all of the reports. If we only handle - // one report per loop cycle, we can accumulate latency. - int ret; - do { - ret = hid_read(_device, inbuf, sizeof(inbuf)); - if (ret < 0) { - fprintf(stderr, "vrpn_HidInterface::update(): Read error\n"); -#if !defined(_WIN32) && !defined(__APPLE__) - fprintf(stderr, " (On one version of Red Hat Linux, this was from " - "not having libusb-devel installed when " - "configuring in CMake.)\n"); -#endif - const wchar_t *errmsg = hid_error(_device); - if (errmsg) { - fprintf( - stderr, - "vrpn_HidInterface::update(): error message: %ls\n", - errmsg); - } - return; - } - - // Handle any data we got. This can include fewer bytes than we - // asked for. - if (ret > 0) { - vrpn_uint8 *data = - static_cast<vrpn_uint8 *>(static_cast<void *>(inbuf)); - on_data_received(ret, data); - } - } while (ret > 0); -} - -// This is based on sample code from UMinn Duluth at -// http://www.d.umn.edu/~cprince/PubRes/Hardware/LinuxUSB/PICDEM/tutorial1.c -// It has not yet been tested. - -void vrpn_HidInterface::send_data(size_t bytes, const vrpn_uint8 *buffer) -{ - if (!_working) { - fprintf(stderr, "vrpn_HidInterface::send_data(): Interface not " - "currently working\n"); - return; - } - int ret; - if ((ret = hid_write(_device, const_cast<vrpn_uint8 *>(buffer), bytes)) != - bytes) { - fprintf(stderr, "vrpn_HidInterface::send_data(): hid_interrupt_write() " - "failed with code %d\n", - ret); - } -} - -void vrpn_HidInterface::send_feature_report(size_t bytes, - const vrpn_uint8 *buffer) -{ - if (!_working) { - fprintf(stderr, "vrpn_HidInterface::send_feature_report(): Interface " - "not currently working\n"); - return; - } - - int ret = hid_send_feature_report(_device, buffer, bytes); - if (ret == -1) { - fprintf(stderr, "vrpn_HidInterface::send_feature_report(): failed to " - "send feature report\n"); - const wchar_t *errmsg = hid_error(_device); - if (errmsg) { - fprintf(stderr, "vrpn_HidInterface::send_feature_report(): error " - "message: %ls\n", - errmsg); - } - } - else { - // fprintf(stderr, "vrpn_HidInterface::send_feature_report(): sent - // feature report, %d bytes\n", static_cast<int>(bytes)); - } -} - -int vrpn_HidInterface::get_feature_report(size_t bytes, vrpn_uint8 *buffer) -{ - if (!_working) { - fprintf(stderr, "vrpn_HidInterface::get_feature_report(): Interface " - "not currently working\n"); - return -1; - } - - int ret = hid_get_feature_report(_device, buffer, bytes); - if (ret == -1) { - fprintf(stderr, "vrpn_HidInterface::get_feature_report(): failed to " - "get feature report\n"); - const wchar_t *errmsg = hid_error(_device); - if (errmsg) { - fprintf( - stderr, - "vrpn_HidInterface::get_feature_report(): error message: %ls\n", - errmsg); - } - } - else { - // fprintf(stderr, "vrpn_HidInterface::get_feature_report(): got feature - // report, %d bytes\n", static_cast<int>(bytes)); - } - return ret; -} - -#endif // any interface diff --git a/src/vrpn/vrpn_HumanInterface.h b/src/vrpn/vrpn_HumanInterface.h deleted file mode 100644 index a92cbd4eff7ce9b2b86dde2f705b125c3db69747..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_HumanInterface.h +++ /dev/null @@ -1,283 +0,0 @@ -// vrpn_HumanInterface.h: Generic USB HID driver I/O interface. -// This implementation uses the cross-platform HIDAPI library -// from http://www.signal11.us/oss/hidapi/ to handle the cross- -// platform HID device interface. The older version had a different -// implementation for each platform; it has been discontinued as -// of version 7.29. - -/* For looking at the types of inforamtion that a device can send, we can use - the following (from a post at microchip.com/forums) - - mcuee@Ubuntu804:~$ lsusb - Bus 002 Device 010: ID 04f2:0760 Chicony Electronics Co., Ltd - Bus 002 Device 007: ID ffff:0005 - Bus 002 Device 005: ID 046d:c054 Logitech, Inc. - Bus 002 Device 004: ID 14c0:0008 - Bus 002 Device 003: ID 1947:0033 - Bus 002 Device 002: ID 058f:9360 Alcor Micro Corp. 8-in-1 Media Card Reader - Bus 002 Device 001: ID 0000:0000 - Bus 001 Device 001: ID 0000:0000 - mcuee@Ubuntu804:~$ sudo libhid-detach-device 04f2:0760 - Trying to detach HID with IDs 04f2:0760... done. - mcuee@Ubuntu804:~$ sudo lsusb -vvv | more - - Bus 002 Device 010: ID 04f2:0760 Chicony Electronics Co., Ltd - Device Descriptor: - bLength 18 - bDescriptorType 1 -*/ - -#ifndef VRPN_HUMANINTERFACE_H -#define VRPN_HUMANINTERFACE_H - -#include <stddef.h> // for size_t -#include <wchar.h> // for wcscmp - -#include "vrpn_Configure.h" // for VRPN_API, VRPN_USE_HID, etc -#include "vrpn_Types.h" // for vrpn_uint16, vrpn_uint8 - -struct vrpn_HIDDEVINFO { - vrpn_uint16 vendor; // USB Vendor ID - vrpn_uint16 product; // USB Product ID - wchar_t *serial_number; // USB device serial number - wchar_t *manufacturer_string; - wchar_t *product_string; - int interface_number; -}; - -// General interface for device enumeration: -// vrpn_HidInterface will connect to the first device your class accepts. -// The reset() method will be called before starting a new enumueration, in -// case you want to connect to the second or third device found that matches -// some criterion. There are some example HID acceptors at the end of -// this file. -class VRPN_API vrpn_HidAcceptor { -public: - virtual ~vrpn_HidAcceptor() {} - virtual bool accept(const vrpn_HIDDEVINFO &device) = 0; - virtual void reset() {} -}; - -#if defined(VRPN_USE_HID) - -// Forward declarations for hid_device -struct hid_device_; -typedef struct hid_device_ hid_device; - -// Main VRPN API for HID devices -class VRPN_API vrpn_HidInterface { -public: - vrpn_HidInterface(vrpn_HidAcceptor *acceptor); - virtual ~vrpn_HidInterface(); - - /// Returns true iff the last device I/O succeeded - virtual bool connected() const; - - /// Polls the device buffers and causes on_data_received callbacks if - /// appropriate - /// You NEED to call this frequently to ensure the OS doesn't drop data - virtual void update(); - - /// Tries to reconnect to an acceptable device. - /// Call this if you suspect a hotplug event has occurred. - virtual bool reconnect(); - - /// Returns USB vendor ID of connected device - vrpn_uint16 vendor() const; - - /// Returns USB product ID of connected device - vrpn_uint16 product() const; - - /// Returns the USB interface number of connected device - int interface_number() const; - -protected: - /** @brief Derived class reimplements this callback. It is called whenever - a read returns some data. - - WARNING! The data returned by this function differs when the device - sends multiple report types and when it only has one. When it - can have more than one, the report type is sent as the first byte. - When it only has one, the report type is NOT included. This is - the behavior of the HIDAPI library we are using. It is surprising - to me, but that's how it behaves. - */ - virtual void on_data_received(size_t bytes, vrpn_uint8 *buffer) = 0; - - /// Call this to send data to the device - void send_data(size_t bytes, const vrpn_uint8 *buffer); - - /// Call this to send a feature report to the device - first byte must be - /// Report ID (or 0x0 for devices without numbered reports) - void send_feature_report(size_t bytes, const vrpn_uint8 *buffer); - - /// Call this to get a feature report from the device - first byte must be - /// Report ID (or 0x0 for devices without numbered reports) - /// @return Number of bytes received, or -1 on error - int get_feature_report(size_t bytes, vrpn_uint8 *buffer); - - /** @brief This is the HidAcceptor we use when reconnecting. - - We do not take ownership of the pointer; it is the user's - responsibility. Using a stack-allocated acceptor is a really good way to - get a segfault when calling reconnect()--there won't be an acceptor there - any longer! - Thus, always use "new" to make your acceptors. - */ - vrpn_HidAcceptor *_acceptor; - - bool _working; - vrpn_uint16 _vendor; - vrpn_uint16 _product; - int _interface; - -private: - hid_device *_device; ///< The HID device to use. -}; - -#endif // VRPN_USE_HID - -// Some sample acceptors - -/// Always accepts the first device passed. Pointless by itself except for -/// testing. -class VRPN_API vrpn_HidAlwaysAcceptor : public vrpn_HidAcceptor { -public: - bool accept(const vrpn_HIDDEVINFO &) { return true; } -}; - -/// Accepts any device with the given vendor and product IDs. -class VRPN_API vrpn_HidProductAcceptor : public vrpn_HidAcceptor { -public: - vrpn_HidProductAcceptor(vrpn_uint16 vendorId, vrpn_uint16 productId) - : product(productId) - , vendor(vendorId) - { - } - bool accept(const vrpn_HIDDEVINFO &device) - { - return (device.vendor == vendor) && (device.product == product); - } - -private: - vrpn_uint16 product, vendor; -}; - -/// Accepts any device with a particular serial number. -class VRPN_API vrpn_HidSerialNumberAcceptor : public vrpn_HidAcceptor { -public: - vrpn_HidSerialNumberAcceptor(const wchar_t *serial) - : devNum(serial) - { - } - bool accept(const vrpn_HIDDEVINFO &device) - { - return !wcscmp(devNum, device.serial_number); - } - -private: - const wchar_t *devNum; -}; - -/// Accepts any device with a particular interface number. Best in conjunction -/// with vrpn_HidBooleanAndAcceptor. -class VRPN_API vrpn_HidInterfaceNumberAcceptor : public vrpn_HidAcceptor { -public: - vrpn_HidInterfaceNumberAcceptor(int iface) - : _iface(iface) - { - } - bool accept(const vrpn_HIDDEVINFO &device) - { - return _iface == device.interface_number; - } - -private: - const int _iface; -}; - -/** @brief Accepts the Nth device matching a given acceptor. - - This demonstrates the composition of acceptors, allowing the user/programmer - to create a more specific Hid object without needing to duplicate code all - over the place. -*/ -class VRPN_API vrpn_HidNthMatchAcceptor : public vrpn_HidAcceptor { -public: - vrpn_HidNthMatchAcceptor(size_t index, vrpn_HidAcceptor *acceptor) - : target(index) - , found(0) - , delegate(acceptor) - { - } - - virtual ~vrpn_HidNthMatchAcceptor() { delete delegate; } - - bool accept(const vrpn_HIDDEVINFO &device) - { - return delegate->accept(device) && (found++ == target); - } - void reset() - { - found = 0; - delegate->reset(); - } - -private: - size_t target, found; - vrpn_HidAcceptor *delegate; -}; - -/// Accepts only devices meeting two criteria. NOT SHORT-CIRCUIT. -/// Another demonstration of acceptor composition. -class VRPN_API vrpn_HidBooleanAndAcceptor : public vrpn_HidAcceptor { -public: - vrpn_HidBooleanAndAcceptor(vrpn_HidAcceptor *p, vrpn_HidAcceptor *q) - : first(p) - , second(q) - { - } - bool accept(const vrpn_HIDDEVINFO &device) - { - bool p = first->accept(device); - bool q = second->accept(device); - return p && q; - } - void reset() - { - first->reset(); - second->reset(); - } - -private: - vrpn_HidAcceptor *first, *second; -}; - -/// Accepts devices meeting at least one of two criteria. NOT SHORT-CIRCUIT. -/// Another demonstration of acceptor composition. -class VRPN_API vrpn_HidBooleanOrAcceptor : public vrpn_HidAcceptor { -public: - vrpn_HidBooleanOrAcceptor(vrpn_HidAcceptor *p, vrpn_HidAcceptor *q) - : first(p) - , second(q) - { - } - bool accept(const vrpn_HIDDEVINFO &device) - { - bool p = first->accept(device); - bool q = second->accept(device); - return p || q; - } - void reset() - { - first->reset(); - second->reset(); - } - -private: - vrpn_HidAcceptor *first, *second; -}; - -/// @todo Operators for these acceptors (really predicates) ? - -#endif // VRPN_HUMANINTERFACE_H diff --git a/src/vrpn/vrpn_IDEA.C b/src/vrpn/vrpn_IDEA.C deleted file mode 100644 index 6431ae2eb5c5e3e0461c8cd55102d57bd90ae99f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_IDEA.C +++ /dev/null @@ -1,1031 +0,0 @@ -// vrpn_IDEA.C - -// See http://www.haydonkerk.com/LinkClick.aspx?fileticket=LEcwYeRmKVg%3d&tabid=331 -// for the software manual for this device. - -#include <stddef.h> // for size_t -#include <stdio.h> // for fprintf, stderr, sprintf, etc -#include <string.h> // for NULL, strlen, strchr, etc - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR, etc -#include "vrpn_IDEA.h" -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_unbuffer, etc - -#define VRPN_TIMESTAMP_MEMBER d_timestamp // Configuration required for vrpn_MessageMacros in this class. -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -#undef VERBOSE - -// Defines the modes in which the device can find itself. -#define STATUS_RESETTING (-1) // Resetting the device -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report - -#define TIMEOUT_TIME_INTERVAL (2000000L) // max time between reports (usec) -#define POLL_INTERVAL (1000000L) // time to poll if no response in a while (usec) - -// This creates a vrpn_IDEA and sets it to reset mode. It opens -// the serial device using the code in the vrpn_Serial_Analog constructor. - -vrpn_IDEA::vrpn_IDEA (const char * name, vrpn_Connection * c,const char * port - , int run_speed_tics_sec - , int start_speed_tics_sec - , int end_speed_tics_sec - , int accel_rate_tics_sec_sec - , int decel_rate_tics_sec_sec - , int run_current - , int hold_current - , int accel_current - , int decel_current - , int delay - , int step - , int high_limit_index - , int low_limit_index - , int output_1_setting - , int output_2_setting - , int output_3_setting - , int output_4_setting - , double initial_move - , double fractional_c_a - , double reset_location): - vrpn_Serial_Analog(name, c, port, 57600) - , vrpn_Analog_Output(name, c) - , vrpn_Button_Filter(name, c) - , d_bufcount(0) - , d_run_speed_tics_sec(run_speed_tics_sec) - , d_start_speed_tics_sec(start_speed_tics_sec) - , d_end_speed_tics_sec(end_speed_tics_sec) - , d_accel_rate_tics_sec_sec(accel_rate_tics_sec_sec) - , d_decel_rate_tics_sec_sec(decel_rate_tics_sec_sec) - , d_run_current(run_current) - , d_hold_current(hold_current) - , d_accel_current(accel_current) - , d_decel_current(decel_current) - , d_delay(delay) - , d_step(step) - , d_high_limit_index(high_limit_index) - , d_low_limit_index(low_limit_index) - , d_output_1_setting(output_1_setting) - , d_output_2_setting(output_2_setting) - , d_output_3_setting(output_3_setting) - , d_output_4_setting(output_4_setting) - , d_initial_move(initial_move) - , d_fractional_c_a(fractional_c_a) - , d_reset_location(reset_location) -{ - d_last_poll.tv_sec = 0; - d_last_poll.tv_usec = 0; - - vrpn_Analog::num_channel = 1; - vrpn_Analog_Output::o_num_channel = 1; - vrpn_Button::num_buttons = 4; - channel[0] = 0; - last[0] = 0; - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(buttons)); - vrpn_gettimeofday(&d_timestamp, NULL); - - // Set the mode to reset - status = STATUS_RESETTING; - - // Register to receive the message to request changes and to receive connection - // messages. - if (d_connection != NULL) { - if (register_autodeleted_handler(request_m_id, handle_request_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_IDEA: can't register handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler(request_channels_m_id, handle_request_channels_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_IDEA: can't register handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler(d_ping_message_id, handle_connect_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_IDEA: can't register handler\n"); - d_connection = NULL; - } - } else { - fprintf(stderr,"vrpn_IDEA: Can't get connection!\n"); - } - - // Reset the drive. - reset(); -} - -// Add a newline-termination to the command and then send it. -bool vrpn_IDEA::send_command(const char *cmd) -{ - char buf[128]; - size_t len = strlen(cmd); - if (len > sizeof(buf)-2) { return false; } - strcpy(buf, cmd); - buf[len] = '\r'; - buf[len+1] = '\0'; - return (vrpn_write_characters(serial_fd, - (const unsigned char *)((void*)(buf)), strlen(buf)) == strlen(buf) ); -} - -// Helper function to scale int by a double and get an int. -static inline int scale_int(int val, double scale) -{ - return static_cast<int>(val*scale); -} - -// Commands Responses Meanings -// M None Move to position -// i None Interrupt configure -// Params: -// distance: distance in 1/64th steps -// run speed: steps/second -// start speed: steps/second -// end speed: steps/second -// accel rate: steps/second/second -// decel rate: steps/second/second -// run current: milliamps -// hold current: milliamps -// accel current: milliamps -// decel current: milliamps -// delay: milliseconds, waiting to drop to hold current -// step mode: inverse step size: 4 is 1/4 step. -// scale: Between 0 and 1. Scales the acceleration and currents down. - -bool vrpn_IDEA::send_move_request(vrpn_float64 location_in_steps, double scale) -{ - char cmd[512]; - - //----------------------------------------------------------------------- - // Configure input interrupts. We want a rising-edge trigger for the - // inputs, calling the appropriate subroutine. We only enable the - // high limit switch when moving forward and only the low one when moving - // backwards. If neither limit switch is set, we still send a command so - // that they will be disabled (in case the motor was programmed differently - // before). - // XXX The "i" command is only available in program mode, so we need to - // write a program that will call the limit routine if needed and then will - // execute our particular move, then we call that program. If we're lucky, - // we can do the limit subroutine as another program on another page and - // call it from here. If not, we'll need to put the whole program including - // the subroutine each time -- then we need to figure out where to branch - // to. We'll probably need to talk the GUI program into spitting out the - // text it is sending to the motor to figure out what that offset is. - { - int edge_masks[4] = { 0, 0, 0, 0 }; - int address_masks[4] = { 0, 0, 0, 0 }; - int priority_masks[4] = { 1, 1, 1, 1 }; - - // If we're moving forward and there is a high limit switch, set - // up to use it. - if ( (location_in_steps > channel[0]) && (d_high_limit_index > 0) ) { - edge_masks[d_high_limit_index - 1] = 2; // Rising edge - address_masks[d_high_limit_index - 1] = 1024; // Address of program - } - - // If we're moving backwards and there is a low limit switch, set - // up to use it. - if ( (location_in_steps < channel[0]) && (d_low_limit_index > 0) ) { - edge_masks[d_low_limit_index - 1] = 2; // Rising edge - address_masks[d_low_limit_index - 1] = 2048; // Address of program - } - - if (sprintf(cmd, "i%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", - edge_masks[0], edge_masks[1], edge_masks[2], edge_masks[3], - address_masks[0], address_masks[1], address_masks[2], address_masks[3], - priority_masks[0], priority_masks[1], priority_masks[2], priority_masks[3] - ) <= 0) { - VRPN_MSG_ERROR("vrpn_IDEA::send_move_request(): Could not configure interrupt command"); - status = STATUS_RESETTING; - return false; - } - if (!send_command(cmd)) { - VRPN_MSG_ERROR("vrpn_IDEA::send_move_request(): Could not configure interrupts"); - status = STATUS_RESETTING; - return false; - } - } - - // If we have a high limit and are moving forward, or a low limit and are - // moving backwards, then we need to check the appropriate limit switch - // before starting the move so that we won't drive once we've passed the - // limit. - if ( (location_in_steps > channel[0]) && (d_high_limit_index > 0) ) { - if (buttons[d_high_limit_index - 1] != 0) { - VRPN_MSG_WARNING("vrpn_IDEA::send_move_request(): Asked to move into limit"); - return true; // Nothing failed, but we're not moving. - } - } - if ( (location_in_steps < channel[0]) && (d_low_limit_index > 0) ) { - if (buttons[d_low_limit_index - 1] != 0) { - VRPN_MSG_WARNING("vrpn_IDEA::send_move_request(): Asked to move into limit"); - return true; // Nothing failed, but we're not moving. - } - } - - // Send the command to move the motor. It may cause an interrupt which - // will stop the motion along the way. - long steps_64th = static_cast<long>(location_in_steps*64); - sprintf(cmd, "M%ld,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", - steps_64th, - d_run_speed_tics_sec, - scale_int(d_start_speed_tics_sec,scale), - scale_int(d_end_speed_tics_sec, scale), - scale_int(d_accel_rate_tics_sec_sec, scale), - scale_int(d_decel_rate_tics_sec_sec, scale), - scale_int(d_run_current, scale), - scale_int(d_hold_current, scale), - scale_int(d_accel_current, scale), - scale_int(d_decel_current, scale), - d_delay, - d_step); - return send_command(cmd); -} - -bool vrpn_IDEA::move_until_done_or_error(vrpn_float64 location_in_steps, double scale) -{ - // Send a move command, scaled by the fractional current and - // acceleration values. - if (!send_move_request(location_in_steps, d_fractional_c_a)) { - VRPN_MSG_ERROR("Could not do move"); - return false; - } - - // Keep asking whether the motor is moving until it says that it - // is not. - bool moving = true; - int ret; - unsigned char inbuf[1024]; - do { - if (!send_command("o")) { - VRPN_MSG_ERROR("Could not request movement status"); - return false; - } - - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 30000; - ret = vrpn_read_available_characters(serial_fd, inbuf, sizeof(inbuf), &timeout); - if (ret < 0) { - VRPN_MSG_ERROR("Error reading movement status"); - return false; - } - if ( (ret < 8) || (inbuf[ret-1] != '\r') ) { - inbuf[ret] = '\0'; - VRPN_MSG_ERROR("Bad movement status report"); - return false; - } - inbuf[ret] = '\0'; - - if ( (inbuf[0] != '`') || (inbuf[1] != 'o') ) { - VRPN_MSG_ERROR("Bad movement status report"); - return false; - } - moving = (inbuf[2] == 'Y'); - } while (moving); - - return true; -} - -// This routine will parse a location response from the drive. -// Commands Responses Meanings -// l `l<value>[cr]`l#[cr] Location of the drive - -int vrpn_IDEA::convert_report_to_position(unsigned char *buf) -{ - // Make sure that the last character is [cr] and that we - // have another [cr] in the record somewhere (there should be - // two). This makes sure that we have a complete report. - char *firstindex = strchr((char*)(buf), '\r'); - char *lastindex = strrchr((char*)(buf), '\r'); - if (buf[strlen((char*)(buf))-1] != '\r') { return 0; } - if (firstindex == lastindex) { return 0; } - - // See if we can convert the number. - int data; - if (sscanf((char *)(buf), "`l%d\r`l#\r", &data) != 1) { - return -1; - } - - // The location of the drive is in 64th-of-a-tick units, so need - // to divide by 64 to find the actual location. Store this in our - // analog channel. - channel[0] = data/64.0; - return 1; -} - -// This routine will parse an I/O response from the drive. -// Commands Responses Meanings -// l `:<value>[cr]`:#[cr] Bitmask of the in/outputs - -int vrpn_IDEA::convert_report_to_buttons(unsigned char *buf) -{ - // Make sure that the last character is [cr] and that we - // have another [cr] in the record somewhere (there should be - // two). This makes sure that we have a complete report. - char *firstindex = strchr((char*)(buf), '\r'); - char *lastindex = strrchr((char*)(buf), '\r'); - if (buf[strlen((char*)(buf))-1] != '\r') { return 0; } - if (firstindex == lastindex) { return 0; } - - // See if we can read the status into an integer. - int io_status; - if (sscanf((char *)(buf), "`:%d\r`:#\r", &io_status) != 1) { - return -1; - } - - // Store the results from the first four inputs (low-order bits, - // input 1 is lowest) into our buttons. - vrpn_Button::buttons[0] = (0 != (io_status & (1 << 0)) ); - vrpn_Button::buttons[1] = (0 != (io_status & (1 << 1)) ); - vrpn_Button::buttons[2] = (0 != (io_status & (1 << 2)) ); - vrpn_Button::buttons[3] = (0 != (io_status & (1 << 3)) ); - - // If one of our limit-switch buttons has just toggled on, report this - // as a warning. - if (d_high_limit_index && buttons[d_high_limit_index-1] && - !lastbuttons[d_high_limit_index-1]) { - VRPN_MSG_WARNING("Encountered high limit"); - } - if (d_low_limit_index && buttons[d_low_limit_index-1] && - !lastbuttons[d_low_limit_index-1]) { - VRPN_MSG_WARNING("Encountered low limit"); - } - - // We got a report. - return 1; -} - -// This routine will reset the IDEA drive. -// Commands Responses Meanings -// R None Software reset -// f `f<value>[cr]`f#[cr] Request fault status -// l `l<value>[cr]`l#[cr] Location of the drive -// A None Abort -// P `P[program size][cr]`P#[cr] (or none) Program -// L None Goto If -// : `:[value][cr]`:#[cr] Read I/O -// O None Set output -// Z None Set position value -// o `oYES[cr]`o#[cr] (or NO) Is the motor moving? - -int vrpn_IDEA::reset(void) -{ - struct timeval timeout; - unsigned char inbuf[128]; - char cmd[512]; - int ret; - - //----------------------------------------------------------------------- - // Drain the input buffer to make sure we start with a fresh slate. - // Also wait a bit to let things clear out. - vrpn_SleepMsecs(250); - vrpn_flush_input_buffer(serial_fd); - - //----------------------------------------------------------------------- - // Reset the driver, then wait briefly to let it reset. - if (!send_command("R")) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not send reset command\n"); - return -1; - } - vrpn_SleepMsecs(250); - - //----------------------------------------------------------------------- - // Ask for the fault status of the drive. This should cause it to respond - // with an "f" followed by a number and a carriage return. We want the - // number to be zero. - if (!send_command("f")) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not request fault status\n"); - return -1; - } - - timeout.tv_sec = 0; - timeout.tv_usec = 30000; - - ret = vrpn_read_available_characters(serial_fd, inbuf, sizeof(inbuf), &timeout); - if (ret < 0) { - perror("vrpn_IDEA::reset(): Error reading fault status from device"); - return -1; - } - if ( (ret < 8) || (inbuf[ret-1] != '\r') ) { - inbuf[ret] = '\0'; - fprintf(stderr,"vrpn_IDEA::reset(): Bad fault status report (length %d): %s\n", ret, inbuf); - VRPN_MSG_ERROR("Bad fault status report"); - return -1; - } - inbuf[ret] = '\0'; - - int fault_status; - if (sscanf((char *)(inbuf), "`f%d\r`f#\r", &fault_status) != 1) { - fprintf(stderr,"vrpn_IDEA::reset(): Bad fault status report: %s\n", inbuf); - VRPN_MSG_ERROR("Bad fault status report"); - return -1; - } - if (fault_status != 0) { - VRPN_MSG_ERROR("Drive reports a fault"); - return -1; - } - - //----------------------------------------------------------------------- - // Reset the drive count at the present location to 0, so that we can - // know how far we got on our initial move later. - if (!send_command("Z0")) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not set position to 0\n"); - return -1; - } - - //----------------------------------------------------------------------- - // Set the outputs to the desired state. If a setting is -1, then we - // don't change the value. If it is 0 or 1 then we set the value to - // what was requested. - int value = 0; - if (d_output_1_setting >= 0) { - value |= 1 << (4 + 0); - value |= (d_output_1_setting != 0) << (0); - } - if (d_output_2_setting >= 0) { - value |= 1 << (4 + 1); - value |= (d_output_2_setting != 0) << (1); - } - if (d_output_3_setting >= 0) { - value |= 1 << (4 + 2); - value |= (d_output_3_setting != 0) << (2); - } - if (d_output_4_setting >= 0) { - value |= 1 << (4 + 3); - value |= (d_output_4_setting != 0) << (3); - } - if (sprintf(cmd, "O%d", value) <= 0) { - VRPN_MSG_ERROR("vrpn_IDEA::send_output(): Could not configure output command"); - status = STATUS_RESETTING; - return -1; - } - if (!send_command(cmd)) { - VRPN_MSG_ERROR("vrpn_IDEA::send_output(): Could not configure outputs"); - status = STATUS_RESETTING; - return -1; - } - //printf("XXX Sending output command: %s\n", cmd); - vrpn_SleepMsecs(100); - - //----------------------------------------------------------------------- - // Read the input/output values from the drive (debugging). - if (!send_command(":")) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not request I/O status\n"); - return -1; - } - - timeout.tv_sec = 0; - timeout.tv_usec = 30000; - - ret = vrpn_read_available_characters(serial_fd, inbuf, sizeof(inbuf), &timeout); - if (ret < 0) { - perror("vrpn_IDEA::reset(): Error reading I/O status from device"); - return -1; - } - if ( (ret < 8) || (inbuf[ret-1] != '\r') ) { - inbuf[ret] = '\0'; - fprintf(stderr,"vrpn_IDEA::reset(): Bad I/O status report (length %d): %s\n", ret, inbuf); - VRPN_MSG_ERROR("Bad I/O status report"); - return -1; - } - inbuf[ret] = '\0'; - - if (convert_report_to_buttons(inbuf) != 1) { - fprintf(stderr,"vrpn_IDEA::reset(): Bad I/O status report: %s\n", inbuf); - VRPN_MSG_ERROR("Bad I/O status report"); - return -1; - } - - //----------------------------------------------------------------------- - // Ask for the position of the drive and make sure we can read it. - if (!send_command("l")) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not request position\n"); - return -1; - } - - timeout.tv_sec = 0; - timeout.tv_usec = 30000; - - ret = vrpn_read_available_characters(serial_fd, inbuf, sizeof(inbuf), &timeout); - if (ret < 0) { - perror("vrpn_IDEA::reset(): Error reading position from device"); - return -1; - } - if ( (ret < 8) || (inbuf[ret-1] != '\r') ) { - inbuf[ret] = '\0'; - fprintf(stderr,"vrpn_IDEA::reset(): Bad position report: %s\n", inbuf); - VRPN_MSG_ERROR("Bad position report"); - return -1; - } - inbuf[ret] = '\0'; - - if (convert_report_to_position(inbuf) != 1) { - fprintf(stderr,"vrpn_IDEA::reset(): Bad position report: %s\n", inbuf); - VRPN_MSG_ERROR("Bad position report"); - return -1; - } - - //----------------------------------------------------------------------- - // Write the limit-switch subroutine, which should abort a move when - // the drive is moving in a positive direction and we get a rising - // edge trigger on the associated input. If the index of the input - // to use is -1, we aren't using this. The motion command will set - // the interrupt handlers appropriately, given the direction of travel. - // Here, we write the programs for the high limit switch and the low - // limit switch that will be called when they are triggered. - - { - // The program name must be exactly ten characters. - // The first integer (second parameter) is the page number that the - // program starts on. Pages are 1024 bytes long. There are pages - // 1-85 available. We put this program on page 1 (which we hope is - // address 0). - // We put this program at memory location 1024 (must be multiple of 1024). - if (!send_command("Pfoundlimit,1,1")) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not start limit program\n"); - return -1; - } - - // The program should cause an abort instruction when run - if (!send_command("A")) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not send abort to limit program\n"); - return -1; - } - - // "Return" instruction from the subroutine back to the main program. - if (!send_command("X")) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not send return to limit program\n"); - return -1; - } - - // The program description is done - if (!send_command("P")) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not finish limit program\n"); - return -1; - } - - timeout.tv_sec = 0; - timeout.tv_usec = 300000; - - // Get a response saying that the program has been received; it will - // say what the size of the program is. - ret = vrpn_read_available_characters(serial_fd, inbuf, sizeof(inbuf), &timeout); - if (ret < 0) { - perror("vrpn_IDEA::reset(): Error reading limit program response from device"); - return -1; - } - if ( (ret < 8) || (inbuf[ret-1] != '\r') ) { - inbuf[ret] = '\0'; - fprintf(stderr,"vrpn_IDEA::reset(): Bad limit program response report: %s\n", inbuf); - VRPN_MSG_ERROR("Could not write limit program"); - return -1; - } - inbuf[ret] = '\0'; - - int program_length; - if (sscanf((char *)(inbuf), "`P%d\r`P#\r", &program_length) != 1) { - fprintf(stderr,"vrpn_IDEA::reset(): Bad limit program report: %s\n", inbuf); - VRPN_MSG_ERROR("Bad limit program report"); - return -1; - } - } - - //----------------------------------------------------------------------- - // If we have an initial-move value (to run into the rails), then execute - // a move with acceleration and currents scaled by the fractional_c_a - // value used in the constructor. Wait until the motor stops moving - // after this command before proceeding. - - if (d_initial_move != 0) { - if (!move_until_done_or_error(d_initial_move, d_fractional_c_a)) { - VRPN_MSG_ERROR("Could not do initial move"); - return -1; - } - } - - //----------------------------------------------------------------------- - // XXX Once the interrupt abort is working... - // Ask for the position of the drive and see if we moved to where we - // wanted to. If not, report where we ended up. - // XXX To make this work, we'll need to write a program to do each - // move, which sets the interrupt handlers as needed for the limit - // switches (the "i" command is only available in program mode). - - // XXX Until we can fix the limit-switch program to abort a move, we'll - // do the homing a different way. If there is a limit switch enabled - // in the direction of the initial move, we will repeat that initial - // move until the limit switch is engaged. This only works for the - // high limit switch; it is a hack until we get the interrupts working. - while ( (d_initial_move > 0) && (d_high_limit_index > 0) ) { - - //----------------------------------------------------------------------- - // Ask for the position of the drive and parse it. - if (!send_command("l")) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not request position\n"); - return -1; - } - - timeout.tv_sec = 0; - timeout.tv_usec = 30000; - - ret = vrpn_read_available_characters(serial_fd, inbuf, sizeof(inbuf), &timeout); - if (ret < 0) { - perror("vrpn_IDEA::reset(): Error reading position from device"); - return -1; - } - if ( (ret < 8) || (inbuf[ret-1] != '\r') ) { - inbuf[ret] = '\0'; - fprintf(stderr,"vrpn_IDEA::reset(): Bad position report: %s\n", inbuf); - VRPN_MSG_ERROR("Bad position report"); - return -1; - } - inbuf[ret] = '\0'; - - if (convert_report_to_position(inbuf) != 1) { - fprintf(stderr,"vrpn_IDEA::reset(): Bad position report: %s\n", inbuf); - VRPN_MSG_ERROR("Bad position report"); - return -1; - } - - // Check to see if the limit switch is on. If so, we're done, so we - // break out of the loop. - if (!send_command(":")) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not request I/O status in limit hunt\n"); - return -1; - } - - timeout.tv_sec = 0; - timeout.tv_usec = 30000; - - ret = vrpn_read_available_characters(serial_fd, inbuf, sizeof(inbuf), &timeout); - if (ret < 0) { - perror("vrpn_IDEA::reset(): Error reading I/O status from device in limit hunt"); - return -1; - } - if ( (ret < 8) || (inbuf[ret-1] != '\r') ) { - inbuf[ret] = '\0'; - fprintf(stderr,"vrpn_IDEA::reset(): Bad I/O status report (length %d) in limit hunt: %s\n", ret, inbuf); - VRPN_MSG_ERROR("Bad I/O status report"); - return -1; - } - inbuf[ret] = '\0'; - - if (convert_report_to_buttons(inbuf) != 1) { - fprintf(stderr,"vrpn_IDEA::reset(): Bad I/O status report in limit hunt: %s\n", inbuf); - VRPN_MSG_ERROR("Bad I/O status report"); - return -1; - } - - // Break out if we're done. - if (buttons[d_high_limit_index-1]) { - break; - } - - // Issue another move request in the same direction of the same - // magnitude as the first one, until we get to the rails. - printf("XXX vrpn_IDEA: moving to %lf to find limit\n", - channel[0] + d_initial_move); - if (!move_until_done_or_error(channel[0] + d_initial_move, d_fractional_c_a)){ - VRPN_MSG_ERROR("Could not do limit-hunting move"); - return -1; - } - } - - //----------------------------------------------------------------------- - // Reset the drive count at the present location to the value set in the - // constructor. We need to multiply by 64 to get into microticks. - long reset_location = static_cast<long>(64 * d_reset_location); - sprintf(cmd, "Z%ld", reset_location); - if (!send_command(cmd)) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not set position to 1280\n"); - return -1; - } - - //----------------------------------------------------------------------- - // Ask for the position of the drive so that it will start sending. - // them to us. Each time we finish getting a report, we request - // another one. - if (!send_command("l")) { - fprintf(stderr,"vrpn_IDEA::reset(): Could not request position\n"); - return -1; - } - - // We're now waiting for any responses from devices - VRPN_MSG_WARNING("reset complete (this is good)"); - vrpn_gettimeofday(&d_timestamp, NULL); // Set watchdog now - status = STATUS_SYNCING; - return 0; -} - -// This function will read characters until it has a full report, then -// put that report into analog fields and call the report methods on these. -// The time stored is that of the first character received as part of the -// report. - -int vrpn_IDEA::get_report(void) -{ - int ret; // Return value from function call to be checked - - //-------------------------------------------------------------------- - // If we're SYNCing, then the next character we get should be the start - // of a report. If we recognize it, go into READing mode and tell how - // many characters we expect total. If we don't recognize it, then we - // must have misinterpreted a command or something; clear the buffer - // and try another read after sending a warning in the hope that this - // is a one-shot glitch. If it persists, we'll eventually timeout and - // reset. - //-------------------------------------------------------------------- - - if (status == STATUS_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, d_buffer, 1) != 1) { - return 0; - } - - // Make sure that the first character is a single back-quote. If - // not, we need to flush the buffer and then send another - // request for reading (probably dropped a character). - if (d_buffer[0] != '`') { - char msg[256]; - sprintf(msg, "Bad character (got %c, expected `), re-syncing", d_buffer[0]); - VRPN_MSG_WARNING(msg); - vrpn_SleepMsecs(10); - vrpn_flush_input_buffer(serial_fd); - if (!send_command("l")) { - VRPN_MSG_ERROR("Could not send position request in re-sync, resetting"); - status = STATUS_RESETTING; - return 0; - } - return 0; - } - - // Got the first character of a report -- go into READING mode - // and record that we got one character at this time. The next - // bit of code will attempt to read the rest of the report. - // The time stored here is as close as possible to when the - // report was generated. - d_bufcount = 1; - vrpn_gettimeofday(&d_timestamp, NULL); - status = STATUS_READING; -#ifdef VERBOSE - printf("... Got the 1st char\n"); -#endif - } - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. - //-------------------------------------------------------------------- - - ret = vrpn_read_available_characters(serial_fd, &d_buffer[d_bufcount], - sizeof(d_buffer)-d_bufcount); - if (ret == -1) { - VRPN_MSG_ERROR("Error reading"); - status = STATUS_RESETTING; - return 0; - } - d_bufcount += ret; -#ifdef VERBOSE - if (ret != 0) printf("... got %d characters (%d total)\n",ret, d_bufcount); -#endif - - //-------------------------------------------------------------------- - // See if we can parse this report as position. If so, it is stored into - // our analog channel and we request an I/O report next (we toggle back - // and forth between requesting position and requesting I/O values). - //-------------------------------------------------------------------- - - d_buffer[d_bufcount] = '\0'; - int pos_ret; - pos_ret = convert_report_to_position(d_buffer); - if (pos_ret == 1) { - - //-------------------------------------------------------------------- - // Request an I/O report so we can keep them coming. - //-------------------------------------------------------------------- - -#ifdef VERBOSE - printf("got a complete report (%d)!\n", d_bufcount); -#endif - if (!send_command(":")) { - VRPN_MSG_ERROR("Could not send I/O request, resetting"); - status = STATUS_RESETTING; - return 0; - } - - //-------------------------------------------------------------------- - // Done with the decoding, send the reports and go back to syncing - //-------------------------------------------------------------------- - - report_changes(); - status = STATUS_SYNCING; - d_bufcount = 0; - - return 1; - } - - //-------------------------------------------------------------------- - // See if we can parse this report as I/O. If so, it is stored into - // our button channels and we request a position report next (we toggle back - // and forth between requesting position and requesting I/O values). - //-------------------------------------------------------------------- - - d_buffer[d_bufcount] = '\0'; - int but_ret; - but_ret = convert_report_to_buttons(d_buffer); - if (but_ret == 1) { - - //-------------------------------------------------------------------- - // Request a position report so we can keep them coming. - //-------------------------------------------------------------------- - -#ifdef VERBOSE - printf("got a complete report (%d)!\n", d_bufcount); -#endif - if (!send_command("l")) { - VRPN_MSG_ERROR("Could not send position request, resetting"); - status = STATUS_RESETTING; - return 0; - } - - //-------------------------------------------------------------------- - // Done with the decoding, send the reports and go back to syncing - //-------------------------------------------------------------------- - - report_changes(); - status = STATUS_SYNCING; - d_bufcount = 0; - - return 1; - } - - // If we got an error for both types of reports, trouble! - // Flush things and ask for a new position report. - if ( (pos_ret == -1) && (but_ret == -1) ) { - // Error during parsing, maybe we got off by a half-report. - // Try clearing the input buffer and re-requesting a report. - VRPN_MSG_WARNING("Flushing input and requesting new position report"); - status = STATUS_SYNCING; - d_bufcount = 0; - vrpn_SleepMsecs(10); - vrpn_flush_input_buffer(serial_fd); - if (!send_command("l")) { - VRPN_MSG_ERROR("Could not send position request in convert failure, resetting"); - status = STATUS_RESETTING; - return 0; - } - } - - // We've not gotten a report, nor an error. - return 0; -} - -int vrpn_IDEA::handle_request_message(void *userdata, vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_float64 value; - vrpn_IDEA *me = (vrpn_IDEA *)userdata; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - vrpn_unbuffer(&bufptr, &value); - - // Set the position to the appropriate value, if the channel number is in the - // range of the ones we have. - if ( (chan_num < 0) || (chan_num >= me->o_num_channel) ) { - char msg[1024]; - sprintf(msg,"vrpn_IDEA::handle_request_message(): Index out of bounds (%d of %d), value %lg\n", - chan_num, me->num_channel, value); - me->send_text_message(msg, me->d_timestamp, vrpn_TEXT_ERROR); - return 0; - } - // This will get set when we read from the motoer me->channel[chan_num] = value; - me->send_move_request(value); - - return 0; -} - -int vrpn_IDEA::handle_request_channels_message(void* userdata, vrpn_HANDLERPARAM p) -{ - int i; - const char* bufptr = p.buffer; - vrpn_int32 num; - vrpn_int32 pad; - vrpn_IDEA* me = (vrpn_IDEA *)userdata; - - // Read the values from the buffer - vrpn_unbuffer(&bufptr, &num); - vrpn_unbuffer(&bufptr, &pad); - if (num > me->o_num_channel) { - char msg[1024]; - sprintf(msg,"vrpn_IDEA::handle_request_channels_message(): Index out of bounds (%d of %d), clipping\n", - num, me->o_num_channel); - me->send_text_message(msg, me->d_timestamp, vrpn_TEXT_ERROR); - num = me->o_num_channel; - } - for (i = 0; i < num; i++) { - vrpn_unbuffer(&bufptr, &(me->o_channel[i])); - me->send_move_request(me->o_channel[i]); - } - - return 0; -} - -/** When we get a connection request from a remote object, send our state so - they will know it to start with. */ -int vrpn_IDEA::handle_connect_message(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_IDEA *me = (vrpn_IDEA *)userdata; - - me->report(vrpn_CONNECTION_RELIABLE); - return 0; -} - -void vrpn_IDEA::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = d_timestamp; - vrpn_Button::timestamp = d_timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_IDEA::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = d_timestamp; - vrpn_Button::timestamp = d_timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -/** This routine is called each time through the server's main loop. It will - take a course of action depending on the current status of the device, - either trying to reset it or trying to get a reading from it. It will - try to reset the device if no data has come from it for a couple of - seconds -*/ - -void vrpn_IDEA::mainloop() -{ - char errmsg[256]; - - server_mainloop(); - - switch(status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - while (get_report()) {}; // Keep getting reports so long as there are more - - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,d_timestamp) > POLL_INTERVAL) { - - if (vrpn_TimevalDuration(current_time, d_last_poll) > TIMEOUT_TIME_INTERVAL) { - // Send another request to the unit, in case we've somehow - // dropped a request. - if (!send_command("l")) { - VRPN_MSG_ERROR("Could not request position"); - status = STATUS_RESETTING; - } - vrpn_gettimeofday(&d_last_poll, NULL); - } else { - return; - } - } - - if ( vrpn_TimevalDuration(current_time,d_timestamp) > TIMEOUT_TIME_INTERVAL) { - sprintf(errmsg,"Timeout, resetting... current_time=%ld:%ld, timestamp=%ld:%ld", - current_time.tv_sec, static_cast<long>(current_time.tv_usec), - d_timestamp.tv_sec, static_cast<long>(d_timestamp.tv_usec)); - VRPN_MSG_ERROR(errmsg); - status = STATUS_RESETTING; - } - } - break; - - default: - VRPN_MSG_ERROR("Unknown mode (internal error)"); - break; - } -} - diff --git a/src/vrpn/vrpn_IDEA.h b/src/vrpn/vrpn_IDEA.h deleted file mode 100644 index 834b15c18cee97aaedd9686051a63e1a29d77ce5..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_IDEA.h +++ /dev/null @@ -1,133 +0,0 @@ -#ifndef VRPN_IDEA_H -#define VRPN_IDEA_H - -//------------------------------------------------------------------------------ -// Driver for the Haydon-Kerk IDEA PCM4806X motor controller. -// This assumes that the operating system has provided a virtual COM port -// for the device, so that it can be opened as a serial device. Both -// Windows 7 and Ubuntu Linux provided this by default as of 8/6/2012. -// This driver does not support the daisy-chained configuration of the -// devices (which is available for RS-485 devices). If you do not find -// the serial device, you may need to install the device driver for the FTDI -// chipset it uses under Windows. - -// See http://www.haydonkerk.com/LinkClick.aspx?fileticket=LEcwYeRmKVg%3d&tabid=331 -// for the software manual for this device. - -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Analog_Output.h" // for vrpn_Analog_Output -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_RELIABLE, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_float64, vrpn_uint32 - -// XXX Add two buttons to the device, to report limit-switch state. - -class VRPN_API vrpn_IDEA: public vrpn_Serial_Analog, public vrpn_Analog_Output, - public vrpn_Button_Filter -{ -public: - vrpn_IDEA (const char * name, vrpn_Connection * c, const char * port - , int run_speed_tics_sec = 3200 - , int start_speed_tics_sec = 1200 - , int end_speed_tics_sec = 2000 - , int accel_rate_tics_sec_sec = 40000 - , int decel_rate_tics_sec_sec = 100000 - , int run_current = 290 - , int hold_current = 0 - , int accel_current = 290 - , int decel_current = 290 - , int delay = 50 - , int step = 8 // Microstepping to do; 1/step steps - , int high_limit_index = -1 // Input index for high limits switch (-1 for none) - , int low_limit_index = -1 // Input index fro low limit switch (-1 for none) - , int output_1_setting = -1 - , int output_2_setting = -1 - , int output_3_setting = -1 - , int output_4_setting = -1 - , double initial_move = 0 // Move to one end of travel when reset - , double fractional_c_a = 1.0 // Use lower accel and current during this move - , double reset_location = 0.0 // Where to set the value to after reset - ); - ~vrpn_IDEA () {}; - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - - protected: - unsigned char d_buffer[512]; //< Buffer of characters in report - unsigned d_bufcount; //< How many characters we have so far - - struct timeval d_timestamp; //< Time of the last report from the device - - int d_run_speed_tics_sec; - int d_start_speed_tics_sec; - int d_end_speed_tics_sec; - int d_accel_rate_tics_sec_sec; - int d_decel_rate_tics_sec_sec; - int d_run_current; - int d_hold_current; - int d_accel_current; - int d_decel_current; - int d_delay; - int d_step; - int d_high_limit_index; - int d_low_limit_index; - int d_output_1_setting; - int d_output_2_setting; - int d_output_3_setting; - int d_output_4_setting; - double d_initial_move; - double d_fractional_c_a; - double d_reset_location; - struct timeval d_last_poll; - - virtual int reset(void); //< Set device back to starting config - virtual int get_report(void); //< Try to read a report from the device - - /// Appends carriage-return and then sends the command. - // Returns true if all characters could be sent. Returns false - // on failure. - bool send_command(const char *cmd); - - /// Request a move from the motor to the specified location. - // Scale the acceleration and current values for the move by the - // specified fraction between 0 and 1. This lets us execute - // "gentler" moves for doing things like jamming against the rails, - // so we don't get stuck. - bool send_move_request(vrpn_float64 location_in_steps, double scale = 1.0); - - /// Send a move request and then wait for the move to complete. Repeat - // the command asking the motor to move until it says that we are no - // longer moving. - bool move_until_done_or_error(vrpn_float64 location_in_steps, double scale = 1.0); - - /// Parses a position report. Returns -1 on failure, 0 on no value - // found, and 1 on value found. Store the result into our analog channel 0. - int convert_report_to_position(unsigned char *buf); - - /// Parses an input/output report. Returns -1 on failure, 0 on no value - // found, and 1 on value found. Store the results of our input reads into - // buttons 0-3. - int convert_report_to_buttons(unsigned char *buf); - - /// send report iff changed - virtual void report_changes - (vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - /// send report whether or not changed - virtual void report - (vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - - /// Responds to a request to change one of the values by - /// setting the channel to that value. - static int VRPN_CALLBACK handle_request_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Responds to a request to change multiple channels at once. - static int VRPN_CALLBACK handle_request_channels_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Responds to a connection request with a report of the values - static int VRPN_CALLBACK handle_connect_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -#endif diff --git a/src/vrpn/vrpn_Imager.C b/src/vrpn/vrpn_Imager.C deleted file mode 100644 index 5d4cf70ff43668d9a1793fcfe31705e4d2a511e8..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Imager.C +++ /dev/null @@ -1,2044 +0,0 @@ -#include <stdio.h> // for fprintf, stderr, printf -#include <string.h> // for memcpy, NULL, strncpy - -#include "vrpn_Imager.h" - -vrpn_Imager::vrpn_Imager(const char *name, vrpn_Connection *c) - : vrpn_BaseClass(name, c) - , d_nRows(0) - , d_nCols(0) - , d_nDepth(0) - , d_nChannels(0) -{ - vrpn_BaseClass::init(); -} - -int vrpn_Imager::register_types(void) -{ - d_description_m_id = - d_connection->register_message_type("vrpn_Imager Description"); - d_begin_frame_m_id = - d_connection->register_message_type("vrpn_Imager Begin_Frame"); - d_end_frame_m_id = - d_connection->register_message_type("vrpn_Imager End_Frame"); - d_discarded_frames_m_id = - d_connection->register_message_type("vrpn_Imager Discarded_Frames"); - d_throttle_frames_m_id = - d_connection->register_message_type("vrpn_Imager Throttle_Frames"); - d_regionu8_m_id = - d_connection->register_message_type("vrpn_Imager Regionu8"); - d_regionu16_m_id = - d_connection->register_message_type("vrpn_Imager Regionu16"); - d_regionu12in16_m_id = - d_connection->register_message_type("vrpn_Imager Regionu12in16"); - d_regionf32_m_id = - d_connection->register_message_type("vrpn_Imager Regionf32"); - if ((d_description_m_id == -1) || (d_regionu8_m_id == -1) || - (d_regionu16_m_id == -1) || (d_regionf32_m_id == -1) || - (d_begin_frame_m_id == -1) || (d_end_frame_m_id == -1) || - (d_throttle_frames_m_id == -1) || (d_discarded_frames_m_id == -1)) { - return -1; - } - else { - return 0; - } -} - -vrpn_Imager_Server::vrpn_Imager_Server(const char *name, vrpn_Connection *c, - vrpn_int32 nCols, vrpn_int32 nRows, - vrpn_int32 nDepth) - : vrpn_Imager(name, c) - , d_description_sent(false) - , d_frames_to_send(-1) - , d_dropped_due_to_throttle(0) -{ - d_nRows = nRows; - d_nCols = nCols; - d_nDepth = nDepth; - - // Set up callback handler for ping message from client so that it - // sends the description. This will make sure that the other side has - // heard the descrption before it hears a region message. Also set this up - // to fire on the "new connection" system message. - - register_autodeleted_handler(d_ping_message_id, handle_ping_message, this, - d_sender_id); - register_autodeleted_handler( - d_connection->register_message_type(vrpn_got_connection), - handle_ping_message, this, vrpn_ANY_SENDER); - - // Set up a handler for the throttle message, which sets how many more - // frames to send before dropping them. Also set up a handler for the - // last-connection-dropped message, which will cause throttling to go - // back to -1. - register_autodeleted_handler(d_throttle_frames_m_id, - handle_throttle_message, this, d_sender_id); - register_autodeleted_handler( - d_connection->register_message_type(vrpn_dropped_last_connection), - handle_last_drop_message, this, vrpn_ANY_SENDER); -} - -int vrpn_Imager_Server::add_channel(const char *name, const char *units, - vrpn_float32 minVal, vrpn_float32 maxVal, - vrpn_float32 scale, vrpn_float32 offset) -{ - if (static_cast<unsigned>(d_nChannels) >= vrpn_IMAGER_MAX_CHANNELS) { - return -1; - } - strncpy(d_channels[d_nChannels].name, name, sizeof(cName)); - strncpy(d_channels[d_nChannels].units, units, sizeof(cName)); - d_channels[d_nChannels].minVal = minVal; - d_channels[d_nChannels].maxVal = maxVal; - if (scale == 0) { - fprintf( - stderr, - "vrpn_Imager_Server::add_channel(): Scale was zero, set to 1\n"); - scale = 1; - } - d_channels[d_nChannels].scale = scale; - d_channels[d_nChannels].offset = offset; - d_nChannels++; - - // We haven't sent a proper description now - d_description_sent = false; - return d_nChannels - 1; -} - -bool vrpn_Imager_Server::send_begin_frame( - const vrpn_uint16 cMin, const vrpn_uint16 cMax, const vrpn_uint16 rMin, - const vrpn_uint16 rMax, const vrpn_uint16 dMin, const vrpn_uint16 dMax, - const struct timeval *time) -{ - // msgbuf must be float64-aligned! It is the buffer to send to the client - vrpn_float64 fbuf[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64)]; - char *msgbuf = (char *)fbuf; - int buflen = sizeof(fbuf); - struct timeval timestamp; - - // If we are throttling frames and the frame count has gone to zero, - // then increment the number of frames missed and return failure to - // send. - if (d_frames_to_send == 0) { - d_dropped_due_to_throttle++; - return false; - } - - // If we missed some frames due to throttling, say so. - if (d_dropped_due_to_throttle > 0) { - send_discarded_frames(d_dropped_due_to_throttle); - d_dropped_due_to_throttle = 0; - } - - // If we are throttling, then decrement the number of frames - // left to send. - if (d_frames_to_send > 0) { - d_frames_to_send--; - } - - // Make sure the region request has indices all within the image size. - if ((rMax >= d_nRows) || (rMin > rMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_begin_frame(): Invalid row " - "range (%d..%d)\n", - rMin, rMax); - return false; - } - if ((cMax >= d_nCols) || (cMin > cMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_begin_frame(): Invalid " - "column range (%d..%d)\n", - cMin, cMax); - return false; - } - if ((dMax >= d_nDepth) || (dMin > dMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_begin_frame(): Invalid depth " - "range (%d..%d)\n", - dMin, dMax); - return false; - } - - // If the user didn't specify a time, assume they want "now" and look it up. - if (time != NULL) { - timestamp = *time; - } - else { - vrpn_gettimeofday(×tamp, NULL); - } - - // Tell what the borders of the region are. - if (vrpn_buffer(&msgbuf, &buflen, dMin) || - vrpn_buffer(&msgbuf, &buflen, dMax) || - vrpn_buffer(&msgbuf, &buflen, rMin) || - vrpn_buffer(&msgbuf, &buflen, rMax) || - vrpn_buffer(&msgbuf, &buflen, cMin) || - vrpn_buffer(&msgbuf, &buflen, cMax)) { - return false; - } - - // Pack the message - vrpn_int32 len = sizeof(fbuf) - buflen; - if (d_connection && - d_connection->pack_message(len, timestamp, d_begin_frame_m_id, - d_sender_id, (char *)(void *)fbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Imager_Server::send_begin_frame(): cannot write " - "message: tossing\n"); - return false; - } - - return true; -} - -bool vrpn_Imager_Server::send_end_frame( - const vrpn_uint16 cMin, const vrpn_uint16 cMax, const vrpn_uint16 rMin, - const vrpn_uint16 rMax, const vrpn_uint16 dMin, const vrpn_uint16 dMax, - const struct timeval *time) -{ - // msgbuf must be float64-aligned! It is the buffer to send to the client - vrpn_float64 fbuf[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64)]; - char *msgbuf = (char *)fbuf; - int buflen = sizeof(fbuf); - struct timeval timestamp; - - // If we are discarding frames, return failure to send. - if (d_dropped_due_to_throttle > 0) { - return false; - } - - // Make sure the region request has indices all within the image size. - if ((rMax >= d_nRows) || (rMin > rMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_end_frame(): Invalid row " - "range (%d..%d)\n", - rMin, rMax); - return false; - } - if ((cMax >= d_nCols) || (cMin > cMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_end_frame(): Invalid column " - "range (%d..%d)\n", - cMin, cMax); - return false; - } - if ((dMax >= d_nDepth) || (dMin > dMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_end_frame(): Invalid depth " - "range (%d..%d)\n", - dMin, dMax); - return false; - } - - // If the user didn't specify a time, assume they want "now" and look it up. - if (time != NULL) { - timestamp = *time; - } - else { - vrpn_gettimeofday(×tamp, NULL); - } - - // Tell what the borders of the region are. - if (vrpn_buffer(&msgbuf, &buflen, dMin) || - vrpn_buffer(&msgbuf, &buflen, dMax) || - vrpn_buffer(&msgbuf, &buflen, rMin) || - vrpn_buffer(&msgbuf, &buflen, rMax) || - vrpn_buffer(&msgbuf, &buflen, cMin) || - vrpn_buffer(&msgbuf, &buflen, cMax)) { - return false; - } - - // Pack the message - vrpn_int32 len = sizeof(fbuf) - buflen; - if (d_connection && - d_connection->pack_message(len, timestamp, d_end_frame_m_id, - d_sender_id, (char *)(void *)fbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Imager_Server::send_end_frame(): cannot write " - "message: tossing\n"); - return false; - } - - return true; -} - -bool vrpn_Imager_Server::send_discarded_frames(const vrpn_uint16 count, - const struct timeval *time) -{ - // msgbuf must be float64-aligned! It is the buffer to send to the client - vrpn_float64 fbuf[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64)]; - char *msgbuf = (char *)fbuf; - int buflen = sizeof(fbuf); - struct timeval timestamp; - - // If the user didn't specify a time, assume they want "now" and look it up. - if (time != NULL) { - timestamp = *time; - } - else { - vrpn_gettimeofday(×tamp, NULL); - } - - // Tell how many frames were skipped. - if (vrpn_buffer(&msgbuf, &buflen, count)) { - return false; - } - - // Pack the message - vrpn_int32 len = sizeof(fbuf) - buflen; - if (d_connection && - d_connection->pack_message(len, timestamp, d_discarded_frames_m_id, - d_sender_id, (char *)(void *)fbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Imager_Server::send_discarded_frames(): cannot " - "write message: tossing\n"); - return false; - } - - return true; -} - -// XXX Re-cast the memcpy loop in terms of offsets (the same way the per-element -// loop is done) and share base calculation between the two; move the if -// statement -// into the inner loop, doing it memcpy or step-at-a-time. - -/** As efficiently as possible, pull the values out of the array whose pointer - is passed - in and send them over a VRPN connection as a region message that is - appropriate for - the type that has been passed in (the type that data points to). - Chanindex: What channel this region holds data for - cMin, cMax: Range of columns to extract from this data set - rMin, rMax: Range of rows to extract from this data set - data: Points at the (0,0) element of the 2D array that holds the image. - It is assumed that the data values should be copied exactly, and that - offset and scale should be applied at the reading end by the user if - they want to get them back into absolute units. - colStride, rowStride, depthStride: Number of elements (size of data type) - to skip along a column, row, and depth - nRows, invert_rows: If invert_rows is true, then nRows must be set to the - number of rows - in the entire image. If invert_rows is false, then nRows is not used. - time: What time the message should have associated with it (NULL pointer - for "now") -*/ - -bool vrpn_Imager_Server::send_region_using_base_pointer( - vrpn_int16 chanIndex, vrpn_uint16 cMin, vrpn_uint16 cMax, vrpn_uint16 rMin, - vrpn_uint16 rMax, const vrpn_uint8 *data, vrpn_uint32 colStride, - vrpn_uint32 rowStride, vrpn_uint16 nRows, bool invert_rows, - vrpn_uint32 depthStride, vrpn_uint16 dMin, vrpn_uint16 dMax, - const struct timeval *time) -{ - // msgbuf must be float64-aligned! It is the buffer to send to the client; - vrpn_float64 fbuf[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64)]; - char *msgbuf = reinterpret_cast<char *>(fbuf); - int buflen = sizeof(fbuf); - struct timeval timestamp; - - // If we are discarding frames, return failure to send. - if (d_dropped_due_to_throttle > 0) { - return false; - } - - // Make sure the region request has a valid channel, has indices all - // within the image size, and is not too large to fit into the data - // array (which is sized the way it is to make sure it can be sent in - // one VRPN reliable message). - if ((chanIndex < 0) || (chanIndex >= d_nChannels)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Invalid channel index (%d)\n", - chanIndex); - return false; - } - if ((dMax >= d_nDepth) || (dMin > dMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Invalid depth range (%d..%d)\n", - dMin, dMax); - return false; - } - if ((rMax >= d_nRows) || (rMin > rMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Invalid row range (%d..%d)\n", - rMin, rMax); - return false; - } - if ((cMax >= d_nCols) || (cMin > cMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Invalid column range (%d..%d)\n", - cMin, cMax); - return false; - } - if (static_cast<unsigned>((rMax - rMin + 1) * (cMax - cMin + 1) * - (dMax - dMin + 1)) > vrpn_IMAGER_MAX_REGIONu8) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Region too large (%d,%d,%d to %d,%d,%d)\n", - cMin, rMin, dMin, cMax, rMax, dMax); - return false; - } - if (invert_rows && (nRows < rMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "nRows must not be less than rMax\n"); - return false; - } - - // Make sure we've sent the description before we send any regions - if (!d_description_sent) { - send_description(); - d_description_sent = true; - } - - // If the user didn't specify a time, assume they want "now" and look it up. - if (time != NULL) { - timestamp = *time; - } - else { - vrpn_gettimeofday(×tamp, NULL); - } - - // Check the compression status and prepare to do compression if it is - // called for. - if (d_channels[chanIndex].d_compression != vrpn_Imager_Channel::NONE) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Compression not implemented\n"); - return false; - } - - // Tell which channel this region is for, and what the borders of the - // region are. - if (vrpn_buffer(&msgbuf, &buflen, chanIndex) || - vrpn_buffer(&msgbuf, &buflen, dMin) || - vrpn_buffer(&msgbuf, &buflen, dMax) || - vrpn_buffer(&msgbuf, &buflen, rMin) || - vrpn_buffer(&msgbuf, &buflen, rMax) || - vrpn_buffer(&msgbuf, &buflen, cMin) || - vrpn_buffer(&msgbuf, &buflen, cMax) || - vrpn_buffer(&msgbuf, &buflen, vrpn_IMAGER_VALTYPE_UINT8)) { - return false; - } - - // Insert the data into the buffer, copying it as efficiently as possible - // from the caller's buffer into the buffer we are going to send. Note that - // the send buffer is going to be little-endian. The code looks a little - // complicated because it short-circuits the copying for the case where the - // column stride is one element long (using memcpy() on each row) but has to - // copy one element at a time otherwise. - // There is also the matter if deciding whether to invert the image in y, - // which complicates the index calculation and the calculation of the - // strides. - int cols = cMax - cMin + 1; - int linelen = cols * sizeof(data[0]); - if (colStride == 1) { - for (unsigned d = dMin; d <= dMax; d++) { - for (unsigned r = rMin; r <= rMax; r++) { - unsigned rActual; - if (invert_rows) { - rActual = (nRows - 1) - r; - } - else { - rActual = r; - } - if (buflen < linelen) { - return false; - } - memcpy(msgbuf, - &data[d * depthStride + rActual * rowStride + cMin], - linelen); - msgbuf += linelen; - buflen -= linelen; - } - } - } - else { - if (buflen < (int)((dMax - dMin + 1) * (rMax - rMin + 1) * - (cMax - cMin + 1) * sizeof(data[0]))) { - return false; - } - long rowStep = rowStride; - if (invert_rows) { - rowStep *= -1; - } - for (unsigned d = dMin; d <= dMax; d++) { - // XXX Turn the depth calculation into start and += like the others - const vrpn_uint8 *rowStart = - &data[d * depthStride + rMin * rowStride + cMin]; - if (invert_rows) { - rowStart = &data[d * depthStride + - (nRows - 1 - rMin) * rowStride + cMin]; - } - const vrpn_uint8 *copyFrom = rowStart; - for (unsigned r = rMin; r <= rMax; r++) { - for (unsigned c = cMin; c <= cMax; c++) { - *reinterpret_cast<vrpn_uint8 *>(msgbuf) = - *copyFrom; //< Copy the current element - msgbuf++; //< Skip to the next buffer location - copyFrom += - colStride; //< Skip appropriate number of elements - } - rowStart += rowStep; //< Skip to the start of the next row - copyFrom = rowStart; - } - } - buflen -= (rMax - rMin + 1) * (cMax - cMin + 1) * sizeof(data[0]); - } - - // No need to swap endian-ness on single-byte elements. - - // Pack the message - vrpn_int32 len = sizeof(fbuf) - buflen; - if (d_connection && - d_connection->pack_message(len, timestamp, d_regionu8_m_id, d_sender_id, - (char *)(void *)fbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "cannot write message: tossing\n"); - return false; - } - - return true; -} - -/** As efficiently as possible, pull the values out of the array whose pointer - is passed - in and send them over a VRPN connection as a region message that is - appropriate for - the type that has been passed in (the type that data points to). - Chanindex: What channel this region holds data for - cMin, cMax: Range of columns to extract from this data set - rMin, rMax: Range of rows to extract from this data set - data: Points at the (0,0) element of the 2D array that holds the image. - It is assumed that the data values should be copied exactly, and that - offset and scale should be applied at the reading end by the user if - they want to get them back into absolute units. - colStride, rowStride: Number of elements (size of data type) to skip along - a column and row - nRows, invert_rows: If invert_rows is true, then nRows must be set to the - number of rows - in the entire image. If invert_rows is false, then nRows is not used. - time: What time the message should have associated with it (NULL pointer - for "now") -*/ - -bool vrpn_Imager_Server::send_region_using_base_pointer( - vrpn_int16 chanIndex, vrpn_uint16 cMin, vrpn_uint16 cMax, vrpn_uint16 rMin, - vrpn_uint16 rMax, const vrpn_uint16 *data, vrpn_uint32 colStride, - vrpn_uint32 rowStride, vrpn_uint16 nRows, bool invert_rows, - vrpn_uint32 depthStride, vrpn_uint16 dMin, vrpn_uint16 dMax, - const struct timeval *time) -{ - // msgbuf must be float64-aligned! It is the buffer to send to the client - vrpn_float64 fbuf[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64)]; - char *msgbuf = (char *)fbuf; - int buflen = sizeof(fbuf); - struct timeval timestamp; - - // If we are discarding frames, return failure to send. - if (d_dropped_due_to_throttle > 0) { - return false; - } - - // Make sure the region request has a valid channel, has indices all - // within the image size, and is not too large to fit into the data - // array (which is sized the way it is to make sure it can be sent in - // one VRPN reliable message). - if ((chanIndex < 0) || (chanIndex >= d_nChannels)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Invalid channel index (%d)\n", - chanIndex); - return false; - } - if ((dMax >= d_nDepth) || (dMin > dMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Invalid depth range (%d..%d)\n", - dMin, dMax); - return false; - } - if ((rMax >= d_nRows) || (rMin > rMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Invalid row range (%d..%d)\n", - rMin, rMax); - return false; - } - if ((cMax >= d_nCols) || (cMin > cMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Invalid column range (%d..%d)\n", - cMin, cMax); - return false; - } - if (static_cast<unsigned>((rMax - rMin + 1) * (cMax - cMin + 1) * - (dMax - dMin + 1)) > vrpn_IMAGER_MAX_REGIONu16) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Region too large (%d,%d,%d to %d,%d,%d)\n", - cMin, rMin, dMin, cMax, rMax, dMax); - return false; - } - if (invert_rows && (nRows < rMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "nRows must not be less than rMax\n"); - return false; - } - - // Make sure we've sent the description before we send any regions - if (!d_description_sent) { - send_description(); - d_description_sent = true; - } - - // If the user didn't specify a time, assume they want "now" and look it up. - if (time != NULL) { - timestamp = *time; - } - else { - vrpn_gettimeofday(×tamp, NULL); - } - - // Check the compression status and prepare to do compression if it is - // called for. - if (d_channels[chanIndex].d_compression != vrpn_Imager_Channel::NONE) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Compression not implemented\n"); - return false; - } - - // Tell which channel this region is for, and what the borders of the - // region are. - if (vrpn_buffer(&msgbuf, &buflen, chanIndex) || - vrpn_buffer(&msgbuf, &buflen, dMin) || - vrpn_buffer(&msgbuf, &buflen, dMax) || - vrpn_buffer(&msgbuf, &buflen, rMin) || - vrpn_buffer(&msgbuf, &buflen, rMax) || - vrpn_buffer(&msgbuf, &buflen, cMin) || - vrpn_buffer(&msgbuf, &buflen, cMax) || - vrpn_buffer(&msgbuf, &buflen, vrpn_IMAGER_VALTYPE_UINT16)) { - return false; - } - - // Insert the data into the buffer, copying it as efficiently as possible - // from the caller's buffer into the buffer we are going to send. Note that - // the send buffer is going to be little-endian. The code looks a little - // complicated because it short-circuits the copying for the case where the - // column stride is one element long (using memcpy() on each row) but has to - // copy one element at a time otherwise. - // There is also the matter if deciding whether to invert the image in y, - // which complicates the index calculation and the calculation of the - // strides. - int cols = cMax - cMin + 1; - int linelen = cols * sizeof(data[0]); - if (colStride == 1) { - for (unsigned d = dMin; d <= dMax; d++) { - for (unsigned r = rMin; r <= rMax; r++) { - unsigned rActual; - if (invert_rows) { - rActual = (nRows - 1) - r; - } - else { - rActual = r; - } - if (buflen < linelen) { - return false; - } - memcpy(msgbuf, - &data[d * depthStride + rActual * rowStride + cMin], - linelen); - msgbuf += linelen; - buflen -= linelen; - } - } - } - else { - if (buflen < (int)((dMax - dMin + 1) * (rMax - rMin + 1) * - (cMax - cMin + 1) * sizeof(data[0]))) { - return false; - } - long rowStep = rowStride; - if (invert_rows) { - rowStep *= -1; - } - for (unsigned d = dMin; d <= dMax; d++) { - // XXX Turn the depth calculation into start and += like the others - const vrpn_uint16 *rowStart = - &data[d * depthStride + rMin * rowStride + cMin]; - if (invert_rows) { - rowStart = &data[d * depthStride + - (nRows - 1 - rMin) * rowStride + cMin]; - } - const vrpn_uint16 *copyFrom = rowStart; - for (unsigned r = rMin; r <= rMax; r++) { - for (unsigned c = cMin; c <= cMax; c++) { - memcpy(msgbuf, copyFrom, sizeof(*copyFrom)); - msgbuf += - sizeof(*copyFrom); //< Skip to the next buffer location - copyFrom += - colStride; //< Skip appropriate number of elements - } - rowStart += rowStep; //< Skip to the start of the next row - copyFrom = rowStart; - } - } - buflen -= (rMax - rMin + 1) * (cMax - cMin + 1) * sizeof(data[0]); - } - - // Swap endian-ness of the buffer if we are on a big-endian machine. - if (vrpn_big_endian) { - fprintf(stderr, "XXX Imager Region needs swapping on Big-endian\n"); - return false; - } - - // Pack the message - vrpn_int32 len = sizeof(fbuf) - buflen; - if (d_connection && - d_connection->pack_message(len, timestamp, d_regionu16_m_id, - d_sender_id, (char *)(void *)fbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "cannot write message: tossing\n"); - return false; - } - - return true; -} - -/** As efficiently as possible, pull the values out of the array whose pointer - is passed - in and send them over a VRPN connection as a region message that is - appropriate for - the type that has been passed in (the type that data points to). - Chanindex: What channel this region holds data for - cMin, cMax: Range of columns to extract from this data set - rMin, rMax: Range of rows to extract from this data set - data: Points at the (0,0) element of the 2D array that holds the image. - It is assumed that the data values should be copied exactly, and that - offset and scale should be applied at the reading end by the user if - they want to get them back into absolute units. - colStride, rowStride: Number of elements (size of data type) to skip along - a column and row - nRows, invert_rows: If invert_rows is true, then nRows must be set to the - number of rows - in the entire image. If invert_rows is false, then nRows is not used. - time: What time the message should have associated with it (NULL pointer - for "now") -*/ - -bool vrpn_Imager_Server::send_region_using_base_pointer( - vrpn_int16 chanIndex, vrpn_uint16 cMin, vrpn_uint16 cMax, vrpn_uint16 rMin, - vrpn_uint16 rMax, const vrpn_float32 *data, vrpn_uint32 colStride, - vrpn_uint32 rowStride, vrpn_uint16 nRows, bool invert_rows, - vrpn_uint32 depthStride, vrpn_uint16 dMin, vrpn_uint16 dMax, - const struct timeval *time) -{ - // msgbuf must be float64-aligned! It is the buffer to send to the client - vrpn_float64 fbuf[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64)]; - char *msgbuf = (char *)fbuf; - int buflen = sizeof(fbuf); - struct timeval timestamp; - - // If we are discarding frames, return failure to send. - if (d_dropped_due_to_throttle > 0) { - return false; - } - - // Make sure the region request has a valid channel, has indices all - // within the image size, and is not too large to fit into the data - // array (which is sized the way it is to make sure it can be sent in - // one VRPN reliable message). - if ((chanIndex < 0) || (chanIndex >= d_nChannels)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Invalid channel index (%d)\n", - chanIndex); - return false; - } - if ((dMax >= d_nDepth) || (dMin > dMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Invalid depth range (%d..%d)\n", - dMin, dMax); - return false; - } - if ((rMax >= d_nRows) || (rMin > rMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Invalid row range (%d..%d)\n", - rMin, rMax); - return false; - } - if ((cMax >= d_nCols) || (cMin > cMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Invalid column range (%d..%d)\n", - cMin, cMax); - return false; - } - if (static_cast<unsigned>((rMax - rMin + 1) * (cMax - cMin + 1) * - (dMax - dMin + 1)) > vrpn_IMAGER_MAX_REGIONf32) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Region too large (%d,%d,%d to %d,%d,%d)\n", - cMin, rMin, dMin, cMax, rMax, dMax); - return false; - } - if (invert_rows && (nRows < rMax)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "nRows must not be less than rMax\n"); - return false; - } - - // Make sure we've sent the description before we send any regions - if (!d_description_sent) { - send_description(); - d_description_sent = true; - } - - // If the user didn't specify a time, assume they want "now" and look it up. - if (time != NULL) { - timestamp = *time; - } - else { - vrpn_gettimeofday(×tamp, NULL); - } - - // Check the compression status and prepare to do compression if it is - // called for. - if (d_channels[chanIndex].d_compression != vrpn_Imager_Channel::NONE) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "Compression not implemented\n"); - return false; - } - - // Tell which channel this region is for, and what the borders of the - // region are. - if (vrpn_buffer(&msgbuf, &buflen, chanIndex) || - vrpn_buffer(&msgbuf, &buflen, dMin) || - vrpn_buffer(&msgbuf, &buflen, dMax) || - vrpn_buffer(&msgbuf, &buflen, rMin) || - vrpn_buffer(&msgbuf, &buflen, rMax) || - vrpn_buffer(&msgbuf, &buflen, cMin) || - vrpn_buffer(&msgbuf, &buflen, cMax) || - vrpn_buffer(&msgbuf, &buflen, vrpn_IMAGER_VALTYPE_FLOAT32)) { - return false; - } - - // Insert the data into the buffer, copying it as efficiently as possible - // from the caller's buffer into the buffer we are going to send. Note that - // the send buffer is going to be little-endian. The code looks a little - // complicated because it short-circuits the copying for the case where the - // column stride is one element long (using memcpy() on each row) but has to - // copy one element at a time otherwise. - // There is also the matter if deciding whether to invert the image in y, - // which complicates the index calculation and the calculation of the - // strides. - int cols = cMax - cMin + 1; - int linelen = cols * sizeof(data[0]); - if (colStride == 1) { - for (unsigned d = dMin; d <= dMax; d++) { - for (unsigned r = rMin; r <= rMax; r++) { - unsigned rActual; - if (invert_rows) { - rActual = (nRows - 1) - r; - } - else { - rActual = r; - } - if (buflen < linelen) { - return false; - } - memcpy(msgbuf, - &data[d * depthStride + rActual * rowStride + cMin], - linelen); - msgbuf += linelen; - buflen -= linelen; - } - } - } - else { - if (buflen < (int)((dMax - dMin + 1) * (rMax - rMin + 1) * - (cMax - cMin + 1) * sizeof(data[0]))) { - return false; - } - long rowStep = rowStride; - if (invert_rows) { - rowStep *= -1; - } - for (unsigned d = dMin; d <= dMax; d++) { - // XXX Turn the depth calculation into start and += like the others - const vrpn_float32 *rowStart = - &data[d * depthStride + rMin * rowStride + cMin]; - if (invert_rows) { - rowStart = &data[d * depthStride + - (nRows - 1 - rMin) * rowStride + cMin]; - } - const vrpn_float32 *copyFrom = rowStart; - for (unsigned r = rMin; r <= rMax; r++) { - for (unsigned c = cMin; c <= cMax; c++) { - memcpy(msgbuf, copyFrom, sizeof(*copyFrom)); - msgbuf += - sizeof(*copyFrom); //< Skip to the next buffer location - copyFrom += - colStride; //< Skip appropriate number of elements - } - rowStart += rowStep; //< Skip to the start of the next row - copyFrom = rowStart; - } - } - buflen -= (rMax - rMin + 1) * (cMax - cMin + 1) * sizeof(data[0]); - } - - // Swap endian-ness of the buffer if we are on a big-endian machine. - if (vrpn_big_endian) { - fprintf(stderr, "XXX Imager Region needs swapping on Big-endian\n"); - return false; - } - - // Pack the message - vrpn_int32 len = sizeof(fbuf) - buflen; - if (d_connection && - d_connection->pack_message(len, timestamp, d_regionf32_m_id, - d_sender_id, (char *)(void *)fbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_base_pointer(): " - "cannot write message: tossing\n"); - return false; - } - - return true; -} - -/** As efficiently as possible, pull the values out of the array whose pointer - is passed - in and send them over a VRPN connection as a region message that is - appropriate for - the type that has been passed in (the type that data points to). - Chanindex: What channel this region holds data for - cMin, cMax: Range of columns to extract from this data set - rMin, rMax: Range of rows to extract from this data set - data: Points at the (cMin,rMin) element of the 2D array that holds the - image. - It is assumed that the data values should be copied exactly, and that - offset and scale should be applied at the reading end by the user if - they want to get them back into absolute units. - colStride, rowStride: Number of elements (size of data type) to skip along - a column and row - nRows, invert_rows: If invert_rows is true, then nRows must be set to the - number of rows - in the entire image. If invert_rows is false, then nRows is not used. - time: What time the message should have associated with it (NULL pointer - for "now") -*/ - -bool vrpn_Imager_Server::send_region_using_first_pointer( - vrpn_int16 chanIndex, vrpn_uint16 cMin, vrpn_uint16 cMax, vrpn_uint16 rMin, - vrpn_uint16 rMax, const vrpn_uint8 *data, vrpn_uint32 colStride, - vrpn_uint32 rowStride, vrpn_uint16 nRows, bool invert_rows, - vrpn_uint32 depthStride, vrpn_uint16 dMin, vrpn_uint16 dMax, - const struct timeval *time) -{ - // If we are discarding frames, return failure to send. - if (d_dropped_due_to_throttle > 0) { - return false; - } - - // Point the data pointer back before the first pointer, to the place it - // should be to make the index math work out. - const vrpn_uint8 *new_base = - data - (cMin + rowStride * rMin + depthStride * dMin); - if (send_region_using_base_pointer( - chanIndex, cMin, cMax, rMin, rMax, new_base, colStride, rowStride, - nRows, invert_rows, depthStride, dMin, dMax, time)) { - return true; - } - else { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_first_pointer():" - " Call to send using offset base_pointer failed.\n"); - return false; - } -} - -/** As efficiently as possible, pull the values out of the array whose pointer - is passed - in and send them over a VRPN connection as a region message that is - appropriate for - the type that has been passed in (the type that data points to). - Chanindex: What channel this region holds data for - cMin, cMax: Range of columns to extract from this data set - rMin, rMax: Range of rows to extract from this data set - data: Points at the (cMin, rMin) element of the 2D array that holds the - image. - It is assumed that the data values should be copied exactly, and that - offset and scale should be applied at the reading end by the user if - they want to get them back into absolute units. - colStride, rowStride: Number of elements (size of data type) to skip along - a column and row - nRows, invert_rows: If invert_rows is true, then nRows must be set to the - number of rows - in the entire image. If invert_rows is false, then nRows is not used. - time: What time the message should have associated with it (NULL pointer - for "now") -*/ - -bool vrpn_Imager_Server::send_region_using_first_pointer( - vrpn_int16 chanIndex, vrpn_uint16 cMin, vrpn_uint16 cMax, vrpn_uint16 rMin, - vrpn_uint16 rMax, const vrpn_uint16 *data, vrpn_uint32 colStride, - vrpn_uint32 rowStride, vrpn_uint16 nRows, bool invert_rows, - vrpn_uint32 depthStride, vrpn_uint16 dMin, vrpn_uint16 dMax, - const struct timeval *time) -{ - // If we are discarding frames, return failure to send. - if (d_dropped_due_to_throttle > 0) { - return false; - } - - // Point the data pointer back before the first pointer, to the place it - // should be to make the index math work out. - const vrpn_uint16 *new_base = - data - (cMin + rowStride * rMin + depthStride * dMin); - if (send_region_using_base_pointer( - chanIndex, cMin, cMax, rMin, rMax, new_base, colStride, rowStride, - nRows, invert_rows, depthStride, dMin, dMax, time)) { - return true; - } - else { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_first_pointer():" - " Call to send using offset base_pointer failed.\n"); - return false; - } -} - -/** As efficiently as possible, pull the values out of the array whose pointer - is passed - in and send them over a VRPN connection as a region message that is - appropriate for - the type that has been passed in (the type that data points to). - Chanindex: What channel this region holds data for - cMin, cMax: Range of columns to extract from this data set - rMin, rMax: Range of rows to extract from this data set - data: Points at the (cMin, rMin) element of the 2D array that holds the - image. - It is assumed that the data values should be copied exactly, and that - offset and scale should be applied at the reading end by the user if - they want to get them back into absolute units. - colStride, rowStride: Number of elements (size of data type) to skip along - a column and row - nRows, invert_rows: If invert_rows is true, then nRows must be set to the - number of rows - in the entire image. If invert_rows is false, then nRows is not used. - time: What time the message should have associated with it (NULL pointer - for "now") -*/ - -bool vrpn_Imager_Server::send_region_using_first_pointer( - vrpn_int16 chanIndex, vrpn_uint16 cMin, vrpn_uint16 cMax, vrpn_uint16 rMin, - vrpn_uint16 rMax, const vrpn_float32 *data, vrpn_uint32 colStride, - vrpn_uint32 rowStride, vrpn_uint16 nRows, bool invert_rows, - vrpn_uint32 depthStride, vrpn_uint16 dMin, vrpn_uint16 dMax, - const struct timeval *time) -{ - // If we are discarding frames, return failure to send. - if (d_dropped_due_to_throttle > 0) { - return false; - } - - // Point the data pointer back before the first pointer, to the place it - // should be to make the index math work out. - const vrpn_float32 *new_base = - data - (cMin + rowStride * rMin + depthStride * dMin); - if (send_region_using_base_pointer( - chanIndex, cMin, cMax, rMin, rMax, new_base, colStride, rowStride, - nRows, invert_rows, depthStride, dMin, dMax, time)) { - return true; - } - else { - fprintf(stderr, "vrpn_Imager_Server::send_region_using_first_pointer():" - " Call to send using offset base_pointer failed.\n"); - return false; - } -} - -bool vrpn_Imager_Server::send_description(void) -{ - // msgbuf must be float64-aligned! - vrpn_float64 fbuf[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64)]; - char *msgbuf = (char *)fbuf; - int buflen = sizeof(fbuf); - struct timeval timestamp; - int i; - - // Pack the description of all of the fields in the imager into the buffer, - // including the channel descriptions. - if (vrpn_buffer(&msgbuf, &buflen, d_nDepth) || - vrpn_buffer(&msgbuf, &buflen, d_nRows) || - vrpn_buffer(&msgbuf, &buflen, d_nCols) || - vrpn_buffer(&msgbuf, &buflen, d_nChannels)) { - fprintf(stderr, "vrpn_Imager_Server::send_description(): Can't pack " - "message header, tossing\n"); - return false; - } - for (i = 0; i < d_nChannels; i++) { - if (!d_channels[i].buffer(&msgbuf, &buflen)) { - fprintf(stderr, "vrpn_Imager_Server::send_description(): Can't " - "pack message channel, tossing\n"); - return false; - } - } - - // Pack the buffer into the connection's outgoing reliable queue, if we have - // a valid connection. - vrpn_int32 len = sizeof(fbuf) - buflen; - vrpn_gettimeofday(×tamp, NULL); - if (d_connection && - d_connection->pack_message(len, timestamp, d_description_m_id, - d_sender_id, (char *)(void *)fbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Imager_Server::send_description(): cannot write " - "message: tossing\n"); - return false; - } - - d_description_sent = true; - return true; -} - -bool vrpn_Imager_Server::set_resolution(vrpn_int32 nCols, vrpn_int32 nRows, - vrpn_int32 nDepth) -{ - if ((nCols <= 0) || (nRows <= 0) || (nDepth <= 0)) { - fprintf( - stderr, - "vrpn_Imager_Server::set_resolution(): Invalid size (%d, %d, %d)\n", - nCols, nRows, nDepth); - return false; - } - d_nDepth = nDepth; - d_nCols = nCols; - d_nRows = nRows; - return send_description(); -} - -void vrpn_Imager_Server::mainloop(void) { server_mainloop(); } - -int vrpn_Imager_Server::handle_ping_message(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_Imager_Server *me = (vrpn_Imager_Server *)userdata; - me->send_description(); - return 0; -} - -int vrpn_Imager_Server::handle_throttle_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_Imager_Server *me = (vrpn_Imager_Server *)userdata; - - // Get the requested number of frames from the buffer - vrpn_int32 frames_to_send; - if (vrpn_unbuffer(&bufptr, &frames_to_send)) { - return -1; - } - - // If the requested number of frames is negative, then we set - // for unbounded sending. The next time a begin_frame message - // is sent, it will start the process going again. - if (frames_to_send < 0) { - me->d_frames_to_send = -1; - return 0; - } - - // If we were sending continuously, store the number of frames - // to send. - if (me->d_frames_to_send == -1) { - me->d_frames_to_send = frames_to_send; - - // If we already had a throttle limit set, then increment it - // by the count. - } - else { - me->d_frames_to_send += frames_to_send; - } - - return 0; -} - -int vrpn_Imager_Server::handle_last_drop_message(void *userdata, - vrpn_HANDLERPARAM) -{ - vrpn_Imager_Server *me = (vrpn_Imager_Server *)userdata; - - // Last connection has dropped, so set the throttling behavior back to - // the default, which is to send as fast as we can. - me->d_frames_to_send = -1; - me->d_dropped_due_to_throttle = 0; - return 0; -} - -vrpn_Imager_Remote::vrpn_Imager_Remote(const char *name, vrpn_Connection *c) - : vrpn_Imager(name, c) - , d_got_description(false) -{ - // Register the handlers for the description message and the region change - // messages - register_autodeleted_handler(d_description_m_id, handle_description_message, - this, d_sender_id); - - // Register the region-handling messages for the different message types. - // All of the types use the same handler, since the type of region is - // encoded - // in one of the parameters of the region function. - register_autodeleted_handler(d_regionu8_m_id, handle_region_message, this, - d_sender_id); - register_autodeleted_handler(d_regionu16_m_id, handle_region_message, this, - d_sender_id); - register_autodeleted_handler(d_regionf32_m_id, handle_region_message, this, - d_sender_id); - register_autodeleted_handler(d_begin_frame_m_id, handle_begin_frame_message, - this, d_sender_id); - register_autodeleted_handler(d_end_frame_m_id, handle_end_frame_message, - this, d_sender_id); - register_autodeleted_handler(d_discarded_frames_m_id, - handle_discarded_frames_message, this, - d_sender_id); - - // Register the handler for the connection dropped message - register_autodeleted_handler( - d_connection->register_message_type(vrpn_dropped_connection), - handle_connection_dropped_message, this); -} - -void vrpn_Imager_Remote::mainloop(void) -{ - client_mainloop(); - if (d_connection) { - d_connection->mainloop(); - }; -} - -const vrpn_Imager_Channel *vrpn_Imager_Remote::channel(unsigned chanNum) const -{ - if (chanNum >= (unsigned)d_nChannels) { - return NULL; - } - return &d_channels[chanNum]; -} - -int vrpn_Imager_Remote::handle_description_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_Imager_Remote *me = (vrpn_Imager_Remote *)userdata; - int i; - - // Get my new information from the buffer - if (vrpn_unbuffer(&bufptr, &me->d_nDepth) || - vrpn_unbuffer(&bufptr, &me->d_nRows) || - vrpn_unbuffer(&bufptr, &me->d_nCols) || - vrpn_unbuffer(&bufptr, &me->d_nChannels)) { - return -1; - } - for (i = 0; i < me->d_nChannels; i++) { - if (!me->d_channels[i].unbuffer(&bufptr)) { - return -1; - } - } - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->d_description_list.call_handlers(p.msg_time); - - me->d_got_description = true; - return 0; -} - -int vrpn_Imager_Remote::handle_region_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_Imager_Remote *me = (vrpn_Imager_Remote *)userdata; - vrpn_IMAGERREGIONCB rp; - vrpn_Imager_Region reg; - - // Create an instance of a region helper class and read its - // parameters from the buffer (setting its _valBuf pointer at - // the start of the data in the buffer). Set it to valid and then - // call the user callback and then set it to invalid before - // deleting it. - if (vrpn_unbuffer(&bufptr, ®.d_chanIndex) || - vrpn_unbuffer(&bufptr, ®.d_dMin) || - vrpn_unbuffer(&bufptr, ®.d_dMax) || - vrpn_unbuffer(&bufptr, ®.d_rMin) || - vrpn_unbuffer(&bufptr, ®.d_rMax) || - vrpn_unbuffer(&bufptr, ®.d_cMin) || - vrpn_unbuffer(&bufptr, ®.d_cMax) || - vrpn_unbuffer(&bufptr, ®.d_valType)) { - fprintf(stderr, "vrpn_Imager_Remote::handle_region_message(): Can't " - "unbuffer parameters!\n"); - return -1; - } - reg.d_valBuf = bufptr; - reg.d_valid = true; - - // Check the compression status and prepare to do decompression if it is - // called for. - if (me->d_channels[reg.d_chanIndex].d_compression != - vrpn_Imager_Channel::NONE) { - fprintf(stderr, "vrpn_Imager_Remote::handle_region_message(): " - "Compression not implemented\n"); - return -1; - } - - // Fill in a user callback structure with the data - rp.msg_time = p.msg_time; - rp.region = ® - - // ONLY if we have gotten a description message, - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - if (me->d_got_description) { - me->d_region_list.call_handlers(rp); - } - - reg.d_valid = false; - return 0; -} - -int vrpn_Imager_Remote::handle_begin_frame_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_Imager_Remote *me = (vrpn_Imager_Remote *)userdata; - vrpn_IMAGERBEGINFRAMECB bf; - - bf.msg_time = p.msg_time; - if (vrpn_unbuffer(&bufptr, &bf.dMin) || vrpn_unbuffer(&bufptr, &bf.dMax) || - vrpn_unbuffer(&bufptr, &bf.rMin) || vrpn_unbuffer(&bufptr, &bf.rMax) || - vrpn_unbuffer(&bufptr, &bf.cMin) || vrpn_unbuffer(&bufptr, &bf.cMax)) { - fprintf(stderr, "vrpn_Imager_Remote::handle_begin_frame_message(): " - "Can't unbuffer parameters!\n"); - return -1; - } - - // ONLY if we have gotten a description message, - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - if (me->d_got_description) { - me->d_begin_frame_list.call_handlers(bf); - } - - return 0; -} - -int vrpn_Imager_Remote::handle_end_frame_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_Imager_Remote *me = (vrpn_Imager_Remote *)userdata; - vrpn_IMAGERENDFRAMECB ef; - - ef.msg_time = p.msg_time; - if (vrpn_unbuffer(&bufptr, &ef.dMin) || vrpn_unbuffer(&bufptr, &ef.dMax) || - vrpn_unbuffer(&bufptr, &ef.rMin) || vrpn_unbuffer(&bufptr, &ef.rMax) || - vrpn_unbuffer(&bufptr, &ef.cMin) || vrpn_unbuffer(&bufptr, &ef.cMax)) { - fprintf(stderr, "vrpn_Imager_Remote::handle_end_frame_message(): Can't " - "unbuffer parameters!\n"); - return -1; - } - - // ONLY if we have gotten a description message, - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - if (me->d_got_description) { - me->d_end_frame_list.call_handlers(ef); - } - - return 0; -} - -int vrpn_Imager_Remote::handle_discarded_frames_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_Imager_Remote *me = (vrpn_Imager_Remote *)userdata; - vrpn_IMAGERDISCARDEDFRAMESCB df; - - df.msg_time = p.msg_time; - if (vrpn_unbuffer(&bufptr, &df.count)) { - fprintf(stderr, "vrpn_Imager_Remote::handle_discarded_frames_message():" - " Can't unbuffer parameters!\n"); - return -1; - } - - // ONLY if we have gotten a description message, - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - if (me->d_got_description) { - me->d_discarded_frames_list.call_handlers(df); - } - - return 0; -} - -int vrpn_Imager_Remote::handle_connection_dropped_message(void *userdata, - vrpn_HANDLERPARAM) -{ - vrpn_Imager_Remote *me = (vrpn_Imager_Remote *)userdata; - - // We have no description message, so don't call region callbacks - me->d_got_description = false; - - return 0; -} - -bool vrpn_Imager_Remote::throttle_sender(vrpn_int32 N) -{ - // msgbuf must be float64-aligned! - vrpn_float64 fbuf[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64)]; - char *msgbuf = (char *)fbuf; - int buflen = sizeof(fbuf); - struct timeval timestamp; - - // Pack the throttle count request. - if (vrpn_buffer(&msgbuf, &buflen, N)) { - fprintf(stderr, "vrpn_ImagerPose_Server::throttle_sender(): Can't pack " - "message header, tossing\n"); - return false; - } - - // Pack the buffer into the connection's outgoing reliable queue, if we have - // a valid connection. - vrpn_int32 len = sizeof(fbuf) - buflen; - vrpn_gettimeofday(×tamp, NULL); - if (d_connection && - d_connection->pack_message(len, timestamp, d_throttle_frames_m_id, - d_sender_id, (char *)(void *)fbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_ImagerPose_Server::throttle_sender(): cannot " - "write message: tossing\n"); - return false; - } - - return true; -} - -/** As efficiently as possible, pull the values out of the VRPN buffer and put - them into - the array whose pointer is passed in, transcoding as needed to convert it - into the - type of the pointer passed in. - data: Points at the (0,0) element of the 2D array that is to hold the - image. - It is assumed that the data values should be copied exactly, and that - offset and scale should be applied at the reading end by the user if - they want to get them back into absolute units. - repeat: How many times to copy each element (for example, this will be 3 - if we are - copying an unsigned 8-bit value from the network into the Red, Green, - and Blue - entries of a color map. - colStride, rowStride: Number of elements (size of data type) to skip along - a column and row. - This tells how far to jump ahead when writing the next element in the - row (must - be larger or the same as the repeat) and how make elements to skip to - get to the - beginning of the next column. For example, copying a uint from the - network into - the Red, Green, and Blue elements of an RGBA texture would have - repeat=3, colStride=4, - and rowStride=4*(number of columns). - numRows, invert_rows: numRows needs to equal the number of rows in the - entire image if - invert_rows is true; it is not used otherwise. invert_rows inverts - the image in y - as it is copying it into the user's buffer. -*/ - -bool vrpn_Imager_Region::decode_unscaled_region_using_base_pointer( - vrpn_uint8 *data, vrpn_uint32 colStride, vrpn_uint32 rowStride, - vrpn_uint32 depthStride, vrpn_uint16 nRows, bool invert_rows, - unsigned repeat) const -{ - // Make sure the parameters are reasonable - if (colStride < repeat) { - fprintf(stderr, "vrpn_Imager_Region::decode_unscaled_region_using_base_" - "pointer(): colStride must be >= repeat\n"); - return false; - } - - if (invert_rows && (nRows < d_rMax)) { - fprintf(stderr, "vrpn_Imager_Region::decode_unscaled_region_using_base_" - "pointer(): nRows must not be less than _rMax\n"); - return false; - } - - // If the type of data in the buffer doesn't match the type of data the user - // wants, we need to convert each element along the way. - if (d_valType == vrpn_IMAGER_VALTYPE_UINT8) { - // The data type matches what we the user is asking for. No transcoding - // needed. - // Insert the data into the buffer, copying it as efficiently as - // possible - // from the network buffer into the caller's buffer . Note that - // the network buffer is little-endian. The code looks a little - // complicated because it short-circuits the copying for the case where - // the - // column stride and repeat are one element long (using memcpy() on each - // row) but has to - // copy one element at a time otherwise. - int cols = d_cMax - d_cMin + 1; - int linelen = cols * sizeof(data[0]); - if ((colStride == 1) && (repeat == 1)) { - const vrpn_uint8 *msgbuf = (const vrpn_uint8 *)d_valBuf; - for (unsigned d = d_dMin; d <= d_dMax; d++) { - for (unsigned r = d_rMin; r <= d_rMax; r++) { - unsigned rActual; - if (invert_rows) { - rActual = (nRows - 1) - r; - } - else { - rActual = r; - } - memcpy( - &data[d * depthStride + rActual * rowStride + d_cMin], - msgbuf, linelen); - msgbuf += linelen; - } - } - } - else { - long rowStep = rowStride; - if (invert_rows) { - rowStep *= -1; - } - const vrpn_uint8 *msgbuf = (const vrpn_uint8 *)d_valBuf; - for (unsigned d = d_dMin; d <= d_dMax; d++) { - vrpn_uint8 *rowStart = - &data[d * depthStride + d_rMin * rowStride + - d_cMin * repeat]; - if (invert_rows) { - rowStart = &data[d * depthStride + - (nRows - 1 - d_rMin) * rowStride + - d_cMin * repeat]; - } - vrpn_uint8 *copyTo = rowStart; - for (unsigned r = d_rMin; r <= d_rMax; r++) { - for (unsigned c = d_cMin; c <= d_cMax; c++) { - for (unsigned rpt = 0; rpt < repeat; rpt++) { - *(copyTo + rpt) = - *msgbuf; //< Copy the current element - } - msgbuf++; //< Skip to the next buffer location - copyTo += - colStride; //< Skip appropriate number of elements - } - rowStart += rowStep; //< Skip to the start of the next row - copyTo = rowStart; - } - } - } - } - else if (d_valType == vrpn_IMAGER_VALTYPE_FLOAT32) { - // Transcode from 32-bit floating-point to 8-bit values during the - // conversion process. - // As this is unscaled, we do not adjust the values -- simply jam the - // values in and - // let C++ conversion do the work for us. - - // Swap endian-ness of the buffer if we are on a big-endian machine. - if (vrpn_big_endian) { - fprintf(stderr, "XXX Imager Region needs swapping on Big-endian\n"); - return false; - } - - long rowStep = rowStride; - if (invert_rows) { - rowStep *= -1; - } - const vrpn_float32 *msgbuf = (const vrpn_float32 *)d_valBuf; - for (unsigned d = d_dMin; d <= d_dMax; d++) { - vrpn_uint8 *rowStart = - &data[d * depthStride + d_rMin * rowStride + d_cMin * repeat]; - if (invert_rows) { - rowStart = - &data[d * depthStride + (nRows - 1 - d_rMin) * rowStride + - d_cMin * repeat]; - } - vrpn_uint8 *copyTo = rowStart; - for (unsigned r = d_rMin; r <= d_rMax; r++) { - for (unsigned c = d_cMin; c <= d_cMax; c++) { - for (unsigned rpt = 0; rpt < repeat; rpt++) { - *(copyTo + rpt) = static_cast<vrpn_uint8>( - *msgbuf); //< Copy the current element - } - msgbuf++; //< Skip to the next buffer location - copyTo += colStride; //< Skip appropriate number of elements - } - rowStart += rowStep; //< Skip to the start of the next row - copyTo = rowStart; - } - } - } - else if (d_valType == vrpn_IMAGER_VALTYPE_UINT16) { - // transcode from 16 bit image to 8 bit data for app - - long rowStep = rowStride; - if (invert_rows) { - rowStep *= -1; - } - const vrpn_uint16 *msgbuf = (const vrpn_uint16 *)d_valBuf; - for (unsigned d = d_dMin; d <= d_dMax; d++) { - vrpn_uint8 *rowStart = - &data[d * depthStride + d_rMin * rowStride + d_cMin * repeat]; - if (invert_rows) { - rowStart = - &data[d * depthStride + (nRows - 1 - d_rMin) * rowStride + - d_cMin * repeat]; - } - vrpn_uint8 *copyTo = rowStart; - for (unsigned r = d_rMin; r <= d_rMax; r++) { - for (unsigned c = d_cMin; c <= d_cMax; c++) { - for (unsigned rpt = 0; rpt < repeat; rpt++) { - *(copyTo + rpt) = static_cast<vrpn_uint8>( - (*msgbuf) >> - 8); //< Copy the current element (take top 8 bits) - } - msgbuf++; //< Skip to the next buffer location - copyTo += colStride; //< Skip appropriate number of elements - } - rowStart += rowStep; //< Skip to the start of the next row - copyTo = rowStart; - } - } - } - else { - printf("vrpn_Imager_Region::decode_unscaled_region_using_base_pointer()" - ": Transcoding not implemented yet for this type\n"); - printf("d_valType = %i\n", d_valType); - return false; - } - - // No need to swap endianness on single-byte entities. - return true; -} - -// This routine handles both 16-bit and 12-bit-in-16 iamges. -bool vrpn_Imager_Region::decode_unscaled_region_using_base_pointer( - vrpn_uint16 *data, vrpn_uint32 colStride, vrpn_uint32 rowStride, - vrpn_uint32 depthStride, vrpn_uint16 nRows, bool invert_rows, - unsigned repeat) const -{ - // Make sure the parameters are reasonable - if (colStride < repeat) { - fprintf(stderr, "vrpn_Imager_Region::decode_unscaled_region_using_base_" - "pointer(): colStride must be >= repeat\n"); - return false; - } - if (invert_rows && (nRows < d_rMax)) { - fprintf(stderr, "vrpn_Imager_Region::decode_unscaled_region_using_base_" - "pointer(): nRows must not be less than _rMax\n"); - return false; - } - - // If the type of data in the buffer matches the type of data the user - // wants, no need to convert each element along the way. - if ((d_valType == vrpn_IMAGER_VALTYPE_UINT16) || - (d_valType == vrpn_IMAGER_VALTYPE_UINT12IN16)) { - - // The data type matches what we the user is asking for. No transcoding - // needed. - // Insert the data into the buffer, copying it as efficiently as - // possible - // from the network buffer into the caller's buffer . Note that - // the network buffer is little-endian. The code looks a little - // complicated because it short-circuits the copying for the case where - // the - // column stride and repeat are one element long (using memcpy() on each - // row) but has to - // copy one element at a time otherwise. - int cols = d_cMax - d_cMin + 1; - int linelen = cols * sizeof(data[0]); - if ((colStride == 1) && (repeat == 1)) { - const vrpn_uint16 *msgbuf = (const vrpn_uint16 *)d_valBuf; - for (unsigned d = d_dMin; d <= d_dMax; d++) { - for (unsigned r = d_rMin; r <= d_rMax; r++) { - unsigned rActual; - if (invert_rows) { - rActual = (nRows - 1) - r; - } - else { - rActual = r; - } - memcpy( - &data[d * depthStride + rActual * rowStride + d_cMin], - msgbuf, linelen); - msgbuf += cols; - } - } - } - else { - long rowStep = rowStride; - if (invert_rows) { - rowStep *= -1; - } - const vrpn_uint16 *msgbuf = (const vrpn_uint16 *)d_valBuf; - for (unsigned d = d_dMin; d <= d_dMax; d++) { - vrpn_uint16 *rowStart = - &data[d * depthStride + d_rMin * rowStride + - d_cMin * repeat]; - if (invert_rows) { - rowStart = &data[d * depthStride + - (nRows - 1 - d_rMin) * rowStride + - d_cMin * repeat]; - } - vrpn_uint16 *copyTo = rowStart; - for (unsigned r = d_rMin; r <= d_rMax; r++) { - for (unsigned c = d_cMin; c <= d_cMax; c++) { - for (unsigned rpt = 0; rpt < repeat; rpt++) { - *(copyTo + rpt) = - *msgbuf; //< Copy the current element - } - msgbuf++; //< Skip to the next buffer location - copyTo += - colStride; //< Skip appropriate number of elements - } - rowStart += rowStep; //< Skip to the start of the next row - copyTo = rowStart; - } - } - } - - // The data type sent does not match the type asked for. We will need - // to trans-code - // from the format it is in to the format they want. - } - else if (d_valType == vrpn_IMAGER_VALTYPE_UINT8) { - // Convert from unsigned integer 8-bit to unsigned integer 16-bit - // by shifting each left 8 bits (same as multiplying by 256). Note - // that this does not map 255 to the maximum 16-bit value, but doing - // that would require either floating-point math or precomputing that - // math and using table look-up. - long rowStep = rowStride; - if (invert_rows) { - rowStep *= -1; - } - const vrpn_uint8 *msgbuf = (const vrpn_uint8 *)d_valBuf; - for (unsigned d = d_dMin; d <= d_dMax; d++) { - vrpn_uint16 *rowStart = - &data[d * depthStride + d_rMin * rowStride + d_cMin * repeat]; - if (invert_rows) { - rowStart = - &data[d * depthStride + (nRows - 1 - d_rMin) * rowStride + - d_cMin * repeat]; - } - vrpn_uint16 *copyTo = rowStart; - for (unsigned r = d_rMin; r <= d_rMax; r++) { - for (unsigned c = d_cMin; c <= d_cMax; c++) { - for (unsigned rpt = 0; rpt < repeat; rpt++) { - //< Shift and copy the current element - *(copyTo + rpt) = - (static_cast<vrpn_uint16>(*msgbuf) << 8); - } - msgbuf++; //< Skip to the next buffer location - copyTo += colStride; //< Skip appropriate number of elements - } - rowStart += rowStep; //< Skip to the start of the next row - copyTo = rowStart; - } - } - } - else { - fprintf(stderr, "vrpn_Imager_Region::decode_unscaled_region_using_base_" - "pointer(): XXX Transcoding this type not yet " - "implemented\n"); - return false; - } - - // Swap endian-ness of the buffer if we are on a big-endian machine. - if (vrpn_big_endian) { - fprintf(stderr, "XXX Imager Region needs swapping on Big-endian\n"); - return false; - } - - return true; -} - -bool vrpn_Imager_Region::decode_unscaled_region_using_base_pointer( - vrpn_float32 *data, vrpn_uint32 colStride, vrpn_uint32 rowStride, - vrpn_uint32 depthStride, vrpn_uint16 nRows, bool invert_rows, - unsigned repeat) const -{ - // Make sure the parameters are reasonable - if (colStride < repeat) { - fprintf(stderr, "vrpn_Imager_Region::decode_unscaled_region_using_base_" - "pointer(): colStride must be >= repeat\n"); - return false; - } - - // If the type of data in the buffer doesn't match the type of data the user - // wants, we need to convert each element along the way. - if (d_valType != vrpn_IMAGER_VALTYPE_FLOAT32) { - printf("vrpn_Imager_Region::decode_unscaled_region_using_base_pointer()" - ": Transcoding not implemented yet\n"); - return false; - } - if (invert_rows && (nRows < d_rMax)) { - fprintf(stderr, "vrpn_Imager_Region::decode_unscaled_region_using_base_" - "pointer(): nRows must not be less than _rMax\n"); - return false; - } - - // The data type matches what we the user is asking for. No transcoding - // needed. - // Insert the data into the buffer, copying it as efficiently as possible - // from the network buffer into the caller's buffer . Note that - // the network buffer is little-endian. The code looks a little - // complicated because it short-circuits the copying for the case where the - // column stride and repeat are one element long (using memcpy() on each - // row) but has to - // copy one element at a time otherwise. - int cols = d_cMax - d_cMin + 1; - int linelen = cols * sizeof(data[0]); - if ((colStride == 1) && (repeat == 1)) { - const vrpn_float32 *msgbuf = (const vrpn_float32 *)d_valBuf; - for (unsigned d = d_dMin; d <= d_dMax; d++) { - for (unsigned r = d_rMin; r <= d_rMax; r++) { - unsigned rActual; - if (invert_rows) { - rActual = (nRows - 1) - r; - } - else { - rActual = r; - } - memcpy(&data[d * depthStride + rActual * rowStride + d_cMin], - msgbuf, linelen); - msgbuf += linelen; - } - } - } - else { - long rowStep = rowStride; - if (invert_rows) { - rowStep *= -1; - } - const vrpn_float32 *msgbuf = (const vrpn_float32 *)d_valBuf; - for (unsigned d = d_dMin; d <= d_dMax; d++) { - vrpn_float32 *rowStart = - &data[d * depthStride + d_rMin * rowStride + d_cMin * repeat]; - if (invert_rows) { - rowStart = - &data[d * depthStride + (nRows - 1 - d_rMin) * rowStride + - d_cMin * repeat]; - } - vrpn_float32 *copyTo = rowStart; - for (unsigned r = d_rMin; r <= d_rMax; r++) { - for (unsigned c = d_cMin; c <= d_cMax; c++) { - for (unsigned rpt = 0; rpt < repeat; rpt++) { - *(copyTo + rpt) = *msgbuf; //< Copy the current element - } - msgbuf++; //< Skip to the next buffer location - copyTo += colStride; //< Skip appropriate number of elements - } - rowStart += rowStep; //< Skip to the start of the next row - copyTo = rowStart; - } - } - } - - // Swap endian-ness of the buffer if we are on a big-endian machine. - if (vrpn_big_endian) { - fprintf(stderr, "XXX Imager Region needs swapping on Big-endian\n"); - return false; - } - - return true; -} - -vrpn_ImagerPose::vrpn_ImagerPose(const char *name, vrpn_Connection *c) - : vrpn_BaseClass(name, c) -{ - vrpn_BaseClass::init(); - - d_origin[0] = d_origin[1] = d_origin[2] = 0.0; - d_dCol[0] = d_dCol[1] = d_dCol[2] = 0.0; - d_dRow[0] = d_dRow[1] = d_dRow[2] = 0.0; - d_dDepth[0] = d_dDepth[1] = d_dDepth[2] = 0.0; -}; - -int vrpn_ImagerPose::register_types(void) -{ - d_description_m_id = - d_connection->register_message_type("vrpn_ImagerPose Description"); - if (d_description_m_id == -1) { - return -1; - } - else { - return 0; - } -} - -bool vrpn_ImagerPose::compute_pixel_center(vrpn_float64 *center, - const vrpn_Imager &image, - vrpn_uint16 col, vrpn_uint16 row, - vrpn_uint16 depth) -{ - // Make sure we don't have a NULL pointer to fill our return into. - if (center == NULL) { - fprintf( - stderr, - "vrpn_ImagerPose::compute_pixel_center(): NULL center pointer\n"); - return false; - } - - // Ensure that the pixel coordinate is within bounds - if ((col >= image.nCols()) || (row >= image.nRows()) || - (depth >= image.nDepth())) { - fprintf(stderr, "vrpn_ImagerPose::compute_pixel_center(): Pixel index " - "out of range\n"); - return false; - } - - // The pixel centers are located at the midpoint in row, column, and - // depth space of each pixel. The pixel range is therefore half a - // pixel past the centers of all pixels in the image. This means that - // there is one extra pixel-step included in the range (half to the - // negative of the origin, half to the positive of the last entry). - // So, the pixel center is one half-step plus a number of whole steps - // equal to its index. - vrpn_float64 stepC = 1.0 / image.nCols(); - vrpn_float64 stepR = 1.0 / image.nRows(); - vrpn_float64 stepD = 1.0 / image.nDepth(); - - center[0] = d_origin[0] + (0.5 + col) * stepC * d_dCol[0] + - (0.5 + row) * stepR * d_dRow[0] + - (0.5 + depth) * stepD * d_dDepth[0]; - center[1] = d_origin[1] + (0.5 + col) * stepC * d_dCol[1] + - (0.5 + row) * stepR * d_dRow[1] + - (0.5 + depth) * stepD * d_dDepth[1]; - center[2] = d_origin[2] + (0.5 + col) * stepC * d_dCol[2] + - (0.5 + row) * stepR * d_dRow[2] + - (0.5 + depth) * stepD * d_dDepth[2]; - - return true; -} - -vrpn_ImagerPose_Server::vrpn_ImagerPose_Server( - const char *name, const vrpn_float64 origin[3], const vrpn_float64 dCol[3], - const vrpn_float64 dRow[3], const vrpn_float64 *dDepth, vrpn_Connection *c) - : vrpn_ImagerPose(name, c) -{ - memcpy(d_origin, origin, sizeof(d_origin)); - memcpy(d_dCol, dCol, sizeof(d_dCol)); - memcpy(d_dRow, dRow, sizeof(d_dRow)); - if (dDepth != NULL) { - memcpy(d_dDepth, dDepth, sizeof(d_dDepth)); - } - - // Set up callback handler for ping message from client so that it - // sends the description. This will make sure that the other side has - // heard the descrption before it hears a region message. Also set this up - // to fire on the "new connection" system message. - - register_autodeleted_handler(d_ping_message_id, handle_ping_message, this, - d_sender_id); - register_autodeleted_handler( - d_connection->register_message_type(vrpn_got_connection), - handle_ping_message, this, vrpn_ANY_SENDER); -}; - -bool vrpn_ImagerPose_Server::set_range(const vrpn_float64 origin[3], - const vrpn_float64 dCol[3], - const vrpn_float64 dRow[3], - const vrpn_float64 *dDepth) -{ - memcpy(d_origin, origin, sizeof(d_origin)); - memcpy(d_dCol, dCol, sizeof(d_dCol)); - memcpy(d_dRow, dRow, sizeof(d_dRow)); - if (dDepth != NULL) { - memcpy(d_dDepth, dDepth, sizeof(d_dDepth)); - } - return send_description(); -} - -bool vrpn_ImagerPose_Server::send_description(void) -{ - // msgbuf must be float64-aligned! - vrpn_float64 fbuf[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64)]; - char *msgbuf = (char *)fbuf; - int buflen = sizeof(fbuf); - struct timeval timestamp; - - // Pack the description of all of the fields in the imager into the buffer, - // including the channel descriptions. - if (vrpn_buffer(&msgbuf, &buflen, d_origin[0]) || - vrpn_buffer(&msgbuf, &buflen, d_origin[1]) || - vrpn_buffer(&msgbuf, &buflen, d_origin[2]) || - vrpn_buffer(&msgbuf, &buflen, d_dDepth[0]) || - vrpn_buffer(&msgbuf, &buflen, d_dDepth[1]) || - vrpn_buffer(&msgbuf, &buflen, d_dDepth[2]) || - vrpn_buffer(&msgbuf, &buflen, d_dRow[0]) || - vrpn_buffer(&msgbuf, &buflen, d_dRow[1]) || - vrpn_buffer(&msgbuf, &buflen, d_dRow[2]) || - vrpn_buffer(&msgbuf, &buflen, d_dCol[0]) || - vrpn_buffer(&msgbuf, &buflen, d_dCol[1]) || - vrpn_buffer(&msgbuf, &buflen, d_dCol[2])) { - fprintf(stderr, "vrpn_ImagerPose_Server::send_description(): Can't " - "pack message header, tossing\n"); - return false; - } - - // Pack the buffer into the connection's outgoing reliable queue, if we have - // a valid connection. - vrpn_int32 len = sizeof(fbuf) - buflen; - vrpn_gettimeofday(×tamp, NULL); - if (d_connection && - d_connection->pack_message(len, timestamp, d_description_m_id, - d_sender_id, (char *)(void *)fbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_ImagerPose_Server::send_description(): cannot " - "write message: tossing\n"); - return false; - } - - return true; -} - -int vrpn_ImagerPose_Server::handle_ping_message(void *userdata, - vrpn_HANDLERPARAM) -{ - vrpn_ImagerPose_Server *me = (vrpn_ImagerPose_Server *)userdata; - me->send_description(); - return 0; -} - -void vrpn_ImagerPose_Server::mainloop(void) { server_mainloop(); } - -vrpn_ImagerPose_Remote::vrpn_ImagerPose_Remote(const char *name, - vrpn_Connection *c) - : vrpn_ImagerPose(name, c) -{ - // Register the handlers for the description message - register_autodeleted_handler(d_description_m_id, handle_description_message, - this, d_sender_id); -} - -int vrpn_ImagerPose_Remote::handle_description_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_ImagerPose_Remote *me = (vrpn_ImagerPose_Remote *)userdata; - - // Get my new information from the buffer - if (vrpn_unbuffer(&bufptr, &me->d_origin[0]) || - vrpn_unbuffer(&bufptr, &me->d_origin[1]) || - vrpn_unbuffer(&bufptr, &me->d_origin[2]) || - vrpn_unbuffer(&bufptr, &me->d_dDepth[0]) || - vrpn_unbuffer(&bufptr, &me->d_dDepth[1]) || - vrpn_unbuffer(&bufptr, &me->d_dDepth[2]) || - vrpn_unbuffer(&bufptr, &me->d_dRow[0]) || - vrpn_unbuffer(&bufptr, &me->d_dRow[1]) || - vrpn_unbuffer(&bufptr, &me->d_dRow[2]) || - vrpn_unbuffer(&bufptr, &me->d_dCol[0]) || - vrpn_unbuffer(&bufptr, &me->d_dCol[1]) || - vrpn_unbuffer(&bufptr, &me->d_dCol[2])) { - return -1; - } - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->d_description_list.call_handlers(p.msg_time); - - return 0; -} - -void vrpn_ImagerPose_Remote::mainloop(void) -{ - client_mainloop(); - if (d_connection) { - d_connection->mainloop(); - }; -} diff --git a/src/vrpn/vrpn_Imager.h b/src/vrpn/vrpn_Imager.h deleted file mode 100644 index 886ce3739a20b8ca0d577d2665fe4cb74c8d924f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Imager.h +++ /dev/null @@ -1,801 +0,0 @@ -// ImagerControl (should be built into Imager, because it will always -// be the same device). The app doesn't have to use all of the -// functions if they don't want to. -// XXX Client can sent request for only subregion of image to be sent -// Server may ignore this message. -// XXX Server sets region back to total region when last connection closed. -// XXX Client can request a frame rate from the server. This is passed on -// to the server code as a handled message. Server should reset to the -// default when the last connection is closed. -// XXX Binning -// XXX integration times -// XXX Which data sets to send (nano) - -// ImagerPose (may be a separate physical device from the imager) -// XXX Lets client request new pose for imager - -// XXX When transcoding to a lower-bitcount resolution, should we -// adjust the scale and offset to make best use of the bits? Perhaps -// a local and a global scale and offset? - -#ifndef VRPN_IMAGER_H -#define VRPN_IMAGER_H -#include <stdio.h> // for fprintf, stderr -#include <string.h> // for NULL, memcpy - -#include "vrpn_BaseClass.h" // for vrpn_Callback_List, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Connection.h" -#include "vrpn_Shared.h" // for vrpn_buffer, vrpn_unbuffer, etc -#include "vrpn_Types.h" // for vrpn_uint16, vrpn_int32, etc - -const unsigned vrpn_IMAGER_MAX_CHANNELS = 100; - -/// Set of constants to tell how many points you can put into a region -/// depending on the type you are putting in there. Useful for senders -/// to know how large of a chunk they can send at once. -const unsigned vrpn_IMAGER_MAX_REGIONu8 = - (vrpn_CONNECTION_TCP_BUFLEN - 8 * sizeof(vrpn_int16) - - 6 * sizeof(vrpn_int32)) / - sizeof(vrpn_uint8); -const unsigned vrpn_IMAGER_MAX_REGIONu16 = - (vrpn_CONNECTION_TCP_BUFLEN - 8 * sizeof(vrpn_int16) - - 6 * sizeof(vrpn_int32)) / - sizeof(vrpn_uint16); -const unsigned vrpn_IMAGER_MAX_REGIONu12in16 = vrpn_IMAGER_MAX_REGIONu16; -const unsigned vrpn_IMAGER_MAX_REGIONf32 = - (vrpn_CONNECTION_TCP_BUFLEN - 8 * sizeof(vrpn_int16) - - 6 * sizeof(vrpn_int32)) / - sizeof(vrpn_float32); - -/// Holds the description needed to convert from raw data to values for a -/// channel -class VRPN_API vrpn_Imager_Channel { - friend class vrpn_Imager_Remote; // provides access to compression status - friend class vrpn_Imager_Server; // provides access to compression status - friend class vrpn_Imager_Stream_Buffer; // provides access to - // buffer/unbuffer -public: - vrpn_Imager_Channel(void) - { - name[0] = '\0'; - units[0] = '\0'; - minVal = maxVal = 0.0; - scale = 1; - offset = 0; - d_compression = NONE; - }; - - cName name; //< Name of the data set stored in this channel - cName units; //< Units for the data set stored in this channel - vrpn_float32 minVal, - maxVal; //< Range of possible values for pixels in this channel - vrpn_float32 offset, - scale; //< Values in units are (raw_values * scale) + offset - -protected: - // The following methods are here for the derived classes and are not - // relevant - // to user code. - inline bool buffer(char **insertPt, vrpn_int32 *buflen) const - { - if (vrpn_buffer(insertPt, buflen, minVal) || - vrpn_buffer(insertPt, buflen, maxVal) || - vrpn_buffer(insertPt, buflen, offset) || - vrpn_buffer(insertPt, buflen, scale) || - vrpn_buffer(insertPt, buflen, (vrpn_uint32)d_compression) || - vrpn_buffer(insertPt, buflen, name, sizeof(name)) || - vrpn_buffer(insertPt, buflen, units, sizeof(units))) { - return false; - } - else { - return true; - } - } - - inline bool unbuffer(const char **buffer) - { - vrpn_uint32 compression; - if (vrpn_unbuffer(buffer, &minVal) || vrpn_unbuffer(buffer, &maxVal) || - vrpn_unbuffer(buffer, &offset) || vrpn_unbuffer(buffer, &scale) || - vrpn_unbuffer(buffer, &compression) || - vrpn_unbuffer(buffer, name, sizeof(name)) || - vrpn_unbuffer(buffer, units, sizeof(units))) { - return false; - } - else { - d_compression = (ChannelCompression)compression; - return true; - } - } - - typedef enum { NONE = 0 } ChannelCompression; - ChannelCompression d_compression; -}; - -/// Base class for Imager class -class VRPN_API vrpn_Imager : public vrpn_BaseClass { -public: - vrpn_Imager(const char *name, vrpn_Connection *c = NULL); - - // Data member accessors. - vrpn_int32 nRows(void) const { return d_nRows; }; - vrpn_int32 nCols(void) const { return d_nCols; }; - vrpn_int32 nDepth(void) const { return d_nDepth; }; - vrpn_int32 nChannels(void) const { return d_nChannels; }; - -protected: - vrpn_int32 d_nRows; //< Number of rows in the image - vrpn_int32 d_nCols; //< Number of columns in the image - vrpn_int32 d_nDepth; //< Number of depth stacks in the image - vrpn_int32 d_nChannels; //< Number of image data channels - vrpn_Imager_Channel d_channels[vrpn_IMAGER_MAX_CHANNELS]; - - virtual int register_types(void); - vrpn_int32 d_description_m_id; //< ID of the message type describing the - // range and channels - vrpn_int32 d_begin_frame_m_id; //< ID of the message type describing the - // start of a region - vrpn_int32 d_end_frame_m_id; //< ID of the message type describing the start - // of a region - vrpn_int32 d_discarded_frames_m_id; //< ID of the message type describing - // the discarding of one or more regions - vrpn_int32 d_throttle_frames_m_id; //< ID of the message type requesting - // throttling of sending. - vrpn_int32 d_regionu8_m_id; //< ID of the message type describing a region - // with 8-bit unsigned entries - vrpn_int32 d_regionu12in16_m_id; //< ID of the message type describing a - // region with 12-bit unsigned entries - // packed in 16 bits - vrpn_int32 d_regionu16_m_id; //< ID of the message type describing a region - // with 16-bit unsigned entries - vrpn_int32 d_regionf32_m_id; //< ID of the message type describing a region - // with 32-bit float entries -}; - -class VRPN_API vrpn_Imager_Server : public vrpn_Imager { -public: - vrpn_Imager_Server(const char *name, vrpn_Connection *c, vrpn_int32 nCols, - vrpn_int32 nRows, vrpn_int32 nDepth = 1); - - /// Add a channel to the server, returns index of the channel or -1 on - /// failure. - int add_channel(const char *name, const char *units = "unsigned8bit", - vrpn_float32 minVal = 0, vrpn_float32 maxVal = 255, - vrpn_float32 scale = 1, vrpn_float32 offset = 0); - - /// Servers must send begin/end frame pairs around contiguous sections of - /// the image - // to provide hints to the client about when to refresh displays and such. - // If they can determine when frames are missed, they should also send a - // description of missed frames, telling how many are skipped (default of - // zero means "some but don't know how many"). - bool send_begin_frame(const vrpn_uint16 cMin, const vrpn_uint16 cMax, - const vrpn_uint16 rMin, const vrpn_uint16 rMax, - const vrpn_uint16 dMin = 0, - const vrpn_uint16 dMax = 0, - const struct timeval *time = NULL); - bool send_end_frame(const vrpn_uint16 cMin, const vrpn_uint16 cMax, - const vrpn_uint16 rMin, const vrpn_uint16 rMax, - const vrpn_uint16 dMin = 0, const vrpn_uint16 dMax = 0, - const struct timeval *time = NULL); - bool send_discarded_frames(const vrpn_uint16 count = 0, - const struct timeval *time = NULL); - - /// Pack and send the region as efficiently as possible; strides are in - /// steps of the element being sent. - // These functions each take a pointer to the base of the image to be sent: - // its [0,0] element. - // If rows are being inverted, then we need to know how many rows there are - // in the total image. - bool send_region_using_base_pointer( - vrpn_int16 chanIndex, vrpn_uint16 cMin, vrpn_uint16 cMax, - vrpn_uint16 rMin, vrpn_uint16 rMax, const vrpn_uint8 *data, - vrpn_uint32 colStride, vrpn_uint32 rowStride, vrpn_uint16 nRows = 0, - bool invert_rows = false, vrpn_uint32 depthStride = 0, - vrpn_uint16 dMin = 0, vrpn_uint16 dMax = 0, - const struct timeval *time = NULL); - bool send_region_using_base_pointer( - vrpn_int16 chanIndex, vrpn_uint16 cMin, vrpn_uint16 cMax, - vrpn_uint16 rMin, vrpn_uint16 rMax, const vrpn_uint16 *data, - vrpn_uint32 colStride, vrpn_uint32 rowStride, vrpn_uint16 nRows = 0, - bool invert_rows = false, vrpn_uint32 depthStride = 0, - vrpn_uint16 dMin = 0, vrpn_uint16 dMax = 0, - const struct timeval *time = NULL); - bool send_region_using_base_pointer( - vrpn_int16 chanIndex, vrpn_uint16 cMin, vrpn_uint16 cMax, - vrpn_uint16 rMin, vrpn_uint16 rMax, const vrpn_float32 *data, - vrpn_uint32 colStride, vrpn_uint32 rowStride, vrpn_uint16 nRows = 0, - bool invert_rows = false, vrpn_uint32 depthStride = 0, - vrpn_uint16 dMin = 0, vrpn_uint16 dMax = 0, - const struct timeval *time = NULL); - - /// Pack and send the region as efficiently as possible; strides are in - /// steps of the element being sent. - // These functions each take a pointer to the first of the data values to be - // sent. This is a - // pointer to the [cMin, rMin] element of the image to be sent. Note that - // if the Y value is inverted, - // this will NOT be a pointer to the beginning of the data block, but rather - // the the beginning of - // the last line in the data block. Note that rowStride will be less than - // the number of rows in the - // whole image if the data is tightly packed into a block and the region - // does not cover all columns. - bool send_region_using_first_pointer( - vrpn_int16 chanIndex, vrpn_uint16 cMin, vrpn_uint16 cMax, - vrpn_uint16 rMin, vrpn_uint16 rMax, const vrpn_uint8 *data, - vrpn_uint32 colStride, vrpn_uint32 rowStride, vrpn_uint16 nRows = 0, - bool invert_rows = false, vrpn_uint32 depthStride = 0, - vrpn_uint16 dMin = 0, vrpn_uint16 dMax = 0, - const struct timeval *time = NULL); - bool send_region_using_first_pointer( - vrpn_int16 chanIndex, vrpn_uint16 cMin, vrpn_uint16 cMax, - vrpn_uint16 rMin, vrpn_uint16 rMax, const vrpn_uint16 *data, - vrpn_uint32 colStride, vrpn_uint32 rowStride, vrpn_uint16 nRows = 0, - bool invert_rows = false, vrpn_uint32 depthStride = 0, - vrpn_uint16 dMin = 0, vrpn_uint16 dMax = 0, - const struct timeval *time = NULL); - bool send_region_using_first_pointer( - vrpn_int16 chanIndex, vrpn_uint16 cMin, vrpn_uint16 cMax, - vrpn_uint16 rMin, vrpn_uint16 rMax, const vrpn_float32 *data, - vrpn_uint32 colStride, vrpn_uint32 rowStride, vrpn_uint16 nRows = 0, - bool invert_rows = false, vrpn_uint32 depthStride = 0, - vrpn_uint16 dMin = 0, vrpn_uint16 dMax = 0, - const struct timeval *time = NULL); - - /// Set the resolution to a different value than it had been before. - /// Returns true on success. - bool set_resolution(vrpn_int32 nCols, vrpn_int32 nRows, - vrpn_int32 nDepth = 1); - - /// Sends a description of the imager so the remote can process the region - /// messages - bool send_description(void); - - /// Handle baseclass ping/pong messages - virtual void mainloop(void); - -protected: - bool d_description_sent; //< Has the description message been sent? - vrpn_int32 d_frames_to_send; //< Set to -1 if continuous, zero or positive - // tells how many to send and then start - // dropping - vrpn_uint16 d_dropped_due_to_throttle; //< Number of frames dropped due to - // the throttle request - - // This method makes sure we send a description whenever we get a ping from - // a client object. - static int VRPN_CALLBACK - handle_ping_message(void *userdata, vrpn_HANDLERPARAM p); - - // This method handles requests to throttle the number of frames. - static int VRPN_CALLBACK - handle_throttle_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_last_drop_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -class VRPN_API vrpn_ImagerPose : public vrpn_BaseClass { -public: - vrpn_ImagerPose(const char *name, vrpn_Connection *c = NULL); - - /// Returns the origin of the coordinate system, - // the location of the corner of the (0,0,0) pixel. Note that - // the pixel coordinate is centered in that pixel, but that the - // pixel extends a half-pixel into the "negative" coordinates. - void get_origin(vrpn_float64 *origin) const - { - memcpy(origin, d_origin, sizeof(d_origin)); - } - - /// This is the total span of the image in columns; - // it is how far and in what direction to go from the origin - // of the image to one pixel past the pixel at the end of - // the column that (0,0,0) is in: this is the total image - // width. - void get_dCol(vrpn_float64 *dCol) const - { - memcpy(dCol, d_dCol, sizeof(d_dCol)); - } - - /// This is the total span of the image in rows; - // it is how far and in what direction to go from the origin - // of the image to one pixel past the pixel at the end of - // the row that (0,0,0) is in: this is the total image height. - void get_dRow(vrpn_float64 *dRow) const - { - memcpy(dRow, d_dRow, sizeof(d_dRow)); - } - - /// This is the total span of the image in depth; - // it is how far and in what direction to go from the origin - // of the image to one pixel past the pixel at the end of - // the depth pixel that (0,0,0) is in: this is the total - // image depth. - void get_dDepth(vrpn_float64 *dDepth) const - { - memcpy(dDepth, d_dDepth, sizeof(d_dDepth)); - } - - /// This will return the location of the center of the specified - // pixel within the image, assuming that the image covers the - // space described by this imagerpose. Note that none of the pixel - // centers will be at the end of the space, except where the image - // has no dimension (Z for a 2D image). Returns false if there is - // a problem (coordinates out of bounds). - bool compute_pixel_center(vrpn_float64 *center, const vrpn_Imager &image, - vrpn_uint16 col, vrpn_uint16 row, - vrpn_uint16 depth = 0); - -protected: - vrpn_float64 d_origin[3]; //< Origin, pixel (0,0,0) in meters - vrpn_float64 - d_dCol[3]; //< End of first columne in coordinate system in meters - vrpn_float64 d_dRow[3]; //< End of first row in coordinate system in meters - vrpn_float64 d_dDepth[3]; //< End of depth in coordinate system in meters - - virtual int register_types(void); - vrpn_int32 d_description_m_id; //< ID of the message type describing the - // range and channels -}; - -class VRPN_API vrpn_ImagerPose_Server : public vrpn_ImagerPose { -public: - vrpn_ImagerPose_Server(const char *name, const vrpn_float64 origin[3], - const vrpn_float64 dCol[3], - const vrpn_float64 dRow[3], - const vrpn_float64 *dDepth = NULL, - vrpn_Connection *c = NULL); - - /// Set the range or units. Return true on success. - bool set_range(const vrpn_float64 origin[3], const vrpn_float64 dCol[3], - const vrpn_float64 dRow[3], - const vrpn_float64 *dDepth = NULL); - - /// Sends a description of the imager so the remote can process the region - /// messages - bool send_description(void); - - /// Handle baseclass ping/pong messages - virtual void mainloop(void); - -protected: - // This method makes sure we send a description whenever we get a ping from - // a client object. - static int VRPN_CALLBACK - handle_ping_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -//------------------------------------------------------------------------------ -// Users deal with things below this line. - -//------------------------------------------------------------------------------ -// Imager_Remote is used for passing image values (pixels), converting them -// to physical units, and saying when regions are started and finished. - -const vrpn_uint16 vrpn_IMAGER_VALTYPE_UNKNOWN = 0; -const vrpn_uint16 vrpn_IMAGER_VALTYPE_UINT8 = 1; -// XXX Bad idea -- do not do this! const vrpn_uint16 -// vrpn_IMAGER_VALTYPE_UINT8RGB = 2; // Placeholder -// XXX Bad idea -- do not do this! const vrpn_uint16 -// vrpn_IMAGER_VALTYPE_UINT8BGR = 3; // Placeholder -const vrpn_uint16 vrpn_IMAGER_VALTYPE_UINT16 = 4; -const vrpn_uint16 vrpn_IMAGER_VALTYPE_UINT12IN16 = 5; -const vrpn_uint16 vrpn_IMAGER_VALTYPE_FLOAT32 = 6; - -class VRPN_API vrpn_Imager_Region; - -typedef struct _vrpn_IMAGERREGIONCB { - struct timeval msg_time; //< Timestamp of the region data's change - const vrpn_Imager_Region *region; //< New region of the image -} vrpn_IMAGERREGIONCB; - -typedef void(VRPN_CALLBACK *vrpn_IMAGERREGIONHANDLER)( - void *userdata, const vrpn_IMAGERREGIONCB info); -// There is no data in the description callback other than the time; the -// data members for the class will have been filled in, so the client should -// call nRows() and other functions to read the new values. -typedef void(VRPN_CALLBACK *vrpn_IMAGERDESCRIPTIONHANDLER)( - void *userdata, const struct timeval msg_time); - -typedef struct _vrpn_IMAGERBEGINFRAMECB { - struct timeval msg_time; //< Timestamp of the begin-frame message - vrpn_uint16 rMin; //< Minimum row in the frame - vrpn_uint16 rMax; //< Maximum row in the frame - vrpn_uint16 cMin; //< Minimum column in the frame - vrpn_uint16 cMax; //< Maximum column in the frame - vrpn_uint16 dMin; //< Minimum depth in the frame - vrpn_uint16 dMax; //< Maximum depth in the frame -} vrpn_IMAGERBEGINFRAMECB; - -typedef struct _vrpn_IMAGERENDFRAMECB { - struct timeval msg_time; //< Timestamp of the end-frame message - vrpn_uint16 rMin; //< Minimum row in the frame - vrpn_uint16 rMax; //< Maximum row in the frame - vrpn_uint16 cMin; //< Minimum column in the frame - vrpn_uint16 cMax; //< Maximum column in the frame - vrpn_uint16 dMin; //< Minimum depth in the frame - vrpn_uint16 dMax; //< Maximum depth in the frame -} vrpn_IMAGERENDFRAMECB; - -typedef struct _vrpn_IMAGERDISCARDEDFRAMESCB { - struct timeval msg_time; //< Timestamp of the begin-frame message - vrpn_uint16 count; //< Number of discarded frames (0 means "1 or more") -} vrpn_IMAGERDISCARDEDFRAMESCB; - -typedef void(VRPN_CALLBACK *vrpn_IMAGERBEGINFRAMEHANDLER)( - void *userdata, const vrpn_IMAGERBEGINFRAMECB info); -typedef void(VRPN_CALLBACK *vrpn_IMAGERENDFRAMEHANDLER)( - void *userdata, const vrpn_IMAGERENDFRAMECB info); -typedef void(VRPN_CALLBACK *vrpn_IMAGERDISCARDEDFRAMESHANDLER)( - void *userdata, const vrpn_IMAGERDISCARDEDFRAMESCB info); - -/// Helper function to convert data for a sub-region of one channel of -// the image. This is passed to the user callback handler and aids in -// getting values out of the buffer. The region is only valid during -// the actual callback handler, so users should not store pointers to -// it for later use. -class VRPN_API vrpn_Imager_Region { - friend class VRPN_API vrpn_Imager_Remote; - friend void VRPN_CALLBACK - java_vrpn_handle_region_change(void *userdata, - const vrpn_IMAGERREGIONCB info); - -public: - vrpn_Imager_Region(void) - { - d_chanIndex = -1; - d_rMin = d_rMax = d_cMin = d_cMax = 0; - d_valBuf = NULL; - d_valType = vrpn_IMAGER_VALTYPE_UNKNOWN; - d_valid = false; - } - - /// Returns the number of values in the region. - inline vrpn_uint32 getNumVals() const - { - if (!d_valid) { - return 0; - } - else { - return (d_rMax - d_rMin + 1) * (d_cMax - d_cMin + 1); - } - } - - /// Reads pixel from the region with no scale and offset applied to the - /// value. Not - /// the most efficient way to read the pixels out -- use the block read - /// routines. - inline bool read_unscaled_pixel(vrpn_uint16 c, vrpn_uint16 r, - vrpn_uint8 &val, vrpn_uint16 d = 0) const - { - if (!d_valid || (c < d_cMin) || (c > d_cMax) || (r < d_rMin) || - (r > d_rMax)) { - fprintf(stderr, "vrpn_Imager_Region::read_unscaled_pixel(): " - "Invalid region or out of range\n"); - return false; - } - else { - if (d_valType != vrpn_IMAGER_VALTYPE_UINT8) { - fprintf(stderr, "XXX " - "vrpn_Imager_Region::read_unscaled_pixel(): " - "Transcoding not implemented yet\n"); - return false; - } - else { - // The data is packed in with column varying fastest, row - // varying next, and depth - // varying slowest. Depth steps are therefore the largest - // steps. - val = - ((vrpn_uint8 *) - d_valBuf)[(c - d_cMin) + - (d_cMax - d_cMin + 1) * - ((r - d_rMin) + - (d - d_dMin) * (d_rMax - d_rMin + 1))]; - } - } - return true; - } - - /// Reads pixel from the region with no scale and offset applied to the - /// value. Not - // the most efficient way to read the pixels out -- use the block read - // routines. - inline bool read_unscaled_pixel(vrpn_uint16 c, vrpn_uint16 r, - vrpn_uint16 &val, vrpn_uint16 d = 0) const - { - if (!d_valid || (d < d_dMin) || (d > d_dMax) || (c < d_cMin) || - (c > d_cMax) || (r < d_rMin) || (r > d_rMax)) { - fprintf(stderr, "vrpn_Imager_Region::read_unscaled_pixel(): " - "Invalid region or out of range\n"); - return false; - } - else { - if ((d_valType != vrpn_IMAGER_VALTYPE_UINT16) && - (d_valType != vrpn_IMAGER_VALTYPE_UINT12IN16)) { - fprintf(stderr, "XXX " - "vrpn_Imager_Region::read_unscaled_pixel(): " - "Transcoding not implemented yet\n"); - return false; - } - else if (vrpn_big_endian) { - fprintf(stderr, "XXX " - "vrpn_Imager_Region::read_unscaled_pixel(): " - "Not implemented on big-endian yet\n"); - return false; - } - else { - // The data is packed in with column varying fastest, row - // varying next, and depth - // varying slowest. Depth steps are therefore the largest - // steps. - val = - ((vrpn_uint16 *) - d_valBuf)[(c - d_cMin) + - (d_cMax - d_cMin + 1) * - ((r - d_rMin) + - (d - d_dMin) * (d_rMax - d_rMin + 1))]; - } - } - return true; - } - - /// Reads pixel from the region with no scale and offset applied to the - /// value. Not - // the most efficient way to read the pixels out -- use the block read - // routines. - inline bool read_unscaled_pixel(vrpn_uint16 c, vrpn_uint16 r, - vrpn_float32 &val, vrpn_uint16 d = 0) const - { - if (!d_valid || (d < d_dMin) || (d > d_dMax) || (c < d_cMin) || - (c > d_cMax) || (r < d_rMin) || (r > d_rMax)) { - fprintf(stderr, "vrpn_Imager_Region::read_unscaled_pixel(): " - "Invalid region or out of range\n"); - return false; - } - else { - if (d_valType != vrpn_IMAGER_VALTYPE_FLOAT32) { - fprintf(stderr, "XXX " - "vrpn_Imager_Region::read_unscaled_pixel(): " - "Transcoding not implemented yet\n"); - return false; - } - else if (vrpn_big_endian) { - fprintf(stderr, "XXX " - "vrpn_Imager_Region::read_unscaled_pixel(): " - "Not implemented on big-endian yet\n"); - return false; - } - else { - // The data is packed in with column varying fastest, row - // varying next, and depth - // varying slowest. Depth steps are therefore the largest - // steps. - val = - ((vrpn_float32 *) - d_valBuf)[(c - d_cMin) + - (d_cMax - d_cMin + 1) * - ((r - d_rMin) + - (d - d_dMin) * (d_rMax - d_rMin + 1))]; - } - } - return true; - } - - // Bulk read routines to copy the whole region right into user structures as - // efficiently as possible. - bool decode_unscaled_region_using_base_pointer( - vrpn_uint8 *data, vrpn_uint32 colStride, vrpn_uint32 rowStride, - vrpn_uint32 depthStride = 0, vrpn_uint16 nRows = 0, - bool invert_rows = false, unsigned repeat = 1) const; - // This routine also reads 12-bits-in-16-bit values. - bool decode_unscaled_region_using_base_pointer( - vrpn_uint16 *data, vrpn_uint32 colStride, vrpn_uint32 rowStride, - vrpn_uint32 depthStride = 0, vrpn_uint16 nRows = 0, - bool invert_rows = false, unsigned repeat = 1) const; - bool decode_unscaled_region_using_base_pointer( - vrpn_float32 *data, vrpn_uint32 colStride, vrpn_uint32 rowStride, - vrpn_uint32 depthStride = 0, vrpn_uint16 nRows = 0, - bool invert_rows = false, unsigned repeat = 1) const; - - // XXX Add routines to read scaled pixels. Clamp values. - - // Report the type of the values stored in the region. The above routines - // use this to decode automatically, but user code may want to do different - // things with different types of data. - vrpn_uint16 get_val_type(void) const { return d_valType; } - - vrpn_int16 d_chanIndex; //< Which channel this region holds data for - vrpn_uint16 d_rMin, d_rMax; //< Range of indices for the rows - vrpn_uint16 d_cMin, d_cMax; //< Range of indices for the columns - vrpn_uint16 d_dMin, d_dMax; //< Range of indices for the depth - -protected: - const void *d_valBuf; //< Pointer to the buffer of values - vrpn_uint16 d_valType; //< Type of the values in the buffer - bool d_valid; //< Tells whether the helper can be used. -}; - -/// This is the class users deal with: it tells the format and the region data -/// when it arrives. -class VRPN_API vrpn_Imager_Remote : public vrpn_Imager { -public: - vrpn_Imager_Remote(const char *name, vrpn_Connection *c = NULL); - - /// Register a handler for when new data arrives (can look up info in object - /// when this happens) - virtual int register_region_handler(void *userdata, - vrpn_IMAGERREGIONHANDLER handler) - { - return d_region_list.register_handler(userdata, handler); - }; - virtual int unregister_region_handler(void *userdata, - vrpn_IMAGERREGIONHANDLER handler) - { - return d_region_list.unregister_handler(userdata, handler); - } - - /// Register a handler for when the object's description changes (if - /// desired). - virtual int - register_description_handler(void *userdata, - vrpn_IMAGERDESCRIPTIONHANDLER handler) - { - return d_description_list.register_handler(userdata, handler); - }; - virtual int - unregister_description_handler(void *userdata, - vrpn_IMAGERDESCRIPTIONHANDLER handler) - { - return d_description_list.unregister_handler(userdata, handler); - } - - /// Register a handler for frame beginning (if the application cares) - virtual int - register_begin_frame_handler(void *userdata, - vrpn_IMAGERBEGINFRAMEHANDLER handler) - { - return d_begin_frame_list.register_handler(userdata, handler); - }; - virtual int - unregister_begin_frame_handler(void *userdata, - vrpn_IMAGERBEGINFRAMEHANDLER handler) - { - return d_begin_frame_list.unregister_handler(userdata, handler); - } - - /// Register a handler for frame end (if the application cares) - virtual int register_end_frame_handler(void *userdata, - vrpn_IMAGERENDFRAMEHANDLER handler) - { - return d_end_frame_list.register_handler(userdata, handler); - }; - virtual int unregister_end_frame_handler(void *userdata, - vrpn_IMAGERENDFRAMEHANDLER handler) - { - return d_end_frame_list.unregister_handler(userdata, handler); - } - - /// Register a handler for discarded frame notifications (if the application - /// cares) - virtual int - register_discarded_frames_handler(void *userdata, - vrpn_IMAGERDISCARDEDFRAMESHANDLER handler) - { - return d_discarded_frames_list.register_handler(userdata, handler); - }; - virtual int unregister_discarded_frames_handler( - void *userdata, vrpn_IMAGERDISCARDEDFRAMESHANDLER handler) - { - return d_discarded_frames_list.unregister_handler(userdata, handler); - } - - /// Request that the server send at most N more frames until a new request - /// is sent. - // This is used to throttle senders that are incurring lots of latency by - // filling - // the network with packets and blocking. The next request for "N" will add - // onto - // the request. Sending "-1" means to send continuously as fast as - // possible, - // which is the default. - virtual bool throttle_sender(vrpn_int32 N); - - /// XXX It could be nice to let the user specify separate callbacks for - // region size changed (which would be called only if the description had - // a different region size than the last time, and also the first time it - // is called) and channel changes (which would require keeping a copy of - // the old and diffing when a new description came in). Also, the interace - // could hook different callbacks for different channels IDs to let the - // Imager do the work of sorting out any mapping changes and keeping track - // of which channel is handled by which callback -- like the Tracker and its - // sensors. This should happen by name, rather than by index. It might be - // nice to provide a delete callback when a channel is removed and an add - // callback when a channel is added as well, and a change callback if the - // name, units, scale or offset change. - - /// Call this each time through the program's main loop - virtual void mainloop(void); - - /// Accessors for the member variables: can be queried in the handler for - /// object changes - const vrpn_Imager_Channel *channel(unsigned chanNum) const; - - /// have we gotten a description message yet? - bool is_description_valid() { return d_got_description; } - -protected: - bool d_got_description; //< Have we gotten a description yet? - // Lists to keep track of registered user handlers. - vrpn_Callback_List<struct timeval> d_description_list; - vrpn_Callback_List<vrpn_IMAGERREGIONCB> d_region_list; - vrpn_Callback_List<vrpn_IMAGERBEGINFRAMECB> d_begin_frame_list; - vrpn_Callback_List<vrpn_IMAGERENDFRAMECB> d_end_frame_list; - vrpn_Callback_List<vrpn_IMAGERDISCARDEDFRAMESCB> d_discarded_frames_list; - - /// Handler for region update message from the server. - static int VRPN_CALLBACK - handle_region_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Handler for resolution and channel list message from the server. - static int VRPN_CALLBACK - handle_description_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Handler for connection dropped message - static int VRPN_CALLBACK - handle_connection_dropped_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Handler for begin-frame message from the server. - static int VRPN_CALLBACK - handle_begin_frame_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Handler for end-frame message from the server. - static int VRPN_CALLBACK - handle_end_frame_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Handler for discarded-frames message from the server. - static int VRPN_CALLBACK - handle_discarded_frames_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -//------------------------------------------------------------------------------ -// ImagerPose_Remote deals with the physical size and location the pixels in -// an image. - -typedef void(VRPN_CALLBACK *vrpn_IMAGERPOSEDESCRIPTIONHANDLER)( - void *userdata, const struct timeval msg_time); - -class VRPN_API vrpn_ImagerPose_Remote : public vrpn_ImagerPose { -public: - vrpn_ImagerPose_Remote(const char *name, vrpn_Connection *c = NULL); - - /// Register a handler for when the object's description changes (if - /// desired) - virtual int - register_description_handler(void *userdata, - vrpn_IMAGERDESCRIPTIONHANDLER handler) - { - return d_description_list.register_handler(userdata, handler); - }; - virtual int - unregister_description_handler(void *userdata, - vrpn_IMAGERDESCRIPTIONHANDLER handler) - { - return d_description_list.unregister_handler(userdata, handler); - } - - /// Call this each time through the program's main loop - virtual void mainloop(void); - -protected: - // Lists to keep track of registered user handlers. - vrpn_Callback_List<struct timeval> d_description_list; - - /// Handler for resolution and channel list message from the server. - static int VRPN_CALLBACK - handle_description_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -#endif diff --git a/src/vrpn/vrpn_Imager_Stream_Buffer.C b/src/vrpn/vrpn_Imager_Stream_Buffer.C deleted file mode 100644 index c5d2fa820cd28ef905e6d8e8f7d12f8f64c40ffd..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Imager_Stream_Buffer.C +++ /dev/null @@ -1,943 +0,0 @@ -#include <stdio.h> // for fprintf, NULL, stderr, etc - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR, etc -#include "vrpn_Imager_Stream_Buffer.h" - -vrpn_Imager_Stream_Buffer::vrpn_Imager_Stream_Buffer( - const char *name, const char *imager_server_name, vrpn_Connection *c) - : vrpn_Auxiliary_Logger_Server(name, c) - , vrpn_Imager_Server( - name, c, 0, 0) // Default number of rows and columns for the device. - , d_logging_thread(NULL) - , d_imager_server_name(NULL) -{ - // Copy the name of the server we are to connect to when we are logging. - d_imager_server_name = new char[strlen(imager_server_name) + 1]; - if (d_imager_server_name == NULL) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::vrpn_Imager_Stream_Buffer: " - "Out of memory\n"); - d_connection = NULL; - return; - } - strcpy(d_imager_server_name, imager_server_name); - - // Create the logging thread but do not run it yet. - vrpn_ThreadData td; - td.pvUD = this; - d_logging_thread = new vrpn_Thread(static_logging_thread_func, td); - if (d_logging_thread == NULL) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::vrpn_Imager_Stream_Buffer: " - "can't create logging thread\n"); - d_connection = NULL; - return; - } - - // Register a handler for the got first connection message. - got_first_connection_m_id = - d_connection->register_message_type(vrpn_got_first_connection); - if (got_first_connection_m_id == -1) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::vrpn_Imager_Stream_Buffer: " - "can't register got first connection type\n"); - d_connection = NULL; - return; - } - if (register_autodeleted_handler(got_first_connection_m_id, - static_handle_got_first_connection, this, - vrpn_ANY_SENDER)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::vrpn_Imager_Stream_Buffer: " - "can't register got first connection handler\n"); - d_connection = NULL; - } - - // The base server class implements throttling for us, so we could just go - // ahead - // and try to send the messages all the time using the normal frame - // begin/end and - // region routines. If we do this, though, we're going to have to unpack - // and repack - // all of the messages. If we re-implement the throttling code, then we can - // just - // watch the packets as they go by and see what types they are, discarding - // as - // appropriate (but we still have to queue and watch them). - // If we implement the throttling - // code down in the thread that listens to the server, we can avoid putting - // them into the queue at all. In that case, there can be a frame or more - // in - // the queue that would drain even after the throttle message was received. - // We can subtract the number of frames in the buffer from the request if - // the - // request is large enough, thus removing the problem, but it won't work for - // the common case of requesting 0 or 1 frames. This will work in the - // steady - // state, where a sender requests one more each time it gets one, but there - // will be an initial bolus of images. - // Nonetheless, this seems like the cleanest solution. So, we will - // install - // a handler for the throttling message that will pass it on down to the - // thread - // that is baby-sitting the server object. - if (register_autodeleted_handler(d_throttle_frames_m_id, - static_handle_throttle_message, this, - vrpn_ANY_SENDER)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::vrpn_Imager_Stream_Buffer: " - "can't register throttle handler\n"); - d_connection = NULL; - } -} - -vrpn_Imager_Stream_Buffer::~vrpn_Imager_Stream_Buffer() -{ - stop_logging_thread(); - if (d_imager_server_name) { - delete[] d_imager_server_name; - d_imager_server_name = NULL; - } -} - -void vrpn_Imager_Stream_Buffer::mainloop(void) -{ - // Required from all servers - server_mainloop(); - - // See if we have a new image description from a logging thread. If so, - // fill in our values and send a description to any attached clients. - const char *channelBuffer = NULL; - if (d_shared_state.get_imager_description(d_nRows, d_nCols, d_nDepth, - d_nChannels, &channelBuffer)) { - int i; - const char *bufptr = channelBuffer; - for (i = 0; i < d_nChannels; i++) { - d_channels[i].unbuffer(&bufptr); - } - delete[] const_cast<char *>(channelBuffer); - send_description(); - } - - // See if we have any messages waiting in the queue from the logging thread. - // If we do, get an initial count and then send that many messages to the - // client. Don't go looking again this iteration or we may never return -- - // the server is quite possibly packing frames faster than we can send them. - // Note that the messages in the queue have already been transcoded for our - // and sender ID. - unsigned count = d_shared_state.get_logger_to_client_queue_size(); - if (count) { - unsigned i; - for (i = 0; i < count; i++) { - // Read the next message from the queue. - vrpn_HANDLERPARAM p; - if (!d_shared_state.retrieve_logger_to_client_message(&p)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::mainloop(): Could " - "not retrieve message from queue\n"); - break; - } - - // Decrement the in-buffer frame count whenever we see a begin_frame - // message. This will un-block the way for later frames to be - // buffered. - if (p.type == d_begin_frame_m_id) { - d_shared_state.decrement_frames_in_queue(); - } - - // Pack and send the message to the client, then delete the buffer - // associated with the message. Send them all reliably. Send them - // all using our sender ID. - if (d_connection->pack_message(p.payload_len, p.msg_time, p.type, - d_sender_id, p.buffer, - vrpn_CONNECTION_RELIABLE) != 0) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::mainloop(): Could " - "not pack message\n"); - break; - } - delete[] const_cast<char *>(p.buffer); - } - } -} - -/* static */ -// This method just passes the call on to the virtual function. -int vrpn_Imager_Stream_Buffer::static_handle_got_first_connection( - void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Imager_Stream_Buffer *me = - static_cast<vrpn_Imager_Stream_Buffer *>(userdata); - me->handle_got_first_connection(); - return 0; -} - -// Handle got first connection request by (having the second thread) create -// a connection to the server and waiting until we get a description message -// from the imager server we're listening to. Timeout after a while if the -// connection cannot be made or the server does not respond. - -void vrpn_Imager_Stream_Buffer::handle_got_first_connection(void) -{ - // There should be no thread in existence when this call is made. - // If there is, kill it and complain. - if (d_logging_thread->running()) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message( - "handle_got_first_connection: Thread running when it should not be", - now, vrpn_TEXT_ERROR); - d_logging_thread->kill(); - return; - } - - // Reset the shared state before starting the thread running. - d_shared_state.init(); - - // Create a thread whose userdata points at the object that - // created it. Then call the start function on that thread and wait - // for its vrpn_Imager_Remote to receive the info from the remote server - // it has connected to. We time out after a few seconds if we don't - // get the response, leaving us with a presumably broken connection - // to the server. - if (!d_logging_thread->go()) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message( - "handle_got_first_connection: Failed to start logging thread", now, - vrpn_TEXT_ERROR); - delete d_logging_thread; - d_logging_thread = NULL; - return; - } - struct timeval start, now; - vrpn_gettimeofday(&start, NULL); - do { - const char *channelBuffer = NULL; - if (d_shared_state.get_imager_description( - d_nRows, d_nCols, d_nDepth, d_nChannels, &channelBuffer)) { - int i; - const char *bufptr = channelBuffer; - for (i = 0; i < d_nChannels; i++) { - d_channels[i].unbuffer(&bufptr); - } - delete[] const_cast<char *>(channelBuffer); - return; - } - - vrpn_SleepMsecs(1); - vrpn_gettimeofday(&now, NULL); - } while (vrpn_TimevalDiff(now, start).tv_sec < 3); - - // Timed out, so we won't be hearing from the server! - vrpn_gettimeofday(&now, NULL); - send_text_message("handle_got_first_connection: Didn't hear from server.", - now, vrpn_TEXT_WARNING); -} - -// Handle dropped last connection on our primary connection by shutting down the -// connection to the imager server (killing the logging thread). -void vrpn_Imager_Stream_Buffer::handle_dropped_last_connection(void) -{ - if (!stop_logging_thread()) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::handle_dropped_last_" - "connection(): Had to kill logging thread\n"); - } -} - -// Handles a throttle request by passing it on down to the non-blocking -// thread to deal with. -int vrpn_Imager_Stream_Buffer::static_handle_throttle_message( - void *userdata, vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_Imager_Stream_Buffer *me = - static_cast<vrpn_Imager_Stream_Buffer *>(userdata); - - // Get the requested number of frames from the buffer - vrpn_int32 frames_to_send; - if (vrpn_unbuffer(&bufptr, &frames_to_send)) { - return -1; - } - - me->d_shared_state.set_throttle_request(frames_to_send); - return 0; -} - -// The function that is called to become the logging thread. It is passed -// a pointer to "this" so that it can acces the object that created it. -// The static function basically just unpacks the "this" pointer and -// then calls the non-static function. -void vrpn_Imager_Stream_Buffer::static_logging_thread_func( - vrpn_ThreadData &threadData) -{ - vrpn_Imager_Stream_Buffer *me = - static_cast<vrpn_Imager_Stream_Buffer *>(threadData.pvUD); - me->logging_thread_func(); -} - -// Note that it must use semaphores to get at the data that will be shared -// between the main thread and itself. -// This function does all the work of the logging thread, including all -// interactions with the vrpn_Imager_Server connection(s) and the client -// object; it forwards information both ways to the main thread that is -// communicating with the end-user client connection. -// DO NOT CALL VRPN message sends on the client object's connection from -// this function or those it calls, because we're not the thread that is -// connected to the client object's connection and such calls are not -// thread-safe. -// Instead, pass the data needed to make the calls to the initial thread. -void vrpn_Imager_Stream_Buffer::logging_thread_func(void) -{ - // Initialize everything to a clean state. - d_log_connection = NULL; - d_imager_remote = NULL; - d_server_dropped_due_to_throttle = 0; // None dropped yet! - d_server_frames_to_send = -1; // Send as many as you get - - // Open a connection to the server object, not asking it to log anything. - // (Logging will be started later if we receive a message from our client.) - // Create a vrpn_Imager_Remote object and set its callbacks to fill things - // into the shared data structures. - d_log_connection = open_new_log_connection("", "", "", ""); - if (d_log_connection == NULL) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::logging_thread_func(): " - "Cannot open connection\n"); - return; - } - if (!setup_handlers_for_logging_connection(d_log_connection)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::logging_thread_func(): " - "Cannot set up handlers\n"); - return; - } - - // Keep doing mainloop() on the client object(s) and checking - // for commands that we're supposed to issue until we're - // told that we're supposed to die. Sleep a little between iterations - // to avoid eating CPU time. - while (!d_shared_state.time_to_exit()) { - // Check to see if the client has sent a new throttling message. - // If so, then adjust our state accordingly. Note that we are - // duplicating - // the effort of the vrpn_Imager_Server base class here; it will still - // be - // keeping its own shadow copy of these values, but will not be doing - // anything - // with them because we'll never be calling its send routines. This - // duplicates - // the code in the handle_throttle_message() in the vrpn_Imager_Server - // base - // class. - vrpn_int32 frames_to_send; - if (d_shared_state.get_throttle_request(&frames_to_send)) { - // If the requested number of frames is negative, then we set - // for unbounded sending. The next time a begin_frame message - // arrives, it will start the process going again. - if (frames_to_send < 0) { - d_server_frames_to_send = -1; - - // If we were sending continuously, store the number of frames - // to send. Decrement by the number of frames already in the - // outgoing buffer, but don't let the number go below zero. - } - else if (d_server_frames_to_send == -1) { - int frames_in_queue = d_shared_state.get_frames_in_queue(); - if (frames_to_send >= frames_in_queue) { - frames_to_send -= frames_in_queue; - } - d_server_frames_to_send = frames_to_send; - - // If we already had a throttle limit set, then increment it - // by the count. - } - else { - d_server_frames_to_send += frames_to_send; - } - } - - // Check to see if we've been asked to create new log files. If we - // have, - // then attempt to do so. If that works, pass back the names of the - // files - // created to the initial thread. If it did not work, return empty - // log-file - // names. - char *lil, *lol, *ril, *rol; - if (d_shared_state.get_logfile_request(&lil, &lol, &ril, &rol)) { - if (make_new_logging_connection(lil, lol, ril, rol)) { - d_shared_state.set_logfile_result(lil, lol, ril, rol); - } - else { - d_shared_state.set_logfile_result("", "", "", ""); - } - // Delete the allocated space only if there were return values. - delete[] lil; - delete[] lol; - delete[] ril; - delete[] rol; - } - - // Handle all of the messages coming from the server. - if (d_imager_remote) { - d_imager_remote->mainloop(); - } - if (d_log_connection) { - d_log_connection->mainloop(); - d_log_connection->save_log_so_far(); - } - - vrpn_SleepMsecs(1); - } - - // Now that we've been told to die, clean up everything and return. - if (d_imager_remote) { - delete d_imager_remote; - d_imager_remote = NULL; - } - if (d_log_connection) { - d_log_connection->removeReference(); - d_log_connection = NULL; - } -} - -/* static */ -int VRPN_CALLBACK -vrpn_Imager_Stream_Buffer::static_handle_server_messages(void *pvISB, - vrpn_HANDLERPARAM p) -{ - vrpn_Imager_Stream_Buffer *me = - static_cast<vrpn_Imager_Stream_Buffer *>(pvISB); - return me->handle_server_messages(p); -} - -int vrpn_Imager_Stream_Buffer::handle_server_messages( - const vrpn_HANDLERPARAM &p) -{ - // Handle begin_frame message very specially, because it has all sorts - // of interactions with throttling and missed-frame reporting. - if (p.type == d_server_begin_frame_m_id) { - // This duplicates code from the send_begin_frame() method in - // the vrpn_Imager_Server base class that handles throttling. - // It further adds code to handle throttling when the queue to - // the initial thread is too full. - - // If we are throttling frames and the frame count has gone to zero, - // then increment the number of frames missed and do not add this - // message to the queue. - if (d_server_frames_to_send == 0) { - d_server_dropped_due_to_throttle++; - return 0; - } - - // If there are too many frames in the queue already, - // add one to the number lost due to throttling (which - // will prevent region and end-of-frame messages until the next - // begin_frame message) and break without forwarding the message. - if (d_shared_state.get_frames_in_queue() >= 2) { - d_server_dropped_due_to_throttle++; - return 0; - } - - // If we missed some frames due to throttling, but are now - // sending frames again, report how many we lost due to - // throttling. This is incremented both for client-requested - // throttling and to queue-overflow throttling. - if (d_server_dropped_due_to_throttle > 0) { - // We create a new message header and body, using the server's - // type IDs, and then transcode and send the message through - // the initial connection. - vrpn_HANDLERPARAM tp = p; - vrpn_float64 - fbuf[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64)]; - char *msgbuf = (char *)fbuf; - int buflen = sizeof(fbuf); - tp.type = d_server_discarded_frames_m_id; - - if (vrpn_buffer(&msgbuf, &buflen, - d_server_dropped_due_to_throttle)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::handle_server_" - "messages: Can't pack count\n"); - return -1; - } - tp.buffer = static_cast<char *>(static_cast<void *>(fbuf)); - tp.payload_len = sizeof(fbuf) - buflen; - - if (!transcode_and_send(tp)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::handle_server_" - "messages: Can't send discarded frames " - "count\n"); - return -1; - } - - d_server_dropped_due_to_throttle = 0; - } - - // If we are throttling, then decrement the number of frames - // left to send. - if (d_server_frames_to_send > 0) { - d_server_frames_to_send--; - } - - // No throttling going on, so add the message to the outgoing queue and - // also increment the count of how many outstanding frames are in the - // queue. - if (!transcode_and_send(p)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::handle_server_messages:" - " Can't transcode and send\n"); - return -1; - } - d_shared_state.increment_frames_in_queue(); - - // Handle the end_frame and all of the region messages in a similar - // manner, - // dropping them if throttling is going on and passing them on if not. - // This duplicates code from the send_end_frame() and the region - // send methods in the vrpn_Imager_Server base class that handles - // throttling. - } - else if ((p.type == d_server_end_frame_m_id) || - (p.type == d_server_regionu8_m_id) || - (p.type == d_server_regionu12in16_m_id) || - (p.type == d_server_regionu16_m_id) || - (p.type == d_server_regionf32_m_id)) { - - // If we are discarding frames, do not queue this message. - if (d_server_dropped_due_to_throttle > 0) { - return 0; - } - - // No throttling going on, so add this message to the outgoing queue. - if (!transcode_and_send(p)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::handle_server_messages:" - " Can't transcode and send\n"); - return -1; - } - - // Send these messages on without modification - // (Currently, these are description messages and discarded-frame - // messages. It also includes the generic pong response and any - // text messages.) - } - else if ((p.type == d_server_description_m_id) || - (p.type == d_server_discarded_frames_m_id) || - (p.type == d_server_text_m_id) || (p.type == d_server_pong_m_id)) { - if (!transcode_and_send(p)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::handle_server_messages:" - " Can't transcode and send\n"); - return -1; - } - - // Ignore these messages without passing them on. - } - else if ((p.type == d_server_ping_m_id)) { - return 0; - - // We need to throw a warning here on unexpected types so that we get - // some - // warning if additional messages are added. This code is fragile - // because it - // relies on us knowing the types of base-level and imager messages and - // catching - // them all. This way, at least we'll know if we miss one. - } - else { - // We create a new message header and body, using the server's - // type IDs, and then transcode and send the message through - // the initial connection. This is a text message saying that we - // got a message of unknown type. - vrpn_HANDLERPARAM tp = p; - char buffer[2 * sizeof(vrpn_int32) + vrpn_MAX_TEXT_LEN]; - char msg[vrpn_MAX_TEXT_LEN]; - tp.type = d_server_text_m_id; - tp.buffer = buffer; - tp.payload_len = sizeof(buffer); - sprintf(msg, "Unknown message type from server: %d", - static_cast<int>(p.type)); - encode_text_message_to_buffer(buffer, vrpn_TEXT_ERROR, 0, msg); - if (!transcode_and_send(tp)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::handle_server_messages:" - " Can't transcode text message\n"); - return -1; - } - } - - return 0; -} - -// Transcode the sender and type fields from the logging server connection to -// the initial client connection and pack the resulting message into the queue -// from the logging thread to the initial thread. The data buffer is copied; -// this space is allocated by the logging thread and must be freed by the -// initial thread. -// Returns true on success and false on failure. The sender is set to the -// d_sender_id of our server object. -bool vrpn_Imager_Stream_Buffer::transcode_and_send(const vrpn_HANDLERPARAM &p) -{ - // Copy the contents of the buffer to a newly-allocated one that will be - // passed to the initial thread. - char *newbuf = new char[p.payload_len]; - if (newbuf == NULL) { - fprintf( - stderr, - "vrpn_Imager_Stream_Buffer::transcode_and_send(): Out of memory\n"); - return false; - } - memcpy(newbuf, p.buffer, p.payload_len); - - // Copy the contents of the handlerparam to a newly-allocated one that will - // be passed to the initial thread. Change the sender to match ours, set - // the - // buffer pointer to the new buffer, and transcode the type. - vrpn_HANDLERPARAM newp = p; - newp.buffer = newbuf; - newp.sender = d_sender_id; - newp.type = transcode_type(p.type); - if (newp.type == -1) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::transcode_and_send(): " - "Unknown type (%d)\n", - static_cast<int>(p.type)); - delete[] newbuf; - return false; - } - - // Add the message to the queue of messages going to the initial thread. - if (!d_shared_state.insert_logger_to_client_message(newp)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::transcode_and_send(): " - "Can't queue message\n"); - return false; - } - - return true; -} - -// Transcode the type from the logging thread's connection type to -// the initial thread's connection type. Return -1 if we don't -// recognize the type. -vrpn_int32 vrpn_Imager_Stream_Buffer::transcode_type(vrpn_int32 type) -{ - if (type == d_server_description_m_id) { - return d_description_m_id; - } - else if (type == d_server_begin_frame_m_id) { - return d_begin_frame_m_id; - } - else if (type == d_server_end_frame_m_id) { - return d_end_frame_m_id; - } - else if (type == d_server_discarded_frames_m_id) { - return d_discarded_frames_m_id; - } - else if (type == d_server_regionu8_m_id) { - return d_regionu8_m_id; - } - else if (type == d_server_regionu12in16_m_id) { - return d_regionu12in16_m_id; - } - else if (type == d_server_regionu16_m_id) { - return d_regionu16_m_id; - } - else if (type == d_server_regionf32_m_id) { - return d_regionf32_m_id; - } - else if (type == d_server_text_m_id) { - return d_text_message_id; - } - else if (type == d_server_ping_m_id) { - return d_ping_message_id; - } - else if (type == d_server_pong_m_id) { - return d_pong_message_id; - } - else { - return -1; - } -} - -vrpn_Connection *vrpn_Imager_Stream_Buffer::open_new_log_connection( - const char *local_in_logfile_name, const char *local_out_logfile_name, - const char *remote_in_logfile_name, const char *remote_out_logfile_name) -{ - vrpn_Connection *ret = NULL; - - // Find the relevant part of the name (skip past last '@' - // if there is one); also find the port number. - const char *cname = d_imager_server_name; - const char *where_at; // Part of name past last '@' - if ((where_at = strrchr(cname, '@')) != NULL) { - cname = where_at + 1; // Chop off the front of the name - } - - // Pass "true" to force_connection so that it will open a new - // connection even if we already have one with that name. - ret = vrpn_get_connection_by_name( - where_at, local_in_logfile_name, local_out_logfile_name, - remote_in_logfile_name, remote_out_logfile_name, NULL, true); - if (!ret || !ret->doing_okay()) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - fprintf(stderr, "vrpn_Imager_Stream_Buffer::open_new_log_connection: " - "Could not create connection (files already exist?)"); - if (ret) { - delete ret; - return NULL; - } - } - - return ret; -} - -bool vrpn_Imager_Stream_Buffer::setup_handlers_for_logging_connection( - vrpn_Connection *c) -{ - // Create a vrpn_Imager_Remote on this connection and set its callbacks so - // that they will do what needs doing; the callbacks point to the - // Imager_Stream_Buffer object, not to the imager_remote object; access it - // through the member variable pointer. - d_imager_remote = new vrpn_Imager_Remote(d_imager_server_name, c); - if (d_imager_remote == NULL) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::setup_handlers_for_logging_" - "connection(): Cannot create vrpn_Imager_Remote\n"); - return false; - } - d_imager_remote->register_description_handler(this, - handle_image_description); - - // Figure out the remote type IDs from the server for the messages we want - // to forward. This is really dangerous, because we need to make sure to - // explicitly list all the ones we might need. If we forget an important - // one (or it gets added later to either the base class or the imager class) - // then it won't get forwarded. - d_server_description_m_id = - c->register_message_type("vrpn_Imager Description"); - d_server_begin_frame_m_id = - c->register_message_type("vrpn_Imager Begin_Frame"); - d_server_end_frame_m_id = c->register_message_type("vrpn_Imager End_Frame"); - d_server_discarded_frames_m_id = - c->register_message_type("vrpn_Imager Discarded_Frames"); - d_server_regionu8_m_id = c->register_message_type("vrpn_Imager Regionu8"); - d_server_regionu16_m_id = c->register_message_type("vrpn_Imager Regionu16"); - d_server_regionu12in16_m_id = - c->register_message_type("vrpn_Imager Regionu12in16"); - d_server_regionf32_m_id = c->register_message_type("vrpn_Imager Regionf32"); - d_server_text_m_id = c->register_message_type("vrpn_Base text_message"); - d_server_ping_m_id = c->register_message_type("vrpn_Base ping_message"); - d_server_pong_m_id = c->register_message_type("vrpn_Base pong_message"); - - // Set up handlers for the other messages from the server so that they can - // be passed on up to the initial thread and on to the client as - // appropriate. - // Be sure to strip the "@" part off the device name before registering the - // sender - // so that it is the same as the one used by the d_imager_remote. - c->register_handler( - vrpn_ANY_TYPE, static_handle_server_messages, this, - c->register_sender(vrpn_copy_service_name(d_imager_server_name))); - - return true; -} - -bool vrpn_Imager_Stream_Buffer::teardown_handlers_for_logging_connection( - vrpn_Connection *c) -{ - if (!d_imager_remote) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::teardown_handlers_for_" - "logging_connection(): No imager remote\n"); - return false; - } - if (d_imager_remote->unregister_description_handler( - this, handle_image_description) != 0) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::teardown_handlers_for_" - "logging_connection(): Cannot unregister handler\n"); - return false; - } - - // Tear down handlers for the other messages from the server. - c->unregister_handler( - vrpn_ANY_TYPE, static_handle_server_messages, this, - c->register_sender(vrpn_copy_service_name(d_imager_server_name))); - - delete d_imager_remote; - d_imager_remote = NULL; - return true; -} - -bool vrpn_Imager_Stream_Buffer::make_new_logging_connection( - const char *local_in_logfile_name, const char *local_out_logfile_name, - const char *remote_in_logfile_name, const char *remote_out_logfile_name) -{ - // Open a new connection to do logging on before deleting the old one so - // that we keep at least one connection open to the server at all time. - // This will prevent it from doing its "dropped last connection" things - // which will include resetting the imager server. - vrpn_Connection *new_log_connection = open_new_log_connection( - local_in_logfile_name, local_out_logfile_name, remote_in_logfile_name, - remote_out_logfile_name); - if (new_log_connection == NULL) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::make_new_logging_" - "connection(): Cannot open connection\n"); - return false; - } - - // Unhook the callbacks from the existing logging connection so that - // we don't end up with two callbacks for each message. - if (!teardown_handlers_for_logging_connection(d_log_connection)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::make_new_logging_" - "connection(): Cannot teardown connection\n"); - return false; - } - - // Hook the callbacks up to the new connection so that we will get reports - // from the server. - if (!setup_handlers_for_logging_connection(new_log_connection)) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::make_new_logging_" - "connection(): Cannot setup connection\n"); - return false; - } - - // Mainloop the new connection object until it becomes connected or we - // time out. If we time out, then put things back on the old connection - // and tell the thread it is time to self-destruct. The way we check - // for connected cannot be just that the connection's connected() method - // returns true (because our end can be marked connected before the other - // end decides it has complete the connection. Rather, we check to see - // that we've got a new description report from the server -- indicating - // that it has seen the new report. This also lets us know that the old - // log file will have accumulated all images up to the new report, so we - // can shut it off without losing any images in the switch to the new - // log file (there may be duplicates, but not losses). - struct timeval start, now; - vrpn_gettimeofday(&start, NULL); - now = start; - d_ready_to_drop_old_connection = false; - while (!d_ready_to_drop_old_connection && - (vrpn_TimevalDiff(now, start).tv_sec < 3)) { - new_log_connection->mainloop(); // Enable connection set-up to occur - new_log_connection->save_log_so_far(); - d_log_connection->mainloop(); // Eat up (and log) any incoming messages - d_log_connection->save_log_so_far(); - vrpn_gettimeofday(&now, NULL); - vrpn_SleepMsecs(1); - }; - if (!d_ready_to_drop_old_connection) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::make_new_logging_" - "connection(): Could not connect new logging " - "connection\n"); - teardown_handlers_for_logging_connection(new_log_connection); - setup_handlers_for_logging_connection(d_log_connection); - new_log_connection->removeReference(); - d_shared_state.time_to_exit(true); - return false; - } - - // Delete the old connection object by reducing its reference count. - d_log_connection->removeReference(); - - // Set up to use the new connection - d_log_connection = new_log_connection; - return true; -} - -void vrpn_Imager_Stream_Buffer::handle_request_logging( - const char *local_in_logfile_name, const char *local_out_logfile_name, - const char *remote_in_logfile_name, const char *remote_out_logfile_name) -{ - // Request that the logging thread start new logs. - d_shared_state.set_logfile_request( - local_in_logfile_name, local_out_logfile_name, remote_in_logfile_name, - remote_out_logfile_name); - - // Wait until we hear back from the logging thread or time out; - // return empty if timeout and the strings we got back if not. - // Remember to deallocated the memory if we got a response. - struct timeval start, now; - vrpn_gettimeofday(&start, NULL); - do { - char *lil, *lol, *ril, *rol; - if (d_shared_state.get_logfile_result(&lil, &lol, &ril, &rol)) { - send_report_logging(lil, lol, ril, rol); - delete[] lil; - delete[] lol; - delete[] ril; - delete[] rol; - return; - } - vrpn_SleepMsecs(1); - vrpn_gettimeofday(&now, NULL); - } while (vrpn_TimevalDiff(now, start).tv_sec < 2); - - // Timeout, report failure of logging by saying that there are empty log - // file names. - send_report_logging("", "", "", ""); -} - -void vrpn_Imager_Stream_Buffer::handle_request_logging_status() -{ - char *local_in; - char *local_out; - char *remote_in; - char *remote_out; - d_shared_state.get_logfile_names(&local_in, &local_out, &remote_in, - &remote_out); - send_report_logging(local_in, local_out, remote_in, remote_out); - if (local_in) delete[] local_in; - if (local_out) delete[] local_out; - if (remote_in) delete[] remote_in; - if (remote_out) delete[] remote_out; -} - -/* Static */ -// We've gotten a new imager description, so fill it into the shared data -// structure -// so that the parent object can hear about it. -void vrpn_Imager_Stream_Buffer::handle_image_description( - void *pvISB, const struct timeval msg_time) -{ - vrpn_Imager_Stream_Buffer *me = - static_cast<vrpn_Imager_Stream_Buffer *>(pvISB); - - // Pack up description messages for all of the channels into a buffer that - // is at - // least large enough to hold them all. - // msgbuf must be float64-aligned! - vrpn_float64 *fbuf = - new vrpn_float64[vrpn_CONNECTION_TCP_BUFLEN / sizeof(vrpn_float64)]; - char *buffer = static_cast<char *>(static_cast<void *>(fbuf)); - if (buffer == NULL) { - fprintf(stderr, "vrpn_Imager_Stream_Buffer::handle_image_description():" - " Out of memory\n"); - me->d_shared_state.time_to_exit(true); - return; - } - int i; - char *bufptr = buffer; - vrpn_int32 buflen = sizeof(vrpn_float64) * vrpn_CONNECTION_TCP_BUFLEN / - sizeof(vrpn_float64); - for (i = 0; i < me->d_imager_remote->nChannels(); i++) { - me->d_imager_remote->channel(i)->buffer(&bufptr, &buflen); - } - - me->d_shared_state.set_imager_description( - me->d_imager_remote->nRows(), me->d_imager_remote->nCols(), - me->d_imager_remote->nDepth(), me->d_imager_remote->nChannels(), - buffer); - - // We've gotten a description report on the new connection, so we're ready - // to drop the old connection. - me->d_ready_to_drop_old_connection = true; -} - -// Stop the logging thread function, cleanly if possible. Returns true if -// the function stopped cleanly, false if it had to be killed. -bool vrpn_Imager_Stream_Buffer::stop_logging_thread(void) -{ - // Set the flag telling the logging thread to stop. - d_shared_state.time_to_exit(true); - - // Wait for up to three seconds for the logging thread to die a clean death. - // If it does, return true. - struct timeval start, now; - vrpn_gettimeofday(&start, NULL); - do { - if (!d_logging_thread->running()) { - return true; - } - vrpn_SleepMsecs(1); - vrpn_gettimeofday(&now, NULL); - } while (vrpn_TimevalDiff(now, start).tv_sec < 3); - - d_logging_thread->kill(); - return false; -} diff --git a/src/vrpn/vrpn_Imager_Stream_Buffer.h b/src/vrpn/vrpn_Imager_Stream_Buffer.h deleted file mode 100644 index b9faab88b93ecc8c10ce78e0123648cca7427dba..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Imager_Stream_Buffer.h +++ /dev/null @@ -1,743 +0,0 @@ -#ifndef VRPN_IMAGER_STREAM_BUFFER_H -#define VRPN_IMAGER_STREAM_BUFFER_H -#include <string.h> // for NULL, strcpy, strlen - -#include "vrpn_Auxiliary_Logger.h" -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Connection.h" // for vrpn_Connection (ptr only), etc -#include "vrpn_Imager.h" -#include "vrpn_Shared.h" // for vrpn_Semaphore, etc -#include "vrpn_Types.h" // for vrpn_int32, vrpn_uint16 - -// This is a fairly complicated class that implements a multi-threaded -// full-rate logger and partial-rate forwarder for a vrpn_Imager_Server -// object. It is intended to allow previewing of microscopy experiments -// at a subset of the camera's video rate while logging the video at -// full rate, possibly on a remote computer and possibly on the original -// video server computer. Its architecture is described in the "Full-rate -// logging" section of the vrpn_Imager.html document in the VRPN web -// page. - -//------------------------------------------------------------------- -// This is a helper class for the vrpn_Imager_Stream_Shared_State class -// below. It keeps a linked list of vrpn_HANDLERPARAM types and the -// buffers to which they point. The buffers need to be allocated by -// the one who inserts to this list and deleted by the one who pulls -// elements from this list. - -class VRPN_API vrpn_Message_List { -public: - vrpn_Message_List(void) - { - d_first = d_last = NULL; - d_count = 0; - }; - ~vrpn_Message_List(void) - { - while (d_first != NULL) { - struct d_ELEMENT *next = d_first->next; - delete d_first; - d_first = next; - } - } - - // Give the length of the list. - unsigned size(void) const { return d_count; } - - // Insert an element into the list. Return false if fails. - bool insert_back(const vrpn_HANDLERPARAM &p) - { - struct d_ELEMENT *el = new struct d_ELEMENT; - if (el == NULL) { - return false; - } - el->p = p; - el->next = NULL; - if (d_last != NULL) { - d_last->next = el; - } - d_last = el; - if (d_first == NULL) { - d_first = el; - } - d_count++; - return true; - } - - // Remove an element from the list. Return false if fails. - bool retrieve_front(vrpn_HANDLERPARAM *p) - { - if (p == NULL) { - return false; - } - if (size() == 0) { - return false; - } - - *p = d_first->p; - if (d_last == d_first) { - d_last = NULL; - } - struct d_ELEMENT *temp = d_first; - d_first = d_first->next; - delete temp; - - d_count--; - return true; - } - -protected: - struct d_ELEMENT { - vrpn_HANDLERPARAM p; - struct d_ELEMENT *next; - }; - struct d_ELEMENT *d_first, *d_last; - unsigned d_count; -}; - -//------------------------------------------------------------------- -// This is the data structure that is shared between the initial -// thread (which listens for client connections) and the non-blocking logging -// thread that sometimes exists to listen to the vrpn_Imager_Server. -// All of its methods must be thread-safe, so it creates a semaphore -// for access and uses it in all of the non-atomic methods. -// Note that some of the things in here are pointers to objects that -// are in the parent class, and they are here just to provide the -// semaphore protection. The parent class should only access these -// things through this shared state object. - -class VRPN_API vrpn_Imager_Stream_Shared_State { -public: - vrpn_Imager_Stream_Shared_State() { init(); } - - // Reset the shared state to what it should be at - // the time the logging thread is started. - void init(void) - { - d_time_to_exit = false; - d_description_updated = false; - d_nRows = d_nCols = d_nDepth = d_nChannels = 0; - d_new_log_request = false; - d_request_lil = NULL; - d_request_lol = NULL; - d_request_ril = NULL; - d_request_rol = NULL; - d_new_log_result = false; - d_result_lil = NULL; - d_result_lol = NULL; - d_result_ril = NULL; - d_result_rol = NULL; - d_new_throttle_request = false; - d_throttle_count = -1; - d_frames_in_queue = 0; - } - - // Accessors for the "time to exit" flag; set by the initial thread and - // read by the logging thread. - bool time_to_exit(void) - { - d_sem.p(); - bool ret = d_time_to_exit; - d_sem.v(); - return ret; - } - void time_to_exit(bool do_exit) - { - d_sem.p(); - d_time_to_exit = do_exit; - d_sem.v(); - } - - // Accessors for the parameters stored based on the - // imager server's reports. Returns false if nothing has - // been set since the last time it was read, true (and fills in - // the values) if it has. Channel buffer must be delete [] by - // the one calling this function iff the function returns true. - bool get_imager_description(vrpn_int32 &nRows, vrpn_int32 &nCols, - vrpn_int32 &nDepth, vrpn_int32 &nChannels, - const char **channelBuffer) - { - d_sem.p(); - bool ret = d_description_updated; - if (d_description_updated) { - nRows = d_nRows; - nCols = d_nCols; - nDepth = d_nDepth; - nChannels = d_nChannels; - *channelBuffer = d_channel_buffer; - } - d_description_updated = false; - d_sem.v(); - return ret; - } - bool set_imager_description(vrpn_int32 nRows, vrpn_int32 nCols, - vrpn_int32 nDepth, vrpn_int32 nChannels, - const char *channelBuffer) - { - d_sem.p(); - d_nRows = nRows; - d_nCols = nCols; - d_nDepth = nDepth; - d_nChannels = nChannels; - d_channel_buffer = channelBuffer; - d_description_updated = true; - d_sem.v(); - return true; - } - - // Accessors for the initial thread to pass new logfile names down to the - // logging thread, which will cause it to initiate a changeover of logging - // connections. Space for the return strings will be allocated in these - // functions - // and must be deleted by the logging thread ONLY IF the get function fills - // the - // values in (it returns true if it does). - // NOTE: this is used to query BOTH the presence of new logfile names - // AS WELL AS the names themselves. this function will only return values - // if new logfile names have been requested since the last time this - // function was called. - bool get_logfile_request(char **lil, char **lol, char **ril, char **rol) - { - d_sem.p(); - bool ret = d_new_log_request; - if (d_new_log_request) { - // Allocate space to return the names in the handles passed in. - // Copy the values from our local storage to the return values. - if ((*lil = new char[strlen(d_request_lil) + 1]) != NULL) { - strcpy(*lil, d_request_lil); - } - if ((*lol = new char[strlen(d_request_lol) + 1]) != NULL) { - strcpy(*lol, d_request_lol); - } - if ((*ril = new char[strlen(d_request_ril) + 1]) != NULL) { - strcpy(*ril, d_request_ril); - } - if ((*rol = new char[strlen(d_request_rol) + 1]) != NULL) { - strcpy(*rol, d_request_rol); - } - - // Delete and NULL the local storage pointers. - delete[] d_request_lil; - d_request_lil = NULL; - delete[] d_request_lol; - d_request_lol = NULL; - delete[] d_request_ril; - d_request_ril = NULL; - delete[] d_request_rol; - d_request_rol = NULL; - } - d_new_log_request = false; - d_sem.v(); - return ret; - } - - void set_logfile_request(const char *lil, const char *lol, const char *ril, - const char *rol) - { - d_sem.p(); - - // delete file names, in case the logging thread hasn't had a chance to - // honor the request yet. - if (d_request_lil) { - delete[] d_request_lil; - d_request_lil = NULL; - } - if (d_request_lol) { - delete[] d_request_lol; - d_request_lol = NULL; - } - if (d_request_ril) { - delete[] d_request_ril; - d_request_ril = NULL; - } - if (d_request_rol) { - delete[] d_request_rol; - d_request_rol = NULL; - } - - // Allocate space for each string and then copy into it. - if (lil != NULL) { - if ((d_request_lil = new char[strlen(lil) + 1]) != NULL) { - strcpy(d_request_lil, lil); - } - } - if (lol != NULL) { - if ((d_request_lol = new char[strlen(lol) + 1]) != NULL) { - strcpy(d_request_lol, lol); - } - } - if (ril != NULL) { - if ((d_request_ril = new char[strlen(ril) + 1]) != NULL) { - strcpy(d_request_ril, ril); - } - } - if (rol != NULL) { - if ((d_request_rol = new char[strlen(rol) + 1]) != NULL) { - strcpy(d_request_rol, rol); - } - } - - d_new_log_request = true; - d_sem.v(); - } - - // Accessors for the logfile thread to pass new logfile names back up to the - // initial thread, reporting a changeover of logging connections. - // Space for the return strings will be allocated in these functions - // and must be deleted by the initial thread ONLY IF the get function fills - // the - // values in (it returns true if it does). - // NOTE: this function is intended to query BOTH the logfile names AS WELL - // AS - // the change in logging status. it ONLY returns filenames if logging has - // changed since the last time this function was called). - bool get_logfile_result(char **lil, char **lol, char **ril, char **rol) - { - d_sem.p(); - bool ret = d_new_log_result; - if (d_new_log_result) { - // Allocate space to return the names in the handles passed in. - // Copy the values from our local storage to the return values. - if (d_result_lil == NULL) - *lil = NULL; - else { - if ((*lil = new char[strlen(d_result_lil) + 1]) != NULL) { - strcpy(*lil, d_result_lil); - } - } - if (d_result_lol == NULL) - *lol = NULL; - else { - if ((*lol = new char[strlen(d_result_lol) + 1]) != NULL) { - strcpy(*lol, d_result_lol); - } - } - if (d_result_ril == NULL) - *ril = NULL; - else { - if ((*ril = new char[strlen(d_result_ril) + 1]) != NULL) { - strcpy(*ril, d_result_ril); - } - } - if (d_result_rol == NULL) - *rol = NULL; - else { - if ((*rol = new char[strlen(d_result_rol) + 1]) != NULL) { - strcpy(*rol, d_result_rol); - } - } - - // do not Delete and NULL the local storage pointers. - // someone may request the filenames later. - } - d_new_log_result = false; - d_sem.v(); - return ret; - } - - void set_logfile_result(const char *lil, const char *lol, const char *ril, - const char *rol) - { - d_sem.p(); - - if (d_result_lil) delete[] d_result_lil; - d_result_lil = NULL; - if (d_result_lol) delete[] d_result_lol; - d_result_lol = NULL; - if (d_result_ril) delete[] d_result_ril; - d_result_ril = NULL; - if (d_result_rol) delete[] d_result_rol; - d_result_rol = NULL; - - // Allocate space for each string and then copy into it. - if (lil != NULL) { - if ((d_result_lil = new char[strlen(lil) + 1]) != NULL) { - strcpy(d_result_lil, lil); - } - } - if (lol != NULL) { - if ((d_result_lol = new char[strlen(lol) + 1]) != NULL) { - strcpy(d_result_lol, lol); - } - } - if (ril != NULL) { - if ((d_result_ril = new char[strlen(ril) + 1]) != NULL) { - strcpy(d_result_ril, ril); - } - } - if (rol != NULL) { - if ((d_result_rol = new char[strlen(rol) + 1]) != NULL) { - strcpy(d_result_rol, rol); - } - } - - d_new_log_result = true; - d_sem.v(); - } - - // fills in the arguments with the logfile names currently in use - // for a particular log, the value will be NULL if that log is not being - // collected. - // NOTE: this function allocates memory for each string returned. IT IS - // THE - // RESPONSIBILITY OF THE CALLING FUNCTION TO FREE THIS MEMORY. - void get_logfile_names(char **local_in, char **local_out, char **remote_in, - char **remote_out) - { - d_sem.p(); - if (d_result_lil == NULL) - *local_in = NULL; - else { - *local_in = new char[strlen(d_result_lil) + 1]; - strcpy(*local_in, d_result_lil); - } - if (d_result_lol == NULL) - *local_out = NULL; - else { - *local_out = new char[strlen(d_result_lol) + 1]; - strcpy(*local_out, d_result_lol); - } - if (d_result_ril == NULL) - *remote_in = NULL; - else { - *remote_in = new char[strlen(d_result_ril) + 1]; - strcpy(*remote_in, d_result_ril); - } - if (d_result_rol == NULL) - *remote_out = NULL; - else { - *remote_out = new char[strlen(d_result_rol) + 1]; - strcpy(*remote_out, d_result_rol); - } - d_sem.v(); - } - - // Accessors for the initial thread to pass new throttle values down to the - // logging thread, which will cause it to throttle as needed. - bool get_throttle_request(vrpn_int32 *throttle_count) - { - d_sem.p(); - bool ret = d_new_throttle_request; - if (d_new_throttle_request) { - *throttle_count = d_throttle_count; - } - d_new_throttle_request = false; - d_sem.v(); - return ret; - } - void set_throttle_request(vrpn_int32 throttle_count) - { - d_sem.p(); - d_throttle_count = throttle_count; - d_new_throttle_request = true; - d_sem.v(); - } - - // Accessors for the logging thread to increment and read the number of - // frames in the queue and for the initial thread to decrement them. The - // increment/decrement is done when a begin_frame message is found. The - // increment/decrement routines return the new value. - vrpn_int32 get_frames_in_queue(void) - { - d_sem.p(); - vrpn_int32 ret = d_frames_in_queue; - d_sem.v(); - return ret; - } - vrpn_int32 increment_frames_in_queue(void) - { - d_sem.p(); - d_frames_in_queue++; - vrpn_int32 ret = d_frames_in_queue; - d_sem.v(); - return ret; - } - vrpn_int32 decrement_frames_in_queue(void) - { - d_sem.p(); - d_frames_in_queue--; - vrpn_int32 ret = d_frames_in_queue; - d_sem.v(); - return ret; - } - - // Accessors for the logging thread to add messages to the queue - // and for the initial thread to retrieve and count them. - vrpn_int32 get_logger_to_client_queue_size(void) - { - d_sem.p(); - vrpn_int32 ret = d_logger_to_client_messages.size(); - d_sem.v(); - return ret; - } - bool insert_logger_to_client_message(const vrpn_HANDLERPARAM &p) - { - d_sem.p(); - bool ret = d_logger_to_client_messages.insert_back(p); - d_sem.v(); - return ret; - } - bool retrieve_logger_to_client_message(vrpn_HANDLERPARAM *p) - { - d_sem.p(); - bool ret = d_logger_to_client_messages.retrieve_front(p); - d_sem.v(); - return ret; - } - -protected: - vrpn_Semaphore d_sem; // Semaphore to control access to data items. - - // Is it time for the logging thread to exit? - bool d_time_to_exit; - - // Stored copies of the value in the vrpn_Imager_Remote and a flag telling - // whether they have changed since last read. - bool d_description_updated; // Do we have a new description from imager - // server? - vrpn_int32 d_nRows; - vrpn_int32 d_nCols; - vrpn_int32 d_nDepth; - vrpn_int32 d_nChannels; - const char *d_channel_buffer; //< Allocated by sender, freed by receiver - - // Names of the log files passed from the initial thread to the logging - // thread and a flag telling whether they have been changed since last - // read. - bool d_new_log_request; - char *d_request_lil; - char *d_request_lol; - char *d_request_ril; - char *d_request_rol; - - // Names of the log files passed from the logging thread to the initial - // thread and a flag telling whether they have been changed since last - // read. NOTE: we maintain a copy of the log file names here, instead - // of using the accessor of vrpn_Connection to query the names. Only - // the logging thread is supposed to have access to the logging connection, - // but the logging thread is banned from calling methods on the client - // connection. - bool d_new_log_result; - char *d_result_lil; - char *d_result_lol; - char *d_result_ril; - char *d_result_rol; - - // New throttle request passed on by the client-handling thread - bool d_new_throttle_request; - vrpn_int32 d_throttle_count; - - // Records the number of frames in the queue. This is incremented - // by the non-blocking thread and decremented by the initial thread - // as the begin_frame() messages are queued and dequeued. - vrpn_int32 d_frames_in_queue; - - // List of messages passing from the logging thread to the initial - // thread. - vrpn_Message_List d_logger_to_client_messages; -}; - -//------------------------------------------------------------------- -// This class is a vrpn_Imager_Server; it has one or two instances of -// vrpn_Imager_Clients to talk to the server it is forwarding packets -// to. It does not use their callback parsers, but rather hooks its own -// callbacks directly to the connection object for the server it is -// buffering. - -class VRPN_API vrpn_Imager_Stream_Buffer : public vrpn_Auxiliary_Logger_Server, - public vrpn_Imager_Server { -public: - // Name of this object (the server side of the vrpn_Imager that is - // buffered and the vrpn_Auxiliary_Logger that the client will connect to). - // (Optional, can be NULL) pointer to the server connection on which to - // communicate. - // Name of the vrpn_Imager_Server to connect to (packets from this server - // will - // be forwarded to the main connection, and logging will occur on the - // connection - // to this imager_server). This server may be local or remote; if local, - // include "@localhost" in the name because new connections will be made to - // it. - vrpn_Imager_Stream_Buffer(const char *name, const char *imager_server_name, - vrpn_Connection *c); - - // Get rid of any logging thread and then clean up. - virtual ~vrpn_Imager_Stream_Buffer(); - - // Required for servers. - virtual void mainloop(void); - -protected: - // Handle a logging-request message. The request contains four file - // names, two for local (to the Auxiliary server itself) and two for - // remote (the far side of its connection to the server). It must - // also respond to the client with a message saying what logging has - // been set up (using the send_logging_response function). Logging is - // turned off on a particular file by sending an empty-string name (""). - // The in/out local/remote are with respect to the connection that the - // logging is to occur on, which is to the imager server whose name is - // passed in to the constructor, not the connection that the client has - // sent the request on. - // Make sure to send a response saying what you did. - virtual void handle_request_logging(const char *local_in_logfile_name, - const char *local_out_logfile_name, - const char *remote_in_logfile_name, - const char *remote_out_logfile_name); - - // Static portion of handling (unpacking) the request_logging message. It - // then calls the non-static virtual method above. - static int VRPN_CALLBACK - static_handle_request_logging(void *userdata, vrpn_HANDLERPARAM p); - - virtual void handle_request_logging_status(); - - // Handle dropped last connection on our primary connection by shutting down - // the - // connection to the imager server. The static method in the base class - // looks up this - // pointer and calls the virtual method. - virtual void handle_dropped_last_connection(void); - - // Handles a throttle request by passing it on down to the non-blocking - // thread to deal with. - static int VRPN_CALLBACK - static_handle_throttle_message(void *userdata, vrpn_HANDLERPARAM p); - - // Handle got first connection request by (having the second thread) create - // a connection to the server and waiting until we get a description message - // from the imager server we're listening to. Timeout after a while if the - // connection cannot be made or the server does not respond. - virtual void handle_got_first_connection(void); - vrpn_int32 got_first_connection_m_id; // ID of message that we got the first - // connection - static int VRPN_CALLBACK - static_handle_got_first_connection(void *userdata, vrpn_HANDLERPARAM p); - - // State shared between the initial thread and the logging thread. - vrpn_Imager_Stream_Shared_State d_shared_state; - - //---------------------------------------------------------------------- - // The section below includes methods and member variables that should - // only be used by the logging thread. They are not protected by - // semaphores and so should not be accessed except within the - // logging_thread_func(). - - // This class spawns a new thread to handle uninterrupted communication - // and logging with the vrpn_Imager_Server that we are forwarding messages - // for. This is created in the constructor and shut down (hopefully gently) - // in the destructor. There are a number of semaphores that are used by - // the initial thread and the logging thread to communicate. - vrpn_Thread *d_logging_thread; - - // The function that is called to become the logging thread. It is passed - // a pointer to "this" so that it can acces the object that created it. - // Note that it must use semaphores to get at the data that will be shared - // between the main thread and itself. The static function basically just - // pulls the "this" pointer out and then calls the non-static function. - static void static_logging_thread_func(vrpn_ThreadData &threadData); - void logging_thread_func(void); - - // Stop the logging thread function, cleanly if possible. Returns true if - // the function stopped cleanly, false if it had to be killed. - bool stop_logging_thread(void); - - // Name of the vrpn_Imager_Server object we are to connect to and - // log/pass messages from. - char *d_imager_server_name; - - // Are we ready to drop the old connection (new one has received its - // descriptor message)? - bool d_ready_to_drop_old_connection; - - // The connection that is used to talk to the client. - vrpn_Connection *d_log_connection; - vrpn_Connection * - open_new_log_connection(const char *local_in_logfile_name, - const char *local_out_logfile_name, - const char *remote_in_logfile_name, - const char *remote_out_logfile_name); - - // These will create/destroy the d_imager_remote and other callback handlers - // needed to provide the handling of messages from the logging connection - // passed in; they are used by the initial-connection code and by the - // code that handles handing off from an old connection to a new connection - // when a new logging message is received. - bool setup_handlers_for_logging_connection(vrpn_Connection *c); - bool teardown_handlers_for_logging_connection(vrpn_Connection *c); - - // This is yet another "create me some logs" function; it handles the - // hand-off from one log file to another within the logging thread. - // It is called by the main logging thread function when a request comes in - // from the initial thread to perform logging. - bool make_new_logging_connection(const char *local_in_logfile_name, - const char *local_out_logfile_name, - const char *remote_in_logfile_name, - const char *remote_out_logfile_name); - - // The imager remote to listen to the vrpn_Imager_Server, along - // with the callback functions that support its operation. The - // generic VRPN callback handler that receives all messages from - // the imager server and either queues them or handles them, there - // is a static version that just gets a this pointer and calls the - // non-static function. - vrpn_Imager_Remote *d_imager_remote; - static void VRPN_CALLBACK - handle_image_description(void *pvISB, const struct timeval msg_time); - static int VRPN_CALLBACK - static_handle_server_messages(void *pvISB, vrpn_HANDLERPARAM p); - int handle_server_messages(const vrpn_HANDLERPARAM &p); - - // Types of messages we expect to be coming from the server. - vrpn_int32 d_server_description_m_id; //< ID of the message type describing - // the range and channels - vrpn_int32 d_server_begin_frame_m_id; //< ID of the message type describing - // the start of a region - vrpn_int32 d_server_end_frame_m_id; //< ID of the message type describing - // the start of a region - vrpn_int32 d_server_discarded_frames_m_id; //< ID of the message type - // describing the discarding of - // one or more regions - vrpn_int32 d_server_regionu8_m_id; //< ID of the message type describing a - // region with 8-bit unsigned entries - vrpn_int32 d_server_regionu12in16_m_id; //< ID of the message type - // describing a region with 12-bit - // unsigned entries packed in 16 bits - vrpn_int32 d_server_regionu16_m_id; //< ID of the message type describing a - // region with 16-bit unsigned entries - vrpn_int32 d_server_regionf32_m_id; //< ID of the message type describing a - // region with 32-bit float entries - vrpn_int32 d_server_text_m_id; //< ID of the system text message - vrpn_int32 d_server_ping_m_id; //< ID of the system ping message - vrpn_int32 d_server_pong_m_id; //< ID of the system pong message - - // Transcode the sender and type fields from the logging server connection - // to - // the initial client connection and pack the resulting message into the - // queue - // from the logging thread to the initial thread. The data buffer is - // copied; - // this space is allocated by the logging thread and must be freed by the - // initial thread. - // Returns true on success and false on failure. The sender is set to the - // d_sender_id of our server object. - bool transcode_and_send(const vrpn_HANDLERPARAM &p); - - // Transcode the type from the logging thread's connection type to - // the initial thread's connection type. Return -1 if we don't - // recognize the type. - vrpn_int32 transcode_type(vrpn_int32 type); - - // Handling throttling on the non-blocking thread. This is a shadow - // copy of the structures in the vrpn_Image_Server base class; we cannot - // use those directly because they will be adjusted by their own callbacks - // in the initial thread. - vrpn_uint16 d_server_dropped_due_to_throttle; - vrpn_int32 d_server_frames_to_send; -}; - -//----------------------------------------------------------- -// Client code should connect to the server twice, once as -// a vrpn_Imager_Server and once as a vrpn_Auxiliary_Logger_Server. -// There is not a special remote class for this. - -#endif diff --git a/src/vrpn/vrpn_ImmersionBox.C b/src/vrpn/vrpn_ImmersionBox.C deleted file mode 100644 index fc31f6a15d59c314c8259493218cdb0737c21b14..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_ImmersionBox.C +++ /dev/null @@ -1,524 +0,0 @@ -// vrpn_ImmersionBox.C -// This is a driver for an Immersion Corporation Immersion Box controller. -// This box is a serial-line device that allows the user to connect -// analog inputs, digital inputs, digital outputs, and digital -// encoders and read from them over RS-232. -// -// This code is based on the ImmersionBox code previously written as part -// of the vrpn library - -#include <math.h> // for floor -#include <stdio.h> // for fprintf, stderr, printf -#include <string.h> // for NULL, strcpy - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR -#include "vrpn_ImmersionBox.h" -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday - -#undef VERBOSE - -// low-level stuff -static const unsigned char CMD_BASIC = static_cast<unsigned char>(0xC0); // mask for command -static const unsigned char CMD_HOMEREF = static_cast<unsigned char>(0xC1); -static const unsigned char CMD_HOMEPOS = static_cast<unsigned char>(0xC2); -static const unsigned char CMD_SETHOME = static_cast<unsigned char>(0xC3); -static const unsigned char CMD_BAUDSET = static_cast<unsigned char>(0xC4); -static const unsigned char CMD_ENDSESS = static_cast<unsigned char>(0xC5); -static const unsigned char CMD_GETMAXS = static_cast<unsigned char>(0xC6); -static const unsigned char CMD_SETPARM = static_cast<unsigned char>(0xC7); -static const unsigned char CMD_GETNAME = static_cast<unsigned char>(0xC8); -static const unsigned char CMD_GETPRID = static_cast<unsigned char>(0xC9); -static const unsigned char CMD_GETMODL = static_cast<unsigned char>(0xCA); -static const unsigned char CMD_GETSERN = static_cast<unsigned char>(0xCB); -static const unsigned char CMD_GETCOMM = static_cast<unsigned char>(0xCC); -static const unsigned char CMD_GETPERF = static_cast<unsigned char>(0xCD); -static const unsigned char CMD_GETVERS = static_cast<unsigned char>(0xCE); -static const unsigned char CMD_GETMOTN = static_cast<unsigned char>(0xCF); -static const unsigned char CMD_SETHREF = static_cast<unsigned char>(0xD0); -static const unsigned char CMD_FACREST = static_cast<unsigned char>(0xD1); -static const unsigned char CMD_INSMARK = static_cast<unsigned char>(0xD2); - -static const double PAUSE_RESET = .015; -static const double PAUSE_END = .015; -static const double PAUSE_RESTORE = 2.0; -static const double PAUSE_BYTE = .015; - -// Defines the modes in which the box can find itself. -#define STATUS_RESETTING (-1) // Resetting the box -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report - -/* Strings for establishing connection */ -char S_INITIALIZE[5] = "IMMC"; -char S_START[6] = "BEGIN"; -char S_END[4] = "END"; - -#define MAX_TIME_INTERVAL (2000000) // max time between reports (usec) - -static void pause (double delay) { - if (delay < 0) - delay = 0; - unsigned long interval = (long) floor(1000000.0 * delay); - - struct timeval start, now; - vrpn_gettimeofday (&start, NULL); - - do { - vrpn_gettimeofday (&now, NULL); - } while (vrpn_TimevalDuration(now, start) < interval); - -} - -// This creates a vrpn_ImmersionBox and sets it to reset mode. It opens -// the serial device using the code in the vrpn_Serial_Analog constructor. -// The box will autodetect the baud rate when the "IMMC" command is sent -// to it. - -vrpn_ImmersionBox::vrpn_ImmersionBox (const char * name, - vrpn_Connection * c, - const char * port, - int baud, - const int numbuttons, - const int numchannels, - const int numencoders): - vrpn_Serial_Analog(name, c, port, baud), - vrpn_Button_Filter(name, c), - vrpn_Dial(name, c), - _numbuttons(numbuttons), - _numchannels(numchannels), - _numencoders(numencoders) -{ - - - // Verify the validity of the parameters - if (_numbuttons > MAX_IBUTTONS) { - fprintf(stderr,"vrpn_ImmersionBox: Can only support %d buttons, not %d\n", MAX_IBUTTONS, _numbuttons); - _numbuttons = MAX_IBUTTONS; - } - if (_numchannels > MAX_ICHANNELS) { - fprintf(stderr,"vrpn_ImmersionBox: Can only support %d analog channels, not %d\n", MAX_ICHANNELS, _numchannels); - _numchannels = MAX_ICHANNELS; - } - if (_numencoders > MAX_IENCODERS) { - fprintf(stderr,"vrpn_ImmersionBox: Can only support %d encoders, not %d\n", MAX_IENCODERS, _numencoders); - _numencoders = MAX_IENCODERS; - } - - // explicitly clear the identification variables - iname[0] = 0; - comment[0] = 0; - serial[0] = 0; - id[0] = 0; - model[0] = 0; - vers[0] = 0; - parmf[0] = 0; - - // Set the parameters in the parent classes - vrpn_Button::num_buttons = _numbuttons; - vrpn_Analog::num_channel = _numchannels; - vrpn_Dial::num_dials = _numencoders; - - // Set the status of the buttons, analogs and encoders to 0 to start - clear_values(); - - // Set the mode to reset - _status = STATUS_RESETTING; -} - -void vrpn_ImmersionBox::clear_values(void) -{ - int i; - - for (i = 0; i < _numbuttons; i++) { - vrpn_Button::buttons[i] = vrpn_Button::lastbuttons[i] = 0; - } - for (i = 0; i < _numchannels; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } - for (i = 0; i < _numencoders; i++) { - vrpn_Dial::dials[i] = 0.0; - } -} - -// This routine will reset the ImmersionBox, asking it to send the requested number -// of analogs, buttons and encoders. -// It verifies that it can communicate with the device and checks the version of -// the device. - -int vrpn_ImmersionBox::reset(void) -{ - - //----------------------------------------------------------------------- - // Set the values back to zero for all buttons, analogs and encoders - clear_values(); - - //----------------------------------------------------------------------- - // sending an end at this time will force the ibox into the reset mode, if it - // was not already. if the ibox is in the power up mode, nothing will happen because - // it 'should' be waiting to sync up the baudrate - - // try to synchronize for 2 seconds - - if (syncBaudrate (10.0)) { - printf("vrpn_ImmersionBox found\n"); - } else { - return -1; - } - - if (0 == sendIboxCommand((char) CMD_GETNAME, (char *) &iname, .1)) { - fprintf(stderr,"problems with ibox command CMD_GETNAME\n"); - return -1; - } - if (0 == sendIboxCommand((char) CMD_GETPRID, (char *) &id, .1)) { - fprintf(stderr,"problems with ibox command CMD_GETPRID\n"); - return -1; - } - if (0 == sendIboxCommand((char) CMD_GETMODL, (char *) &model, .1)){ - fprintf(stderr,"problems with ibox command CMD_GETMODL\n"); - return -1; - } - if (0 == sendIboxCommand((char) CMD_GETSERN, (char *) &serial, .1)){ - fprintf(stderr,"problems with ibox command CMD_GETSERN\n"); - return -1; - } - if (0 == sendIboxCommand((char) CMD_GETCOMM, (char *) &comment, .1)){ - fprintf(stderr,"problems with ibox command CMD_GETCOMM\n"); - return -1; - } - if (0 == sendIboxCommand((char) CMD_GETPERF, (char *) &parmf, .1)){ - fprintf(stderr,"problems with ibox command CMD_GETPERF\n"); - return -1; - } - if (0 == sendIboxCommand((char) CMD_GETVERS, (char *) &vers, .1)){ - fprintf(stderr,"problems with ibox command CMD_GETVERS\n"); - return -1; - } - -#ifdef VERBOSE - printf("%s\n%s\n%s\n%s\n%s\n%s\n", iname, id, serial, comment, parmf, vers); -#endif - - //----------------------------------------------------------------------- - // Compute the proper string to initialize the device based on how many - // of each type of input/output that is selected. - - setupCommand (0, _numchannels, _numencoders); - - unsigned char command[26] = ""; - command[0] = 0xcf; - command[1] = 0x0; - command[2] = (unsigned char) 10; // milliseconds between reports - command[3] = commandByte; - - for (int i = 4; i < 25;i++) - command[i] = 0x0; - - //----------------------------------------------------------------------- - - int result = vrpn_write_characters(serial_fd, (const unsigned char *) command, 25); - - // Ask the box to send a report, ensure echo received - if (result < 25) { - fprintf(stderr,"vrpnImmersionBox::reset: could not write command\n"); - return -1; - } - - pause (.1); - - // look for command echo - result = vrpn_read_available_characters(serial_fd, (unsigned char *) command, 1); - - if (result <= 0 || command[0] != 0xcf) { - fprintf(stderr,"vrpnImmersionBox::reset: no command echo\n"); - return -1; - } - - // flush the input buffer - vrpn_flush_input_buffer(serial_fd); - - printf("ImmersionBox reset complete.\n"); - - status = STATUS_SYNCING; - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - return 0; -} - -// This function will read characters until it has a full report, then -// put that report into the time, analog, button and encoder fields and call -// the report methods on these. The time stored is that of -// the first character received as part of the report. -// -// Reports start with the header packetHeader followed by dataRecordLength bytes -// -// If we get a report that is not valid, we assume that we have lost a -// character or something and re-synchronize by flushing the buffer -// -// The routine that calls this one -// makes sure we get a full reading often enough (ie, it is responsible -// for doing the watchdog timing to make sure the box hasn't simply -// stopped sending characters). -// Returns 1 if got a full report, 0 otherwise. - -int vrpn_ImmersionBox::get_report(void) -{ - unsigned char responseString[MAX_IBOX_STRING]; - int i; - unsigned int buttonBits = 0; - - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 100000; - - status = STATUS_SYNCING; - - // process as long as we can get characters - while (1 == vrpn_read_available_characters(serial_fd, buffer, 1)) { - // if not a record start, skip it - if (buffer[0] != dataPacketHeader) { - continue; - } - // we got a good one... we're reading now - status = STATUS_READING; - break; - } - - // we broke out.. if we're not reading, then we have nothing to do - if (STATUS_READING != status) { - return 0; - } - - - // we're reading now, get the report - - // get the expected number of data record bytes - int result = vrpn_read_available_characters(serial_fd, - (unsigned char *) responseString, - dataRecordLength, - &timeout ); - - if (result < dataRecordLength) { - status = STATUS_SYNCING; - return 0; - } - - // parse the report here - buttonBits = responseString[0]; - - for (i = 0; i < _numbuttons; i++) { - vrpn_Button::lastbuttons[i] = vrpn_Button::buttons[i]; - vrpn_Button::buttons[i] = static_cast<unsigned char>(buttonBits & (1 << i)); - } - -#if VERBOSE - if (vrpn_Button::buttons[3]) - cerr << "left button pressed " << endl; -#endif - - // if we processed timer bits we would do so here - - // here is where we decode the analog stuff - for (i = 0; i < _numchannels; i++) { - vrpn_Analog::last[i] = vrpn_Analog::channel[i]; - } - - // here is where we convert the angle encoders - for (i = 0; i < _numencoders; i++) { - vrpn_Dial::dials[i] = 0.0; - } - - report_changes(); - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - - return 1; -} - -void vrpn_ImmersionBox::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; - vrpn_Dial::timestamp = timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); - vrpn_Dial::report_changes(); -} - -void vrpn_ImmersionBox::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; - vrpn_Dial::timestamp = timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); - vrpn_Dial::report(); -} - -// This routine is called each time through the server's main loop. It will -// take a course of action depending on the current status of the cerealbox, -// either trying to reset it or trying to get a reading from it. -void vrpn_ImmersionBox::mainloop(void) -{ - server_mainloop(); - - switch(status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - while (get_report()) {}; // Get multiple reports if available - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) > MAX_TIME_INTERVAL) { - fprintf(stderr,"Tracker failed to read... current_time=%ld:%ld, timestamp=%ld:%ld\n", - current_time.tv_sec, static_cast<long>(current_time.tv_usec), - timestamp.tv_sec, static_cast<long>(timestamp.tv_usec)); - send_text_message("Too long since last report, resetting", current_time, vrpn_TEXT_ERROR); - status = STATUS_RESETTING; - } - } - break; - - default: - fprintf(stderr,"vrpn_ImmersionBox: Unknown mode (internal error)\n"); - break; - } -} - -// utility routine (optionally) to send commands to the ibox, -// (optionally) to return results, -// (optionally) delaying between sending the command and receiving the results - -int vrpn_ImmersionBox::sendIboxCommand (char cmd, char * returnString, double delay) -{ - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 15000; - char command[2]; - char responseString [MAX_IBOX_STRING+1]; - int result; - - if (cmd) { - command[0] = cmd; - result = vrpn_write_characters(serial_fd, (const unsigned char *) command, 1); - if (delay > 0) - pause (delay); - - if (NULL == returnString) - // if we are not anticipating a return, go back now - return result; - } - - // read the response to the command - result = vrpn_read_available_characters(serial_fd, (unsigned char *) responseString, MAX_IBOX_STRING, &timeout ); - - if (result <= 0) - return 0; - - // since we're looking for a response, we need to ensure the command was properly - // echoed back... To begin with, bit 7 must be set - if (!(responseString[0] & 0x80)) - return 0; - - // the bits, excepting bit 7 must match - if ((responseString[0] & 0x7f) != (cmd & 0x7f)) - return 0; - - // copy the remainder of the response into the response - strcpy (returnString, &responseString[1]); - - return 1; -} - - -// sync the baud rate on the ibox. -// seconds determines how long the process is permitted to continue -int vrpn_ImmersionBox::syncBaudrate (double seconds) { - - struct timeval miniDelay; - miniDelay.tv_sec = 0; - miniDelay.tv_usec = 50000; - - unsigned long maxDelay = 1000000L * (long) seconds; - struct timeval start_time; - vrpn_gettimeofday(&start_time, NULL); - - int loggedOn = 0; - unsigned char responseString[8]; - unsigned char * matchString = (unsigned char *) S_INITIALIZE ; // IMMC - int index, numRead; - - if (serial_fd < 0) - return 0; - vrpn_flush_input_buffer(serial_fd); - vrpn_write_characters(serial_fd, (const unsigned char *)"E", 1); - pause (0.01); - - while (!loggedOn) { - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, start_time) > maxDelay ) { - // if we've timed out, go back unhappy - fprintf(stderr,"vrpn_ImmersionBox::syncBaudrate timeout expired: %lf secs \n", seconds); - break; // out of while loop - } - - // send "IMMC" - if (4 != vrpn_write_characters(serial_fd, matchString, 4)) { - fprintf(stderr,"vrpn_ImmersionBox::syncBaudrate could not write to serial port\n"); - break; // out of while loop - } - - pause (0.015); - - // wait for 4 characters - numRead = vrpn_read_available_characters(serial_fd, responseString, 4, &miniDelay); - - if (numRead <= 0) - continue; - - // get 4 characters, hopefully "IMMC" - for (index = 0; index < 4; index++) { - // get a character, check for failure - if (responseString[index] != matchString[index]) - break; - } - - // if we got all four, we're done - if (4 == index) - loggedOn = 1; - } - - if (!loggedOn) - return 0; - - // now begin the session && ensure that its an ibox we're talking to - matchString = (unsigned char *) "IBOX"; - vrpn_write_characters(serial_fd, (const unsigned char *)"BEGIN", 5); - numRead = vrpn_read_available_characters(serial_fd, responseString, 4, &miniDelay); - - if (numRead <= 0) - return 0; - - // check 4 characters, hopefully "IBOX" - for (index = 0; index < 4; index++) { - // get a character, check for failure - if (responseString[index] != matchString[index]) - return 0; - } - vrpn_flush_input_buffer(serial_fd); - return 1; -} diff --git a/src/vrpn/vrpn_ImmersionBox.h b/src/vrpn/vrpn_ImmersionBox.h deleted file mode 100644 index 0b1e80560dd65af4ca3bb08e368210c5a369e4d0..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_ImmersionBox.h +++ /dev/null @@ -1,110 +0,0 @@ -#ifndef VRPN_IMMERSIONBOX_H -#define VRPN_IMMERSIONBOX_H -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Dial.h" // for vrpn_Dial -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32 - -// Written by Rob King at Navy Research Labs. The button code works; -// the others are not fully implemented. - -class VRPN_API vrpn_ImmersionBox: public vrpn_Serial_Analog, - public vrpn_Button_Filter, - public vrpn_Dial -{ - public: - vrpn_ImmersionBox (const char * name, - vrpn_Connection * c, - const char * port, - int baud, - const int numbuttons, - const int numchannels, - const int numencoders); - - ~vrpn_ImmersionBox () {}; - - // Called once through each main loop iteration to handle - // updates. - virtual void mainloop (void); - - protected: - int _status; - int _numbuttons; // How many buttons to open - int _numchannels; // How many analog channels to open - int _numencoders; // How many encoders to open - - unsigned _expected_chars; // How many characters to expect in the report - unsigned char _buffer[512]; // Buffer of characters in report - unsigned _bufcount; // How many characters we have so far - - struct timeval timestamp; // Time of the last report from the device - - virtual void clear_values(void); // Set all buttons, analogs and encoders back to 0 - virtual int reset(void); // Set device back to starting config - virtual int get_report(void); // Try to read a report from the device - - // send report iff changed - virtual void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // send report whether or not changed - virtual void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button or vrpn_Dial - - private: - -#define MAX_IENCODERS 6 -#define MAX_ICHANNELS 8 -#define MAX_IBUTTONS 7 -#define MAX_IBOX_STRING 32 - -// utility routine to sync up the baudrate - int syncBaudrate (double seconds); - -// utility to read a string from the ibox - int sendIboxCommand (char cmd, char * returnString, double delay); - -// identification strings obtained from the ibox - char iname [MAX_IBOX_STRING]; - char comment[MAX_IBOX_STRING]; - char serial [MAX_IBOX_STRING]; - char id [MAX_IBOX_STRING]; - char model [MAX_IBOX_STRING]; - char vers [MAX_IBOX_STRING]; - char parmf [MAX_IBOX_STRING]; - - -// stores the byte sent to the ibox - unsigned char commandByte; - unsigned char dataPacketHeader; - int dataRecordLength; - -// makes a command byte, given the user's choice of time stamping and the number of -// reports desired from each type of sensor -// also calculates the expected number of bytes in each report that follow the packet header - inline void setupCommand (int useTimeStamp, - unsigned int numAnalog, - unsigned int numEncoder) { - commandByte = (unsigned char) ( - (useTimeStamp ? 0x20 : 0) | - (numAnalog > 4 ? 0x0C : (numAnalog > 2 ? 0x08 : (numAnalog ? 0x04 : 0 ) ) ) | - (numEncoder > 3 ? 0x03 : (numEncoder > 2 ? 0x02 : (numEncoder ? 0x01 : 0 ) ) ) ); - - dataPacketHeader = (unsigned char)(commandByte | 0x80); - - // packet header - // button status - // (optionally) 2 bytes of timer data - // 8,4,2,or 0 analog @1 byte each + byte to hold extra controller bits - // 6,4,2,or 0 encoders @2 bytes each - dataRecordLength = 1 + (useTimeStamp ? 2 : 0) + - (numAnalog > 4 ? 9 :(numAnalog > 2 ? 5: (numAnalog ? 3 : 0 ) ) ) + - (numEncoder > 4 ? 12 :(numEncoder > 2 ? 8: (numEncoder ? 4: 0 ) ) ); - }; - -}; - -#endif diff --git a/src/vrpn/vrpn_JoyFly.C b/src/vrpn/vrpn_JoyFly.C deleted file mode 100644 index 16177f259972453e169c13d9e50b69121c276a84..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_JoyFly.C +++ /dev/null @@ -1,191 +0,0 @@ -/// This object has been superceded by the vrpn_Tracker_AnalogFly object. - -#include <math.h> // for fabs -#include <string.h> // for memcpy - -#include "quat.h" // for q_matrix_copy, etc -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_JoyFly.h" -#include "vrpn_Types.h" // for vrpn_float64, vrpn_int32 - -vrpn_Tracker_JoyFly::vrpn_Tracker_JoyFly - (const char * name, vrpn_Connection * c, - const char * source, const char * set_config, - vrpn_Connection * sourceConnection) : - vrpn_Tracker (name, c) { - int i; - - - joy_remote = new vrpn_Analog_Remote (source, sourceConnection); - joy_remote->register_change_handler(this, handle_joystick); - c->register_handler(c->register_message_type(vrpn_got_connection), - handle_newConnection, this); - - FILE * fp = fopen(set_config, "r"); - if (fp == NULL) { - fprintf(stderr, "Can't open joy config file, using default..\n"); - fprintf(stderr, "Channel Accel 1.0, Power 1, Init Identity Matrix. \n"); - for (i=0; i< 7; i++) { - chanAccel[i] = 1.0; - chanPower[i] = 1; - } - for ( i =0; i< 4; i++) - for (int j=0; j< 4; j++) - initMatrix[i][j] = 0; - initMatrix[0][0] = initMatrix[2][2] = - initMatrix[1][1] = initMatrix[3][3] = 1.0; - } else { - for (i=0; i< 7; i++) { - if (fscanf(fp, "%lf %d", &chanAccel[i], &chanPower[i]) != 2) { - fprintf(stderr,"Cannot read acceleration and power from file\n"); - return; - } - fprintf(stderr, "Chan[%d] = (%lf %d)\n", i, chanAccel[i], chanPower[i]); - } - for (i =0; i< 4; i++) - for (int j=0; j< 4; j++) { - if (fscanf(fp, "%lf", &initMatrix[i][j]) < 0) { - perror("vrpn_Tracker_JoyFly::vrpn_Tracker_JoyFly(): Could not read matrix value"); - return; - } - } - fclose(fp); - } - - q_matrix_copy(currentMatrix, initMatrix); - -} - -vrpn_Tracker_JoyFly::~vrpn_Tracker_JoyFly() -{ - delete joy_remote; -} - -void vrpn_Tracker_JoyFly::mainloop(void) -{ - server_mainloop(); - - if (joy_remote != NULL) - joy_remote->mainloop(); - if (status == vrpn_TRACKER_REPORT_READY) { - // pack and deliver tracker report; - fprintf(stderr, "Sending a report\n"); - - char msgbuf[1000]; - vrpn_int32 len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, - position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, - "\nvrpn_Tracker_Flock: cannot write message ... tossing"); - } else { - fprintf(stderr,"\nvrpn_Tracker_Flock: No valid connection"); - } - status = vrpn_TRACKER_SYNCING; - } -} - - -#define ONE_SEC (1000000l) -// static -void vrpn_Tracker_JoyFly::handle_joystick - (void * userdata, const vrpn_ANALOGCB b) -{ - double tx, ty, tz, rx, ry, rz; - double temp[7]; - int i,j; - q_matrix_type newM; - double deltaT; - - vrpn_Tracker_JoyFly * pts = (vrpn_Tracker_JoyFly *) userdata; - - printf("Joy total = %d,Chan[0] = %lf\n", - b.num_channel,b.channel[0]); - - if (pts->prevtime.tv_sec == -1) { - deltaT = 1.0 ; // one milisecond; - } else { - deltaT = (pts->prevtime.tv_sec* ONE_SEC + pts->prevtime.tv_usec) - - (b.msg_time.tv_sec *ONE_SEC + b.msg_time.tv_usec); - deltaT /= 1000.0 ; // convert to millsecond; - } - - memcpy(&(pts->prevtime), &b.msg_time, sizeof(struct timeval)); - - for (i=0; i< 7; i++) { - temp[i] = 1.0; - //printf("chan[%d] = %lf\n", i, b.channel[i]); - if (!(b.channel[i] >=-0.5 && b.channel[i] <= 0.5)) return; - for (j=0; j< pts->chanPower[i]; j++) - temp[i] *= b.channel[i]; - if (b.channel[i] > 0) { - temp[i] *= pts->chanAccel[i]; - } else { - temp[i] = -fabs(temp[i]) * pts->chanAccel[i]; - } - temp[i] *= deltaT; - } - - /* roll chan[3] */ - rz = temp[3]; - - /* pitch Chan[4]*/ - rx = temp[4]; - - /* yaw Chan[5]*/ - ry = temp[5]; - - - /* translation, x chan[0], y: chane[2], z: chan[1] */ - tx = -temp[0]; // tx is NEGTIVE of power !!! ; - ty = temp[2]; - tz = temp[1]; - - q_euler_to_col_matrix(newM, rz, ry, rx); - newM[3][0] = tx; newM[3][1] = ty; newM[3][2] = tz; - pts->update(newM); -} - -void vrpn_Tracker_JoyFly::update(q_matrix_type & newM) { - - q_matrix_type final; - q_xyz_quat_type xq; - int i; - - q_matrix_mult(final, newM, currentMatrix); - q_matrix_copy(currentMatrix, final); - q_row_matrix_to_xyz_quat( & xq, currentMatrix); - - - status = vrpn_TRACKER_REPORT_READY; - for (i=0; i< 3; i++) { - pos[i] = xq.xyz[i]; // position; - } - printf("(x, y, z)= %lf %lf %lf\n", pos[0],pos[1], pos[2]); - for (i=0; i< 4; i++) { - d_quat[i] = xq.quat[i]; // orientation. - } -} - - -// static -int vrpn_Tracker_JoyFly::handle_newConnection - (void * userdata, vrpn_HANDLERPARAM) { - - printf("Get a new connection, reset virtual_Tracker\n"); - ((vrpn_Tracker_JoyFly *) userdata)->reset(); - return 0; -} - -void vrpn_Tracker_JoyFly::reset() { - q_matrix_copy(currentMatrix, initMatrix); - prevtime.tv_sec = -1; - prevtime.tv_usec = -1; -} - - - - - - - diff --git a/src/vrpn/vrpn_JoyFly.h b/src/vrpn/vrpn_JoyFly.h deleted file mode 100644 index b816efade03aef53aee931d87c8b04ec7d2166cb..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_JoyFly.h +++ /dev/null @@ -1,57 +0,0 @@ -/// This object has been superceded by the vrpn_Tracker_AnalogFly object. - -#ifndef INCLUDED_JOYFLY -#define INCLUDED_JOYFLY - -#include <quat.h> // for q_matrix_type -#include <stdio.h> // for NULL - -#include "vrpn_Analog.h" // for vrpn_ANALOGCB, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker - -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -class VRPN_API vrpn_Tracker_JoyFly : public vrpn_Tracker { - - private: - double chanAccel [7]; - int chanPower [7]; - struct timeval prevtime; - - vrpn_Analog_Remote * joy_remote; - q_matrix_type initMatrix, currentMatrix; - - public: - vrpn_Tracker_JoyFly (const char * name, vrpn_Connection * c, - const char * source, const char * config_file_name, - vrpn_Connection * sourceConnection = NULL); - virtual ~vrpn_Tracker_JoyFly (void); - - virtual void mainloop (void); - virtual void reset (void); - - void update (q_matrix_type &); - - static void VRPN_CALLBACK handle_joystick (void *, const vrpn_ANALOGCB); - static int VRPN_CALLBACK handle_newConnection (void *, vrpn_HANDLERPARAM); -}; - -#endif - - - - - - - - - - - - - - - diff --git a/src/vrpn/vrpn_Joylin.C b/src/vrpn/vrpn_Joylin.C deleted file mode 100644 index a0f9a3ef9a1dba7c83aeac75e533e2bb0ebcf117..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Joylin.C +++ /dev/null @@ -1,173 +0,0 @@ -/* -# Linux Joystick. Interface to the Linux Joystick driver by Vojtech Pavlik -# included in several Linux distributions. The server code has been tested -# with Linux Joystick driver version 1.2.14. Yet, there is no way how to -# map a typical joystick's zillion buttons and axes on few buttons and axes -# really used. Unfortunately, even joysticks of the same kind can have -# different button mappings from one to another. Driver written by Harald -# Barth (haba@pdc.kth.se). -*/ - -#include "vrpn_Joylin.h" - -#ifdef VRPN_USE_JOYLIN - -#define NAME_LENGTH 128 - -#include <fcntl.h> // for open, O_RDONLY -#include <stdio.h> // for NULL, fprintf, perror, etc -#include <stdlib.h> // for exit -#include <sys/select.h> // for select, FD_ISSET, FD_SET, etc -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday -#include "vrpn_Types.h" // for vrpn_float64 - -#include <sys/ioctl.h> // for ioctl -#include <unistd.h> // for read -#include <string.h> // for strncpy - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR -#include "vrpn_Connection.h" // for vrpn_Connection -#include <linux/joystick.h> // for js_event, JSIOCGAXES, etc - -vrpn_Joylin::vrpn_Joylin(char * name, - vrpn_Connection * c, - char *portname): - vrpn_Analog(name, c), vrpn_Button_Filter(name, c) -{ - namelen = 128; - num_channel = 2; // inherited : default for generic me-know-nothing PC joystick - num_buttons = 2; // inherited : this value is corrected by the ioctl call below. - fd = -1; - version = 0x000800; - devname = (char *) calloc(namelen, sizeof(char)); - if (devname == NULL) { - fprintf(stderr,"vrpn_Joylin::vrpn_Joylin(): Out of memory\n"); - return; - } - - device = strdup(portname); - init(); -} - -vrpn_Joylin::~vrpn_Joylin() -{ - if (devname != NULL) { - delete [] devname; - devname = NULL; - } -} - -/****************************************************************************/ -/* Initialize the device -*/ -int vrpn_Joylin::init() -{ - if ((fd = open(device, O_RDONLY)) < 0) { /* FIX LATER */ - fprintf(stderr, "vrpn_Joylin constructor could not open %s", device); - perror(" joystick device"); - return -1; - } - - ioctl(fd, JSIOCGVERSION, &version); - ioctl(fd, JSIOCGAXES, &num_channel); - ioctl(fd, JSIOCGBUTTONS, &num_buttons); - ioctl(fd, JSIOCGNAME(namelen), devname); - -#ifdef DEBUG - printf("Joystick (%s) has %d axes and %d buttons. Driver version is %d.%d.%d.\n", - devname, num_channel, num_buttons, version >> 16, (version >> 8) & 0xff, version & 0xff); -#endif - - return 0; -} - -void vrpn_Joylin::mainloop(void) -{ - struct timeval zerotime; - fd_set fdset; - struct js_event js; - int i; - - zerotime.tv_sec = 0; - zerotime.tv_usec = 0; - - // Since we are a server, call the generic server mainloop() - server_mainloop(); - - if (fd < 0) { return; } - - bool got_response; - do { - got_response = false; - FD_ZERO(&fdset); /* clear fdset */ - FD_SET(fd, &fdset); /* include fd in fdset */ - select(fd+1, &fdset, NULL, NULL, &zerotime); - - if (FD_ISSET(fd, &fdset)){ - if (read(fd, &js, sizeof(struct js_event)) != sizeof(struct js_event)) { - send_text_message("Error reading from joystick", vrpn_Analog::timestamp, vrpn_TEXT_ERROR); - if (d_connection) { d_connection->send_pending_reports(); } - - /* try to reopen the device, e.g. wireless joysticks - * like to disconnect when not in use to save battery */ - close(fd); - vrpn_SleepMsecs(5000); - init(); - return; - } - got_response = true; - - switch(js.type & ~JS_EVENT_INIT) { - case JS_EVENT_BUTTON: - vrpn_gettimeofday((timeval *)&this->vrpn_Button::timestamp, NULL); - buttons[js.number] = js.value; - break; - case JS_EVENT_AXIS: - vrpn_gettimeofday((timeval *)&this->vrpn_Analog::timestamp, NULL); - channel[js.number] = js.value / 32767.0; /* FIX LATER */ - break; - } - -#ifdef DEBUG - if (num_channel) { - printf("Axes: "); - for (i = 0; i < num_channel; i++) { - printf("%2d:%.3f ", i, channel[i]); - } - } - if (num_buttons) { - printf("Buttons: "); - for (i = 0; i < num_buttons; i++) { - printf("%2d:%s ", i, buttons[i] ? "on " : "off"); - } - } - printf("\n"); - fflush(stdout); -#endif - - vrpn_Analog::report_changes(); // report any analog event; - vrpn_Button::report_changes(); // report any button event; - } - } while (got_response); -} - -#else - -vrpn_Joylin::vrpn_Joylin(char * name, - vrpn_Connection * c, - char *): - vrpn_Analog(name, c), vrpn_Button_Filter(name, c) -{ - fprintf(stderr,"vrpn_Joylin::vrpn_Joylin: Can't open Linux joystick on non-Linux machine\n"); -} - -vrpn_Joylin::~vrpn_Joylin() -{ -} - -void vrpn_Joylin::mainloop(void) -{ -} - -#endif - diff --git a/src/vrpn/vrpn_Joylin.h b/src/vrpn/vrpn_Joylin.h deleted file mode 100644 index 1f003d95e96e92b04493a5669dfc7ae77da90584..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Joylin.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -# Linux Joystick. Interface to the Linux Joystick driver by Vojtech Pavlik -# included in several Linux distributions. The server code has been tested -# with Linux Joystick driver version 1.2.14. Yet, there is no way how to -# map a typical joystick's zillion buttons and axes on few buttons and axes -# really used. Unfortunately, even joysticks of the same kind can have -# different button mappings from one to another. Driver written by Harald -# Barth (haba@pdc.kth.se). -*/ - -#ifndef VRPN_JOYLIN -#define VRPN_JOYLIN -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API - -class VRPN_API vrpn_Connection; - - -class VRPN_API vrpn_Joylin :public vrpn_Analog, public vrpn_Button_Filter { -public: - vrpn_Joylin(char * name, vrpn_Connection * c, char * portname); - ~vrpn_Joylin(); - - void mainloop(void); - -#ifdef VRPN_USE_JOYLIN -protected: - int init(); -#endif -private: - int namelen; - int fd; - int version; - char *devname; - char *device; -}; - - -#endif diff --git a/src/vrpn/vrpn_Joywin32.C b/src/vrpn/vrpn_Joywin32.C deleted file mode 100644 index 9e9f327ef6f4068c83a719bb5bcb7049f319f51d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Joywin32.C +++ /dev/null @@ -1,390 +0,0 @@ - -#include "vrpn_Joywin32.h" - -#if defined(_WIN32) - -#pragma comment(lib,"winmm.lib") -#include "vrpn_Shared.h" -#include <windows.h> -#include <stdio.h> -#include <cmath> -#include <algorithm> -// vrpn_Joywin32.C -// This is a driver for joysticks being used through the -// Win32 basic interface. -// The driver portions of this code are based on the Microsoft MSDN -// and tutorial from DigiBen at gametutorials.com - -#undef VERBOSE - -// Defines the modes in which the box can find itself. -const int STATUS_BROKEN = -1; // Broken joystick -const int STATUS_READING = 1; // Looking for a report -const int CENTERED_VALUE = -1; // returned value for centered POV - -#define MAX_TIME_INTERVAL (2000000) // max time to try and reacquire - -vrpn_Joywin32::vrpn_Joywin32 (const char * name, vrpn_Connection * c, vrpn_uint8 joyNumber, vrpn_float64 readRate, vrpn_uint8 mode, vrpn_int32 deadzone) : - vrpn_Analog(name, c), - vrpn_Button_Filter(name, c), - _read_rate(readRate), - _joyNumber(joyNumber), - _numchannels((std::min)(12,vrpn_CHANNEL_MAX)), // Maximum available - _numbuttons((std::min)(128,vrpn_BUTTON_MAX_BUTTONS)), // Maximum available - _mode(mode) -{ - last_error_report.tv_sec = 0; - last_error_report.tv_usec = 0; - - if (deadzone >100 || deadzone<0) { - fprintf(stderr,"invalid deadzone, (should be a percentage between 0 and 100).\n"); - _status = STATUS_BROKEN; - return; - } - - if (_mode >2) { - fprintf(stderr,"invalid mode, should be 0 (raw), 1 (normalized to 0,1) or 2 (normalized to -1,1).\n"); - _status = STATUS_BROKEN; - return; - } - - if (_read_rate <0 ) { - fprintf(stderr,"invalid read rate, should be positive.\n"); - _status = STATUS_BROKEN; - return; - } - - if (_numchannels < 12) { - fprintf(stderr,"vrpn_JoyWin32::vrpn_JoyWin32(): Not enough analog channels!\n"); - _status = STATUS_BROKEN; - return; - } - - _deadzone = deadzone / 100.0; - - // initialize the joystick - init_joystick(); -} - -void vrpn_Joywin32::init_joystick(void) -{ - DWORD dwResult = 0; - - // This function below return the number of joysticks the driver supports. - // If it returns 0 then there is no joystick driver installed. - - if (!joyGetNumDevs()) - { - fprintf(stderr,"There are no joystick devices installed.\n"); - _status = STATUS_BROKEN; - return; - } - - if(_joyNumber > joyGetNumDevs()) { - fprintf(stderr,"There are not %d joysticks devices installed, unable to get joystick id %d.\n", _joyNumber, _joyNumber); - _status = STATUS_BROKEN; - return; - } - - // initialize requested joystick - // polling every 10 ms. - JOYINFO tempJoyInfo; - dwResult = joyGetPos (_joyNumber-1, &tempJoyInfo); - - // Let's check what the return value was from joySetCapture() - // - If the joystick is unplugged, say so. - // - If there is no driver installed, say so - // - If we can access the joystick for some strange reason, say so - // Otherwise, let's return a SUCCESS! - // You don't need to do this, but it helps the user solve the problem if there is one. - // Error checking is VERY important, and employers want to see you use it. - - switch (dwResult) - { - case JOYERR_UNPLUGGED: // The joystick is unplugged - fprintf(stderr, "Please plug in the joystick first.\n"); - _status = STATUS_BROKEN; - return; - case MMSYSERR_NODRIVER: // There is no driver for a joystick - fprintf(stderr, "No valid joystick driver.\n"); - _status = STATUS_BROKEN; - return; // Return failure - case JOYERR_PARMS: - fprintf(stderr, "Bad joystick parameters.\n"); - _status = STATUS_BROKEN; - return; // return failure - case JOYERR_NOCANDO: // Unknown error, try restarting - fprintf(stderr, "Couldn't capture joystick input, try restarting.\n"); - _status = STATUS_BROKEN; - return; // return failure - } - - // get joystick caps - if (joyGetDevCaps(_joyNumber-1, &_jc, sizeof(_jc)) != JOYERR_NOERROR){ - fprintf(stderr, "Unable to get joystick capabilities.\n"); - _status = STATUS_BROKEN; - return; - } - - /* set size of data, deprecated - // _numchannels = _jc.wNumAxes; - // _numbuttons = _jc.wNumButtons; - - if (_jc.wCaps & JOYCAPS_HASPOV) { - _numchannels++; - }*/ - - vrpn_Analog::num_channel = _numchannels; - vrpn_Button::num_buttons = _numbuttons; - - fprintf(stderr, "Joystick (%s) has %d axes and %d buttons.\n", - _jc.szPname, _jc.wNumAxes+(JOYCAPS_HASPOV?1:0), _jc.wNumButtons); - - // Set the mode to reading. Set time to zero, so we'll try to read - _status = STATUS_READING; - vrpn_gettimeofday(&_timestamp, NULL); -} - -void vrpn_Joywin32::clear_values(void) -{ - vrpn_uint32 i; - - for (i = 0; i < _numbuttons; i++) { - vrpn_Button::buttons[i] = vrpn_Button::lastbuttons[i] = 0; - } - for (i = 0; i < _numchannels; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } -} - -// This function will send a report if any of the analog or button values -// have changed. This reads from the joystick _read_rate times per second, returns -// right away at other times. -// Returns 0 on success, -1 (and sets _status) on failure. - -int vrpn_Joywin32::get_report(void) -{ - // If it is not time for the next read, just return - struct timeval reporttime; - vrpn_gettimeofday(&reporttime, NULL); - if (vrpn_TimevalDuration(reporttime, _timestamp) < 1000000.0 / _read_rate) { - return 0; - } -#ifdef VERBOSE - printf(" now: %ld:%ld, last %ld:%ld\n", reporttime.tv_sec, reporttime.tv_usec, - _timestamp.tv_sec, static_cast<long>(_timestamp.tv_usec)); - printf(" win32 joystick: Getting report\n"); -#endif - - // update channels and buttons state : - JOYINFOEX jie; - jie.dwFlags = JOY_RETURNALL;//JOY_RETURNBUTTONS|JOY_RETURNCENTERED|JOY_RETURNPOVCTS|JOY_RETURNR|JOY_RETURNU|JOY_RETURNV|JOY_RETURNX|JOY_RETURNY|JOY_RETURNZ|JOY_USEDEADZONE; - jie.dwSize = sizeof(jie); - - if (joyGetPosEx(_joyNumber-1, &jie) != JOYERR_NOERROR ){ - fprintf(stderr, "Unable to get joystick information.\n"); - // clear channels and buttons : - clear_values(); - _status = STATUS_BROKEN; - return -1; - } - - // update vrpn_Channels state - // all joysticks have x and y axes. - - vrpn_float64 normalizer; - - //*************** Retrieve information from JOYINFOEX about joystick state ***************** - channel[0] = jie.dwXpos; - channel[1] = jie.dwYpos; - - if (_jc.wCaps & JOYCAPS_HASZ) { - channel[2] = jie.dwZpos; - } - else channel[2] = 0; - - if (_jc.wCaps & JOYCAPS_HASR) { - channel[3] = jie.dwRpos; - } - else channel[3] = 0; - if (_jc.wCaps & JOYCAPS_HASU) { - channel[4] = jie.dwUpos; - } - else channel[4] = 0; - if (_jc.wCaps & JOYCAPS_HASV) { - channel[5] = jie.dwVpos; - } - else channel[5] = 0; - - channel[6] = 0; - channel[7] = 0; - - if (_jc.wCaps & JOYCAPS_HASPOV) { - channel[8] = jie.dwPOV; - if (channel[8] == 65535 || channel[8] == -1) { - channel[8] = CENTERED_VALUE; - } - if (channel[8] != CENTERED_VALUE) { - channel[8] /= 100.0; - } - } - else { - channel[8] = -1; - } - - channel[9] = -1; - channel[10] = -1; - channel[11] = -1; - - //*********************** normalize from -1 to 1 ********************************* - - if (_mode == 2) { - normalizer = (_jc.wXmax - _jc.wXmin); - if (normalizer != 0) channel[0] = (2*channel[0] - _jc.wXmax - _jc.wXmin) / (_jc.wXmax - _jc.wXmin); - normalizer = (_jc.wYmax - _jc.wYmin); - if (normalizer != 0) channel[1] = (2*channel[1] - _jc.wYmax - _jc.wYmin) / (_jc.wYmax - _jc.wYmin); - if (_jc.wCaps & JOYCAPS_HASZ) { - normalizer = (_jc.wZmax - _jc.wZmin); - if (normalizer != 0) channel[2] = (2*channel[2] - _jc.wZmax - _jc.wZmin) / (_jc.wZmax - _jc.wZmin); - } - if (_jc.wCaps & JOYCAPS_HASR) { - normalizer = (_jc.wRmax - _jc.wRmin); - if (normalizer != 0) channel[3] = (2*channel[3] - _jc.wRmax - _jc.wRmin) / (_jc.wRmax - _jc.wRmin); - } - if (_jc.wCaps & JOYCAPS_HASU) { - normalizer = (_jc.wUmax - _jc.wUmin); - if (normalizer != 0) channel[4] = (2*channel[4] - _jc.wUmax - _jc.wUmin) / (_jc.wUmax - _jc.wUmin); - } - if (_jc.wCaps & JOYCAPS_HASV) { - normalizer = (_jc.wVmax - _jc.wVmin); - if (normalizer != 0) channel[5] = (2*channel[5] - _jc.wVmax - _jc.wVmin) / (_jc.wVmax - _jc.wVmin); - } - } - //*********************** normalize from 0 to 1 ********************************* - else if (_mode == 1){ - normalizer = _jc.wXmax - _jc.wXmin; - if (normalizer != 0) channel[0] = (channel[0] - _jc.wXmin) / normalizer; - normalizer = _jc.wYmax - _jc.wYmin; - if (normalizer != 0) channel[1] = (channel[1] - _jc.wYmin) / normalizer; - if (_jc.wCaps & JOYCAPS_HASZ) { - normalizer = _jc.wZmax - _jc.wZmin; - if (normalizer != 0) channel[2] = (channel[2] - _jc.wZmin) / normalizer; - } - if (_jc.wCaps & JOYCAPS_HASR) { - normalizer = _jc.wRmax - _jc.wRmin; - if (normalizer != 0) channel[3] = (channel[3] - _jc.wRmin) / normalizer; - } - if (_jc.wCaps & JOYCAPS_HASU) { - normalizer = _jc.wUmax - _jc.wUmin; - if (normalizer != 0) channel[4] = (channel[4] - _jc.wUmin) / normalizer; - } - if (_jc.wCaps & JOYCAPS_HASV) { - normalizer = _jc.wVmax - _jc.wVmin; - if (normalizer != 0) channel[5] = (channel[5] - _jc.wVmin) / normalizer; - } - } - - // tidy up clipping - if (_mode == 1){ - // clip to -1;1 + deadzone each channel which is not a POV - for (vrpn_uint32 j=0;j<8;j++) { - // clip to -1 ; 1 - if (channel[j] > 1.0) channel[j] = 1.0; - else if (channel[j] < 0.0) channel[j] = 0.0; - - // clip with dead zone - if (channel[j] <= _deadzone) { - channel[j] = 0; - } - else { - channel[j] = (channel[j] - _deadzone)/(1-_deadzone); - } - } - } - else if(_mode == 2) { - // clip to -1;1 + deadzone each channel which is not a POV - for (vrpn_uint32 j=0;j<8;j++) { - // clip to -1 ; 1 - if (channel[j] > 1.0) channel[j] = 1.0; - else if (channel[j] < -1.0) channel[j] = -1.0; - - // clip with dead zone - if (channel[j] > -_deadzone && channel[j] < _deadzone) { - channel[j] = 0; - } - else { - if (channel[j]>0) { - channel[j] = (channel[j] - _deadzone)/(1-_deadzone); - } - else { - channel[j] = (channel[j] + _deadzone)/(1-_deadzone); - } - } - } - } - - // update vrpn_Buttons state - for (vrpn_uint32 i=0;i<(std::min)(_jc.wMaxButtons, _numbuttons);i++) { - // get flag for current button with a single bit mask and move it left to get 0x1 or 0x0 value - buttons[i] = (char) ((jie.dwButtons&(1<<(i)))>>(i)); - } - - // Send any changes out over the connection. - _timestamp = reporttime; - report_changes(); - return 0; -} - -void vrpn_Joywin32::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_Joywin32::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - - -// This routine is called each time through the server's main loop. It will -// take a course of action depending on the current status of the joystick, -// either trying to reset it or trying to get a reading from it. -void vrpn_Joywin32::mainloop() -{ - // Call the generic server mainloop, since we are a server - server_mainloop(); - - switch(_status) { - case STATUS_BROKEN: - { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - if (vrpn_TimevalDuration(now, last_error_report) > MAX_TIME_INTERVAL) { - send_text_message("Cannot talk to joystick, trying resetting it", now, vrpn_TEXT_ERROR); - last_error_report = now; - - init_joystick(); - } - } - break; - - case STATUS_READING: - get_report(); - break; - - default: - fprintf(stderr,"vrpn_Joywin32: Unknown mode (internal error)\n"); - break; - } -} - -#endif - diff --git a/src/vrpn/vrpn_Joywin32.h b/src/vrpn/vrpn_Joywin32.h deleted file mode 100644 index a131c356aed19f4c377901ec68604704086a6a5e..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Joywin32.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -# Joystick VRPN Driver based on Win32. -# written by Sebastien MARAUX, ONDIM SA (France) -# maraux@ondim.fr -*/ - -#ifndef VRPN_WIN32JOYSTICK_H -#define VRPN_WIN32JOYSTICK_H - -#if defined(_WIN32) - -#include "vrpn_Analog.h" -#include "vrpn_Button.h" - -#include <basetsd.h> -#include <mmsystem.h> - -class VRPN_API vrpn_Joywin32: public vrpn_Analog, public vrpn_Button_Filter -{ -public: - vrpn_Joywin32 (const char * name, vrpn_Connection * c, vrpn_uint8 joyNumber = 1, vrpn_float64 readRate = 60, vrpn_uint8 mode = 0, vrpn_int32 deadzone = 0); - - //~vrpn_Joywin32 (); - - // Called once through each main loop iteration to handle - // updates. - virtual void mainloop (); - -protected: - int _status; - vrpn_uint8 _mode; // raw data , 0;1 or -1;1 normalized data for axes - - struct timeval _timestamp; // Time of the last report from the device - vrpn_float64 _read_rate; // How many times per second to read the device - vrpn_float64 _deadzone; // apply a dead zone to analog inputs - - virtual vrpn_int32 get_report(void); // Try to read a report from the device - void clear_values(void); // Clear the Analog and Button values - void init_joystick(void); // try to (re-)initialize the joystick - - // send report iff changed - virtual void report_changes (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - // send report whether or not changed - virtual void report (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - - vrpn_uint32 _numbuttons; // How many buttons - vrpn_uint32 _numchannels; // How many analog channels - - vrpn_uint8 _joyNumber; - struct timeval last_error_report; // When the last error report was sent - - // joystick caps - JOYCAPS _jc; -}; -#endif -#endif - diff --git a/src/vrpn/vrpn_Keyboard.C b/src/vrpn/vrpn_Keyboard.C deleted file mode 100644 index 4bf97d1eec4ffecc97003d594865b05931b044ed..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Keyboard.C +++ /dev/null @@ -1,78 +0,0 @@ -#include <stdio.h> // for fprintf, stderr - -#include "vrpn_Keyboard.h" -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday - -class VRPN_API vrpn_Connection; -#ifdef _WIN32 -#pragma comment (lib, "user32.lib") -#endif - -vrpn_Keyboard::vrpn_Keyboard (const char * name, vrpn_Connection * c) : - vrpn_Button_Filter(name, c) -{ - int i; - // Set the parameters in the parent classes - num_buttons = 256; - - for( i = 0; i < num_buttons; i++) { - buttons[i] = lastbuttons[i] = 0; - } - -#ifndef _WIN32 - fprintf(stderr,"vrpn_Keyboard:: Not implement on this architecture\n"); -#endif -} - -vrpn_Keyboard::~vrpn_Keyboard() -{ -} - -int vrpn_Keyboard::get_report(void) -{ - struct timeval time; - vrpn_gettimeofday(&time, NULL); // set timestamp of this event - timestamp = time; -#ifdef _WIN32 - int i; - // Read one key state, which will read all of the events - // and make it possible to read the state of all the keys; - // We're ignoring the return for this particular key; it - // will be read again as part of the 256-key read below. - GetKeyState(1); - - // Read all 256 keys from the keyboard, then translate the - // "virtual key" value from each into a scanline code and fill - // in the appropriate entry with each value. - BYTE virtual_keys[256]; - if (GetKeyboardState(virtual_keys) == 0) { - fprintf(stderr,"vrpn_Keyboard::get_report(): Could not read keyboard state\n"); - return 0; - } - - // Clear all 256 key values, then fill in the ones that are - // nonzero. This is done because some of the keys from the - // keyboard (control and shift) map into the same scan code; - // if we just set all of the codes, then the right ones - // overwrite the left ones. - for (i = 0; i < 256; i++) { - buttons[i] = 0; - } - for (i = 0; i < 256; i++) { - unsigned scancode = MapVirtualKey(i, 0); - if ( (scancode != 0) && ((0x80 & virtual_keys[i]) != 0) ) { - buttons[scancode] = 1; - } - } -#endif - report_changes(); // Report updates to VRPN - return 0; -} - -// This routine is called each time through the server's main loop. It will -// get a reading and also handle the server_mainloop requirement. -void vrpn_Keyboard::mainloop() -{ - server_mainloop(); - get_report(); -} diff --git a/src/vrpn/vrpn_Keyboard.h b/src/vrpn/vrpn_Keyboard.h deleted file mode 100644 index 5f3911062f1b6a3d7fbfc7f53d2cecfe1dd7a071..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Keyboard.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef VRPN_KEYBOARD_H -#define VRPN_KEYBOARD_H - -/////////////////////////////////////////////////////////////////////////// -// vrpn_Keyboard is a VRPN server class to publish events from the PC's keyboard. -// It provides a 256-channel vrpn_Button for keyboard buttons, reporting the -// scan codes for the key. -// -// This implementation is Windows-specific, as it leverages the windows mouse calls. -// - -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API - -class VRPN_API vrpn_Connection; - -class VRPN_API vrpn_Keyboard: public vrpn_Button_Filter -{ - public: - vrpn_Keyboard (const char * name, vrpn_Connection * c); - ~vrpn_Keyboard () ; - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - - protected: - /// Read the current status. Return 1 if a report was found, - // 0 otherwise (this only makes sense for buffered implementations; - // return 0 if it is not a buffered implementation. - virtual int get_report(void); -}; - -#endif diff --git a/src/vrpn/vrpn_LUDL.C b/src/vrpn/vrpn_LUDL.C deleted file mode 100644 index bb9444fe298a5a6b48663b342d6365768832a237..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_LUDL.C +++ /dev/null @@ -1,634 +0,0 @@ -// Device drivers for the LUDL family of translation stage controllers. - -// XXX I think we're using ASCII send and response because Ryan had some kind of trouble -// with the binary send/response. Not sure about this, though. It sure would be -// faster to read and easier to parse the binary ones, which all have the same length. -// XXX If we don't recenter, then we definitely need a way to figure out where -// our analogs are. -// XXX Need to parse more than one report if there is more than one in the buffer -// Also, need to clear _inbuf after each parsing. -// XXX Switch the reads (at least) to be asynchronous transfers. -// XXX Consider querying/parsing the position rather than just the status. -// XXX Make sure that we get notified if the user moves the stage with the knobs. -// XXX Check for running into the limits. - -#include "vrpn_LUDL.h" - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_LIBUSB_1_0) - -#include <stdio.h> // for fprintf, stderr, sprintf, etc -#include <string.h> // for NULL, memset, strlen - -#include "libusb.h" -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR - -#define REPORT_ERROR(msg) { send_text_message(msg, timestamp, vrpn_TEXT_ERROR) ; if (d_connection && d_connection->connected()) d_connection->send_pending_reports(); } - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 LUDL_VENDOR = 0x6969; -static const vrpn_uint16 LUDL_USBMAC6000 = 0x1235; - -// Constants used in the LUDL commands and responses. -static const vrpn_uint16 LUDL_GET_LONG_DATA = 84; -static const vrpn_uint16 LUDL_SET_LONG_DATA = 83; -static const vrpn_uint16 LUDL_MOTOR_ACTION = 65; - -// Index constants used by the above commands and responses. -static const vrpn_uint16 LUDL_MOTOR_POSITION = 5; -static const vrpn_uint16 LUDL_MODULE_BUSY = 63; -static const vrpn_uint16 LUDL_START_MOTOR_TARGET = 0; -static const vrpn_uint16 LUDL_CENTER_HOME = 7; -static const vrpn_uint16 SERVO_CHECKING = 241; - -// Device number for the interface we're connected to. -static const vrpn_uint16 LUDL_INTERFACE_ADDRESS = 32; - -vrpn_LUDL_USBMAC6000::vrpn_LUDL_USBMAC6000(const char *name, vrpn_Connection *c, bool do_recenter) - : vrpn_Analog(name, c) - , vrpn_Analog_Output(name, c) - , _device_handle(NULL) - , _incount(0) - , _endpoint(2) // All communications is with Endpoint 2 for the MAC6000 -{ - // Open and claim a device with the expected vendor and product ID. - if ( libusb_init(&_context) != 0) { - fprintf(stderr,"vrpn_LUDL_USBMAC6000: can't init LibUSB\n"); - return; - } - //printf("dbg: Opening device\n"); - if ( (_device_handle = libusb_open_device_with_vid_pid(_context, LUDL_VENDOR, LUDL_USBMAC6000)) == NULL) { - fprintf(stderr,"vrpn_LUDL_USBMAC6000: can't find any USBMac6000 devices\n"); -#ifdef _WIN32 - fprintf(stderr," (Did you install a Zadig.exe or other LibUSB-compatible driver?)\n"); -#endif -#ifdef linux - fprintf(stderr," (Did you remember to run as root?)\n"); -#endif - return; - } - //printf("dbg: Claiming interface\n"); - if ( libusb_claim_interface(_device_handle, 0) != 0) { - fprintf(stderr,"vrpn_LUDL_USBMAC6000: can't claim interface for this device\n"); -#ifdef linux - fprintf(stderr," (Did you remember to run as root?)\n"); -#endif - libusb_close(_device_handle); - _device_handle = NULL; - libusb_exit(_context); - _context = NULL; - return; - } - - // Initialize our analog values. - vrpn_Analog::num_channel = 4; - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); - - // Initialize our analog output values - vrpn_Analog_Output::o_num_channel = 2; - memset(o_channel, 0, sizeof(o_channel)); - - // Recenter if we have been asked to. This takes a long time, during which the - // constructor is locked up. - if (do_recenter) { - //printf("dbg: Recentering\n"); - recenter(); - } - - // Tell the X and Y channel to do servo checking, which means that it will - // cause the system to actively work to hold the system in place when it - // has reached its destination. This turns out to greatly improve the - // precision of motion, and make the precision uniform across particular - // locations. Before this was turned on, there was a positional dependence - // to the amount of error in moving the stage. - if (!send_usbmac_command(1, LUDL_SET_LONG_DATA, SERVO_CHECKING, 1)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::vrpn_LUDL_USBMAC6000(): Could not send command 1"); - } - if (!send_usbmac_command(2, LUDL_SET_LONG_DATA, SERVO_CHECKING, 1)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::vrpn_LUDL_USBMAC6000(): Could not send command 2"); - } - - // Wait for these commands to take effect and then clear any return - // values - vrpn_SleepMsecs(100); - flush_input_from_ludl(); - - // Register to receive the message to request changes and to receive connection - // messages. - if (d_connection != NULL) { - if (register_autodeleted_handler(request_m_id, handle_request_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_LUDL_USBMAC6000: can't register handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler(request_channels_m_id, handle_request_channels_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_LUDL_USBMAC6000: can't register handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler(d_ping_message_id, handle_connect_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_LUDL_USBMAC6000: can't register handler\n"); - d_connection = NULL; - } - } else { - fprintf(stderr,"vrpn_LUDL_USBMAC6000: Can't get connection!\n"); - } - - // Allocate space to store the axis status and record that the axes are stopped. - if ( (_axis_moving = new bool[o_num_channel]) == NULL) { - fprintf(stderr,"vrpn_LUDL_USBMAC6000: Out of memory\n"); - } - if ( (_axis_destination = new vrpn_float64[o_num_channel]) == NULL) { - fprintf(stderr,"vrpn_LUDL_USBMAC6000: Out of memory\n"); - } - int i; - for (i = 0; i < o_num_channel; i++) { - _axis_moving[i] = false; - } -} - -vrpn_LUDL_USBMAC6000::~vrpn_LUDL_USBMAC6000() -{ - if (_device_handle) { - libusb_close(_device_handle); - _device_handle = NULL; - } - if (_context) { - libusb_exit(_context); - _context = NULL; - } - - // Get rid of the arrays we allocated in the constructor - if (_axis_moving != NULL) { delete [] _axis_moving; _axis_moving = NULL; } - if (_axis_destination != NULL) { delete [] _axis_destination; _axis_destination = NULL; } -} - -bool vrpn_LUDL_USBMAC6000::check_for_data(void) -{ - if (_device_handle == NULL) { - return false; - } - - // Let libusb handle any outstanding events - struct timeval zerotime; - zerotime.tv_sec = 0; - zerotime.tv_usec = 0; - libusb_handle_events_timeout(_context, &zerotime); - - // Try to read as many characters as are left in the buffer from - // the device. Keep track of how many we get. - - int chars_to_read = _INBUFFER_SIZE - _incount; - int chars_read = 0; - int ret; - //printf("dbg: Starting bulk receive\n"); - ret = libusb_bulk_transfer(_device_handle, _endpoint | LIBUSB_ENDPOINT_IN, - &_inbuffer[_incount], chars_to_read, &chars_read, 1); - //printf("dbg: Finished bulk receive\n"); - if ( (ret != LIBUSB_SUCCESS) && (ret != LIBUSB_ERROR_TIMEOUT) ) { -#ifdef libusb_strerror - fprintf(stderr, "vrpn_LUDL_USBMAC6000::check_for_data(): Could not read data: %s\n", - libusb_strerror(static_cast<libusb_error>(ret))); -#else - fprintf(stderr, "vrpn_LUDL_USBMAC6000::check_for_data(): Could not read data: code %d\n", - ret); -#endif - - return false; - } - _incount += chars_read; - return true; -} - - -void vrpn_LUDL_USBMAC6000::mainloop() -{ - if (_device_handle == NULL) { - return; - } - - // Let libusb handle any outstanding events - struct timeval zerotime; - zerotime.tv_sec = 0; - zerotime.tv_usec = 0; - libusb_handle_events_timeout(_context, &zerotime); - - // If one of the axes is moving, check to see whether it has stopped. - // If so, report its new position. - // XXX Would like to change this to poll (or have the device send - // continuously) the actual position, rather than relying on it having - // gotten where we asked it to go). - if (!_axis_moving || !_axis_destination) { return; } - int i; - for (i = 0; i < o_num_channel; i++) { - if (_axis_moving[i]) { - if (!ludl_axis_moving(i+1)) { - vrpn_Analog::channel[i] = _axis_destination[i]; - _axis_moving[i] = false; - } - } - } - - // Ask for and record the positions of the two axes. - // Remember that the axes are numbered starting from 1 on the - // LUDL controller but they go in Analog channels 2 and 3. - vrpn_int32 position; - if (ludl_axis_position(1, &position)) { - channel[2] = position; - } - if (ludl_axis_position(2, &position)) { - channel[3] = position; - } - - // Let all of the servers do their thing. - server_mainloop(); - vrpn_gettimeofday(&_timestamp, NULL); - report_changes(); - - vrpn_Analog_Output::server_mainloop(); - vrpn_Analog::server_mainloop(); -} - -void vrpn_LUDL_USBMAC6000::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Analog::report(class_of_service); -} - -void vrpn_LUDL_USBMAC6000::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Analog::report_changes(class_of_service); -} - -void vrpn_LUDL_USBMAC6000::flush_input_from_ludl(void) -{ - // Clear the input buffer, read all available characters - // from the endpoint we're supposed to use, then clear it - // again -- throwing away all data that was coming from the device. - _incount = 0; - check_for_data(); - _incount = 0; -} - -// Construct a command using the specific language of the USBMAC6000 -// and send the message to the device. -// I got the format for this message from the code in USBMAC6000.cpp from -// the video project, as implemented by Ryan Schubert at UNC. -bool vrpn_LUDL_USBMAC6000::send_usbmac_command(unsigned device, unsigned command, unsigned index, int value) -{ - if (_device_handle == NULL) { - return false; - } - - // Let libusb handle any outstanding events - struct timeval zerotime; - zerotime.tv_sec = 0; - zerotime.tv_usec = 0; - libusb_handle_events_timeout(_context, &zerotime); - - char msg[1024]; - sprintf(msg, "can %u %u %u %i\n", device, command, index, value); - int len = strlen(msg); - int sent_len = 0; - msg[len-1] = 0xD; - - //printf("dbg: Starting bulk send command\n"); - int ret = libusb_bulk_transfer(_device_handle, _endpoint | LIBUSB_ENDPOINT_OUT, - static_cast<vrpn_uint8 *>(static_cast<void*>(msg)), - len, &sent_len, 50); - //printf("dbg: Finished bulk send command\n"); - if ((ret != 0) || (sent_len != len)) { -#ifdef libusb_strerror - fprintf(stderr,"vrpn_LUDL_USBMAC6000::send_usbmac_command(): Could not send: %s\n", - libusb_strerror(static_cast<libusb_error>(ret))); -#else - fprintf(stderr,"vrpn_LUDL_USBMAC6000::send_usbmac_command(): Could not send: code %d\n", - ret); -#endif - return false; - } - return true; -} - -// Interpret one response from the device and place its resulting value -// in the return parameter. -// I got the format for this message from the code in USBMAC6000.cpp from -// the video project, as implemented by Ryan Schubert at UNC. -bool vrpn_LUDL_USBMAC6000::interpret_usbmac_ascii_response(const vrpn_uint8 *buffer, - int *device_return, - int *command_return, - int *index_return, - int *value_return) -{ - if (buffer == NULL) { return false; } - const char *charbuf = static_cast<const char *>(static_cast<const void *>(buffer)); - - char acolon[32], can[32]; - int device = 0, command = 0, index = 0, value = 0; - if (sscanf(charbuf, "%s %s %i %i %i %i", acolon, can, &device, &command, &index, &value) <= 0) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::interpret_usbmac_ascii_response(): Could not parse response"); - return false; - } - - *device_return = device; - *command_return = command; - *index_return = index; - *value_return = value; - return true; -} - -// I got the algorithm for recentering from the code in USBMAC6000.cpp from -// the video project, as implemented by Ryan Schubert at UNC. -// XXX This takes a LONG TIME to finish and relies on messages coming back; -// consider making it asynchronous. -bool vrpn_LUDL_USBMAC6000::recenter(void) -{ - // Send the command to make the X axis go to both ends of its - // range and then move into the center. - if (!send_usbmac_command(1, LUDL_MOTOR_ACTION, LUDL_CENTER_HOME, 100000)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::recenter(): Could not send command 1"); - return false; - } - printf("vrpn_LUDL_USBMAC6000::recenter(): Waiting for X-axis center\n"); - vrpn_SleepMsecs(500); // XXX Why sleep? - - // Let libusb handle any outstanding events - struct timeval zerotime; - zerotime.tv_sec = 0; - zerotime.tv_usec = 0; - libusb_handle_events_timeout(_context, &zerotime); - - flush_input_from_ludl(); - - // First we need to wait for the axis to start moving, then we need - // to wait for it to stop moving. This is because sometimes the - // X axis (at least) claims to be not moving even though we just - // told it to and flushed the buffer - while(!ludl_axis_moving(1)) { - vrpn_SleepMsecs(10); - libusb_handle_events_timeout(_context, &zerotime); - } - while(ludl_axis_moving(1)) { - vrpn_SleepMsecs(10); - libusb_handle_events_timeout(_context, &zerotime); - } - - // Send the command to record the value at the center of the X axis as - // 694576 ticks. This magic number comes from the dividing by two the - // range on the UNC Monoptes system between the stops set to keep the - // objective from running into the walls of the plate. XXX Replace this - // with a more meaningful constant, perhaps 0. - if (!send_usbmac_command(1, LUDL_SET_LONG_DATA, LUDL_MOTOR_POSITION, 694576)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::recenter(): Could not send command 2"); - return false; - } - channel[0] = 694576; - - // Send the command to make the Y axis go to both ends of its - // range and then move into the center. - if (!send_usbmac_command(2, LUDL_MOTOR_ACTION, LUDL_CENTER_HOME, 100000)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::recenter(): Could not send command 3"); - return false; - } - printf("vrpn_LUDL_USBMAC6000::recenter(): Waiting for Y-axis center\n"); - vrpn_SleepMsecs(500); // XXX Why sleep? - - // Let libusb handle any outstanding events - libusb_handle_events_timeout(_context, &zerotime); - - flush_input_from_ludl(); - - // First we need to wait for the axis to start moving, then we need - // to wait for it to stop moving. This is because sometimes the - // X axis (at least) claims to be not moving even though we just - // told it to and flushed the buffer - while(!ludl_axis_moving(2)) { - vrpn_SleepMsecs(10); - libusb_handle_events_timeout(_context, &zerotime); - } - while(ludl_axis_moving(2)) { - vrpn_SleepMsecs(10); - libusb_handle_events_timeout(_context, &zerotime); - } - - // Send the command to record the value at the center of the Y axis as - // 1124201 ticks. This magic number comes from the dividing by two the - // range on the UNC Monoptes system between the stops set to keep the - // objective from running into the walls of the plate. XXX Replace this - // with a more meaningful constant, perhaps 0. - if (!send_usbmac_command(2, LUDL_SET_LONG_DATA, LUDL_MOTOR_POSITION, 1124201)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::recenter(): Could not send command 4"); - return false; - } - channel[1] = 1124201; - - return true; -} - -// I got the algorithm for checking if the axis is moving -// from the code in USBMAC6000.cpp from -// the video project, as implemented by Ryan Schubert at UNC. -// The first axis is 1 in this function. -bool vrpn_LUDL_USBMAC6000::ludl_axis_moving(unsigned axis) -{ - // Request the status of the axis. In particular, we look at the - // bits telling whether each axis is busy. - flush_input_from_ludl(); - if (!send_usbmac_command(LUDL_INTERFACE_ADDRESS, LUDL_GET_LONG_DATA, LUDL_MODULE_BUSY, 0)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::ludl_axis_moving(): Could not send command 1"); - return false; - } - - // Read from the device to find the status. We call the check_for_data() method - // to look for a response. - unsigned watchdog = 0; - while (_incount == 0) { - if (!check_for_data()) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::ludl_axis_moving(): Could not get report"); - return false; - } - - // If it has been too long, re-send the request to the stage. - // XXX We should not be losing characters... figure out what is causing us to - // have to resend. - if (++watchdog == 25) { // 25 ms (timeout is 1ms) - if (!send_usbmac_command(LUDL_INTERFACE_ADDRESS, LUDL_GET_LONG_DATA, LUDL_MODULE_BUSY, 0)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::ludl_axis_moving(): Could not resend command 1"); - return false; - } - watchdog = 0; - } - } - int status = 0; - int device, command, index; - if (!interpret_usbmac_ascii_response(_inbuffer, &device, &command, &index, &status)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::ludl_axis_moving(): Could not parse report"); - return false; - } - _incount = 0; // XXX Should parse more than one report if there is one. - int axisMaskBit = 0x0001 << axis; - return (status & axisMaskBit) != 0; -} - -// The first axis is 1 in this function. -bool vrpn_LUDL_USBMAC6000::ludl_axis_position(unsigned axis, vrpn_int32 *position_return) -{ - // Request the position of the axis. - flush_input_from_ludl(); - if (!send_usbmac_command(axis, LUDL_GET_LONG_DATA, LUDL_MOTOR_POSITION, 0)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::ludl_axis_position(): Could not send command 1"); - return false; - } - - // Read from the device to find the status. We call the check_for_data() method - // to look for a response. - unsigned watchdog = 0; - while (_incount == 0) { - if (!check_for_data()) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::ludl_axis_position(): Could not get report"); - return false; - } - - // If it has been too long, re-send the request to the stage. - // XXX We should not be losing characters... figure out what is causing us to - // have to resend. - if (++watchdog == 25) { // 25 ms (timeout is 1ms) - if (!send_usbmac_command(axis, LUDL_GET_LONG_DATA, LUDL_MOTOR_POSITION, 0)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::ludl_axis_position(): Could not resend command 1"); - return false; - } - watchdog = 0; - } - } - int position = 0; - int device, command, index; - if (!interpret_usbmac_ascii_response(_inbuffer, &device, &command, &index, &position)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::ludl_axis_position(): Could not parse report"); - return false; - } - _incount = 0; // XXX Should parse more than one report if there is one. - if ( (command != LUDL_GET_LONG_DATA) || (index != LUDL_MOTOR_POSITION) ) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::ludl_axis_position(): Bad command or index in report"); - return false; - } - *position_return = position; - return true; -} - -bool vrpn_LUDL_USBMAC6000::move_axis_to_position(int axis, int position) -{ - if (!_device_handle) { return false; } - if (!_axis_destination || !_axis_moving) { return false; } - - // If we're already at the place we're being asked to move to, - // then we just go ahead and return. Otherwise, the code below - // that waits for us to start moving hangs. - if (_axis_destination[axis-1] == position) { - return true; - } - - // Send the command to the device asking it to move. - if (!send_usbmac_command(axis, LUDL_MOTOR_ACTION, LUDL_START_MOTOR_TARGET, position)) { - REPORT_ERROR("vrpn_LUDL_USBMAC6000::move_axis_to_position(): Could not send command"); - return false; - } - - // Wait until that axis starts to move. If we don't do this, then - // sometimes we hear back that there are no axes moving even though - // we told them to. Just waiting a while after we told them to move - // does not help; there is still a report saying that they are not moving. - // If the stage is at its limits or if we asked it to go where it already - // is, then we'll wait forever here because it will not move. So this - // needs to time out and not set the axis to moving if we never see - // it start to move. - struct timeval start, now; - vrpn_gettimeofday(&start, NULL); - while (!ludl_axis_moving(axis)) { - vrpn_gettimeofday(&now, NULL); - struct timeval diff = vrpn_TimevalDiff(now, start); - if (diff.tv_sec > 1) { - // Say that we moved there, but don't say that the axis is - // moving. - _axis_destination[axis-1] = position; - return true; - } - }; - - // Indicate that we're expecting this axis to be moving and where we think it is - // going, so that when the axis becomes no longer busy we know that we have gotten - // there. - - _axis_destination[axis-1] = position; - _axis_moving[axis-1] = true; - return true; -} - -int vrpn_LUDL_USBMAC6000::handle_request_message(void *userdata, vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_float64 value; - vrpn_LUDL_USBMAC6000 *me = (vrpn_LUDL_USBMAC6000 *)userdata; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - vrpn_unbuffer(&bufptr, &value); - - // Set the position to the appropriate value, if the channel number is in the - // range of the ones we have. - if ( (chan_num < 0) || (chan_num >= me->o_num_channel) ) { - char msg[1024]; - sprintf(msg,"vrpn_LUDL_USBMAC6000::handle_request_message(): Index out of bounds (%d of %d), value %lg\n", - chan_num, me->o_num_channel, value); - me->send_text_message(msg, me->timestamp, vrpn_TEXT_ERROR); - return 0; - } - - me->move_axis_to_position(chan_num + 1, static_cast<int>(value)); - return 0; -} - -int vrpn_LUDL_USBMAC6000::handle_request_channels_message(void* userdata, vrpn_HANDLERPARAM p) -{ - int i; - const char* bufptr = p.buffer; - vrpn_int32 num; - vrpn_int32 pad; - vrpn_LUDL_USBMAC6000* me = (vrpn_LUDL_USBMAC6000 *)userdata; - - // Read the values from the buffer - vrpn_unbuffer(&bufptr, &num); - vrpn_unbuffer(&bufptr, &pad); - if (num > me->o_num_channel) { - char msg[1024]; - sprintf(msg,"vrpn_LUDL_USBMAC6000::handle_request_channels_message(): Index out of bounds (%d of %d), clipping\n", - num, me->o_num_channel); - me->send_text_message(msg, me->timestamp, vrpn_TEXT_ERROR); - num = me->o_num_channel; - } - for (i = 0; i < num; i++) { - vrpn_unbuffer(&bufptr, &(me->o_channel[i])); - me->move_axis_to_position(i + 1, static_cast<int>(me->o_channel[i])); - } - - return 0; -} - -/** When we get a connection request from a remote object, send our state so - they will know it to start with. */ -int vrpn_LUDL_USBMAC6000::handle_connect_message(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_LUDL_USBMAC6000 *me = (vrpn_LUDL_USBMAC6000 *)userdata; - - me->report(vrpn_CONNECTION_RELIABLE); - return 0; -} - -// End of VRPN_USE_HID -#endif diff --git a/src/vrpn/vrpn_LUDL.h b/src/vrpn/vrpn_LUDL.h deleted file mode 100644 index f2e09ccbfc10358e484291140a8ce43601d3c328..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_LUDL.h +++ /dev/null @@ -1,109 +0,0 @@ -// Device drivers for the LUDL family of translation stage controllers. -// The only device currently implemented is the USBMAC6000 controller in its -// two-axis configuration controlling the stage for the Panoptes system -// at UNC Chapel Hill. - -#ifndef VRPN_LUDL_H -#define VRPN_LUDL_H - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Analog_Output.h" // for vrpn_Analog_Output -#include "vrpn_Configure.h" // for VRPN_CALLBACK, etc -#include "vrpn_Connection.h" // for vrpn_CONNECTION_RELIABLE, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32, vrpn_uint8, etc - -#if defined(VRPN_USE_LIBUSB_1_0) - -// This driver uses the VRPN-preferred LibUSB-1.0 to control the device. -// It exposes the vrpn_Analog and the -// vrpn_Analog_Output interfaces, to report and set the stage position. -// The first two entries below enable the client to set the desired -// position (in ticks) and to read back when the device has finished -// the move to the requested position. They do not actually look at -// the position sensors on the device. -// -// Analog/Analog_Output channel 0 is X (0 to maximum #ticks, in ticks). -// Analog/Analog_Output channel 1 is Y (0 to maximum #ticks, in ticks). -// -// The next two report the actual sensor positions in X and Y. These -// may differ by quite a lot (a micron or more) from the requested -// position, so code that is watching to see if a requested move has -// completed should use the ones above, but those that want to know -// the actual postion, even as it shifts, should use the ones below. -// -// Analog channel 2 is X (0 to maximum #ticks, in ticks). -// Analog channel 3 is Y (0 to maximum #ticks, in ticks). - -class vrpn_LUDL_USBMAC6000 : - public vrpn_Analog, - public vrpn_Analog_Output -{ -public: - vrpn_LUDL_USBMAC6000(const char *name, vrpn_Connection *c = 0, bool do_recenter = false); - virtual ~vrpn_LUDL_USBMAC6000(); - - virtual void mainloop(); - -protected: - struct libusb_context *_context; // LibUSB context used for this device - struct libusb_device_handle *_device_handle; // Handle for the USB device - struct timeval _timestamp; - unsigned _endpoint; // Which endpoint to use to communicate with the device - - // Buffer to store incoming data from the device and count of how many characters - // we got. Function to check and read any incoming data (and set _incount). - // Function to parse accumulated data. - static const unsigned _INBUFFER_SIZE = 1024; - vrpn_uint8 _inbuffer[_INBUFFER_SIZE]; // MUST CHANGE the sizeof() code if this becomes not an array. - unsigned _incount; - bool check_for_data(); // False if error. True even if no data. - bool interpret_usbmac_ascii_response(const vrpn_uint8 *buffer, - int *device_return, - int *command_return, - int *index_return, - int *value_return); - - // vrpn_Analog overridden methods. - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - - // No actual types to register, derived classes will be analogs and analog_outputs - int register_types(void) { return 0; } - - // Handlers for the Analog_Output messages. - /// Responds to a request to change one of the values by - /// setting the channel to that value. - static int VRPN_CALLBACK handle_request_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Responds to a request to change multiple channels at once. - static int VRPN_CALLBACK handle_request_channels_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Responds to a connection request with a report of the values - static int VRPN_CALLBACK handle_connect_message(void *userdata, vrpn_HANDLERPARAM p); - -private: - // Helper functions for communication with the stage - void flush_input_from_ludl(void); - bool send_usbmac_command(unsigned device, unsigned command, unsigned index, int value); - bool recenter(void); - bool ludl_axis_moving(unsigned axis); // Returns true if the axis is still moving - bool move_axis_to_position(int axis, int position); - // Returns true on success, fills in the position of the axis. - bool ludl_axis_position(unsigned axis, vrpn_int32 *position_return); - - // Stores whether we think each axis is moving and where we think each axis is - // going if it is moving. These are set in the move_axis_to_position() routine - // and used in the mainloop() routine to decide if it is time to report that we - // have gotten where we want to be. - bool *_axis_moving; - vrpn_float64 *_axis_destination; -}; - -// end of OS selection -#endif - -// end of VRPN_LUDL_H -#endif diff --git a/src/vrpn/vrpn_LamportClock.C b/src/vrpn/vrpn_LamportClock.C deleted file mode 100644 index d61d1f9ab7e0f92491f91e95fadb9cde82deef18..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_LamportClock.C +++ /dev/null @@ -1,147 +0,0 @@ -#include "vrpn_LamportClock.h" - -vrpn_LamportTimestamp::vrpn_LamportTimestamp (int vectorLength, - vrpn_uint32 * vector) : - d_timestampSize (vectorLength), - d_timestamp (new vrpn_uint32 [vectorLength]) { - - copy(vector); -} - -vrpn_LamportTimestamp::vrpn_LamportTimestamp - (const vrpn_LamportTimestamp & r) : - d_timestampSize (r.d_timestampSize), - d_timestamp (new vrpn_uint32 [r.d_timestampSize]) { - - copy(r.d_timestamp); -} - - - -vrpn_LamportTimestamp::~vrpn_LamportTimestamp (void) { - if (d_timestamp) { - delete [] d_timestamp; - } -} - -vrpn_LamportTimestamp & vrpn_LamportTimestamp::operator = - (const vrpn_LamportTimestamp & r) { - - if (d_timestamp) { - delete [] d_timestamp; - } - - d_timestampSize = r.d_timestampSize; - d_timestamp = new vrpn_uint32 [r.d_timestampSize]; - - copy(r.d_timestamp); - - return *this; -} - - - -vrpn_bool vrpn_LamportTimestamp::operator < (const vrpn_LamportTimestamp & r) - const { - int i; - - // TODO - // What's the right thing to do here? Throw an exception? - if (d_timestampSize != r.d_timestampSize) { - return d_timestampSize < r.d_timestampSize; - } - - // TODO - // How do we compare these correctly? - - for (i = 0; i < d_timestampSize; i++) { - if (d_timestamp[i] > r.d_timestamp[i]) { - return vrpn_false; - } - } - - for (i = 0; i < d_timestampSize; i++) { - if (d_timestamp[i] < r.d_timestamp[i]) { - return vrpn_true; - } - } - - return vrpn_false; // equal -} - -vrpn_uint32 vrpn_LamportTimestamp::operator [] (int i) const { - if ((i < 0) || (i >= d_timestampSize)) { - return 0; - } - return d_timestamp[i]; -} - -int vrpn_LamportTimestamp::size (void) const { - return d_timestampSize; -} - - -void vrpn_LamportTimestamp::copy (const vrpn_uint32 * vector) { - int i; - - if (d_timestamp && vector) { - for (i = 0; i < d_timestampSize; i++) { - d_timestamp[i] = vector[i]; - } - } -} - - - -vrpn_LamportClock::vrpn_LamportClock (int numHosts, int ourIndex) : - d_numHosts (numHosts), - d_ourIndex (ourIndex), - d_currentTimestamp (new vrpn_uint32 [numHosts]) { - - int i; - - if (d_currentTimestamp) { - for (i = 0; i < numHosts; i++) { - d_currentTimestamp[i] = 0; - } - } -} - - -vrpn_LamportClock::~vrpn_LamportClock (void) { - if (d_currentTimestamp) { - delete [] d_currentTimestamp; - } -} - -void vrpn_LamportClock::receive (const vrpn_LamportTimestamp & r) { - int i; - - if (r.size() != d_numHosts) { - // Throw exception! - return; - } - - for (i = 0; i < d_numHosts; i++) { - if (r[i] > d_currentTimestamp[i]) { - d_currentTimestamp[i] = r[i]; - } - } - -} - -vrpn_LamportTimestamp * vrpn_LamportClock::getTimestampAndAdvance (void) { - - d_currentTimestamp[d_ourIndex]++; - - return new vrpn_LamportTimestamp (d_numHosts, d_currentTimestamp); -} - - - - - - - - - diff --git a/src/vrpn/vrpn_LamportClock.h b/src/vrpn/vrpn_LamportClock.h deleted file mode 100644 index c168b6290e4c7ef8a830d3f6ff43374f0a24d5ea..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_LamportClock.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef VRPN_LAMPORT_CLOCK_H -#define VRPN_LAMPORT_CLOCK_H - -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Types.h" // for vrpn_uint32, vrpn_bool - -/// @class vrpn_LamportTimestamp -/// Timestamp for a single event, produced by a vrpn_LamportClock and -/// hopefully generally usable in place of a struct timeval. - -/// @class vrpn_LamportClock -/// Implements a distributed event clock as defined by Leslie Lamport in -/// some seminal papers I can't find my copies of, for use by people who -/// want to sequence events without relying on synchronization of wallclocks. - -class VRPN_API vrpn_LamportTimestamp { - - public: - - vrpn_LamportTimestamp (int vectorLength, vrpn_uint32 * vector); - vrpn_LamportTimestamp (const vrpn_LamportTimestamp &); - ~vrpn_LamportTimestamp (void); - - vrpn_LamportTimestamp & operator = (const vrpn_LamportTimestamp &); - - - // ACCESSORS - - - vrpn_bool operator < (const vrpn_LamportTimestamp & r) const; - ///< Returns vrpn_true if this timestamp precedes r. - ///< It'd be nice if we could throw an exception here, - ///< since some timestamps are incommesurate. - - - // Utility functions. - - vrpn_uint32 operator [] (int i) const; - ///< Returns the event count for the i'th host. - - int size (void) const; - ///< Returns the number of hosts participating in the timestamp. - - - private: - - void copy (const vrpn_uint32 *); - ///< Used by constructors and operator = to copy values into - ///< d_timestamp; don't we wish we were using STL? - - int d_timestampSize; - vrpn_uint32 * d_timestamp; - - vrpn_LamportTimestamp (void); - ///< UNDEFINED - not legal. - -}; - - -class VRPN_API vrpn_LamportClock { - - public: - - vrpn_LamportClock (int numHosts, int ourIndex); - ~vrpn_LamportClock (void); - - - // MANIPULATORS - - - void receive (const vrpn_LamportTimestamp &); - ///< Updates this clock to reflect a timestamp received from - ///< another clock/host. - - vrpn_LamportTimestamp * getTimestampAndAdvance (void); - ///< Increments the current timestamp and returns it. - - - private: - - int d_numHosts; - int d_ourIndex; - vrpn_uint32 * d_currentTimestamp; - -}; - - - -#endif // VRPN_LAMPORT_CLOCK_H - - diff --git a/src/vrpn/vrpn_Local_HIDAPI.C b/src/vrpn/vrpn_Local_HIDAPI.C deleted file mode 100644 index de7ad7365b996ecd918e12fb99a5cc052603737f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Local_HIDAPI.C +++ /dev/null @@ -1,43 +0,0 @@ -#include "vrpn_Configure.h" -#ifdef VRPN_USE_HID -#ifdef VRPN_USE_LOCAL_HIDAPI - -#if defined(_WIN32) || defined(__CYGWIN__) - -// I had to include this definition to get the hid.c file to compile -// under Visual Studio 2005. Hopefully this won't conflict with the environments -// of others. In future versions, if NTSTATUS is located by -// the compiler then we can remove this definition. - -#ifndef NTSTATUS -typedef long NTSTATUS; -#endif -#include "submodules/hidapi/windows/hid.cpp" - -#pragma comment( lib, "Setupapi.lib" ) - -#elif defined(linux) -// On linux, we need to compile this code as C code rather than C++ code -// because otherwise the lack of casts from void* keeps it from compiling. -// Hopefully this will be fixed in a future version. If so, we can then remove -// the special "compile this as C" line from the Makefile and the following -// check. -#ifdef __cplusplus -#error This code must be compiled as C code, rather than C++. Use the '-x c' option to the compiler. -#endif - -#include "submodules/hidapi/linux/hid-libusb.c" - -#elif defined(__APPLE__) -// On the mac, we need to compile this code as C code rather than C++ code -// because otherwise the lack of casts from void* keeps it from compiling. -// The inclusion of this file is handled in CMake. -//#include "submodules/hidapi/mac/hid.c" - -#else -#error HIDAPI is not configured for this architecture. If the current version works on this architecture, describe how to find it in this file. - -#endif - -#endif // VRPN_USE_LOCAL_HIDAPI -#endif // VRPN_USE_HID diff --git a/src/vrpn/vrpn_Log.h b/src/vrpn/vrpn_Log.h deleted file mode 100644 index 2d613b46920f4b02845eb438930c59489941c2db..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Log.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef VRPN_LOG_H -#define VRPN_LOG_H - -/** - * @class vrpn_Log - * Logs a VRPN stream. - * Used by vrpn_Endpoint. - */ - -class VRPN_API vrpn_Log { - -public: - vrpn_Log(vrpn_TranslationTable* senders, vrpn_TranslationTable* types); - ~vrpn_Log(void); - - // ACCESSORS - char* getName(); - ///< Allocates a new string and copies the log file name to it. - ///< IMPORTANT: code calling this function is responsible for freeing the - /// memory. - - // MANIPULATORS - int open(void); - ///< Opens the log file. - - int close(void); - ///< Closes and saves the log file. - - int saveLogSoFar(void); - ///< Saves any messages logged so far. - - int logIncomingMessage(size_t payloadLen, struct timeval time, - vrpn_int32 type, vrpn_int32 sender, - const char* buffer); - ///< Should be called with the timeval adjusted by the clock offset - ///< on the receiving Endpoint. - - int logOutgoingMessage(vrpn_int32 payloadLen, struct timeval time, - vrpn_int32 type, vrpn_int32 sender, - const char* buffer); - - int logMessage(vrpn_int32 payloadLen, struct timeval time, vrpn_int32 type, - vrpn_int32 sender, const char* buffer, - vrpn_bool isRemote = VRPN_FALSE); - ///< We'd like to make this protected, but there's one place it needs - ///< to be exposed, at least until we get cleverer. - - int setCookie(const char* cookieBuffer); - ///< The magic cookie is set to the default value of the version of - ///< VRPN compiled, but a more correct value to write in the logfile - ///< (if we're logging incoming messages) is that of the version of - ///< VRPN we're communicating with. - - int setCompoundName(const char* name, int index); - ///< Takes a name of the form foo.bar and an index <n> and sets the - ///< name of the log file to be foo-<n>.bar; if there is no period - ///< in the name, merely appends -<n>. - - int setName(const char* name); - int setName(const char* name, size_t len); - - long& logMode(void); - ///< Returns a reference so we can |= it. - - int addFilter(vrpn_LOGFILTER filter, void* userdata); - - timeval lastLogTime(); - ///< Returns the time of the last message that was logged - -protected: - int checkFilters(vrpn_int32 payloadLen, struct timeval time, - vrpn_int32 type, vrpn_int32 sender, const char* buffer); - - char* d_logFileName; - long d_logmode; - - vrpn_LOGLIST* d_logTail; - vrpn_LOGLIST* d_firstEntry; - - FILE* d_file; - - char* d_magicCookie; - - vrpn_bool d_wroteMagicCookie; - - vrpnLogFilterEntry* d_filters; - - vrpn_TranslationTable* d_senders; - vrpn_TranslationTable* d_types; - - timeval d_lastLogTime; -}; - -#endif // VRPN_LOG_H diff --git a/src/vrpn/vrpn_Logitech_Controller_Raw.C b/src/vrpn/vrpn_Logitech_Controller_Raw.C deleted file mode 100644 index 6478064a9dced369df6ef854cbda89f58998c79e..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Logitech_Controller_Raw.C +++ /dev/null @@ -1,264 +0,0 @@ -// vrpn_Logitech_Controller_Raw.C: VRPN driver for Logitech (other than 3Dconnexion) Controller Raw devices - -#include <stdio.h> // for fprintf, stderr, NULL -#include <string.h> // for memset -#include <math.h> // for sqrt and fabs - -#include "vrpn_Logitech_Controller_Raw.h" - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_HID) - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 LOGITECH_VENDOR = 0x046d; // 3Dconnexion is made by Logitech -static const vrpn_uint16 EXTREME_3D_PRO = 0xc215; - -static const double POLL_INTERVAL = 1e+6 / 30.0; // If we have not heard, ask. - -#define GAMEPAD_TRIGGER_THRESHOLD 30 - -////////////////////////////////////////////////////////////////////////// -// helpers -////////////////////////////////////////////////////////////////////////// -static vrpn_float64 normalize_dpad(unsigned char up, unsigned char right, unsigned char down, unsigned char left) -{ - int x = 0; - int y = 0; - if (right) - { - x += 1; - } - if (left) - { - x -= 1; - } - if (up) - { - y += 1; - } - if (down) - { - y -= 1; - } - size_t index = ((x + 1) * 3) + (y + 1); - vrpn_float64 angles[] = {225, 270, 315, 180, -1, 0, 135, 90, 45}; - return (angles[index]); -} - -static void normalize_axis(const unsigned int value, const short deadzone, const vrpn_float64 scale, vrpn_float64& channel, int wordSize = 16) -{ - channel = (static_cast<float>(value) - (float) (1 << (wordSize - 1))); - if (fabs(channel) < (deadzone * 3 / 4)) - { - channel = 0.0f; - } - else - { - channel /= (float) (1 << (wordSize - 1)); - } - channel *= scale; - if (channel < -1.0) { channel = -1.0; } - if (channel > 1.0) { channel = 1.0; } -} - -static void normalize_axes(const unsigned int x, const unsigned int y, const short deadzone, const vrpn_float64 scale, vrpn_float64& channelX, vrpn_float64& channelY, int wordSize = 16) -{ - normalize_axis(x, deadzone, scale, channelX, wordSize); - normalize_axis(y, deadzone, scale, channelY, wordSize); -} - -static vrpn_float64 normalize_trigger(unsigned int trigger) -{ - // Filter out low-intensity signals - int value = trigger - 0x80; - return ((fabs(static_cast<double>(value)) < GAMEPAD_TRIGGER_THRESHOLD) ? 0.0f : (value * 2.0f / 255.0f)); -} - -////////////////////////////////////////////////////////////////////////// -// Common base class -////////////////////////////////////////////////////////////////////////// -vrpn_Logitech_Controller_Raw::vrpn_Logitech_Controller_Raw(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c) : - vrpn_HidInterface(filter), vrpn_BaseClass(name, c), _filter(filter) -{ - init_hid(); -} - -vrpn_Logitech_Controller_Raw::~vrpn_Logitech_Controller_Raw(void) -{ - delete _filter; -} - -void vrpn_Logitech_Controller_Raw::init_hid() -{ - // Get notifications when clients connect and disconnect - register_autodeleted_handler(d_connection->register_message_type(vrpn_dropped_last_connection), on_last_disconnect, this); - register_autodeleted_handler(d_connection->register_message_type(vrpn_got_connection), on_connect, this); -} - -void vrpn_Logitech_Controller_Raw::on_data_received(size_t bytes, vrpn_uint8 *buffer) -{ - decodePacket(bytes, buffer); -} - -int vrpn_Logitech_Controller_Raw::on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Logitech_Controller_Raw* me = static_cast<vrpn_Logitech_Controller_Raw*>(thisPtr); - return (0); -} - -int vrpn_Logitech_Controller_Raw::on_connect(void* thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Logitech_Controller_Raw* me = static_cast<vrpn_Logitech_Controller_Raw*>(thisPtr); - return (0); -} - -////////////////////////////////////////////////////////////////////////// -// SideWinder Precision 2 Joystick -////////////////////////////////////////////////////////////////////////// -vrpn_Logitech_Extreme_3D_Pro::vrpn_Logitech_Extreme_3D_Pro(const char *name, vrpn_Connection *c) : - vrpn_Logitech_Controller_Raw(_filter = new vrpn_HidProductAcceptor(LOGITECH_VENDOR, EXTREME_3D_PRO), name, c), - vrpn_Button_Filter(name, c), vrpn_Analog(name, c), vrpn_Dial(name, c) -{ - vrpn_Analog::num_channel = 5; - vrpn_Dial::num_dials = 0; - vrpn_Button::num_buttons = 16; - - // Initialize the state of all the analogs, buttons, and dials - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); -} - -void vrpn_Logitech_Extreme_3D_Pro::mainloop(void) -{ - update(); - server_mainloop(); - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, _timestamp) > POLL_INTERVAL) - { - _timestamp = current_time; - report_changes(); - - vrpn_Analog::server_mainloop(); - vrpn_Button::server_mainloop(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::server_mainloop(); - } - } -} - -void vrpn_Logitech_Extreme_3D_Pro::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Logitech_Extreme_3D_Pro::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Logitech_Extreme_3D_Pro::decodePacket(size_t bytes, vrpn_uint8 *buffer) -{ - // SideWinder Precision 2 joystick - - // Decode all full reports, each of which is 40 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - /* -? [0]: X-axis (left=00, right=ff) - [1]: Y-axis - lower byte (up=00, down=ff) - [2]: POV Hat high nibble (none=0x80, N=0x00, NE=0x10, ... NW=0x80), Y-axis upper nibble in low nibble of this byte - [3]: Z-rotate (left=00, right=ff) - [4]: buttons (bit flags: none=0x00, "1" (trigger)=0x01, "2"=0x02, "3"=0x04, ..., "8"=0x80 - [5]: Slider (up=00, down=ff) - [6]: buttons (bit flags: none=0x00, "9"=0x01, "10"=0x02, "11"=0x04, "12"=0x08 - */ - // XXX Check to see that this works with HIDAPI, there may be two smaller reports. - if (bytes == 7) - { - unsigned int x, y; - x = buffer[0]; - y = ((buffer[2] & 0x0f) << 8) + buffer[1]; - normalize_axes(x, y, 0x16, 1.0f, channel[0], channel[1], 12); - normalize_axis(buffer[3], 0x12, 1.0f, channel[2], 8); - normalize_axis(buffer[5], 0x0e, 1.0f, channel[3], 8); - - vrpn_uint8 value, mask; - value = buffer[4]; - for (int btn = 0; btn < 8; btn++) - { - mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[btn] = ((value & mask) != 0); - } - - // Point of View Hat - buttons[8] = buttons[9] = buttons[10] = buttons[11] = 0; - switch (buffer[2] >> 4) - { - case 0: // up - buttons[8] = true; - break; - case 1: - buttons[8] = buttons[9] = true; - break; - case 2: // right - buttons[9] = true; - break; - case 3: - buttons[9] = buttons[10] = true; - break; - case 4: // down - buttons[10] = true; - break; - case 5: - buttons[10] = buttons[11] = true; - break; - case 6: // left - buttons[11] = true; - break; - case 7: - buttons[11] = buttons[8] = true; - break; - case 8: - default: - // nothing to do - break; - } - channel[4] = normalize_dpad(buttons[8], buttons[9], buttons[10], buttons[11]); - } - else - { - fprintf(stderr, "vrpn_Logitech_Extreme_3D_Pro: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - } -} - -// End of VRPN_USE_HID -#endif diff --git a/src/vrpn/vrpn_Logitech_Controller_Raw.h b/src/vrpn/vrpn_Logitech_Controller_Raw.h deleted file mode 100644 index 4d84f970cff7d3b86944b00a72fcbe67fb647338..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Logitech_Controller_Raw.h +++ /dev/null @@ -1,66 +0,0 @@ -#pragma once - -#include <stddef.h> // for size_t - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_BaseClass.h" // for vrpn_BaseClass -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_USE_HID -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Dial.h" // for vrpn_Dial -#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint8, vrpn_uint32 - -#if defined(VRPN_USE_HID) - -// Device drivers for the Logitech Controller Raw USB line of products -// Currently supported: Extreme 3D Pro -// -// Exposes three major VRPN device classes: Button, Analog, Dial (as appropriate). -// All models expose Buttons for the keys on the device. -// Button 0 is the programming switch; it is set if the switch is in the "red" position. -// - -class vrpn_Logitech_Controller_Raw: public vrpn_BaseClass, protected vrpn_HidInterface { -public: - vrpn_Logitech_Controller_Raw(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Logitech_Controller_Raw(void); - - virtual void mainloop(void) = 0; -protected: - // Set up message handlers, etc. - void init_hid(void); - void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - static int VRPN_CALLBACK on_connect(void *thisPtr, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM p); - - virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer) = 0; - struct timeval _timestamp; - vrpn_HidAcceptor *_filter; - - // No actual types to register, derived classes will be buttons, analogs, and/or dials - int register_types(void) { return (0); } -}; - -class vrpn_Logitech_Extreme_3D_Pro: protected vrpn_Logitech_Controller_Raw, public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Dial -{ -public: - vrpn_Logitech_Extreme_3D_Pro(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Logitech_Extreme_3D_Pro(void) {}; - - virtual void mainloop(void); -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); -}; - -// end of VRPN_USE_HID -#else -class VRPN_API vrpn_Logitech_Extreme_3D_Pro; -#endif diff --git a/src/vrpn/vrpn_Magellan.C b/src/vrpn/vrpn_Magellan.C deleted file mode 100644 index 84a53458509d4c0eacf3a944717ddb2f57f96790..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Magellan.C +++ /dev/null @@ -1,428 +0,0 @@ -// vrpn_Magellan.C -// This is a driver for the LogiCad 3D Magellan controller. -// This is a 6DOF motion controller with 9 buttons and a 6DOF -// puck that can be translated and rotated. It plugs into a serial -// line and communicated using RS-232 (this is a raw-mode driver). -// You can find out more at www.logicad3d.com; from there you can -// download the programming guide, which was used to generate this -// driver. This is a driver for the standard Magellan/Space Mouse -// (the Turbo Magellan/Space Mouse uses 19200 baud communications -// and a compressed data format -- it would only require determining -// which mode and implementing a new data translation part to make -// the driver compatible with the Turbo version; we don't have one -// here to check). The driver was written and tested on a Magellan -// version 5.49. - -// INFO about how the device communicates: -// It sends 4-bit nybbles packed into bytes such that there is -// even parity: in particular, the following values are sent: -// 0 1 2 3 4 5 6 7 8 9 A B C D E F -// 30H 41H 42H 33H 44H 35H 36H 47H 48H 39H 3AH 4BH 3CH 4DH 4EH 3FH -// '0' 'A' 'B' '3' 'D' '5' '6' 'G' 'H' '9' ':' 'K' '<' 'M' 'N' '?' -// Commands are sent starting with a character, then followed -// by data, then always terminated by a carriage return '\r'. Useful -// commands to send to the device include z\r (zero), vQ\r (query -// version), b<\r (beep for half a second), -// Julien Brisset found a version of the Magellan that did not -// understand the reset command that works on our version, so sent an -// alternate reset string that works on his. This is sent if the -// 'altreset' parameter is true in the constructor. - -#include <stdio.h> // for fprintf, stderr -#include <string.h> // for strlen, NULL, strcmp - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR -#include "vrpn_Magellan.h" -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_SleepMsecs, etc - -#undef VERBOSE - -// Defines the modes in which the box can find itself. -#define STATUS_RESETTING (-1) // Resetting the device -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report - -#define MAX_TIME_INTERVAL (2000000) // max time between reports (usec) - -// This creates a vrpn_Magellan and sets it to reset mode. It opens -// the serial device using the code in the vrpn_Serial_Analog constructor. -// The box seems to autodetect the baud rate when the "T" command is sent -// to it. -vrpn_Magellan::vrpn_Magellan (const char * name, vrpn_Connection * c, - const char * port, int baud, bool altreset): - vrpn_Serial_Analog(name, c, port, baud), - vrpn_Button_Filter(name, c), - _numbuttons(9), - _numchannels(6), - _null_radius(8), - _altreset(altreset) -{ - // Set the parameters in the parent classes - vrpn_Button::num_buttons = _numbuttons; - vrpn_Analog::num_channel = _numchannels; - - // Set the status of the buttons and analogs to 0 to start - clear_values(); - - // Set the mode to reset - _status = STATUS_RESETTING; - - // Wait before the first time we attempt a reset - seems to be a race condition - // with the device needing time between opening of the serial connection and - // receiving the reset commands. (SpaceMouse Plus XT Serial, version 6.60) - vrpn_SleepMsecs(1000); -} - -void vrpn_Magellan::clear_values(void) -{ - int i; - - for (i = 0; i < _numbuttons; i++) { - vrpn_Button::buttons[i] = vrpn_Button::lastbuttons[i] = 0; - } - for (i = 0; i < _numchannels; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } -} - -// This routine will reset the Magellan, zeroing the position, setting the compress -// mode and making the device beep for half a second. It then verifies that the -// commands were received and processed by the device. -// Commands Responses Meanings -// z\r z\r Set current position and orientation to be zero -// m3\r m3\r Set 3D mode, send trans+rot -// c30\r c30\r Sets to not compress the return data -// nH\r nH\r Sets the NULL radius for the device to 8 -// bH\r b\r Beep (< means for 32 milliseconds) - -int vrpn_Magellan::reset(void) -{ - struct timeval timeout, now; - unsigned char inbuf[45]; - const char *reset_str = "z\rm3\rc30\rnH\rbH\r"; // Reset string sent to box - const char *expect_back = "z\rm3\rc30\rnH\rb\r"; // What we expect back - int ret; - - //----------------------------------------------------------------------- - // See if we should be using the alternative reset string. - // XXX The "expect_back" string here is almost certainly wrong. Waiting - // to hear back what the correct one should be. - if (_altreset) { - reset_str = "z\rm3\rnH\rp?0\rq00\r"; - expect_back = "z\rm3\rnH\rp?0\rq00\r"; - } - - //----------------------------------------------------------------------- - // Set the values back to zero for all buttons, analogs and encoders - clear_values(); - - //----------------------------------------------------------------------- - // Send the list of commands to the device to cause it to reset and beep. - // Read back the response and make sure it matches what we expect. - // Give it a reasonable amount of time to finish, then timeout - vrpn_flush_input_buffer(serial_fd); - vrpn_write_slowly(serial_fd, (unsigned char *)reset_str, strlen(reset_str), 5); - timeout.tv_sec = 1; - timeout.tv_usec = 0; - ret = vrpn_read_available_characters(serial_fd, inbuf, strlen(expect_back), &timeout); - inbuf[strlen(expect_back)] = 0; // Make sure string is NULL-terminated - - vrpn_gettimeofday(&now, NULL); - if (ret < 0) { - send_text_message("vrpn_Magellan reset: Error reading from device", now); - return -1; - } - if (ret == 0) { - send_text_message("vrpn_Magellan reset: No response from device", now); - return -1; - } - if (ret != (int)strlen(expect_back)) { - send_text_message("vrpn_Magellan reset: Got less than expected number of characters", now); - //,ret, strlen(expect_back)); - return -1; - } - - // Make sure the string we got back is what we expected - if ( strcmp((char *)inbuf, expect_back) != 0 ) { - send_text_message("vrpn_Magellan reset: Bad reset string", now); - //(want %s, got %s)\n", expect_back, inbuf); - return -1; - } - - // The NULL radius is now set to 8 - _null_radius = 8; - - // We're now waiting for a response from the box - status = STATUS_SYNCING; - - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - return 0; -} - -// This function will read characters until it has a full report, then -// put that report into the time, analog, or button fields and call -// the report methods on these. The time stored is that of -// the first character received as part of the report. -// Reports start with different characters, and the length of the report -// depends on what the first character of the report is. We switch based -// on the first character of the report to see how many more to expect and -// to see how to handle the report. -// Returns 1 if there is a complete report found, 0 otherwise. This is -// so that the calling routine can know to check again at the end of complete -// reports to see if there is more than one report buffered up. - -int vrpn_Magellan::get_report(void) -{ - int ret; // Return value from function call to be checked - int i; // Loop counter - int nextchar = 1; // Index of the next character to read - - //-------------------------------------------------------------------- - // If we're SYNCing, then the next character we get should be the start - // of a report. If we recognize it, go into READing mode and tell how - // many characters we expect total. If we don't recognize it, then we - // must have misinterpreted a command or something; reset the Magellan - // and start over - //-------------------------------------------------------------------- - - if (status == STATUS_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, _buffer, 1) != 1) { - return 0; - } - - switch (_buffer[0]) { - case 'k': - _expected_chars = 5; status = STATUS_READING; break; - case 'b': - _expected_chars = 2; status = STATUS_READING; break; - case 'm': - _expected_chars = 3; status = STATUS_READING; break; - case 'd': - _expected_chars = 26; status = STATUS_READING; break; - case 'n': - _expected_chars = 3; status = STATUS_READING; break; - case 'q': - _expected_chars = 4; status = STATUS_READING; break; - case 'z': - _expected_chars = 2; status = STATUS_READING; break; - case 'p': - _expected_chars = 4; status = STATUS_READING; break; - case 'c': - _expected_chars = 4; status = STATUS_READING; break; - - default: - fprintf(stderr,"vrpn_Magellan: Unknown command (%c), resetting\n", _buffer[0]); - status = STATUS_RESETTING; - return 0; - } - - - // Got the first character of a report -- go into READING mode - // and record that we got one character at this time. The next - // bit of code will attempt to read the rest of the report. - // The time stored here is as close as possible to when the - // report was generated. - _bufcount = 1; - vrpn_gettimeofday(×tamp, NULL); - status = STATUS_READING; -#ifdef VERBOSE - printf("... Got the 1st char\n"); -#endif - } - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. - //-------------------------------------------------------------------- - - ret = vrpn_read_available_characters(serial_fd, &_buffer[_bufcount], - _expected_chars-_bufcount); - if (ret == -1) { - send_text_message("vrpn_Magellan: Error reading", timestamp, vrpn_TEXT_ERROR); - status = STATUS_RESETTING; - return 0; - } - _bufcount += ret; -#ifdef VERBOSE - if (ret != 0) printf("... got %d characters (%d total)\n",ret, _bufcount); -#endif - if (_bufcount < _expected_chars) { // Not done -- go back for more - return 0; - } - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. Check to make - // sure that its format matches what we expect. If it does, the next - // section will parse it. If it does not, we need to go back into - // synch mode and ignore this report. A well-formed report has the - // last character '\r' - //-------------------------------------------------------------------- - - if (_buffer[_expected_chars-1] != '\r') { - status = STATUS_SYNCING; - send_text_message("vrpn_Magellan: No carriage return in record", timestamp, vrpn_TEXT_ERROR); - return 0; - } - -#ifdef VERBOSE - printf("got a complete report (%d of %d)!\n", _bufcount, _expected_chars); -#endif - - //-------------------------------------------------------------------- - // Decode the report and store the values in it into the parent classes - // (analog or button) if appropriate. - //-------------------------------------------------------------------- - - switch ( _buffer[0] ) { - case 'k': - // This is a button command from the device. It gives us the state - // of each of the buttons on the device. Buttons 1-4 are encoded - // in the 4 LSBs of the first byte (key 1 in the LSB); buttons 5-8 - // are in the 4 LSBs of the second byte; the * button (which we'll - // call button 0) is in the LSB of the third byte (the other 3 bits - // don't seem to be used). - buttons[0] = ( (_buffer[3] & 0x01) != 0); - buttons[1] = ( (_buffer[1] & 0x01) != 0); - buttons[2] = ( (_buffer[1] & 0x02) != 0); - buttons[3] = ( (_buffer[1] & 0x04) != 0); - buttons[4] = ( (_buffer[1] & 0x08) != 0); - buttons[5] = ( (_buffer[2] & 0x01) != 0); - buttons[6] = ( (_buffer[2] & 0x02) != 0); - buttons[7] = ( (_buffer[2] & 0x04) != 0); - buttons[8] = ( (_buffer[2] & 0x08) != 0); - break; - - case 'b': - // Beep command received. We don't care. - break; - - case 'm': - // Mode set command. We really only care that it is still in - // 3D mode (as opposed to Mouse mode); the other fields tell - // whether it is in dominant axis mode, and whether translations - // and rotations are being sent. We can handle any of these without - // incident. - if ( (_buffer[1] & 0x08) != 0) { - send_text_message("vrpn_Magellan: Was put into mouse mode, resetting", timestamp, vrpn_TEXT_ERROR); - status = STATUS_RESETTING; - return 1; - } - break; - - case 'd': - // Axis data is being returned (telling what the X,Y,Z and A,B,C axes - // are currently set to). This data is put into the range [-1,1] and - // put into the analog channels (0=X, 1=Y, 2=Z, 3=A, 4=B, 5=C). It comes - // from the device with each axis packed into the lower nybble of 4 - // consecutive bytes; the translation back to a signed 16-bit integer - // is done with (N0 * 4096) + (N1 * 256) + (N2 * 16) + (N3) - 32768 - // for each value; this is then scaled to [-1,1]. - nextchar = 1; // Skip the zeroeth character (the command) - for (i = 0; i < _numchannels; i++) { - long intval; - intval = (0x0f & _buffer[nextchar++]) << 12; - intval += (0x0f & _buffer[nextchar++]) << 8; - intval += (0x0f & _buffer[nextchar++]) << 4; - intval += (0x0f & _buffer[nextchar++]); - intval -= 32768; - - // If the absolute value of the integer is <= the NULL radius, it should - // be set to zero. - if ( (intval <= _null_radius) && (intval >= - _null_radius) ) { - intval = 0; - } - - // The largest values that seem to come out of the Magellan I've got - // even under the maximum acceleration are absolute value 7200 or so. - // We'll divide by 7500 to keep it safe. - double realval = intval / 7500.0; - channel[i] = realval; - } - break; - - case 'n': - // NULL radius set. This is the number of ticks around zero that should - // count as zero, to allow a "dead zone" for the user near the center. - // We store this for the analog parsing code. The low nybble in the data - // word holds the new value - _null_radius = 0x0f & _buffer[1]; - break; - - case 'q': - // Sensitivity set. We don't care. - break; - - case 'z': - // The device was zeroed. We don't care. - break; - - case 'p': - // The min/max periods were set. We don't care. - break; - - case 'c': - // Some extended command was sent. I hope we don't care. - // XXX Should check to make sure compression is not on. - break; - - default: - fprintf(stderr,"vrpn_Magellan: Unknown [internal] command (%c), resetting\n", _buffer[0]); - status = STATUS_RESETTING; - return 1; - } - - //-------------------------------------------------------------------- - // Done with the decoding, send the reports and go back to syncing - //-------------------------------------------------------------------- - - report_changes(); - status = STATUS_SYNCING; - _bufcount = 0; - - return 1; // We got a full report. -} - -void vrpn_Magellan::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_Magellan::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -// This routine is called each time through the server's main loop. It will -// take a course of action depending on the current status of the Magellan, -// either trying to reset it or trying to get a reading from it. -void vrpn_Magellan::mainloop() -{ - server_mainloop(); - - switch(status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - // Keep getting reports until all full reports are read. - while (get_report()) {}; - break; - - default: - fprintf(stderr,"vrpn_Magellan: Unknown mode (internal error)\n"); - break; - } -} diff --git a/src/vrpn/vrpn_Magellan.h b/src/vrpn/vrpn_Magellan.h deleted file mode 100644 index f37e1c482b9489cf969b30d56d3faa1930e4bd14..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Magellan.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef VRPN_MAGELLAN_H -#define VRPN_MAGELLAN_H - -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32 - -class VRPN_API vrpn_Magellan: public vrpn_Serial_Analog - ,public vrpn_Button_Filter -{ -public: - vrpn_Magellan (const char * name, vrpn_Connection * c, - const char * port, int baud, bool altreset = false); - - ~vrpn_Magellan () {}; - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - - virtual int reset(void); //< Set device back to starting config - - protected: - bool _altreset; //< Send alternative reset string? - int _status; //< Used by mainloop() and get_report() - int _numbuttons; //< How many buttons to open - int _numchannels; //< How many analog channels to open - - unsigned _expected_chars; //< How many characters to expect in the report - unsigned char _buffer[512]; //< Buffer of characters in report - unsigned _bufcount; //< How many characters we have so far - - int _null_radius; //< The range over which no motion should be reported - - struct timeval timestamp; //< Time of the last report from the device - - virtual void clear_values(void);//< Set all buttons, analogs and encoders back to 0 - - /// Try to read a report from the device. Returns 1 if complete report received, - /// 0 otherwise. Sets _status to match current status. - virtual int get_report(void); - - /// send report iff changed - virtual void report_changes - (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - /// send report whether or not changed - virtual void report - (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button, which are always vrpn_RELIABLE -}; - -#endif diff --git a/src/vrpn/vrpn_MainloopContainer.h b/src/vrpn/vrpn_MainloopContainer.h deleted file mode 100644 index f3df28d3e02ec64d14ffaf11456fccbcbb0d0417..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_MainloopContainer.h +++ /dev/null @@ -1,115 +0,0 @@ -/** @file - @brief Header - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// *** WARNING: This file must only be included in a .cpp or .C file, not -// in a .h file, because it includes <vector>, and we can't have any standard -// library files in the VRPN headers because that will make VRPN incompatible -// with libraries that use the other flavor of <vector.h>. - -#pragma once - -// Internal Includes -#include "vrpn_MainloopObject.h" - -// Library/third-party includes -// - none - -// Standard includes -#include <vector> - -/// A container that holds and owns one or more VRPN objects, -class vrpn_MainloopContainer { -public: - /// Constructor - vrpn_MainloopContainer() {} - /// Destructor: invokes clear() - ~vrpn_MainloopContainer(); - - /// Clear internal structure holding objects, deleting them - /// in reverse order of their addition. - void clear(); - - /// Add an object wrapped by vrpn_MainloopObject. - /// Return NULL if the object has a problem (indicated by - /// broken()). - vrpn_MainloopObject *add(vrpn_MainloopObject *o); - - /// Template method to automatically wrap objects - /// with vrpn_MainloopObject before adding them. - /// Return NULL if there is a problem with the object add. - template <class T> T add(T o) - { - if (!add(vrpn_MainloopObject::wrap(o))) { - return NULL; - } - return o; - } - - /// Runs mainloop on all contained objects, in the order - /// that they were added. - void mainloop(); - -private: - std::vector<vrpn_MainloopObject *> _vrpn; -}; - -/* -- inline implementations -- */ - -inline vrpn_MainloopContainer::~vrpn_MainloopContainer() { clear(); } - -inline vrpn_MainloopObject *vrpn_MainloopContainer::add(vrpn_MainloopObject *o) -{ - // If the object is NULL, we have a problem and don't add it. - if (!o) { - return o; - } - - // If the object is broken(), this indicates a problem - // with the device. We also do not add it and we return NULL to show. - // that there is a problem. - if (o->broken()) { - fprintf( - stderr, - "vrpn_MainloopContainer::add() Device is broken, not adding.\n"); - return NULL; - } - - _vrpn.push_back(o); - return o; -} - -inline void vrpn_MainloopContainer::clear() -{ - if (_vrpn.empty()) { - return; - } - /// Delete in reverse order - for (int i = int(_vrpn.size()) - 1; i >= 0; --i) { - delete _vrpn[i]; - _vrpn[i] = NULL; - } - _vrpn.clear(); -} - -inline void vrpn_MainloopContainer::mainloop() -{ - const size_t n = _vrpn.size(); - for (size_t i = 0; i < n; ++i) { - _vrpn[i]->mainloop(); - } -} diff --git a/src/vrpn/vrpn_MainloopObject.h b/src/vrpn/vrpn_MainloopObject.h deleted file mode 100644 index 11e0af457b7c8b3f01b42225b8f55824134bda11..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_MainloopObject.h +++ /dev/null @@ -1,182 +0,0 @@ -/** @file - @brief Header - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef INCLUDED_vrpn_MainloopObject_h_GUID_38f638e4_40e0_4c6d_bebc_21c463794b88 -#define INCLUDED_vrpn_MainloopObject_h_GUID_38f638e4_40e0_4c6d_bebc_21c463794b88 - -// Internal Includes -#include "vrpn_Connection.h" - -// Library/third-party includes -// - none - -// Standard includes -#include <stdexcept> - -#ifdef VRPN_MAINLOOPOBJECT_VERBOSE -#include <iostream> -#define VRPN_MAINLOOPOBJECT_MSG(_x) \ - std::cout << __FILE__ << ":" << __LINE__ << ": " << _x << std::endl; -#else -#define VRPN_MAINLOOPOBJECT_MSG(_x) -#endif - -class VRPN_API vrpn_Connection; - -/// An interface for all VRPN objects that have a "mainloop" method. -/// Not instantiated directly: use vrpn_MainloopObject::wrap() to create one -class vrpn_MainloopObject { -public: - /// Exception thrown when trying to wrap a NULL pointer. - struct CannotWrapNullPointerIntoMainloopObject : public std::logic_error { - CannotWrapNullPointerIntoMainloopObject() - : std::logic_error( - "Cannot wrap a null pointer into a vrpn_MainloopObject!") - { - } - }; - - /// Destructor - virtual ~vrpn_MainloopObject() {} - - /// The mainloop function: the primary thing we look for in a VRPN object - virtual void mainloop() = 0; - - /// Checks the connectionPtr() for the VRPN object to make sure it is not - /// NULL. - virtual bool broken() = 0; - - /// Templated wrapping function - template <class T> static vrpn_MainloopObject *wrap(T o); - - /// Templated wrapping function that can encourage the - /// wrapper to not destroy the wrapped object at destruction - template <class T> static vrpn_MainloopObject *wrap(T o, bool owner); - -protected: - /// Internal function to return a typeless pointer of the contained - /// object, for comparison purposes. - virtual void *_returnContained() const = 0; - vrpn_MainloopObject() {} - friend bool operator==(vrpn_MainloopObject const &lhs, - vrpn_MainloopObject const &rhs); - friend bool operator!=(vrpn_MainloopObject const &lhs, - vrpn_MainloopObject const &rhs); -}; - -/// @name Comparison operators -/// @relates vrpn_MainloopObject -/// @{ -inline bool operator==(vrpn_MainloopObject const &lhs, - vrpn_MainloopObject const &rhs) -{ - return lhs._returnContained() == rhs._returnContained(); -} - -inline bool operator!=(vrpn_MainloopObject const &lhs, - vrpn_MainloopObject const &rhs) -{ - return lhs._returnContained() == rhs._returnContained(); -} -/// @} - -/// Namespace enclosing internal implementation details -namespace detail { - template <class T> class TypedMainloopObject; - - /// Template class for holding generic VRPN objects with - /// type information. - template <class T> - class TypedMainloopObject<T *> : public vrpn_MainloopObject { - public: - TypedMainloopObject(T *o, bool do_delete = true) - : _instance(o) - , _do_delete(do_delete) - { - if (!o) { - throw vrpn_MainloopObject:: - CannotWrapNullPointerIntoMainloopObject(); - } - VRPN_MAINLOOPOBJECT_MSG("Wrapping vrpn object " << o) - } - virtual ~TypedMainloopObject() - { - if (_do_delete) { - delete _instance; - VRPN_MAINLOOPOBJECT_MSG("Deleted contained vrpn object " - << _instance) - } - else { - VRPN_MAINLOOPOBJECT_MSG("NOT deleting contained vrpn object " - << _instance) - } - } - - virtual void mainloop() { _instance->mainloop(); } - - virtual bool broken() { return (_instance->connectionPtr() == NULL); } - - protected: - virtual void *_returnContained() const { return _instance; } - T *_instance; - bool _do_delete; - }; - - /// Specialization for connections, since they're reference-counted. - template <> - class TypedMainloopObject<vrpn_Connection *> : public vrpn_MainloopObject { - public: - TypedMainloopObject(vrpn_Connection *o) - : _instance(o) - { - if (!o) { - throw vrpn_MainloopObject:: - CannotWrapNullPointerIntoMainloopObject(); - } - VRPN_MAINLOOPOBJECT_MSG("Wrapping vrpn connection " << o) - } - virtual ~TypedMainloopObject() - { - VRPN_MAINLOOPOBJECT_MSG("Unreferencing contained vrpn connection " - << _instance) - _instance->removeReference(); - } - - virtual void mainloop() { _instance->mainloop(); } - - virtual bool broken() { return (!_instance->doing_okay()); } - - protected: - virtual void *_returnContained() const { return _instance; } - vrpn_Connection *_instance; - }; - -} // end of namespace detail - -template <class T> inline vrpn_MainloopObject *vrpn_MainloopObject::wrap(T o) -{ - return new detail::TypedMainloopObject<T>(o); -} - -template <class T> -inline vrpn_MainloopObject *vrpn_MainloopObject::wrap(T o, bool owner) -{ - return new detail::TypedMainloopObject<T>(o, owner); -} - -#endif // INCLUDED_vrpn_MainloopObject_h_GUID_38f638e4_40e0_4c6d_bebc_21c463794b88 diff --git a/src/vrpn/vrpn_MessageMacros.h b/src/vrpn/vrpn_MessageMacros.h deleted file mode 100644 index b5c3a78162550d1d7e9e433e6581392766cd86c9..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_MessageMacros.h +++ /dev/null @@ -1,53 +0,0 @@ -/** @file - @brief Header containing macros formerly duplicated in a lot of - implementation files. - - For use only in implementation files for vrpn devices. This is the "old way" - of doing things: just unified here to reduce code duplication. The - new way of simplifying message sending is in - vrpn_SendTextMessageStreamProxy.h. - - @date 2013 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2013. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef INCLUDED_vrpn_MessageMacros_h_GUID_289adc6a_78da_4d50_8166_4611d0d911e8 -#define INCLUDED_vrpn_MessageMacros_h_GUID_289adc6a_78da_4d50_8166_4611d0d911e8 - -#ifndef VRPN_TIMESTAMP_MEMBER -#define VRPN_TIMESTAMP_MEMBER timestamp -#endif - -#define VRPN_MSG_INFO(msg) \ - { \ - send_text_message(msg, VRPN_TIMESTAMP_MEMBER, vrpn_TEXT_NORMAL); \ - if (d_connection && d_connection->connected()) \ - d_connection->send_pending_reports(); \ - } - -#define VRPN_MSG_WARNING(msg) \ - { \ - send_text_message(msg, VRPN_TIMESTAMP_MEMBER, vrpn_TEXT_WARNING); \ - if (d_connection && d_connection->connected()) \ - d_connection->send_pending_reports(); \ - } - -#define VRPN_MSG_ERROR(msg) \ - { \ - send_text_message(msg, VRPN_TIMESTAMP_MEMBER, vrpn_TEXT_ERROR); \ - if (d_connection && d_connection->connected()) \ - d_connection->send_pending_reports(); \ - } - -#endif // INCLUDED_vrpn_MessageMacros_h_GUID_289adc6a_78da_4d50_8166_4611d0d911e8 diff --git a/src/vrpn/vrpn_Microsoft_Controller_Raw.C b/src/vrpn/vrpn_Microsoft_Controller_Raw.C deleted file mode 100644 index 4108dd1b3af714d21b01be90d62de8d52c9ae251..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Microsoft_Controller_Raw.C +++ /dev/null @@ -1,841 +0,0 @@ -// vrpn_Microsoft_Controller_Raw.C: VRPN driver for Microsoft Controller Raw devices - -#include <stdio.h> // for fprintf, stderr, NULL -#include <string.h> // for memset -#include <math.h> // for sqrt and fabs - -#include "vrpn_Microsoft_Controller_Raw.h" - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_HID) - -static const double POLL_INTERVAL = 1e+6 / 30.0; // If we have not heard, ask. - -#define MS_GAMEPAD_LEFT_THUMB_DEADZONE 7849 -#define MS_GAMEPAD_RIGHT_THUMB_DEADZONE 8689 -#define MS_GAMEPAD_TRIGGER_THRESHOLD 30 - -////////////////////////////////////////////////////////////////////////// -// helpers -////////////////////////////////////////////////////////////////////////// -static vrpn_float64 normalize_dpad(unsigned char up, unsigned char right, unsigned char down, unsigned char left) -{ - int x = 0; - int y = 0; - if (right) - { - x += 1; - } - if (left) - { - x -= 1; - } - if (up) - { - y += 1; - } - if (down) - { - y -= 1; - } - size_t index = ((x + 1) * 3) + (y + 1); - vrpn_float64 angles[] = {225, 270, 315, 180, -1, 0, 135, 90, 45}; - return (angles[index]); -} - -static void normalize_axis(const unsigned int value, const short deadzone, const vrpn_float64 scale, vrpn_float64& channel, int wordSize = 16) -{ - channel = (static_cast<float>(value) - (float) (1 << (wordSize - 1))); - if (fabs(channel) < (deadzone * 3 / 4)) - { - channel = 0.0f; - } - else - { - channel /= (float) (1 << (wordSize - 1)); - } - channel *= scale; - if (channel < -1.0) { channel = -1.0; } - if (channel > 1.0) { channel = 1.0; } -} - -static void normalize_axes(const unsigned int x, const unsigned int y, const short deadzone, const vrpn_float64 scale, vrpn_float64& channelX, vrpn_float64& channelY, int wordSize = 16) -{ -#ifdef FUTURE - // adapted from: http://msdn.microsoft.com/en-us/library/windows/desktop/ee417001%28v=vs.85%29.aspx - // determine how far the controller is pushed - float magnitude = (float) sqrt((double) ((x * x) + (y * y))); - - // determine the direction the controller is pushed - float normalizedX = ((magnitude > 0.0f) ? (x / magnitude) : 0.0f); - float normalizedY = ((magnitude > 0.0f) ? (y / magnitude) : 0.0f); - - float normalizedMagnitude = 0.0f; - - // check if the controller is outside a circular dead zone - if (magnitude > deadzone) - { - // clip the magnitude at its expected maximum value - if (magnitude > 32767) - { - magnitude = 32767; - } - - // adjust magnitude relative to the end of the dead zone - magnitude -= deadzone; - - // optionally normalize the magnitude with respect to its - // expected range giving a magnitude value of 0.0 to 1.0 - normalizedMagnitude = magnitude / (32767.0f - deadzone); - } - else - { // if the controller is in the deadzone zero out the magnitude - magnitude = 0.0f; - normalizedMagnitude = 0.0f; - } -#else - normalize_axis(x, deadzone, scale, channelX, wordSize); - normalize_axis(y, deadzone, scale, channelY, wordSize); -#endif // FUTURE -} - -static vrpn_float64 normalize_trigger(unsigned int trigger) -{ - // Filter out low-intensity signals - int value = trigger - 0x80; - return ((fabs(static_cast<double>(value)) < MS_GAMEPAD_TRIGGER_THRESHOLD) ? 0.0f : (value * 2.0f / 255.0f)); -} - -////////////////////////////////////////////////////////////////////////// -// Common base class -////////////////////////////////////////////////////////////////////////// -vrpn_Microsoft_Controller_Raw::vrpn_Microsoft_Controller_Raw(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c) - : _filter(filter) - , vrpn_HidInterface(filter) - , vrpn_BaseClass(name, c) -{ - init_hid(); -} - -vrpn_Microsoft_Controller_Raw::~vrpn_Microsoft_Controller_Raw(void) -{ - delete _filter; -} - -void vrpn_Microsoft_Controller_Raw::init_hid() { - // Get notifications when clients connect and disconnect - register_autodeleted_handler(d_connection->register_message_type(vrpn_dropped_last_connection), on_last_disconnect, this); - register_autodeleted_handler(d_connection->register_message_type(vrpn_got_connection), on_connect, this); -} - -void vrpn_Microsoft_Controller_Raw::on_data_received(size_t bytes, vrpn_uint8 *buffer) -{ - decodePacket(bytes, buffer); -} - -int vrpn_Microsoft_Controller_Raw::on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Microsoft_Controller_Raw *me = static_cast<vrpn_Microsoft_Controller_Raw *>(thisPtr); - return 0; -} - -int vrpn_Microsoft_Controller_Raw::on_connect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Microsoft_Controller_Raw *me = static_cast<vrpn_Microsoft_Controller_Raw *>(thisPtr); - return 0; -} - -////////////////////////////////////////////////////////////////////////// -// SideWinder Precision 2 Joystick -////////////////////////////////////////////////////////////////////////// -vrpn_Microsoft_SideWinder_Precision_2::vrpn_Microsoft_SideWinder_Precision_2(const char *name, vrpn_Connection *c) : - vrpn_Microsoft_Controller_Raw(_filter = new vrpn_HidProductAcceptor(MICROSOFT_VENDOR, SIDEWINDER_PRECISION_2), name, c), - vrpn_Button_Filter(name, c), vrpn_Analog(name, c), vrpn_Dial(name, c) -{ - vrpn_Analog::num_channel = 5; - vrpn_Dial::num_dials = 0; - vrpn_Button::num_buttons = 12; - - // Initialize the state of all the analogs, buttons, and dials - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); -} - -void vrpn_Microsoft_SideWinder_Precision_2::mainloop(void) -{ - update(); - server_mainloop(); - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, _timestamp) > POLL_INTERVAL) - { - _timestamp = current_time; - report_changes(); - - vrpn_Analog::server_mainloop(); - vrpn_Button::server_mainloop(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::server_mainloop(); - } - } -} - -void vrpn_Microsoft_SideWinder_Precision_2::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Microsoft_SideWinder_Precision_2::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Microsoft_SideWinder_Precision_2::decodePacket(size_t bytes, vrpn_uint8 *buffer) -{ - // SideWinder Precision 2 joystick - - // Decode all full reports, each of which is 40 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - /* - Byte : Bit 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 - [0]: X-axis (left=00, right=ff) - [1]: Y-axis (up=00, down=ff) - [2]: Z-rotate (left=00, right=ff) - [3]: Slider (up=00, down=ff) - [4]: buttons (bit flags: none=0x00, "1" (trigger)=0x01, "2"=0x02, "3"=0x04, ..., "8"=0x80 - [5]: POV Hat high nibble (none=0x80, N=0x00, NE=0x10, ... NW=0x80) - */ - // XXX Check to see that this works with HIDAPI, there may be two smaller reports. - if (bytes == 6) - { - normalize_axes(buffer[0], buffer[1], 0x08, 1.0f, channel[0], channel[1], 8); - normalize_axis(buffer[2], 0x08, 1.0f, channel[2], 8); - normalize_axis(buffer[3], 0x08, 1.0f, channel[3], 8); - - vrpn_uint8 value, mask; - value = buffer[4]; - for (int btn = 0; btn < 8; btn++) - { - mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[btn] = ((value & mask) != 0); - } - - // Point of View Hat - buttons[8] = buttons[9] = buttons[10] = buttons[11] = 0; - switch (buffer[5] >> 4) - { - case 0: // up - buttons[8] = true; - break; - case 1: - buttons[8] = buttons[9] = true; - break; - case 2: // right - buttons[9] = true; - break; - case 3: - buttons[9] = buttons[10] = true; - break; - case 4: // down - buttons[10] = true; - break; - case 5: - buttons[10] = buttons[11] = true; - break; - case 6: // left - buttons[11] = true; - break; - case 7: - buttons[11] = buttons[8] = true; - break; - case 8: - default: - // nothing to do - break; - } - channel[4] = normalize_dpad(buttons[8], buttons[9], buttons[10], buttons[11]); - } - else - { - fprintf(stderr, "vrpn_Microsoft_SideWinder_Precision_2: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - } -} - -////////////////////////////////////////////////////////////////////////// -// SideWinder Joystick -////////////////////////////////////////////////////////////////////////// -vrpn_Microsoft_SideWinder::vrpn_Microsoft_SideWinder(const char *name, vrpn_Connection *c) : - vrpn_Microsoft_Controller_Raw(_filter = new vrpn_HidProductAcceptor(MICROSOFT_VENDOR, SIDEWINDER), name, c), - vrpn_Button_Filter(name, c), vrpn_Analog(name, c), vrpn_Dial(name, c) -{ - vrpn_Analog::num_channel = 3; - vrpn_Dial::num_dials = 0; - vrpn_Button::num_buttons = 8; - - // Initialize the state of all the analogs, buttons, and dials - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); -} - -void vrpn_Microsoft_SideWinder::mainloop(void) -{ - update(); - server_mainloop(); - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, _timestamp) > POLL_INTERVAL) - { - _timestamp = current_time; - report_changes(); - - vrpn_Analog::server_mainloop(); - vrpn_Button::server_mainloop(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::server_mainloop(); - } - } -} - -void vrpn_Microsoft_SideWinder::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Microsoft_SideWinder::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Microsoft_SideWinder::decodePacket(size_t bytes, vrpn_uint8 *buffer) -{ - // SideWinder Precision 2 joystick - - // Decode all full reports, each of which is 40 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - /* - Byte : Bit 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 - [0]: X-axis (left=00, right=ff) - [1]: Y-axis (up=00, down=ff) - [2]: slider (up/fwd=00, down/back=ff) - [3]: buttons (bit flags: none=0x00, "1" (trigger)=0x01, "2"=0x02, "3"=0x04, ..., "8"=0x80) - */ - // XXX Check to see that this works with HIDAPI, there may be two smaller reports. - if (bytes == 4) - { - normalize_axes(buffer[0], buffer[1], 0x08, 1.0f, channel[0], channel[1], 8); - normalize_axis(buffer[2], 0x08, 1.0f, channel[2], 8); - - vrpn_uint8 value, mask; - value = buffer[3]; - for (int btn = 0; btn < 8; btn++) - { - mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[btn] = ((value & mask) != 0); - } - } - else - { - fprintf(stderr, "vrpn_Microsoft_SideWinder: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - } -} - -////////////////////////////////////////////////////////////////////////// -// Xbox S -////////////////////////////////////////////////////////////////////////// -vrpn_Microsoft_Controller_Raw_Xbox_S::vrpn_Microsoft_Controller_Raw_Xbox_S(const char *name, vrpn_Connection *c) - : vrpn_Microsoft_Controller_Raw(_filter = new vrpn_HidProductAcceptor(MICROSOFT_VENDOR, XBOX_S), name, c) - , vrpn_Button_Filter(name, c) - , vrpn_Analog(name, c) - , vrpn_Dial(name, c) -{ - vrpn_Analog::num_channel = 5; - vrpn_Dial::num_dials = 0; - vrpn_Button::num_buttons = 16; - - // Initialize the state of all the analogs, buttons, and dials - _lastDial = 0; - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); -} - -void vrpn_Microsoft_Controller_Raw_Xbox_S::mainloop() -{ - update(); - server_mainloop(); - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, _timestamp) > POLL_INTERVAL ) { - _timestamp = current_time; - report_changes(); - - vrpn_Analog::server_mainloop(); - vrpn_Button::server_mainloop(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::server_mainloop(); - } - } -} - -void vrpn_Microsoft_Controller_Raw_Xbox_S::report(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Microsoft_Controller_Raw_Xbox_S::report_changes(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Microsoft_Controller_Raw_Xbox_S::decodePacket(size_t bytes, vrpn_uint8 *buffer) { - // Xbox Controller S requires adapter to be made/purchased to connect USB to computer. - // Also, it may require a driver to be installed such as XBCD_Installer_0.2.7.exe (Windows). - - // Decode all full reports, each of which is 40 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - /* - Byte : Bit 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 - [0] : | Report ID | - [1] : |B8 |B7 |B6 |B5 |B4 |B3 |B2 |B1 | - [2] : |B16|B15|B14|B13|B12|B11|B10|B9 | - [3] : |B24|B23|B22|B21|B20|B19|B18|B17| <------- no such buttons exist and data does not change - [4-5] : | X Axis | - [6-7] : | Y Axis | - [8-9] : | Z Axis | - [10-11] : | RX Axis | - [12-13]: | RY Axis | - [14-15]: | RZ Axis | - [16-17]: | Slider Axis | - [18] : | EMPTY | POV | - [19] : | Current MapMatrix | - --- Original data from Xbox controller --- - [20] : | 0x00 | - [21] : | 0x14(Size of report) | - [22] : |RSp|LSp|Bk |St |Rgt|Lft|Dn |Up | <------- other buttons - [23] : | 0x00 | - [24] : | Button A | - [25] : | Button B | - [26] : | Button X | - [27] : | Button Y | - [28] : | Button Black | - [29] : | Button White | - [30] : | Left Trigger | - [31] : | Right Trigger | - [32-33]: | Left-Stick X | - [34-35]: | Left-Stick Y | - [36-37]: | Right-Stick X | - [38-39]: | Right-Stick Y | - */ - // XXX Check to see that this works with HIDAPI, there may be two smaller reports. - if (bytes == 40) { - if (buffer[0] == 1) { - - // Report joystick axes as analogs - vrpn_uint16 x, y; - vrpn_uint8 *bufptr; -#ifdef OLD_DATA - // left joy left/right: Left 27, center (normal) 81 (calc 7e), right D5 - bufptr = &buffer[32]; - x = vrpn_unbuffer<vrpn_int16>(bufptr); - // left joy up/down: Up 34, center (normal) 81 (calc 81), down CF - bufptr = &buffer[34]; - y = vrpn_unbuffer<vrpn_int16>(bufptr); - normalize_axes(x, y, MS_GAMEPAD_LEFT_THUMB_DEADZONE, 1.0f, channel[0], channel[1]); - // right joy up/down: Up 32, (center calc 7f), down CC - bufptr = &buffer[36]; - x = vrpn_unbuffer<vrpn_int16>(bufptr); - // right joy left/right: Left 2B, center (normal) 82 (calc 84), right DC - bufptr = &buffer[38]; - y = vrpn_unbuffer<vrpn_int16>(bufptr); - normalize_axes(x, y, MS_GAMEPAD_RIGHT_THUMB_DEADZONE, 1.0f, channel[2], channel[3]); -#else - vrpn_int16 temp; - bufptr = &buffer[4]; - temp = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr) / 2; - x = temp + (1 << 15); - x *= 2; - bufptr = &buffer[6]; - temp = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr) / 2; - y = temp + (1 << 15); - y *= 2; - normalize_axes(x, y, MS_GAMEPAD_LEFT_THUMB_DEADZONE, 1.0f, channel[0], channel[1]); - bufptr = &buffer[10]; - temp = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr) / 2; - x = temp + (1 << 15); - bufptr = &buffer[12]; - temp = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr) / 2; - y = temp + (1 << 15); - normalize_axes(x, y, MS_GAMEPAD_LEFT_THUMB_DEADZONE, 2.0f, channel[2], channel[3]); -#endif // OLD_DATA - -#ifdef OLD_DATA - // button #0: 24 A - buttons[0] = (buffer[24] != 0); - // button #1: 25 B - buttons[1] = (buffer[25] != 0); - // button #2: 26 X - buttons[2] = (buffer[26] != 0); - // button #3: 27 Y - buttons[3] = (buffer[27] != 0); - // button #4: 28 Black - buttons[4] = (buffer[28] != 0); - // button #5: 29 White - buttons[5] = (buffer[29] != 0); - // button #6: 40 Start - buttons[6] = ((buffer[22] & 0x10) != 0); - // button #7: 80 Back - buttons[7] = ((buffer[22] & 0x20) != 0); - // button #8: left joy - buttons[8] = ((buffer[22] & 0x40) != 0); - // button #9: right joy - buttons[9] = ((buffer[22] & 0x80) != 0); - // button #10:30 left trigger - buttons[10] = (buffer[30] != 0); - // button #11:31 right trigger - buttons[11] = (buffer[31] != 0); -#else - vrpn_uint8 value, mask; - value = buffer[1]; - for (int btn = 0; btn < 8; btn++) - { - mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[btn] = ((value & mask) != 0); - } - value = buffer[2]; - for (int btn = 0; btn < 4; btn++) - { - mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[8 + btn] = ((value & mask) != 0); - } -#endif // OLD_DATA - - // Point of View Hat -#ifdef OLD_DATA - buttons[12] = ((buffer[22] & 0x01) != 0); // Up - buttons[14] = ((buffer[22] & 0x02) != 0); // Down - buttons[15] = ((buffer[22] & 0x04) != 0); // Left - buttons[13] = ((buffer[22] & 0x08) != 0); // Right -#else - // Point of View Hat - buttons[12] = buttons[13] = buttons[14] = buttons[15] = 0; - switch (buffer[18] & 0x0f) - { - case 0: // up - buttons[12] = true; - break; - case 1: - buttons[12] = buttons[13] = true; - break; - case 2: // right - buttons[13] = true; - break; - case 3: - buttons[13] = buttons[14] = true; - break; - case 4: // down - buttons[14] = true; - break; - case 5: - buttons[14] = buttons[15] = true; - break; - case 6: // left - buttons[15] = true; - break; - case 7: - buttons[15] = buttons[12] = true; - break; - case 8: - default: - // nothing to do - break; - } -#endif // OLD_DATA - channel[4] = normalize_dpad(buttons[12], buttons[13], buttons[14], buttons[15]); - } else { - fprintf(stderr, "vrpn_Microsoft_Controller_Raw_Xbox_S: Unknown report = %u\n", static_cast<unsigned>(buffer[0])); - } - } else { - fprintf(stderr, "vrpn_Microsoft_Controller_Raw_Xbox_S: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - } -} - -////////////////////////////////////////////////////////////////////////// -// Xbox 360 -////////////////////////////////////////////////////////////////////////// -vrpn_Microsoft_Controller_Raw_Xbox_360::vrpn_Microsoft_Controller_Raw_Xbox_360(const char *name, vrpn_Connection *c, vrpn_uint16 vendorId /*=MICROSOFT_VENDOR*/, vrpn_uint16 productId /*=XBOX_360*/) -: vrpn_Microsoft_Controller_Raw(_filter = new vrpn_HidProductAcceptor(vendorId, productId), name, c) -, vrpn_Button_Filter(name, c) -, vrpn_Analog(name, c) -, vrpn_Dial(name, c) -{ - vrpn_Analog::num_channel = 6; - vrpn_Dial::num_dials = 0; - vrpn_Button::num_buttons = 18; - - // Initialize the state of all the analogs, buttons, and dials - _lastDial = 0; - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); -} - -void vrpn_Microsoft_Controller_Raw_Xbox_360::mainloop() -{ - update(); - server_mainloop(); - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, _timestamp) > POLL_INTERVAL ) { - _timestamp = current_time; - report_changes(); - - vrpn_Analog::server_mainloop(); - vrpn_Button::server_mainloop(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::server_mainloop(); - } - } -} - -void vrpn_Microsoft_Controller_Raw_Xbox_360::report(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Microsoft_Controller_Raw_Xbox_360::report_changes(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Microsoft_Controller_Raw_Xbox_360::decodePacket(size_t bytes, vrpn_uint8 *buffer) { - // Decode all full reports, each of which is 14 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - /* - 0: left-X - 1: " - 2: left-Y - 3: " - 4: right-X - 5: " - 6: right-Y - 7: " - 8: 00/80: not sure with left & right triggers - 9: 80 normal, ...ff=left trigger, ...00=right trigger - 10: Button bit flags: 01=A, ..., 80=start - 11: Button bit flags: 01=left joy, 02=right joy, 04=hat up add 04 every 45 degrees right - 12: varies with everything - 13: " - ??: not sure where Xbox button is - */ - // XXX Check to see that this works with HIDAPI, there may be two smaller reports. - if (bytes == 14) { - if (true) { - vrpn_uint8 *bufptr; - - // Report joystick axes as analogs - // left joy left/right - vrpn_uint16 x, y; - bufptr = &buffer[0]; - x = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr); - // left joy up/down - bufptr = &buffer[2]; - y = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr); - normalize_axes(x, y, MS_GAMEPAD_LEFT_THUMB_DEADZONE, 1.0f, channel[0], channel[1]); - // right joy left/right - bufptr = &buffer[4]; - x = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr); - // right joy up/down - bufptr = &buffer[6]; - y = vrpn_unbuffer_from_little_endian<vrpn_int16>(bufptr); - normalize_axes(x, y, MS_GAMEPAD_RIGHT_THUMB_DEADZONE, 1.0f, channel[2], channel[3]); - - // triggers: left goes positive, right goes negative - channel[4] = normalize_trigger(buffer[9]); - - vrpn_uint8 value; - value = buffer[10]; - for (int btn = 0; btn < 8; btn++) { - /* - 1: A - 2: B - 3: X - 4: Y - 5: left bump - 6: right bump - 7: back - 8: start - */ - vrpn_uint8 mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[btn] = ((value & mask) != 0); - } - value = buffer[11]; - for (int btn = 0; btn < 2; btn++) { - /* - 9: left joy - 10: right joy - */ - vrpn_uint8 mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[8 + btn] = ((value & mask) != 0); - } - value &= 0x3c; // remove joystick buttons and isolate just the "Point of View Hat" - value >>= 2; - /* - 11: 04 (>>2=1, >>3=0) hat up (0) - 08 (>>2=2, >>3=1) up-right (45) - 12: 0c (>>2=3, >>3=1) hat right (90) - 10 (>>2=4, >>3=2) right-down (135) - 13: 14 (>>2=5, >>3=2) hat down (180) - 18 (>>2=6, >>3=3) down-left (225) - 14: 1c (>>2=7, >>3=3) hat left (270) - 20 (>>2=8, >>3=4) left-up (315) - */ - buttons[10] = buttons[11] = buttons[12] = buttons[13] = false; - if (value != 0) - { - int lowerBtn = (10 + (value >> 3)) & 0x03; - switch (value) - { - case 1: - buttons[10] = true; - break; - case 2: - buttons[10] = buttons[11] = true; - break; - case 3: - buttons[11] = true; - break; - case 4: - buttons[11] = buttons[12] = true; - break; - case 5: - buttons[12] = true; - break; - case 6: - buttons[12] = buttons[13] = true; - break; - case 7: - buttons[13] = true; - break; - case 8: - buttons[13] = buttons[10] = true; - break; - } - } - channel[5] = normalize_dpad(buttons[10], buttons[11], buttons[12], buttons[13]); - } else { - fprintf(stderr, "vrpn_Microsoft_Controller_Raw_Xbox_360: Unknown report = %u\n", static_cast<unsigned>(buffer[0])); - } - } else { - fprintf(stderr, "vrpn_Microsoft_Controller_Raw_Xbox_360: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - } -} - -// End of VRPN_USE_HID -#endif diff --git a/src/vrpn/vrpn_Microsoft_Controller_Raw.h b/src/vrpn/vrpn_Microsoft_Controller_Raw.h deleted file mode 100644 index 0f9444e677aa770f5ce82a66ada11b4b52d47f18..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Microsoft_Controller_Raw.h +++ /dev/null @@ -1,145 +0,0 @@ -#pragma once - -#include <stddef.h> // for size_t - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_BaseClass.h" // for vrpn_BaseClass -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_USE_HID -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Dial.h" // for vrpn_Dial -#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint8, vrpn_uint32 - -#if defined(VRPN_USE_HID) - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 MICROSOFT_VENDOR = 0x045e; -static const vrpn_uint16 SIDEWINDER_PRECISION_2 = 0x0038; -static const vrpn_uint16 SIDEWINDER = 0x003c; -static const vrpn_uint16 XBOX_S = 0x0289; -static const vrpn_uint16 XBOX_360 = 0x028e; -//static const vrpn_uint16 XBOX_360_WIRELESS = 0x028f; // does not seem to be an HID-compliant device - -// and generic controllers that act the same as the above -static const vrpn_uint16 AFTERGLOW_VENDOR = 0x0e6f; -static const vrpn_uint16 AX1_FOR_XBOX_360 = 0x0213; - -// Device drivers for the Microsoft Controller Raw USB line of products -// Currently supported: Xbox Controller S, Xbox 360 Controller -// -// Exposes three major VRPN device classes: Button, Analog, Dial (as appropriate). -// All models expose Buttons for the keys on the device. -// Button 0 is the programming switch; it is set if the switch is in the "red" position. -// - -class vrpn_Microsoft_Controller_Raw : public vrpn_BaseClass, protected vrpn_HidInterface -{ -public: - vrpn_Microsoft_Controller_Raw(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Microsoft_Controller_Raw(void); - - virtual void mainloop(void) = 0; -protected: - // Set up message handlers, etc. - void init_hid(void); - void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - static int VRPN_CALLBACK on_connect(void *thisPtr, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM p); - - virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer) = 0; - struct timeval _timestamp; - vrpn_HidAcceptor *_filter; - - // No actual types to register, derived classes will be buttons, analogs, and/or dials - int register_types(void) { return (0); } -}; - -class vrpn_Microsoft_SideWinder_Precision_2: protected vrpn_Microsoft_Controller_Raw, public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Dial -{ -public: - vrpn_Microsoft_SideWinder_Precision_2(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Microsoft_SideWinder_Precision_2(void) {}; - - virtual void mainloop(void); -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); -}; - -class vrpn_Microsoft_SideWinder: protected vrpn_Microsoft_Controller_Raw, public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Dial -{ -public: - vrpn_Microsoft_SideWinder(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Microsoft_SideWinder(void) {}; - - virtual void mainloop(void); -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); -}; - -class vrpn_Microsoft_Controller_Raw_Xbox_S : protected vrpn_Microsoft_Controller_Raw, public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Dial -{ -public: - vrpn_Microsoft_Controller_Raw_Xbox_S(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Microsoft_Controller_Raw_Xbox_S(void) {}; - - virtual void mainloop(void); -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); - - // Previous dial value, used to determine delta to send when it changes. - vrpn_uint8 _lastDial; -}; - -class vrpn_Microsoft_Controller_Raw_Xbox_360: protected vrpn_Microsoft_Controller_Raw, public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Dial -{ -public: - vrpn_Microsoft_Controller_Raw_Xbox_360(const char *name, vrpn_Connection *c = 0, vrpn_uint16 vendorId = MICROSOFT_VENDOR, vrpn_uint16 productId = XBOX_360); - virtual ~vrpn_Microsoft_Controller_Raw_Xbox_360(void) {}; - - virtual void mainloop(void); -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); - - // Previous dial value, used to determine delta to send when it changes. - vrpn_uint8 _lastDial; -}; - -// Generic Xbox 360, same as actual Xbox 360, but other IDs -class vrpn_Afterglow_Ax1_For_Xbox_360 : public vrpn_Microsoft_Controller_Raw_Xbox_360 -{ -public: - vrpn_Afterglow_Ax1_For_Xbox_360(const char *name, vrpn_Connection *c) : vrpn_Microsoft_Controller_Raw_Xbox_360(name, c, AFTERGLOW_VENDOR, AX1_FOR_XBOX_360) {}; - virtual ~vrpn_Afterglow_Ax1_For_Xbox_360(void) {}; -}; - -// end of VRPN_USE_HID -#else -class VRPN_API vrpn_Microsoft_Controller_Raw_Xbox_S; -class VRPN_API vrpn_Microsoft_Controller_Raw_Xbox_360; -class VRPN_API vrpn_Afterglow_Ax1_For_Xbox_360; -class VRPN_API vrpn_Microsoft_SideWinder_Precision_2; -class VRPN_API vrpn_Microsoft_SideWinder; -#endif diff --git a/src/vrpn/vrpn_Mouse.C b/src/vrpn/vrpn_Mouse.C deleted file mode 100644 index 67b2b52129775bbd89c35f7251d512214069de91..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Mouse.C +++ /dev/null @@ -1,340 +0,0 @@ -/* file: vrpn_Mouse.cpp - * author: Mike Weiblen mew@mew.cx 2004-01-14 - * copyright: (C) 2003,2004 Michael Weiblen - * license: Released to the Public Domain. - * depends: gpm 1.19.6, VRPN 06_04 - * tested on: Linux w/ gcc 2.95.4 - * references: http://mew.cx/ http://vrpn.org/ - * http://linux.schottelius.org/gpm/ -*/ - -#include <stdio.h> // for NULL, fprintf, printf, etc -#include <string.h> // for strncpy - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR -#include "vrpn_Mouse.h" -#include "vrpn_Serial.h" // for vrpn_open_commport, etc - -#if defined(linux) && defined(VRPN_USE_GPM_MOUSE) -#include <gpm.h> // for Gpm_Event, Gpm_Connect, etc -#endif - - -#if !( defined(_WIN32) && defined(VRPN_USE_WINSOCK_SOCKETS) ) -# include <sys/select.h> // for select, FD_ISSET, FD_SET, etc -#endif - -#ifdef _WIN32 -#include <windows.h> - -#pragma comment (lib, "user32.lib") - -// Fix sent in by Andrei State to make this compile under Visual Studio 6.0. -// If you need this, you also have to copy multimon.h from the DirectX or -// another Windows SDK into a place where the compiler can find it. -#ifndef SM_XVIRTUALSCREEN -#define COMPILE_MULTIMON_STUBS -#include "multimon.h" -#endif - -#endif - -/////////////////////////////////////////////////////////////////////////// - -vrpn_Mouse::vrpn_Mouse( const char* name, vrpn_Connection * cxn ) : - vrpn_Analog( name, cxn ), - vrpn_Button_Filter( name, cxn ) -{ - int i; - - // initialize the vrpn_Analog - vrpn_Analog::num_channel = 2; - for( i = 0; i < vrpn_Analog::num_channel; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } - - // initialize the vrpn_Button_Filter - vrpn_Button_Filter::num_buttons = 3; - for( i = 0; i < vrpn_Button_Filter::num_buttons; i++) { - vrpn_Button_Filter::buttons[i] = vrpn_Button_Filter::lastbuttons[i] = 0; - } - -#if defined(linux) && defined(VRPN_USE_GPM_MOUSE) - // attempt to connect to the GPM server - gpm_zerobased = 1; - gpm_visiblepointer = 1; - - Gpm_Connect gc; - gc.eventMask = ~0; - gc.defaultMask = GPM_MOVE | GPM_HARD; - gc.maxMod = 0; - gc.minMod = 0; - - if( Gpm_Open( &gc, 0 ) < 0 ) - { - // either GPM server is not running, or we're trying to run - // on an xterm. - throw GpmOpenFailure(); - } - - set_alerts( 1 ); -#elif defined(_WIN32) - // Nothing needs to be opened under Windows; we just make direct - // calls below to find the values. -#else - fprintf(stderr,"vrpn_Mouse::vrpn_Mouse() Not implement on this architecture\n"); -#endif -} - -/////////////////////////////////////////////////////////////////////////// - -vrpn_Mouse::~vrpn_Mouse() -{ -#if defined(linux) && defined(VRPN_USE_GPM_MOUSE) - Gpm_Close(); -#endif -} - -/////////////////////////////////////////////////////////////////////////// - -void vrpn_Mouse::mainloop() -{ - get_report(); - server_mainloop(); -} - -/////////////////////////////////////////////////////////////////////////// - -int vrpn_Mouse::get_report() -{ -#if defined(linux) && defined(VRPN_USE_GPM_MOUSE) - fd_set readset; - - FD_ZERO( &readset ); - FD_SET( gpm_fd, &readset ); - struct timeval timeout = { 0, 0 }; - select( gpm_fd+1, &readset, NULL, NULL, &timeout ); - if( ! FD_ISSET( gpm_fd, &readset ) ) - return 0; - - Gpm_Event evt; - if( Gpm_GetEvent( &evt ) <= 0 ) - return 0; - - if( evt.type & GPM_UP ) - { - if( evt.buttons & GPM_B_LEFT ) buttons[0] = 0; - if( evt.buttons & GPM_B_MIDDLE ) buttons[1] = 0; - if( evt.buttons & GPM_B_RIGHT ) buttons[2] = 0; - } - else - { - buttons[0] = (evt.buttons & GPM_B_LEFT) ? 1 : 0; - buttons[1] = (evt.buttons & GPM_B_MIDDLE) ? 1 : 0; - buttons[2] = (evt.buttons & GPM_B_RIGHT) ? 1 : 0; - } - - channel[0] = (vrpn_float64) evt.dx / gpm_mx; - channel[1] = (vrpn_float64) evt.dy / gpm_my; - return 1; -#elif defined(_WIN32) - const unsigned LEFT_MOUSE_BUTTON = 0x01; - const unsigned RIGHT_MOUSE_BUTTON = 0x02; - const unsigned MIDDLE_MOUSE_BUTTON = 0x04; - - // Find out if the mouse buttons are pressed. - if (0x80000 & GetKeyState(LEFT_MOUSE_BUTTON)) { - vrpn_Button::buttons[0] = 1; - } else { - vrpn_Button::buttons[0] = 0; - } - if (0x80000 & GetKeyState(MIDDLE_MOUSE_BUTTON)) { - vrpn_Button::buttons[1] = 1; - } else { - vrpn_Button::buttons[1] = 0; - } - if (0x80000 & GetKeyState(RIGHT_MOUSE_BUTTON)) { - vrpn_Button::buttons[2] = 1; - } else { - vrpn_Button::buttons[2] = 0; - } - - // Find the position of the cursor in X,Y with range 0..1 across the screen - POINT curPos; - GetCursorPos(&curPos); - vrpn_Analog::channel[0] = (vrpn_float64)(curPos.x - GetSystemMetrics(SM_XVIRTUALSCREEN)) / GetSystemMetrics(SM_CXVIRTUALSCREEN); - vrpn_Analog::channel[1] = (vrpn_float64)(curPos.y - GetSystemMetrics(SM_YVIRTUALSCREEN)) / GetSystemMetrics(SM_CYVIRTUALSCREEN); - - vrpn_gettimeofday( ×tamp, NULL ); - report_changes(); - return 1; -#else - return 0; -#endif -} - -/////////////////////////////////////////////////////////////////////////// - -void vrpn_Mouse::report_changes( vrpn_uint32 class_of_service ) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button_Filter::timestamp = timestamp; - - vrpn_Analog::report_changes( class_of_service ); - vrpn_Button_Filter::report_changes(); -} - -/////////////////////////////////////////////////////////////////////////// - -void vrpn_Mouse::report( vrpn_uint32 class_of_service ) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button_Filter::timestamp = timestamp; - - vrpn_Analog::report( class_of_service ); - vrpn_Button_Filter::report_changes(); -} - -/////////////////////////////////////////////////////////////////////////// -#define BUTTON_READY (1) -#define BUTTON_FAIL (-1) - -// (RDK) serial mouse wired up as button device -vrpn_Button_SerialMouse::vrpn_Button_SerialMouse(const char *name,vrpn_Connection *c, - const char *port, int baud, vrpn_MOUSETYPE type) - : vrpn_Button_Filter(name, c) -{ - status = BUTTON_FAIL; - bool printed_error = false; - // Find out the port name and baud rate; - if (port == NULL) { - fprintf(stderr,"vrpn_Button_SerialMouse: NULL port name\n"); - return; - } else { - strncpy(portname, port, sizeof(portname)); - portname[sizeof(portname)-1] = '\0'; - } - num_buttons = 3; - baudrate = baud; - - // Open the serial port we are going to use - if ( (serial_fd=vrpn_open_commport(portname, baudrate)) == -1) { - fprintf(stderr,"vrpn_Button_SerialMouse: Cannot open serial port\n"); - return; - } - - for (vrpn_int32 i = 0; i < num_buttons; i++) { - buttons[i] = lastbuttons[i] = 0; - buttonstate[i] = vrpn_BUTTON_MOMENTARY; - } - - mousetype = type; - lastL = lastR = 0; - // first time in read(), this will get set to 0 - lastM = (mousetype == THREEBUTTON_EMULATION)?1:0; - - // Say we are ready and find out what time it is - status = BUTTON_READY; - vrpn_gettimeofday(×tamp, NULL); -} - -void vrpn_Button_SerialMouse::mainloop() -{ - // Call the generic server mainloop, since we are a server - server_mainloop(); - - switch (status) { - case BUTTON_READY: - read(); - report_changes(); - break; - case BUTTON_FAIL: - { - if (!printed_error) break; - printed_error = 0; - send_text_message("vrpn_Button_SerialMouse failure!", timestamp, vrpn_TEXT_ERROR); - } - break; - } -} - -// Fill in the buttons[] array with the current value of each of the -// buttons For a description of the protocols for a Microsoft 3button -// mouse and a MouseSystems mouse, see http://www.hut.fi/~then/mytexts/mouse.html -void vrpn_Button_SerialMouse::read(void) -{ - // Make sure we're ready to read - if (status != BUTTON_READY) { - return; - } - - unsigned char buffer; - - // process as long as we can get characters - int num = 1; - int debounce = 0; - while (num) - { - num = vrpn_read_available_characters(serial_fd, &buffer, 1); - - if (num <= 0) { - if (debounce) { -#ifdef VERBOSE - fprintf (stderr,"state: %d %d %d last: %d %d %d\n", - buttons[0],buttons[1],buttons[2], - lastL, lastM, lastR); -#endif - lastL = buttons[0]; - lastM = buttons[1]; - lastR = buttons[2]; - } - return; // nothing there or error, so return - } - - switch (mousetype) { - case THREEBUTTON_EMULATION: - // a mouse capable of 3 button emulation - // this mouse encodes its buttons in a byte that is one of - // 0xc0 0xd0 0xe0 0xf0. - - // Throw away all bytes that are not one of C0, D0, E0 or F0. - if ( (buffer != 0xc0) && (buffer != 0xd0) && - (buffer != 0xe0) && (buffer != 0xf0) ) { - continue; - } - - buttons[0] = (unsigned char)( (buffer & 0x20)?1:0 ); - buttons[2] = (unsigned char)( (buffer & 0x10)?1:0 ); - // middle button check:: we get here without a change in left or right - // This means that we toggle the middle button by moving the mouse - // around while not pressing or releasing the other buttons! - if ((buttons[0] == lastL) && (buttons[2] == lastR) && !debounce) { - buttons[1] = (unsigned char)( lastM?0:1 ); - } - debounce = 1; - break; - - case MOUSESYSTEMS: - - // mousesystems (real PC 3 button mouse) protocol - // The pc three button mouse encodes its buttons in a byte - // that looks like 1 0 0 0 0 lb mb rb - - if ((buffer & 0xf8) != 0x80) { // Ignore all bytes but first in record - continue; - } - debounce = 1; - buttons[0] = (unsigned char)( (buffer & 4)?0:1 ); - buttons[1] = (unsigned char)( (buffer & 2)?0:1 ); - buttons[2] = (unsigned char)( (buffer & 1)?0:1 ); - break; - - default: - printf("vrpn_Button_SerialMouse::read(): Unknown mouse type\n"); - break; - } // switch - } // while (num) -} - - -/*EOF*/ diff --git a/src/vrpn/vrpn_Mouse.h b/src/vrpn/vrpn_Mouse.h deleted file mode 100644 index e7271a42d9cf3cd82f03dda7265109868aee9d9f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Mouse.h +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef VRPN_MOUSE_H -#define VRPN_MOUSE_H - -/////////////////////////////////////////////////////////////////////////// -// This file contains a distillation of the various Mouse classes that had -// been spread throughout VRPN. The interfaces have been rationalized, so -// that they are the same between operating systems and are factored into -// independent interfaces. -/////////////////////////////////////////////////////////////////////////// - -/* file: vrpn_Mouse.h - * author: Mike Weiblen mew@mew.cx 2004-01-14 - * copyright: (C) 2003,2004 Michael Weiblen - * license: Released to the Public Domain. - * depends: gpm 1.19.6, VRPN 06_04 - * tested on: Linux w/ gcc 2.95.4 - * references: http://mew.cx/ http://vrpn.org/ - * http://linux.schottelius.org/gpm/ -*/ - -/////////////////////////////////////////////////////////////////////////// -// vrpn_Mouse is a VRPN server class to publish events from the PC's mouse. -// It provides a 2-channel vrpn_Analog for X & Y mouse motion, and a -// 3-channel vrpn_Button for the mouse buttons. -// -// vrpn_Mouse makes it easy to use the diverse array of commodity input -// devices that masquerade as a mouse, such as PS/2 trackballs, gyroscopic -// free-space pointers, and force-sensing touchpads. -// -// This version includes a Linux-specific implementation that leverages the Linux GPM -// (General Purpose Mouse) server to handle the low-level hardware interfaces -// and device protocols. GPM is commonly included in Linux distributions. -// The GPM homepage is http://linux.schottelius.org/gpm/ -// -// It also includes a Windows interface to the mouse. -// -// The interface reports mouse position in fraction of the screen. -// The previous version of the Windows implementation had reported them -// in pixels, but this has been changed to match on both platforms. -// -// vrpn_Mouse must be run on a Linux console, not an xterm. Rationale: -// 1) Since the console environment doesn't presume the existence of a mouse, -// it avoids issues about mapping mouse events to window focus, etc. -// 2) With the mouse movement controlled by a different user, it's really -// not possible to also use a mouse-based user interface anyway. -// 3) My VRPN server machine is headless, and doesn't even have an X server. -/////////////////////////////////////////////////////////////////////////// - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32 - -class VRPN_API vrpn_Mouse : - public vrpn_Analog, - public vrpn_Button_Filter -{ -public: - vrpn_Mouse( const char* name, vrpn_Connection* cxn ); - virtual ~vrpn_Mouse(); - - virtual void mainloop(); - - class GpmOpenFailure {}; // thrown when can't open GPM server - -protected: // methods - /// Try to read reports from the device. - /// Returns 1 if msg received, or 0 if none received. - virtual int get_report(); - - /// send report iff changed - virtual void report_changes( vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY ); - - /// send report whether or not changed - virtual void report( vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY ); - -protected: // data - struct timeval timestamp; ///< time of last report from device - -private: // disable unwanted default methods - vrpn_Mouse(); - vrpn_Mouse(const vrpn_Mouse&); - const vrpn_Mouse& operator=(const vrpn_Mouse&); -}; - -/////////////////////////////////////////////////////////////////////////// -// (RDK) Button device that is connected to a serial port. This is a -// raw driver that can be used with any of the serial-enabled architectures, -// and does not go through the mouse driver -- it talks to the mouse -// directly as a serial device. This enables the user to use a mouse, or -// a rewired serial mouse, as a simple button device. - -enum vrpn_MOUSETYPE {MOUSESYSTEMS, THREEBUTTON_EMULATION, MAX_MOUSE_TYPES}; - -class VRPN_API vrpn_Button_SerialMouse: public vrpn_Button_Filter { -public: - // Open a serial mouse button device connected to the local machine - - vrpn_Button_SerialMouse(const char *name, vrpn_Connection *connection, - const char *port, int baud, vrpn_MOUSETYPE type); - - virtual void mainloop(void); - -protected: - char portname[512]; - int baudrate; - int serial_fd; - int status; - int lastL, lastM, lastR; //used in 3 button emulator - vrpn_MOUSETYPE mousetype; - bool printed_error; - - void read(void); -}; - -#endif diff --git a/src/vrpn/vrpn_Mutex.C b/src/vrpn/vrpn_Mutex.C deleted file mode 100644 index 352bee2db4fc445001537957c5300cf5a1f8164d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Mutex.C +++ /dev/null @@ -1,1407 +0,0 @@ -#include <stdio.h> // for fprintf, stderr, sprintf -#include <string.h> // for NULL, memcpy, strlen, etc - -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_Mutex.h" -#include "vrpn_Shared.h" // for vrpn_buffer, vrpn_unbuffer, etc - -#ifndef VRPN_USE_WINSOCK_SOCKETS -#include <arpa/inet.h> // for inet_addr -#include <netdb.h> // for gethostbyname, hostent, etc -//#include <sys/socket.h> -#include <netinet/in.h> // for in_addr, ntohl, INADDR_NONE -#include <unistd.h> // for getpid, gethostname -#endif - -#ifdef _WIN32 -#include <process.h> // for _getpid() -#endif - -#ifdef sparc -#define INADDR_NONE -1 -#endif - -/* - - Server State diagram: - - handle_release() - +-------------------------+ - | | - v | - handle_request() - FREE ------------------> HELD - - Peer State diagram: - - release() - +--------------------------------------------+ - | | - v | - request() - AVAILABLE --------------> REQUESTING ----> OURS - - | ^ | - v | | - | - HELD_REMOTELY <---------------+ - -*/ - -//#define VERBOSE - -// static const char * myID = "vrpn_Mutex"; -static const char *requestIndex_type = "vrpn_Mutex Request Index"; -static const char *requestMutex_type = "vrpn_Mutex Request Mutex"; -static const char *release_type = "vrpn_Mutex Release"; -static const char *releaseNotification_type = "vrpn_Mutex Release_Notification"; -static const char *grantRequest_type = "vrpn_Mutex Grant_Request"; -static const char *denyRequest_type = "vrpn_Mutex Deny_Request"; -// static const char * losePeer_type = "vrpn_Mutex Lose_Peer"; -static const char *initialize_type = "vrpn_Mutex Initialize"; - -struct losePeerData { - vrpn_Connection *connection; - vrpn_PeerMutex *mutex; -}; - -// Mostly copied from vrpn_Connection.C's vrpn_getmyIP() and some man pages. -// Should return in host order. -// Returns 0 on error. -static vrpn_uint32 getmyIP(const char *NICaddress = NULL) -{ - struct hostent *host; - char myname[100]; - in_addr in; - int retval; - - if (NICaddress) { - // First, see if NIC is specified as IP address. - // inet_addr() comes back in network order - in.s_addr = inet_addr(NICaddress); - if (in.s_addr != INADDR_NONE) { - return ntohl(in.s_addr); - } - // Second, try a name. - // gethostbyname() comes back in network order - host = gethostbyname(NICaddress); - if (host) { - memcpy(&in.s_addr, host->h_addr, host->h_length); - return ntohl(in.s_addr); - } - - fprintf(stderr, "getmyIP: Can't get host entry for %s.\n", NICaddress); - return 0; - } - - retval = gethostname(myname, sizeof(myname)); - if (retval) { - fprintf(stderr, "getmyIP: Couldn't determine local hostname.\n"); - return 0; - } - - // gethostname() is guaranteed to produce something gethostbyname() can - // parse. - // gethostbyname() comes back in network order - host = gethostbyname(myname); - if (!host) { - fprintf(stderr, "getmyIP: Couldn't find host by name (%s).\n", myname); - return 0; - } - - memcpy(&in.s_addr, host->h_addr, host->h_length); - return ntohl(in.s_addr); -} - -vrpn_Mutex::vrpn_Mutex(const char *name, vrpn_Connection *c) - : d_connection(c) -{ - char *servicename; - - servicename = vrpn_copy_service_name(name); - - if (c) { - c->addReference(); - d_myId = c->register_sender(servicename); - d_requestIndex_type = c->register_message_type(requestIndex_type); - d_requestMutex_type = c->register_message_type(requestMutex_type); - d_release_type = c->register_message_type(release_type); - d_releaseNotification_type = - c->register_message_type(releaseNotification_type); - d_grantRequest_type = c->register_message_type(grantRequest_type); - d_denyRequest_type = c->register_message_type(denyRequest_type); - d_initialize_type = c->register_message_type(initialize_type); - } - - if (servicename) { - delete[] servicename; - } -} - -// virtual -vrpn_Mutex::~vrpn_Mutex(void) -{ - if (d_connection) { - d_connection->removeReference(); // possibly destroy connection. - } -} - -void vrpn_Mutex::mainloop(void) -{ - - if (d_connection) { - d_connection->mainloop(); - } -} - -void vrpn_Mutex::sendRequest(vrpn_int32 index) -{ - timeval now; - char buffer[32]; - char *b = buffer; - vrpn_int32 bl = 32; - - if (!d_connection) return; - vrpn_gettimeofday(&now, NULL); - vrpn_buffer(&b, &bl, index); - d_connection->pack_message(32 - bl, now, d_requestMutex_type, d_myId, - buffer, vrpn_CONNECTION_RELIABLE); -} - -void vrpn_Mutex::sendRelease(void) -{ - timeval now; - - if (!d_connection) return; - - vrpn_gettimeofday(&now, NULL); - d_connection->pack_message(0, now, d_release_type, d_myId, NULL, - vrpn_CONNECTION_RELIABLE); -} - -void vrpn_Mutex::sendReleaseNotification(void) -{ - timeval now; - - if (!d_connection) return; - vrpn_gettimeofday(&now, NULL); - d_connection->pack_message(0, now, d_releaseNotification_type, d_myId, NULL, - vrpn_CONNECTION_RELIABLE); -} - -void vrpn_Mutex::sendGrantRequest(vrpn_int32 index) -{ - timeval now; - char buffer[32]; - char *b = buffer; - vrpn_int32 bl = 32; - - if (!d_connection) return; - vrpn_gettimeofday(&now, NULL); - vrpn_buffer(&b, &bl, index); - d_connection->pack_message(32 - bl, now, d_grantRequest_type, d_myId, - buffer, vrpn_CONNECTION_RELIABLE); -} - -void vrpn_Mutex::sendDenyRequest(vrpn_int32 index) -{ - timeval now; - char buffer[32]; - char *b = buffer; - vrpn_int32 bl = 32; - - if (!d_connection) return; - vrpn_gettimeofday(&now, NULL); - vrpn_buffer(&b, &bl, index); - d_connection->pack_message(32 - bl, now, d_denyRequest_type, d_myId, buffer, - vrpn_CONNECTION_RELIABLE); -} - -vrpn_Mutex_Server::vrpn_Mutex_Server(const char *name, vrpn_Connection *c) - : vrpn_Mutex(name, c) - , d_state(FREE) - , d_remoteIndex(0) -{ - vrpn_int32 got; - vrpn_int32 droppedLast; - - if (c) { - c->register_handler(d_requestIndex_type, handle_requestIndex, this); - c->register_handler(d_requestMutex_type, handle_requestMutex, this); - c->register_handler(d_release_type, handle_release, this); - - got = c->register_message_type(vrpn_got_connection); - c->register_handler(got, handle_gotConnection, this); - droppedLast = c->register_message_type(vrpn_dropped_last_connection); - c->register_handler(droppedLast, handle_dropLastConnection, this); - } -} - -// virtual -vrpn_Mutex_Server::~vrpn_Mutex_Server(void) -{ - if (d_connection) { - vrpn_int32 got, droppedLast; - got = d_connection->register_message_type(vrpn_got_connection); - droppedLast = - d_connection->register_message_type(vrpn_dropped_last_connection); - d_connection->unregister_handler(d_requestIndex_type, - handle_requestIndex, this); - d_connection->unregister_handler(d_requestMutex_type, - handle_requestMutex, this); - d_connection->unregister_handler(d_release_type, handle_release, this); - d_connection->unregister_handler(got, handle_gotConnection, this); - d_connection->unregister_handler(droppedLast, handle_dropLastConnection, - this); - } -} - -// static -int vrpn_Mutex_Server::handle_requestMutex(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Mutex_Server *me = (vrpn_Mutex_Server *)userdata; - const char *b = p.buffer; - vrpn_int32 remoteId; - - vrpn_unbuffer(&b, &remoteId); - -#ifdef VERBOSE - fprintf(stderr, "vrpn_Mutex_Server::handle_request from %d.\n", remoteId); -#endif - - if (me->d_state == FREE) { - me->d_state = HELD; - - // BUG BUG BUG - how does the Mutex_Remote recognize that this grant - // is for it, not for some other? - me->sendGrantRequest(remoteId); - - return 0; - } - else { - me->sendDenyRequest(remoteId); - - return 0; - } -} - -// static -int vrpn_Mutex_Server::handle_release(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_Mutex_Server *me = (vrpn_Mutex_Server *)userdata; - -#ifdef VERBOSE - fprintf(stderr, "vrpn_Mutex_Server::handle_release.\n"); -#endif - - me->d_state = FREE; - me->sendReleaseNotification(); - - return 0; -} - -// static -int vrpn_Mutex_Server::handle_requestIndex(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Mutex_Server *me = (vrpn_Mutex_Server *)userdata; - - timeval now; - vrpn_int32 msg_len = sizeof(vrpn_int32) + p.payload_len; - char *buffer = new char[msg_len]; - char *b = buffer; - vrpn_int32 bl = msg_len; - -#ifdef VERBOSE - fprintf(stderr, "vrpn_Mutex_Server::handle_requestIndex: " - "Initializing client %d (%lu %d).\n", - me->d_remoteIndex, ntohl(*(vrpn_uint32 *)p.buffer), - ntohl(*(vrpn_int32 *)(p.buffer + sizeof(vrpn_uint32)))); -#endif - - if (me->d_connection) { - vrpn_gettimeofday(&now, NULL); - // echo back whatever the client gave us as a unique identifier - vrpn_buffer(&b, &bl, p.buffer, p.payload_len); - vrpn_buffer(&b, &bl, (me->d_remoteIndex)); - me->d_connection->pack_message(msg_len, now, me->d_initialize_type, - me->d_myId, buffer, - vrpn_CONNECTION_RELIABLE); - } - - me->d_remoteIndex++; - delete[] buffer; - return 0; -} - -// static -int vrpn_Mutex_Server::handle_gotConnection(void *, vrpn_HANDLERPARAM) -{ - return 0; - // return handle_requestIndex(userdata, p); -} - -// static -int vrpn_Mutex_Server::handle_dropLastConnection(void *userdata, - vrpn_HANDLERPARAM) -{ - vrpn_Mutex_Server *me = (vrpn_Mutex_Server *)userdata; - - // Force the lock to release, to avoid deadlock. - if (me->d_state == HELD) { - fprintf(stderr, "vrpn_Mutex_Server::handle_dropLastConnection: " - "Forcing the state to FREE to avoid deadlock.\n"); - } - - me->d_state = FREE; - - return 0; -} - -vrpn_Mutex_Remote::vrpn_Mutex_Remote(const char *name, vrpn_Connection *c) - : vrpn_Mutex(name, c ? c : ((strcmp(name, "null") == 0) - ? (vrpn_Connection *)NULL - : vrpn_get_connection_by_name(name))) - , d_state(AVAILABLE) - , d_myIndex(-1) - , d_requestBeforeInit(vrpn_FALSE) - , d_reqGrantedCB(NULL) - , d_reqDeniedCB(NULL) - , d_takeCB(NULL) - , d_releaseCB(NULL) -{ - - if (d_connection) { - d_connection->register_handler(d_grantRequest_type, handle_grantRequest, - this); - d_connection->register_handler(d_denyRequest_type, handle_denyRequest, - this); - d_connection->register_handler(d_releaseNotification_type, - handle_releaseNotification, this); - d_connection->register_handler(d_initialize_type, handle_initialize, - this); - if (d_connection->connected()) { - requestIndex(); - } - vrpn_int32 got = - d_connection->register_message_type(vrpn_got_connection); - d_connection->register_handler(got, handle_gotConnection, this); - } -} - -// virtual -vrpn_Mutex_Remote::~vrpn_Mutex_Remote(void) -{ - - // Make sure we don't deadlock things - release(); - - if (d_connection) { - d_connection->unregister_handler(d_grantRequest_type, - handle_grantRequest, this); - d_connection->unregister_handler(d_denyRequest_type, handle_denyRequest, - this); - d_connection->unregister_handler(d_releaseNotification_type, - handle_releaseNotification, this); - d_connection->unregister_handler(d_initialize_type, handle_initialize, - this); - vrpn_int32 got = - d_connection->register_message_type(vrpn_got_connection); - d_connection->unregister_handler(got, handle_gotConnection, this); - } -} - -vrpn_bool vrpn_Mutex_Remote::isAvailable(void) const -{ - return (d_state == AVAILABLE); -} - -vrpn_bool vrpn_Mutex_Remote::isHeldLocally(void) const -{ - return (d_state == OURS); -} - -vrpn_bool vrpn_Mutex_Remote::isHeldRemotely(void) const -{ - return (d_state == HELD_REMOTELY); -} - -void vrpn_Mutex_Remote::requestIndex(void) -{ - timeval now; - vrpn_int32 buflen = sizeof(vrpn_int32) + sizeof(vrpn_uint32); - char *buf = new char[buflen]; - char *bufptr = buf; - vrpn_int32 len = buflen; - vrpn_uint32 ip_addr = getmyIP(); -#ifdef _WIN32 - vrpn_int32 pid = _getpid(); -#else - vrpn_int32 pid = getpid(); -#endif - vrpn_buffer(&bufptr, &len, ip_addr); - vrpn_buffer(&bufptr, &len, pid); -#ifdef VERBOSE - printf("requesting index for %lu, %d\n", ip_addr, pid); -#endif - vrpn_gettimeofday(&now, NULL); - d_connection->pack_message(buflen, now, d_requestIndex_type, d_myId, buf, - vrpn_CONNECTION_RELIABLE); - delete[] buf; - return; -} - -void vrpn_Mutex_Remote::request(void) -{ - if (!isAvailable()) { - -#ifdef VERBOSE - fprintf(stderr, "Requested unavailable mutex.\n"); -#endif - triggerDenyCallbacks(); - return; - } - else if (d_myIndex == -1) { -#ifdef VERBOSE - fprintf(stderr, "Requested mutex before initialization; deferring.\n"); -#endif - d_requestBeforeInit = vrpn_TRUE; - return; - } - -#ifdef VERBOSE - fprintf(stderr, "Requesting mutex\n"); -#endif - - d_state = REQUESTING; - sendRequest(d_myIndex); - - return; -} - -void vrpn_Mutex_Remote::release(void) -{ - if (!isHeldLocally()) { - return; - } - -#ifdef VERBOSE - fprintf(stderr, "Releasing mutex.\n"); -#endif - - d_state = AVAILABLE; - sendRelease(); - triggerReleaseCallbacks(); -} - -void vrpn_Mutex_Remote::addRequestGrantedCallback(void *userdata, - int (*f)(void *)) -{ - mutexCallback *cb = new mutexCallback; - if (!cb) { - fprintf(stderr, "vrpn_Mutex_Remote::addRequestGrantedCallback: " - "Out of memory.\n"); - return; - } - - cb->userdata = userdata; - cb->f = f; - cb->next = d_reqGrantedCB; - d_reqGrantedCB = cb; -} - -void vrpn_Mutex_Remote::addRequestDeniedCallback(void *userdata, - int (*f)(void *)) -{ - mutexCallback *cb = new mutexCallback; - if (!cb) { - fprintf(stderr, "vrpn_Mutex_Remote::addRequestDeniedCallback: " - "Out of memory.\n"); - return; - } - - cb->userdata = userdata; - cb->f = f; - cb->next = d_reqDeniedCB; - d_reqDeniedCB = cb; -} - -void vrpn_Mutex_Remote::addTakeCallback(void *userdata, int (*f)(void *)) -{ - mutexCallback *cb = new mutexCallback; - if (!cb) { - fprintf(stderr, - "vrpn_Mutex_Remote::addTakeCallback: Out of memory.\n"); - return; - } - - cb->userdata = userdata; - cb->f = f; - cb->next = d_takeCB; - d_takeCB = cb; -} - -// static -void vrpn_Mutex_Remote::addReleaseCallback(void *userdata, int (*f)(void *)) -{ - mutexCallback *cb = new mutexCallback; - if (!cb) { - fprintf(stderr, "vrpn_Mutex_Remote::addReleaseCallback: " - "Out of memory.\n"); - return; - } - - cb->userdata = userdata; - cb->f = f; - cb->next = d_releaseCB; - d_releaseCB = cb; -} - -// static -int vrpn_Mutex_Remote::handle_grantRequest(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Mutex_Remote *me = (vrpn_Mutex_Remote *)userdata; - const char *b = p.buffer; - vrpn_int32 index; - - vrpn_unbuffer(&b, &index); - -#ifdef VERBOSE - fprintf(stderr, "vrpn_Mutex_Remote::handle_grantRequest for %d.\n", index); -#endif - - if (me->d_myIndex != index) { - me->d_state = HELD_REMOTELY; - me->triggerTakeCallbacks(); - return 0; - } - - me->d_state = OURS; - me->triggerGrantCallbacks(); - me->triggerTakeCallbacks(); - - return 0; -} - -// static -int vrpn_Mutex_Remote::handle_denyRequest(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Mutex_Remote *me = (vrpn_Mutex_Remote *)userdata; - const char *b = p.buffer; - vrpn_int32 index; - - vrpn_unbuffer(&b, &index); - -#ifdef VERBOSE - fprintf(stderr, "vrpn_Mutex_Remote::handle_denyRequest for %d.\n", index); -#endif - - if (me->d_myIndex != index) { - return 0; - } - - me->d_state = HELD_REMOTELY; - me->triggerDenyCallbacks(); - - return 0; -} - -// static -int vrpn_Mutex_Remote::handle_releaseNotification(void *userdata, - vrpn_HANDLERPARAM) -{ - vrpn_Mutex_Remote *me = (vrpn_Mutex_Remote *)userdata; - -#ifdef VERBOSE - fprintf(stderr, "vrpn_Mutex_Remote::handle_releaseNotification.\n"); -#endif - - me->d_state = AVAILABLE; - me->triggerReleaseCallbacks(); - - return 0; -} - -// static -int vrpn_Mutex_Remote::handle_initialize(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Mutex_Remote *me = (vrpn_Mutex_Remote *)userdata; - const char *b = p.buffer; - - // Only pay attention to the first initialize() message we get - // after startup. - if (me->d_myIndex != -1) { - return 0; - } - - vrpn_int32 expected_payload_len = - 2 * sizeof(vrpn_int32) + sizeof(vrpn_uint32); - if (p.payload_len != expected_payload_len) { - fprintf(stderr, - "vrpn_Mutex_Remote::handle_initialize: " - "Warning: Ignoring message with length %d, expected %d\n", - p.payload_len, expected_payload_len); - return 0; - } - - vrpn_uint32 ip_addr; - vrpn_int32 pid; - vrpn_unbuffer(&b, &ip_addr); - vrpn_unbuffer(&b, &pid); - vrpn_int32 my_pid = 0; -#ifdef _WIN32 - my_pid = _getpid(); -#else - my_pid = getpid(); -#endif - if ((ip_addr != getmyIP()) || (pid != my_pid)) { - fprintf( - stderr, - "vrpn_Mutex_Remote::handle_initialize: " - "Warning: Ignoring message that doesn't match ip/pid identifier\n"); -#ifdef VERBOSE - fprintf(stderr, "Got %lu %d, expected %lu %d.\n", ip_addr, pid, - getmyIP(), my_pid); -#endif - return 0; - } - vrpn_unbuffer(&b, &(me->d_myIndex)); - -#ifdef VERBOSE - fprintf(stderr, "vrpn_Mutex_Remote::handle_initialize: " - "Got assigned index %d.\n", - me->d_myIndex); -#endif - - if (me->d_requestBeforeInit) { -#ifdef VERBOSE - fprintf(stderr, "vrpn_Mutex_Remote::handle_initialize: " - "Sending request\n"); -#endif - me->request(); - } - - return 0; -} - -// static -int vrpn_Mutex_Remote::handle_gotConnection(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_Mutex_Remote *me = (vrpn_Mutex_Remote *)userdata; - if (me->d_myIndex == -1) { - me->requestIndex(); - } - return 0; -} - -void vrpn_Mutex_Remote::triggerGrantCallbacks(void) -{ - mutexCallback *cb; - - // trigger callbacks - for (cb = d_reqGrantedCB; cb; cb = cb->next) { - (cb->f)(cb->userdata); - } -} - -void vrpn_Mutex_Remote::triggerDenyCallbacks(void) -{ - mutexCallback *cb; - - // trigger callbacks - for (cb = d_reqDeniedCB; cb; cb = cb->next) { - (cb->f)(cb->userdata); - } -} - -void vrpn_Mutex_Remote::triggerTakeCallbacks(void) -{ - mutexCallback *cb; - - // trigger callbacks - for (cb = d_takeCB; cb; cb = cb->next) { - (cb->f)(cb->userdata); - } -} - -void vrpn_Mutex_Remote::triggerReleaseCallbacks(void) -{ - mutexCallback *cb; - - // trigger callbacks - for (cb = d_releaseCB; cb; cb = cb->next) { - (cb->f)(cb->userdata); - } -} - -// Implementation notes: -// -// We broadcast messages over d_peer[] tagged with our IP number in -// network format. -// We broadcast REPLIES over d_peer[] tagged with the sender's IP number -// in network format. When we get a reply, we check the IP number it -// contains against our own and discard it if it doesn't match. -// -// This is an ugly n^2 implementation, when we could do it in 2n, but the -// data structures would be a little more complex - we'd have to have a -// mapping from IP numbers to vrpn_Connections in d_peer[]. What I'd probably -// do would be abandon IP numbers and ports and just use lexographical -// ordering of station names. But then we'd have to ensure that every -// instance used the same station name (evans vs. evans.cs.unc.edu vs. -// evans.cs.unc.edu:4500) for each peer, which is ugly. - -vrpn_PeerMutex::vrpn_PeerMutex(const char *name, int port, - const char *NICaddress) - : d_state(AVAILABLE) - , d_server(NULL) - , d_peer(NULL) - , d_numPeers(0) - , d_numConnectionsAllocated(0) - , d_myIP(getmyIP(NICaddress)) - , d_myPort(port) - , d_holderIP(0) - , d_holderPort(-1) - , d_reqGrantedCB(NULL) - , d_reqDeniedCB(NULL) - , d_takeCB(NULL) - , d_releaseCB(NULL) - , d_peerData(NULL) -{ - - if (!name) { - fprintf(stderr, "vrpn_PeerMutex: NULL name!\n"); - return; - } - // XXX Won't work with non-IP connections (MPI, for example) - char con_name[512]; - sprintf(con_name, "%s:%d", NICaddress, port); - d_server = vrpn_create_server_connection(con_name); - if (d_server) { - d_server->addReference(); - d_server->setAutoDeleteStatus(true); - } - else { - fprintf(stderr, "vrpn_PeerMutex: " - "Couldn't open connection on port %d!\n", - port); - return; - } - - init(name); -} - -vrpn_PeerMutex::vrpn_PeerMutex(const char *name, vrpn_Connection *server) - : d_state(AVAILABLE) - , d_server(server) - , d_peer(NULL) - , d_numPeers(0) - , d_numConnectionsAllocated(0) - , d_myIP(getmyIP(NULL)) - , d_myPort(0) - , d_holderIP(0) - , d_holderPort(-1) - , d_reqGrantedCB(NULL) - , d_reqDeniedCB(NULL) - , d_takeCB(NULL) - , d_releaseCB(NULL) - , d_peerData(NULL) -{ - - if (!name) { - fprintf(stderr, "vrpn_PeerMutex: NULL name!\n"); - return; - } - if (server) { - d_server->addReference(); - } - else { - fprintf(stderr, "vrpn_PeerMutex: NULL connection!\n"); - return; - } - - init(name); -} - -vrpn_PeerMutex::~vrpn_PeerMutex(void) -{ - - // Send an explicit message so they know we're shutting down, not - // just disconnecting temporarily and will be back. - - // Probably a safer way to do it would be to do addPeer and losePeer - // implicitly through dropped_connection/got_connection on d_server - // and d_peer? - - // There is no good solution! - - // Possible improvement: if we lose our connection and regain it, - // send some sort of announcement message to everybody who used to - // be our peer so they add us back into their tables. - - if (isHeldLocally()) { - release(); - } - - if (d_mutexName) { - delete[] d_mutexName; - } - for (int i = 0; i < d_numPeers; ++i) { - if (d_peer[i]) { - d_peer[i]->removeReference(); - } - } - if (d_peer) { - delete[] d_peer; - } - - if (d_server) { - d_server->removeReference(); - } -} - -vrpn_bool vrpn_PeerMutex::isAvailable(void) const -{ - return (d_state == AVAILABLE); -} - -vrpn_bool vrpn_PeerMutex::isHeldLocally(void) const -{ - return (d_state == OURS); -} - -vrpn_bool vrpn_PeerMutex::isHeldRemotely(void) const -{ - return (d_state == HELD_REMOTELY); -} - -int vrpn_PeerMutex::numPeers(void) const { return d_numPeers; } - -void vrpn_PeerMutex::mainloop(void) -{ - int i; - - d_server->mainloop(); - for (i = 0; i < d_numPeers; i++) { - d_peer[i]->mainloop(); - } - - checkGrantMutex(); -} - -void vrpn_PeerMutex::request(void) -{ - int i; - - // No point in sending requests if it's not currently available. - // However, we need to trigger any local denial callbacks; otherwise - // this looks like a silent failure. - if (!isAvailable()) { - triggerDenyCallbacks(); - -#ifdef VERBOSE - fprintf(stderr, - "vrpn_PeerMutex::request: the mutex isn't available.\n"); -#endif - - return; - } - - d_state = REQUESTING; - d_numPeersGrantingLock = 0; - for (i = 0; i < d_numPeers; i++) { - // d_peerData[i].grantedLock = VRPN_FALSE; - sendRequest(d_peer[i]); - } - - // If somebody else sends a request before we get all our grants, - // and their IP/port# is lower than ours, we have to yield to them. - - d_holderIP = d_myIP; - d_holderPort = d_myPort; - - // We used to wait until the next pass through mainloop() to check - // this (our request could be trivially granted if we have no - // peers), but that leads to bad things (TM), like having to - // insert extra calls to mainloop() in client code just to guarantee - // that we have the mutex. - - checkGrantMutex(); - -#ifdef VERBOSE - fprintf(stderr, "vrpn_PeerMutex::request: requested the mutex " - "(from %d peers).\n", - d_numPeers); -#endif -} - -void vrpn_PeerMutex::release(void) -{ - int i; - - // Can't release it if we don't already have it. - // There aren't any appropriate callbacks to trigger here. :) - if (!isHeldLocally()) { - -#ifdef VERBOSE - fprintf(stderr, "vrpn_PeerMutex::release: we don't hold the mutex.\n"); -#endif - - return; - } - - d_state = AVAILABLE; - d_holderIP = 0; - d_holderPort = -1; - for (i = 0; i < d_numPeers; i++) { - sendRelease(d_peer[i]); - } - - triggerReleaseCallbacks(); - -#ifdef VERBOSE - fprintf(stderr, "vrpn_PeerMutex::release: released the mutex.\n"); -#endif -} - -void vrpn_PeerMutex::addPeer(const char *stationName) -{ - vrpn_Connection **newc; - peerData *newg; - losePeerData *d; - int i; - - // complex - while (d_numPeers >= d_numConnectionsAllocated) { - - // reallocate arrays - d_numConnectionsAllocated = 2 * (d_numConnectionsAllocated + 1); - newc = new vrpn_Connection *[d_numConnectionsAllocated]; - newg = new peerData[d_numConnectionsAllocated]; - if (!newc || !newg) { - fprintf(stderr, "vrpn_PeerMutex::addPeer: Out of memory.\n"); - return; - } - for (i = 0; i < d_numPeers; i++) { - newc[i] = d_peer[i]; - newg[i] = d_peerData[i]; - } - if (d_peer) { - delete[] d_peer; - } - if (d_peerData) { - delete[] d_peerData; - } - d_peer = newc; - d_peerData = newg; - } - d_peer[d_numPeers] = vrpn_get_connection_by_name(stationName); - // d_peerData[d_numPeers].grantedLock = vrpn_false; - - d = new losePeerData; - if (!d) { - fprintf(stderr, "vrpn_PeerMutex::addPeer: Out of memory.\n"); - return; - } - d->connection = d_peer[d_numPeers]; - d->mutex = this; - vrpn_int32 control; - vrpn_int32 drop; - control = d_peer[d_numPeers]->register_sender(vrpn_CONTROL); - drop = d_peer[d_numPeers]->register_message_type(vrpn_dropped_connection); - d_peer[d_numPeers]->register_handler(drop, handle_losePeer, d, control); - -#ifdef VERBOSE - fprintf(stderr, "vrpn_PeerMutex::addPeer: added peer named %s.\n", - stationName); -#endif - - d_numPeers++; -} - -void vrpn_PeerMutex::addRequestGrantedCallback(void *ud, int (*f)(void *)) -{ - mutexCallback *cb = new mutexCallback; - if (!cb) { - fprintf(stderr, "vrpn_PeerMutex::addRequestGrantedCallback: " - "Out of memory.\n"); - return; - } - - cb->userdata = ud; - cb->f = f; - cb->next = d_reqGrantedCB; - d_reqGrantedCB = cb; -} - -void vrpn_PeerMutex::addRequestDeniedCallback(void *ud, int (*f)(void *)) -{ - mutexCallback *cb = new mutexCallback; - if (!cb) { - fprintf(stderr, "vrpn_PeerMutex::addRequestDeniedCallback: " - "Out of memory.\n"); - return; - } - - cb->userdata = ud; - cb->f = f; - cb->next = d_reqDeniedCB; - d_reqDeniedCB = cb; -} - -void vrpn_PeerMutex::addTakeCallback(void *ud, int (*f)(void *)) -{ - mutexCallback *cb = new mutexCallback; - if (!cb) { - fprintf(stderr, "vrpn_PeerMutex::addTakeCallback: Out of memory.\n"); - return; - } - - cb->userdata = ud; - cb->f = f; - cb->next = d_takeCB; - d_takeCB = cb; -} - -// static -void vrpn_PeerMutex::addReleaseCallback(void *ud, int (*f)(void *)) -{ - mutexCallback *cb = new mutexCallback; - if (!cb) { - fprintf(stderr, "vrpn_PeerMutex::addReleaseCallback: " - "Out of memory.\n"); - return; - } - - cb->userdata = ud; - cb->f = f; - cb->next = d_releaseCB; - d_releaseCB = cb; -} - -// static -int vrpn_PeerMutex::handle_request(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_PeerMutex *me = (vrpn_PeerMutex *)userdata; - const char *b = p.buffer; - vrpn_uint32 senderIP; - vrpn_uint32 senderPort; - int i; - - vrpn_unbuffer(&b, &senderIP); - vrpn_unbuffer(&b, &senderPort); - -// This function is where we're n^2. If we could look up the peer -// given their IP number we could be 2n instead. - -#ifdef VERBOSE - in_addr nad; - nad.s_addr = htonl(senderIP); - fprintf(stderr, - "vrpn_PeerMutex::handle_request: got one from %s port %d.\n", - inet_ntoa(nad), senderPort); -#endif - - // If several nodes request the lock at once, ties are broken in favor - // of the node with the lowest IP number & port. - - if ((me->d_state == AVAILABLE) || - (((me->d_state == HELD_REMOTELY) || (me->d_state == REQUESTING)) && - ((senderIP < me->d_holderIP) || - ((senderIP == me->d_holderIP) && - ((vrpn_int32)senderPort < me->d_holderPort))))) { - - me->d_holderIP = senderIP; - me->d_holderPort = senderPort; - - if (me->d_state != HELD_REMOTELY) { - me->triggerTakeCallbacks(); - } - - me->d_state = HELD_REMOTELY; - for (i = 0; i < me->d_numPeers; i++) { - me->sendGrantRequest(me->d_peer[i], senderIP, senderPort); - } - return 0; - } - - for (i = 0; i < me->d_numPeers; i++) { - me->sendDenyRequest(me->d_peer[i], senderIP, senderPort); - } - - return 0; -} - -// static -int vrpn_PeerMutex::handle_release(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_PeerMutex *me = (vrpn_PeerMutex *)userdata; - const char *b = p.buffer; - vrpn_uint32 senderIP; - vrpn_uint32 senderPort; - - vrpn_unbuffer(&b, &senderIP); - vrpn_unbuffer(&b, &senderPort); - -#ifdef VERBOSE - in_addr nad; - - nad.s_addr = senderIP; - fprintf(stderr, - "vrpn_PeerMutex::handle_release: got one from %s port %d.\n", - inet_ntoa(nad), senderPort); -#endif - - if ((senderIP != me->d_holderIP) || - ((vrpn_int32)senderPort != me->d_holderPort)) { - fprintf(stderr, "vrpn_PeerMutex::handle_release: Got a release from " - "somebody who didn't have the lock!?\n"); - } - - me->d_state = AVAILABLE; - me->d_holderIP = 0; - me->d_holderPort = -1; - - me->triggerReleaseCallbacks(); - - return 0; -} - -// static -int vrpn_PeerMutex::handle_grantRequest(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_PeerMutex *me = (vrpn_PeerMutex *)userdata; - const char *b = p.buffer; - vrpn_uint32 senderIP; - vrpn_uint32 senderPort; - - vrpn_unbuffer(&b, &senderIP); - vrpn_unbuffer(&b, &senderPort); - -#ifdef VERBOSE - in_addr nad; - nad.s_addr = senderIP; - fprintf(stderr, "vrpn_PeerMutex::handle_grantRequest: " - "got one for %s port %d.\n", - inet_ntoa(nad), senderPort); -#endif - - if ((senderIP != me->d_myIP) || (senderPort != me->d_myPort)) { - // we can treat this as a denial - - // but we'll get a denial eventually, - // so we need not do so. - return 0; - } - - me->d_numPeersGrantingLock++; - - me->checkGrantMutex(); - - return 0; -} - -// static -int vrpn_PeerMutex::handle_denyRequest(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_PeerMutex *me = (vrpn_PeerMutex *)userdata; - const char *b = p.buffer; - vrpn_uint32 senderIP; - vrpn_uint32 senderPort; - - vrpn_unbuffer(&b, &senderIP); - vrpn_unbuffer(&b, &senderPort); - -#ifdef VERBOSE - in_addr nad; - nad.s_addr = senderIP; - fprintf(stderr, "vrpn_PeerMutex::handle_denyRequest: " - "got one for %s port %d.\n", - inet_ntoa(nad), senderPort); -#endif - - if ((senderIP != me->d_myIP) || (senderPort != me->d_myPort)) { - return 0; - } - - me->d_numPeersGrantingLock = 0; - - me->triggerDenyCallbacks(); - - me->d_state = HELD_REMOTELY; - - return 0; -} - -// static -int vrpn_PeerMutex::handle_losePeer(void *userdata, vrpn_HANDLERPARAM) -{ - losePeerData *data = (losePeerData *)userdata; - vrpn_PeerMutex *me = data->mutex; - vrpn_Connection *c = data->connection; - int i; - - // Need to abort a request since we don't have enough data to correctly - // compensate for losing a peer mid-request. - - if (me->d_state == REQUESTING) { - me->release(); - } - - for (i = 0; i < me->d_numPeers; i++) { - if (c == me->d_peer[i]) { - break; - } - } - if (i == me->d_numPeers) { - fprintf(stderr, - "vrpn_PeerMutex::handle_losePeer: Can't find lost peer.\n"); - return 0; // -1? - } - - fprintf(stderr, "vrpn_PeerMutex::handle_losePeer: lost peer #%d.\n", i); - - if (me->d_peer[i]) { - me->d_peer[i]->removeReference(); - } - me->d_numPeers--; - me->d_peer[i] = me->d_peer[me->d_numPeers]; - - delete data; - - return 0; -} - -void vrpn_PeerMutex::sendRequest(vrpn_Connection *c) -{ - timeval now; - char buffer[32]; - char *b = buffer; - vrpn_int32 bl = 32; - - vrpn_gettimeofday(&now, NULL); - vrpn_buffer(&b, &bl, d_myIP); - vrpn_buffer(&b, &bl, d_myPort); - c->pack_message(32 - bl, now, c->register_message_type(requestMutex_type), - c->register_sender(d_mutexName), buffer, - vrpn_CONNECTION_RELIABLE); -} - -void vrpn_PeerMutex::sendRelease(vrpn_Connection *c) -{ - timeval now; - char buffer[32]; - char *b = buffer; - vrpn_int32 bl = 32; - - vrpn_gettimeofday(&now, NULL); - vrpn_buffer(&b, &bl, d_myIP); - vrpn_buffer(&b, &bl, d_myPort); - c->pack_message(32 - bl, now, c->register_message_type(release_type), - c->register_sender(d_mutexName), buffer, - vrpn_CONNECTION_RELIABLE); -} - -void vrpn_PeerMutex::sendGrantRequest(vrpn_Connection *c, vrpn_uint32 IP, - vrpn_uint32 port) -{ - timeval now; - char buffer[32]; - char *b = buffer; - vrpn_int32 bl = 32; - - vrpn_gettimeofday(&now, NULL); - vrpn_buffer(&b, &bl, IP); - vrpn_buffer(&b, &bl, port); - c->pack_message(32 - bl, now, c->register_message_type(grantRequest_type), - c->register_sender(d_mutexName), buffer, - vrpn_CONNECTION_RELIABLE); -} - -void vrpn_PeerMutex::sendDenyRequest(vrpn_Connection *c, vrpn_uint32 IP, - vrpn_uint32 port) -{ - timeval now; - char buffer[32]; - char *b = buffer; - vrpn_int32 bl = 32; - - vrpn_gettimeofday(&now, NULL); - vrpn_buffer(&b, &bl, IP); - vrpn_buffer(&b, &bl, port); - c->pack_message(32 - bl, now, c->register_message_type(denyRequest_type), - c->register_sender(d_mutexName), buffer, - vrpn_CONNECTION_RELIABLE); -} - -void vrpn_PeerMutex::triggerGrantCallbacks(void) -{ - mutexCallback *cb; - - // trigger callbacks - for (cb = d_reqGrantedCB; cb; cb = cb->next) { - (cb->f)(cb->userdata); - } -} - -void vrpn_PeerMutex::triggerDenyCallbacks(void) -{ - mutexCallback *cb; - - // trigger callbacks - for (cb = d_reqDeniedCB; cb; cb = cb->next) { - (cb->f)(cb->userdata); - } -} - -void vrpn_PeerMutex::triggerTakeCallbacks(void) -{ - mutexCallback *cb; - - // trigger callbacks - for (cb = d_takeCB; cb; cb = cb->next) { - (cb->f)(cb->userdata); - } -} - -void vrpn_PeerMutex::triggerReleaseCallbacks(void) -{ - mutexCallback *cb; - - // trigger callbacks - for (cb = d_releaseCB; cb; cb = cb->next) { - (cb->f)(cb->userdata); - } -} - -void vrpn_PeerMutex::checkGrantMutex(void) -{ - - if ((d_state == REQUESTING) && (d_numPeersGrantingLock == d_numPeers)) { - d_state = OURS; - - triggerTakeCallbacks(); - triggerGrantCallbacks(); - } -} - -void vrpn_PeerMutex::init(const char *name) -{ - - d_mutexName = new char[1 + strlen(name)]; - if (!d_mutexName) { - fprintf(stderr, "vrpn_PeerMutex::init: Out of memory.\n"); - return; - } - strncpy(d_mutexName, name, strlen(name)); - - d_myId = d_server->register_sender(name); - d_request_type = d_server->register_message_type(requestMutex_type); - d_release_type = d_server->register_message_type(release_type); - d_grantRequest_type = d_server->register_message_type(grantRequest_type); - d_denyRequest_type = d_server->register_message_type(denyRequest_type); - - d_server->register_handler(d_request_type, handle_request, this, d_myId); - d_server->register_handler(d_release_type, handle_release, this, d_myId); - d_server->register_handler(d_grantRequest_type, handle_grantRequest, this, - d_myId); - d_server->register_handler(d_denyRequest_type, handle_denyRequest, this, - d_myId); -} diff --git a/src/vrpn/vrpn_Mutex.h b/src/vrpn/vrpn_Mutex.h deleted file mode 100644 index 7d27a05297e07a7e0b821379b6c493833fd2e502..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Mutex.h +++ /dev/null @@ -1,333 +0,0 @@ -#ifndef VRPN_MUTEX_H -#define VRPN_MUTEX_H - -#include <stddef.h> // for NULL - -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Types.h" // for vrpn_int32, vrpn_uint32, etc - -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; -// Every time a Mutex_Remote connects to a Mutex_Server, the server assigns -// a unique ID to the remote. -// HACK - because vrpn doesn't let us unicast within a multicast (multiple- -// connection server) (in any clean way), or identify at a MC server which -// connection a message came in over, this code is fragile - it depends -// on the fact that vrpn_Connection only allows one connection to be made -// before triggering the got_connection callback. If connections were somehow -// batched, or we multithreaded vrpn_Connection, this would break. - -class VRPN_API vrpn_Mutex { - -public: - vrpn_Mutex(const char *name, vrpn_Connection * = NULL); - virtual ~vrpn_Mutex(void) = 0; - - void mainloop(void); - -protected: - vrpn_Connection *d_connection; - - vrpn_int32 d_myId; - vrpn_int32 d_requestIndex_type; - vrpn_int32 d_requestMutex_type; - vrpn_int32 d_release_type; - vrpn_int32 d_releaseNotification_type; - vrpn_int32 d_grantRequest_type; - vrpn_int32 d_denyRequest_type; - vrpn_int32 d_initialize_type; - - void sendRequest(vrpn_int32 index); - void sendRelease(void); - void sendReleaseNotification(void); - void sendGrantRequest(vrpn_int32 index); - void sendDenyRequest(vrpn_int32 index); -}; - -class VRPN_API vrpn_Mutex_Server : public vrpn_Mutex { - -public: - vrpn_Mutex_Server(const char *name, vrpn_Connection * = NULL); - virtual ~vrpn_Mutex_Server(void); - -protected: - enum state { HELD, FREE }; - - state d_state; - - vrpn_int32 d_remoteIndex; - ///< Counts remotes who have had IDs issued to them. - - static int VRPN_CALLBACK handle_requestIndex(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_requestMutex(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_release(void *, vrpn_HANDLERPARAM); - - static int VRPN_CALLBACK handle_gotConnection(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK - handle_dropLastConnection(void *, vrpn_HANDLERPARAM); -}; - -class VRPN_API vrpn_Mutex_Remote : public vrpn_Mutex { - -public: - vrpn_Mutex_Remote(const char *name, vrpn_Connection * = NULL); - virtual ~vrpn_Mutex_Remote(void); - - // ACCESSORS - - vrpn_bool isAvailable(void) const; - ///< True from when release() is called or we receive a release - ///< message from another process until request() is called or we - ///< grant the lock to another process in response to its request - ///< message. - vrpn_bool isHeldLocally(void) const; - ///< True from when RequestGranted callbacks are triggered until - ///< release() is called. - vrpn_bool isHeldRemotely(void) const; - ///< True from when we grant the lock to another process in response - ///< to its request message until we receive a release message from - ///< another process. - - // MANIPULATORS - - void request(void); - ///< Request the distributed lock. Does not request the lock - ///< if !isAvailable(), instead automatically triggering DeniedCallbacks. - - void release(void); - ///< Release the distributed lock. Does nothing if !isHeldLocally() - ///< and there isn't a request pending. - - void addRequestGrantedCallback(void *userdata, int (*)(void *)); - ///< These callbacks are triggered when OUR request is granted. - void addRequestDeniedCallback(void *userdata, int (*)(void *)); - ///< These callbacks are triggered when OUR request is denied. - void addTakeCallback(void *userdata, int (*)(void *)); - ///< These callbacks are triggered when ANY peer gets the mutex. - void addReleaseCallback(void *userdata, int (*)(void *)); - ///< These callbacks are triggered when ANY peer releases the - ///< mutex. - -protected: - void requestIndex(void); - - enum state { OURS, REQUESTING, AVAILABLE, HELD_REMOTELY }; - - state d_state; - vrpn_int32 d_myIndex; - vrpn_bool d_requestBeforeInit; - - static int VRPN_CALLBACK handle_grantRequest(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_denyRequest(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK - handle_releaseNotification(void *, vrpn_HANDLERPARAM); - - static int VRPN_CALLBACK handle_initialize(void *, vrpn_HANDLERPARAM); - - static int VRPN_CALLBACK handle_gotConnection(void *, vrpn_HANDLERPARAM); - - void triggerGrantCallbacks(void); - void triggerDenyCallbacks(void); - void triggerTakeCallbacks(void); - void triggerReleaseCallbacks(void); - - struct mutexCallback { - int (*f)(void *); - void *userdata; - mutexCallback *next; - }; - - mutexCallback *d_reqGrantedCB; - mutexCallback *d_reqDeniedCB; - mutexCallback *d_takeCB; - mutexCallback *d_releaseCB; -}; - -/// vrpn_PeerMutex -/// -/// This class provides distributed mutual exclusion between every instance -/// with the same name for which addPeer() has been called. -/// If a process calls request() when isAvailable() returns true, -/// the mutex will attempt to secure a lock to whatever resource it is -/// governing; either RequestGranted or RequestDenied callbacks will -/// be triggered. If RequestGranted callbacks are triggered, the process -/// has the lock until it explicitly calls release() (and can verify this -/// by checking isHeldLocally()). Once the lock-owner calls release(), -/// Release callbacks at every peer will be triggered. -/// -/// Like most vrpn classes, the mainloop() must be called frequently. -/// -/// Note that none of isAvailable(), isHeldLocally(), and isHeldRemotely() -/// are true between when request() is called and either RequestGranted or -/// RequestDenied callbacks are triggered. - -// Known bugs - - -// The constructor that takes a Connection as an argument will incorrectly -// identify its IP address as the machine's default rather than the address -// used by the Connection. This should not cause any errors in the protocol, -// but will bias the tiebreaking algorithm. The same constructor will use -// the wrong port number; without this information the tiebreaking algorithm -// fails. Oops. Use only one mutex per Connection for now. - -// Possible bugs - - -// If on startup somebody else is holding the mutex we'll think it's -// available. However, if we request it they'll deny it to us and -// we won't break. -// If sites don't execute the same set of addPeer() commands, they may -// implicitly partition the network and not get true mutual exclusion. -// This could be fixed by sending an addPeer message. -// If sites execute addPeer() while the lock is held, or being requested, -// we'll break. -// - To fix: send messages, but defer all executions of addPeer until the -// lock is released. If we want to be really careful here, on getting an -// addPeer message when we think the lock is available we should request -// the lock and then (if we get it) release it immediately, without -// triggering any user callbacks. Sounds tough to code? - -// Handling more than 2 sites in a mutex requires multiconnection servers. -// It's been tested with 1-3 sites, and works fine. - -// This is an O(n^2) network traffic implementation; -// for details (and how to fix if it ever becomes a problem), -// see the implementation notes in vrpn_Mutex.C. - -class VRPN_API vrpn_PeerMutex { - -public: - vrpn_PeerMutex(const char *name, int port, const char *NICaddress = NULL); - ///< This constructor opens a new connection/port for the mutex. - - ~vrpn_PeerMutex(void); - ///< If isHeldLocally(), calls release(). - - // ACCESSORS - - vrpn_bool isAvailable(void) const; - ///< True from when release() is called or we receive a release - ///< message from another process until request() is called or we - ///< grant the lock to another process in response to its request - ///< message. - vrpn_bool isHeldLocally(void) const; - ///< True from when RequestGranted callbacks are triggered until - ///< release() is called. - vrpn_bool isHeldRemotely(void) const; - ///< True from when we grant the lock to another process in response - ///< to its request message until we receive a release message from - ///< another process. - - int numPeers(void) const; - - // MANIPULATORS - - void mainloop(void); - - void request(void); - ///< Request the distributed lock. Does not request the lock - ///< if !isAvailable(), instead automatically triggering DeniedCallbacks. - - void release(void); - ///< Release the distributed lock. Does nothing if !isHeldLocally() - ///< and there isn't a request pending. - - void addPeer(const char *stationName); - ///< Takes a VRPN station name of the form "<host>:<port>". - - void addRequestGrantedCallback(void *userdata, int (*)(void *)); - ///< These callbacks are triggered when OUR request is granted. - void addRequestDeniedCallback(void *userdata, int (*)(void *)); - ///< These callbacks are triggered when OUR request is denied. - void addTakeCallback(void *userdata, int (*)(void *)); - ///< These callbacks are triggered when ANY peer gets the mutex. - ///< (If several peers are competing for the mutex, and the - ///< implementation issues multiple "grants", these callbacks will - ///< only be triggered once between triggerings of ReleaseCallbacks.) - void addReleaseCallback(void *userdata, int (*)(void *)); - ///< These callbacks are triggered when ANY peer releases the - ///< mutex. - -protected: - enum state { OURS, REQUESTING, AVAILABLE, HELD_REMOTELY }; - - char *d_mutexName; - - state d_state; - - int d_numPeersGrantingLock; - ///< Counts the number of "grants" we've received after issuing - ///< a request; when this reaches d_numPeers, the lock is ours. - - vrpn_Connection *d_server; - ///< Receive on this connection. - vrpn_Connection **d_peer; - ///< Send on these connections to other Mutex's well-known-ports. - - int d_numPeers; - int d_numConnectionsAllocated; - ///< Dynamic array size for d_peer and d_peerGrantedLock. - - vrpn_uint32 d_myIP; - vrpn_uint32 d_myPort; - vrpn_uint32 d_holderIP; - vrpn_int32 d_holderPort; - - vrpn_int32 d_myId; - vrpn_int32 d_request_type; - vrpn_int32 d_release_type; - vrpn_int32 d_grantRequest_type; - vrpn_int32 d_denyRequest_type; - // vrpn_int32 d_losePeer_type; - - static int VRPN_CALLBACK handle_request(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_release(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_grantRequest(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_denyRequest(void *, vrpn_HANDLERPARAM); - - static int VRPN_CALLBACK handle_losePeer(void *, vrpn_HANDLERPARAM); - - void sendRequest(vrpn_Connection *); - void sendRelease(vrpn_Connection *); - void sendGrantRequest(vrpn_Connection *, vrpn_uint32 IPnumber, - vrpn_uint32 PortNumber); - void sendDenyRequest(vrpn_Connection *, vrpn_uint32 IPnumber, - vrpn_uint32 PortNumber); - - void triggerGrantCallbacks(void); - void triggerDenyCallbacks(void); - void triggerTakeCallbacks(void); - void triggerReleaseCallbacks(void); - - void checkGrantMutex(void); - - void init(const char *name); - - struct mutexCallback { - int (*f)(void *); - void *userdata; - mutexCallback *next; - }; - - mutexCallback *d_reqGrantedCB; - mutexCallback *d_reqDeniedCB; - mutexCallback *d_takeCB; - mutexCallback *d_releaseCB; - - struct peerData { - vrpn_uint32 IPaddress; - vrpn_uint32 port; - vrpn_bool grantedLock; - }; - - peerData *d_peerData; - ///< Needed only to clean up when a peer shuts down (mid-request). - ///< It isn't currently feasible to have all this data, so instead - ///< we abort requests that were interrupted by a shutdown. - - vrpn_PeerMutex(const char *name, vrpn_Connection *c); - ///< This constructor reuses a SERVER connection for the mutex. - ///< BUG BUG BUG - do not use this constructor; it does not reliably - ///< resolve race conditions. -}; - -#endif // VRPN_MUTEX_H diff --git a/src/vrpn/vrpn_NationalInstruments.C b/src/vrpn/vrpn_NationalInstruments.C deleted file mode 100644 index 2becfa1088472b30f3354045c38857ab21713536..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_NationalInstruments.C +++ /dev/null @@ -1,777 +0,0 @@ -#include <stdio.h> // for sprintf, fprintf, stderr, etc -#include "vrpn_Shared.h" // for vrpn_gettimeofday - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_WARNING, etc -#include "vrpn_Connection.h" // for vrpn_HANDLERPARAM, etc -#include "vrpn_NationalInstruments.h" - -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS -#include "server_src/NIUtil.cpp" -#endif - - -vrpn_National_Instruments_Server::vrpn_National_Instruments_Server (const char* name, vrpn_Connection * c, - const char *boardName, - int numInChannels, int numOutChannels, - double minInputReportDelaySecs, - bool inBipolar, int inputMode, int inputRange, bool driveAIS, int inputGain, - bool outBipolar, double minOutVoltage, double maxOutVoltage) : - vrpn_Analog(name, c), - vrpn_Analog_Output(name, c), -#if defined(VRPN_USE_NATIONAL_INSTRUMENTS_MX) - d_analog_task_handle(0), - d_analog_out_task_handle(0), -#else - d_device_number(-1), -#endif - d_out_min_voltage(minOutVoltage), - d_out_max_voltage(maxOutVoltage), - d_in_min_delay(minInputReportDelaySecs), - d_in_gain(inputGain) -{ - // Set the polarity. 0 is bipolar, 1 is unipolar. - if (inBipolar) { - d_in_polarity = 0; - } else { - d_in_polarity = 1; - } - if (outBipolar) { - d_out_polarity = 0; - } else { - d_out_polarity = 1; - } - - setNumInChannels( numInChannels ); - setNumOutChannels( numOutChannels ); - -#if defined(VRPN_USE_NATIONAL_INSTRUMENTS_MX) - char portName[1024]; - int32 error=0; - - // Input mode that we are using - int32 terminalConfig; - switch(inputMode) { - case vrpn_NI_INPUT_MODE_DIFFERENTIAL: - terminalConfig = DAQmx_Val_Diff; - break; - case vrpn_NI_INPUT_MODE_REF_SINGLE_ENDED: - terminalConfig = DAQmx_Val_RSE; - break; - case vrpn_NI_INPUT_MODE_NON_REF_SINGLE_ENDED: - terminalConfig = DAQmx_Val_NRSE; - break; - default: - fprintf(stderr,"vrpn_National_Instruments_Server::vrpn_National_Instruments_Server(): Invalid inputMode (%d)\n", inputMode); - return; - } - - // Minimum and maximum values that we expect to read. - // Set the high end of the voltage range. If we're bipolar, then - // we get half the range above and half below zero. - double min_val = 0.0, max_val = inputRange; - if (inBipolar) { - min_val = -max_val/2; - max_val = max_val/2; - } - - // If we are going analog input, then we specify the range of input - // ports that we use from 0 through the number requested. We make a - // task to handle reading of these channels as a group. We then - // start this task. - if (numInChannels > 0) { - sprintf(portName, "%s/ai0:%d", boardName, numInChannels-1); - error = DAQmxCreateTask("", &d_analog_task_handle); - if (error == 0) { - error = DAQmxCreateAIVoltageChan( - d_analog_task_handle // The handle we'll use to read values - , portName // Device name and port range - , "" // Our nickname for the channel - , terminalConfig // Single-ended vs. differentil - , min_val, max_val // Range of values we expect to read - , DAQmx_Val_Volts, "" // Units, no custom scale - ); - if (error == 0) { - fprintf(stderr,"vrpn_National_Instruments_Server::vrpn_National_Instruments_Server(): Cannot create input voltage channel\n"); - error = DAQmxStartTask(d_analog_task_handle); - } - } - if (error) { - fprintf(stderr,"vrpn_National_Instruments_Server::vrpn_National_Instruments_Server(): Cannot create input voltage task\n"); - reportError(error); - return; - } - } - - // If we are going analog output, then we specify the range of output - // ports that we use from 0 through the number requested. We make a - // task to handle writing of these channels as a group. Start the - // task. Also, set the outputs to their minimum value at startup. - if (numOutChannels > 0) { - sprintf(portName, "%s/ao0:%d", boardName, numOutChannels-1); - error = DAQmxCreateTask("", &d_analog_out_task_handle); - if (error == 0) { - error = DAQmxCreateAOVoltageChan( - d_analog_out_task_handle // The handle we'll use to write values - , portName // Device name and port range - , "" // Our nickname for the channel - , minOutVoltage, maxOutVoltage// Range of values we expect to write - , DAQmx_Val_Volts, "" // Units, no custom scale - ); - if (error) { - fprintf(stderr,"vrpn_National_Instruments_Server::vrpn_National_Instruments_Server(): Cannot create output voltage channel\n"); - reportError(error); - return; - } - } - if (error == 0) { - error = DAQmxStartTask(d_analog_out_task_handle); - } - if (error) { - fprintf(stderr,"vrpn_National_Instruments_Server::vrpn_National_Instruments_Server(): Cannot create or start output voltage task\n"); - reportError(error); - return; - } - - // Set the output values to zero or to the minimum if the minimum - // is above 0. Also send these values to the board. - float64 minval = 0.0; - if (minval < minOutVoltage) { minval = minOutVoltage; } - int i; - for (i = 0; i < vrpn_Analog_Output::o_num_channel; i++) { - vrpn_Analog_Output::o_channel[i] = minval; - } - if (!setValues()) { - fprintf(stderr, "vrpn_National_Instruments_Server::vrpn_National_Instruments_Server(): Could not set values\n"); - return; - } - } - -#elif defined(VRPN_USE_NATIONAL_INSTRUMENTS) - short i; - short update_mode = 0; //< Mode 0 is immediate - short ref_source = 0; //< Reference source, 0 = internal, 1 = external - double ref_voltage = 10.0; - - // Open the board - d_device_number = NIUtil::findDevice(boardName); - if (d_device_number == -1) { - fprintf(stderr, "vrpn_National_Instruments_Server: Error opening the D/A board %s\n", boardName); - return; - } - - // Set the parameters for each input channel. - if (vrpn_Analog::num_channel > 0) { - int ret = AI_Clear(d_device_number); - if (ret < 0) { - fprintf(stderr,"vrpn_National_Instruments_Server: Cannot clear analog input (error %d)\n", ret); - setNumInChannels(0); - } - } - for (i = 0; i < vrpn_Analog::num_channel; i++) { - int ret = AI_Configure(d_device_number, i, inputMode, inputRange, d_in_polarity, driveAIS); - if (ret < 0) { - fprintf(stderr,"vrpn_National_Instruments_Server: Cannot configure input channel %d (error %d)\n", i, ret); - setNumInChannels(0); - break; - } - } - - // Set the parameters for each output channel. Set the voltage for each channel to the minimum. - for (i = 0; i < o_num_channel; i++) { - - int ret = AO_Configure(d_device_number, i, d_out_polarity, ref_source, ref_voltage, update_mode); - // Code -10403 shows up but did not cause problems for the NI server, so we ignore it (probably at our peril) - if ( (ret < 0) && (ret != -10403) ) { - fprintf(stderr,"vrpn_National_Instruments_Server: Cannot configure output channel %d (error %d)\n", i, ret); - fprintf(stderr," polarity: %d, reference source: %d, reference_voltage: %lg, update_mode: %d\n", - d_out_polarity, ref_source, ref_voltage, update_mode); - setNumOutChannels(0); - break; - } - - if (AO_VWrite(d_device_number, i, d_out_min_voltage)) { - fprintf(stderr,"vrpn_National_Instruments_Server: Cannot set output channel %d to %lg\n", i, d_out_min_voltage); - setNumOutChannels(0); - } - } - -#else - fprintf(stderr,"vrpn_National_Instruments_Server: Support for NI not compiled in, edit vrpn_Configure.h and recompile VRPN\n"); -#endif - - // Check if we have a connection - if (d_connection == NULL) { - fprintf(stderr, "vrpn_National_Instruments_Server: Can't get connection!\n"); - } - - // Register a handler for the request channel change message - if (register_autodeleted_handler(request_m_id, - handle_request_message, this, d_sender_id)) { - fprintf(stderr,"vrpn_Analog_Output_Server_NI: can't register change channel request handler\n"); - d_connection = NULL; - } - - // Register a handler for the request channels change message - if (register_autodeleted_handler(request_channels_m_id, - handle_request_channels_message, this, d_sender_id)) { - fprintf(stderr,"vrpn_Analog_Output_Server_NI: can't register change channels request handler\n"); - d_connection = NULL; - } - - // Register a handler for vrpn_got_connection, so we can tell the - // client how many channels are active - if( register_autodeleted_handler( got_connection_m_id, handle_got_connection, this ) ) - { - fprintf( stderr, "vrpn_Analog_Output_Server_NI: can't register new connection handler\n"); - d_connection = NULL; - } - - // No report yet sent. - d_last_report_time.tv_sec = 0; - d_last_report_time.tv_usec = 0; -} - -// virtual -vrpn_National_Instruments_Server::~vrpn_National_Instruments_Server() -{ -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX - if( d_analog_task_handle != 0 ) - { - /*********************************************/ - // DAQmx Stop Code - /*********************************************/ - DAQmxStopTask(d_analog_task_handle); - DAQmxClearTask(d_analog_task_handle); - d_analog_task_handle = 0 ; - } - - if( d_analog_out_task_handle != 0 ) - { - /*********************************************/ - // DAQmx Stop Code - /*********************************************/ - DAQmxStopTask(d_analog_out_task_handle); - DAQmxClearTask(d_analog_out_task_handle); - d_analog_out_task_handle = 0 ; - } -#endif -} - -// virtual -void vrpn_National_Instruments_Server::mainloop(void) -{ - // Let the server code do its thing (ping/pong messages) - server_mainloop(); - - // See if it has been long enough since we sent the last report. - // If so, then read the channels and send a new report. - struct timeval now; - vrpn_gettimeofday(&now, NULL); - if (vrpn_TimevalDurationSeconds(now, d_last_report_time) >= d_in_min_delay) { - d_last_report_time = now; - -#if defined(VRPN_USE_NATIONAL_INSTRUMENTS_MX) - // Read one complete set of channel values from the board and store - // the results (which are already in volts) into the channels. - if (vrpn_Analog::num_channel > 0) { - int32 error; - int32 channelsRead = 0; - float64 data[vrpn_CHANNEL_MAX]; - error = DAQmxReadAnalogF64(d_analog_task_handle, 1, 1.0, DAQmx_Val_GroupByChannel, - data, vrpn_CHANNEL_MAX, &channelsRead, NULL); - if (channelsRead != vrpn_Analog::num_channel) { - send_text_message("vrpn_National_Instruments_Server::mainloop(): Cannot read channel", now, vrpn_TEXT_ERROR); - setNumInChannels(0); - return; - } - if (error) { - reportError(error); - return; - } - int i; - for (i = 0; i < channelsRead; i++) { - channel[i] = data[i]; - } - } - -#elif defined(VRPN_USE_NATIONAL_INSTRUMENTS) - // Read from the board, convert to volts, and store in the channel array - i16 value; - int i; - for (i = 0; i < vrpn_Analog::num_channel; i++) { - int ret = AI_Read(d_device_number, i, d_in_gain, &value); - if (ret != 0) { - send_text_message("vrpn_National_Instruments_Server::mainloop(): Cannot read channel", now, vrpn_TEXT_ERROR); - setNumInChannels(0); - return; - } - if(0 == d_in_polarity){ //Bipolar: We multiply by 10, but it will only go halfway (it is signed). - channel[i] = (value / 65536.0) * (10.0 / d_in_gain); - } else { //Unipolar (cast it to unsigned, so it will be from zero to almost 10 volts). - channel[i] = ((vrpn_uint16)value / 65536.0) * (10.0 / d_in_gain); - } - } -#endif - - // Send a report. - vrpn_Analog::report(); - } -} - -int vrpn_National_Instruments_Server::setNumInChannels (int sizeRequested) { - if (sizeRequested < 0) sizeRequested = 0; - if (sizeRequested > vrpn_CHANNEL_MAX) sizeRequested = vrpn_CHANNEL_MAX; - vrpn_Analog::num_channel = sizeRequested; - - return vrpn_Analog::num_channel; -} - -int vrpn_National_Instruments_Server::setNumOutChannels (int sizeRequested) { - if (sizeRequested < 0) sizeRequested = 0; - if (sizeRequested > vrpn_CHANNEL_MAX) sizeRequested = vrpn_CHANNEL_MAX; - - o_num_channel = sizeRequested; - return o_num_channel; -} - -/* static */ -int VRPN_CALLBACK vrpn_National_Instruments_Server::handle_request_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - const char* bufptr = p.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_float64 value; - vrpn_National_Instruments_Server* me = (vrpn_National_Instruments_Server*)userdata; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - vrpn_unbuffer(&bufptr, &value); - - // Set the appropriate value, if the channel number is in the - // range of the ones we have. - if ( (chan_num < 0) || (chan_num >= me->o_num_channel) ) { - char msg[1024]; - sprintf( msg, "Error: (handle_request_message): channel %d is not active. Squelching.", chan_num ); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_ERROR ); - return 0; - } - // Make sure the voltage value is within the allowed range. - if (value < me->d_out_min_voltage) { - char msg[1024]; - sprintf( msg, "Error: (handle_request_message): voltage %g is too low. Clamping to %g.", value, me->d_out_min_voltage); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_WARNING ); - value = me->d_out_min_voltage; - } - if (value > me->d_out_max_voltage) { - char msg[1024]; - sprintf( msg, "Error: (handle_request_message): voltage %g is too high. Clamping to %g.", value, me->d_out_max_voltage); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_WARNING ); - value = me->d_out_max_voltage; - } - me->o_channel[chan_num] = value; - - // Send the new value to the D/A board -#if defined(VRPN_USE_NATIONAL_INSTRUMENTS_MX) - if (!me->setValues()) { - me->send_text_message( "vrpn_National_Instruments_Server::handle_request_message(): Could not set values", p.msg_time, vrpn_TEXT_ERROR ); - return -1; - } - -#elif defined(VRPN_USE_NATIONAL_INSTRUMENTS) - if (me->d_device_number != -1) { - AO_VWrite(me->d_device_number, (short)(chan_num), value); - } -#endif - return 0; -} - -/* static */ -int vrpn_National_Instruments_Server::handle_request_channels_message(void* userdata, - vrpn_HANDLERPARAM p) -{ - const char* bufptr = p.buffer; - vrpn_int32 num; - vrpn_int32 pad; - vrpn_National_Instruments_Server* me = (vrpn_National_Instruments_Server*)userdata; - vrpn_int32 chan_num; - vrpn_float64 value; - - // Read the values from the buffer - vrpn_unbuffer(&bufptr, &num); - vrpn_unbuffer(&bufptr, &pad); - if (num > me->o_num_channel) - { - char msg[1024]; - sprintf( msg, "Error: (handle_request_channels_message): channels above %d not active; " - "bad request up to channel %d. Squelching.", me->o_num_channel, num ); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_ERROR ); - num = me->o_num_channel; - } - if (num < 0) - { - char msg[1024]; - sprintf( msg, "Error: (handle_request_channels_message): invalid channel %d. Squelching.", num ); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_ERROR ); - return 0; - } - for (chan_num = 0; chan_num < num; chan_num++) { - vrpn_unbuffer(&bufptr, &value); - - // Make sure the voltage value is within the allowed range. - if (value < me->d_out_min_voltage) { - char msg[1024]; - sprintf( msg, "Error: (handle_request_messages): voltage %g is too low. Clamping to %g.", value, me->d_out_min_voltage); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_WARNING ); - value = me->d_out_min_voltage; - } - if (value > me->d_out_max_voltage) { - char msg[1024]; - sprintf( msg, "Error: (handle_request_messages): voltage %g is too high. Clamping to %g.", value, me->d_out_max_voltage); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_WARNING ); - value = me->d_out_max_voltage; - } - me->o_channel[chan_num] = value; - - // Send the new value to the D/A board -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS - if (me->d_device_number != -1) { - AO_VWrite(me->d_device_number, (short)(chan_num), value); - } -#endif - } - -#if defined(VRPN_USE_NATIONAL_INSTRUMENTS_MX) - if (!me->setValues()) { - me->send_text_message( "vrpn_National_Instruments_Server::handle_request_channels_message(): Could not set values", p.msg_time, vrpn_TEXT_ERROR ); - return -1; - } -#endif - - return 0; -} - -#if defined(VRPN_USE_NATIONAL_INSTRUMENTS_MX) -bool vrpn_National_Instruments_Server::setValues() { - // Send all current values to the board, including the - // changed one. - float64 outbuffer[vrpn_CHANNEL_MAX]; - int i; - for (i = 0; i < vrpn_Analog_Output::o_num_channel ; i++) { - outbuffer[i] = vrpn_Analog_Output::o_channel[i]; - } - int32 error; - error = DAQmxWriteAnalogF64(d_analog_out_task_handle, 1, true, 1.0, - DAQmx_Val_GroupByChannel, outbuffer, NULL, NULL); - if (error) { - reportError(error); - return false; - } - /* - printf("Debug: Setting %d channels:", o_num_channel); - for (i = 0; i < o_num_channel; i++) { - printf(" %lg", outbuffer[i]); - } - printf("\n"); - */ - return true; -} -#endif - -/* static */ -int VRPN_CALLBACK vrpn_National_Instruments_Server::handle_got_connection( void* userdata, vrpn_HANDLERPARAM ) -{ - vrpn_National_Instruments_Server* me = (vrpn_National_Instruments_Server*) userdata; - if( me->report_num_channels( ) == false ) { - fprintf( stderr, "Error: failed sending active channels to client.\n" ); - } - return 0; -} - -bool vrpn_National_Instruments_Server::report_num_channels( vrpn_uint32 class_of_service ) -{ - char msgbuf[ sizeof( vrpn_int32) ]; - vrpn_int32 len = sizeof( vrpn_int32 );; - - encode_num_channels_to( msgbuf, o_num_channel ); - vrpn_gettimeofday( &o_timestamp, NULL ); - if( d_connection && - d_connection->pack_message( len, o_timestamp, report_num_channels_m_id, - d_sender_id, msgbuf, class_of_service ) ) - { - fprintf(stderr, "vrpn_Analog_Output_Server_NI (report_num_channels): cannot write message: tossing\n"); - return false; - } - return true; -} - - -vrpn_int32 vrpn_National_Instruments_Server::encode_num_channels_to( char* buf, vrpn_int32 num ) -{ - // Message includes: int32 number of active channels - int buflen = sizeof(vrpn_int32); - - vrpn_buffer(&buf, &buflen, num); - return sizeof(vrpn_int32); -} - -vrpn_Analog_Output_Server_NI::vrpn_Analog_Output_Server_NI(const char* name, vrpn_Connection * c, - const char *boardName, - vrpn_int16 numChannels, bool bipolar, - double minVoltage, double maxVoltage) : - vrpn_Analog_Output(name, c), - NI_device_number(-1), - min_voltage(minVoltage), - max_voltage(maxVoltage), - NI_num_channels(numChannels) -{ -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS - short i; - short update_mode = 0; //< Mode 0 is immediate - short ref_source = 0; //< Reference source, 0 = internal, 1 = external - double ref_voltage = 0.0; - - // Set the polarity - if (bipolar) { - polarity = 0; - } else { - polarity = 1; - } - - // Open the D/A board and set the parameters for each channel. Set the voltage for each - // channel to the minimum. - NI_device_number = NIUtil::findDevice(boardName); - if (NI_device_number == -1) { - fprintf(stderr, "vrpn_Analog_Output_Server_NI: Error opening the D/A board %s\n", boardName); - return; - } - for (i = 0; i < NI_num_channels; i++) { - AO_Configure(NI_device_number, i, polarity, ref_source, ref_voltage, - update_mode); -/* - fprintf(stderr,"Configuring channel %d, polarity: %d, reference source: %d, reference_voltage: %lg, update_mode: %d\n", - i, polarity, ref_source, ref_voltage, update_mode); -*/ - AO_VWrite(NI_device_number, i, min_voltage); - } - - - setNumChannels( numChannels ); - - // Check if we have a connection - if (d_connection == NULL) { - fprintf(stderr, "vrpn_Analog_Output_Server_NI: Can't get connection!\n"); - } - - // Register a handler for the request channel change message - if (register_autodeleted_handler(request_m_id, - handle_request_message, this, d_sender_id)) { - fprintf(stderr,"vrpn_Analog_Output_Server_NI: can't register change channel request handler\n"); - d_connection = NULL; - } - - // Register a handler for the request channels change message - if (register_autodeleted_handler(request_channels_m_id, - handle_request_channels_message, this, d_sender_id)) { - fprintf(stderr,"vrpn_Analog_Output_Server_NI: can't register change channels request handler\n"); - d_connection = NULL; - } - - // Register a handler for vrpn_got_connection, so we can tell the - // client how many channels are active - if( register_autodeleted_handler( got_connection_m_id, handle_got_connection, this ) ) - { - fprintf( stderr, "vrpn_Analog_Output_Server_NI: can't register new connection handler\n"); - d_connection = NULL; - } -#else - fprintf(stderr,"vrpn_Analog_Output_Server_NI: Support for NI not compiled in, edit vrpn_Configure.h and recompile\n"); -#endif -} - -// virtual -vrpn_Analog_Output_Server_NI::~vrpn_Analog_Output_Server_NI(void) {} - -// virtual -void vrpn_Analog_Output_Server_NI::mainloop(void) -{ - // Let the server code do its thing (ping/pong messages) - server_mainloop(); -} - -vrpn_int32 vrpn_Analog_Output_Server_NI::setNumChannels (vrpn_int32 sizeRequested) { - if (sizeRequested < 0) sizeRequested = 0; - if (sizeRequested > vrpn_CHANNEL_MAX) sizeRequested = vrpn_CHANNEL_MAX; - - o_num_channel = sizeRequested; - - return o_num_channel; -} - -/* static */ -int VRPN_CALLBACK vrpn_Analog_Output_Server_NI::handle_request_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - const char* bufptr = p.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_float64 value; - vrpn_Analog_Output_Server_NI* me = (vrpn_Analog_Output_Server_NI*)userdata; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - vrpn_unbuffer(&bufptr, &value); - - // Set the appropriate value, if the channel number is in the - // range of the ones we have. - if ( (chan_num < 0) || (chan_num >= me->o_num_channel) ) { - char msg[1024]; - sprintf( msg, "Error: (handle_request_message): channel %d is not active. Squelching.", chan_num ); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_ERROR ); - return 0; - } - // Make sure the voltage value is within the allowed range. - if (value < me->min_voltage) { - char msg[1024]; - sprintf( msg, "Error: (handle_request_message): voltage %g is too low. Clamping to %g.", value, me->min_voltage); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_WARNING ); - value = me->min_voltage; - } - if (value > me->max_voltage) { - char msg[1024]; - sprintf( msg, "Error: (handle_request_message): voltage %g is too high. Clamping to %g.", value, me->max_voltage); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_WARNING ); - value = me->max_voltage; - } - me->o_channel[chan_num] = value; - - // Send the new value to the D/A board -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS - if (me->NI_device_number != -1) { - AO_VWrite(me->NI_device_number, (short)(chan_num), value); - } -#endif - return 0; -} - -/* static */ -int vrpn_Analog_Output_Server_NI::handle_request_channels_message(void* userdata, - vrpn_HANDLERPARAM p) -{ - const char* bufptr = p.buffer; - vrpn_int32 num; - vrpn_int32 pad; - vrpn_Analog_Output_Server_NI* me = (vrpn_Analog_Output_Server_NI*)userdata; - vrpn_int32 chan_num; - vrpn_float64 value; - - // Read the values from the buffer - vrpn_unbuffer(&bufptr, &num); - vrpn_unbuffer(&bufptr, &pad); - if (num > me->o_num_channel) - { - char msg[1024]; - sprintf( msg, "Error: (handle_request_channels_message): channels above %d not active; " - "bad request up to channel %d. Squelching.", me->o_num_channel, num ); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_ERROR ); - num = me->o_num_channel; - } - if (num < 0) - { - char msg[1024]; - sprintf( msg, "Error: (handle_request_channels_message): invalid channel %d. Squelching.", num ); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_ERROR ); - return 0; - } - for (chan_num = 0; chan_num < num; chan_num++) { - vrpn_unbuffer(&bufptr, &value); - - // Make sure the voltage value is within the allowed range. - if (value < me->min_voltage) { - char msg[1024]; - sprintf( msg, "Error: (handle_request_messages): voltage %g is too low. Clamping to %g.", value, me->min_voltage); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_WARNING ); - value = me->min_voltage; - } - if (value > me->max_voltage) { - char msg[1024]; - sprintf( msg, "Error: (handle_request_messages): voltage %g is too high. Clamping to %g.", value, me->max_voltage); - me->send_text_message( msg, p.msg_time, vrpn_TEXT_WARNING ); - value = me->max_voltage; - } - me->o_channel[chan_num] = value; - - // Send the new value to the D/A board -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS - if (me->NI_device_number != -1) { - AO_VWrite(me->NI_device_number, (short)(chan_num), value); - } -#endif - } - - return 0; -} - - -/* static */ -int VRPN_CALLBACK vrpn_Analog_Output_Server_NI::handle_got_connection( void* userdata, vrpn_HANDLERPARAM ) -{ - vrpn_Analog_Output_Server_NI* me = (vrpn_Analog_Output_Server_NI*) userdata; - if( me->report_num_channels( ) == false ) - { - fprintf( stderr, "Error: failed sending active channels to client.\n" ); - } - return 0; -} - - -bool vrpn_Analog_Output_Server_NI::report_num_channels( vrpn_uint32 class_of_service ) -{ - char msgbuf[ sizeof( vrpn_int32) ]; - vrpn_int32 len = sizeof( vrpn_int32 );; - - encode_num_channels_to( msgbuf, o_num_channel ); - vrpn_gettimeofday( &o_timestamp, NULL ); - if( d_connection && - d_connection->pack_message( len, o_timestamp, report_num_channels_m_id, - d_sender_id, msgbuf, class_of_service ) ) - { - fprintf(stderr, "vrpn_Analog_Output_Server_NI (report_num_channels): cannot write message: tossing\n"); - return false; - } - return true; -} - - -vrpn_int32 vrpn_Analog_Output_Server_NI:: -encode_num_channels_to( char* buf, vrpn_int32 num ) -{ - // Message includes: int32 number of active channels - int buflen = sizeof(vrpn_int32); - - vrpn_buffer(&buf, &buflen, num); - return sizeof(vrpn_int32); -} - -// This handles error reporting -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX -void vrpn_National_Instruments_Server::reportError(int32 errnumber, vrpn_bool exitProgram) -{ - char errBuff[2048]={'\0'}; - - if( DAQmxFailed(errnumber) ) - { - DAQmxGetExtendedErrorInfo(errBuff,2048); - printf("DAQmx Error: %s\n",errBuff); - if (exitProgram==vrpn_true) { - printf("Exiting...\n") ; - throw(errnumber) ; // this will quit, cause the destructor to be called - } else { - printf("Sleeping...\n") ; - vrpn_SleepMsecs(1000.0*1) ; // so at least the log will slow down so someone can see the error - } - } -} // reportError -#endif diff --git a/src/vrpn/vrpn_NationalInstruments.h b/src/vrpn/vrpn_NationalInstruments.h deleted file mode 100644 index bc9a3e61dedbd82125843168890c7a277fe2ce06..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_NationalInstruments.h +++ /dev/null @@ -1,149 +0,0 @@ -// vrpn_NationalInstruments.h -// Russell Taylor, May 2004 -// - -#ifndef VRPN_NATIONALINSTRUMENTS_H -#define VRPN_NATIONALINSTRUMENTS_H - -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX -#include <NIDAQmx.h> -#endif - -#include "vrpn_Analog.h" // for vrpn_CHANNEL_MAX, etc -#include "vrpn_Analog_Output.h" // for vrpn_Analog_Output -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Connection.h" -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_int32, vrpn_uint32, etc - -#define vrpn_NI_INPUT_MODE_DIFFERENTIAL (0) -#define vrpn_NI_INPUT_MODE_REF_SINGLE_ENDED (1) -#define vrpn_NI_INPUT_MODE_NON_REF_SINGLE_ENDED (2) -#define vrpn_NI_INPUT_RANGE_5V (5) -#define vrpn_NI_INPUT_RANGE_10V (10) -#define vrpn_NI_INPUT_RANGE_20V (20) - -// An Analog and/or Analog_Output server that uses National Instruments cards -// to do its input and output. It supercedes the vrpn_Analog_Output_Server_NI, -// which is now depracated. - -class VRPN_API vrpn_National_Instruments_Server : public vrpn_Analog, public vrpn_Analog_Output { -public: - vrpn_National_Instruments_Server(const char* name, vrpn_Connection* c, - const char *boardName = "PCI-6713", - int numInChannels = vrpn_CHANNEL_MAX, - int numOutChannels = vrpn_CHANNEL_MAX, - double minInputReportDelaySecs = 0.0, - bool inBipolar = false, - int inputMode = vrpn_NI_INPUT_MODE_DIFFERENTIAL, // Input parameters (A/D) - int inputRange = vrpn_NI_INPUT_RANGE_10V, - bool driveAIS = false, - int inputGain = 1, - bool outBipolar = false, // Output parameters (D/A) - double minOutVoltage = 0.0, - double maxOutVoltage = 10.0); - virtual ~vrpn_National_Instruments_Server(); - - virtual void mainloop(); - -protected: - // Addresses of the devices -#ifdef VRPN_USE_NATIONAL_INSTRUMENTS_MX - TaskHandle d_analog_task_handle; - TaskHandle d_analog_out_task_handle; - bool setValues(); // Transfer our internal values to the D/A - void reportError(int32 errnumber, vrpn_bool exitProgram = vrpn_false); -#else - short d_device_number; //< National Instruments device to use -#endif - short d_in_polarity; //< Polarity (1 = unipolar, 0 = bipolar) - int d_in_gain; //< Input gain - double d_in_min_delay; //< Minimum delay between two readings - double d_out_min_voltage; //< Minimum voltage allowed on a channel - double d_out_max_voltage; //< Maximum voltate allowed on a channel - short d_out_polarity; //< Polarity (1 = unipolar, 0 = bipolar) - struct timeval d_last_report_time;//< When was the last analog tracker report sent? - - /// Sets the size of the array; returns the size actually set. - /// (May be clamped to vrpn_CHANNEL_MAX) - /// This should be used before mainloop is ever called. - int setNumInChannels (int sizeRequested); - - /// Sets the size of the array; returns the size actually set. - /// (May be clamped to vrpn_CHANNEL_MAX) - /// This should be used before mainloop is ever called. - int setNumOutChannels (int sizeRequested); - - /// Responds to a request to the AnalogOutput to change one of the values by - /// setting the channel to that value. Derived class must - /// either install handlers for this routine or else make - /// its own routines to handle the request message. - static int VRPN_CALLBACK handle_request_message( void *userdata, - vrpn_HANDLERPARAM p ); - - /// Responds to a request to change a number of channels - /// Derived class must either install handlers for this - /// routine or else make its own routines to handle the - /// multi-channel request message. - static int VRPN_CALLBACK handle_request_channels_message( void* userdata, - vrpn_HANDLERPARAM p); - - /// Used to notify us when a new connection is requested, so that - /// we can let the client know how many channels are active - static int VRPN_CALLBACK handle_got_connection( void* userdata, vrpn_HANDLERPARAM p ); - - virtual bool report_num_channels( vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE ); - virtual vrpn_int32 encode_num_channels_to( char* buf, vrpn_int32 num ); -}; - -// An Analog output server that uses National Instruments cards to do its -// output. It is superceded by vrpn_National_Instruments_Server, and is -// now deprecated. It only works with the NIDAQ traditional. - -class VRPN_API vrpn_Analog_Output_Server_NI : public vrpn_Analog_Output { -public: - vrpn_Analog_Output_Server_NI(const char* name, vrpn_Connection* c, - const char *boardName = "PCI-6713", - vrpn_int16 numChannels = vrpn_CHANNEL_MAX, - bool bipolar = false, - double minVoltage = 0.0, - double maxVoltage = 10.0); - virtual ~vrpn_Analog_Output_Server_NI(void); - - virtual void mainloop(); - -protected: - short NI_device_number; //< National Instruments device to use - short NI_num_channels; //< Number of channels on the board - double min_voltage; //< Minimum voltage allowed on a channel - double max_voltage; //< Maximum voltate allowed on a channel - short polarity; //< Polarity (1 = unipolar, 0 = bipolar) - - /// Sets the size of the array; returns the size actually set. - /// (May be clamped to vrpn_CHANNEL_MAX) - /// This should be used before mainloop is ever called. - vrpn_int32 setNumChannels (vrpn_int32 sizeRequested); - - /// Responds to a request to change one of the values by - /// setting the channel to that value. Derived class must - /// either install handlers for this routine or else make - /// its own routines to handle the request message. - static int VRPN_CALLBACK handle_request_message( void *userdata, - vrpn_HANDLERPARAM p ); - - /// Responds to a request to change a number of channels - /// Derived class must either install handlers for this - /// routine or else make its own routines to handle the - /// multi-channel request message. - static int VRPN_CALLBACK handle_request_channels_message( void* userdata, - vrpn_HANDLERPARAM p); - - /// Used to notify us when a new connection is requested, so that - /// we can let the client know how many channels are active - static int VRPN_CALLBACK handle_got_connection( void* userdata, vrpn_HANDLERPARAM p ); - - virtual bool report_num_channels( vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE ); - virtual vrpn_int32 encode_num_channels_to( char* buf, vrpn_int32 num ); -}; - -#endif diff --git a/src/vrpn/vrpn_Nidaq.C b/src/vrpn/vrpn_Nidaq.C deleted file mode 100644 index a07f68dc39e5f21e9622078fa27ca6e107f93384..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Nidaq.C +++ /dev/null @@ -1,201 +0,0 @@ -/*****************************************************************************\ - vrpn_Nidaq.C - -- - Description : - - ---------------------------------------------------------------------------- - Author: weberh - Created: Fri Jan 29 10:00:00 1999 - Revised: Fri Mar 19 14:46:06 1999 by weberh -\*****************************************************************************/ - -#include "vrpn_Nidaq.h" -#if defined(WIN32) || defined(_WIN32) -#if defined(VRPN_USE_NIDAQ) -#include <uptime.h> - -// for fNice stuff -#include <windows.h> -#include <mmsystem.h> -// link with winmm.lib -#include <process.h> -// must link to multithreaded libs - - -//#define VERBOSE -vrpn_Nidaq::vrpn_Nidaq(char *pchName, vrpn_Connection *pConnection, - double dSamplingRate, double dInterChannelRate, - short sDeviceNumber, int cChannels, - short rgsChan[], short rgsGain[], - short sInputMode, short sPolarity, int fNice) - : vrpn_Analog(pchName, pConnection), pDAQ(NULL), fNice(fNice), fStop(0), - fNewData(0), dSampleTime(0) { - - if (cChannels>vrpn_CHANNEL_MAX) { - cerr << "vrpn_Nidaq::vrpn_Nidaq: vrpn_Analog allows only " - << vrpn_CHANNEL_MAX << " channels (" << cChannels - << " requested). DAQ not initialized." << endl; - return; - } - - if (fNice) { - MMRESULT res = timeBeginPeriod(1); - if (res != TIMERR_NOERROR) { - cerr << "NidaqServer: timeBeginPeriod() failed!!!\n"; - } - } - - num_channel = cChannels; - daqSample.resize(cChannels); - - // calc the approximate offset between the clock the daq class uses - // and the clock vrpn uses. - - // call each to get them in cache - struct timeval tv, tvUpTime; - double dTime1, dTime2; - vrpn_gettimeofday(&tv, NULL); - vrpn_gettimeofday(&tv, NULL); - UpTime::Now(); - UpTime::Now(); - - // Now calc offset - dTime1=UpTime::Now(); - vrpn_gettimeofday(&tv, NULL); - dTime2=UpTime::Now(); - - dTime1 = (dTime1 + dTime2)/2.0; - tvUpTime = vrpn_MsecsTimeval(dTime1*1000.0); - tvOffset = vrpn_TimevalDiff(tv, tvUpTime); - - // later, add this to tvUpTime to get into vrpn_gettimeofday time frame - - // alloc the daq (which also starts it up) - // args are: - // rate for set of channels - // rate between channels - // which device num the daq has been set up as - // the number of channels to read off of it - // the array of channels to read - // the gain to apply to each - // differential or single ended - // bipolar (+/-) or just unipolar (+) - pDAQ = new DAQ(dSamplingRate, dInterChannelRate, sDeviceNumber, cChannels, - rgsChan, rgsGain, sInputMode, sPolarity ); - - // start the DAQ-only thread - InitializeCriticalSection(&csAnalogBuffer); - hDAQThread = (HANDLE) _beginthreadex(NULL, 0, runThread, this, 0, NULL); -} - -// threadshell for code which actually runs "Inertials" -unsigned __stdcall vrpn_Nidaq::runThread(void *pVrpnNidaq) { - ((vrpn_Nidaq *)pVrpnNidaq)->runNidaq(); - return 0; -} - -// here is what Inertials does in its run thread -void vrpn_Nidaq::runNidaq() { - // always service the nidaq, but only pack messages if there is - // a new report and we have a connection. - - // getSample will fill in the report with most recent valid - // data and the time of that data. - // return value is the number of reports processed by - // the a/d card since the last getSample call. - // (if > 1, then we missed a report; if 0, then no new data) - // if gfAllInertial is filled in, then we will grab the intervening - // reports as well (note: gfAllInertial does not work properly as - // of 1/29/99 weberh). - while (!fStop) { - if (pDAQ->getSample(&daqSample)) { - // there is a reading and a connection ... so package it - - // copy daq channels to analog class data - EnterCriticalSection(&csAnalogBuffer); - for (int i=0;i<daqSample.cChannels;i++) { - channel[i]=daqSample.rgd[i]; - } - fNewData=1; - dSampleTime=daqSample.dTime; - LeaveCriticalSection(&csAnalogBuffer); - } - if (fNice) { - Sleep(1); - } - } -} - -vrpn_Nidaq::~vrpn_Nidaq() { - fStop=1; - WaitForSingleObject(hDAQThread,INFINITE); - if (fNice) { - timeEndPeriod(1); - } - delete pDAQ; -} - -void vrpn_Nidaq::mainloop(void) { - server_mainloop(); - report_changes(); -} - -int vrpn_Nidaq::doing_okay() { - return (pDAQ->status()==DAQ::RUNNING); -} - -void vrpn_Nidaq::report_changes() { - // always service the nidaq, but only pack messages if there is - // a new report and we have a connection. - - // getSample will fill in the report with most recent valid - // data and the time of that data. - // return value is the number of reports processed by - // the a/d card since the last getSample call. - // (if > 1, then we missed a report; if 0, then no new data) - // if gfAllInertial is filled in, then we will grab the intervening - // reports as well (note: gfAllInertial does not work properly as - // of 1/29/99 weberh). -#ifdef VERBOSE - int fHadNew=0; -#endif - if (d_connection) { - // there is a reading and a connection ... so package it - - EnterCriticalSection(&csAnalogBuffer); - -#ifdef VERBOSE - fHadNew=fNewData; -#endif - if (fNewData) { - fNewData=0; - // It will actually be sent out when the server calls - // mainloop() on the connection object this device uses. - char rgch[1000]; - int cChars = vrpn_Analog::encode_to(rgch); - double dTime = dSampleTime; - LeaveCriticalSection(&csAnalogBuffer); - - struct timeval tv; - tv = vrpn_TimevalSum(vrpn_MsecsTimeval(dTime*1000.0), - tvOffset); - - if (d_connection->pack_message(cChars, tv, channel_m_id, d_sender_id, rgch, - vrpn_CONNECTION_LOW_LATENCY)) { - cerr << "vrpn_Nidaq::report_changes: cannot write message: tossing.\n"; - } - } else { - LeaveCriticalSection(&csAnalogBuffer); - } -#ifdef VERBOSE - if (fHadNew) { - print(); - } -#endif - - } else { - cerr << "vrpn_Nidaq::report_changes: no valid connection.\n"; - } -} -#endif // def(VRPN_USE_NIDAQ) -#endif // def(WIN32) || def(_WIN32) diff --git a/src/vrpn/vrpn_Nidaq.h b/src/vrpn/vrpn_Nidaq.h deleted file mode 100644 index 4448e61609bc55968bb145fbc0e7008b2130f5a6..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Nidaq.h +++ /dev/null @@ -1,81 +0,0 @@ -/*****************************************************************************\ - vrpn_Nidaq.h - -- - NOTICE: This class is superceded by vrpn_NationalInstruments.h and is - now deprecated. - - Description : This class reads from a National Instruments D/A Card - (NIDAQ). To compile this class, you must have the - following directories in your include path: - ~tracker/hiball/nidaq/ - ~tracker/hiball/src/libs/libgb (for uptime.h) - ~tracker/hiball/src/hybrid/ (for daq.h) - And you must link in: - ~tracker/hiball/src/libs/libgb/uptime.cpp - ~tracker/hiball/src/hybrid/daq.cpp - ~tracker/hiball/nidaq/nidaq32.lib - - ---------------------------------------------------------------------------- - Author: weberh - Created: Fri Jan 29 10:00:00 1999 - Revised: Fri Mar 19 14:45:55 1999 by weberh -\*****************************************************************************/ - -#ifndef VRPN_NIDAQ -#define VRPN_NIDAQ -#if defined(_WIN32) || defined(WIN32) -#if defined(VRPN_USE_NIDAQ) -#include "vrpn_Analog.h" -#include <daq.h> -#include <windows.h> - -class VRPN_API vrpn_Nidaq : public vrpn_Analog { -public: - // see daq.h for more info on the args - // fNice says whether these threads should use 100% of the cpu or - // whether they should sleep for 1 ms each time through their loops - // (the net effect is that they add 1 ms of uncertainty to the - // existing 1 or 1/2 ms of uncertainty in time-stamps across a - // synchronized vrpn connection). If fNice is set, then - // the max theoretical reporting rate is 1000 hz. - vrpn_Nidaq(char * pchName, vrpn_Connection * pConnection, - double dSamplingRate=100.0, double dInterChannelRate=100000.0, - short sDeviceNumber=DAQ::DEF_DEVICE, int cChannels=10, - short rgsChan[]=DAQ::DEF_CHANS_DIFF, - short rgsGain[]=DAQ::DEF_GAINS, - short sInputMode=DAQ::DIFFERENTIAL, - short sPolarity=DAQ::BIPOLAR, - int fNice=0); - - ~vrpn_Nidaq(); - void mainloop(); - int doing_okay(); - -protected: - void report_changes(); - -private: - DAQSample daqSample; - DAQ *pDAQ; - // value to add to UpTime calls to get into vrpn_gettimeofday timeframe - struct timeval tvOffset; - - // Data, threadshell, and function used by extra daq getSample thread. - // the crit section is used to protect the analog buffer from simultaneous - // access by the two nidaq threads. - CRITICAL_SECTION csAnalogBuffer; - HANDLE hDAQThread; - static unsigned __stdcall vrpn_Nidaq::runThread(void *pVrpnNidaq); - void runNidaq(); - int fStop; - int fNewData; - double dSampleTime; - - // this controls whether we give up about 1 ms worth of timestamp accuracy - // in exchange for cpu utilization going from 100% to 4% (or so) - int fNice; -}; - -#endif // def(VRPN_USE_NIDAQ) -#endif // def(_WIN32) || def(WIN32) -#endif // ndef(VRPN_NIDAQ) diff --git a/src/vrpn/vrpn_OmegaTemperature.C b/src/vrpn/vrpn_OmegaTemperature.C deleted file mode 100644 index fed440c24b309636314ea7e476b43098455ade74..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_OmegaTemperature.C +++ /dev/null @@ -1,526 +0,0 @@ -// vrpn_OmegaTemperature.C -// This is a driver for the OmegaTemperature temperature controller. -// It was written in April 2014 by Russ Taylor. - -// INFO about how the device communicates, taken from the user manual: -// This information comes from the Bulletin E-90-OCN publication, which is -// the manual for the Omega Series CN7200, CN7600, CN7800, CN7500 microprocessor -// based temperature process control. It was developed for a CN7800. -// It communicates over RS-485 using the MODBUS ASCII/RTU communications -// protocol. The driver is written for the ASCII protocol. -// A Windows application to test communication with the device can be found -// at http://www.omega.com/Software/CN7-a_r.html - -// A Modbus ASCII frame is as follows (Wikipedia) (big-endian): -// Colon ':' character. -// 2-character station address -// 2-character function code -// (0x03 read register, 0x02 read data bits, 0x06 write register, 0x05 write bit) -// n-character data + length -// 2-character checksum -// 2-character CR/LF (0x0d 0x0a) - -// Modbus application protocol specification: -// http://www.modbus.com/docs/Modbus_Application_Protocol_V1_1b.pdf -// Modbus over serial line document: -// http://modbus.org/docs/Modbus_over_serial_line_V1_02.pdf - -// libmodbus: libmodbus.org has a Modbus library for various operating -// systems. It has ominous statements in the release notes about Windows -// support being broken even in the latest version (3.1.1 on 2013-10-06). -// The latest stable version is 3.0.5; it does not say that it has broken -// support on Windows. It seems to support the serial RTU protocol. -// However, the configure script reports that VC++ support has not been -// tested in a long time; it can be configured and built under Cygwin. - -/* XXX The code has not been changed from the Biosciences code yet, - only the names have been changed. */ - -/* -Using a standard DB-9 cable (female-female connectors on both ends with -straight-through connections from each pin) -connect the controller (middle DB-9 connector) to a serial port of your computer. -Set the serial port at 115,200 speed, 8 bits, 1 stop bit, -NONE parity, and Hardware flow control. -The following is the list of text commands supported. -NOTE: Each command should follow by \r <CR> code: -(The following notes LIE: There is no space before the . or before the C, - and sometimes the C is an E. Also, the order is incorrect. The actual - order is stage 1, bath 1, external 1, stage 2, bath 2, external 2.) -T1<CR> returns temperature readings from STAGE1 sensor: 37 .1 C -T2<CR> returns temperature readings from BATH1 sensor: 36 .9 C -T5<CR> returns SET temperature: 37 .0 C -T3<CR> returns temperature readings from STAGE2 sensor: 37 .1 C -T4<CR> returns temperature readings from BATH2 sensor: 36 .9 C -T6<CR> returns SET temperature: 37 .0 C -CTn<CR> returns readings from n (n=1 - STAGE1, 2 - BATH1, 3 - STAGE2, 4 - BATH2) sensor: 37 .1 C -ON<CR> turns temperature control ON -OFF<CR> turns temperature control OFF -S1 037 0<CR> sets reference temperature for channel I (NOTE: all four digits should be sent to the controller) -S2 037 0<CR> sets reference temperature for channel II -*/ - -#include <stddef.h> // for size_t -#include <stdio.h> // for sprintf, fprintf, stderr, etc -#include <string.h> // for strlen, NULL - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR, etc -#include "vrpn_OmegaTemperature.h" -#include "vrpn_Serial.h" // for vrpn_write_characters, etc -#include "vrpn_Shared.h" // for vrpn_unbuffer, timeval, etc -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_MODBUS) && defined(VRPN_USE_WINSOCK2) - -#undef VERBOSE - -// Defines the modes in which the device can find itself. -#define STATUS_RESETTING (-1) // Resetting the device -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report - -#define TIMEOUT_TIME_INTERVAL (2000000L) // max time between reports (usec) - - -// This creates a vrpn_OmegaTemperature. It opens -// the serial device using the code in the vrpn_Serial_Analog constructor. -// It uses hardware flow control. - -vrpn_OmegaTemperature::vrpn_OmegaTemperature (const char * name, vrpn_Connection * c, - const char * port, float temp1, float temp2, bool control_on): - vrpn_Serial_Analog(name, c, port, 115200, 8, vrpn_SER_PARITY_NONE, true), - vrpn_Analog_Output(name, c), - vrpn_Button_Filter(name, c) -{ - // XXX Make this configurable? - int baud = 38400; - char parity = 'n'; // XXX What should this be? - int stop_bits = 1; - d_modbus = modbus_new_rtu(port, baud, parity, 8, stop_bits); - // XXX No code below has been changed yet. - - num_channel = 6; - o_num_channel = 3; - num_buttons = 1; - buttons[0] = control_on; - - // Fill in the arguments to send to the device at reset time. - o_channel[0] = temp1; - o_channel[1] = temp2; - o_channel[2] = control_on; - - // Set the mode to reset - status = STATUS_RESETTING; - - // Register to receive the message to request changes and to receive connection - // messages. - if (d_connection != NULL) { - if (register_autodeleted_handler(request_m_id, handle_request_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_OmegaTemperature: can't register handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler(request_channels_m_id, handle_request_channels_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_OmegaTemperature: can't register handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler(d_ping_message_id, handle_connect_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_OmegaTemperature: can't register handler\n"); - d_connection = NULL; - } - } else { - fprintf(stderr,"vrpn_OmegaTemperature: Can't get connection!\n"); - } - -} - -// Command format described in document: -// S1 037 0<CR> sets reference temperature for channel 1 -// (NOTE: all four digits should be sent to the controller) -// Actual command format: -// S1 0370<CR> Sets reference temperature for channel 1 to 37.0 deg C -// S2 0421<CR> Sets reference temperature for channel 2 to 42.1 deg C - -bool vrpn_OmegaTemperature::set_reference_temperature(unsigned channel, float value) -{ - char command[128]; - - // Fill in the command with the zero-padded integer output for - // above the decimal and then a single value for the first point - // past the decimal. - int whole = static_cast<int>(value); - int dec = static_cast<int>(value*10) - whole*10; - sprintf(command, "S%d %03d%d\r", channel+1, whole,dec); - - // Send the command to the serial port - return (vrpn_write_characters(serial_fd, (unsigned char *)(command), strlen(command)) == strlen(command)); -} - -// Command format: -// ON<CR> sets control on -// OFF<CR> sets control off - -bool vrpn_OmegaTemperature::set_control_status(bool on) -{ - char command[128]; - - if (on) { - sprintf(command, "ON\r"); - } else { - sprintf(command, "OFF\r"); - } - - // Send the command to the serial port - return (vrpn_write_characters(serial_fd, (unsigned char *)(command), strlen(command)) == strlen(command)); -} - -// Command format: -// T1<CR> returns temperature readings from STAGE1 sensor: 37.1C -// T2<CR> returns temperature readings from BATH1 sensor: 36.9C -// T5<CR> returns SET temperature: 37.0C -// T3<CR> returns temperature readings from STAGE2 sensor: 37.1C -// T4<CR> returns temperature readings from BATH2 sensor: 36.9C -// T6<CR> returns SET temperature: 37.0C -// NOTE: Sometimes the C is an E when there is no reading. - -bool vrpn_OmegaTemperature::request_temperature(unsigned channel) -{ - char command[128]; - - sprintf(command, "T%d\r", channel+1); -#ifdef VERBOSE - printf("Sending command: %s", command); -#endif - - // Send the command to the serial port - return (vrpn_write_characters(serial_fd, (unsigned char *)(command), strlen(command)) == strlen(command)); -} - -// Convert the four bytes that have been read into a signed integer value. -// The format (no quotes) looks like: "- 37.1C\r" or " 000.00E\r". -// I don't think that the - means a minus sign, and it has a space -// between it and the number. -// Returns -1000 if there is an error. -float vrpn_OmegaTemperature::convert_bytes_to_reading(const char *buf) -{ - float val; - char c; - - // Skip any leading minus sign. - if (*buf == '-') { buf++; } - - // Read a fractional number. - if (sscanf(buf, "%f%c", &val, &c) != 2) { - return -1000; - } - - // See if we get and E or C after the number, - // or (since E can be part of a floating-point - // number) if we get \r. - if ( (c != 'E') && (c != 'C') && (c != '\r') ) { - return -1000; - } - - return val; -} - - -int vrpn_OmegaTemperature::reset(void) -{ - //----------------------------------------------------------------------- - // Sleep less thana second and then drain the input buffer to make sure we start - // with a fresh slate. - vrpn_SleepMsecs(200); - vrpn_flush_input_buffer(serial_fd); - - //----------------------------------------------------------------------- - // Set the temperatures for channel 1 and 2 and then set the temperature - // control to be on or off depending on what we've been asked to do. - if (!set_reference_temperature(0, static_cast<float>(o_channel[0]))) { - fprintf(stderr,"vrpn_OmegaTemperature::reset(): Cannot send set ref temp 0, trying again\n"); - return -1; - } - if (!set_reference_temperature(1, static_cast<float>(o_channel[1]))) { - fprintf(stderr,"vrpn_OmegaTemperature::reset(): Cannot send set ref temp 1, trying again\n"); - return -1; - } - if (!set_control_status(o_channel[0] != 0)) { - fprintf(stderr,"vrpn_OmegaTemperature::reset(): Cannot send set control status, trying again\n"); - return -1; - } - - //----------------------------------------------------------------------- - // Send the command to request input from the first channel, and set up - // the finite-state machine so we know which thing to request next. - d_next_channel_to_read = 0; - if (!request_temperature(d_next_channel_to_read)) { - fprintf(stderr,"vrpn_OmegaTemperature::reset(): Cannot request temperature, trying again\n"); - return -1; - } - - // We're now waiting for any responses from devices - status = STATUS_SYNCING; - VRPN_MSG_WARNING("reset complete (this is normal)"); - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - return 0; -} - -// This function will read characters until it has a full report, then -// put that report into analog fields and call the report methods on these. -// The time stored is that of the first character received as part of the -// report. - -int vrpn_OmegaTemperature::get_report(void) -{ - int ret; // Return value from function call to be checked - - //-------------------------------------------------------------------- - // If we're SYNCing, then the next character we get should be the start - // of a report. If we recognize it, go into READing mode and tell how - // many characters we expect total. If we don't recognize it, then we - // must have misinterpreted a command or something; reset - // and start over - //-------------------------------------------------------------------- - - if (status == STATUS_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, (unsigned char *)(d_buffer), 1) != 1) { - return 0; - } - - // Got the first character of a report -- go into READING mode - // and record that we got one character at this time. Clear the - // rest of the buffer to 0's so that we won't be looking at old - // data when we parse. - // The time stored here is as close as possible to when the - // report was generated. - d_bufcount = 1; - vrpn_gettimeofday(×tamp, NULL); - status = STATUS_READING; - size_t i; - for (i = 1; i < sizeof(d_buffer); i++) { - d_buffer[i] = 0; - } -#ifdef VERBOSE - printf("... Got the 1st char\n"); -#endif - } - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. - //-------------------------------------------------------------------- - - while ( 1 == (ret = vrpn_read_available_characters(serial_fd, (unsigned char *)(&d_buffer[d_bufcount]), 1))) { - d_bufcount++; - } - if (ret == -1) { - VRPN_MSG_ERROR("Error reading"); - status = STATUS_RESETTING; - return 0; - } -#ifdef VERBOSE - if (ret != 0) printf("... got %d total characters\n", d_bufcount); -#endif - if (d_buffer[d_bufcount-1] != '\r') { // Not done -- go back for more - return 0; - } - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. Check to make - // sure that its format matches what we expect. If it does, the next - // section will parse it. - // Store the report into the appropriate analog channel. - //-------------------------------------------------------------------- - -#ifdef VERBOSE - printf(" Complete report: \n%s\n",d_buffer); -#endif - float value = convert_bytes_to_reading(d_buffer); - if (value == -1000) { - char msg[256]; - sprintf(msg,"Invalid report, channel %d, resetting", d_next_channel_to_read); - VRPN_MSG_ERROR(msg); - status = STATUS_RESETTING; - } - channel[d_next_channel_to_read] = value; - -#ifdef VERBOSE - printf("got a complete report (%d chars)!\n", d_bufcount); -#endif - - //-------------------------------------------------------------------- - // Request a reading from the next channe. - //-------------------------------------------------------------------- - - d_next_channel_to_read = (d_next_channel_to_read + 1) % 6; - if (!request_temperature(d_next_channel_to_read)) { - char msg[256]; - sprintf(msg,"Can't request reading, channel %d, resetting", d_next_channel_to_read); - VRPN_MSG_ERROR(msg); - status = STATUS_RESETTING; - } - - //-------------------------------------------------------------------- - // Done with the decoding, send the reports and go back to syncing - //-------------------------------------------------------------------- - - report_changes(); - status = STATUS_SYNCING; - d_bufcount = 0; - - return 1; -} - -bool vrpn_OmegaTemperature::set_specified_channel(unsigned channel, vrpn_float64 value) -{ - // XXX Check return status of the set commands? - switch (channel) { - case 0: // Reference temperature for channels 1 and 2 - case 1: // Reference temperature for channels 1 and 2 - set_reference_temperature(channel, static_cast<float>(value)); - o_channel[channel] = value; - break; - case 2: // Turn on temperature control if this is nonzero. - o_channel[2] = value; - buttons[0] = ( value != 0 ); - set_control_status( value != 0); - break; - default: - return false; - } - return true; -} - -int vrpn_OmegaTemperature::handle_request_message(void *userdata, vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_float64 value; - vrpn_OmegaTemperature *me = (vrpn_OmegaTemperature *)userdata; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - vrpn_unbuffer(&bufptr, &value); - - // Set the appropriate value, if the channel number is in the - // range of the ones we have. - if ( (chan_num < 0) || (chan_num >= me->o_num_channel) ) { - char msg[1024]; - sprintf(msg,"vrpn_OmegaTemperature::handle_request_message(): Index out of bounds (%d of %d), value %lg\n", - chan_num, me->num_channel, value); - me->send_text_message(msg, me->timestamp, vrpn_TEXT_ERROR); - return 0; - } - - me->set_specified_channel(chan_num, value); - return 0; -} - -int vrpn_OmegaTemperature::handle_request_channels_message(void* userdata, vrpn_HANDLERPARAM p) -{ - int i; - const char* bufptr = p.buffer; - vrpn_int32 num; - vrpn_int32 pad; - vrpn_OmegaTemperature* me = (vrpn_OmegaTemperature *)userdata; - - // Read the values from the buffer - vrpn_unbuffer(&bufptr, &num); - vrpn_unbuffer(&bufptr, &pad); - if (num > me->o_num_channel) { - char msg[1024]; - sprintf(msg,"vrpn_OmegaTemperature::handle_request_channels_message(): Index out of bounds (%d of %d), clipping\n", - num, me->o_num_channel); - me->send_text_message(msg, me->timestamp, vrpn_TEXT_ERROR); - num = me->o_num_channel; - } - for (i = 0; i < num; i++) { - vrpn_unbuffer(&bufptr, &(me->o_channel[i])); - me->set_specified_channel(i, me->o_channel[i]); - } - - return 0; -} - -/** When we get a connection request from a remote object, send our state so - they will know it to start with. */ -int vrpn_OmegaTemperature::handle_connect_message(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_OmegaTemperature *me = (vrpn_OmegaTemperature *)userdata; - - me->report(vrpn_CONNECTION_RELIABLE); - return 0; -} - -void vrpn_OmegaTemperature::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_OmegaTemperature::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -/** This routine is called each time through the server's main loop. It will - take a course of action depending on the current status of the device, - either trying to reset it or trying to get a reading from it. It will - try to reset the device if no data has come from it for a couple of - seconds -*/ - -void vrpn_OmegaTemperature::mainloop() -{ - char errmsg[256]; - - server_mainloop(); - - switch(status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - while (get_report()) {}; // Keep getting reports so long as there are more - - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) > TIMEOUT_TIME_INTERVAL) { - sprintf(errmsg,"Timeout... current_time=%ld:%ld, timestamp=%ld:%ld", - current_time.tv_sec, static_cast<long>(current_time.tv_usec), - timestamp.tv_sec, static_cast<long>(timestamp.tv_usec)); - VRPN_MSG_ERROR(errmsg); - status = STATUS_RESETTING; - } - } - break; - - default: - VRPN_MSG_ERROR("Unknown mode (internal error)"); - break; - } -} - -#endif diff --git a/src/vrpn/vrpn_OmegaTemperature.h b/src/vrpn/vrpn_OmegaTemperature.h deleted file mode 100644 index 19121d70ec2eb984cba67f02a1897bf4f0977bb9..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_OmegaTemperature.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef VRPN_OMEGATEMPERATURE_H -#define VRPN_OMEGATEMPERATURE_H - -// XXX Need to have a VRPN boolean output device. Then we can set the -// temperature control to be on or off based on its value. For now, we're -// doing a horrible thing and packing it into an analog output channel. - -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Analog_Output.h" // for vrpn_Analog_Output -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_RELIABLE, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32, vrpn_float64 - -/* XXX The code has not been changed from the Biosciences code yet, - only the names have been changed. */ -/* -# Analog channels: (read by client) -# 0 Reading from stage 1 in degrees Celcius -# 1 Reading from bath 1 in degrees Celcius -# 2 External 1 in degrees Celcius (or setpoint if ext not used) -# 3 Reading from stage 2 in degrees Celcius -# 4 Reading from bath 2 in degrees Celcius -# 5 External 1 in degrees Celcius (or setpoint if ext not used) -# Button channels: (read by client) -# 0 Temperature control is on or off -# Analog_Output channels: (set by client) -# 0 Reference temperature for channel 1 -# 1 Reference temperature for channel 2 -# 2 Turn temperature control on/off (0 = off, otherwise on) -*/ - -#if defined(VRPN_USE_MODBUS) && defined(VRPN_USE_WINSOCK2) -#include <modbus.h> - -class VRPN_API vrpn_OmegaTemperature: public vrpn_Serial_Analog, - public vrpn_Analog_Output, public vrpn_Button_Filter -{ -public: - // Tell it the temperature to use to set channels 1 and 2 to - // in Celcius and also whether to turn the temperature control on. - vrpn_OmegaTemperature (const char * name, vrpn_Connection * c, - const char * port, float temp1, float temp2, - bool control_on); - ~vrpn_OmegaTemperature () {}; - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - - protected: - modbus_t *d_modbus; //< Modbus object to use to communicate. - char d_buffer[128]; //< Buffer of characters in report - unsigned d_bufcount; //< How many characters we have so far - - struct timeval timestamp; //< Time of the last report from the device - - virtual int reset(void); //< Set device back to starting config - virtual int get_report(void); //< Try to read a report from the device - - // Channels are zero-referenced. Use 0 for channel 1. - bool set_reference_temperature(unsigned channel, float value); - bool set_control_status(bool on); - bool request_temperature(unsigned channel); - - // Sets a specified channel based on a new value from the Analog_Output. - // Channels 0 and 1 are temperature settings, and channel 2 is our - // hack to turn on and off temperatur control. - bool set_specified_channel(unsigned channel, vrpn_float64 value); - - // This lets us know which channel we're waiting for a reading on. - // It cycles; each time we hear from one, we ask for the next. - unsigned d_next_channel_to_read; - - float convert_bytes_to_reading(const char *buf); - - /// send report iff changed - virtual void report_changes - (vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - /// send report whether or not changed - virtual void report - (vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - - /// Responds to a request to change one of the values by - /// setting the channel to that value. - static int VRPN_CALLBACK handle_request_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Responds to a request to change multiple channels at once. - static int VRPN_CALLBACK handle_request_channels_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Responds to a connection request with a report of the values - static int VRPN_CALLBACK handle_connect_message(void *userdata, vrpn_HANDLERPARAM p); -}; -#endif - -#endif diff --git a/src/vrpn/vrpn_OneEuroFilter.h b/src/vrpn/vrpn_OneEuroFilter.h deleted file mode 100644 index 3d76fd7ba94d57e4c47afb18fce84887c7be455f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_OneEuroFilter.h +++ /dev/null @@ -1,243 +0,0 @@ -/** @file - @brief Header file that completely implements a direction and - orientation filter on tracking reports; it does not implement - an actual server, it is intended to be built into a server. - - @date 2012 - - @author - Jan Ciger - <jan.ciger@reviatech.com> - -*/ - -// Copyright Reviatech 2012. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -// Internal Includes -#include <quat.h> - -// Library/third-party includes -// - none - -// Standard includes -#include <math.h> // for sqrt() and acos() -#include <string.h> // for memcpy - -// "One Euro" filter for reducing jitter -// http://hal.inria.fr/hal-00670496/ - -template<int DIMENSION = 3, typename Scalar = vrpn_float64> -class vrpn_LowPassFilter { - public: - typedef Scalar scalar_type; - typedef Scalar value_type[DIMENSION]; - typedef const scalar_type * return_type; - - vrpn_LowPassFilter() : _firstTime(true) { - } - - return_type filter(const value_type x, scalar_type alpha) { - if (_firstTime) { - _firstTime = false; - memcpy(_hatxprev, x, sizeof(_hatxprev)); - } - - value_type hatx; - for (int i = 0; i < DIMENSION; ++i) { - hatx[i] = alpha * x[i] + (1 - alpha) * _hatxprev[i]; - } - - memcpy(_hatxprev, hatx, sizeof(_hatxprev)); - return _hatxprev; - } - - return_type hatxprev() { - return _hatxprev; - } - - private: - bool _firstTime; - value_type _hatxprev; -}; - -typedef vrpn_LowPassFilter<> vrpn_LowPassFilterVec; - -template<int DIMENSION = 3, typename Scalar = vrpn_float64> -class vrpn_VectorFilterable { - public: - typedef Scalar scalar_type; - typedef Scalar value_type[DIMENSION]; - typedef value_type derivative_value_type; - typedef Scalar * value_ptr_type; - typedef vrpn_LowPassFilter<DIMENSION, Scalar> value_filter_type; - typedef vrpn_LowPassFilter<DIMENSION, Scalar> derivative_filter_type; - typedef typename value_filter_type::return_type value_filter_return_type; - - static void setDxIdentity(value_ptr_type dx) { - for (int i = 0; i < DIMENSION; ++i) { - dx[i] = 0; - } - } - - static void computeDerivative(derivative_value_type dx, value_filter_return_type prev, const value_type current, scalar_type dt) { - for (int i = 0; i < DIMENSION; ++i) { - dx[i] = (current[i] - prev[i]) / dt; - } - } - static scalar_type computeDerivativeMagnitude(derivative_value_type const dx) { - scalar_type sqnorm = 0; - for (int i = 0; i < DIMENSION; ++i) { - sqnorm += dx[i] * dx[i]; - } - return sqrt(static_cast<vrpn_float64>(sqnorm)); - } - -}; -template<typename Filterable = vrpn_VectorFilterable<> > -class vrpn_OneEuroFilter { - public: - typedef Filterable contents; - typedef typename Filterable::scalar_type scalar_type; - typedef typename Filterable::value_type value_type; - typedef typename Filterable::derivative_value_type derivative_value_type; - typedef typename Filterable::value_ptr_type value_ptr_type; - typedef typename Filterable::derivative_filter_type derivative_filter_type; - typedef typename Filterable::value_filter_type value_filter_type; - typedef typename value_filter_type::return_type value_filter_return_type; - - vrpn_OneEuroFilter(scalar_type mincutoff, scalar_type beta, scalar_type dcutoff) : - _firstTime(true), - _mincutoff(mincutoff), _dcutoff(dcutoff), - _beta(beta) {}; - - vrpn_OneEuroFilter() : _firstTime(true), _mincutoff(1), _dcutoff(1), _beta(0.5) {}; - - void setMinCutoff(scalar_type mincutoff) { - _mincutoff = mincutoff; - } - scalar_type getMinCutoff() const { - return _mincutoff; - } - void setBeta(scalar_type beta) { - _beta = beta; - } - scalar_type getBeta() const { - return _beta; - } - void setDerivativeCutoff(scalar_type dcutoff) { - _dcutoff = dcutoff; - } - scalar_type getDerivativeCutoff() const { - return _dcutoff; - } - void setParams(scalar_type mincutoff, scalar_type beta, scalar_type dcutoff) { - _mincutoff = mincutoff; - _beta = beta; - _dcutoff = dcutoff; - } - const value_filter_return_type filter(scalar_type dt, const value_type x) { - derivative_value_type dx; - - if (_firstTime) { - _firstTime = false; - Filterable::setDxIdentity(dx); - - } else { - Filterable::computeDerivative(dx, _xfilt.hatxprev(), x, dt); - } - - scalar_type derivative_magnitude = Filterable::computeDerivativeMagnitude(_dxfilt.filter(dx, alpha(dt, _dcutoff))); - scalar_type cutoff = _mincutoff + _beta * derivative_magnitude; - - return _xfilt.filter(x, alpha(dt, cutoff)); - } - - private: - static scalar_type alpha(scalar_type dt, scalar_type cutoff) { - scalar_type tau = scalar_type(1) / (scalar_type(2) * Q_PI * cutoff); - return scalar_type(1) / (scalar_type(1) + tau / dt); - } - - bool _firstTime; - scalar_type _mincutoff, _dcutoff; - scalar_type _beta; - value_filter_type _xfilt; - derivative_filter_type _dxfilt; -}; - -typedef vrpn_OneEuroFilter<> vrpn_OneEuroFilterVec; - -class vrpn_LowPassFilterQuat { - public: - typedef const double * return_type; - - vrpn_LowPassFilterQuat() : _firstTime(true) { - } - - return_type filter(const q_type x, vrpn_float64 alpha) { - if (_firstTime) { - _firstTime = false; - q_copy(_hatxprev, x); - } - - q_type hatx; - q_slerp(hatx, _hatxprev, x, alpha); - q_copy(_hatxprev, hatx); - return _hatxprev; - } - - return_type hatxprev() { - return _hatxprev; - } - - private: - bool _firstTime; - q_type _hatxprev; -}; - -class vrpn_QuatFilterable { - public: - typedef double scalar_type; - typedef q_type value_type; - typedef q_type derivative_value_type; - typedef q_type value_ptr_type; - typedef vrpn_LowPassFilterQuat value_filter_type; - typedef vrpn_LowPassFilterQuat derivative_filter_type; - typedef value_filter_type::return_type value_filter_return_type; - - static void setDxIdentity(value_ptr_type dx) { - dx[Q_X] = dx[Q_Y] = dx[Q_Z] = 0; - dx[Q_W] = 1; - } - - static void computeDerivative(derivative_value_type dx, value_filter_return_type prev, const value_type current, scalar_type dt) { - scalar_type rate = 1.0 / dt; - - q_type inverse_prev; - q_invert(inverse_prev, prev); - q_mult(dx, current, inverse_prev); - - // nlerp instead of slerp - dx[Q_X] *= rate; - dx[Q_Y] *= rate; - dx[Q_Z] *= rate; - dx[Q_W] = dx[Q_W] * rate + (1.0 - rate); - q_normalize(dx, dx); - - //q_slerp(dx, identity, dx, 1.0 / dt); - } - static scalar_type computeDerivativeMagnitude(derivative_value_type const dx) { - /// Should be safe since the quaternion we're given has been normalized. - return 2.0 * acos(static_cast<vrpn_float64>(dx[Q_W])); - } - -}; - -typedef vrpn_OneEuroFilter<vrpn_QuatFilterable> vrpn_OneEuroFilterQuat; - - diff --git a/src/vrpn/vrpn_Poser.C b/src/vrpn/vrpn_Poser.C deleted file mode 100644 index 4a38d5685e5d051d6df6dc56aae83688faedbd09..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Poser.C +++ /dev/null @@ -1,620 +0,0 @@ -#include <quat.h> // for q_mult -#include <stdio.h> // for fprintf, stderr, NULL -#include <string.h> // for memcpy - -// NOTE: a vrpn poser must accept poser data (pos and -// ori info) which represent the transformation such -// that the pos info is the position of the origin of -// the poser coord sys in the source coord sys space, and the -// quat represents the orientation of the poser relative to the -// source space (ie, its value rotates the source's axes so that -// they coincide with the poser's) - -// borrows heavily from the vrpn_Tracker code, as the poser is basically -// the inverse of a tracker -#include "vrpn_Connection.h" // for vrpn_HANDLERPARAM, etc -// Include vrpn_Shared.h _first_ to avoid conflicts with sys/time.h -// and unistd.h -#include "vrpn_Shared.h" // for timeval, vrpn_buffer, etc - -#ifdef _WIN32 -#ifndef _WIN32_WCE -#include <io.h> -#endif -#endif - -#include "vrpn_Poser.h" - -//#define VERBOSE -// #define READ_HISTOGRAM - -vrpn_Poser::vrpn_Poser(const char* name, vrpn_Connection* c) - : vrpn_BaseClass(name, c) -{ - vrpn_BaseClass::init(); - - // Find out what time it is and put this into the timestamp - vrpn_gettimeofday(&p_timestamp, NULL); - - // Set the position to the origin and the orientation to identity - // just to have something there in case nobody fills them in later - p_pos[0] = p_pos[1] = p_pos[2] = 0.0; - p_quat[0] = p_quat[1] = p_quat[2] = 0.0; - p_quat[3] = 1.0; - - // Set the velocity to zero and the orientation to identity - // just to have something there in case nobody fills them in later - p_vel[0] = p_vel[1] = p_vel[2] = 0.0; - p_vel_quat[0] = p_vel_quat[1] = p_vel_quat[2] = 0.0; - p_vel_quat[3] = 1.0; - p_vel_quat_dt = 1; - - // Set the workspace max and min values just to have something there - p_pos_max[0] = p_pos_max[1] = p_pos_max[2] = p_vel_max[0] = p_vel_max[1] = - p_vel_max[2] = 1.0; - p_pos_min[0] = p_pos_min[1] = p_pos_min[2] = p_vel_min[0] = p_vel_min[1] = - p_vel_min[2] = -1.0; - p_pos_rot_max[0] = p_pos_rot_max[1] = p_pos_rot_max[2] = p_vel_rot_max[0] = - p_vel_rot_max[1] = p_vel_rot_max[2] = 1.0; - p_pos_rot_min[0] = p_pos_rot_min[1] = p_pos_rot_min[2] = p_vel_rot_min[0] = - p_vel_rot_min[1] = p_vel_rot_min[2] = -1.0; -} - -void vrpn_Poser::p_print() -{ - fprintf(stderr, "Pos: %lf, %lf, %lf\n", p_pos[0], p_pos[1], p_pos[2]); - fprintf(stderr, "Quat: %lf, %lf, %lf, %lf\n", p_quat[0], p_quat[1], - p_quat[2], p_quat[3]); -} - -void vrpn_Poser::p_print_vel() -{ - fprintf(stderr, "Vel: %lf, %lf, %lf\n", p_vel[0], p_vel[1], p_vel[2]); - fprintf(stderr, "Quat: %lf, %lf, %lf, %lf\n", p_vel_quat[0], - p_vel_quat[1], p_vel_quat[2], p_vel_quat[3]); - fprintf(stderr, "Quat_dt: %lf\n", p_vel_quat_dt); -} - -int vrpn_Poser::register_types(void) -{ - // Register this poser device and the needed message types - if (d_connection) { - req_position_m_id = - d_connection->register_message_type("vrpn_Poser Request Pos_Quat"); - req_position_relative_m_id = d_connection->register_message_type( - "vrpn_Poser Request Relative Pos_Quat"); - req_velocity_m_id = - d_connection->register_message_type("vrpn_Poser Request Velocity"); - req_velocity_relative_m_id = d_connection->register_message_type( - "vrpn_Poser Request Relative Velocity"); - } - return 0; -} - -// virtual -vrpn_Poser::~vrpn_Poser(void) {} - -/* -int vrpn_Poser::register_server_handlers(void) -{ - if (d_connection){ - - - } - else { - return -1; - } - return 0; -} -*/ - -// NOTE: you need to be sure that if you are sending vrpn_float64 then -// the entire array needs to remain aligned to 8 byte boundaries -// (malloced data and static arrays are automatically alloced in -// this way). Assumes that there is enough room to store the -// entire message. Returns the number of characters sent. -int vrpn_Poser::encode_to(char* buf) -{ - char* bufptr = buf; - int buflen = 1000; - - // Message includes: vrpn_float64 p_pos[3], vrpn_float64 p_quat[4] - // Byte order of each needs to be reversed to match network standard - - vrpn_buffer(&bufptr, &buflen, p_pos[0]); - vrpn_buffer(&bufptr, &buflen, p_pos[1]); - vrpn_buffer(&bufptr, &buflen, p_pos[2]); - - vrpn_buffer(&bufptr, &buflen, p_quat[0]); - vrpn_buffer(&bufptr, &buflen, p_quat[1]); - vrpn_buffer(&bufptr, &buflen, p_quat[2]); - vrpn_buffer(&bufptr, &buflen, p_quat[3]); - - return 1000 - buflen; -} - -int vrpn_Poser::encode_vel_to(char* buf) -{ - char* bufptr = buf; - int buflen = 1000; - - // Message includes: vrpn_float64 p_vel[3], vrpn_float64 p_vel_quat[4], - // vrpn_float64 p_vel_quat_dt - // Byte order of each needs to be reversed to match network standard - - vrpn_buffer(&bufptr, &buflen, p_vel[0]); - vrpn_buffer(&bufptr, &buflen, p_vel[1]); - vrpn_buffer(&bufptr, &buflen, p_vel[2]); - - vrpn_buffer(&bufptr, &buflen, p_vel_quat[0]); - vrpn_buffer(&bufptr, &buflen, p_vel_quat[1]); - vrpn_buffer(&bufptr, &buflen, p_vel_quat[2]); - vrpn_buffer(&bufptr, &buflen, p_vel_quat[3]); - - vrpn_buffer(&bufptr, &buflen, p_vel_quat_dt); - - return 1000 - buflen; -} - -void vrpn_Poser::set_pose(const timeval t, const vrpn_float64 position[3], - const vrpn_float64 quaternion[4]) -{ - // Update the time - p_timestamp.tv_sec = t.tv_sec; - p_timestamp.tv_usec = t.tv_usec; - - // Update the position and quaternion - memcpy(p_pos, position, sizeof(p_pos)); - memcpy(p_quat, quaternion, sizeof(p_quat)); -} - -void vrpn_Poser::set_pose_relative(const timeval t, - const vrpn_float64 position_delta[3], - const vrpn_float64 quaternion[4]) -{ - // Update the time - p_timestamp.tv_sec = t.tv_sec; - p_timestamp.tv_usec = t.tv_usec; - - // Update the position and quaternion - p_pos[0] += position_delta[0]; - p_pos[1] += position_delta[1]; - p_pos[2] += position_delta[2]; - q_mult(p_quat, quaternion, p_quat); -} - -void vrpn_Poser::set_pose_velocity(const timeval t, - const vrpn_float64 velocity[3], - const vrpn_float64 quaternion[4], - const vrpn_float64 interval) -{ - // Update the time - p_timestamp.tv_sec = t.tv_sec; - p_timestamp.tv_usec = t.tv_usec; - - // Update the position and quaternion - memcpy(p_vel, velocity, sizeof(p_vel)); - memcpy(p_vel_quat, quaternion, sizeof(p_vel_quat)); - - // Update the interval - p_vel_quat_dt = interval; -} - -void vrpn_Poser::set_pose_velocity_relative( - const timeval t, const vrpn_float64 velocity_delta[3], - const vrpn_float64 quaternion[4], const vrpn_float64 interval_delta) -{ - // Update the time - p_timestamp.tv_sec = t.tv_sec; - p_timestamp.tv_usec = t.tv_usec; - - // Update the position and quaternion - p_vel[0] += velocity_delta[0]; - p_vel[1] += velocity_delta[1]; - p_vel[2] += velocity_delta[2]; - q_mult(p_vel_quat, quaternion, p_vel_quat); - - // Update the interval - p_vel_quat_dt += interval_delta; -} - -////////////////////////////////////////////////////////////////////////////////////// -// Server Code - -vrpn_Poser_Server::vrpn_Poser_Server(const char* name, vrpn_Connection* c) - : vrpn_Poser(name, c) -{ - // register_server_handlers(); - - // Make sure that we have a valid connection - if (d_connection == NULL) { - fprintf(stderr, "vrpn_Poser_Server: No connection\n"); - return; - } - - // Register a handler for the position change callback for this device - if (register_autodeleted_handler(req_position_m_id, handle_change_message, - this, d_sender_id)) { - fprintf(stderr, "vrpn_Poser_Server: can't register position handler\n"); - d_connection = NULL; - } - - // Register a handler for the relative position change callback for this - // device - if (register_autodeleted_handler(req_position_relative_m_id, - handle_relative_change_message, this, - d_sender_id)) { - fprintf( - stderr, - "vrpn_Poser_Server: can't register relative position handler\n"); - d_connection = NULL; - } - - // Register a handler for the velocity change callback for this device - if (register_autodeleted_handler( - req_velocity_m_id, handle_vel_change_message, this, d_sender_id)) { - fprintf(stderr, "vrpn_Poser_Server: can't register velocity handler\n"); - d_connection = NULL; - } - - // Register a handler for the relative velocity change callback for this - // device - if (register_autodeleted_handler(req_velocity_relative_m_id, - handle_relative_vel_change_message, this, - d_sender_id)) { - fprintf(stderr, "vrpn_Poser_Server: can't register velocity handler\n"); - d_connection = NULL; - } -} - -void vrpn_Poser_Server::mainloop() -{ - // Call the generic server mainloop routine, since this is a server - server_mainloop(); -} - -int vrpn_Poser_Server::handle_change_message(void* userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Poser_Server* me = (vrpn_Poser_Server*)userdata; - const char* params = (p.buffer); - int i; - - vrpn_POSERCB cp; - // Fill in the parameters to the poser from the message - if (p.payload_len != (7 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_Poser_Server: change message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", p.payload_len, - static_cast<unsigned long>(7 * sizeof(vrpn_float64))); - return -1; - } - me->p_timestamp = p.msg_time; - - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &me->p_pos[i]); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &me->p_quat[i]); - } - - // Check the pose against the max and min values of the workspace - for (i = 0; i < 3; i++) { - if (me->p_pos[i] < me->p_pos_min[i]) { - me->p_pos[i] = me->p_pos_min[i]; - } - else if (me->p_pos[i] > me->p_pos_max[i]) { - me->p_pos[i] = me->p_pos_max[i]; - } - } - - /// Now pack the information in a way that user-routine will understand - cp.msg_time = me->p_timestamp; - memcpy(cp.pos, me->p_pos, sizeof(cp.pos)); - memcpy(cp.quat, me->p_quat, sizeof(cp.quat)); - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->d_callback_list.call_handlers(cp); - - return 0; -} - -int vrpn_Poser_Server::handle_relative_change_message(void* userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Poser_Server* me = (vrpn_Poser_Server*)userdata; - const char* params = (p.buffer); - int i; - - // Fill in the parameters to the poser from the message - if (p.payload_len != (7 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_Poser_Server: change message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", p.payload_len, - static_cast<unsigned long>(7 * sizeof(vrpn_float64))); - return -1; - } - me->p_timestamp = p.msg_time; - - vrpn_float64 dp[3], dq[4]; - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &(dp[i])); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &(dq[i])); - } - - // apply the requested changes - for (i = 0; i <= 2; i++) - me->p_pos[i] += dp[i]; - q_mult(me->p_quat, dq, me->p_quat); - - // Check the pose against the max and min values of the workspace - for (i = 0; i < 3; i++) { - if (me->p_pos[i] < me->p_pos_min[i]) { - me->p_pos[i] = me->p_pos_min[i]; - } - else if (me->p_pos[i] > me->p_pos_max[i]) { - me->p_pos[i] = me->p_pos_max[i]; - } - } - - /// Now pack the information in a way that user-routine will understand - vrpn_POSERCB cp; - cp.msg_time = me->p_timestamp; - memcpy(cp.pos, dp, sizeof(cp.pos)); - memcpy(cp.quat, dq, sizeof(cp.quat)); - // Go down the list of callbacks that have been registered. - me->d_relative_callback_list.call_handlers(cp); - - return 0; -} - -int vrpn_Poser_Server::handle_vel_change_message(void* userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Poser_Server* me = (vrpn_Poser_Server*)userdata; - const char* params = (p.buffer); - int i; - - // Fill in the parameters to the poser from the message - if (p.payload_len != (8 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_Poser_Server: velocity message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", p.payload_len, - static_cast<unsigned long>(8 * sizeof(vrpn_float64))); - return -1; - } - me->p_timestamp = p.msg_time; - - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &me->p_vel[i]); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &me->p_vel_quat[i]); - } - vrpn_unbuffer(¶ms, &me->p_vel_quat_dt); - - // Check the velocity against the max and min values of the workspace - for (i = 0; i < 3; i++) { - if (me->p_vel[i] < me->p_vel_min[i]) { - me->p_vel[i] = me->p_vel_min[i]; - } - else if (me->p_vel[i] > me->p_vel_max[i]) { - me->p_vel[i] = me->p_vel_max[i]; - } - } - return 0; -} - -int vrpn_Poser_Server::handle_relative_vel_change_message(void* userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Poser_Server* me = (vrpn_Poser_Server*)userdata; - const char* params = (p.buffer); - int i; - - // Fill in the parameters to the poser from the message - if (p.payload_len != (8 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_Poser_Server: velocity message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", p.payload_len, - static_cast<unsigned long>(8 * sizeof(vrpn_float64))); - return -1; - } - me->p_timestamp = p.msg_time; - - vrpn_float64 dv[3], dq[4], di; - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &(dv[i])); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &(dq[i])); - } - vrpn_unbuffer(¶ms, &di); - - // apply the requested changes - for (i = 0; i < 2; i++) - me->p_vel[i] += dv[i]; - q_mult(me->p_quat, dq, me->p_quat); - me->p_vel_quat_dt += di; - - // Check the velocity against the max and min values of the workspace - for (i = 0; i < 3; i++) { - if (me->p_vel[i] < me->p_vel_min[i]) { - me->p_vel[i] = me->p_vel_min[i]; - } - else if (me->p_vel[i] > me->p_vel_max[i]) { - me->p_vel[i] = me->p_vel_max[i]; - } - } - return 0; -} - -////////////////////////////////////////////////////////////////////////////////////// -// Client Code -// Note that the Remote class uses p_pos and p_quat for the absolute -// position/orientation as well as position/orientation deltas when -// requesting relative changes. Externally, these are write-only variables, -// so no user code will need to change. If these are ever made readable -// from the Remote class, additional data members will need to be added -// to hold the delta values, as well as addition methods for encoding. - -vrpn_Poser_Remote::vrpn_Poser_Remote(const char* name, vrpn_Connection* c) - : vrpn_Poser(name, c) -{ - // Make sure that we have a valid connection - if (d_connection == NULL) { - fprintf(stderr, "vrpn_Poser_Remote: No connection\n"); - return; - } -} - -// The remote poser has to un-register its handlers when it -// is destroyed to avoid seg faults (this is taken care of by -// using autodeleted handlers above). It should also remove all -// remaining user-registered callbacks to free up memory. - -vrpn_Poser_Remote::~vrpn_Poser_Remote() -{ - // Delete all of the callback handlers that other code had registered - // with this object. This will free up the memory taken by the lists -} - -void vrpn_Poser_Remote::mainloop() -{ - if (d_connection) { - d_connection->mainloop(); - } - client_mainloop(); -} - -int vrpn_Poser_Remote::request_pose(const struct timeval t, - const vrpn_float64 position[3], - const vrpn_float64 quaternion[4]) -{ - // Set the requested pose - set_pose(t, position, quaternion); - - // Send position request - if (client_send_pose() != 0) { - fprintf(stderr, "vrpn_Poser_Remote: request_pose failed\n"); - return 0; - } - - return 1; -} - -int vrpn_Poser_Remote::request_pose_relative( - const struct timeval t, const vrpn_float64 position_delta[3], - const vrpn_float64 quaternion[4]) -{ - // Set the requested pose - set_pose_relative(t, position_delta, quaternion); - - // Send position request - if (client_send_pose_relative() != 0) { - fprintf(stderr, "vrpn_Poser_Remote: request_pose_relative failed\n"); - return 0; - } - - return 1; -} - -int vrpn_Poser_Remote::request_pose_velocity(const struct timeval t, - const vrpn_float64 velocity[3], - const vrpn_float64 quaternion[4], - const vrpn_float64 interval) -{ - // Set the requested velocity - set_pose_velocity(t, velocity, quaternion, interval); - - // Send position request - if (client_send_pose_velocity() != 0) { - fprintf(stderr, "vrpn_Poser_Remote: request_pose_velocity failed\n"); - return 0; - } - - return 1; -} - -int vrpn_Poser_Remote::request_pose_velocity_relative( - const struct timeval t, const vrpn_float64 velocity_delta[3], - const vrpn_float64 quaternion[4], const vrpn_float64 interval_delta) -{ - // Set the requested velocity - set_pose_velocity(t, velocity_delta, quaternion, interval_delta); - - // Send position request - if (client_send_pose_velocity_relative() != 0) { - fprintf(stderr, - "vrpn_Poser_Remote: request_pose_velocity_relative failed\n"); - return 0; - } - - return 1; -} - -int vrpn_Poser_Remote::client_send_pose() -{ - char msgbuf[1000]; - vrpn_int32 len; - - // Pack pose - len = encode_to(msgbuf); - if (d_connection->pack_message(len, p_timestamp, req_position_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "vrpn_Poser_Remote: can't write a message: tossing\n"); - return -1; - } - - return 0; -} - -int vrpn_Poser_Remote::client_send_pose_relative() -{ - char msgbuf[1000]; - vrpn_int32 len; - - // Pack pose delta. - len = encode_to(msgbuf); - if (d_connection->pack_message(len, p_timestamp, req_position_relative_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "vrpn_Poser_Remote: can't write a message: tossing\n"); - return -1; - } - - return 0; -} - -int vrpn_Poser_Remote::client_send_pose_velocity() -{ - char msgbuf[1000]; - vrpn_int32 len; - - // Pack velocity - len = encode_vel_to(msgbuf); - if (d_connection->pack_message(len, p_timestamp, req_velocity_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "vrpn_Poser_Remote: can't write a message: tossing\n"); - return -1; - } - - return 0; -} - -int vrpn_Poser_Remote::client_send_pose_velocity_relative() -{ - char msgbuf[1000]; - vrpn_int32 len; - - // Pack velocity delta - len = encode_vel_to(msgbuf); - if (d_connection->pack_message(len, p_timestamp, req_velocity_relative_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "vrpn_Poser_Remote: can't write a message: tossing\n"); - return -1; - } - - return 0; -} diff --git a/src/vrpn/vrpn_Poser.h b/src/vrpn/vrpn_Poser.h deleted file mode 100644 index d6dd3401a41955732c9e4f1df6055df73187167a..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Poser.h +++ /dev/null @@ -1,191 +0,0 @@ -#ifndef vrpn_POSER_H -#define vrpn_POSER_H -#include <stdio.h> // for NULL - -// NOTE: the poser class borrows heavily from the vrpn_Tracker code. -// The poser is basically the inverse of a tracker. -// We are only handling pose and velocity updates for now...acceleration -// will come later, as needed. - -#include "vrpn_BaseClass.h" // for vrpn_Callback_List, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_float64, vrpn_int32 - -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -class VRPN_API vrpn_Poser : public vrpn_BaseClass { -public: - vrpn_Poser(const char* name, vrpn_Connection* c = NULL); - - virtual ~vrpn_Poser(void); - - void p_print(); // print the current pose - void p_print_vel(); // print the current velocity - - // a poser server should call the following to register the - // default xform and workspace request handlers - // int register_server_handlers(void); - -protected: - // client-->server - vrpn_int32 req_position_m_id; // ID of poser position message - vrpn_int32 req_position_relative_m_id; // ID of poser position delta message - vrpn_int32 req_velocity_m_id; // ID of poser velocity message - vrpn_int32 req_velocity_relative_m_id; // ID of poser velocity delta message - - // Description of current state - vrpn_float64 p_pos[3], p_quat[4]; // Current pose, (x,y,z), (qx,qy,qz,qw) - vrpn_float64 p_vel[3], - p_vel_quat[4]; // Current velocity and dQuat/vel_quat_dt - vrpn_float64 p_vel_quat_dt; // delta time (in secs) for vel_quat - struct timeval p_timestamp; // Current timestamp - - // Minimum and maximum values available for the position and velocity values - // of the poser. - vrpn_float64 p_pos_min[3], p_pos_max[3], p_pos_rot_min[3], p_pos_rot_max[3], - p_vel_min[3], p_vel_max[3], p_vel_rot_min[3], p_vel_rot_max[3]; - - virtual int register_types(void); // Called by BaseClass init() - - virtual int encode_to(char* buf); // Encodes the position - virtual int encode_vel_to(char* buf); // Encodes the velocity - - virtual void set_pose(const struct timeval t, // Sets the pose internally - const vrpn_float64 position[3], - const vrpn_float64 quaternion[4]); - virtual void set_pose_relative( - const struct timeval t, // Increments the pose internally - const vrpn_float64 - position_delta[3], // pos_new = position_delta + pos_old - const vrpn_float64 quaternion[4]); // q_new = quaternion * q_old - virtual void - set_pose_velocity(const struct timeval t, // Sets the velocity internally - const vrpn_float64 position[3], - const vrpn_float64 quaternion[4], - const vrpn_float64 interval); - virtual void set_pose_velocity_relative( - const struct timeval t, // Increments the velocity internally - const vrpn_float64 - velocity_delta[3], // vel_new = velocity_delta + vel_old - const vrpn_float64 quaternion[4], // q_new = quaternion * q_old - const vrpn_float64 - interval_delta); // interval_new = interval_delta + interval_old -}; - -//------------------------------------------------------------------------------------ -// Server Code - -/// A structure for Call-Backs related to Vrpn Poser Server -typedef struct _vrpn_POSERCB { - struct timeval msg_time; // Timestamp - /// NOTE: I think since we have different routines for handling velocity and - /// position poser requests, - /// putting poser and quaternions for both doesn't make sense. Instead, the - /// change handler should - /// take care of packing correct poser and quaternion. - vrpn_float64 pos[3]; - vrpn_float64 quat[4]; -} vrpn_POSERCB; - -typedef void(VRPN_CALLBACK* vrpn_POSERHANDLER)(void* userdata, - const vrpn_POSERCB info); - -//------------------------------------------------------------------------------------ -// Server Code -// Users supply the routines to handle requests from the client - -// This is a sample basic poser server -// - -class VRPN_API vrpn_Poser_Server : public vrpn_Poser { -public: - vrpn_Poser_Server(const char* name, vrpn_Connection* c); - - /// This function should be called each time through app mainloop. - virtual void mainloop(); - - int register_change_handler(void* userdata, vrpn_POSERHANDLER handler) - { - return d_callback_list.register_handler(userdata, handler); - }; - int unregister_change_handler(void* userdata, vrpn_POSERHANDLER handler) - { - return d_callback_list.unregister_handler(userdata, handler); - } - - int register_relative_change_handler(void* userdata, - vrpn_POSERHANDLER handler) - { - return d_relative_callback_list.register_handler(userdata, handler); - } - int unregister_relative_change_handler(void* userdata, - vrpn_POSERHANDLER handler) - { - return d_relative_callback_list.unregister_handler(userdata, handler); - } - -protected: - static int VRPN_CALLBACK - handle_change_message(void* userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_relative_change_message(void* userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_vel_change_message(void* userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_relative_vel_change_message(void* userdata, vrpn_HANDLERPARAM p); - vrpn_Callback_List<vrpn_POSERCB> d_callback_list; - vrpn_Callback_List<vrpn_POSERCB> d_relative_callback_list; -}; - -//------------------------------------------------------------------------------------ -// Client Code - -// Open a poser that is on the other end of a connection for sending updates to -// it. -class VRPN_API vrpn_Poser_Remote : public vrpn_Poser { -public: - // The name of the poser to connect to, including connection name, - // for example "poser@magnesium.cs.unc.edu". If you already - // have the connection open, you can specify it as the second parameter. - // This allows both servers and clients in the same thread, for example. - // If it is not specified, then the connection will be looked up based - // on the name passed in. - vrpn_Poser_Remote(const char* name, vrpn_Connection* c = NULL); - - // unregister all of the handlers registered with the connection - virtual ~vrpn_Poser_Remote(void); - - // This routine calls the mainloop of the connection it's on - virtual void mainloop(); - - // Routines to set the state of the poser - int request_pose(const struct timeval t, const vrpn_float64 position[3], - const vrpn_float64 quaternion[4]); - int request_pose_relative(const struct timeval t, - const vrpn_float64 position_delta[3], - const vrpn_float64 quaternion[4]); - int request_pose_velocity(const struct timeval t, - const vrpn_float64 velocity[3], - const vrpn_float64 quaternion[4], - const vrpn_float64 interval); - int request_pose_velocity_relative(const struct timeval t, - const vrpn_float64 velocity_delta[3], - const vrpn_float64 quaternion[4], - const vrpn_float64 interval_delta); - -protected: - virtual int - client_send_pose(); // Sends the current pose. Called by request_pose - virtual int client_send_pose_relative(); // Sends the current pose delta. - // Called by request_pose_relative - virtual int client_send_pose_velocity(); // Sends the current velocity. - // Called by request_pose_velocity - virtual int - client_send_pose_velocity_relative(); // Sends the current velocity delta. - // Called by - // request_pose_velocity_relative -}; - -#endif diff --git a/src/vrpn/vrpn_Poser_Analog.C b/src/vrpn/vrpn_Poser_Analog.C deleted file mode 100644 index ce12b1607f80273407c31a6d1315eb082c45a377..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Poser_Analog.C +++ /dev/null @@ -1,333 +0,0 @@ -#include "vrpn_Analog.h" // for vrpn_CHANNEL_MAX -#include "vrpn_Analog_Output.h" // for vrpn_Analog_Output_Remote -#include "vrpn_Connection.h" // for vrpn_HANDLERPARAM, etc -#include "vrpn_Poser_Analog.h" -#include "vrpn_Shared.h" // for vrpn_unbuffer, timeval, etc - -vrpn_Poser_AnalogParam::vrpn_Poser_AnalogParam() -{ - // set workspace values to defaults - for (int i = 0; i < 3; i++) { - pos_min[i] = vel_min[i] = -1; - pos_max[i] = vel_max[i] = 1; - pos_rot_min[i] = vel_rot_min[i] = -45; - pos_rot_max[i] = vel_rot_max[i] = 45; - } -} - -bool vrpn_Poser_Analog::setup_channel(vrpn_PA_fullaxis* full) -{ - // If the name is NULL, we're done. - if (full->axis.ana_name == NULL) { - return 0; - } - - // Create the Analog Output Remote - // If the name starts with the '*' character, use the server - // connection rather than making a new one. - if (full->axis.ana_name != NULL) { - if (full->axis.ana_name[0] == '*') { - full->ana = new vrpn_Analog_Output_Remote(&(full->axis.ana_name[1]), - d_connection); - } - else { - full->ana = new vrpn_Analog_Output_Remote(full->axis.ana_name); - } - - if (full->ana == NULL) { - fprintf(stderr, "vrpn_Poser_Analog: Can't open Analog %s\n", - full->axis.ana_name); - return false; - } - } - else { - full->ana = NULL; - fprintf(stderr, - "vrpn_Poser_Analog: Can't open Analog: No name given\n"); - return false; - } - return true; -} - -vrpn_Poser_Analog::vrpn_Poser_Analog(const char* name, vrpn_Connection* c, - vrpn_Poser_AnalogParam* p, - bool act_as_tracker) - : vrpn_Poser(name, c) - , vrpn_Tracker(name, c) - , d_act_as_tracker(act_as_tracker) -{ - int i; - - // register_server_handlers(); - - // Make sure that we have a valid connection - if (d_connection == NULL) { - fprintf(stderr, "vrpn_Poser_Analog: No connection\n"); - return; - } - - // Register a handler for the position change callback for this device - if (register_autodeleted_handler(req_position_m_id, handle_change_message, - this, d_sender_id)) { - fprintf(stderr, "vrpn_Poser_Analog: can't register position handler\n"); - d_connection = NULL; - } - - // Register a handler for the velocity change callback for this device - if (register_autodeleted_handler( - req_velocity_m_id, handle_vel_change_message, this, d_sender_id)) { - fprintf(stderr, "vrpn_Poser_Analog: can't register velocity handler\n"); - d_connection = NULL; - } - - // Set up the axes - x.axis = p->x; - y.axis = p->y; - z.axis = p->z; - rx.axis = p->rx; - ry.axis = p->ry; - rz.axis = p->rz; - - x.ana = y.ana = z.ana = NULL; - rx.ana = ry.ana = rz.ana = NULL; - - x.value = y.value = z.value = 0.0; - rx.value = ry.value = rz.value = 0.0; - - x.pa = this; - y.pa = this; - z.pa = this; - rx.pa = this; - ry.pa = this; - rz.pa = this; - - //-------------------------------------------------------------------- - // Open analog remotes for any channels that have non-NULL names. - // If the name starts with the "*" character, use tracker - // connection rather than getting a new connection for it. - setup_channel(&x); - setup_channel(&y); - setup_channel(&z); - setup_channel(&rx); - setup_channel(&ry); - setup_channel(&rz); - - // Set up the workspace max and min values - for (i = 0; i < 3; i++) { - p_pos_min[i] = p->pos_min[i]; - p_pos_max[i] = p->pos_max[i]; - p_vel_min[i] = p->vel_min[i]; - p_vel_max[i] = p->vel_max[i]; - p_pos_rot_min[i] = p->pos_rot_min[i]; - p_pos_rot_max[i] = p->pos_rot_max[i]; - p_vel_rot_min[i] = p->vel_rot_min[i]; - p_vel_rot_max[i] = p->vel_rot_max[i]; - } - - // Check the pose for each channel against the max and min values of the - // workspace - // and set it to the location closest to the origin. - p_pos[0] = p_pos[1] = p_pos[2] = 0.0; - p_quat[0] = p_quat[1] = p_quat[2] = 0.0; - p_quat[3] = 1.0; - for (i = 0; i < 3; i++) { - if (p_pos[i] < p_pos_min[i]) { - p_pos[i] = p_pos_min[i]; - } - else if (p_pos[i] > p_pos_max[i]) { - p_pos[i] = p_pos_max[i]; - } - } -} - -vrpn_Poser_Analog::~vrpn_Poser_Analog() {} - -void vrpn_Poser_Analog::mainloop() -{ - // Call generic server mainloop, since we are a server - server_mainloop(); - - // Call the Analog outputs' mainloops - if (x.ana != NULL) { - x.ana->mainloop(); - }; - if (y.ana != NULL) { - y.ana->mainloop(); - }; - if (z.ana != NULL) { - z.ana->mainloop(); - }; - if (rx.ana != NULL) { - rx.ana->mainloop(); - }; - if (ry.ana != NULL) { - ry.ana->mainloop(); - }; - if (rz.ana != NULL) { - rz.ana->mainloop(); - }; -} - -int vrpn_Poser_Analog::handle_change_message(void* userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Poser_Analog* me = (vrpn_Poser_Analog*)userdata; - const char* params = (p.buffer); - int i; - bool outside_bounds = false; - - // Fill in the parameters to the poser from the message - if (p.payload_len != (7 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_Poser_Server: change message payload error\n"); - fprintf(stderr, " (got %d, expected %d)\n", p.payload_len, - static_cast<int>(7 * sizeof(vrpn_float64))); - return -1; - } - me->p_timestamp = p.msg_time; - - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &me->p_pos[i]); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &me->p_quat[i]); - } - - // Check the pose against the max and min values of the workspace - for (i = 0; i < 3; i++) { - if (me->p_pos[i] < me->p_pos_min[i]) { - me->p_pos[i] = me->p_pos_min[i]; - outside_bounds = true; - } - else if (me->p_pos[i] > me->p_pos_max[i]) { - me->p_pos[i] = me->p_pos_max[i]; - outside_bounds = true; - } - } - - // Update the analog values based on the request we just got. - if (!me->update_Analog_values()) { - fprintf(stderr, "vrpn_Poser_Analog: Error updating Analog values\n"); - } - - if (me->d_act_as_tracker) { - // Tell the client where we actually went (clipped position and - // orientation). - // using sensor 0 as the one to use to report. - me->d_sensor = 0; - me->pos[0] = me->p_pos[0]; - me->pos[1] = me->p_pos[1]; - me->pos[2] = me->p_pos[2]; - me->d_quat[0] = me->p_quat[0]; - me->d_quat[1] = me->p_quat[1]; - me->d_quat[2] = me->p_quat[2]; - me->d_quat[3] = me->p_quat[3]; - vrpn_gettimeofday(&me->vrpn_Tracker::timestamp, NULL); - char msgbuf[1000]; - vrpn_int32 len; - len = me->vrpn_Tracker::encode_to(msgbuf); - if (me->d_connection->pack_message( - len, me->vrpn_Tracker::timestamp, me->position_m_id, - me->d_sender_id, msgbuf, vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "vrpn_Poser_Analog::handle_change_message(): can't " - "write message: tossing\n"); - return -1; - } - } - - return 0; -} - -int vrpn_Poser_Analog::handle_vel_change_message(void* userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Poser_Analog* me = (vrpn_Poser_Analog*)userdata; - const char* params = (p.buffer); - int i; - bool outside_bounds = false; - - // Fill in the parameters to the poser from the message - if (p.payload_len != (8 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_Poser_Server: velocity message payload error\n"); - fprintf(stderr, " (got %d, expected %d)\n", p.payload_len, - static_cast<int>(8 * sizeof(vrpn_float64))); - return -1; - } - me->p_timestamp = p.msg_time; - - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &me->p_vel[i]); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &me->p_vel_quat[i]); - } - vrpn_unbuffer(¶ms, &me->p_vel_quat_dt); - - // Check the velocity against the max and min values of the workspace - for (i = 0; i < 3; i++) { - if (me->p_vel[i] < me->p_vel_min[i]) { - me->p_vel[i] = me->p_vel_min[i]; - outside_bounds = true; - } - else if (me->p_vel[i] > me->p_vel_max[i]) { - me->p_vel[i] = me->p_vel_max[i]; - outside_bounds = true; - } - } - - // XXX Update the values now. - - if (me->d_act_as_tracker) { - // Tell the client where we actually went (clipped position and - // orientation). - // using sensor 0 as the one to use to report. - me->d_sensor = 0; - me->vel[0] = me->p_vel[0]; - me->vel[1] = me->p_vel[1]; - me->vel[2] = me->p_vel[2]; - me->vel_quat[0] = me->p_vel_quat[0]; - me->vel_quat[1] = me->p_vel_quat[1]; - me->vel_quat[2] = me->p_vel_quat[2]; - me->vel_quat[3] = me->p_vel_quat[3]; - vrpn_gettimeofday(&me->vrpn_Tracker::timestamp, NULL); - char msgbuf[1000]; - vrpn_int32 len; - len = me->vrpn_Tracker::encode_vel_to(msgbuf); - if (me->d_connection->pack_message( - len, me->vrpn_Tracker::timestamp, me->velocity_m_id, - me->d_sender_id, msgbuf, vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "vrpn_Poser_Analog::handle_vel_change_message(): " - "can't write message: tossing\n"); - return -1; - } - } - - return 0; -} - -bool vrpn_Poser_Analog::update_Analog_values() -{ - vrpn_float64 value; - bool ret = true; - - // XXX ONLY DOING TRANS FOR NOW...ADD ROT LATER - if (x.axis.channel != -1 && x.axis.channel < vrpn_CHANNEL_MAX) { - value = (p_pos[0] - x.axis.offset) * x.axis.scale; - if (x.ana != NULL) { - ret &= x.ana->request_change_channel_value(x.axis.channel, value); - } - } - if (y.axis.channel != -1 && y.axis.channel < vrpn_CHANNEL_MAX) { - value = (p_pos[1] - y.axis.offset) * y.axis.scale; - if (y.ana != NULL) { - ret &= y.ana->request_change_channel_value(y.axis.channel, value); - } - } - if (z.axis.channel != -1 && z.axis.channel < vrpn_CHANNEL_MAX) { - value = (p_pos[2] - z.axis.offset) * z.axis.scale; - if (z.ana != NULL) { - ret &= z.ana->request_change_channel_value(z.axis.channel, value); - } - } - - return ret; -} diff --git a/src/vrpn/vrpn_Poser_Analog.h b/src/vrpn/vrpn_Poser_Analog.h deleted file mode 100644 index fe5d931a3d0f39fd50aa9af0f293937061beb308..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Poser_Analog.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef vrpn_POSER_ANALOG_H -#define vrpn_POSER_ANALOG_H -#include <stdio.h> // for NULL - -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Poser.h" // for vrpn_Poser -#include "vrpn_Tracker.h" // for vrpn_Tracker -#include "vrpn_Types.h" // for vrpn_float64 - -class VRPN_API vrpn_Analog_Output_Remote; -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -// This code is for a Poser server that uses a vrpn_Analog_Output to drive a -// device. -// It is basically the inverse of a vrpn_Tracker_AnalogFly. -// We are assuming that one Analog device will be used to drive all axes. This -// could be -// Changed by storing an Analog device per axis. -// -// This class can also act as a vrpn_Tracker so that it can report back the new -// positions -// and velocities to the client when the requests are within the bounds. This -// is not -// what you want it to do if you've got an independent tracker watching your -// output, -// and in any case is open-loop, so use with caution. - -// Class for holding data used in transforming pose data to analog values for -// each axis -class VRPN_API vrpn_PA_axis { -public: - vrpn_PA_axis(char *name = NULL, int c = -1, double offset = 0.0, - double s = 1.0) - : ana_name(name) - , channel(c) - , offset(offset) - , scale(s) - { - } - - char *ana_name; // Name of the Analog Output device to drive with this axis - int channel; // Which channel to use from the Analog device. Default value - // of -1 means - // no motion for this axis - double offset; // Offset to apply to pose values for this channel to reach 0 - double - scale; // Scale applied to pose values to get the correct analog value -}; - -// Class for passing in config data. Usually read from the vrpn.cfg file in the -// server code. -class VRPN_API vrpn_Poser_AnalogParam { -public: - vrpn_Poser_AnalogParam(); - - // Translation for the three axes - vrpn_PA_axis x, y, z; - - // Rotation for the three axes - vrpn_PA_axis rx, ry, rz; - - // Workspace max and min info - vrpn_float64 pos_min[3], pos_max[3], pos_rot_min[3], pos_rot_max[3], - vel_min[3], vel_max[3], vel_rot_min[3], vel_rot_max[3]; -}; - -class VRPN_API vrpn_Poser_Analog; // Forward reference - -class VRPN_API vrpn_PA_fullaxis { -public: - vrpn_PA_fullaxis(void) - { - ana = NULL; - value = 0.0; - pa = NULL; - }; - - vrpn_PA_axis axis; - vrpn_Analog_Output_Remote *ana; - vrpn_Poser_Analog *pa; - double value; -}; - -class VRPN_API vrpn_Poser_Analog : public vrpn_Poser, public vrpn_Tracker { -public: - vrpn_Poser_Analog(const char *name, vrpn_Connection *c, - vrpn_Poser_AnalogParam *p, bool act_as_tracker = false); - - virtual ~vrpn_Poser_Analog(); - - virtual void mainloop(); - -protected: - // Axes for translation and rotation - vrpn_PA_fullaxis x, y, z, rx, ry, rz; - - // Should we act like a tracker, and report back values? - bool d_act_as_tracker; - - static int VRPN_CALLBACK - handle_change_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_vel_change_message(void *userdata, vrpn_HANDLERPARAM p); - - // Routine to update the analog values from the current pose - bool update_Analog_values(); - bool setup_channel(vrpn_PA_fullaxis *full); -}; - -#endif diff --git a/src/vrpn/vrpn_Poser_Tek4662.C b/src/vrpn/vrpn_Poser_Tek4662.C deleted file mode 100644 index 3224fb4c7373dee98ed8a9e0c5bcfdfc4506b59a..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Poser_Tek4662.C +++ /dev/null @@ -1,458 +0,0 @@ -#include <math.h> // for floor -#include <stdio.h> // for fprintf, stderr, NULL -#include <string.h> // for strlen, memcpy - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR -#include "vrpn_Connection.h" // for vrpn_HANDLERPARAM, etc -// Include vrpn_Shared.h _first_ to avoid conflicts with sys/time.h -// and unistd.h -#include "vrpn_Shared.h" // for timeval, vrpn_unbuffer, etc -#include "vrpn_Types.h" // for vrpn_float64, vrpn_uint16 - -#ifdef _WIN32 -#ifndef _WIN32_WCE -#include <io.h> -#endif -#endif - -#include "vrpn_Poser_Tek4662.h" - -//#define VERBOSE - -const int vrpn_Poser_Tek4662_FAIL = -1; -const int vrpn_Poser_Tek4662_RESETTING = 0; -const int vrpn_Poser_Tek4662_SYNCING = 1; -const int vrpn_Poser_Tek4662_RUNNING = 2; - -// Plotter motion constants -const double COUNTS_PER_METER = 1.0 / ( (15.0 / 4095.0) * ( 0.0254 / 1.0 ) ); -const double MAX_X = 0.381; // Range of the X axis is 15 inches -const double MAX_Y = 0.254; // Range of the Y axis is 10 inches -const double VELOCITY= (1/0.06144) * (1/0.00254); // Meters per second - -// Constants used as characters to communicate to the plotter -const unsigned char ESC = 27; -const unsigned char BELL = '7'; -const unsigned char DEVICE = 'A'; -const unsigned char GS = 29; //< Puts the plotter into graphics mode -const unsigned char ZERO = 0; -const unsigned char ZEROES[] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; -const unsigned char PLOTTER_ON[] = { ESC, DEVICE, 'E', ZERO }; -const unsigned char RESET[] = { ESC, DEVICE, 'N', ZERO }; -const unsigned char GIN[] = { ESC, DEVICE, 'M' }; -const unsigned char MOVE_TEMPLATE[] = { GS, 0x20, 0x60, 0x60, 0x20, 0x40 }; -const int DATA_RECORD_LENGTH = 7; - -// Constants used to do bit manipulation -const unsigned BITFOUR = 1 << 4; -const unsigned BITFIVE = 1 << 5; -const unsigned LOWFIVEBITS = 0x001f; -const unsigned LOWTWOBITS = 0x0003; - -////////////////////////////////////////////////////////////////////////////////////// -// Server Code - -vrpn_Poser_Tek4662::vrpn_Poser_Tek4662 (const char *name, vrpn_Connection *c, - const char *port, int baud, int bits, - vrpn_SER_PARITY parity) : - vrpn_Poser(name, c), - vrpn_Tracker(name, c), - d_serial_fd(-1), - d_inbufcounter(0), - d_new_location_requested(false), - d_outstanding_requests(0) -{ - // Make sure that we have a valid connection - if (d_connection == NULL) { - fprintf(stderr,"vrpn_Poser_Tek4662: No connection\n"); - return; - } - - // Check the port name; - if (port == NULL) { - fprintf(stderr,"vrpn_Poser_Tek4662: NULL port name\n"); - status = vrpn_Poser_Tek4662_FAIL; - return; - } - - // Open the serial port we're going to use - if ( (d_serial_fd=vrpn_open_commport(port, baud, bits, parity)) == -1) { - fprintf(stderr,"vrpn_Poser_Tek4662: Cannot Open serial port (%s)\n", port); - status = vrpn_Poser_Tek4662_FAIL; - } - - // Register a handler for the position change callback for this device - if (register_autodeleted_handler(req_position_m_id, - handle_change_message, this, d_sender_id)) { - fprintf(stderr,"vrpn_Poser_Server: can't register position handler\n"); - d_connection = NULL; - } - - // Register a handler for the velocity change callback for this device - if (register_autodeleted_handler(req_velocity_m_id, - handle_vel_change_message, this, d_sender_id)) { - fprintf(stderr,"vrpn_Poser_Server: can't register velocity handler\n"); - d_connection = NULL; - } - - // Set up the workspace max and min values - p_pos_min[0] = 0.0; p_pos_max[0] = MAX_X; - p_pos_min[1] = 0.0; p_pos_max[1] = MAX_Y; - p_pos_min[2] = 0.0; p_pos_max[2] = 0.0; // There is no Z axis - p_vel_min[0] = p_vel_max[0] = VELOCITY; // Meters per second - p_vel_min[1] = p_vel_max[1] = VELOCITY; // Meters per second - p_vel_min[2] = p_vel_max[2] = 0.0; // No motion in Z - p_pos_rot_min[0] = 0.0; p_pos_rot_max[0] = 0.0; // There is no rotation - p_pos_rot_min[1] = 0.0; p_pos_rot_max[1] = 0.0; // There is no rotation - p_pos_rot_min[2] = 0.0; p_pos_rot_max[2] = 0.0; // There is no rotation - p_vel_rot_min[0] = 0.0; p_vel_rot_max[0] = 0.0; // There is no rotation - p_vel_rot_min[1] = 0.0; p_vel_rot_max[1] = 0.0; // There is no rotation - p_vel_rot_min[2] = 0.0; p_vel_rot_max[2] = 0.0; // There is no rotation - - // Reset the device and find out what time it is - status = vrpn_Poser_Tek4662_RESETTING; - vrpn_gettimeofday(×tamp, NULL); -} - - -vrpn_Poser_Tek4662::~vrpn_Poser_Tek4662() -{ - // Close com port when destroyed. - if (d_serial_fd != -1) { - vrpn_close_commport(d_serial_fd); - } -} - -// This parses the pen position and location from a GIN report. -// It first verifies that the high-order tag bits match what is -// expected on all bytes (see page 2-27 of the manual). If they -// do not, it returns false; otherwise, true. -static bool interpret_GIN_bytes(const unsigned char inbuf[], bool &pen_down, float &x, float &y) -{ - // Check the high-order tag bits to make sure they are valid. - for (int i = 0; i < 6; i++) { - if ( (inbuf[i] & 0x60) != 0x20) { return false; } - } - if ( (inbuf[6] & 0x60) != 0x40) { return false; } - - // Interpret the pen-down bit. - pen_down = (inbuf[6] & (1<<2)) != 0; - - // Unpack the X and Y coordinates from the plotter report as described on - // page 2-27 of the manual. Note that in GIN mode, the plotter only uses - // the higher-order 12 bits; the lower 4 are set to zero. This means that - // we shift three bit past the right and ignore the lowest bit. - vrpn_uint16 x_int, y_int; - x_int = static_cast<unsigned short>(((inbuf[0] & LOWFIVEBITS) << 7) | ((inbuf[2] & LOWFIVEBITS) << 2) | ((inbuf[4] & LOWFIVEBITS) >> 3)); - y_int = static_cast<unsigned short>(((inbuf[1] & LOWFIVEBITS) << 7) | ((inbuf[3] & LOWFIVEBITS) << 2) | ((inbuf[5] & LOWFIVEBITS) >> 3)); - - // Convert the position from counts to meters. This goes through inches, which is the native - // plotter unit. - x = (float)( x_int / COUNTS_PER_METER ); - y = (float)( y_int / COUNTS_PER_METER ); - -#if 0 - if (pen_down) { printf("XXX pen down\n"); } else { printf("XXX pen up\n"); } - printf("XXX At %f, %f\n", x, y); -#endif - return true; -} - -void vrpn_Poser_Tek4662::reset() -{ - // Wait a little and then flush the input buffer so we don't get extra reports - // from before the reset. - vrpn_SleepMsecs(100); - vrpn_flush_input_buffer( d_serial_fd ); - - // Send a bunch of zeroes to clear out the input buffer, - // then a "Plotter on", then a "Reset" to the plotter. - vrpn_flush_output_buffer( d_serial_fd ); - vrpn_write_characters( d_serial_fd, ZEROES, sizeof(ZEROES) ); - vrpn_write_characters( d_serial_fd, PLOTTER_ON, strlen((char*)PLOTTER_ON) ); - vrpn_write_characters( d_serial_fd, RESET, strlen((char*)RESET) ); - vrpn_drain_output_buffer( d_serial_fd ); - - // Request a position message from the plotter and then wait - // until it responds. Make sure we get a good response. If - // so, then send a Tracker message with the specified position - // and go into SYNCING mode. If not, then reset again. - vrpn_write_characters( d_serial_fd, GIN, strlen((char*)GIN) ); - vrpn_drain_output_buffer( d_serial_fd ); - unsigned char inbuf[DATA_RECORD_LENGTH]; - struct timeval wait_time = { 1, 0 }; - int bufcount = vrpn_read_available_characters( d_serial_fd, inbuf, sizeof(inbuf), &wait_time); - if (bufcount != sizeof(inbuf)) { - fprintf(stderr,"vrpn_Poser_Tek4662::reset(): Expected %d characters, got %d\n", - static_cast<int>(sizeof(inbuf)), bufcount); - } else { - // Parse the input to find our position and store it in the tracker - // position. - float x,y; - bool pen_down; - - vrpn_gettimeofday(×tamp, NULL); - if (!interpret_GIN_bytes(inbuf, pen_down, x, y)) { - send_text_message("vrpn_Poser_Tek4662: Error resetting", timestamp, vrpn_TEXT_ERROR); - return; - } else { - send_text_message("vrpn_Poser_Tek4662: Reset correctly", timestamp, vrpn_TEXT_ERROR); - } - - // Set and send tracker position. - pos[0] = x; pos[1] = y; pos[2] = 0; - d_quat[0] = d_quat[1] = d_quat[2] = 0; d_quat[3] = 1; - if (d_connection) { - char msgbuf[1000]; - int len = vrpn_Tracker::encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, - position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"vrpn_Poser_Tek4662: cannot write message: tossing\n"); - } - } else { - fprintf(stderr,"vrpn_Poser_Tek4662: No valid connection\n"); - } - - // We're waiting for the first character! - d_outstanding_requests = 0; - status = vrpn_Poser_Tek4662_SYNCING; - } -} - -void vrpn_Poser_Tek4662::run() -{ - struct timeval now; - - // Send new positions as needed, in coordination with the callback handler. - if ((d_outstanding_requests == 0) && d_new_location_requested) { - - // Figure out the integer location corresponding to the new poser - // position requested. We've already tested to make sure that the - // position is in bounds. - vrpn_uint16 x_int, y_int; - x_int = (vrpn_uint16)floor( p_pos[0] * COUNTS_PER_METER ); - y_int = (vrpn_uint16)floor( p_pos[1] * COUNTS_PER_METER ); - - // Send a command to the plotter to move to the new location. - // Request the new location be reported. - // The first two characters tell it to go into graph mode; the - // last five include the correct upper-two bits for each byte, - // with the rest filled in as described on page 2-26 in the manual. - unsigned char MOVE[sizeof(MOVE_TEMPLATE)]; - memcpy(MOVE, MOVE_TEMPLATE, sizeof(MOVE)); - // Five MSB of y into 5 LSB - MOVE[1] |= y_int >> 7; - // Two LSB of y into bits 2-3, two LSB of x into bits 0-1 - MOVE[2] |= (x_int & LOWTWOBITS); - MOVE[2] |= (y_int & LOWTWOBITS) << 2; - // The rest of the Y bits (five in the middle) to LSB - MOVE[3] |= (y_int >> 2) & LOWFIVEBITS; - // High-order x bits into low-order bits - MOVE[4] |= x_int >> 7; - // Intermediate X bits into lower-order bits - MOVE[5] |= (x_int >> 2) & LOWFIVEBITS; - vrpn_write_characters(d_serial_fd, MOVE, sizeof(MOVE)); - vrpn_write_characters(d_serial_fd, GIN, strlen((char*)GIN) ); - - // Record the fact that we're moving so that we won't send a new - // command until the move completes. -#if 0 - printf("XXX Going to %f,%f (%d, %d)\n", p_pos[0], p_pos[1], x_int, y_int); -#endif - d_outstanding_requests++; - d_new_location_requested = false; - } - - // Listen for any new reports from the device. Recall that we can get - // partial results reported, especially with a 1200-baud or slower serial - // connection like we have on this device. - // This assumes that the plotter does not tell us where it is until - // it finishes moving there. This assumption looks valid from short - // tests. - if (status == vrpn_Poser_Tek4662_SYNCING) { // Try to get first byte - // Zero timeout, poll for any available characters - struct timeval timeout = {0, 0}; - if (1 == vrpn_read_available_characters(d_serial_fd, d_inbuf, 1, &timeout)) { - d_inbufcounter = 1; //< Ignore the status byte for the following record - status = vrpn_Poser_Tek4662_RUNNING; - vrpn_gettimeofday(×tamp, NULL); - } else { - d_inbufcounter = 0; - } - } - if (status == vrpn_Poser_Tek4662_RUNNING) { - // Zero timeout, poll for any available characters - struct timeval timeout = {0, 0}; - int result = vrpn_read_available_characters(d_serial_fd, - &d_inbuf[d_inbufcounter], DATA_RECORD_LENGTH-d_inbufcounter, &timeout); - - if (result < 0) { - send_text_message("vrpn_Poser_Tek4662: Error reading", timestamp, vrpn_TEXT_ERROR); - status = vrpn_Poser_Tek4662_RESETTING; - } else { - d_inbufcounter += result; - if (d_inbufcounter == DATA_RECORD_LENGTH) { - d_inbufcounter = 0; - status = vrpn_Poser_Tek4662_SYNCING; - - // Parse the input to find our position and store it in the tracker - // position. - float x,y; - bool pen_down; - - if (!interpret_GIN_bytes(d_inbuf, pen_down, x, y)) { - send_text_message("vrpn_Poser_Tek4662: Error parsing position", timestamp, vrpn_TEXT_ERROR); - return; - } - - // Set and send tracker position. - pos[0] = x; pos[1] = y; pos[2] = 0; - d_quat[0] = d_quat[1] = d_quat[2] = 0; d_quat[3] = 1; - if (d_connection) { - char msgbuf[1000]; - int len = vrpn_Tracker::encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, - position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"vrpn_Poser_Tek4662: cannot write message: tossing\n"); - } - } else { - fprintf(stderr,"vrpn_Poser_Tek4662: No valid connection\n"); - } - d_outstanding_requests--; - } - } - } - - // Request the position four times per second when we're outside of - // the position command. Remember to increment the number of outstanding - // requests so the position-request code keeps working. This will let - // the user move the plotter around with the joystick and have the - // tracker follow around. It will also keep sending reports so that a - // client the connects after reset will know where the plotter is fairly - // quickly. - - if ((d_outstanding_requests == 0) && !d_new_location_requested) { - vrpn_gettimeofday(&now, NULL); - if (vrpn_TimevalDuration(now, timestamp) > 250000L) { - // Record the fact that we're asking so that we won't send a new - // command until the response completes. - vrpn_write_characters(d_serial_fd, GIN, strlen((char*)GIN) ); - d_outstanding_requests++; - } - } - - // We need a watchdog timer to make sure that the plotter doesn't just - // die on us in the middle of a move. If we don't hear from it for 5 seconds, - // reset it. - vrpn_gettimeofday(&now, NULL); - if (vrpn_TimevalDuration(now, timestamp) > 5000000L) { - send_text_message("vrpn_Poser_Tek4662: Device timeout (resetting)", now, vrpn_TEXT_ERROR); - status = vrpn_Poser_Tek4662_RESETTING; - return; - } -} - -void vrpn_Poser_Tek4662::mainloop() -{ - // Call the generic server mainloop routine, since this is a server - server_mainloop(); - - // Depending on what mode we're in, do our thing. - - switch (status) { - case vrpn_Poser_Tek4662_RESETTING: - reset(); - break; - - case vrpn_Poser_Tek4662_SYNCING: - case vrpn_Poser_Tek4662_RUNNING: - run(); - break; - - case vrpn_Poser_Tek4662_FAIL: - break; - - default: - fprintf(stderr,"vrpn_Poser_Tek4662: Unknown status (%d)\n", status); - status = vrpn_Poser_Tek4662_FAIL; - break; - } -} - -int vrpn_Poser_Tek4662::handle_change_message(void* userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Poser_Tek4662* me = (vrpn_Poser_Tek4662 *)userdata; - const char* params = (p.buffer); - int i; - // Fill in the parameters to the poser from the message - if (p.payload_len != (7 * sizeof(vrpn_float64)) ) { - fprintf(stderr,"vrpn_Poser_Server: change message payload error\n"); - fprintf(stderr," (got %d, expected %d)\n", - p.payload_len, static_cast<int>(7 * sizeof(vrpn_float64)) ); - return -1; - } - me->p_timestamp = p.msg_time; - - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &me->p_pos[i]); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &me->p_quat[i]); - } - - // Check the pose against the max and min values of the workspace - for (i = 0; i < 3; i++) { - if (me->p_pos[i] < me->p_pos_min[i]) { - me->p_pos[i] = me->p_pos_min[i]; - } - else if (me->p_pos[i] > me->p_pos_max[i]) { - me->p_pos[i] = me->p_pos_max[i]; - } - } - - // Set up so that run() will move the plotter to the requested location. - me->d_new_location_requested = true; - - return 0; -} - -int vrpn_Poser_Tek4662::handle_vel_change_message(void* userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Poser_Tek4662* me = (vrpn_Poser_Tek4662*)userdata; - const char* params = (p.buffer); - int i; - - // Fill in the parameters to the poser from the message - if (p.payload_len != (8 * sizeof(vrpn_float64)) ) { - fprintf(stderr,"vrpn_Poser_Server: velocity message payload error\n"); - fprintf(stderr," (got %d, expected %d)\n", - p.payload_len, static_cast<int>(8 * sizeof(vrpn_float64)) ); - return -1; - } - me->p_timestamp = p.msg_time; - - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &me->p_vel[i]); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &me->p_vel_quat[i]); - } - vrpn_unbuffer(¶ms, &me->p_vel_quat_dt); - - // Check the velocity against the max and min values of the workspace - for (i = 0; i < 3; i++) { - if (me->p_vel[i] < me->p_vel_min[i]) { - me->p_vel[i] = me->p_vel_min[i]; - } - else if (me->p_vel[i] > me->p_vel_max[i]) { - me->p_vel[i] = me->p_vel_max[i]; - } - } - - // No response to this message. - return 0; -} diff --git a/src/vrpn/vrpn_Poser_Tek4662.h b/src/vrpn/vrpn_Poser_Tek4662.h deleted file mode 100644 index 4aa898671afd258e8a09894db20f9a1dd2426256..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Poser_Tek4662.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef vrpn_POSER_TEK4662_H -#define vrpn_POSER_TEK4662_H -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Poser.h" // for vrpn_Poser -#include "vrpn_Serial.h" // for ::vrpn_SER_PARITY_NONE, etc -#include "vrpn_Tracker.h" // for vrpn_Tracker - -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -// This code is for a Poser server that uses a Tektronix 4662 plotter in the -// RS-232 mode. This is a 2D device. -// This class also acts as a vrpn_Tracker so that it can report back the new positions -// to the client. This lets the system operate in a closed-loop fashion. -// -// It assumes the following settings on the plotter: GIN terminator (none), no -// DEL modification, device A, copy mode off, 1 stop bit, CR translation off, -// low-speed plotting off, RS-232 interface enabled. It assumes that the plotter -// is not in local mode and that the communications is through the Modem port. - -// If multiple requests for motion to a new location arrive while an ongoing -// move is being made, all but the last are ignored. - -class VRPN_API vrpn_Poser_Tek4662 : public vrpn_Poser, public vrpn_Tracker { -public: - vrpn_Poser_Tek4662(const char* name, vrpn_Connection* c, - const char * port, int baud = 1200, int bits = 8, - vrpn_SER_PARITY parity = vrpn_SER_PARITY_NONE); - - virtual ~vrpn_Poser_Tek4662(); - - virtual void mainloop(); - -protected: - int d_serial_fd; //< File descriptor for the serial port we're using - unsigned char d_inbuf[1024]; //< Input buffer for characters from the plotter - int d_inbufcounter; //< How many characters have been read - - float d_newx, d_newy; //< New location that we're supposed to go to - bool d_new_location_requested; //< Has a new location been requested since our last move? - int d_outstanding_requests; //< How many GIN requests are outstanding? - - void reset(void); - void run(); - - static int VRPN_CALLBACK handle_change_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK handle_vel_change_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -#endif - diff --git a/src/vrpn/vrpn_Qt_GUI_server/CMakeLists.txt b/src/vrpn/vrpn_Qt_GUI_server/CMakeLists.txt deleted file mode 100644 index 49e092a0d53012ba6c138458da3c806c6d2277b7..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -project(vrpn_Qt) - -set(EXECUTABLE_OUTPUT_PATH "${vrpn_Qt_BINARY_DIR}/bin") - -#----------------------------------------------------------------------------- -# Local CMake Modules -list(APPEND - CMAKE_MODULE_PATH - ${vrpn_Qt_SOURCE_DIR} - ${vrpn_Qt_SOURCE_DIR}/cmake) - - -####################################### -# Build shared library or not -####################################### - -option(BUILD_SHARED_LIBS 0) - - -####################################### -# Include Qt -####################################### - -# Need XML for QAutoGUI -set(QT_USE_QTXML TRUE) - -#Use Qt -find_package(Qt4 REQUIRED) -include(${QT_USE_FILE}) - -include_directories(${QT_INCLUDE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}) - -# Set up variables for moc -set(QT_HEADER vrpn_Qt.h) -set(QT_SRC vrpn_Qt.C) - -# Do moc stuff -qt4_wrap_cpp(QT_MOC_SRC ${QT_HEADER}) - - -####################################### -# Include vrpn -####################################### - -find_package(quatlib REQUIRED) # Sets QUATLIB_INCLUDE_DIR and QUATLIB_LIBRARIES -find_package(VRPN REQUIRED) - -include_directories(${VRPN_INCLUDE_DIR}) - - -####################################### -# Build setup -####################################### - -add_library(vrpn_Qt ${QT_HEADER} ${QT_SRC} ${QT_MOC_SRC} ${SRC}) -target_link_libraries(vrpn_Qt ${QT_LIBRARIES} ${VRPN_LIBRARY}) -if(WIN32) # MS-Windows, both 32 and 64 bits - target_link_libraries(vrpn_Qt wsock32) -elseif(APPLE) # Apple - target_link_libraries(vrpn_Qt m) # Math library -elseif(UNIX) # other UNIXes - target_link_libraries(vrpn_Qt m) # Math library -endif() - - -####################################### -# Include applications -####################################### - -add_subdirectory(vrpn_Qt_AutoGUI) -add_subdirectory(vrpn_Qt_AppExample) - diff --git a/src/vrpn/vrpn_Qt_GUI_server/README.txt b/src/vrpn/vrpn_Qt_GUI_server/README.txt deleted file mode 100644 index b52e83d592ee16bf7e6e1a25b62c0ed5a5beb190..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/README.txt +++ /dev/null @@ -1,20 +0,0 @@ -This tool was submitted by David Borland. It lets you create a Qt-based GUI whose widgets control the values for the buttons and analogs from a VRPN server. - -There are two ways to use it: -The first is to create a Qt GUI application using standard tools (i.e. Qt Designer). An example of this method is found in the vrpn_Qt_AppExample folder. -The second is to use the vrpn_Qt_AutoGUI tool found in the vrpn_Qt_AutoGUI folder. It is configurable with an XML file, so that you can generate custom GUI controls for your VR application quickly, and edit them easily. - -You create the makefiles to compile the code in this directory using CMake. The current build has been tested only on MingGW on Windows; it was developed for Visual Studio. - -The VRPN library must first have been made and installed (this will also build and install the quat library). These should then be found by CMake when you configure it. - -You will probably need to point the configuration at the QMake executable that you want to use. - -The executables in the bin/ directory under the build (for MinGW, Release/ or Debug/ for Visual Studio) are ready to use. - -You will either need to have all of the Qt DLLs in your path or copy them into the executable directory so that you can run the program. - -For the vrpn_Qt_AutoGUI, you also need to have a vrpn_Qt_GUI.xml file in the same directory as the executable; it tells what GUI elements should be created. You can find an example configuration file in the vrpn_Qt_GUI subdirectory (this should be copied automatically to the bin directory). You can use the -xmlFile command-line argument to select a different file. - -The device name to connect to if you are running on the same host is "qt@localhost". This device has 5 buttons (0 through 4) and 8 analogs (0 through 7). The console window will show you which GUI components are mapped to which channels (this mapping is done in the XML file). The example XML file has Button0-Button4 and Analog0-Analog7 (but analogs 3, 5, and 7 are not used). You can use the -serverName command-line argument to change the name of the local server. - diff --git a/src/vrpn/vrpn_Qt_GUI_server/cmake/FindVRPN.cmake b/src/vrpn/vrpn_Qt_GUI_server/cmake/FindVRPN.cmake deleted file mode 100644 index b2dabc6c086db76ae19c4f07bdfca20439f22840..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/cmake/FindVRPN.cmake +++ /dev/null @@ -1,124 +0,0 @@ -# - try to find VRPN library -# -# Cache Variables: -# VRPN_LIBRARY -# VRPN_SERVER_LIBRARY -# VRPN_INCLUDE_DIR -# -# Non-cache variables you might use in your CMakeLists.txt: -# VRPN_FOUND -# VRPN_SERVER_LIBRARIES -# VRPN_LIBRARIES -# VRPN_INCLUDE_DIRS -# -# VRPN_ROOT_DIR is searched preferentially for these files -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(VRPN_ROOT_DIR - "${VRPN_ROOT_DIR}" - CACHE - PATH - "Root directory to search for VRPN") - -if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8") - set(_libsuffixes lib64 lib) - - # 64-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _progfiles) -else() - set(_libsuffixes lib) - if(NOT "$ENV{ProgramFiles(x86)}" STREQUAL "") - # 32-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles(x86)}" _progfiles) - else() - # 32-bit dir on win32, useless to us on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _progfiles) - endif() -endif() - -### -# Configure VRPN -### - -find_path(VRPN_INCLUDE_DIR - NAMES - vrpn_Connection.h - PATH_SUFFIXES - include - include/vrpn - HINTS - "${VRPN_ROOT_DIR}" - PATHS - "${_progfiles}/VRPN") - -find_library(VRPN_LIBRARY - NAMES - vrpn - PATH_SUFFIXES - ${_libsuffixes} - HINTS - "${VRPN_ROOT_DIR}" - PATHS - "${_progfiles}/VRPN") - -find_library(VRPN_SERVER_LIBRARY - NAMES - vrpnserver - PATH_SUFFIXES - ${_libsuffixes} - HINTS - "${VRPN_ROOT_DIR}" - PATHS - "${_progfiles}/VRPN") - -### -# Dependencies -### -set(_deps_libs) -set(_deps_includes) -set(_deps_check) - -find_package(quatlib) -list(APPEND _deps_libs ${QUATLIB_LIBRARIES}) -list(APPEND _deps_includes ${QUATLIB_INCLUDE_DIRS}) -list(APPEND _deps_check QUATLIB_FOUND) - -if(NOT WIN32) - find_package(Threads) - list(APPEND _deps_libs ${CMAKE_THREAD_LIBS_INIT}) - list(APPEND _deps_check CMAKE_HAVE_THREADS_LIBRARY) -endif() - - -# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(VRPN - DEFAULT_MSG - VRPN_LIBRARY - VRPN_INCLUDE_DIR - ${_deps_check}) - -if(VRPN_FOUND) - set(VRPN_INCLUDE_DIRS "${VRPN_INCLUDE_DIR}" ${_deps_includes}) - set(VRPN_LIBRARIES "${VRPN_LIBRARY}" ${_deps_libs}) - set(VRPN_SERVER_LIBRARIES "${VRPN_SERVER_LIBRARY}" ${_deps_libs}) - - mark_as_advanced(VRPN_ROOT_DIR) -endif() - -mark_as_advanced(VRPN_LIBRARY - VRPN_SERVER_LIBRARY - VRPN_INCLUDE_DIR) diff --git a/src/vrpn/vrpn_Qt_GUI_server/cmake/Findquatlib.cmake b/src/vrpn/vrpn_Qt_GUI_server/cmake/Findquatlib.cmake deleted file mode 100644 index 578d6d2e099215015c653cd5fe1825fbf33af17f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/cmake/Findquatlib.cmake +++ /dev/null @@ -1,99 +0,0 @@ -# - Find quatlib -# Find the quatlib headers and libraries. -# -# QUATLIB_INCLUDE_DIRS - where to find quat.h -# QUATLIB_LIBRARIES - List of libraries when using quatlib. -# QUATLIB_FOUND - True if quatlib found. -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(TARGET quat) - # Look for the header file. - find_path(QUATLIB_INCLUDE_DIR NAMES quat.h - PATHS ${quatlib_SOURCE_DIR}) - - set(QUATLIB_LIBRARY "quat") - -else() - set(QUATLIB_ROOT_DIR - "${QUATLIB_ROOT_DIR}" - CACHE - PATH - "Root directory to search for quatlib") - if(DEFINED VRPN_ROOT_DIR AND NOT QUATLIB_ROOT_DIR) - set(QUATLIB_ROOT_DIR "${VRPN_ROOT_DIR}") - mark_as_advanced(QUATLIB_ROOT_DIR) - endif() - - if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8") - set(_libsuffixes lib64 lib) - - # 64-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _progfiles) - else() - set(_libsuffixes lib) - if(NOT "$ENV{ProgramFiles(x86)}" STREQUAL "") - # 32-bit dir: only set on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles(x86)}" _progfiles) - else() - # 32-bit dir on win32, useless to us on win64 - file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _progfiles) - endif() - endif() - - # Look for the header file. - find_path(QUATLIB_INCLUDE_DIR - NAMES - quat.h - HINTS - "${QUATLIB_ROOT_DIR}" - PATH_SUFFIXES - include - PATHS - "${_progfiles}/VRPN" - "${_progfiles}/quatlib") - - # Look for the library. - find_library(QUATLIB_LIBRARY - NAMES - quat.lib - libquat.a - HINTS - "${QUATLIB_ROOT_DIR}" - PATH_SUFFIXES - ${_libsuffixes} - PATHS - "${_progfiles}/VRPN" - "${_progfiles}/quatlib") -endif() - -# handle the QUIETLY and REQUIRED arguments and set QUATLIB_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(quatlib - DEFAULT_MSG - QUATLIB_LIBRARY - QUATLIB_INCLUDE_DIR) - -if(QUATLIB_FOUND) - set(QUATLIB_LIBRARIES ${QUATLIB_LIBRARY}) - if(NOT WIN32) - list(APPEND QUATLIB_LIBRARIES m) - endif() - set(QUATLIB_INCLUDE_DIRS ${QUATLIB_INCLUDE_DIR}) - - mark_as_advanced(QUATLIB_ROOT_DIR) -else() - set(QUATLIB_LIBRARIES) - set(QUATLIB_INCLUDE_DIRS) -endif() - -mark_as_advanced(QUATLIB_LIBRARY QUATLIB_INCLUDE_DIR) diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt.C b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt.C deleted file mode 100644 index 66c4b7fd7dbc604f83492957cd502d46990f3207..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt.C +++ /dev/null @@ -1,201 +0,0 @@ -/*============================================================================================= - - Name: vrpn_Qt.C - - Author: David Borland, EventLab - - Description: The vrpn_Qt class. - - This class is designed to enable remote control of an application using VRPN - for communication. - - All widgets derived from QAbstractButton are supported with a VRPN button - device, and all widgets derived from QAbstractSlider, along with - QDoubleSpinBox and QSpinBox, are supported as channels of a VRPN analog device. - - Widgets can be added individually using AddWidget(), or all children of a - widget can be added using AddChildren. - -=============================================================================================*/ - - -#include "vrpn_Qt.h" - -#include <QTimer> - -// Buttons -#include <QAbstractButton> - -// Analogs -#include <QAbstractSlider> -#include <QDoubleSpinBox> -#include <QSpinBox> - - -// Callback for new connections -int VRPN_CALLBACK handle_gotConnection(void* userData, vrpn_HANDLERPARAM) { - vrpn_Qt* server = static_cast<vrpn_Qt*>(userData); - - // Reset "last" values so report_changes() will send a report - server->ResetLast(); - - return 0; -} - - -vrpn_Qt::vrpn_Qt(const char* name, vrpn_Connection* c, QObject* parent, int updateRate) -: QObject(parent), vrpn_Button_Filter(name, c), vrpn_Analog(name, c) { - // Create a timer to call mainloop - QTimer* timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(mainloop())); - timer->start(updateRate); - - // Create a callback for new connections - vrpn_int32 gotConnection = c->register_message_type(vrpn_got_connection); - c->register_handler(gotConnection, handle_gotConnection, this); -} - - -void vrpn_Qt::AddWidget(QWidget* widget) { - // Ignore widgets called vrpn_Qt_ignore - if (widget->objectName() == "vrpn_Qt_ignore") { - return; - } - - - // Check if widget is derived from abstract button - if (qobject_cast<QAbstractButton*>(widget)) { - QAbstractButton* button = qobject_cast<QAbstractButton*>(widget); - - connect(button, SIGNAL(pressed()), this, SLOT(ButtonChanged())); - connect(button, SIGNAL(released()), this, SLOT(ButtonChanged())); - - buttonWidgets.append(button); - buttons[num_buttons] = button->isChecked(); - num_buttons++; - } - // Check if widget is derived from abstract slider - else if (qobject_cast<QAbstractSlider*>(widget)) { - QAbstractSlider* slider = qobject_cast<QAbstractSlider*>(widget); - - connect(slider, SIGNAL(valueChanged(int)), this, SLOT(AnalogChanged())); - - analogWidgets.append(slider); - channel[num_channel] = slider->value(); - num_channel++; - } - // Check for double spin box - else if (qobject_cast<QDoubleSpinBox*>(widget)) { - QDoubleSpinBox* doubleSpinBox = qobject_cast<QDoubleSpinBox*>(widget); - - connect(doubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(AnalogChanged())); - - analogWidgets.append(doubleSpinBox); - channel[num_channel] = doubleSpinBox->value(); - num_channel++; - } - // Check for spin box - else if (qobject_cast<QSpinBox*>(widget)) { - QSpinBox* spinBox = qobject_cast<QSpinBox*>(widget); - - connect(spinBox, SIGNAL(valueChanged(int)), this, SLOT(AnalogChanged())); - - analogWidgets.append(spinBox); - channel[num_channel] = spinBox->value(); - num_channel++; - } - - - // Sanity check - if (buttonWidgets.size() != num_buttons) { - fprintf(stderr, "Warning: number of Qt buttons and VRPN buttons differ!\n"); - } - - // Sanity check - if (analogWidgets.size() != num_channel) { - fprintf(stderr, "Warning: number of Qt analog widgets and VRPN analog channels differ!\n"); - } -} - -void vrpn_Qt::AddChildren(QWidget* widget) { - // Try to add each child of the input widget - QList<QWidget*> list = widget->findChildren<QWidget*>(); - foreach(QWidget* w, list) { - AddWidget(w); - } -} - - -void vrpn_Qt::PrintWidgets() { - // Print buttons - for (int i = 0; i < buttonWidgets.size(); i++) { - printf("Button %d: %s\n", i, buttonWidgets[i]->objectName().toLatin1().constData()); - } - - printf("\n"); - - // Print analogs - for (int i = 0; i < analogWidgets.size(); i++) { - printf("Analog %d: %s\n", i, analogWidgets[i]->objectName().toLatin1().constData()); - } -} - - -void vrpn_Qt::ResetLast() { - for (int i = 0; i < num_buttons; i++) { - lastbuttons[i] = !buttons[i]; - } - for (int i = 0; i < num_channel; i++) { - last[i] = channel[i] - 1.0; - } -} - - -void vrpn_Qt::ButtonChanged() { - // Update all VRPN buttons from widgets because we don't know what button this is - for (int i = 0; i < num_buttons; i++) { - buttons[i] = buttonWidgets[i]->isChecked() || buttonWidgets[i]->isDown(); - } -} - -void vrpn_Qt::AnalogChanged() { - // Update all VRPN analog channels from widgets because we don't know what spin box this is - for (int i = 0; i < num_channel; i++) { - // Cast to the correct widget type and set the value - if (qobject_cast<QAbstractSlider*>(analogWidgets[i])) { - QAbstractSlider* slider = qobject_cast<QAbstractSlider*>(analogWidgets[i]); - channel[i] = slider->value(); - } - else if (qobject_cast<QDoubleSpinBox*>(analogWidgets[i])) { - QDoubleSpinBox* doubleSpinBox = qobject_cast<QDoubleSpinBox*>(analogWidgets[i]); - channel[i] = doubleSpinBox->value(); - } - else if (qobject_cast<QSpinBox*>(analogWidgets[i])) { - QSpinBox* spinBox = qobject_cast<QSpinBox*>(analogWidgets[i]); - channel[i] = spinBox->value(); - } - } -} - - -void vrpn_Qt::mainloop() { - // Call the connection mainloop - d_connection->mainloop(); - - // Call the generic server mainloop - server_mainloop(); - - // Get a time stamp - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - - // Set the time stamp for each device type - vrpn_Button_Filter::timestamp.tv_sec = current_time.tv_sec; - vrpn_Button_Filter::timestamp.tv_usec = current_time.tv_usec; - vrpn_Analog::timestamp.tv_sec = current_time.tv_sec; - vrpn_Analog::timestamp.tv_usec = current_time.tv_usec; - - // Send updates - vrpn_Button_Filter::report_changes(); - vrpn_Analog::report_changes(); -} diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt.h b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt.h deleted file mode 100644 index e8b954a757555b453af2e4ac4f94b05a185593ea..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt.h +++ /dev/null @@ -1,82 +0,0 @@ -/*============================================================================================= - - Name: vrpn_Qt.h - - Author: David Borland, EventLab - - Description: The vrpn_Qt class. - - This class is designed to enable remote control of an application using VRPN - for communication. - - All widgets derived from QAbstractButton are supported with a VRPN button - device, and all widgets derived from QAbstractSlider, along with - QDoubleSpinBox and QSpinBox, are supported as channels of a VRPN analog device. - - Widgets can be added individually using AddWidget(), or all children of a - widget can be added using AddChildren. - -=============================================================================================*/ - - -#ifndef VRPN_QT_H -#define VRPN_QT_H - - -#include <QObject> - -#include <vrpn_Analog.h> -#include <vrpn_Button.h> - -class QAbstractButton; -class QWidget; - - -class vrpn_Qt : public QObject, public vrpn_Button_Filter, public vrpn_Analog { - Q_OBJECT - -public: - // - // Constructor - // - // name: VRPN device name - // - // c: VRPN connection to use - // - // parent: Qt parent object - // - // updateRate: Interval of QTimer used to call mainloop(), in milliseconds - // - vrpn_Qt(const char* name, vrpn_Connection* c, QObject* parent = NULL, int updateRate = 10); - - // Add widget - void AddWidget(QWidget* widget); - - // Add all child widgets of this widget - void AddChildren(QWidget* widget); - - // Print widget information - void PrintWidgets(); - - // Resets the "last" values to force report_changes() to send a report of the current state. - // Used to send send current state to newly-connected clients. - void ResetLast(); - -public slots: - // Widget changes - void ButtonChanged(); - void AnalogChanged(); - - // Instantiate VRPN pure virtual method - virtual void mainloop(); - -protected: - // Holds widgets for all button types - QList<QAbstractButton*> buttonWidgets; - - // Holds widgets for all analog types - QList<QWidget*> analogWidgets; -}; - - -#endif diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/CMakeLists.txt b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/CMakeLists.txt deleted file mode 100644 index 3dafcd563b229e701bbf188969bbbfa6d7c70a99..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -project(vrpn_Qt_AppExample) - -set(EXECUTABLE_OUTPUT_PATH "${vrpn_Qt_BINARY_DIR}/bin") - - -####################################### -# Qt moc -####################################### - -# Set up variables for moc -set(QT_UI MainWindow.ui) -set(QT_HEADER MainWindow.h) -set(QT_SRC vrpn_Qt_AppExample.cpp MainWindow.cpp) - -include_directories(${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}) - -# Do moc stuff -set(QT_UI_HEADER) -set(QT_MOC_SRC) -qt4_wrap_ui(QT_UI_HEADER ${QT_UI}) -qt4_wrap_cpp(QT_MOC_SRC ${QT_HEADER}) -set_source_files_properties(${QT_SRC} - PROPERTIES - OBJECT_DEPENDS - "${QT_UI_HEADER}") - - -####################################### -# Build setup -####################################### - -add_executable(vrpn_Qt_AppExample ${QT_HEADER} ${QT_SRC} ${QT_MOC_SRC}) -add_dependencies(vrpn_Qt_AppExample vrpn_Qt) -target_link_libraries(vrpn_Qt_AppExample vrpn_Qt) - diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/MainWindow.cpp b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/MainWindow.cpp deleted file mode 100644 index 560a78446a265dc3ab9bcb8d744f437592e077f7..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/MainWindow.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/*========================================================================= - - Name: MainWindow.cpp - - Author: David Borland, EventLab - - Description: Main window for vrpn_Qt_AppExample. - -=========================================================================*/ - - -#include "MainWindow.h" - - -// Constructor -MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) { - // Create the GUI from the Qt Designer file - setupUi(this); -} \ No newline at end of file diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/MainWindow.h b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/MainWindow.h deleted file mode 100644 index 591ce23fa7207a17f4a0dcf8790cda35a3a612c6..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/MainWindow.h +++ /dev/null @@ -1,29 +0,0 @@ -/*========================================================================= - - Name: MainWindow.h - - Author: David Borland, EventLab - - Description: Main window for vrpn_Qt_AppExample. - -=========================================================================*/ - - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - - -#include <QMainWindow> - -#include "ui_MainWindow.h" - - -class MainWindow : public QMainWindow, private Ui_MainWindow { - Q_OBJECT - -public: - // Constructor - MainWindow(QWidget* parent = NULL); -}; - -#endif diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/MainWindow.ui b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/MainWindow.ui deleted file mode 100644 index ee32ab617f08b771b81d70bff5b498c172d10c6d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/MainWindow.ui +++ /dev/null @@ -1,281 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>295</width> - <height>281</height> - </rect> - </property> - <property name="windowTitle"> - <string>MainWindow</string> - </property> - <widget class="QWidget" name="centralwidget"> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string>Buttons</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <widget class="QPushButton" name="pushButton"> - <property name="text"> - <string>Push Button</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioButton"> - <property name="text"> - <string>Radio Button 1</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioButton_2"> - <property name="text"> - <string>Radio Button 2</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioButton_3"> - <property name="text"> - <string>Radio Button 3</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox"> - <property name="text"> - <string>Check Box</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>7</height> - </size> - </property> - </spacer> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - <item> - <widget class="Line" name="line_5"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_2"> - <property name="title"> - <string>Analogs</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Spin Box</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox"> - <property name="singleStep"> - <number>5</number> - </property> - <property name="value"> - <number>10</number> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QLabel" name="label_4"> - <property name="text"> - <string>Double Spin Box</string> - </property> - </widget> - </item> - <item> - <widget class="QDoubleSpinBox" name="doubleSpinBox"> - <property name="maximum"> - <double>6.280000000000000</double> - </property> - <property name="singleStep"> - <double>0.010000000000000</double> - </property> - <property name="value"> - <double>3.140000000000000</double> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="Line" name="line_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <widget class="QLabel" name="label_5"> - <property name="text"> - <string>Dial</string> - </property> - </widget> - </item> - <item> - <widget class="QDial" name="dial"> - <property name="value"> - <number>25</number> - </property> - <property name="wrapping"> - <bool>false</bool> - </property> - <property name="notchesVisible"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="Line" name="line_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <widget class="QLabel" name="label_7"> - <property name="text"> - <string>Scroll Bar</string> - </property> - </widget> - </item> - <item> - <widget class="QScrollBar" name="horizontalScrollBar"> - <property name="value"> - <number>50</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <item> - <widget class="QLabel" name="label_6"> - <property name="text"> - <string>Slider</string> - </property> - </widget> - </item> - <item> - <widget class="QSlider" name="horizontalSlider"> - <property name="value"> - <number>75</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="tickPosition"> - <enum>QSlider::TicksBelow</enum> - </property> - </widget> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <widget class="QMenuBar" name="menubar"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>295</width> - <height>21</height> - </rect> - </property> - </widget> - <widget class="QStatusBar" name="statusbar"/> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/vrpn_Qt_AppExample.bat b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/vrpn_Qt_AppExample.bat deleted file mode 100644 index 7e5808f6b796cb87eb979c532dd3641cbcfd6a24..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/vrpn_Qt_AppExample.bat +++ /dev/null @@ -1 +0,0 @@ -..\Bin\bin\Release\vrpn_Qt_AppExample.exe -serverName qt -vrpnPort 3883 \ No newline at end of file diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/vrpn_Qt_AppExample.cpp b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/vrpn_Qt_AppExample.cpp deleted file mode 100644 index e4fd9d6f8db10e7a030591572ae8654edd0cb768..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AppExample/vrpn_Qt_AppExample.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/*========================================================================= - - Name: vrpn_Qt_AppExample.cpp - - Author: David Borland, EventLab - - Description: Contains the main function for vrpn_Qt_AppExample. - - This is an example of using a GUI created with Qt - Designer with vrpn_Qt. - -=========================================================================*/ - - -#include <QApplication> - -#include "vrpn_Qt.h" -#include "MainWindow.h" - -#include <QDebug> -#include <QString> - - -int main(int argc, char** argv) { - // Initialize Qt - QApplication app(argc, argv); - - - // Set default server name and port - char* name = "qt"; - int port = vrpn_DEFAULT_LISTEN_PORT_NO; - - // Parse the command line to override defaults - for (int i = 1; i < argc; i++) { - if (QString(argv[i]) == "-serverName") { - name = argv[++i]; - } - else if (QString(argv[i]) == "-vrpnPort") { - port = QString(argv[++i]).toInt(); - } - else { - qDebug() << "Error parsing command line.\n" - << "Usage: vrpn_Qt_AppExample.exe [-serverName name] [-vrpnPort portNumber]"; - } - } - - - // Set up VRPN - vrpn_Connection* connection = vrpn_create_server_connection(port); - vrpn_Qt vq(name, connection); - - // Create the window - MainWindow mainWindow; - - // Add widgets to the vrpn_Qt - vq.AddChildren(&mainWindow); - vq.PrintWidgets(); - - // Show the window - mainWindow.show(); - - return app.exec(); -} - diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/CMakeLists.txt b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/CMakeLists.txt deleted file mode 100644 index 8b5225dc542840d8e902ab6a6664a8cecf5999e0..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/CMakeLists.txt +++ /dev/null @@ -1,58 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -project(vrpn_Qt_AutoGUI) - -set(EXECUTABLE_OUTPUT_PATH "${vrpn_Qt_BINARY_DIR}/bin") - - -####################################### -# Include Qt -####################################### - -# Set up variables for moc -set(QT_HEADER QAutoGUI.h) -set(QT_SRC vrpn_Qt_AutoGUI.cpp QAutoGUI.cpp) - -include_directories(${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}) - -# Do moc stuff -set(QT_MOC_SRC) -qt4_wrap_cpp(QT_MOC_SRC ${QT_HEADER}) -add_definitions(-DQT_GUI_LIBS -DQT_CORE_LIB -DQT3_SUPPORT) - - -####################################### -# Build setup -####################################### - -set(SRC QXmlAutoGUIHandler.h QXmlAutoGUIHandler.cpp vrpn_Qt_AutoGUI.xml) - -add_executable(vrpn_Qt_AutoGUI - ${QT_HEADER} - ${QT_SRC} - ${QT_MOC_SRC} - ${SRC}) -add_dependencies(vrpn_Qt_AutoGUI vrpn_Qt) -target_link_libraries(vrpn_Qt_AutoGUI vrpn_Qt) - -add_custom_command(TARGET - vrpn_Qt_AutoGUI - PRE_BUILD - COMMAND - ${CMAKE_COMMAND} - -E - copy - ${vrpn_Qt_AutoGUI_SOURCE_DIR}/vrpn_Qt_AutoGUI.xml - ${EXECUTABLE_OUTPUT_PATH}/Release) - -add_custom_command(TARGET - vrpn_Qt_AutoGUI - PRE_BUILD - COMMAND - ${CMAKE_COMMAND} - -E - copy - ${vrpn_Qt_AutoGUI_SOURCE_DIR}/vrpn_Qt_AutoGUI.xml - ${EXECUTABLE_OUTPUT_PATH}/Debug) - diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/QAutoGUI.cpp b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/QAutoGUI.cpp deleted file mode 100644 index 9ab382feadecd401033b736534f079ec96190503..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/QAutoGUI.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/*========================================================================= - - Name: QAutoGUI.cpp - - Author: David Borland, EventLab - - Description: Widget for generating a simple Qt GUI. Widgets can be added - manually, or via an XML description. - - Widgets currently supported: - - QPushButton - QCheckBox - QRadioButton - - QSpinBox - QDoubleSpinBox - QDial - QScrollBar - QSlider - - Widgets are added to the current column with AddWidget(), - and columns can be added with AddColumn(). - -=========================================================================*/ - - -#include "QAutoGUI.h" - -#include "QXmlAutoGUIHandler.h" - -#include <QDebug> -#include <QFile> -#include <QGroupBox> -#include <QHBoxLayout> -#include <QXmlDefaultHandler> -#include <QXmlInputSource> -#include <QXmlSimpleReader> -#include <QVBoxLayout> - - -QAutoGUI::QAutoGUI(QWidget* parent) : QWidget(parent) { - // Create the main layout for the widget - horizontal = new QHBoxLayout(this); - setLayout(horizontal); - - vertical = NULL; -} - - -bool QAutoGUI::ParseXML(const QString& fileName) { - // Try to open the file - QFile file(fileName); - if (!file.exists()) { - qDebug() << "QAutoGUI::ParseXML() : Error, vrpn_Qt_AutoGUI configuration file" << fileName - << "does not exist."; - - return false; - } - - // Set up XML parsing - QXmlAutoGUIHandler handler(this); - - QXmlSimpleReader xmlReader; - xmlReader.setContentHandler(&handler); - xmlReader.setErrorHandler(&handler); - - // Parse the GUI description - QXmlInputSource source(file); - xmlReader.parse(source); - - return true; -} - -void QAutoGUI::AddWidget(QWidget* widget) { - // Check if there is a column yet - if (vertical == NULL) { - AddColumn(); - } - - // Show the widget - widget->setParent(this); - vertical->addWidget(widget); -} - -void QAutoGUI::AddColumn(const QString& title) { - // If there is already a column, add a spacer at the end - if (vertical) { - QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); - vertical->addItem(spacer); - } - - // Add a new column - QGroupBox* groupBox = new QGroupBox(title, this); - vertical = new QVBoxLayout(groupBox); - groupBox->setLayout(vertical); - - horizontal->addWidget(groupBox); -} - -void QAutoGUI::Finish() { - // If there is a column, add a spacer at the end - if (vertical) { - QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding); - vertical->addItem(spacer); - } -} \ No newline at end of file diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/QAutoGUI.h b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/QAutoGUI.h deleted file mode 100644 index 51e97e33569b3548a3799f696905b26ef3cc64b6..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/QAutoGUI.h +++ /dev/null @@ -1,61 +0,0 @@ -/*========================================================================= - - Name: QAutoGUI.h - - Author: David Borland, EventLab - - Description: Widget for generating a simple Qt GUI. Widgets can be added - manually, or via an XML description. - - Widgets currently supported: - - QPushButton - QCheckBox - QRadioButton - - QSpinBox - QDoubleSpinBox - QDial - QScrollBar - QSlider - - Widgets are added to the current column with AddWidget(), - and columns can be added with AddColumn(). - -=========================================================================*/ - - -#ifndef QAUTOGUI_H -#define QAUTOGUI_H - - -#include <QWidget> - -class QBoxLayout; - -class QAutoGUI : public QWidget { - Q_OBJECT - -public: - // Constructor - QAutoGUI(QWidget* parent = NULL); - - // Add widgets described in the given XML file - bool ParseXML(const QString& fileName); - - // Add an individual widget - void AddWidget(QWidget* widget); - - // Add a column - void AddColumn(const QString& text = NULL); - - // Finish building the GUI - void Finish(); - -protected: - QBoxLayout* horizontal; - QBoxLayout* vertical; -}; - - -#endif diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/QXmlAutoGUIHandler.cpp b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/QXmlAutoGUIHandler.cpp deleted file mode 100644 index 6d0318c9a5ca362a5d392df6910ffdd428e61778..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/QXmlAutoGUIHandler.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/*========================================================================= - - Name: QXmlAutoGUIHandler.cpp - - Author: David Borland, EventLab - - Description: XML parser for QAutoGUI. - -=========================================================================*/ - - -#include "QXmlAutoGUIHandler.h" - -#include "QAutoGUI.h" - -#include <QCheckBox> -#include <QDebug> -#include <QDial> -#include <QDoubleSpinBox> -#include <QHBoxLayout> -#include <QLabel> -#include <QPushButton> -#include <QRadioButton> -#include <QScrollBar> -#include <QSlider> -#include <QSpinBox> - - -/////////////////////////////////////////////////////////////////////////// - - -QAnalogContainer::QAnalogContainer(QWidget* widget, const QString& text) { - widget->setParent(this); - - // Create the label - QLabel* label = new QLabel(text, this); - - // Use a horizontal layout - QHBoxLayout* layout = new QHBoxLayout(this); - layout->addWidget(label); - layout->addWidget(widget); - - // Add a numerical display for things that need it - if (qobject_cast<QAbstractSlider*>(widget)) { - QAbstractSlider* slider = qobject_cast<QAbstractSlider*>(widget); - - // Use a spin box without buttons - QSpinBox* display = new QSpinBox(this); - display->setName("vrpn_Qt_ignore"); - display->setButtonSymbols(QAbstractSpinBox::NoButtons); - - // Set to the same value and range as the widget - display->setValue(slider->value()); - display->setRange(display->minimum(), display->maximum()); - - // Hook them together - connect(slider, SIGNAL(valueChanged(int)), display, SLOT(setValue(int))); - connect(display, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int))); - - // Add to the layout - layout->addWidget(display); - } - - layout->addStretch(); - - setLayout(layout); -} - - -/////////////////////////////////////////////////////////////////////////// - - -QXmlAutoGUIHandler::QXmlAutoGUIHandler(QAutoGUI* autoGui) : gui(autoGui) { -} - - -bool QXmlAutoGUIHandler::startElement(const QString& namespaceURI, const QString& localName, - const QString& qName, const QXmlAttributes& atts) { - // Top-level tag, do nothing - if (qName == "AUTOGUI") return true; - - - // Add a column - if (qName == "Column") { - QString text; - for (int i = 0; i < atts.count(); i++) { - if (atts.qName(i) == "Text") { - text = atts.value(i); - } - else { - qWarning() << "Unsupported attribute: " << atts.qName(i); - } - } - - gui->AddColumn(text); - - return true; - } - - - // Add a horizontal line - if (qName == "Line") { - // Use a frame with some specific properties set to make it a line. - // This is how Qt Designer does it... - QFrame* line = new QFrame(); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - - gui->AddWidget(line); - - return true; - } - - - // Create the appropriate widget - if (qName == "PushButton") { - // Create a push button - QPushButton* widget = new QPushButton(); - - ProcessPushButton(widget, atts); - } - else if (qName == "CheckBox") { - // Create a check box - QCheckBox* widget = new QCheckBox(); - - ProcessCheckableButton(widget, atts); - } - else if (qName == "RadioButton") { - // Create a check box - QRadioButton* widget = new QRadioButton(); - - ProcessCheckableButton(widget, atts); - } - else if (qName == "SpinBox") { - // Create a spin box - QSpinBox* widget = new QSpinBox(); - - ProcessSpinBox(widget, atts); - } - else if (qName == "DoubleSpinBox") { - // Create a spin box - QDoubleSpinBox* widget = new QDoubleSpinBox(); - - ProcessDoubleSpinBox(widget, atts); - } - else if (qName == "Dial") { - // Create a spin box - QDial* widget = new QDial(); - widget->setNotchesVisible(true); - - ProcessSliderWidget(widget, atts); - } - else if (qName == "ScrollBar") { - QScrollBar* widget = new QScrollBar(Qt::Horizontal); - - ProcessSliderWidget(widget, atts); - } - else if (qName == "Slider") { - QSlider* widget = new QSlider(Qt::Horizontal); - widget->setTickmarks(QSlider::Below); - - ProcessSliderWidget(widget, atts); - } - else { - qWarning() << "Unsupported widget type: " << qName; - } - - return true; -} - -bool QXmlAutoGUIHandler::endDocument() { - // Finish up the GUI - gui->Finish(); - - return true; -} - -bool QXmlAutoGUIHandler::fatalError(const QXmlParseException& exception) { - // Print a fatal error message - qWarning() << "Fatal error on line" << exception.lineNumber() - << ", column" << exception.columnNumber() << ":" - << exception.message(); - - return false; -} - - -void QXmlAutoGUIHandler::ProcessPushButton(QAbstractButton* widget, const QXmlAttributes& atts) { - // Check attributes - for (int i = 0; i < atts.count(); i++) { - if (atts.qName(i) == "Name") { - widget->setName(atts.value(i)); - } - else if (atts.qName(i) == "Text") { - widget->setText(atts.value(i)); - } - else { - qWarning() << "Unsupported attribute: " << atts.qName(i); - } - } - - // Add the widget - gui->AddWidget(widget); -} -void QXmlAutoGUIHandler::ProcessCheckableButton(QAbstractButton* widget, const QXmlAttributes& atts) { - // Check attributes - for (int i = 0; i < atts.count(); i++) { - if (atts.qName(i) == "Name") { - widget->setName(atts.value(i)); - } - else if (atts.qName(i) == "Text") { - widget->setText(atts.value(i)); - } - else if (atts.qName(i) == "Checked") { - widget->setChecked(atts.value(i).toInt()); - } - else { - qWarning() << "Unsupported attribute: " << atts.qName(i); - } - } - - // Add the widget - gui->AddWidget(widget); -} - -void QXmlAutoGUIHandler::ProcessSliderWidget(QAbstractSlider* widget, const QXmlAttributes& atts) { - // Set this so the scrollbar can expand - widget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); - - // Check attributes - QString text; - for (int i = 0; i < atts.count(); i++) { - if (atts.qName(i) == "Name") { - widget->setName(atts.value(i)); - } - else if (atts.qName(i) == "Text") { - text = atts.value(i); - } - else if (atts.qName(i) == "Min") { - widget->setMinimum(atts.value(i).toInt()); - } - else if (atts.qName(i) == "Max") { - widget->setMaximum(atts.value(i).toInt()); - } - else if (atts.qName(i) == "Value") { - widget->setValue(atts.value(i).toInt()); - } - else if (atts.qName(i) == "Step") { - widget->setSingleStep(atts.value(i).toInt()); - } - else { - qWarning() << "Unsupported attribute: " << atts.qName(i); - } - } - - // Add to a container and add the widget - QAnalogContainer* container = new QAnalogContainer(widget, text); - gui->AddWidget(container); -} - -void QXmlAutoGUIHandler::ProcessSpinBox(QSpinBox* widget, const QXmlAttributes& atts) { - // Check attributes - QString text; - for (int i = 0; i < atts.count(); i++) { - if (atts.qName(i) == "Name") { - widget->setName(atts.value(i)); - } - else if (atts.qName(i) == "Text") { - text = atts.value(i); - } - else if (atts.qName(i) == "Min") { - widget->setMinimum(atts.value(i).toInt()); - } - else if (atts.qName(i) == "Max") { - widget->setMaximum(atts.value(i).toInt()); - } - else if (atts.qName(i) == "Value") { - widget->setValue(atts.value(i).toInt()); - } - else if (atts.qName(i) == "Step") { - widget->setSingleStep(atts.value(i).toInt()); - } - else { - qWarning() << "Unsupported attribute: " << atts.qName(i); - } - } - - // Add to a container and add the widget - QAnalogContainer* container = new QAnalogContainer(widget, text); - gui->AddWidget(container); -} - -void QXmlAutoGUIHandler::ProcessDoubleSpinBox(QDoubleSpinBox* widget, const QXmlAttributes& atts) { - // Check attributes - QString text; - for (int i = 0; i < atts.count(); i++) { - if (atts.qName(i) == "Name") { - widget->setName(atts.value(i)); - } - else if (atts.qName(i) == "Text") { - text = atts.value(i); - } - else if (atts.qName(i) == "Min") { - widget->setMinimum(atts.value(i).toDouble()); - } - else if (atts.qName(i) == "Max") { - widget->setMaximum(atts.value(i).toDouble()); - } - else if (atts.qName(i) == "Value") { - widget->setValue(atts.value(i).toDouble()); - } - else if (atts.qName(i) == "Step") { - widget->setSingleStep(atts.value(i).toDouble()); - } - else { - qWarning() << "Unsupported attribute: " << atts.qName(i); - } - } - - // Add to a container and add the widget - QAnalogContainer* container = new QAnalogContainer(widget, text); - gui->AddWidget(container); -} \ No newline at end of file diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/QXmlAutoGUIHandler.h b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/QXmlAutoGUIHandler.h deleted file mode 100644 index 79759a9dfea683fd6ce4dfab74ed079bd7a6f35e..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/QXmlAutoGUIHandler.h +++ /dev/null @@ -1,66 +0,0 @@ -/*========================================================================= - - Name: QXmlAutoGUIHandler.h - - Author: David Borland, EventLab - - Description: XML parser for QAutoGUI. - -=========================================================================*/ - - -#ifndef QXMLAUTOGUIHANDLER_H -#define QXMLAUTOGUIHANDLER_H - - -#include <QXmlDefaultHandler> -#include <QWidget> - - -class QAutoGUI; - -class QAbstractButton; -class QAbstractSlider; -class QDoubleSpinBox; -class QSpinBox; - - -/////////////////////////////////////////////////////////////////////////// - - -// Small container for Qt analog widgets that adds a label -class QAnalogContainer : public QWidget { -public: - QAnalogContainer(QWidget* widget, const QString& text = NULL); -}; - - -/////////////////////////////////////////////////////////////////////////// - - -// XML handler -class QXmlAutoGUIHandler : public QXmlDefaultHandler { -public: - // Constructor - QXmlAutoGUIHandler(QAutoGUI* autoGui); - - // Callbacks for XML parsing - virtual bool startElement(const QString& namespaceURI, const QString& localName, - const QString& qName, const QXmlAttributes& atts); - virtual bool endDocument(); - virtual bool fatalError(const QXmlParseException& exception); - -protected: - // Set up widgets from XML attributes - void ProcessPushButton(QAbstractButton* button, const QXmlAttributes& atts); - void ProcessCheckableButton(QAbstractButton* button, const QXmlAttributes& atts); - void ProcessSliderWidget(QAbstractSlider* widget, const QXmlAttributes& atts); - void ProcessSpinBox(QSpinBox* widget, const QXmlAttributes& atts); - void ProcessDoubleSpinBox(QDoubleSpinBox* widget, const QXmlAttributes& atts); - - // The QAutoGUI widget - QAutoGUI* gui; -}; - - -#endif \ No newline at end of file diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/vrpn_Qt_AutoGUI.bat b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/vrpn_Qt_AutoGUI.bat deleted file mode 100644 index ee48addd21cd7f9e6bc2a45c2234d2a6277164ef..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/vrpn_Qt_AutoGUI.bat +++ /dev/null @@ -1 +0,0 @@ -..\Bin\bin\Release\vrpn_Qt_AutoGUI.exe -xmlFile vrpn_Qt_AutoGUI.xml -serverName qt -vrpnPort 3883 \ No newline at end of file diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/vrpn_Qt_AutoGUI.cpp b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/vrpn_Qt_AutoGUI.cpp deleted file mode 100644 index ddf4cea948faf40f807cc73dc66ed76e0f0b6e4d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/vrpn_Qt_AutoGUI.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/*========================================================================= - - Name: vrpn_Qt_GUI.cpp - - Author: David Borland, EventLab - - Description: Contains the main function for vrpn_Qt_GUI. - - This is an example of generating a GUI from a simple XML - file using QAutoGUI. - -=========================================================================*/ - - -#include <QApplication> - -#include "vrpn_Qt.h" -#include "QAutoGUI.h" - -#include <QDebug> -#include <QString> - - -int main(int argc, char** argv) { - // Initialize Qt - QApplication app(argc, argv); - - - // Set default xml file, server name, and port - QString xmlFile("vrpn_Qt_AutoGUI.xml"); - char* name = "qt"; - int port = vrpn_DEFAULT_LISTEN_PORT_NO; - - // Parse the command line to override defaults - for (int i = 1; i < argc; i++) { - if (QString(argv[i]) == "-xmlFile") { - xmlFile = argv[++i]; - } - else if (QString(argv[i]) == "-serverName") { - name = argv[++i]; - } - else if (QString(argv[i]) == "-vrpnPort") { - port = QString(argv[++i]).toInt(); - } - else { - qDebug() << "Error parsing command line.\n" - << "Usage: vrpn_Qt_GUI.exe [-xmlFile fileName] [-vrpnPort portNumber]"; - } - } - - - // Set up VRPN - vrpn_Connection* connection = vrpn_create_server_connection(port); - vrpn_Qt vq(name, connection); - - // Create the GUI - QAutoGUI gui; - gui.ParseXML(xmlFile); - - // Add widgets to the vrpn_Qt - vq.AddChildren(&gui); - vq.PrintWidgets(); - - // Show the widget - gui.show(); - - return app.exec(); -} - diff --git a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/vrpn_Qt_AutoGUI.xml b/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/vrpn_Qt_AutoGUI.xml deleted file mode 100644 index a0cc57ce31d6556acf6c9cf447060e67269fc75b..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Qt_GUI_server/vrpn_Qt_AutoGUI/vrpn_Qt_AutoGUI.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<AUTOGUI> - - <Column Text="Buttons"/> - - <PushButton Name="pushButton" Text="Push Button"/> - <RadioButton Name="radioButton" Text="Radio Button 1" Checked="0"/> - <RadioButton Name="radioButton_2" Text="Radio Button 2" Checked="1"/> - <RadioButton Name="radioButton_3" Text="Radio Button 3" Checked="0"/> - <CheckBox Name="checkBox" Text="Check Box" Checked="1"/> - - <Column Text="Analogs"/> - - <SpinBox Name="spinbox" Text="Spin Box" Min="0" Max="99" Value="10" Step="5"/> - <DoubleSpinBox Name="doubleSpinBox" Text="Double Spin Box" Min="0.0" Max="6.28" Value="3.14" Step="0.01"/> - <Dial Name="dial" Text="Dial" Min="0" Max="99" Value="25" Step="1"/> - <ScrollBar Name="scrollBar" Text="Scroll Bar" Min="0" Max="99" Value="50" Step="1"/> - <Slider Name="slider" Text="Slider" Min="0" Max="99" Value="75" Step="1"/> - -</AUTOGUI> \ No newline at end of file diff --git a/src/vrpn/vrpn_RedundantTransmission.C b/src/vrpn/vrpn_RedundantTransmission.C deleted file mode 100644 index 501882a833d2abfcaac0ee5ab154d1e7253e0f33..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_RedundantTransmission.C +++ /dev/null @@ -1,666 +0,0 @@ -#include <stdio.h> // for fprintf, stderr, fclose, etc -#include <string.h> // for NULL, memcpy - -#include "vrpn_RedundantTransmission.h" - -struct timeval; - -vrpn_RedundantTransmission::vrpn_RedundantTransmission(vrpn_Connection *c) - : d_connection(c) - , d_messageList(NULL) - , d_numMessagesQueued(0) - , d_numTransmissions(0) - , d_isEnabled(VRPN_FALSE) -{ - - d_transmissionInterval.tv_sec = 0L; - d_transmissionInterval.tv_usec = 0L; - - if (d_connection) { - d_connection->addReference(); - } -} - -vrpn_RedundantTransmission::~vrpn_RedundantTransmission(void) -{ - - if (d_connection) { - d_connection->removeReference(); - } -} - -vrpn_uint32 vrpn_RedundantTransmission::defaultRetransmissions(void) const -{ - return d_numTransmissions; -} - -timeval vrpn_RedundantTransmission::defaultInterval(void) const -{ - return d_transmissionInterval; -} - -vrpn_bool vrpn_RedundantTransmission::isEnabled(void) const -{ - return d_isEnabled; -} - -// virtual -void vrpn_RedundantTransmission::mainloop(void) -{ - - queuedMessage *qm; - queuedMessage **snitch; - timeval now; - - if (!d_connection) { - return; - } - - // fprintf(stderr, "mainloop: %d messages queued.\n", d_numMessagesQueued); - - vrpn_gettimeofday(&now, NULL); - for (qm = d_messageList; qm; qm = qm->next) { - if ((qm->remainingTransmissions > 0) && - vrpn_TimevalGreater(now, qm->nextValidTime)) { - d_connection->pack_message(qm->p.payload_len, qm->p.msg_time, - qm->p.type, qm->p.sender, qm->p.buffer, - vrpn_CONNECTION_LOW_LATENCY); - qm->nextValidTime = vrpn_TimevalSum(now, qm->transmissionInterval); - qm->remainingTransmissions--; - // fprintf(stderr, "Sending message; " - //"%d transmissions remaining at %d.%d int.\n", - // qm->remainingTransmissions, qm->transmissionInterval.tv_sec, - // qm->transmissionInterval.tv_usec); - } - } - - snitch = &d_messageList; - qm = *snitch; - - while (qm) { - if (!qm->remainingTransmissions) { - *snitch = qm->next; - delete[](char *)qm -> p.buffer; - delete qm; - qm = *snitch; - d_numMessagesQueued--; - } - else { - snitch = &qm->next; - qm = *snitch; - } - } - - if ((d_numMessagesQueued && !d_messageList) || - (!d_numMessagesQueued && d_messageList)) { - fprintf(stderr, "vrpn_RedundantTransmission::mainloop(): " - "serious internal error.\n"); - d_numMessagesQueued = 0; - d_messageList = NULL; - } -} - -void vrpn_RedundantTransmission::enable(vrpn_bool on) -{ - d_isEnabled = on; - - // fprintf(stderr, "vrpn_RedundantTransmission::enable(%s)\n", - // on ? "on" : "off"); -} - -void vrpn_RedundantTransmission::setDefaults(vrpn_uint32 numTransmissions, - timeval transmissionInterval) -{ - - // fprintf(stderr, "vrpn_RedundantTransmission::setDefaults: " - //"to %d, %d.%d\n", numTransmissions, transmissionInterval.tv_sec, - // transmissionInterval.tv_usec); - - d_numTransmissions = numTransmissions; - d_transmissionInterval = transmissionInterval; -} - -// virtual -int vrpn_RedundantTransmission::pack_message( - vrpn_uint32 len, timeval time, vrpn_uint32 type, vrpn_uint32 sender, - const char *buffer, vrpn_uint32 class_of_service, - vrpn_int32 numTransmissions, timeval *transmissionInterval) -{ - queuedMessage *qm; - int ret; - int i; - - if (!d_connection) { - fprintf(stderr, "vrpn_RedundantTransmission::pack_message: " - "Connection not defined!\n"); - return -1; - } - - if (!d_isEnabled) { - return d_connection->pack_message(len, time, type, sender, buffer, - class_of_service); - } - - ret = d_connection->pack_message(len, time, type, sender, buffer, - vrpn_CONNECTION_LOW_LATENCY); - - // TODO: check ret - - // use defaults? - if (numTransmissions < 0) { - numTransmissions = d_numTransmissions; - } - if (!transmissionInterval) { - transmissionInterval = &d_transmissionInterval; - } - - // fprintf(stderr, "In pack message with %d xmit at %d.%d\n", - // numTransmissions, transmissionInterval->tv_sec, - // transmissionInterval->tv_usec); - - if (!numTransmissions) { - return ret; - } - - // Special case - if transmissionInterval is 0, we send them all right - // away, but force VRPN to use separate network packets. - if (!transmissionInterval->tv_sec && !transmissionInterval->tv_usec) { - for (i = 0; i < numTransmissions; i++) { - d_connection->send_pending_reports(); - ret = d_connection->pack_message(len, time, type, sender, buffer, - vrpn_CONNECTION_LOW_LATENCY); - // TODO: check ret - } - d_connection->send_pending_reports(); - return 0; - } - - qm = new queuedMessage; - if (!qm) { - fprintf(stderr, - "vrpn_RedundantTransmission::pack_message: " - "Out of memory; can't queue message for retransmission.\n"); - return ret; - } - - qm->p.payload_len = len; - qm->p.msg_time = time; - qm->p.type = type; - qm->p.sender = sender; - qm->p.buffer = new char[len]; - if (!qm->p.buffer) { - fprintf(stderr, - "vrpn_RedundantTransmission::pack_message: " - "Out of memory; can't queue message for retransmission.\n"); - return ret; - } - memcpy((char *)qm->p.buffer, buffer, len); - - qm->remainingTransmissions = numTransmissions; - qm->transmissionInterval = *transmissionInterval; - qm->nextValidTime = vrpn_TimevalSum(time, *transmissionInterval); - qm->next = d_messageList; - - d_numMessagesQueued++; - - // timeval now; - // vrpn_gettimeofday(&now, NULL); - // fprintf(stderr, " Queued message to go at %d.%d (now is %d.%d)\n", - // qm->nextValidTime.tv_sec, qm->nextValidTime.tv_usec, - // now.tv_sec, now.tv_usec); - - d_messageList = qm; - - return ret; -} - -char *vrpn_RedundantController_Protocol::encode_set(int *len, vrpn_uint32 num, - timeval interval) -{ - char *buffer; - char *bp; - int buflen; - - buflen = sizeof(vrpn_uint32) + sizeof(timeval); - *len = buflen; - buffer = new char[buflen]; - if (!buffer) { - fprintf(stderr, "vrpn_RedundantController_Protocol::encode_set: " - "Out of memory.\n"); - return NULL; - } - - bp = buffer; - vrpn_buffer(&bp, &buflen, num); - vrpn_buffer(&bp, &buflen, interval); - - return buffer; -} - -void vrpn_RedundantController_Protocol::decode_set(const char **buf, - vrpn_uint32 *num, - timeval *interval) -{ - vrpn_unbuffer(buf, num); - vrpn_unbuffer(buf, interval); -} - -char *vrpn_RedundantController_Protocol::encode_enable(int *len, vrpn_bool on) -{ - char *buffer; - char *bp; - int buflen; - - buflen = sizeof(vrpn_bool); - *len = buflen; - buffer = new char[buflen]; - if (!buffer) { - fprintf(stderr, "vrpn_RedundantController_Protocol::encode_enable: " - "Out of memory.\n"); - return NULL; - } - - bp = buffer; - vrpn_buffer(&bp, &buflen, on); - - return buffer; -} - -void vrpn_RedundantController_Protocol::decode_enable(const char **buf, - vrpn_bool *on) -{ - vrpn_unbuffer(buf, on); -} - -void vrpn_RedundantController_Protocol::register_types(vrpn_Connection *c) -{ - d_set_type = c->register_message_type("vrpn_Red_Xmit_Ctrl set"); - d_enable_type = c->register_message_type("vrpn_Red_Xmit_Ctrl enable"); -} - -vrpn_RedundantController::vrpn_RedundantController( - vrpn_RedundantTransmission *r, vrpn_Connection *c) - : vrpn_BaseClass("vrpn Redundant Transmission Controller", c) - , d_object(r) -{ - - vrpn_BaseClass::init(); - - // fprintf(stderr, "Registering set handler with type %d.\n", - // d_protocol.d_set_type); - - register_autodeleted_handler(d_protocol.d_set_type, handle_set, this); - register_autodeleted_handler(d_protocol.d_enable_type, handle_enable, this); -} - -vrpn_RedundantController::~vrpn_RedundantController(void) {} - -void vrpn_RedundantController::mainloop(void) -{ - server_mainloop(); - - // do nothing -} - -int vrpn_RedundantController::register_types(void) -{ - d_protocol.register_types(d_connection); - - return 0; -} - -// static -int vrpn_RedundantController::handle_set(void *ud, vrpn_HANDLERPARAM p) -{ - vrpn_RedundantController *me = (vrpn_RedundantController *)ud; - const char **bp = &p.buffer; - vrpn_uint32 num; - timeval interval; - - me->d_protocol.decode_set(bp, &num, &interval); - // fprintf(stderr, "vrpn_RedundantController::handle_set: %d, %d.%d\n", - // num, interval.tv_sec, interval.tv_usec); - me->d_object->setDefaults(num, interval); - - return 0; -} - -int vrpn_RedundantController::handle_enable(void *ud, vrpn_HANDLERPARAM p) -{ - vrpn_RedundantController *me = (vrpn_RedundantController *)ud; - const char **bp = &p.buffer; - vrpn_bool on; - - me->d_protocol.decode_enable(bp, &on); - me->d_object->enable(on); - - return 0; -} - -vrpn_RedundantRemote::vrpn_RedundantRemote(vrpn_Connection *c) - : vrpn_BaseClass("vrpn Redundant Transmission Controller", c) -{ - - vrpn_BaseClass::init(); -} - -vrpn_RedundantRemote::~vrpn_RedundantRemote(void) {} - -void vrpn_RedundantRemote::mainloop(void) -{ - client_mainloop(); - - // do nothing -} - -void vrpn_RedundantRemote::set(int num, timeval interval) -{ - char *buf; - int len = 0; - timeval now; - - buf = d_protocol.encode_set(&len, num, interval); - if (!buf) { - return; - } - // fprintf(stderr, "vrpn_RedundantRemote::set: %d, %d.%d\n", - // num, interval.tv_sec, interval.tv_usec); - - vrpn_gettimeofday(&now, NULL); - d_connection->pack_message(len, now, d_protocol.d_set_type, d_sender_id, - buf, vrpn_CONNECTION_RELIABLE); -} - -void vrpn_RedundantRemote::enable(vrpn_bool on) -{ - char *buf; - int len = 0; - timeval now; - - buf = d_protocol.encode_enable(&len, on); - if (!buf) { - return; - } - - vrpn_gettimeofday(&now, NULL); - d_connection->pack_message(len, now, d_protocol.d_enable_type, d_sender_id, - buf, vrpn_CONNECTION_RELIABLE); -} - -int vrpn_RedundantRemote::register_types(void) -{ - d_protocol.register_types(d_connection); - - return 0; -} - -vrpn_RedundantReceiver::RRRecord::RRRecord(void) - : nextTimestampToReplace(0) - , cb(NULL) - , handlerIsRegistered(vrpn_FALSE) -{ - timeval zero; - int i; - - zero.tv_sec = 0; - zero.tv_usec = 0; - - for (i = 0; i < VRPN_RR_LENGTH; i++) { - timestampSeen[i] = zero; - numSeen[i] = 0; - } -} - -vrpn_RedundantReceiver::vrpn_RedundantReceiver(vrpn_Connection *c) - : d_connection(c) - , d_memory(NULL) - , d_lastMemory(NULL) - , d_record(VRPN_FALSE) -{ - - if (d_connection) { - d_connection->addReference(); - } -} - -vrpn_RedundantReceiver::~vrpn_RedundantReceiver(void) -{ - vrpnMsgCallbackEntry *pVMCB, *pVMCB_Del; - int i; - - for (i = 0; i < vrpn_CONNECTION_MAX_TYPES; i++) { - pVMCB = d_records[i].cb; - while (pVMCB) { - pVMCB_Del = pVMCB; - pVMCB = pVMCB_Del->next; - delete pVMCB_Del; - } - } - - pVMCB = d_generic.cb; - - while (pVMCB) { - pVMCB_Del = pVMCB; - pVMCB = pVMCB_Del->next; - delete pVMCB_Del; - } - - if (d_connection) { - d_connection->removeReference(); - } -} - -// virtual -int vrpn_RedundantReceiver::register_handler(vrpn_int32 type, - vrpn_MESSAGEHANDLER handler, - void *userdata, vrpn_int32 sender) -{ - vrpnMsgCallbackEntry *ce = new vrpnMsgCallbackEntry; - if (!ce) { - fprintf(stderr, "vrpn_RedundantReceiver::register_handler: " - "Out of memory.\n"); - return -1; - } - - ce->handler = handler; - ce->userdata = userdata; - ce->sender = sender; - - if (type == vrpn_ANY_TYPE) { - ce->next = d_generic.cb; - d_generic.cb = ce; - return 0; - } - else if (type < 0) { - fprintf(stderr, "vrpn_RedundantReceiver::register_handler: " - "Negative type passed in.\n"); - return -1; - } - else { - ce->next = d_records[type].cb; - d_records[type].cb = ce; - } - - if (!d_records[type].handlerIsRegistered) { - d_connection->register_handler(type, handle_possiblyRedundantMessage, - this, sender); - d_records[type].handlerIsRegistered = VRPN_TRUE; - } - - return 0; -} - -// virtual -int vrpn_RedundantReceiver::unregister_handler(vrpn_int32 type, - vrpn_MESSAGEHANDLER handler, - void *userdata, - vrpn_int32 sender) -{ - // The pointer at *snitch points to victim - vrpnMsgCallbackEntry *victim, **snitch; - - // Find a handler with this registry in the list (any one will do, - // since all duplicates are the same). - if (type == vrpn_ANY_TYPE) { - snitch = &d_generic.cb; - } - else { - snitch = &(d_records[type].cb); - } - victim = *snitch; - while ((victim != NULL) && - ((victim->handler != handler) || (victim->userdata != userdata) || - (victim->sender != sender))) { - snitch = &((*snitch)->next); - victim = victim->next; - } - - // Make sure we found one - if (victim == NULL) { - fprintf(stderr, - "vrpn_TypeDispatcher::removeHandler: No such handler\n"); - return -1; - } - - // Remove the entry from the list - *snitch = victim->next; - delete victim; - - return 0; -} - -void vrpn_RedundantReceiver::record(vrpn_bool on) { d_record = on; } - -void vrpn_RedundantReceiver::writeMemory(const char *filename) -{ - FILE *fp; - RRMemory *mp; - - if (!d_memory) { - fprintf(stderr, "vrpn_RedundantReceiver::writeMemory: " - "Memory is empty.\n"); - return; - } - - // BUG: This doesn't write out the records of the things that - // are still in the active list! As long as our network tests - // are recording a few seconds beyond the end of the interesting - // period & trimming them back that's OK, but if this code is ever - // used for precise timings there will be slight undersampling. - - fp = fopen(filename, "wb"); - if (!fp) { - fprintf(stderr, "vrpn_RedundantReceiver::writeMemory: " - "Couldn't open %s for writing.\n", - filename); - return; - } - - for (mp = d_memory; mp; mp = mp->next) { - fprintf(fp, "%ld.%ld %d\n", mp->timestamp.tv_sec, - static_cast<long>(mp->timestamp.tv_usec), mp->numSeen); - } - - fclose(fp); -} - -void vrpn_RedundantReceiver::clearMemory(void) -{ - RRMemory *mp; - - for (mp = d_memory; d_memory; mp = d_memory) { - d_memory = mp->next; - delete mp; - } - - d_lastMemory = NULL; -} - -// static -int vrpn_RedundantReceiver::handle_possiblyRedundantMessage(void *ud, - vrpn_HANDLERPARAM p) -{ - vrpn_RedundantReceiver *me = (vrpn_RedundantReceiver *)ud; - vrpnMsgCallbackEntry *who; - RRMemory *memory; - int ntr; - int i; - - for (i = 0; i < VRPN_RR_LENGTH; i++) { - if ((p.msg_time.tv_sec == - me->d_records[p.type].timestampSeen[i].tv_sec) && - (p.msg_time.tv_usec == - me->d_records[p.type].timestampSeen[i].tv_usec)) { - - // We've seen this one (recently); it's a redundant send whose - // predecessor didn't get lost, so this one is unnecessary FEC. - // Discard it. - - // fprintf(stderr, "Threw out redundant copy of type %d.\n", - // p.type); - - me->d_records[p.type].numSeen[i]++; - - return 0; - } - } - - ntr = me->d_records[p.type].nextTimestampToReplace; - - // Store a record of how many copies of this message we received so - // we can compute loss later (knowing what level of redundancy was being - // used). - - if (me->d_record) { - if (me->d_records[p.type].numSeen[ntr]) { - memory = new RRMemory; - if (!memory) { - fprintf(stderr, - "vrpn_RedundantReceiver::" - "handle_possiblyRedundantMessage: Out of memory.\n"); - return -1; - } - - memory->timestamp = me->d_records[p.type].timestampSeen[ntr]; - memory->numSeen = me->d_records[p.type].numSeen[ntr]; - memory->next = NULL; - - if (me->d_lastMemory) { - me->d_lastMemory->next = memory; - } - else { - me->d_memory = memory; - } - me->d_lastMemory = memory; - } - } - - me->d_records[p.type].timestampSeen[ntr] = p.msg_time; - me->d_records[p.type].numSeen[ntr] = 1; - me->d_records[p.type].nextTimestampToReplace = (ntr + 1) % VRPN_RR_LENGTH; - - for (who = me->d_generic.cb; who; who = who->next) { - if ((who->sender == vrpn_ANY_SENDER) || (who->sender == p.sender)) { - if (who->handler(who->userdata, p)) { - fprintf(stderr, "vrpn_RedundantReceiver::" - "handle_possiblyRedundantMessage: " - "Nonzero user generic handler return.\n"); - return -1; - } - } - } - - for (who = me->d_records[p.type].cb; who; who = who->next) { - // Verify that the sender is ANY or matches - if ((who->sender == vrpn_ANY_SENDER) || (who->sender == p.sender)) { - if (who->handler(who->userdata, p)) { - fprintf(stderr, "vrpn_RedundantReceiver::" - "handle_possiblyRedundantMessage: " - "Nonzero user handler return.\n"); - return -1; - } - } - } - - return 0; -} diff --git a/src/vrpn/vrpn_RedundantTransmission.h b/src/vrpn/vrpn_RedundantTransmission.h deleted file mode 100644 index 993260d41e9d3b6eb0fdb3ce044c11e06f53d455..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_RedundantTransmission.h +++ /dev/null @@ -1,214 +0,0 @@ -#ifndef VRPN_REDUNDANT_TRANSMISSION_H -#define VRPN_REDUNDANT_TRANSMISSION_H - -/// @class vrpn_RedundantTransmission -/// Helper class for vrpn_Connection that automates redundant transmission -/// for unreliable (low-latency) messages. Call pack_messages() here instead -/// of on your connection, and call mainloop() here before calling mainloop() -/// on your connection. - -#include <stddef.h> // for NULL - -#include "vrpn_BaseClass.h" // for vrpn_BaseClass -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Connection.h" // for vrpn_Connection (ptr only), etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32, vrpn_bool, etc - -struct timeval; - -class VRPN_API vrpn_RedundantTransmission { - -public: - vrpn_RedundantTransmission(vrpn_Connection *c); - ~vrpn_RedundantTransmission(void); - - // ACCESSORS - - vrpn_uint32 defaultRetransmissions(void) const; - timeval defaultInterval(void) const; - vrpn_bool isEnabled(void) const; - - // MANIPULATORS - - virtual void mainloop(void); - ///< Determines which messages need to be resent and queues - ///< them up on the connection for transmission. - - void enable(vrpn_bool); - - virtual void setDefaults(vrpn_uint32 numRetransmissions, - timeval transmissionInterval); - ///< Set default values for future calls to pack_message(). - - virtual int pack_message(vrpn_uint32 len, timeval time, vrpn_uint32 type, - vrpn_uint32 sender, const char *buffer, - vrpn_uint32 class_of_service, - vrpn_int32 numRetransmissions = -1, - timeval *transmissionInterval = NULL); - ///< If !isEnabled(), does a normal pack_message(), but if isEnabled() - ///< ignores class_of_service and sends it vrpn_CONNECTION_LOW_LATENCY, - ///< sending it an additional number of times equal to numRetransmissions - ///< at minimum intervals of transmissionInterval. - ///< Specify -1 and NULL to use default values. - -protected: - vrpn_Connection *d_connection; - - struct queuedMessage { - vrpn_HANDLERPARAM p; - vrpn_uint32 remainingTransmissions; - timeval transmissionInterval; - timeval nextValidTime; - queuedMessage *next; - }; - - queuedMessage *d_messageList; - vrpn_uint32 d_numMessagesQueued; - ///< For debugging, mostly. - - // Default values. - - vrpn_uint32 d_numTransmissions; - timeval d_transmissionInterval; - - vrpn_bool d_isEnabled; -}; - -struct vrpn_RedundantController_Protocol { - - char *encode_set(int *len, vrpn_uint32 num, timeval interval); - void decode_set(const char **buf, vrpn_uint32 *num, timeval *interval); - - char *encode_enable(int *len, vrpn_bool); - void decode_enable(const char **buf, vrpn_bool *); - - void register_types(vrpn_Connection *); - - vrpn_int32 d_set_type; - vrpn_int32 d_enable_type; -}; - -/// @class vrpn_RedundantController -/// Accepts commands over a connection to control a local -/// vrpn_RedundantTransmission's default parameters. - -class VRPN_API vrpn_RedundantController : public vrpn_BaseClass { - -public: - vrpn_RedundantController(vrpn_RedundantTransmission *, vrpn_Connection *); - ~vrpn_RedundantController(void); - - void mainloop(void); - // Do nothing; vrpn_BaseClass requires this. - -protected: - virtual int register_types(void); - - vrpn_RedundantController_Protocol d_protocol; - - static int VRPN_CALLBACK handle_set(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_enable(void *, vrpn_HANDLERPARAM); - - vrpn_RedundantTransmission *d_object; -}; - -/// @class vrpn_RedundantRemote -/// Sends messages to a vrpn_RedundantController so that a -/// vrpn_RedundantTransmission on a server can be controlled from a client. - -class VRPN_API vrpn_RedundantRemote : public vrpn_BaseClass { - -public: - vrpn_RedundantRemote(vrpn_Connection *); - ~vrpn_RedundantRemote(void); - - void mainloop(void); - // Do nothing; vrpn_BaseClass requires this. - - void set(int numRetransmissions, timeval transmissionInterval); - void enable(vrpn_bool); - -protected: - int register_types(void); - - vrpn_RedundantController_Protocol d_protocol; -}; - -/// @class vrpn_RedundantReceiver -/// Helper class that eliminates duplicates; only the first instance of -/// a message is delivered. Registers a callback on connection for any -/// type it's told to monitor; when it gets a message back, checks its -/// list of recently-seen-timestamps for that type; if it isn't on the -/// list, it's dispatched and replaces the oldest item on the list. -/// List length is limited, so -/// if too many messages of the same type (more than VRPN_RR_LENGTH) are -/// interleaved - if transmissionInterval * numRetransmissions > -/// VRPN_RR_LENGTH * the normal rate of message generation - it will not -/// detect the redundant messages. - -// A TypeDispatcher insists on too much control of its table for -// us to use one here - we want to use the same indices as the -// vrpn_Connection we're attached to, but if we had our own TypeDispatcher -// we'd have an independent, inconsistent set of type & sender ids. - -#define VRPN_RR_LENGTH 8 - -class VRPN_API vrpn_RedundantReceiver { - -public: - vrpn_RedundantReceiver(vrpn_Connection *); - ~vrpn_RedundantReceiver(void); - - virtual int register_handler(vrpn_int32 type, vrpn_MESSAGEHANDLER handler, - void *userdata, - vrpn_int32 sender = vrpn_ANY_SENDER); - virtual int unregister_handler(vrpn_int32 type, vrpn_MESSAGEHANDLER handler, - void *userdata, - vrpn_int32 sender = vrpn_ANY_SENDER); - - void record(vrpn_bool); - ///< Turns "memory" (tracking statistics of redundant reception) - ///< on and off. - - void writeMemory(const char *filename); - ///< Writes statistics to the named file: timestamp of every message - ///< received and number of copies of that message. Detects partial - ///< losses, but not when all copies are lost, since vrpn_RR doesn't - ///< expect messages. - - void clearMemory(void); - ///< Throws away / resets statistics. - -protected: - vrpn_Connection *d_connection; - - struct VRPN_API RRRecord { - RRRecord(void); - - timeval timestampSeen[VRPN_RR_LENGTH]; - int numSeen[VRPN_RR_LENGTH]; - int nextTimestampToReplace; - - vrpnMsgCallbackEntry *cb; - vrpn_bool handlerIsRegistered; - }; - - RRRecord d_records[vrpn_CONNECTION_MAX_TYPES]; - RRRecord d_generic; - - struct RRMemory { - timeval timestamp; - int numSeen; - RRMemory *next; - }; - - RRMemory *d_memory; - RRMemory *d_lastMemory; - vrpn_bool d_record; - - static int VRPN_CALLBACK - handle_possiblyRedundantMessage(void *, vrpn_HANDLERPARAM); -}; - -#endif // VRPN_REDUNDANT_TRANSMISSION_H diff --git a/src/vrpn/vrpn_Retrolink.C b/src/vrpn/vrpn_Retrolink.C deleted file mode 100644 index 990c04b44809e1856463c118abfc21d129319d84..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Retrolink.C +++ /dev/null @@ -1,217 +0,0 @@ -// vrpn_Retrolink.C: VRPN driver for Retrolink Classic Controller devices - -#include <stdio.h> // for fprintf, stderr, NULL -#include <string.h> // for memset -#include <math.h> // for fabs - -#include "vrpn_Retrolink.h" -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_HID) - -static const double POLL_INTERVAL = 1e+6 / 30.0; // If we have not heard, ask. - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 RETROLINK_VENDOR = 0x0079; -static const vrpn_uint16 RETROLINK_GAMECUBE = 0x0006; - -// A channel goes from -1 (value 0) to 1 (value 255), with -// an initial value between 0x80 and 0x83 for the one I developed -// with. -// XXX Consider adding a dead zone and putting it in the config file -static vrpn_float64 normalize_axis(const vrpn_uint8 value) -{ - vrpn_float64 offset = static_cast<vrpn_float64>(value) - 128; - vrpn_float64 scaled = offset / 127; - if (scaled > 1) { scaled = 1; } - if (scaled < -1) { scaled = -1; } - return scaled; -} - -// Convert the 0-f nybble for the rocker switch into its angle -static void angle_and_buttons_from_rocker(const vrpn_uint8 value, - vrpn_float64 *angle, - bool *up, bool *right, bool *down, bool *left) -{ - switch (value) { - case 0: *angle = 0; *up = true; *right = false; *down = false; *left = false; break; - case 1: *angle = 45; *up = true; *right = true; *down = false; *left = false; break; - case 2: *angle = 90; *up = false; *right = true; *down = false; *left = false; break; - case 3: *angle = 135; *up = false; *right = true; *down = true; *left = false; break; - case 4: *angle = 180; *up = false; *right = false; *down = true; *left = false; break; - case 5: *angle = 225; *up = false; *right = false; *down = true; *left = true; break; - case 6: *angle = 270; *up = false; *right = false; *down = false; *left = true; break; - case 7: *angle = 315; *up = true; *right = false; *down = false; *left = true; break; - default: *angle = -1; *up = false; *right = false; *down = false; *left = false; break; - } -} - -vrpn_Retrolink::vrpn_Retrolink(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c) - : _filter(filter) - , vrpn_HidInterface(filter) - , vrpn_BaseClass(name, c) -{ - init_hid(); -} - -vrpn_Retrolink::~vrpn_Retrolink(void) -{ - delete _filter; -} - -void vrpn_Retrolink::init_hid(void) { - // Get notifications when clients connect and disconnect - register_autodeleted_handler(d_connection->register_message_type(vrpn_dropped_last_connection), on_last_disconnect, this); - register_autodeleted_handler(d_connection->register_message_type(vrpn_got_connection), on_connect, this); -} - -void vrpn_Retrolink::on_data_received(size_t bytes, vrpn_uint8 *buffer) -{ - decodePacket(bytes, buffer); -} - -int vrpn_Retrolink::on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Retrolink *me = static_cast<vrpn_Retrolink *>(thisPtr); - return 0; -} - -int vrpn_Retrolink::on_connect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Retrolink *me = static_cast<vrpn_Retrolink *>(thisPtr); - return 0; -} - -vrpn_Retrolink_GameCube::vrpn_Retrolink_GameCube(const char *name, vrpn_Connection *c) - : vrpn_Retrolink(_filter = new vrpn_HidProductAcceptor(RETROLINK_VENDOR, RETROLINK_GAMECUBE), name, c) - , vrpn_Button_Filter(name, c) - , vrpn_Analog(name, c) -{ - vrpn_Analog::num_channel = 5; - vrpn_Button::num_buttons = 12; - - // Initialize the state of all the analogs, buttons - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); -} - -void vrpn_Retrolink_GameCube::mainloop(void) -{ - update(); - server_mainloop(); - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, _timestamp) > POLL_INTERVAL ) { - _timestamp = current_time; - report_changes(); - - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::server_mainloop(); - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::server_mainloop(); - } - } -} - -void vrpn_Retrolink_GameCube::report(vrpn_uint32 class_of_service) { - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::timestamp = _timestamp; - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::timestamp = _timestamp; - } - - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::report(class_of_service); - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::report_changes(); - } -} - -void vrpn_Retrolink_GameCube::report_changes(vrpn_uint32 class_of_service) { - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::timestamp = _timestamp; - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::timestamp = _timestamp; - } - - if (vrpn_Analog::num_channel > 0) - { - vrpn_Analog::report(class_of_service); - } - if (vrpn_Button::num_buttons > 0) - { - vrpn_Button::report_changes(); - } -} - -void vrpn_Retrolink_GameCube::decodePacket(size_t bytes, vrpn_uint8 *buffer) -{ - /* - // Print the report so we can figure out what is going on. - for (size_t i = 0; i < bytes; i++) { - printf("%02x ", buffer[i]); - } - printf("\n"); - return; - */ - - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - // Reports should be 8 bytes. They are encoded as follows: - // 0 = Left joystick X axis, goes from 0 (left) to 255 (right) - // 1 = Left joystick Y axis, goes from 0 (up) to 255 (down) - // 2 = Uncontrolled jibberish, must be from an unconnected channel - // 3 = Left joystick X axis, goes from 0 (left) to 255 (right) - // 4 = Left joystick Y axis, goes from 0 (left) to 255 (right) - // 5 upper nybble = bit 0 (Y), 1 (X), 2 (A), 3 (B) - // 5 lower nybble = rocker: 255 when nothing; 0 (up), 1 (UR), 2 (right), .. 7 (UL) - // 6 = bit # 0 (left trigger), 1 (right trigger), 2 (Z), 5 (Start/pause) - // 7 = always 0x20 (maybe unconnected buttons; probably safest to ignore) - - if (bytes == 8) { - // Figure out the joystick axes. - channel[0] = normalize_axis(buffer[0]); - channel[1] = normalize_axis(buffer[1]); - channel[2] = normalize_axis(buffer[3]); - channel[3] = normalize_axis(buffer[4]); - - // Figure out the buttons. - buttons[0] = (buffer[5] & (1 << 4)) != 0; - buttons[1] = (buffer[5] & (1 << 5)) != 0; - buttons[2] = (buffer[5] & (1 << 6)) != 0; - buttons[3] = (buffer[5] & (1 << 7)) != 0; - buttons[4] = (buffer[6] & (1 << 0)) != 0; - buttons[5] = (buffer[6] & (1 << 1)) != 0; - buttons[6] = (buffer[6] & (1 << 2)) != 0; - buttons[7] = (buffer[6] & (1 << 5)) != 0; - - // Figure out the rocker. - vrpn_uint8 rocker = buffer[5] & 0x0f; - vrpn_float64 angle; - bool up, right, down, left; - angle_and_buttons_from_rocker(rocker, &angle, &up, &right, &down, &left); - channel[4] = angle; - buttons[8] = up; - buttons[9] = right; - buttons[10] = down; - buttons[11] = left; - } else { - fprintf(stderr, "vrpn_Retrolink_GameCube: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - } -} - -// End of VRPN_USE_HID -#endif diff --git a/src/vrpn/vrpn_Retrolink.h b/src/vrpn/vrpn_Retrolink.h deleted file mode 100644 index 00bbd72c5a299983ea40f7ee08dab8aebd85149c..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Retrolink.h +++ /dev/null @@ -1,84 +0,0 @@ -#pragma once - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc -#include <stddef.h> // for size_t - -#if defined(VRPN_USE_HID) - -// Device drivers for the Retrolink Classic Controller USB line of products -// Currently supported: GameCube -// -// Exposes two major VRPN device classes: Button, Analog. See vrpn.cfg for -// a description of which buttons and control map where. -// - -class vrpn_Retrolink: public vrpn_BaseClass, protected vrpn_HidInterface { -public: - vrpn_Retrolink(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Retrolink(void); - - virtual void mainloop(void) = 0; - -protected: - // Set up message handlers, etc. - void init_hid(void); - void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - static int VRPN_CALLBACK on_connect(void *thisPtr, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM p); - - virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer) = 0; - struct timeval _timestamp; - vrpn_HidAcceptor *_filter; - - // No actual types to register, derived classes will be buttons, analogs - int register_types(void) { return 0; } -}; - -//-------------------------------------------------------------------------------- -// For GameCube : -// Analog channel assignments : -// 0 = Left joystick X axis; -1 = left, 1 = right -// 1 = Left joystick Y axis; -1 = up, 1 = down -// 2 = Right joystick X axis; -1 = left, 1 = right -// 3 = Right joystick Y axis; -1 = up, 1 = down -// 4 = Left rocker switch angle in degrees(-1 if nothing is pressed) -// Button number assignments : -// 0 = Y -// 1 = X -// 2 = A -// 3 = B -// 4 = left trigger -// 5 = right trigger -// 6 = Z -// 7 = Start / pause -// Buttons 8 - 11 are duplicate mappings for the rocker - switch; both -// these and the analog angle in degrees will change as they are pressed -// 8 = up -// 9 = right -// 10 = down -// 11 = left - -class vrpn_Retrolink_GameCube : protected vrpn_Retrolink, public vrpn_Analog, public vrpn_Button_Filter { -public: - vrpn_Retrolink_GameCube(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Retrolink_GameCube(void) {}; - - virtual void mainloop(void); - -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); -}; - -// end of VRPN_USE_HID -#else -class VRPN_API vrpn_Retrolink; -class VRPN_API vrpn_Retrolink_GameCube; -#endif diff --git a/src/vrpn/vrpn_Saitek_Controller_Raw.C b/src/vrpn/vrpn_Saitek_Controller_Raw.C deleted file mode 100644 index b5835274a3eaec3d8dd4905135bddc3129b450f4..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Saitek_Controller_Raw.C +++ /dev/null @@ -1,265 +0,0 @@ -// vrpn_Saitek_Controller_Raw.C: VRPN driver for Saitek Controller Raw devices - -#include <stdio.h> // for fprintf, stderr, NULL -#include <string.h> // for memset -#include <math.h> // for sqrt and fabs - -#include "vrpn_Saitek_Controller_Raw.h" -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_HID) - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 SAITEK_VENDOR = 0x06a3; -static const vrpn_uint16 ST290_PRO = 0x0d60; - -static const double POLL_INTERVAL = 1e+6 / 30.0; // If we have not heard, ask. - -#define GAMEPAD_TRIGGER_THRESHOLD 30 - -////////////////////////////////////////////////////////////////////////// -// helpers -////////////////////////////////////////////////////////////////////////// -static vrpn_float64 normalize_dpad(unsigned char up, unsigned char right, unsigned char down, unsigned char left) -{ - int x = 0; - int y = 0; - if (right) - { - x += 1; - } - if (left) - { - x -= 1; - } - if (up) - { - y += 1; - } - if (down) - { - y -= 1; - } - size_t index = ((x + 1) * 3) + (y + 1); - vrpn_float64 angles[] = {225, 270, 315, 180, -1, 0, 135, 90, 45}; - return (angles[index]); -} - -static void normalize_axis(const unsigned int value, const short deadzone, const vrpn_float64 scale, vrpn_float64& channel, int wordSize = 16) -{ - channel = (static_cast<float>(value) - (float) (1 << (wordSize - 1))); - if (fabs(channel) < (deadzone * 3 / 4)) - { - channel = 0.0f; - } - else - { - channel /= (float) (1 << (wordSize - 1)); - } - channel *= scale; - if (channel < -1.0) { channel = -1.0; } - if (channel > 1.0) { channel = 1.0; } -} - -static void normalize_axes(const unsigned int x, const unsigned int y, const short deadzone, const vrpn_float64 scale, vrpn_float64& channelX, vrpn_float64& channelY, int wordSize = 16) -{ - normalize_axis(x, deadzone, scale, channelX, wordSize); - normalize_axis(y, deadzone, scale, channelY, wordSize); -} - -static vrpn_float64 normalize_trigger(unsigned int trigger) -{ - // Filter out low-intensity signals - int value = trigger - 0x80; - return ((fabs(static_cast<double>(value)) < GAMEPAD_TRIGGER_THRESHOLD) ? 0.0f : (value * 2.0f / 255.0f)); -} - -////////////////////////////////////////////////////////////////////////// -// Common base class -////////////////////////////////////////////////////////////////////////// -vrpn_Saitek_Controller_Raw::vrpn_Saitek_Controller_Raw(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c) : - vrpn_HidInterface(filter), vrpn_BaseClass(name, c), _filter(filter) -{ - init_hid(); -} - -vrpn_Saitek_Controller_Raw::~vrpn_Saitek_Controller_Raw(void) -{ - delete _filter; -} - -void vrpn_Saitek_Controller_Raw::init_hid() -{ - // Get notifications when clients connect and disconnect - register_autodeleted_handler(d_connection->register_message_type(vrpn_dropped_last_connection), on_last_disconnect, this); - register_autodeleted_handler(d_connection->register_message_type(vrpn_got_connection), on_connect, this); -} - -void vrpn_Saitek_Controller_Raw::on_data_received(size_t bytes, vrpn_uint8 *buffer) -{ - decodePacket(bytes, buffer); -} - -int vrpn_Saitek_Controller_Raw::on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Saitek_Controller_Raw* me = static_cast<vrpn_Saitek_Controller_Raw*>(thisPtr); - return (0); -} - -int vrpn_Saitek_Controller_Raw::on_connect(void* thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Saitek_Controller_Raw* me = static_cast<vrpn_Saitek_Controller_Raw*>(thisPtr); - return (0); -} - -////////////////////////////////////////////////////////////////////////// -// ST290 Pro Joystick -////////////////////////////////////////////////////////////////////////// -vrpn_Saitek_ST290_Pro::vrpn_Saitek_ST290_Pro(const char *name, vrpn_Connection *c) : - vrpn_Saitek_Controller_Raw(_filter = new vrpn_HidProductAcceptor(SAITEK_VENDOR, ST290_PRO), name, c), - vrpn_Button_Filter(name, c), vrpn_Analog(name, c), vrpn_Dial(name, c) -{ - vrpn_Analog::num_channel = 5; - vrpn_Dial::num_dials = 0; - vrpn_Button::num_buttons = 10; - - // Initialize the state of all the analogs, buttons, and dials - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); -} - -void vrpn_Saitek_ST290_Pro::mainloop(void) -{ - update(); - server_mainloop(); - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, _timestamp) > POLL_INTERVAL) - { - _timestamp = current_time; - report_changes(); - - vrpn_Analog::server_mainloop(); - vrpn_Button::server_mainloop(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::server_mainloop(); - } - } -} - -void vrpn_Saitek_ST290_Pro::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Saitek_ST290_Pro::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::timestamp = _timestamp; - } - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); - if (vrpn_Dial::num_dials > 0) - { - vrpn_Dial::report(); - } -} - -void vrpn_Saitek_ST290_Pro::decodePacket(size_t bytes, vrpn_uint8 *buffer) -{ - // ST290 Pro joystick - - // Decode all full reports, each of which is 6 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - /* - [0]: X-axis (left=00, right=ff) - [1]: Y-axis - lower byte (up=00, down=ff) - [2]: Z-rotate (left=00, right=ff) - [3]: Slider (up=00, down=ff) - [4]: buttons high nibble "1"=0x10, "2"=0x20, "3"=0x40, "4"=0x80, POV Hat low nibble (none=0x00, N=0x01, NE=0x02, ... NW=0x08) - [5]: 0xf0 high nibble, buttons low nibble (none=0x00, "5"=0x01, "6"=0x02) - */ - // XXX Check to see that this works with HIDAPI, there may be two smaller reports. - if (bytes == 6) - { - normalize_axes(buffer[0], buffer[1], 0x08, 1.0f, channel[0], channel[1], 8); - normalize_axis(buffer[2], 0x08, 1.0f, channel[2], 8); - normalize_axis(buffer[3], 0x08, 1.0f, channel[3], 8); - - vrpn_uint8 value, mask; - value = (buffer[4] >> 4); - for (int btn = 0; btn < 4; btn++) - { - mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[btn] = ((value & mask) != 0); - } - value = (buffer[5] & 0x0f); - for (int btn = 0; btn < 4; btn++) - { - mask = static_cast<vrpn_uint8>(1 << (btn % 8)); - buttons[btn + 4] = ((value & mask) != 0); - } - - // Point of View Hat - buttons[6] = buttons[7] = buttons[8] = buttons[9] = 0; - switch (buffer[4] & 0x0f) - { - case 1: // up - buttons[6] = true; - break; - case 2: - buttons[6] = buttons[7] = true; - break; - case 3: // right - buttons[7] = true; - break; - case 4: - buttons[7] = buttons[8] = true; - break; - case 5: // down - buttons[8] = true; - break; - case 6: - buttons[8] = buttons[9] = true; - break; - case 7: // left - buttons[9] = true; - break; - case 8: - buttons[9] = buttons[6] = true; - break; - case 0: - default: - // nothing to do - break; - } - channel[4] = normalize_dpad(buttons[7], buttons[8], buttons[9], buttons[10]); - } - else - { - fprintf(stderr, "vrpn_Saitek_ST290_Pro: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - } -} - -// End of VRPN_USE_HID -#endif diff --git a/src/vrpn/vrpn_Saitek_Controller_Raw.h b/src/vrpn/vrpn_Saitek_Controller_Raw.h deleted file mode 100644 index fb71c7838e8af4f44b74de1598c2635407743f49..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Saitek_Controller_Raw.h +++ /dev/null @@ -1,66 +0,0 @@ -#pragma once - -#include <stddef.h> // for size_t - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_BaseClass.h" // for vrpn_BaseClass -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_USE_HID -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Dial.h" // for vrpn_Dial -#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint8, vrpn_uint32 - -#if defined(VRPN_USE_HID) - -// Device drivers for the Saitek Controller Raw USB line of products -// Currently supported: ST290 Pro -// -// Exposes three major VRPN device classes: Button, Analog, Dial (as appropriate). -// All models expose Buttons for the keys on the device. -// Button 0 is the programming switch; it is set if the switch is in the "red" position. -// - -class vrpn_Saitek_Controller_Raw: public vrpn_BaseClass, protected vrpn_HidInterface { -public: - vrpn_Saitek_Controller_Raw(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Saitek_Controller_Raw(void); - - virtual void mainloop(void) = 0; -protected: - // Set up message handlers, etc. - void init_hid(void); - void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - static int VRPN_CALLBACK on_connect(void *thisPtr, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM p); - - virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer) = 0; - struct timeval _timestamp; - vrpn_HidAcceptor *_filter; - - // No actual types to register, derived classes will be buttons, analogs, and/or dials - int register_types(void) { return (0); } -}; - -class vrpn_Saitek_ST290_Pro: protected vrpn_Saitek_Controller_Raw, public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Dial -{ -public: - vrpn_Saitek_ST290_Pro(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Saitek_ST290_Pro(void) {}; - - virtual void mainloop(void); -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); -}; - -// end of VRPN_USE_HID -#else -class VRPN_API vrpn_Saitek_ST290_Pro; -#endif diff --git a/src/vrpn/vrpn_SendTextMessageStreamProxy.h b/src/vrpn/vrpn_SendTextMessageStreamProxy.h deleted file mode 100644 index 4a6d2a5a2eaa05452b90d935e054098df9ec030a..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_SendTextMessageStreamProxy.h +++ /dev/null @@ -1,114 +0,0 @@ -/** @file - @brief Header allowing use of a output stream-style method of sending - text messages from devices. Contains the operator<< overload needed to - stream into a vrpn_BaseClassUnique::SendTextMessageBoundCall, and the - proxy object containing an ostringstream that executes the bound call - when it's done having data streamed in to it. - - This is a separate header to avoid including <sstream> in vrpn_BaseClass.h - since the functionality is only used by device implementations themselves, - and not even all of them. Further, since we create the stream proxy - only once we've seen an operator<< (rather than as a part of the bound - call), - we know that if a stream proxy exists, it has a message to send. - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -// Internal Includes -#include "vrpn_BaseClass.h" - -// Library/third-party includes -// - none - -// Standard includes -#include <sstream> - -class vrpn_SendTextMessageStreamProxy { -private: - /// Functor allowing us to perform a send_text_message call on - /// a device's behalf once we're done having data streamed in. - vrpn_BaseClassUnique::SendTextMessageBoundCall const& _call; - - /// Stream that will accumulate the message - std::ostringstream _s; - - /// assignment operator disabled - vrpn_SendTextMessageStreamProxy& - operator=(vrpn_SendTextMessageStreamProxy const&); - -public: - /// Templated constructor taking anything streamable. - template <typename T> - vrpn_SendTextMessageStreamProxy( - vrpn_BaseClassUnique::SendTextMessageBoundCall const& call, - T const& firstData) - : _call(call) - { - _s << firstData; - } - - /// Constructor taking a std::string, since we can use the ostringstream's - /// std::string constructor in this case. - vrpn_SendTextMessageStreamProxy( - vrpn_BaseClassUnique::SendTextMessageBoundCall const& call, - std::string const& firstData) - : _call(call) - , _s(firstData) - { - } - - /// Copy constructor - required for return by value (?) - vrpn_SendTextMessageStreamProxy( - vrpn_SendTextMessageStreamProxy const& other) - : _call(other._call) - , _s(other._s.str()) - { - } - - /// Destructor performs the send_text_message call with all contents - /// streamed into it. - ~vrpn_SendTextMessageStreamProxy() { _call(_s.str().c_str()); } - - /// Template operator<<, used for the second item streamed into the results - /// of a BoundCall-returning send_text_message() call. The first one is - /// handled below, and creates this temporary proxy object. Now, we can - /// return a reference to the internal ostream, and we'll still - /// stick around until the end of the statement to make the call - /// once it's all done. - template <typename T> std::ostream& operator<<(T const& other) - { - _s << other; - return _s; - } -}; - -/// Templated operator << that takes a -/// vrpn_BaseClassUnique::SendTextMessageBoundCall on the left, and some data on -/// the -/// right, and uses that to initialize and return a temporary -/// vrpn_SendTextMessageStreamProxy who will be able to accept -/// additional streamed data before making the send_text_message call in its -/// destructor at the -/// end of the statement. -template <typename T> -vrpn_SendTextMessageStreamProxy -operator<<(vrpn_BaseClassUnique::SendTextMessageBoundCall const& call, - T const& firstData) -{ - return vrpn_SendTextMessageStreamProxy(call, firstData); -} diff --git a/src/vrpn/vrpn_Serial.C b/src/vrpn/vrpn_Serial.C deleted file mode 100644 index 027f85de06f6dec110f294edb1e5783cd7746c63..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Serial.C +++ /dev/null @@ -1,682 +0,0 @@ -#include <fcntl.h> // for open, O_NDELAY, O_NOCTTY, etc -#include <stdio.h> // for perror, fprintf, NULL, etc -#include <string.h> // for memcpy - -#ifndef _WIN32 -#include <errno.h> // for EINTR, errno -#include <sys/ioctl.h> // for ioctl, TIOCMGET, TIOCMSET, etc -#include <termios.h> // for termios, tcflush, CSIZE, etc -#endif - -#if !defined(_WIN32) || defined(__GNUC__) && !defined(__MINGW32__) -#include <unistd.h> // for close, read, write -#endif - -#ifdef _AIX -#include <sys/termios.h> -#endif - -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday, and making it safe to include windows headers - -#if defined(_WIN32) && !defined(_WIN32_WCE) -#include <io.h> -#if defined(__GNUC__) && !defined(__MINGW32__) -#include <netinet/in.h> -#include <sys/socket.h> -#else -//#include <afxcoll.h> -#endif -#endif - -#include "vrpn_Serial.h" - -//#define VERBOSE - -#define time_add(t1, t2, tr) \ - { \ - (tr).tv_sec = (t1).tv_sec + (t2).tv_sec; \ - (tr).tv_usec = (t1).tv_usec + (t2).tv_usec; \ - while ((tr).tv_usec >= 1000000L) { \ - (tr).tv_sec++; \ - (tr).tv_usec -= 1000000L; \ - } \ - } -#define time_greater(t1, t2) \ - ((t1.tv_sec > t2.tv_sec) || \ - ((t1.tv_sec == t2.tv_sec) && (t1.tv_usec > t2.tv_usec))) - -#if defined(_WIN32) && !defined(__CYGWIN__) -const int maxCom = 50; -static HANDLE commConnections[maxCom]; -static int curCom = -1; -#endif - -int vrpn_open_commport(const char *portname, long baud, int charsize, - vrpn_SER_PARITY parity, bool rts_flow) -{ -#ifdef VERBOSE - printf("vrpn_open_commport(): Entering\n"); -#endif -#if defined(hpux) || defined(__hpux) || defined(ultrix) || defined(FreeBSD) || \ - defined(__CYGWIN__) - fprintf( - stderr, - "vrpn_open_commport(): Not yet implemented in this operating system\n"); - return -1; -#else - -#if defined(_WIN32) - DCB dcb; - COMMTIMEOUTS cto; - HANDLE hCom; - BOOL fSuccess; -#else - int fileDescriptor; - struct termios sttyArgs; -#endif - -#if defined(_WIN32) - if (curCom + 1 >= maxCom) { - fprintf(stderr, "VRPN: To many communication connections open, edit " - "vrpn_Serial.C and recompile\n"); - return -1; - } - - hCom = CreateFile(portname, GENERIC_READ | GENERIC_WRITE, - 0, // comm devices must be opened w/exclusive-access - NULL, // no security attributes - OPEN_EXISTING, // comm devices must use OPEN_EXISTING - 0, // not overlapped I/O - NULL); // hTemplate must be NULL for comm devices ); - - if (hCom == INVALID_HANDLE_VALUE) { - perror("vrpn_open_commport: cannot open serial port"); - fprintf(stderr, " (Make sure port name is valid and it has not been " - "opened by another program)\n"); - return -1; - } - - if ((fSuccess = GetCommState(hCom, &dcb)) == 0) { - perror("vrpn_open_commport: cannot get serial port configuration " - "settings"); - CloseHandle(hCom); - return -1; - } - - // Enable the hardware data-ready line (the TNG-3 uses this for power). - dcb.fDtrControl = DTR_CONTROL_ENABLE; - - // Set the baud rate - switch (baud) { - case 300: - dcb.BaudRate = CBR_300; - break; - case 1200: - dcb.BaudRate = CBR_1200; - break; - case 2400: - dcb.BaudRate = CBR_2400; - break; - case 4800: - dcb.BaudRate = CBR_4800; - break; - case 9600: - dcb.BaudRate = CBR_9600; - break; - case 19200: - dcb.BaudRate = CBR_19200; - break; - case 38400: - dcb.BaudRate = CBR_38400; - break; - case 57600: - dcb.BaudRate = CBR_57600; - break; - case 115200: - dcb.BaudRate = CBR_115200; - break; - default: - fprintf(stderr, "vrpn_open_commport: unknown baud rate %ld\n", baud); - CloseHandle(hCom); - return -1; - } - - switch (parity) { - case vrpn_SER_PARITY_NONE: - dcb.fParity = FALSE; - dcb.Parity = NOPARITY; - break; - case vrpn_SER_PARITY_ODD: - dcb.fParity = TRUE; - dcb.Parity = 1; - break; - case vrpn_SER_PARITY_EVEN: - dcb.fParity = TRUE; - dcb.Parity = 2; - break; - case vrpn_SER_PARITY_MARK: - dcb.fParity = TRUE; - dcb.Parity = 3; - break; - case vrpn_SER_PARITY_SPACE: - dcb.fParity = TRUE; - dcb.Parity = 3; - break; - default: - fprintf(stderr, "vrpn_open_commport: unknown parity setting\n"); - CloseHandle(hCom); - return -1; - } - - dcb.StopBits = ONESTOPBIT; - if (charsize == 8) - dcb.ByteSize = 8; - else if (charsize == 7) - dcb.ByteSize = 7; - else { - fprintf(stderr, - "vrpn_open_commport: unknown character size (charsize = %d)\n", - charsize); - CloseHandle(hCom); - return -1; - } - - // Turn on RTS hardware flow control if we've been asked to. - if (rts_flow) { - dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; - } - - if ((fSuccess = SetCommState(hCom, &dcb)) == 0) { - perror("vrpn_open_commport: cannot set serial port configuration " - "settings"); - CloseHandle(hCom); - return -1; - } - - cto.ReadIntervalTimeout = MAXDWORD; - cto.ReadTotalTimeoutMultiplier = MAXDWORD; - cto.ReadTotalTimeoutConstant = 1; - cto.WriteTotalTimeoutConstant = 0; - cto.WriteTotalTimeoutMultiplier = 0; - - if ((fSuccess = SetCommTimeouts(hCom, &cto)) == 0) { - perror("vrpn_open_commport: cannot set serial port timeouts"); - CloseHandle(hCom); - return -1; - } - - curCom++; - commConnections[curCom] = hCom; - - return curCom; - -// -- This section is "Win32" -#else -// -- This section is "Not win32" - -// Open the serial port for r/w -#if defined(sol) || defined(__APPLE__) || defined(linux) - if ((fileDescriptor = open(portname, O_RDWR | O_NDELAY | O_NOCTTY)) == -1) { -#else - if ((fileDescriptor = open(portname, O_RDWR)) == -1) { -#endif - perror("vrpn_open_commport: cannot open serial port"); - return -1; - } - -#ifdef VERBOSE - printf("vrpn_open_commport(): Getting settings\n"); -#endif - /* get current settings */ - if (tcgetattr(fileDescriptor, &sttyArgs) == -1) { - perror("vrpn_open_commport: tcgetattr failed"); - return (-1); - } - - /* override old values */ - speed_t speed; - switch (baud) { - case 300: - speed = B300; - break; - case 1200: - speed = B1200; - break; - case 2400: - speed = B2400; - break; - case 4800: - speed = B4800; - break; - case 9600: - speed = B9600; - break; - case 19200: - speed = B19200; - break; - case 38400: - speed = B38400; - break; -#ifdef B57600 - case 57600: - speed = B57600; - break; -#endif // End B57600 -#ifdef B115200 - case 115200: - speed = B115200; - break; -#endif // End B115200 - default: - fprintf(stderr, "vrpn_open_commport: unknown baud rate %ld\n", baud); - return -1; - } - cfsetispeed(&sttyArgs, speed); - cfsetospeed(&sttyArgs, speed); - - sttyArgs.c_iflag = (IGNBRK | IGNPAR); /* Ignore break & parity errs */ - sttyArgs.c_oflag = 0; /* Raw output, leave tabs alone */ - sttyArgs.c_lflag = 0; /* Raw input (no KILL, etc.), no echo */ - - sttyArgs.c_cflag &= ~CSIZE; - if (charsize == 8) - sttyArgs.c_cflag |= CSIZE & CS8; /* 8 bits */ - else if (charsize == 7) - sttyArgs.c_cflag |= CSIZE & CS7; /* 7 bits */ - else { - fprintf(stderr, - "vrpn_open_commport: unknown character size (charsize = %d)\n", - charsize); - return -1; - } - sttyArgs.c_cflag &= ~CSTOPB; /* One stop bit */ - - switch (parity) { - case vrpn_SER_PARITY_NONE: - sttyArgs.c_cflag &= ~PARENB; /* No parity */ - break; - case vrpn_SER_PARITY_ODD: - sttyArgs.c_cflag |= PARENB | PARODD; - break; - case vrpn_SER_PARITY_EVEN: - sttyArgs.c_cflag |= PARENB; - sttyArgs.c_cflag &= ~PARODD; - break; - case vrpn_SER_PARITY_MARK: - case vrpn_SER_PARITY_SPACE: - default: - fprintf(stderr, "vrpn_open_commport: unsupported parity setting (only " - "none, odd and even)\n"); - return -1; - } - - sttyArgs.c_cflag |= CREAD; /* Allow reading */ - sttyArgs.c_cflag |= CLOCAL; /* No modem between us and device */ - - sttyArgs.c_cc[VMIN] = 0; /* Return read even if no chars */ - sttyArgs.c_cc[VTIME] = 0; /* Return without waiting */ - - // Enable RTS hardware flow control if we've been asked for it. - if (rts_flow) { - sttyArgs.c_cflag |= CRTSCTS; - } - -#ifdef VERBOSE - printf("vrpn_open_commport(): Setting settings\n"); -#endif - /* pass the new settings back to the driver */ - if (tcsetattr(fileDescriptor, TCSANOW, &sttyArgs) == -1) { - perror("vrpn_open_commport: tcsetattr failed"); - close(fileDescriptor); - return (-1); - } - -#ifdef VERBOSE - printf("vrpn_open_commport(): Exiting\n"); -#endif - return (fileDescriptor); -// -- This section is "Not win32" -#endif // _WIN32 - -#endif // !defined(...lots of stuff...) -} - -// When finished close the commport. -int vrpn_close_commport(int comm) -{ -#ifdef VERBOSE - printf("vrpn_close_commport(): Entering\n"); -#endif -#if defined(_WIN32) && !defined(__CYGWIN__) - int ret = CloseHandle(commConnections[comm]); - - for (int i = comm; i < curCom - 1; i++) - commConnections[i] = commConnections[i + 1]; - - commConnections[curCom--] = NULL; - - return ret; -#else - return close(comm); -#endif -} - -// Set the RTS ("ready to send") bit on an open commport. -int vrpn_set_rts(int comm) -{ -#ifdef VERBOSE - printf("vrpn_set_rts(): Entering\n"); -#endif -#if defined(_WIN32) - // Determine the handle for this serial port by looking it - // up in our list. Then make the system call that Kyle from - // Ascension told us about. Return 0 on success; the Windows - // function returns nonzero on success - return EscapeCommFunction(commConnections[comm], SETRTS) != 0; - -#else - // XXX There are termios methods to enable/disable RTSCTS. but - // they do not actually seem to set the line. We need to use - // an ioctl interface, which has been shown to work, to do this - // function. We are doing this now by going directly to the - // modem bits. - int flags; - if (ioctl(comm, TIOCMGET, &flags) == -1) { - perror("vrpn_set_rts: Failed to get modem status bits"); - return (-1); - } - flags |= TIOCM_RTS; - if (ioctl(comm, TIOCMSET, &flags) == -1) { - perror("vrpn_set_rts: Failed to set modem status bits"); - return (-1); - } - - return 0; -#endif -} - -// Clear the RTS ("ready to send") bit on an open commport. -int vrpn_clear_rts(int comm) -{ -#ifdef VERBOSE - printf("vrpn_clear_rts(): Entering\n"); -#endif -#if defined(_WIN32) - // Determine the handle for this serial port by looking it - // up in our list. Then make the system call that Kyle from - // Ascension told us about. Return 0 on success; the Windows - // function returns nonzero on success - return EscapeCommFunction(commConnections[comm], CLRRTS) != 0; - -#else - // XXX There are termios methods to enable/disable RTSCTS. but - // they do not actually seem to set the line. We need to use - // an ioctl interface, which has been shown to work, to do this - // function. We are doing this now by going directly to the - // modem bits. - int flags; - if (ioctl(comm, TIOCMGET, &flags) == -1) { - perror("vrpn_set_rts: Failed to get modem status bits"); - return (-1); - } - flags &= ~TIOCM_RTS; - if (ioctl(comm, TIOCMSET, &flags) == -1) { - perror("vrpn_set_rts: Failed to set modem status bits"); - return (-1); - } - - return 0; -#endif -} - -// empty the input buffer (discarding the chars) -// Return 0 on success, -1 on failure. -// NOT CALLED! OBSOLETE? -- no ... used by vrpn_Flock and others -int vrpn_flush_input_buffer(int comm) -{ -#ifdef VERBOSE - printf("vrpn_flush_input_buffer(): Entering\n"); -#endif -#if defined(hpux) || defined(__hpux) || defined(ultrix) || defined(__CYGWIN__) - fprintf( - stderr, - "vrpn_flush_input_buffer: Not impemented on cygwin, ultrix, or HP\n"); - return -1; -#else -#if defined(_WIN32) - if (PurgeComm(commConnections[comm], PURGE_RXCLEAR) != 0) { - return 0; - } - else { - return -1; - } -#else - return tcflush(comm, TCIFLUSH); -#endif -#endif -} - -// empty the output buffer, discarding all of the chars -// Return 0 on success, tc err codes other on failure. -// NOT CALLED! OBSOLETE? -- no ... used by vrpn_Flock -int vrpn_flush_output_buffer(int comm) -{ -#ifdef VERBOSE - printf("vrpn_flush_output_buffer(): Entering\n"); -#endif -#if defined(hpux) || defined(__hpux) || defined(ultrix) || defined(__CYGWIN__) - fprintf(stderr, "vrpn_flush_output_buffer: Not impemented on NT, ultrix, " - "HP, or cygwin\n"); - return -1; -#else - -#if defined(_WIN32) - return PurgeComm(commConnections[comm], PURGE_TXCLEAR); -#else - return tcflush(comm, TCOFLUSH); -#endif - -#endif -} - -// empty the output buffer, waiting for all of the chars to be delivered -// Return 0 on success, nonzero on failure. -// NOT CALLED! OBSOLETE? -- no ... used by vrpn_Flock -int vrpn_drain_output_buffer(int comm) -{ -#ifdef VERBOSE - printf("vrpn_drain_output_buffer(): Entering\n"); -#endif -#if defined(hpux) || defined(__hpux) || defined(ultrix) || \ - defined(__CYGWIN__) || defined(__ANDROID__) - - fprintf(stderr, "vrpn_drain_output_buffer: Not impemented on NT, ultrix, " - "android, or HP\n"); - return -1; -#else - -#if defined(_WIN32) - return FlushFileBuffers(commConnections[comm]) == 0; -#else - return tcdrain(comm); -#endif - -#endif -} - -// This routine will read any available characters from the handle into -// the buffer specified, up to the number of bytes requested. It returns -// the number of characters read or -1 on failure. Note that it only -// reads characters that are available at the time of the read, so less -// than the requested number may be returned. -int vrpn_read_available_characters(int comm, unsigned char *buffer, - size_t bytes) -{ -#ifdef VERBOSE - printf("vrpn_read_available_characters(): Entering\n"); -#endif -#if defined(_WIN32) && !defined(__CYGWIN__) - BOOL fSuccess; - DWORD numRead; - COMSTAT cstat; - DWORD errors; - OVERLAPPED Overlapped; - - Overlapped.Offset = 0; - Overlapped.OffsetHigh = 0; - Overlapped.hEvent = NULL; - - if ((fSuccess = ClearCommError(commConnections[comm], &errors, &cstat)) == - 0) { - perror("vrpn_read_available_characters: can't get current status"); - return (-1); - } - - if (cstat.cbInQue > 0) { - if ((fSuccess = ReadFile(commConnections[comm], buffer, - static_cast<DWORD>(bytes), &numRead, - &Overlapped)) == 0) { - perror( - "vrpn_read_available_characters: can't read from serial port"); - return (-1); - } - - return numRead; - } - - return 0; -#else - int bRead; - - // on sgi's (and possibly other architectures) the folks from - // ascension have noticed that a read command will not necessarily - // read everything available in the read buffer (see the following file: - // /afs/cs.unc.edu/project/hmd/src/libs/tracker/apps/ascension/FLOCK232/C/unix.txt - // For this reason, we loop and try to fill the buffer, stopping our - // loop whenever no chars are available. - int cReadThisTime = 0; - int cSpaceLeft = bytes; - unsigned char *pch = buffer; - - do { - if ((cReadThisTime = read(comm, (char *)pch, cSpaceLeft)) == -1) { - // If the read stopped because of an interrupt, don't cause an error - // but rather behave as if no characters were available. - if (errno == EINTR) { - cReadThisTime = 0; - } - else { - perror("vrpn_read_available_characters: cannot read from " - "serial port"); - fprintf(stderr, "buffer = %p, %d\n", pch, - static_cast<int>(bytes)); - return -1; - } - } - cSpaceLeft -= cReadThisTime; - pch += cReadThisTime; - } while ((cReadThisTime != 0) && (cSpaceLeft > 0)); - bRead = pch - buffer; - -#ifdef VERBOSE - printf("vrpn_read_available_characters(): Exiting\n"); -#endif - return bRead; -#endif -} - -/// Read until either you get the answer, you get an error, or timeout. -// If there is a NULL timeout pointer, block indefinitely. Return the number -// of characters read. - -int vrpn_read_available_characters(int comm, unsigned char *buffer, - size_t bytes, struct timeval *timeout) -{ -#ifdef VERBOSE - printf("vrpn_read_available_characters(timeout): Entering\n"); -#endif - struct timeval start, finish, now; - int sofar = 0, ret; // How many characters we have read so far - unsigned char *where = buffer; - - // Find out what time it is at the start, and when we should end - // (unless the timeout is NULL) - if (timeout == NULL) { - // Set up so that it will never be that now > finish - // This prevents the while() loop below from stopping looping - vrpn_gettimeofday(&now, NULL); - memcpy(&finish, &now, sizeof(finish)); - vrpn_gettimeofday(&finish, NULL); - } - else { - vrpn_gettimeofday(&start, NULL); - memcpy(&now, &start, sizeof(now)); - time_add(start, *timeout, finish); - } - - // Keep reading until we timeout. Exit from the middle of this by - // returning if we complete or find an error so that the loop only has - // to check for timeout, not other terminating conditions. - do { - ret = vrpn_read_available_characters(comm, where, bytes - sofar); - if (ret == -1) { - return -1; - } - sofar += ret; - if (sofar == bytes) { - break; - } - where += ret; - if (timeout != NULL) { // Update the time if we are checking timeout - vrpn_gettimeofday(&now, NULL); - } - } while (!(time_greater(now, finish))); - -#ifdef VERBOSE - printf("vrpn_read_available_characters(timeout): Exiting\n"); -#endif - return sofar; -} - -/// Write the buffer to the serial port - -int vrpn_write_characters(int comm, const unsigned char *buffer, size_t bytes) -{ -#ifdef VERBOSE - printf("vrpn_write_characters(): Entering\n"); -#endif -#if defined(_WIN32) && !defined(__CYGWIN__) - BOOL fSuccess; - DWORD numWritten; - OVERLAPPED Overlapped; - - Overlapped.Offset = 0; - Overlapped.OffsetHigh = 0; - Overlapped.hEvent = NULL; - - if ((fSuccess = - WriteFile(commConnections[comm], buffer, static_cast<DWORD>(bytes), - &numWritten, &Overlapped)) == 0) { - perror("vrpn_write_characters: can't write to serial port"); - return (-1); - } - - return numWritten; -#else - return write(comm, buffer, bytes); -#endif -} - -int vrpn_write_slowly(int comm, const unsigned char *buffer, size_t bytes, - int millisec_delay) -{ - size_t i; - - for (i = 0; i < bytes; i++) { - vrpn_SleepMsecs(millisec_delay); - if (vrpn_write_characters(comm, &buffer[i], 1) != 1) { - return -1; - } - } - return static_cast<int>(bytes); -} diff --git a/src/vrpn/vrpn_Serial.h b/src/vrpn/vrpn_Serial.h deleted file mode 100644 index ac031fc92f6a23181c2878d466aae69adb8f0c3e..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Serial.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef VRPN_SERIAL_H -#define VRPN_SERIAL_H - -#include "vrpn_Configure.h" // for VRPN_API -#include <stddef.h> // For size_t - -/// @file -/// -/// @brief vrpn_Serial: Pulls all the serial port routines into one file to make -/// porting to -/// new operating systems easier. -/// -/// @author Russ Taylor, 1998 - -typedef enum { - vrpn_SER_PARITY_NONE, - vrpn_SER_PARITY_ODD, - vrpn_SER_PARITY_EVEN, - vrpn_SER_PARITY_MARK, - vrpn_SER_PARITY_SPACE -} vrpn_SER_PARITY; - -/// @brief Open a serial port, given its name and baud rate. -/// -/// Default Settings are 8 bits, no parity, 1 start and stop bits with no -/// RTS (hardware) flow control. Also, -/// set the port so that it will return immediately if there are no -/// characters or less than the number of characters requested. -/// -/// @returns the file descriptor on success,-1 on failure. -extern VRPN_API int -vrpn_open_commport(const char *portname, long baud, int charsize = 8, - vrpn_SER_PARITY parity = vrpn_SER_PARITY_NONE, - bool rts_flow = false); - -/// @name RTS Hardware Flow Control -/// Set and clear functions for the RTS ("ready to send") hardware flow- -/// control bit. These are used on a port that is already open. Some -/// devices (like the Ascension Flock of Birds) use this to reset the -/// device. Return 0 on success, nonzero on error. -/// @{ -extern VRPN_API int vrpn_set_rts(int comm); -extern VRPN_API int vrpn_clear_rts(int comm); -/// @} - -extern VRPN_API int vrpn_close_commport(int comm); - -/// @brief Throw out any characters within the input buffer. -/// @returns 0 on success, -1 on error. -extern VRPN_API int vrpn_flush_input_buffer(int comm); - -/// @brief Throw out any characters (do not send) within the output buffer -/// @returns 0 on success, tc err codes (whatever those are) on error. -extern VRPN_API int vrpn_flush_output_buffer(int comm); - -/// @brief Wait until all of the characters in the output buffer are sent, then -/// return. -/// -/// @returns 0 on success, -1 on error. -extern VRPN_API int vrpn_drain_output_buffer(int comm); - -/// @name Read routines -/// -/// Read up the the requested count of characters from the input buffer, -/// return with less if less (or none) are there. Return the number of -/// characters read, or -1 if there is an error. The second of these -/// will keep looking until the timeout period expires before returning -/// (NULL pointer will cause it to block indefinitely). -/// @{ -extern VRPN_API int -vrpn_read_available_characters(int comm, unsigned char *buffer, size_t count); -extern VRPN_API int vrpn_read_available_characters(int comm, - unsigned char *buffer, - size_t count, - struct timeval *timeout); -/// @} - -/// @name Write routines -/// -/// Write the specified number of characters. Some devices can't accept writes -/// that -/// are too fast, so need time between characters; the write_slowly function -/// handles -/// this case. -/// @} -extern VRPN_API int vrpn_write_characters(int comm, const unsigned char *buffer, - size_t bytes); -extern VRPN_API int vrpn_write_slowly(int comm, const unsigned char *buffer, - size_t bytes, int millisec_delay); - -#endif diff --git a/src/vrpn/vrpn_SerialPort.C b/src/vrpn/vrpn_SerialPort.C deleted file mode 100644 index d4fc14ba086adca65be7be8711fcf20ff12d6cd2..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_SerialPort.C +++ /dev/null @@ -1,204 +0,0 @@ -/** - @file - @brief Implementation - - @date 2012 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2012. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// Internal Includes -#include "vrpn_SerialPort.h" -#include "vrpn_Serial.h" - -// Library/third-party includes -// - none - -// Standard includes -#include <stdio.h> -#include <vector> -#include <exception> -#include <algorithm> -#include <limits> - -typedef std::vector<unsigned char> DynamicBufferType; - -vrpn_SerialPort::vrpn_SerialPort(const char *portname, long baud, int charsize, - vrpn_SER_PARITY parity) - : _comm(vrpn_open_commport(portname, baud, charsize, parity)) - , _rts_status(false) -{ - if (!is_open()) { - throw OpenFailure(); - } -} - -vrpn_SerialPort::vrpn_SerialPort() - : _comm(-1) - , _rts_status(false) -{ -} - -vrpn_SerialPort::~vrpn_SerialPort() -{ - if (is_open()) { - try { - close(); - } - catch (std::exception &) { - fprintf(stderr, "Error when closing serial port in destructor.\n"); - } - } -} - -void vrpn_SerialPort::open(const char *portname, long baud, int charsize, - vrpn_SER_PARITY parity) -{ - if (is_open()) { - throw AlreadyOpen(); - } - _comm = vrpn_open_commport(portname, baud, charsize, parity); - if (!is_open()) { - - throw OpenFailure(); - } -} - -void vrpn_SerialPort::close() -{ - requiresOpen(); - int ret = vrpn_close_commport(_comm); - if (ret != 0) { - throw CloseFailure(); - } -} - -int vrpn_SerialPort::write(std::string const &buffer) -{ - if (buffer.size() > 0) { - DynamicBufferType buf(buffer.c_str(), buffer.c_str() + buffer.size()); - return write(&(buf[0]), static_cast<int>(buffer.size())); - } - return 0; -} - -int vrpn_SerialPort::write(const unsigned char *buffer, int bytes) -{ - requiresOpen(); - int ret = vrpn_write_characters(_comm, buffer, bytes); - if (ret == -1) { - throw WriteFailure(); - } - return ret; -} - -int vrpn_SerialPort::read_available_characters(unsigned char *buffer, int count) -{ - requiresOpen(); - int ret = vrpn_read_available_characters(_comm, buffer, count); - if (ret == -1) { - throw ReadFailure(); - } - - return ret; -} - -std::string vrpn_SerialPort::read_available_characters(int count) -{ - std::string retString; - unsigned int numRead = 0; - unsigned int thisRead = 0; - static const unsigned int BUFSIZE = 256; - unsigned char buf[BUFSIZE]; - unsigned int needed = BUFSIZE - 1; - do { - if (count > -1) { - needed = (std::min)(count - numRead, BUFSIZE - 1); - } - thisRead = read_available_characters(buf, needed); - if (thisRead != 0) { - retString.append(&(buf[0]), &(buf[0]) + thisRead); - numRead += thisRead; - } - } while (thisRead != 0 && - (static_cast<int>(numRead) < count || count == -1)); - return retString; -} - -int vrpn_SerialPort::read_available_characters(unsigned char *buffer, int count, - struct timeval &timeout) -{ - requiresOpen(); - int ret = vrpn_read_available_characters(_comm, buffer, count, &timeout); - if (ret == -1) { - throw ReadFailure(); - } - return ret; -} - -std::string vrpn_SerialPort::read_available_characters(int count, - struct timeval &timeout) -{ - if (count == std::numeric_limits<int>::max()) { - /// overflow safety - throw ReadFailure(); - } - DynamicBufferType buf(count + 1); - int ret = read_available_characters(&(buf[0]), count, timeout); - return std::string(&(buf[0]), &(buf[0]) + ret); -} - -void vrpn_SerialPort::flush_input_buffer() -{ - requiresOpen(); - int ret = vrpn_flush_input_buffer(_comm); - if (ret == -1) { - throw FlushFailure(); - } -} - -void vrpn_SerialPort::flush_output_buffer() -{ - requiresOpen(); - int ret = vrpn_flush_output_buffer(_comm); - if (ret == -1) { - throw FlushFailure(); - } -} - -void vrpn_SerialPort::drain_output_buffer() -{ - requiresOpen(); - int ret = vrpn_drain_output_buffer(_comm); - if (ret == -1) { - throw DrainFailure(); - } -} - -void vrpn_SerialPort::set_rts() -{ - requiresOpen(); - int ret = vrpn_set_rts(_comm); - if (ret == -1) { - throw RTSFailure(); - } -} - -void vrpn_SerialPort::clear_rts() -{ - requiresOpen(); - int ret = vrpn_clear_rts(_comm); - if (ret == -1) { - throw RTSFailure(); - } -} diff --git a/src/vrpn/vrpn_SerialPort.h b/src/vrpn/vrpn_SerialPort.h deleted file mode 100644 index 3a41e71059b7c5c42042f44ec27d2f6b37126c6f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_SerialPort.h +++ /dev/null @@ -1,227 +0,0 @@ -/** @file - @brief Header - - @date 2012 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2012. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -// Internal Includes -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Serial.h" // for ::vrpn_SER_PARITY_NONE, etc - -// Library/third-party includes -// - none - -// Standard includes -#include <stdexcept> // for runtime_error, logic_error -#include <string> // for string - -/// @brief A simple class wrapping the functionality of vrpn_Serial.h with -/// RAII, object-orientation, and optional STL types -class VRPN_API vrpn_SerialPort { -public: - typedef int file_handle_type; - /// @brief Construct and open port - /// @sa vrpn_open_commport - /// @throws OpenFailure - vrpn_SerialPort(const char *portname, long baud, int charsize = 8, - vrpn_SER_PARITY parity = vrpn_SER_PARITY_NONE); - - /// @brief Construct without opening - vrpn_SerialPort(); - - /// @brief Destructor - closes port if open. - ~vrpn_SerialPort(); - - /// @name Open/Close Methods - /// @{ - /// @brief Open serial port - /// @sa vrpn_open_commport - /// @throws OpenFailure, AlreadyOpen - void open(const char *portname, long baud, int charsize = 8, - vrpn_SER_PARITY parity = vrpn_SER_PARITY_NONE); - bool is_open() const; - - /// @brief Close the serial port. - /// @throws NotOpen, CloseFailure - void close(); - /// @} - - /// @name Write - /// @returns number of bytes written - /// @throws WriteFailure, NotOpen - /// @{ - int write(std::string const &buffer); - int write(const unsigned char *buffer, int bytes); - /// @} - - /// @name Read - /// @throws ReadFailure, NotOpen - /// @{ - /// @brief Read available characters from input buffer, up to indicated - /// count. - int read_available_characters(unsigned char *buffer, int count); - - /// @brief Read available characters from input buffer, up to indicated - /// count (or -1 for no limit) - std::string read_available_characters(int count = -1); - - /// @brief Read available characters from input buffer, and wait up to the - /// indicated timeout for those remaining, up to indicated count. - int read_available_characters(unsigned char *buffer, int count, - struct timeval &timeout); - - /// @brief Read available characters from input buffer, and wait up to the - /// indicated timeout for those remaining, up to indicated count. - std::string read_available_characters(int count, struct timeval &timeout); - /// @} - - /// @name Buffer manipulation - /// @{ - - /// @brief Throw out any characters within the input buffer. - /// @throws FlushFailure, NotOpen - void flush_input_buffer(); - - /// @brief Throw out any characters (do not send) within the output buffer. - /// @throws FlushFailure, NotOpen - void flush_output_buffer(); - - /// @brief Wait until all of the characters in the output buffer are sent, - /// then return. - void drain_output_buffer(); - /// @} - - /// @name RTS - /// @brief Set and clear functions for the RTS ("ready to send") hardware - /// flow- control bit. - /// - /// These are used on a port that is already open. Some devices (like the - /// Ascension Flock of Birds) use this to reset the device. - /// @throws RTSFailure, NotOpen - /// @{ - void set_rts(); - void clear_rts(); - void assign_rts(bool set); - /// @} - - /// @name Serial Port Exceptions - /// @{ - struct AlreadyOpen; - struct CloseFailure; - struct DrainFailure; - struct FlushFailure; - struct NotOpen; - struct OpenFailure; - struct RTSFailure; - struct ReadFailure; - struct WriteFailure; - /// @} - -private: - void requiresOpen() const; - /// @name Non-copyable - /// @{ - vrpn_SerialPort(vrpn_SerialPort const &); - vrpn_SerialPort const &operator=(vrpn_SerialPort const &); - /// @} - file_handle_type _comm; - bool _rts_status; -}; - -struct vrpn_SerialPort::AlreadyOpen : std::logic_error { - AlreadyOpen() - : std::logic_error("Tried to open a serial port that was already open.") - { - } -}; - -struct vrpn_SerialPort::NotOpen : std::logic_error { - NotOpen() - : std::logic_error("Tried to use a serial port that was not yet open.") - { - } -}; - -struct vrpn_SerialPort::OpenFailure : std::runtime_error { - OpenFailure() - : std::runtime_error( - "Received an error when trying to open serial port.") - { - } -}; - -struct vrpn_SerialPort::CloseFailure : std::runtime_error { - CloseFailure() - : std::runtime_error( - "Received an error when trying to close serial port.") - { - } -}; - -struct vrpn_SerialPort::RTSFailure : std::runtime_error { - RTSFailure() - : std::runtime_error("Failed to modify serial port RTS status.") - { - } -}; - -struct vrpn_SerialPort::ReadFailure : std::runtime_error { - ReadFailure() - : std::runtime_error("Failure on serial port read.") - { - } -}; - -struct vrpn_SerialPort::WriteFailure : std::runtime_error { - WriteFailure() - : std::runtime_error("Failure on serial port write.") - { - } -}; - -struct vrpn_SerialPort::FlushFailure : std::runtime_error { - FlushFailure() - : std::runtime_error("Failure on serial port flush.") - { - } -}; - -struct vrpn_SerialPort::DrainFailure : std::runtime_error { - DrainFailure() - : std::runtime_error("Failure on serial port drain.") - { - } -}; - -inline bool vrpn_SerialPort::is_open() const { return _comm != -1; } - -inline void vrpn_SerialPort::assign_rts(bool set) -{ - if (set) { - set_rts(); - } - else { - clear_rts(); - } -} - -inline void vrpn_SerialPort::requiresOpen() const -{ - if (!is_open()) { - throw NotOpen(); - } -} diff --git a/src/vrpn/vrpn_Shared.C b/src/vrpn/vrpn_Shared.C deleted file mode 100644 index db19d188f05de05f06aab11e936d21ae5c2efbe1..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Shared.C +++ /dev/null @@ -1,1539 +0,0 @@ -#include <math.h> // for floor, fmod -#include <stddef.h> // for size_t -#include <stdio.h> // for fprintf() and such - -#ifdef _MSC_VER -// Don't tell us about strcpy being dangerous. -#define _CRT_SECURE_NO_WARNINGS 1 -#pragma warning(disable : 4996) -#endif - -#include "vrpn_Shared.h" - -#if defined(__APPLE__) || defined(__ANDROID__) -#include <unistd.h> -#endif - -#if !(defined(_WIN32) && defined(VRPN_USE_WINSOCK_SOCKETS)) -#include <sys/select.h> // for select -#include <netinet/in.h> // for htonl, htons -#endif - -#define CHECK(a) \ - if (a == -1) return -1 - -// perform normalization of a timeval -// XXX this still needs to be checked for errors if the timeval -// or the rate is negative -static inline void timevalNormalizeInPlace(timeval &in_tv) -{ - const long div_77777 = (in_tv.tv_usec / 1000000); - in_tv.tv_sec += div_77777; - in_tv.tv_usec -= (div_77777 * 1000000); -} -timeval vrpn_TimevalNormalize(const timeval &in_tv) -{ - timeval out_tv = in_tv; - timevalNormalizeInPlace(out_tv); - return out_tv; -} - -// Calcs the sum of tv1 and tv2. Returns the sum in a timeval struct. -// Calcs negative times properly, with the appropriate sign on both tv_sec -// and tv_usec (these signs will match unless one of them is 0). -// NOTE: both abs(tv_usec)'s must be < 1000000 (ie, normal timeval format) -timeval vrpn_TimevalSum(const timeval &tv1, const timeval &tv2) -{ - timeval tvSum = tv1; - - tvSum.tv_sec += tv2.tv_sec; - tvSum.tv_usec += tv2.tv_usec; - - // do borrows, etc to get the time the way i want it: both signs the same, - // and abs(usec) less than 1e6 - if (tvSum.tv_sec > 0) { - if (tvSum.tv_usec < 0) { - tvSum.tv_sec--; - tvSum.tv_usec += 1000000; - } - else if (tvSum.tv_usec >= 1000000) { - tvSum.tv_sec++; - tvSum.tv_usec -= 1000000; - } - } - else if (tvSum.tv_sec < 0) { - if (tvSum.tv_usec > 0) { - tvSum.tv_sec++; - tvSum.tv_usec -= 1000000; - } - else if (tvSum.tv_usec <= -1000000) { - tvSum.tv_sec--; - tvSum.tv_usec += 1000000; - } - } - else { - // == 0, so just adjust usec - if (tvSum.tv_usec >= 1000000) { - tvSum.tv_sec++; - tvSum.tv_usec -= 1000000; - } - else if (tvSum.tv_usec <= -1000000) { - tvSum.tv_sec--; - tvSum.tv_usec += 1000000; - } - } - - return tvSum; -} - -// Calcs the diff between tv1 and tv2. Returns the diff in a timeval struct. -// Calcs negative times properly, with the appropriate sign on both tv_sec -// and tv_usec (these signs will match unless one of them is 0) -timeval vrpn_TimevalDiff(const timeval &tv1, const timeval &tv2) -{ - timeval tv; - - tv.tv_sec = -tv2.tv_sec; - tv.tv_usec = -tv2.tv_usec; - - return vrpn_TimevalSum(tv1, tv); -} - -timeval vrpn_TimevalScale(const timeval &tv, double scale) -{ - timeval result; - result.tv_sec = (long)(tv.tv_sec * scale); - result.tv_usec = - (long)(tv.tv_usec * scale + fmod(tv.tv_sec * scale, 1.0) * 1000000.0); - timevalNormalizeInPlace(result); - return result; -} - -// returns 1 if tv1 is greater than tv2; 0 otherwise -bool vrpn_TimevalGreater(const timeval &tv1, const timeval &tv2) -{ - if (tv1.tv_sec > tv2.tv_sec) return 1; - if ((tv1.tv_sec == tv2.tv_sec) && (tv1.tv_usec > tv2.tv_usec)) return 1; - return 0; -} - -// return 1 if tv1 is equal to tv2; 0 otherwise -bool vrpn_TimevalEqual(const timeval &tv1, const timeval &tv2) -{ - if (tv1.tv_sec == tv2.tv_sec && tv1.tv_usec == tv2.tv_usec) - return true; - else - return false; -} - -unsigned long vrpn_TimevalDuration(struct timeval endT, struct timeval startT) -{ - return (endT.tv_usec - startT.tv_usec) + - 1000000L * (endT.tv_sec - startT.tv_sec); -} - -double vrpn_TimevalDurationSeconds(struct timeval endT, struct timeval startT) -{ - return (endT.tv_usec - startT.tv_usec) / 1000000.0 + - (endT.tv_sec - startT.tv_sec); -} - -double vrpn_TimevalMsecs(const timeval &tv) -{ - return tv.tv_sec * 1000.0 + tv.tv_usec / 1000.0; -} - -timeval vrpn_MsecsTimeval(const double dMsecs) -{ - timeval tv; - tv.tv_sec = (long)floor(dMsecs / 1000.0); - tv.tv_usec = (long)((dMsecs / 1000.0 - tv.tv_sec) * 1e6); - return tv; -} - -// Sleep for dMsecs milliseconds, freeing up the processor while you -// are doing so. - -void vrpn_SleepMsecs(double dMsecs) -{ -#if defined(_WIN32) - Sleep((DWORD)dMsecs); -#else - timeval timeout; - - // Convert milliseconds to seconds - timeout.tv_sec = (int)(dMsecs / 1000.0); - - // Subtract of whole number of seconds - dMsecs -= timeout.tv_sec * 1000; - - // Convert remaining milliseconds to microsec - timeout.tv_usec = (int)(dMsecs * 1000); - - // A select() with NULL file descriptors acts like a microsecond - // timer. - select(0, 0, 0, 0, &timeout); // wait for that long; -#endif -} - -// convert vrpn_float64 to/from network order -// I have chosen big endian as the network order for vrpn_float64 -// to match the standard for htons() and htonl(). -// NOTE: There is an added complexity when we are using an ARM -// processor in mixed-endian mode for the doubles, whereby we need -// to not just swap all of the bytes but also swap the two 4-byte -// words to get things in the right order. -#if defined(__arm__) -#include <endian.h> -#endif - -vrpn_float64 vrpn_htond(vrpn_float64 d) -{ - if (!vrpn_big_endian) { - vrpn_float64 dSwapped; - char *pchSwapped = (char *)&dSwapped; - char *pchOrig = (char *)&d; - - // swap to big-endian order. - unsigned i; - for (i = 0; i < sizeof(vrpn_float64); i++) { - pchSwapped[i] = pchOrig[sizeof(vrpn_float64) - i - 1]; - } - -#if defined(__arm__) && !defined(__ANDROID__) -// On ARM processor, see if we're in mixed mode. If so, -// we need to swap the two words after doing the total -// swap of bytes. -#if __FLOAT_WORD_ORDER != __BYTE_ORDER - { - /* Fixup mixed endian floating point machines */ - vrpn_uint32 *pwSwapped = (vrpn_uint32 *)&dSwapped; - vrpn_uint32 scratch = pwSwapped[0]; - pwSwapped[0] = pwSwapped[1]; - pwSwapped[1] = scratch; - } -#endif -#endif - - return dSwapped; - } - else { - return d; - } -} - -// they are their own inverses, so ... -vrpn_float64 vrpn_ntohd(vrpn_float64 d) { return vrpn_htond(d); } - -/** Utility routine for placing a timeval struct into a buffer that - is to be sent as a message. Handles packing into an unaligned - buffer (though this should not be done). Advances the insertPt - pointer to just after newly-inserted value. Decreases the buflen - (space remaining) by the length of the value. Returns zero on - success and -1 on failure. - - Part of a family of routines that buffer different VRPN types - based on their type (vrpn_buffer is overloaded based on the third - parameter type). These routines handle byte-swapping to the - VRPN standard wire protocol. -*/ - -VRPN_API int vrpn_buffer(char **insertPt, vrpn_int32 *buflen, const timeval t) -{ - vrpn_int32 sec, usec; - - // tv_sec and usec are 64 bits on some architectures, but we - // define them as 32 bit for network transmission - - sec = t.tv_sec; - usec = t.tv_usec; - - if (vrpn_buffer(insertPt, buflen, sec)) return -1; - return vrpn_buffer(insertPt, buflen, usec); -} - -/** Utility routine for placing a character string of given length - into a buffer that is to be sent as a message. Handles packing into - an unaligned buffer (though this should not be done). Advances the insertPt - pointer to just after newly-inserted value. Decreases the buflen - (space remaining) by the length of the value. Returns zero on - success and -1 on failure. - - Part of a family of routines that buffer different VRPN types - based on their type (vrpn_buffer is overloaded based on the third - parameter type). These routines handle byte-swapping to the - VRPN standard wire protocol. - - If the length is specified as -1, then the string will be assumed to - be NULL-terminated and will be copied using the string-copy routines. -*/ - -VRPN_API int vrpn_buffer(char **insertPt, vrpn_int32 *buflen, - const char *string, vrpn_int32 length) -{ - if (length > *buflen) { - fprintf(stderr, "vrpn_buffer: buffer not long enough for string.\n"); - return -1; - } - - if (length == -1) { - size_t len = - strlen(string) + 1; // +1 for the NULL terminating character - if (len > (unsigned)*buflen) { - fprintf(stderr, - "vrpn_buffer: buffer not long enough for string.\n"); - return -1; - } - strcpy(*insertPt, string); - *insertPt += len; - *buflen -= static_cast<vrpn_int32>(len); - } - else { - memcpy(*insertPt, string, length); - *insertPt += length; - *buflen -= length; - } - - return 0; -} - -/** Utility routine for taking a struct timeval from a buffer that - was sent as a message. Handles unpacking from an - unaligned buffer, because people did this anyway. Advances the reading - pointer to just after newly-read value. Assumes that the - buffer holds a complete value. Returns zero on success and -1 on failure. - - Part of a family of routines that unbuffer different VRPN types - based on their type (vrpn_buffer is overloaded based on the third - parameter type). These routines handle byte-swapping to and from - the VRPN defined wire protocol. -*/ - -VRPN_API int vrpn_unbuffer(const char **buffer, timeval *t) -{ - vrpn_int32 sec, usec; - - CHECK(vrpn_unbuffer(buffer, &sec)); - CHECK(vrpn_unbuffer(buffer, &usec)); - - t->tv_sec = sec; - t->tv_usec = usec; - - return 0; -} - -/** Utility routine for taking a string of specified length from a buffer that - was sent as a message. Does NOT handle unpacking from an - unaligned buffer, because the semantics of VRPN require - message buffers and the values in them to be aligned, in order to - reduce the amount of copying that goes on. Advances the read - pointer to just after newly-read value. Assumes that the - buffer holds a complete value. Returns zero on success and -1 on failure. - - Part of a family of routines that unbuffer different VRPN types - based on their type (vrpn_buffer is overloaded based on the third - parameter type). These routines handle byte-swapping to and from - the VRPN defined wire protocol. - - If the length is specified as less than zero, then the string will be - assumed to - be NULL-terminated and will be read using the string-copy routines with a - length that is at most the magnitude of the number (-16 means at most 16). - NEVER - use this on a string that was packed with other than the NULL-terminating - condition, since embedded NULL characters will ruin the argument parsing - for any later arguments in the message. -*/ - -VRPN_API int vrpn_unbuffer(const char **buffer, char *string, vrpn_int32 length) -{ - if (!string) return -1; - - if (length < 0) { - // Read the string up to maximum length, then check to make sure we - // found the null-terminator in the length we read. - size_t max_len = static_cast<size_t>(-length); - strncpy(string, *buffer, max_len); - size_t i; - bool found = false; - for (i = 0; i < max_len; i++) { - if (string[i] == '\0') { - found = true; - break; - } - } - if (!found) { - return -1; - } - *buffer += strlen(*buffer) + 1; // +1 for NULL terminating character - } - else { - memcpy(string, *buffer, length); - *buffer += length; - } - - return 0; -} - -/////////////////////////////////////////////////////////////// -// More accurate gettimeofday() on some Windows operating systems -// and machines can be gotten by using the Performance Counter -// on the CPU. This doesn't seem to work in NT/2000 for some -// computers, so the code to do it is #defined out by default. -// To put it back back, #define VRPN_UNSAFE_WINDOWS_CLOCK and -// the following code will use the performance counter (which it -// takes a second to calibrate at program start-up). -/////////////////////////////////////////////////////////////// - -#ifndef VRPN_UNSAFE_WINDOWS_CLOCK - -#if defined(_WIN32) && !defined(__CYGWIN__) -#include <math.h> // for floor, fmod - -#pragma optimize("", on) - -#ifdef _WIN32 -void get_time_using_GetLocalTime(unsigned long &sec, unsigned long &usec) -{ - SYSTEMTIME stime; // System time in funky structure - FILETIME ftime; // Time in 100-nsec intervals since Jan 1 1601 - LARGE_INTEGER tics; // ftime stored into a 64-bit quantity - - GetLocalTime(&stime); - SystemTimeToFileTime(&stime, &ftime); - - // Copy the data into a structure that can be treated as a 64-bit integer - tics.HighPart = ftime.dwHighDateTime; - tics.LowPart = ftime.dwLowDateTime; - - // Convert the 64-bit time into seconds and microseconds since July 1 1601 - sec = (long)(tics.QuadPart / 10000000L); - usec = (long)((tics.QuadPart - (((LONGLONG)(sec)) * 10000000L)) / 10); - - // Translate the time to be based on January 1, 1970 (_ftime base) - // The offset here is gotten by using the "time_test" program to report the - // difference in seconds between the two clocks. - sec -= 3054524608; -} -#endif - -/////////////////////////////////////////////////////////////// -// Although VC++ doesn't include a gettimeofday -// call, Cygnus Solutions Cygwin32 environment does, -// so this is not used when compiling with gcc under WIN32. -// XXX Note that the cygwin one was wrong in an earlier -// version. It is claimed that they have fixed it now, but -// better check. -/////////////////////////////////////////////////////////////// -int vrpn_gettimeofday(timeval *tp, void *voidp) -{ -#ifndef _STRUCT_TIMEZONE -#define _STRUCT_TIMEZONE - /* from HP-UX */ - struct timezone { - int tz_minuteswest; /* minutes west of Greenwich */ - int tz_dsttime; /* type of dst correction */ - }; -#endif - struct timezone *tzp = (struct timezone *)voidp; - if (tp != NULL) { -#ifdef _WIN32_WCE - unsigned long sec, usec; - get_time_using_GetLocalTime(sec, usec); - tp->tv_sec = sec; - tp->tv_usec = usec; -#else - struct _timeb t; - _ftime(&t); - tp->tv_sec = t.time; - tp->tv_usec = (long)t.millitm * 1000; -#endif - } - if (tzp != NULL) { - TIME_ZONE_INFORMATION tz; - GetTimeZoneInformation(&tz); - tzp->tz_minuteswest = tz.Bias; - tzp->tz_dsttime = (tz.StandardBias != tz.Bias); - } - return 0; -} - -#endif // defined(_WIN32) - -#else // In the case that VRPN_UNSAFE_WINDOWS_CLOCK is defined - -// Although VC++ doesn't include a gettimeofday -// call, Cygnus Solutions Cygwin32 environment does. -// XXX AND ITS WRONG in the current release 10/11/99, version b20.1 -// They claim it will be fixed in the next release, version b21 -// so until then, we will make it right using our solution. -#if defined(_WIN32) && !defined(__CYGWIN__) -#include <math.h> // for floor, fmod - -// utility routines to read the pentium time stamp counter -// QueryPerfCounter drifts too much -- others have documented this -// problem on the net - -// This is all based on code extracted from the UNC hiball tracker cib lib - -// 200 mhz pentium default -- we change this based on our calibration -static __int64 VRPN_CLOCK_FREQ = 200000000; - -// Helium to histidine -// __int64 FREQUENCY = 199434500; - -// tori -- but queryperfcounter returns this for us -// __int64 FREQUENCY = 198670000; - -// Read Time Stamp Counter -#define rdtsc(li) \ - { \ - _asm _emit 0x0f _asm _emit 0x31 _asm mov li.LowPart, \ - eax _asm mov li.HighPart, edx \ - } - -/* - * calculate the time stamp counter register frequency (clock freq) - */ -#ifndef VRPN_WINDOWS_CLOCK_V2 -#pragma optimize("", off) -static int vrpn_AdjustFrequency(void) -{ - const int loops = 2; - const int tPerLoop = 500; // milliseconds for Sleep() - fprintf(stderr, "vrpn vrpn_gettimeofday: determining clock frequency..."); - - LARGE_INTEGER startperf, endperf; - LARGE_INTEGER perffreq; - - // See if the hardware supports the high-resolution performance counter. - // If so, get the frequency of it. If not, we can't use it and so return - // -1. - if (QueryPerformanceFrequency(&perffreq) == 0) { - return -1; - } - - // don't optimize away these variables - double sum = 0; - volatile LARGE_INTEGER liStart, liEnd; - - DWORD dwPriorityClass = GetPriorityClass(GetCurrentProcess()); - int iThreadPriority = GetThreadPriority(GetCurrentThread()); - SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS); - SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); - - // pull all into cache and do rough test to see if tsc and perf counter - // are one and the same - rdtsc(liStart); - QueryPerformanceCounter(&startperf); - Sleep(100); - rdtsc(liEnd); - QueryPerformanceCounter(&endperf); - - double freq = perffreq.QuadPart * (liEnd.QuadPart - liStart.QuadPart) / - ((double)(endperf.QuadPart - startperf.QuadPart)); - - if (fabs(perffreq.QuadPart - freq) < 0.05 * freq) { - VRPN_CLOCK_FREQ = (__int64)perffreq.QuadPart; - fprintf(stderr, "\nvrpn vrpn_gettimeofday: perf clock is tsc -- using " - "perf clock freq ( %lf MHz)\n", - perffreq.QuadPart / 1e6); - SetPriorityClass(GetCurrentProcess(), dwPriorityClass); - SetThreadPriority(GetCurrentThread(), iThreadPriority); - return 0; - } - - // either tcs and perf clock are not the same, or we could not - // tell accurately enough with the short test. either way we now - // need an accurate frequency measure, so ... - - fprintf(stderr, " (this will take %lf seconds)...\n", - loops * tPerLoop / 1000.0); - - for (int j = 0; j < loops; j++) { - rdtsc(liStart); - QueryPerformanceCounter(&startperf); - Sleep(tPerLoop); - rdtsc(liEnd); - QueryPerformanceCounter(&endperf); - - // perf counter timer ran for one call to Query and one call to - // tcs read in addition to the time between the tsc readings - // tcs read did the same - - // endperf - startperf / perf freq = time between perf queries - // endtsc - starttsc = clock ticks between perf queries - // sum += (endtsc - starttsc) / ((double)(endperf - - // startperf)/perffreq); - sum += perffreq.QuadPart * (liEnd.QuadPart - liStart.QuadPart) / - ((double)(endperf.QuadPart - startperf.QuadPart)); - } - - SetPriorityClass(GetCurrentProcess(), dwPriorityClass); - SetThreadPriority(GetCurrentThread(), iThreadPriority); - - // might want last, not sum -- just get into cache and run - freq = (sum / loops); - - // if we are on a uniprocessor system, then use the freq estimate - // This used to check against a 200 mhz assumed clock, but now - // we assume the routine works and trust the result. - // if (fabs(freq - VRPN_CLOCK_FREQ) > 0.05 * VRPN_CLOCK_FREQ) { - // cerr << "vrpn vrpn_gettimeofday: measured freq is " << freq/1e6 - // << " MHz - DOES NOT MATCH" << endl; - // return -1; - // } - - // if we are in a system where the perf clock is the tsc, then use the - // rate the perf clock returns (or rather, if the freq we measure is - // approx the perf clock freq). - if (fabs(perffreq.QuadPart - freq) < 0.05 * freq) { - VRPN_CLOCK_FREQ = perffreq.QuadPart; - fprintf(stderr, "vrpn vrpn_gettimeofday: perf clock is tsc -- using " - "perf clock freq ( %lf MHz)\n", - perffreq.QuadPart / 1e6); - } - else { - fprintf(stderr, "vrpn vrpn_gettimeofday: adjusted clock freq to " - "measured freq ( %lf MHz )\n", - freq / 1e6); - } - VRPN_CLOCK_FREQ = (__int64)freq; - return 0; -} -#pragma optimize("", on) -#endif - -// The pc has no gettimeofday call, and the closest thing to it is _ftime. -// _ftime, however, has only about 6 ms resolution, so we use the peformance -// as an offset from a base time which is established by a call to by _ftime. - -// The first call to vrpn_gettimeofday will establish a new time frame -// on which all later calls will be based. This means that the time returned -// by vrpn_gettimeofday will not always match _ftime (even at _ftime's -// resolution), -// but it will be consistent across all vrpn_gettimeofday calls. - -/////////////////////////////////////////////////////////////// -// Although VC++ doesn't include a gettimeofday -// call, Cygnus Solutions Cygwin32 environment does, -// so this is not used when compiling with gcc under WIN32 - -// XXX AND ITS WRONG in the current release 10/11/99 -// They claim it will be fixed in the next release, -// so until then, we will make it right using our solution. -/////////////////////////////////////////////////////////////// -#ifndef VRPN_WINDOWS_CLOCK_V2 -int vrpn_gettimeofday(timeval *tp, void *voidp) -{ - static int fFirst = 1; - static int fHasPerfCounter = 1; - static struct _timeb tbInit; - static LARGE_INTEGER liInit; - static LARGE_INTEGER liNow; - static LARGE_INTEGER liDiff; - timeval tvDiff; - -#ifndef _STRUCT_TIMEZONE -#define _STRUCT_TIMEZONE - /* from HP-UX */ - struct timezone { - int tz_minuteswest; /* minutes west of Greenwich */ - int tz_dsttime; /* type of dst correction */ - }; -#endif - struct timezone *tzp = (struct timezone *)voidp; - - if (!fHasPerfCounter) { - _ftime(&tbInit); - tp->tv_sec = tbInit.time; - tp->tv_usec = tbInit.millitm * 1000; - return 0; - } - - if (fFirst) { - LARGE_INTEGER liTemp; - // establish a time base - fFirst = 0; - - // Check to see if we are on a Windows NT machine (as opposed to a - // Windows 95/98 machine). If we are not, then use the _ftime code - // because the hi-perf clock does not work under Windows 98SE on my - // laptop, although the query for one seems to indicate that it is - // available. - - { - OSVERSIONINFO osvi; - - memset(&osvi, 0, sizeof(OSVERSIONINFO)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&osvi); - - if (osvi.dwPlatformId != VER_PLATFORM_WIN32_NT) { - fprintf(stderr, - "\nvrpn_gettimeofday: disabling hi performance clock " - "on non-NT system. " - "Defaulting to _ftime (~6 ms resolution) ...\n"); - fHasPerfCounter = 0; - vrpn_gettimeofday(tp, tzp); - return 0; - } - } - - // check that hi-perf clock is available - if (!(fHasPerfCounter = QueryPerformanceFrequency(&liTemp))) { - fprintf(stderr, - "\nvrpn_gettimeofday: no hi performance clock available. " - "Defaulting to _ftime (~6 ms resolution) ...\n"); - fHasPerfCounter = 0; - vrpn_gettimeofday(tp, tzp); - return 0; - } - - if (vrpn_AdjustFrequency() < 0) { - fprintf(stderr, - "\nvrpn_gettimeofday: can't verify clock frequency. " - "Defaulting to _ftime (~6 ms resolution) ...\n"); - fHasPerfCounter = 0; - vrpn_gettimeofday(tp, tzp); - return 0; - } - // get current time - // We assume this machine has a time stamp counter register -- - // I don't know of an easy way to check for this - rdtsc(liInit); - _ftime(&tbInit); - - // we now consider it to be exactly the time _ftime returned - // (beyond the resolution of _ftime, down to the perfCounter res) - } - - // now do the regular get time call to get the current time - rdtsc(liNow); - - // find offset from initial value - liDiff.QuadPart = liNow.QuadPart - liInit.QuadPart; - - tvDiff.tv_sec = (long)(liDiff.QuadPart / VRPN_CLOCK_FREQ); - tvDiff.tv_usec = - (long)(1e6 * ((liDiff.QuadPart - VRPN_CLOCK_FREQ * tvDiff.tv_sec) / - (double)VRPN_CLOCK_FREQ)); - - // pack the value and clean it up - tp->tv_sec = tbInit.time + tvDiff.tv_sec; - tp->tv_usec = tbInit.millitm * 1000 + tvDiff.tv_usec; - while (tp->tv_usec >= 1000000) { - tp->tv_sec++; - tp->tv_usec -= 1000000; - } - - return 0; -} -#else // defined(VRPN_WINDOWS_CLOCK_V2) - -void get_time_using_GetLocalTime(unsigned long &sec, unsigned long &usec) -{ - static LARGE_INTEGER first_count = {0, 0}; - static unsigned long first_sec, first_usec; - static LARGE_INTEGER perf_freq; //< Frequency of the performance counter. - SYSTEMTIME stime; // System time in funky structure - FILETIME ftime; // Time in 100-nsec intervals since Jan 1 1601 - LARGE_INTEGER tics; // ftime stored into a 64-bit quantity - LARGE_INTEGER perf_counter; - - // The first_count value will be zero only the first time through; we - // rely on this to set up the structures needed to interpret the data - // that we get from querying the performance counter. - if (first_count.QuadPart == 0) { - QueryPerformanceCounter(&first_count); - - // Find out how fast the performance counter runs. Store this for later - // runs. - QueryPerformanceFrequency(&perf_freq); - - // Find out what time it is in a Windows structure. - GetLocalTime(&stime); - SystemTimeToFileTime(&stime, &ftime); - - // Copy the data into a structure that can be treated as a 64-bit - // integer - tics.HighPart = ftime.dwHighDateTime; - tics.LowPart = ftime.dwLowDateTime; - - // Convert the 64-bit time into seconds and microseconds since July 1 - // 1601 - sec = (long)(tics.QuadPart / 10000000L); - usec = (long)((tics.QuadPart - (((LONGLONG)(sec)) * 10000000L)) / 10); - first_sec = sec; - first_usec = usec; - } - else { - QueryPerformanceCounter(&perf_counter); - if (perf_counter.QuadPart >= first_count.QuadPart) { - perf_counter.QuadPart = - perf_counter.QuadPart - first_count.QuadPart; - } - else { - // Take care of the case when the counter rolls over. - perf_counter.QuadPart = 0x7fffffffffffffffLL - - first_count.QuadPart + - perf_counter.QuadPart; - } - - // Reinterpret the performance counter into seconds and microseconds - // by dividing by the performance counter. Microseconds is placed - // into perf_counter by subtracting the seconds value out, then - // multiplying by 1 million and re-dividing by the performance counter. - sec = (long)(perf_counter.QuadPart / perf_freq.QuadPart); - perf_counter.QuadPart -= perf_freq.QuadPart * sec; - perf_counter.QuadPart *= 1000000L; //< Turn microseconds into seconds - usec = first_usec + (long)(perf_counter.QuadPart / perf_freq.QuadPart); - sec += first_sec; - - // Make sure that we've not got more than a million microseconds. - // If so, then shift it into seconds. We don't expect it to be above - // more than 1 million because we added two things, each of which were - // less than 1 million. - if (usec > 1000000L) { - usec -= 1000000L; - sec++; - } - } - - // Translate the time to be based on January 1, 1970 (_ftime base) - // The offset here is gotten by using the "time_test" program to report the - // difference in seconds between the two clocks. - sec -= 3054524608L; -} - -int vrpn_gettimeofday(timeval *tp, void *voidp) -{ -#ifndef _STRUCT_TIMEZONE -#define _STRUCT_TIMEZONE - /* from HP-UX */ - struct timezone { - int tz_minuteswest; /* minutes west of Greenwich */ - int tz_dsttime; /* type of dst correction */ - }; -#endif - struct timezone *tzp = (struct timezone *)voidp; - - unsigned long sec, usec; - get_time_using_GetLocalTime(sec, usec); - tp->tv_sec = sec; - tp->tv_usec = usec; - if (tzp != NULL) { - TIME_ZONE_INFORMATION tz; - GetTimeZoneInformation(&tz); - tzp->tz_minuteswest = tz.Bias; - tzp->tz_dsttime = (tz.StandardBias != tz.Bias); - } - return 0; -} - -#endif // defined(VRPN_WINDOWS_CLOCK_V2) - -#endif // defined(_WIN32) - -// do the calibration before the program ever starts up -static timeval __tv; -static int __iTrash = vrpn_gettimeofday(&__tv, (struct timezone *)NULL); - -#endif // VRPN_UNSAFE_WINDOWS_CLOCK - -#include <stdio.h> // for fprintf, stderr, perror, etc -#include <string.h> // for memcpy, strlen, strcpy, etc -#ifndef _WIN32 -#include <errno.h> // for EAGAIN, errno -#include <signal.h> // for pthread_kill, SIGKILL -#endif - -#define ALL_ASSERT(exp, msg) \ - if (!(exp)) { \ - fprintf(stderr, "\nAssertion failed! \n %s (%s, %d)\n", msg, __FILE__, \ - __LINE__); \ - } - -// init all fields in init() -vrpn_Semaphore::vrpn_Semaphore(int cNumResources) - : cResources(cNumResources) -{ - init(); -} - -// create a new internal structure for the semaphore -// (binary copy is not ok) -// This does not copy the state of the semaphore -vrpn_Semaphore::vrpn_Semaphore(const vrpn_Semaphore &s) - : cResources(s.cResources) -{ - init(); -} - -bool vrpn_Semaphore::init() -{ -#ifdef sgi - if (vrpn_Semaphore::ppaArena == NULL) { - vrpn_Semaphore::allocArena(); - } - if (cResources == 1) { - fUsingLock = true; - ps = NULL; - // use lock instead of semaphore - if ((l = usnewlock(vrpn_Semaphore::ppaArena)) == NULL) { - fprintf(stderr, "vrpn_Semaphore::vrpn_Semaphore: error allocating " - "lock from arena.\n"); - return false; - } - } - else { - fUsingLock = false; - l = NULL; - if ((ps = usnewsema(vrpn_Semaphore::ppaArena, cResources)) == NULL) { - fprintf(stderr, "vrpn_Semaphore::vrpn_Semaphore: error allocating " - "semaphore from arena.\n"); - return false; - } - } -#elif defined(_WIN32) - // args are security, initial count, max count, and name - // TCH 20 Feb 2001 - Make the PC behavior closer to the SGI behavior. - int numMax = cResources; - if (numMax < 1) { - numMax = 1; - } - hSemaphore = CreateSemaphore(NULL, cResources, numMax, NULL); - if (!hSemaphore) { - // get error info from windows (from FormatMessage help page) - LPVOID lpMsgBuf; - - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, - GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - // Default language - (LPTSTR)&lpMsgBuf, 0, NULL); - fprintf(stderr, - "vrpn_Semaphore::vrpn_Semaphore: error creating semaphore, " - "WIN32 CreateSemaphore call caused the following error: %s\n", - (LPTSTR)lpMsgBuf); - // Free the buffer. - LocalFree(lpMsgBuf); - return false; - } -#elif defined(__APPLE__) - // We need to use sem_open on the mac because sem_init is not implemented - int numMax = cResources; - if (numMax < 1) { - numMax = 1; - } - char *tempname = new char[100]; - sprintf(tempname, "/tmp/vrpn_sem.XXXXXXX"); - semaphore = sem_open(mktemp(tempname), O_CREAT, 0600, numMax); - if (semaphore == SEM_FAILED) { - perror("vrpn_Semaphore::vrpn_Semaphore: error opening semaphore"); - delete[] tempname; - return false; - } - delete[] tempname; -#else - // Posix threads are the default. - // We use sem_init on linux (instead of sem_open). - int numMax = cResources; - if (numMax < 1) { - numMax = 1; - } - semaphore = new sem_t; - if (sem_init(semaphore, 0, numMax) != 0) { - perror("vrpn_Semaphore::vrpn_Semaphore: error initializing semaphore"); - return false; - } -#endif - - return true; -} - -bool vrpn_Semaphore::destroy() -{ -#ifdef sgi - if (fUsingLock) { - usfreelock(l, vrpn_Semaphore::ppaArena); - } - else { - usfreesema(ps, vrpn_Semaphore::ppaArena); - } -#elif defined(_WIN32) - if (!CloseHandle(hSemaphore)) { - // get error info from windows (from FormatMessage help page) - LPVOID lpMsgBuf; - - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, - GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - // Default language - (LPTSTR)&lpMsgBuf, 0, NULL); - fprintf(stderr, - "vrpn_Semaphore::destroy: error destroying semaphore, " - "WIN32 CloseHandle call caused the following error: %s\n", - (LPTSTR)lpMsgBuf); - // Free the buffer. - LocalFree(lpMsgBuf); - return false; - } -#else -// Posix threads are the default. -#ifdef __APPLE__ - if (sem_close(semaphore) != 0) { - perror("vrpn_Semaphore::destroy: error destroying semaphore."); - return false; - } -#else - if (sem_destroy(semaphore) != 0) { - fprintf(stderr, - "vrpn_Semaphore::destroy: error destroying semaphore.\n"); - return false; - } - delete semaphore; -#endif - semaphore = NULL; -#endif - return true; -} - -vrpn_Semaphore::~vrpn_Semaphore() -{ - if (!destroy()) { - fprintf( - stderr, - "vrpn_Semaphore::~vrpn_Semaphore: error destroying semaphore.\n"); - } -} - -// routine to reset it -bool vrpn_Semaphore::reset(int cNumResources) -{ - cResources = cNumResources; - - // Destroy the old semaphore and then create a new one with the correct - // value. - if (!destroy()) { - fprintf(stderr, "vrpn_Semaphore::reset: error destroying semaphore.\n"); - return false; - } - if (!init()) { - fprintf(stderr, - "vrpn_Semaphore::reset: error initializing semaphore.\n"); - return false; - } - return true; -} - -// routines to use it (p blocks, cond p does not) -// 1 on success, -1 fail -int vrpn_Semaphore::p() -{ -#ifdef sgi - if (fUsingLock) { - if (ussetlock(l) != 1) { - perror("vrpn_Semaphore::p: ussetlock:"); - return -1; - } - } - else { - if (uspsema(ps) != 1) { - perror("vrpn_Semaphore::p: uspsema:"); - return -1; - } - } -#elif defined(_WIN32) - switch (WaitForSingleObject(hSemaphore, INFINITE)) { - case WAIT_OBJECT_0: - // got the resource - break; - case WAIT_TIMEOUT: - ALL_ASSERT(0, "vrpn_Semaphore::p: infinite wait time timed out!"); - return -1; - break; - case WAIT_ABANDONED: - ALL_ASSERT(0, "vrpn_Semaphore::p: thread holding resource died"); - return -1; - break; - case WAIT_FAILED: - // get error info from windows (from FormatMessage help page) - LPVOID lpMsgBuf; - - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, - GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - // Default language - (LPTSTR)&lpMsgBuf, 0, NULL); - fprintf(stderr, - "vrpn_Semaphore::p: error waiting for resource, " - "WIN32 WaitForSingleObject call caused the following error: %s", - (LPTSTR)lpMsgBuf); - // Free the buffer. - LocalFree(lpMsgBuf); - return -1; - break; - default: - ALL_ASSERT(0, "vrpn_Semaphore::p: unknown return code"); - return -1; - } -#else - // Posix by default - if (sem_wait(semaphore) != 0) { - perror("vrpn_Semaphore::p: "); - return -1; - } -#endif - return 1; -} - -// 0 on success, -1 fail -int vrpn_Semaphore::v() -{ -#ifdef sgi - if (fUsingLock) { - if (usunsetlock(l)) { - perror("vrpn_Semaphore::v: usunsetlock:"); - return -1; - } - } - else { - if (usvsema(ps)) { - perror("vrpn_Semaphore::v: uspsema:"); - return -1; - } - } -#elif defined(_WIN32) - if (!ReleaseSemaphore(hSemaphore, 1, NULL)) { - // get error info from windows (from FormatMessage help page) - LPVOID lpMsgBuf; - - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, - GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - // Default language - (LPTSTR)&lpMsgBuf, 0, NULL); - fprintf(stderr, - "vrpn_Semaphore::v: error v'ing semaphore, " - "WIN32 ReleaseSemaphore call caused the following error: %s", - (LPTSTR)lpMsgBuf); - // Free the buffer. - LocalFree(lpMsgBuf); - return -1; - } -#else - // Posix by default - if (sem_post(semaphore) != 0) { - perror("vrpn_Semaphore::p: "); - return -1; - } -#endif - return 0; -} - -// 0 if it can't get the resource, 1 if it can -// -1 if fail -int vrpn_Semaphore::condP() -{ - int iRetVal = 1; -#ifdef sgi - if (fUsingLock) { - // don't spin at all - iRetVal = uscsetlock(l, 0); - if (iRetVal <= 0) { - perror("vrpn_Semaphore::condP: uscsetlock:"); - return -1; - } - } - else { - iRetVal = uscpsema(ps); - if (iRetVal <= 0) { - perror("vrpn_Semaphore::condP: uscpsema:"); - return -1; - } - } -#elif defined(_WIN32) - switch (WaitForSingleObject(hSemaphore, 0)) { - case WAIT_OBJECT_0: - // got the resource - break; - case WAIT_TIMEOUT: - // resource not free - iRetVal = 0; - break; - case WAIT_ABANDONED: - ALL_ASSERT(0, "vrpn_Semaphore::condP: thread holding resource died"); - return -1; - break; - case WAIT_FAILED: - // get error info from windows (from FormatMessage help page) - LPVOID lpMsgBuf; - - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, - GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - // Default language - (LPTSTR)&lpMsgBuf, 0, NULL); - fprintf(stderr, - "Semaphore::condP: error waiting for resource, " - "WIN32 WaitForSingleObject call caused the following error: %s", - (LPTSTR)lpMsgBuf); - // Free the buffer. - LocalFree(lpMsgBuf); - return -1; - break; - default: - ALL_ASSERT(0, "vrpn_Semaphore::p: unknown return code"); - return -1; - } -#else - // Posix by default - iRetVal = sem_trywait(semaphore); - if (iRetVal == 0) { - iRetVal = 1; - } - else if (errno == EAGAIN) { - iRetVal = 0; - } - else { - perror("vrpn_Semaphore::condP: "); - iRetVal = -1; - } -#endif - return iRetVal; -} - -int vrpn_Semaphore::numResources() { return cResources; } - -// static var definition -#ifdef sgi -usptr_t *vrpn_Semaphore::ppaArena = NULL; - -#include <sys/stat.h> -// for umask stuff -#include <sys/types.h> -#include <sys/stat.h> - -void vrpn_Semaphore::allocArena() -{ - // /dev/zero is a special file which can only be shared between - // processes/threads which share file descriptors. - // It never shows up in the file system. - if ((ppaArena = usinit("/dev/zero")) == NULL) { - perror("vrpn_Thread::allocArena: usinit:"); - } -} -#endif - -vrpn_Thread::vrpn_Thread(void (*pfThreadparm)(vrpn_ThreadData &ThreadData), - vrpn_ThreadData tdparm) - : pfThread(pfThreadparm) - , td(tdparm) - , threadID(0) -{ -} - -bool vrpn_Thread::go() -{ - if (threadID != 0) { - fprintf(stderr, "vrpn_Thread::go: already running\n"); - return false; - } - -#ifdef sgi - if ((threadID = sproc(&threadFuncShell, PR_SALL, this)) == - ((unsigned long)-1)) { - perror("vrpn_Thread::go: sproc"); - return false; - } -// Threads not defined for the CYGWIN environment yet... -#elif defined(_WIN32) && !defined(__CYGWIN__) - // pass in func, let it pick stack size, and arg to pass to thread - if ((threadID = _beginthread(&threadFuncShell, 0, this)) == - ((unsigned long)-1)) { - perror("vrpn_Thread::go: _beginthread"); - return false; - } -#else - // Pthreads by default - if (pthread_create(&threadID, NULL, &threadFuncShellPosix, this) != 0) { - perror("vrpn_Thread::go:pthread_create: "); - return false; - } -#endif - return true; -} - -bool vrpn_Thread::kill() -{ -// kill the os thread -#if defined(sgi) || defined(_WIN32) - if (threadID > 0) { -#ifdef sgi - if (::kill((long)threadID, SIGKILL) < 0) { - perror("vrpn_Thread::kill: kill:"); - return false; - } -#elif defined(_WIN32) - // Return value of -1 passed to TerminateThread causes a warning. - if (!TerminateThread((HANDLE)threadID, 1)) { - fprintf(stderr, - "vrpn_Thread::kill: problem with terminateThread call.\n"); - return false; - } -#endif -#else - if (threadID) { - // Posix by default. Detach so that the thread's resources will be - // freed automatically when it is killed. - if (pthread_detach(threadID) != 0) { - perror("vrpn_Thread::kill:pthread_detach: "); - return false; - } - if (pthread_kill(threadID, SIGKILL) != 0) { - perror("vrpn_Thread::kill:pthread_kill: "); - return false; - } -#endif - } - else { - fprintf(stderr, "vrpn_Thread::kill: thread is not currently alive.\n"); - return false; - } - threadID = 0; - return true; -} - -bool vrpn_Thread::running() { return threadID != 0; } - -vrpn_Thread::thread_t vrpn_Thread::pid() { return threadID; } - -bool vrpn_Thread::available() -{ -#ifdef vrpn_THREADS_AVAILABLE - return true; -#else - return false; -#endif -} - -void vrpn_Thread::userData(void *pvNewUserData) { td.pvUD = pvNewUserData; } - -void *vrpn_Thread::userData() { return td.pvUD; } - -void vrpn_Thread::threadFuncShell(void *pvThread) -{ - vrpn_Thread *pth = static_cast<vrpn_Thread *>(pvThread); - pth->pfThread(pth->td); - // thread has stopped running -#if !defined(sgi) && !defined(_WIN32) - // Pthreads; need to detach the thread so its resources will be freed. - if (pthread_detach(pth->threadID) != 0) { - perror("vrpn_Thread::threadFuncShell:pthread_detach: "); - } -#endif - pth->threadID = 0; -} - -// This is a Posix-compatible function prototype that -// just calls the other function. -void *vrpn_Thread::threadFuncShellPosix(void *pvThread) -{ - threadFuncShell(pvThread); - return NULL; -} - -vrpn_Thread::~vrpn_Thread() -{ - if (running()) { - kill(); - } -} - -// For the code to get the number of processor cores. -#ifdef __APPLE__ -#include <sys/param.h> -#include <sys/sysctl.h> -#endif - -unsigned vrpn_Thread::number_of_processors() -{ -#ifdef _WIN32 - // Copy the hardware information to the SYSTEM_INFO structure. - SYSTEM_INFO siSysInfo; - GetSystemInfo(&siSysInfo); - return siSysInfo.dwNumberOfProcessors; -#elif linux - // For Linux, we look at the /proc/cpuinfo file and count up the number - // of "processor :" entries (tab between processor and colon) in - // the file to find out how many we have. - FILE *f = fopen("/proc/cpuinfo", "r"); - int count = 0; - if (f == NULL) { - perror("vrpn_Thread::number_of_processors:fopen: "); - return 1; - } - - char line[512]; - while (fgets(line, sizeof(line), f) != NULL) { - if (strncmp(line, "processor\t:", strlen("processor\t:")) == 0) { - count++; - } - } - - fclose(f); - if (count == 0) { - fprintf(stderr, - "vrpn_Thread::number_of_processors: Found zero, returning 1\n"); - count = 1; - } - return count; - -#elif __APPLE__ - int count; - size_t size = sizeof(count); - if (sysctlbyname("hw.ncpu", &count, &size, NULL, 0)) { - return 1; - } - else { - return static_cast<unsigned>(count); - } - -#else - fprintf(stderr, "vrpn_Thread::number_of_processors: Not yet implemented on " - "this architecture.\n"); - return 1; -#endif -} - -// Thread function to call from within vrpn_test_threads_and_semaphores(). -// In this case, the userdata pointer is a pointer to a semaphore that -// the thread should call v() on so that it will free up the main program -// thread. -static void vrpn_test_thread_body(vrpn_ThreadData &threadData) -{ - if (threadData.pvUD == NULL) { - fprintf(stderr, "vrpn_test_thread_body(): pvUD is NULL\n"); - return; - } - vrpn_Semaphore *s = static_cast<vrpn_Semaphore *>(threadData.pvUD); - s->v(); - - return; -} - -bool vrpn_test_threads_and_semaphores(void) -{ - //------------------------------------------------------------ - // Make a semaphore to test in single-threaded mode. First run its count - // all the way - // down to zero, then bring it back to the full complement and then bring it - // down - // again. Check that all of the semaphores are available and also that - // there are no - // more than expected available. - const unsigned sem_count = 5; - vrpn_Semaphore s(sem_count); - unsigned i; - for (i = 0; i < sem_count; i++) { - if (s.condP() != 1) { - fprintf(stderr, "vrpn_test_threads_and_semaphores(): Semaphore ran " - "out of counts\n"); - return false; - } - } - if (s.condP() != 0) { - fprintf(stderr, "vrpn_test_threads_and_semaphores(): Semaphore had too " - "many counts\n"); - return false; - } - for (i = 0; i < sem_count; i++) { - if (s.v() != 0) { - fprintf(stderr, "vrpn_test_threads_and_semaphores(): Could not " - "release Semaphore\n"); - return false; - } - } - for (i = 0; i < sem_count; i++) { - if (s.condP() != 1) { - fprintf(stderr, "vrpn_test_threads_and_semaphores(): Semaphore ran " - "out of counts, round 2\n"); - return false; - } - } - if (s.condP() != 0) { - fprintf(stderr, "vrpn_test_threads_and_semaphores(): Semaphore had too " - "many counts, round 2\n"); - return false; - } - - //------------------------------------------------------------ - // Get a semaphore and use it to construct a thread data structure and then - // a thread. Use that thread to test whether threading is enabled (if not, - // then - // this completes our testing) and to find out how many processors there - // are. - vrpn_ThreadData td; - td.pvUD = NULL; - vrpn_Thread t(vrpn_test_thread_body, td); - - // If threading is not enabled, then we're done. - if (!t.available()) { - return true; - } - - // Find out how many processors we have. - unsigned num_procs = t.number_of_processors(); - if (num_procs == 0) { - fprintf(stderr, "vrpn_test_threads_and_semaphores(): " - "vrpn_Thread::number_of_processors() returned zero\n"); - return false; - } - - //------------------------------------------------------------ - // Now make sure that we can actually run a thread. Do this by - // creating a semaphore with one entry and calling p() on it. - // Then make sure we can't p() it again and then run a thread - // that will call v() on it when it runs. - vrpn_Semaphore sem; - if (sem.p() != 1) { - fprintf(stderr, "vrpn_test_threads_and_semaphores(): thread-test " - "Semaphore had no count\n"); - return false; - } - if (sem.condP() != 0) { - fprintf(stderr, "vrpn_test_threads_and_semaphores(): thread-test " - "Semaphore had too many counts\n"); - return false; - } - t.userData(&sem); - if (!t.go()) { - fprintf(stderr, - "vrpn_test_threads_and_semaphores(): Could not start thread\n"); - return false; - } - struct timeval start; - struct timeval now; - vrpn_gettimeofday(&start, NULL); - while (true) { - if (sem.condP() == 1) { - // The thread must have run; we got the semaphore! - break; - } - - // Time out after three seconds if we haven't had the thread run to - // reset the semaphore. - vrpn_gettimeofday(&now, NULL); - struct timeval diff = vrpn_TimevalDiff(now, start); - if (diff.tv_sec >= 3) { - fprintf(stderr, - "vrpn_test_threads_and_semaphores(): Thread didn't run\n"); - return false; - } - - vrpn_SleepMsecs(1); - } - - return true; -} diff --git a/src/vrpn/vrpn_Shared.h b/src/vrpn/vrpn_Shared.h deleted file mode 100644 index c214ad930320c4636f20a814c134b7f60575ac29..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Shared.h +++ /dev/null @@ -1,613 +0,0 @@ -#pragma once - -// Horrible hack for old HPUX compiler -#ifdef hpux -#ifndef true -#define bool int -#define true 1 -#define false 0 -#endif -#endif - -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Types.h" // for vrpn_int32, vrpn_float64, etc -#include <string.h> // for memcpy() -#include <stdio.h> // for fprintf() - -#if defined(__ANDROID__) -#include <bitset> -#endif - -// IWYU pragma: no_include <bits/time.h> - -// Oct 2000: Sang-Uok changed because vrpn code was compiling but giving -// runtime errors with cygwin 1.1. I changed the code so it only uses unix -// code. I had to change includes in various files. - -// jan 2000: jeff changing the way sockets are used with cygwin. I made this -// change because I realized that we were using winsock stuff in some places, -// and cygwin stuff in others. Discovered this when our code wouldn't compile -// in cygwin-1.0 (but it did in cygwin-b20.1). - -// let's start with a clean slate -#undef VRPN_USE_WINSOCK_SOCKETS - -// Does cygwin use winsock sockets or unix sockets -//#define VRPN_CYGWIN_USES_WINSOCK_SOCKETS - -#if defined(_WIN32) && \ - (!defined(__CYGWIN__) || defined(VRPN_CYGWIN_USES_WINSOCK_SOCKETS)) -#define VRPN_USE_WINSOCK_SOCKETS -#endif - -#ifndef VRPN_USE_WINSOCK_SOCKETS -// On Win32, this constant is defined as ~0 (sockets are unsigned ints) -#define INVALID_SOCKET -1 -#define SOCKET int -#endif - -#if !(defined(_WIN32) && defined(VRPN_USE_WINSOCK_SOCKETS)) -#include <sys/select.h> // for select -#include <netinet/in.h> // for htonl, htons -#endif - -#ifdef _WIN32_WCE -#define perror(x) fprintf(stderr, "%s\n", x); -#endif - -// comment from vrpn_Connection.h reads : -// -// gethostbyname() fails on SOME Windows NT boxes, but not all, -// if given an IP octet string rather than a true name. -// Until we figure out WHY, we have this extra clause in here. -// It probably wouldn't hurt to enable it for non-NT systems -// as well. -#ifdef _WIN32 -#define VRPN_USE_WINDOWS_GETHOSTBYNAME_HACK -#endif - -//-------------------------------------------------------------- -// Timeval defines. These are a bit hairy. The basic problem is -// that Windows doesn't implement gettimeofday(), nor does it -// define "struct timezone", although Winsock.h does define -// "struct timeval". The painful solution has been to define a -// vrpn_gettimeofday() function that takes a void * as a second -// argument (the timezone) and have all VRPN code call this function -// rather than gettimeofday(). On non-WINSOCK implementations, -// we alias vrpn_gettimeofday() right back to gettimeofday(), so -// that we are calling the system routine. On Windows, we will -// be using vrpn_gettimofday(). So far so good, but now user code -// would like to not have to know the difference under windows, so -// we have an optional VRPN configuration setting in vrpn_Configure.h -// that exports vrpn_gettimeofday() as gettimeofday() and also -// exports a "struct timezone" definition. Yucky, but it works and -// lets user code use the VRPN one as if it were the system call -// on Windows. - -#if (!defined(VRPN_USE_WINSOCK_SOCKETS)) -#include <sys/time.h> // for timeval, timezone, gettimeofday -#define vrpn_gettimeofday gettimeofday -#else // winsock sockets - -// These are a pair of horrible hacks that instruct Windows include -// files to (1) not define min() and max() in a way that messes up -// standard-library calls to them, and (2) avoids pulling in a large -// number of Windows header files. They are not used directly within -// the VRPN library, but rather within the Windows include files to -// change the way they behave. - -#ifndef NOMINMAX -#define NOMINMAX -#endif -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include <windows.h> -#ifndef _WIN32_WCE -#include <sys/timeb.h> -#endif -#ifdef VRPN_USE_WINSOCK2 -#include <winsock2.h> // struct timeval is defined here -#else -#include <winsock.h> // struct timeval is defined here -#endif - -// Whether or not we export gettimeofday, we declare the -// vrpn_gettimeofday() function. -extern "C" VRPN_API int vrpn_gettimeofday(struct timeval *tp, void *tzp); - -// If compiling under Cygnus Solutions Cygwin then these get defined by -// including sys/time.h. So, we will manually define only for _WIN32 -// Only do this if the Configure file has set VRPN_EXPORT_GETTIMEOFDAY, -// so that application code can get at it. All VRPN routines should be -// calling vrpn_gettimeofday() directly. - -#if defined(VRPN_EXPORT_GETTIMEOFDAY) && !defined(_STRUCT_TIMEZONE) && \ - !defined(_TIMEZONE_DEFINED) -#define _TIMEZONE_DEFINED -/* from HP-UX */ -struct timezone { - int tz_minuteswest; /* minutes west of Greenwich */ - int tz_dsttime; /* type of dst correction */ -}; -#endif -#if defined(VRPN_EXPORT_GETTIMEOFDAY) && !defined(_STRUCT_TIMEZONE) -#define _STRUCT_TIMEZONE - -// manually define this too. _WIN32 sans cygwin doesn't have gettimeofday -#define gettimeofday vrpn_gettimeofday - -#endif -#endif - -//-------------------------------------------------------------- -// vrpn_* timeval utility functions - -// IMPORTANT: timevals must be normalized to make any sense -// -// * normalized means abs(tv_usec) is less than 1,000,000 -// -// * TimevalSum and TimevalDiff do not do the right thing if -// their inputs are not normalized -// -// * TimevalScale now normalizes it's results [9/1999 it didn't before] - -// make sure tv_usec is less than 1,000,000 -extern VRPN_API struct timeval vrpn_TimevalNormalize(const struct timeval &tv); - -extern VRPN_API struct timeval vrpn_TimevalSum(const struct timeval &tv1, - const struct timeval &tv2); -extern VRPN_API struct timeval vrpn_TimevalDiff(const struct timeval &tv1, - const struct timeval &tv2); -extern VRPN_API struct timeval vrpn_TimevalScale(const struct timeval &tv, - double scale); - -/// @brief Return number of microseconds between startT and endT. -extern VRPN_API unsigned long vrpn_TimevalDuration(struct timeval endT, - struct timeval startT); - -/// @brief Return the number of seconds between startT and endT as a -/// floating-point value. -extern VRPN_API double vrpn_TimevalDurationSeconds(struct timeval endT, - struct timeval startT); - -extern VRPN_API bool vrpn_TimevalGreater(const struct timeval &tv1, - const struct timeval &tv2); -extern VRPN_API bool vrpn_TimevalEqual(const struct timeval &tv1, - const struct timeval &tv2); - -extern VRPN_API double vrpn_TimevalMsecs(const struct timeval &tv1); - -extern VRPN_API struct timeval vrpn_MsecsTimeval(const double dMsecs); -extern VRPN_API void vrpn_SleepMsecs(double dMsecs); - -//-------------------------------------------------------------- -// vrpn_* buffer util functions and endian-ness related -// definitions and functions. - -// xform a double to/from network order -- like htonl and htons -extern VRPN_API vrpn_float64 vrpn_htond(vrpn_float64 d); -extern VRPN_API vrpn_float64 vrpn_ntohd(vrpn_float64 d); - -// From this we get the variable "vrpn_big_endian" set to true if the machine we -// are -// on is big endian and to false if it is little endian. This can be used by -// custom packing and unpacking code to bypass the buffer and unbuffer routines -// for cases that have to be particularly fast (like video data). It is also -// used -// internally by the vrpn_htond() function. - -static const int vrpn_int_data_for_endian_test = 1; -static const char *vrpn_char_data_for_endian_test = - (char *)(void *)(&vrpn_int_data_for_endian_test); -static const bool vrpn_big_endian = (vrpn_char_data_for_endian_test[0] != 1); - -// Read and write strings (not single items). -extern VRPN_API int vrpn_buffer(char **insertPt, vrpn_int32 *buflen, - const char *string, vrpn_int32 length); -extern VRPN_API int vrpn_unbuffer(const char **buffer, char *string, - vrpn_int32 length); - -// Read and write timeval. -extern VRPN_API int vrpn_unbuffer(const char **buffer, timeval *t); -extern VRPN_API int vrpn_buffer(char **insertPt, vrpn_int32 *buflen, - const timeval t); - -// To read and write the atomic types defined in vrpn_Types, you use the -// templated -// buffer and unbuffer routines below. These have the same form as the ones for -// timeval, but they use types vrpn_int, vrpn_uint, vrpn_int16, vrpn_uint16, -// vrpn_int32, vrpn_uint32, vrpn_float32, and vrpn_float64. - -/** - @brief Internal header providing unbuffering facilities for a number of - types. - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// Tested in the context of vrpn_server and vrpn_print_devices running between -// an SGI running Irix 6.5 MIPS 32-bit (big endian) and Mac OSX intel 64-bit -// (little endian) machine with a NULL tracker and it worked using the SGI -// repaired commits from 3/17/2012. - -/// @brief Contains overloaded hton() and ntoh() functions that forward -/// to their correctly-typed implementations. -namespace vrpn_byte_order { - namespace vrpn_detail { - /// Traits class to get the uint type of a given size - template <int TypeSize> struct uint_traits; - - template <> struct uint_traits<1> { - typedef vrpn_uint8 type; - }; - template <> struct uint_traits<2> { - typedef vrpn_uint16 type; - }; - template <> struct uint_traits<4> { - typedef vrpn_uint32 type; - }; - } // end of namespace vrpn_detail - - /// host to network byte order for 8-bit uints is a no-op - inline vrpn_uint8 hton(vrpn_uint8 hostval) { return hostval; } - - /// network to host byte order for 8-bit uints is a no-op - inline vrpn_uint8 ntoh(vrpn_uint8 netval) { return netval; } - - /// host to network byte order for 16-bit uints - inline vrpn_uint16 hton(vrpn_uint16 hostval) { return htons(hostval); } - - /// network to host byte order for 16-bit uints - inline vrpn_uint16 ntoh(vrpn_uint16 netval) { return ntohs(netval); } - - /// host to network byte order for 32-bit uints - inline vrpn_uint32 hton(vrpn_uint32 hostval) { return htonl(hostval); } - - /// network to host byte order for 32-bit uints - inline vrpn_uint32 ntoh(vrpn_uint32 netval) { return ntohl(netval); } - - /// host to network byte order for 64-bit floats, using vrpn_htond - inline vrpn_float64 hton(vrpn_float64 hostval) { return vrpn_htond(hostval); } - - /// network to host byte order for 64-bit floats, using vrpn_ntohd - inline vrpn_float64 ntoh(vrpn_float64 netval) { return vrpn_ntohd(netval); } - - /// Templated hton that type-puns to the same-sized uint type - /// as a fallback for those types not explicitly defined above. - template <typename T> inline T hton(T input) - { - union { - T asInput; - typename vrpn_detail::uint_traits<sizeof(T)>::type asInt; - } inVal, outVal; - inVal.asInput = input; - outVal.asInt = hton(inVal.asInt); - return outVal.asInput; - } - - /// Templated ntoh that type-puns to the same-sized uint type - /// as a fallback for those types not explicitly defined above. - template <typename T> inline T ntoh(T input) - { - union { - T asInput; - typename vrpn_detail::uint_traits<sizeof(T)>::type asInt; - } inVal, outVal; - inVal.asInput = input; - outVal.asInt = ntoh(inVal.asInt); - return outVal.asInput; - } -} // end of namespace vrpn_byte_order - -namespace vrpn_detail { - template <typename T> struct remove_const { - typedef T type; - }; - - template <typename T> struct remove_const<const T> { - typedef T type; - }; - - template <bool Condition> struct vrpn_static_assert { - }; - /// @brief Each static assertion needs its message in this enum, or it will - /// always fail. - template <> struct vrpn_static_assert<true> { - enum { SIZE_OF_BUFFER_ITEM_IS_NOT_ONE_BYTE }; - }; -} // end of namespace vrpn_detail - -#ifdef VRPN_USE_STATIC_ASSERTIONS -/// @brief Static assertion macro for limited sets of messages. -/// Inspired by http://eigen.tuxfamily.org/dox/TopicAssertions.html -#if defined(__GXX_EXPERIMENTAL_CXX0X__) || \ - (defined(_MSC_VER) && (_MSC_VER >= 1600)) -#define VRPN_STATIC_ASSERT(CONDITION, MESSAGE) \ - static_assert(CONDITION, #MESSAGE) -#else -#define VRPN_STATIC_ASSERT(CONDITION, MESSAGE) \ - (void)(::vrpn_detail::vrpn_static_assert<CONDITION>::MESSAGE) -#endif -#else -/// Fall back to normal asserts. -#include <assert.h> -#define VRPN_STATIC_ASSERT(CONDITION, MESSAGE) assert((CONDITION) && #MESSAGE) -#endif - -/// Function template to unbuffer values from a buffer stored in little- -/// endian byte order. Specify the type to extract T as a template parameter. -/// The templated buffer type ByteT will be deduced automatically. -/// The input pointer will be advanced past the unbuffered value. -template <typename T, typename ByteT> -static inline T vrpn_unbuffer_from_little_endian(ByteT *&input) -{ - using namespace vrpn_byte_order; - - VRPN_STATIC_ASSERT(sizeof(ByteT) == 1, SIZE_OF_BUFFER_ITEM_IS_NOT_ONE_BYTE); - - /// Union to allow type-punning - union { - typename ::vrpn_detail::remove_const<ByteT>::type bytes[sizeof(T)]; - T typed; - } value; - - /// Swap known little-endian into big-endian (aka network byte order) - for (unsigned int i = 0, j = sizeof(T) - 1; i < sizeof(T); ++i, --j) { - value.bytes[i] = input[j]; - } - - /// Advance input pointer - input += sizeof(T); - - /// return value in host byte order - return ntoh(value.typed); -} - -/// Function template to unbuffer values from a buffer stored in network -/// byte order. Specify the type to extract T as a template parameter. -/// The templated buffer type ByteT will be deduced automatically. -/// The input pointer will be advanced past the unbuffered value. -template <typename T, typename ByteT> inline T vrpn_unbuffer(ByteT *&input) -{ - using namespace vrpn_byte_order; - - VRPN_STATIC_ASSERT(sizeof(ByteT) == 1, SIZE_OF_BUFFER_ITEM_IS_NOT_ONE_BYTE); - - /// Union to allow type-punning and ensure alignment - union { - typename ::vrpn_detail::remove_const<ByteT>::type bytes[sizeof(T)]; - T typed; - } value; - - /// Copy bytes into union - memcpy(value.bytes, input, sizeof(T)); - - /// Advance input pointer - input += sizeof(T); - - /// return value in host byte order - return ntoh(value.typed); -} - -/// Function template to buffer values to a buffer stored in network -/// byte order. Specify the type to buffer T as a template parameter. -/// The templated buffer type ByteT will be deduced automatically. -/// The input pointer will be advanced past the unbuffered value. -template <typename T, typename ByteT> -inline int vrpn_buffer(ByteT **insertPt, vrpn_int32 *buflen, const T inVal) -{ - using namespace vrpn_byte_order; - - VRPN_STATIC_ASSERT(sizeof(ByteT) == 1, SIZE_OF_BUFFER_ITEM_IS_NOT_ONE_BYTE); - - if ((insertPt == NULL) || (buflen == NULL)) { - fprintf(stderr, "vrpn_buffer: NULL pointer\n"); - return -1; - } - - if (sizeof(T) > static_cast<size_t>(*buflen)) { - fprintf(stderr, "vrpn_buffer: buffer not large enough\n"); - return -1; - } - - /// Union to allow type-punning and ensure alignment - union { - typename ::vrpn_detail::remove_const<ByteT>::type bytes[sizeof(T)]; - T typed; - } value; - - /// Populate union in network byte order - value.typed = hton(inVal); - - /// Copy bytes into buffer - memcpy(*insertPt, value.bytes, sizeof(T)); - - /// Advance insert pointer - *insertPt += sizeof(T); - /// Decrement buffer length - *buflen -= sizeof(T); - - return 0; -} - -template <typename T, typename ByteT> -inline int vrpn_unbuffer(ByteT **input, T *lvalue) -{ - *lvalue = ::vrpn_unbuffer<T, ByteT>(*input); - return 0; -} - -// Semaphore and Thread classes derived from Hans Weber's classes from UNC. -// Don't let the existence of a Thread class fool you into thinking -// that VRPN is thread-safe. This and the Semaphore are included as -// building blocks towards making your own code thread-safe. They are -// here to enable the vrpn_Imager_Logger class to do its thing. - -#if defined(sgi) || (defined(_WIN32) && !defined(__CYGWIN__)) || \ - defined(linux) || defined(__APPLE__) -#define vrpn_THREADS_AVAILABLE -#else -#undef vrpn_THREADS_AVAILABLE -#endif - -// multi process stuff -#ifdef sgi -#include <task.h> -#include <ulocks.h> -#elif defined(_WIN32) -#include <process.h> -#else -#include <pthread.h> // for pthread_t -#include <semaphore.h> // for sem_t -#endif - -// make the SGI compile without tons of warnings -#ifdef sgi -#pragma set woff 1110, 1424, 3201 -#endif - -// and reset the warnings -#ifdef sgi -#pragma reset woff 1110, 1424, 3201 -#endif - -class VRPN_API vrpn_Semaphore { -public: - // mutex by default (0 is a sync primitive) - vrpn_Semaphore(int cNumResources = 1); - - // This does not copy the state of the semaphore, just creates - // a new one with the same resource count - vrpn_Semaphore(const vrpn_Semaphore &s); - ~vrpn_Semaphore(); - - // routine to reset it (true on success, false on failure) - // (may create new semaphore) - bool reset(int cNumResources = 1); - - // routines to use it (p blocks, condP does not) - // p returns 1 when it has acquired the resource, -1 on fail - // v returns 0 when it has released the resource, -1 on fail - // condP returns 0 if it could not access the resource - // and 1 if it could (-1 on fail) - int p(); - int v(); - int condP(); - - // read values - int numResources(); - -protected: - // common init and destroy routines - bool init(); - bool destroy(); - - int cResources; - -// arch specific details -#ifdef sgi - // single mem area for dynamically alloced shared mem - static usptr_t *ppaArena; - static void allocArena(); - - // the semaphore struct in the arena - usema_t *ps; - ulock_t l; - bool fUsingLock; -#elif defined(_WIN32) - HANDLE hSemaphore; -#else - sem_t *semaphore; // Posix -#endif -}; - -// A ptr to this struct will be passed to the -// thread function. The user data ptr will be in pvUD. -// (There used to be a non-functional semaphore object -// also in this structure, but it was removed. This leaves -// a struct with only one element, which is a pain but -// at least it doesn't break existing code. If we need -// to add something else later, there is a place for it. - -// The user should create and manage any semaphore needed -// to handle access control to the userdata. - -struct VRPN_API vrpn_ThreadData { - void *pvUD; -}; - -typedef void (*vrpn_THREAD_FUNC)(vrpn_ThreadData &threadData); - -// Don't let the existence of a Thread class fool you into thinking -// that VRPN is thread-safe. This and the Semaphore are included as -// building blocks towards making your own code thread-safe. They are -// here to enable the vrpn_Imager_Stream_Buffer class to do its thing. -class VRPN_API vrpn_Thread { -public: - // args are the routine to run in the thread - // a ThreadData struct which will be passed into - // the thread (it will be passed as a void *). - vrpn_Thread(vrpn_THREAD_FUNC pfThread, vrpn_ThreadData td); - ~vrpn_Thread(); - -#if defined(sgi) - typedef unsigned long thread_t; -#elif defined(_WIN32) - typedef uintptr_t thread_t; -#else - typedef pthread_t thread_t; -#endif - - // start/kill the thread (true on success, false on failure) - bool go(); - bool kill(); - - // thread info: check if running, get proc id - bool running(); - thread_t pid(); - - // run-time user function to test if threads are available - // (same value as #ifdef THREADS_AVAILABLE) - static bool available(); - - // Number of processors available on this machine. - static unsigned number_of_processors(); - - // This can be used to change the ThreadData user data ptr - // between calls to go (ie, when a thread object is used - // many times with different args). This will take - // effect the next time go() is called. - void userData(void *pvNewUserData); - void *userData(); - -protected: - // user func and data ptrs - void (*pfThread)(vrpn_ThreadData &ThreadData); - vrpn_ThreadData td; - - // utility func for calling the specified function. - static void threadFuncShell(void *pvThread); - - // Posix version of the utility function, makes the - // function prototype match. - static void *threadFuncShellPosix(void *pvThread); - - // the process id - thread_t threadID; -}; - -// Returns true if they work and false if they do not. -extern bool vrpn_test_threads_and_semaphores(void); diff --git a/src/vrpn/vrpn_SharedObject.C b/src/vrpn/vrpn_SharedObject.C deleted file mode 100644 index adf928c76fe84d7fddfb31858b279206a1a356e1..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_SharedObject.C +++ /dev/null @@ -1,1494 +0,0 @@ -#include <stdio.h> // for fprintf, stderr, sprintf -#include <string.h> // for NULL, strcpy, strlen, etc - -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_LamportClock.h" // for vrpn_LamportTimestamp, etc -#include "vrpn_SharedObject.h" - -struct timeval; - -// We can't put d_lastUpdate in the message header timestamps; it must -// go in the body. -// This is because we're (probably) using a synchronized connection, -// and VRPN clock sync munges these timestamps. -// If we send a message from A to B and it gets sent back to A, attempting -// to preserve the timestamp at both ends, but sending it over a synchronized -// connection, its timestamp will end up equal to the original timestamp -// PLUS the network RTT (round-trip time). -// The original design intent of a vrpn_SharedObject was to be able to use -// timestamps as message identifiers/sequencers, so they need to be invariant -// over several network hops. - -// Note on Lamport clocks: the implementation was never completed -// (see vrpn_LamportClock.[C,h]), so it's use here has been disabled in the -// following ways. First, the code that considers the Lamport clock -// in vrpn_Shared_int32::shouldAcceptUpdates(...) is commented out -// (the other shared objects, float64 and String, never had code to -// consider the Lamport clock). Second, the body of the method -// vrpn_SharedObject::useLamportClock is commented out so that a -// Lamport clock is never started. - -vrpn_SharedObject::vrpn_SharedObject(const char *name, const char *tname, - vrpn_int32 mode) - : d_name(name ? new char[1 + strlen(name)] : NULL) - , d_mode(mode) - , d_typename(tname ? new char[1 + strlen(tname)] : NULL) - , d_connection(NULL) - , d_serverId(-1) - , d_remoteId(-1) - , d_myId(-1) - , d_peerId(-1) - , d_update_type(-1) - , d_requestSerializer_type(-1) - , d_grantSerializer_type(-1) - , d_assumeSerializer_type(-1) - , d_lamportUpdate_type(-1) - , d_isSerializer(vrpn_TRUE) - , d_isNegotiatingSerializer(vrpn_FALSE) - , d_queueSets(vrpn_FALSE) - , d_lClock(NULL) - , d_lastLamportUpdate(NULL) - , d_deferredUpdateCallbacks(NULL) -{ - - if (name) { - strcpy(d_name, name); - } - if (tname) { - strcpy(d_typename, tname); - } - vrpn_gettimeofday(&d_lastUpdate, NULL); -} - -// virtual -vrpn_SharedObject::~vrpn_SharedObject(void) -{ - vrpn_int32 gotConnection_type; - - if (d_name) { - delete[] d_name; - } - if (d_typename) { - delete[] d_typename; - } - if (d_connection) { - d_connection->unregister_handler(d_update_type, handle_update, this, - d_peerId); - d_connection->unregister_handler( - d_requestSerializer_type, handle_requestSerializer, this, d_peerId); - d_connection->unregister_handler( - d_grantSerializer_type, handle_grantSerializer, this, d_peerId); - d_connection->unregister_handler( - d_assumeSerializer_type, handle_assumeSerializer, this, d_peerId); - - gotConnection_type = - d_connection->register_message_type(vrpn_got_connection); - d_connection->unregister_handler(gotConnection_type, - handle_gotConnection, this, d_myId); - - d_connection->removeReference(); - } -} - -const char *vrpn_SharedObject::name(void) const { return d_name; } - -vrpn_bool vrpn_SharedObject::isSerializer(void) const { return VRPN_TRUE; } - -// virtual -void vrpn_SharedObject::bindConnection(vrpn_Connection *c) -{ - char buffer[101]; - if (c == NULL) { - // unbind the connection - if (d_connection) { - d_connection->removeReference(); - } - d_connection = NULL; - return; - } - - if (c && d_connection) { - fprintf(stderr, "vrpn_SharedObject::bindConnection: " - "Tried to rebind a connection to %s.\n", - d_name); - return; - } - - d_connection = c; - c->addReference(); - sprintf(buffer, "vrpn Shared server %s %s", d_typename, d_name); - d_serverId = c->register_sender(buffer); - sprintf(buffer, "vrpn Shared peer %s %s", d_typename, d_name); - d_remoteId = c->register_sender(buffer); - // d_updateFromServer_type = c->register_message_type - //("vrpn_Shared update_from_server"); - // d_updateFromRemote_type = c->register_message_type - //("vrpn_Shared update_from_remote"); - d_update_type = c->register_message_type("vrpn_Shared update"); - - // fprintf (stderr, "My name is %s; myId %d, ufs type %d, ufr type %d.\n", - // buffer, d_myId, d_updateFromServer_type, d_updateFromRemote_type); - - d_requestSerializer_type = - c->register_message_type("vrpn_Shared request_serializer"); - d_grantSerializer_type = - c->register_message_type("vrpn_Shared grant_serializer"); - d_assumeSerializer_type = - c->register_message_type("vrpn_Shared assume_serializer"); -} - -void vrpn_SharedObject::useLamportClock(vrpn_LamportClock *) -{ - - // NOTE: this is disabled - // d_lClock = l; -} - -void vrpn_SharedObject::becomeSerializer(void) -{ - timeval now; - - // Make sure only one request is outstanding - - if (d_isNegotiatingSerializer) { - return; - } - - d_isNegotiatingSerializer = vrpn_TRUE; - - // send requestSerializer - - if (d_connection) { - vrpn_gettimeofday(&now, NULL); - d_connection->pack_message(0, d_lastUpdate, d_requestSerializer_type, - d_myId, NULL, vrpn_CONNECTION_RELIABLE); - } - - // fprintf(stderr, "sent requestSerializer\n"); -} - -void vrpn_SharedObject::registerDeferredUpdateCallback( - vrpnDeferredUpdateCallback cb, void *userdata) -{ - deferredUpdateCallbackEntry *x; - - x = new deferredUpdateCallbackEntry; - if (!x) { - fprintf(stderr, "vrpn_SharedObject::registerDeferredUpdateCallback: " - "Out of memory!\n"); - return; - } - - x->handler = cb; - x->userdata = userdata; - x->next = d_deferredUpdateCallbacks; - d_deferredUpdateCallbacks = x; -} - -// virtual -vrpn_bool vrpn_SharedObject::shouldSendUpdate(vrpn_bool isLocalSet, - vrpn_bool acceptedUpdate) -{ - - // fprintf(stderr, "In vrpn_SharedObject::shouldSendUpdate(%s).\n", d_name); - - // Should handle all modes other than VRPN_SO_DEFER_UPDATES. - if (acceptedUpdate && isLocalSet) { - // fprintf(stderr, "..... accepted; local set => broadcast it.\n"); - return vrpn_TRUE; - } - - // Not a local set or (not accepted and not serializing) - if (!(d_mode & VRPN_SO_DEFER_UPDATES)) { - // fprintf(stderr, "..... rejected (NOT serialized).\n"); - return vrpn_FALSE; - } - - if (!d_isSerializer && isLocalSet) { - // fprintf(stderr, "..... not serializer; local set " - //"=> send it to the serializer.\n"); - return vrpn_TRUE; - } - - if (d_isSerializer && !isLocalSet && acceptedUpdate) { - // fprintf(stderr, "..... serializer; remote set; accepted => - // broadcast it.\n"); - return vrpn_TRUE; - } - - // fprintf(stderr,"..... rejected (under serialization).\n"); - return vrpn_FALSE; -} - -// static -int vrpn_SharedObject::handle_requestSerializer(void *userdata, - vrpn_HANDLERPARAM) -{ - vrpn_SharedObject *s = (vrpn_SharedObject *)userdata; - timeval now; - - if (!s->isSerializer() || s->d_isNegotiatingSerializer) { - // ignore this - // we should probably return failure or error? - return 0; - } - - s->d_isNegotiatingSerializer = vrpn_TRUE; - - if (s->d_connection) { - - // Don't set d_isSerializer to FALSE until they've assumed it. - // Until then, retain the serializer status but queue all of our - // messages; when they finish becoming the serializer, we - // set our flag to false and send the queue of set()s we've - // received to them. - - // send grantSerializer - - vrpn_gettimeofday(&now, NULL); - s->d_connection->pack_message(0, s->d_lastUpdate, - s->d_grantSerializer_type, s->d_myId, - NULL, vrpn_CONNECTION_RELIABLE); - } - - // start queueing set()s - - s->d_queueSets = vrpn_TRUE; - - // fprintf(stderr, "sent grantSerializer\n"); - return 0; -} - -// static -int vrpn_SharedObject::handle_grantSerializer(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_SharedObject *s = (vrpn_SharedObject *)userdata; - timeval now; - - s->d_isSerializer = vrpn_TRUE; - s->d_isNegotiatingSerializer = vrpn_FALSE; - - // send assumeSerializer - - if (s->d_connection) { - vrpn_gettimeofday(&now, NULL); - s->d_connection->pack_message(0, s->d_lastUpdate, - s->d_assumeSerializer_type, s->d_myId, - NULL, vrpn_CONNECTION_RELIABLE); - } - - // fprintf(stderr, "sent assumeSerializer\n"); - return 0; -} - -// static -int vrpn_SharedObject::handle_assumeSerializer(void *userdata, - vrpn_HANDLERPARAM) -{ - vrpn_SharedObject *s = (vrpn_SharedObject *)userdata; - - s->d_isSerializer = vrpn_FALSE; - s->d_isNegotiatingSerializer = vrpn_FALSE; - - // TODO: send queued set()s - - return 0; -} - -int vrpn_SharedObject::yankDeferredUpdateCallbacks(void) -{ - deferredUpdateCallbackEntry *x; - - for (x = d_deferredUpdateCallbacks; x; x = x->next) { - if ((x->handler)(x->userdata)) { - return -1; - } - } - - return 0; -} - -void vrpn_SharedObject::serverPostBindCleanup(void) -{ - d_myId = d_serverId; - d_peerId = d_remoteId; - postBindCleanup(); -} - -void vrpn_SharedObject::remotePostBindCleanup(void) -{ - d_myId = d_remoteId; - d_peerId = d_serverId; - postBindCleanup(); -} - -// static -int vrpn_SharedObject::handle_gotConnection(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_SharedObject *s = (vrpn_SharedObject *)userdata; - - // Send an update to the remote so that they have the correct - // initial value for our state. Otherwise an attempt to synchronize - // something will assume we're at our initial value until our value - // changes, which is an error. - - if (s->d_isSerializer) { - s->sendUpdate(); - // fprintf(stderr, "%s: set client's value.\n", s->d_name); - } - else if (!(s->d_mode & VRPN_SO_DEFER_UPDATES) && - (s->d_myId == s->d_serverId)) { - s->sendUpdate(); - // fprintf(stderr, "%s: set remote's value.\n", s->d_name); - } - - return 0; -} - -// static -int vrpn_SharedObject::handle_update(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_SharedObject *s = (vrpn_SharedObject *)userdata; - - return s->handleUpdate(p); -} - -void vrpn_SharedObject::postBindCleanup(void) -{ - vrpn_int32 gotConnection_type; - - if (!d_connection) { - return; - } - - // listen for update - - d_connection->register_handler(d_update_type, handle_update, this, - d_peerId); - - // listen for request/grant/assumeSerializer - - d_connection->register_handler(d_requestSerializer_type, - handle_requestSerializer, this, d_peerId); - d_connection->register_handler(d_grantSerializer_type, - handle_grantSerializer, this, d_peerId); - d_connection->register_handler(d_assumeSerializer_type, - handle_assumeSerializer, this, d_peerId); - - gotConnection_type = - d_connection->register_message_type(vrpn_got_connection); - d_connection->register_handler(gotConnection_type, handle_gotConnection, - this, d_myId); -} - -vrpn_Shared_int32::vrpn_Shared_int32(const char *name, vrpn_int32 defaultValue, - vrpn_int32 mode) - : vrpn_SharedObject(name, "int32", mode) - , d_value(defaultValue) - , d_callbacks(NULL) - , d_timedCallbacks(NULL) - , d_policy(vrpn_ACCEPT) - , d_policyCallback(NULL) - , d_policyUserdata(NULL) -{ -} - -// virtual -vrpn_Shared_int32::~vrpn_Shared_int32(void) -{ - // if (d_connection) { - // d_connection->unregister_handler(d_becomeSerializer_type, - // handle_becomeSerializer, this, d_myId); - //} -} - -vrpn_int32 vrpn_Shared_int32::value(void) const { return d_value; } - -vrpn_Shared_int32::operator vrpn_int32() const { return value(); } - -vrpn_Shared_int32 &vrpn_Shared_int32::operator=(vrpn_int32 newValue) -{ - struct timeval now; - vrpn_gettimeofday(&now, NULL); - return set(newValue, now); -} - -vrpn_Shared_int32 &vrpn_Shared_int32::set(vrpn_int32 newValue, timeval when) -{ - return set(newValue, when, vrpn_TRUE); -} -void vrpn_Shared_int32::register_handler(vrpnSharedIntCallback cb, - void *userdata) -{ - callbackEntry *e = new callbackEntry; - if (!e) { - fprintf(stderr, "vrpn_Shared_int32::register_handler: " - "Out of memory.\n"); - return; - } - e->handler = cb; - e->userdata = userdata; - e->next = d_callbacks; - d_callbacks = e; -} - -void vrpn_Shared_int32::unregister_handler(vrpnSharedIntCallback cb, - void *userdata) -{ - callbackEntry *e, **snitch; - - snitch = &d_callbacks; - e = *snitch; - while (e && (e->handler != cb) && (e->userdata != userdata)) { - snitch = &(e->next); - e = *snitch; - } - if (!e) { - fprintf(stderr, "vrpn_Shared_int32::unregister_handler: " - "Handler not found.\n"); - return; - } - - *snitch = e->next; - delete e; -} - -void vrpn_Shared_int32::register_handler(vrpnTimedSharedIntCallback cb, - void *userdata) -{ - timedCallbackEntry *e = new timedCallbackEntry; - if (!e) { - fprintf(stderr, "vrpn_Shared_int32::register_handler: " - "Out of memory.\n"); - return; - } - e->handler = cb; - e->userdata = userdata; - e->next = d_timedCallbacks; - d_timedCallbacks = e; -} - -void vrpn_Shared_int32::unregister_handler(vrpnTimedSharedIntCallback cb, - void *userdata) -{ - timedCallbackEntry *e, **snitch; - - snitch = &d_timedCallbacks; - e = *snitch; - while (e && (e->handler != cb) && (e->userdata != userdata)) { - snitch = &(e->next); - e = *snitch; - } - if (!e) { - fprintf(stderr, "vrpn_Shared_int32::unregister_handler: " - "Handler not found.\n"); - return; - } - - *snitch = e->next; - delete e; -} - -void vrpn_Shared_int32::setSerializerPolicy(vrpn_SerializerPolicy policy, - vrpnSharedIntSerializerPolicy f, - void *userdata) -{ - d_policy = policy; - d_policyCallback = f; - d_policyUserdata = userdata; -} - -vrpn_Shared_int32 &vrpn_Shared_int32::set(vrpn_int32 newValue, timeval when, - vrpn_bool isLocalSet, - vrpn_LamportTimestamp *t) -{ - vrpn_bool acceptedUpdate; - - acceptedUpdate = shouldAcceptUpdate(newValue, when, isLocalSet, t); - if (acceptedUpdate) { - d_value = newValue; - d_lastUpdate = when; - // yankCallbacks(isLocalSet); - } - - if (shouldSendUpdate(isLocalSet, acceptedUpdate)) { - sendUpdate(newValue, when); - } - - // yankCallbacks is placed after sendUpdate so that the update goes on the - // network before the updates due to local callbacks. - if (acceptedUpdate) yankCallbacks(isLocalSet); - - return *this; -} - -// virtual -vrpn_bool vrpn_Shared_int32::shouldAcceptUpdate(vrpn_int32 newValue, - timeval when, - vrpn_bool isLocalSet, - vrpn_LamportTimestamp *) -{ - - // fprintf(stderr, "In vrpn_Shared_int32::shouldAcceptUpdate(%s).\n", - // d_name); - - /* - // this commented-out code uses Lamport logical clocks, and is - // disabled now b/c the implementation of Lamport clocks was - // never complete. We use standard timestamps instead. - vrpn_bool old, equal; - if (t) { - old = d_lastLamportUpdate && (*t < *d_lastLamportUpdate); - equal = d_lastLamportUpdate && (*t == *d_lastLamportUpdate); - } else { - old = !vrpn_TimevalGreater(when, d_lastUpdate); - equal = vrpn_TimevalEqual( when, d_lastUpdate ); - } - */ - vrpn_bool old = !vrpn_TimevalGreater(when, d_lastUpdate); - vrpn_bool equal = vrpn_TimevalEqual(when, d_lastUpdate); - - // Is this "new" change idempotent? - if ((d_mode & VRPN_SO_IGNORE_IDEMPOTENT) && (newValue == d_value)) { - // fprintf(stderr, "... was idempotent.\n"); - return vrpn_FALSE; - } - - // Is this "new" change older than the previous change? - if ((d_mode & VRPN_SO_IGNORE_OLD) && old) { - // fprintf(stderr, "... was outdated.\n"); - return vrpn_FALSE; - } - // Is this "new" change older than the previous change? - if ((d_mode & VRPN_SO_IGNORE_OLD) && old) { - - // If the timestamps of the new & previous changes are equal: - // - if we are the serializer, we can accept the local change - // - if we are not the serializer, local updates are to be rejected - if (equal) { - if (!d_isSerializer && isLocalSet) { - return vrpn_FALSE; - } - } - else - return vrpn_FALSE; - } - - // All other clauses of shouldAcceptUpdate depend on serialization - if (!(d_mode & VRPN_SO_DEFER_UPDATES)) { - return vrpn_TRUE; - } - - // fprintf(stderr, "... serializing: "); - - // If we're not the serializer, don't accept local set() calls - - // forward those to the serializer. Non-local set() calls are - // messages from the serializer that we should accept. - if (!d_isSerializer) { - if (isLocalSet) { - // fprintf(stderr, "local update, not serializer, so reject.\n"); - yankDeferredUpdateCallbacks(); - return vrpn_FALSE; - } - else { - // fprintf(stderr, "remote update, not serializer, so accept.\n"); - return vrpn_TRUE; - } - } - - // We are the serializer. - // fprintf(stderr, "serializer: "); - - if (isLocalSet) { - // fprintf(stderr, "local update.\n"); - if (d_policy == vrpn_DENY_LOCAL) { - return vrpn_FALSE; - } - else { - return vrpn_TRUE; - } - } - - // Are we accepting all updates? - if (d_policy == vrpn_ACCEPT) { - // fprintf(stderr, "policy is to accept.\n"); - return vrpn_TRUE; - } - - // Does the user want to accept this one? - if ((d_policy == vrpn_CALLBACK) && d_policyCallback && - (*d_policyCallback)(d_policyUserdata, newValue, when, this)) { - // fprintf(stderr, "user callback accepts.\n"); - return vrpn_TRUE; - } - - // fprintf(stderr, "rejected.\n"); - return vrpn_FALSE; -} - -void vrpn_Shared_int32::encode(char **buffer, vrpn_int32 *len, - vrpn_int32 newValue, timeval when) const -{ - vrpn_buffer(buffer, len, newValue); - vrpn_buffer(buffer, len, when); -} -void vrpn_Shared_int32::encodeLamport(char **buffer, vrpn_int32 *len, - vrpn_int32 newValue, timeval when, - vrpn_LamportTimestamp *t) const -{ - int i; - vrpn_buffer(buffer, len, newValue); - vrpn_buffer(buffer, len, when); - vrpn_buffer(buffer, len, t->size()); - for (i = 0; i < t->size(); i++) { - vrpn_buffer(buffer, len, (*t)[i]); - } -} - -void vrpn_Shared_int32::decode(const char **buffer, vrpn_int32 *, - vrpn_int32 *newValue, timeval *when) const -{ - vrpn_unbuffer(buffer, newValue); - vrpn_unbuffer(buffer, when); -} -void vrpn_Shared_int32::decodeLamport(const char **buffer, vrpn_int32 *, - vrpn_int32 *newValue, timeval *when, - vrpn_LamportTimestamp **t) const -{ - vrpn_uint32 size; - vrpn_uint32 *array; - unsigned int i; - - vrpn_unbuffer(buffer, newValue); - vrpn_unbuffer(buffer, when); - vrpn_unbuffer(buffer, &size); - array = new vrpn_uint32[size]; - for (i = 0; i < size; i++) { - vrpn_unbuffer(buffer, &array[i]); - } - *t = new vrpn_LamportTimestamp(size, array); - delete[] array; -} - -void vrpn_Shared_int32::sendUpdate(void) { sendUpdate(d_value, d_lastUpdate); } - -void vrpn_Shared_int32::sendUpdate(vrpn_int32 newValue, timeval when) -{ - char buffer[32]; - vrpn_int32 buflen = 32; - char *bp = buffer; - vrpn_LamportTimestamp *t; - - if (d_connection) { - if (d_lClock) { - t = d_lClock->getTimestampAndAdvance(); - encodeLamport(&bp, &buflen, newValue, when, t); - } - else { - encode(&bp, &buflen, newValue, when); - } - d_connection->pack_message(32 - buflen, d_lastUpdate, d_update_type, - d_myId, buffer, vrpn_CONNECTION_RELIABLE); - // fprintf(stderr, "vrpn_Shared_int32::sendUpdate: packed message of %d - // " - //"at %d:%d.\n", d_value, d_lastUpdate.tv_sec, d_lastUpdate.tv_usec); - } -} - -int vrpn_Shared_int32::yankCallbacks(vrpn_bool isLocal) -{ - callbackEntry *e; - timedCallbackEntry *te; - - for (e = d_callbacks; e; e = e->next) { - if ((*e->handler)(e->userdata, d_value, isLocal)) { - return -1; - } - } - for (te = d_timedCallbacks; te; te = te->next) { - if ((*te->handler)(te->userdata, d_value, d_lastUpdate, isLocal)) { - return -1; - } - } - - return 0; -} - -int vrpn_Shared_int32::handleUpdate(vrpn_HANDLERPARAM p) -{ - vrpn_int32 newValue; - timeval when; - - decode(&p.buffer, &p.payload_len, &newValue, &when); - - // fprintf(stderr, "%s::handleUpdate to %d at %d:%d.\n", - // d_name, newValue, when.tv_sec, when.tv_usec); - - set(newValue, when, vrpn_FALSE); - - // fprintf(stderr, "vrpn_Shared_int32::handleUpdate done\n"); - return 0; -} - -// static -int vrpn_Shared_int32::handle_lamportUpdate(void *ud, vrpn_HANDLERPARAM p) -{ - vrpn_Shared_int32 *s = (vrpn_Shared_int32 *)ud; - vrpn_LamportTimestamp *t; - vrpn_int32 newValue; - timeval when; - - s->decodeLamport(&p.buffer, &p.payload_len, &newValue, &when, &t); - - // fprintf(stderr, "vrpn_Shared_int32::handleUpdate to %d at %d:%d.\n", - // newValue, when.tv_sec, when.tv_usec); - - s->d_lClock->receive(*t); - - s->set(newValue, when, vrpn_FALSE, t); - - if (s->d_lastLamportUpdate) { - delete s->d_lastLamportUpdate; - } - s->d_lastLamportUpdate = t; - - // fprintf(stderr, "vrpn_Shared_int32::handleUpdate done\n"); - return 0; -} - -vrpn_Shared_int32_Server::vrpn_Shared_int32_Server(const char *name, - vrpn_int32 defaultValue, - vrpn_int32 defaultMode) - : vrpn_Shared_int32(name, defaultValue, defaultMode) -{ - - d_isSerializer = vrpn_TRUE; -} - -// virtual -vrpn_Shared_int32_Server::~vrpn_Shared_int32_Server(void) {} - -vrpn_Shared_int32_Server &vrpn_Shared_int32_Server::operator=(vrpn_int32 c) -{ - vrpn_Shared_int32::operator=(c); - return *this; -} - -// virtual -void vrpn_Shared_int32_Server::bindConnection(vrpn_Connection *c) -{ - vrpn_Shared_int32::bindConnection(c); - - serverPostBindCleanup(); -} - -vrpn_Shared_int32_Remote::vrpn_Shared_int32_Remote(const char *name, - vrpn_int32 defaultValue, - vrpn_int32 defaultMode) - : vrpn_Shared_int32(name, defaultValue, defaultMode) -{ -} - -// virtual -vrpn_Shared_int32_Remote::~vrpn_Shared_int32_Remote(void) {} - -vrpn_Shared_int32_Remote &vrpn_Shared_int32_Remote::operator=(vrpn_int32 c) -{ - vrpn_Shared_int32::operator=(c); - return *this; -} - -void vrpn_Shared_int32_Remote::bindConnection(vrpn_Connection *c) -{ - - vrpn_Shared_int32::bindConnection(c); - - remotePostBindCleanup(); -} - -vrpn_Shared_float64::vrpn_Shared_float64(const char *name, - vrpn_float64 defaultValue, - vrpn_int32 mode) - : vrpn_SharedObject(name, "float64", mode) - , d_value(defaultValue) - , d_callbacks(NULL) - , d_timedCallbacks(NULL) - , d_policy(vrpn_ACCEPT) - , d_policyCallback(NULL) - , d_policyUserdata(NULL) -{ - - if (name) { - strcpy(d_name, name); - } - vrpn_gettimeofday(&d_lastUpdate, NULL); -} - -// virtual -vrpn_Shared_float64::~vrpn_Shared_float64(void) -{ - // if (d_connection) { - // d_connection->unregister_handler(d_becomeSerializer_type, - // handle_becomeSerializer, this, d_myId); - //} -} - -vrpn_float64 vrpn_Shared_float64::value(void) const { return d_value; } - -vrpn_Shared_float64::operator vrpn_float64() const { return value(); } - -vrpn_Shared_float64 &vrpn_Shared_float64::operator=(vrpn_float64 newValue) -{ - struct timeval now; - vrpn_gettimeofday(&now, NULL); - return set(newValue, now); -} - -vrpn_Shared_float64 &vrpn_Shared_float64::set(vrpn_float64 newValue, - timeval when) -{ - return set(newValue, when, vrpn_TRUE); -} - -void vrpn_Shared_float64::register_handler(vrpnSharedFloatCallback cb, - void *userdata) -{ - callbackEntry *e = new callbackEntry; - if (!e) { - fprintf(stderr, "vrpn_Shared_float64::register_handler: " - "Out of memory.\n"); - return; - } - e->handler = cb; - e->userdata = userdata; - e->next = d_callbacks; - d_callbacks = e; -} - -void vrpn_Shared_float64::unregister_handler(vrpnSharedFloatCallback cb, - void *userdata) -{ - callbackEntry *e, **snitch; - - snitch = &d_callbacks; - e = *snitch; - while (e && (e->handler != cb) && (e->userdata != userdata)) { - snitch = &(e->next); - e = *snitch; - } - if (!e) { - fprintf(stderr, "vrpn_Shared_float64::unregister_handler: " - "Handler not found.\n"); - return; - } - - *snitch = e->next; - delete e; -} - -void vrpn_Shared_float64::register_handler(vrpnTimedSharedFloatCallback cb, - void *userdata) -{ - timedCallbackEntry *e = new timedCallbackEntry; - if (!e) { - fprintf(stderr, "vrpn_Shared_float64::register_handler: " - "Out of memory.\n"); - return; - } - e->handler = cb; - e->userdata = userdata; - e->next = d_timedCallbacks; - d_timedCallbacks = e; -} - -void vrpn_Shared_float64::unregister_handler(vrpnTimedSharedFloatCallback cb, - void *userdata) -{ - timedCallbackEntry *e, **snitch; - - snitch = &d_timedCallbacks; - e = *snitch; - while (e && (e->handler != cb) && (e->userdata != userdata)) { - snitch = &(e->next); - e = *snitch; - } - if (!e) { - fprintf(stderr, "vrpn_Shared_float64::unregister_handler: " - "Handler not found.\n"); - return; - } - - *snitch = e->next; - delete e; -} - -void vrpn_Shared_float64::setSerializerPolicy(vrpn_SerializerPolicy policy, - vrpnSharedFloatSerializerPolicy f, - void *userdata) -{ - d_policy = policy; - d_policyCallback = f; - d_policyUserdata = userdata; -} - -vrpn_Shared_float64 &vrpn_Shared_float64::set(vrpn_float64 newValue, - timeval when, - vrpn_bool isLocalSet) -{ - vrpn_bool acceptedUpdate; - - acceptedUpdate = shouldAcceptUpdate(newValue, when, isLocalSet); - if (acceptedUpdate) { - d_value = newValue; - d_lastUpdate = when; - // yankCallbacks(isLocalSet); - } - - if (shouldSendUpdate(isLocalSet, acceptedUpdate)) { - sendUpdate(newValue, when); - } - - // yankCallbacks is placed after sendUpdate so that the update goes on the - // network before the updates due to local callbacks. - if (acceptedUpdate) yankCallbacks(isLocalSet); - - return *this; -} - -// virtual -vrpn_bool vrpn_Shared_float64::shouldAcceptUpdate(vrpn_float64 newValue, - timeval when, - vrpn_bool isLocalSet) -{ - - // Is this "new" change idempotent? - if ((d_mode & VRPN_SO_IGNORE_IDEMPOTENT) && (newValue == d_value)) { - return vrpn_FALSE; - } - - // Is this "new" change older than the previous change? - if ((d_mode & VRPN_SO_IGNORE_OLD) && - !vrpn_TimevalGreater(when, d_lastUpdate)) { - - // If the timestamps of the new & previous changes are equal: - // - if we are the serializer, we can accept the local change - // - if we are not the serializer, local updates are to be rejected - if (vrpn_TimevalEqual(when, d_lastUpdate)) { - if (!d_isSerializer && isLocalSet) { - return vrpn_FALSE; - } - } - else - return vrpn_FALSE; - } - - // All other clauses of shouldAcceptUpdate depend on serialization - if (!(d_mode & VRPN_SO_DEFER_UPDATES)) { - return vrpn_TRUE; - } - - // If we're not the serializer, don't accept local set() calls - - // forward those to the serializer. Non-local set() calls are - // messages from the serializer that we should accept. - if (!d_isSerializer) { - if (isLocalSet) { - yankDeferredUpdateCallbacks(); - return vrpn_FALSE; - } - else { - return vrpn_TRUE; - } - } - - // We are the serializer. - - if (isLocalSet) { - if (d_policy == vrpn_DENY_LOCAL) { - return vrpn_FALSE; - } - else { - return vrpn_TRUE; - } - } - - // Are we accepting all updates? - if (d_policy == vrpn_ACCEPT) { - return vrpn_TRUE; - } - - // Does the user want to accept this one? - if ((d_policy == vrpn_CALLBACK) && d_policyCallback && - (*d_policyCallback)(d_policyUserdata, newValue, when, this)) { - return vrpn_TRUE; - } - - return vrpn_FALSE; -} - -void vrpn_Shared_float64::encode(char **buffer, vrpn_int32 *len, - vrpn_float64 newValue, timeval when) const -{ - vrpn_buffer(buffer, len, newValue); - vrpn_buffer(buffer, len, when); -} -void vrpn_Shared_float64::decode(const char **buffer, vrpn_int32 *, - vrpn_float64 *newValue, timeval *when) const -{ - vrpn_unbuffer(buffer, newValue); - vrpn_unbuffer(buffer, when); -} - -void vrpn_Shared_float64::sendUpdate(void) -{ - sendUpdate(d_value, d_lastUpdate); -} - -void vrpn_Shared_float64::sendUpdate(vrpn_float64 newValue, timeval when) -{ - char buffer[32]; - vrpn_int32 buflen = 32; - char *bp = buffer; - - if (d_connection) { - encode(&bp, &buflen, newValue, when); - d_connection->pack_message(32 - buflen, d_lastUpdate, d_update_type, - d_myId, buffer, vrpn_CONNECTION_RELIABLE); - // fprintf(stderr, "vrpn_Shared_float64::sendUpdate: packed - // message\n"); - } -} - -int vrpn_Shared_float64::yankCallbacks(vrpn_bool isLocal) -{ - callbackEntry *e; - timedCallbackEntry *te; - - for (e = d_callbacks; e; e = e->next) { - if ((*e->handler)(e->userdata, d_value, isLocal)) { - return -1; - } - } - for (te = d_timedCallbacks; te; te = te->next) { - if ((*te->handler)(te->userdata, d_value, d_lastUpdate, isLocal)) { - return -1; - } - } - - return 0; -} - -int vrpn_Shared_float64::handleUpdate(vrpn_HANDLERPARAM p) -{ - vrpn_float64 newValue; - timeval when; - - decode(&p.buffer, &p.payload_len, &newValue, &when); - - set(newValue, when, vrpn_FALSE); - - return 0; -} - -vrpn_Shared_float64_Server::vrpn_Shared_float64_Server( - const char *name, vrpn_float64 defaultValue, vrpn_int32 defaultMode) - : vrpn_Shared_float64(name, defaultValue, defaultMode) -{ - - d_isSerializer = vrpn_TRUE; -} - -// virtual -vrpn_Shared_float64_Server::~vrpn_Shared_float64_Server(void) {} - -vrpn_Shared_float64_Server &vrpn_Shared_float64_Server:: -operator=(vrpn_float64 c) -{ - vrpn_Shared_float64::operator=(c); - return *this; -} - -// virtual -void vrpn_Shared_float64_Server::bindConnection(vrpn_Connection *c) -{ - vrpn_Shared_float64::bindConnection(c); - - serverPostBindCleanup(); -} - -vrpn_Shared_float64_Remote::vrpn_Shared_float64_Remote( - const char *name, vrpn_float64 defaultValue, vrpn_int32 defaultMode) - : vrpn_Shared_float64(name, defaultValue, defaultMode) -{ -} - -// virtual -vrpn_Shared_float64_Remote::~vrpn_Shared_float64_Remote(void) {} - -vrpn_Shared_float64_Remote &vrpn_Shared_float64_Remote:: -operator=(vrpn_float64 c) -{ - vrpn_Shared_float64::operator=(c); - return *this; -} - -// virtual -void vrpn_Shared_float64_Remote::bindConnection(vrpn_Connection *c) -{ - - vrpn_Shared_float64::bindConnection(c); - - remotePostBindCleanup(); -} - -vrpn_Shared_String::vrpn_Shared_String(const char *name, - const char *defaultValue, - vrpn_int32 mode) - : vrpn_SharedObject(name, "String", mode) - , d_value(defaultValue ? new char[1 + strlen(defaultValue)] : NULL) - , d_callbacks(NULL) - , d_timedCallbacks(NULL) - , d_policy(vrpn_ACCEPT) - , d_policyCallback(NULL) - , d_policyUserdata(NULL) -{ - - if (defaultValue) { - strcpy(d_value, defaultValue); - } - if (name) { - strcpy(d_name, name); - } - vrpn_gettimeofday(&d_lastUpdate, NULL); -} - -// virtual -vrpn_Shared_String::~vrpn_Shared_String(void) -{ - if (d_value) { - delete[] d_value; - } - // if (d_connection) { - // d_connection->unregister_handler(d_becomeSerializer_type, - // handle_becomeSerializer, this, d_myId); - //} -} - -const char *vrpn_Shared_String::value(void) const { return d_value; } - -vrpn_Shared_String::operator const char *() const { return value(); } - -vrpn_Shared_String &vrpn_Shared_String::operator=(const char *newValue) -{ - struct timeval now; - vrpn_gettimeofday(&now, NULL); - return set(newValue, now); -} - -vrpn_Shared_String &vrpn_Shared_String::set(const char *newValue, timeval when) -{ - return set(newValue, when, vrpn_TRUE); -} - -void vrpn_Shared_String::register_handler(vrpnSharedStringCallback cb, - void *userdata) -{ - callbackEntry *e = new callbackEntry; - if (!e) { - fprintf(stderr, "vrpn_Shared_String::register_handler: " - "Out of memory.\n"); - return; - } - e->handler = cb; - e->userdata = userdata; - e->next = d_callbacks; - d_callbacks = e; -} - -void vrpn_Shared_String::unregister_handler(vrpnSharedStringCallback cb, - void *userdata) -{ - callbackEntry *e, **snitch; - - snitch = &d_callbacks; - e = *snitch; - while (e && (e->handler != cb) && (e->userdata != userdata)) { - snitch = &(e->next); - e = *snitch; - } - if (!e) { - fprintf(stderr, "vrpn_Shared_String::unregister_handler: " - "Handler not found.\n"); - return; - } - - *snitch = e->next; - delete e; -} - -void vrpn_Shared_String::register_handler(vrpnTimedSharedStringCallback cb, - void *userdata) -{ - timedCallbackEntry *e = new timedCallbackEntry; - if (!e) { - fprintf(stderr, "vrpn_Shared_String::register_handler: " - "Out of memory.\n"); - return; - } - e->handler = cb; - e->userdata = userdata; - e->next = d_timedCallbacks; - d_timedCallbacks = e; -} - -void vrpn_Shared_String::unregister_handler(vrpnTimedSharedStringCallback cb, - void *userdata) -{ - timedCallbackEntry *e, **snitch; - - snitch = &d_timedCallbacks; - e = *snitch; - while (e && (e->handler != cb) && (e->userdata != userdata)) { - snitch = &(e->next); - e = *snitch; - } - if (!e) { - fprintf(stderr, "vrpn_Shared_String::unregister_handler: " - "Handler not found.\n"); - return; - } - - *snitch = e->next; - delete e; -} - -void vrpn_Shared_String::setSerializerPolicy(vrpn_SerializerPolicy policy, - vrpnSharedStringSerializerPolicy f, - void *userdata) -{ - d_policy = policy; - d_policyCallback = f; - d_policyUserdata = userdata; -} - -vrpn_Shared_String &vrpn_Shared_String::set(const char *newValue, timeval when, - vrpn_bool isLocalSet) -{ - vrpn_bool acceptedUpdate; - - acceptedUpdate = shouldAcceptUpdate(newValue, when, isLocalSet); - if (acceptedUpdate) { - - if ((d_value == NULL) || (strcmp(d_value, newValue) != 0)) { - if (d_value) { - delete[] d_value; - } - d_value = new char[1 + strlen(newValue)]; - if (!d_value) { - fprintf(stderr, "vrpn_Shared_String::set: Out of memory.\n"); - return *this; - } - strcpy(d_value, newValue); - } - - // fprintf(stderr, "vrpn_Shared_String::set: %s to \"%s\".\n", name(), - // value()); - - d_lastUpdate = when; - } - - if (shouldSendUpdate(isLocalSet, acceptedUpdate)) { - sendUpdate(newValue, when); - } - - // yankCallbacks is placed after sendUpdate so that the update goes on the - // network before the updates due to local callbacks. - if (acceptedUpdate) yankCallbacks(isLocalSet); - - return *this; -} - -// virtual -vrpn_bool vrpn_Shared_String::shouldAcceptUpdate(const char *newValue, - timeval when, - vrpn_bool isLocalSet) -{ - - // Is this "new" change idempotent? - if ((d_mode & VRPN_SO_IGNORE_IDEMPOTENT) && (newValue == d_value)) { - return vrpn_FALSE; - } - - // Is this "new" change older than the previous change? - if ((d_mode & VRPN_SO_IGNORE_OLD) && - !vrpn_TimevalGreater(when, d_lastUpdate)) { - - // If the timestamps of the new & previous changes are equal: - // - if we are the serializer, we can accept the local change - // - if we are not the serializer, local updates are to be rejected - if (vrpn_TimevalEqual(when, d_lastUpdate)) { - if (!d_isSerializer && isLocalSet) { - return vrpn_FALSE; - } - } - else - return vrpn_FALSE; - } - - // All other clauses of shouldAcceptUpdate depend on serialization - if (!(d_mode & VRPN_SO_DEFER_UPDATES)) { - return vrpn_TRUE; - } - - // If we're not the serializer, don't accept local set() calls - - // forward those to the serializer. Non-local set() calls are - // messages from the serializer that we should accept. - if (!d_isSerializer) { - if (isLocalSet) { - yankDeferredUpdateCallbacks(); - return vrpn_FALSE; - } - else { - return vrpn_TRUE; - } - } - - // We are the serializer. - - if (isLocalSet) { - if (d_policy == vrpn_DENY_LOCAL) { - return vrpn_FALSE; - } - else { - return vrpn_TRUE; - } - } - - // Are we accepting all updates? - if (d_policy == vrpn_ACCEPT) { - return vrpn_TRUE; - } - - // Does the user want to accept this one? - if ((d_policy == vrpn_CALLBACK) && d_policyCallback && - (*d_policyCallback)(d_policyUserdata, newValue, when, this)) { - return vrpn_TRUE; - } - - return vrpn_FALSE; -} - -void vrpn_Shared_String::encode(char **buffer, vrpn_int32 *len, - const char *newValue, timeval when) const -{ - // We reverse ordering from the other vrpn_SharedObject classes - // so that the time value is guaranteed to be aligned. - vrpn_buffer(buffer, len, when); - vrpn_buffer(buffer, len, newValue, - static_cast<vrpn_int32>(strlen(newValue))); -} -void vrpn_Shared_String::decode(const char **buffer, vrpn_int32 *len, - char *newValue, timeval *when) const -{ - vrpn_unbuffer(buffer, when); - vrpn_unbuffer(buffer, newValue, *len - sizeof(*when)); - newValue[*len - sizeof(*when)] = 0; -} - -void vrpn_Shared_String::sendUpdate(void) { sendUpdate(d_value, d_lastUpdate); } - -void vrpn_Shared_String::sendUpdate(const char *newValue, timeval when) -{ - char buffer[1024]; // HACK - vrpn_int32 buflen = 1024; - char *bp = buffer; - - if (d_connection) { - encode(&bp, &buflen, newValue, when); - d_connection->pack_message(1024 - buflen, d_lastUpdate, d_update_type, - d_myId, buffer, vrpn_CONNECTION_RELIABLE); - // fprintf(stderr, "vrpn_Shared_String::sendUpdate: packed message\n"); - } -} - -int vrpn_Shared_String::yankCallbacks(vrpn_bool isLocal) -{ - callbackEntry *e; - timedCallbackEntry *te; - - for (e = d_callbacks; e; e = e->next) { - if ((*e->handler)(e->userdata, d_value, isLocal)) { - return -1; - } - } - for (te = d_timedCallbacks; te; te = te->next) { - if ((*te->handler)(te->userdata, d_value, d_lastUpdate, isLocal)) { - return -1; - } - } - - return 0; -} - -// static -int vrpn_Shared_String::handleUpdate(vrpn_HANDLERPARAM p) -{ - char newValue[1024]; // HACK - timeval when; - - decode(&p.buffer, &p.payload_len, newValue, &when); - - set(newValue, when, vrpn_FALSE); - - return 0; -} - -vrpn_Shared_String_Server::vrpn_Shared_String_Server(const char *name, - const char *defaultValue, - vrpn_int32 defaultMode) - : vrpn_Shared_String(name, defaultValue, defaultMode) -{ - - d_isSerializer = vrpn_TRUE; -} - -// virtual -vrpn_Shared_String_Server::~vrpn_Shared_String_Server(void) {} - -vrpn_Shared_String_Server &vrpn_Shared_String_Server::operator=(const char *c) -{ - vrpn_Shared_String::operator=(c); - return *this; -} - -// virtual -void vrpn_Shared_String_Server::bindConnection(vrpn_Connection *c) -{ - vrpn_Shared_String::bindConnection(c); - - serverPostBindCleanup(); -} - -vrpn_Shared_String_Remote::vrpn_Shared_String_Remote(const char *name, - const char *defaultValue, - vrpn_int32 defaultMode) - : vrpn_Shared_String(name, defaultValue, defaultMode) -{ -} - -// virtual -vrpn_Shared_String_Remote::~vrpn_Shared_String_Remote(void) {} - -vrpn_Shared_String_Remote &vrpn_Shared_String_Remote::operator=(const char *c) -{ - vrpn_Shared_String::operator=(c); - return *this; -} - -// virtual -void vrpn_Shared_String_Remote::bindConnection(vrpn_Connection *c) -{ - - vrpn_Shared_String::bindConnection(c); - - remotePostBindCleanup(); -} diff --git a/src/vrpn/vrpn_SharedObject.h b/src/vrpn/vrpn_SharedObject.h deleted file mode 100644 index 6dfa452d4411a4d1cc73be79ec9f82122a14b12f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_SharedObject.h +++ /dev/null @@ -1,572 +0,0 @@ -#ifndef VRPN_SHARED_OBJECT -#define VRPN_SHARED_OBJECT - -#include <stddef.h> // for NULL - -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -// This *must* be here to take care of winsock2.h and sys/time.h and other -// assorted system-dependent details. -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_int32, vrpn_bool, etc - -class VRPN_API vrpn_Connection; -struct timeval; -struct vrpn_HANDLERPARAM; - -class VRPN_API vrpn_LamportClock; // from "vrpn_LamportClock.h" -class VRPN_API vrpn_LamportTimestamp; - -// It's increasingly clear that we could handle all this with -// a template, except for the fact that vrpn_Shared_String is -// based on char *. All we need is a String base class. -// We could try to adopt BCString from nano's libnmb... - -// I'd like to implement shouldAcceptUpdate/shouldSendUpdate -// with the Strategy pattern (Gamma/Helm/Johnson/Vlissides 1995, pg 315). -// That would make it far, far easier to extend, but the implementation -// looks too unweildy. - -class VRPN_API vrpn_Shared_String; -class VRPN_API vrpn_Shared_float64; -class VRPN_API vrpn_Shared_int32; - -typedef int(VRPN_CALLBACK *vrpnDeferredUpdateCallback)(void *userdata); - -typedef int(VRPN_CALLBACK *vrpnSharedIntCallback)(void *userdata, - vrpn_int32 newValue, - vrpn_bool isLocal); -typedef int(VRPN_CALLBACK *vrpnSharedFloatCallback)(void *userdata, - vrpn_float64 newValue, - vrpn_bool isLocal); -typedef int(VRPN_CALLBACK *vrpnSharedStringCallback)(void *userdata, - const char *newValue, - vrpn_bool isLocal); - -typedef int(VRPN_CALLBACK *vrpnTimedSharedIntCallback)(void *userdata, - vrpn_int32 newValue, - timeval when, - vrpn_bool isLocal); -typedef int(VRPN_CALLBACK *vrpnTimedSharedFloatCallback)(void *userdata, - vrpn_float64 newValue, - timeval when, - vrpn_bool isLocal); -typedef int(VRPN_CALLBACK *vrpnTimedSharedStringCallback)(void *userdata, - const char *newValue, - timeval when, - vrpn_bool isLocal); - -// Update callbacks should return 0 on successful completion, -// nonzero on error (which will prevent further update callbacks -// from being invoked). - -typedef int(VRPN_CALLBACK *vrpnSharedIntSerializerPolicy)( - void *userdata, vrpn_int32 newValue, timeval when, - vrpn_Shared_int32 *object); -typedef int(VRPN_CALLBACK *vrpnSharedFloatSerializerPolicy)( - void *userdata, vrpn_float64 newValue, timeval when, - vrpn_Shared_float64 *object); -typedef int(VRPN_CALLBACK *vrpnSharedStringSerializerPolicy)( - void *userdata, const char *newValue, timeval when, - vrpn_Shared_String *object); - -// Policy callbacks should return 0 if the update should be accepted, -// nonzero if it should be denied. - -#define VRPN_SO_DEFAULT 0x00 -#define VRPN_SO_IGNORE_IDEMPOTENT 0x01 -#define VRPN_SO_DEFER_UPDATES 0x10 -#define VRPN_SO_IGNORE_OLD 0x100 - -// Each of these flags can be passed to all vrpn_Shared_* constructors. -// If VRPN_SO_IGNORE_IDEMPOTENT is used, calls of operator = (v) or set(v) -// are *ignored* if v == d_value. No callbacks are called, no network -// traffic takes place. -// If VRPN_SO_DEFER_UPDATES is used, calls of operator = (v) or set(v) -// on vrpn_Shared_*_Remote are sent to the server but not reflected -// locally until an update message is received from the server. -// If VRPN_SO_IGNORE_OLD is set, calls of set(v, t) are ignored if -// t < d_lastUpdate. This includes messages propagated over the network. - -// A vrpn_Shared_*_Server/Remote pair using VRPN_SO_IGNORE_OLD are -// guaranteed to reach the same final state - after quiescence (all messages -// sent on the network are delivered) they will yield the same value(), -// but they are *not* guaranteed to go through the same sequence of -// callbacks. - -// Using VRPN_SO_DEFER_UPDATES serializes all changes to d_value and -// all callbacks, so it guarantees that all instances of the shared -// variable see the same sequence of callbacks. - -// setSerializerPolicy() can be used to change the way VRPN_SO_DEFER_UPDATES -// operates. The default value described above is equivalent to calling -// setSerializerPolicy(vrpn_ACCEPT). Also possible are vrpn_DENY_REMOTE, -// which causes the serializer to ignore all updates from its peers, -// vrpn_DENY_LOCAL, which accepts updates from peers but ignores local -// updates, -// and vrpn_CALLBACK, which passes the update to a callback which can -// return zero for vrpn_ACCEPT or nonzero for vrpn_DENY. - -enum vrpn_SerializerPolicy { - vrpn_ACCEPT, - vrpn_DENY_REMOTE, - vrpn_DENY_LOCAL, - vrpn_CALLBACK -}; - -// Separated out vrpn_SharedObject from common behavior of 3 classes -// on 14 Feb 2000. Now all we need is permission to use templates to -// collapse them all together; *all* the functions remaining on the -// other classes are type-dependent and should be templatable. -// (One exception: the string that names the type. This could probably -// be cut.) - -class VRPN_API vrpn_SharedObject { - -public: - vrpn_SharedObject(const char *name, const char *tname, vrpn_int32 mode); - virtual ~vrpn_SharedObject(void); - - // ACCESSORS - - const char *name(void) const; - vrpn_bool isSerializer(void) const; - - // MANIPULATORS - - virtual void bindConnection(vrpn_Connection *); - ///< Every derived class should call this, do what it needs to, - ///< and ALSO call {server,remote}PostBindCleanup() to get - ///< myId and peerId set up and to get standard handlers registered. - - void useLamportClock(vrpn_LamportClock *); - ///< Lamport Clocks are NOT currently integrated. They should - ///< provide serialization (virtual timestamps) that work even - ///< when the clocks of the computers communicating are not - ///< roughly synchronized. - - void becomeSerializer(void); - ///< Requests that this instance of the shared object becomes - ///< the serializer (i.e. lock-arbitrator), and we can then use - ///< setSerializerPolicy to imitate a complete lock. Does nothing - ///< if we already are the serializer (isSerializer() returns true); - ///< otherwise initiates a 3-phase request protocol with the - ///< current serializer. There currently isn't any provision for - ///< notification of success (or failure). - - void registerDeferredUpdateCallback(vrpnDeferredUpdateCallback, - void *userdata); - ///< The specified function will be passed userdata when this - ///< particular shared object defers an update (receives a local - ///< update but is not the serializer and so sends the update off - ///< to the serializer). Intended to allow insertion of timing - ///< code for those times when you really want to know how long - ///< every little thing is taking. - -protected: - char *d_name; - vrpn_int32 d_mode; - timeval d_lastUpdate; - char *d_typename; // currently int32, float64, or String - - vrpn_Connection *d_connection; - // vrpn_int32 d_updateFromServer_type; - // vrpn_int32 d_updateFromRemote_type; - // vrpn_int32 d_myUpdate_type; // fragile - vrpn_int32 d_serverId; - vrpn_int32 d_remoteId; - vrpn_int32 d_myId; // fragile - vrpn_int32 d_peerId; // fragile - vrpn_int32 d_update_type; - - vrpn_int32 d_requestSerializer_type; - ///< Sent to the serializer to assume its duties. - vrpn_int32 d_grantSerializer_type; - ///< Sent by the serializer to grant a request. - vrpn_int32 d_assumeSerializer_type; - ///< Sent by a new serializer once it has been notified that - ///< its request has been granted. - - // vrpn_int32 d_updateFromServerLamport_type; - // vrpn_int32 d_updateFromRemoteLamport_type; - vrpn_int32 d_lamportUpdate_type; - - vrpn_bool d_isSerializer; - ///< default to vrpn_TRUE for servers, FALSE for remotes - vrpn_bool d_isNegotiatingSerializer; - ///< As long as we have inorder delivery, this should be - ///< sufficient to keep us from getting many at once. - - virtual vrpn_bool shouldSendUpdate(vrpn_bool isLocalSet, - vrpn_bool acceptedUpdate); - - int yankCallbacks(vrpn_bool isLocal); - ///< must set d_lastUpdate BEFORE calling yankCallbacks() - - static int VRPN_CALLBACK - handle_requestSerializer(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_grantSerializer(void *, vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_assumeSerializer(void *, vrpn_HANDLERPARAM); - - vrpn_bool d_queueSets; - ///< If this is true, no set()s are processed; instead, they - ///< are queued for later execution. - ///< NOT IMPLEMENTED - - vrpn_LamportClock *d_lClock; - vrpn_LamportTimestamp *d_lastLamportUpdate; - - struct deferredUpdateCallbackEntry { - vrpnDeferredUpdateCallback handler; - void *userdata; - deferredUpdateCallbackEntry *next; - }; - deferredUpdateCallbackEntry *d_deferredUpdateCallbacks; - - int yankDeferredUpdateCallbacks(void); - ///< returns -1 on error (i.e. nonzero return by a callback) - - void serverPostBindCleanup(void); - void remotePostBindCleanup(void); - - virtual void sendUpdate(void) = 0; - ///< Should invoke default sendUpdate() for this derived type. - virtual int handleUpdate(vrpn_HANDLERPARAM) = 0; - - static int VRPN_CALLBACK handle_gotConnection(void *, vrpn_HANDLERPARAM); - ///< Register this handler in postBindCleanup(); - ///< it calls sendUpdate() to make sure the remote has the - ///< correct value on first connection. - static int VRPN_CALLBACK handle_update(void *, vrpn_HANDLERPARAM); - ///< Passes arguments to handleUpdate() for this type; - ///< registered in postBindCleanup(); - -private: - void postBindCleanup(void); -}; - -class VRPN_API vrpn_Shared_int32 : public vrpn_SharedObject { - -public: - vrpn_Shared_int32(const char *name, vrpn_int32 defaultValue = 0, - vrpn_int32 mode = VRPN_SO_DEFAULT); - virtual ~vrpn_Shared_int32(void); - - // ACCESSORS - - vrpn_int32 value(void) const; - operator vrpn_int32() const; - - // MANIPULATORS - - vrpn_Shared_int32 &operator=(vrpn_int32 newValue); - // calls set(newValue, now); - - vrpn_Shared_int32 &set(vrpn_int32 newValue, timeval when); - // calls protected set (newValue, when, vrpn_TRUE); - - void register_handler(vrpnSharedIntCallback, void *); - void unregister_handler(vrpnSharedIntCallback, void *); - void register_handler(vrpnTimedSharedIntCallback, void *); - void unregister_handler(vrpnTimedSharedIntCallback, void *); - // Callbacks are (currently) called *AFTER* the assignment - // has been made, so any check of the value of their shared int - // will return newValue - - void setSerializerPolicy(vrpn_SerializerPolicy policy = vrpn_ACCEPT, - vrpnSharedIntSerializerPolicy f = NULL, - void *userdata = NULL); - -protected: - vrpn_int32 d_value; - - // callback code - // Could generalize this by making a class that gets passed - // a vrpn_HANDLERPARAM and passes whatever is needed to its callback, - // but it's not worth doing that unless we need a third or fourth - // kind of callback. - struct callbackEntry { - vrpnSharedIntCallback handler; - void *userdata; - callbackEntry *next; - }; - callbackEntry *d_callbacks; - struct timedCallbackEntry { - vrpnTimedSharedIntCallback handler; - void *userdata; - timedCallbackEntry *next; - }; - timedCallbackEntry *d_timedCallbacks; - - vrpn_Shared_int32 &set(vrpn_int32, timeval, vrpn_bool isLocalSet, - vrpn_LamportTimestamp * = NULL); - - virtual vrpn_bool shouldAcceptUpdate(vrpn_int32 newValue, timeval when, - vrpn_bool isLocalSet, - vrpn_LamportTimestamp *); - - virtual void sendUpdate(void); - void sendUpdate(vrpn_int32 newValue, timeval when); - - void encode(char **buffer, vrpn_int32 *len, vrpn_int32 newValue, - timeval when) const; - void encodeLamport(char **buffer, vrpn_int32 *len, vrpn_int32 newValue, - timeval when, vrpn_LamportTimestamp *t) const; - // We used to have sendUpdate() and encode() just read off of - // d_value and d_lastUpdate, but that doesn't work when we're - // serializing (VRPN_SO_DEFER_UPDATES), because we don't want - // to change the local values but do want to send the new values - // to the serializer. - void decode(const char **buffer, vrpn_int32 *len, vrpn_int32 *newValue, - timeval *when) const; - void decodeLamport(const char **buffer, vrpn_int32 *len, - vrpn_int32 *newValue, timeval *when, - vrpn_LamportTimestamp **t) const; - - int yankCallbacks(vrpn_bool isLocal); - // must set d_lastUpdate BEFORE calling yankCallbacks() - - // serializer policy code - vrpn_SerializerPolicy d_policy; // default to vrpn_ACCEPT - vrpnSharedIntSerializerPolicy d_policyCallback; - void *d_policyUserdata; - - int handleUpdate(vrpn_HANDLERPARAM); - - static int VRPN_CALLBACK handle_lamportUpdate(void *, vrpn_HANDLERPARAM); -}; - -// I don't think the derived classes should have to have operator = () -// defined (they didn't in the last version??), but both SGI and HP -// compilers seem to insist on it. - -class VRPN_API vrpn_Shared_int32_Server : public vrpn_Shared_int32 { - -public: - vrpn_Shared_int32_Server(const char *name, vrpn_int32 defaultValue = 0, - vrpn_int32 defaultMode = VRPN_SO_DEFAULT); - virtual ~vrpn_Shared_int32_Server(void); - - vrpn_Shared_int32_Server &operator=(vrpn_int32 newValue); - - virtual void bindConnection(vrpn_Connection *); - -protected: -}; - -class VRPN_API vrpn_Shared_int32_Remote : public vrpn_Shared_int32 { - -public: - vrpn_Shared_int32_Remote(const char *name, vrpn_int32 defaultValue = 0, - vrpn_int32 defaultMode = VRPN_SO_DEFAULT); - virtual ~vrpn_Shared_int32_Remote(void); - - vrpn_Shared_int32_Remote &operator=(vrpn_int32 newValue); - - virtual void bindConnection(vrpn_Connection *); -}; - -class VRPN_API vrpn_Shared_float64 : public vrpn_SharedObject { - -public: - vrpn_Shared_float64(const char *name, vrpn_float64 defaultValue = 0.0, - vrpn_int32 mode = VRPN_SO_DEFAULT); - virtual ~vrpn_Shared_float64(void); - - // ACCESSORS - - vrpn_float64 value(void) const; - operator vrpn_float64() const; - - // MANIPULATORS - - vrpn_Shared_float64 &operator=(vrpn_float64 newValue); - // calls set(newValue, now); - - virtual vrpn_Shared_float64 &set(vrpn_float64 newValue, timeval when); - // calls protected set (newValue, when, vrpn_TRUE); - - void register_handler(vrpnSharedFloatCallback, void *); - void unregister_handler(vrpnSharedFloatCallback, void *); - void register_handler(vrpnTimedSharedFloatCallback, void *); - void unregister_handler(vrpnTimedSharedFloatCallback, void *); - // Callbacks are (currently) called *AFTER* the assignment - // has been made, so any check of the value of their shared int - // will return newValue - - void setSerializerPolicy(vrpn_SerializerPolicy policy = vrpn_ACCEPT, - vrpnSharedFloatSerializerPolicy f = NULL, - void *userdata = NULL); - -protected: - vrpn_float64 d_value; - - // callback code - // Could generalize this by making a class that gets passed - // a vrpn_HANDLERPARAM and passes whatever is needed to its callback, - // but it's not worth doing that unless we need a third or fourth - // kind of callback. - struct callbackEntry { - vrpnSharedFloatCallback handler; - void *userdata; - callbackEntry *next; - }; - callbackEntry *d_callbacks; - struct timedCallbackEntry { - vrpnTimedSharedFloatCallback handler; - void *userdata; - timedCallbackEntry *next; - }; - timedCallbackEntry *d_timedCallbacks; - - vrpn_SerializerPolicy d_policy; // default to vrpn_ACCEPT - vrpnSharedFloatSerializerPolicy d_policyCallback; - void *d_policyUserdata; - - vrpn_Shared_float64 &set(vrpn_float64, timeval, vrpn_bool isLocalSet); - - virtual vrpn_bool shouldAcceptUpdate(vrpn_float64 newValue, timeval when, - vrpn_bool isLocalSet); - - virtual void sendUpdate(void); - void sendUpdate(vrpn_float64 newValue, timeval when); - void encode(char **buffer, vrpn_int32 *len, vrpn_float64 newValue, - timeval when) const; - void decode(const char **buffer, vrpn_int32 *len, vrpn_float64 *newValue, - timeval *when) const; - - int yankCallbacks(vrpn_bool isLocal); - // must set d_lastUpdate BEFORE calling yankCallbacks() - - int handleUpdate(vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_lamportUpdate(void *, vrpn_HANDLERPARAM); -}; - -class VRPN_API vrpn_Shared_float64_Server : public vrpn_Shared_float64 { - -public: - vrpn_Shared_float64_Server(const char *name, vrpn_float64 defaultValue = 0, - vrpn_int32 defaultMode = VRPN_SO_DEFAULT); - virtual ~vrpn_Shared_float64_Server(void); - - vrpn_Shared_float64_Server &operator=(vrpn_float64 newValue); - - virtual void bindConnection(vrpn_Connection *); - -protected: -}; - -class VRPN_API vrpn_Shared_float64_Remote : public vrpn_Shared_float64 { - -public: - vrpn_Shared_float64_Remote(const char *name, vrpn_float64 defaultValue = 0, - vrpn_int32 defaultMode = VRPN_SO_DEFAULT); - virtual ~vrpn_Shared_float64_Remote(void); - - vrpn_Shared_float64_Remote &operator=(vrpn_float64 newValue); - - virtual void bindConnection(vrpn_Connection *); -}; - -class VRPN_API vrpn_Shared_String : public vrpn_SharedObject { - -public: - vrpn_Shared_String(const char *name, const char *defaultValue = NULL, - vrpn_int32 mode = VRPN_SO_DEFAULT); - virtual ~vrpn_Shared_String(void); - - // ACCESSORS - - const char *value(void) const; - operator const char *() const; - - // MANIPULATORS - - vrpn_Shared_String &operator=(const char *newValue); - // calls set(newValue, now); - - virtual vrpn_Shared_String &set(const char *newValue, timeval when); - // calls protected set (newValue, when, vrpn_TRUE); - - void register_handler(vrpnSharedStringCallback, void *); - void unregister_handler(vrpnSharedStringCallback, void *); - void register_handler(vrpnTimedSharedStringCallback, void *); - void unregister_handler(vrpnTimedSharedStringCallback, void *); - // Callbacks are (currently) called *AFTER* the assignment - // has been made, so any check of the value of their shared int - // will return newValue - - void setSerializerPolicy(vrpn_SerializerPolicy policy = vrpn_ACCEPT, - vrpnSharedStringSerializerPolicy f = NULL, - void *userdata = NULL); - -protected: - char *d_value; - - // callback code - // Could generalize this by making a class that gets passed - // a vrpn_HANDLERPARAM and passes whatever is needed to its callback, - // but it's not worth doing that unless we need a third or fourth - // kind of callback. - struct callbackEntry { - vrpnSharedStringCallback handler; - void *userdata; - callbackEntry *next; - }; - callbackEntry *d_callbacks; - struct timedCallbackEntry { - vrpnTimedSharedStringCallback handler; - void *userdata; - timedCallbackEntry *next; - }; - timedCallbackEntry *d_timedCallbacks; - - vrpn_SerializerPolicy d_policy; // default to vrpn_ACCEPT - vrpnSharedStringSerializerPolicy d_policyCallback; - void *d_policyUserdata; - - vrpn_Shared_String &set(const char *, timeval, vrpn_bool isLocalSet); - - virtual vrpn_bool shouldAcceptUpdate(const char *newValue, timeval when, - vrpn_bool isLocalSet); - - virtual void sendUpdate(void); - void sendUpdate(const char *newValue, timeval when); - void encode(char **buffer, vrpn_int32 *len, const char *newValue, - timeval when) const; - void decode(const char **buffer, vrpn_int32 *len, char *newValue, - timeval *when) const; - - int yankCallbacks(vrpn_bool isLocal); - // must set d_lastUpdate BEFORE calling yankCallbacks() - - int handleUpdate(vrpn_HANDLERPARAM); - static int VRPN_CALLBACK handle_lamportUpdate(void *, vrpn_HANDLERPARAM); -}; - -class VRPN_API vrpn_Shared_String_Server : public vrpn_Shared_String { - -public: - vrpn_Shared_String_Server(const char *name, const char *defaultValue = NULL, - vrpn_int32 defaultMode = VRPN_SO_DEFAULT); - virtual ~vrpn_Shared_String_Server(void); - - vrpn_Shared_String_Server &operator=(const char *); - - virtual void bindConnection(vrpn_Connection *); - -protected: -}; - -class VRPN_API vrpn_Shared_String_Remote : public vrpn_Shared_String { - -public: - vrpn_Shared_String_Remote(const char *name, const char *defaultValue = NULL, - vrpn_int32 defaultMode = VRPN_SO_DEFAULT); - virtual ~vrpn_Shared_String_Remote(void); - - vrpn_Shared_String_Remote &operator=(const char *); - - virtual void bindConnection(vrpn_Connection *); -}; - -#endif // VRPN_SHARED_OBJECT diff --git a/src/vrpn/vrpn_Sound.C b/src/vrpn/vrpn_Sound.C deleted file mode 100644 index a363cd410769ec50a4d38f2dcc812b02dd095587..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Sound.C +++ /dev/null @@ -1,1704 +0,0 @@ -#include <stdio.h> // for fprintf, stderr, printf -#include <string.h> // for strlen - -#include "vrpn_Connection.h" // for vrpn_HANDLERPARAM, etc -#include "vrpn_Sound.h" - -// vrpn_Sound constructor. -vrpn_Sound::vrpn_Sound(const char *name, vrpn_Connection *c) - : vrpn_BaseClass(name, c) -{ - vrpn_BaseClass::init(); -} - -int vrpn_Sound::register_types(void) -{ - load_sound_local = - d_connection->register_message_type("vrpn_Sound Load_Local"); - load_sound_remote = - d_connection->register_message_type("vrpn_Sound Load_Remote"); - unload_sound = d_connection->register_message_type("vrpn_Sound Unload"); - play_sound = d_connection->register_message_type("vrpn_Sound Play"); - stop_sound = d_connection->register_message_type("vrpn_Sound Stop"); - change_sound_status = - d_connection->register_message_type("vrpn_Sound Status"); - - set_listener_pose = - d_connection->register_message_type("vrpn_Sound Listener_Pose"); - set_listener_velocity = - d_connection->register_message_type("vrpn_Sound Listener_Velocity"); - - set_sound_pose = d_connection->register_message_type("vrpn_Sound Pose"); - set_sound_velocity = - d_connection->register_message_type("vrpn_Sound Velocity"); - set_sound_distanceinfo = - d_connection->register_message_type("vrpn_Sound DistInfo"); - set_sound_coneinfo = - d_connection->register_message_type("vrpn_Sound ConeInfo"); - - set_sound_doplerfactor = - d_connection->register_message_type("vrpn_Sound DopFac"); - set_sound_eqvalue = d_connection->register_message_type("vrpn_Sound EqVal"); - set_sound_pitch = d_connection->register_message_type("vrpn_Sound Pitch"); - set_sound_volume = d_connection->register_message_type("vrpn_Sound Volume"); - - load_model_local = - d_connection->register_message_type("vrpn_Sound Load_Model_Local"); - load_model_remote = - d_connection->register_message_type("vrpn_Sound Load_Model_Remote"); - load_polyquad = - d_connection->register_message_type("vrpn_Sound Load_Poly_Quad"); - load_polytri = - d_connection->register_message_type("vrpn_Sound Load_Poly_Tri"); - load_material = - d_connection->register_message_type("vrpn_Sound Load_Material"); - set_polyquad_vertices = - d_connection->register_message_type("vrpn_Sound Quad_Vertices"); - set_polytri_vertices = - d_connection->register_message_type("vrpn_Sound Tri_Vertices"); - set_poly_openingfactor = - d_connection->register_message_type("vrpn_Sound Poly_OF"); - set_poly_material = - d_connection->register_message_type("vrpn_Sound Poly_Material"); - - return 0; -} - -vrpn_Sound::~vrpn_Sound() {} - -vrpn_int32 vrpn_Sound::encodeSound_local(const char *filename, - const vrpn_SoundID id, - const vrpn_SoundDef sound, char **buf) -{ - vrpn_int32 len = static_cast<vrpn_int32>( - sizeof(vrpn_SoundID) + strlen(filename) + sizeof(vrpn_SoundDef) + 1); - vrpn_int32 ret = len; - char *mptr; - int i; - - *buf = new char[len]; - - mptr = *buf; - vrpn_buffer(&mptr, &len, id); - - for (i = 0; i < 3; i++) - vrpn_buffer(&mptr, &len, sound.pose.position[i]); - - for (i = 0; i < 4; i++) - vrpn_buffer(&mptr, &len, sound.pose.orientation[i]); - - for (i = 0; i < 4; i++) - vrpn_buffer(&mptr, &len, sound.velocity[i]); - - vrpn_buffer(&mptr, &len, sound.volume); - - vrpn_buffer(&mptr, &len, sound.max_back_dist); - vrpn_buffer(&mptr, &len, sound.min_back_dist); - vrpn_buffer(&mptr, &len, sound.max_front_dist); - vrpn_buffer(&mptr, &len, sound.min_front_dist); - - vrpn_buffer(&mptr, &len, sound.cone_inner_angle); - vrpn_buffer(&mptr, &len, sound.cone_outer_angle); - vrpn_buffer(&mptr, &len, sound.cone_gain); - vrpn_buffer(&mptr, &len, sound.dopler_scale); - vrpn_buffer(&mptr, &len, sound.equalization_val); - vrpn_buffer(&mptr, &len, sound.pitch); - - vrpn_buffer(&mptr, &len, filename, - static_cast<vrpn_int32>(strlen(filename)) + 1); - - return ret; -} - -// Decodes the file and Client Index number -vrpn_int32 vrpn_Sound::decodeSound_local(const char *buf, char **filename, - vrpn_SoundID *id, vrpn_SoundDef *sound, - const int payload) -{ - const char *mptr = buf; - int i; - - *filename = - new char[payload - sizeof(vrpn_SoundID) - sizeof(vrpn_SoundDef)]; - - vrpn_unbuffer(&mptr, id); - - for (i = 0; i < 3; i++) - vrpn_unbuffer(&mptr, &(sound->pose.position[i])); - - for (i = 0; i < 4; i++) - vrpn_unbuffer(&mptr, &(sound->pose.orientation[i])); - - for (i = 0; i < 4; i++) - vrpn_unbuffer(&mptr, &(sound->velocity[i])); - - vrpn_unbuffer(&mptr, &(sound->volume)); - - vrpn_unbuffer(&mptr, &(sound->max_back_dist)); - vrpn_unbuffer(&mptr, &(sound->min_back_dist)); - vrpn_unbuffer(&mptr, &(sound->max_front_dist)); - vrpn_unbuffer(&mptr, &(sound->min_front_dist)); - - vrpn_unbuffer(&mptr, &(sound->cone_inner_angle)); - vrpn_unbuffer(&mptr, &(sound->cone_outer_angle)); - vrpn_unbuffer(&mptr, &(sound->cone_gain)); - vrpn_unbuffer(&mptr, &(sound->dopler_scale)); - vrpn_unbuffer(&mptr, &(sound->equalization_val)); - vrpn_unbuffer(&mptr, &(sound->pitch)); - - vrpn_unbuffer(&mptr, *filename, - payload - sizeof(vrpn_SoundID) - sizeof(vrpn_SoundDef)); - - return 0; -} - -/// @todo not supported -vrpn_int32 vrpn_Sound::encodeSound_remote(const char * /*filename*/, - const vrpn_SoundID /*id*/, - char ** /*buf*/) -{ - return 0; -} -/// @todo not supported yet -vrpn_int32 vrpn_Sound::decodeSound_remote(const char * /*buf*/, - char ** /*filename*/, - vrpn_SoundID * /*id*/, - const int /*payload*/) -{ - return 0; -} - -// Encodes the client sound ID -vrpn_int32 vrpn_Sound::encodeSoundID(const vrpn_SoundID id, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_SoundID); - - vrpn_buffer(&mptr, &len, id); - - return (sizeof(vrpn_SoundID)); -} - -// Decodes the client sound ID -vrpn_int32 vrpn_Sound::decodeSoundID(const char *buf, vrpn_SoundID *id) -{ - const char *mptr = buf; - - vrpn_unbuffer(&mptr, id); - - return 0; -} - -// Sends all the information necessary to play a sound appropriately. -// IE, The sounds position, orientation, velocity, volume and repeat count -vrpn_int32 vrpn_Sound::encodeSoundDef(const vrpn_SoundDef sound, - const vrpn_SoundID id, - const vrpn_int32 repeat, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = - sizeof(vrpn_SoundDef) + sizeof(vrpn_SoundID) + sizeof(vrpn_int32); - vrpn_int32 ret = len; - int i; - - vrpn_buffer(&mptr, &len, repeat); - vrpn_buffer(&mptr, &len, id); - - for (i = 0; i < 3; i++) - vrpn_buffer(&mptr, &len, sound.pose.position[i]); - - for (i = 0; i < 4; i++) - vrpn_buffer(&mptr, &len, sound.pose.orientation[i]); - - for (i = 0; i < 4; i++) - vrpn_buffer(&mptr, &len, sound.velocity[i]); - - vrpn_buffer(&mptr, &len, sound.volume); - - vrpn_buffer(&mptr, &len, sound.max_back_dist); - vrpn_buffer(&mptr, &len, sound.min_back_dist); - vrpn_buffer(&mptr, &len, sound.max_front_dist); - vrpn_buffer(&mptr, &len, sound.min_front_dist); - - vrpn_buffer(&mptr, &len, sound.cone_inner_angle); - vrpn_buffer(&mptr, &len, sound.cone_outer_angle); - vrpn_buffer(&mptr, &len, sound.cone_gain); - vrpn_buffer(&mptr, &len, sound.dopler_scale); - vrpn_buffer(&mptr, &len, sound.equalization_val); - vrpn_buffer(&mptr, &len, sound.pitch); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSoundDef(const char *buf, vrpn_SoundDef *sound, - vrpn_SoundID *id, vrpn_int32 *repeat) -{ - const char *mptr = buf; - int i; - - vrpn_unbuffer(&mptr, repeat); - vrpn_unbuffer(&mptr, id); - - for (i = 0; i < 3; i++) - vrpn_unbuffer(&mptr, &(sound->pose.position[i])); - - for (i = 0; i < 4; i++) - vrpn_unbuffer(&mptr, &(sound->pose.orientation[i])); - - for (i = 0; i < 4; i++) - vrpn_unbuffer(&mptr, &(sound->velocity[i])); - - vrpn_unbuffer(&mptr, &(sound->volume)); - - vrpn_unbuffer(&mptr, &(sound->max_back_dist)); - vrpn_unbuffer(&mptr, &(sound->min_back_dist)); - vrpn_unbuffer(&mptr, &(sound->max_front_dist)); - vrpn_unbuffer(&mptr, &(sound->min_front_dist)); - - vrpn_unbuffer(&mptr, &(sound->cone_inner_angle)); - vrpn_unbuffer(&mptr, &(sound->cone_outer_angle)); - vrpn_unbuffer(&mptr, &(sound->cone_gain)); - vrpn_unbuffer(&mptr, &(sound->dopler_scale)); - vrpn_unbuffer(&mptr, &(sound->equalization_val)); - vrpn_unbuffer(&mptr, &(sound->pitch)); - - return 0; -} - -// Sends information about the listener. IE position, orientation and velocity -vrpn_int32 vrpn_Sound::encodeListenerPose(const vrpn_PoseDef pose, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_ListenerDef); - vrpn_int32 ret = len; - int i; - - for (i = 0; i < 3; i++) - vrpn_buffer(&mptr, &len, pose.position[i]); - - for (i = 0; i < 4; i++) - vrpn_buffer(&mptr, &len, pose.orientation[i]); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeListenerPose(const char *buf, vrpn_PoseDef *pose) -{ - const char *mptr = buf; - int i; - - for (i = 0; i < 3; i++) - vrpn_unbuffer(&mptr, &pose->position[i]); - - for (i = 0; i < 4; i++) - vrpn_unbuffer(&mptr, &pose->orientation[i]); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSoundPlay(const vrpn_SoundID id, - const vrpn_int32 repeat, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_SoundID) + sizeof(vrpn_int32); - vrpn_int32 ret = len; - - vrpn_buffer(&mptr, &len, repeat); - vrpn_buffer(&mptr, &len, id); - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSoundPlay(const char *buf, vrpn_SoundID *id, - vrpn_int32 *repeat) -{ - const char *mptr = buf; - - vrpn_unbuffer(&mptr, repeat); - vrpn_unbuffer(&mptr, id); - return 0; -} - -vrpn_int32 vrpn_Sound::encodeListenerVelocity(const vrpn_float64 *velocity, - char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_float64) * 4; - vrpn_int32 ret = len; - int i; - - for (i = 0; i < 4; i++) - vrpn_buffer(&mptr, &len, velocity[i]); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeListenerVelocity(const char *buf, - vrpn_float64 *velocity) -{ - const char *mptr = buf; - - for (int i = 0; i < 4; i++) - vrpn_unbuffer(&mptr, &velocity[i]); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSoundPose(const vrpn_PoseDef pose, - const vrpn_SoundID id, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_SoundID) + sizeof(vrpn_PoseDef); - vrpn_int32 ret = len; - int i; - - vrpn_buffer(&mptr, &len, id); - - for (i = 0; i < 4; i++) - vrpn_buffer(&mptr, &len, pose.orientation[i]); - - for (i = 0; i < 3; i++) - vrpn_buffer(&mptr, &len, pose.position[i]); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSoundPose(const char *buf, vrpn_PoseDef *pose, - vrpn_SoundID *id) -{ - const char *mptr = buf; - int i; - - vrpn_unbuffer(&mptr, id); - - for (i = 0; i < 4; i++) - vrpn_unbuffer(&mptr, &pose->orientation[i]); - - for (i = 0; i < 3; i++) - vrpn_unbuffer(&mptr, &pose->position[i]); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSoundVelocity(const vrpn_float64 *velocity, - const vrpn_SoundID id, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_SoundID) + sizeof(vrpn_float64) * 4; - vrpn_int32 ret = len; - int i; - - vrpn_buffer(&mptr, &len, id); - - for (i = 0; i < 4; i++) - vrpn_buffer(&mptr, &len, velocity[i]); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSoundVelocity(const char *buf, - vrpn_float64 *velocity, - vrpn_SoundID *id) -{ - const char *mptr = buf; - int i; - - vrpn_unbuffer(&mptr, id); - - for (i = 0; i < 4; i++) - vrpn_unbuffer(&mptr, &velocity[i]); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSoundDistInfo(const vrpn_float64 min_back, - const vrpn_float64 max_back, - const vrpn_float64 min_front, - const vrpn_float64 max_front, - const vrpn_SoundID id, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_SoundID) + sizeof(vrpn_float64) * 4; - vrpn_int32 ret = len; - - vrpn_buffer(&mptr, &len, id); - - vrpn_buffer(&mptr, &len, min_back); - vrpn_buffer(&mptr, &len, max_back); - vrpn_buffer(&mptr, &len, min_front); - vrpn_buffer(&mptr, &len, max_front); - - return ret; -} -vrpn_int32 -vrpn_Sound::decodeSoundDistInfo(const char *buf, vrpn_float64 *min_back, - vrpn_float64 *max_back, vrpn_float64 *min_front, - vrpn_float64 *max_front, vrpn_SoundID *id) -{ - const char *mptr = buf; - vrpn_unbuffer(&mptr, id); - - vrpn_unbuffer(&mptr, min_back); - vrpn_unbuffer(&mptr, max_back); - vrpn_unbuffer(&mptr, min_front); - vrpn_unbuffer(&mptr, max_front); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSoundConeInfo(const vrpn_float64 cone_inner_angle, - const vrpn_float64 cone_outer_angle, - const vrpn_float64 cone_gain, - const vrpn_SoundID id, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_SoundID) + sizeof(vrpn_float64) * 3; - vrpn_int32 ret = len; - - vrpn_buffer(&mptr, &len, id); - - vrpn_buffer(&mptr, &len, cone_inner_angle); - vrpn_buffer(&mptr, &len, cone_outer_angle); - vrpn_buffer(&mptr, &len, cone_gain); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSoundConeInfo(const char *buf, - vrpn_float64 *cone_inner_angle, - vrpn_float64 *cone_outer_angle, - vrpn_float64 *cone_gain, - vrpn_SoundID *id) -{ - const char *mptr = buf; - - vrpn_unbuffer(&mptr, id); - - vrpn_unbuffer(&mptr, cone_inner_angle); - vrpn_unbuffer(&mptr, cone_outer_angle); - vrpn_unbuffer(&mptr, cone_gain); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSoundDoplerScale(const vrpn_float64 doplerfactor, - const vrpn_SoundID id, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_SoundID) + sizeof(vrpn_float64); - vrpn_int32 ret = len; - - vrpn_buffer(&mptr, &len, id); - - vrpn_buffer(&mptr, &len, doplerfactor); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSoundDoplerScale(const char *buf, - vrpn_float64 *doplerfactor, - vrpn_SoundID *id) -{ - const char *mptr = buf; - - vrpn_unbuffer(&mptr, id); - vrpn_unbuffer(&mptr, doplerfactor); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSoundEqFactor(const vrpn_float64 eqfactor, - const vrpn_SoundID id, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_SoundID) + sizeof(vrpn_float64); - vrpn_int32 ret = len; - - vrpn_buffer(&mptr, &len, id); - - vrpn_buffer(&mptr, &len, eqfactor); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSoundEqFactor(const char *buf, - vrpn_float64 *eqfactor, - vrpn_SoundID *id) -{ - const char *mptr = buf; - - vrpn_unbuffer(&mptr, id); - - vrpn_unbuffer(&mptr, eqfactor); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSoundPitch(const vrpn_float64 pitch, - const vrpn_SoundID id, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_SoundID) + sizeof(vrpn_float64); - vrpn_int32 ret = len; - - vrpn_buffer(&mptr, &len, id); - - vrpn_buffer(&mptr, &len, pitch); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSoundPitch(const char *buf, vrpn_float64 *pitch, - vrpn_SoundID *id) -{ - const char *mptr = buf; - - vrpn_unbuffer(&mptr, id); - - vrpn_unbuffer(&mptr, pitch); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSoundVolume(const vrpn_float64 volume, - const vrpn_SoundID id, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_SoundID) + sizeof(vrpn_float64); - vrpn_int32 ret = len; - - vrpn_buffer(&mptr, &len, id); - - vrpn_buffer(&mptr, &len, volume); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSoundVolume(const char *buf, vrpn_float64 *volume, - vrpn_SoundID *id) -{ - const char *mptr = buf; - - vrpn_unbuffer(&mptr, id); - vrpn_unbuffer(&mptr, volume); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeLoadModel_local(const char *filename, char **buf) -{ - vrpn_int32 len = - static_cast<vrpn_int32>(sizeof(vrpn_SoundID) + strlen(filename) + 1); - vrpn_int32 ret = len; - char *mptr; - - *buf = new char[strlen(filename) + sizeof(vrpn_SoundID) + 1]; - - mptr = *buf; - vrpn_buffer(&mptr, &len, filename, - static_cast<vrpn_int32>(strlen(filename)) + 1); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeLoadModel_local(const char *buf, char **filename, - const int payload) -{ - const char *mptr = buf; - - *filename = new char[payload - sizeof(vrpn_SoundID)]; - - vrpn_unbuffer(&mptr, *filename, payload - sizeof(vrpn_SoundID)); - - return 0; -} - -/// @todo Remote stuff not supported yet! -vrpn_int32 vrpn_Sound::encodeLoadModel_remote(const char * /*filename*/, - char ** /*buf*/) -{ - return 0; -} -/// @todo Remote stuff not supported yet! -vrpn_int32 vrpn_Sound::decodeLoadModel_remote(const char * /*buf*/, - char ** /*filename*/, - const int /*payload*/) -{ - return 0; -} - -vrpn_int32 vrpn_Sound::encodeLoadPolyQuad(const vrpn_QuadDef quad, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_QuadDef); - vrpn_int32 ret = len; - int i; - - vrpn_buffer(&mptr, &len, quad.subQuad); - vrpn_buffer(&mptr, &len, quad.openingFactor); - vrpn_buffer(&mptr, &len, quad.tag); - for (i = 0; i < 4; i++) - for (int j(0); j < 3; j++) - vrpn_buffer(&mptr, &len, quad.vertices[i][j]); - - vrpn_buffer(&mptr, &len, quad.material_name, MAX_MATERIAL_NAME_LENGTH); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeLoadPolyQuad(const char *buf, vrpn_QuadDef *quad) -{ - const char *mptr = buf; - int i; - - vrpn_unbuffer(&mptr, &quad->subQuad); - vrpn_unbuffer(&mptr, &quad->openingFactor); - vrpn_unbuffer(&mptr, &quad->tag); - for (i = 0; i < 4; i++) - for (int j(0); j < 3; j++) - vrpn_unbuffer(&mptr, &quad->vertices[i][j]); - vrpn_unbuffer(&mptr, quad->material_name, MAX_MATERIAL_NAME_LENGTH); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeLoadPolyTri(const vrpn_TriDef tri, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_int32) + sizeof(vrpn_TriDef); - vrpn_int32 ret = len; - int i; - - vrpn_buffer(&mptr, &len, tri.subTri); - vrpn_buffer(&mptr, &len, tri.openingFactor); - vrpn_buffer(&mptr, &len, tri.tag); - for (i = 0; i < 3; i++) - for (int j(0); j < 3; j++) - vrpn_buffer(&mptr, &len, tri.vertices[i][j]); - vrpn_buffer(&mptr, &len, tri.material_name, MAX_MATERIAL_NAME_LENGTH); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeLoadPolyTri(const char *buf, vrpn_TriDef *tri) -{ - const char *mptr = buf; - int i; - - vrpn_unbuffer(&mptr, &tri->subTri); - vrpn_unbuffer(&mptr, &tri->openingFactor); - vrpn_unbuffer(&mptr, &tri->tag); - for (i = 0; i < 3; i++) - for (int j(0); j < 3; j++) - vrpn_unbuffer(&mptr, &tri->vertices[i][j]); - vrpn_unbuffer(&mptr, tri->material_name, MAX_MATERIAL_NAME_LENGTH); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeLoadMaterial(const vrpn_int32 id, - const vrpn_MaterialDef material, - char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_int32) + sizeof(vrpn_MaterialDef); - vrpn_int32 ret = len; - - vrpn_buffer(&mptr, &len, id); - - vrpn_buffer(&mptr, &len, material.material_name, MAX_MATERIAL_NAME_LENGTH); - vrpn_buffer(&mptr, &len, material.transmittance_gain); - vrpn_buffer(&mptr, &len, material.transmittance_highfreq); - vrpn_buffer(&mptr, &len, material.reflectance_gain); - vrpn_buffer(&mptr, &len, material.reflectance_highfreq); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeLoadMaterial(const char *buf, - vrpn_MaterialDef *material, - vrpn_int32 *id) -{ - const char *mptr = buf; - - vrpn_unbuffer(&mptr, id); - - vrpn_unbuffer(&mptr, material->material_name, MAX_MATERIAL_NAME_LENGTH); - vrpn_unbuffer(&mptr, &material->transmittance_gain); - vrpn_unbuffer(&mptr, &material->transmittance_highfreq); - vrpn_unbuffer(&mptr, &material->reflectance_gain); - vrpn_unbuffer(&mptr, &material->reflectance_highfreq); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSetQuadVert(const vrpn_float64 vertices[4][3], - const vrpn_int32 tag, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_int32) + sizeof(vrpn_float64) * 12; - vrpn_int32 ret = len; - - vrpn_buffer(&mptr, &len, tag); - - for (int i = 0; i < 4; i++) - for (int j(0); j < 3; j++) - vrpn_buffer(&mptr, &len, vertices[i][j]); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSetQuadVert(const char *buf, - vrpn_float64 (*vertices)[4][3], - vrpn_int32 *tag) -{ - const char *mptr = buf; - - vrpn_unbuffer(&mptr, tag); - - for (int i = 0; i < 4; i++) - for (int j(0); j < 3; j++) - vrpn_unbuffer(&mptr, vertices[i][j]); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSetTriVert(const vrpn_float64 vertices[4][3], - const vrpn_int32 tag, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_int32) + sizeof(vrpn_float64) * 9; - vrpn_int32 ret = len; - - vrpn_buffer(&mptr, &len, tag); - - for (int i = 0; i < 3; i++) - for (int j(0); j < 3; j++) - vrpn_buffer(&mptr, &len, vertices[i][j]); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSetTriVert(const char *buf, - vrpn_float64 (*vertices)[3][3], - vrpn_int32 *tag) -{ - const char *mptr = buf; - - vrpn_unbuffer(&mptr, tag); - - for (int i = 0; i < 3; i++) - for (int j(0); j < 3; j++) - vrpn_unbuffer(&mptr, vertices[i][j]); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSetPolyOF(const vrpn_float64 openingfactor, - const vrpn_int32 tag, char *buf) -{ - char *mptr = buf; - vrpn_int32 len = sizeof(vrpn_SoundID) + sizeof(vrpn_float64); - vrpn_int32 ret = len; - - vrpn_buffer(&mptr, &len, tag); - - vrpn_buffer(&mptr, &len, openingfactor); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSetPolyOF(const char *buf, - vrpn_float64 *openingfactor, - vrpn_int32 *tag) -{ - const char *mptr = buf; - - vrpn_unbuffer(&mptr, tag); - - vrpn_unbuffer(&mptr, openingfactor); - - return 0; -} - -vrpn_int32 vrpn_Sound::encodeSetPolyMaterial(const char *material, - const vrpn_int32 tag, char *buf) -{ - vrpn_int32 len = sizeof(vrpn_SoundID) + 128; - vrpn_int32 ret = len; - char *mptr = buf; - - vrpn_buffer(&mptr, &len, tag); - vrpn_buffer(&mptr, &len, material, 128); - - return ret; -} - -vrpn_int32 vrpn_Sound::decodeSetPolyMaterial(const char *buf, char **material, - vrpn_int32 *tag, const int) -{ - const char *mptr = buf; - - vrpn_unbuffer(&mptr, tag); - vrpn_unbuffer(&mptr, *material, 128); - - return 0; -} - -/******************************************************************************************** - Begin vrpn_Sound_Client - *******************************************************************************************/ -vrpn_Sound_Client::vrpn_Sound_Client(const char *name, vrpn_Connection *c) - : vrpn_Sound(name, c) - , vrpn_Text_Receiver(name, c) -{ - vrpn_Text_Receiver::register_message_handler(this, - handle_receiveTextMessage); -} - -vrpn_Sound_Client::~vrpn_Sound_Client() {} - -/*Sends a play sound message to the server. Sends the id of the sound to play - and the repeat value. If 0 then it plays it continuously*/ -vrpn_int32 vrpn_Sound_Client::playSound(const vrpn_SoundID id, - vrpn_int32 repeat) -{ - - char buf[sizeof(vrpn_SoundID) + sizeof(vrpn_int32)]; - vrpn_int32 len; - - len = encodeSoundPlay(id, repeat, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, play_sound, - d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf(stderr, - "vrpn_Sound_Client: cannot write message play: tossing\n"); - - return 0; -} - -/*Stops a playing sound*/ -vrpn_int32 vrpn_Sound_Client::stopSound(const vrpn_SoundID id) -{ - char buf[sizeof(vrpn_SoundID)]; - vrpn_int32 len; - - len = encodeSoundID(id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, stop_sound, - d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf(stderr, - "vrpn_Sound_Client: cannot write message play: tossing\n"); - - return 0; -} - -/*Loads a sound file on the server machine for playing. Returns a vrpn_SoundID - to - be used to refer to that sound from now on*/ -vrpn_SoundID vrpn_Sound_Client::loadSound(const char *sound, - const vrpn_SoundID id, - const vrpn_SoundDef soundDef) -{ - vrpn_int32 len; - char *buf; - - len = encodeSound_local(sound, id, soundDef, &buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, load_sound_local, - d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf(stderr, - "vrpn_Sound_Client: cannot write message load: tossing\n"); - - delete[] buf; - return id; -} - -/*Unloads a sound file on the server side*/ -vrpn_int32 vrpn_Sound_Client::unloadSound(const vrpn_SoundID id) -{ - vrpn_int32 len; - char buf[sizeof(vrpn_SoundID)]; - - len = encodeSoundID(id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, unload_sound, - d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf(stderr, - "vrpn_Sound_Client: cannot write message unload: tossing\n"); - - return 0; -} - -vrpn_int32 vrpn_Sound_Client::setSoundVolume(const vrpn_SoundID id, - const vrpn_float64 volume) -{ - char buf[sizeof(vrpn_SoundID) + sizeof(vrpn_float64)]; - vrpn_int32 len; - - len = encodeSoundVolume(volume, id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, set_sound_volume, - d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - - return 0; -} - -vrpn_int32 vrpn_Sound_Client::setSoundPose(const vrpn_SoundID id, - vrpn_float64 position[3], - vrpn_float64 orientation[4]) -{ - char buf[sizeof(vrpn_PoseDef) + sizeof(vrpn_SoundID)]; - vrpn_int32 len; - vrpn_PoseDef tempdef; - int i; - for (i = 0; i < 4; i++) { - tempdef.orientation[i] = orientation[i]; - } - for (i = 0; i < 3; i++) { - tempdef.position[i] = position[i]; - } - - len = encodeSoundPose(tempdef, id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, set_sound_pose, - d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) { - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - } - - return 0; -} - -vrpn_int32 vrpn_Sound_Client::setSoundVelocity(const vrpn_SoundID id, - const vrpn_float64 velocity[4]) -{ - char buf[sizeof(vrpn_float64) * 4 + sizeof(vrpn_SoundID)]; - vrpn_int32 len; - - len = encodeSoundVelocity(velocity, id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, - set_sound_velocity, d_sender_id, - buf, vrpn_CONNECTION_RELIABLE)) - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - - return 0; -} - -vrpn_int32 vrpn_Sound_Client::setSoundDistances( - const vrpn_SoundID id, const vrpn_float64 max_front_dist, - const vrpn_float64 min_front_dist, const vrpn_float64 max_back_dist, - const vrpn_float64 min_back_dist) -{ - char buf[sizeof(vrpn_float64) * 4 + sizeof(vrpn_SoundID)]; - vrpn_int32 len; - - len = encodeSoundDistInfo(max_front_dist, min_front_dist, max_back_dist, - min_back_dist, id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message( - len, timestamp, set_sound_distanceinfo, d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - - return 0; -} - -vrpn_int32 vrpn_Sound_Client::setSoundConeInfo(const vrpn_SoundID id, - const vrpn_float64 inner_angle, - const vrpn_float64 outer_angle, - const vrpn_float64 gain) -{ - - char buf[sizeof(vrpn_float64) * 3 + sizeof(vrpn_SoundID)]; - vrpn_int32 len; - - len = encodeSoundConeInfo(inner_angle, outer_angle, gain, id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, - set_sound_coneinfo, d_sender_id, - buf, vrpn_CONNECTION_RELIABLE)) - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - - return 0; -} - -vrpn_int32 vrpn_Sound_Client::setSoundDopScale(const vrpn_SoundID id, - vrpn_float64 dopfactor) -{ - - char buf[sizeof(vrpn_float64) + sizeof(vrpn_SoundID)]; - vrpn_int32 len; - - len = encodeSoundDoplerScale(dopfactor, id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message( - len, timestamp, set_sound_doplerfactor, d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - - return 0; -} - -vrpn_int32 vrpn_Sound_Client::setSoundEqValue(const vrpn_SoundID id, - vrpn_float64 eq_value) -{ - char buf[sizeof(vrpn_float64) + sizeof(vrpn_SoundID)]; - vrpn_int32 len; - - len = encodeSoundEqFactor(eq_value, id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, - set_sound_eqvalue, d_sender_id, - buf, vrpn_CONNECTION_RELIABLE)) - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - - return 0; -} - -vrpn_int32 vrpn_Sound_Client::setSoundPitch(const vrpn_SoundID id, - vrpn_float64 pitch) -{ - char buf[sizeof(vrpn_float64) + sizeof(vrpn_SoundID)]; - vrpn_int32 len; - - len = encodeSoundPitch(pitch, id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, set_sound_pitch, - d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - - return 0; -} - -vrpn_int32 vrpn_Sound_Client::setListenerPose(const vrpn_float64 position[3], - const vrpn_float64 orientation[4]) -{ - char buf[sizeof(vrpn_PoseDef)]; - vrpn_int32 len; - vrpn_PoseDef tempdef; - int i; - - for (i = 0; i < 4; i++) { - tempdef.orientation[i] = orientation[i]; - } - for (i = 0; i < 3; i++) { - tempdef.position[i] = position[i]; - } - - len = encodeListenerPose(tempdef, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, - set_listener_pose, d_sender_id, - buf, vrpn_CONNECTION_RELIABLE)) - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - - return 0; -} - -vrpn_int32 -vrpn_Sound_Client::setListenerVelocity(const vrpn_float64 velocity[4]) -{ - char buf[sizeof(vrpn_float64) * 4]; - vrpn_int32 len; - - len = encodeListenerVelocity(velocity, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message( - len, timestamp, set_listener_velocity, d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) { - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - } - - return 0; -} - -vrpn_int32 vrpn_Sound_Client::LoadModel_local(const char *filename) -{ - vrpn_int32 len; - char *buf; - - len = encodeLoadModel_local(filename, &buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, load_model_local, - d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf(stderr, - "vrpn_Sound_Client: cannot write message load: tossing\n"); - - return 1; -} - -/** @todo Remote stuff not supported yet!*/ -vrpn_int32 vrpn_Sound_Client::LoadModel_remote(const char * /*data*/) -{ - return 0; -} - -vrpn_int32 vrpn_Sound_Client::LoadPolyQuad(const vrpn_QuadDef quad) -{ - vrpn_int32 len; - char buf[sizeof(vrpn_QuadDef)]; - - len = encodeLoadPolyQuad(quad, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, load_polyquad, - d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf(stderr, - "vrpn_Sound_Client: cannot write message load: tossing\n"); - - return quad.tag; -} - -vrpn_int32 vrpn_Sound_Client::LoadPolyTri(const vrpn_TriDef tri) -{ - vrpn_int32 len; - char buf[sizeof(vrpn_TriDef)]; - - len = encodeLoadPolyTri(tri, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, load_polytri, - d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf(stderr, - "vrpn_Sound_Client: cannot write message load: tossing\n"); - - return tri.tag; -} - -vrpn_int32 vrpn_Sound_Client::LoadMaterial(const vrpn_int32 id, - const vrpn_MaterialDef material) -{ - vrpn_int32 len; - char buf[sizeof(vrpn_MaterialDef) + sizeof(vrpn_int32)]; - - len = encodeLoadMaterial(id, material, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, load_material, - d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf(stderr, - "vrpn_Sound_Client: cannot write message load: tossing\n"); - - return id; -} - -vrpn_int32 vrpn_Sound_Client::setPolyOF(const int id, const vrpn_float64 OF) -{ - char buf[sizeof(vrpn_int32) + sizeof(vrpn_float64)]; - vrpn_int32 len; - - len = encodeSetPolyOF(OF, id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message( - len, timestamp, set_poly_openingfactor, d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - - return 0; -} - -vrpn_int32 vrpn_Sound_Client::setQuadVertices(const int id, - const vrpn_float64 vertices[4][3]) -{ - char buf[sizeof(vrpn_int32) + sizeof(vrpn_float64) * 12]; - vrpn_int32 len; - - len = encodeSetQuadVert(vertices, id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message( - len, timestamp, set_polyquad_vertices, d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - - return 0; -} - -vrpn_int32 vrpn_Sound_Client::setPolyMaterialName(const int id, - const char *material_name) -{ - char buf[sizeof(vrpn_int32) + sizeof(material_name)]; - vrpn_int32 len; - - len = encodeSetPolyMaterial(material_name, id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message(len, timestamp, - set_poly_material, d_sender_id, - buf, vrpn_CONNECTION_RELIABLE)) - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - - return 0; -} -vrpn_int32 vrpn_Sound_Client::setTriVertices(const int id, - const vrpn_float64 vertices[3][3]) -{ - char buf[sizeof(vrpn_int32) + sizeof(vrpn_float64) * 9]; - vrpn_int32 len; - - len = encodeSetTriVert(vertices, id, buf); - - vrpn_gettimeofday(×tamp, NULL); - - if (vrpn_Sound::d_connection->pack_message( - len, timestamp, set_polytri_vertices, d_sender_id, buf, - vrpn_CONNECTION_RELIABLE)) - fprintf( - stderr, - "vrpn_Sound_Client: cannot write message change status: tossing\n"); - - return 0; -} - -void vrpn_Sound_Client::mainloop() -{ - vrpn_Sound::d_connection->mainloop(); - client_mainloop(); -} - -void vrpn_Sound_Client::handle_receiveTextMessage(void *userdata, - const vrpn_TEXTCB t) -{ - vrpn_Sound_Client *me = (vrpn_Sound_Client *)userdata; - me->receiveTextMessage(t.message, t.type, t.level, t.msg_time); -} - -void vrpn_Sound_Client::receiveTextMessage(const char *message, vrpn_uint32, - vrpn_uint32, struct timeval) -{ - printf("Virtual: %s\n", message); - return; -} - -/******************************************************************************************** - Begin vrpn_Sound_Server - *******************************************************************************************/ -#ifndef VRPN_CLIENT_ONLY -vrpn_Sound_Server::vrpn_Sound_Server(const char *name, vrpn_Connection *c) - : vrpn_Sound(name, c) - , vrpn_Text_Sender((char *)name, c) -{ - /*Register the handlers*/ - register_autodeleted_handler(load_sound_local, handle_loadSoundLocal, this, - d_sender_id); - register_autodeleted_handler(load_sound_remote, handle_loadSoundRemote, - this, d_sender_id); - register_autodeleted_handler(unload_sound, handle_unloadSound, this, - d_sender_id); - register_autodeleted_handler(play_sound, handle_playSound, this, - d_sender_id); - register_autodeleted_handler(stop_sound, handle_stopSound, this, - d_sender_id); - register_autodeleted_handler(change_sound_status, handle_changeSoundStatus, - this, d_sender_id); - - register_autodeleted_handler(set_listener_pose, handle_setListenerPose, - this, d_sender_id); - register_autodeleted_handler(set_listener_velocity, - handle_setListenerVelocity, this, d_sender_id); - - register_autodeleted_handler(set_sound_pose, handle_setSoundPose, this, - d_sender_id); - register_autodeleted_handler(set_sound_velocity, handle_setSoundVelocity, - this, d_sender_id); - register_autodeleted_handler( - set_sound_distanceinfo, handle_setSoundDistanceinfo, this, d_sender_id); - register_autodeleted_handler(set_sound_coneinfo, handle_setSoundConeinfo, - this, d_sender_id); - - register_autodeleted_handler( - set_sound_doplerfactor, handle_setSoundDoplerfactor, this, d_sender_id); - register_autodeleted_handler(set_sound_eqvalue, handle_setSoundEqvalue, - this, d_sender_id); - register_autodeleted_handler(set_sound_pitch, handle_setSoundPitch, this, - d_sender_id); - register_autodeleted_handler(set_sound_volume, handle_setSoundVolume, this, - d_sender_id); - - register_autodeleted_handler(load_model_local, handle_loadModelLocal, this, - d_sender_id); - register_autodeleted_handler(load_model_remote, handle_loadModelRemote, - this, d_sender_id); - register_autodeleted_handler(load_polyquad, handle_loadPolyquad, this, - d_sender_id); - register_autodeleted_handler(load_polytri, handle_loadPolytri, this, - d_sender_id); - register_autodeleted_handler(load_material, handle_loadMaterial, this, - d_sender_id); - register_autodeleted_handler(set_polyquad_vertices, - handle_setPolyquadVertices, this, d_sender_id); - register_autodeleted_handler(set_polytri_vertices, - handle_setPolytriVertices, this, d_sender_id); - register_autodeleted_handler( - set_poly_openingfactor, handle_setPolyOpeningfactor, this, d_sender_id); - register_autodeleted_handler(set_poly_material, handle_setPolyMaterial, - this, d_sender_id); -} - -vrpn_Sound_Server::~vrpn_Sound_Server() {} - -/****************************************************************************** - Callback Handler routines. - ******************************************************************************/ - -int vrpn_Sound_Server::handle_loadSoundLocal(void *userdata, - vrpn_HANDLERPARAM p) -{ - - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_SoundID id; - vrpn_SoundDef soundDef; - char *filename; - - me->decodeSound_local((char *)p.buffer, &filename, &id, &soundDef, - p.payload_len); - me->loadSoundLocal(filename, id, soundDef); - delete[] filename; - return 0; -} - -/* not supported */ -int vrpn_Sound_Server::handle_loadSoundRemote(void *userdata, - vrpn_HANDLERPARAM p) -{ - return 0; -} -int vrpn_Sound_Server::handle_playSound(void *userdata, vrpn_HANDLERPARAM p) -{ - - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_SoundID id; - vrpn_SoundDef soundDef; - vrpn_int32 repeat; - - me->decodeSoundDef((char *)p.buffer, &soundDef, &id, &repeat); - me->playSound(id, repeat, soundDef); - return 0; -} - -int vrpn_Sound_Server::handle_stopSound(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_SoundID id; - - me->decodeSoundID((char *)p.buffer, &id); - me->stopSound(id); - return 0; -} - -int vrpn_Sound_Server::handle_unloadSound(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_SoundID id; - - me->decodeSoundID((char *)p.buffer, &id); - me->unloadSound(id); - return 0; -} - -int vrpn_Sound_Server::handle_changeSoundStatus(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_SoundID id; - vrpn_SoundDef soundDef; - vrpn_int32 repeat; - - me->decodeSoundDef((char *)p.buffer, &soundDef, &id, &repeat); - me->changeSoundStatus(id, soundDef); - return 0; -} - -int vrpn_Sound_Server::handle_setListenerPose(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_PoseDef pose; - - me->decodeListenerPose((char *)p.buffer, &pose); - me->setListenerPose(pose); - return 0; -} - -int vrpn_Sound_Server::handle_setListenerVelocity(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_float64 velocity[4]; - - me->decodeListenerVelocity((char *)p.buffer, velocity); - me->setListenerVelocity(velocity); - return 0; -} - -int vrpn_Sound_Server::handle_setSoundPose(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_PoseDef pose; - vrpn_int32 id; - - me->decodeSoundPose((char *)p.buffer, &pose, &id); - me->setSoundPose(id, pose); - return 0; -} - -int vrpn_Sound_Server::handle_setSoundVelocity(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_float64 velocity[4]; - vrpn_int32 id; - - me->decodeSoundVelocity((char *)p.buffer, velocity, &id); - me->setSoundVelocity(id, velocity); - return 0; -} - -int vrpn_Sound_Server::handle_setSoundDistanceinfo(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_float64 dist[4]; - vrpn_int32 id; - /* order is min_back, max_back, min_front, max_front */ - me->decodeSoundDistInfo((char *)p.buffer, &dist[0], &dist[1], &dist[2], - &dist[3], &id); - me->setSoundDistInfo(id, dist); - return 0; -} - -int vrpn_Sound_Server::handle_setSoundConeinfo(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_float64 cinfo[3]; - vrpn_int32 id; - - me->decodeSoundConeInfo((char *)p.buffer, &cinfo[0], &cinfo[1], &cinfo[2], - &id); - me->setSoundConeInfo(id, cinfo); - return 0; -} - -int vrpn_Sound_Server::handle_setSoundDoplerfactor(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_float64 df; - vrpn_int32 id; - - me->decodeSoundDoplerScale((char *)p.buffer, &df, &id); - me->setSoundDoplerFactor(id, df); - return 0; -} - -int vrpn_Sound_Server::handle_setSoundEqvalue(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_float64 val; - vrpn_int32 id; - - me->decodeSoundEqFactor((char *)p.buffer, &val, &id); - me->setSoundEqValue(id, val); - return 0; -} - -int vrpn_Sound_Server::handle_setSoundPitch(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_float64 pitch; - vrpn_int32 id; - - me->decodeSoundPitch((char *)p.buffer, &pitch, &id); - me->setSoundPitch(id, pitch); - return 0; -} - -int vrpn_Sound_Server::handle_setSoundVolume(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_float64 vol; - vrpn_int32 id; - - me->decodeSoundVolume((char *)p.buffer, &vol, &id); - me->setSoundVolume(id, vol); - return 0; -} - -int vrpn_Sound_Server::handle_loadModelLocal(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - char *filename; - - me->decodeLoadModel_local((char *)p.buffer, &filename, p.payload_len); - me->loadModelLocal(filename); - delete[] filename; - return 0; -} - -/* not handled yet */ -int vrpn_Sound_Server::handle_loadModelRemote(void *userdata, - vrpn_HANDLERPARAM p) -{ - return 0; -} - -int vrpn_Sound_Server::handle_loadPolyquad(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_QuadDef quad; - - me->decodeLoadPolyQuad((char *)p.buffer, &quad); - me->loadPolyQuad(&quad); - return 0; -} - -int vrpn_Sound_Server::handle_loadPolytri(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_TriDef tri; - - me->decodeLoadPolyTri((char *)p.buffer, &tri); - me->loadPolyTri(&tri); - return 0; -} - -int vrpn_Sound_Server::handle_loadMaterial(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_MaterialDef material; - vrpn_int32 id; - - me->decodeLoadMaterial((char *)p.buffer, &material, &id); - - me->loadMaterial(&material, id); - return 0; -} - -int vrpn_Sound_Server::handle_setPolyquadVertices(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_float64(*vertices)[4][3] = NULL; - vrpn_int32 id; - - me->decodeSetQuadVert((char *)p.buffer, vertices, &id); - me->setPolyQuadVertices(*vertices, id); - return 0; -} - -int vrpn_Sound_Server::handle_setPolytriVertices(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_float64(*vertices)[3][3] = NULL; - vrpn_int32 id; - - me->decodeSetTriVert((char *)p.buffer, vertices, &id); - me->setPolyTriVertices(*vertices, id); - return 0; -} - -int vrpn_Sound_Server::handle_setPolyOpeningfactor(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - vrpn_float64 of; - vrpn_int32 id; - - me->decodeSetPolyOF((char *)p.buffer, &of, &id); - me->setPolyOF(of, id); - return 0; -} - -int vrpn_Sound_Server::handle_setPolyMaterial(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Sound_Server *me = (vrpn_Sound_Server *)userdata; - char **material = NULL; - vrpn_int32 id; - - me->decodeSetPolyMaterial((char *)p.buffer, material, &id, p.payload_len); - me->setPolyMaterial(*material, id); - return 0; -} - -#endif /*#ifndef VRPN_CLIENT_ONLY */ diff --git a/src/vrpn/vrpn_Sound.h b/src/vrpn/vrpn_Sound.h deleted file mode 100644 index d2ab86cca32f7e5fa40c6927b04dc6dc597ca313..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Sound.h +++ /dev/null @@ -1,442 +0,0 @@ -// vrpn_Sound.h -// -// April 12 2000 - ZK - -#ifndef VRPN_SOUND_H - -#include "vrpn_BaseClass.h" // for vrpn_BaseClass -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Text.h" // for vrpn_TEXTCB, etc -#include "vrpn_Types.h" // for vrpn_int32, vrpn_float64, etc - -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -#define MAX_MATERIAL_NAME_LENGTH 128 -#define MAX_NUMBER_SOUNDS 1024 -#define MAX_NUMBER_MATERIALS 64 -#define MAX_NUMBER_POLYGONS 2048 -#define MAX_FILENAME_LENGTH 2048 - -// everything is on order found in these structs! - -typedef vrpn_int32 vrpn_SoundID; - -typedef struct _vrpn_PoseDef { - vrpn_float64 position[3]; - vrpn_float64 orientation[4]; - _vrpn_PoseDef() - { - position[0] = position[1] = position[2] = 0.0; - orientation[0] = orientation[1] = orientation[2] = 0.0; - orientation[3] = 1.0; - }; -} vrpn_PoseDef; - -typedef struct _vrpn_SoundDef { - vrpn_PoseDef pose; - vrpn_float64 velocity[4]; - vrpn_float64 max_front_dist; - vrpn_float64 min_front_dist; - vrpn_float64 max_back_dist; - vrpn_float64 min_back_dist; - vrpn_float64 cone_inner_angle; - vrpn_float64 cone_outer_angle; - vrpn_float64 cone_gain; - vrpn_float64 dopler_scale; - vrpn_float64 equalization_val; - vrpn_float64 pitch; - vrpn_float32 volume; // Jason Clark calls this volume, but really its gain! - _vrpn_SoundDef() - : max_front_dist(0) - , min_front_dist(0) - , max_back_dist(0) - , min_back_dist(0) - , cone_inner_angle(0) - , cone_outer_angle(0) - , cone_gain(0) - , dopler_scale(0) - , equalization_val(0) - , pitch(0) - , volume(0){}; - -} vrpn_SoundDef; - -typedef struct _vrpn_ListenerDef { - vrpn_PoseDef pose; - vrpn_float64 velocity[4]; -} vrpn_ListenerDef; - -typedef struct _vrpn_MaterialDef { - char material_name[MAX_MATERIAL_NAME_LENGTH]; - vrpn_float64 transmittance_gain; - vrpn_float64 transmittance_highfreq; - vrpn_float64 reflectance_gain; - vrpn_float64 reflectance_highfreq; -} vrpn_MaterialDef; - -typedef struct _vrpn_QuadDef { - vrpn_int32 subQuad; // really a bool - vrpn_float64 openingFactor; - vrpn_int32 tag; - vrpn_float64 vertices[4][3]; - char material_name[MAX_MATERIAL_NAME_LENGTH]; -} vrpn_QuadDef; - -typedef struct _vrpn_TriDef { - vrpn_int32 subTri; - vrpn_float64 openingFactor; - vrpn_int32 tag; - vrpn_float64 vertices[3][3]; - char material_name[MAX_MATERIAL_NAME_LENGTH]; -} vrpn_TriDef; - -class VRPN_API vrpn_Sound : public vrpn_BaseClass { - -public: - vrpn_Sound(const char *name, vrpn_Connection *c); - ~vrpn_Sound(); - -protected: - vrpn_int32 - load_sound_local; // ID of message to load a sound from server side - vrpn_int32 - load_sound_remote; // ID of message to load a sound from client side - vrpn_int32 unload_sound; // ID of message to unload a sound - vrpn_int32 play_sound; // ID of message to play a sound - vrpn_int32 stop_sound; // ID of message to stop a sound - vrpn_int32 - change_sound_status; // ID of message to change the sound's status - vrpn_int32 - set_listener_pose; // ID of message to set the listener's pos/orient - vrpn_int32 - set_listener_velocity; // ID of message to set the listener's velocity - vrpn_int32 set_sound_pose; // - vrpn_int32 set_sound_velocity; // - vrpn_int32 set_sound_distanceinfo; // - vrpn_int32 set_sound_coneinfo; // - vrpn_int32 set_sound_doplerfactor; // - vrpn_int32 set_sound_eqvalue; // - vrpn_int32 set_sound_pitch; - vrpn_int32 set_sound_volume; // - - vrpn_int32 load_model_local; // load model file from server side - vrpn_int32 load_model_remote; // load model file from client side - vrpn_int32 load_polyquad; // ID of message to load a quad polygon - vrpn_int32 load_polytri; // ID of message to load a tri polygon - vrpn_int32 load_material; // ID of message to load a material definition - vrpn_int32 set_polyquad_vertices; - vrpn_int32 set_polytri_vertices; - vrpn_int32 set_poly_openingfactor; - vrpn_int32 set_poly_material; - - vrpn_int32 receive_text_message; - - struct timeval timestamp; // Current timestamp - - int register_types(void); - - /*All encodes and decodes functions are for the purpose of setting up - messages to be sent over the network properly (ie to put them in one - char buffer and to put them in proper network order and for getting - the messages back into a usable format once they have been received*/ - - /*Note encodeSound allocates space dynamically for buf, it is your - responsibility to free it up*/ - vrpn_int32 encodeSound_local(const char *filename, const vrpn_SoundID id, - const vrpn_SoundDef soundDef, char **buf); - /*Note decodeSound allocates space dynamically for filename, it is your - responsibility to free it up*/ - vrpn_int32 decodeSound_local(const char *buf, char **filename, - vrpn_SoundID *id, vrpn_SoundDef *soundDef, - const int payload); - - // These two are not supported yet! - vrpn_int32 encodeSound_remote(const char *filename, const vrpn_SoundID id, - char **buf); - vrpn_int32 decodeSound_remote(const char *buf, char **filename, - vrpn_SoundID *id, const int payload); - - vrpn_int32 encodeSoundID(const vrpn_SoundID id, char *buf); - vrpn_int32 decodeSoundID(const char *buf, vrpn_SoundID *id); - vrpn_int32 encodeSoundDef(const vrpn_SoundDef sound, const vrpn_SoundID id, - const vrpn_int32 repeat, char *buf); - vrpn_int32 decodeSoundDef(const char *buf, vrpn_SoundDef *sound, - vrpn_SoundID *id, vrpn_int32 *repeat); - vrpn_int32 encodeSoundPlay(const vrpn_SoundID id, const vrpn_int32 repeat, - char *buf); - vrpn_int32 decodeSoundPlay(const char *buf, vrpn_SoundID *id, - vrpn_int32 *repeat); - vrpn_int32 encodeListenerVelocity(const vrpn_float64 *velocity, char *buf); - vrpn_int32 decodeListenerVelocity(const char *buf, vrpn_float64 *velocity); - vrpn_int32 encodeListenerPose(const vrpn_PoseDef pose, char *buf); - vrpn_int32 decodeListenerPose(const char *buf, vrpn_PoseDef *pose); - - vrpn_int32 encodeSoundPose(const vrpn_PoseDef pose, const vrpn_SoundID id, - char *buf); - vrpn_int32 decodeSoundPose(const char *buf, vrpn_PoseDef *pose, - vrpn_SoundID *id); - vrpn_int32 encodeSoundVelocity(const vrpn_float64 *velocity, - const vrpn_SoundID id, char *buf); - vrpn_int32 decodeSoundVelocity(const char *buf, vrpn_float64 *velocity, - vrpn_SoundID *id); - vrpn_int32 encodeSoundDistInfo(const vrpn_float64 min_back, - const vrpn_float64 max_back, - const vrpn_float64 min_front, - const vrpn_float64 max_front, - const vrpn_SoundID id, char *buf); - vrpn_int32 decodeSoundDistInfo(const char *buf, vrpn_float64 *min_back, - vrpn_float64 *max_back, - vrpn_float64 *min_front, - vrpn_float64 *max_front, vrpn_SoundID *id); - vrpn_int32 encodeSoundConeInfo(const vrpn_float64 cone_inner_angle, - const vrpn_float64 cone_outer_angle, - const vrpn_float64 cone_gain, - const vrpn_SoundID id, char *buf); - vrpn_int32 decodeSoundConeInfo(const char *buf, - vrpn_float64 *cone_inner_angle, - vrpn_float64 *cone_outer_angle, - vrpn_float64 *cone_gain, vrpn_SoundID *id); - vrpn_int32 encodeSoundDoplerScale(const vrpn_float64 doplerfactor, - const vrpn_SoundID id, char *buf); - vrpn_int32 decodeSoundDoplerScale(const char *buf, - vrpn_float64 *doplerfactor, - vrpn_SoundID *id); - vrpn_int32 encodeSoundEqFactor(const vrpn_float64 eqfactor, - const vrpn_SoundID id, char *buf); - vrpn_int32 decodeSoundEqFactor(const char *buf, vrpn_float64 *eqfactor, - vrpn_SoundID *id); - vrpn_int32 encodeSoundPitch(const vrpn_float64 pitch, const vrpn_SoundID id, - char *buf); - vrpn_int32 decodeSoundPitch(const char *buf, vrpn_float64 *pitch, - vrpn_SoundID *id); - vrpn_int32 encodeSoundVolume(const vrpn_float64 volume, - const vrpn_SoundID id, char *buf); - vrpn_int32 decodeSoundVolume(const char *buf, vrpn_float64 *volume, - vrpn_SoundID *id); - - vrpn_int32 encodeLoadModel_local(const char *filename, char **buf); - vrpn_int32 decodeLoadModel_local(const char *buf, char **filename, - const int payload); - - // Remote stuff not supported yet! - vrpn_int32 encodeLoadModel_remote(const char *filename, char **buf); - vrpn_int32 decodeLoadModel_remote(const char *buf, char **filename, - const int payload); - - vrpn_int32 encodeLoadPolyQuad(const vrpn_QuadDef quad, char *buf); - vrpn_int32 decodeLoadPolyQuad(const char *buf, vrpn_QuadDef *quad); - vrpn_int32 encodeLoadPolyTri(const vrpn_TriDef tri, char *buf); - vrpn_int32 decodeLoadPolyTri(const char *buf, vrpn_TriDef *tri); - vrpn_int32 encodeLoadMaterial(const vrpn_int32 id, - const vrpn_MaterialDef material, char *buf); - vrpn_int32 decodeLoadMaterial(const char *buf, vrpn_MaterialDef *material, - vrpn_int32 *id); - vrpn_int32 encodeSetQuadVert(const vrpn_float64 vertices[4][3], - const vrpn_int32 tag, char *buf); - vrpn_int32 decodeSetQuadVert(const char *buf, - vrpn_float64 (*vertices)[4][3], - vrpn_int32 *tag); - vrpn_int32 encodeSetTriVert(const vrpn_float64 vertices[3][3], - const vrpn_int32 tag, char *buf); - vrpn_int32 decodeSetTriVert(const char *buf, vrpn_float64 (*vertices)[3][3], - vrpn_int32 *tag); - vrpn_int32 encodeSetPolyOF(const vrpn_float64 openingfactor, - const vrpn_int32 tag, char *buf); - vrpn_int32 decodeSetPolyOF(const char *buf, vrpn_float64 *openingfactor, - vrpn_int32 *tag); - vrpn_int32 encodeSetPolyMaterial(const char *material, const vrpn_int32 tag, - char *buf); - vrpn_int32 decodeSetPolyMaterial(const char *buf, char **material, - vrpn_int32 *tag, const int payload); -}; - -class VRPN_API vrpn_Sound_Client : public vrpn_Sound, - public vrpn_Text_Receiver { -public: - vrpn_Sound_Client(const char *name, vrpn_Connection *c); - ~vrpn_Sound_Client(); - - // This command starts a sound playing, the repeat value indicates how - // many times to play it. Continuously if repeat is set to 0 - vrpn_int32 playSound(const vrpn_SoundID id, vrpn_int32 repeat); - vrpn_int32 stopSound(const vrpn_SoundID id); - // Loads a sound into memory on the server side, returns the ID value to be - // used to refer to the sound from now on. Pass in the path and filename - vrpn_SoundID loadSound(const char *sound, const vrpn_SoundID id, - const vrpn_SoundDef soundDef); - vrpn_int32 unloadSound(const vrpn_SoundID id); - - // All the functions with change and sound in them, can change either an - // already playing sound or one yet to be played - vrpn_int32 setSoundVolume(const vrpn_SoundID id, const vrpn_float64 volume); - vrpn_int32 setSoundPose(const vrpn_SoundID id, vrpn_float64 position[3], - vrpn_float64 orientation[4]); - vrpn_int32 setSoundVelocity(const vrpn_SoundID id, - const vrpn_float64 velocity[4]); - vrpn_int32 setSoundDistances(const vrpn_SoundID id, - const vrpn_float64 max_front_dist, - const vrpn_float64 min_front_dist, - const vrpn_float64 max_back_dist, - const vrpn_float64 min_back_dist); - vrpn_int32 setSoundConeInfo(const vrpn_SoundID id, - const vrpn_float64 inner_angle, - const vrpn_float64 outer_angle, - const vrpn_float64 gain); - - vrpn_int32 setSoundDopScale(const vrpn_SoundID id, vrpn_float64 dopfactor); - vrpn_int32 setSoundEqValue(const vrpn_SoundID id, vrpn_float64 eq_value); - vrpn_int32 setSoundPitch(const vrpn_SoundID id, vrpn_float64 pitch); - - vrpn_int32 setListenerPose(const vrpn_float64 position[3], - const vrpn_float64 orientation[4]); - vrpn_int32 setListenerVelocity(const vrpn_float64 velocity[4]); - - vrpn_int32 LoadModel_local(const char *filename); - - // Remote stuff not supported yet! - vrpn_int32 LoadModel_remote(const char *data); - - vrpn_int32 LoadPolyQuad(const vrpn_QuadDef quad); - vrpn_int32 LoadPolyTri(const vrpn_TriDef tri); - vrpn_int32 LoadMaterial(const vrpn_int32 id, - const vrpn_MaterialDef material); - - vrpn_int32 setMaterialName(const int id, const char *materialname); - vrpn_int32 setMaterialTransGain(const int id, - const vrpn_float64 transmittance_gain); - vrpn_int32 setMaterialTransHF(const int id, - const vrpn_float64 transmittance_hf); - vrpn_int32 setMaterialReflGain(const int id, - const vrpn_float64 reflectance_gain); - vrpn_int32 setMaterialReflHF(const int id, - const vrpn_float64 reflectance_hf); - - vrpn_int32 setPolyOF(const int id, const vrpn_float64 OF); - vrpn_int32 setQuadVertices(const int id, const vrpn_float64 vertices[4][3]); - vrpn_int32 setPolyMaterialName(const int id, const char *materialname); - - vrpn_int32 setTriVertices(const int id, const vrpn_float64 vertices[3][3]); - - virtual void mainloop(); - - virtual void receiveTextMessage(const char *message, vrpn_uint32 type, - vrpn_uint32 level, struct timeval msg_time); - -protected: -private: - static void VRPN_CALLBACK - handle_receiveTextMessage(void *userdata, const vrpn_TEXTCB t); -}; - -/*Note on the server design - The server is designed in such a way that it expects a sub-class that is - implemented - that actually implements sound functionality to have certain functions that it - can - call to tell the child to play, load, whatever. This parent server class, - handles - all of the callback functionality and decoding, allowing child classes to only - have - to worry about sound functionality*/ -#ifndef VRPN_CLIENT_ONLY -class VRPN_API vrpn_Sound_Server : public vrpn_Sound, public vrpn_Text_Sender { -public: - vrpn_Sound_Server(const char *name, vrpn_Connection *c); - ~vrpn_Sound_Server(); - - virtual void playSound(vrpn_SoundID id, vrpn_int32 repeat, - vrpn_SoundDef soundDef) = 0; - virtual void loadSoundLocal(char *filename, vrpn_SoundID id, - vrpn_SoundDef soundDef) = 0; - virtual void loadSoundRemote(char *file, vrpn_SoundID id, - vrpn_SoundDef soundDef) = 0; - virtual void stopSound(vrpn_SoundID id) = 0; - virtual void unloadSound(vrpn_SoundID id) = 0; - virtual void changeSoundStatus(vrpn_SoundID id, vrpn_SoundDef soundDef) = 0; - virtual void setListenerPose(vrpn_PoseDef pose) = 0; - virtual void setListenerVelocity(vrpn_float64 *velocity) = 0; - - virtual void setSoundPose(vrpn_SoundID id, vrpn_PoseDef pose) = 0; - virtual void setSoundVelocity(vrpn_SoundID id, vrpn_float64 *velocity) = 0; - virtual void setSoundDistInfo(vrpn_SoundID id, vrpn_float64 *distinfo) = 0; - virtual void setSoundConeInfo(vrpn_SoundID id, vrpn_float64 *coneinfo) = 0; - - virtual void setSoundDoplerFactor(vrpn_SoundID id, - vrpn_float64 doplerfactor) = 0; - virtual void setSoundEqValue(vrpn_SoundID id, vrpn_float64 eqvalue) = 0; - virtual void setSoundPitch(vrpn_SoundID id, vrpn_float64 pitch) = 0; - virtual void setSoundVolume(vrpn_SoundID id, vrpn_float64 volume) = 0; - virtual void loadModelLocal(const char *filename) = 0; - virtual void loadModelRemote() = 0; // not supported - virtual void loadPolyQuad(vrpn_QuadDef *quad) = 0; - virtual void loadPolyTri(vrpn_TriDef *tri) = 0; - virtual void loadMaterial(vrpn_MaterialDef *material, vrpn_int32 id) = 0; - virtual void setPolyQuadVertices(vrpn_float64 vertices[4][3], - const vrpn_int32 id) = 0; - virtual void setPolyTriVertices(vrpn_float64 vertices[3][3], - const vrpn_int32 id) = 0; - virtual void setPolyOF(vrpn_float64 OF, vrpn_int32 tag) = 0; - virtual void setPolyMaterial(const char *material, vrpn_int32 tag) = 0; - -protected: -private: - static int VRPN_CALLBACK - handle_loadSoundLocal(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_loadSoundRemote(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_unloadSound(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_playSound(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_stopSound(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_changeSoundStatus(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setListenerPose(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setListenerVelocity(void *userdata, vrpn_HANDLERPARAM p); - - static int VRPN_CALLBACK - handle_setSoundPose(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setSoundVelocity(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setSoundDistanceinfo(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setSoundConeinfo(void *userdata, vrpn_HANDLERPARAM p); - - static int VRPN_CALLBACK - handle_setSoundDoplerfactor(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setSoundEqvalue(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setSoundPitch(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setSoundVolume(void *userdata, vrpn_HANDLERPARAM p); - - static int VRPN_CALLBACK - handle_loadModelLocal(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_loadModelRemote(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_loadPolyquad(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_loadPolytri(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_loadMaterial(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setPolyquadVertices(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setPolytriVertices(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setPolyOpeningfactor(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_setPolyMaterial(void *userdata, vrpn_HANDLERPARAM p); -}; -#endif //#ifndef VRPN_CLIENT_ONLY - -#define VRPN_SOUND_H -#endif diff --git a/src/vrpn/vrpn_Spaceball.C b/src/vrpn/vrpn_Spaceball.C deleted file mode 100644 index fdc3ba36654a236da2df5514d2558b17a2415ff4..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Spaceball.C +++ /dev/null @@ -1,602 +0,0 @@ -// vrpn_Spaceball.C -// This is a driver for the 3DConnexions (was Labtec/Spacetec.) -// http://www.3dconnexions.com/ -// Spaceball 6DOF motion controller, with 2, 9, or 12 buttons and -// a ball that translational and rotational forces can be -// applied to. It uses an RS-232 interface and can be communicated -// with using either a raw serial protocol (done in this driver), -// or by using the X-Windows or Microsoft Windows drivers supplied -// by the hardware vendor. -// -// This driver was written by John E. Stone, based on his previous Spaceball -// driver implementations. The VRPN version of this code has only been -// directly tested with the Spaceball 2003 version of the device so far, -// though the original standalone libsball code it is based on is known -// to work with the 3003 and 4000 FLX devices, so the VRPN driver should too. -// If you have questions about this code in general, please email the author: -// johns@megapixel.com j.stone@acm.org johns@ks.uiuc.edu -// http://www.megapixel.com/ -// -// Guidance for the VRPN version of this driver was obtained by -// basing it on the vrpn_Magellan code, where possible. -// -// Comments about this code: -// Spots in the code marked with XXX are either of particular interest -// as they could be improved, or because they are a VRPN-interpretation of -// functionality written in libsball that was changed for VRPN. -// In particular, it might be useful for VRPN to know whether or not it is -// talking to a Spaceball 2003, 3003, or 4000, but this implementation does -// not set any status bits in VRPN to make such information available. -// Should the "lefty" mode of the 4000 be reported as a button? -// At present, none of this state is exposed to VRPN, though it might -// be useful in some cases. Also, the VRPN code hides the differences -// between the 2003, 3003, and 4000 button handling, where libsball -// gives them separate types of button status. Either interpretation -// is useful, depending on what the application people want, but since -// VRPN is supposed to be very general purpose, I chose to make this -// driver hide as much of the device specific stuff as possible. -// The main issues between the devices are the actual number of buttons -// on the devices, and the interpretation of the "rezero" button, -// the interpretation of the "pick" button, and the interpretation of -// the "lefty" mode on the Spaceball 4000. These can easily be -// changed to better suit VRPN's needs however if some other behavior -// is preferable. -// -// The current button mapping in VRPN (only verified on 2003 so far) -// is as follows: -// -// Spaceball Model -// VRPN Button 1003 2003 3003 4000 -// 1 1 L 1 -// 2 2 R 2 -// 3 3 3 -// 4 4 4 -// 5 5 5 -// 6 6 6 -// 7 7 7 -// 8 8/Zero Zero 8 -// 9 Pick 9 -// 10 10 ("aka A?") -// 11 11 ("aka B?") -// 12 12 ("aka C?") -// -// Enjoy, -// John E. Stone -// johns@megapixel.com -// j.stone@acm.org -// johns@ks.uiuc.edu -// - -#include <stdio.h> // for fprintf, stderr -#include <string.h> // for NULL, strlen - -#include "vrpn_Serial.h" // for vrpn_flush_input_buffer, etc -#include "vrpn_Shared.h" // for timeval, vrpn_SleepMsecs, etc -#include "vrpn_Spaceball.h" - -// turn on for debugging code, leave off otherwise -#undef VERBOSE - -#if defined(VERBOSE) -#include <ctype.h> // for isprint() - -#define DEBUG 1 -#endif - -// Defines the modes in which the box can find itself. -#define STATUS_RESETTING (-1) // Resetting the device -#define STATUS_SYNCING (0) // Looking for the first char of report -#define STATUS_READING (1) // Looking for the rest of the report -#define MAX_TIME_INTERVAL (2000000) // max time between reports (usec) - -// This creates a vrpn_Spaceball and sets it to reset mode. It opens -// the serial device using the code in the vrpn_Serial_Analog constructor. -vrpn_Spaceball::vrpn_Spaceball (const char * name, vrpn_Connection * c, - const char * port, int baud): - vrpn_Serial_Analog(name, c, port, baud), - vrpn_Button_Filter(name, c), - _numbuttons(12), - _numchannels(6), - null_radius(8) -{ - // Set the parameters in the parent classes - vrpn_Button::num_buttons = _numbuttons; - vrpn_Analog::num_channel = _numchannels; - - // Set the status of the buttons and analogs to 0 to start - clear_values(); - - // Set the mode to reset - status = STATUS_RESETTING; -} - -void vrpn_Spaceball::clear_values(void) -{ - int i; - - for (i = 0; i < _numbuttons; i++) { - vrpn_Button::buttons[i] = vrpn_Button::lastbuttons[i] = 0; - } - for (i = 0; i < _numchannels; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } -} - - - - - -// This routine will reset the Spaceball, zeroing the position, -// mode and making the device beep. -int vrpn_Spaceball::reset(void) { - - /* Spaceball initialization string. Newer documentation suggests */ - /* eliminating several init settings, leaving them at defaults. */ - const char *reset_str = "CB\rNT\rFTp\rFRp\rP@r@r\rMSSV\rZ\rBcCcC\r"; - - // Set the values back to zero for all buttons, analogs and encoders - clear_values(); - - /* Reset some state variables back to zero */ - bufpos = 0; - packtype = 0; - packlen = 0; - escapedchar = 0; - erroroccured = 0; - resetoccured = 0; - spaceball4000 = 0; /* re-determine which type it is */ - leftymode4000 = 0; /* re-determine if its in lefty mode */ - null_radius = 8; // The NULL radius is now set to 8 - - // Send commands to the device to cause it to reset and beep. - vrpn_flush_input_buffer(serial_fd); - vrpn_write_slowly(serial_fd, (unsigned char *)reset_str, strlen(reset_str), 5); - - // We're now waiting for a response from the box - status = STATUS_SYNCING; - - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - return 0; -} - - - -// This function will read characters until it has a full report, then -// put that report into the time, analog, or button fields and call -// the report methods on these. The time stored is that of -// the first character received as part of the report. -// Reports start with different characters, and the length of the report -// depends on what the first character of the report is. We switch based -// on the first character of the report to see how many more to expect and -// to see how to handle the report. -// Returns 1 if there is a complete report found, 0 otherwise. This is -// so that the calling routine can know to check again at the end of complete -// reports to see if there is more than one report buffered up. - -int vrpn_Spaceball::get_report(void) -{ - unsigned char rawbuf[1024]; // raw unprocessed incoming characters - int i, num, packs; -#if defined(DEBUG) - int j; -#endif - packs = 0; /* no packs received yet */ - - // read up to 1023 unprocessed characters from the serial device at once - num = vrpn_read_available_characters(serial_fd, rawbuf, 1023); - - // if we receive 1 or more chars, we will see if this completes any - // pending packets we're trying to process. - if (num > 0) { - for (i=0; i<num; i++) { - /* process potentially occurring escaped character sequences */ - if (rawbuf[i] == '^') { - if (!escapedchar) { - escapedchar = 1; - continue; /* eat the escape character from buffer */ - } - } - - /* if in escaped mode, we convert the escaped char to final form */ - if (escapedchar) { - escapedchar = 0; /* we're back out of escape mode after this */ - - switch (rawbuf[i]) { - case '^': /* leave char in buffer unchanged */ - break; - - case 'Q': - case 'S': - case 'M': - rawbuf[i] &= 0x1F; /* convert character to unescaped form */ - break; - - default: -#if defined(DEBUG) - printf("\nGot a bad escape sequence! 0x%02x", rawbuf[i]); - if (isprint(rawbuf[i])) - printf(" (%c)", rawbuf[i]); - else - printf(" (unprintable)"); - printf("\n"); -#endif - break; - } - } - - - /* figure out what kind of packet we received */ - if (bufpos == 0) { - status = STATUS_SYNCING; /* update our status */ - - switch(rawbuf[i]) { - case 'D': /* Displacement packet */ - packtype = 'D'; - packlen = 16; /* D packets are 15 bytes long */ - break; - - case 'K': /* Button/Key packet */ - packtype = 'K'; - packlen = 4; /* K packets are 3 bytes long */ - break; - - case '.': /* Spaceball 4000 FLX "advanced" button press event */ - packtype = '.'; - packlen = 4; /* . packets are 3 bytes long */ - break; - - case 'C': /* Communications mode packet */ - packtype = 'C'; - packlen = 4; - break; - - case 'F': /* Spaceball sensitization mode packet */ - packtype = 'F'; - packlen = 4; - break; - - case 'M': /* Movement mode packet */ - packtype = 'M'; - packlen = 5; - break; - - case 'N': /* Null region packet */ - packtype = 'N'; - packlen = 3; - break; - - case 'P': /* Update rate packet */ - packtype = 'P'; - packlen = 6; - break; - - case '\v': /* XON at poweron */ - packtype = '\v'; - packlen = 1; - break; - - case '\n': /* carriage return at poweron */ - case '\r': /* carriage return at poweron */ - packtype = '\r'; - packlen = 1; - break; - - case '@': /* Spaceball Hard/Soft Reset packet */ - resetoccured=1; - packtype = '@'; - packlen = 62; /* Resets aren't longer than 62 chars */ - break; - - case 'E': /* Error packet */ - packtype = 'E'; - packlen = 8; /* E packets are up to 7 bytes long */ - break; - - case 'Z': /* Zero packet (Spaceball 2003/3003/4000 FLX) */ - packtype = 'Z'; - packlen = 14; /* Z packets are hardware dependent */ - break; - - default: /* Unknown packet! */ -#if defined(DEBUG) - printf("\nUnknown packet (1) [%d]: 0x%02x \n ", i, rawbuf[i]); - printf(" char: "); - if (isprint(rawbuf[i])) - printf("%c", rawbuf[i]); - else - printf(" (unprintable)"); - printf("\n"); -#endif - continue; - } - } - - - buf[bufpos] = rawbuf[i]; /* copy processed chars into long-term buffer */ - bufpos++; /* go to next buffer slot */ - - /* Reset packet processing */ - if (packtype == '@') { - if (rawbuf[i] != '\r') - continue; - else - packlen = bufpos; - } - - /* Error packet processing */ - if (packtype == 'E') { - if (rawbuf[i] != '\r') - continue; - else - packlen = bufpos; - } else if (bufpos != packlen) - continue; - - status = STATUS_READING; // ready to process event packet - vrpn_gettimeofday(×tamp, NULL); // set timestamp of this event - - switch (packtype) { - case 'D': /* ball displacement event */ - { - int nextchar, chan; - - /* number of 1/16ths of milliseconds since last */ - /* ball displacement packet */ - - nextchar = 1; // this is where the timer data is, if we want it. - nextchar = 3; // Skip the zeroeth character (the command) - for (chan = 0; chan < _numchannels; chan++) { - long intval; - intval = (buf[nextchar++]) << 8; - intval |= (buf[nextchar++]); - intval = (intval << 16) >> 16; - - // If the absolute value of the integer is <= the NULL - // radius, it should be set to zero. - if ( (intval <= null_radius) && (intval >= - null_radius) ) { - intval = 0; - } - - // maximum possible values per axis are +/- 32768, although the - // largest value I've ever observed among several devices - // is only 20,000. For now, we'll divide by 32768, and if this is - // too insensitive, we can do something better later. - double realval = intval / 32768.0; - channel[chan] = realval; - // printf("XXX Channel[%d] = %f %d \n", z, realval, intval); - } - channel[2] = -channel[2]; // Negate Z translation - channel[5] = -channel[5]; // Negate Z rotation - } - break; - - case 'K': /* button press event */ - /* Spaceball 2003A, 2003B, 2003 FLX, 3003 FLX, 4000 FLX */ - /* button packet. (4000 only for backwards compatibility) */ - /* The lowest 5 bits of the first byte are buttons 5-9 */ - /* Button '8' on a Spaceball 2003 is the rezero button */ - /* The lowest 4 bits of the second byte are buttons 1-4 */ - /* For Spaceball 2003, we'll map the buttons 1-7 normally */ - /* skip 8, as its a hardware "rezero button" on that device */ - /* and call the "pick" button "8". */ - /* On the Spaceball 3003, the "right" button also triggers */ - /* the "pick" bit. We OR the 2003/3003 rezero bits together */ - - /* if we have found a Spaceball 4000, then we ignore the 'K' */ - /* packets entirely, and only use the '.' packets. */ - if (spaceball4000) - break; - -// XXX my original libsball button decoding code, for reference -// buttons = -// ((buf[1] & 0x10) << 3) | /* 2003 pick button is "8" */ -// ((buf[1] & 0x20) << 9) | /* 3003 rezero button */ -// ((buf[1] & 0x08) << 11) | /* 2003 rezero button */ -// ((buf[1] & 0x07) << 4) | /* 5,6,7 (2003/4000) */ -// ((buf[2] & 0x30) << 8) | /* 3003 Left/Right buttons */ -// ((buf[2] & 0x0F)); /* 1,2,3,4 (2003/4000) */ - - // Mapping the buttons is tricky since different models - // of the Spaceball have different button sets. - // 2003 has 9 buttons (rezero included) - // 3003 has 3 buttons (rezero included) - // 4000 has 12 buttons, and can be in "lefty" or "righty" mode. - // We'll skip reporting lefty/righty mode for now though. - - // Spaceball 2003/4000 buttons 1-4 mapped to slots 0-3 - // Spaceball 3003 L/R buttons are mapped as slots 0/1 - buttons[0] = static_cast<unsigned char>(((buf[2] & 0x01) != 0) | ((buf[2] & 0x10) != 0)); - buttons[1] = static_cast<unsigned char>(((buf[2] & 0x02) != 0) | ((buf[2] & 0x20) != 0)); - buttons[2] = static_cast<unsigned char>(((buf[2] & 0x04) != 0)); - buttons[3] = static_cast<unsigned char>(((buf[2] & 0x08) != 0)); - - // Spaceball 2003/4000 buttons 5,6,7 mapped to slots 4-6 - buttons[4] = static_cast<unsigned char>(((buf[1] & 0x01) != 0)); - buttons[5] = static_cast<unsigned char>(((buf[1] & 0x02) != 0)); - buttons[6] = static_cast<unsigned char>(((buf[1] & 0x04) != 0)); - - // Spaceball 2003/3003 rezero buttons are mapped to slot 7 - // The rezero button's function is sometimes hard-wired, - // and may or may not be used by applications, this is up - // in the air still. For now, I'll map it to slot 7 which - // keeps the numbering in a sane order on the 2003 device anyway. - buttons[7] = static_cast<unsigned char>(((buf[1] & 0x20) != 0) | ((buf[1] & 0x08) != 0)); - - // Spaceball 2003 pick button mapped to slot 8 - // Note: the pick button is the button embedded into the front - // surface of the control sphere. - buttons[8] = static_cast<unsigned char>(((buf[1] & 0x10) != 0)); - break; - - - case '.': /* button press event (4000) */ - /* Spaceball 4000 FLX "expanded" button packet, with 12 buttons */ - - /* extra packet validity check, since we use this packet type */ - /* to override the 'K' button packets, and determine if its a */ - /* Spaceball 4000 or not... */ - if (buf[3] != '\r') { - break; /* if not terminated with a '\r', probably garbage */ - } - - /* if we got a valid '.' packet, this must be a Spaceball 4000 */ -#if defined(DEBUG) - if (!spaceball4000) - printf("\nDetected a Spaceball 4000 FLX\n"); -#endif - spaceball4000 = 1; /* Must be talking to a Spaceball 4000 */ - -// XXX my original libsball button decoding code, for reference -// buttons = -// (((~buf[1]) & 0x20) << 10) | /* "left handed" mode */ -// ((buf[1] & 0x1F) << 7) | /* 8,9,10,11,12 */ -// ((buf[2] & 0x3F) ) | /* 1,2,3,4,5,6 */ -// ((buf[2] & 0x80) >> 1); /* 7 */ - - /* Spaceball 4000 series "expanded" button press event */ - /* includes data for 12 buttons, and left/right orientation */ - buttons[0] = ((buf[2] & 0x01) != 0); // SB 4000 button 1 - buttons[1] = ((buf[2] & 0x02) != 0); // SB 4000 button 2 - buttons[2] = ((buf[2] & 0x04) != 0); // SB 4000 button 3 - buttons[3] = ((buf[2] & 0x08) != 0); // SB 4000 button 4 - buttons[4] = ((buf[2] & 0x10) != 0); // SB 4000 button 5 - buttons[5] = ((buf[2] & 0x20) != 0); // SB 4000 button 6 - buttons[6] = ((buf[2] & 0x80) != 0); // SB 4000 button 7 - - buttons[7] = ((buf[1] & 0x01) != 0); // SB 4000 button 8 - buttons[8] = ((buf[1] & 0x02) != 0); // SB 4000 button 9 - buttons[9] = ((buf[1] & 0x04) != 0); // SB 4000 button 10 - buttons[10] = ((buf[1] & 0x08) != 0); // SB 4000 button 11 - buttons[11] = ((buf[1] & 0x10) != 0); // SB 4000 button 12 - - // XXX lefty/righty mode handling goes here if we wish to - // represent it as a "button" etc.. - //buttons[??] = ((~buf[1]) & 0x20) != 0) // SB 4000 "lefty" mode bit - -#if defined(DEBUG) - if (leftymode4000 != ((buf[1] & 0x20) == 0)) - printf("\nSpaceball 4000 mode changed to: %s\n", - (((buf[1] & 0x20) == 0) ? "left handed" : "right handed")); -#endif - /* set "lefty" orientation mode if "lefty bit" is _clear_ */ - if ((buf[1] & 0x20) == 0) - leftymode4000 = 1; /* left handed mode */ - else - leftymode4000 = 0; /* right handed mode */ - break; - - case 'C': /* Communications mode packet */ - case 'F': /* Spaceball sensitization packet */ - case 'P': /* Spaceball update rate packet */ - case 'M': /* Spaceball movement mode packet */ - case 'N': /* Null region packet */ - case '\r': /* carriage return at poweron */ - case '\v': /* XON at poweron */ - /* eat and ignore these packets */ - break; - - case '@': /* Reset packet */ -#if defined(DEBUG) - printf("Spaceball reset: "); - for (j=0; j<packlen; j++) { - if (isprint(buf[j])) - printf("%c", buf[j]); - } - printf("\n"); -#endif - /* if we get a reset packet, we have to re-initialize */ - /* the device, and assume that its completely schizophrenic */ - /* at this moment, we must reset it again at this point */ - resetoccured=1; - reset(); // was sball_hwreset() - break; - - - case 'E': /* Error packet, hardware/software problem */ - erroroccured++; -#if defined(DEBUG) - printf("\nSpaceball Error!! "); - printf("Error code: "); - for (j=0; j<packlen; j++) { - printf(" 0x%02x ", buf[j]); - } - printf("\n"); -#endif - break; - - case 'Z': /* Zero packet (Spaceball 2003/3003/4000 FLX) */ - /* We just ignore these... */ - break; - - default: -#if defined(DEBUG) - printf("Unknown packet (2): 0x%02x\n", packtype); - printf(" char: "); - if (isprint(packtype)) - printf("%c", packtype); - else - printf(" (unprintable)"); - printf("\n"); -#endif - break; - } - - /* reset */ - bufpos = 0; - packtype = 0; - packlen = 1; - packs++; - } - } - - report_changes(); // Report updates to VRPN - - if (packs > 0) - return 1; // got at least 1 full report - else - return 0; // didn't get any full reports -} - -void vrpn_Spaceball::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_Spaceball::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -// This routine is called each time through the server's main loop. It will -// take a course of action depending on the current status of the Spaceball, -// either trying to reset it or trying to get a reading from it. -void vrpn_Spaceball::mainloop() -{ - server_mainloop(); - - switch(status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - // Keep getting reports until all full reports are read. - while (get_report()) {}; - break; - - default: - fprintf(stderr,"vrpn_Spaceball: Unknown mode (internal error)\n"); - break; - } -} - - diff --git a/src/vrpn/vrpn_Spaceball.h b/src/vrpn/vrpn_Spaceball.h deleted file mode 100644 index 7e9400d4c5ad73435bcbaeb43e9a877dee74986e..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Spaceball.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef VRPN_SPACEBALL_H -#define VRPN_SPACEBALL_H - -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32 - -class VRPN_API vrpn_Spaceball: public vrpn_Serial_Analog - ,public vrpn_Button_Filter -{ - public: - vrpn_Spaceball (const char * name, vrpn_Connection * c, - const char * port, int baud); - - ~vrpn_Spaceball () {}; - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - - virtual int reset(void); ///< Set device back to starting config - - protected: - int _numbuttons; ///< How many buttons to open - int _numchannels; ///< How many analog channels to open - unsigned char buf[512]; ///< Buffer of characters in report, - int bufpos; ///< Current char pos in buffer - int packtype; ///< What kind of packet we are decoding - int packlen; ///< Expected packet length - int escapedchar; ///< We're processing an escaped char - int erroroccured; ///< A device error has occurred - int resetoccured; ///< A reset event has occurred - int spaceball4000; ///< We found a Spaceball 4000 - int leftymode4000; ///< Spaceball 4000 is in lefty mode - int null_radius; ///< range where no motion should be reported - struct timeval timestamp; ///< Time of the last report from the device - - virtual void clear_values(void); ///< Set all buttons, analogs and encoders back to 0 - - /// Try to read reports from the device. Returns 1 if a complete - /// report received, 0 otherwise. Sets status to current mode. - virtual int get_report(void); - - /// send report iff changed - virtual void report_changes - (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - - /// send report whether or not changed - virtual void report - (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button, which are always vrpn_RELIABLE -}; - -#endif diff --git a/src/vrpn/vrpn_Text.C b/src/vrpn/vrpn_Text.C deleted file mode 100644 index 8c777e3c8eac496094a12e140cea9cca03b7b744..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Text.C +++ /dev/null @@ -1,47 +0,0 @@ -#include "vrpn_Text.h" - -int vrpn_Text_Sender::send_message(const char *msg, vrpn_TEXT_SEVERITY type, - vrpn_uint32 level, const struct timeval time) -{ - struct timeval now; - - // Replace the time value with the current time if the user passed in the - // constant time referring to "now". - if ((time.tv_sec == vrpn_TEXT_NOW.tv_sec) && - (time.tv_usec == vrpn_TEXT_NOW.tv_usec)) { - vrpn_gettimeofday(&now, NULL); - } - else { - now = time; - } - // send message, time, type and level - return send_text_message(msg, now, type, level); -} - -vrpn_Text_Receiver::vrpn_Text_Receiver(const char *name, vrpn_Connection *c) - : vrpn_BaseClass(name, c) -{ - init(); - if (d_connection) { - register_autodeleted_handler(d_text_message_id, handle_message, this, - d_sender_id); - } -}; - -vrpn_Text_Receiver::~vrpn_Text_Receiver() {} - -int vrpn_Text_Receiver::handle_message(void *userdata, vrpn_HANDLERPARAM p) -{ - - vrpn_Text_Receiver *me = (vrpn_Text_Receiver *)userdata; - vrpn_TEXTCB cp; - - cp.msg_time = p.msg_time; - me->decode_text_message_from_buffer(cp.message, &cp.type, &cp.level, - p.buffer); - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->d_callback_list.call_handlers(cp); - return 0; -} diff --git a/src/vrpn/vrpn_Text.h b/src/vrpn/vrpn_Text.h deleted file mode 100644 index e6c7bde958468537891212c761961ed8fea7395b..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Text.h +++ /dev/null @@ -1,102 +0,0 @@ -/* vrpn_Text.h - Definition of user-level access to the text sending and retrieving - functions within VRPN. These are wrappers around the vrpn_BaseClass - routines, since basic text functions have been pulled into these - classes. -*/ - -#ifndef VRPN_TEXT_H -#include <stddef.h> // for NULL - -#include "vrpn_BaseClass.h" // for vrpn_BaseClass, etc -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32 - -// text-message time value meaning "go find out what time it is right now" -const struct timeval vrpn_TEXT_NOW = {0, 0}; - -/// Structure passed back to user-level code from a vrpn_Text_Receiver. -typedef struct _vrpn_TEXTCB { - struct timeval msg_time; // Time of the message - char message[vrpn_MAX_TEXT_LEN]; // The message - vrpn_TEXT_SEVERITY type; - vrpn_uint32 level; -} vrpn_TEXTCB; - -/// Description of the callback function type. -typedef void(VRPN_CALLBACK *vrpn_TEXTHANDLER)(void *userdata, - const vrpn_TEXTCB info); - -//---------------------------------------------------------- -//************** Users deal with the following ************* - -/// Allows a user to send text messages from a device (usually, -// the send_text_message() function is protected). It provides -// the needed function definitions for vrpn_BaseClass. - -class VRPN_API vrpn_Text_Sender : public vrpn_BaseClass { -public: - vrpn_Text_Sender(const char *name, vrpn_Connection *c = NULL) - : vrpn_BaseClass(name, c) - { - init(); - }; - - /// Mainloop the connection to send the message. - void mainloop(void) - { - server_mainloop(); - if (d_connection) d_connection->mainloop(); - }; - - /// Send a text message. - int send_message(const char *msg, - vrpn_TEXT_SEVERITY type = vrpn_TEXT_NORMAL, - vrpn_uint32 level = 0, - const struct timeval time = vrpn_TEXT_NOW); - -protected: - /// No types to register beyond the text, which is done in BaseClass. - virtual int register_types(void) { return 0; }; -}; - -/// Allows a user to handle text messages directly, in addition too having the -// standard VRPN printing functions handle them. - -class VRPN_API vrpn_Text_Receiver : public vrpn_BaseClass { -public: - vrpn_Text_Receiver(const char *name, vrpn_Connection *c = NULL); - virtual ~vrpn_Text_Receiver(void); - virtual int register_message_handler(void *userdata, - vrpn_TEXTHANDLER handler) - { - return d_callback_list.register_handler(userdata, handler); - }; - - virtual int unregister_message_handler(void *userdata, - vrpn_TEXTHANDLER handler) - { - return d_callback_list.unregister_handler(userdata, handler); - } - - virtual void mainloop(void) - { - if (d_connection) { - d_connection->mainloop(); - }; - client_mainloop(); - }; - -protected: - static int VRPN_CALLBACK - handle_message(void *userdata, vrpn_HANDLERPARAM p); - vrpn_Callback_List<vrpn_TEXTCB> d_callback_list; - - /// No types to register beyond the text, which is done in BaseClass. - virtual int register_types(void) { return 0; }; -}; - -#define VRPN_TEXT_H -#endif diff --git a/src/vrpn/vrpn_Tng3.C b/src/vrpn/vrpn_Tng3.C deleted file mode 100644 index 1e7e0126ed4d9e4927f53b4332d8dd4198dd9acf..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tng3.C +++ /dev/null @@ -1,374 +0,0 @@ -// vrpn_Tng3.C -// This is a driver for an TNG 3 controller. -// This box is a serial-line device that allows the user to connect -// 8 analog and 8 digital inputs and, read from them over RS-232. -// -// This code is based on the Tng3 code from pulsar.org - -#include <math.h> // for floor -#include <stdio.h> // for fprintf, stderr, printf - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_WARNING, etc -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday -#include "vrpn_Tng3.h" - -#define VRPN_TIMESTAMP_MEMBER _timestamp // Configuration required for vrpn_MessageMacros in this class. -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -#undef VERBOSE - -#define MAX_TCHANNELS 8 -#define MAX_TBUTTONS 8 - -#define PAUSE_RESET .015 -#define PAUSE_END .015 -#define PAUSE_RESTORE 2.0 -#define PAUSE_BYTE .015 - -#define DATA_RECORD_LENGTH 9 // 9 bytes follow the start byte - - -// Defines the modes in which the box can find itself. -#define STATUS_RESETTING (-1) // Resetting the box -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report -#define MAX_TIME_INTERVAL (2000000) // max time between reports (usec) - - -static void pause (double delay) { - if (delay < 0) - delay = 0; - unsigned long interval = (long) floor(1000000.0 * delay); - - struct timeval start, now; - vrpn_gettimeofday (&start, NULL); - - do { - vrpn_gettimeofday (&now, NULL); - } while (vrpn_TimevalDuration(now, start) < interval); - -} - -// This creates a vrpn_Tng3 and sets it to reset mode. It opens -// the serial device using the code in the vrpn_Serial_Analog constructor. -// The box will autodetect the baud rate when the "IMMC" command is sent -// to it. - -vrpn_Tng3::vrpn_Tng3 (const char * name, - vrpn_Connection * c, - const char * port, - int baud, - const int numbuttons, - const int numchannels): - vrpn_Serial_Analog(name, c, port, baud), - vrpn_Button_Filter(name, c), - _numbuttons(numbuttons), - _numchannels(numchannels), - _num_read(0) -{ - // Verify the validity of the parameters - if (_numbuttons > MAX_TBUTTONS) { - fprintf(stderr,"vrpn_Tng3: Can only support %d buttons, not %d\n", (int)MAX_TBUTTONS, (int)_numbuttons); - _numbuttons = MAX_TBUTTONS; - } - if (_numchannels > MAX_TCHANNELS) { - fprintf(stderr,"vrpn_Tng3: Can only support %d analog channels, not %d\n", (int)MAX_TCHANNELS, (int)_numchannels); - _numchannels = MAX_TCHANNELS; - } - - // Set the parameters in the parent classes - vrpn_Button::num_buttons = _numbuttons; - vrpn_Analog::num_channel = _numchannels; - - // Set the status of the buttons, analogs and encoders to 0 to start - clear_values(); - - // Set the mode to reset - _status = STATUS_RESETTING; -} - -void vrpn_Tng3::clear_values(void) -{ - int i; - - for (i = 0; i < _numbuttons; i++) { - vrpn_Button::buttons[i] = vrpn_Button::lastbuttons[i] = 0; - } - for (i = 0; i < _numchannels; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } -} - -// This routine will reset the Tng3, asking it to send the requested number -// of analogs, buttons and encoders. -// It verifies that it can communicate with the device and checks the version of -// the device. - -int vrpn_Tng3::reset(void) -{ - - //----------------------------------------------------------------------- - // Set the values back to zero for all buttons and analogs - clear_values(); - - //----------------------------------------------------------------------- - // sending an end at this time will force the ibox into the reset mode, if it - // was not already. if the box is in the power up mode, nothing will happen because - // it 'should' be waiting to sync up the baudrate - - // try to synchronize for 2 seconds - - bDataPacketStart = 0x55; - - if (syncDatastream (2.0)) { - printf("vrpn_Tng3 found\n"); - } else { - return -1; - } - - printf("TNG3B found\n"); - - status = STATUS_SYNCING; - vrpn_gettimeofday(&_timestamp, NULL); // Set watchdog now - return 0; -} - -// This function will read characters until it has a full report, then -// put that report into the time, analog amd button fields and call -// the report methods on these. The time stored is that of -// the first character received as part of the report. Each time -// through, it gets however many characters are available. -// -// Reports start with the byte bDataPacketStart followed by -// DATA_RECORD_LENGTH bytes -// -// If we get a report that is not valid, we assume that we have lost a -// character or something and re-synchronize by flushing the buffer -// -// The routine that calls this one -// makes sure we get a full reading often enough (ie, it is responsible -// for doing the watchdog timing to make sure the box hasn't simply -// stopped sending characters). - -int vrpn_Tng3::get_report(void) -{ - int i; - unsigned int buttonBits = 0; - - // Zero timeout, poll for any available characters - struct timeval timeout = {0, 0}; - - // Go looking for a synchronization byte. This apparently starts out - // as 0x55 for one record, then toggles all of the bits for the next - // record. - if (status == STATUS_SYNCING) { - if (1 == vrpn_read_available_characters(serial_fd, _buffer, 1, &timeout)) { - // if not a record start, we need to resync - if (_buffer[0] != bDataPacketStart) { - VRPN_MSG_WARNING("Resyncing"); - return 0;; - } - - // we got a good start byte... we're reading now - _num_read = 0; //< Ignore the status byte for the following record - status = STATUS_READING; - - // invert the bits for the next packet start - bDataPacketStart ^= 0xFF; - } - } - - // we broke out.. if we're not reading, then we have nothing to do - if (STATUS_READING != status) { - return 0; - } - - // we're reading now, get the report - - // get the expected number of data record bytes - timeout.tv_sec = 0; - timeout.tv_usec = 0; - int result = vrpn_read_available_characters(serial_fd, - &_buffer[_num_read], DATA_RECORD_LENGTH-_num_read, &timeout); - - if (result < 0) { - VRPN_MSG_WARNING("Bad read"); - status = STATUS_SYNCING; - return 0; - } - - // If we don't have a full record, go back again. - _num_read += result; - if (_num_read < DATA_RECORD_LENGTH) { - return 0; - } - - // parse the report here -- we got a full record. - - // here is where we decode the analog stuff - for (i = 0; i < _numchannels; i++) { - vrpn_Analog::last[i] = vrpn_Analog::channel[i]; - vrpn_Analog::channel[i] = (unsigned short) _buffer[i]; - } - - // get the button bits and make sense of them - - buttonBits = _buffer[DATA_RECORD_LENGTH-1]; - for (i = 0; i < _numbuttons; i++) { - vrpn_Button::lastbuttons[i] = vrpn_Button::buttons[i]; - vrpn_Button::buttons[i] = static_cast<unsigned char>((buttonBits & (1 << i)) ? VRPN_BUTTON_OFF : VRPN_BUTTON_ON); - } - - report_changes(); - vrpn_gettimeofday(&_timestamp, NULL); // Set watchdog now - - status = STATUS_SYNCING; - return 1; -} - -void vrpn_Tng3::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_Tng3::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -// This routine is called each time through the server's main loop. It will -// take a course of action depending on the current status of the TNG3, -// either trying to reset it or trying to get a reading from it. -void vrpn_Tng3::mainloop(void) -{ - server_mainloop(); - - switch(status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - while (get_report()) {}; // Keep getting reports as long as they come - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,_timestamp) > MAX_TIME_INTERVAL) { - fprintf(stderr,"TNG3 failed to read... current_time=%ld:%ld, timestamp=%ld:%ld\n", - current_time.tv_sec, static_cast<long>(current_time.tv_usec), - _timestamp.tv_sec, static_cast<long>(_timestamp.tv_usec)); - send_text_message("Too long since last report, resetting", current_time, vrpn_TEXT_ERROR); - status = STATUS_RESETTING; - } - } - break; - - default: - fprintf(stderr,"vrpn_Tng3: Unknown mode (internal error)\n"); - break; - } -} - - -// synchronize the data stream -// seconds determines how long the process is permitted to continue - -int vrpn_Tng3::syncDatastream (double seconds) { - - struct timeval miniDelay; - miniDelay.tv_sec = 0; - miniDelay.tv_usec = 50000; - - unsigned long maxDelay = 1000000L * (long) seconds; - struct timeval start_time; - vrpn_gettimeofday(&start_time, NULL); - - int loggedOn = 0; - int numRead; - - if (serial_fd < 0) { - return 0; - } - - // ensure that the packet start byte is valid - if ( bDataPacketStart != 0x55 && bDataPacketStart != 0xAA ) { - bDataPacketStart = 0x55; - } - - vrpn_flush_input_buffer(serial_fd); - -// vrpn_write_characters(serial_fd, (const unsigned char *)"E", 1); - pause (0.01); - - while (!loggedOn) { - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, start_time) > maxDelay ) { - // if we've timed out, go back unhappy - fprintf(stderr,"vrpn_Tng3::syncDatastream timeout expired: %d secs\n", (int)seconds); - return 0; // go back unhappy - } - - // get a byte - if (1 != vrpn_read_available_characters(serial_fd, _buffer, 1, &miniDelay)) { - continue; - } - // if not a record start, skip - if (_buffer[0] != bDataPacketStart) { - continue; - } - // invert the packet start byte for the next test - bDataPacketStart ^= 0xFF; - - // get an entire report - numRead = vrpn_read_available_characters(serial_fd, - _buffer, DATA_RECORD_LENGTH, &miniDelay); - - if (numRead < DATA_RECORD_LENGTH) { - continue; - } - - // get the start byte for the next packet - if (1 != vrpn_read_available_characters(serial_fd, _buffer, 1, &miniDelay)) { - continue; - } - - // if not the anticipated record start, things are not yet sync'd - if (_buffer[0] != bDataPacketStart) { - continue; - } - - // invert the packet start byte in anticipation of normal operation - bDataPacketStart ^= 0xFF; - - // get an entire report - numRead = vrpn_read_available_characters(serial_fd, - _buffer, DATA_RECORD_LENGTH, &miniDelay); - - if (numRead < DATA_RECORD_LENGTH) { - continue; - } - - return 1; - } - return 0; -} diff --git a/src/vrpn/vrpn_Tng3.h b/src/vrpn/vrpn_Tng3.h deleted file mode 100644 index e96b9960583cb883b8ac3a7950bc1e385a49b696..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tng3.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef VRPN_TNG3B_H -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32 - -// TNG stands for "Totally Neat Gadget." -// The TNG3 is an interface device from Mindtel <www.mindtel.com>. -// It is powered by the serial control lines and offers 8 digital -// and 8 analog inputs. It costs about $150. -// Written by Rob King at Navy Research Labs. - -class VRPN_API vrpn_Tng3: public vrpn_Serial_Analog, - public vrpn_Button_Filter -{ - public: - vrpn_Tng3 (const char * name, - vrpn_Connection * c, - const char * port, - int baud = 19200, // only speed - const int numbuttons = 8, - const int numchannels = 8); - - ~vrpn_Tng3 () {}; - - // Called once through each main loop iteration to handle - // updates. - virtual void mainloop (void); - - protected: - int _status; - int _numbuttons; // How many buttons to open - int _numchannels; // How many analog channels to open - - unsigned _num_read; // How many characters have been read on this report? - unsigned _expected_chars; // How many characters to expect in the report - unsigned char _buffer[512]; // Buffer of characters in report - unsigned _bufcount; // How many characters we have so far - - struct timeval _timestamp; // Time of the last report from the device - - virtual void clear_values(void); // Set all buttons, analogs back to 0 - virtual int reset(void); // Set device back to starting config - virtual int get_report(void); // Try to read a report from the device - - // send report iff changed - virtual void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // send report whether or not changed - virtual void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button or vrpn_Dial - - private: - -// utility routine to sync up the data stream - int syncDatastream (double seconds); - - unsigned char bDataPacketStart; -}; - -#define VRPN_TNG3B_H -#endif diff --git a/src/vrpn/vrpn_Tracker.C b/src/vrpn/vrpn_Tracker.C deleted file mode 100644 index 21096684a900f5ad82f583bd2bb2d7cbba514625..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker.C +++ /dev/null @@ -1,1881 +0,0 @@ -#include <ctype.h> // for isspace -#include <stdio.h> // for fprintf, stderr, NULL, etc -#include <string.h> // for memcpy, strlen, strncmp, etc - -// NOTE: a vrpn tracker must call user callbacks with tracker data (pos and -// ori info) which represent the transformation xfSourceFromSensor. -// This means that the pos info is the position of the origin of -// the sensor coord sys in the source coord sys space, and the -// quat represents the orientation of the sensor relative to the -// source space (ie, its value rotates the source's axes so that -// they coincide with the sensor's) - -// Include vrpn_Shared.h _first_ to avoid conflicts with sys/time.h -// and unistd.h -#include "vrpn_Shared.h" // for timeval, vrpn_buffer, etc - -#ifdef _WIN32 -#ifndef _WIN32_WCE -#include <io.h> -#endif -#endif - -#include "vrpn_RedundantTransmission.h" // for vrpn_RedundantTransmission -#include "vrpn_Tracker.h" - -#if defined(VRPN_USE_LIBUSB_1_0) -#include <libusb.h> // for libusb_close, etc -#endif - -#ifndef VRPN_CLIENT_ONLY -#include "vrpn_Serial.h" // for vrpn_close_commport, etc -#endif - -static const char *default_tracker_cfg_file_name = "vrpn_Tracker.cfg"; -// this is used unless we pass in a path & file name into the vrpn_TRACKER -// constructor - -#define vrpn_ser_tkr_MAX_TIME_INTERVAL \ - (2000000) // max time between reports (usec) - -//#define VERBOSE -// #define READ_HISTOGRAM - -vrpn_Tracker::vrpn_Tracker(const char *name, vrpn_Connection *c, - const char *tracker_cfg_file_name) - : vrpn_BaseClass(name, c) - , unit2sensor(NULL) - , unit2sensor_quat(NULL) - , num_unit2sensors(0) -{ - FILE *config_file; - vrpn_BaseClass::init(); - - // Set the current time to zero, just to have something there - timestamp.tv_sec = 0; - timestamp.tv_usec = 0; - - // Set the watchdog time to zero, which will disable it unless it is used - watchdog_timestamp.tv_sec = 0; - watchdog_timestamp.tv_usec = 0; - - // Set the sensor to 0 just to have something in there. - d_sensor = 0; - - // Set the position to the origin and the orientation to identity - // just to have something there in case nobody fills them in later - pos[0] = pos[1] = pos[2] = 0.0; - d_quat[0] = d_quat[1] = d_quat[2] = 0.0; - d_quat[3] = 1.0; - - // Set the velocity to zero and the orientation to identity - // just to have something there in case nobody fills them in later - vel[0] = vel[1] = vel[2] = 0.0; - vel_quat[0] = vel_quat[1] = vel_quat[2] = 0.0; - vel_quat[3] = 1.0; - vel_quat_dt = 1; - - // Set the acceleration to zero and the orientation to identity - // just to have something there in case nobody fills them in later - acc[0] = acc[1] = acc[2] = 0.0; - acc_quat[0] = acc_quat[1] = acc_quat[2] = 0.0; - acc_quat[3] = 1.0; - acc_quat_dt = 1; - -#ifdef DESKTOP_PHANTOM_DEFAULTS - // Defaults for Desktop Phantom. - tracker2room[0] = tracker2room[1] = 0.0; - tracker2room[2] = -0.28; -#else - // Set the room to tracker and sensor to unit transforms to identity - tracker2room[0] = tracker2room[1] = tracker2room[2] = 0.0; -#endif - tracker2room_quat[0] = tracker2room_quat[1] = tracker2room_quat[2] = 0.0; - tracker2room_quat[3] = 1.0; - - num_sensors = 1; - -#ifdef DESKTOP_PHANTOM_DEFAULTS - // Defaults for Desktop Phantom. - workspace_min[0] = workspace_min[1] = -0.2; - workspace_min[2] = -0.1; - workspace_max[0] = workspace_max[1] = workspace_max[2] = 0.2; -#else - workspace_min[0] = workspace_min[1] = workspace_min[2] = -0.5; - workspace_max[0] = workspace_max[1] = workspace_max[2] = 0.5; -#endif - // replace defaults with values from tracker config file - // if it exists - if (tracker_cfg_file_name == NULL) { // the default argument value - tracker_cfg_file_name = default_tracker_cfg_file_name; - } - if ((config_file = fopen(tracker_cfg_file_name, "r")) == NULL) { - // Can't find the config file - // Complain only if we are using the a non-default config file - // (Since most people don't use any config file at all, - // and would be confused to see an error about not being - // able to open the default config file) - if (tracker_cfg_file_name != default_tracker_cfg_file_name) { - fprintf(stderr, "vrpn_Tracker: Can't find config file %s\n", - tracker_cfg_file_name); - } - } - else if (read_config_file(config_file, name)) { - fprintf( - stderr, - "vrpn_Tracker: Found config file %s, but cannot read info for %s\n", - tracker_cfg_file_name, name); - fclose(config_file); - } - else { // no problems - fprintf(stderr, "vrpn_Tracker: Read room and sensor info from %s\n", - tracker_cfg_file_name); - fclose(config_file); - } -} - -int vrpn_Tracker::register_types(void) -{ - // Register this tracker device and the needed message types - if (d_connection) { - position_m_id = - d_connection->register_message_type("vrpn_Tracker Pos_Quat"); - velocity_m_id = - d_connection->register_message_type("vrpn_Tracker Velocity"); - accel_m_id = - d_connection->register_message_type("vrpn_Tracker Acceleration"); - tracker2room_m_id = - d_connection->register_message_type("vrpn_Tracker To_Room"); - unit2sensor_m_id = - d_connection->register_message_type("vrpn_Tracker Unit_To_Sensor"); - request_t2r_m_id = d_connection->register_message_type( - "vrpn_Tracker Request_Tracker_To_Room"); - request_u2s_m_id = d_connection->register_message_type( - "vrpn_Tracker Request_Unit_To_Sensor"); - workspace_m_id = - d_connection->register_message_type("vrpn_Tracker Workspace"); - request_workspace_m_id = d_connection->register_message_type( - "vrpn_Tracker Request_Tracker_Workspace"); - update_rate_id = - d_connection->register_message_type("vrpn_Tracker set_update_rate"); - reset_origin_m_id = - d_connection->register_message_type("vrpn_Tracker Reset_Origin"); - } - return 0; -} - -// virtual -// Delete all of the unit2sensor position and quaternion entries. -vrpn_Tracker::~vrpn_Tracker(void) -{ - if (unit2sensor != NULL) { - delete[] unit2sensor; - } - if (unit2sensor_quat != NULL) { - delete[] unit2sensor_quat; - } - num_unit2sensors = 0; -} - -// Make sure we have enough unit2sensor elements in the array. -// Returns false if we run out of memory, true otherwise. -bool vrpn_Tracker::ensure_enough_unit2sensors(unsigned num) -{ - unsigned i; - ++num; // Just to make sure we don't fall prey to off-by-one indexing - // errors. - if (num > num_unit2sensors) { - // Make sure we allocate in large chunks, rather than one at a time. - if (num < 2 * num_unit2sensors) { - num = 2 * num_unit2sensors; - } - - // Allocate new space for the two lists. - vrpn_Tracker_Pos *newlist = new vrpn_Tracker_Pos[num]; - if (newlist == NULL) { - return false; - } - vrpn_Tracker_Quat *newqlist = new vrpn_Tracker_Quat[num]; - if (newqlist == NULL) { - return false; - } - - // Copy all of the existing elements. - for (i = 0; i < num_unit2sensors; i++) { - memcpy(newlist[i], unit2sensor[i], sizeof(vrpn_Tracker_Pos)); - memcpy(newqlist[i], unit2sensor_quat[i], sizeof(vrpn_Tracker_Quat)); - } - - // Initialize all of the new elements - for (i = num_unit2sensors; i < num; i++) { - newlist[i][0] = newlist[i][1] = newlist[i][2] = 0.0; - newqlist[i][0] = 0.0; - newqlist[i][1] = 0.0; - newqlist[i][2] = 0.0; - newqlist[i][3] = 1.0; - } - - // Switch the new lists in for the old, and delete the old. - if (unit2sensor != NULL) { - delete[] unit2sensor; - } - if (unit2sensor_quat != NULL) { - delete[] unit2sensor_quat; - } - unit2sensor = newlist; - unit2sensor_quat = newqlist; - num_unit2sensors = num; - } - return true; -} - -int vrpn_Tracker::read_config_file(FILE *config_file, const char *tracker_name) -{ - - char line[512]; // line read from input file - vrpn_int32 num_sens; - vrpn_int32 which_sensor; - float f[14]; - int i, j; - - // Read lines from the file until we run out - while (fgets(line, sizeof(line), config_file) != NULL) { - // Make sure the line wasn't too long - if (strlen(line) >= sizeof(line) - 1) { - fprintf(stderr, "Line too long in config file: %s\n", line); - return -1; - } - // find tracker name in file - if ((!(strncmp(line, tracker_name, strlen(tracker_name)))) && - (isspace(line[strlen(tracker_name)]))) { - // get the tracker2room xform and the workspace volume - if (fgets(line, sizeof(line), config_file) == NULL) break; - if (sscanf(line, "%f%f%f", &f[0], &f[1], &f[2]) != 3) break; - if (fgets(line, sizeof(line), config_file) == NULL) break; - if (sscanf(line, "%f%f%f%f", &f[3], &f[4], &f[5], &f[6]) != 4) - break; - if (fgets(line, sizeof(line), config_file) == NULL) break; - if (sscanf(line, "%f%f%f%f%f%f", &f[7], &f[8], &f[9], &f[10], - &f[11], &f[12]) != 6) - break; - - for (i = 0; i < 3; i++) { - tracker2room[i] = f[i]; - workspace_min[i] = f[i + 7]; - workspace_max[i] = f[i + 10]; - } - for (i = 0; i < 4; i++) - tracker2room_quat[i] = f[i + 3]; - // get the number of sensors - if (fgets(line, sizeof(line), config_file) == NULL) break; - if (sscanf(line, "%d", &num_sens) != 1) break; - if (!ensure_enough_unit2sensors(num_sens + 1)) { - fprintf(stderr, "Out of memory\n"); - return -1; - } - for (i = 0; i < num_sens; i++) { - // get which sensor this xform is for - if (fgets(line, sizeof(line), config_file) == NULL) break; - if (sscanf(line, "%d", &which_sensor) != 1) break; - if (!ensure_enough_unit2sensors(which_sensor + 1)) { - fprintf(stderr, "Out of memory\n"); - return -1; - } - // get the sensor to unit xform - if (fgets(line, sizeof(line), config_file) == NULL) break; - if (sscanf(line, "%f%f%f", &f[0], &f[1], &f[2]) != 3) break; - if (fgets(line, sizeof(line), config_file) == NULL) break; - if (sscanf(line, "%f%f%f%f", &f[3], &f[4], &f[5], &f[6]) != 4) - break; - for (j = 0; j < 3; j++) { - unit2sensor[which_sensor][j] = f[j]; - } - for (j = 0; j < 4; j++) { - unit2sensor_quat[which_sensor][j] = f[j + 3]; - } - } - num_sensors = num_sens; - return 0; // success - } - } - fprintf(stderr, "Error reading or %s not found in config file\n", - tracker_name); - return -1; -} - -void vrpn_Tracker::print_latest_report(void) -{ - printf("----------------------------------------------------\n"); - printf("Sensor :%d\n", d_sensor); - printf("Timestamp :%ld:%ld\n", timestamp.tv_sec, - static_cast<long>(timestamp.tv_usec)); - printf("Framecount:%d\n", frame_count); - printf("Pos :%lf, %lf, %lf\n", pos[0], pos[1], pos[2]); - printf("Quat :%lf, %lf, %lf, %lf\n", d_quat[0], d_quat[1], d_quat[2], - d_quat[3]); -} - -int vrpn_Tracker::register_server_handlers(void) -{ - if (d_connection) { - if (register_autodeleted_handler(request_t2r_m_id, handle_t2r_request, - this, d_sender_id)) { - fprintf(stderr, "vrpn_Tracker:can't register t2r handler\n"); - return -1; - } - if (register_autodeleted_handler(request_u2s_m_id, handle_u2s_request, - this, d_sender_id)) { - fprintf(stderr, "vrpn_Tracker:can't register u2s handler\n"); - return -1; - } - if (register_autodeleted_handler(request_workspace_m_id, - handle_workspace_request, this, - d_sender_id)) { - fprintf(stderr, "vrpn_Tracker: " - "Can't register workspace handler\n"); - return -1; - } - } - else { - return -1; - } - return 0; -} - -// put copies of vector and quat into arrays passed in -void vrpn_Tracker::get_local_t2r(vrpn_float64 *vec, vrpn_float64 *quat) -{ - int i; - for (i = 0; i < 3; i++) - vec[i] = tracker2room[i]; - for (i = 0; i < 4; i++) - quat[i] = tracker2room_quat[i]; -} - -// put copies of vector and quat into arrays passed in -void vrpn_Tracker::get_local_u2s(vrpn_int32 sensor, vrpn_float64 *vec, - vrpn_float64 *quat) -{ - ensure_enough_unit2sensors(sensor + 1); - int i; - for (i = 0; i < 3; i++) - vec[i] = unit2sensor[sensor][i]; - for (i = 0; i < 4; i++) - quat[i] = unit2sensor_quat[sensor][i]; -} - -int vrpn_Tracker::handle_t2r_request(void *userdata, vrpn_HANDLERPARAM p) -{ - struct timeval current_time; - char msgbuf[1000]; - vrpn_int32 len; - vrpn_Tracker *me = (vrpn_Tracker *)userdata; // == this normally - - p = p; // Keep the compiler from complaining - - vrpn_gettimeofday(¤t_time, NULL); - me->timestamp.tv_sec = current_time.tv_sec; - me->timestamp.tv_usec = current_time.tv_usec; - - // our t2r transform was read in by the constructor - - // send t2r transform - if (me->d_connection) { - len = me->encode_tracker2room_to(msgbuf); - if (me->d_connection->pack_message( - len, me->timestamp, me->tracker2room_m_id, me->d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Tracker: cannot write t2r message\n"); - } - } - return 0; -} - -int vrpn_Tracker::handle_u2s_request(void *userdata, vrpn_HANDLERPARAM p) -{ - struct timeval current_time; - char msgbuf[1000]; - vrpn_int32 len; - vrpn_int32 i; - vrpn_Tracker *me = (vrpn_Tracker *)userdata; - - p = p; // Keep the compiler from complaining - - vrpn_gettimeofday(¤t_time, NULL); - me->timestamp.tv_sec = current_time.tv_sec; - me->timestamp.tv_usec = current_time.tv_usec; - - // our u2s transforms were read in by the constructor - - if (me->d_connection) { - me->ensure_enough_unit2sensors(me->num_sensors + 1); - for (i = 0; i < me->num_sensors; i++) { - me->d_sensor = i; - // send u2s transform - len = me->encode_unit2sensor_to(msgbuf); - if (me->d_connection->pack_message( - len, me->timestamp, me->unit2sensor_m_id, me->d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Tracker: cannot write u2s message\n"); - } - } - } - return 0; -} - -int vrpn_Tracker::handle_workspace_request(void *userdata, vrpn_HANDLERPARAM p) -{ - struct timeval current_time; - char msgbuf[1000]; - vrpn_int32 len; - vrpn_Tracker *me = (vrpn_Tracker *)userdata; - - p = p; // Keep the compiler from complaining - - vrpn_gettimeofday(¤t_time, NULL); - me->timestamp.tv_sec = current_time.tv_sec; - me->timestamp.tv_usec = current_time.tv_usec; - - // our workspace was read in by the constructor - - if (me->d_connection) { - len = me->encode_workspace_to(msgbuf); - if (me->d_connection->pack_message(len, me->timestamp, - me->workspace_m_id, me->d_sender_id, - msgbuf, vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Tracker: cannot write workspace message\n"); - } - } - return 0; -} - -/** Encodes the "Tracker to Room" transformation into the buffer - specified. Returns the number of bytes encoded into the - buffer. Assumes that the buffer can hold all of the data. - Encodes the position, then the quaternion. -*/ - -int vrpn_Tracker::encode_tracker2room_to(char *buf) -{ - char *bufptr = buf; - int buflen = 1000; - int i; - - // Encode the position part of the transformation. - for (i = 0; i < 3; i++) { - vrpn_buffer(&bufptr, &buflen, tracker2room[i]); - } - - // Encode the quaternion part of the transformation. - for (i = 0; i < 4; i++) { - vrpn_buffer(&bufptr, &buflen, tracker2room_quat[i]); - } - - // Return the number of characters sent. - return 1000 - buflen; -} - -/** Encodes the "Unit to Sensor" transformation into the buffer - specified. Returns the number of bytes encoded into the - buffer. Assumes that the buffer can hold all of the data. - Encodes the position, then the quaternion. - - WARNING: make sure sensor is set to desired value before encoding - this message. -*/ - -int vrpn_Tracker::encode_unit2sensor_to(char *buf) -{ - char *bufptr = buf; - int buflen = 1000; - int i; - - // Encode the sensor number, then put a filler in32 to re-align - // to the 64-bit boundary. - vrpn_buffer(&bufptr, &buflen, d_sensor); - vrpn_buffer(&bufptr, &buflen, (vrpn_int32)(0)); - - // Encode the position part of the transformation. - for (i = 0; i < 3; i++) { - vrpn_buffer(&bufptr, &buflen, unit2sensor[d_sensor][i]); - } - - // Encode the quaternion part of the transformation. - for (i = 0; i < 4; i++) { - vrpn_buffer(&bufptr, &buflen, unit2sensor_quat[d_sensor][i]); - } - - // Return the number of characters sent. - return 1000 - buflen; -} - -int vrpn_Tracker::encode_workspace_to(char *buf) -{ - char *bufptr = buf; - int buflen = 1000; - - vrpn_buffer(&bufptr, &buflen, workspace_min[0]); - vrpn_buffer(&bufptr, &buflen, workspace_min[1]); - vrpn_buffer(&bufptr, &buflen, workspace_min[2]); - - vrpn_buffer(&bufptr, &buflen, workspace_max[0]); - vrpn_buffer(&bufptr, &buflen, workspace_max[1]); - vrpn_buffer(&bufptr, &buflen, workspace_max[2]); - - return 1000 - buflen; -} - -// NOTE: you need to be sure that if you are sending vrpn_float64 then -// the entire array needs to remain aligned to 8 byte boundaries -// (malloced data and static arrays are automatically alloced in -// this way). Assumes that there is enough room to store the -// entire message. Returns the number of characters sent. -int vrpn_Tracker::encode_to(char *buf) -{ - char *bufptr = buf; - int buflen = 1000; - - // Message includes: long sensor, long scrap, vrpn_float64 pos[3], - // vrpn_float64 quat[4] - // Byte order of each needs to be reversed to match network standard - - vrpn_buffer(&bufptr, &buflen, d_sensor); - vrpn_buffer(&bufptr, &buflen, - d_sensor); // This is just to take up space to align - - vrpn_buffer(&bufptr, &buflen, pos[0]); - vrpn_buffer(&bufptr, &buflen, pos[1]); - vrpn_buffer(&bufptr, &buflen, pos[2]); - - vrpn_buffer(&bufptr, &buflen, d_quat[0]); - vrpn_buffer(&bufptr, &buflen, d_quat[1]); - vrpn_buffer(&bufptr, &buflen, d_quat[2]); - vrpn_buffer(&bufptr, &buflen, d_quat[3]); - - return 1000 - buflen; -} - -int vrpn_Tracker::encode_vel_to(char *buf) -{ - char *bufptr = buf; - int buflen = 1000; - - // Message includes: long unitNum, vrpn_float64 vel[3], vrpn_float64 - // vel_quat[4] - // Byte order of each needs to be reversed to match network standard - - vrpn_buffer(&bufptr, &buflen, d_sensor); - vrpn_buffer(&bufptr, &buflen, - d_sensor); // This is just to take up space to align - - vrpn_buffer(&bufptr, &buflen, vel[0]); - vrpn_buffer(&bufptr, &buflen, vel[1]); - vrpn_buffer(&bufptr, &buflen, vel[2]); - - vrpn_buffer(&bufptr, &buflen, vel_quat[0]); - vrpn_buffer(&bufptr, &buflen, vel_quat[1]); - vrpn_buffer(&bufptr, &buflen, vel_quat[2]); - vrpn_buffer(&bufptr, &buflen, vel_quat[3]); - - vrpn_buffer(&bufptr, &buflen, vel_quat_dt); - - return 1000 - buflen; -} - -int vrpn_Tracker::encode_acc_to(char *buf) -{ - char *bufptr = buf; - int buflen = 1000; - - // Message includes: long unitNum, vrpn_float64 acc[3], vrpn_float64 - // acc_quat[4] - // Byte order of each needs to be reversed to match network standard - - vrpn_buffer(&bufptr, &buflen, d_sensor); - vrpn_buffer(&bufptr, &buflen, - d_sensor); // This is just to take up space to align - - vrpn_buffer(&bufptr, &buflen, acc[0]); - vrpn_buffer(&bufptr, &buflen, acc[1]); - vrpn_buffer(&bufptr, &buflen, acc[2]); - - vrpn_buffer(&bufptr, &buflen, acc_quat[0]); - vrpn_buffer(&bufptr, &buflen, acc_quat[1]); - vrpn_buffer(&bufptr, &buflen, acc_quat[2]); - vrpn_buffer(&bufptr, &buflen, acc_quat[3]); - - vrpn_buffer(&bufptr, &buflen, acc_quat_dt); - - return 1000 - buflen; -} - -vrpn_Tracker_NULL::vrpn_Tracker_NULL(const char *name, vrpn_Connection *c, - vrpn_int32 sensors, vrpn_float64 Hz) - : vrpn_Tracker(name, c) - , update_rate(Hz) - , d_redundancy(NULL) -{ - num_sensors = sensors; - register_server_handlers(); - // Nothing left to do -} - -void vrpn_Tracker_NULL::mainloop() -{ - struct timeval current_time; - char msgbuf[1000]; - vrpn_int32 i, len; - - // Call the generic server mainloop routine, since this is a server - server_mainloop(); - - // See if its time to generate a new report - vrpn_gettimeofday(¤t_time, NULL); - if (vrpn_TimevalDuration(current_time, timestamp) >= - 1000000.0 / update_rate) { - - // Update the time - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - // Send messages for all sensors if we have a connection - if (d_redundancy) { - for (i = 0; i < num_sensors; i++) { - d_sensor = i; - - // Pack position report - len = encode_to(msgbuf); - if (d_redundancy->pack_message(len, timestamp, position_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, - "NULL tracker: can't write message: tossing\n"); - } - - // Pack velocity report - len = encode_vel_to(msgbuf); - if (d_redundancy->pack_message(len, timestamp, velocity_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, - "NULL tracker: can't write message: tossing\n"); - } - - // Pack acceleration report - len = encode_acc_to(msgbuf); - if (d_redundancy->pack_message(len, timestamp, accel_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, - "NULL tracker: can't write message: tossing\n"); - } - } - } - else if (d_connection) { - for (i = 0; i < num_sensors; i++) { - d_sensor = i; - - // Pack position report - len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, position_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, - "NULL tracker: can't write message: tossing\n"); - } - - // Pack velocity report - len = encode_vel_to(msgbuf); - if (d_connection->pack_message(len, timestamp, velocity_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, - "NULL tracker: can't write message: tossing\n"); - } - - // Pack acceleration report - len = encode_acc_to(msgbuf); - if (d_connection->pack_message(len, timestamp, accel_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, - "NULL tracker: can't write message: tossing\n"); - } - } - } - } -} - -void vrpn_Tracker_NULL::setRedundantTransmission(vrpn_RedundantTransmission *t) -{ - d_redundancy = t; -} - -vrpn_Tracker_Server::vrpn_Tracker_Server(const char *name, vrpn_Connection *c, - vrpn_int32 sensors) - : vrpn_Tracker(name, c) -{ - num_sensors = sensors; - register_server_handlers(); - // Nothing left to do -} - -void vrpn_Tracker_Server::mainloop() -{ - // Call the generic server mainloop routine, since this is a server - server_mainloop(); -} - -int vrpn_Tracker_Server::report_pose(const int sensor, const struct timeval t, - const vrpn_float64 position[3], - const vrpn_float64 quaternion[4], - const vrpn_uint32 class_of_service) -{ - char msgbuf[1000]; - vrpn_int32 len; - - // Update the time - timestamp.tv_sec = t.tv_sec; - timestamp.tv_usec = t.tv_usec; - - // Send messages for all sensors if we have a connection - if (sensor >= num_sensors) { - send_text_message("Sensor number too high", timestamp, vrpn_TEXT_ERROR); - return -1; - } - else if (!d_connection) { - send_text_message("No connection", timestamp, vrpn_TEXT_ERROR); - return -1; - } - else { - d_sensor = sensor; - - // Pack position report - memcpy(pos, position, sizeof(pos)); - memcpy(d_quat, quaternion, sizeof(d_quat)); - len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, position_m_id, - d_sender_id, msgbuf, class_of_service)) { - fprintf(stderr, - "vrpn_Tracker_Server: can't write message: tossing\n"); - return -1; - } - } - return 0; -} - -int vrpn_Tracker_Server::report_pose_velocity( - const int sensor, const struct timeval t, const vrpn_float64 position[3], - const vrpn_float64 quaternion[4], const vrpn_float64 interval, - const vrpn_uint32 class_of_service) -{ - char msgbuf[1000]; - vrpn_int32 len; - - // Update the time - timestamp.tv_sec = t.tv_sec; - timestamp.tv_usec = t.tv_usec; - - // Send messages for all sensors if we have a connection - if (sensor >= num_sensors) { - send_text_message("Sensor number too high", timestamp, vrpn_TEXT_ERROR); - return -1; - } - else if (!d_connection) { - send_text_message("No connection", timestamp, vrpn_TEXT_ERROR); - return -1; - } - else { - d_sensor = sensor; - - // Pack velocity report - memcpy(vel, position, sizeof(pos)); - memcpy(vel_quat, quaternion, sizeof(d_quat)); - vel_quat_dt = interval; - len = encode_vel_to(msgbuf); - if (d_connection->pack_message(len, timestamp, velocity_m_id, - d_sender_id, msgbuf, class_of_service)) { - fprintf(stderr, - "vrpn_Tracker_Server: can't write message: tossing\n"); - return -1; - } - } - - return 0; -} - -int vrpn_Tracker_Server::report_pose_acceleration( - const int sensor, const struct timeval t, const vrpn_float64 position[3], - const vrpn_float64 quaternion[4], const vrpn_float64 interval, - const vrpn_uint32 class_of_service) -{ - char msgbuf[1000]; - vrpn_int32 len; - - // Update the time - timestamp.tv_sec = t.tv_sec; - timestamp.tv_usec = t.tv_usec; - - // Send messages for all sensors if we have a connection - if (sensor >= num_sensors) { - send_text_message("Sensor number too high", timestamp, vrpn_TEXT_ERROR); - return -1; - } - else if (!d_connection) { - send_text_message("No connection", timestamp, vrpn_TEXT_ERROR); - return -1; - } - else { - d_sensor = sensor; - - // Pack acceleration report - memcpy(acc, position, sizeof(pos)); - memcpy(acc_quat, quaternion, sizeof(d_quat)); - acc_quat_dt = interval; - len = encode_acc_to(msgbuf); - if (d_connection->pack_message(len, timestamp, accel_m_id, d_sender_id, - msgbuf, class_of_service)) { - fprintf(stderr, - "vrpn_Tracker_Server: can't write message: tossing\n"); - return -1; - } - } - - return 0; -} - -#ifndef VRPN_CLIENT_ONLY -vrpn_Tracker_Serial::vrpn_Tracker_Serial(const char *name, vrpn_Connection *c, - const char *port, long baud) - : vrpn_Tracker(name, c) - , serial_fd(-1) -{ - register_server_handlers(); - // Find out the port name and baud rate - if (port == NULL) { - fprintf(stderr, "vrpn_Tracker_Serial: NULL port name\n"); - status = vrpn_TRACKER_FAIL; - return; - } - else { - strncpy(portname, port, sizeof(portname)); - portname[sizeof(portname) - 1] = '\0'; - } - baudrate = baud; - - // Open the serial port we're going to use - if ((serial_fd = vrpn_open_commport(portname, baudrate)) == -1) { - fprintf(stderr, "vrpn_Tracker_Serial: Cannot Open serial port\n"); - status = vrpn_TRACKER_FAIL; - } - - // Reset the tracker and find out what time it is - status = vrpn_TRACKER_RESETTING; - vrpn_gettimeofday(×tamp, NULL); -} - -vrpn_Tracker_Serial::~vrpn_Tracker_Serial() -{ - if (serial_fd >= 0) { - vrpn_close_commport(serial_fd); - serial_fd = -1; - } -} - -void vrpn_Tracker_Serial::send_report(void) -{ - // Send the message on the connection - if (d_connection) { - char msgbuf[1000]; - int len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, position_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "Tracker: cannot write message: tossing\n"); - } - } - else { - fprintf(stderr, "Tracker: No valid connection\n"); - } -} - -/** This function should be called each time through the main loop - of the server code. It polls for a report from the tracker and - sends them if there are one or more. It will reset the tracker - if there is no data from it for a few seconds. -**/ -void vrpn_Tracker_Serial::mainloop() -{ - server_mainloop(); - - switch (status) { - case vrpn_TRACKER_SYNCING: - case vrpn_TRACKER_AWAITING_STATION: - case vrpn_TRACKER_PARTIAL: { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - - while (get_report()) { // While we get reports, continue to send them. - send_report(); - }; - - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - int time_lapsed; /* The time since the last report */ - - // Watchdog timestamp is implemented by Polhemus Liberty driver. - // XXX All trackers should be modified to use this, or it to not. - // If the watchdog timestamp is zero, use the last timestamp to check. - if (watchdog_timestamp.tv_sec == 0) { - time_lapsed = vrpn_TimevalDuration(current_time, timestamp); - } - else { // The watchdog_timestamp is being used - time_lapsed = - vrpn_TimevalDuration(current_time, watchdog_timestamp); - } - - if (time_lapsed > vrpn_ser_tkr_MAX_TIME_INTERVAL) { - char errmsg[1024]; - sprintf(errmsg, "Tracker failed to read... current_time=%ld:%ld, " - "timestamp=%ld:%ld\n", - current_time.tv_sec, - static_cast<long>(current_time.tv_usec), timestamp.tv_sec, - static_cast<long>(timestamp.tv_usec)); - send_text_message(errmsg, current_time, vrpn_TEXT_ERROR); - status = vrpn_TRACKER_FAIL; - } - } break; - - case vrpn_TRACKER_RESETTING: - reset(); - break; - - case vrpn_TRACKER_FAIL: - send_text_message("Tracker failed, trying to reset (Try power cycle if " - "more than 4 attempts made)", - timestamp, vrpn_TEXT_ERROR); - if (serial_fd >= 0) { - vrpn_close_commport(serial_fd); - serial_fd = -1; - } - if ((serial_fd = vrpn_open_commport(portname, baudrate)) == -1) { - fprintf( - stderr, - "vrpn_Tracker_Serial::mainloop(): Cannot Open serial port\n"); - status = vrpn_TRACKER_FAIL; - } - status = vrpn_TRACKER_RESETTING; - break; - } -} - -#if defined(VRPN_USE_LIBUSB_1_0) - -vrpn_Tracker_USB::vrpn_Tracker_USB(const char *name, vrpn_Connection *c, - vrpn_uint16 vendor, vrpn_uint16 product, - long baud) - : vrpn_Tracker(name, c) - , _vendor(vendor) - , _product(product) - , _baudrate(baud) - , _device_handle(NULL) -{ - // Register handlers - register_server_handlers(); - - // Initialize libusb - if (libusb_init(&_context) != 0) { - fprintf(stderr, "vrpn_Tracker_USB: can't init LibUSB\n"); - status = vrpn_TRACKER_FAIL; - return; - } - // libusb_set_debug (_context, 3); - - // Open and claim an usb device with the expected vendor and product ID. - if ((_device_handle = libusb_open_device_with_vid_pid(_context, _vendor, - _product)) == NULL) { - fprintf(stderr, "vrpn_Tracker_USB: can't find any Polhemus High Speed " - "Liberty Latus devices\n"); - fprintf(stderr, - " (Did you remember to run as root?)\n"); - status = vrpn_TRACKER_FAIL; - return; - } - - if (libusb_claim_interface(_device_handle, 0) != 0) { - fprintf(stderr, - "vrpn_Tracker_USB: can't claim interface for this device\n"); - fprintf(stderr, - " (Did you remember to run as root?)\n"); - libusb_close(_device_handle); - _device_handle = NULL; - libusb_exit(_context); - _context = NULL; - status = vrpn_TRACKER_FAIL; - return; - } - - // Reset the tracker and find out what time it is - status = vrpn_TRACKER_RESETTING; - vrpn_gettimeofday(×tamp, NULL); -} - -vrpn_Tracker_USB::~vrpn_Tracker_USB() -{ - if (_device_handle) { - libusb_close(_device_handle); - _device_handle = NULL; - } - if (_context) { - libusb_exit(_context); - _context = NULL; - } -} - -void vrpn_Tracker_USB::send_report(void) -{ - // Send the message on the connection - if (d_connection) { - char msgbuf[1000]; - int len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, position_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "Tracker: cannot write message: tossing\n"); - } - } - else { - fprintf(stderr, "Tracker: No valid connection\n"); - } -} - -/** This function should be called each time through the main loop - of the server code. It polls for reports from the tracker and - sends them if there are one or more. It will reset the tracker - if there is no data from it for a few seconds. -**/ -void vrpn_Tracker_USB::mainloop() -{ - server_mainloop(); - - switch (status) { - case vrpn_TRACKER_SYNCING: - case vrpn_TRACKER_PARTIAL: { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - - get_report(); - - // Ready for another report - status = vrpn_TRACKER_SYNCING; - - // Save reception time - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - int time_lapsed; // The time since the last report - - // Watchdog timestamp is implemented by Polhemus Liberty driver. - // XXX All trackers should be modified to use this, or it to not. - // If the watchdog timestamp is zero, use the last timestamp to check. - if (watchdog_timestamp.tv_sec == 0) { - time_lapsed = vrpn_TimevalDuration(current_time, timestamp); - } - else { // The watchdog_timestamp is being used - time_lapsed = - vrpn_TimevalDuration(current_time, watchdog_timestamp); - } - - if (time_lapsed > vrpn_ser_tkr_MAX_TIME_INTERVAL) { - char errmsg[1024]; - sprintf(errmsg, "Tracker failed to read... current_time=%ld:%ld, " - "timestamp=%ld:%ld\n", - current_time.tv_sec, - static_cast<long>(current_time.tv_usec), timestamp.tv_sec, - static_cast<long>(timestamp.tv_usec)); - send_text_message(errmsg, current_time, vrpn_TEXT_ERROR); - status = vrpn_TRACKER_FAIL; - } - - } break; - - case vrpn_TRACKER_RESETTING: - reset(); - break; - - case vrpn_TRACKER_FAIL: - send_text_message("Tracker failed, trying to reset (Try power cycle if " - "more than 4 attempts made)", - timestamp, vrpn_TEXT_ERROR); - // Reset the device handle and then attempt to connect to a device. - if (_device_handle) { - libusb_close(_device_handle); - _device_handle = NULL; - } - if ((_device_handle = libusb_open_device_with_vid_pid( - _context, _vendor, _product)) == NULL) { - fprintf(stderr, "vrpn_Tracker_USB::mainloop(): can't find any " - "Polhemus High Speed Liberty Latus devices\n"); - status = vrpn_TRACKER_FAIL; - break; - } - - if (libusb_claim_interface(_device_handle, 0) != 0) { - fprintf(stderr, "vrpn_Tracker_USB::mainloop(): can't claim " - "interface for this device\n"); - libusb_close(_device_handle); - _device_handle = NULL; - status = vrpn_TRACKER_FAIL; - break; - } - - status = vrpn_TRACKER_RESETTING; - break; - } -} - -// End of LIBUSB -#endif - -#endif // VRPN_CLIENT_ONLY - -vrpn_Tracker_Remote::vrpn_Tracker_Remote(const char *name, vrpn_Connection *cn) - : vrpn_Tracker(name, cn) - , sensor_callbacks(NULL) - , num_sensor_callbacks(0) -{ - // Make sure that we have a valid connection - if (d_connection == NULL) { - fprintf(stderr, "vrpn_Tracker_Remote: No connection\n"); - return; - } - - // Register a handler for the position change callback from this device. - if (register_autodeleted_handler(position_m_id, handle_change_message, this, - d_sender_id)) { - fprintf(stderr, - "vrpn_Tracker_Remote: can't register position handler\n"); - d_connection = NULL; - } - - // Register a handler for the velocity change callback from this device. - if (register_autodeleted_handler(velocity_m_id, handle_vel_change_message, - this, d_sender_id)) { - fprintf(stderr, - "vrpn_Tracker_Remote: can't register velocity handler\n"); - d_connection = NULL; - } - - // Register a handler for the acceleration change callback. - if (register_autodeleted_handler(accel_m_id, handle_acc_change_message, - this, d_sender_id)) { - fprintf(stderr, - "vrpn_Tracker_Remote: can't register acceleration handler\n"); - d_connection = NULL; - } - - // Register a handler for the room to tracker xform change callback - if (register_autodeleted_handler(tracker2room_m_id, - handle_tracker2room_change_message, this, - d_sender_id)) { - fprintf(stderr, - "vrpn_Tracker_Remote: can't register tracker2room handler\n"); - d_connection = NULL; - } - - // Register a handler for the sensor to unit xform change callback - if (register_autodeleted_handler(unit2sensor_m_id, - handle_unit2sensor_change_message, this, - d_sender_id)) { - fprintf(stderr, - "vrpn_Tracker_Remote: can't register unit2sensor handler\n"); - d_connection = NULL; - } - - // Register a handler for the workspace change callback - if (register_autodeleted_handler(workspace_m_id, - handle_workspace_change_message, this, - d_sender_id)) { - fprintf(stderr, - "vrpn_Tracker_Remote: can't register workspace handler\n"); - d_connection = NULL; - } - - // Find out what time it is and put this into the timestamp - vrpn_gettimeofday(×tamp, NULL); -} - -// The remote tracker has to un-register its handlers when it -// is destroyed to avoid seg faults (this is taken care of by -// using autodeleted handlers above). It should also remove all -// remaining user-registered callbacks to free up memory. - -vrpn_Tracker_Remote::~vrpn_Tracker_Remote() -{ - if (sensor_callbacks != NULL) { - delete[] sensor_callbacks; - } - num_sensor_callbacks = 0; -} - -// Make sure we have enough sensor_callback elements in the array. -// Returns false if we run out of memory, true otherwise. -bool vrpn_Tracker_Remote::ensure_enough_sensor_callbacks(unsigned num) -{ - unsigned i; - ++num; // Just to make sure we don't fall prey to off-by-one indexing - // errors. - if (num > num_sensor_callbacks) { - // Make sure we allocate in large chunks, rather than one at a time. - if (num < 2 * num_sensor_callbacks) { - num = 2 * num_sensor_callbacks; - } - - // Allocate new space for the list. - vrpn_Tracker_Sensor_Callbacks *newlist = - new vrpn_Tracker_Sensor_Callbacks[num]; - if (newlist == NULL) { - return false; - } - - // Copy all of the existing elements. - for (i = 0; i < num_sensor_callbacks; i++) { - newlist[i] = sensor_callbacks[i]; - } - - // The new elements will be empty by default, nothing to do here. - - // Switch the new list in for the old, and delete the old. - if (sensor_callbacks != NULL) { - delete[] sensor_callbacks; - } - sensor_callbacks = newlist; - num_sensor_callbacks = num; - } - return true; -} - -int vrpn_Tracker_Remote::request_t2r_xform(void) -{ - char *msgbuf = NULL; - vrpn_int32 len = 0; // no payload - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - if (d_connection->pack_message(len, timestamp, request_t2r_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Tracker_Remote: cannot request t2r xform\n"); - return -1; - } - } - return 0; -} - -int vrpn_Tracker_Remote::request_u2s_xform(void) -{ - char *msgbuf = NULL; - vrpn_int32 len = 0; // no payload - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - if (d_connection->pack_message(len, timestamp, request_u2s_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Tracker_Remote: cannot request u2s xform\n"); - return -1; - } - } - return 0; -} - -int vrpn_Tracker_Remote::request_workspace(void) -{ - char *msgbuf = NULL; - vrpn_int32 len = 0; // no payload - struct timeval current_time; - - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - if (d_connection->pack_message(len, timestamp, request_workspace_m_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Tracker_Remote: cannot request workspace\n"); - return -1; - } - } - - return 0; -} - -int vrpn_Tracker_Remote::set_update_rate(vrpn_float64 samplesPerSecond) -{ - char *msgbuf; - vrpn_int32 len; - struct timeval now; - - len = sizeof(vrpn_float64); - msgbuf = new char[len]; - if (!msgbuf) { - fprintf(stderr, "vrpn_Tracker_Remote::set_update_rate: " - "Out of memory!\n"); - return -1; - } - - vrpn_int32 buflen = len; - vrpn_buffer(&msgbuf, &buflen, samplesPerSecond); - - vrpn_gettimeofday(&now, NULL); - timestamp.tv_sec = now.tv_sec; - timestamp.tv_usec = now.tv_usec; - - if (d_connection) { - if (d_connection->pack_message(len, timestamp, update_rate_id, - d_sender_id, msgbuf, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, "vrpn_Tracker_Remote::set_update_rate: " - "Cannot send message.\n"); - return -1; - } - } - return 0; -} - -int vrpn_Tracker_Remote::reset_origin() -{ - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - - if (d_connection) { - if (d_connection->pack_message(0, timestamp, reset_origin_m_id, - d_sender_id, NULL, - vrpn_CONNECTION_RELIABLE)) { - fprintf(stderr, - "vrpn_Tracker_Remote: cannot write message: tossing\n"); - } - } - return 0; -} - -void vrpn_Tracker_Remote::mainloop() -{ - if (d_connection) { - d_connection->mainloop(); - } - client_mainloop(); -} - -int vrpn_Tracker_Remote::register_change_handler( - void *userdata, vrpn_TRACKERCHANGEHANDLER handler, vrpn_int32 whichSensor) -{ - if (whichSensor < vrpn_ALL_SENSORS) { - fprintf( - stderr, - "vrpn_Tracker_Remote::register_change_handler: bad sensor index\n"); - return -1; - } - // Ensure that the handler is non-NULL - if (handler == NULL) { - fprintf(stderr, - "vrpn_Tracker_Remote::register_change_handler: NULL handler\n"); - return -1; - } - - // If this is the ALL_SENSORS value, put it on the all list; otherwise, - // put it into the normal list. - if (whichSensor == vrpn_ALL_SENSORS) { - return all_sensor_callbacks.d_change.register_handler(userdata, - handler); - } - else if (ensure_enough_sensor_callbacks(whichSensor)) { - return sensor_callbacks[whichSensor].d_change.register_handler(userdata, - handler); - } - else { - fprintf( - stderr, - "vrpn_Tracker_Remote::register_change_handler: Out of memory\n"); - return -1; - } -} - -int vrpn_Tracker_Remote::register_change_handler( - void *userdata, vrpn_TRACKERVELCHANGEHANDLER handler, - vrpn_int32 whichSensor) -{ - if (whichSensor < vrpn_ALL_SENSORS) { - fprintf( - stderr, - "vrpn_Tracker_Remote::register_change_handler: bad sensor index\n"); - return -1; - } - // Ensure that the handler is non-NULL - if (handler == NULL) { - fprintf(stderr, - "vrpn_Tracker_Remote::register_change_handler: NULL handler\n"); - return -1; - } - - // If this is the ALL_SENSORS value, put it on the all list; otherwise, - // put it into the normal list. - if (whichSensor == vrpn_ALL_SENSORS) { - return all_sensor_callbacks.d_velchange.register_handler(userdata, - handler); - } - else if (ensure_enough_sensor_callbacks(whichSensor)) { - return sensor_callbacks[whichSensor].d_velchange.register_handler( - userdata, handler); - } - else { - fprintf( - stderr, - "vrpn_Tracker_Remote::register_change_handler: Out of memory\n"); - return -1; - } -} - -int vrpn_Tracker_Remote::register_change_handler( - void *userdata, vrpn_TRACKERACCCHANGEHANDLER handler, - vrpn_int32 whichSensor) -{ - if (whichSensor < vrpn_ALL_SENSORS) { - fprintf( - stderr, - "vrpn_Tracker_Remote::register_change_handler: bad sensor index\n"); - return -1; - } - - // Ensure that the handler is non-NULL - if (handler == NULL) { - fprintf(stderr, - "vrpn_Tracker_Remote::register_change_handler: NULL handler\n"); - return -1; - } - - // If this is the ALL_SENSORS value, put it on the all list; otherwise, - // put it into the normal list. - if (whichSensor == vrpn_ALL_SENSORS) { - return all_sensor_callbacks.d_accchange.register_handler(userdata, - handler); - } - else if (ensure_enough_sensor_callbacks(whichSensor)) { - return sensor_callbacks[whichSensor].d_accchange.register_handler( - userdata, handler); - } - else { - fprintf( - stderr, - "vrpn_Tracker_Remote::register_change_handler: Out of memory\n"); - return -1; - } -} - -int vrpn_Tracker_Remote::register_change_handler( - void *userdata, vrpn_TRACKERUNIT2SENSORCHANGEHANDLER handler, - vrpn_int32 whichSensor) -{ - if (whichSensor < vrpn_ALL_SENSORS) { - fprintf( - stderr, - "vrpn_Tracker_Remote::register_change_handler: bad sensor index\n"); - return -1; - } - - // Ensure that the handler is non-NULL - if (handler == NULL) { - fprintf(stderr, "%s%s", "vrpn_Tracker_Remote:", - ":register_change_handler: NULL handler\n"); - return -1; - } - - // If this is the ALL_SENSORS value, put it on the all list; otherwise, - // put it into the normal list. - if (whichSensor == vrpn_ALL_SENSORS) { - return all_sensor_callbacks.d_unit2sensorchange.register_handler( - userdata, handler); - } - else if (ensure_enough_sensor_callbacks(whichSensor)) { - return sensor_callbacks[whichSensor] - .d_unit2sensorchange.register_handler(userdata, handler); - } - else { - fprintf( - stderr, - "vrpn_Tracker_Remote::register_change_handler: Out of memory\n"); - return -1; - } -} - -int vrpn_Tracker_Remote::unregister_change_handler( - void *userdata, vrpn_TRACKERCHANGEHANDLER handler, vrpn_int32 whichSensor) -{ - if (whichSensor < vrpn_ALL_SENSORS) { - fprintf(stderr, "vrpn_Tracker_Remote::unregister_change_handler: bad " - "sensor index\n"); - return -1; - } - - if (whichSensor == vrpn_ALL_SENSORS) { - return all_sensor_callbacks.d_change.unregister_handler(userdata, - handler); - } - else if (ensure_enough_sensor_callbacks(whichSensor)) { - return sensor_callbacks[whichSensor].d_change.unregister_handler( - userdata, handler); - } - else { - fprintf( - stderr, - "vrpn_Tracker_Remote::unregister_change_handler: Out of memory\n"); - return -1; - } -} - -int vrpn_Tracker_Remote::unregister_change_handler( - void *userdata, vrpn_TRACKERVELCHANGEHANDLER handler, - vrpn_int32 whichSensor) -{ - if (whichSensor < vrpn_ALL_SENSORS) { - fprintf(stderr, "vrpn_Tracker_Remote::unregister_change_handler: bad " - "sensor index\n"); - return -1; - } - - if (whichSensor == vrpn_ALL_SENSORS) { - return all_sensor_callbacks.d_velchange.unregister_handler(userdata, - handler); - } - else if (ensure_enough_sensor_callbacks(whichSensor)) { - return sensor_callbacks[whichSensor].d_velchange.unregister_handler( - userdata, handler); - } - else { - fprintf( - stderr, - "vrpn_Tracker_Remote::unregister_change_handler: Out of memory\n"); - return -1; - } -} - -int vrpn_Tracker_Remote::unregister_change_handler( - void *userdata, vrpn_TRACKERACCCHANGEHANDLER handler, - vrpn_int32 whichSensor) -{ - if (whichSensor < vrpn_ALL_SENSORS) { - fprintf(stderr, "vrpn_Tracker_Remote::unregister_change_handler: bad " - "sensor index\n"); - return -1; - } - - if (whichSensor == vrpn_ALL_SENSORS) { - return all_sensor_callbacks.d_accchange.unregister_handler(userdata, - handler); - } - else if (ensure_enough_sensor_callbacks(whichSensor)) { - return sensor_callbacks[whichSensor].d_accchange.unregister_handler( - userdata, handler); - } - else { - fprintf( - stderr, - "vrpn_Tracker_Remote::unregister_change_handler: Out of memory\n"); - return -1; - } -} - -int vrpn_Tracker_Remote::unregister_change_handler( - void *userdata, vrpn_TRACKERUNIT2SENSORCHANGEHANDLER handler, - vrpn_int32 whichSensor) -{ - if (whichSensor < vrpn_ALL_SENSORS) { - fprintf(stderr, "vrpn_Tracker_Remote::unregister_change_handler: bad " - "sensor index\n"); - return -1; - } - - if (whichSensor == vrpn_ALL_SENSORS) { - return all_sensor_callbacks.d_unit2sensorchange.unregister_handler( - userdata, handler); - } - else if (ensure_enough_sensor_callbacks(whichSensor)) { - return sensor_callbacks[whichSensor] - .d_unit2sensorchange.unregister_handler(userdata, handler); - } - else { - fprintf( - stderr, - "vrpn_Tracker_Remote::unregister_change_handler: Out of memory\n"); - return -1; - } -} - -int vrpn_Tracker_Remote::handle_change_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Tracker_Remote *me = (vrpn_Tracker_Remote *)userdata; - const char *params = (p.buffer); - vrpn_int32 padding; - vrpn_TRACKERCB tp; - int i; - - // Fill in the parameters to the tracker from the message - if (p.payload_len != (8 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_Tracker: change message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", p.payload_len, - static_cast<unsigned long>(8 * sizeof(vrpn_float64))); - return -1; - } - tp.msg_time = p.msg_time; - vrpn_unbuffer(¶ms, &tp.sensor); - vrpn_unbuffer(¶ms, &padding); - - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &tp.pos[i]); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &tp.quat[i]); - } - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->all_sensor_callbacks.d_change.call_handlers(tp); - - // Go down the list of callbacks that have been registered for this - // particular sensor - if (tp.sensor < 0) { - fprintf(stderr, "vrpn_Tracker_Rem:pos sensor index is negative!\n"); - return -1; - } - else if (me->ensure_enough_sensor_callbacks(tp.sensor)) { - me->sensor_callbacks[tp.sensor].d_change.call_handlers(tp); - } - else { - fprintf(stderr, "vrpn_Tracker_Rem:pos sensor index too large\n"); - return -1; - } - return 0; -} - -int vrpn_Tracker_Remote::handle_vel_change_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Tracker_Remote *me = (vrpn_Tracker_Remote *)userdata; - const char *params = p.buffer; - vrpn_int32 padding; - vrpn_TRACKERVELCB tp; - int i; - - // Fill in the parameters to the tracker from the message - if (p.payload_len != (9 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_Tracker: vel message payload error\n"); - fprintf(stderr, " (got %d, expected %lud)\n", p.payload_len, - static_cast<unsigned long>(9 * sizeof(vrpn_float64))); - return -1; - } - tp.msg_time = p.msg_time; - vrpn_unbuffer(¶ms, &tp.sensor); - vrpn_unbuffer(¶ms, &padding); - - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &tp.vel[i]); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &tp.vel_quat[i]); - } - - vrpn_unbuffer(¶ms, &tp.vel_quat_dt); - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->all_sensor_callbacks.d_velchange.call_handlers(tp); - - // Go down the list of callbacks that have been registered for this - // particular sensor - if (me->ensure_enough_sensor_callbacks(tp.sensor)) { - me->sensor_callbacks[tp.sensor].d_velchange.call_handlers(tp); - } - else { - fprintf(stderr, "vrpn_Tracker_Rem:vel sensor index too large\n"); - return -1; - } - return 0; -} - -int vrpn_Tracker_Remote::handle_acc_change_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Tracker_Remote *me = (vrpn_Tracker_Remote *)userdata; - const char *params = p.buffer; - vrpn_int32 padding; - vrpn_TRACKERACCCB tp; - int i; - - // Fill in the parameters to the tracker from the message - if (p.payload_len != (9 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_Tracker: acc message payload error\n"); - fprintf(stderr, "(got %d, expected %lud)\n", p.payload_len, - static_cast<unsigned long>(9 * sizeof(vrpn_float64))); - return -1; - } - tp.msg_time = p.msg_time; - vrpn_unbuffer(¶ms, &tp.sensor); - vrpn_unbuffer(¶ms, &padding); - - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &tp.acc[i]); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &tp.acc_quat[i]); - } - - vrpn_unbuffer(¶ms, &tp.acc_quat_dt); - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->all_sensor_callbacks.d_accchange.call_handlers(tp); - - // Go down the list of callbacks that have been registered for this - // particular sensor - if (me->ensure_enough_sensor_callbacks(tp.sensor)) { - me->sensor_callbacks[tp.sensor].d_accchange.call_handlers(tp); - } - else { - fprintf(stderr, "vrpn_Tracker_Rem:acc sensor index too large\n"); - return -1; - } - return 0; -} - -int vrpn_Tracker_Remote::handle_unit2sensor_change_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Tracker_Remote *me = (vrpn_Tracker_Remote *)userdata; - const char *params = p.buffer; - vrpn_int32 padding; - vrpn_TRACKERUNIT2SENSORCB tp; - int i; - - // Fill in the parameters to the tracker from the message - if (p.payload_len != (8 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_Tracker: unit2sensor message payload"); - fprintf(stderr, " error\n(got %d, expected %lud)\n", p.payload_len, - static_cast<unsigned long>(8 * sizeof(vrpn_float64))); - return -1; - } - tp.msg_time = p.msg_time; - vrpn_unbuffer(¶ms, &tp.sensor); - vrpn_unbuffer(¶ms, &padding); - - // Typecasting used to get the byte order correct on the vrpn_float64 - // that are coming from the other side. - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &tp.unit2sensor[i]); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &tp.unit2sensor_quat[i]); - } - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->all_sensor_callbacks.d_unit2sensorchange.call_handlers(tp); - - // Go down the list of callbacks that have been registered for this - // particular sensor - if (me->ensure_enough_sensor_callbacks(tp.sensor)) { - me->sensor_callbacks[tp.sensor].d_unit2sensorchange.call_handlers(tp); - } - else { - fprintf(stderr, "vrpn_Tracker_Rem:u2s sensor index too large\n"); - return -1; - } - - return 0; -} - -int vrpn_Tracker_Remote::handle_tracker2room_change_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Tracker_Remote *me = (vrpn_Tracker_Remote *)userdata; - const char *params = p.buffer; - vrpn_TRACKERTRACKER2ROOMCB tp; - int i; - - // Fill in the parameters to the tracker from the message - if (p.payload_len != (7 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_Tracker: tracker2room message payload"); - fprintf(stderr, " error\n(got %d, expected %lud)\n", p.payload_len, - static_cast<unsigned long>(7 * sizeof(vrpn_float64))); - return -1; - } - tp.msg_time = p.msg_time; - - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &tp.tracker2room[i]); - } - for (i = 0; i < 4; i++) { - vrpn_unbuffer(¶ms, &tp.tracker2room_quat[i]); - } - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->d_tracker2roomchange_list.call_handlers(tp); - - return 0; -} - -int vrpn_Tracker_Remote::handle_workspace_change_message(void *userdata, - vrpn_HANDLERPARAM p) -{ - vrpn_Tracker_Remote *me = (vrpn_Tracker_Remote *)userdata; - const char *params = p.buffer; - vrpn_TRACKERWORKSPACECB tp; - int i; - - // Fill in the parameters to the tracker from the message - if (p.payload_len != (6 * sizeof(vrpn_float64))) { - fprintf(stderr, "vrpn_Tracker: tracker2room message payload"); - fprintf(stderr, " error\n(got %d, expected %lud)\n", p.payload_len, - static_cast<unsigned long>(6 * sizeof(vrpn_float64))); - return -1; - } - tp.msg_time = p.msg_time; - - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &tp.workspace_min[i]); - } - for (i = 0; i < 3; i++) { - vrpn_unbuffer(¶ms, &tp.workspace_max[i]); - } - - // Go down the list of callbacks that have been registered. - // Fill in the parameter and call each. - me->d_workspacechange_list.call_handlers(tp); - - return 0; -} diff --git a/src/vrpn/vrpn_Tracker.h b/src/vrpn/vrpn_Tracker.h deleted file mode 100644 index 45a0286f668b59f8ba74fc86d708754faff0dcc3..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker.h +++ /dev/null @@ -1,496 +0,0 @@ -#ifndef vrpn_TRACKER_H -#define vrpn_TRACKER_H -#include <stdio.h> // for NULL, FILE - -// NOTE: a vrpn tracker must call user callbacks with tracker data (pos and -// ori info) which represent the transformation xfSourceFromSensor. -// This means that the pos info is the position of the origin of -// the sensor coord sys in the source coord sys space, and the -// quat represents the orientation of the sensor relative to the -// source space (ie, its value rotates the source's axes so that -// they coincide with the sensor's) -// Positions from all trackers in VRPN are reported in meters. -// Velocities are reported in meters/second. -// Accelerations are reported in meters/second/second. -// These are all reported in three-element double arrays -// in the order (X=0, Y=1, Z=2). -// They are translated into this format from the native format for each device. -// Orientations from all trackers in VRPN are reported in quaternions -// (see Quatlib for more info) in four-element double arrays -// in the order (X=0, Y=1, Z=2, W=3). -// They are translated into this format from the native format for each device. - -// to use time synched tracking, just pass in a sync connection to the -// client and the server - -#include "vrpn_BaseClass.h" // for vrpn_Callback_List, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API, etc -#include "vrpn_Connection.h" -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_float64, vrpn_int32, etc - -class VRPN_API vrpn_RedundantTransmission; - -// tracker status flags -const int vrpn_TRACKER_SYNCING = (3); -const int vrpn_TRACKER_AWAITING_STATION = (2); -const int vrpn_TRACKER_REPORT_READY = (1); -const int vrpn_TRACKER_PARTIAL = (0); -const int vrpn_TRACKER_RESETTING = (-1); -const int vrpn_TRACKER_FAIL = (-2); - -// index for the change_list that should be called for all sensors. -// Not an in-range index. -const int vrpn_ALL_SENSORS = -1; - -typedef vrpn_float64 vrpn_Tracker_Pos[3]; -typedef vrpn_float64 vrpn_Tracker_Quat[4]; - -class VRPN_API vrpn_Tracker : public vrpn_BaseClass { -public: - // vrpn_Tracker.cfg, in the "local" directory, is the default config file - // . You can specify a different config file in the constructor. When - // you do this, you must also specify a vrpn_Connection. Pass in NULL - // if you don't have one. This awkwardness is because C++ requires that - // only the rightmost arguments can use the default values, and that the - // order of arguments must match the base class :( - vrpn_Tracker(const char *name, vrpn_Connection *c = NULL, - const char *tracker_cfg_file_name = NULL); - - virtual ~vrpn_Tracker(void); - - int read_config_file(FILE *config_file, const char *tracker_name); - void print_latest_report(void); - // a tracker server should call the following to register the - // default xform and workspace request handlers - int register_server_handlers(void); - void get_local_t2r(vrpn_float64 *vec, vrpn_float64 *quat); - void get_local_u2s(vrpn_int32 sensor, vrpn_float64 *vec, - vrpn_float64 *quat); - static int VRPN_CALLBACK - handle_t2r_request(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_u2s_request(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_workspace_request(void *userdata, vrpn_HANDLERPARAM p); - // static int VRPN_CALLBACK handle_update_rate_request (void *, - // vrpn_HANDLERPARAM); - -protected: - vrpn_int32 position_m_id; // ID of tracker position message - vrpn_int32 velocity_m_id; // ID of tracker velocity message - vrpn_int32 accel_m_id; // ID of tracker acceleration message - vrpn_int32 tracker2room_m_id; // ID of tracker tracker2room message - vrpn_int32 unit2sensor_m_id; // ID of tracker unit2sensor message - vrpn_int32 request_t2r_m_id; // ID of tracker2room request message - vrpn_int32 request_u2s_m_id; // ID of unit2sensor request message - vrpn_int32 request_workspace_m_id; // ID of workspace request message - vrpn_int32 workspace_m_id; // ID of workspace message - vrpn_int32 update_rate_id; // ID of update rate message - vrpn_int32 connection_dropped_m_id; // ID of connection dropped message - vrpn_int32 reset_origin_m_id; // ID of reset origin message - - // Description of the next report to go out - vrpn_int32 d_sensor; // Current sensor - vrpn_float64 pos[3], d_quat[4]; // Current pose, (x,y,z), (qx,qy,qz,qw) - vrpn_float64 vel[3], vel_quat[4]; // Cur velocity and dQuat/vel_quat_dt - vrpn_float64 vel_quat_dt; // delta time (in secs) for vel_quat - vrpn_float64 acc[3], acc_quat[4]; // Cur accel and d2Quat/acc_quat_dt2 - vrpn_float64 acc_quat_dt; // delta time (in secs) for acc_quat - struct timeval timestamp; // Current timestamp - vrpn_int32 frame_count; // Current framecount - - // The timestamp that the last report was received (Used by the Liberty - // Driver) - // Other trackers use timestamp as the watchdog, however due to variable USB - // latency the Liberty driver uses the device timestamp and not the computer - // clock - // at the time the report was received. This however can drift - // from the computer time, and hence it can cause a reset when things are - // working fine - struct timeval watchdog_timestamp; - - vrpn_float64 tracker2room[3], tracker2room_quat[4]; // Current t2r xform - vrpn_int32 num_sensors; - - // Arrays of values, one per sensor. Includes function to ensure there are - // enough there for a specified number of sensors. - vrpn_Tracker_Pos *unit2sensor; - vrpn_Tracker_Quat *unit2sensor_quat; // Current u2s xforms - unsigned num_unit2sensors; - bool ensure_enough_unit2sensors(unsigned num); - - // bounding box for the tracker workspace (in tracker space) - // these are the points with (x,y,z) minimum and maximum - // note: we assume the bounding box edges are aligned with the tracker - // coordinate system - vrpn_float64 workspace_min[3], workspace_max[3]; - - int status; // What are we doing? - - virtual int register_types(void); //< Called by BaseClass init() - virtual int encode_to(char *buf); // Encodes the position report - // Not all trackers will call the velocity and acceleration packers - virtual int encode_vel_to(char *buf); // Encodes the velocity report - virtual int encode_acc_to(char *buf); // Encodes the acceleration report - virtual int encode_tracker2room_to(char *buf); // Encodes the tracker2room - virtual int encode_unit2sensor_to(char *buf); // and unit2sensor xforms - virtual int encode_workspace_to(char *buf); // Encodes workspace info -}; - -#ifndef VRPN_CLIENT_ONLY -#define VRPN_TRACKER_BUF_SIZE 100 - -class VRPN_API vrpn_Tracker_Serial : public vrpn_Tracker { -public: - vrpn_Tracker_Serial(const char *name, vrpn_Connection *c, - const char *port = "/dev/ttyS1", long baud = 38400); - virtual ~vrpn_Tracker_Serial(); - -protected: - char portname[VRPN_TRACKER_BUF_SIZE]; - long baudrate; - int serial_fd; - - unsigned char buffer[VRPN_TRACKER_BUF_SIZE]; // Characters read in from the - // tracker so far - vrpn_uint32 bufcount; // How many characters in the buffer? - - /// Gets a report if one is available, returns 0 if not, 1 if complete - /// report. - virtual int get_report(void) = 0; - - // Sends the report that was just read. - virtual void send_report(void); - - /// Reset the tracker. - virtual void reset(void) = 0; - -public: - /// Uses the get_report, send_report, and reset routines to implement a - /// server - virtual void mainloop(); -}; - -// This driver uses the VRPN-preferred LibUSB-1.0 to control the device. -#if defined(VRPN_USE_LIBUSB_1_0) -struct libusb_device_handle; // IWYU pragma: keep -struct libusb_context; // IWYU pragma: keep -#define VRPN_TRACKER_USB_BUF_SIZE 1000 - -class VRPN_API vrpn_Tracker_USB : public vrpn_Tracker { -public: - vrpn_Tracker_USB(const char *name, vrpn_Connection *c, vrpn_uint16 vendor, - vrpn_uint16 product, long baud = 115200); - virtual ~vrpn_Tracker_USB(); - -protected: - struct libusb_device_handle *_device_handle; // Handle for the USB device - struct libusb_context *_context; // LibUSB context used for this device - vrpn_uint16 _vendor; // Vendor ID for usb device - vrpn_uint16 _product; // Product ID for usb device - long _baudrate; - - vrpn_uint8 buffer[VRPN_TRACKER_USB_BUF_SIZE]; // Characters read in from the - // tracker - vrpn_uint32 bufcount; // How many characters in the buffer? - - /// Gets reports if some are available, returns 0 if not, 1 if complete - /// report(s). - virtual int get_report(void) = 0; - - // Sends the report that was just read. - virtual void send_report(void); - - /// Reset the tracker. - virtual void reset(void) = 0; - -public: - /// Uses the get_report, send_report, and reset routines to implement a - /// server - virtual void mainloop(); -}; - -// End of VRPN_USE_LIBUSB_1_0 -#endif - -#endif // VRPN_CLIENT_ONLY - -// This is an example of a tracker server. It basically reports the -// position at the origin with zero velocity and acceleration over and -// over again at the rate requested. It is here mostly as an example of -// how to build a tracker server, and also serves as a test object for -// client codes and VRPN builds. - -class VRPN_API vrpn_Tracker_NULL : public vrpn_Tracker { -public: - vrpn_Tracker_NULL(const char *name, vrpn_Connection *c, - vrpn_int32 sensors = 1, vrpn_float64 Hz = 1.0); - virtual void mainloop(); - - void setRedundantTransmission(vrpn_RedundantTransmission *); - -protected: - vrpn_float64 update_rate; - - vrpn_RedundantTransmission *d_redundancy; -}; - -// This is a tracker server that can be used by an application that -// just wants to generate tracker reports but does not really have -// a tracker device to drive. Similar to the vrpn_Analog_Server, it -// provides a quick and easy way for an application to report things. -// -// The application creates an object of this class, specifying the -// number of sensors and the connection that is to be used. It then -// reports poses (position + quat), pose velocities, and pose -// accelerations as desired using the provided functions. The -// mainloop() function needs to be called periodically even when -// there is nothing to report. - -class VRPN_API vrpn_Tracker_Server : public vrpn_Tracker { -public: - vrpn_Tracker_Server(const char *name, vrpn_Connection *c, - vrpn_int32 sensors = 1); - - /// This function should be called each time through app mainloop. - virtual void mainloop(); - - /// These functions should be called to report changes in state, once per - /// sensor. - virtual int report_pose( - const int sensor, const struct timeval t, - const vrpn_float64 position[3], const vrpn_float64 quaternion[4], - const vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - virtual int report_pose_velocity( - const int sensor, const struct timeval t, - const vrpn_float64 position[3], const vrpn_float64 quaternion[4], - const vrpn_float64 interval, - const vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - virtual int report_pose_acceleration( - const int sensor, const struct timeval t, - const vrpn_float64 position[3], const vrpn_float64 quaternion[4], - const vrpn_float64 interval, - const vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); -}; - -//---------------------------------------------------------- -// ************** Users deal with the following ************* - -// User routine to handle a tracker position update. This is called when -// the tracker callback is called (when a message from its counterpart -// across the connection arrives). - -typedef struct _vrpn_TRACKERCB { - struct timeval msg_time; // Time of the report - vrpn_int32 sensor; // Which sensor is reporting - vrpn_float64 pos[3]; // Position of the sensor - vrpn_float64 quat[4]; // Orientation of the sensor -} vrpn_TRACKERCB; -typedef void(VRPN_CALLBACK *vrpn_TRACKERCHANGEHANDLER)( - void *userdata, const vrpn_TRACKERCB info); - -// User routine to handle a tracker velocity update. This is called when -// the tracker callback is called (when a message from its counterpart -// across the connetion arrives). - -typedef struct _vrpn_TRACKERVELCB { - struct timeval msg_time; // Time of the report - vrpn_int32 sensor; // Which sensor is reporting - vrpn_float64 vel[3]; // Velocity of the sensor - vrpn_float64 vel_quat[4]; // Future Orientation of the sensor - vrpn_float64 vel_quat_dt; // delta time (in secs) for vel_quat -} vrpn_TRACKERVELCB; -typedef void(VRPN_CALLBACK *vrpn_TRACKERVELCHANGEHANDLER)( - void *userdata, const vrpn_TRACKERVELCB info); - -// User routine to handle a tracker acceleration update. This is called when -// the tracker callback is called (when a message from its counterpart -// across the connetion arrives). - -typedef struct _vrpn_TRACKERACCCB { - struct timeval msg_time; // Time of the report - vrpn_int32 sensor; // Which sensor is reporting - vrpn_float64 acc[3]; // Acceleration of the sensor - vrpn_float64 acc_quat[4]; // ????? - vrpn_float64 acc_quat_dt; // delta time (in secs) for acc_quat - -} vrpn_TRACKERACCCB; -typedef void(VRPN_CALLBACK *vrpn_TRACKERACCCHANGEHANDLER)( - void *userdata, const vrpn_TRACKERACCCB info); - -// User routine to handle a tracker room2tracker xform update. This is called -// when the tracker callback is called (when a message from its counterpart -// across the connection arrives). - -typedef struct _vrpn_TRACKERTRACKER2ROOMCB { - struct timeval msg_time; // Time of the report - vrpn_float64 tracker2room[3]; // position offset - vrpn_float64 tracker2room_quat[4]; // orientation offset -} vrpn_TRACKERTRACKER2ROOMCB; -typedef void(VRPN_CALLBACK *vrpn_TRACKERTRACKER2ROOMCHANGEHANDLER)( - void *userdata, const vrpn_TRACKERTRACKER2ROOMCB info); - -typedef struct _vrpn_TRACKERUNIT2SENSORCB { - struct timeval msg_time; // Time of the report - vrpn_int32 sensor; // Which sensor this is for - vrpn_float64 unit2sensor[3]; // position offset - vrpn_float64 unit2sensor_quat[4]; // orientation offset -} vrpn_TRACKERUNIT2SENSORCB; -typedef void(VRPN_CALLBACK *vrpn_TRACKERUNIT2SENSORCHANGEHANDLER)( - void *userdata, const vrpn_TRACKERUNIT2SENSORCB info); - -typedef struct _vrpn_TRACKERWORKSPACECB { - struct timeval msg_time; // Time of the report - vrpn_float64 workspace_min[3]; // minimum corner of box (tracker CS) - vrpn_float64 workspace_max[3]; // maximum corner of box (tracker CS) -} vrpn_TRACKERWORKSPACECB; -typedef void(VRPN_CALLBACK *vrpn_TRACKERWORKSPACECHANGEHANDLER)( - void *userdata, const vrpn_TRACKERWORKSPACECB info); - -// Structure to hold all of the callback lists for one sensor -// (also used for the "all sensors" sensor). -class vrpn_Tracker_Sensor_Callbacks { -public: - vrpn_Callback_List<vrpn_TRACKERCB> d_change; - vrpn_Callback_List<vrpn_TRACKERVELCB> d_velchange; - vrpn_Callback_List<vrpn_TRACKERACCCB> d_accchange; - vrpn_Callback_List<vrpn_TRACKERUNIT2SENSORCB> d_unit2sensorchange; - - // This class requires deep copies. - void operator=(const vrpn_Tracker_Sensor_Callbacks &from) - { - d_change = from.d_change; - d_velchange = from.d_velchange; - d_accchange = from.d_accchange; - d_unit2sensorchange = from.d_unit2sensorchange; - }; -}; - -// Open a tracker that is on the other end of a connection -// and handle updates from it. This is the type of tracker that user code will -// deal with. - -class VRPN_API vrpn_Tracker_Remote : public vrpn_Tracker { -public: - // The name of the tracker to connect to, including connection name, - // for example "Ceiling_tracker@ceiling.cs.unc.edu". If you already - // have the connection open, you can specify it as the second parameter. - // This allows both servers and clients in the same thread, for example. - // If it is not specified, then the connection will be looked up based - // on the name passed in. - vrpn_Tracker_Remote(const char *name, vrpn_Connection *c = NULL); - - // unregister all of the handlers registered with the connection - virtual ~vrpn_Tracker_Remote(void); - - // request room from tracker xforms - int request_t2r_xform(void); - // request all available sensor from unit xforms - int request_u2s_xform(void); - // request workspace bounding box - int request_workspace(void); - - // set rate of p/v/a updates from the tracker - int set_update_rate(vrpn_float64 samplesPerSecond); - - // reset origin to current tracker location (e.g. - to reinitialize - // a PHANToM in its reset position) - int reset_origin(void); - - // This routine calls the mainloop of the connection it's on - virtual void mainloop(); - - // **** to register handlers for sensor-specific messages: **** - // Default is to register them for all sensors. - - // (un)Register a callback handler to handle a position change - virtual int register_change_handler(void *userdata, - vrpn_TRACKERCHANGEHANDLER handler, - vrpn_int32 sensor = vrpn_ALL_SENSORS); - virtual int unregister_change_handler(void *userdata, - vrpn_TRACKERCHANGEHANDLER handler, - vrpn_int32 sensor = vrpn_ALL_SENSORS); - - // (un)Register a callback handler to handle a velocity change - virtual int register_change_handler(void *userdata, - vrpn_TRACKERVELCHANGEHANDLER handler, - vrpn_int32 sensor = vrpn_ALL_SENSORS); - virtual int unregister_change_handler(void *userdata, - vrpn_TRACKERVELCHANGEHANDLER handler, - vrpn_int32 sensor = vrpn_ALL_SENSORS); - - // (un)Register a callback handler to handle an acceleration change - virtual int register_change_handler(void *userdata, - vrpn_TRACKERACCCHANGEHANDLER handler, - vrpn_int32 sensor = vrpn_ALL_SENSORS); - virtual int unregister_change_handler(void *userdata, - vrpn_TRACKERACCCHANGEHANDLER handler, - vrpn_int32 sensor = vrpn_ALL_SENSORS); - - // (un)Register a callback handler to handle a unit2sensor change - virtual int - register_change_handler(void *userdata, - vrpn_TRACKERUNIT2SENSORCHANGEHANDLER handler, - vrpn_int32 sensor = vrpn_ALL_SENSORS); - virtual int - unregister_change_handler(void *userdata, - vrpn_TRACKERUNIT2SENSORCHANGEHANDLER handler, - vrpn_int32 sensor = vrpn_ALL_SENSORS); - - // **** to get workspace information **** - // (un)Register a callback handler to handle a workspace change - virtual int - register_change_handler(void *userdata, - vrpn_TRACKERWORKSPACECHANGEHANDLER handler) - { - return d_workspacechange_list.register_handler(userdata, handler); - }; - virtual int - unregister_change_handler(void *userdata, - vrpn_TRACKERWORKSPACECHANGEHANDLER handler) - { - return d_workspacechange_list.unregister_handler(userdata, handler); - } - - // (un)Register a callback handler to handle a tracker2room change - virtual int - register_change_handler(void *userdata, - vrpn_TRACKERTRACKER2ROOMCHANGEHANDLER handler) - { - return d_tracker2roomchange_list.register_handler(userdata, handler); - }; - virtual int - unregister_change_handler(void *userdata, - vrpn_TRACKERTRACKER2ROOMCHANGEHANDLER handler) - { - return d_tracker2roomchange_list.unregister_handler(userdata, handler); - }; - -protected: - // Callbacks with one per sensor (plus one for "all") - vrpn_Tracker_Sensor_Callbacks all_sensor_callbacks; - vrpn_Tracker_Sensor_Callbacks *sensor_callbacks; - unsigned num_sensor_callbacks; - bool ensure_enough_sensor_callbacks(unsigned num); - - // Callbacks that are one per tracker - vrpn_Callback_List<vrpn_TRACKERTRACKER2ROOMCB> d_tracker2roomchange_list; - vrpn_Callback_List<vrpn_TRACKERWORKSPACECB> d_workspacechange_list; - - static int VRPN_CALLBACK - handle_change_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_vel_change_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_acc_change_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_tracker2room_change_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_unit2sensor_change_message(void *userdata, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK - handle_workspace_change_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -// End of vrpn_TRACKER_H -#endif diff --git a/src/vrpn/vrpn_Tracker_3DMouse.C b/src/vrpn/vrpn_Tracker_3DMouse.C deleted file mode 100644 index 028e7a49b9e16091a2a1ae779a3fd4d1f5e3e57b..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_3DMouse.C +++ /dev/null @@ -1,355 +0,0 @@ -#include <ctype.h> // for isprint -#include <math.h> // for cos, sin, M_PI -#include <stdio.h> // for fprintf, stderr, perror - -#ifndef _WIN32 -#else -#define M_PI 3.14159265358979323846 -#endif - -#include "vrpn_Serial.h" // for vrpn_write_characters, etc -#include "vrpn_Shared.h" // for vrpn_SleepMsecs, timeval -#include "vrpn_Tracker_3DMouse.h" -#include "vrpn_Types.h" // for vrpn_float64 - -class VRPN_API vrpn_Connection; - -// max time between reports (usec) -#define MAX_TIME_INTERVAL (2000000) -#define INCHES_TO_METERS (2.54/100.0) - -vrpn_Tracker_3DMouse::vrpn_Tracker_3DMouse(const char *name, vrpn_Connection *c, - const char *port, long baud, int filtering_count): - vrpn_Tracker_Serial(name, c, port, baud), - vrpn_Button_Filter(name, c), - _filtering_count(filtering_count), - _numbuttons(5), - _count(0) -{ - vrpn_Button::num_buttons = _numbuttons; - clear_values(); -} - -void vrpn_Tracker_3DMouse::clear_values() -{ - int i; - for (i=0; i <_numbuttons; i++) - vrpn_Button::buttons[i] = vrpn_Button::lastbuttons[i] = 0; -} - -vrpn_Tracker_3DMouse::~vrpn_Tracker_3DMouse() -{ -} - -void vrpn_Tracker_3DMouse::reset() -{ - int ret, i; - - clear_values(); - - fprintf(stderr, "Resetting the 3DMouse...\n"); - if (vrpn_write_characters(serial_fd, (unsigned char*)"*R", 2) == 2) - { - fprintf(stderr,"."); - vrpn_SleepMsecs(1000.0*2); // Wait after each character to give it time to respond - } - else - { - perror("3DMouse: Failed writing to 3DMouse"); - status = vrpn_TRACKER_FAIL; - return; - } - - fprintf(stderr,"\n"); - - // Get rid of the characters left over from before the reset - vrpn_flush_input_buffer(serial_fd); - - // Make sure that the tracker has stopped sending characters - vrpn_SleepMsecs(1000.0*2); - - if ( (ret = vrpn_read_available_characters(serial_fd, _buffer, 80)) != 0) - { - fprintf(stderr, "Got >=%d characters after reset\n", ret); - for (i = 0; i < ret; i++) - { - if (isprint(_buffer[i])) fprintf(stderr,"%c",_buffer[i]); - else fprintf(stderr,"[0x%02X]",_buffer[i]); - } - fprintf(stderr, "\n"); - vrpn_flush_input_buffer(serial_fd); // Flush what's left - } - - // Asking for tracker status - if (vrpn_write_characters(serial_fd, (const unsigned char *) "*\x05", 2) == 2) - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - else - { - perror(" 3DMouse write failed"); - status = vrpn_TRACKER_FAIL; - return; - } - - // Read Status - bool success = true; - - ret = vrpn_read_available_characters(serial_fd, _buffer, 2); - if (ret != 2) fprintf(stderr, " Got %d of 5 characters for status\n",ret); - - fprintf(stderr, " Control Unit test : "); - if (_buffer[0] & 1) fprintf(stderr, "success\n"); - else - { - fprintf(stderr, "fail\n"); - success = false; - } - - fprintf(stderr, " Processor test : "); - if (_buffer[0] & 2) fprintf(stderr, "success\n"); - else - { - fprintf(stderr, "fail\n"); - success = false; - } - - fprintf(stderr, " EPROM checksum test : "); - if (_buffer[0] & 4) fprintf(stderr, "success\n"); - else - { - fprintf(stderr, "fail\n"); - success = false; - } - - fprintf(stderr, " RAM checksum test : "); - if (_buffer[0] & 8) fprintf(stderr, "success\n"); - else - { - fprintf(stderr, "fail\n"); - success = false; - } - - fprintf(stderr, " Transmitter test : "); - if (_buffer[0] & 16) fprintf(stderr, "success\n"); - else - { - fprintf(stderr, "fail\n"); - success = false; - } - - fprintf(stderr, " Receiver test : "); - if (_buffer[0] & 32) fprintf(stderr, "success\n"); - else - { - fprintf(stderr, "fail\n"); - success = false; - } - - fprintf(stderr, " Serial Port test : "); - if (_buffer[1] & 1) fprintf(stderr, "success\n"); - else - { - fprintf(stderr, "fail\n"); - success = false; - } - - fprintf(stderr, " EEPROM test : "); - if (_buffer[0] & 2) fprintf(stderr, "success\n"); - else - { - fprintf(stderr, "fail\n"); - success = false; - } - - if (!success) - { - fprintf(stderr, "Bad status report from 3DMouse, retrying reset\n"); - status = vrpn_TRACKER_FAIL; - return; - } - else - { - fprintf(stderr, "3DMouse gives status (this is good)\n"); - } - - // Set filtering count if the constructor parameter said to. - if (_filtering_count > 1) - { - if (!set_filtering_count(_filtering_count)) return; - } - fprintf(stderr, "Reset Completed (this is good)\n"); - status = vrpn_TRACKER_SYNCING; // We're trying for a new reading -} - -bool vrpn_Tracker_3DMouse::set_filtering_count(int count) -{ - char sBuf[16]; - - sBuf[0] = 0x2a; - sBuf[1] = 0x24; - sBuf[2] = 2; - sBuf[3] = 7; - sBuf[4] = count; - - if (vrpn_write_characters(serial_fd, (const unsigned char*)sBuf, 5) == 5) - { - vrpn_SleepMsecs(1000.0*1); - } - else - { - perror(" 3DMouse write filtering count failed"); - status = vrpn_TRACKER_FAIL; - return false; - } - - return true; -} - -int vrpn_Tracker_3DMouse::get_report(void) -{ - int ret; // Return value from function call to be checked - timeval waittime; - waittime.tv_sec = 2; - waittime.tv_usec = 0; - - if (status == vrpn_TRACKER_SYNCING) { - unsigned char tmpc; - - if (vrpn_write_characters(serial_fd, (const unsigned char*)"*d", 2) !=2) - { - perror(" 3DMouse write command failed"); - status = vrpn_TRACKER_RESETTING; - return 0; - } - ret = vrpn_read_available_characters(serial_fd, _buffer+_count, 16-_count, &waittime); - if (ret < 0) - { - perror(" 3DMouse read failed (disconnected)"); - status = vrpn_TRACKER_RESETTING; - return 0; - } - - _count += ret; - if (_count < 16) return 0; - if (_count > 16) - { - perror(" 3DMouse read failed (wrong message)"); - status = vrpn_TRACKER_RESETTING; - return 0; - } - - _count = 0; - - tmpc = _buffer[0]; - if (tmpc & 32) - { - //printf("port%d: Out of Range\n", i); - //ret |= 1 << (3-i); - } else - { - long ax, ay, az; // integer form of absolute translational data - short arx, ary, arz; // integer form of absolute rotational data - float p, y, r; - - ax = (_buffer[1] & 0x40) ? 0xFFE00000 : 0; - ax |= (long)(_buffer[1] & 0x7f) << 14; - ax |= (long)(_buffer[2] & 0x7f) << 7; - ax |= (_buffer[3] & 0x7f); - - ay = (_buffer[4] & 0x40) ? 0xFFE00000 : 0; - ay |= (long)(_buffer[4] & 0x7f) << 14; - ay |= (long)(_buffer[5] & 0x7f) << 7; - ay |= (_buffer[6] & 0x7f); - - az = (_buffer[7] & 0x40) ? 0xFFE00000 : 0; - az |= (long)(_buffer[7] & 0x7f) << 14; - az |= (long)(_buffer[8] & 0x7f) << 7; - az |= (_buffer[9] & 0x7f); - - pos[0] = static_cast<float>(ax / 100000.0 * 2.54); - pos[2] = static_cast<float>(ay / 100000.0 * 2.54); - pos[1] = -static_cast<float>(az / 100000.0f * 2.54); - - arx = (_buffer[10] & 0x7f) << 7; - arx += (_buffer[11] & 0x7f); - - ary = (_buffer[12] & 0x7f) << 7; - ary += (_buffer[13] & 0x7f); - - arz = (_buffer[14] & 0x7f) << 7; - arz += (_buffer[15] & 0x7f); - - p = static_cast<float>(arx / 40.0); // pitch - y = static_cast<float>(ary / 40.0); // yaw - r = static_cast<float>(arz / 40.0); // roll - - p = static_cast<float>(p * M_PI / 180); - y = static_cast<float>(y * M_PI / 180); - r = static_cast<float>((360-r) * M_PI / 180); - - float cosp2 = static_cast<float>(cos(p/2)); - float cosy2 = static_cast<float>(cos(y/2)); - float cosr2 = static_cast<float>(cos(r/2)); - float sinp2 = static_cast<float>(sin(p/2)); - float siny2 = static_cast<float>(sin(y/2)); - float sinr2 = static_cast<float>(sin(r/2)); - - d_quat[0] = cosr2*sinp2*cosy2 + sinr2*cosp2*siny2; - d_quat[1] = sinr2*cosp2*cosy2 + cosr2*sinp2*siny2; - d_quat[2] = cosr2*cosp2*siny2 + sinr2*sinp2*cosy2; - d_quat[3] = cosr2*cosp2*cosy2 + sinr2*sinp2*siny2; - - } - - buttons[0] = tmpc & 16; // Mouse stand button - buttons[1] = tmpc & 8; // Suspend button - buttons[2] = tmpc & 4; // Left button - buttons[3] = tmpc & 2; // Middle button - buttons[4] = tmpc & 1; // Right button - } - - vrpn_Button::report_changes(); - - status = vrpn_TRACKER_SYNCING; - bufcount = 0; - -#ifdef VERBOSE2 - print_latest_report(); -#endif - - return 1; -} - -void vrpn_Tracker_3DMouse::mainloop() -{ - server_mainloop(); - - switch(status) - { - case vrpn_TRACKER_AWAITING_STATION: - case vrpn_TRACKER_PARTIAL: - case vrpn_TRACKER_SYNCING: - if (get_report()) send_report(); - break; - case vrpn_TRACKER_RESETTING: - reset(); - break; - case vrpn_TRACKER_FAIL: - fprintf(stderr, "3DMouse failed, trying to reset (Try power cycle if more than 4 attempts made)\n"); - if (serial_fd >= 0) - { - vrpn_close_commport(serial_fd); - serial_fd = -1; - } - if ( (serial_fd=vrpn_open_commport(portname, baudrate)) == -1) - { - fprintf(stderr,"vrpn_Tracker_3DMouse::mainloop(): Cannot Open serial port\n"); - status = vrpn_TRACKER_FAIL; - return; - } - status = vrpn_TRACKER_RESETTING; - break; - default: - break; - } -} - diff --git a/src/vrpn/vrpn_Tracker_3DMouse.h b/src/vrpn/vrpn_Tracker_3DMouse.h deleted file mode 100644 index c77b1e8a01a056ba12f402768ae67299c6abecfc..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_3DMouse.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __TRACKER_3DMOUSE_H -#define __TRACKER_3DMOUSE_H - -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Tracker.h" // for vrpn_Tracker_Serial - -class VRPN_API vrpn_Connection; - -class VRPN_API vrpn_Tracker_3DMouse : public vrpn_Tracker_Serial, public vrpn_Button_Filter { - - public: - - vrpn_Tracker_3DMouse(const char *name, - vrpn_Connection *c, - const char *port = "/dev/ttyS1", - long baud = 19200, - int filtering_count = 1); - - ~vrpn_Tracker_3DMouse(); - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop(); - - - protected: - - virtual void reset(); - virtual int get_report(void); - bool set_filtering_count(int count); - virtual void clear_values(void); - - unsigned char _buffer[2048]; - int _filtering_count; - int _numbuttons; - int _count; -}; - -#endif diff --git a/src/vrpn/vrpn_Tracker_AnalogFly.C b/src/vrpn/vrpn_Tracker_AnalogFly.C deleted file mode 100644 index c3f56dd32fd978c99a80e26c65c8f5c37be43689..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_AnalogFly.C +++ /dev/null @@ -1,542 +0,0 @@ -#include <math.h> // for M_PI, pow, fabs - -#include "quat.h" // for q_xyz_quat_type, etc -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_Tracker_AnalogFly.h" - -#undef VERBOSE - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -vrpn_Tracker_AnalogFly::vrpn_Tracker_AnalogFly - (const char * name, vrpn_Connection * trackercon, - vrpn_Tracker_AnalogFlyParam * params, float update_rate, - bool absolute, bool reportChanges, - bool worldFrame) : - vrpn_Tracker (name, trackercon), - d_reset_button(NULL), - d_which_button (params->reset_which), - d_clutch_button(NULL), - d_clutch_which (params->clutch_which), - d_clutch_engaged(false), - d_clutch_was_off(false), - d_update_interval (update_rate ? (1/update_rate) : 1.0), - d_absolute (absolute), - d_reportChanges (reportChanges), - d_worldFrame (worldFrame) -{ - int i; - - d_x.axis = params->x; d_y.axis = params->y; d_z.axis = params->z; - d_sx.axis = params->sx; d_sy.axis = params->sy; d_sz.axis = params->sz; - - d_x.ana = d_y.ana = d_z.ana = NULL; - d_sx.ana = d_sy.ana = d_sz.ana = NULL; - - d_x.value = d_y.value = d_z.value = 0.0; - d_sx.value = d_sy.value = d_sz.value = 0.0; - - d_x.af = this; d_y.af = this; d_z.af = this; - d_sx.af = this; d_sy.af = this; d_sz.af = this; - - //-------------------------------------------------------------------- - // Open analog remotes for any channels that have non-NULL names. - // If the name starts with the "*" character, use tracker - // connection rather than getting a new connection for it. - // Set up callbacks to handle updates to the analog values - setup_channel(&d_x); - setup_channel(&d_y); - setup_channel(&d_z); - setup_channel(&d_sx); - setup_channel(&d_sy); - setup_channel(&d_sz); - - //-------------------------------------------------------------------- - // Open the reset button if is has a non-NULL name. - // If the name starts with the "*" character, use tracker - // connection rather than getting a new connection for it. - // Set up callback for it to reset the matrix to identity. - - // If the name is NULL, don't do anything. - if (params->reset_name != NULL) { - - // Open the button device and point the remote at it. - // If the name starts with the '*' character, use - // the server connection rather than making a new one. - if (params->reset_name[0] == '*') { - d_reset_button = new vrpn_Button_Remote - (&(params->reset_name[1]), - d_connection); - } else { - d_reset_button = new vrpn_Button_Remote - (params->reset_name); - } - if (d_reset_button == NULL) { - fprintf(stderr,"vrpn_Tracker_AnalogFly: " - "Can't open Button %s\n",params->reset_name); - } else { - // Set up the callback handler for the channel - d_reset_button->register_change_handler - (this, handle_reset_press); - } - } - - //-------------------------------------------------------------------- - // Open the clutch button if is has a non-NULL name. - // If the name starts with the "*" character, use tracker - // connection rather than getting a new connection for it. - // Set up callback for it to control clutching. - - // If the name is NULL, don't do anything. - if (params->clutch_name != NULL) { - - // Open the button device and point the remote at it. - // If the name starts with the '*' character, use - // the server connection rather than making a new one. - if (params->clutch_name[0] == '*') { - d_clutch_button = new vrpn_Button_Remote - (&(params->clutch_name[1]), - d_connection); - } else { - d_clutch_button = new vrpn_Button_Remote - (params->clutch_name); - } - if (d_clutch_button == NULL) { - fprintf(stderr,"vrpn_Tracker_AnalogFly: " - "Can't open Button %s\n",params->clutch_name); - } else { - // Set up the callback handler for the channel - d_clutch_button->register_change_handler - (this, handle_clutch_press); - } - } - - // If the clutch button is NULL, then engage the clutch always. - if (params->clutch_name == NULL) { - d_clutch_engaged = true; - } - - //-------------------------------------------------------------------- - // Whenever we get the first connection to this server, we also - // want to reset the matrix to identity, so that you start at the - // beginning. Set up a handler to do this. - register_autodeleted_handler(d_connection->register_message_type(vrpn_got_first_connection), - handle_newConnection, this); - - //-------------------------------------------------------------------- - // Set the initialization matrix to identity, then also set - // the current matrix to identity and the clutch matrix to - // identity. - for ( i =0; i< 4; i++) { - for (int j=0; j< 4; j++) { - d_initMatrix[i][j] = 0; - } - } - - d_initMatrix[0][0] = d_initMatrix[1][1] = d_initMatrix[2][2] = - d_initMatrix[3][3] = 1.0; - reset(); - q_matrix_copy(d_clutchMatrix, d_initMatrix); - q_matrix_copy(d_currentMatrix, d_initMatrix); - - //-------------------------------------------------------------------- - // Set the current timestamp to "now" and current matrix to identity - // for absolute trackers. This is done in case we never hear from the - // analog devices. Reset doesn't do this for absolute trackers. - if (d_absolute) { - vrpn_gettimeofday(&d_prevtime, NULL); - vrpn_Tracker::timestamp = d_prevtime; - q_matrix_copy(d_currentMatrix, d_initMatrix); - convert_matrix_to_tracker(); - } -} - -vrpn_Tracker_AnalogFly::~vrpn_Tracker_AnalogFly (void) -{ - // Tear down the analog update callbacks and remotes - teardown_channel(&d_x); - teardown_channel(&d_y); - teardown_channel(&d_z); - teardown_channel(&d_sx); - teardown_channel(&d_sy); - teardown_channel(&d_sz); - - // Tear down the reset button update callback and remote (if there is one) - if (d_reset_button != NULL) { - d_reset_button->unregister_change_handler(this, - handle_reset_press); - delete d_reset_button; - } - - // Tear down the clutch button update callback and remote (if there is one) - if (d_clutch_button != NULL) { - d_clutch_button->unregister_change_handler(this, - handle_clutch_press); - delete d_clutch_button; - } -} - -// This routine handles updates of the analog values. The value coming in is -// adjusted per the parameters in the full axis description, and then used to -// update the value there. The value is used by the matrix-generation code in -// mainloop() to update the transformations; that work is not done here. - -void VRPN_CALLBACK vrpn_Tracker_AnalogFly::handle_analog_update - (void *userdata, const vrpn_ANALOGCB info) -{ - vrpn_TAF_fullaxis *full = (vrpn_TAF_fullaxis *)userdata; - double value = info.channel[full->axis.channel]; - double value_offset = value - full->axis.offset; - double value_abs = fabs(value_offset); - - // If we're an absolute channel, store the time of the report - // into the tracker's timestamp field. - if (full->af->d_absolute) { - full->af->vrpn_Tracker::timestamp = info.msg_time; - } - - // If we're not above threshold, store zero and we're done! - if (value_abs <= full->axis.thresh) { - full->value = 0.0; - return; - } - - // Scale and apply the power to the value (maintaining its sign) - if (value_offset >=0) { - full->value = pow(value_offset*full->axis.scale, (double) full->axis.power); - } else { - full->value = -pow(value_abs*full->axis.scale, (double) full->axis.power); - } -} - -// This routine will reset the matrix to identity when the reset button is -// pressed. - -void VRPN_CALLBACK vrpn_Tracker_AnalogFly::handle_reset_press - (void *userdata, const vrpn_BUTTONCB info) -{ - vrpn_Tracker_AnalogFly *me = (vrpn_Tracker_AnalogFly*)userdata; - - // If this is the correct button, and it has just been pressed, then - // reset the matrix. - if ( (info.button == me->d_which_button) && (info.state == 1) ) { - me->reset(); - } -} - -// This handle state changes associated with the clutch button. - -void VRPN_CALLBACK vrpn_Tracker_AnalogFly::handle_clutch_press - (void *userdata, const vrpn_BUTTONCB info) -{ - vrpn_Tracker_AnalogFly *me = (vrpn_Tracker_AnalogFly*)userdata; - - // If this is the correct button, set the clutch state according to - // the value of the button. - if (info.button == me->d_clutch_which) { - if (info.state == 1) { - me->d_clutch_engaged = true; - } else { - me->d_clutch_engaged = false; - } - } -} - -// This sets up the Analog Remote for one channel, setting up the callback -// needed to adjust the value based on changes in the analog input. -// Returns 0 on success and -1 on failure. - -int vrpn_Tracker_AnalogFly::setup_channel(vrpn_TAF_fullaxis *full) -{ - // If the name is NULL, we're done. - if (full->axis.name == NULL) { return 0; } - - // Open the analog device and point the remote at it. - // If the name starts with the '*' character, use the server - // connection rather than making a new one. - if (full->axis.name[0] == '*') { - full->ana = new vrpn_Analog_Remote(&(full->axis.name[1]), - d_connection); -#ifdef VERBOSE - printf("vrpn_Tracker_AnalogFly: Adding local analog %s\n", - &(full->axis.name[1])); -#endif - } else { - full->ana = new vrpn_Analog_Remote(full->axis.name); -#ifdef VERBOSE - printf("vrpn_Tracker_AnalogFly: Adding remote analog %s\n", - full->axis.name); -#endif - } - if (full->ana == NULL) { - fprintf(stderr,"vrpn_Tracker_AnalogFly: " - "Can't open Analog %s\n",full->axis.name); - return -1; - } - - // Set up the callback handler for the channel - return full->ana->register_change_handler(full, handle_analog_update); -} - -// This tears down the Analog Remote for one channel, undoing everything that -// the setup did. Returns 0 on success and -1 on failure. - -int vrpn_Tracker_AnalogFly::teardown_channel(vrpn_TAF_fullaxis *full) -{ - int ret; - - // If the analog pointer is NULL, we're done. - if (full->ana == NULL) { return 0; } - - // Turn off the callback handler for the channel - ret = full->ana->unregister_change_handler((void*)full, - handle_analog_update); - - // Delete the analog device. - delete full->ana; - - return ret; -} - -// static -int VRPN_CALLBACK vrpn_Tracker_AnalogFly::handle_newConnection(void * userdata, - vrpn_HANDLERPARAM) -{ - - printf("Get a new connection, reset virtual_Tracker\n"); - ((vrpn_Tracker_AnalogFly *) userdata)->reset(); - - // Always return 0 here, because nonzero return means that the input data - // was garbage, not that there was an error. If we return nonzero from a - // vrpn_Connection handler, it shuts down the connection. - return 0; -} - -/** Reset the current matrix to zero and store it into the tracker - position/quaternion location. This is is not done for an absolute - tracker, whose position and orientation are locked to the reports from - the analog device. -*/ - -void vrpn_Tracker_AnalogFly::reset (void) -{ - // Set the clutch matrix to the identity. - q_matrix_copy(d_clutchMatrix, d_initMatrix); - - // Set the matrix back to the identity matrix - q_matrix_copy(d_currentMatrix, d_initMatrix); - vrpn_gettimeofday(&d_prevtime, NULL); - - // Convert the matrix into quaternion notation and copy into the - // tracker pos and quat elements. - convert_matrix_to_tracker(); -} - -void vrpn_Tracker_AnalogFly::mainloop() -{ - struct timeval now; - double interval; // How long since the last report, in secs - - // Call generic server mainloop, since we are a server - server_mainloop(); - - // Mainloop() all of the analogs that are defined and the button - // so that we will get all of the values fresh. - if (d_x.ana != NULL) { d_x.ana->mainloop(); }; - if (d_y.ana != NULL) { d_y.ana->mainloop(); }; - if (d_z.ana != NULL) { d_z.ana->mainloop(); }; - if (d_sx.ana != NULL) { d_sx.ana->mainloop(); }; - if (d_sy.ana != NULL) { d_sy.ana->mainloop(); }; - if (d_sz.ana != NULL) { d_sz.ana->mainloop(); }; - if (d_reset_button != NULL) { d_reset_button->mainloop(); }; - if (d_clutch_button != NULL) { d_clutch_button->mainloop(); }; - - // See if it has been long enough since our last report. - // If so, generate a new one. - vrpn_gettimeofday(&now, NULL); - interval = vrpn_TimevalDurationSeconds(now, d_prevtime); - - if (shouldReport(interval)) { - - // Set the time on the report to now, if not an absolute - // tracker. Absolute trackers have their time values set - // to match the time at which their analog devices gave the - // last report. - if (!d_absolute) { - vrpn_Tracker::timestamp = now; - } - - // Figure out the new matrix based on the current values and - // the length of the interval since the last report - update_matrix_based_on_values(interval); - - // pack and deliver tracker report; - if (d_connection) { - char msgbuf[1000]; - int len = encode_to(msgbuf); - if (d_connection->pack_message(len, vrpn_Tracker::timestamp, - position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"Tracker AnalogFly: " - "cannot write message: tossing\n"); - } - } else { - fprintf(stderr,"Tracker AnalogFly: " - "No valid connection\n"); - } - - // We just sent a report, so reset the time - d_prevtime = now; - } - - // We're not always sending reports, but we still want to - // update the interval clock so that we don't integrate over - // too long a timespan when we do finally report a change. - if (interval >= d_update_interval) { - d_prevtime = now; - } -} - -// This routine will update the current matrix based on the current values -// in the offsets list for each axis, and the length of time over which the -// action is taking place (time_interval). -// Handling of non-absolute trackers: It treats the values as either -// meters/second or else rotations/second to be integrated over the interval -// to adjust the current matrix. -// Handling of absolute trackers: It always assumes that the starting matrix -// is the identity, so that the values are absolute offsets/rotations. -// XXX Later, it would be cool to have non-absolute trackers send velocity -// information as well, since it knows what this is. - -void vrpn_Tracker_AnalogFly::update_matrix_based_on_values - (double time_interval) -{ - double tx,ty,tz, rx,ry,rz; // Translation (m/s) and rotation (rad/sec) - q_matrix_type diffM; // Difference (delta) matrix - - // For absolute trackers, the interval is treated as "1", so that the - // translations and rotations are unscaled; - if (d_absolute) { time_interval = 1.0; }; - - // compute the translation and rotation - tx = d_x.value * time_interval; - ty = d_y.value * time_interval; - tz = d_z.value * time_interval; - - rx = d_sx.value * time_interval * (2*M_PI); - ry = d_sy.value * time_interval * (2*M_PI); - rz = d_sz.value * time_interval * (2*M_PI); - - // Build a rotation matrix, then add in the translation - q_euler_to_col_matrix(diffM, rz, ry, rx); - diffM[3][0] = tx; diffM[3][1] = ty; diffM[3][2] = tz; - - // While the clutch is not engaged, we don't move. Record that - // the clutch was off so that we know later when it is re-engaged. - if (!d_clutch_engaged) { - d_clutch_was_off = true; - return; - } - - // When the clutch becomes re-engaged, we store the current matrix - // multiplied by the inverse of the present differential matrix so that - // the first frame of the mouse-hold leaves us in the same location. - // For the absolute matrix, this re-engages new motion at the previous - // location. - if (d_clutch_engaged && d_clutch_was_off) { - d_clutch_was_off = false; - q_type diff_orient; - // This is backwards, because Euler angles have rotation about Z first... - q_from_euler(diff_orient, rz, ry, rx); - q_xyz_quat_type diff; - q_vec_set(diff.xyz, tx, ty, tz); - q_copy(diff.quat, diff_orient); - q_xyz_quat_type diff_inverse; - q_xyz_quat_invert(&diff_inverse, &diff); - q_matrix_type di_matrix; - q_to_col_matrix(di_matrix, diff_inverse.quat); - di_matrix[3][0] = diff_inverse.xyz[0]; - di_matrix[3][1] = diff_inverse.xyz[1]; - di_matrix[3][2] = diff_inverse.xyz[2]; - q_matrix_mult(d_clutchMatrix, di_matrix, d_currentMatrix); - } - - // Apply the matrix. - if (d_absolute) { - // The difference matrix IS the current matrix. Catenate it - // onto the clutch matrix. If there is no clutching happening, - // this matrix will always be the identity so this will just - // copy the difference matrix. - q_matrix_mult(d_currentMatrix, diffM, d_clutchMatrix); - } else { - // Multiply the current matrix by the difference matrix to update - // it to the current time. - if (d_worldFrame) { - // If using world frame: - // 1. Separate out the translation and add to the differential translation - tx += d_currentMatrix[3][0]; - ty += d_currentMatrix[3][1]; - tz += d_currentMatrix[3][2]; - diffM[3][0] = 0; diffM[3][1] = 0; diffM[3][2] = 0; - d_currentMatrix[3][0] = 0; d_currentMatrix[3][1] = 0; d_currentMatrix[3][2] = 0; - - // 2. Compose the rotations. - q_matrix_mult(d_currentMatrix, d_currentMatrix, diffM); - - // 3. Put the new translation back in the matrix. - d_currentMatrix[3][0] = tx; d_currentMatrix[3][1] = ty; d_currentMatrix[3][2] = tz; - - } else { - q_matrix_mult(d_currentMatrix, diffM, d_currentMatrix); - } - } - - // Finally, convert the matrix into a pos/quat - // and copy it into the tracker position and quaternion structures. - convert_matrix_to_tracker(); -} - -void vrpn_Tracker_AnalogFly::convert_matrix_to_tracker (void) -{ - q_xyz_quat_type xq; - int i; - - q_row_matrix_to_xyz_quat( & xq, d_currentMatrix); - - for (i=0; i< 3; i++) { - pos[i] = xq.xyz[i]; // position; - } - for (i=0; i< 4; i++) { - d_quat[i] = xq.quat[i]; // orientation. - } -} - -bool vrpn_Tracker_AnalogFly::shouldReport - (double elapsedInterval) const { - - // If we haven't had enough time pass yet, don't report. - if (elapsedInterval < d_update_interval) { - return VRPN_FALSE; - } - - // If we're sending a report every interval, regardless of - // whether or not there are changes, then send one now. - if (!d_reportChanges) { - return VRPN_TRUE; - } - - // If anything's nonzero, send the report. - // HACK: This values may be unstable, depending on device characteristics; - // we may need to designate a small dead zone around zero and only report - // if the value is outside the dead zone. - if (d_x.value || d_y.value || d_z.value || - d_sx.value || d_sy.value || d_sz.value) { - return VRPN_TRUE; - } - - // Enough time has elapsed, but nothing has changed, so return false. - return VRPN_FALSE; -} - diff --git a/src/vrpn/vrpn_Tracker_AnalogFly.h b/src/vrpn/vrpn_Tracker_AnalogFly.h deleted file mode 100644 index 4fcc82b9a3f463f1f290a8cfac0f3ce33b467fdc..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_AnalogFly.h +++ /dev/null @@ -1,155 +0,0 @@ -#ifndef INCLUDED_ANALOGFLY -#define INCLUDED_ANALOGFLY - -#include <quat.h> // for q_matrix_type -#include <stdio.h> // for NULL - -#include "vrpn_Analog.h" // for vrpn_ANALOGCB, etc -#include "vrpn_Button.h" // for vrpn_BUTTONCB, etc -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker -#include "vrpn_Types.h" // for VRPN_FALSE, vrpn_FALSE - -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -// This parameter is passed to the constructor for the AnalogFly; it describes -// the channel mapping and parameters of that mapping, as well as the button -// that will be used to reset the tracker when it is pushed. Any entry which -// has a NULL pointer for the name is disabled. - -class VRPN_API vrpn_TAF_axis { - - public: - - vrpn_TAF_axis (void) - { name = NULL; channel = 0; offset = 0.0f; thresh = 0.0f; - scale = 1.0f; power = 1.0f; }; - - char * name; //< Name of the Analog device driving this axis - int channel; //< Which channel to use from the Analog device - float offset; //< Offset to apply to values from this channel to reach 0 - float thresh; //< Threshold to apply after offset within which values count as zero - float scale; //< Scale applied to values after offset and threshold - float power; //< Power to which values are taken after scaling -}; - -class VRPN_API vrpn_Tracker_AnalogFlyParam { - - public: - - vrpn_Tracker_AnalogFlyParam (void) { - x.name = y.name = z.name = - sx.name = sy.name = sz.name = reset_name = clutch_name = NULL; - } - - /// Translation along each of these three axes - vrpn_TAF_axis x, y, z; - - /// Rotation in the positive direction about the three axes - vrpn_TAF_axis sx, sy, sz; - - /// Button device that is used to reset the matrix to the origin - - char * reset_name; - int reset_which; - - /// Clutch device that is used to enable relative motion over - // large distances - - char * clutch_name; - int clutch_which; -}; - -class VRPN_API vrpn_Tracker_AnalogFly; // Forward reference - -class VRPN_API vrpn_TAF_fullaxis { -public: - vrpn_TAF_fullaxis (void) { ana = NULL; value = 0.0; af = NULL; }; - - vrpn_TAF_axis axis; - vrpn_Analog_Remote * ana; - vrpn_Tracker_AnalogFly * af; - double value; -}; - -/// This class will turn an analog device such as a joystick or a camera -// tracker into a tracker by interpreting the joystick -// positions as either position or velocity inputs and "flying" the user -// around based on analog values. -// The "absolute" parameter tells whether the tracker integrates differential -// changes (the default, with FALSE) or takes the analog values as absolute -// positions or orientations. -// The mapping from analog channels to directions (or orientation changes) is -// described in the vrpn_Tracker_AnalogFlyParam parameter. For translations, -// values above threshold are multiplied by the scale and then taken to the -// power; the result is the number of meters (or meters per second) to move -// in that direction. For rotations, the result is taken as the number of -// revolutions (or revolutions per second) around the given axis. -// Note that the reset button has no effect on an absolute tracker. -// The time reported by absolute trackers is as of the last report they have -// had from their analog devices. The time reported by differential trackers -// is the local time that the report was generated. This is to allow a -// gen-locked camera tracker to have its time values passed forward through -// the AnalogFly class. - -// If reportChanges is TRUE, updates are ONLY sent if there has been a -// change since the last update, in which case they are generated no faster -// than update_rate. - -// If worldFrame is TRUE, then translations and rotations take place in the -// world frame, rather than the local frame. Useful for a simulated wand -// when doing desktop testing of immersive apps - easier to keep under control. - -class VRPN_API vrpn_Tracker_AnalogFly : public vrpn_Tracker { - public: - vrpn_Tracker_AnalogFly (const char * name, vrpn_Connection * trackercon, - vrpn_Tracker_AnalogFlyParam * params, - float update_rate, bool absolute = vrpn_FALSE, - bool reportChanges = VRPN_FALSE, bool worldFrame = VRPN_FALSE); - - virtual ~vrpn_Tracker_AnalogFly (void); - - virtual void mainloop (); - virtual void reset (void); - - void update (q_matrix_type &); - - static void VRPN_CALLBACK handle_joystick (void *, const vrpn_ANALOGCB); - static int VRPN_CALLBACK handle_newConnection (void *, vrpn_HANDLERPARAM); - - protected: - - double d_update_interval; //< How long to wait between sends - struct timeval d_prevtime; //< Time of the previous report - bool d_absolute; //< Report absolute (vs. differential)? - bool d_reportChanges; - bool d_worldFrame; - - vrpn_TAF_fullaxis d_x, d_y, d_z, d_sx, d_sy, d_sz; - vrpn_Button_Remote * d_reset_button; - int d_which_button; - - vrpn_Button_Remote * d_clutch_button; - int d_clutch_which; - bool d_clutch_engaged; - bool d_clutch_was_off; - - q_matrix_type d_initMatrix, d_currentMatrix, d_clutchMatrix; - - void update_matrix_based_on_values (double time_interval); - void convert_matrix_to_tracker (void); - - bool shouldReport (double elapsedInterval) const; - - int setup_channel (vrpn_TAF_fullaxis * full); - int teardown_channel (vrpn_TAF_fullaxis * full); - - static void VRPN_CALLBACK handle_analog_update (void * userdata, - const vrpn_ANALOGCB info); - static void VRPN_CALLBACK handle_reset_press (void * userdata, const vrpn_BUTTONCB info); - static void VRPN_CALLBACK handle_clutch_press (void * userdata, const vrpn_BUTTONCB info); -}; - -#endif diff --git a/src/vrpn/vrpn_Tracker_ButtonFly.C b/src/vrpn/vrpn_Tracker_ButtonFly.C deleted file mode 100644 index 773771fad3bab8f278b5d60ca4a84392e17ce3f2..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_ButtonFly.C +++ /dev/null @@ -1,501 +0,0 @@ -//XXX Send velocity and rotational velocity reports. - -#include <math.h> // for pow, M_PI, fabs - -#include "quat.h" // for q_matrix_copy, etc -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_Tracker_ButtonFly.h" - -#undef VERBOSE - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -vrpn_Tracker_ButtonFly::vrpn_Tracker_ButtonFly - (const char * name, vrpn_Connection * trackercon, - vrpn_Tracker_ButtonFlyParam * params, float update_rate, - bool reportChanges) : - vrpn_Tracker (name, trackercon), - d_vel_scale(NULL), - d_vel_scale_value(1.0), - d_rot_scale(NULL), - d_rot_scale_value(1.0), - d_update_interval (update_rate ? (1/update_rate) : 1.0), - d_reportChanges (reportChanges) -{ - int i; - - //-------------------------------------------------------------------- - // Copy the parameter values and initialize the values and pointers - // in the list of axes. The setup_channel() call opens the button - // remote and sets up a callback to handle the changes. - d_num_axes = params->num_axes; - for (i = 0; i < params->num_axes; i++) { - d_axes[i].axis = params->axes[i]; - d_axes[i].active = false; - d_axes[i].bf = this; - setup_channel(&d_axes[i]); - } - - //-------------------------------------------------------------------- - // Open the scale analogs if they have non-NULL, non-empty names. - // If the name starts with the "*" character, use tracker - // connection rather than getting a new connection for it. - // Set up a callback for each to set the scale factor. - - if (params->vel_scale_name[0] != '\0') { - - // Copy the parameters into our member variables - d_vel_scale_channel = params->vel_scale_channel; - d_vel_scale_offset = params->vel_scale_offset; - d_vel_scale_scale = params->vel_scale_scale; - d_vel_scale_power = params->vel_scale_power; - - // Open the analog device and point the remote at it. - // If the name starts with the '*' character, use - // the server connection rather than making a new one. - if (params->vel_scale_name[0] == '*') { - d_vel_scale = new vrpn_Analog_Remote - (&(params->vel_scale_name[1]), d_connection); - } else { - d_vel_scale = new vrpn_Analog_Remote(params->vel_scale_name); - } - - // Set up the callback handler - if (d_vel_scale == NULL) { - fprintf(stderr,"vrpn_Tracker_ButtonFly: " - "Can't open Analog %s\n",params->vel_scale_name); - } else { - // Set up the callback handler for the channel - d_vel_scale->register_change_handler(this, handle_velocity_update); - } - } - - if (params->rot_scale_name[0] != '\0') { - - // Copy the parameters into our member variables - d_rot_scale_channel = params->rot_scale_channel; - d_rot_scale_offset = params->rot_scale_offset; - d_rot_scale_scale = params->rot_scale_scale; - d_rot_scale_power = params->rot_scale_power; - - // Open the analog device and point the remote at it. - // If the name starts with the '*' character, use - // the server connection rather than making a new one. - if (params->rot_scale_name[0] == '*') { - d_rot_scale = new vrpn_Analog_Remote - (&(params->rot_scale_name[1]), d_connection); - } else { - d_rot_scale = new vrpn_Analog_Remote(params->rot_scale_name); - } - - // Set up the callback handler - if (d_rot_scale == NULL) { - fprintf(stderr,"vrpn_Tracker_ButtonFly: " - "Can't open Analog %s\n",params->rot_scale_name); - } else { - // Set up the callback handler for the channel - d_rot_scale->register_change_handler(this, handle_rotation_update); - } - } - - //-------------------------------------------------------------------- - // Whenever we get the first connection to this server, we also - // want to reset the matrix to identity, so that you start at the - // beginning. Set up a handler to do this. - register_autodeleted_handler(d_connection->register_message_type - (vrpn_got_first_connection), - handle_newConnection, this); - - //-------------------------------------------------------------------- - // Set the initialization matrix to identity, then also set - // the current matrix to identity. - for ( i =0; i< 4; i++) - for (int j=0; j< 4; j++) - d_initMatrix[i][j] = 0; - - d_initMatrix[0][0] = d_initMatrix[1][1] = d_initMatrix[2][2] = - d_initMatrix[3][3] = 1.0; - reset(); -} - -vrpn_Tracker_ButtonFly::~vrpn_Tracker_ButtonFly (void) -{ - int i; - - // Tear down the button axes (which will include the - // button callbacks and remotes). - for (i = 0; i < d_num_axes; i++) { - teardown_channel(&d_axes[i]); - } - - // Tear down the analog update callbacks and remotes (if they exist) - if (d_vel_scale != NULL) { - d_vel_scale->unregister_change_handler(this, handle_velocity_update); - delete d_vel_scale; - } - if (d_rot_scale != NULL) { - d_rot_scale->unregister_change_handler(this, handle_rotation_update); - delete d_rot_scale; - } -} - -// This sets up the Button Remote for one channel, setting up the callback -// needed to adjust the value based on changes in the button. -// Returns 0 on success and -1 on failure. - -int vrpn_Tracker_ButtonFly::setup_channel(vrpn_TBF_fullaxis *full) -{ - // Open the button device and point the remote at it. - // If the name starts with the '*' character, use the server - // connection rather than making a new one. - if (full->axis.name[0] == '*') { - full->btn = new vrpn_Button_Remote(&(full->axis.name[1]), - d_connection); -#ifdef VERBOSE - printf("vrpn_Tracker_ButtonFly: Adding local button %s\n", - &(full->axis.name[1])); -#endif - } else { - full->btn = new vrpn_Button_Remote(full->axis.name); -#ifdef VERBOSE - printf("vrpn_Tracker_ButtonFly: Adding remote button %s\n", - full->axis.name); -#endif - } - if (full->btn == NULL) { - fprintf(stderr,"vrpn_Tracker_ButtonFly: " - "Can't open Button %s\n",full->axis.name); - return -1; - } - - // Set up the callback handler for the channel - return full->btn->register_change_handler(full, handle_button_update); -} - -// This tears down the Button Remote for one channel, undoing everything that -// the setup did. Returns 0 on success and -1 on failure. - -int vrpn_Tracker_ButtonFly::teardown_channel(vrpn_TBF_fullaxis *full) -{ - int ret; - - // If the button pointer is NULL, we're done. - if (full->btn == NULL) { return 0; } - - // Turn off the callback handler for the channel - ret = full->btn->unregister_change_handler((void*)full, handle_button_update); - - // Delete the analog device and point the remote at it. - delete full->btn; - - return ret; -} - -// This routine handles updates of the velocity-scale value. The value coming in is -// adjusted per the parameters in the member variables, and then used to -// update the value there. The value is used by the matrix-generation code in -// mainloop() to update the transformations; that work is not done here. - -void vrpn_Tracker_ButtonFly::handle_velocity_update - (void *userdata, const vrpn_ANALOGCB info) -{ - vrpn_Tracker_ButtonFly *me = (vrpn_Tracker_ButtonFly *)userdata; - double value = info.channel[me->d_vel_scale_channel]; - double value_offset = value - me->d_vel_scale_offset; - double value_scaled = value_offset * me->d_vel_scale_scale; - double value_abs = fabs(value_scaled); - double value_powered; - - // Scale and apply the power to the value (maintaining its sign) - if (value_offset >=0) { - value_powered = pow(value_abs, (double) me->d_vel_scale_power); - } else { - value_powered = -pow(value_abs, (double) me->d_vel_scale_power); - } - - // Store the value for use by the matrix code - me->d_vel_scale_value = (float)value_powered; -} - -// This routine handles updates of the rotational-scale value. The value coming in is -// adjusted per the parameters in the member variables, and then used to -// update the value there. The value is used by the matrix-generation code in -// mainloop() to update the transformations; that work is not done here. - -void vrpn_Tracker_ButtonFly::handle_rotation_update - (void *userdata, const vrpn_ANALOGCB info) -{ - vrpn_Tracker_ButtonFly *me = (vrpn_Tracker_ButtonFly *)userdata; - double value = info.channel[me->d_rot_scale_channel]; - double value_offset = value - me->d_rot_scale_offset; - double value_scaled = value_offset * me->d_rot_scale_scale; - double value_abs = fabs(value_scaled); - double value_powered; - - // Scale and apply the power to the value (maintaining its sign) - if (value_offset >=0) { - value_powered = pow(value_abs, (double) me->d_rot_scale_power); - } else { - value_powered = -pow(value_abs, (double) me->d_rot_scale_power); - } - - // Store the value for use by the matrix code - me->d_rot_scale_value = (float)value_powered; -} - -// This routine will handle a button being pressed. For absolute -// buttons, it stores the value directly into the matrix when the -// button is pressed. For differential channels, it adds marks -// the channel as active so that its difference will be included -// the the total difference computation. - -void vrpn_Tracker_ButtonFly::handle_button_update - (void *userdata, const vrpn_BUTTONCB info) -{ - vrpn_TBF_fullaxis *axis = (vrpn_TBF_fullaxis*)userdata; - - // If this is not the correct button for this axis, return - if (axis->axis.channel != info.button) { - return; - } - - // If this is an absolute axis, and the button has just been pressed, - // then set the matrix to the one for this button. - if (axis->axis.absolute) { - if (info.state == 1) { - double tx,ty,tz, rx,ry,rz; //< Translation and rotation to set to - q_matrix_type newMatrix; //< Matrix set to these values. - - // compute the translation and rotation - tx = axis->axis.vec[0]; - ty = axis->axis.vec[1]; - tz = axis->axis.vec[2]; - - rx = axis->axis.rot[0] * (2*M_PI); - ry = axis->axis.rot[1] * (2*M_PI); - rz = axis->axis.rot[2] * (2*M_PI); - - // Build a rotation matrix, then add in the translation - q_euler_to_col_matrix(newMatrix, rz, ry, rx); - newMatrix[3][0] = tx; newMatrix[3][1] = ty; newMatrix[3][2] = tz; - - // Copy the new matrix to the current matrix - // and then update the tracker based on it - q_matrix_copy(axis->bf->d_currentMatrix, newMatrix); - axis->bf->convert_matrix_to_tracker(); - - // Mark the axis as active, so that a report will be generated - // next time. For absolute channels, this is marked inactive when - // the report based on it is generated. - axis->active = true; - } - - // This is a differential axis, so mark it as active or not - // depending on whether the button was pressed or not. - } else { - axis->active = (info.state != 0); - - // XXX To be strictly correct, we should record the time at which - // the activity started so that it can take effect between update - // intervals. - } -} - -// static -int vrpn_Tracker_ButtonFly::handle_newConnection(void * userdata, - vrpn_HANDLERPARAM) -{ - - printf("Get a new connection, reset virtual_Tracker\n"); - ((vrpn_Tracker_ButtonFly *) userdata)->reset(); - - // Always return 0 here, because nonzero return means that the input data - // was garbage, not that there was an error. If we return nonzero from a - // vrpn_Connection handler, it shuts down the connection. - return 0; -} - -/** Reset the current matrix to zero and store it into the tracker - position/quaternion location. -*/ - -void vrpn_Tracker_ButtonFly::reset (void) -{ - // Set the matrix back to the identity matrix - q_matrix_copy(d_currentMatrix, d_initMatrix); - vrpn_gettimeofday(&d_prevtime, NULL); - - // Convert the matrix into quaternion notation and copy into the - // tracker pos and quat elements. - convert_matrix_to_tracker(); -} - -void vrpn_Tracker_ButtonFly::mainloop() -{ - int i; - struct timeval now; - double interval; // How long since the last report, in secs - - // Call generic server mainloop, since we are a server - server_mainloop(); - - // Mainloop() all of the buttons that are defined and the analog - // scale values if they are defined so that we will get all of - // the values fresh. - for (i = 0; i < d_num_axes; i++) { - d_axes[i].btn->mainloop(); - } - if (d_vel_scale != NULL) { d_vel_scale->mainloop(); }; - if (d_rot_scale != NULL) { d_rot_scale->mainloop(); }; - - // See if it has been long enough since our last report. - // If so, generate a new one. - vrpn_gettimeofday(&now, NULL); - interval = vrpn_TimevalDurationSeconds(now, d_prevtime); - - if (shouldReport(interval)) { - // Figure out the new matrix based on the current values and - // the length of the interval since the last report - update_matrix_based_on_values(interval); - d_prevtime = now; - - // Set the time on the report to now. - vrpn_Tracker::timestamp = now; - - // pack and deliver tracker report; - if (d_connection) { - char msgbuf[1000]; - int len = encode_to(msgbuf); - if (d_connection->pack_message(len, vrpn_Tracker::timestamp, - position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"Tracker ButtonFly: cannot write message: tossing\n"); - } - } else { - fprintf(stderr,"Tracker ButtonFly: No valid connection\n"); - } - - // We're not always sending reports, but we still want to - // update the matrix so that we don't integrate over - // too long a timespan when we do finally report a change. - } else if (interval >= d_update_interval) { - // Figure out the new matrix based on the current values and - // the length of the interval since the last report - update_matrix_based_on_values(interval); - d_prevtime = now; - } -} - -// This routine will update the current matrix based on the current values -// in the offsets list for each axis, and the length of time over which the -// action is taking place (time_interval). -// Handling of non-absolute trackers: It treats the values as either -// meters/second or else rotations/second to be integrated over the interval -// to adjust the current matrix. All active differential axis are added -// together, and then the results are scaled by the velocity and rotational -// analog scale factors. -// Handling of absolute trackers: Their effects are handled in the button -// callback and in the shouldReport methods. -// XXX Later, it would be cool to have non-absolute trackers send velocity -// information as well, since it knows what this is. - -void vrpn_Tracker_ButtonFly::update_matrix_based_on_values - (double time_interval) -{ - double tx,ty,tz, rx,ry,rz; // Translation (m/s) and rotation (rad/sec) - q_matrix_type diffM; // Difference (delta) matrix - int i; - - // Set the translation and rotation to zero, then go through all of the - // axis and sum in the contributions from any that are differential and - // active. - tx = ty = tz = rx = ry = rz = 0.0; - - for (i = 0; i < d_num_axes; i++) { - if (d_axes[i].active && !d_axes[i].axis.absolute) { - tx += d_axes[i].axis.vec[0] * time_interval * d_vel_scale_value; - ty += d_axes[i].axis.vec[1] * time_interval * d_vel_scale_value; - tz += d_axes[i].axis.vec[2] * time_interval * d_vel_scale_value; - - rx = d_axes[i].axis.rot[0] * time_interval * (2*M_PI) * d_rot_scale_value; - ry = d_axes[i].axis.rot[1] * time_interval * (2*M_PI) * d_rot_scale_value; - rz = d_axes[i].axis.rot[2] * time_interval * (2*M_PI) * d_rot_scale_value; - } - } - - // Build a rotation matrix, then add in the translation - q_euler_to_col_matrix(diffM, rz, ry, rx); - diffM[3][0] = tx; diffM[3][1] = ty; diffM[3][2] = tz; - - // Multiply the current matrix by the difference matrix to update - // it to the current time. Then convert the matrix into a pos/quat - // and copy it into the tracker position and quaternion structures. - q_matrix_type final; - q_matrix_mult(final, diffM, d_currentMatrix); - q_matrix_copy(d_currentMatrix, final); - convert_matrix_to_tracker(); -} - -void vrpn_Tracker_ButtonFly::convert_matrix_to_tracker (void) -{ - q_xyz_quat_type xq; - int i; - - q_row_matrix_to_xyz_quat( & xq, d_currentMatrix); - - for (i=0; i< 3; i++) { - pos[i] = xq.xyz[i]; // position; - } - for (i=0; i< 4; i++) { - d_quat[i] = xq.quat[i]; // orientation. - } -} - -bool vrpn_Tracker_ButtonFly::shouldReport - (double elapsedInterval) { - int i; - bool found_any; - - // If we come across an absolute channel that is active, - // we'll want to report. We also want to reset that channel's - // activity to false. Go through the whole list to make sure - // we handle all of them at once. - found_any = false; - for (i = 0; i < d_num_axes; i++) { - if (d_axes[i].active && d_axes[i].axis.absolute) { - found_any = true; - d_axes[i].active = false; - } - } - if (found_any) { - return VRPN_TRUE; - } - - // If we haven't had enough time pass yet, don't report. - if (elapsedInterval < d_update_interval) { - return VRPN_FALSE; - } - - // If we're sending a report every interval, regardless of - // whether or not there are changes, then send one now. - if (!d_reportChanges) { - return VRPN_TRUE; - } - - // If any differential channels are active, send the report. - found_any = false; - for (i = 0; i < d_num_axes; i++) { - if (d_axes[i].active && !d_axes[i].axis.absolute) { - found_any = true; - } - } - if (found_any) { - return VRPN_TRUE; - } - - // Enough time has elapsed, but nothing has changed, so return false. - return VRPN_FALSE; -} - diff --git a/src/vrpn/vrpn_Tracker_ButtonFly.h b/src/vrpn/vrpn_Tracker_ButtonFly.h deleted file mode 100644 index 322aeded1fc4d72159bd5fa19c09b965bfefaa23..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_ButtonFly.h +++ /dev/null @@ -1,181 +0,0 @@ -#ifndef INCLUDED_BUTTONFLY -#define INCLUDED_BUTTONFLY - -#include <quat.h> // for q_matrix_type -#include <stdio.h> // for NULL -#include <string.h> // for strcpy, memcpy, strncpy - -#include "vrpn_Analog.h" // for vrpn_ANALOGCB, etc -#include "vrpn_Button.h" // for vrpn_BUTTONCB, etc -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker -#include "vrpn_Types.h" // for VRPN_FALSE - -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -const int vrpn_BUTTONFLY_MAXAXES = 200; - -// This parameter is passed to the constructor for the ButtonFly; it -// describes the action of a single button, describing which -// direction to translate or rotate and how fast. Translation is -// expressed as a vector with the length of the translation, expressed -// in meters/second. Rotation is specified as a vector with the number -// of rotations to make per second around X, Y, and Z. - -class VRPN_API vrpn_TBF_axis { - - public: - - vrpn_TBF_axis(void) - { strcpy(name,""); channel = 0; - vec[0] = vec[1] = vec[2] = 0.0; - rot[0] = rot[1] = rot[2] = 0.0; - absolute = false; - }; - vrpn_TBF_axis(const char *n, int ch, const float v[], - const float rv[], bool absolut) - { strncpy(name, n, sizeof(name)-1); name[sizeof(name)-1] = '\0'; - channel = ch; - memcpy(vec, v, sizeof(vec)); - memcpy(rot, rv, sizeof(rot)); - absolute = absolut; - }; - - char name[200]; //< Name of the Button device driving this axis - int channel; //< Which channel to use from the Button device - float vec[3]; //< Vector telling how far and which way to move in 1 second - float rot[3]; //< Vector telling rotation about X,Y,and Z - bool absolute; //< Whether this is an absolute or differential change -}; - -class VRPN_API vrpn_Tracker_ButtonFlyParam { - - public: - - vrpn_Tracker_ButtonFlyParam (void) { - strcpy(vel_scale_name, ""); - strcpy(rot_scale_name, ""); - num_axes = 0; - } - - /// Add an axis command to the parameter list - bool add_axis(const vrpn_TBF_axis &b) { - if (num_axes >= vrpn_BUTTONFLY_MAXAXES) { return false; } - axes[num_axes] = b; - num_axes++; - return true; - } - - /// List of buttons that control axes - vrpn_TBF_axis axes[vrpn_BUTTONFLY_MAXAXES]; - int num_axes; //< How many axes have been filled in - - /// Analog device that scales the translation - char vel_scale_name[200]; - int vel_scale_channel; - float vel_scale_offset; - float vel_scale_scale; - float vel_scale_power; - - /// Analog device that scales the rotation - char rot_scale_name[200]; - int rot_scale_channel; - float rot_scale_offset; - float rot_scale_scale; - float rot_scale_power; -}; - -class VRPN_API vrpn_Tracker_ButtonFly; // Forward reference - -class VRPN_API vrpn_TBF_fullaxis { - public: - vrpn_TBF_fullaxis (void) { btn = NULL; active = false; bf = NULL; }; - - vrpn_TBF_axis axis; - vrpn_Button_Remote * btn; - vrpn_Tracker_ButtonFly * bf; - bool active; -}; - -/// This class will turn a button device into a tracker by interpreting -// the buttons as constant-velocity inputs and "flying" the user around based -// on which buttons are held down for how long. -// The mapping from buttons to directions (or orientation changes) is -// described in the vrpn_Tracker_ButtonFlyParam parameter. Translations are -// specified as vectors giving direction and speed (meters per second). -// Rotations are given as an axis to rotate around and speed to rotate -// (revolutions per second) around the given axis. -// The time reported by button trackers is the local time that the report was -// generated. Velocity reports are also generated for the tracker. - -// If reportChanges is TRUE, updates are ONLY sent if there has been a -// change since the last update, in which case they are generated no faster -// than update_rate. - -class VRPN_API vrpn_Tracker_ButtonFly : public vrpn_Tracker { - public: - vrpn_Tracker_ButtonFly (const char * name, vrpn_Connection * trackercon, - vrpn_Tracker_ButtonFlyParam * params, - float update_rate, - bool reportChanges = VRPN_FALSE); - - virtual ~vrpn_Tracker_ButtonFly (void); - - virtual void mainloop (); - virtual void reset (void); - - void update (q_matrix_type &); - - static int VRPN_CALLBACK handle_newConnection (void *, vrpn_HANDLERPARAM); - - protected: - - double d_update_interval; //< How long to wait between sends - struct timeval d_prevtime; //< Time of the previous report - bool d_reportChanges; //< Report only when something changes? - - vrpn_TBF_fullaxis d_axes[vrpn_BUTTONFLY_MAXAXES]; - int d_num_axes; - - /// Analog device that scales the translation - vrpn_Analog_Remote *d_vel_scale; - char d_vel_scale_name[200]; - int d_vel_scale_channel; - float d_vel_scale_offset; - float d_vel_scale_scale; - float d_vel_scale_power; - float d_vel_scale_value; //< Value computed from above, scales vel - - /// Analog device that scales the rotation - vrpn_Analog_Remote *d_rot_scale; - char d_rot_scale_name[200]; - int d_rot_scale_channel; - float d_rot_scale_offset; - float d_rot_scale_scale; - float d_rot_scale_power; - float d_rot_scale_value; //< Value computed from above, scales rotation - - /// Button that resets the transformation - vrpn_Button_Remote * d_reset_button; - int d_which_button; - - /// Initial, current, and velocity matrices for the tracker - q_matrix_type d_initMatrix, d_currentMatrix, d_velMatrix; - - void update_matrix_based_on_values (double time_interval); - void convert_matrix_to_tracker (void); - - bool shouldReport (double elapsedInterval); - - int setup_channel(vrpn_TBF_fullaxis * full); - int teardown_channel(vrpn_TBF_fullaxis * full); - - static void VRPN_CALLBACK handle_velocity_update(void * userdata, const vrpn_ANALOGCB info); - static void VRPN_CALLBACK handle_rotation_update(void * userdata, const vrpn_ANALOGCB info); - static void VRPN_CALLBACK handle_button_update(void * userdata, const vrpn_BUTTONCB info); - static void VRPN_CALLBACK handle_reset_press(void * userdata, const vrpn_BUTTONCB info); -}; - -#endif diff --git a/src/vrpn/vrpn_Tracker_Crossbow.C b/src/vrpn/vrpn_Tracker_Crossbow.C deleted file mode 100644 index 54ab51fc9d113ebfe1ba4362f472648371e2998c..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_Crossbow.C +++ /dev/null @@ -1,405 +0,0 @@ -// vrpn_Tracker_Crossbow.h -// This file contains the implementation for a Crossbow RGA300CA Tracker. - -#include <math.h> // for cos, sin -#include <stdio.h> // for fprintf, stderr, NULL -#include <stdlib.h> // for realloc, free -#include <string.h> // for memset - -#include "quat.h" // for q_from_euler, Q_W, Q_X, Q_Y, etc -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Serial.h" -#include "vrpn_Tracker_Crossbow.h" - -// Conversion multiplier from degrees to radians (Pi radians per 180 degrees) -#define DEGREES_TO_RADIANS (3.1415926535897 / 180) -// Conversion multiplier from Gs to meters-per-second-per-second (~9.8 m/s^2 on Earth) -#define MPSS_PER_G (9.80665) - -vrpn_Tracker_Crossbow::vrpn_Tracker_Crossbow(const char *name, vrpn_Connection *c, const char *port, long baud, - float g_range, float ar_range) : vrpn_Tracker_Serial(name, c, port, baud), just_read_something(0), - lin_accel_range(g_range), ang_accel_range(ar_range), device_version(0), device_serial(0) -{ -} - -vrpn_Tracker_Crossbow::~vrpn_Tracker_Crossbow() { - if (device_version) { - free(device_version); - device_version = 0; - } -} - -// Retrieves a raw_packet from an incoming byte array, and even flips endianness as necessary. -void vrpn_Tracker_Crossbow::unbuffer_packet(raw_packet &dest, unsigned char *buffer) { - vrpn_unbuffer(&buffer, &dest.header); - vrpn_unbuffer(&buffer, &dest.roll_angle); - vrpn_unbuffer(&buffer, &dest.pitch_angle); - vrpn_unbuffer(&buffer, &dest.yaw_rate); - vrpn_unbuffer(&buffer, &dest.accel_x); - vrpn_unbuffer(&buffer, &dest.accel_y); - vrpn_unbuffer(&buffer, &dest.accel_z); - vrpn_unbuffer(&buffer, &dest.timer); - vrpn_unbuffer(&buffer, &dest.temp_voltage); - vrpn_unbuffer(&buffer, &dest.part_number); - vrpn_unbuffer(&buffer, &dest.status); - vrpn_unbuffer(&buffer, &dest.checksum); -} - -int vrpn_Tracker_Crossbow::validate_packet(const raw_packet &packet) { - - // Allow accessing the packet as a string of bytes - union { - raw_packet packet; - vrpn_uint8 bytes[sizeof(raw_packet)]; - } aligned; - aligned.packet = packet; - - // Check the header for the magic number - if (packet.header != 0xAA55) { - fprintf(stderr, "vrpn_Tracker_Crossbow: Received packet with invalid header $%02X%02X (should be $AA55)\n", - aligned.bytes[0], aligned.bytes[1]); - return 1; - } - - // Now calculate the expected checksum - vrpn_uint16 checksum = 0; - for (int i = 2; i < 22; i++) - checksum += aligned.bytes[i]; - - // And compare the two checksum values. - if (checksum != packet.checksum) { - fprintf(stderr, "vrpn_Tracker_Crossbow: Received packet with invalid checksum $%04X (should be $%04X)\n", - packet.checksum, checksum); - return 1; - } - - return 0; -} - -int vrpn_Tracker_Crossbow::get_report() { - struct timeval timeout; - - timeout.tv_sec = 0; - timeout.tv_usec = 500000; // Half a second - - switch (status) { - case vrpn_TRACKER_AWAITING_STATION: - fprintf(stderr, "vrpn_Tracker_Crossbow: sanity: should never enter AWAITING_STATION state\n"); - return 0; - - case vrpn_TRACKER_SYNCING: { - int rv; - - // Quit early if we just got a packet - if (just_read_something) { - just_read_something = 0; - return 0; - } - - // Request a packet from the device - unsigned char echo = 'G'; - vrpn_write_characters(serial_fd, &echo, 1); - - rv = vrpn_read_available_characters(serial_fd, buffer, 1, &timeout); - // Return early if no characters are available - if (!rv) - return 0; - - // Return early if we aren't at the start of a packet header - if (*buffer != 0xAA) { - return 0; - } - - bufcount = 1; - - status = vrpn_TRACKER_PARTIAL; - - // Fall through to next state - } - - case vrpn_TRACKER_PARTIAL: { - int rv; - - if (bufcount == 1) { - rv = vrpn_read_available_characters(serial_fd, buffer + 1, 1, &timeout); - if (!rv || (buffer[1] != 0x55)) { - buffer[0] = 0; - bufcount = 0; - status = vrpn_TRACKER_SYNCING; - return 0; - } - bufcount++; - } - - // Try to read the rest of the packet. Return early if we haven't got a full packet yet. - rv = vrpn_read_available_characters(serial_fd, buffer + bufcount, 24 - bufcount, &timeout); - bufcount += rv; - if (bufcount < 24) - return 0; - - raw_packet new_data; - unbuffer_packet(new_data, &buffer[0]); - - // Ensure the packet is valid - if (validate_packet(new_data)) { - vrpn_flush_input_buffer(serial_fd); - status = vrpn_TRACKER_SYNCING; - return 0; - } - - // Prepare the new report - process_packet(new_data); - - bufcount = 0; - memset(buffer, 0, 24); - status = vrpn_TRACKER_SYNCING; - just_read_something = 1; - return 1; - } - - default: - fprintf(stderr, "vrpn_Tracker_Crossbow: sanity: unknown tracker state\n"); - return 0; - } -} - -void vrpn_Tracker_Crossbow::reset() { - const char *cmd; - unsigned char recv_buf[8]; - struct timeval timeout; - - timeout.tv_sec = 1; - timeout.tv_usec = 0; - -#if 0 // doesn't help - // First, take the comm port offline for a second - vrpn_close_commport(serial_fd); - vrpn_SleepMsecs(1000); - serial_fd = vrpn_open_commport(portname, baudrate); -#endif - - vrpn_flush_output_buffer(serial_fd); - vrpn_flush_input_buffer(serial_fd); - - // Try resetting by toggling the RTS line of the serial port - vrpn_set_rts(serial_fd); - vrpn_SleepMsecs(750); - vrpn_clear_rts(serial_fd); - vrpn_SleepMsecs(250); - vrpn_gettimeofday(×tamp, NULL); - - vrpn_flush_input_buffer(serial_fd); - - cmd = "P"; - vrpn_write_characters(serial_fd, reinterpret_cast<const unsigned char*> (cmd), 1); - vrpn_SleepMsecs(50); // Sleep long enough to stop receiving data - vrpn_flush_input_buffer(serial_fd); - - cmd = "RSv"; - vrpn_write_characters(serial_fd, reinterpret_cast<const unsigned char*> (cmd), 3); - vrpn_drain_output_buffer(serial_fd); - if (vrpn_read_available_characters(serial_fd, recv_buf, 8, &timeout) != 8) { - fprintf(stderr, "vrpn_Tracker_Crossbow::reset: Crossbow not responding to stimulus\n"); - status = vrpn_TRACKER_FAIL; - return; - } - - if ((recv_buf[0] != 'H') || (recv_buf[1] != 255) || (recv_buf[7] != 255)) { - fprintf(stderr, "vrpn_Tracker_Crossbow::reset: Crossbow gave unexpected ping response\n"); - status = vrpn_TRACKER_FAIL; - return; - } - - if (recv_buf[6] != ((recv_buf[2] + recv_buf[3] + recv_buf[4] + recv_buf[5]) & 0xFF)) { - fprintf(stderr, "vrpn_Tracker_Crossbow::reset: Crossbow gave invalid serial number checksum\n"); - status = vrpn_TRACKER_FAIL; - return; - } - - const char *bufptr = reinterpret_cast<const char *>(&recv_buf[2]); - vrpn_unbuffer(&bufptr, &device_serial); - - if (0) do { - if (!vrpn_read_available_characters(serial_fd, recv_buf, 1, &timeout)) { - fprintf(stderr, "vrpn_Tracker_Crossbow::reset: Crossbow not responding to stimulus\n"); - status = vrpn_TRACKER_FAIL; - return; - } - } while (*recv_buf != 255); - - int curSize = 4, curLen = 0; - device_version = (char *) realloc(device_version, curSize * sizeof(char)); - if (device_version == NULL) { - fprintf(stderr, "vrpn_Tracker_Crossbow::reset: Out of memory\n"); - status = vrpn_TRACKER_FAIL; - return; - } - do { - if (!vrpn_read_available_characters(serial_fd, recv_buf, 1, &timeout)) { - fprintf(stderr, "vrpn_Tracker_Crossbow::reset: Crossbow not responding to stimulus\n"); - status = vrpn_TRACKER_FAIL; - return; - } - if (*recv_buf != '$') - device_version[curLen++] = *recv_buf; - - if (curLen == curSize) - device_version = (char *) realloc(device_version, curSize *= 2); - } while (*recv_buf != '$'); - - // Now null-terminate the version string, expanding it one last time if necessary - if (curLen == curSize) - device_version = (char *) realloc(device_version, ++curSize); - - device_version[curLen] = 0; - - //printf("Serial %u\tVersion '%s'\n", device_serial, device_version); - - just_read_something = 0; - status = vrpn_TRACKER_SYNCING; - -} - -void vrpn_Tracker_Crossbow::ping() { - unsigned char buffer = 'R'; - struct timeval timeout; - - vrpn_write_characters(serial_fd, &buffer, 1); - - timeout.tv_sec = 1; - timeout.tv_usec = 0; - - while (vrpn_read_available_characters(serial_fd, &buffer, 1, &timeout) == 1) { - if (buffer == 'H') - return; - } - - fprintf(stderr, "vrpn_Tracker_Crossbow: Crossbow device not responding to ping\n"); -} - -void vrpn_Tracker_Crossbow::recalibrate(vrpn_uint16 num_samples) { - if (num_samples < 100) { - fprintf(stderr, "vrpn_Tracker_Crossbow: Must recalibrate using at least 100 samples\n"); - return; - } - else if (num_samples > 25599) { - fprintf(stderr, "vrpn_Tracker_Crossbow: Capping recalibration at 25,500 samples\n"); - num_samples = 25500; - } - - vrpn_drain_output_buffer(serial_fd); - vrpn_flush_input_buffer(serial_fd); - - // Prepare zero command - unsigned char buffer[2]; - buffer[0] = 'z'; - buffer[1] = (unsigned char) (num_samples / 100); - - vrpn_write_characters(serial_fd, buffer, 2); - vrpn_drain_output_buffer(serial_fd); - vrpn_SleepMsecs(50); - - // Wait for affirmative response. - // Allow two minutes before timing out. - // Even 25500 samples should make it with a few seconds to spare. - struct timeval timeout; - timeout.tv_sec = 120; - timeout.tv_usec = 0; - if (!vrpn_read_available_characters(serial_fd, buffer, 1, &timeout) || *buffer != 'Z') { - fprintf(stderr, "vrpn_Tracker_Crossbow: Failed to recalibrate device\n"); - } -} - -vrpn_uint32 vrpn_Tracker_Crossbow::get_serial_number() { - if (!device_serial) - reset(); - return device_serial; -} - -const char *vrpn_Tracker_Crossbow::get_version_string() { - if (!device_version) - reset(); - return device_version; -} - - -void vrpn_Tracker_Crossbow::mainloop() { - vrpn_Tracker_Serial::mainloop(); -} - -// Utility function to convert packed inputs into decoded floating-point equivalents. -float vrpn_Tracker_Crossbow::convert_scalar(vrpn_int16 data, float scale) const { - return data * scale / 32768; // 2^15 -} - -void vrpn_Tracker_Crossbow::process_packet(const raw_packet &packet) { - // Use the current time for a timestamp. - vrpn_gettimeofday(×tamp, NULL); - - // Clear the position record. - memset(pos, 0, sizeof(pos)); - - // Calculate the current orientation. (We don't know yaw, so report 0.) - double pitch = convert_scalar(packet.pitch_angle, 180.0f) * DEGREES_TO_RADIANS; - double roll = convert_scalar(packet.roll_angle, 180.0f) * DEGREES_TO_RADIANS; - xb_quat_from_euler(d_quat, pitch, roll); - - // Clear the linear velocity; we don't know it. - memset(vel, 0, sizeof(vel)); - - // Calculate the current angular velocity from yaw rate - // It's in degrees per second, so convert to radians per second. - q_from_euler(vel_quat, convert_scalar(packet.yaw_rate, 1.5f * ang_accel_range) * DEGREES_TO_RADIANS, 0, 0); - vel_quat_dt = 1; - - // Calculate the current acceleration vector - acc[0] = convert_scalar(packet.accel_x, 1.5f * lin_accel_range) * MPSS_PER_G; - acc[1] = convert_scalar(packet.accel_y, 1.5f * lin_accel_range) * MPSS_PER_G; - acc[2] = convert_scalar(packet.accel_z, 1.5f * lin_accel_range) * MPSS_PER_G; - - //printf("RawAccel = %hd\tG-Range = %f\tDerivedZ = %f\n", packet.accel_z, lin_accel_range, acc[2]); - - // The angular acceleration vector is nil. (0001 / 1) - acc_quat[0] = acc_quat[1] = acc_quat[2] = 0; - acc_quat[3] = acc_quat_dt = 1; -} - -void vrpn_Tracker_Crossbow::send_report(void) { - // Send the message on the connection - if (d_connection) { - char msgbuf[1000]; - int len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, position_m_id, d_sender_id, msgbuf, vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"Tracker: cannot write message: tossing\n"); - } - - len = encode_acc_to(msgbuf); - if (d_connection->pack_message(len, timestamp, accel_m_id, d_sender_id, msgbuf, vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"Tracker: cannot write message: tossing\n"); - } - - len = encode_vel_to(msgbuf); - if (d_connection->pack_message(len, timestamp, velocity_m_id, d_sender_id, msgbuf, vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"Tracker: cannot write message: tossing\n"); - } - } else { - fprintf(stderr,"Tracker: No valid connection\n"); - } -} - -// Creates orientation quaternion from pitch and roll Euler angles. -// Crossbow angles are given such that p' = yaw(pitch(roll(p))), -// but quatlib angles assume p' = roll(pitch(yaw(p))). -// Hence the apparent reimplementation of q_from_euler. -void vrpn_Tracker_Crossbow::xb_quat_from_euler(q_type destQuat, double pitch, double roll) const { - double sinP = sin(pitch / 2.0); - double cosP = cos(pitch / 2.0); - double sinR = sin(roll / 2.0); - double cosR = cos(roll / 2.0); - - destQuat[Q_X] = sinP * cosR; - destQuat[Q_Y] = cosP * sinR; - destQuat[Q_Z] = -sinP * sinR; - destQuat[Q_W] = cosP * cosR; -} - diff --git a/src/vrpn/vrpn_Tracker_Crossbow.h b/src/vrpn/vrpn_Tracker_Crossbow.h deleted file mode 100644 index f1c95725de6082fe158b5d9415cdf7d797bcb99e..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_Crossbow.h +++ /dev/null @@ -1,92 +0,0 @@ -// vrpn_Tracker_Crossbow.h -// This file contains the class header for a Crossbow RGA300CA Tracker. -// This version was written in the summer of 2005 by Chris VanderKnyff. - -#ifndef VRPN_TRACKER_CROSSBOW_H -#define VRPN_TRACKER_CROSSBOW_H - -#include "quat.h" // for q_type -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker_Serial -#include "vrpn_Types.h" // for vrpn_int16, vrpn_uint16, etc - -class VRPN_API vrpn_Connection; - -class VRPN_API vrpn_Tracker_Crossbow: public vrpn_Tracker_Serial { -public: - /// The constructor is given the name of the tracker (the name of - /// the sender it should use), the connection on which it is to - /// send its messages, the name of the serial port it is to open - /// (default is /dev/ttyS0 (first serial port in Linux), the baud - /// rate at which it is to communicate (default 38400), the linear - /// acceleration range of the sensor in Gs (default 2), and the - /// angular acceleration range of the sensor in degrees per second - /// (default 100). - - vrpn_Tracker_Crossbow(const char *name, vrpn_Connection *c, - const char *port = "/dev/ttyS0", long baud = 38400, - float g_range = 2.0f, float ar_range = 100.0f); - - ~vrpn_Tracker_Crossbow(); - - // Run through the main loop once, sending notification messages as necessary - virtual void mainloop(); - - // Reset the tracker. - void reset(); - - // Get reports from the serial port - int get_report(); - - // Retrieve the device's serial number. This is cached between resets. - vrpn_uint32 get_serial_number(); - - // Retrieve the device's version string. This is cached between resets. - const char *get_version_string(); - - // Recalibrates and zeros the device's rate sensors over a specified # of samples. - // This takes about 3-4ms per sample, during which time the process blocks. - // The device does not have to be level when zeroing, but must be still. - void recalibrate(vrpn_uint16 num_samples = 20000); - -protected: - struct raw_packet { - vrpn_uint16 header; - vrpn_int16 roll_angle; - vrpn_int16 pitch_angle; - vrpn_int16 yaw_rate; - vrpn_int16 accel_x; - vrpn_int16 accel_y; - vrpn_int16 accel_z; - vrpn_uint16 timer; - vrpn_int16 temp_voltage; - vrpn_int16 part_number; - vrpn_int16 status; - vrpn_uint16 checksum; - }; - - struct timeval init_time; - float lin_accel_range; - float ang_accel_range; - - vrpn_uint32 device_serial; // Device serial number - char *device_version; // Device version string - - int just_read_something; - - void unbuffer_packet(raw_packet &dest, unsigned char *buffer); - int validate_packet(const raw_packet &packet); - void process_packet(const raw_packet &packet); - - float convert_scalar(vrpn_int16 data, float scale) const; - void xb_quat_from_euler(q_type destQuat, double pitch, double roll) const; - - void send_report(); - - void ping(); - -}; - -#endif - diff --git a/src/vrpn/vrpn_Tracker_DTrack.C b/src/vrpn/vrpn_Tracker_DTrack.C deleted file mode 100644 index 3cdc2943de5759dc362583569b894bae5d8897d0..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_DTrack.C +++ /dev/null @@ -1,1388 +0,0 @@ -// vrpn_Tracker_DTrack.C -// -// Advanced Realtime Tracking GmbH's (http://www.ar-tracking.de) DTrack/DTrack2 client - -// developed by David Nahon for Virtools VR Pack (http://www.virtools.com) -// (07/20/2004) improved by Advanced Realtime Tracking GmbH (http://www.ar-tracking.de) -// (07/02/2007, 06/29/2009) upgraded by Advanced Realtime Tracking GmbH to support new devices -// (08/25/2010) a correction added by Advanced Realtime Tracking GmbH -// (12/01/2010) support of 3dof objects added by Advanced Realtime Tracking GmbH -// -// Recommended settings within DTrack's 'Settings / Network' or DTrack2's 'Settings / Output' dialog: -// 'ts', '6d', '6df' or '6df2', '6dcal', '3d' (optional) - -/* Configuration file: - -################################################################################ -# Advanced Realtime Tracking GmbH (http://www.ar-tracking.de) DTrack/DTrack2 client -# -# creates as many vrpn_Tracker as there are bodies or Flysticks, starting with the bodies -# creates 2 analogs per Flystick -# creates 8 buttons per Flystick -# -# NOTE: when using DTrack's older output format for Flystick data ('6df'), the numbering -# of Flystick buttons differs from DTrack documentation (for compatibility with -# older vrpn releases) -# -# Arguments: -# char name_of_this_device[] -# int udp_port (DTrack sends data to this UDP port) -# -# Optional arguments: -# float time_to_reach_joy (in seconds; see below) -# int number_of_bodies, number_of_flysticks (fixed numbers of bodies and Flysticks) -# int renumbered_ids[] (vrpn_Tracker IDs of bodies and Flysticks) -# char "3d" (activates 3dof marker output if available; -# always last argument if "-" is not present) -# char "-" (activates tracing; always last argument) -# -# NOTE: time_to_reach_joy is the time needed to reach the maximum value (1.0 or -1.0) of the -# joystick of older 'Flystick' devices when the corresponding button is pressed -# (one of the last buttons amongst the 8); not necessary for newer 'Flystick2' devices -# with its analog joystick -# -# NOTE: if fixed numbers of bodies and Flysticks should be used, both arguments -# number_of_bodies and number_of_flysticks have to be set -# -# NOTE: renumbering of tracker IDs is only possible, if fixed numbers of bodies and -# Flysticks are set; there has to be an argument present for each body/Flystick - -#vrpn_Tracker_DTrack DTrack 5000 -#vrpn_Tracker_DTrack DTrack 5000 - -#vrpn_Tracker_DTrack DTrack 5000 3d -#vrpn_Tracker_DTrack DTrack 5000 3d - -#vrpn_Tracker_DTrack DTrack 5000 0.5 -#vrpn_Tracker_DTrack DTrack 5000 0.5 2 2 -#vrpn_Tracker_DTrack DTrack 5000 0.5 2 2 2 1 0 3 -#vrpn_Tracker_DTrack DTrack 5000 0.5 2 2 2 1 0 3 3d - - -################################################################################ -*/ - -// usually the following should work: - -#ifndef _WIN32 - #define OS_UNIX // for Unix (Linux, Irix, ...) -#else - #define OS_WIN // for MS Windows (2000, XP, ...) -#endif - -#include <stdio.h> // for NULL, printf, fprintf, etc -#include <stdlib.h> // for strtod, exit, free, malloc, etc -#include <string.h> // for strncmp, memset, strcat, etc - -#include "quat.h" // for Q_RAD_TO_DEG, etc -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval, INVALID_SOCKET, etc -#include "vrpn_Tracker_DTrack.h" -#include "vrpn_Types.h" // for vrpn_float64 -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -#ifdef OS_WIN - #ifdef VRPN_USE_WINSOCK2 - #include <winsock2.h> // struct timeval is defined here - #else - #include <winsock.h> // struct timeval is defined here - #endif -#endif -#ifdef OS_UNIX - #include <netinet/in.h> // for sockaddr_in, INADDR_ANY, etc - #include <sys/socket.h> // for bind, recv, socket, AF_INET, etc - #include <unistd.h> // for close - #include <sys/select.h> // for select, FD_SET, FD_SETSIZE, etc -#endif - - -// There is a problem with linking on SGIs related to standard libraries. -#ifndef sgi - -// -------------------------------------------------------------------------- -// Globals: - -#define DTRACK2VRPN_BUTTONS_PER_FLYSTICK 8 // number of vrpn buttons per Flystick (fixed) -#define DTRACK2VRPN_ANALOGS_PER_FLYSTICK 2 // number of vrpn analogs per Flystick (fixed) - -#define UDPRECEIVE_BUFSIZE 20000 // size of udp buffer for DTrack data (one frame; in bytes) - -// -------------------------------------------------------------------------- - -// Local error codes: - -#define DTRACK_ERR_NONE 0 // no error -#define DTRACK_ERR_TIMEOUT 1 // timeout while receiving data -#define DTRACK_ERR_UDP 2 // UDP receive error -#define DTRACK_ERR_PARSE 3 // error in UDP packet - -// Local prototypes: - -static char* string_nextline(char* str, char* start, int len); -static char* string_get_i(char* str, int* i); -static char* string_get_ui(char* str, unsigned int* ui); -static char* string_get_d(char* str, double* d); -static char* string_get_f(char* str, float* f); -static char* string_get_block(char* str, const char* fmt, int* idat, float* fdat); - -static vrpn_Tracker_DTrack::socket_type udp_init(unsigned short port); -static int udp_exit(vrpn_Tracker_DTrack::socket_type sock); -static int udp_receive(vrpn_Tracker_DTrack::socket_type sock, void *buffer, int maxlen, int tout_us); - - -// -------------------------------------------------------------------------- -// Constructor: -// name (i): device name -// c (i): vrpn_Connection -// dtrackPort (i): DTrack UDP port -// timeToReachJoy (i): time needed to reach the maximum value of the joystick -// fixNbody, fixNflystick (i): fixed numbers of DTrack bodies and Flysticks (-1 if not wanted) -// fixId (i): renumbering of targets; must have exactly (fixNbody + fixNflystick) elements (NULL if not wanted) -// actTracing (i): activate trace output - -vrpn_Tracker_DTrack::vrpn_Tracker_DTrack(const char *name, vrpn_Connection *c, - int dtrackPort, float timeToReachJoy, - int fixNbody, int fixNflystick, int* fixId, - bool act3DOFout, bool actTracing) : - vrpn_Tracker(name, c), - vrpn_Button_Filter(name, c), - vrpn_Analog(name, c) -{ - - int i; - - // Dunno how many of these there are yet... - - num_sensors = 0; - num_channel = 0; - num_buttons = 0; - - // init variables: general - output_3dof_marker = act3DOFout; - tracing = actTracing; - tracing_frames = 0; - - tim_first.tv_sec = tim_first.tv_usec = 0; // also used to recognize the first frame - tim_last.tv_sec = tim_last.tv_usec = 0; - - // init variables: DTrack data - - if(fixNbody >= 0 && fixNflystick >= 0){ // fixed numbers of bodies and Flysticks should be used - use_fix_numbering = true; - - fix_nbody = fixNbody; - fix_nflystick = fixNflystick; - - fix_idbody.resize(fix_nbody + fix_nflystick); - fix_idflystick.resize(fix_nflystick); - - if(fixId){ // take the renumbering information for bodies and Flysticks - for(i=0; i<fix_nbody + fix_nflystick; i++){ // take the renumbering information for bodies - fix_idbody[i] = fixId[i]; - } - - for(i=0; i<fix_nflystick; i++){ // take the renumbering information for Flysticks (vrpn button data) - fix_idflystick[i] = fixId[i + fix_nbody]; - } - - for(i=0; i<fix_nbody; i++){ // remove all bodies from the Flystick renumbering data - for(int j=0; j<fix_nflystick; j++){ - if(fixId[i] < fixId[j + fix_nbody] && fix_idflystick[j] > 0){ // be sure to avoid crazy numbers... - fix_idflystick[j]--; - } - } - } - }else{ // take identity numbering for bodies and Flysticks - for(i=0; i<fix_nbody + fix_nflystick; i++){ - fix_idbody[i] = i; - } - for(i=0; i<fix_nflystick; i++){ - fix_idflystick[i] = i; - } - } - }else{ // no fixed numbers - use_fix_numbering = false; - } - - warning_nbodycal = false; - - // init variables: preparing data for VRPN - - if(timeToReachJoy > 1e-20){ - joy_incPerSec = 1.f / timeToReachJoy; // increase of 'joystick' channel - }else{ - joy_incPerSec = 1e20f; // so it reaches immediately - } - - // init: communicating with DTrack - - if(!dtrack_init(dtrackPort)){ - exit(EXIT_FAILURE); - } -} - -// Destructor: - -vrpn_Tracker_DTrack::~vrpn_Tracker_DTrack() -{ - - dtrack_exit(); -} - - -// -------------------------------------------------------------------------- -// Main loop: - -// This function should be called each time through the main loop -// of the server code. It checks for a report from the tracker and -// sends it if there is one. - -void vrpn_Tracker_DTrack::mainloop() -{ - struct timeval timestamp; - long tts, ttu; - float dt; - int nbody, nflystick, i; - int newid; - - // call the generic server mainloop, since we are a server: - - server_mainloop(); - - // get data from DTrack: - - if(!dtrack_receive()){ - if(d_lasterror != DTRACK_ERR_TIMEOUT){ - fprintf(stderr, "vrpn_Tracker_DTrack: Receive Error from DTrack.\n"); - } - return; - } - - tracing_frames++; - - // get time stamp: - - vrpn_gettimeofday(×tamp, NULL); - - if(act_timestamp >= 0){ // use DTrack time stamp if available - tts = (long )act_timestamp; - ttu = (long )((act_timestamp - tts) * 1000000); - tts += timestamp.tv_sec - timestamp.tv_sec % 86400; // add day part of vrpn time stamp - - if(tts >= timestamp.tv_sec + 43200 - 1800){ // shift closer to vrpn time stamp - tts -= 86400; - }else if(tts <= timestamp.tv_sec - 43200 - 1800){ - tts += 86400; - } - - timestamp.tv_sec = tts; - timestamp.tv_usec = ttu; - } - - if(tim_first.tv_sec == 0 && tim_first.tv_usec == 0){ - tim_first = tim_last = timestamp; - } - - dt = (float )vrpn_TimevalDurationSeconds(timestamp, tim_last); - tim_last = timestamp; - - if(tracing && ((tracing_frames % 10) == 0)){ - printf("framenr %u time %.3lf\n", act_framecounter, vrpn_TimevalDurationSeconds(timestamp, tim_first)); - } - - // find number of targets visible for vrpn to choose the correct vrpn ID numbers: - // (1) takes fixed number of bodies and Flysticks, if defined in the configuration file - // (2) otherwise uses the '6dcal' line in DTrack's output, that gives the total number of - // calibrated targets, if available - // (3) otherwise tracks the maximum number of appeared targets - - if(use_fix_numbering){ // fixed numbers should be used - nbody = fix_nbody; // number of bodies visible for vrpn - nflystick = fix_nflystick; // number of Flysticks visible for vrpn - }else if(act_has_bodycal_format){ // DTrack/DTrack2 sent information about the number of calibrated targets - nbody = act_num_bodycal; // number of bodies visible for vrpn - nflystick = act_num_flystick; // number of Flysticks visible for vrpn - }else{ // else track the maximum number of appeared targets (at least) - if(!warning_nbodycal){ // mention warning (once) - fprintf(stderr, "vrpn_Tracker_DTrack warning: no DTrack '6dcal' data available.\n"); - warning_nbodycal = true; - } - - nbody = act_num_body; // number of bodies visible for vrpn - nflystick = act_num_flystick; // number of Flysticks visible for vrpn - } - - // report tracker data to vrpn: - - num_sensors = nbody + nflystick; // total number of targets visible for vrpn - num_buttons = nflystick * DTRACK2VRPN_BUTTONS_PER_FLYSTICK; // 8 buttons per Flystick - num_channel = nflystick * DTRACK2VRPN_ANALOGS_PER_FLYSTICK; // 2 channels per joystick/Flystick - - for(i=0; i<act_num_body; i++){ // DTrack standard bodies - if(act_body[i].id < nbody){ // there might be more DTrack standard bodies than wanted - if(act_body[i].quality >= 0){ // report position only if body is tracked - if(use_fix_numbering){ - newid = fix_idbody[act_body[i].id]; // renumbered ID - }else{ - newid = act_body[i].id; - } - - dtrack2vrpn_body(newid, "", act_body[i].id, act_body[i].loc, act_body[i].rot, timestamp); - } - } - } - - if(num_channel >= static_cast<int>(joy_last.size())){ // adjust length of vector for current joystick value - size_t j0 = joy_last.size(); - - joy_simulate.resize(num_channel); - joy_last.resize(num_channel); - - for(size_t j=j0; j< static_cast<size_t>(num_channel); j++){ - joy_simulate[j] = false; - joy_last[j] = 0; - } - } - - for(i=0; i<(int)act_num_flystick; i++){ // DTrack Flysticks - if(act_flystick[i].id < nflystick){ // there might be more DTrack Flysticks than wanted - if(act_flystick[i].quality >= 0){ // report position only if Flystick is tracked - if(use_fix_numbering){ - newid = fix_idbody[act_flystick[i].id + nbody]; // renumbered ID for position - }else{ - newid = act_flystick[i].id + nbody; - } - - dtrack2vrpn_body(newid, "f", act_flystick[i].id, act_flystick[i].loc, act_flystick[i].rot, - timestamp); - } - - if(use_fix_numbering){ - newid = fix_idflystick[act_flystick[i].id]; // renumbered ID for buttons and analogs - }else{ - newid = act_flystick[i].id; - } - - dtrack2vrpn_flystickbuttons(newid, act_flystick[i].id, - act_flystick[i].num_button, act_flystick[i].button, timestamp); - - dtrack2vrpn_flystickanalogs(newid, act_flystick[i].id, - act_flystick[i].num_joystick, act_flystick[i].joystick, dt, timestamp); - } - } - - if (output_3dof_marker) { - int offset = num_sensors; - num_sensors += act_num_marker; - for(i=0; i<act_num_marker; i++){ // DTrack 3dof marker - dtrack2vrpn_marker(offset + i, "m", act_marker[i].id, act_marker[i].loc, timestamp); - } - } - - // finish main loop: - - vrpn_Analog::report_changes(); // report any analog event; - vrpn_Button::report_changes(); // report any button event; -} - - -// ----------------------------------------------------------------------------------------- -// Helpers: - - -// --------------------------------------------------------------------------------------------------- -// --------------------------------------------------------------------------------------------------- -// Preparing data for VRPN: -// these functions convert DTrack data to vrpn data - -// Preparing marker data: -// id (i): VRPN body ID -// str_dtrack (i): DTrack marker name (just used for trace output) -// id_dtrack (i): DTrack marker ID (just used for trace output) -// loc (i): position -// timestamp (i): timestamp for body data -// return value (o): 0 ok, -1 error - -int vrpn_Tracker_DTrack::dtrack2vrpn_marker(int id, const char* str_dtrack, int id_dtrack, - const float* loc, struct timeval timestamp) -{ - - d_sensor = id; - - // position (plus converting to unit meter): - - pos[0] = loc[0] / 1000.; - pos[1] = loc[1] / 1000.; - pos[2] = loc[2] / 1000.; - - // orientation: none - - q_make(d_quat, 1, 0, 0, 0); - - // pack and deliver tracker report: - - if(d_connection){ - char msgbuf[1000]; - int len = vrpn_Tracker::encode_to(msgbuf); - - if(d_connection->pack_message(len, timestamp, position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) - { - fprintf(stderr, "vrpn_Tracker_DTrack: cannot write message: tossing.\n"); - } - } - - // tracing: - - if(tracing && ((tracing_frames % 10) == 0)){ - - printf("marker id (DTrack vrpn): %s%d %d pos (x y z): %.4f %.4f %.4f\n", - str_dtrack, id_dtrack, id, pos[0], pos[1], pos[2]); - } - - return 0; -} - - -// Preparing body data: -// id (i): VRPN body ID -// str_dtrack (i): DTrack body name ('body' or 'Flystick'; just used for trace output) -// id_dtrack (i): DTrack body ID (just used for trace output) -// loc (i): position -// rot (i): orientation (3x3 rotation matrix) -// timestamp (i): timestamp for body data -// return value (o): 0 ok, -1 error - -int vrpn_Tracker_DTrack::dtrack2vrpn_body(int id, const char* str_dtrack, int id_dtrack, - const float* loc, const float* rot, struct timeval timestamp) -{ - - d_sensor = id; - - // position (plus converting to unit meter): - - pos[0] = loc[0] / 1000.; - pos[1] = loc[1] / 1000.; - pos[2] = loc[2] / 1000.; - - // orientation: - - q_matrix_type destMatrix; // if this is not good, just build the matrix and do a matrixToQuat - - destMatrix[0][0] = rot[0]; - destMatrix[0][1] = rot[1]; - destMatrix[0][2] = rot[2]; - destMatrix[0][3] = 0.0; - - destMatrix[1][0] = rot[3]; - destMatrix[1][1] = rot[4]; - destMatrix[1][2] = rot[5]; - destMatrix[1][3] = 0.0; - - destMatrix[2][0] = rot[6]; - destMatrix[2][1] = rot[7]; - destMatrix[2][2] = rot[8]; - destMatrix[2][3] = 0.0; - - destMatrix[3][0] = 0.0; - destMatrix[3][1] = 0.0; - destMatrix[3][2] = 0.0; - destMatrix[3][3] = 1.0; - - q_from_row_matrix(d_quat, destMatrix); - - // pack and deliver tracker report: - - if(d_connection){ - char msgbuf[1000]; - int len = vrpn_Tracker::encode_to(msgbuf); - - if(d_connection->pack_message(len, timestamp, position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) - { - fprintf(stderr, "vrpn_Tracker_DTrack: cannot write message: tossing.\n"); - } - } - - // tracing: - - if(tracing && ((tracing_frames % 10) == 0)){ - q_vec_type yawPitchRoll; - - q_to_euler(yawPitchRoll, d_quat); - - printf("body id (DTrack vrpn): %s%d %d pos (x y z): %.4f %.4f %.4f euler (y p r): %.3f %.3f %.3f\n", - str_dtrack, id_dtrack, id, pos[0], pos[1], pos[2], - Q_RAD_TO_DEG(yawPitchRoll[0]), Q_RAD_TO_DEG(yawPitchRoll[1]), Q_RAD_TO_DEG(yawPitchRoll[2])); - } - - return 0; -} - - -// Preparing Flystick button data: -// id (i): VRPN Flystick ID -// id_dtrack (i): DTrack Flystick ID (just used for trace output) -// num_but (i): number of buttons -// but (i): button state (1 pressed, 0 not pressed) -// timestamp (i): timestamp for button data -// return value (o): 0 ok, -1 error - -int vrpn_Tracker_DTrack::dtrack2vrpn_flystickbuttons(int id, int id_dtrack, - int num_but, const int* but, struct timeval timestamp) -{ - int n, i, ind; - - n = (num_but > DTRACK2VRPN_BUTTONS_PER_FLYSTICK) ? DTRACK2VRPN_BUTTONS_PER_FLYSTICK : num_but; - - // buttons: - // NOTE: numbering of two buttons (B2 and B4) differs from DTrack documentation, as long as the 'older' - // output format '6df' is used by DTrack! - - ind = id * DTRACK2VRPN_BUTTONS_PER_FLYSTICK; - i = 0; - while(i < n){ - buttons[ind++] = but[i]; - i++; - } - while(i < DTRACK2VRPN_BUTTONS_PER_FLYSTICK){ // fill remaining buttons - buttons[ind++] = 0; - i++; - } - - if(act_has_old_flystick_format){ // for backward compatibility! - // NOTE: numbering of two buttons (button 2 and button 4) differs from DTrack documentation! - buttons[id * DTRACK2VRPN_BUTTONS_PER_FLYSTICK + 1] = but[3]; - buttons[id * DTRACK2VRPN_BUTTONS_PER_FLYSTICK + 3] = but[1]; - } - - vrpn_Button::timestamp = timestamp; // timestamp for button event (explicitly necessary) - - // tracing: - - if(tracing && ((tracing_frames % 10) == 0)){ - printf("flystick id (DTrack vrpn): f%d %d but ", id_dtrack, id); - for(i=0; i<n; i++){ - printf(" %d", but[i]); - } - printf("\n"); - } - - return 0; -} - - -// Preparing Flystick analog data: -// id (i): VRPN Flystick ID -// id_dtrack (i): DTrack Flystick ID (just used for trace output) -// num_ana (i): number of analogs -// ana (i): analog state (-1 <= ana <= 1) -// dt (i): time since last change -// timestamp (i): timestamp for analog data -// return value (o): 0 ok, -1 error - -int vrpn_Tracker_DTrack::dtrack2vrpn_flystickanalogs(int id, int id_dtrack, - int num_ana, const float* ana, float dt, struct timeval timestamp) -{ - int n, i, ind; - float f; - - n = (num_ana > DTRACK2VRPN_ANALOGS_PER_FLYSTICK) ? DTRACK2VRPN_ANALOGS_PER_FLYSTICK : num_ana; - - // analogs: - // NOTE: simulation of time varying floating values, if a joystick action of an older - // 'Flystick' device is recognized! - - ind = id * DTRACK2VRPN_ANALOGS_PER_FLYSTICK; - i = 0; - while(i < n){ - f = ana[i]; - - // simulation of time varying floating values (actually just necessary for older - // 'Flystick' devices and for backward compatibility): - - if(f == 0){ // zero position: reset everything - joy_simulate[ind] = false; - }else if((f > 0.99 || f < -0.99) && joy_last[ind] == 0){ // extreme change: start simulation - joy_simulate[ind] = true; - } - - if(joy_simulate[ind]){ // simulation of time varying floating values - if(f > 0){ - f = joy_last[ind] + joy_incPerSec * dt; - - if(f >= 1){ - f = 1; - joy_simulate[ind] = false; - } - }else{ - f = joy_last[ind] - joy_incPerSec * dt; - - if(f <= -1){ - f = -1; - joy_simulate[ind] = false; - } - } - } - - joy_last[ind] = f; - channel[ind++] = f; - i++; - } - while(i < DTRACK2VRPN_ANALOGS_PER_FLYSTICK){ // fill remaining analogs - channel[ind++] = 0; - i++; - } - - vrpn_Analog::timestamp = timestamp; // timestamp for analog event (explicitly necessary) - - // tracing: - - if(tracing && ((tracing_frames % 10) == 0)){ - printf("flystick id (DTrack vrpn): f%d %d ana ", id_dtrack, id); - for(i=0; i<n; i++){ - printf(" %.2f", ana[i]); - } - printf("\n"); - } - - return 0; -} - - -// --------------------------------------------------------------------------------------------------- -// --------------------------------------------------------------------------------------------------- -// Communication with DTrack: -// these functions receive and parse data packets from DTrack - -// Initializing communication with DTrack: -// -// udpport (i): UDP port number to receive data from DTrack -// -// return value (o): initialization was successful (boolean) - -bool vrpn_Tracker_DTrack::dtrack_init(int udpport) -{ - - d_udpbuf = NULL; - d_lasterror = DTRACK_ERR_NONE; - - // create UDP socket: - - if(udpport <= 0 || udpport > 65535){ - fprintf(stderr, "vrpn_Tracker_DTrack: Illegal UDP port %d.\n", udpport); - return false; - } - - d_udpsock = udp_init((unsigned short )udpport); - - if(d_udpsock == INVALID_SOCKET){ - fprintf(stderr, "vrpn_Tracker_DTrack: Cannot Initialize UDP Socket.\n"); - return false; - } - - d_udptimeout_us = 0; - - // create UDP buffer: - - d_udpbufsize = UDPRECEIVE_BUFSIZE; - - d_udpbuf = (char *)malloc(d_udpbufsize); - - if(d_udpbuf == NULL){ - udp_exit(d_udpsock); - d_udpsock = INVALID_SOCKET; - fprintf(stderr, "vrpn_Tracker_DTrack: Cannot Allocate Memory for UDP Buffer.\n"); - return false; - } - - // reset actual DTrack data: - - act_framecounter = 0; - act_timestamp = -1; - - act_num_marker = act_num_body = act_num_flystick = 0; - act_has_bodycal_format = false; - act_has_old_flystick_format = false; - - return true; -} - - -// Deinitializing communication with DTrack: -// -// return value (o): deinitialization was successful (boolean) - -bool vrpn_Tracker_DTrack::dtrack_exit(void) -{ - - // release buffer: - - if(d_udpbuf != NULL){ - free(d_udpbuf); - } - - // release UDP socket: - - if(d_udpsock != INVALID_SOCKET){ - udp_exit(d_udpsock); - } - - return true; -} - - -// --------------------------------------------------------------------------------------------------- -// Receive and process one DTrack data packet (UDP; ASCII protocol): -// -// return value (o): receiving was successful (boolean) - -bool vrpn_Tracker_DTrack::dtrack_receive(void) -{ - char* s; - int i, j, k, l, n, len, id; - char sfmt[20]; - int iarr[3]; - float f; - int loc_num_bodycal, loc_num_flystick1, loc_num_meatool; - - if(d_udpsock == INVALID_SOCKET){ - d_lasterror = DTRACK_ERR_UDP; - return false; - } - - // defaults: - - act_framecounter = 0; - act_timestamp = -1; - - loc_num_bodycal = -1; // i.e. not available - loc_num_flystick1 = loc_num_meatool = 0; - - act_has_bodycal_format = false; - - // receive UDP packet: - - len = udp_receive(d_udpsock, d_udpbuf, d_udpbufsize-1, d_udptimeout_us); - - if(len == -1){ - d_lasterror = DTRACK_ERR_TIMEOUT; - return false; - } - if(len <= 0){ - d_lasterror = DTRACK_ERR_UDP; - return false; - } - - s = d_udpbuf; - s[len] = '\0'; - - // process lines: - - d_lasterror = DTRACK_ERR_PARSE; - - do{ - // line for frame counter: - - if(!strncmp(s, "fr ", 3)){ - s += 3; - - if(!(s = string_get_ui(s, &act_framecounter))){ // get frame counter - act_framecounter = 0; - return false; - } - - continue; - } - - // line for timestamp: - - if(!strncmp(s, "ts ", 3)){ - s += 3; - - if(!(s = string_get_d(s, &act_timestamp))){ // get time stamp - act_timestamp = -1; - return false; - } - - continue; - } - - // line for additional information about number of calibrated bodies: - - if(!strncmp(s, "6dcal ", 6)){ - s += 6; - - act_has_bodycal_format = true; - - if(!(s = string_get_i(s, &loc_num_bodycal))){ // get number of calibrated bodies - return false; - } - - continue; - } - - // line for 3dof marker data: - - if(!strncmp(s, "3d ", 3)){ - s += 3; - act_num_marker = 0; - - if(!(s = string_get_i(s, &n))){ // get number of standard bodies (in line) - return false; - } - - if (static_cast<unsigned>(n) > act_marker.size()) { - act_marker.resize(n); - } - - for(i=0; i<n; i++){ // get data of standard bodies - if(!(s = string_get_block(s, "if", &id, &f))){ - return false; - } - - act_marker[act_num_marker].id = id; - - if(!(s = string_get_block(s, "fff", NULL, act_marker[act_num_marker].loc))){ - return false; - } - - act_num_marker++; - } - - continue; - } - - // line for standard body data: - - if(!strncmp(s, "6d ", 3)){ - s += 3; - - for(i=0; i<act_num_body; i++){ // disable all existing data - memset(&act_body[i], 0, sizeof(vrpn_dtrack_body_type)); - act_body[i].id = i; - act_body[i].quality = -1; - } - - if(!(s = string_get_i(s, &n))){ // get number of standard bodies (in line) - return false; - } - - for(i=0; i<n; i++){ // get data of standard bodies - if(!(s = string_get_block(s, "if", &id, &f))){ - return false; - } - - if(id >= act_num_body){ // adjust length of vector - act_body.resize(id + 1); - - for(j=act_num_body; j<=id; j++){ - memset(&act_body[j], 0, sizeof(vrpn_dtrack_body_type)); - act_body[j].id = j; - act_body[j].quality = -1; - } - - act_num_body = id + 1; - } - - act_body[id].id = id; - act_body[id].quality = f; - - if(!(s = string_get_block(s, "fff", NULL, act_body[id].loc))){ - return false; - } - - if(!(s = string_get_block(s, "fffffffff", NULL, act_body[id].rot))){ - return false; - } - } - - continue; - } - - // line for Flystick data (older format): - - if(!strncmp(s, "6df ", 4)){ - s += 4; - - act_has_old_flystick_format = true; - - if(!(s = string_get_i(s, &n))){ // get number of calibrated Flysticks - return false; - } - - loc_num_flystick1 = n; - - if(n > act_num_flystick){ // adjust length of vector - act_flystick.resize(n); - - act_num_flystick = n; - } - - for(i=0; i<n; i++){ // get data of Flysticks - if(!(s = string_get_block(s, "ifi", iarr, &f))){ - return false; - } - - if(iarr[0] != i){ // not expected - return false; - } - - act_flystick[i].id = iarr[0]; - act_flystick[i].quality = f; - - act_flystick[i].num_button = 8; - k = iarr[1]; - for(j=0; j<8; j++){ - act_flystick[i].button[j] = k & 0x01; - k >>= 1; - } - - act_flystick[i].num_joystick = 2; // additionally to buttons 5-8 - if(iarr[1] & 0x20){ - act_flystick[i].joystick[0] = -1; - }else if(iarr[1] & 0x80){ - act_flystick[i].joystick[0] = 1; - }else{ - act_flystick[i].joystick[0] = 0; - } - if(iarr[1] & 0x10){ - act_flystick[i].joystick[1] = -1; - }else if(iarr[1] & 0x40){ - act_flystick[i].joystick[1] = 1; - }else{ - act_flystick[i].joystick[1] = 0; - } - - if(!(s = string_get_block(s, "fff", NULL, act_flystick[i].loc))){ - return false; - } - - if(!(s = string_get_block(s, "fffffffff", NULL, act_flystick[i].rot))){ - return false; - } - } - - continue; - } - - // line for Flystick data (newer format): - - if(!strncmp(s, "6df2 ", 5)){ - s += 5; - - act_has_old_flystick_format = false; - - if(!(s = string_get_i(s, &n))){ // get number of calibrated Flysticks - return false; - } - - if(n > act_num_flystick){ // adjust length of vector - act_flystick.resize(n); - - act_num_flystick = n; - } - - if(!(s = string_get_i(s, &n))){ // get number of Flysticks - return false; - } - - for(i=0; i<n; i++){ // get data of Flysticks - if(!(s = string_get_block(s, "ifii", iarr, &f))){ - return false; - } - - if(iarr[0] != i){ // not expected - return false; - } - - act_flystick[i].id = iarr[0]; - act_flystick[i].quality = f; - - if(iarr[1] > vrpn_DTRACK_FLYSTICK_MAX_BUTTON){ - return false; - } - if(iarr[2] > vrpn_DTRACK_FLYSTICK_MAX_JOYSTICK){ - return false; - } - act_flystick[i].num_button = iarr[1]; - act_flystick[i].num_joystick = iarr[2]; - - if(!(s = string_get_block(s, "fff", NULL, act_flystick[i].loc))){ - return false; - } - - if(!(s = string_get_block(s, "fffffffff", NULL, act_flystick[i].rot))){ - return false; - } - - strcpy(sfmt, ""); - j = 0; - while(j < act_flystick[i].num_button){ - strcat(sfmt, "i"); - j += 32; - } - j = 0; - while(j < act_flystick[i].num_joystick){ - strcat(sfmt, "f"); - j++; - } - - if(!(s = string_get_block(s, sfmt, iarr, act_flystick[i].joystick))){ - return false; - } - - k = l = 0; - for(j=0; j<act_flystick[i].num_button; j++){ - act_flystick[i].button[j] = iarr[k] & 0x01; - iarr[k] >>= 1; - - l++; - if(l == 32){ - k++; - l = 0; - } - } - } - - continue; - } - - // line for measurement tool data: - - if(!strncmp(s, "6dmt ", 5)){ - s += 5; - - if(!(s = string_get_i(s, &n))){ // get number of calibrated measurement tools - return false; - } - - loc_num_meatool = n; - - continue; - } - - // ignore unknown line identifiers (could be valid in future DTracks) - - }while((s = string_nextline(d_udpbuf, s, d_udpbufsize)) != NULL); - - // set number of calibrated standard bodies, if necessary: - - if(loc_num_bodycal >= 0){ // '6dcal' information was available - act_num_bodycal = loc_num_bodycal - loc_num_flystick1 - loc_num_meatool; - } - - d_lasterror = DTRACK_ERR_NONE; - return true; -} - - -// --------------------------------------------------------------------------------------------------- -// --------------------------------------------------------------------------------------------------- -// Parsing DTrack data: - -// Search next line in buffer: -// str (i): buffer (total) -// start (i): start position within buffer -// len (i): buffer length in bytes -// return (i): begin of line, NULL if no new line in buffer - -static char* string_nextline(char* str, char* start, int len) -{ - char* s = start; - char* se = str + len; - int crlffound = 0; - - while(s < se){ - if(*s == '\r' || *s == '\n'){ // crlf - crlffound = 1; - }else{ - if(crlffound){ // begin of new line found - return (*s) ? s : NULL; // first character is '\0': end of buffer - } - } - - s++; - } - - return NULL; // no new line found in buffer -} - - -// Read next 'int' value from string: -// str (i): string -// i (o): read value -// return value (o): pointer behind read value in str; NULL in case of error - -static char* string_get_i(char* str, int* i) -{ - char* s; - - *i = (int )strtol(str, &s, 0); - return (s == str) ? NULL : s; -} - - -// Read next 'unsigned int' value from string: -// str (i): string -// ui (o): read value -// return value (o): pointer behind read value in str; NULL in case of error - -static char* string_get_ui(char* str, unsigned int* ui) -{ - char* s; - - *ui = (unsigned int )strtoul(str, &s, 0); - return (s == str) ? NULL : s; -} - - -// Read next 'double' value from string: -// str (i): string -// d (o): read value -// return value (o): pointer behind read value in str; NULL in case of error - -static char* string_get_d(char* str, double* d) -{ - char* s; - - *d = strtod(str, &s); - return (s == str) ? NULL : s; -} - - -// Read next 'float' value from string: -// str (i): string -// f (o): read value -// return value (o): pointer behind read value in str; NULL in case of error - -static char* string_get_f(char* str, float* f) -{ - char* s; - - *f = (float )strtod(str, &s); // strtof() only available in GNU-C - return (s == str) ? NULL : s; -} - - -// Process next block '[...]' in string: -// str (i): string -// fmt (i): format string ('i' for 'int', 'f' for 'float') -// idat (o): array for 'int' values (long enough due to fmt) -// fdat (o): array for 'float' values (long enough due to fmt) -// return value (o): pointer behind read value in str; NULL in case of error - -static char* string_get_block(char* str, const char* fmt, int* idat, float* fdat) -{ - char* strend; - int index_i, index_f; - - if((str = strchr(str, '[')) == NULL){ // search begin of block - return NULL; - } - if((strend = strchr(str, ']')) == NULL){ // search end of block - return NULL; - } - - str++; // (temporarily) remove delimiters - *strend = '\0'; - - index_i = index_f = 0; - - while(*fmt){ - switch(*fmt++){ - case 'i': - if((str = string_get_i(str, &idat[index_i++])) == NULL){ - *strend = ']'; - return NULL; - } - break; - - case 'f': - if((str = string_get_f(str, &fdat[index_f++])) == NULL){ - *strend = ']'; - return NULL; - } - break; - - default: // unknown format character - *strend = ']'; - return NULL; - } - } - - // ignore additional data inside the block - - *strend = ']'; - return strend + 1; -} - - -// --------------------------------------------------------------------------------------------------- -// --------------------------------------------------------------------------------------------------- -// Handling UDP data: - -#ifdef OS_UNIX -#define INVALID_SOCKET -1 -#endif - -// Initialize UDP socket: -// port (i): port number -// return value (o): socket number, NULL if error - -static vrpn_Tracker_DTrack::socket_type udp_init(unsigned short port) -{ - vrpn_Tracker_DTrack::socket_type sock; - struct sockaddr_in name; - - // initialize socket dll (only Windows): - -#ifdef OS_WIN - { - WORD vreq; - WSADATA wsa; - - vreq = MAKEWORD(2, 0); - - if(WSAStartup(vreq, &wsa) != 0){ - return NULL; - } - } -#endif - - // create socket: - -#ifdef OS_UNIX - { - int usock; - - usock = socket(PF_INET, SOCK_DGRAM, 0); - - if(usock < 0){ - return INVALID_SOCKET; - } - sock = usock; - } -#endif -#ifdef OS_WIN - { - SOCKET wsock; - - wsock = socket(PF_INET, SOCK_DGRAM, 0); - - if(wsock == INVALID_SOCKET){ - WSACleanup(); - return INVALID_SOCKET; - } - - sock = wsock; - } -#endif - - // name socket: - - name.sin_family = AF_INET; - name.sin_port = htons(port); - name.sin_addr.s_addr = htonl(INADDR_ANY); - - if(bind(sock, (struct sockaddr *) &name, sizeof(name)) < 0){ - udp_exit(sock); - return INVALID_SOCKET; - } - - return sock; -} - - -// Deinitialize UDP socket: -// sock (i): socket number -// return value (o): 0 ok, -1 error - -static int udp_exit(vrpn_Tracker_DTrack::socket_type sock) -{ - int err; - -#ifdef OS_UNIX - err = close(sock); -#endif -#ifdef OS_WIN - err = closesocket(sock); - WSACleanup(); -#endif - - if(err < 0){ - return -1; - } - - return 0; -} - - -// Receive UDP data: -// - tries to receive packets, as long as data are available -// sock (i): socket number -// buffer (o): buffer for UDP data -// maxlen (i): length of buffer -// tout_us (i): timeout in us (micro sec) -// return value (o): number of received bytes, <0 if error/timeout occurred - -// Don't tell us about the FD_SET causing a conditional expression to be constant -#ifdef _WIN32 -#pragma warning ( disable : 4127 ) -#endif - -static int udp_receive(vrpn_Tracker_DTrack::socket_type sock, void *buffer, int maxlen, int tout_us) -{ - int nbytes, err; - fd_set set; - struct timeval tout; - - // waiting for data: - - FD_ZERO(&set); - FD_SET(sock, &set); - - tout.tv_sec = tout_us / 1000000; - tout.tv_usec = tout_us % 1000000; - - switch((err = select(FD_SETSIZE, &set, NULL, NULL, &tout))){ - case 1: - break; // data available - case 0: - return -1; // timeout - default: - return -2; // error - } - - // receiving packet: - - while(1){ - - // receive one packet: - - nbytes = recv(sock, (char *)buffer, maxlen, 0); - - if(nbytes < 0){ // receive error - return -3; - } - - // check, if more data available: if so, receive another packet - - FD_ZERO(&set); - FD_SET(sock, &set); - - tout.tv_sec = 0; // timeout with value of zero, thus no waiting - tout.tv_usec = 0; - - if(select(FD_SETSIZE, &set, NULL, NULL, &tout) != 1){ - - // no more data available: check length of received packet and return - - if(nbytes >= maxlen){ // buffer overflow - return -4; - } - - return nbytes; - } - } -} - -#endif - diff --git a/src/vrpn/vrpn_Tracker_DTrack.h b/src/vrpn/vrpn_Tracker_DTrack.h deleted file mode 100644 index 2a701142ede08653db0f0661fc27b69facca70d7..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_DTrack.h +++ /dev/null @@ -1,186 +0,0 @@ -// vrpn_Tracker_DTrack.h -// -// Advanced Realtime Tracking GmbH's (http://www.ar-tracking.de) DTrack/DTrack2 client -// -// developed by David Nahon for Virtools VR Pack (http://www.virtools.com) -// (07/20/2004) improved by Advanced Realtime Tracking GmbH (http://www.ar-tracking.de) -// (07/02/2007, 06/29/2009) upgraded by Advanced Realtime Tracking GmbH to support new devices -// (08/25/2010) a correction added by Advanced Realtime Tracking GmbH -// (12/01/2010) support of 3dof objects added by Advanced Realtime Tracking GmbH - -#ifndef VRPN_TRACKER_DTRACK_H -#define VRPN_TRACKER_DTRACK_H - -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Shared.h" // for timeval - -class VRPN_API vrpn_Connection; -// There is a problem with linking on SGI related to the use of standard -// libraries. -#ifndef sgi - -#include <stdio.h> // for NULL -#include <vector> // for vector - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Tracker.h" // for vrpn_Tracker - - -// -------------------------------------------------------------------------- -// Data types: - -// Standard marker data (3DOF): - -typedef struct{ - int id; // id number (starting with 0) - float loc[3]; // location (in mm) -} vrpn_dtrack_marker_type; - -// Standard body data (6DOF): -// - currently not tracked bodies are getting a quality of -1 - -typedef struct{ - int id; // id number (starting with 0) - float quality; // quality (0 <= qu <= 1, no tracking if -1) - - float loc[3]; // location (in mm) - float rot[9]; // rotation matrix (column-wise) -} vrpn_dtrack_body_type; - -// A.R.T. Flystick data (6DOF + buttons): -// - currently not tracked bodies are getting a quality of -1 -// - note the maximum number of buttons and joystick values - -#define vrpn_DTRACK_FLYSTICK_MAX_BUTTON 16 // maximum number of buttons -#define vrpn_DTRACK_FLYSTICK_MAX_JOYSTICK 8 // maximum number of joystick values - -typedef struct{ - int id; // id number (starting with 0) - float quality; // quality (0 <= qu <= 1, no tracking if -1) - - int num_button; // number of buttons - int button[vrpn_DTRACK_FLYSTICK_MAX_BUTTON]; // button state (1 pressed, 0 not pressed) - // (0 front, 1..n-1 right to left) - int num_joystick; // number of joystick values - float joystick[vrpn_DTRACK_FLYSTICK_MAX_JOYSTICK]; // joystick value (-1 <= joystick <= 1) - // (0 horizontal, 1 vertical) - - float loc[3]; // location (in mm) - float rot[9]; // rotation matrix (column-wise) -} vrpn_dtrack_flystick_type; - - -// -------------------------------------------------------------------------- -// VRPN class: - -class VRPN_API vrpn_Tracker_DTrack : public vrpn_Tracker, public vrpn_Button_Filter, public vrpn_Analog -{ - - public: - -#ifdef _WIN32 - typedef SOCKET socket_type; -#else - typedef int socket_type; -#endif - -// Constructor: -// name (i): device name -// c (i): vrpn_Connection -// dtrackPort (i): DTrack UDP port -// timeToReachJoy (i): time needed to reach the maximum value of the joystick -// fixNbody, fixNflystick (i): fixed numbers of DTrack bodies and Flysticks (-1 if not wanted) -// fixId (i): renumbering of targets; must have exact (fixNbody + fixNflystick) elements (NULL if not wanted) -// act3DOFout (i): activate 3dof marker output if present -// actTracing (i): activate trace output - - vrpn_Tracker_DTrack(const char *name, vrpn_Connection *c, - int dtrackPort, float timeToReachJoy = 0.f, - int fixNbody = -1, int fixNflystick = -1, int* fixId = NULL, - bool act3DOFout = false, bool actTracing = false); - - ~vrpn_Tracker_DTrack(); - - /// This function should be called each time through the main loop - /// of the server code. It checks for a report from the tracker and - /// sends it if there is one. - - virtual void mainloop(); - - - private: - - // general: - - struct timeval tim_first; // timestamp of first frame - struct timeval tim_last; // timestamp of current frame - - bool tracing; // activate debug output - unsigned int tracing_frames; // frame counter for debug output - - // DTrack data: - - bool use_fix_numbering; // use fixed numbers of standard bodies and Flysticks - - int fix_nbody; // fixed number of standard bodies - int fix_nflystick; // fixed number of Flysticks - - std::vector<int> fix_idbody; // fixed vrpn standard body IDs - std::vector<int> fix_idflystick; // fixed vrpn Flystick IDs - - bool warning_nbodycal; // already warned cause of missing '6dcal' data - - // preparing data for VRPN: - // these functions convert DTrack data to vrpn data - - std::vector<bool> joy_simulate; // simulate time varying floating values - std::vector<float> joy_last; // current value of 'joystick' channel (hor, ver) - float joy_incPerSec; // increase of 'joystick' channel (in 1/sec) - - int dtrack2vrpn_marker(int id, const char* str_dtrack, int id_dtrack, - const float* loc, struct timeval timestamp); - int dtrack2vrpn_body(int id, const char* str_dtrack, int id_dtrack, - const float* loc, const float* rot, struct timeval timestamp); - int dtrack2vrpn_flystickbuttons(int id, int id_dtrack, - int num_but, const int* but, struct timeval timestamp); - int dtrack2vrpn_flystickanalogs(int id, int id_dtrack, - int num_ana, const float* ana, float dt, struct timeval timestamp); - - // communicating with DTrack: - // these functions receive and parse data packets from DTrack - - socket_type d_udpsock; // socket number for UDP - int d_udptimeout_us; // timeout for receiving UDP data - - int d_udpbufsize; // size of UDP buffer - char* d_udpbuf; // UDP buffer - - unsigned int act_framecounter; // frame counter - double act_timestamp; // time stamp - - bool output_3dof_marker; // 3dof marker output if available - int act_num_marker; // number of 3dof marker (due to '3d' line) - std::vector<vrpn_dtrack_marker_type> act_marker; // array containing 3dof marker data - - int act_num_body; // number of calibrated standard bodies (due to '6d' line) - std::vector<vrpn_dtrack_body_type> act_body; // array containing standard body data - bool act_has_bodycal_format; // DTrack sent '6dcal' format - int act_num_bodycal; // number of calibrated standard bodies (due to '6dcal' line) - - int act_num_flystick; // number of calibrated Flysticks - std::vector<vrpn_dtrack_flystick_type> act_flystick; // array containing Flystick data - bool act_has_old_flystick_format; // DTrack uses old Flystick format - - int d_lasterror; // last receive error - - bool dtrack_init(int udpport); - bool dtrack_exit(void); - - bool dtrack_receive(void); -}; - -#endif - -#endif - diff --git a/src/vrpn/vrpn_Tracker_Fastrak.C b/src/vrpn/vrpn_Tracker_Fastrak.C deleted file mode 100644 index f43acf8e3f1084373da65fe7e69dc8ff6265adac..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_Fastrak.C +++ /dev/null @@ -1,787 +0,0 @@ -// vrpn_Tracker_Fastrak.C -// This file contains the code to operate a Polhemus Fastrak Tracker. -// This file is based on the vrpn_3Space.C file, with modifications made -// to allow it to operate a Fastrak instead. The modifications are based -// on the old version of the Fastrak driver, which had been mainly copied -// from the Trackerlib driver and was very difficult to understand. -// This version was written in the Summer of 1999 by Russ Taylor. -// Modifications were made to this version to allow it to run the -// Intersense IS600 tracker; basically, this involved allowing the user -// to set extra things in the reset routine, and to pause to let the tracker -// handle the parameter-setting commands. -// Modifications were later made to support the IS-900 trackers, -// including wands and styli. - -#include <ctype.h> // for isprint, isalpha -#include <stdio.h> // for fprintf, sprintf, stderr, etc -#include <stdlib.h> // for atoi -#include <string.h> // for strlen, strncpy, strtok - -#include "quat.h" // for Q_W, Q_X, Q_Y, Q_Z -#include "vrpn_Analog.h" // for vrpn_Clipping_Analog_Server -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR, etc -#include "vrpn_Button.h" // for vrpn_Button_Server -#include "vrpn_Connection.h" // for vrpn_Connection -#include "vrpn_Serial.h" // for vrpn_write_characters, etc -#include "vrpn_Shared.h" // for vrpn_SleepMsecs, timeval, etc -#include "vrpn_Tracker.h" // for vrpn_TRACKER_FAIL, etc -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR -#include "vrpn_Tracker_Fastrak.h" - -#define INCHES_TO_METERS (2.54/100.0) - -vrpn_Tracker_Fastrak::vrpn_Tracker_Fastrak(const char *name, vrpn_Connection *c, - const char *port, long baud, int enable_filtering, int numstations, - const char *additional_reset_commands, int is900_timestamps) : - vrpn_Tracker_Serial(name,c,port,baud), - do_filter(enable_filtering), - num_stations(numstations>vrpn_FASTRAK_MAX_STATIONS ? vrpn_FASTRAK_MAX_STATIONS : numstations), - do_is900_timestamps(is900_timestamps), - num_resets(0) -{ - int i; - - reset_time.tv_sec = reset_time.tv_usec = 0; - if (additional_reset_commands == NULL) { - sprintf(add_reset_cmd, ""); - } else { - strncpy(add_reset_cmd, additional_reset_commands, sizeof(add_reset_cmd)-1); - } - - // Initially, set to no buttons or analogs on the stations. The - // methods to add buttons and analogs must be called to add them. - for (i = 0; i < num_stations; i++) { - is900_buttons[i] = NULL; - is900_analogs[i] = NULL; - } - - // Let me assume I am an Intersense till proven false, - // by an instance of a fastrak-only command like "FTStylus" - // in the initialization strings. - really_fastrak = false; -} - -vrpn_Tracker_Fastrak::~vrpn_Tracker_Fastrak() -{ - int i; - - // Delete any button and analog devices that were created - for (i = 0; i < num_stations; i++) { - if (is900_buttons[i]) { - delete is900_buttons[i]; - } - if (is900_analogs[i]) { - delete is900_analogs[i]; - } - } -} - -/** This routine augments the basic sensor-output setting function of the Fastrak - to allow the possibility of requesting timestamp, button data, and/or analog - data from the device. It sets the device for position + quaternion + any of - the extended fields. It puts a space at the end so that we can check to make - sure we have complete good records for each report. - - Returns 0 on success and -1 on failure. -*/ - -int vrpn_Tracker_Fastrak::set_sensor_output_format(int sensor) -{ - char outstring[64]; - const char *timestring; - const char *buttonstring; - const char *analogstring; - - // Set output format for the station to be position and quaternion, - // and any of the extended Fastrak (stylus with button) or - // IS900 states (timestamp, button, analog). - // This command is a capitol 'o' followed by the number of the - // station, then comma-separated values (2 for xyz, 11 for quat, 21 for - // timestamp, 22 for buttons, 16 for Fastrak stylus button, - // 23 for joystick, 0 for space) that - // indicate data sets, followed by character 13 (octal 15). - // Note that the sensor number has to be bumped to map to station number. - - timestring = do_is900_timestamps ? ",21" : ""; - if (really_fastrak) { - buttonstring = is900_buttons[sensor] ? ",16" : ""; - } else { - buttonstring = is900_buttons[sensor] ? ",22" : ""; - } - analogstring = is900_analogs[sensor] ? ",23" : ""; - sprintf(outstring, "O%d,2,11%s%s%s,0\015", sensor+1, timestring, - buttonstring, analogstring); - if (vrpn_write_characters(serial_fd, (const unsigned char *)outstring, - strlen(outstring)) == (int)strlen(outstring)) { - vrpn_SleepMsecs(50); // Sleep for a bit to let command run - } else { - VRPN_MSG_ERROR("Write failed on format command"); - status = vrpn_TRACKER_FAIL; - return -1; - } - - return 0; -} - -/** This routine augments the standard Fastrak report (3 initial characters + - 3*4 for position + 4*4 for quaternions) to include the timestamp, button - or analog response, if any, for the given sensor. - - It returns the number of characters total to expect for a report for the - given sensor. -*/ - -int vrpn_Tracker_Fastrak::report_length(int sensor) -{ - int len; - - len = 4; // Basic report, "0" plus Fastrak station char + status char + space at the end - len += 3*4; // Four bytes/float, 3 floats for position - len += 4*4; // Four bytes/float, 4 floats for quaternion - - // Add in the timestamp (4 bytes of float) if it is present - if (do_is900_timestamps) { - len += 4; - } - - // Add in the buttons (1 byte for IS900, 2 for Fastrak) if present - if (is900_buttons[sensor]) { - if (really_fastrak) { - len += 2; - } else { - len += 1; - } - } - - // Add in the joystick (one byte each for two values) if present - if (is900_analogs[sensor]) { - len += 2*1; - } - - return len; -} - -// This routine will reset the tracker and set it to generate the types -// of reports we want. It relies on the power-on configuration to set the -// active sensors based on the 'Rcvr Select Switch', as described on page -// 128 of the Fastrak manual printed November 1993. - -void vrpn_Tracker_Fastrak::reset() -{ - int i,resetLen,ret; - unsigned char reset[10]; - char errmsg[512]; - - //-------------------------------------------------------------------- - // This section deals with resetting the tracker to its default state. - // Multiple attempts are made to reset, getting more aggressive each - // time. This section completes when the tracker reports a valid status - // message after the reset has completed. - //-------------------------------------------------------------------- - - // Send the tracker a string that should reset it. The first time we - // try this, just do the normal 'c' command to put it into polled mode. - // after a few tries with this, use the ^Y reset. Later, try to reset - // to the factory defaults. Then toggle the extended mode. - // Then put in a carriage return to try and break it out of - // a query mode if it is in one. These additions are cumulative: by the - // end, we're doing them all. - resetLen = 0; - num_resets++; // We're trying another reset - if (num_resets > 1) { // Try to get it out of a query loop if its in one - reset[resetLen++] = (unsigned char) (13); // Return key -> get ready - } - if (num_resets > 5) { - reset[resetLen++] = 'Y'; // Put tracker into tracking (not point) mode - } - if (num_resets > 4) { // Even more aggressive - reset[resetLen++] = 't'; // Toggle extended mode (in case it is on) - } - /* XXX These commands are probably never needed, and can cause real - headaches for people who are keeping state in their trackers (especially - the InterSense trackers). Taking them out in version 05.01; you can put - them back in if your tracker isn't resetting as well. - if (num_resets > 3) { // Get a little more aggressive - reset[resetLen++] = 'W'; // Reset to factory defaults - reset[resetLen++] = (unsigned char) (11); // Ctrl + k --> Burn settings into EPROM - } - */ - if (num_resets > 2) { - reset[resetLen++] = (unsigned char) (25); // Ctrl + Y -> reset the tracker - } - reset[resetLen++] = 'c'; // Put it into polled (not continuous) mode - - sprintf(errmsg, "Resetting the tracker (attempt %d)", num_resets); - VRPN_MSG_WARNING(errmsg); - for (i = 0; i < resetLen; i++) { - if (vrpn_write_characters(serial_fd, &reset[i], 1) == 1) { - fprintf(stderr,"."); - vrpn_SleepMsecs(1000.0*2); // Wait after each character to give it time to respond - } else { - perror("Fastrak: Failed writing to tracker"); - status = vrpn_TRACKER_FAIL; - return; - } - } - //XXX Take out the sleep and make it keep spinning quickly - // You only need to sleep 10 seconds for an actual Fastrak. - // For the Intersense trackers, you need to sleep 20. So, - // sleeping 20 is the more general solution... - if (num_resets > 2) { - vrpn_SleepMsecs(1000.0*20); // Sleep to let the reset happen, if we're doing ^Y - } - - fprintf(stderr,"\n"); - - // Get rid of the characters left over from before the reset - vrpn_flush_input_buffer(serial_fd); - - // Make sure that the tracker has stopped sending characters - vrpn_SleepMsecs(1000.0*2); - unsigned char scrap[80]; - if ( (ret = vrpn_read_available_characters(serial_fd, scrap, 80)) != 0) { - sprintf(errmsg,"Got >=%d characters after reset",ret); - VRPN_MSG_WARNING(errmsg); - for (i = 0; i < ret; i++) { - if (isprint(scrap[i])) { - fprintf(stderr,"%c",scrap[i]); - } else { - fprintf(stderr,"[0x%02X]",scrap[i]); - } - } - fprintf(stderr, "\n"); - vrpn_flush_input_buffer(serial_fd); // Flush what's left - } - - // Asking for tracker status - if (vrpn_write_characters(serial_fd, (const unsigned char *) "S", 1) == 1) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" Fastrak write failed"); - status = vrpn_TRACKER_FAIL; - return; - } - - // Read Status - unsigned char statusmsg[56]; - - // Attempt to read 55 characters. For some reason, later versions of the - // InterSense IS900 only report a 54-character status message. If this - // happens, handle it. - ret = vrpn_read_available_characters(serial_fd, statusmsg, 55); - if ( (ret != 55) && (ret != 54) ) { - fprintf(stderr, - " Got %d of 55 characters for status (54 expected for IS900)\n",ret); - } - if ( (statusmsg[0]!='2') || (statusmsg[ret-1]!=(char)(10)) ) { - int i; - statusmsg[55] = '\0'; // Null-terminate the string - fprintf(stderr, " Fastrak: status is ("); - for (i = 0; i < ret; i++) { - if (isprint(statusmsg[i])) { - fprintf(stderr,"%c",statusmsg[i]); - } else { - fprintf(stderr,"[0x%02X]",statusmsg[i]); - } - } - fprintf(stderr,"\n)\n"); - VRPN_MSG_ERROR("Bad status report from Fastrak, retrying reset"); - return; - } else { - VRPN_MSG_WARNING("Fastrak/Isense gives status (this is good)"); - num_resets = 0; // Success, use simple reset next time - } - - //-------------------------------------------------------------------- - // Now that the tracker has given a valid status report, set all of - // the parameters the way we want them. We rely on power-up setting - // based on the receiver select switches to turn on the receivers that - // the user wants. - //-------------------------------------------------------------------- - - // Set output format for each of the possible stations. - - for (i = 0; i < num_stations; i++) { - if (set_sensor_output_format(i)) { - return; - } - } - - if (really_fastrak) { - char outstring[64]; - sprintf(outstring, "e1,0\r"); - if (vrpn_write_characters(serial_fd, (const unsigned char *)outstring, - strlen(outstring)) == (int)strlen(outstring)) { - vrpn_SleepMsecs(50); // Sleep for a bit to let command run - } else { - VRPN_MSG_ERROR("Write failed on mouse format command"); - status = vrpn_TRACKER_FAIL; - } - } - - // Enable filtering if the constructor parameter said to. - // Set filtering for both position (x command) and orientation (v command) - // to the values that are recommended as a "jumping off point" in the - // Fastrak manual. - - if (do_filter) { - if (vrpn_write_characters(serial_fd, - (const unsigned char *)"x0.2,0.2,0.8,0.8\015", 17) == 17) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" Fastrak write position filter failed"); - status = vrpn_TRACKER_FAIL; - return; - } - if (vrpn_write_characters(serial_fd, - (const unsigned char *)"v0.2,0.2,0.8,0.8\015", 17) == 17) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" Fastrak write orientation filter failed"); - status = vrpn_TRACKER_FAIL; - return; - } - } - - // Send the additional reset commands, if any, to the tracker. - // These commands come in lines, with character \015 ending each - // line. If a line start with an asterisk (*), treat it as a pause - // command, with the number of seconds to wait coming right after - // the asterisk. Otherwise, the line is sent directly to the tracker. - // Wait a while for them to take effect, then clear the input - // buffer. - if (strlen(add_reset_cmd) > 0) { - char *next_line; - char add_cmd_copy[sizeof(add_reset_cmd)+1]; - char string_to_send[sizeof(add_reset_cmd)+1]; - int seconds_to_wait; - - printf(" Fastrak writing extended reset commands...\n"); - - // Make a copy of the additional reset string, since it is consumed - strncpy(add_cmd_copy, add_reset_cmd, sizeof(add_cmd_copy)); - add_cmd_copy[sizeof(add_cmd_copy)-1] = '\0'; - - // Pass through the string, testing each line to see if it is - // a sleep command or a line to send to the tracker. Continue until - // there are no more line delimiters ('\015'). Be sure to write the - // \015 to the end of the string sent to the tracker. - // Note that strok() puts a NULL character in place of the delimiter. - - next_line = strtok(add_cmd_copy, "\015"); - while (next_line != NULL) { - if (next_line[0] == '*') { // This is a "sleep" line, see how long - seconds_to_wait = atoi(&next_line[1]); - fprintf(stderr," ...sleeping %d seconds\n",seconds_to_wait); - vrpn_SleepMsecs(1000.0*seconds_to_wait); - } else { // This is a command line, send it - sprintf(string_to_send, "%s\015", next_line); - fprintf(stderr, " ...sending command: %s\n", string_to_send); - vrpn_write_characters(serial_fd, - (const unsigned char *)string_to_send,strlen(string_to_send)); - } - next_line = strtok(next_line+strlen(next_line)+1, "\015"); - } - - // Sleep a little while to let this finish, then clear the input buffer - vrpn_SleepMsecs(1000.0*2); - vrpn_flush_input_buffer(serial_fd); - } - - // Set data format to BINARY mode - vrpn_write_characters(serial_fd, (const unsigned char *)"f", 1); - - // Set tracker to continuous mode - if (vrpn_write_characters(serial_fd,(const unsigned char *) "C", 1) != 1) { - perror(" Fastrak write failed"); - status = vrpn_TRACKER_FAIL; - return; - } else { - fprintf(stderr, " Fastrak set to continuous mode\n"); - } - - // If we are using the IS-900 timestamps, clear the timer on the device and - // store the time when we cleared it. First, drain any characters in the output - // buffer to ensure we're sending right away. Then, send the reset command and - // store the time that we sent it, plus the estimated time for the characters to - // get across the serial line to the device at the current baud rate. - // Set time units to milliseconds (MT) and reset the time (MZ). - if (do_is900_timestamps) { - char clear_timestamp_cmd[] = "MT\015MZ\015"; - - vrpn_drain_output_buffer(serial_fd); - - if (vrpn_write_characters(serial_fd, (const unsigned char *)clear_timestamp_cmd, - strlen(clear_timestamp_cmd)) != (int)strlen(clear_timestamp_cmd)) { - VRPN_MSG_ERROR("Cannot send command to clear timestamp"); - status = vrpn_TRACKER_FAIL; - return; - } - - // Drain the output buffer again, then record the time as the base time from - // the tracker. - vrpn_drain_output_buffer(serial_fd); - vrpn_gettimeofday(&is900_zerotime, NULL); - } - - // Done with reset. - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - VRPN_MSG_WARNING("Reset Completed (this is good)"); - status = vrpn_TRACKER_SYNCING; // We're trying for a new reading -} - -// This function will read characters until it has a full report, then -// put that report into the time, sensor, pos and quat fields so that it can -// be sent the next time through the loop. The time stored is that of -// the first character received as part of the report. Reports start with -// the header "0xy", where x is the station number and y is either the -// space character or else one of the characters "A-F". Characters "A-F" -// indicate weak signals and so forth, but in practice it is much harder -// to deal with them than to ignore them (they don't indicate hard error -// conditions). The report follows, 4 bytes per word in little-endian byte -// order; each word is an IEEE floating-point binary value. The first three -// are position in X,Y and Z. The next four are the unit quaternion in the -// order W, X,Y,Z. There are some optional fields for the Intersense 900 -// tracker, then there is an ASCII space character at the end. -// If we get a report that is not valid, we assume that we have lost a -// character or something and re-synchronize with the Fastrak by waiting -// until the start-of-report character ('0') comes around again. -// The routine that calls this one makes sure we get a full reading often -// enough (ie, it is responsible for doing the watchdog timing to make sure -// the tracker hasn't simply stopped sending characters). - -int vrpn_Tracker_Fastrak::get_report(void) -{ - char errmsg[512]; // Error message to send to VRPN - int ret; // Return value from function call to be checked - int i; // Loop counter - unsigned char *bufptr; // Points into buffer at the current value to read - - //-------------------------------------------------------------------- - // Each report starts with an ASCII '0' character. If we're synching, - // read a byte at a time until we find a '0' character. - //-------------------------------------------------------------------- - - if (status == vrpn_TRACKER_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, buffer, 1) != 1) { - return 0; - } - - // If it is not an '0', we don't want it but we - // need to look at the next one, so just return and stay - // in Syncing mode so that we will try again next time through. - // Also, flush the buffer so that it won't take as long to catch up. - if ( buffer[0] != '0') { - sprintf(errmsg,"While syncing (looking for '0', " - "got '%c')", buffer[0]); - VRPN_MSG_INFO(errmsg); - vrpn_flush_input_buffer(serial_fd); - return 0; - } - - // Got the first character of a report -- go into AWAITING_STATION mode - // and record that we got one character at this time. The next - // bit of code will attempt to read the station. - // The time stored here is as close as possible to when the - // report was generated. For the InterSense 900 in timestamp - // mode, this value will be overwritten later. - bufcount = 1; - vrpn_gettimeofday(×tamp, NULL); - status = vrpn_TRACKER_AWAITING_STATION; - } - - //-------------------------------------------------------------------- - // The second character of each report is the station number. Once - // we know this, we can compute how long the report should be for the - // given station, based on what values are in its report. - // The station number is converted into a VRPN sensor number, where - // the first Fastrak station is '1' and the first VRPN sensor is 0. - //-------------------------------------------------------------------- - - if (status == vrpn_TRACKER_AWAITING_STATION) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, &buffer[bufcount], 1) != 1) { - return 0; - } - - d_sensor = buffer[1] - '1'; // Convert ASCII 1 to sensor 0 and so on. - if ( (d_sensor < 0) || (d_sensor >= num_stations) ) { - status = vrpn_TRACKER_SYNCING; - sprintf(errmsg,"Bad sensor # (%d) in record, re-syncing", d_sensor); - VRPN_MSG_INFO(errmsg); - vrpn_flush_input_buffer(serial_fd); - return 0; - } - - // Figure out how long the current report should be based on the - // settings for this sensor. - REPORT_LEN = report_length(d_sensor); - - // Got the station report -- to into PARTIAL mode and record - // that we got one character at this time. The next bit of code - // will attempt to read the rest of the report. - bufcount++; - status = vrpn_TRACKER_PARTIAL; - } - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. The routine that calls this one - // makes sure we get a full reading often enough (ie, it is responsible - // for doing the watchdog timing to make sure the tracker hasn't simply - // stopped sending characters). - //-------------------------------------------------------------------- - - ret = vrpn_read_available_characters(serial_fd, &buffer[bufcount], - REPORT_LEN-bufcount); - if (ret == -1) { - VRPN_MSG_ERROR("Error reading report"); - status = vrpn_TRACKER_FAIL; - return 0; - } - bufcount += ret; - if (bufcount < REPORT_LEN) { // Not done -- go back for more - return 0; - } - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. Check to make - // sure that its format matches what we expect. If it does, the next - // section will parse it. If it does not, we need to go back into - // synch mode and ignore this report. A well-formed report has the - // first character '0', the next character is the ASCII station - // number, and the third character is either a space or a letter. - //-------------------------------------------------------------------- - - if (buffer[0] != '0') { - status = vrpn_TRACKER_SYNCING; - VRPN_MSG_INFO("Not '0' in record, re-syncing"); - vrpn_flush_input_buffer(serial_fd); - return 0; - } - // Sensor checking was handled when we received the character for it - if ( (buffer[2] != ' ') && !isalpha(buffer[2]) ) { - status = vrpn_TRACKER_SYNCING; - VRPN_MSG_INFO("Bad 3rd char in record, re-syncing"); - vrpn_flush_input_buffer(serial_fd); - return 0; - } - if (buffer[bufcount-1] != ' ') { - status = vrpn_TRACKER_SYNCING; - VRPN_MSG_INFO("No space character at end of report, re-syncing"); - vrpn_flush_input_buffer(serial_fd); - return 0; - } - - //-------------------------------------------------------------------- - // Decode the X,Y,Z of the position and the W,X,Y,Z of the quaternion - // (keeping in mind that we store quaternions as X,Y,Z, W). - //-------------------------------------------------------------------- - // The reports coming from the Fastrak are in little-endian order, - // which is the opposite of the network-standard byte order that is - // used by VRPN. Here we swap the order to big-endian so that the - // routines below can pull out the values in the correct order. - // This is slightly inefficient on machines that have little-endian - // order to start with, since it means swapping the values twice, but - // that is more than outweighed by the cleanliness gained by keeping - // all architecture-dependent code in the vrpn_Shared.C file. - //-------------------------------------------------------------------- - - // Point at the first value in the buffer (position of the X value) - bufptr = &buffer[3]; - - // When copying the positions, convert from inches to meters, since the - // Fastrak reports in inches and VRPN reports in meters. - pos[0] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr) * INCHES_TO_METERS; - pos[1] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr) * INCHES_TO_METERS; - pos[2] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr) * INCHES_TO_METERS; - - // Change the order of the quaternion fields to match quatlib order - d_quat[Q_W] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - d_quat[Q_X] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - d_quat[Q_Y] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - d_quat[Q_Z] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - - //-------------------------------------------------------------------- - // If we are doing IS900 timestamps, decode the time, add it to the - // time we zeroed the tracker, and update the report time. Remember - // to convert the MILLIseconds from the report into MICROseconds and - // seconds. - //-------------------------------------------------------------------- - - if (do_is900_timestamps) { - struct timeval delta_time; // Time since the clock was reset - - // Read the floating-point value of the time from the record. - vrpn_float32 read_time = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - - // Convert from the float in MILLIseconds to the struct timeval - delta_time.tv_sec = (long)(read_time / 1000); // Integer trunction to seconds - read_time -= delta_time.tv_sec * 1000; // Subtract out what we just counted - delta_time.tv_usec = (long)(read_time * 1000); // Convert remainder to MICROseconds - - // Store the current time - timestamp = vrpn_TimevalSum(is900_zerotime, delta_time); - } - - //-------------------------------------------------------------------- - // If this sensor has an IS900 button or fastrak button on it, decode - // the button values into the button device and mainloop the button - // device so that it will report any changes. Each button is stored - // in one bit of the byte, with the lowest-numbered button in the - // lowest bit. - //-------------------------------------------------------------------- - - if (is900_buttons[d_sensor]) { - // the following section was modified by Debug to add support for Fastrak stylus button - int value; - if (really_fastrak) { - value=*(++bufptr)-'0'; // only one button, status in ASCII, skip over space - is900_buttons[d_sensor]->set_button(0, value); - } else {// potentially multiple buttons, values encoded in binary as a bit field - for (i = 0; i < is900_buttons[d_sensor]->number_of_buttons(); i++) { - value = ( (*bufptr) >> i) & 1; - is900_buttons[d_sensor]->set_button(i, value); - } - } - is900_buttons[d_sensor]->mainloop(); - - bufptr++; - } - - //-------------------------------------------------------------------- - // If this sensor has an IS900 analog on it, decode the analog values - // into the analog device and mainloop the analog device so that it - // will report any changes. The first byte holds the unsigned char - // representation of left/right. The second holds up/down. For each, - // 0 means min (left or rear), 127 means center and 255 means max. - //-------------------------------------------------------------------- - - if (is900_analogs[d_sensor]) { - - // Read the raw values for the left/right and top/bottom channels - unsigned char raw_lr = *bufptr; - bufptr++; - unsigned char raw_tb = *bufptr; - bufptr++; - - // Normalize the values to the range -1 to 1 - is900_analogs[d_sensor]->setChannelValue(0, (raw_lr - 127) / 128.0); - is900_analogs[d_sensor]->setChannelValue(1, (raw_tb - 127) / 128.0); - - // Report the new values - is900_analogs[d_sensor]->report_changes(); - is900_analogs[d_sensor]->mainloop(); - } - - //-------------------------------------------------------------------- - // Done with the decoding, set the report to ready - //-------------------------------------------------------------------- - - status = vrpn_TRACKER_SYNCING; - bufcount = 0; - -#ifdef VERBOSE2 - print_latest_report(); -#endif - - return 1; -} - - -/** This function indicates to the driver that there is some sort of InterSense IS-900- - compatible button device attached to the port (either a Wand or a Stylus). The driver - will configure the device to send reports when buttons are pressed and released. - - This routine returns 0 on success and -1 on failure (due to the sensor number being too - large or errors writing to the device or can't create the button). -*/ - -int vrpn_Tracker_Fastrak::add_is900_button(const char *button_device_name, int sensor, int numbuttons) -{ - // Make sure this is a valid sensor - if ( (sensor < 0) || (sensor >= num_stations) ) { - return -1; - } - - // Add a new button device and set the pointer to point at it. - is900_buttons[sensor] = new vrpn_Button_Server(button_device_name, d_connection, numbuttons); - if (is900_buttons[sensor] == NULL) { - VRPN_MSG_ERROR("Cannot open button device"); - return -1; - } - - // Send a new station-format command to the tracker so it will report the button states. - return set_sensor_output_format(sensor); -} - -// this routine is called when an "FTStylus" button is encountered by the tracker init string parser -// it sets up the VRPN button device & enables the switch "really_fastrak" that affects subsequent interpretation -// of button readings - Debug -int vrpn_Tracker_Fastrak::add_fastrak_stylus_button(const char *button_device_name, int sensor, int numbuttons) -{ - // Make sure this is a valid sensor - if ( (sensor < 0) || (sensor >= num_stations) ) { - return -1; - } - - // Add a new button device and set the pointer to point at it. - is900_buttons[sensor] = new vrpn_Button_Server(button_device_name, d_connection, numbuttons); - if (is900_buttons[sensor] == NULL) { - VRPN_MSG_ERROR("Cannot open button device"); - return -1; - } - - // Debug's HACK here. Make sure it knows that it is a plain vanilla fastrak, so it will - // get the button output parameters right. - really_fastrak=true; - - // Send a new station-format command to the tracker so it will report the button states. - return set_sensor_output_format(sensor); -} - - -/** This function indicates to the driver that there is an InterSense IS-900- - compatible joystick device attached to the port (a Wand). The driver - will configure the device to send reports indicating the current status of the - analogs when they change. Note that a separate call to add_is900_button must - be made in order to enable the buttons on the wand: this routine only handles - the analog channels. - - The c0 and c1 parameters specify the clipping and scaling to take the reports - from the two joystick axes into the range [-1..1]. The default is unscaled. - - This routine returns 0 on success and -1 on failure (due to the sensor number being too - large or errors writing to the device or can't create the analog). -*/ - -int vrpn_Tracker_Fastrak::add_is900_analog(const char *analog_device_name, int sensor, - double c0Min, double c0Low, double c0Hi, double c0Max, - double c1Min, double c1Low, double c1Hi, double c1Max) -{ - // Make sure this is a valid sensor - if ( (sensor < 0) || (sensor >= num_stations) ) { - return -1; - } - - // Add a new analog device and set the pointer to point at it. - is900_analogs[sensor] = new vrpn_Clipping_Analog_Server(analog_device_name, d_connection); - if (is900_analogs[sensor] == NULL) { - VRPN_MSG_ERROR("Cannot open analog device"); - return -1; - } - - // Set the analog to have two channels, and set its channels to 0 to start with - is900_analogs[sensor]->setNumChannels(2); - is900_analogs[sensor]->setChannelValue(0, 0.0); - is900_analogs[sensor]->setChannelValue(1, 0.0); - - // Set the scaling on the two channels. - is900_analogs[sensor]->setClipValues(0, c0Min, c0Low, c0Hi, c0Max); - is900_analogs[sensor]->setClipValues(1, c1Min, c1Low, c1Hi, c1Max); - - // Send a new station-format command to the tracker so it will report the analog status - return set_sensor_output_format(sensor); -} diff --git a/src/vrpn/vrpn_Tracker_Fastrak.h b/src/vrpn/vrpn_Tracker_Fastrak.h deleted file mode 100644 index 29ad3a20f80a60dc7be98bee30faa889ad7468a9..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_Fastrak.h +++ /dev/null @@ -1,101 +0,0 @@ -// vrpn_Tracker_Fastrak.h -// This file contains the class header for a Polhemus Fastrak Tracker. -// This file is based on the vrpn_3Space.h file, with modifications made -// to allow it to operate a Fastrak instead. The modifications are based -// on the old version of the Fastrak driver, which had been mainly copied -// from the Trackerlib driver and was very difficult to understand. -// This version was written in the Summer of 1999 by Russ Taylor. -// Later, it was updated to allow the extended reset commands needed -// to drive an IS-600 tracker. -// Later (Summer of 2000), it was augmented to allow the button, analog, -// and timestamp capabilities of the InterSense IS-900 tracker. - -#ifndef VRPN_TRACKER_FASTRAK_H -#define VRPN_TRACKER_FASTRAK_H - -#include <stdio.h> // for NULL - -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker_Serial -#include "vrpn_Types.h" // for vrpn_uint32 - -class VRPN_API vrpn_Button_Server; -class VRPN_API vrpn_Clipping_Analog_Server; -class VRPN_API vrpn_Connection; - -const int vrpn_FASTRAK_MAX_STATIONS = 4; //< How many stations can exist - -class VRPN_API vrpn_Tracker_Fastrak: public vrpn_Tracker_Serial { - - public: - - /// The constructor is given the name of the tracker (the name of - /// the sender it should use), the connection on which it is to - /// send its messages, the name of the serial port it is to open - /// (default is /dev/ttyS1 (first serial port in Linux)), the baud - /// rate at which it is to communicate (default 19200), whether - /// filtering is enabled (default yes), and the number of stations - /// that are possible on this Fastrak (default 4). The station select - /// switches on the front of the Fastrak determine which stations are - /// active. The final parameter is a string that can contain additional - /// commands that are set to the tracker as part of its reset routine. - /// These might be used to set the hemisphere or other things that are - /// not normally included; see the Fastrak manual for a list of these. - /// There can be multiple lines of them but putting <CR> into the string. - - vrpn_Tracker_Fastrak(const char *name, vrpn_Connection *c, - const char *port = "/dev/ttyS1", long baud = 19200, - int enable_filtering = 1, int numstations = vrpn_FASTRAK_MAX_STATIONS, - const char *additional_reset_commands = NULL, - int is900_timestamps = 0); - - ~vrpn_Tracker_Fastrak(); - - // is the version modified (debug@cs.unc.edu, 5/20/01) to handle Pol.Fastrak stylus buttons - int add_fastrak_stylus_button(const char *button_device_name, - int sensor, int numbuttons = 1); - - /// Add an IS900 button device to one of the sensors - /// This allows configuration of an InterSense IS-900 - int add_is900_button(const char *button_device_name, int sensor, int numbuttons = 5); - - /// Add the analog part of an IS900 joystick device to one of the sensors - /// This allows configuration of an InterSense IS-900 - /// The optional parameters specify the clipping and scaling to take the reports - /// from the two joystick axes into the range [-1..1]. The default is unscaled. - int add_is900_analog(const char *analog_device_name, int sensor, - double c0Min = -1, double c0Low = 0, double c0Hi = 0, double c0Max = 1, - double c1Min = -1, double c1Low = 0, double c1Hi = 0, double c1Max = 1); - - protected: - - virtual int get_report(void); - virtual void reset(); - - struct timeval reset_time; - int do_filter; //< Should we turn on filtering for pos/orient? - int num_stations; //< How many stations maximum on this Fastrak? - char add_reset_cmd[2048]; //< Additional reset commands to be sent - int num_resets; //< How many resets we have tried. - - // another modification by Debug, 5/23/01 - bool really_fastrak; // to distinguish it from intersense when using buttons!!! - - // The following members provide support for the InterSense IS-900 features - // that are beyond the standard Fastrak features. - - int do_is900_timestamps; //< Request and process IS-900 timestamps? - struct timeval is900_zerotime; //< When the IS-900 time counter was zeroed - vrpn_Button_Server *is900_buttons[vrpn_FASTRAK_MAX_STATIONS]; //< Pointer to button on each sensor (NULL if none) - vrpn_Clipping_Analog_Server *is900_analogs[vrpn_FASTRAK_MAX_STATIONS]; //< Pointer to analog on each sensor (NULL if none) - vrpn_uint32 REPORT_LEN; //< The length that the current report should be - - /// Augments the basic Fastrak format to include IS900 features if needed - int set_sensor_output_format(int sensor); - - /// Augments the basic Fastrak report length to include IS900 features if needed - int report_length(int sensor); -}; - -#endif diff --git a/src/vrpn/vrpn_Tracker_Filter.C b/src/vrpn/vrpn_Tracker_Filter.C deleted file mode 100644 index 61c1f6f3c11bbac75e1fa4293b2fa9d8a93a16fd..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_Filter.C +++ /dev/null @@ -1,121 +0,0 @@ -// Internal Includes -#include "vrpn_Tracker_Filter.h" - -#include "vrpn_HumanInterface.h" // for vrpn_HidInterface, etc -#include "vrpn_OneEuroFilter.h" // for OneEuroFilterQuat, etc -#include "vrpn_SendTextMessageStreamProxy.h" // for operator<<, etc - -// Library/third-party includes -// - none - -// Standard includes -#include <sstream> // for operator<<, basic_ostream, etc -#include <string> // for char_traits, basic_string, etc -#include <stddef.h> // for size_t -#include <stdio.h> // for fprintf, NULL, stderr -#include <string.h> // for memset - -void VRPN_CALLBACK vrpn_Tracker_FilterOneEuro::handle_tracker_update(void *userdata, const vrpn_TRACKERCB info) -{ - // Get pointer to the object we're dealing with. - vrpn_Tracker_FilterOneEuro *me = static_cast<vrpn_Tracker_FilterOneEuro *>(userdata); - - // See if this sensor is within our range. If not, we ignore it. - if (info.sensor >= me->d_channels) { - return; - } - - // Filter the position and orientation and then report the filtered value - // for this channel. Keep track of the delta-time, and update our current - // time so we get the right one next time. - double dt = vrpn_TimevalDurationSeconds(info.msg_time, me->d_last_report_times[info.sensor]); - if (dt <= 0) { dt = 1; } // Avoid divide-by-zero in case of fluke. - vrpn_float64 pos[3]; - vrpn_float64 quat[4]; - memcpy(pos, info.pos, sizeof(pos)); - memcpy(quat, info.quat, sizeof(quat)); - const vrpn_float64 *filtered = me->d_filters[info.sensor].filter(dt, pos); - q_vec_copy(me->pos, filtered); - const double *q_filtered = me->d_qfilters[info.sensor].filter(dt, quat); - q_normalize(me->d_quat, q_filtered); - me->timestamp = info.msg_time; - me->d_sensor = info.sensor; - me->d_last_report_times[info.sensor] = info.msg_time; - - // Send the filtered report. - char msgbuf[512]; - int len = me->encode_to(msgbuf); - if (me->d_connection->pack_message(len, me->timestamp, me->position_m_id, - me->d_sender_id, msgbuf,vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "vrpn_Tracker_FilterOneEuro: cannot write message: tossing\n"); - } -} - -vrpn_Tracker_FilterOneEuro::vrpn_Tracker_FilterOneEuro(const char * name, vrpn_Connection * con, - const char *listen_tracker_name, - unsigned channels, vrpn_float64 vecMinCutoff, - vrpn_float64 vecBeta, vrpn_float64 vecDerivativeCutoff, - vrpn_float64 quatMinCutoff, vrpn_float64 quatBeta, - vrpn_float64 quatDerivativeCutoff) - : vrpn_Tracker(name, con) - , d_channels(channels) -{ - // Allocate space for the times. Fill them in with now. - d_last_report_times = new struct timeval[channels]; - if (d_last_report_times == NULL) { - fprintf(stderr,"vrpn_Tracker_FilterOneEuro::vrpn_Tracker_FilterOneEuro(): Out of memory\n"); - d_channels = 0; - return; - } - - vrpn_gettimeofday(×tamp, NULL); - - // Allocate space for the filters. - d_filters = new vrpn_OneEuroFilterVec[channels]; - d_qfilters = new vrpn_OneEuroFilterQuat[channels]; - if ( (d_filters == NULL) || (d_qfilters == NULL) ) { - fprintf(stderr,"vrpn_Tracker_FilterOneEuro::vrpn_Tracker_FilterOneEuro(): Out of memory\n"); - d_channels = 0; - return; - } - - // Fill in the parameters for each filter. - for (int i = 0; i < static_cast<int>(channels); ++i) { - d_filters[i].setMinCutoff(vecMinCutoff); - d_filters[i].setBeta(vecBeta); - d_filters[i].setDerivativeCutoff(vecDerivativeCutoff); - - d_qfilters[i].setMinCutoff(quatMinCutoff); - d_qfilters[i].setBeta(quatBeta); - d_qfilters[i].setDerivativeCutoff(quatDerivativeCutoff); - } - - // Open and set up callback handler for the tracker we're listening to. - // If the name starts with the '*' character, use the server - // connection rather than making a new one. - if (listen_tracker_name[0] == '*') { - d_listen_tracker = new vrpn_Tracker_Remote(&(listen_tracker_name[1]), - d_connection); - } else { - d_listen_tracker = new vrpn_Tracker_Remote(listen_tracker_name); - } - d_listen_tracker->register_change_handler(this, handle_tracker_update); -} - -vrpn_Tracker_FilterOneEuro::~vrpn_Tracker_FilterOneEuro() -{ - d_listen_tracker->unregister_change_handler(this, handle_tracker_update); - delete d_listen_tracker; - if (d_qfilters) { delete [] d_qfilters; d_qfilters = NULL; } - if (d_filters) { delete [] d_filters; d_filters = NULL; } - if (d_last_report_times) { delete [] d_last_report_times; d_last_report_times = NULL; } -} - -void vrpn_Tracker_FilterOneEuro::mainloop() -{ - // See if we have anything new from our tracker. - d_listen_tracker->mainloop(); - - // server update - vrpn_Tracker::server_mainloop(); -} diff --git a/src/vrpn/vrpn_Tracker_Filter.h b/src/vrpn/vrpn_Tracker_Filter.h deleted file mode 100644 index a2cbe77bf371a6f32a94df1085d63e0f8c3ce9c3..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_Filter.h +++ /dev/null @@ -1,60 +0,0 @@ -/** @file - @brief Header for a class of trackers that read from one tracker and - apply a filter to the inputs, sending out filtered outputs under a - different tracker name. The initial instance is the one-Euro filter - - - @date 2013 - - @author - Russ Taylor -*/ - -#pragma once - -// Internal Includes -#include "quat.h" // for q_vec_type -#include "vrpn_Tracker.h" // for vrpn_Tracker -#include "vrpn_OneEuroFilter.h" - -/** @brief Tracker filter based on the one-Euro filter by Jan Ciger - <jan.ciger@reviatech.com> - - This class reads values from the specified tracker, then applies the - one-Euro filter to its values and reports them as another tracker. - This lets you filter any device type. It was originally written to - be used with the Razer Hydra tracker. -*/ - -class VRPN_API vrpn_Tracker_FilterOneEuro: public vrpn_Tracker { - public: - // name is the name that the filtered reports go out under - // trackercon is the server connection to use to send filtered reports on - // listen_tracker_name is the name of the tracker we listen to to filter - // If the tracker should use the server connection, then put * in - // front of the name. - // channels tells how many channels from the listening tracker to - // filter (reports on other channels are ignored by this tracker) - // The other parameters are passed to each One-Euro filter. - vrpn_Tracker_FilterOneEuro(const char * name, vrpn_Connection * trackercon, - const char *listen_tracker_name, - unsigned channels, vrpn_float64 vecMinCutoff = 1.15, - vrpn_float64 vecBeta = 0.5, vrpn_float64 vecDerivativeCutoff = 1.2, - vrpn_float64 quatMinCutoff = 1.5, vrpn_float64 quatBeta = 0.5, - vrpn_float64 quatDerivativeCutoff = 1.2); - ~vrpn_Tracker_FilterOneEuro(); - - virtual void mainloop(); - - private: - int d_channels; // How many channels on our tracker? - vrpn_OneEuroFilterVec *d_filters; // Set of position filters, one/channel - vrpn_OneEuroFilterQuat *d_qfilters; // Set of orientation filters, one/channel - struct timeval *d_last_report_times; // Last time of report for each tracker. - vrpn_Tracker_Remote *d_listen_tracker; // Tracker we get our reports from - - // Callback handler to deal with getting messages from the tracker we're - // listening to. It filters them and then sends them on. - static void VRPN_CALLBACK handle_tracker_update(void *userdata, const vrpn_TRACKERCB info); -}; - diff --git a/src/vrpn/vrpn_Tracker_GPS.C b/src/vrpn/vrpn_Tracker_GPS.C deleted file mode 100644 index 6a582b4a17e0a9bd631359bce222b7a1d72b54bc..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_GPS.C +++ /dev/null @@ -1,431 +0,0 @@ -/* - * - * vrpn_tracker_GPS added to allow GPS tracking in outdoor AR experiences - * - */ - -#include <stdio.h> // for printf, NULL, fread, etc -#include <string.h> // for strlen - -#ifndef _WIN32 -#include <unistd.h> // for usleep, sleep -#endif - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_WARNING, etc -#include "vrpn_Connection.h" // for vrpn_Connection -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday -#include "vrpn_Tracker.h" // for vrpn_TRACKER_SYNCING, etc -#include "vrpn_Tracker_GPS.h" -#include "vrpn_Types.h" // for vrpn_float64 -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -#define MAX_TIME_INTERVAL (5000000) // max time between reports (usec) -#define INCHES_TO_METERS (2.54/100.0) -#define PI (3.14159265358979323846) - - -//-------------------------------------------------- - - - - -vrpn_Tracker_GPS::vrpn_Tracker_GPS(const char *name, - vrpn_Connection *c, - const char *port, - long baud, - int utmFlag, - int testFileFlag, - const char* startSentence) : -vrpn_Tracker_Serial(name,c,port,baud) -{ - //this sets the name of the testfile - sprintf(testfilename, "GPS-data.txt"); - - // This allow people to set an external flag whether they want to use real GPS or not - //Assuming this is 0 by default - if (testFileFlag == 1) { - //MessageBox(NULL, "CFG file flag set to use sample GPS data","FYI",0); - testfile = fopen(testfilename,"r"); //comment this line out to get real data - } else { - //MessageBox(NULL, temp,"Live GPS data",0); - testfile = NULL; - } - useUTM = utmFlag; - if (strlen(startSentence) > 0) { - nmeaParser.setStartSentence((char*)startSentence); - } - - // Set the hardware flow-control on the serial line in case - // the GPS unit requires it (some do). - if (serial_fd >= 0) { - vrpn_set_rts(serial_fd); - VRPN_MSG_WARNING("Set RTS.\n"); - } - - register_server_handlers(); //-eb - -} - -//------------------------------------ -vrpn_Tracker_GPS::~vrpn_Tracker_GPS() -{ - //Cleanup - if (testfile != NULL) fclose(testfile); - - if (serial_fd >=0) { - vrpn_close_commport(serial_fd); - serial_fd = -1; - } -} - -//--------------------------------- -void vrpn_Tracker_GPS::reset() -{ - - if (serial_fd >= 0) { - vrpn_set_rts(serial_fd); - VRPN_MSG_WARNING("Set RTS during reset.\n"); - } - //printf("serial fd: %d\n",serial_fd); - if (serial_fd >= 0) - { - VRPN_MSG_WARNING("Reset Completed (this is good).\n"); - //we need to give the port a chance to read new bits -#ifdef _WIN32 - Sleep(100); -#else - usleep(100000); -#endif - status = vrpn_TRACKER_SYNCING; // We're trying for a new reading - - if (testfile != NULL) fseek(testfile,0L,SEEK_SET); - } else { - printf("Serial not detected on reset. Try power cycle.\n"); //doesn't really ever seem to fail here unless com port gets jammed -#ifdef _WIN32 - Sleep(1000); -#else - sleep(1); -#endif //prevent the console from spamming us - status = vrpn_TRACKER_FAIL; - } - - nmeaParser.reset(); -} - -//----------------------------------------------------------------- -// This function will read characters until it has a full report, then -// put that report into the time, sensor, pos and quat fields so that it can -// be sent the next time through the loop. -int vrpn_Tracker_GPS::get_report(void) -{ - //printf("getting report\n"); - char errmsg[512]; // Error message to send to VRPN - //int ret; // Return value from function call to be checked - int ret; - - int i = 0; - // unsigned char *bufptr; // Points into buffer at the current value to read - int done=0; - - //char speed[256]; - //char course[256]; - // int buflen = 0; - unsigned int numparameter=0; - unsigned int index=0; - int charRead = 0; - // char temp [256]; - - //-------------------------------------------------------------------- - // Each report starts with an ASCII '$' character. If we're synching, - // read a byte at a time until we find a '$' character. - //-------------------------------------------------------------------- - - //printf("STATUS =%d\n", status); - if(status == vrpn_TRACKER_SYNCING) - { - - // If testfile is live; read data from that - if (testfile != NULL) { - - //Read one char to see if test file is active - if(fread(buffer,sizeof(char),1,testfile) != 1) - { - return 0; - } - - // Else read from the serial port - } else { - - charRead = vrpn_read_available_characters(serial_fd, buffer, 1); - - - if( charRead == -1) - { - printf("fail to read first bit\n"); - return 0; - } else if (charRead == 0) { - //case of successful read but no new bits, take a quick nap, wait for new info. - -#ifdef _WIN32 - Sleep(10); -#else - usleep(10000); -#endif - return 0; - } - } - //if it returns 0 (very likely - happens on interrupt or no new bits) then we have to prevent it from reading the same buffer over and over. - - // If it's not = to $, keep going until the beginning of a packet starts - if( buffer[0] != '$') - { - sprintf(errmsg,"While syncing (looking for '$', got '%c')", buffer[0]); - - - VRPN_MSG_INFO(errmsg); - vrpn_flush_input_buffer(serial_fd); - - return 0; - } - - //printf("We have a $, setting to partial and moving on.\n"); - bufcount = 1; // external GPS parser lib expects "$" at start - - vrpn_gettimeofday(×tamp, NULL); - - status = vrpn_TRACKER_PARTIAL; - }//if syncing - - while (!done) - { - if (testfile != NULL) { - ret = static_cast<int>(fread(&buffer[bufcount],sizeof(char),1,testfile)); - } else { - ret = vrpn_read_available_characters(serial_fd, &buffer[bufcount], 1); - } - - if (ret == -1) { - VRPN_MSG_ERROR("Error reading report"); - status = vrpn_TRACKER_FAIL; - return 0; - } else if (ret == 0) { - return 0; - } - - bufcount += ret; - if (bufcount >= VRPN_TRACKER_BUF_SIZE*10) - { - status = vrpn_TRACKER_SYNCING; - return 0; - } - if(buffer[bufcount-1] == '\n') - { - buffer[bufcount-1] = '\0'; - done = 1; - } - } - if (nmeaParser.parseSentence((char*)buffer) == SENTENCE_VALID) - { - nmeaData = nmeaParser.getData(); - //printf("Raw lastfixQuality: %d anyValid: %d LAT: %f LONG: %f ALT: %f\n", nmeaData.lastFixQuality, nmeaData.hasCoordEverBeenValid, nmeaData.lat, nmeaData.lon, nmeaData.altitude); - //required RMC doesn't do altitude, so this will be needlessly false half of the time. - //if (nmeaData.isValidLat && nmeaData.isValidLon && nmeaData.isValidAltitude) - if (nmeaData.isValidLat && nmeaData.isValidLon) - { - if(nmeaData.isValidAltitude){ - - if (useUTM) - { - utmCoord.setLatLonCoord (nmeaData.lat, nmeaData.lon); - if (!utmCoord.isOutsideUTMGrid ()) - { - double x, y; - utmCoord.getXYCoord (x,y); - // Christopher 07/25/04: We flip to be x = East <-> West and y = North <-> South - //Should this be changed to match rtk precision vrpn_float64? - pos[0] = (float)(y); - pos[1] = (float)(x); - pos[2] = (float)(nmeaData.altitude); - } - } else { - - pos[0] = (vrpn_float64)(nmeaData.lat); - pos[1] = (vrpn_float64)(nmeaData.lon); - pos[2] = (vrpn_float64)(nmeaData.altitude); - }//use utm d - /* - vel[0] = vel_data[0]; - vel[1] = vel_data[1]; - vel[2] = vel_data[2]; - */ -//#ifdef VERBOSE - printf("GPS pos: %f, %f, %f\n",pos[0],pos[1],pos[2]); -//#endif - nmeaParser.reset(); - - //send report -eb - //----------------------------- - //printf("tracker report ready\n",status); - - //vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - - /* - // Send the message on the connection - if (NULL != vrpn_Tracker::d_connection) - { - char msgbuf[1000]; - - - fprintf(stderr, "position id = %d, sender id = %d", position_m_id, d_sender_id); - //MessageBox(NULL, temp,"GPS Testing",0); - - // Pack position report - int len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, - position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) - { - - fprintf(stderr,"GPS: cannot write message: tossing\n"); - } - else - { - fprintf(stderr,"packed a message\n\n"); - } - - - } - else - { - fprintf(stderr,"Tracker Fastrak: No valid connection\n"); - } - - //-----------------------------*/ - - //printf("%s\n", buffer); - //printf("before first sync status is %d\n",status); - status = vrpn_TRACKER_SYNCING; - //printf("after first set sync status is %d\n",status); - - return 1; - } - //no valid alt probably RMC, safe to ignore if we care about alt - } else {//valid lat lon alt fail - printf("GPS cannot determine position (empty fields). Wait for satellites or reposition GPS.\n"); - //printf("GPS cannot determine position (empty fields)."); - status = vrpn_TRACKER_SYNCING; - return 0; - } - } else {//valid sentence fail - //status = vrpn_TRACKER_FAIL; - status = vrpn_TRACKER_RESETTING; - //is this a good place to put it? If it's not a valid sentence? maybe it should be in reset. - printf("Sentence Invalid. Resetting tracker and resyncing.\n"); - return 0; - } - // failed valid sentence - status = vrpn_TRACKER_SYNCING; - return 0; - -//#ifdef VERBOSE2 - // print_latest_report(); -//#endif - } - - - // This function should be called each time through the main loop - // of the server code. It polls for a report from the tracker and - // sends it if there is one. It will reset the tracker if there is - // no data from it for a few seconds. -#if 0 - void vrpn_Tracker_GPS::mainloop() - { - //char temp[256]; - fprintf(stderr,"calling server main\n"); - // Call the generic server mainloop, since we are a server - server_mainloop(); - - //-eb adding get report and removing switch statement - //get_report(); - - fprintf(stderr,"status in mainloop is %d\n\n",status); - - switch (status) { - case vrpn_TRACKER_REPORT_READY: - { - printf("tracker report ready\n",status); - - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - - // Send the message on the connection - if (d_connection) { - char msgbuf[1000]; - - - //sprintf(temp, "position id = %d, sender id = %d", position_m_id, d_sender_id); - //MessageBox(NULL, temp,"GPS Testing",0); - - // Pack position report - int len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, - position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - - fprintf(stderr,"Fastrak: cannot write message: tossing\n"); - } - - // Pack velocity report - - // len = encode_vel_to(msgbuf); - // if (d_connection->pack_message(len, timestamp, - // velocity_m_id, d_sender_id, msgbuf, - // vrpn_CONNECTION_LOW_LATENCY)){ - // fprintf(stderr,"Fastrak: cannot write message: tossing\n"); - // } - - - } else { - fprintf(stderr,"Tracker Fastrak: No valid connection\n"); - } - - // Ready for another report - status = vrpn_TRACKER_SYNCING; - - } - break; - - case vrpn_TRACKER_SYNCING: - case vrpn_TRACKER_AWAITING_STATION: - case vrpn_TRACKER_PARTIAL: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - - - get_report(); - - } - break; - - case vrpn_TRACKER_RESETTING: - reset(); - break; - - case vrpn_TRACKER_FAIL: - VRPN_MSG_WARNING("Tracking failed, trying to reset (try power cycle if more than 4 attempts made)"); - //vrpn_close_commport(serial_fd); - //serial_fd = vrpn_open_commport(portname, baudrate); - status = vrpn_TRACKER_RESETTING; - break; - }//switch - - } -#endif diff --git a/src/vrpn/vrpn_Tracker_GPS.h b/src/vrpn/vrpn_Tracker_GPS.h deleted file mode 100644 index 0a74708f8bd2c5dd4f151bcd67f61f52283e68ce..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_GPS.h +++ /dev/null @@ -1,61 +0,0 @@ -// vrpn_Tracker_GPS.h -// This file contains the header for the VRPN GPS server. This server -// reads NMEA messages from a serial GPS. -// This implementation can convert to UTM meter-based coordinates. - -#ifndef VRPN_TRACKER_GPS_H -#define VRPN_TRACKER_GPS_H - -#include "vrpn_Configure.h" // for VRPN_API - -#include <stdio.h> // for FILE - -#include "gpsnmealib/nmeaParser.h" // for NMEAData, NMEAParser -#include "gpsnmealib/utmCoord.h" // for UTMCoord -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for VRPN_TRACKER_BUF_SIZE, etc - -class VRPN_API vrpn_Connection; - -class vrpn_Tracker_GPS: public vrpn_Tracker_Serial { - - public: - - vrpn_Tracker_GPS(const char *name, - vrpn_Connection *c, - const char *port = "/dev/ttyS1", - long baud = 4800, - int utmFlag = 1, // report in UTM coordinates if possible - int testFileFlag = 0, - const char* startStr = "RMC"); // the sentence to use as the "start" of a sequence - - ~vrpn_Tracker_GPS(); - - - /// This function should be called each time through the main loop - /// of the server code. It polls for a report from the tracker and - /// sends it if there is one. It will reset the tracker if there is - /// no data from it for a few seconds. - - // virtual void mainloop(); - - protected: - // need a bigger buffer - unsigned char buffer[VRPN_TRACKER_BUF_SIZE*10];// Characters read in from the tracker so far - - virtual int get_report(void); - virtual void reset(); - - struct timeval reset_time; - - FILE *testfile; - char testfilename[256]; - - // an nmeaParser object and associated data objects - NMEAData nmeaData; - NMEAParser nmeaParser; - UTMCoord utmCoord; - int useUTM; -}; - -#endif diff --git a/src/vrpn/vrpn_Tracker_GameTrak.C b/src/vrpn/vrpn_Tracker_GameTrak.C deleted file mode 100644 index 4e82d13acde52dcd18c19146ca565cfc0fc4d60d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_GameTrak.C +++ /dev/null @@ -1,145 +0,0 @@ -/* - * vrpn_Tracker_GameTrak.cpp - * - * Created on: Nov 22, 2010 - * Author: janoc - */ - -#include <math.h> // for cos, sin -#include <stdio.h> // for fprintf, stderr -#include <string.h> // for memset, memcpy, NULL - -#include "quat.h" // for Q_PI -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Tracker_GameTrak.h" - -vrpn_Tracker_GameTrak::vrpn_Tracker_GameTrak(const char * name, vrpn_Connection * trackercon, const char *joystick_dev, int *mapping) : - vrpn_Tracker(name, trackercon) -{ - memset(_sensor0, 0, 3 * sizeof(float)); - memset(_sensor1, 0, 3 * sizeof(float)); - - memcpy(_mapping, mapping, 6 * sizeof(int)); - - // try to open a client connection to the joystick device - // if the name starts with '*', use the server connection only - if (joystick_dev[0] == '*') - _analog = new vrpn_Analog_Remote(&(joystick_dev[1]), d_connection); - else - _analog = new vrpn_Analog_Remote(joystick_dev); - - if (_analog == NULL) - { - fprintf(stderr, "vrpn_Tracker_GameTrak: " - "Can't open joystick %s\n", joystick_dev); - } - else - { - _analog->register_change_handler(this, handle_update); - } -} - -vrpn_Tracker_GameTrak::~vrpn_Tracker_GameTrak() -{ - // TODO: Auto-generated destructor stub -} - -void vrpn_Tracker_GameTrak::mainloop() -{ - if (!_analog) - return; - - // server update - server_mainloop(); - - // master joystick update - _analog->mainloop(); - - if (_should_report) - { - vrpn_Tracker::timestamp = _timestamp; - - // send tracker orientation - memset(d_quat, 0, sizeof(vrpn_float64) * 4); // no position - d_quat[3] = 1; - - d_sensor = 0; - pos[0] = _sensor0[0]; - pos[1] = _sensor0[1]; - pos[2] = _sensor0[2]; - - char msgbuf[1000]; - int len = vrpn_Tracker::encode_to(msgbuf); - if (d_connection->pack_message(len, _timestamp, position_m_id, d_sender_id, msgbuf, vrpn_CONNECTION_LOW_LATENCY)) - { - fprintf(stderr, "GameTrak tracker: can't write message: tossing\n"); - } - - d_sensor = 1; - pos[0] = _sensor1[0]; - pos[1] = _sensor1[1]; - pos[2] = _sensor1[2]; - - len = vrpn_Tracker::encode_to(msgbuf); - if (d_connection->pack_message(len, _timestamp, position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) - { - fprintf(stderr,"GameTrak tracker: can't write message: tossing\n"); - } - - _should_report = false; - } -} - -void VRPN_CALLBACK vrpn_Tracker_GameTrak::handle_update(void *userdata, const vrpn_ANALOGCB info) -{ - /* - * The spherical->carthesian conversion code is based on the mail from: - * Marc LE RENARD lerenard@esiea-ouest.fr, - * ESIEA - * Laboratoire RVSE - * (Réalité Virtuelle et Systèmes Embarqués) - * 38 Rue des docteurs Calmette & Guérin - * 53000 LAVAL - */ - - vrpn_Tracker_GameTrak *gametrak = (vrpn_Tracker_GameTrak *) userdata; - - vrpn_float64 s1x, s1y, s1z; - vrpn_float64 s2x, s2y, s2z; - - s1x = info.channel[gametrak->_mapping[0]]; - s1y = info.channel[gametrak->_mapping[1]]; - s1z = info.channel[gametrak->_mapping[2]]; - - s2x = info.channel[gametrak->_mapping[3]]; - s2y = info.channel[gametrak->_mapping[4]]; - s2z = info.channel[gametrak->_mapping[5]]; - - vrpn_float64 coef = (32.5 / 180.0) * Q_PI; - - vrpn_float64 distance0 = 1.5 * (1 - s1z); - vrpn_float64 angleX0 = -s1x * coef; - vrpn_float64 angleY0 = -s1y * coef; - - vrpn_float64 distance1 = 1.5 * (1 - s2z); - vrpn_float64 angleX1 = -s2x * coef; - vrpn_float64 angleY1 = -s2y * coef; - - // printf("%3.3f %3.3f %3.3f %3.3f %3.3f %3.3f\n", angleX0, angleY0, distance0, angleX1, angleY1, distance1); - - gametrak->_sensor0[0] = sin(angleX0) * distance0 + 0.065; - gametrak->_sensor0[1] = cos(angleX0) * sin(angleY0) * distance0; - gametrak->_sensor0[2] = cos(angleX0) * cos(angleY0) * distance0; - - gametrak->_sensor1[0] = sin(angleX1) * distance1 - 0.065; - gametrak->_sensor1[1] = cos(angleX1) * sin(angleY1) * distance1; - gametrak->_sensor1[2] = cos(angleX1) * cos(angleY1) * distance1; - - //printf(" %3.3f %3.3f %3.3f %3.3f %3.3f %3.3f\n", gametrak->_sensor0[0], gametrak->_sensor0[1], gametrak->_sensor0[2], - // gametrak->_sensor1[0], gametrak->_sensor1[1], gametrak->_sensor1[2]); - - memcpy(&(gametrak->_timestamp), &(info.msg_time), sizeof(struct timeval)); - gametrak->_should_report = true; -} - diff --git a/src/vrpn/vrpn_Tracker_GameTrak.h b/src/vrpn/vrpn_Tracker_GameTrak.h deleted file mode 100644 index 364d329b8c2641d7d1c7f18393d2bbd78836efff..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_GameTrak.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * vrpn_Tracker_GameTrak.h - * - * Created on: Nov 22, 2010 - * Author: janoc - */ - -#ifndef VRPN_TRACKER_GAMETRAK_H_ -#define VRPN_TRACKER_GAMETRAK_H_ - -#include "vrpn_Analog.h" // for vrpn_ANALOGCB, etc -#include "vrpn_Configure.h" // for VRPN_API, VRPN_CALLBACK -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker -#include "vrpn_Types.h" // for vrpn_float64 - -class VRPN_API vrpn_Connection; - -class VRPN_API vrpn_Tracker_GameTrak: public vrpn_Tracker -{ - public: - vrpn_Tracker_GameTrak(const char * name, vrpn_Connection * trackercon, const char *joystick_dev, int *mapping); - - virtual void mainloop (); - - virtual ~vrpn_Tracker_GameTrak(); - - protected: - int _mapping[6]; - - bool _should_report; - vrpn_float64 _sensor0[3], _sensor1[3]; - struct timeval _timestamp; - - vrpn_Analog_Remote *_analog; - - static void VRPN_CALLBACK handle_update (void *, const vrpn_ANALOGCB); -}; - -#endif /* VRPN_TRACKER_GAMETRAK_H_ */ diff --git a/src/vrpn/vrpn_Tracker_Isotrak.C b/src/vrpn/vrpn_Tracker_Isotrak.C deleted file mode 100644 index 969f9b1d4ea45d54406b338c7592d455b59802ae..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_Isotrak.C +++ /dev/null @@ -1,556 +0,0 @@ -// vrpn_Tracker_Isotrak.C -// This file contains the code to operate a Polhemus Isotrack Tracker. -// This file is based on the vrpn_Tracker_Fastrack.C file, with modifications made -// to allow it to operate a Isotrack instead. The modifications are based -// on the old version of the Isotrack driver. -// This version was written in the Spring 2006 by Bruno Herbelin. -// -// Revised by Charles B. Owen (cbowen@cse.msu.edu) 1-20-2012 -// Revisions: -// -// The version before was reporting in centimeters. Revised to report in Meters per VRPN requirements. -// The version before negated the coordinates. I have no idea why. That has been fixed. -// Now reads the binary format instead of ASCII. It's faster and supports the stylus button. -// Now supports a stylus button for either channel. - - -#include <ctype.h> // for isprint -#include <stdio.h> // for fprintf, perror, sprintf, etc -#include <stdlib.h> // for atoi -#include <string.h> // for strlen, strncpy, strtok - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_WARNING, etc -#include "vrpn_Button.h" // for vrpn_Button_Server -#include "vrpn_Connection.h" // for vrpn_Connection -#include "vrpn_Serial.h" // for vrpn_write_characters, etc -#include "vrpn_Shared.h" // for vrpn_SleepMsecs, timeval, etc -#include "vrpn_Tracker.h" // for vrpn_TRACKER_FAIL, etc -#include "vrpn_Tracker_Isotrak.h" -#include "vrpn_Types.h" // for vrpn_uint8, vrpn_float64, etc -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -const int BINARY_RECORD_SIZE = 20; - -vrpn_Tracker_Isotrak::vrpn_Tracker_Isotrak(const char *name, vrpn_Connection *c, - const char *port, long baud, int enable_filtering, int numstations, - const char *additional_reset_commands) : - vrpn_Tracker_Serial(name,c,port,baud), - do_filter(enable_filtering), - num_stations(numstations>vrpn_ISOTRAK_MAX_STATIONS ? vrpn_ISOTRAK_MAX_STATIONS : numstations), - num_resets(0) -{ - reset_time.tv_sec = reset_time.tv_usec = 0; - if (additional_reset_commands == NULL) { - sprintf(add_reset_cmd, ""); - } else { - strncpy(add_reset_cmd, additional_reset_commands, sizeof(add_reset_cmd)-1); - } - - // Initially, set to no buttons - for(int i=0; i<vrpn_ISOTRAK_MAX_STATIONS; i++) { - stylus_buttons[i] = NULL; - } -} - -vrpn_Tracker_Isotrak::~vrpn_Tracker_Isotrak() -{ - -} - - -/** This routine sets the device for position + quaternion - It puts a space at the end so that we can check to make - sure we have complete good records for each report. - - Returns 0 on success and -1 on failure. -*/ - -int vrpn_Tracker_Isotrak::set_sensor_output_format(int /*sensor*/) -{ - char outstring[16]; - - // Set output format for the station to be position, quaternion - // Don't need the space anymore, though - sprintf(outstring, "O2,11\r"); - - if (vrpn_write_characters(serial_fd, (const unsigned char *)outstring, - strlen(outstring)) == (int)strlen(outstring)) { - vrpn_SleepMsecs(50); // Sleep for a bit to let command run - } else { - VRPN_MSG_ERROR("Write failed on format command"); - status = vrpn_TRACKER_FAIL; - return -1; - } - return 0; -} - -// This routine will reset the tracker and set it to generate the types -// of reports we want. -// This was based on the Isotrak User Manual from Polhemus (2001 Edition, Rev A) - -void vrpn_Tracker_Isotrak::reset() -{ - int i,resetLen,ret; - unsigned char reset[10]; - char errmsg[512]; - - //-------------------------------------------------------------------- - // This section deals with resetting the tracker to its default state. - // Multiple attempts are made to reset, getting more aggressive each - // time. This section completes when the tracker reports a valid status - // message after the reset has completed. - //-------------------------------------------------------------------- - - // Send the tracker a string that should reset it. The first time we - // try this, just do the normal 'c' command to put it into polled mode. - // After a few tries with this, use a [return] character, and then use the ^Y to reset. - - resetLen = 0; - num_resets++; - - // We're trying another reset - if (num_resets > 1) { // Try to get it out of a query loop if its in one - reset[resetLen++] = (unsigned char) (13); // Return key -> get ready - } - - if (num_resets > 2) { - reset[resetLen++] = (unsigned char) (25); // Ctrl + Y -> reset the tracker - } - - reset[resetLen++] = 'c'; // Put it into polled (not continuous) mode - - - sprintf(errmsg, "Resetting the tracker (attempt %d)", num_resets); - VRPN_MSG_WARNING(errmsg); - - for (i = 0; i < resetLen; i++) { - if (vrpn_write_characters(serial_fd, &reset[i], 1) == 1) { - fprintf(stderr,"."); - vrpn_SleepMsecs(1000.0*2); // Wait after each character to give it time to respond - } else { - perror("Isotrack: Failed writing to tracker"); - status = vrpn_TRACKER_FAIL; - return; - } - } - //XXX Take out the sleep and make it keep spinning quickly - if (num_resets > 2) { - vrpn_SleepMsecs(1000.0*20); // Sleep to let the reset happen, if we're doing ^Y - } - - fprintf(stderr,"\n"); - - // Get rid of the characters left over from before the reset - vrpn_flush_input_buffer(serial_fd); - - // Make sure that the tracker has stopped sending characters - vrpn_SleepMsecs(1000.0*2); - unsigned char scrap[80]; - if ( (ret = vrpn_read_available_characters(serial_fd, scrap, 80)) != 0) { - sprintf(errmsg,"Got >=%d characters after reset",ret); - VRPN_MSG_WARNING(errmsg); - for (i = 0; i < ret; i++) { - if (isprint(scrap[i])) { - fprintf(stderr,"%c",scrap[i]); - } else { - fprintf(stderr,"[0x%02X]",scrap[i]); - } - } - fprintf(stderr, "\n"); - vrpn_flush_input_buffer(serial_fd); // Flush what's left - } - - // Asking for tracker status - if (vrpn_write_characters(serial_fd, (const unsigned char *) "S", 1) == 1) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" Isotrack write failed"); - status = vrpn_TRACKER_FAIL; - return; - } - - // Read Status - unsigned char statusmsg[22]; - - // Attempt to read 21 characters. - ret = vrpn_read_available_characters(serial_fd, statusmsg, 21); - - if ( (ret != 21) ) { - fprintf(stderr, - " Got %d of 21 characters for status\n",ret); - VRPN_MSG_ERROR("Bad status report from Isotrack, retrying reset"); - return; - } - else if ( (statusmsg[0]!='2') ) { - int i; - statusmsg[sizeof(statusmsg) - 1] = '\0'; // Null-terminate the string - fprintf(stderr, " Isotrack: bad status ("); - for (i = 0; i < ret; i++) { - if (isprint(statusmsg[i])) { - fprintf(stderr,"%c",statusmsg[i]); - } else { - fprintf(stderr,"[0x%02X]",statusmsg[i]); - } - } - fprintf(stderr,")\n"); - VRPN_MSG_ERROR("Bad status report from Isotrack, retrying reset"); - return; - } else { - VRPN_MSG_WARNING("Isotrack gives correct status (this is good)"); - num_resets = 0; // Success, use simple reset next time - } - - //-------------------------------------------------------------------- - // Now that the tracker has given a valid status report, set all of - // the parameters the way we want them. We rely on power-up setting - // based on the receiver select switches to turn on the receivers that - // the user wants. - //-------------------------------------------------------------------- - - // Set output format. This is done once for the Isotrak, not per channel. - if (set_sensor_output_format(0)) { - return; - } - - // Enable filtering if the constructor parameter said to. - // Set filtering for both position (x command) and orientation (v command) - // to the values that are recommended as a "jumping off point" in the - // Isotrack manual. - - if (do_filter) { - if (vrpn_write_characters(serial_fd, (const unsigned char *)"x0.2,0.2,0.8,0.8\015", 17) == 17) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" Isotrack write position filter failed"); - status = vrpn_TRACKER_FAIL; - return; - } - if (vrpn_write_characters(serial_fd, (const unsigned char *)"v0.2,0.2,0.8,0.8\015", 17) == 17) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" Isotrack write orientation filter failed"); - status = vrpn_TRACKER_FAIL; - return; - } - } - - // RESET Alignment reference frame - if (vrpn_write_characters(serial_fd, (const unsigned char *) "R1\r", 3) != 3) { - perror(" Isotrack write failed"); - status = vrpn_TRACKER_FAIL; - return; - } else { - VRPN_MSG_WARNING("Isotrack reset ALIGNMENT reference frame (this is good)"); - } - - // reset BORESIGHT - if (vrpn_write_characters(serial_fd, (const unsigned char *) "b1\r", 3) != 3) { - perror(" Isotrack write failed"); - status = vrpn_TRACKER_FAIL; - return; - } else { - VRPN_MSG_WARNING("Isotrack reset BORESIGHT (this is good)"); - } - - // Set data format to METRIC mode - if (vrpn_write_characters(serial_fd, (const unsigned char *) "u", 1) != 1) { - perror(" Isotrack write failed"); - status = vrpn_TRACKER_FAIL; - return; - } else { - VRPN_MSG_WARNING("Isotrack set to metric units (this is good)"); - } - - - - // Send the additional reset commands, if any, to the tracker. - // These commands come in lines, with character \015 ending each - // line. If a line start with an asterisk (*), treat it as a pause - // command, with the number of seconds to wait coming right after - // the asterisk. Otherwise, the line is sent directly to the tracker. - // Wait a while for them to take effect, then clear the input - // buffer. - if (strlen(add_reset_cmd) > 0) { - char *next_line; - char add_cmd_copy[sizeof(add_reset_cmd)]; - char string_to_send[sizeof(add_reset_cmd)]; - int seconds_to_wait; - - printf(" Isotrack writing extended reset commands...\n"); - - // Make a copy of the additional reset string, since it is consumed - strncpy(add_cmd_copy, add_reset_cmd, sizeof(add_cmd_copy)); - add_cmd_copy[sizeof(add_cmd_copy)-1] = '\0'; - - // Pass through the string, testing each line to see if it is - // a sleep command or a line to send to the tracker. Continue until - // there are no more line delimiters ('\015'). Be sure to write the - // \015 to the end of the string sent to the tracker. - // Note that strok() puts a NULL character in place of the delimiter. - - next_line = strtok(add_cmd_copy, "\015"); - while (next_line != NULL) { - if (next_line[0] == '*') { // This is a "sleep" line, see how long - seconds_to_wait = atoi(&next_line[1]); - fprintf(stderr," ...sleeping %d seconds\n",seconds_to_wait); - vrpn_SleepMsecs(1000.0*seconds_to_wait); - } else { // This is a command line, send it - sprintf(string_to_send, "%s\015", next_line); - fprintf(stderr, " ...sending command: %s\n", string_to_send); - vrpn_write_characters(serial_fd, - (const unsigned char *)string_to_send,strlen(string_to_send)); - } - next_line = strtok(next_line+strlen(next_line)+1, "\015"); - } - - // Sleep a little while to let this finish, then clear the input buffer - vrpn_SleepMsecs(1000.0*2); - vrpn_flush_input_buffer(serial_fd); - } - - // Set data format to BINARY mode - // F = ASCII, f = binary - if (vrpn_write_characters(serial_fd, (const unsigned char *) "f", 1) != 1) { - perror(" Isotrack write failed"); - status = vrpn_TRACKER_FAIL; - return; - } else { - VRPN_MSG_WARNING("Isotrack set to BINARY mode (this is good)"); - } - - - // Set tracker to continuous mode - if (vrpn_write_characters(serial_fd, (const unsigned char *) "C", 1) != 1) { - perror(" Isotrack write failed"); - status = vrpn_TRACKER_FAIL; - return; - } else { - VRPN_MSG_WARNING("Isotrack set to continuous mode (this is good)"); - } - - VRPN_MSG_WARNING("Reset Completed."); - - status = vrpn_TRACKER_SYNCING; // We're trying for a new reading - - // Ok, device is ready, we want to calibrate to sensor 1 current position/orientation - while(get_report() != 1); - - // Done with reset. - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - - status = vrpn_TRACKER_SYNCING; // We're trying for a new reading -} - - - -// This function will read characters until it has a full report, then -// put that report into the time, sensor, pos and quat fields so that it can -// be sent the next time through the loop. The time stored is that of -// the first character received as part of the report. Reports start with -// the header "0xy", where x is the station number and y is either the -// space character or else one of the characters "A-F". Characters "A-F" -// indicate weak signals and so forth, but in practice it is much harder -// to deal with them than to ignore them (they don't indicate hard error -// conditions). The report follows, 7 values in 7 characters each. The first three -// are position in X,Y and Z. The next four are the quaternion in the -// order W, X,Y,Z. -// If we get a report that is not valid, we assume that we have lost a -// character or something and re-synchronize with the Isotrack by waiting -// until the start-of-report character ('0') comes around again. -// The routine that calls this one makes sure we get a full reading often -// enough (ie, it is responsible for doing the watchdog timing to make sure -// the tracker hasn't simply stopped sending characters). - -int vrpn_Tracker_Isotrak::get_report(void) -{ - char errmsg[512]; // Error message to send to VRPN - int ret; // Return value from function call to be checked - - // The first byte of a binary record has the high order bit set - - if (status == vrpn_TRACKER_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, buffer, 1) != 1) { - return 0; - } - - // The first byte of a record has the high order bit set - if(!(buffer[0] & 0x80)) { - sprintf(errmsg,"While syncing (looking for byte with high order bit set, " - "got '%x')", buffer[0]); - VRPN_MSG_WARNING(errmsg); - vrpn_flush_input_buffer(serial_fd); - - return 0; - } - - // Got the first byte of a report -- go into TRACKER_PARTIAL mode - // and record that we got one character at this time. - bufcount = 1; - vrpn_gettimeofday(×tamp, NULL); - status = vrpn_TRACKER_PARTIAL; - } - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. The routine that calls this one - // makes sure we get a full reading often enough (ie, it is responsible - // for doing the watchdog timing to make sure the tracker hasn't simply - // stopped sending characters). - //-------------------------------------------------------------------- - - ret = vrpn_read_available_characters(serial_fd, &buffer[bufcount], - BINARY_RECORD_SIZE - bufcount); - if (ret == -1) { - VRPN_MSG_ERROR("Error reading report"); - status = vrpn_TRACKER_FAIL; - return 0; - } - - bufcount += ret; - - if (bufcount < BINARY_RECORD_SIZE) { // Not done -- go back for more - return 0; - } - - // We now have enough characters for a full report - // Check it to ensure we do not have a high bit set other - // than on the first byte - for(int i=1; i<BINARY_RECORD_SIZE; i++) - { - if (buffer[i] & 0x80) { - status = vrpn_TRACKER_SYNCING; - - sprintf(errmsg,"Unexpected sync character in record"); - VRPN_MSG_WARNING(errmsg); - - //VRPN_MSG_WARNING("Not '0' in record, re-syncing"); - vrpn_flush_input_buffer(serial_fd); - return 0; - } - } - - // Create a buffer for the decoded message - unsigned char decoded[BINARY_RECORD_SIZE]; - int d = 0; - - int fullgroups = BINARY_RECORD_SIZE / 8; - - // The following decodes the Isotrak binary format. It consists of - // 7 byte values plus an extra byte of the high bit for these - // 7 bytes. First, loop over the 7 byte ranges (8 bytes in binary) - int i; - for(i = 0; i<fullgroups; i++) - { - vrpn_uint8 *group = &buffer[i * 8]; - vrpn_uint8 high = buffer[i * 8 + 7]; - - for(int j=0; j<7; j++) - { - decoded[d] = *group++; - if(high & 1) - decoded[d] |= 0x80; - - d++; - high >>= 1; - } - } - - // We'll have X bytes left at the end - int left = BINARY_RECORD_SIZE - fullgroups * 8; - vrpn_uint8 *group = &buffer[fullgroups * 8]; - vrpn_uint8 high = buffer[fullgroups * 8 + left - 1]; - - for(int j=0; j<left-1; j++) - { - decoded[d] = *group++; - if(high & 1) - decoded[d] |= 0x80; - - d++; - high >>= 1; - } - - // ASCII value of 1 == 49 subtracing 49 gives the sensor number - d_sensor = decoded[1] - 49; // Convert ASCII 1 to sensor 0 and so on. - if ( (d_sensor < 0) || (d_sensor >= num_stations) ) { - status = vrpn_TRACKER_SYNCING; - sprintf(errmsg,"Bad sensor # (%d) in record, re-syncing", d_sensor); - VRPN_MSG_WARNING(errmsg); - vrpn_flush_input_buffer(serial_fd); - return 0; - } - - - - // Extract the important information - vrpn_uint8 *item = &decoded[3]; - - // This is a scale factor from the Isotrak manual - // This will convert the values to meters, the standard vrpn format - double mul = 1.6632 / 32767.; - float div = 1.f / 32767.f; // Fractional amount for angles - - pos[0] = ( (vrpn_int8(item[1]) << 8) + item[0]) * mul; item += 2; - pos[1] = ( (vrpn_int8(item[1]) << 8) + item[0]) * mul; item += 2; - pos[2] = ( (vrpn_int8(item[1]) << 8) + item[0]) * mul; item += 2; - d_quat[3] = ( (vrpn_int8(item[1]) << 8) + item[0]) * div; item += 2; - d_quat[0] = ( (vrpn_int8(item[1]) << 8) + item[0]) * div; item += 2; - d_quat[1] = ( (vrpn_int8(item[1]) << 8) + item[0]) * div; item += 2; - d_quat[2] = ( (vrpn_int8(item[1]) << 8) + item[0]) * div; - - //-------------------------------------------------------------------- - // If this sensor has button on it, decode the button values - // into the button device and mainloop the button device so that - // it will report any changes. - //-------------------------------------------------------------------- - - if(stylus_buttons[d_sensor] != NULL) - { - char button = decoded[2]; - if(button == '@' || button == '*') - { - stylus_buttons[d_sensor]->set_button(0, button == '@'); - - } - - stylus_buttons[d_sensor]->mainloop(); - } - - //-------------------------------------------------------------------- - // Done with the decoding, - // set the report to ready - //-------------------------------------------------------------------- - status = vrpn_TRACKER_SYNCING; - bufcount = 0; - - #ifdef VERBOSE2 - print_latest_report(); - #endif - - return 1; -} - - -// this routine is called when an "Stylus" button is encountered -// by the tracker init string parser it sets up the VRPN button -// device -int vrpn_Tracker_Isotrak::add_stylus_button(const char *button_device_name, int sensor) -{ - // Make sure this is a valid sensor - if ( (sensor < 0) || (sensor >= num_stations) ) { - return -1; - } - - // Add a new button device and set the pointer to point at it. - stylus_buttons[sensor] = new vrpn_Button_Server(button_device_name, d_connection, 1); - if (stylus_buttons[sensor] == NULL) - { - VRPN_MSG_ERROR("Cannot open button device"); - return -1; - } - - return 0; -} - diff --git a/src/vrpn/vrpn_Tracker_Isotrak.h b/src/vrpn/vrpn_Tracker_Isotrak.h deleted file mode 100644 index 04c648c0f89915e80c4ba2a4ca42066429f19948..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_Isotrak.h +++ /dev/null @@ -1,73 +0,0 @@ -// vrpn_Tracker_Isotrak.h -// This file contains the code to operate a Polhemus Isotrack Tracker. -// This file is based on the vrpn_Tracker_Fastrack.C file, with modifications made -// to allow it to operate a Isotrack instead. The modifications are based -// on the old version of the Isotrack driver. -// This version was written in the Spring 2006 by Bruno Herbelin. - - -#ifndef VRPN_TRACKER_ISOTRAK_H -#define VRPN_TRACKER_ISOTRAK_H - -#include <stdio.h> // for NULL - -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker_Serial - -class VRPN_API vrpn_Button_Server; -class VRPN_API vrpn_Connection; - - -const int vrpn_ISOTRAK_MAX_STATIONS = 2; // How many stations can exist - -class VRPN_API vrpn_Tracker_Isotrak: public vrpn_Tracker_Serial { - - public: - - /// The constructor is given the name of the tracker (the name of - /// the sender it should use), the connection on which it is to - /// send its messages, the name of the serial port it is to open - /// (default is /dev/ttyS1 (first serial port in Linux)), the baud - /// rate at which it is to communicate (default 19200), whether - /// filtering is enabled (default yes), and the number of stations - /// that are possible on this Fastrak (default 4). The station select - /// switches on the front of the Fastrak determine which stations are - /// active. The final parameter is a string that can contain additional - /// commands that are set to the tracker as part of its reset routine. - /// These might be used to set the hemisphere or other things that are - /// not normally included; see the Fastrak manual for a list of these. - /// There can be multiple lines of them but putting <CR> into the string. - - vrpn_Tracker_Isotrak(const char *name, vrpn_Connection *c, - const char *port = "/dev/ttyS1", long baud = 19200, - int enable_filtering = 1, int numstations = vrpn_ISOTRAK_MAX_STATIONS, - const char *additional_reset_commands = NULL); - - ~vrpn_Tracker_Isotrak(); - - /// Add a stylus (with button) to one of the sensors. - int add_stylus_button(const char *button_device_name, int sensor); - - protected: - - virtual int get_report(void); - virtual void reset(); - - struct timeval reset_time; - int do_filter; //< Should we turn on filtering for pos/orient? - int num_stations; //< How many stations maximum on this Isotrak? - - int num_resets; //< How many resets have we tried this time around? - char add_reset_cmd[2048]; //< Additional reset commands to be sent - - int set_sensor_output_format(int sensor); - - // An Isotrak can have stylus's with buttons on them - vrpn_Button_Server *stylus_buttons[vrpn_ISOTRAK_MAX_STATIONS]; - -private: - void process_binary(); -}; - -#endif diff --git a/src/vrpn/vrpn_Tracker_JsonNet.C b/src/vrpn/vrpn_Tracker_JsonNet.C deleted file mode 100644 index 4d5eebdff276f91129785f649d1af962d2e81e50..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_JsonNet.C +++ /dev/null @@ -1,454 +0,0 @@ -#include "vrpn_Tracker_JsonNet.h" - -#if defined(VRPN_USE_JSONNET) - -#ifdef _WIN32 - #ifdef VRPN_USE_WINSOCK2 - #include <winsock2.h> // struct timeval is defined here - #else - #include <winsock.h> // struct timeval is defined here - #endif -#else - #include <sys/socket.h> - #include <sys/time.h> - #include <netinet/in.h> - #include <unistd.h> - #define INVALID_SOCKET -1 -#endif - -#include "json/json.h" - -#include "quat.h" - -#include "vrpn_SendTextMessageStreamProxy.h" - -#include <stdlib.h> // for exit - -// These must match definitions in eu.ensam.ii.vrpn.Vrpn -static const char* const MSG_KEY_TYPE = "type"; -static const char* const MSG_KEY_SEQUENCE_NUMBER = "sn"; -static const char* const MSG_KEY_TIMESTAMP = "ts"; - -static const char* const MSG_KEY_TRACKER_ID = "id"; -static const char* const MSG_KEY_TRACKER_QUAT = "quat"; -static const char* const MSG_KEY_TRACKER_POS = "pos"; - -static const char* const MSG_KEY_BUTTON_ID = "button"; -static const char* const MSG_KEY_BUTTON_STATUS = "state"; - -static const char* const MSG_KEY_ANALOG_CHANNEL = "num"; -static const char* const MSG_KEY_ANALOG_DATA = "data"; - -static const char* const MSG_KEY_TEXT_DATA = "data"; - -// Message types (values for MSG_KEY_TYPE) -static const int MSG_TYPE_TRACKER = 1; -static const int MSG_TYPE_BUTTON = 2; -static const int MSG_TYPE_ANALOG = 3; -static const int MSG_TYPE_TEXT = 4; - -vrpn_Tracker_JsonNet::vrpn_Tracker_JsonNet(const char* name,vrpn_Connection* c,int udp_port) : - vrpn_Tracker(name, c), - vrpn_Button_Filter(name, c), - vrpn_Analog(name, c), - vrpn_Text_Sender(name, c), - _socket(INVALID_SOCKET), - _pJsonReader(0), - _do_tracker_report(false) -{ - fprintf(stderr, "vrpn_Tracker_JsonNet : Device %s listen on port udp port %d\n", name, udp_port); - if (! _network_init(udp_port)) { - exit(EXIT_FAILURE); - } - - // Buttons part - - num_buttons = vrpn_BUTTON_MAX_BUTTONS; - num_channel = vrpn_CHANNEL_MAX; - - _pJsonReader = new Json::Reader(); -} - -vrpn_Tracker_JsonNet::~vrpn_Tracker_JsonNet(void) -{ - if (_pJsonReader != 0) { - delete _pJsonReader; - _pJsonReader = 0; - } - _network_release(); -} - - -void vrpn_Tracker_JsonNet::mainloop() { - server_mainloop(); - /* - * The original Dtrack code uses blocking call to select() in _network_receive with - * a 1 sec timeout. In Dtrack, the data is supposed to be continuously flowing (app. 60 Hz), - * so the timeout is unlikely to happen. However, the data from the Android device flow at a lower - * frequency and may not flow at all if the tilt tracker is disabled. - * Thus a 1 sec timeout here causes latency and jerky movements in Dtrack - */ - const int timeout_us = 10 * 1000; - int received_length = _network_receive(_network_buffer, _NETWORK_BUFFER_SIZE, timeout_us); - - if (received_length < 0) { - //fprintf(stderr, "vrpn_Tracker_JsonNet : receive error %d\n", received_length); - return; - } - _network_buffer[received_length] = '\0'; - //fprintf(stderr, "got data : %.*s\n", received_length, _network_buffer); - if (!_parse(_network_buffer, received_length)) { - // whatever error - - return; - } - - // report trackerchanges - // TODO really use timestamps - struct timeval ts ; - vrpn_gettimeofday(&ts, NULL); - // from vrpn_Tracker_DTrack::dtrack2vrpnbody - if (d_connection && _do_tracker_report) { - char msgbuf[1000]; - // Encode pos and d_quat - int len = vrpn_Tracker::encode_to(msgbuf); - if (d_connection->pack_message(len, ts, position_m_id, d_sender_id, msgbuf, vrpn_CONNECTION_LOW_LATENCY)) { - // error - } - _do_tracker_report = false; - //fprintf(stderr, "Packed and sent\n"); - } - - vrpn_Button::report_changes(); - vrpn_Analog::report_changes(); - -} - -bool vrpn_Tracker_JsonNet::_parse(const char* buffer, int length) { - Json::Value root; // will contains the root value after parsing. - // Beware collectcomment = true crashes - bool parsingSuccessful = _pJsonReader->parse( buffer, root , false); - if ( !parsingSuccessful ) { - // report to the user the failure and their locations in the document. - fprintf(stderr, "vrpn_Tracker_JsonNet parse error :%s\n", - _pJsonReader->getFormatedErrorMessages().c_str()); - fprintf(stderr, "%s\n",buffer); - return false; - } - - const Json::Value& constRoot = root; - // Find MessageType - const Json::Value& type = constRoot[MSG_KEY_TYPE]; - int messageType; - if (!type.empty() && type.isConvertibleTo(Json::intValue)) { - messageType = type.asInt(); - // HACK - } else { - fprintf(stderr, "vrpn_Tracker_JsonNet parse error : missing message type\n"); - return false; - } - switch (messageType) { - // TODO cleanup - case MSG_TYPE_TRACKER: - return _parse_tracker_data(root); - break; - case MSG_TYPE_BUTTON: - return _parse_button(root); - break; - case MSG_TYPE_ANALOG: - return _parse_analog(root); - break; - case MSG_TYPE_TEXT: - return _parse_text(root); - break; - default: - ; - } - return false; - - -} - -/** - * Parse a tracker update mesage. - * - * If the message can be parsed and the tracker Id is valid, the tracker data is updated. - * - * @param root the JSON message - * @returns false if any error, true otherwise. - */ -bool vrpn_Tracker_JsonNet::_parse_tracker_data(const Json::Value& root) { - const Json::Value& constRoot = root; - - // Id of the current tracker - const Json::Value& sensorId = constRoot[MSG_KEY_TRACKER_ID]; - if (!sensorId.empty() && sensorId.isConvertibleTo(Json::intValue)){ - this->d_sensor = sensorId.asInt(); - } else { - return false; - } - - /* - * mainloop calls vrpn_Tracker::encode_to, that will send d_sensor, d_pos and d_quat. - * velocity and acceleration are curretly not handled - */ - - const Json::Value& quatData = constRoot[MSG_KEY_TRACKER_QUAT]; - if (!quatData.empty() && quatData.isArray() && quatData.size() == 4) { - this->d_quat[0] = quatData[0u].asDouble(); - this->d_quat[1] = quatData[1].asDouble(); - this->d_quat[2] = quatData[2].asDouble(); - this->d_quat[3] = quatData[3].asDouble(); - //q_vec_type ypr; - //q_to_euler(ypr, d_quat); - //fprintf(stderr, "yaw-rY %.3f pitch-rX %.3f roll-rZ %.3f \n", ypr[0], ypr[1], ypr[2]); - } - - /* - * Look for a position - */ - const Json::Value& posData = constRoot[MSG_KEY_TRACKER_POS]; - if (!posData.empty() && posData.isArray() && posData.size() == 3) { - this->pos[0] = posData[0u].asDouble(); - this->pos[1]= posData[1].asDouble(); - this->pos[2]= posData[2].asDouble(); - } - - _do_tracker_report = true; - return true; -} - -/** - * Parse a text update mesage. - * - * If the message can be parsed the message data is sent. - * - * @param root the JSON message - * @returns false if any error, true otherwise. - */ -bool vrpn_Tracker_JsonNet::_parse_text(const Json::Value& root) { - const Json::Value& valueTextStatus = root[MSG_KEY_TEXT_DATA]; - const char *msg = ""; - if (!valueTextStatus.empty() && valueTextStatus.isConvertibleTo(Json::stringValue)) { - send_text_message(vrpn_TEXT_NORMAL) << valueTextStatus.asString(); - return true; - } - fprintf(stderr, "vrpn_Tracker_JsonNet::_parse_text parse error : missing text"); - return false; -} -/** - * Parse a button update mesage. - * - * If the message can be parses and the button Id is valid, the button data is updated. - * - * @param root the JSON message - * @returns false if any error, true otherwise. - */ -bool vrpn_Tracker_JsonNet::_parse_button(const Json::Value& root) { - const Json::Value& valueButtonStatus = root[MSG_KEY_BUTTON_STATUS]; - bool buttonStatus; - if (!valueButtonStatus.empty() && valueButtonStatus.isConvertibleTo(Json::booleanValue)) { - buttonStatus = valueButtonStatus.asBool(); - } else { - fprintf(stderr, "vrpn_Tracker_JsonNet::_parse_button parse error : missing status"); - return false; - } - const Json::Value& valueButtonId = root[MSG_KEY_BUTTON_ID]; - int buttonId; // buttonId embedded in the message. - if (!valueButtonId.empty() && valueButtonId.isConvertibleTo(Json::intValue)) { - buttonId = valueButtonId.asInt(); - } else { - fprintf(stderr, "vrpn_Tracker_JsonNet::_parse_button parse error : missing id\n"); - return false; - } - - if (buttonId < 0 || buttonId > num_buttons) { - fprintf(stderr, "invalid button Id %d (max : %d)\n", buttonId, num_buttons); - } else { - buttons[buttonId] = (int)buttonStatus; - } - - return true; -} - -/** - * Parse an analog update mesage. - * - * If the message can be parsed and the analog Id is valid, the analog data is updated. - * - * @param root the JSON message - * @returns false if any error, true otherwise. - */ - -bool vrpn_Tracker_JsonNet::_parse_analog(const Json::Value& root) { - const Json::Value& valueData = root[MSG_KEY_ANALOG_DATA]; - double data; - if (!valueData.empty() && valueData.isConvertibleTo(Json::realValue)) { - data = valueData.asDouble(); - } else { - fprintf(stderr, "vrpn_Tracker_JsonNet::_parse_analog parse error : missing status"); - return false; - } - - - const Json::Value& channelNumberId = root[MSG_KEY_ANALOG_CHANNEL]; - int channelNumber; - if (!channelNumberId.empty() && channelNumberId.isConvertibleTo(Json::intValue)) { - channelNumber = channelNumberId.asInt(); - } else { - fprintf(stderr, "vrpn_Tracker_JsonNet::_parse_analog parse error : missing id\n"); - return false; - } - - if (channelNumber < 0 || channelNumber >= num_channel) { - fprintf(stderr, "vrpn_Tracker_JsonNet::_parse_analog id out of bounds %d/%d\n", channelNumber, num_channel); - } else { - channel[channelNumber] = data; - } - - return true; -} - -/** - * Initilises the listening socket - * @param udp_port the UDP listening port - */ -bool vrpn_Tracker_JsonNet::_network_init(int udp_port) { - int iResult; -#ifdef _WIN32 - { - // Initialize Winsock - WORD versionRequested = MAKEWORD(2,2); - WSADATA wsaData; - - iResult = WSAStartup(versionRequested, &wsaData); - if (iResult != 0) { - printf("WSAStartup failed with error: %d\n", iResult); - return false; - } - } -#endif - -#ifdef _WIN32 - { - // Create a SOCKET for connecting to server - _socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (_socket == INVALID_SOCKET) { - printf("socket failed with error: %ld\n", WSAGetLastError()); - //freeaddrinfo(result); - WSACleanup(); - return false; - } - } -#else - { - int usock; - - usock = socket(PF_INET, SOCK_DGRAM, 0); - - if (usock < 0){ - return false; - } - _socket = usock; - } -#endif - struct sockaddr_in localSocketAddress; - localSocketAddress.sin_family = AF_INET; - localSocketAddress.sin_addr.s_addr = htonl(INADDR_ANY); - localSocketAddress.sin_port = htons(udp_port); - - // Setup the listening socket - iResult = bind( _socket, (struct sockaddr*)&localSocketAddress, sizeof(localSocketAddress)); - if (iResult < 0) { -#ifdef _WIN32 - printf("bind failed with error: %d\n", WSAGetLastError()); -#else - printf("bind failed."); -#endif - //freeaddrinfo(result); - _network_release(); - return false; - } - - //freeaddrinfo(result); - return true; - -} - -/** - * Read a network message. - * - * Same as vrpn_tracker_DTrack::udp_receive - * - * @param buffer the address of the data buffer to be updated - * @param maxlen the length of the buffer - * @param tout_us the read timeout in microseconds - */ -int vrpn_Tracker_JsonNet::_network_receive(void *buffer, int maxlen, int tout_us) -{ - int nbytes, err; - fd_set set; - struct timeval tout; - - // waiting for data: - - FD_ZERO(&set); - FD_SET(_socket, &set); - - tout.tv_sec = tout_us / 1000000; - tout.tv_usec = tout_us % 1000000; - - switch((err = select(FD_SETSIZE, &set, NULL, NULL, &tout))){ - case 1: - break; // data available - case 0: - //fprintf(stderr, "net_receive: select timeout (err = 0)\n"); - return -1; // timeout - break; - default: - //fprintf(stderr, "net_receive: select error %d\n", err); - return -2; // error - - } - - // receiving packet: - while(1){ - - // receive one packet: - nbytes = recv(_socket, (char *)buffer, maxlen, 0); - if(nbytes < 0){ // receive error - //fprintf(stderr, "recv_receive: select error %d\n", err); - return -3; - } - - // check, if more data available: if so, receive another packet - FD_ZERO(&set); - FD_SET(_socket, &set); - - tout.tv_sec = 0; // timeout with value of zero, thus no waiting - tout.tv_usec = 0; - - if(select(FD_SETSIZE, &set, NULL, NULL, &tout) != 1){ - // no more data available: check length of received packet and return - if(nbytes >= maxlen){ // buffer overflow - return -4; - } - return nbytes; - } - } -} - -/** - * Cleanup the network resources - */ -void vrpn_Tracker_JsonNet::_network_release() { -#ifdef _WIN32 - closesocket(_socket); - WSACleanup(); -#else - close(_socket); -#endif -} - -#endif // defined VRPN_USE_JSONNET - diff --git a/src/vrpn/vrpn_Tracker_JsonNet.h b/src/vrpn/vrpn_Tracker_JsonNet.h deleted file mode 100644 index 9b9d04876d975108cb6ec6110664aa13fd537771..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_JsonNet.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef VRPN_TRACKER_JSONNET -#define VRPN_TRACKER_JSONNET - -#include "vrpn_Configure.h" - -#if defined(VRPN_USE_JSONNET) - -#include "vrpn_Analog.h" -#include "vrpn_Button.h" -#include "vrpn_Tracker.h" -#include "vrpn_Text.h" - -namespace Json { - class Reader; - class Value; -} - -/** - * A tracker class that accepts network updates in JSON format. - * - * This tracker is used by the Vrpn Android widgets. - * Any other application that can send UDP packets with a JSON payload - * and feed this tracker. - * - * @Author Philippe Crassous / ENSAM ParisTech-Institut Image - */ -class vrpn_Tracker_JsonNet : - public vrpn_Tracker, public vrpn_Button_Filter, public vrpn_Analog, public vrpn_Text_Sender -{ -public: - vrpn_Tracker_JsonNet( - const char* name, - vrpn_Connection* c, - int udpPort - ); - ~vrpn_Tracker_JsonNet(void); - - void mainloop(); - - enum { - TILT_TRACKER_ID = 0, - }; - - -private: - /* - * Network part - */ - bool _network_init(int udp_port); - int _network_receive(void *buffer, int maxlen, int tout_us); - void _network_release(); -#ifdef _WIN32 - typedef SOCKET socket_type; -#else - typedef int socket_type; -#endif - socket_type _socket; - enum { - _NETWORK_BUFFER_SIZE = 2000, - - }; - char _network_buffer[_NETWORK_BUFFER_SIZE]; - - /* - * Json part - */ - bool _parse(const char* buffer, int length); - bool _parse_tracker_data(const Json::Value& root); - bool _parse_analog(const Json::Value& root); - bool _parse_button(const Json::Value& root); - bool _parse_text(const Json::Value& root); - bool _do_tracker_report; - Json::Reader* _pJsonReader; -}; - -#endif // ifdef JSONNET -#endif diff --git a/src/vrpn/vrpn_Tracker_Liberty.C b/src/vrpn/vrpn_Tracker_Liberty.C deleted file mode 100644 index 2cd33f75592a0b0c29c4575c74590f9916752d95..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_Liberty.C +++ /dev/null @@ -1,704 +0,0 @@ -// vrpn_Tracker_Liberty.C -// This file contains the code to operate a Polhemus Liberty Tracker. -// This file is based on the vrpn_Tracker_Fastrak.C file. - -// Modified to work with the Polhemus Patriot as well. - -#include <ctype.h> // for isprint -#include <stdio.h> // for fprintf, stderr, sprintf, etc -#include <stdlib.h> // for atoi -#include <string.h> // for strlen, strncpy, strtok - -#include "quat.h" // for Q_W, Q_X, Q_Y, Q_Z -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR, etc -#include "vrpn_Button.h" // for vrpn_Button_Server -#include "vrpn_Connection.h" // for vrpn_Connection -#include "vrpn_Serial.h" // for vrpn_write_characters, etc -#include "vrpn_Shared.h" // for vrpn_SleepMsecs, timeval, etc -#include "vrpn_Tracker.h" // for vrpn_TRACKER_FAIL, etc -#include "vrpn_Tracker_Liberty.h" -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -#define INCHES_TO_METERS (2.54/100.0) -const bool DEBUG = false; // General Debug Messages -const bool DEBUGA = false; // Only errors - -vrpn_Tracker_Liberty::vrpn_Tracker_Liberty(const char *name, vrpn_Connection *c, - const char *port, long baud, int enable_filtering, int numstations, - const char *additional_reset_commands, int whoamilen) : - vrpn_Tracker_Serial(name,c,port,baud), - do_filter(enable_filtering), - num_stations(numstations>vrpn_LIBERTY_MAX_STATIONS ? vrpn_LIBERTY_MAX_STATIONS : numstations), - num_resets(0), - whoami_len(whoamilen>vrpn_LIBERTY_MAX_WHOAMI_LEN ? vrpn_LIBERTY_MAX_WHOAMI_LEN : whoamilen), - got_single_sync_char(0) -{ - int i; - - reset_time.tv_sec = reset_time.tv_usec = 0; - if (additional_reset_commands == NULL) { - sprintf(add_reset_cmd, ""); - } else { - strncpy(add_reset_cmd, additional_reset_commands, sizeof(add_reset_cmd)-1); - } - - // Initially, set to no buttons or analogs on the stations. The - // methods to add buttons and analogs must be called to add them. - for (i = 0; i < num_stations; i++) { - stylus_buttons[i] = NULL; - } - - if (DEBUG) fprintf(stderr,"[DEBUG] Constructed Liberty Object\n"); -} - -vrpn_Tracker_Liberty::~vrpn_Tracker_Liberty() -{ - -} - -/** This routine augments the basic sensor-output setting function of the Liberty - . It sets the device for position + quaternion + any of - the extended fields. It puts a space at the end so that we can check to make - sure we have complete good records for each report. - - Returns 0 on success and -1 on failure. -*/ - -int vrpn_Tracker_Liberty::set_sensor_output_format(int sensor) -{ - char outstring[64]; - const char *timestring; - const char *buttonstring; - const char *analogstring; - - // Set output format for the station to be position and quaternion, - // and any of the extended Liberty (stylus with button) or - // IS900 states (timestamp, button, analog). - // This command is a capitol 'o' followed by the number of the - // station, then comma-separated values (2 for xyz, 7 for quat, 8 for - // timestamp, 10 for buttons, 0 for space) that - // indicate data sets, followed by character 13 (octal 15). - // Note that the sensor number has to be bumped to map to station number. - - timestring = ",8"; - buttonstring = stylus_buttons[sensor] ? ",10" : ""; - analogstring=""; - - sprintf(outstring, "O%d,2,7%s%s%s,0\015", sensor+1, timestring, - buttonstring, analogstring); - - if (DEBUG) fprintf(stderr,"[DEBUG]: %s \n",outstring); - if (vrpn_write_characters(serial_fd, (const unsigned char *)outstring, - strlen(outstring)) == (int)strlen(outstring)) { - vrpn_SleepMsecs(50); // Sleep for a bit to let command run - } else { - VRPN_MSG_ERROR("Write failed on format command"); - status = vrpn_TRACKER_FAIL; - return -1; - } - - return 0; - } - -/** This routine augments the standard Liberty report (3 initial characters + - 3*4 for position + 4*4 for quaternions) to include the timestamp for the given sensor. - - It returns the number of characters total to expect for a report for the - given sensor. -*/ - -int vrpn_Tracker_Liberty::report_length(int sensor) -{ - int len; - - len = 9; // Basic report: Header information (8) + space at the end (1) - len += 3*4; // Four bytes/float, 3 floats for position - len += 4*4; // Four bytes/float, 4 floats for quaternion - len += 4; // Timestamp - len += stylus_buttons[sensor] ? 4 : 0; // If applicable, 4 bytes for button info - - return len; -} - -// This routine will reset the tracker and set it to generate the types -// of reports we want. - -void vrpn_Tracker_Liberty::reset() -{ - int i,resetLen,ret; - char reset[10]; - char errmsg[512]; - char outstring1[64],outstring3[64]; - - //-------------------------------------------------------------------- - // This section deals with resetting the tracker to its default state. - // Multiple attempts are made to reset, getting more aggressive each - // time. This section completes when the tracker reports a valid status - // message after the reset has completed. - //-------------------------------------------------------------------- - - // Send the tracker a string that should reset it. The first time we - // try this, just do the normal 'c' command to put it into polled mode. - // after a few tries with this, use the ^Y reset. Later, try to reset - // to the factory defaults. Then toggle the extended mode. - // Then put in a carriage return to try and break it out of - // a query mode if it is in one. These additions are cumulative: by the - // end, we're doing them all. - fprintf(stderr,"[DEBUG] Beginning Reset"); - resetLen = 0; - num_resets++; // We're trying another reset - if (num_resets > 0) { // Try to get it out of a query loop if its in one - reset[resetLen++] = (char) (13); // Return key -> get ready - reset[resetLen++] = 'F'; - reset[resetLen++] = '0'; - reset[resetLen++] = (char) (13); // Return key -> get ready - // reset[resetLen++] = (char) (13); - // reset[resetLen++] = (char) (13); - } - /* XXX These commands are probably never needed, and can cause real - headaches for people who are keeping state in their trackers (especially - the InterSense trackers). Taking them out in version 05.01; you can put - them back in if your tracker isn't resetting as well. - if (num_resets > 3) { // Get a little more aggressive - reset[resetLen++] = 'W'; // Reset to factory defaults - reset[resetLen++] = (char) (11); // Ctrl + k --> Burn settings into EPROM - } - */ - if (num_resets > 2) { - reset[resetLen++] = (char) (25); // Ctrl + Y -> reset the tracker - reset[resetLen++] = (char) (13); // Return Key - } - reset[resetLen++] = 'P'; // Put it into polled (not continuous) mode - - sprintf(errmsg, "Resetting the tracker (attempt %d)", num_resets); - VRPN_MSG_WARNING(errmsg); - for (i = 0; i < resetLen; i++) { - if (vrpn_write_characters(serial_fd, (unsigned char*)&reset[i], 1) == 1) { - fprintf(stderr,"."); - vrpn_SleepMsecs(1000.0*2); // Wait after each character to give it time to respond - } else { - perror("Liberty: Failed writing to tracker"); - status = vrpn_TRACKER_FAIL; - return; - } - } - //XXX Take out the sleep and make it keep spinning quickly - // You only need to sleep 10 seconds for an actual Liberty. - // For the Intersense trackers, you need to sleep 20. So, - // sleeping 20 is the more general solution... - if (num_resets > 2) { - vrpn_SleepMsecs(1000.0*20); // Sleep to let the reset happen, if we're doing ^Y - } - - fprintf(stderr,"\n"); - - // Get rid of the characters left over from before the reset - vrpn_flush_input_buffer(serial_fd); - - // Make sure that the tracker has stopped sending characters - vrpn_SleepMsecs(1000.0*2); - unsigned char scrap[80]; - if ( (ret = vrpn_read_available_characters(serial_fd, scrap, 80)) != 0) { - sprintf(errmsg,"Got >=%d characters after reset",ret); - VRPN_MSG_WARNING(errmsg); - for (i = 0; i < ret; i++) { - if (isprint(scrap[i])) { - fprintf(stderr,"%c",scrap[i]); - } else { - fprintf(stderr,"[0x%02X]",scrap[i]); - } - } - fprintf(stderr, "\n"); - vrpn_flush_input_buffer(serial_fd); // Flush what's left - } - - // Asking for tracker status. S not implemented in Liberty and hence - // ^V (WhoAmI) is used. It retruns 196 bytes - - char statusCommand[2]; - statusCommand[0]=(char)(22); // ^V - statusCommand[1]=(char)(13); // Return Key - - if (vrpn_write_characters(serial_fd, (const unsigned char *) &statusCommand[0], 2) == 2) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" Liberty write failed"); - status = vrpn_TRACKER_FAIL; - return; - } - - // Read Status - unsigned char statusmsg[vrpn_LIBERTY_MAX_WHOAMI_LEN+1]; - - // Attempt to read whoami_len characters. - ret = vrpn_read_available_characters(serial_fd, statusmsg, whoami_len); - if (ret != whoami_len) { - fprintf(stderr," Got %d of %d characters for status\n",ret, whoami_len); - } - // It seems like some versions of the tracker report longer - // messages; so we reduced this chech so that it does not check for the - // appropriate length of message or for the last character being a 10, - // so that it works more generally. The removed tests are: - // || (ret!=whoami_len) || (statusmsg[ret-1]!=(char)(10)) - if ( (statusmsg[0]!='0') ) { - int i; - if (ret != -1) { - statusmsg[ret] = '\0'; // Null-terminate the string - } - fprintf(stderr, " Liberty: status is ("); - for (i = 0; i < ret; i++) { - if (isprint(statusmsg[i])) { - fprintf(stderr,"%c",statusmsg[i]); - } else { - fprintf(stderr,"[0x%02X]",statusmsg[i]); - } - } - fprintf(stderr,"\n)\n"); - VRPN_MSG_ERROR("Bad status report from Liberty, retrying reset"); - return; - } else { - VRPN_MSG_WARNING("Liberty/Isense gives status (this is good)"); -printf("LIBERTY LATUS STATUS (whoami):\n%s\n\n",statusmsg); - num_resets = 0; // Success, use simple reset next time - } - - //-------------------------------------------------------------------- - // Now that the tracker has given a valid status report, set all of - // the parameters the way we want them. We rely on power-up setting - // based on the receiver select switches to turn on the receivers that - // the user wants. - //-------------------------------------------------------------------- - - // Set output format for each of the possible stations. - - for (i = 0; i < num_stations; i++) { - if (set_sensor_output_format(i)) { - return; - } - } - - // Enable filtering if the constructor parameter said to. - // Set filtering for both position (X command) and orientation (Y command) - // to the values that are recommended as a "jumping off point" in the - // Liberty manual. - - if (do_filter) { - if (DEBUG) fprintf(stderr,"[DEBUG]: Enabling filtering\n"); - - if (vrpn_write_characters(serial_fd, - (const unsigned char *)"X0.2,0.2,0.8,0.8\015", 17) == 17) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" Liberty write position filter failed"); - status = vrpn_TRACKER_FAIL; - return; - } - if (vrpn_write_characters(serial_fd, - (const unsigned char *)"Y0.2,0.2,0.8,0.8\015", 17) == 17) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" Liberty write orientation filter failed"); - status = vrpn_TRACKER_FAIL; - return; - } - } else { - if (DEBUG) fprintf(stderr,"[DEBUG]: Disabling filtering\n"); - - if (vrpn_write_characters(serial_fd, - (const unsigned char *)"X0,1,0,0\015", 9) == 9) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" Liberty write position filter failed"); - status = vrpn_TRACKER_FAIL; - return; - } - if (vrpn_write_characters(serial_fd, - (const unsigned char *)"Y0,1,0,0\015", 9) == 9) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" Liberty write orientation filter failed"); - status = vrpn_TRACKER_FAIL; - return; - } - } - - - // Send the additional reset commands, if any, to the tracker. - // These commands come in lines, with character \015 ending each - // line. If a line start with an asterisk (*), treat it as a pause - // command, with the number of seconds to wait coming right after - // the asterisk. Otherwise, the line is sent directly to the tracker. - // Wait a while for them to take effect, then clear the input - // buffer. - if (strlen(add_reset_cmd) > 0) { - char *next_line; - char add_cmd_copy[sizeof(add_reset_cmd)]; - char string_to_send[sizeof(add_reset_cmd)]; - int seconds_to_wait; - - printf(" Liberty writing extended reset commands...\n"); - - // Make a copy of the additional reset string, since it is consumed - strncpy(add_cmd_copy, add_reset_cmd, sizeof(add_cmd_copy)); - add_cmd_copy[sizeof(add_cmd_copy)-1] = '\0'; - - // Pass through the string, testing each line to see if it is - // a sleep command or a line to send to the tracker. Continue until - // there are no more line delimiters ('\015'). Be sure to write the - // \015 to the end of the string sent to the tracker. - // Note that strok() puts a NULL character in place of the delimiter. - - next_line = strtok(add_cmd_copy, "\015"); - while (next_line != NULL) { - if (next_line[0] == '*') { // This is a "sleep" line, see how long - seconds_to_wait = atoi(&next_line[1]); - fprintf(stderr," ...sleeping %d seconds\n",seconds_to_wait); - vrpn_SleepMsecs(1000.0*seconds_to_wait); - } else { // This is a command line, send it - sprintf(string_to_send, "%s\015", next_line); - fprintf(stderr, " ...sending command: %s\n", string_to_send); - vrpn_write_characters(serial_fd, - (const unsigned char *)string_to_send,strlen(string_to_send)); - } - next_line = strtok(next_line+strlen(next_line)+1, "\015"); - } - - // Sleep a little while to let this finish, then clear the input buffer - vrpn_SleepMsecs(1000.0*2); - vrpn_flush_input_buffer(serial_fd); - } - - // Set data format to BINARY mode - sprintf(outstring1, "F1\r"); - if (vrpn_write_characters(serial_fd, (const unsigned char *)outstring1, - strlen(outstring1)) == (int)strlen(outstring1)) { - fprintf(stderr, " Liberty set to binary mode\n"); - - } - - // Set tracker to continuous mode - sprintf(outstring3, "C\r"); - if (vrpn_write_characters(serial_fd, (const unsigned char *)outstring3, - strlen(outstring3)) != (int)strlen(outstring3)) { - perror(" Liberty write failed"); - status = vrpn_TRACKER_FAIL; - return; - } else { - fprintf(stderr, " Liberty set to continuous mode\n"); - } - - // If we are using the Liberty timestamps, clear the timer on the device and - // store the time when we cleared it. First, drain any characters in the output - // buffer to ensure we're sending right away. Then, send the reset command and - // store the time that we sent it, plus the estimated time for the characters to - // get across the serial line to the device at the current baud rate. - // Set time units to milliseconds (MT) and reset the time (MZ). - - char clear_timestamp_cmd[] = "Q0\r"; - - vrpn_drain_output_buffer(serial_fd); - - if (vrpn_write_characters(serial_fd, (const unsigned char *)clear_timestamp_cmd, - strlen(clear_timestamp_cmd)) != (int)strlen(clear_timestamp_cmd)) { - VRPN_MSG_ERROR("Cannot send command to clear timestamp"); - status = vrpn_TRACKER_FAIL; - return; - } - - // Drain the output buffer again, then record the time as the base time from - // the tracker. - vrpn_drain_output_buffer(serial_fd); - vrpn_gettimeofday(&liberty_zerotime, NULL); - - // Done with reset. - vrpn_gettimeofday(&watchdog_timestamp, NULL); // Set watchdog now - VRPN_MSG_WARNING("Reset Completed (this is good)"); - status = vrpn_TRACKER_SYNCING; // We're trying for a new reading -} - -// This function will read characters until it has a full report, then -// put that report into the time, sensor, pos and quat fields so that it can -// be sent the next time through the loop. The time stored is that of -// the first character received as part of the report. Reports start with -// the header "0xy", where x is the station number and y is either the -// space character or else one of the characters "A-F". Characters "A-F" -// indicate weak signals and so forth, but in practice it is much harder -// to deal with them than to ignore them (they don't indicate hard error -// conditions). The report follows, 4 bytes per word in little-endian byte -// order; each word is an IEEE floating-point binary value. The first three -// are position in X,Y and Z. The next four are the unit quaternion in the -// order W, X,Y,Z. There are some optional fields for the Intersense 900 -// tracker, then there is an ASCII space character at the end. -// If we get a report that is not valid, we assume that we have lost a -// character or something and re-synchronize with the Liberty by waiting -// until the start-of-report character ('0') comes around again. -// The routine that calls this one makes sure we get a full reading often -// enough (ie, it is responsible for doing the watchdog timing to make sure -// the tracker hasn't simply stopped sending characters). - -int vrpn_Tracker_Liberty::get_report(void) -{ - char errmsg[512]; // Error message to send to VRPN - int ret; // Return value from function call to be checked - unsigned char *bufptr; // Points into buffer at the current value to read - - //-------------------------------------------------------------------- - // Each report starts with the ASCII 'LY' characters. If we're synching, - // read a byte at a time until we find a 'LY' characters. - //-------------------------------------------------------------------- - // For the Patriot this is 'PA'. - // For the (high speed) Liberty Latus this is 'LU'. - - if (status == vrpn_TRACKER_SYNCING) { - - // Try to get the first sync character if don't already have it. - // If none, just return. - if (got_single_sync_char != 1) { - ret = vrpn_read_available_characters(serial_fd, buffer, 1); - if (ret != 1) { - //if (DEBUG) fprintf(stderr,"[DEBUG]: Missed First Sync Char, ret= %i\n",ret); - return 0; - } - } - - // Try to get the second sync character. If none, just return - ret = vrpn_read_available_characters(serial_fd, &buffer[1], 1); - if (ret == 1) { - //Got second sync Char - got_single_sync_char = 0; - } - else if (ret != -1) { - if (DEBUG) fprintf(stderr,"[DEBUG]: Missed Second Sync Char\n"); - got_single_sync_char = 1; - return 0; - } - - // If it is not 'LY' or 'PA' or 'LU' , we don't want it but we - // need to look at the next one, so just return and stay - // in Syncing mode so that we will try again next time through. - // Also, flush the buffer so that it won't take as long to catch up. - if ( - ((( buffer[0] == 'L') && (buffer[1] == 'Y')) != 1) - && - ((( buffer[0] == 'P') && (buffer[1] == 'A')) != 1) - && - ((( buffer[0] == 'L') && (buffer[1] == 'U')) != 1) - ) - { - sprintf(errmsg,"While syncing (looking for 'LY' or 'PA' or 'LU', " - "got '%c%c')", buffer[0], buffer[1]); - VRPN_MSG_INFO(errmsg); - vrpn_flush_input_buffer(serial_fd); - if (DEBUG) fprintf(stderr,"[DEBUGA]: Getting Report - Not LY or PA or LU, Got Character %c %c \n",buffer[0],buffer[1]); - return 0; - } - - if (DEBUG) fprintf(stderr,"[DEBUG]: Getting Report - Got LY or PA or LU\n"); - - // Got the first character of a report -- go into AWAITING_STATION mode - // and record that we got one character at this time. The next - // bit of code will attempt to read the station. - // The time stored here is as close as possible to when the - // report was generated. For the InterSense 900 in timestamp - // mode, this value will be overwritten later. - bufcount = 2; - // vrpn_gettimeofday(×tamp, NULL); - status = vrpn_TRACKER_AWAITING_STATION; - } - - //-------------------------------------------------------------------- - // The third character of each report is the station number. Once - // we know this, we can compute how long the report should be for the - // given station, based on what values are in its report. - // The station number is converted into a VRPN sensor number, where - // the first Liberty station is '1' and the first VRPN sensor is 0. - //-------------------------------------------------------------------- - - if (status == vrpn_TRACKER_AWAITING_STATION) { - - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, &buffer[bufcount], 1) != 1) { - return 0; - } - if (DEBUG) fprintf(stderr,"[DEBUG]: Awaiting Station - Got Station (%i) \n",buffer[2]); - - d_sensor = buffer[2] - 1; // Convert ASCII 1 to sensor 0 and so on. - if ( (d_sensor < 0) || (d_sensor >= num_stations) ) { - status = vrpn_TRACKER_SYNCING; - sprintf(errmsg,"Bad sensor # (%d) in record, re-syncing", d_sensor); - VRPN_MSG_INFO(errmsg); - vrpn_flush_input_buffer(serial_fd); - return 0; - } - - // Figure out how long the current report should be based on the - // settings for this sensor. - REPORT_LEN = report_length(d_sensor); - - // Got the station report -- to into PARTIAL mode and record - // that we got one character at this time. The next bit of code - // will attempt to read the rest of the report. - bufcount++; - status = vrpn_TRACKER_PARTIAL; - } - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. The routine that calls this one - // makes sure we get a full reading often enough (ie, it is responsible - // for doing the watchdog timing to make sure the tracker hasn't simply - // stopped sending characters). - //-------------------------------------------------------------------- - - ret = vrpn_read_available_characters(serial_fd, &buffer[bufcount], - REPORT_LEN-bufcount); - if (ret == -1) { - if (DEBUGA) fprintf(stderr,"[DEBUG]: Error Reading Report\n"); - VRPN_MSG_ERROR("Error reading report"); - status = vrpn_TRACKER_FAIL; - return 0; - } - bufcount += ret; - if (bufcount < REPORT_LEN) { // Not done -- go back for more - if (DEBUG) fprintf(stderr,"[DEBUG]: Don't have full report (%i of %i)\n",bufcount,REPORT_LEN); - return 0; - } - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. Check to make - // sure that its format matches what we expect. If it does, the next - // section will parse it. If it does not, we need to go back into - // synch mode and ignore this report. A well-formed report has the - // first character '0', the next character is the ASCII station - // number, and the third character is either a space or a letter. - //-------------------------------------------------------------------- - // fprintf(stderr,"[DEBUG]: Got full report\n"); - - if ( - ((buffer[0] != 'L') || (buffer[1] != 'Y')) - && - ((buffer[0] != 'P') || (buffer[1] != 'A')) - && - ((buffer[0] != 'L') || (buffer[1] != 'U')) - ) { - if (DEBUGA) fprintf(stderr,"[DEBUG]: Don't have LY or PA or 'LU' at beginning"); - status = vrpn_TRACKER_SYNCING; - VRPN_MSG_INFO("Not 'LY' or 'PA' or 'LU' in record, re-syncing"); - vrpn_flush_input_buffer(serial_fd); - return 0; - } - - if (buffer[bufcount-1] != ' ') { - status = vrpn_TRACKER_SYNCING; - VRPN_MSG_INFO("No space character at end of report, re-syncing\n"); - vrpn_flush_input_buffer(serial_fd); - if (DEBUGA) fprintf(stderr,"[DEBUG]: Don't have space at end of report, got (%c) sensor %i\n",buffer[bufcount-1], d_sensor); - - return 0; - } - - //Decode the error status and output a debug message - if (buffer[4] != ' ') { - // An error has been flagged - if (DEBUGA) fprintf(stderr,"[DEBUG]:Error Flag %i\n",buffer[4]); - } - - //-------------------------------------------------------------------- - // Decode the X,Y,Z of the position and the W,X,Y,Z of the quaternion - // (keeping in mind that we store quaternions as X,Y,Z, W). - //-------------------------------------------------------------------- - // The reports coming from the Liberty are in little-endian order, - // which is the opposite of the network-standard byte order that is - // used by VRPN. Here we swap the order to big-endian so that the - // routines below can pull out the values in the correct order. - // This is slightly inefficient on machines that have little-endian - // order to start with, since it means swapping the values twice, but - // that is more than outweighed by the cleanliness gained by keeping - // all architecture-dependent code in the vrpn_Shared.C file. - //-------------------------------------------------------------------- - - // Point at the first value in the buffer (position of the X value) - bufptr = &buffer[8]; - - // When copying the positions, convert from inches to meters, since the - // Liberty reports in inches and VRPN reports in meters. - pos[0] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr) * INCHES_TO_METERS; - pos[1] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr) * INCHES_TO_METERS; - pos[2] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr) * INCHES_TO_METERS; - - // Change the order of the quaternion fields to match quatlib order - d_quat[Q_W] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - d_quat[Q_X] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - d_quat[Q_Y] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - d_quat[Q_Z] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - - //-------------------------------------------------------------------- - // Decode the time from the Liberty system (unsigned 32bit int), add it to the - // time we zeroed the tracker, and update the report time. Remember - // to convert the MILLIseconds from the report into MICROseconds and - // seconds. - //-------------------------------------------------------------------- - - struct timeval delta_time; // Time since the clock was reset - - // Read the integer value of the time from the record. - vrpn_uint32 read_time = vrpn_unbuffer_from_little_endian<vrpn_uint32>(bufptr); - - // Convert from the float in MILLIseconds to the struct timeval - delta_time.tv_sec = (long)(read_time / 1000); // Integer trunction to seconds - vrpn_uint32 read_time_milliseconds = read_time_milliseconds = read_time - delta_time.tv_sec * 1000; // Subtract out what we just counted - delta_time.tv_usec = (long)(read_time_milliseconds * 1000); // Convert remainder to MICROseconds - - // The time that the report was generated - timestamp = vrpn_TimevalSum(liberty_zerotime, delta_time); - vrpn_gettimeofday(&watchdog_timestamp, NULL); // Set watchdog now - - //-------------------------------------------------------------------- - // If this sensor has button on it, decode the button values - // into the button device and mainloop the button device so that - // it will report any changes. - //-------------------------------------------------------------------- - - if (stylus_buttons[d_sensor]) { - // Read the integer value of the bytton status from the record. - vrpn_uint32 button_status = vrpn_unbuffer_from_little_endian<vrpn_uint32>(bufptr); - - stylus_buttons[d_sensor]->set_button(0, button_status); - stylus_buttons[d_sensor]->mainloop(); - } - - //-------------------------------------------------------------------- - // Done with the decoding, set the report to ready - //-------------------------------------------------------------------- - - status = vrpn_TRACKER_SYNCING; - bufcount = 0; - -#ifdef VERBOSE2 - print_latest_report(); -#endif - - return 1; -} - -// this routine is called when an "Stylus" button is encountered -// by the tracker init string parser it sets up the VRPN button -// device -int vrpn_Tracker_Liberty::add_stylus_button(const char *button_device_name, int sensor, int numbuttons) -{ - // Make sure this is a valid sensor - if ( (sensor < 0) || (sensor >= num_stations) ) { - return -1; - } - - // Add a new button device and set the pointer to point at it. - stylus_buttons[sensor] = new vrpn_Button_Server(button_device_name, d_connection, numbuttons); - if (stylus_buttons[sensor] == NULL) { - VRPN_MSG_ERROR("Cannot open button device"); - return -1; - } - - // Send a new station-format command to the tracker so it will report the button states. - return set_sensor_output_format(sensor); -} diff --git a/src/vrpn/vrpn_Tracker_Liberty.h b/src/vrpn/vrpn_Tracker_Liberty.h deleted file mode 100644 index 396d5fdaf678b046e6619130811021a95bdcc5f1..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_Liberty.h +++ /dev/null @@ -1,78 +0,0 @@ -// vrpn_Tracker_Liberty.h -// This file contains the class header for a Polhemus Liberty Tracker. -// This file is based on the vrpn_Tracker_Fastrak.h file, with modifications made -// to allow it to operate a Liberty instead. -// It has been tested on Linux and relies on being able to open the USB -// port as a named port and using serial commands to communicate with it. - -#ifndef VRPN_TRACKER_LIBERTY_H -#define VRPN_TRACKER_LIBERTY_H - -#include <stdio.h> // for NULL - -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker_Serial -#include "vrpn_Types.h" // for vrpn_uint32 - -class VRPN_API vrpn_Button_Server; -class VRPN_API vrpn_Connection; - -const int vrpn_LIBERTY_MAX_STATIONS = 8; //< How many stations can exist -const int vrpn_LIBERTY_MAX_WHOAMI_LEN = 1024; //< Maximum whoami response length - -class VRPN_API vrpn_Tracker_Liberty: public vrpn_Tracker_Serial { - - public: - - /// The constructor is given the name of the tracker (the name of - /// the sender it should use), the connection on which it is to - /// send its messages, the name of the serial port it is to open - /// (default is /dev/ttyS0 (first serial port in Linux)), the baud - /// rate at which it is to communicate (default 19200), whether - /// filtering is enabled (default yes), and the number of stations - /// that are possible on this Liberty (default 4). The station select - /// switches on the front of the Liberty determine which stations are - /// active. The final parameter is a string that can contain additional - /// commands that are set to the tracker as part of its reset routine. - /// These might be used to set the hemisphere or other things that are - /// not normally included; see the Liberty manual for a list of these. - /// There can be multiple lines of them but putting <CR> into the string. - - vrpn_Tracker_Liberty(const char *name, vrpn_Connection *c, - const char *port = "/dev/ttyS0", long baud = 115200, - int enable_filtering = 1, int numstations = vrpn_LIBERTY_MAX_STATIONS, - const char *additional_reset_commands = NULL, int whoamilen = 195); - - ~vrpn_Tracker_Liberty(); - - /// Add a stylus (with button) to one of the sensors. - int add_stylus_button(const char *button_device_name, - int sensor, int numbuttons = 1); - protected: - - virtual int get_report(void); - virtual void reset(); - - struct timeval reset_time; - int do_filter; //< Should we turn on filtering for pos/orient? - int num_stations; //< How many stations maximum on this Liberty? - int num_resets; //< How many resets we've tried this time. - char add_reset_cmd[2048]; //< Additional reset commands to be sent - int whoami_len; - int got_single_sync_char; - - struct timeval liberty_zerotime; //< When the liberty time counter was zeroed - struct timeval liberty_timestamp; //< The time returned from the Liberty System - vrpn_uint32 REPORT_LEN; //< The length that the current report should be - - vrpn_Button_Server *stylus_buttons[vrpn_LIBERTY_MAX_STATIONS]; //< Pointer to button on each sensor (NULL if none) - - /// Augments the basic Liberty format - int set_sensor_output_format(int sensor); - - /// Augments the basic Liberty report length - int report_length(int sensor); -}; - -#endif diff --git a/src/vrpn/vrpn_Tracker_LibertyHS.C b/src/vrpn/vrpn_Tracker_LibertyHS.C deleted file mode 100644 index c071f8059d418a0f9b090158f6c5b7fe26da29a1..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_LibertyHS.C +++ /dev/null @@ -1,791 +0,0 @@ -// vrpn_Tracker_LibertyHS.C -// This file contains the class header for a High Speed Polhemus Liberty -// Latus Tracker. -// This file is based on the vrpn_Tracker_Liberty.C file, with modifications made -// to allow it to operate a Liberty Latus instead. It has been tested on Linux. - -#include <ctype.h> // for isprint -#include <stdio.h> // for fprintf, stderr, sprintf, etc -#include <stdlib.h> // for atoi -#include <string.h> // for strlen, strncpy, strtok - -#include "quat.h" // for Q_W, Q_X, Q_Y, Q_Z -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_WARNING, etc -#include "vrpn_Connection.h" // for vrpn_Connection -#include "vrpn_Shared.h" // for vrpn_SleepMsecs, timeval, etc -#include "vrpn_Tracker.h" // for vrpn_TRACKER_FAIL, etc -#include "vrpn_Tracker_LibertyHS.h" -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_LIBUSB_1_0) - -#include <libusb.h> // for libusb_bulk_transfer, etc - -#define INCHES_TO_METERS (2.54f/100.0f) -const bool METRIC_UNITS = true; -const bool DEBUG = false; // General Debug Messages -const bool DEBUGA = false; // Only errors - -vrpn_Tracker_LibertyHS::vrpn_Tracker_LibertyHS(const char *name, vrpn_Connection *c, - long baud, int enable_filtering, int numstations, - int receptoridx, const char *additional_reset_commands, int whoamilen) : - vrpn_Tracker_USB(name,c,LIBERTYHS_VENDOR_ID,LIBERTYHS_PRODUCT_ID,baud), - do_filter(enable_filtering), - num_stations(numstations>vrpn_LIBERTYHS_MAX_STATIONS ? vrpn_LIBERTYHS_MAX_STATIONS : numstations), - receptor_index(receptoridx), - num_resets(0), - whoami_len(whoamilen>vrpn_LIBERTYHS_MAX_WHOAMI_LEN ? vrpn_LIBERTYHS_MAX_WHOAMI_LEN : whoamilen), - sync_index(-1), read_len(0) -{ - if (additional_reset_commands == NULL) { - sprintf(add_reset_cmd, ""); - } else { - strncpy(add_reset_cmd, additional_reset_commands, sizeof(add_reset_cmd)-1); - } - - if (DEBUG) fprintf(stderr,"[DEBUG] Constructed LibertyHS Object\n"); -} - -vrpn_Tracker_LibertyHS::~vrpn_Tracker_LibertyHS() -{ - - fprintf(stderr," interrupting continuous print output mode\n"); - char pollCommand = 'P'; - write_usb_data(&pollCommand,1); - vrpn_SleepMsecs(1000.0); // Sleep for a second to let it respond - flush_usb_data(); - -} - -/** This routine augments the basic sensor-output setting function of the LibertyHS - . It sets the device for position + quaternion + any of - the extended fields. It puts a space at the end so that we can check to make - sure we have complete good records for each report. - - Returns 0 on success and -1 on failure. -*/ - -int vrpn_Tracker_LibertyHS::set_sensor_output_format(int sensor) -{ - // Set output format for the station to be position and quaternion. - // This command is a capitol 'o' followed by '*' to format all sensors - // if sensor equals -1 or by the number of one specific station, - // then comma-separated values (2 for xyz, 7 for quat, 8 for timestamp, - // 0 for space) that indicate data sets, followed by character 13 (octal 15). - // Note that the sensor number has to be bumped to map to station number. - - char outstring[64]; - if (sensor == -1) - sprintf(outstring, "O*,2,7,8,9,0\015"); - else - sprintf(outstring, "O%d,2,7,8,9,0\015", sensor+1); - int len = strlen(outstring); - int ret; - - if (DEBUG) fprintf(stderr,"[DEBUG]: %s \n",outstring); - if ( (ret = write_usb_data(outstring,len)) != len) { -#ifdef libusb_strerror - fprintf(stderr,"vrpn_Tracker_LibertyHS::libusb_bulk_transfer(): Could not send: %s\n", - libusb_strerror(static_cast<libusb_error>(ret))); -#else - fprintf(stderr,"vrpn_Tracker_LibertyHS::libusb_bulk_transfer(): Could not send: code %d\n", - ret); -#endif - status = vrpn_TRACKER_FAIL; - return -1; - } - vrpn_SleepMsecs(50); // Sleep for a bit to let command run - - return 0; - } - -/** This routine augments the standard LibertyHS report (3 initial characters + - 3*4 for position + 4*4 for quaternions) to include the timestamp for the given sensor. - - It returns the number of characters total to expect for a report for the - given sensor. -*/ - -int vrpn_Tracker_LibertyHS::report_length(int sensor) -{ - int len; - - len = 9; // Basic report: Header information (8) + space at the end (1) - len += 3*4; // Four bytes/float, 3 floats for position - len += 4*4; // Four bytes/float, 4 floats for quaternion - len += 4; // Timestamp - len += 4; // Framecount - - return len; -} - - -int vrpn_Tracker_LibertyHS::write_usb_data(void* data, int len) -{ - int sent_len = 0; - int ret = libusb_bulk_transfer(_device_handle, LIBERTYHS_WRITE_EP | LIBUSB_ENDPOINT_OUT, - (vrpn_uint8*)data, len, &sent_len, 50); - - if (ret != 0) - fprintf(stderr,"vrpn_Tracker_LibertyHS::write_usb_data(): LIBUSB ERROR '%i'\n",ret); - - return sent_len; -} - - -int vrpn_Tracker_LibertyHS::read_usb_data(void* data, int maxlen, unsigned int timeout) -{ - int read_len = 0; - - int ret = libusb_bulk_transfer(_device_handle, LIBERTYHS_READ_EP | LIBUSB_ENDPOINT_IN, - (vrpn_uint8*)data, maxlen, &read_len, timeout); - - /* - fprintf(stderr,"vrpn_Tracker_LibertyHS::read_usb_data() READ %i chars: ___",read_len); - for (int i = 0; i < read_len; i++) { - if (isprint(((unsigned char*)data)[i])) { - fprintf(stderr,"%c",((unsigned char*)data)[i]); - } else { - fprintf(stderr,"[0x%02X]",((unsigned char*)data)[i]); - } - } - fprintf(stderr,"___ "); - if (ret != 0) fprintf(stderr," LIBUSB ERROR: code #'%i'\n",ret); else fprintf(stderr,"\n"); - */ - - // Success: return number of read bytes - return read_len; -} - -void vrpn_Tracker_LibertyHS::flush_usb_data() -{ - - int len; - vrpn_uint8 buf[VRPN_TRACKER_USB_BUF_SIZE]; - - // Flush usb data as long as they are available on usb port - do { - len = read_usb_data(buf, VRPN_TRACKER_USB_BUF_SIZE); - } while(len); - -} - - -// This routine will reset the tracker and set it to generate the types -// of reports we want. - -void vrpn_Tracker_LibertyHS::reset() -{ - int i,resetLen,ret; - char reset[10]; - char errmsg[512]; - char outstring1[64],outstring2[64],outstring3[64],outstring4[64]; - - //-------------------------------------------------------------------- - // This section deals with resetting the tracker to its default state. - // Multiple attempts are made to reset, getting more aggressive each - // time. This section completes when the tracker reports a valid status - // message after the reset has completed. - //-------------------------------------------------------------------- - - // Send the tracker a string that should reset it. The first time we - // try this, just do the normal 'c' command to put it into polled mode. - // after a few tries with this, use the '^Y' reset. Later, try to reset - // to the factory defaults. Then toggle the extended mode. - // Then put in a carriage return to try and break it out of - // a query mode if it is in one. These additions are cumulative: by the - // end, we're doing them all. - if (DEBUG) fprintf(stderr,"[DEBUG] Beginning Reset"); - resetLen = 0; - num_resets++; // We're trying another reset - - if (num_resets > 0) { // Try to get it out of a query loop if its in one - reset[resetLen++] = 'F'; - reset[resetLen++] = '0'; - reset[resetLen++] = (char) (13); // Return key -> get ready - } - - if (num_resets > 2) { - reset[resetLen++] = (char) (25); // Ctrl + Y -> reset the tracker - reset[resetLen++] = (char) (13); // Return Key - } - - reset[resetLen++] = 'P'; // Put it into polled (not continuous) mode - - sprintf(errmsg, "Resetting the tracker (attempt %d)", num_resets); - VRPN_MSG_WARNING(errmsg); - for (i = 0; i < resetLen; i++) { - if (write_usb_data(&reset[i],1) == 1) { - fprintf(stderr,"."); - vrpn_SleepMsecs(1000.0*2); // Wait after each character to give it time to respond - } else { - perror("Liberty: Failed writing to tracker"); - status = vrpn_TRACKER_FAIL; - return; - } - } - - if (num_resets > 2) { - vrpn_SleepMsecs(1000.0*20); // Sleep to let the reset happen, if we're doing ^Y - } - - fprintf(stderr,"\n"); - - // Get rid of the characters left over from before the reset - flush_usb_data(); - - // Make sure that the tracker has stopped sending characters - vrpn_SleepMsecs(1000.0*2); - unsigned char scrap[80]; - if ( (ret = read_usb_data((void*)scrap, 80)) != 0) { - sprintf(errmsg,"Got >=%d characters after reset",ret); - VRPN_MSG_WARNING(errmsg); - for (i = 0; i < ret; i++) { - if (isprint(scrap[i])) { - fprintf(stderr,"%c",scrap[i]); - } else { - fprintf(stderr,"[0x%02X]",scrap[i]); - } - } - fprintf(stderr, "\n"); - flush_usb_data(); // Flush what's left - } - - // Asking for tracker status. ^V (WhoAmI) is used. It retruns 288 bytes - char statusCommand[2]; - statusCommand[0]=(char)(22); // ^V - statusCommand[1]=(char)(13); // Return Key - - if (write_usb_data(&statusCommand[0],2) == 2) { - vrpn_SleepMsecs(1000.0); // Sleep for a second to let it respond - } else { - perror(" LibertyHS write failed (WhoAmI command)"); - status = vrpn_TRACKER_FAIL; - return; - } - - // Read Status - unsigned char statusmsg[vrpn_LIBERTYHS_MAX_WHOAMI_LEN+1]; - - // Attempt to read whoami_len characters. - if ( (ret = read_usb_data((void*)statusmsg, whoami_len)) != whoami_len) { - fprintf(stderr," Got %d of %d characters for status\n",ret, whoami_len); - } - - if ( (statusmsg[0]!='0') ) { - int i; - if (ret != -1) { - statusmsg[ret] = '\0'; // Null-terminate the string - } - fprintf(stderr, " LibertyHS: status is ("); - for (i = 0; i < ret; i++) { - if (isprint(statusmsg[i])) { - fprintf(stderr,"%c",statusmsg[i]); - } else { - fprintf(stderr,"[0x%02X]",statusmsg[i]); - } - } - fprintf(stderr,"\n)\n"); - VRPN_MSG_ERROR("Bad status report from LibertyHS, retrying reset"); - return; - } else { - VRPN_MSG_WARNING("LibertyHS gives status (this is good)"); - num_resets = 0; // Success, use simple reset next time - } - - //-------------------------------------------------------------------- - // Now that the tracker has given a valid status report, set all of - // the parameters the way we want them. - //-------------------------------------------------------------------- - - // Set output format for each of the possible stations. - - if (set_sensor_output_format()) { - return; - } - - // Enable filtering if the constructor parameter said to. - // Set filtering for both position (X command) and orientation (Y command) - // to the values that are recommended as a "jumping off point" in the - // LibertyHS manual. - - if (do_filter) { - if (DEBUG) fprintf(stderr,"[DEBUG]: Enabling filtering\n"); - - if (write_usb_data((void*)"X0.2,0.2,0.8,0.8\015", 17) == 17) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" LibertyHS write position filter failed"); - status = vrpn_TRACKER_FAIL; - return; - } - if (write_usb_data((void*)"Y0.2,0.2,0.8,0.8\015", 17) == 17) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" LibertyHS write orientation filter failed"); - status = vrpn_TRACKER_FAIL; - return; - } - } else { - if (DEBUG) fprintf(stderr,"[DEBUG]: Disabling filtering\n"); - - if (write_usb_data((void*)"X0,1,0,0\015", 9) == 9) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" LibertyHS write position filter failed"); - status = vrpn_TRACKER_FAIL; - return; - } - if (write_usb_data((void*)"Y0,1,0,0\015", 9) == 9) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" LibertyHS write orientation filter failed"); - status = vrpn_TRACKER_FAIL; - return; - } - } - - // Send the additional reset commands, if any, to the tracker. - // These commands come in lines, with character \015 ending each - // line. If a line start with an asterisk (*), treat it as a pause - // command, with the number of seconds to wait coming right after - // the asterisk. Otherwise, the line is sent directly to the tracker. - // Wait a while for them to take effect, then clear the input - // buffer. - if (strlen(add_reset_cmd) > 0) { - char *next_line; - char add_cmd_copy[sizeof(add_reset_cmd)]; - char string_to_send[sizeof(add_reset_cmd)]; - int seconds_to_wait, count; - - printf(" LibertyHS writing extended reset commands...\n"); - - // Make a copy of the additional reset string, since it is consumed - strncpy(add_cmd_copy, add_reset_cmd, sizeof(add_cmd_copy)); - - // Pass through the string, testing each line to see if it is - // a sleep command or a line to send to the tracker. Continue until - // there are no more line delimiters ('\015'). Be sure to write the - // \015 to the end of the string sent to the tracker. - // Note that strok() puts a NULL character in place of the delimiter. - - next_line = strtok(add_cmd_copy, "\015"); - count = 0; - while (next_line != NULL) { - if (next_line[0] == '*') { // This is a "sleep" line, see how long - seconds_to_wait = atoi(&next_line[1]); - fprintf(stderr," ...sleeping %d seconds\n",seconds_to_wait); - vrpn_SleepMsecs(1000.0*seconds_to_wait); - } else { // This is a command line, send it - sprintf(string_to_send, "%s\015", next_line); - fprintf(stderr," ...sending command: %s\n", string_to_send); - write_usb_data(string_to_send,strlen(string_to_send)); - vrpn_SleepMsecs(1000.0*2); - } - next_line = strtok(next_line+strlen(next_line)+1, "\015"); - } - - // Sleep a little while to let this finish, then clear the input buffer - vrpn_SleepMsecs(1000.0); - flush_usb_data(); - } - - // Disable USB BUFFERING mode - // (disbale output buffering before USB transmission to the host) - sprintf(outstring1, "@B0\r"); - if (write_usb_data(outstring1, strlen(outstring1)) == (int)strlen(outstring1)) { - fprintf(stderr, "\n Tracker USB buffering mode disabled\n"); - } - vrpn_SleepMsecs(1000.0); - - // Set METRIC units - if (METRIC_UNITS) { - sprintf(outstring2, "U1\r"); - if (write_usb_data(outstring2, strlen(outstring2)) == (int)strlen(outstring2)) { - fprintf(stderr, " LibertyHS set to metric units\n"); - } - } - else - fprintf(stderr, " LibertyHS set to English units\n"); - vrpn_SleepMsecs(1000.0); - - // Set data format to BINARY mode - sprintf(outstring3, "F1\r"); - if (write_usb_data(outstring3, strlen(outstring3)) == (int)strlen(outstring3)) { - fprintf(stderr, " LibertyHS set to binary mode\n\n"); - } - vrpn_SleepMsecs(1000.0); - - // Launch detected markers - if (launch_markers() != num_stations) { - fprintf(stderr, "\nCould not launch the %i requested markers\n", num_stations); - status = vrpn_TRACKER_FAIL; - return; - } else { - fprintf(stderr, "\nAll %i markers are ready!\n", num_stations); - } - - // Set tracker to CONTINUOUS mode - sprintf(outstring4, "C\r"); - if (write_usb_data(outstring4, strlen(outstring4)) != (int)strlen(outstring4)) { - perror(" LibertyHS write failed"); - status = vrpn_TRACKER_FAIL; - return; - } else { - fprintf(stderr, "\n LibertyHS set to continuous mode\n\n"); - } - - // If we are using the LibertyHS timestamps, clear the timer on the device and - // store the time when we cleared it. Send the reset command and - // store the time that we sent it. - - char clear_timestamp_cmd[] = "Q0\r"; - - if (write_usb_data(clear_timestamp_cmd, - strlen(clear_timestamp_cmd)) != (int)strlen(clear_timestamp_cmd)) { - VRPN_MSG_ERROR("Cannot send command to clear timestamp"); - status = vrpn_TRACKER_FAIL; - return; - } - - // Record the time as the base time from the tracker. - vrpn_gettimeofday(&liberty_zerotime, NULL); - - // Done with reset. - vrpn_gettimeofday(&watchdog_timestamp, NULL); // Set watchdog now - - VRPN_MSG_WARNING("Reset Completed (this is good)"); - status = vrpn_TRACKER_SYNCING; // We're trying for a new reading -} - - -// This function will try to read and send as many reports as there are -// sensors (i.e. num_stations). -// It reads characters until it has a full report, then put that report -// into the time, sensor, pos and quat fields so that it can -// be sent the next time through the loop. The time stored is that of -// the first character received as part of the report. Reports start with -// the header "0xy", where x is the station number and y is either the -// space character or else one of the characters "A-F". Characters "A-F" -// indicate weak signals and so forth, but in practice it is much harder -// to deal with them than to ignore them (they don't indicate hard error -// conditions). The report follows, 4 bytes per word in little-endian byte -// order; each word is an IEEE floating-point binary value. The first three -// are position in X,Y and Z. The next four are the unit quaternion in the -// order W, X,Y,Z. Then there is an ASCII space character at the end. -// If we get a report that is not valid, we assume that we have lost a -// character or something and re-synchronize with the LibertyHS by waiting -// until the start-of-report character ('0') comes around again. -// The routine that calls this one makes sure we get a full reading often -// enough (ie, it is responsible for doing the watchdog timing to make sure -// the tracker hasn't simply stopped sending characters). - -int vrpn_Tracker_LibertyHS::get_report(void) -{ - char errmsg[512]; // Error message to send to VRPN - unsigned char *bufptr; // Points into buffer at the current value to read - - //-------------------------------------------------------------------- - // Each report starts with the ASCII 'LU' characters. If we're synching, - // read available bytes and check if we find the 'LU' characters. - //-------------------------------------------------------------------- - - for (int i = 0; i < num_stations; i++) - { - // Read new data from USB buffer if we are in Syncing mode - if (status == vrpn_TRACKER_SYNCING) { - read_len = read_usb_data(buffer, VRPN_TRACKER_USB_BUF_SIZE); - - if (read_len < 1) { - if (DEBUG) fprintf(stderr,"[DEBUG]: Missed First Sync Char, read_len = %i\n",read_len); - return 0; - } - - status = vrpn_TRACKER_PARTIAL; - sync_index = 0; - } - else { // Partial mode (status = vrpn_TRACKER_PARTIAL) - bufcount = 0; - } - - // Try to get the two first sync characters. If none, just return. - while (sync_index < read_len - 1) { - - // If it is not 'LU', we don't want it but we - // need to look at the next one, so just keep reading the buffer - // and stay in Syncing mode until we find them. - if ((buffer[sync_index] == 'L') && (buffer[sync_index + 1] == 'U')) { - if (DEBUG) fprintf(stderr,"[DEBUG]: Getting Report - Got LU\n"); - bufcount = 2; - break; - } - - if (DEBUG) fprintf(stderr,"[DEBUGA] While syncing: Getting Report - Not LU, Got Character %c \n",buffer[sync_index]); - sync_index++; - - } - - // Try to get next character. If none, just return and go back to Syncing mode. - if ( static_cast<vrpn_int32>(sync_index + bufcount) >= (read_len - 1) ) { - return 0; - } - - // Get sensor number - if (DEBUG) fprintf(stderr,"[DEBUG]: Awaiting Station - Got Station (%i) \n",buffer[sync_index + bufcount]); - d_sensor = buffer[sync_index + bufcount] - 1; // Convert ASCII 1 to sensor 0 and so on. - if ( (d_sensor < 0) || (d_sensor >= vrpn_LIBERTYHS_MAX_STATIONS) ) { - sprintf(errmsg,"Bad sensor # (%d) in record, re-syncing", d_sensor + 1); - VRPN_MSG_INFO(errmsg); - status = vrpn_TRACKER_PARTIAL; - sync_index += bufcount; - continue; - } - - bufcount++; - - // Figure out how long the current report should be based on the - // settings for this sensor. - REPORT_LEN = report_length(d_sensor); - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. The routine that calls this one - // makes sure we get a full reading often enough (ie, it is responsible - // for doing the watchdog timing to make sure the tracker hasn't simply - // stopped sending characters). - //-------------------------------------------------------------------- - - if (read_len - sync_index < static_cast<vrpn_int32>(REPORT_LEN)) { - if (DEBUG) fprintf(stderr,"[DEBUG]: Don't have full report (%i of %i)\n", - read_len - sync_index,REPORT_LEN); - return 0; - } - - // Full report available - bufcount = REPORT_LEN; - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. Check to make - // sure that its format matches what we expect. If it does, the next - // section will parse it. If it does not, we need to go to Partial mode - // and ignore this report. A well-formed report has the - // first characters 'LU', the next character is the ASCII station - // number, and the third character is either a space or a letter. - //-------------------------------------------------------------------- - if (DEBUG) fprintf(stderr,"[DEBUG]: Got full report\n"); - - if ((buffer[sync_index] != 'L') || (buffer[sync_index + 1] != 'U')) { - if (DEBUGA) fprintf(stderr,"[DEBUG]: Don't have 'LU' at beginning"); - VRPN_MSG_INFO("Not 'LU' in record, re-syncing"); - status = vrpn_TRACKER_PARTIAL; - sync_index++; - continue; - } - - if (buffer[sync_index + bufcount - 1] != ' ') { - VRPN_MSG_INFO("No space character at end of report, re-syncing\n"); - if (DEBUGA) fprintf(stderr,"[DEBUG]: Don't have space at end of report, got (%c) sensor %i\n", - buffer[sync_index + bufcount - 1], d_sensor); - status = vrpn_TRACKER_PARTIAL; - sync_index++; - continue; - } - - // Decode the error status and output a debug message - - if (buffer[sync_index + 4] != ' ') { - // An error has been flagged - if (DEBUGA) fprintf(stderr,"[DEBUG]:Error Flag %i\n",buffer[sync_index + 4]); - } - - //-------------------------------------------------------------------- - // Decode the X,Y,Z of the position and the W,X,Y,Z of the quaternion - // (keeping in mind that we store quaternions as X,Y,Z, W). - //-------------------------------------------------------------------- - // The reports coming from the LibertyHS are in little-endian order, - // which is the opposite of the network-standard byte order that is - // used by VRPN. Here we swap the order to big-endian so that the - // routines below can pull out the values in the correct order. - // This is slightly inefficient on machines that have little-endian - // order to start with, since it means swapping the values twice, but - // that is more than outweighed by the cleanliness gained by keeping - // all architecture-dependent code in the vrpn_Shared.C file. - //-------------------------------------------------------------------- - - // Point at the first value in the report (position of the X value) - bufptr = &buffer[sync_index + 8]; - - // When copying the positions, convert from inches to meters, since the - // LibertyHS reports in inches and VRPN reports in meters. - float convFactor = METRIC_UNITS ? 1.0f : INCHES_TO_METERS; - pos[0] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr) * convFactor; - pos[1] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr) * convFactor; - pos[2] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr) * convFactor; - - - // Change the order of the quaternion fields to match quatlib order - d_quat[Q_W] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - d_quat[Q_X] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - d_quat[Q_Y] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - d_quat[Q_Z] = vrpn_unbuffer_from_little_endian<vrpn_float32>(bufptr); - - //-------------------------------------------------------------------- - // Decode the time from the LibertyHS system (unsigned 32bit int), add it to the - // time we zeroed the tracker, and update the report time. Remember - // to convert the MILLIseconds from the report into MICROseconds and - // seconds. - //-------------------------------------------------------------------- - - struct timeval delta_time; // Time since the clock was reset - - // Read the integer value of the time from the record. - vrpn_uint32 read_time = vrpn_unbuffer_from_little_endian<vrpn_uint32>(bufptr); - - // Convert from the float in MILLIseconds to the struct timeval - delta_time.tv_sec = (long)(read_time / 1000); // Integer trunction to seconds - vrpn_uint32 read_time_milliseconds = read_time - delta_time.tv_sec * 1000; // Subtract out what we just counted - delta_time.tv_usec = (long)(read_time_milliseconds * 1000); // Convert remainder to MICROseconds - - // The time that the report was generated - timestamp = vrpn_TimevalSum(liberty_zerotime, delta_time); - vrpn_gettimeofday(&watchdog_timestamp, NULL); // Set watchdog now - - // The frame number corresponding to the report - frame_count = vrpn_unbuffer_from_little_endian<vrpn_uint32>(bufptr); - - /* - fprintf(stderr,"READ_TIME = %d,%d + liberty_zerotime %d,%d = TIMESTAMP %d,%d ; WATCHDOG = %d,%d\n", - (int)delta_time.tv_sec,(int)delta_time.tv_usec, - (int)liberty_zerotime.tv_sec, (int)liberty_zerotime.tv_usec, - (int)timestamp.tv_sec,(int)timestamp.tv_usec, - (int)watchdog_timestamp.tv_sec,(int)watchdog_timestamp.tv_usec); - */ - /* - print_latest_report(); - double delta = vrpn_TimevalMsecs(vrpn_TimevalDiff(watchdog_timestamp,liberty_zerotime)) - (double) read_time; - fprintf(stderr,"--> LATENCY = %6.3f msec\n",delta); - */ - - - //-------------------------------------------------------------------- - // Done with the decoding, send the report - //-------------------------------------------------------------------- - - send_report(); - - // Check if there's still data to read in the buffer - sync_index += bufcount; - if (sync_index < read_len) { - // There might be remaining reports from other trackers in buffer. - // Go to Partial mode. - status = vrpn_TRACKER_PARTIAL; - } - else { - // There is no more report in buffer - break; - } - -#ifdef VERBOSE2 - print_latest_report(); -#endif - } - - return 1; -} - - -int vrpn_Tracker_LibertyHS::test_markers() -{ - // Define a marker map request - char mapmsg[4]; - mapmsg[0] = (char) (21); // Ctrl + U -> active marker map - mapmsg[1] = '0'; - mapmsg[2] = (char) (13); // Return Key - - // Send a marker map command to the tracker - if (write_usb_data(&mapmsg[0], 3) == 3) { - vrpn_SleepMsecs(1000.0*1); // Sleep for a second to let it respond - } else { - perror(" LibertyHS write failed"); - return 0; - } - - // Read binary output record - unsigned char markermap[vrpn_LIBERTYHS_MAX_MARKERMAP_LEN+1]; - int ret = read_usb_data((void*)markermap, vrpn_LIBERTYHS_MAX_MARKERMAP_LEN); - if (ret != vrpn_LIBERTYHS_MAX_MARKERMAP_LEN) { - fprintf(stderr," Got %d of %d bytes for marker map\n",ret,vrpn_LIBERTYHS_MAX_MARKERMAP_LEN); - return 0; - } - - // Flush what's left - flush_usb_data(); - - // Check marker map to identify launched markers - int marker_found = 0; - unsigned char mask = (char) (1); - for (int bit = 1; bit <= vrpn_LIBERTYHS_MAX_STATIONS; bit++) { - if (mask & markermap[10]) { - marker_found++; - fprintf(stderr,"Tracker #%i launched\n",bit); - } - mask *= 2; - } - - return marker_found; -} - - -int vrpn_Tracker_LibertyHS::launch_markers() -{ - fprintf(stderr,"\nDetect and launch %i markers:\n\n",num_stations); - - // Clear the input buffer - flush_usb_data(); - - // Check if the markers are already launched - int marker_found = test_markers (); - if (marker_found > 0) { - fprintf(stderr,"\nWARNING: %i markers are already launched! If you want to change markers,\n",marker_found); - fprintf(stderr, " turn off the SEU (System Electronics Unit) and run this application again.\n"); - return marker_found; - } - - // Define a launch marker request - char launchmsg[4]; - launchmsg[0] = 'L'; // 'Li' command line (i.e. launch new tracker near receptor i) - launchmsg[1] = (char) ((int) '0' + receptor_index); - launchmsg[2] = (char) (13); // Return Key - - // Detect and launch num_stations markers - while (marker_found < num_stations) { - - // Wait for the user to place a tracker for activation - fprintf(stderr,"\n--> PLACE A NEW POWERED UP MARKER UNDER RECEPTOR #%i\n ",receptor_index); - for (int i = 10; i > 0 ; i--) { - fprintf(stderr,"%i...",i); - vrpn_SleepMsecs(1000.0); - } - - // Send a launch marker command to receptor 'receptor_index' - fprintf(stderr," sending LAUNCH MARKER command\n DON'T MOVE THE TRACKER!\n\n"); - if (write_usb_data(&launchmsg[0], 3) == 3) { - vrpn_SleepMsecs(1000.0*2); // Wait after each character to give it time to respond - } else { - perror("LibertyHS: Failed writing launch marker command to tracker"); - break; - } - - // Check if the markers are already launched - if (test_markers () == num_stations) - marker_found = num_stations; - } - - return marker_found; -} - -// End of LIBUSB -#endif diff --git a/src/vrpn/vrpn_Tracker_LibertyHS.h b/src/vrpn/vrpn_Tracker_LibertyHS.h deleted file mode 100644 index cbd97349a3f864153edc9c511dc5f41712f40719..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_LibertyHS.h +++ /dev/null @@ -1,107 +0,0 @@ -// vrpn_Tracker_LibertyHS.h -// This file contains the class header for a High Speed Polhemus Liberty -// Latus Tracker. -// This file is based on the vrpn_Tracker_Liberty.h file, with modifications made -// to allow it to operate a Liberty Latus instead. It has been tested on Linux. - -#ifndef VRPN_TRACKER_LIBERTYHS_H -#define VRPN_TRACKER_LIBERTYHS_H - -#include <stdio.h> // for NULL - -#include "vrpn_Configure.h" // for VRPN_API, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker_USB -#include "vrpn_Types.h" // for vrpn_uint16, vrpn_uint8, etc - -class VRPN_API vrpn_Connection; - -#if defined(VRPN_USE_LIBUSB_1_0) - -// Vendor and product IDs for High Speed Liberty Latus tracker -static const vrpn_uint16 LIBERTYHS_VENDOR_ID = 0x0f44; -static const vrpn_uint16 LIBERTYHS_PRODUCT_ID = 0xff20; - -// Endpoints to communicate with the USB device -static const vrpn_uint8 LIBERTYHS_WRITE_EP = 0x04; -static const vrpn_uint8 LIBERTYHS_READ_EP = 0x88; - -const int vrpn_LIBERTYHS_MAX_STATIONS = 8; //< How many stations (i.e. markers) can exist -const int vrpn_LIBERTYHS_MAX_WHOAMI_LEN = 1024; //< Maximum whoami response length -const int vrpn_LIBERTYHS_MAX_MARKERMAP_LEN = 12; //< Maximum active marker map response length - - -class VRPN_API vrpn_Tracker_LibertyHS: public vrpn_Tracker_USB { - - public: - - /// The constructor is given the name of the tracker (the name of - /// the sender it should use), the connection on which it is to - /// send its messages, the baud rate at which it is to communicate - /// (default 115200), whether filtering is enabled (default yes), - /// the number of stations that are possible on this LibertyHS (default 8) - /// and the receptor used to launch the stations (default 1). - /// The final parameter is a string that can contain additional - /// commands that are set to the tracker as part of its reset routine. - /// These might be used to set the hemisphere or other things that are - /// not normally included; see the Liberty Latus manual for a list of these. - /// There can be multiple lines of them but putting <CR> into the string. - - vrpn_Tracker_LibertyHS(const char *name, vrpn_Connection *c, - long baud = 115200, int enable_filtering = 1, - int numstations = vrpn_LIBERTYHS_MAX_STATIONS, - int receptoridx = 1, const char *additional_reset_commands = NULL, - int whoamilen = 288); - - ~vrpn_Tracker_LibertyHS(); - - protected: - - virtual int get_report(void); - virtual void reset(); - - - int do_filter; //< Should we turn on filtering for pos/orient? - int num_stations; //< How many stations (trackers) on this LibertyHS? - int receptor_index; //< Index of receptor used to detect and launch the markers - int num_resets; //< Number of resets we've tried this time. - char add_reset_cmd[2048]; //< Additional reset commands to be sent - int whoami_len; //< Number of chars in whoami response - int read_len; //< Number of bytes in usb read buffer - int sync_index; //< Index of first sync char in usb read buffer - - struct timeval liberty_zerotime; //< When the liberty time counter was zeroed - struct timeval liberty_timestamp; //< The time returned from the LibertyHS System - vrpn_uint32 REPORT_LEN; //< The length that the current report should be - - - /// Augments the basic LibertyHS format - int set_sensor_output_format(int sensor = -1); - - /// Augments the basic LibertyHS report length - int report_length(int sensor); - - /// Writes len bytes from data buffer to USB device - int write_usb_data(void* data,int len); - - /// Reads at most maxlen bytes from USB device and copy them into - /// data buffer. Returns the number of read bytes. - /// The maximum period in milliseconds to wait for reading USB data - /// is defined by parameter timeout. - int read_usb_data(void* data,int maxlen,unsigned int timeout = 50); - - /// Empties the USB read buffer - void flush_usb_data(); - - /// Launches num_stations markers using receptor receptor_index to detect them. - int test_markers(); - - /// Returns the number of detected and lauched trackers - int launch_markers(); -}; - -// End of LIBUSB -#endif - -// End of VRPN_TRACKER_LIBERTYHS_H -#endif diff --git a/src/vrpn/vrpn_Tracker_MotionNode.C b/src/vrpn/vrpn_Tracker_MotionNode.C deleted file mode 100644 index 2a3f1d043ba7735de9eff50c68d90d05dbcddbff..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_MotionNode.C +++ /dev/null @@ -1,390 +0,0 @@ -/* -Copyright (C) Motion Workshop 2014. Public domain. - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ -#include "vrpn_Tracker_MotionNode.h" -#ifdef VRPN_USE_MOTIONNODE - -// Option to print out more information for run-time testing. -//#define TRACKER_MOTIONNODE_TEST 1 - -// -// Use the binary Motion C API library provided by Motion Workshop. The library -// is loaded dynamically at run-time and is not required to compile this -// tracker The C API is available in your software installation or directly -// from Motion Workshop at: -// -// http://www.motionnode.com/sdk.html#capi -// -// The API is not required to compile this tracker class. The binary -// library is required at run-time to connect to the MotionNode data -// streams. -// -//#include <MotionNodeCAPI.h> - -// For convenience, the functions we will use are included directly in this -// file. No external compile time dependencies. -#if !defined(MNCAPI_PREVIEW_SIZE) - -#if defined(_WIN32) -# define MNCAPI_IMPORT_API __declspec(dllimport) -# define MNCAPI_CALL_API __cdecl -#else -# define MNCAPI_IMPORT_API -# define MNCAPI_CALL_API -#endif // defined(_WIN32) - -extern "C" { - -#define MNCAPI_PREVIEW_SIZE (14) - -enum mncapi_error_t { - MNCAPI_FAILURE = 0, - MNCAPI_SUCCESS = 1 -}; - -enum mncapi_stream_t { - MNCAPI_PREVIEW = 1, - MNCAPI_SENSOR = 2, - MNCAPI_RAW = 3 -}; - -} - -#endif // !defined(MNCAPI_PREVIEW_SIZE) - -#include <string> -#include <vector> - -#if defined(_WIN32) -# include <windows.h> -# define MOTION_C_API_LIBRARY "MotionCAPI.dll" -#else -# include <dlfcn.h> -# include <stdlib.h> -# if defined(__APPLE__) -# define MOTION_C_API_LIBRARY "libMotionCAPI.dylib" -# else -# define MOTION_C_API_LIBRARY "libMotionCAPI.so" -# endif // __APPLE__ -# define GetProcAddress dlsym -#endif // _WIN32 - -typedef int (MNCAPI_CALL_API *MNCAPI_OPEN_HOST_FN)(enum mncapi_stream_t, const char *, int); -typedef int (MNCAPI_CALL_API *MNCAPI_SAMPLE_FN)(int, float *, int); -typedef void (MNCAPI_CALL_API *MNCAPI_CLOSE_FN)(int); - - -/** - Just a local class definition to model the SDK Sampler class. This class - stores all of the dynamically loaded library and symbol information from - the C API. - - The constructor loads the library, connects, and binds useful function symbols. - - The destructor unloads the library after closing any active connections. -*/ -class Sampler { -public: - typedef std::vector<float> data_type; - - Sampler(const std::string &address, unsigned port); - ~Sampler(); - - bool get_data_block(data_type &data, const unsigned &num_sensor); - -private: - int m_handle; -#if defined(_WIN32) - HMODULE m_library_handle; -#else - void *m_library_handle; -#endif // WIN32 - MNCAPI_SAMPLE_FN m_mncapi_sample; -}; // class Sampler - -typedef Sampler sampler_type; - - -vrpn_Tracker_MotionNode::vrpn_Tracker_MotionNode(const char *name, - vrpn_Connection *c, - unsigned num_sensor, - const char *address, - unsigned port) - : vrpn_Tracker(name, c), m_num_sensor(num_sensor), m_handle(NULL) -{ -#if defined(TRACKER_MOTIONNODE_TEST) - printf("vrpn_Tracker_MotionNode {\n"); -#endif // TRACKER_MOTIONNODE_TEST - - register_server_handlers(); - - { - std::string remote_address = "127.0.0.1"; - unsigned remote_port = 32079; - if (NULL != address) { - remote_address = address; - } - if (port > 0) { - remote_port = port; - } - - sampler_type *sampler = new sampler_type(address, port); - - // Attempt to read a single sample from - // the stream. - for (int i=0; i<4; i++) { - sampler_type::data_type data; - if (sampler->get_data_block(data, m_num_sensor) && !data.empty()) { - m_handle = sampler; - sampler = NULL; - break; - } - } - - if (NULL == m_handle) { - fprintf(stderr, "MotionNode driver failed to start sampling, device not currently reading\n"); - } -#if defined(TRACKER_MOTIONNODE_TEST) - else { - printf( - "Connected to Motion data service at \"%s:%d\"\n", - remote_address.c_str(), remote_port); - } -#endif // TRACKER_MOTIONNODE_TEST - - // Clean up resources now if the sampler was never - // copied into this object. - if ((NULL == m_handle) && (NULL != sampler)) { - delete sampler; - } - } - - if (NULL != m_handle) { - vrpn_Tracker::status = vrpn_TRACKER_SYNCING; - } else { - vrpn_Tracker::status = vrpn_TRACKER_FAIL; - } - -#if defined(TRACKER_MOTIONNODE_TEST) - printf("} vrpn_Tracker_MotionNode, status=%d\n", vrpn_Tracker::status); -#endif // TRACKER_MOTIONNODE_TEST -} - -vrpn_Tracker_MotionNode::~vrpn_Tracker_MotionNode() -{ -#if defined(TRACKER_MOTIONNODE_TEST) - printf("~vrpn_Tracker_MotionNode() {\n"); -#endif // TRACKER_MOTIONNODE_TEST - - if (NULL != m_handle) { - sampler_type *sampler = reinterpret_cast<sampler_type *>(m_handle); - delete sampler; - - m_handle = NULL; - } - -#if defined(TRACKER_MOTIONNODE_TEST) - printf("} ~vrpn_Tracker_MotionNode()\n"); -#endif // TRACKER_MOTIONNODE_TEST -} - -void vrpn_Tracker_MotionNode::mainloop() -{ - // Call the generic server mainloop, since we are a server - server_mainloop(); - - get_report(); -} - -void vrpn_Tracker_MotionNode::get_report() -{ - if (NULL != m_handle) { - sampler_type *sampler = reinterpret_cast<sampler_type *>(m_handle); - - sampler_type::data_type data; - if (sampler->get_data_block(data, m_num_sensor) && !data.empty()) { - - for (std::size_t i=0; i<m_num_sensor; i++) { - const std::size_t index = i * MNCAPI_PREVIEW_SIZE; - if (index + 4 < data.size()) { - - vrpn_Tracker::d_sensor = i; - vrpn_Tracker::d_quat[0] = data[index + 1]; - vrpn_Tracker::d_quat[1] = data[index + 2]; - vrpn_Tracker::d_quat[2] = data[index + 3]; - vrpn_Tracker::d_quat[3] = data[index + 0]; - - send_report(); - } - } - - } - } - -} - -void vrpn_Tracker_MotionNode::send_report() -{ - // Send the message on the connection - if (NULL != vrpn_Tracker::d_connection) { - char buffer[1024]; - int len = encode_to(buffer); - if (vrpn_Tracker::d_connection->pack_message(len, timestamp, position_m_id, d_sender_id, buffer, vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "MotionNode: cannot write message: tossing\n"); - } - } -} - - -Sampler::Sampler(const std::string &address, unsigned port) - : m_handle(0), m_library_handle(NULL), m_mncapi_sample(NULL) -{ - // Load the dynamic library. This will use the search paths - // and fail if the library can not be found. -#if defined(_WIN32) - - HMODULE library_handle = LoadLibrary(MOTION_C_API_LIBRARY); - if (NULL == library_handle) { - library_handle = LoadLibrary("C:/Program Files/Motion/tools/plugin/capi/" MOTION_C_API_LIBRARY); - } - -#else - - // Manually search for the shared library in likely locations. - const char *SearchPaths[3] = { - MOTION_C_API_LIBRARY, - "./" MOTION_C_API_LIBRARY, -#if defined(__APPLE__) - "/Applications/Motion.app/Contents/Resources/tools/plugin/capi" MOTION_C_API_LIBRARY -#else - "/opt/Motion/tools/plugin/capi" MOTION_C_API_LIBRARY -#endif // defined(__APPLE__) - }; - - void *library_handle = NULL; - for (int i=0; i<3; i++) { - library_handle = dlopen(SearchPaths[i], RTLD_LAZY); - if (NULL != library_handle) { -#if defined(TRACKER_MOTIONNODE_TEST) - printf("Loaded Motion C API library, \"%s\"\n", SearchPaths[i]); -#endif // TRACKER_MOTIONNODE_TEST - break; - } - } - -#endif // defined(_WIN32) - - if (NULL != library_handle) { - m_library_handle = library_handle; - - // Bind the open function and connect to the data service. - MNCAPI_OPEN_HOST_FN mncapi_open_host = - reinterpret_cast<MNCAPI_OPEN_HOST_FN>(GetProcAddress(m_library_handle, "mncapi_open_host")); - if (NULL != mncapi_open_host) { - // Connect and get the integer handle back. - int handle = mncapi_open_host(MNCAPI_PREVIEW, address.c_str(), static_cast<int>(port)); - if (handle > 0) { - m_handle = handle; - - // Bind the sampling function that we will reuse many times in the get_data_block method. - MNCAPI_SAMPLE_FN mncapi_sample = - reinterpret_cast<MNCAPI_SAMPLE_FN>(GetProcAddress(m_library_handle, "mncapi_sample")); - if (NULL != mncapi_sample) { - m_mncapi_sample = mncapi_sample; - } else { - fprintf( - stderr, - "failed to bind function \"mncapi_sample\" from Motion C API library\n"); - } - - } else { - fprintf( - stderr, - "failed to connect to Motion data service at \"%s:%d\"\n", - address.c_str(), port); - } - - } else { - fprintf( - stderr, - "failed to bind function \"mncapi_open_host\" from Motion C API library\n"); - } - } else { - fprintf( - stderr, - "failed to find Motion C API library, \"" MOTION_C_API_LIBRARY "\"\n"); - } -} - -Sampler::~Sampler() -{ - // Clean up resource. Unload the dynamic library after closing the active connection. - if (NULL != m_library_handle) { - if (m_handle > 0) { - MNCAPI_CLOSE_FN mncapi_close = - reinterpret_cast<MNCAPI_CLOSE_FN>(GetProcAddress(m_library_handle, "mncapi_close")); - if (NULL != mncapi_close) { - mncapi_close(m_handle); - m_handle = 0; - } else { - fprintf( - stderr, - "failed to bind function \"mncapi_close\" from Motion C API library\n"); - } - } - - m_mncapi_sample = NULL; - -#if defined(_WIN32) - if (FreeLibrary(m_library_handle)) { -#else - if (0 == dlclose(m_library_handle)) { -#endif // defined(_WIN32) - } else { - fprintf(stderr, "failed to unload Motion C API library\n"); - } - - m_library_handle = NULL; - } -} - -bool Sampler::get_data_block(data_type &data, const unsigned &num_sensor) -{ - bool result = false; - - if ((m_handle > 0) && (NULL != m_mncapi_sample) && (num_sensor > 0)) { - // Accept up to num_sensor results. We may not receive that many. - data.resize(MNCAPI_PREVIEW_SIZE * num_sensor); - - int sample_result = m_mncapi_sample(m_handle, &data[0], data.size()); - if (sample_result > MNCAPI_FAILURE) { - result = true; - } - } - - return result; -} - -#endif // VRPN_USE_MOTIONNODE diff --git a/src/vrpn/vrpn_Tracker_MotionNode.h b/src/vrpn/vrpn_Tracker_MotionNode.h deleted file mode 100644 index 3117e5a62665a942fd06c499b3a06723b7f5a07f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_MotionNode.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright (C) Motion Workshop 2014. Public domain. - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ -#ifndef __TRACKER_MOTIONNODE_H -#define __TRACKER_MOTIONNODE_H - -#include "vrpn_Tracker.h" - -#ifdef VRPN_USE_MOTIONNODE - -class VRPN_API vrpn_Tracker_MotionNode : public vrpn_Tracker { -public: - vrpn_Tracker_MotionNode( - const char *name, - vrpn_Connection *c, - unsigned num_sensor, - const char *address, - unsigned port); - - virtual ~vrpn_Tracker_MotionNode(); - - virtual void mainloop(); - -private: - /** From the configuration parameters. */ - unsigned m_num_sensor; - - /** Opaque pointer to our Motion SDK sampler. */ - void *m_handle; - - void get_report(); - void send_report(); -}; // class vrpn_Tracker_MotionNode - -#endif // VRPN_USE_MOTIONNODE - -#endif // __TRACKER_MOTION_NODE_H diff --git a/src/vrpn/vrpn_Tracker_NDI_Polaris.C b/src/vrpn/vrpn_Tracker_NDI_Polaris.C deleted file mode 100644 index 0cab8a61d72dbd10637e76a8bcc7e8d7434eb548..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_NDI_Polaris.C +++ /dev/null @@ -1,421 +0,0 @@ - -#include <stdio.h> // for fprintf, printf, sprintf, etc -#include <string.h> // for strncmp, strlen, strncpy - -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Serial.h" // for vrpn_close_commport, etc -#include "vrpn_Shared.h" // for vrpn_SleepMsecs, etc -#include "vrpn_Tracker.h" // for vrpn_Tracker -#include "vrpn_Tracker_NDI_Polaris.h" -#include "vrpn_Types.h" // for vrpn_float64 - -vrpn_Tracker_NDI_Polaris::vrpn_Tracker_NDI_Polaris(const char *name, - vrpn_Connection *c, - const char *port, - int numOfRigidBodies, - const char** rigidBodyNDIRomFileNames) : vrpn_Tracker(name,c) -{ - latestResponseStr=new unsigned char[MAX_NDI_RESPONSE_LENGTH]; - - ///////////////////////////////////////////////////////// - //STEP 1: open com port at NDI's default speed - ///////////////////////////////////////////////////////// - - - serialFd=vrpn_open_commport(port,9600); - if (serialFd==-1){ - fprintf(stderr,"vrpn_Tracker_NDI_Polaris: Can't open serial port: %s\n",port); - } else { - - printf("connected to NDI Polaris at default 9600 baud on device:%s.\n",port); - - //send a reset -#ifdef DEBUG - printf("DEBUG: Reseting com port"); -#endif - vrpn_set_rts(serialFd); - vrpn_SleepMsecs(100); - vrpn_clear_rts(serialFd); - printf("done\n"); - - vrpn_SleepMsecs(100); //if the NDI was previously running at the higher rate, it will need some time to reset - vrpn_flush_input_buffer(serialFd); //get rid of any reset message the NDI might have sent - - ///////////////////////////////////////////////////////// - //STEP 2: switch to a higher baud rate - ///////////////////////////////////////////////////////// - switchToHigherBaudRate(port); - - ///////////////////////////////////////////////////////// - //STEP 3: INIT tracker - ///////////////////////////////////////////////////////// - - - sendCommand("INIT "); - readResponse(); -#ifdef DEBUG - printf("DEBUG:Init response: >%s<\n",latestResponseStr); -#endif - - //0 = 20hz(default), 1= 30Hz, 2=60Hz - sendCommand("IRATE 0"); //set the illumination to the default - readResponse(); -#ifdef DEBUG - printf("DEBUG: IRATE response: >%s<\n",latestResponseStr); -#endif - - - ///////////////////////////////////////////////////////// - //STEP 4: SETUP EACH TOOL (i.e. rigid body) - ///////////////////////////////////////////////////////// - - this->numOfRigidBodies=numOfRigidBodies; - - //declare an array of filenames, one for each tool - for (int t=0; t<numOfRigidBodies; t++) { - if (setupOneTool(rigidBodyNDIRomFileNames[t])<1) { - fprintf(stderr,"vrpn_Tracker_NDI_Polaris: tool %s didn't init properly!\n",rigidBodyNDIRomFileNames[t]); - } - } - - ///////////////////////////////////////////////////////// - //STEP 5: GO TO TRACKING MODE - ///////////////////////////////////////////////////////// - - sendCommand("TSTART 80"); //80 resets the frame counter to zero - readResponse(); -#ifdef DEBUG - printf("DEBUG: Tstart response: >%s<\n",latestResponseStr); -#endif - } - -} - -vrpn_Tracker_NDI_Polaris::~vrpn_Tracker_NDI_Polaris() -{ - vrpn_close_commport(serialFd); -} - -void vrpn_Tracker_NDI_Polaris::mainloop() -{ - get_report(); - - // Call the generic server mainloop, since we are a server - server_mainloop(); - - return; -} - -int vrpn_Tracker_NDI_Polaris::get_report(void) -// returns 0 on fail -{ - vrpn_gettimeofday(×tamp, NULL); - - sendCommand("TX "); - readResponse(); - //printf("DEBUG: TX response: >%s %i<\n",latestResponseStr); - - //int numOfHandles=parse2CharIntFromNDIResponse(latestResponseStr); - int TXResponseStrIndex=2; - bool gotAtLeastOneReport=false; - - for (int t=0; t<numOfRigidBodies; t++) { - //int handleNum=parse2CharIntFromNDIResponse(latestResponseStr,&TXResponseStrIndex); - // check if the tool is present. Parse and print out the transform data if and only if - // it's not missing - if (strncmp("MISSING",(char *) &latestResponseStr[TXResponseStrIndex],7)!=0) { - gotAtLeastOneReport=true; - d_sensor = t; - - // NDI gives qw first(qw,qx,qy,qz), whereas VRPN wants it last (qx,qy,qz,qw) - d_quat[3]=parse6CharFloatFromNDIResponse(latestResponseStr,&TXResponseStrIndex); //qw - d_quat[0]=parse6CharFloatFromNDIResponse(latestResponseStr,&TXResponseStrIndex); //qx - d_quat[1]=parse6CharFloatFromNDIResponse(latestResponseStr,&TXResponseStrIndex); //qy - d_quat[2]=parse6CharFloatFromNDIResponse(latestResponseStr,&TXResponseStrIndex); //qz - - pos[0]=parse7CharFloatFromNDIResponse(latestResponseStr,&TXResponseStrIndex); - pos[1]=parse7CharFloatFromNDIResponse(latestResponseStr,&TXResponseStrIndex); - pos[2]=parse7CharFloatFromNDIResponse(latestResponseStr,&TXResponseStrIndex); - - send_report(); //call this once per sensor - } - - //seek to the new line character (since each rigid body is on its own line) - while (latestResponseStr[TXResponseStrIndex]!='\n') { - TXResponseStrIndex++; - } - TXResponseStrIndex++; // advance one more char as to be on the next line of text - - }// for - - return(gotAtLeastOneReport); //return 1 if something was sent, 0 otherwise -} - - -void vrpn_Tracker_NDI_Polaris::send_report(void) // called from get_report() -{ - if (d_connection) - { - char msgbuf[VRPN_MSGBUFSIZE]; - int len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"vrpn_Tracker_NDI_Polaris: cannot write message: tossing\n"); - } - } -} - - -// Send a command to the NDI tracker over the serial port. -// This assumes the serial port has already been opened. -// Some NDI commands require a white-space char at the end of the command, the -// call must be sure to add it. -// NDI commands end with a Carriage-return (\r) char. This function automatically adds it, and -// flushes the output buffer. -// commandString MUST be terminated with \0, since we don't know the string -// length otherwise. -// The NDI trackers have two different command syntaxes - this only supports the syntax -// WITHOUT CRC checksums - -void vrpn_Tracker_NDI_Polaris::sendCommand(const char* commandString ){ - vrpn_write_characters(serialFd,(unsigned char* )commandString,strlen(commandString)); - vrpn_write_characters(serialFd,(unsigned char* )"\r",1); //send the CR - vrpn_flush_output_buffer(serialFd); -} - -// Read a fully formed responses from the NDI tracker, (including the 4-byte CRC at the end) -// and copies it to latestResponseString. -// Returns the number of characters in the response (not including the CR), -// or -1 in case of an error -// NDI responses are all terminated with a CR, which this function replace with a end-of-string char. -// -// This function blocks until the CR has been received. -// FIXME: add a timeout parameter, and timeout if it's been too long -int vrpn_Tracker_NDI_Polaris::readResponse(){ - //read in characters one-at-a-time until we come across a CR - int charIndex=0; - bool foundCR=false; - unsigned char c; - while (!foundCR) { - if (vrpn_read_available_characters(serialFd,&c,1)>0) { - latestResponseStr[charIndex]=c; - if (c=='\r') { //found CR - latestResponseStr[charIndex]='\0'; - foundCR=true; - } else { - charIndex++; - } - } - } - return (charIndex); -} - -// Given a filename of a binary .rom file, this reads the file and returns -// a string with the contents of the file as ascii encoded hex: For each byte of -// the file, this returns two ascii characters, each of which are ascii representation -// of a HEX digit (0-9 & a-f). Hex letters are returned as lower case. -// The string is padded with zeros to make it's length a multiple of 128 -// characters( which is 64 bytes of the original binary file). -// asciiEncodedHexStr must be allocated before calling, be -// MAX_NDI_FROM_FILE_SIZE_IN_BYTES * 2 characters long. -// -// RETURNS the number of bytes represented in the string (which is half the number of ASCII characters) -// , or -1 on failure -int vrpn_Tracker_NDI_Polaris::convertBinaryFileToAsciiEncodedHex(const char* filename, char *asciiEncodedHexStr) { - - - FILE* fptr=fopen(filename,"rb"); - if (fptr==NULL) { - fprintf(stderr,"vrpn_Tracker_NDI_Polaris: can't open NDI .rom file %s\n",filename); - return (-1); - } - - // obtain file size: - fseek(fptr , 0 , SEEK_END); - long int fileSizeInBytes = ftell(fptr); - rewind(fptr); - - if (fileSizeInBytes>MAX_NDI_ROM_FILE_SIZE_IN_BYTES) { - fprintf(stderr,"vrpn_Tracker_NDI_Polaris: file is %ld bytes long - which is larger than expected NDI ROM file size of %d bytes.\n", - fileSizeInBytes,MAX_NDI_ROM_FILE_SIZE_IN_BYTES); - return (-1); - } - - // allocate memory to contain the whole file: - unsigned char* rawBytesFromRomFile = (unsigned char*) new unsigned char[fileSizeInBytes]; - - // copy the file into the buffer: - size_t result = fread (rawBytesFromRomFile,1,fileSizeInBytes,fptr); - if (result != (unsigned int) fileSizeInBytes) { - fprintf(stderr,"vrpn_Tracker_NDI_Polaris: error while reading .rom file!\n"); - fclose(fptr); - return(-1); - } - fclose(fptr); - - - // init array with "_" for debugging - for (int i=0; i<MAX_NDI_ROM_FILE_SIZE_IN_BYTES; i++) { - asciiEncodedHexStr[i]='_'; - } - int byteIndex; - for (byteIndex=0; byteIndex<fileSizeInBytes; byteIndex++) { - sprintf(&(asciiEncodedHexStr[byteIndex*2]),"%02x ",rawBytesFromRomFile[byteIndex]); - } - - // pad the length to make it a multiple of 64 - int numOfBytesToPadRemaining= NDI_ROMFILE_CHUNK_SIZE-(fileSizeInBytes% NDI_ROMFILE_CHUNK_SIZE); - if (numOfBytesToPadRemaining== NDI_ROMFILE_CHUNK_SIZE) {numOfBytesToPadRemaining=0;} - - int paddedFileSizeInBytes=fileSizeInBytes+numOfBytesToPadRemaining; - - while (numOfBytesToPadRemaining>0) { - asciiEncodedHexStr[byteIndex*2]='0'; - asciiEncodedHexStr[byteIndex*2+1]='0'; - byteIndex++; - numOfBytesToPadRemaining--; - } - - asciiEncodedHexStr[byteIndex*2]='\0'; //end of string marker, which is used just for debugging - - //printf("DEBUG: >>%s<<\n",asciiEncodedHexStr); - delete (rawBytesFromRomFile); - - return paddedFileSizeInBytes; -} - -// NDI response strings often encode ints as a two ascii's WITHOUT any separator behind it -// this returns the value as an int. -// The caller passes in the string, and a pointer to an (int) index into that string (which will be advanced -// to the end of the value we just parsed. -// The caller must make sure the string is at least two characters long -unsigned int vrpn_Tracker_NDI_Polaris::parse2CharIntFromNDIResponse(unsigned char* str, int* strIndexPtr) { - unsigned intVal; - if (strIndexPtr==NULL){ //if no index was passed in, start at the beginning of the string, and don't - //advance the index - sscanf((char*) str,"%2u",&intVal); - } else { - sscanf((char*) &(str[*strIndexPtr]),"%2u",&intVal); - *strIndexPtr+=2; - } - return (intVal); -} - -// NDI TX response strings often encode floats as a size ascii's WITHOUT any separator behind it -// this returns the value as an float. The last 4 digits are implicitly to the right of the decimal point -// (the decimal point itself is not in the string) -// The caller passes in the string, and a pointer to an (int) index into that string (which will be advanced -// to the end of the value we just parsed. -// The caller must make sure the string is at least six characters long -float vrpn_Tracker_NDI_Polaris::parse6CharFloatFromNDIResponse(unsigned char* str, int* strIndexPtr) { - int intVal; - sscanf((char*) &(str[*strIndexPtr]),"%6d",&intVal); - *strIndexPtr+=6; - return (intVal/10000.0f); -} - -// NDI TX response strings often encode floats as a size ascii's WITHOUT any separator behind it -// this returns the value as an float. The last 2 digits are implicitly to the right of the decimal point -// (the decimal point itself is not in the string) -// The caller passes in the string, and a pointer to an (int) index into that string (which will be advanced -// to the end of the value we just parsed. -// The caller must make sure the string is at least seven characters long -float vrpn_Tracker_NDI_Polaris::parse7CharFloatFromNDIResponse(unsigned char* str, int* strIndexPtr) { - int intVal; - sscanf((char*) &(str[*strIndexPtr]),"%7d",&intVal); - *strIndexPtr+=7; - return (intVal/100.0f); -} - -int vrpn_Tracker_NDI_Polaris::setupOneTool(const char* NDIToolRomFilename) -{ - // For each tool (i.e. rigid body) that we want to track, we must first need to initialize a port handle (on the NDI machine) - // for that tool. This function does that. the caller must call it for each tool. - // This returns -1 on failure, or the tool number (i.e. port handle), which is 1 or greater (VRPN - // sensors start at 0, whereas NDI port handles start at 1). - - // We use the command - // sequence PHRQ -> PVWR -> PINIT -> PENA; we must do this for each tool we want tracked. - - // sending the PHRQ command first; this will assign a port handler number to the tracking device. the - // first 8 digits are the hardware device ID, but one can just use asterisks as wild cards. the 9th digit - // is system type, 0 for polaris or just *. the 10th digit needs to be a 1 with the passive tracking - // balls that we are using in this setup (0 for an active wired LED setup). 11th & 12th digits are to - // request a specific port number (we may as well do that here), and the last two are "reserved". - char commandStr[MAX_NDI_RESPONSE_LENGTH]; - - sendCommand("PHRQ *********1****"); - readResponse(); -#ifdef DEBUG - printf("DEBUG: PHRQ response: >%s<\n",latestResponseStr); -#endif - if (strncmp("ERROR",(char *) latestResponseStr,5)==0) return (-1); - - unsigned int portHandleNum = parse2CharIntFromNDIResponse(latestResponseStr); - - //convert to ASCII-encoded hex, write to array of chars - char asciiEncodedHex[MAX_NDI_ROM_FILE_SIZE_IN_BYTES*2]; //each byte needs two digits, so we multiply by 2 - int numOfFileBytes=convertBinaryFileToAsciiEncodedHex(NDIToolRomFilename,asciiEncodedHex); - - //feed that array of chars to NDI, but we must first divide it up into 64 byte (128 ascii char) - //"chunks", and send on chunk at a time. - int numOfChunks=numOfFileBytes/NDI_ROMFILE_CHUNK_SIZE; - for (int chunkIndex=0; chunkIndex<numOfChunks; chunkIndex++) { - char chunk[129]; //64*2 +1 for the end of string - strncpy(chunk,&(asciiEncodedHex[chunkIndex*NDI_ROMFILE_CHUNK_SIZE*2]),NDI_ROMFILE_CHUNK_SIZE*2); - chunk[128]='\0'; - - int NDIAddress=chunkIndex*NDI_ROMFILE_CHUNK_SIZE; //the memory offset (in the NDI machine, not this PC) - // where this chunk will start - sprintf(commandStr,"PVWR %02u%04x%s",portHandleNum, NDIAddress,chunk); - //printf("DEBUG: >>%s<<\n",commandStr); - sendCommand(commandStr); - readResponse(); -#ifdef DEBUG - printf("DEBUG: PVWR response: >%s<\n",latestResponseStr); -#endif - } - sprintf(commandStr,"PINIT %02u",portHandleNum); // initializes the port handle - sendCommand(commandStr); - readResponse(); -#ifdef DEBUG - printf("DEBUG: PINIT response: >%s<\n",latestResponseStr); //this will be an error if PVWR hasn't been sent -#endif - if (strncmp("ERROR",(char *) latestResponseStr,5)==0) return (-1); - - sprintf(commandStr,"PENA %02uD",portHandleNum); //enables the port handle as a dynamic tool (expect motion) - sendCommand(commandStr); - readResponse(); -#ifdef DEBUG - printf("DEBUG: PENA response: >%s<\n",latestResponseStr); //this will be an error if PINIT hasn't been sent -#endif - //FIXME: PENA returns warnings if the tool geometry has problems, Parse these warnings and return them - return(portHandleNum); -} - -void vrpn_Tracker_NDI_Polaris::switchToHigherBaudRate(const char *port) { - printf("vrpn_Tracker_NDI_Polaris: Switching NDI to higher baud rate, and then reopening com port at higher rate..."); - sendCommand("COMM 70000"); // 1.2Mbit (1228739 baud), which requires the NDI USB 2.0 adapter - readResponse(); -#ifdef DEBUG - printf("DEBUG: COMM response: >%s<\n",latestResponseStr); -#endif - //if the response is "RESET", try again - if (strncmp("RESET",(char *) latestResponseStr,5)==0) { - //we got a reset, which means the track reset itself (without being commanded too?) - sendCommand("COMM 70000"); // 1.2Mbit, which requires the NDI USB 2.0 adapter - readResponse(); - //printf("DEBUG: COMM response: >%s<\n",latestResponseStr); - } - vrpn_SleepMsecs(100); //we should wait 100 msec after getting the OKAY from the NDI before changing the PC's comm rate - - vrpn_close_commport(serialFd); -#ifdef _WIN32 - serialFd=vrpn_open_commport(port,19200); //19.2k is aliased to 1.2Mbit in the Window's version of the NDI USB virtual com port driver -#else - serialFd=vrpn_open_commport(port,1228739); //should work on linux (UNTESTED!) -#endif - printf("done\n"); -} - - diff --git a/src/vrpn/vrpn_Tracker_NDI_Polaris.h b/src/vrpn/vrpn_Tracker_NDI_Polaris.h deleted file mode 100644 index d291b3c2db855e980f0ff7f4ad51dc46a82f55cb..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_NDI_Polaris.h +++ /dev/null @@ -1,182 +0,0 @@ - -//TODO - -//---Do I really need a reset? If we add one, we'll need to either store -//the filenames of each .rom file, or store the contents of -//the files themselves. The NDI Polaris needs theses files to be uploaded -//to the tracker, over the serial port, each time we connect to it. - -//---do update_rate affect only the rate at which tracker reports are -//generated, or also the rate at which they are sent? - -//---read frame # from tracker and avoid sending duplicate reports -//(if this runs at faster than 60Hz) - -//---test on other platforms (only tested on WinXP so far) - -//---add support for - - - -// This server works with the NDI Polaris Spectra and Polaris Vectra -// trackers. It doesn't work with the Optitrak or Aurora. It only -// handles rigid bodies made from passive sphere markers, and does -// not yet support active led markers nor single "stray" passive -// spheres. - -// Each vrpn "sensor" is a single rigid body (or "tool" in NDI -// terminology), which consists of 3 or more passive spheres in a -// particular geometric arrangement. In order to define a custom -// rigid body (one that didn't come from NDI), you must use the NDI -// Architect software. That software produces .rom files for each -// rigid body. This vrpn tracker class will load those files during -// initialization. - -// Before configuring the vrpn server here, you should first run -// the NDI software to track the rigid bodies using the NDI's -// interactive GUI. Only after you have configured and tested the -// tracker and rigid bodies to your satisfaction, should you try -// this vrpn server. - -// This currently only handles an IR strobe rate of 60Hz, not -// 20Hz or 30Hz. - - -// The NDI Polaris Vectra and Spectra communicates with the host over -// the serial port, but this VRPN Tracker isn't a sub-class of -// vrpn_Tracker_Serial. Perhaps a future version of this class should -// be. Here are some potential differences between this Tracker class -// and the other serial port trackers: -// -// 1) The host must connect at a fixed 9600 baud rate at first, but -// then switches to a faster rate. This should happen each time the -// tracker server initializes, and after each reset. And the com port -// isn't really a com port - it's a virtual com port that runs over -// NDI's own USB device. When we tell the host to connect at 19200 baud -// (on Windows), it really runs at 1.2Mbps. -// -// 2) While other trackers consciously send tracker report to the -// host, the NDI Polaris trackers do not. Instead, they wait for -// a command from the host, then immediately (< 17 ms later) send a -// single reply back. The host asks for a single trackerport at a -// time (using the "TX" command). Because of the 1.2Mbps connection -// speed, it seems reasonable (to me) to simply block and wait for the -// response, rather than return control back to the caller and then -// processing the response later. - -#ifndef VRPN_TRACKER_NDI_POLARIS_H -#define VRPN_TRACKER_NDI_POLARIS_H - -#include <stddef.h> // for NULL - -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Tracker.h" // for vrpn_Tracker - -class VRPN_API vrpn_Connection; - -class VRPN_API vrpn_Tracker_NDI_Polaris : public vrpn_Tracker { - -public: - /// The constructor is given the name of the tracker (the name of - /// the sender it should use), the connection on which it is to - /// send its messages, the name of the serial port it is to open. - /// The final two parameters are the number of rigid bodies to track, - /// and a pointer to an array of strings containing the filenames of the - /// the .rom file for each rigid body. - - vrpn_Tracker_NDI_Polaris(const char *name, - vrpn_Connection *c, - const char *port, - int numOfRigidBodies, - const char** rigidBodyNDIRomFileNames); - - ~vrpn_Tracker_NDI_Polaris(); - - virtual void mainloop(); - -protected: - - // constants, that are enums instead of const ints, to allow VC6 compatibility - // Other vrpn objects appear to put the globals in the global scope? - enum { NDI_ROMFILE_CHUNK_SIZE=64}; - enum { MAX_NDI_ROM_FILE_SIZE_IN_BYTES=1024}; - enum { MAX_NDI_RESPONSE_LENGTH=300} ; //FIXME look up what the longest response the NDI tracker will send back - enum { VRPN_MSGBUFSIZE=1024}; - - -int serialFd; //the fid for the serial port -int numOfRigidBodies; -unsigned char* latestResponseStr; - - -protected: - // FIXME - do I need a reset() method? - virtual int get_report(void); - virtual void send_report(void); - -// Send a command to the NDI tracker over the serial port. -// This assumes the serial port has already been opened. -// Some NDI commands require a white-space char at the end of the command, the -// call must be sure to add it. -// NDI commands end with a Carriage-return (\r) char. This function automatically adds it, and -// flushes the output buffer. -// commandString MUST be terminated with \0, since we don't know the string -// length otherwise. -// The NDI trackers have two different command syntaxes - this only supports the syntax -// WITHOUT CRC checksums - - void sendCommand(const char* commandString ); - -// Read a fully formed responses from the NDI tracker, (including the 4-byte CRC at the end) -// and copies it to latestResponseString. -// Returns the number of characters in the response (not including the CR), -// or -1 in case of an error -// NDI responses are all terminated with a CR, which this function replace with a end-of-string char. -// -// This function blocks until the CR has been received. -// FIXME: add a timeout parameter, and timeout if it's been too long - int readResponse(); - -// Given a filename of a binary .rom file, this reads the file and returns -// a string with the contents of the file as ascii encoded hex: For each byte of -// the file, this returns two ascii characters, each of which are ascii representation -// of a HEX digit (0-9 & a-f). Hex letters are returned as lower case. -// The string is padded with zeros to make it's length a multiple of 128 -// characters( which is 64 bytes of the original binary file). -// asciiEncodedHexStr must be allocated before calling, be -// MAX_NDI_FROM_FILE_SIZE_IN_BYTES * 2 characters long. -// -// RETURNS the number of bytes represented in the string (which is half the number of ASCII characters) -// , or -1 on failure - int convertBinaryFileToAsciiEncodedHex(const char* filename, char *asciiEncodedHexStr); - -// NDI response strings often encode ints as a two ascii's WITHOUT any separator behind it -// this returns the value as an int. -// The caller passes in the string, and a pointer to an (int) index into that string (which will be advanced -// to the end of the value we just parsed. -// The caller must make sure the string is at least two characters long - unsigned int parse2CharIntFromNDIResponse(unsigned char* str, int* strIndexPtr=NULL); - -// NDI TX response strings often encode floats as a size ascii's WITHOUT any separator behind it -// this returns the value as an float. The last 4 digits are implicitly to the right of the decimal point -// (the decimal point itself is not in the string) -// The caller passes in the string, and a pointer to an (int) index into that string (which will be advanced -// to the end of the value we just parsed. -// The caller must make sure the string is at least six characters long - float parse6CharFloatFromNDIResponse(unsigned char* str, int* strIndexPtr); - -// NDI TX response strings often encode floats as a size ascii's WITHOUT any separator behind it -// this returns the value as an float. The last 2 digits are implicitly to the right of the decimal point -// (the decimal point itself is not in the string) -// The caller passes in the string, and a pointer to an (int) index into that string (which will be advanced -// to the end of the value we just parsed. -// The caller must make sure the string is at least seven characters long - float parse7CharFloatFromNDIResponse(unsigned char* str, int* strIndexPtr); - - int setupOneTool(const char* NDIToolRomFilename); - - void switchToHigherBaudRate(const char* port); - -}; - -#endif diff --git a/src/vrpn/vrpn_Tracker_NovintFalcon.C b/src/vrpn/vrpn_Tracker_NovintFalcon.C deleted file mode 100644 index bf775de86aabb8661a7af531cf620cb336af477b..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_NovintFalcon.C +++ /dev/null @@ -1,737 +0,0 @@ -// -*- c++ -*- -// This file provides an interface to a Novint Falcon. -// http://home.novint.com/products/novint_falcon.php -// It uses libnifalcon to communicate with the device. -// http://libnifalcon.nonpolynomial.org/ -// -// File: vrpn_Tracker_NovintFalcon.C -// Author: Axel Kohlmeyer akohlmey@gmail.com -// Date: 2010-08-12 -// Copyright: (C) 2010 Axel Kohlmeyer -// License: Boost Software License 1.0 -// depends: libnifalcon-1.0.1+, libusb-1.0, boost 1.39, VRPN 07_27 -// tested on: Linux x86_64 w/ gcc 4.4.1 - -#include "vrpn_Tracker_NovintFalcon.h" - -#if defined(VRPN_USE_LIBNIFALCON) -#include "boost/array.hpp" -#include "boost/ptr_container/ptr_vector.hpp" -#include "boost/shared_ptr.hpp" -#include "falcon/core/FalconDevice.h" -#include "falcon/firmware/FalconFirmwareNovintSDK.h" -#include "falcon/grip/FalconGripFourButton.h" -#include "falcon/kinematic/FalconKinematicStamper.h" -#include "falcon/util/FalconFirmwareBinaryNvent.h" - -/**************************************************************************/ -// number of retries for the I/O loop. -#define FALCON_NUM_RETRIES 10 - -// define to activate additional messages about -// what the driver is currently trying to do. -#undef VERBOSE - -// define for detailed status tracking. very verbose. -#undef VERBOSE2 -/**************************************************************************/ - -// save us some typing -typedef boost::array<double, 3> d_vector; - -/// allow to add two vectors -static d_vector operator+(const d_vector &a,const d_vector &b) -{ - d_vector ret; - ret[0] = a[0] + b[0]; - ret[1] = a[1] + b[1]; - ret[2] = a[2] + b[2]; - return ret; -} - -/// difference of two vectors -static d_vector operator-(const d_vector &a,const d_vector &b) -{ - d_vector ret; - ret[0] = a[0] + b[0]; - ret[1] = a[1] + b[1]; - ret[2] = a[2] + b[2]; - return ret; -} - -/// length of a vector -static double d_length(const d_vector &a) -{ - double ret; - ret = a[0] * a[0]; - ret += a[1] * a[1]; - ret += a[2] * a[2]; - return sqrt(ret); -} - -/*************************************************************************/ -// compute time difference in microseconds. -static double timediff(struct timeval t1, struct timeval t2) { - return (t1.tv_usec - t2.tv_usec)*1.0 + 1000000.0 * (t1.tv_sec - t2.tv_sec); -} - -/*************************************************************************/ - -class vrpn_NovintFalcon_Device -{ -public: - vrpn_NovintFalcon_Device(int flags) - : m_flags(flags) - { - if (m_flags < 0) { - m_falconDevice = NULL; - return; - } else { - m_falconDevice = new libnifalcon::FalconDevice; - m_falconDevice->setFalconFirmware<libnifalcon::FalconFirmwareNovintSDK>(); - } - - if (m_flags & KINE_STAMPER) { - m_falconDevice->setFalconKinematic<libnifalcon::FalconKinematicStamper>(); - } else { - delete m_falconDevice; - m_falconDevice=NULL; - return; - } - - if (m_flags & GRIP_FOURBUTTON) { - m_falconDevice->setFalconGrip<libnifalcon::FalconGripFourButton>(); - } else { - delete m_falconDevice; - m_falconDevice=NULL; - return; - } - } - - ~vrpn_NovintFalcon_Device() { -#ifdef VERBOSE - fprintf(stderr, "Closing Falcon device %d.\n", m_flags & MASK_DEVICEIDX); -#endif - if (m_falconDevice) { - m_falconDevice->close(); - } - delete m_falconDevice; - m_flags=-1; - }; - -public: - // open device, load firmware and calibrate. - bool init() { - if (!m_falconDevice) - return false; - - unsigned int count; - m_falconDevice->getDeviceCount(count); - int devidx = m_flags & MASK_DEVICEIDX; - -#ifdef VERBOSE - fprintf(stderr, "Trying to open Falcon device %d/%d.\n", devidx, count); -#endif - if (devidx < count) { - if (!m_falconDevice->open(devidx)) { - fprintf(stderr, "Cannot open falcon device %d - Lib Error Code: %d - Device Error Code: %d\n", - devidx, m_falconDevice->getErrorCode(), m_falconDevice->getFalconComm()->getDeviceErrorCode()); - return false; - } - } else { - fprintf(stderr, "Trying to open non-existing Novint Falcon device %d\n", devidx); - return false; - } - - if (!m_falconDevice->isFirmwareLoaded()) { -#ifdef VERBOSE - fprintf(stderr, "Loading Falcon Firmware\n"); -#endif - int i; - // 10 chances to load the firmware. - for (i=0; i<FALCON_NUM_RETRIES; ++i) { - if(!m_falconDevice->getFalconFirmware()->loadFirmware(false, libnifalcon::NOVINT_FALCON_NVENT_FIRMWARE_SIZE, const_cast<uint8_t*>(libnifalcon::NOVINT_FALCON_NVENT_FIRMWARE))) - { - fprintf(stderr, "Firmware loading attempt %d failed.\n", i); - // Completely close and reopen device and try again - m_falconDevice->close(); - if(!m_falconDevice->open(devidx)) - { - fprintf(stderr, "Cannot open falcon device %d - Lib Error Code: %d - Device Error Code: %d\n", - devidx, m_falconDevice->getErrorCode(), m_falconDevice->getFalconComm()->getDeviceErrorCode()); - return false; - } - } else { -#ifdef VERBOSE - fprintf(stderr, "Falcon firmware successfully loaded.\n"); -#endif - break; - } - } - } else { -#ifdef VERBOSE - fprintf(stderr, "Falcon Firmware already loaded.\n"); -#endif - } - - int i; - bool message = false; - boost::shared_ptr<libnifalcon::FalconFirmware> f; - f=m_falconDevice->getFalconFirmware(); - for (i=0; !m_falconDevice->runIOLoop() && i < FALCON_NUM_RETRIES; ++i) continue; - while(1) { // XXX: add timeout to declare device dead after a while. - f->setHomingMode(true); - for (i=0; !m_falconDevice->runIOLoop() && i < FALCON_NUM_RETRIES; ++i) continue; - if(!f->isHomed()) { - f->setLEDStatus(libnifalcon::FalconFirmware::RED_LED); - for (i=0; !m_falconDevice->runIOLoop() && i < FALCON_NUM_RETRIES; ++i) continue; - if (!message) { - fprintf(stderr, "Falcon not currently calibrated. Move control all the way out then push straight all the way in.\n"); - message = true; - } - } else { - f->setLEDStatus(libnifalcon::FalconFirmware::BLUE_LED); - for (i=0; !m_falconDevice->runIOLoop() && i < FALCON_NUM_RETRIES; ++i) continue; -#ifdef VERBOSE - fprintf(stderr, "Falcon calibrated successfully.\n"); -#endif - break; - } - } - - message = false; - while(1) { // XXX: add timeout to declare device dead after a while. - int i; - - for (i=0; !m_falconDevice->runIOLoop() && i < FALCON_NUM_RETRIES; ++i) continue; - d_vector pos = m_falconDevice->getPosition(); - m_oldpos = pos; - vrpn_gettimeofday(&m_oldtime, NULL); - - if (!message) { - fprintf(stderr, "Move control all the way out until led turns green to activate device.\n"); - message = true; - } - if (pos[2] > 0.170) { // XXX: value taken from libnifalcon test example - f->setLEDStatus(libnifalcon::FalconFirmware::GREEN_LED); - for (i=0; !m_falconDevice->runIOLoop() && i < FALCON_NUM_RETRIES; ++i) continue; -#ifdef VERBOSE - fprintf(stderr, "Falcon activated successfully.\n"); -#endif - break; - } - } - return true; - }; - - // query status of device. - bool get_status(vrpn_float64 *pos, vrpn_float64 *vel, - vrpn_float64 *quat, vrpn_float64 *vel_quat, - vrpn_float64 *vel_dt, unsigned char *buttons) { - if (!m_falconDevice) - return false; - - int i; - for (i=0; !m_falconDevice->runIOLoop() && i < FALCON_NUM_RETRIES; ++i) continue; - if ( i == FALCON_NUM_RETRIES ) - return false; - - // we have no orientation of the effector. - // so we just pick one. to tell them apart - // more easily, we just give each a different - // orientation. - if (quat) { - switch (m_flags & MASK_DEVICEIDX) { - case 0: - quat[0] = 0.0; - quat[1] = 0.0; - quat[2] = 1.0; - quat[3] = 0.0; - break; - case 1: - quat[0] = 1.0; - quat[1] = 0.0; - quat[2] = 0.0; - quat[3] = 0.0; - break; - default: - quat[0] = 1.0; - quat[1] = 0.0; - quat[2] = 0.0; - quat[3] = 0.0; - break; - } - } - - if (vel_quat) { - vel_quat[0] = 0.0; - vel_quat[1] = 0.0; - vel_quat[2] = 0.0; - vel_quat[3] = 0.0; - } - - // update position information - d_vector my_pos = m_falconDevice->getPosition(); - const double convert_pos = 1.0; // empirical. need to measure properly. - pos[0] = convert_pos * my_pos[0]; - pos[1] = convert_pos * my_pos[1]; - pos[2] = convert_pos * (my_pos[2]-0.125); // apply offset to make z axis data centered. -#ifdef VERBOSE2 - fprintf(stderr, "position %5.3f %5.3f %5.3f\n", pos[0],pos[1],pos[2]); -#endif - if (vel) { - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - double deltat = timediff(current_time, m_oldtime); - *vel_dt= deltat; - if (deltat > 0) { - vel[0] = convert_pos * (my_pos[0] - m_oldpos[0]) / deltat; - vel[1] = convert_pos * (my_pos[1] - m_oldpos[1]) / deltat; - vel[2] = convert_pos * (my_pos[2] - m_oldpos[2]) / deltat; - } else { - vel[0] = 0.0; - vel[1] = 0.0; - vel[2] = 0.0; - } -#ifdef VERBOSE2 - fprintf(stderr, "velocity %5.3f %5.3f %5.3f\n", vel[0],vel[1],vel[2]); -#endif - m_oldpos = my_pos; - m_oldtime.tv_sec = current_time.tv_sec; - m_oldtime.tv_usec = current_time.tv_usec; - } - - // update button information - unsigned int my_buttons = m_falconDevice->getFalconGrip()->getDigitalInputs(); - if (m_flags & GRIP_FOURBUTTON) { - buttons[0] = (my_buttons & libnifalcon::FalconGripFourButton::CENTER_BUTTON) ? 1 : 0; - buttons[1] = (my_buttons & libnifalcon::FalconGripFourButton::PLUS_BUTTON) ? 1 : 0; - buttons[2] = (my_buttons & libnifalcon::FalconGripFourButton::MINUS_BUTTON) ? 1 : 0; - buttons[3] = (my_buttons & libnifalcon::FalconGripFourButton::FORWARD_BUTTON) ? 1 : 0; - } - return true; - }; - - // set feedback force - bool set_force(const d_vector &force) { - if (!m_falconDevice) - return false; - - // update position information - m_falconDevice->setForce(force); - if(!m_falconDevice->runIOLoop()) - return false; - - return true; - }; - -protected: - int m_flags; - libnifalcon::FalconDevice *m_falconDevice; - d_vector m_oldpos; - struct timeval m_oldtime; - -private: - /// default constructor is disabled - vrpn_NovintFalcon_Device() {}; - /// copy constructor is disabled - vrpn_NovintFalcon_Device(const vrpn_NovintFalcon_Device &dev) {}; - -public: - /// constants to parse device flags. - enum falconflags { - NONE = 0x0000, //< empty - MASK_DEVICEIDX = 0x000f, //< max. 15 falcons - KINE_STAMPER = 0x0010, //< stamper kinematics model - GRIP_FOURBUTTON = 0x0100 //< 4-button grip (the default) - }; -}; - -/// force field effect for Novint Falcon. -class ForceFieldEffect -{ -public: - /// constructor - ForceFieldEffect() : m_active(false), m_time(0), m_cutoff(0.0), m_damping(0.9) - { - int i,j; - for (i=0; i < 3; i++) { - m_origin[i] = 0.0; - m_addforce[i] = 0.0; - for (j=0; j < 3; j++) { - m_jacobian[i][j] = 0.0; - } - } - }; - - /// destructor - ~ForceFieldEffect() {} - -public: - /// sets member variables to specificed values - void setForce(vrpn_float32 ori[3], vrpn_float32 frc[3], vrpn_float32 jac[3][3], vrpn_float32 rad) { - int i,j; - for (i=0; i < 3; i++) { - m_neworig[i] = ori[i]; - m_newadd[i] = frc[i]; - for (j=0; j < 3; j++) { - m_newjacob[i][j] = jac[i][j]; - } - } - m_newcut = rad; - } - - /// updates damping factor - void setDamping(double damp) { - m_damping = damp; - } - - /// start effect - virtual bool start() { - m_active = true; - m_time = 0.0; - // this will delay the effect until it - // is (re-)initialized with setForce() - m_cutoff = 0.0; - return m_active; - } - - /// stop effect - virtual void stop() { - m_active = false; - } - - /// query active status - virtual bool isActive() const { return m_active; } - - /// calculate the effect force - d_vector calcForce(const d_vector &pos) { - d_vector force, offset; - force.assign(0.0); - if (m_active) { - // apply damping to effect values - const double mix = 1.0 - m_damping; - int i,j; - for (i=0; i < 3; i++) { - m_origin[i] = m_damping*m_origin[i] + mix*m_neworig[i]; - m_addforce[i] = m_damping*m_addforce[i] + mix*m_newadd[i]; - for (j=0; j < 3; j++) { - m_jacobian[i][j] = m_damping*m_jacobian[i][j] + mix*m_newjacob[i][j]; - } - } - m_cutoff = m_damping*m_cutoff + mix*m_newcut; - - offset = pos - m_origin; - // no force too far away. - if (d_length(offset) > m_cutoff) { - return force; - } - // Compute the force, which is the constant force plus - // a force that varies as the effector position deviates - // from the origin of the force field. The Jacobian - // determines how the force changes in different directions - // away from the origin (generalizing spring forces of different - // magnitudes that constrain the Phantom to the point of the - // origin, to a line containing the origin, or to a plane - // containing the origin). - force = m_addforce; - for (i=0; i<3; ++i) { - for (j=0; j<3; ++j) { - force[i] += offset[j]*m_jacobian[i][j]; - } - } - } - return force; - } - -protected: - bool m_active; /// true if effect is active - double m_time; /// time since last update - double m_cutoff; /// force cutoff radius - d_vector m_origin; /// origin of effect - d_vector m_addforce; /// additional constant force - double m_jacobian[3][3]; /// describes increase in force away from origin in different directions. - double m_newcut; /// new force cutoff radius - d_vector m_neworig; /// new effect origin handed over at update - d_vector m_newadd; /// new additional constant force - double m_newjacob[3][3]; /// new jacobian handed over at update - double m_damping; /// damping coefficient for updates -}; - -/// callback for receiving new force field effects. -static int VRPN_CALLBACK handle_forcefield_change_message(void *userdata, vrpn_HANDLERPARAM p) -{ - vrpn_Tracker_NovintFalcon *dev = (vrpn_Tracker_NovintFalcon *)userdata; - dev->update_forcefield_effect(p); - return 0; -} - -/// class to collect all force generating objects. -class vrpn_NovintFalcon_ForceObjects { -public: - boost::ptr_vector<ForceFieldEffect> m_FFEffects; - -protected: - d_vector m_curforce; //< collected force value - d_vector m_curpos; //< position for force calculation - d_vector m_curvel; //< velocity for force calculation - -public: - /// constructor - vrpn_NovintFalcon_ForceObjects() { - m_curforce.assign(0.0); - m_curpos.assign(0.0); - }; - /// destructor - ~vrpn_NovintFalcon_ForceObjects() {}; -public: - /// compute the resulting force of all force field objects. - d_vector getObjForce(vrpn_float64 *pos, vrpn_float64 *vel) { - int i; - - for (i=0; i<3; ++i) { - m_curforce[i]=0.0; - m_curpos[i]=pos[i]; - m_curvel[i]=vel[i]; - } - - // force field objects - int nobj = m_FFEffects.size(); - for (i=0; i<nobj; ++i) { - m_curforce = m_curforce + m_FFEffects[i].calcForce (m_curpos); - } - return m_curforce; - }; -}; - -/// custom contructor for falcon device tracker. handles a single device. -vrpn_Tracker_NovintFalcon::vrpn_Tracker_NovintFalcon(const char *name, - vrpn_Connection *c, - const int devidx, - const char *grip, - const char *kine, - const char *damp) - : vrpn_Tracker(name, c), vrpn_Button_Filter(name, c), - vrpn_ForceDevice(name, c), m_dev(NULL), m_obj(NULL), m_update_rate(1000.0), m_damp(0.9) -{ - m_devflags=vrpn_NovintFalcon_Device::MASK_DEVICEIDX & devidx; - if (grip != NULL) { - if (0 == strcmp(grip,"4-button")) { - m_devflags |= vrpn_NovintFalcon_Device::GRIP_FOURBUTTON; - vrpn_Button::num_buttons = 4; - } else { - fprintf(stderr, "WARNING: Unknown grip for Novint Falcon #%d: %s \n", devidx, grip); - m_devflags = -1; - return; - } - } - - if (kine != NULL) { - if (0 == strcmp(kine,"stamper")) { - m_devflags |= vrpn_NovintFalcon_Device::KINE_STAMPER; - } else { - fprintf(stderr, "WARNING: Unknown kinematic model for Novint Falcon #%d: %s \n", devidx, kine); - m_devflags = -1; - return; - } - } - - if (damp != NULL) { - vrpn_float64 val= atof(damp); - if (val >= 1.0 && val <= 10000.0) { - m_damp = 1.0 - 1.0/val; - } else { - fprintf(stderr, "WARNING: Ignoring illegal force effect damping factor: %g \n", val); - } - } - clear_values(); - - if (register_autodeleted_handler(forcefield_message_id, - handle_forcefield_change_message, this, vrpn_ForceDevice::d_sender_id)) { - fprintf(stderr,"vrpn_Tracker_NovintFalcon:can't register force handler\n"); - return; - } - vrpn_gettimeofday(&m_timestamp, NULL); - status = vrpn_TRACKER_RESETTING; -} - -void vrpn_Tracker_NovintFalcon::clear_values() -{ - // nothing to do - if (m_devflags < 0) return; - - int i; - for (i=0; i <vrpn_Button::num_buttons; i++) - vrpn_Button::buttons[i] = vrpn_Button::lastbuttons[i] = 0; - - if (m_obj) delete m_obj; - m_obj = new vrpn_NovintFalcon_ForceObjects; - - // add dummy effect object - ForceFieldEffect *ffe = new ForceFieldEffect; - ffe->setDamping(m_damp); - ffe->stop(); - m_obj->m_FFEffects.push_back(ffe); -} - -vrpn_Tracker_NovintFalcon::~vrpn_Tracker_NovintFalcon() -{ - if (m_dev) - delete m_dev; - if (m_obj) - delete m_obj; -} - -void vrpn_Tracker_NovintFalcon::reset() -{ - - // nothing to do - if (m_devflags < 0) return; - - int ret, i; - clear_values(); - - fprintf(stderr, "Resetting the NovintFalcon #%d\n", - vrpn_NovintFalcon_Device::MASK_DEVICEIDX & m_devflags); - - if (m_dev) - delete m_dev; - - m_dev = new vrpn_NovintFalcon_Device(m_devflags); - if (!m_dev) { -#ifdef VERBOSE - fprintf(stderr, "Device constructor failed!\n"); -#endif - status = vrpn_TRACKER_FAIL; - return; - } - - if (!m_dev->init()) { -#ifdef VERBOSE - fprintf(stderr, "Device init failed!\n"); -#endif - status = vrpn_TRACKER_FAIL; - return; - } - - fprintf(stderr, "Reset Completed.\n"); - status = vrpn_TRACKER_SYNCING; // We're trying for a new reading -} - -int vrpn_Tracker_NovintFalcon::get_report(void) -{ - if (!m_dev) - return 0; - - if (status == vrpn_TRACKER_SYNCING) { - if (m_dev->get_status(pos, vel, d_quat, vel_quat, &vel_quat_dt, buttons)) { - // if all buttons are pressed. we force a reset. - int i,j; - j=0; - for (i=0; i < num_buttons; i++) - j += buttons[i]; - // all buttons pressed - if (j == num_buttons) { - status = vrpn_TRACKER_FAIL; - return 0; - } - } else { - status = vrpn_TRACKER_FAIL; - return 0; - } - } - status = vrpn_TRACKER_SYNCING; - -#ifdef VERBOSE2 - print_latest_report(); -#endif - - return 1; -} - -void vrpn_Tracker_NovintFalcon::send_report(void) -{ - if (d_connection) { - char msgbuf[1000]; - int len = vrpn_Tracker::encode_to(msgbuf); - if (d_connection->pack_message(len, m_timestamp, position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - } - len = vrpn_Tracker::encode_vel_to(msgbuf); - if (d_connection->pack_message(len, m_timestamp, velocity_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - } - } -} - -void vrpn_Tracker_NovintFalcon::handle_forces(void) -{ - if (!m_dev) return; - if (!m_obj) return; - - // we have just updated our published position and can use that - d_vector force= m_obj->getObjForce(pos,vel); - m_dev->set_force(force); -} - - -int vrpn_Tracker_NovintFalcon::update_forcefield_effect(vrpn_HANDLERPARAM p) -{ - if (!m_obj) return 1; - - vrpn_float32 center[3]; - vrpn_float32 force[3]; - vrpn_float32 jacobian[3][3]; - vrpn_float32 radius; - - decode_forcefield(p.buffer, p.payload_len, center, force, jacobian, &radius); - // XXX: only one force field effect. sufficient for VMD. - // we have just updated our published position and can use that - m_obj->m_FFEffects[0].start(); - m_obj->m_FFEffects[0].setForce(center, force, jacobian, radius); - return 0; -} - - -void vrpn_Tracker_NovintFalcon::mainloop() -{ - struct timeval current_time; - server_mainloop(); - - // no need to report more often than we can poll the device - vrpn_gettimeofday(¤t_time, NULL); - if ( timediff(current_time, m_timestamp) >= 1000000.0/m_update_rate) { - - // Update the time - m_timestamp.tv_sec = current_time.tv_sec; - m_timestamp.tv_usec = current_time.tv_usec; - switch(status) - { - case vrpn_TRACKER_AWAITING_STATION: - case vrpn_TRACKER_PARTIAL: - case vrpn_TRACKER_SYNCING: - if (get_report()) { - send_report(); - vrpn_Button::report_changes(); - handle_forces(); - } - break; - case vrpn_TRACKER_RESETTING: - reset(); - break; - - case vrpn_TRACKER_FAIL: - fprintf(stderr, "NovintFalcon #%d failed, trying to reset (Try power cycle if more than 4 attempts made)\n", - vrpn_NovintFalcon_Device::MASK_DEVICEIDX & m_devflags); - status = vrpn_TRACKER_RESETTING; - break; - - default: - fprintf(stderr, "NovintFalcon #%d , unknown status message: %d)\n", - vrpn_NovintFalcon_Device::MASK_DEVICEIDX & m_devflags, status); - break; - } - } -} - -#endif diff --git a/src/vrpn/vrpn_Tracker_NovintFalcon.h b/src/vrpn/vrpn_Tracker_NovintFalcon.h deleted file mode 100644 index 23928c8c9d598c5e70d6416fdc5f3e989bf8c6e4..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_NovintFalcon.h +++ /dev/null @@ -1,73 +0,0 @@ -// -*- c++ -*- -// This file provides an interface to a Novint Falcon. -// http://home.novint.com/products/novint_falcon.php -// It uses libnifalcon to communicate with the device. -// http://libnifalcon.nonpolynomial.org/ -// -// file: vrpn_Tracker_NovintFalcon.h -// author: Axel Kohlmeyer akohlmey@gmail.com 2010-04-14 -// copyright: (C) 2010 Axel Kohlmeyer -// license: Released to the Public Domain. -// depends: libnifalcon-1.0.1, libusb-1.0, VRPN 07_26 -// tested on: Linux x86_64 w/ gcc 4.4.1 - -#ifndef __TRACKER_NOVINTFALCON_H -#define __TRACKER_NOVINTFALCON_H - -#include "vrpn_Configure.h" // IWYU pragma: keep - -#if defined(VRPN_USE_LIBNIFALCON) - -#include "vrpn_Tracker.h" -#include "vrpn_Button.h" -#include "vrpn_ForceDevice.h" - -// Forward declaration for proxy class that wraps -// the device management of the falcon. -class vrpn_NovintFalcon_Device; - -// Forward declaration for proxy class that maintains -// the list of objects that contribute to the force. -class vrpn_NovintFalcon_ForceObjects; - -class VRPN_API vrpn_Tracker_NovintFalcon - : public vrpn_Tracker, public vrpn_Button_Filter, public vrpn_ForceDevice { - -public: - /// custom constructor - vrpn_Tracker_NovintFalcon(const char *name, - vrpn_Connection *c = NULL, - const int devidx = 0, - const char *grip = NULL, - const char *kine = NULL, - const char *damp = NULL); - - /// destructor - ~vrpn_Tracker_NovintFalcon(); - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop(); - -protected: // methods for tracker and button functionality - virtual void reset(); - virtual int get_report(void); - virtual void send_report(void); - virtual void clear_values(void); - -protected: // methods for force feedback functionality - /// apply forces from known objects - virtual void handle_forces(void); -public: - /// apply received information about force field effects. - virtual int update_forcefield_effect(vrpn_HANDLERPARAM p); -protected: - int m_devflags; //< device configuration flags - vrpn_float64 m_update_rate; //< update rate of device - vrpn_float64 m_damp; //< damping factor for force updates - struct timeval m_timestamp; //< last update of device status - vrpn_NovintFalcon_Device *m_dev; //< device handle - vrpn_NovintFalcon_ForceObjects *m_obj; //< handle to force generating objects -}; - -#endif /* defined(VRPN_USE_LIBNIFALCON) */ -#endif diff --git a/src/vrpn/vrpn_Tracker_OSVRHackerDevKit.C b/src/vrpn/vrpn_Tracker_OSVRHackerDevKit.C deleted file mode 100644 index f89af064441c983ff8df1992e4f79a5317a3657b..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_OSVRHackerDevKit.C +++ /dev/null @@ -1,113 +0,0 @@ -/** @file vrpn_Tracker_OSVRHackerDevKit.C - @brief Implemendation of the OSVR Hacker Dev Kit HMD tracker. - - @date 2014 - - @author - Kevin M. Godby - <kevin@godby.org> -*/ - -#include "vrpn_Tracker_OSVRHackerDevKit.h" - -#include "vrpn_SendTextMessageStreamProxy.h" -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_NORMAL, etc -#include "vrpn_FixedPoint.h" // for vrpn::FixedPoint -#include <quat.h> // for Q_W, Q_X, etc. - -#include <cstring> // for memset -#include <stdexcept> // for logic_error - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_HID) - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 vrpn_OSVR_VENDOR = 0x1532; -static const vrpn_uint16 vrpn_OSVR_HACKER_DEV_KIT_HMD = 0x0b00; - -/// @todo Alternate, temporary VID/PID -static const vrpn_uint16 vrpn_OSVR_ALT_VENDOR = 0x03EB; -static const vrpn_uint16 vrpn_OSVR_ALT_HACKER_DEV_KIT_HMD = 0x2421; - -vrpn_Tracker_OSVRHackerDevKit::vrpn_Tracker_OSVRHackerDevKit(const char *name, - vrpn_Connection *c) - : vrpn_Tracker(name, c) - , vrpn_HidInterface(new vrpn_HidBooleanOrAcceptor( - new vrpn_HidProductAcceptor(vrpn_OSVR_VENDOR, - vrpn_OSVR_HACKER_DEV_KIT_HMD), - new vrpn_HidProductAcceptor(vrpn_OSVR_ALT_VENDOR, - vrpn_OSVR_ALT_HACKER_DEV_KIT_HMD))) - , _wasConnected(false) -{ - vrpn_Tracker::num_sensors = 1; // only orientation - - // Initialize the state - std::memset(d_quat, 0, sizeof(d_quat)); - d_quat[Q_W] = 1.0; - - // Set the timestamp - vrpn_gettimeofday(&_timestamp, NULL); -} - -vrpn_Tracker_OSVRHackerDevKit::~vrpn_Tracker_OSVRHackerDevKit() -{ - delete _acceptor; -} - -void vrpn_Tracker_OSVRHackerDevKit::on_data_received(std::size_t bytes, - vrpn_uint8 *buffer) -{ - if (bytes != 32) { - send_text_message(vrpn_TEXT_WARNING) - << "Received a report " << bytes - << " in length, but expected it to be 32 bytes. Discarding."; - return; - } - - vrpn_uint8 version = vrpn_unbuffer_from_little_endian<vrpn_uint8>(buffer); - /// @todo Verify that version is what we expect. - vrpn_uint8 msg_seq = vrpn_unbuffer_from_little_endian<vrpn_uint8>(buffer); - - // Signed, 16-bit, fixed-point numbers in Q1.14 format. - typedef vrpn::FixedPoint<1, 14> FixedPointValue; - d_quat[Q_X] = - FixedPointValue(vrpn_unbuffer_from_little_endian<vrpn_int16>(buffer)) - .get<vrpn_float64>(); - d_quat[Q_Y] = - FixedPointValue(vrpn_unbuffer_from_little_endian<vrpn_int16>(buffer)) - .get<vrpn_float64>(); - d_quat[Q_Z] = - FixedPointValue(vrpn_unbuffer_from_little_endian<vrpn_int16>(buffer)) - .get<vrpn_float64>(); - d_quat[Q_W] = - FixedPointValue(vrpn_unbuffer_from_little_endian<vrpn_int16>(buffer)) - .get<vrpn_float64>(); - - vrpn_Tracker::timestamp = _timestamp; - char msgbuf[512]; - int len = vrpn_Tracker::encode_to(msgbuf); - if (d_connection->pack_message(len, _timestamp, position_m_id, d_sender_id, - msgbuf, vrpn_CONNECTION_LOW_LATENCY)) { - fprintf( - stderr, - "vrpn_Tracker_OSVRHackerDevKit: cannot write message: tossing\n"); - } -} - -void vrpn_Tracker_OSVRHackerDevKit::mainloop() -{ - vrpn_gettimeofday(&_timestamp, NULL); - - update(); - - if (connected() && !_wasConnected) { - send_text_message("Successfully connected to OSVR Hacker Dev Kit HMD.", - _timestamp, vrpn_TEXT_NORMAL); - } - _wasConnected = connected(); - - server_mainloop(); -} - -#endif diff --git a/src/vrpn/vrpn_Tracker_OSVRHackerDevKit.h b/src/vrpn/vrpn_Tracker_OSVRHackerDevKit.h deleted file mode 100644 index 7d7cd62c905b320759ca3bbaa8cd1bad7bb25045..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_OSVRHackerDevKit.h +++ /dev/null @@ -1,96 +0,0 @@ -/** @file vrpn_Tracker_OSVRHackerDevKit.h - @brief header for OSVR Hacker Dev Kit - - @date 2014 - - @author - Kevin M. Godby - <kevin@godby.org> -*/ - -#ifndef VRPN_TRACKER_OSVR_HACKER_DEV_KIT_H_ -#define VRPN_TRACKER_OSVR_HACKER_DEV_KIT_H_ - -#include <cstddef> // for size_t -#include <string> // for string - -#include "vrpn_Tracker.h" // for vrpn_Tracker -#include "vrpn_Configure.h" // for VRPN_API, VRPN_USE_HID -#include "vrpn_Connection.h" // for vrpn_Connection (ptr only), etc -#include "vrpn_HumanInterface.h" // for vrpn_HIDDEVINFO, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint16, vrpn_uint32, etc - -#if defined(VRPN_USE_HID) - -/** @brief OSVR Hacker Dev Kit HMD - * The official name of the Razer/Sensics HMD (until they change it again…) is “OSVR Hacker Dev Kit.†- * - * The devkit will have a built-in head tracker. - * - * VID 0x1532 - * PID 0x0B00 - * - * The head tracker shows as a generic HID device - * - * Protocol for it is as follows (in byte offsets): - * - * 0: Version number, currently 1 - * 1: message sequence number (8 bit) - * - * 2: Unit quaternion i component LSB - * 3: Unit quaternion i component MSB - * - * 4: Unit quaternion j component LSB - * 5: Unit quaternion j component MSB - * - * 6: Unit quaternion k component LSB - * 7: Unit quaternion k component MSB - * - * 8: Unit quaternion real component LSB - * 9: Unit quaternion real component MSB - * - * 10-31: reserved for future use - * - * Each quaternion is presented as signed, 16-bit fixed point, 2’s complement - * number with a Q point of 14. - */ -class VRPN_API vrpn_Tracker_OSVRHackerDevKit : public vrpn_Tracker, protected vrpn_HidInterface { -public: - /** - * @brief Constructor. - * - * @param filter HID acceptor. - * @param name Name of tracker. - * @param c Optional vrpn_Connection. - */ - vrpn_Tracker_OSVRHackerDevKit(const char *name, vrpn_Connection *c = NULL); - - /** - * @brief Destructor. - */ - virtual ~vrpn_Tracker_OSVRHackerDevKit(); - - /** - * @brief Standard VRPN mainloop method. - */ - virtual void mainloop(); - -protected: - - /// Extracts the sensor values from each report. - void on_data_received(std::size_t bytes, vrpn_uint8 *buffer); - - /// Timestamp updated during mainloop() - struct timeval _timestamp; - - /// Flag indicating whether we were connected last time through the mainloop. - /// Used to send a "normal"-severity message when we connect with info on the - /// device. - bool _wasConnected; -}; - -#endif // VRPN_USE_HID - -#endif // VRPN_TRACKER_OSVR_HACKER_DEV_KIT_H_ - diff --git a/src/vrpn/vrpn_Tracker_PDI.C b/src/vrpn/vrpn_Tracker_PDI.C deleted file mode 100644 index 3abb702c4765201098965c1119f5c446fc631e6a..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_PDI.C +++ /dev/null @@ -1,2221 +0,0 @@ -// $Header: /PDIvrpn.root/2.0.0/PDIVRPN/vrpn/vrpn_Tracker_G4.cpp 1 6/05/12 12:21p Ben $ -#include "vrpn_Tracker_PDI.h" - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#ifdef VRPN_USE_PDI - -using namespace std; - -#define CM_TO_METERS (1/100.0) - -// Constructor -vrpn_Tracker_G4::vrpn_Tracker_G4 (const char *name, vrpn_Connection *c, const char *filepath, vrpn_float64 Hz, const char *rcmd, vrpn_Tracker_G4_HubMap * pHMap) : - vrpn_Tracker(name, c), update_rate(Hz), m_pHMap(pHMap) - { - srcCalPath = LPCTSTR(filepath); - cmd = (char*)(rcmd); // extra commands - See SendCommand(char *scmd) - register_server_handlers(); - if(!(Initialize())) - { - cout<<"G4: Could not initialize\r\n"; - status = vrpn_TRACKER_FAIL; - } - else if (pHMap && !(InitDigIOBtns())) - { - cout<<"G4: Could not configure DigIO buttons\r\n"; - status = vrpn_TRACKER_FAIL; - } - else if(!(Connect())) - { - cout<<"G4: Could not connect\r\n"; - isCont = false; - status = vrpn_TRACKER_FAIL; - } - else if(!(SetupDevice())) - { - cout<<"G4: Could not setup device\r\n"; - status = vrpn_TRACKER_FAIL; - } - else if(!(StartCont())){ - cout<<"G4: Failed to enter continuous mode\r\n"; - status = vrpn_TRACKER_FAIL; - } - else { - cout<<"G4: Initialization Complete\r\n"; - status = vrpn_TRACKER_REPORT_READY; - } - } - -// Deconstructor -vrpn_Tracker_G4::~vrpn_Tracker_G4(void){ - if(isCont) - StopCont(); - Disconnect(); - - if (m_pHMap) - { - delete m_pHMap; - } -} - - -// Called by the vrpn_Generic_Sever class in order to report its status. -void vrpn_Tracker_G4::mainloop() -{ - struct timeval current_time; - - // Call the generic server mainloop routine, since this is a server - server_mainloop(); - - // See if its time to generate a new report - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) >= 1000000.0/update_rate) { - DisplayCont(current_time); // Sending a report is handled in ParseG4NativeFrame - } -} - - // NOTE: you need to be sure that if you are sending vrpn_float64 then -// the entire array needs to remain aligned to 8 byte boundaries -// (malloced data and static arrays are automatically alloced in -// this way). Assumes that there is enough room to store the -// entire message. Returns the number of characters sent. -int vrpn_Tracker_G4::encode_to(char *buf) -{ - char *bufptr = buf; - int buflen = 1000; - - // Message includes: long sensor, long scrap, vrpn_float64 pos[3], vrpn_float64 quat[4] - // Byte order of each needs to be reversed to match network standard - - vrpn_buffer(&bufptr, &buflen, d_sensor); - vrpn_buffer(&bufptr, &buflen, d_sensor); // This is just to take up space to align - - vrpn_buffer(&bufptr, &buflen, pos[0]); - vrpn_buffer(&bufptr, &buflen, pos[1]); - vrpn_buffer(&bufptr, &buflen, pos[2]); - - vrpn_buffer(&bufptr, &buflen, quat[0]); - vrpn_buffer(&bufptr, &buflen, quat[1]); - vrpn_buffer(&bufptr, &buflen, quat[2]); - vrpn_buffer(&bufptr, &buflen, quat[3]); - - return 1000 - buflen; -} - -//////////////////////////////// PDI Stuff ///////////////////////////////////////////////////// - -// Initialize the device and some variables -BOOL vrpn_Tracker_G4::Initialize(VOID){ - - hContEvent = NULL; - hwnd = NULL; - dwOverflowCount = 0; - - BOOL bRet = TRUE; - - pdiG4.Trace(TRUE, 5); - - bCnxReady = FALSE; - dwStationMap = 0; - - return bRet; -} - - -BOOL vrpn_Tracker_G4::InitDigIOBtns() -{ - BOOL bRet = TRUE; - - if (m_pHMap) - { - - HUBMAP_ENTRY * pHub = m_pHMap->Begin(); - - while (pHub) - { - if (pHub->nBtnCount) - { - pHub->pBtnSrv = new vrpn_Button_Server(pHub->BtnName, d_connection, pHub->nBtnCount ); - if (pHub->pBtnSrv == NULL) - { - cout << "Cannot create button device " << pHub->BtnName << endl; - bRet = FALSE; - break; - } - } - pHub = pHub->Next(); - } - } - - return bRet; -} - -// Connect to the G4 using the filepath provided in the config file. -BOOL vrpn_Tracker_G4::Connect(VOID) -{ - if (!(pdiG4.CnxReady())) - { - if(pdiG4.ConnectG4(srcCalPath)){ - cout<<"G4: Connected\r\n"; - } - } - else{ - cout<<"G4: Already Connected\r\n"; - } - - return pdiG4.CnxReady(); -} - -// End the connection to the G4 -VOID vrpn_Tracker_G4::Disconnect(VOID) -{ - string msg; - if (!(pdiG4.CnxReady())) - { - cout << "G4: Already disconnected\r\n"; - } - else - { - pdiG4.Disconnect(); - cout<< "G4: Disconnected\r\n"; - } - -} - -// Set G4 to collect correct data, eg. cm and quaternions -BOOL vrpn_Tracker_G4::SetupDevice( VOID ) -{ - int i = 0; - pdiG4.GetStationMap( dwStationMap ); - while(dwStationMap == 0 && i<30) - { // Make sure that the G4 can see its hubs and sensors - Sleep(50);// RF signals take a moment to work themselves out after connection - pdiG4.GetStationMap( dwStationMap ); - i++;// Escape in the case that it can not find hubs 7 sensors - } - - OriUnits = E_PDI_ORI_QUATERNION; - pdiG4.SetPNOOriUnits( OriUnits ); - - PosUnits = E_PDI_POS_METER; //ePDIposUnits(2); - pdiG4.SetPNOPosUnits( PosUnits ); - - pdiG4.SetPnoBuffer( pMotionBuf, VRPN_PDI_BUFFER_SIZE ); - - //pdiG4.StartPipeExport(); - UpdateStationMap(); - - if(strlen(cmd)>0) - { - bool end = true; - char *pch; - char *pcmd = cmd; - pch = strtok (pcmd,"\n"); - while (pch != NULL) - { - pcmd += strlen(pch) + 1; - sendCommand(pch); - //printf ("%s\n",pch); - pch = strtok (pcmd, "\n"); - } - } - - //CPDIbiterr cBE; - //pdiG4.GetBITErrs( cBE ); - - //CHAR szc[100]; - //LPTSTR sz = LPTSTR(szc); - //cBE.Parse( sz, 100 ); - - //if (!(cBE.IsClear())) - //{ - // pdiG4.ClearBITErrs(); - //} - - UpdateStationMap(); - if(dwStationMap != 0) - { - return TRUE; - } - return FALSE; // G4 has connected but cannot see any hubs or sensors -} - -// Updates the map of hubs and sensors -VOID vrpn_Tracker_G4::UpdateStationMap( VOID ) -{ - pdiG4.GetStationMap( dwStationMap ); - printf("Set GetStationMap Result: %s\r\n", pdiG4.GetLastResultStr() ); -} - -// Send additional commands to the G4 -// Originally called during setup, but can be called anytime by client software -// since it is a public function. -void vrpn_Tracker_G4::sendCommand(char *scmd) -{ - char command = scmd[0]; - printf("G4: Received Command: %s\n",scmd); - switch(command) - { - case 'B':// Boresight - DoBoresightCmd(&scmd[1]); - break; - case 'X'://Pos Filter - case 'Y'://Att Filter - DoFilterCmd(scmd); - break; - case 'T'://Translation FOR - case 'R'://Rotation FOR - DoFORCmd(scmd); - break; - case 'I'://Increment,AutoIncrement - DoIncrementCmd(scmd); - break; - case 'N': - DoTipOffsetCmd(scmd); - break; - case 'U':// Set Position Units - //action = scmd[1] - 48; - //if(action<4) - //{ - // PosUnits = ePDIposUnits(action); - // pdiG4.SetPNOPosUnits( PosUnits ); - - //} - //else - //{ - // printf("Improper Set Units Command\r\n"); - //} - printf("\tIgnoring 'U' command: VRPN Position Units standard is Meters.\r\n"); - break; - case 'O':// Set Orientation Units - //action = scmd[1] - 48; - //if(action<3) - //{ - // OriUnits = ePDIoriUnits(action); - // pdiG4.SetPNOOriUnits(OriUnits); - //} - //else - //{ - // printf("Improper Set Orientation Command\r\n"); - //} - printf("\tIgnoring 'O' command: VRPN Orientation standard is Quaternion XYZW.\r\n"); - break; - default: - printf("\tUnrecognized Command: %c\r\n", scmd[1]); - break; - } - Sleep(50); -} -#define CMD_ACTION_SET 1 -#define CMD_ACTION_RESET 2 -void vrpn_Tracker_G4::DoBoresightCmd(char *scmd) -{ - PDI4vec fP; - PDIori threeVec = {0.0,0.0,0.0}; // default Euler - PDI4vec fourVec = {1.0,0.0,0.0,0.0}; // default Quaternion WXYZ for G4 - - char delims[] = ",\n"; - char eol[] = "\r\n"; - char comma[] = ","; - char *pArgs = scmd; - //strcpy(pArgs, scmd); - - char *pAct=NULL; - char *pHub=NULL; - char *pSens=NULL; - char *pRef=NULL; - bool bValid = TRUE; - - int nParams=0; - int nAction; - int nHub; - int nSensor; - - pAct = strtok(pArgs,comma); - if (pAct == NULL) - { - bValid = FALSE; - } - else - { - nAction = pAct[0] - '0'; - nParams++; - pHub = strtok(NULL,comma); - if (pHub == NULL ) - { - bValid = FALSE; - } - else - { - nHub = (pHub[0] == '*') ? -1 : atoi(pHub); - nParams++; - pSens = strtok(NULL, delims); - if (pSens == NULL) - { - bValid = FALSE; - } - else - { - nSensor = (pSens[0] == '*') ? -1 : atoi(pSens); - nParams++; - pRef = strtok(NULL, eol); - if (pRef != NULL) - { - nParams += sscanf( pRef, "%f,%f,%f,%f", &fP[1],&fP[2],&fP[3],&fP[0] ); - } - } - } - } - - if (!bValid) - { - printf("\tERROR: Invalid Boresight Command Syntax : B%s\r\n", scmd); - } - else - { - switch (nAction) - { - case (CMD_ACTION_SET): - if (nParams == 7) - { - pdiG4.SetSBoresight(nHub, nSensor, fP); - printf("\tSet Boresight Result: %s\r\n", pdiG4.GetLastResultStr() ); - } - else if (nParams == 3) - { - pdiG4.SetSBoresight(nHub, nSensor, fourVec); - printf("\tSet Boresight Result: %s\r\n", pdiG4.GetLastResultStr() ); - } - else - { - printf("\tERROR: Unexpected Boresight Argument count: %d\r\n", nParams); - } - break; - case (CMD_ACTION_RESET): - pdiG4.ResetSBoresight(nHub, nSensor); - printf("\tReset Boresight Result: %s\r\n", pdiG4.GetLastResultStr() ); - break; - default: - printf("\tERROR: Unrecognized Boresight Action: %s\r\n", pAct); - break; - } - } -} - - -void vrpn_Tracker_G4::DoFilterCmd(char *scmd) -{ - char delims[] = ",\n\r\\"; - char eol[] = "\r\n"; - char comma[] = ","; - char * pArgs = &scmd[1]; - char cmd = scmd[0]; - - char *pAct=NULL; - char *pHub=NULL; - char *pLev=NULL; - char *pCust=NULL; - bool bValid = TRUE; - - int nParams=0; - int nAction; - int nHub; - int nLev; - float F=0, FLow=0, FHigh=0, Factor=0; - CPDIfilter f; - char * pLevelName = 0; - - pAct = strtok(pArgs,comma); - if (pAct == NULL) - { - bValid = FALSE; - } - else - { - nAction = pAct[0] - '0'; - nParams++; - - pHub = strtok(NULL,delims); - if (pHub == NULL ) - { - bValid = FALSE; - } - else - { - nHub = (pHub[0] == '*') ? -1 : atoi(pHub); - nParams++; - - if (nAction == CMD_ACTION_SET) - { - pLev = strtok(NULL, delims); - if (pLev == NULL) - { - bValid = FALSE; - } - else - { - nLev = atoi(pLev); - nParams++; - - if (nLev == E_PDI_FILTER_CUSTOM) - { - pCust = strtok(NULL, eol); - if (pCust == NULL) - { - bValid = FALSE; - } - else - { - nParams += sscanf( pCust, "%f,%f,%f,%f", &f.m_fSensitivity, - &f.m_fLowValue, - &f.m_fHighValue, - &f.m_fMaxTransRate ); - if (nParams != 7) - { - printf("\tERROR: Unexpected Filter Argument count: %d\r\n", nParams); - bValid = FALSE; - } - } - } - } - } - } - } - - if (!bValid) - { - printf("\tERROR: Invalid Filter Command Syntax: %s\r\n", scmd); - } - else - { - if (nLev == E_PDI_FILTER_NONE) - { - nAction = CMD_ACTION_RESET; - } - - switch (nAction) - { - case (CMD_ACTION_SET): - SetFilterPreset( nLev, f, &pLevelName); - if (cmd == 'X') - { - pdiG4.SetHPosFilter( nHub, f); - } - else - { - pdiG4.SetHAttFilter( nHub, f); - } - printf("\tSet Filter Cmd %c %s Result: %s\r\n", cmd, pLevelName, pdiG4.GetLastResultStr() ); - break; - - case (CMD_ACTION_RESET): - if (cmd == 'X') - { - pdiG4.ResetHPosFilter( nHub ); - } - else - { - pdiG4.ResetHAttFilter( nHub ); - } - printf("\tReset Filter Cmd %c Result: %s\r\n", cmd, pdiG4.GetLastResultStr() ); - break; - - default: - printf("\tERROR: Unrecognized Filter Action: %c\r\n", pAct); - break; - } - - } -} - -CPDIfilter FilterPresets[4] = -{ - CPDIfilter(0.0f, 1.0f, 0.0f, 0.0f), // none - CPDIfilter(0.2f, 0.2f, 0.8f, 0.95f), // low, - CPDIfilter(0.05f, 0.05f, 0.8f, 0.95f), // med, - CPDIfilter(0.02f, 0.02f, 0.8f, 0.95f) // heavy -}; -char * PresetNames[5] = -{ - "NONE", "LIGHT", "MEDIUM", "HEAVY", "CUSTOM" -}; - -void vrpn_Tracker_G4::SetFilterPreset( int nLev, CPDIfilter & f, char **pLevName ) -{ - switch (nLev) - { - case E_PDI_FILTER_NONE: - case E_PDI_FILTER_LIGHT: - case E_PDI_FILTER_MED: - case E_PDI_FILTER_HEAVY: - f = FilterPresets[nLev]; - *pLevName = PresetNames[nLev]; - break; - case E_PDI_FILTER_CUSTOM: - *pLevName = PresetNames[nLev]; - break; - default: - f = FilterPresets[E_PDI_FILTER_HEAVY]; - *pLevName = PresetNames[E_PDI_FILTER_HEAVY]; - break; - } -} - -void vrpn_Tracker_G4::DoFORCmd( char *scmd ) -{ - char delims[] = ",\n\r\\"; - char eol[] = "\r\n"; - char comma[] = ","; - char * pArgs = &scmd[1]; - char cmd = scmd[0]; - - char *pAct=NULL; - char *pFOR=NULL; - bool bValid = TRUE; - - int nParams=0; - int nParamSpec=0; - int nAction; - PDIpos pos; - PDIqtrn qtrn; - - pAct = strtok(pArgs,comma); - if (pAct == NULL) - { - bValid = FALSE; - } - else - { - nAction = pAct[0] - '0'; - nParams++; - - if (nAction == CMD_ACTION_SET) - { - pFOR = strtok( NULL, eol ); - if (pFOR == NULL) - { - bValid = FALSE; - } - else if (cmd == 'T') - { - nParams += sscanf( pFOR, "%f,%f,%f", &pos[0], &pos[1], &pos[2] ); - nParamSpec = 4; - } - else - { - nParams += sscanf( pFOR, "%f,%f,%f,%f", &qtrn[1], &qtrn[2], &qtrn[3], &qtrn[0] ); - nParamSpec = 5; - } - - if (nParams != nParamSpec) - { - printf("\tERROR: Unexpected Frame of Reference %c Argument count: %d\r\n", cmd, nParams); - bValid = FALSE; - } - } - } - - if (!bValid) - { - printf("\tERROR: Invalid Frame of Reference Command Syntax: %s\r\n", scmd); - } - else - { - switch (nAction) - { - case (CMD_ACTION_SET): - if (cmd == 'T') - { - pdiG4.SetFrameOfRefTRANS( pos ); - } - else - { - pdiG4.SetFrameOfRefROT( qtrn ); - } - printf("\tSet Frame of Ref %c Result: %s\r\n", cmd, pdiG4.GetLastResultStr() ); - break; - - case (CMD_ACTION_RESET): - if (cmd == 'T') - { - pdiG4.ResetFrameOfRefTRANS(); - } - else - { - pdiG4.ResetFrameOfRefROT(); - } - printf("\tReset Frams of Ref Cmd %c Result: %s\r\n", cmd, pdiG4.GetLastResultStr() ); - break; - - default: - printf("\tERROR: Unrecognized Frame Of Reference Action: %c\r\n", pAct); - break; - } - - } - -} - - - -void vrpn_Tracker_G4::DoIncrementCmd(char *scmd) -{ - char cmd = scmd[0]; - - char delims[] = " ,\r\n\\"; - char eol[] = "\r\n"; - char comma[] = ","; - char *pArgs = &scmd[1]; - //strcpy(pArgs, scmd); - - char *pAct=NULL; - char *pHub=NULL; - char *pSens=NULL; - char *pIncrs=NULL; - bool bValid = TRUE; - - int nParams=0; - int nParamSpec=5; - int nAction; - int nHub; - int nSensor; - float fPosIncr, fOriIncr; - - - pAct = strtok(pArgs,comma); - if (pAct == NULL) - { - bValid = FALSE; - } - else - { - nAction = pAct[0] - '0'; - nParams++; - pHub = strtok(NULL,comma); - if (pHub == NULL ) - { - bValid = FALSE; - } - else - { - nHub = (pHub[0] == '*') ? -1 : atoi(pHub); - nParams++; - pSens = strtok(NULL, delims); - if (pSens == NULL) - { - bValid = FALSE; - } - else - { - nSensor = (pSens[0] == '*') ? -1 : atoi(pSens); - nParams++; - - if (nAction == CMD_ACTION_SET) - { - pIncrs = strtok(NULL, eol); - if (pIncrs == NULL) - { - bValid = FALSE; - } - else - { - nParams += sscanf( pIncrs, "%f,%f", &fPosIncr, &fOriIncr ); - } - - if (nParams != nParamSpec) - { - printf("\tERROR: Unexpected Increment Cmd Argument count: %d\r\n", nParams); - bValid = FALSE; - } - } - } - } - } - - if (!bValid) - { - printf("\tERROR: Invalid Increment Command Syntax : %s\r\n", scmd); - } - else - { - pdiG4.SetPNOOriUnits(E_PDI_ORI_EULER_DEGREE); - printf("\tSet Ori Units DEGREES Result: %s\r\n", pdiG4.GetLastResultStr() ); - switch (nAction) - { - case (CMD_ACTION_SET): - pdiG4.SetSIncrement(nHub, nSensor, fPosIncr, fOriIncr); - printf("\tSet Increment Result: %s\r\n", pdiG4.GetLastResultStr() ); - break; - - case (CMD_ACTION_RESET): - pdiG4.ResetSIncrement(nHub, nSensor); - printf("\tReset Increment Result: %s\r\n", pdiG4.GetLastResultStr() ); - break; - - default: - printf("\tERROR: Unrecognized Increment Action: %s\r\n", pAct); - break; - } - pdiG4.SetPNOOriUnits(E_PDI_ORI_QUATERNION); - printf("\tSet Ori Units QUATERNION Result: %s\r\n", pdiG4.GetLastResultStr() ); - } -} - - - -void vrpn_Tracker_G4::DoTipOffsetCmd(char *scmd) -{ - char cmd = scmd[0]; - - char delims[] = " ,\n\r\\"; - char eol[] = "\r\n"; - char comma[] = ","; - char *pArgs = &scmd[1]; - //strcpy(pArgs, scmd); - - char *pAct=NULL; - char *pHub=NULL; - char *pSens=NULL; - char *pTO=NULL; - bool bValid = TRUE; - - int nParams=0; - int nParamSpec=6; - int nAction; - int nHub; - int nSensor; - PDIpos pos; - - - pAct = strtok(pArgs,comma); - if (pAct == NULL) - { - bValid = FALSE; - } - else - { - nAction = pAct[0] - '0'; - nParams++; - pHub = strtok(NULL,comma); - if (pHub == NULL ) - { - bValid = FALSE; - } - else - { - nHub = (pHub[0] == '*') ? -1 : atoi(pHub); - nParams++; - pSens = strtok(NULL, delims); - if (pSens == NULL) - { - bValid = FALSE; - } - else - { - nSensor = (pSens[0] == '*') ? -1 : atoi(pSens); - nParams++; - - if (nAction == CMD_ACTION_SET) - { - pTO = strtok(NULL, eol); - if (pTO == NULL) - { - bValid = FALSE; - } - else - { - nParams += sscanf( pTO, "%f,%f,%f", &pos[0], &pos[1], &pos[2] ); - } - - if (nParams != nParamSpec) - { - printf("\tERROR: Unexpected Tip Offset Cmd Argument count: %d\r\n", nParams); - bValid = FALSE; - } - } - } - } - } - - if (!bValid) - { - printf("\tERROR: Invalid Tip Offset Command Syntax : %s\r\n", scmd); - } - else - { - switch (nAction) - { - case (CMD_ACTION_SET): - pdiG4.SetSTipOffset(nHub, nSensor, pos); - printf("\tSet Tip Offset Result: %s\r\n", pdiG4.GetLastResultStr() ); - break; - case (CMD_ACTION_RESET): - pdiG4.ResetSTipOffset(nHub, nSensor); - printf("\tReset Tip Offset Result: %s\r\n", pdiG4.GetLastResultStr() ); - break; - default: - printf("\tERROR: Unrecognized Tip Offset Action: %s\r\n", pAct); - break; - } - } -} - - - - -// Start Continuous Mode for the G4 -BOOL vrpn_Tracker_G4::StartCont( VOID ) -{ - cout<<"G4: Start Continuous Mode\r\n"; - BOOL bRet = FALSE; - - - if (!(pdiG4.StartContPnoG4(hwnd))) - { - } - else - { - dwOverflowCount = 0; - bRet = TRUE; - } - - isCont = true; - return bRet; -} - -// Stops Continuous Mode for the G4 -BOOL vrpn_Tracker_G4::StopCont( VOID ) -{ - cout<<"G4: Stop Continuous Mode\r\n"; - BOOL bRet = FALSE; - - if (!(pdiG4.StopContPnoG4())) - { - } - else - { - bRet = TRUE; - Sleep(1000); - } - - isCont = false; - ::ResetEvent(hContEvent); - return bRet; -} - -// Displays a frame of information taken from the continuous stream of -// Continuous Mode by calling ParseG4NativeFrame - not functioning now -BOOL vrpn_Tracker_G4::DisplayCont( timeval ct ) -{ - //cout<<"DisplayCont\r\n"; - BOOL bRet = FALSE; - - PBYTE pBuf; - DWORD dwSize; - PBYTE pLastBuf = 0; - DWORD dwLastSize = 0; - - - if (!(pdiG4.LastPnoPtr(pBuf, dwSize))) - { - } - else if ((pBuf == 0) || (dwSize == 0)) - { - } - else if (pLastBuf && (pBuf > pLastBuf)) - { - ParseG4NativeFrame( pLastBuf+dwLastSize, dwSize+(pBuf-pLastBuf-dwLastSize), ct ); - pLastBuf = pBuf; - dwLastSize = dwSize; - bRet = TRUE; - } - else if (pBuf != pLastBuf) // it wrapped in buffer - { - if (pLastBuf) - cout << "wrapped" << endl; - - pLastBuf = pBuf; - dwLastSize = dwSize; - ParseG4NativeFrame( pBuf, dwSize, ct ); - bRet = TRUE; - } - - //cout<<"Leaving DisplayCont\r\n"; - return bRet; -} - -// Displays a single frame of information from the G4 by collecting data -// and calling ParseG4NativeFrame -BOOL vrpn_Tracker_G4::DisplaySingle( timeval ct ) -{ - BOOL bRet = FALSE; - PBYTE pBuf; - DWORD dwSize; - - if (!(pdiG4.ReadSinglePnoBufG4(pBuf, dwSize))) - { - //cout<<"ReadSinglePno\r\n"; - } - else if ((pBuf == 0) || (dwSize == 0)) - { - } - else - { - ParseG4NativeFrame( pBuf, dwSize, ct ); - bRet = TRUE; - } - - return bRet; - -} - -// Parses the data collected from a P or C command, packages it and sends it out to clients -// calling for it -void vrpn_Tracker_G4::ParseG4NativeFrame( PBYTE pBuf, DWORD dwSize, timeval current_time ) -{ - DWORD dw= 0; - char msgbuf[1000]; - vrpn_int32 len; - LPG4_HUBDATA pHubFrame; - - while (dw < dwSize ) - { - pHubFrame = (LPG4_HUBDATA)(&pBuf[dw]); - - dw += sizeof(G4_HUBDATA); - - UINT nHubID = pHubFrame->nHubID; - UINT nFrameNum = pHubFrame->nFrameCount; - UINT nSensorMap = pHubFrame->dwSensorMap; - UINT nDigIO = pHubFrame->dwDigIO; - - HUBMAP_ENTRY * pH = 0; - int nButtons = 0; - // handle digios if necessary - if (m_pHMap && (pH = m_pHMap->Find( nHubID )) && (nButtons = pH->nBtnCount) ) - { - for (int i=0; i<nButtons; i++) - { - pH->pBtnSrv->set_button(i, (nDigIO & (1<<i)) >> i); - pH->pBtnSrv->mainloop(); - } - } - - UINT nSensMask = 1; - - for (int j=0; j<G4_MAX_SENSORS_PER_HUB; j++) - { - if (((nSensMask << j) & nSensorMap) != 0) - { - G4_SENSORDATA * pSD = &(pHubFrame->sd[j]); - d_sensor = (nHubID*10)+j; - // transfer the data from the G4 data array to the vrpn_Tracker array - pos[0] = pSD->pos[0]; - pos[1] = pSD->pos[1]; - pos[2] = pSD->pos[2]; - - quat[0] = pSD->ori[1]; - quat[1] = pSD->ori[2]; - quat[2] = pSD->ori[3]; - quat[3] = pSD->ori[0]; - - // Grab the current time and create a timestamp - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - // check the connection and then send a message out along it. - if (d_connection) { - // Pack position report - len = encode_to(msgbuf); - d_connection->pack_message(len, timestamp, - position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY); - } - } - } - - - - } // end while dwsize -} - -// Constructor -vrpn_Tracker_FastrakPDI::vrpn_Tracker_FastrakPDI (const char * name, vrpn_Connection *cn, - vrpn_float64 Hz, const char * rcmd, unsigned int nStylusMap) : - vrpn_Tracker(name, cn), update_rate(Hz) - , m_nStylusMap(nStylusMap) - , m_nHeaderSize(3) - , m_nFrameSize(nStylusMap?33:31) - { - cmd = (char*)(rcmd); - register_server_handlers(); - if(!(Initialize())){ - status = vrpn_TRACKER_FAIL; - } - else if (nStylusMap & !(InitStylusBtns())) - { - status = vrpn_TRACKER_FAIL; - } - else if(!(Connect())){ - status = vrpn_TRACKER_FAIL; - } - else if(!(SetupDevice())){ - status = vrpn_TRACKER_FAIL; - cout << "FasTrakPDI: Device setup failed\r\n"; - } - else if(!(StartCont())){ - isCont = FALSE; - cout << "FastrakPDI: Failed to enter continuous mode\r\n"; - status = vrpn_TRACKER_FAIL; - } - else { - cout << "FastrakPDI: Initialization Complete\r\n"; - status = vrpn_TRACKER_REPORT_READY; - } - } - -// Deconstructor -vrpn_Tracker_FastrakPDI::~vrpn_Tracker_FastrakPDI(void) -{ - if(isCont) - StopCont(); - Disconnect(); - - for (int i=0; i<FT_MAX_SENSORS; i++) - { - if (FTstylusBtns[i]) - delete FTstylusBtns[i]; - } - } - -// Called by the vrpn_Generic_Sever class in order to report its status. -VOID vrpn_Tracker_FastrakPDI::mainloop() -{ - struct timeval current_time; - - // Call the generic server mainloop routine, since this is a server - server_mainloop(); - - // See if its time to generate a new report - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) >= 1000000.0/update_rate) { - DisplayCont(current_time); - } -} - -// NOTE: you need to be sure that if you are sending vrpn_float64 then -// the entire array needs to remain aligned to 8 byte boundaries -// (malloced data and static arrays are automatically alloced in -// this way). Assumes that there is enough room to store the -// entire message. Returns the number of characters sent. -int vrpn_Tracker_FastrakPDI::encode_to(char *buf) -{ - char *bufptr = buf; - int buflen = 1000; - - // Message includes: long sensor, long scrap, vrpn_float64 pos[3], vrpn_float64 quat[4] - // Byte order of each needs to be reversed to match network standard - - vrpn_buffer(&bufptr, &buflen, d_sensor); - vrpn_buffer(&bufptr, &buflen, d_sensor); // This is just to take up space to align - - vrpn_buffer(&bufptr, &buflen, pos[0]); - vrpn_buffer(&bufptr, &buflen, pos[1]); - vrpn_buffer(&bufptr, &buflen, pos[2]); - - vrpn_buffer(&bufptr, &buflen, d_quat[0]); - vrpn_buffer(&bufptr, &buflen, d_quat[1]); - vrpn_buffer(&bufptr, &buflen, d_quat[2]); - vrpn_buffer(&bufptr, &buflen, d_quat[3]); - - return 1000 - buflen; -} - - -// Initialize the device and some variables -BOOL vrpn_Tracker_FastrakPDI::Initialize(VOID) -{ - BOOL bRet = TRUE; - - pos[0]=0; pos[1]=0; pos[2]=0; - d_quat[0]=0; d_quat[1]=0; d_quat[2]=0; d_quat[3]=0; - - memset( FTstylusBtns, 0, sizeof(FTstylusBtns)); - - hContEvent = NULL; - hwnd = NULL; - dwOverflowCount = 0; - - - pdiDev.Trace(TRUE, 5); // Report debugging information to IDE output - - bCnxReady = FALSE; - dwStationMap = 0; - - return bRet; -} - -BOOL vrpn_Tracker_FastrakPDI::InitStylusBtns() -{ - BOOL bRet = TRUE; - int mask = 1; - for (int i=0; i<FT_MAX_SENSORS; i++) - { - if (((1<<i) & m_nStylusMap) != 0) - { - char btnName[512]; - sprintf( btnName, "%sStylus%d", d_servicename, i+1); - FTstylusBtns[i] = new vrpn_Button_Server( btnName, d_connection, 1 ); - if (FTstylusBtns[i] == NULL) - { - cout << "Cannot create button device " << btnName << endl; - bRet = FALSE; - } - else - { - cout << "Button device " << btnName << " created." << endl; - } - } - } - return bRet; -} -// Connect to the Fastrak using the filepath provided in the config file -// Sets tracker to default VRPN units and frames -BOOL vrpn_Tracker_FastrakPDI::Connect( VOID ) -{ - if (!(pdiDev.CnxReady())) - { - pdiDev.SetSerialIF( &pdiSer ); - - ePiCommType eType; - - eType = pdiDev.DiscoverCnx(); - DWORD attempts = 0; - while (eType != PI_CNX_USB && eType != PI_CNX_SERIAL && attempts < 10){ - switch (eType) - { - case PI_CNX_USB: - cout << "FastrakPDI: USB Connection\r\n"; - status = vrpn_TRACKER_SYNCING; - break; - case PI_CNX_SERIAL: - cout << "FastrakPDI: Serial Connection\r\n"; - status = vrpn_TRACKER_SYNCING; - break; - default: - printf("FastrakPDI: %s\r\n", pdiDev.GetLastResultStr() ); - eType = pdiDev.DiscoverCnx(); - attempts++; - break; - } - Sleep(3000); - } - - UpdateStationMap(); - num_sensors = pdiDev.StationCount(); - - CPDIbiterr cBE; - pdiDev.GetBITErrs( cBE ); - - CHAR sz[100]; - cBE.Parse( sz, 100 ); - - if(!(cBE.IsClear())) - pdiDev.ClearBITErrs(); - - // Set VRPN defaults for position, orientation and frame structure - //m_nFrameSize = 28; - pdiMDat.Empty(); - if (m_nStylusMap) - { - pdiMDat.Append(PDI_MODATA_STYLUS); - } - pdiMDat.Append( PDI_MODATA_POS ); - pdiMDat.Append( PDI_MODATA_QTRN ); - pdiDev.SetSDataList( -1, pdiMDat ); - pdiDev.SetMetric(TRUE); - isMetric = TRUE; - isBinary = TRUE; - - pdiDev.SetPnoBuffer( pMotionBuf, VRPN_PDI_BUFFER_SIZE ); - - bCnxReady = pdiDev.CnxReady(); - } - else{ - cout << "FastrakPDI: Already connected\r\n"; - bCnxReady = TRUE; - } - - return bCnxReady; -} - -// End the connection to the Fastrak -VOID vrpn_Tracker_FastrakPDI::Disconnect(VOID) -{ - string msg; - if (!(pdiDev.CnxReady())) - { - cout << "FastrakPDI: Already disconnected\r\n"; - } - else - { - pdiDev.Disconnect(); - cout << "FastrakPDI: Disconnected\r\n"; - } - -} - -// Parses rcmd and calls SendCommand for each line -BOOL vrpn_Tracker_FastrakPDI::SetupDevice( VOID ) -{ - char * pcmd = cmd; - if(strlen(pcmd) > 0){ - char * pch = strchr(pcmd,'\\'); - while (pch != NULL){ - pch[0] = '\0'; - SendCommand(pcmd); - pcmd = pch + sizeof(char); - pch = strchr(pcmd,'\\'); - } - SendCommand(pcmd); - } - - // warn the user if tracker is in ASCII mode - if (isBinary == FALSE) - cout << "FastrakPDI: Warning! Tracker is still in ASCII mode!\r\n"; - - return TRUE; -} - -// Updates the map of hubs and sensors -VOID vrpn_Tracker_FastrakPDI::UpdateStationMap( VOID ) -{ - pdiDev.GetStationMap( dwStationMap ); -} - -// Sends commands to the tracker, the syntax is explained in vrpn_FastrakPDI.cfg -VOID vrpn_Tracker_FastrakPDI::SendCommand(char *scmd){ - char szCmd[PI_MAX_CMD_BUF_LEN] = "\0"; - DWORD dwRspSize = 5000; - char szRsp[5000] = "\0"; - bool parseErr = false; - - // print scmd to server screen - cout << "FastrakPDI: reset command "; - unsigned int i = 0; - while (scmd[i] != '\0'){ - // ignore carriage returns and new lines (cleans up output) - if (scmd[i] != '\n' && scmd[i] != '\r') - cout << scmd[i]; - i++; - } - - for (i = 0; i < strlen(scmd); i++){ - switch (scmd[i]){ - case '^': // convert ^ to control+char ascii equivalent - i++; - switch (scmd[i]){ - case 'K': - strncat(szCmd, "\x0b", 1); - break; - case 'Q': - strncat(szCmd, "\x11", 1); - break; - case 'S': - strncat(szCmd, "\x13", 1); - break; - case 'Y': - strncat(szCmd, "\x19", 1); - break; - default: // no match, flip parseErr - i = strlen(scmd); - parseErr = true; - } - break; - case '<': // check for <>, which represents a carriage return - i++; - if (scmd[i] != '>'){ - i = strlen(scmd); - parseErr = true; - } - else - strncat(szCmd, "\r\n", 1); - break; - case '\r': // ignore carriage returns. - break; - case '\n': // ignore new lines - break; - case '\xff': // ignore eof - break; - default: - strncat(szCmd, &scmd[i], 1); - } - } - - // CPDIdev::TxtCmd() and CPDIdev::SetBinary() functions are not exposed in CPDIfastrak - // but can be called from the base class (CPDIdev) - - // Typecasts pdiDev as a CPDIdev in pointer pDev - CPDIdev * pDev = (CPDIdev*) (&pdiDev); - - if (parseErr == true) - cout << "\r\n\t<unrecognized command>\r\n"; - else{ - strncat(szCmd, "\0", 1); - switch (szCmd[0]){ - case 'C': // Continuous pno command - case 'c': // Ignored since this would conflict with VRPN directly - cout << "\r\n\t<command ignored, use P instead>\r\n"; - break; - case 0x19: // reset command - pDev->TxtCmd(szCmd,dwRspSize,szRsp); - cout << "\r\n\t<tracker will be set to VRPN defaults on reconnect>\r\n"; - Disconnect(); - Sleep(2500); - Connect(); - break; - case 'U': // units command - case 'u': - pDev->TxtCmd(szCmd,dwRspSize,szRsp); - if (isBinary == TRUE) - pdiDev.GetMetric(isMetric); - else{ - // if tracker is in ASCII mode, switch to binary for GetMetric function - pDev->SetBinary(TRUE); - pdiDev.GetMetric(isMetric); - pDev->SetBinary(FALSE); - } - if (isMetric == FALSE) - cout << "\r\n\t<position units set to inches>\r\n"; - else - cout << "\r\n\t<position units set to meters>\r\n"; - break; - case 'F': // format (binary or ascii) command - case 'f': - pDev->TxtCmd(szCmd,dwRspSize,szRsp); - pdiDev.GetBinary(isBinary); - if (isBinary == FALSE) - cout << "\r\n\t<response frames set to ASCII>\r\n"; - else - cout << "\r\n\t<response frames set to binary>\r\n"; - break; - case 'O': // data list format command - cout << "\r\n\t<pno frame format changed (use extreme caution)>"; - case 'P': // print single pno command - if (isBinary == TRUE) - cout << "\r\n\t<suggestion: use ASCII response frames (reset command F)>"; - default: - pDev->TxtCmd(szCmd,dwRspSize,szRsp); - if (dwRspSize != 0 && dwRspSize != 5000){ - if (isBinary == TRUE) - cout << "\r\n\t<binary response bgn>\r\n\t"; - else - cout << "\r\n\t<ASCII response bgn>\r\n\t"; - for (i = 0; i < dwRspSize; i++){ - if (szRsp[i] != '\r') - printf("%c",szRsp[i]); - if (szRsp[i] == '\n') - printf("\t"); - } - if (isBinary == TRUE) - cout << "\r\n\t<binary response end>\r\n"; - else - cout << "\r\n\t<ASCII response end>\r\n"; - } - else - cout << "\r\n\t<command sent>\r\n"; - } - } - //Sleep(500); -} - -// Start Continuous Mode for the Fastrak -BOOL vrpn_Tracker_FastrakPDI::StartCont( VOID ) -{ - cout << "FastrakPDI: Start Continuous Mode\r\n"; - BOOL bRet = FALSE; - - - if (!(pdiDev.StartContPno(hwnd))) - { - } - else - { - isCont = TRUE; - dwOverflowCount = 0; - bRet = TRUE; - } - - return bRet; -} - -// Stops Continuous Mode for the Fastrak -BOOL vrpn_Tracker_FastrakPDI::StopCont( VOID ) -{ - cout << "FastrakPDI: Stop Continuous Mode\r\n"; - BOOL bRet = FALSE; - - if (!(pdiDev.StopContPno())) - { - } - else - { - isCont = FALSE; - bRet = TRUE; - Sleep(1000); - } - - ::ResetEvent(hContEvent); - return bRet; -} - -// Displays a frame of information taken from the continuous stream of -// Continuous Mode by calling displayFrame -BOOL vrpn_Tracker_FastrakPDI::DisplayCont( timeval ct ) -{ - BOOL bRet = FALSE; - - PBYTE pBuf; - DWORD dwSize; - PBYTE pLastBuf = 0; - DWORD dwLastSize = 0; - - if (!(pdiDev.LastPnoPtr(pBuf, dwSize))) - { - } - else if ((pBuf == 0) || (dwSize == 0)) - { - } - else if (pLastBuf && (pBuf > pLastBuf)) - { - ParseFastrakFrame( pLastBuf+dwLastSize, dwSize+(pBuf-pLastBuf-dwLastSize), ct ); - pLastBuf = pBuf; - dwLastSize = dwSize; - bRet = TRUE; - } - else if (pBuf != pLastBuf) // it wrapped in buffer - { - if (pLastBuf) - cout << "wrapped\r\n"; - - pLastBuf = pBuf; - dwLastSize = dwSize; - ParseFastrakFrame( pBuf, dwSize, ct ); - bRet = TRUE; - } - - return bRet; -} - -// Displays a single frame of information from the Fastrak by collecting data -// and calling DisplayFrame -VOID vrpn_Tracker_FastrakPDI::DisplaySingle( timeval ct ) -{ - BOOL bExit = FALSE; - - PBYTE pBuf; - DWORD dwSize; - - cout << endl; - - if (!(pdiDev.ReadSinglePnoBuf(pBuf, dwSize))) - { - bExit = TRUE; - } - else if ((pBuf == 0) || (dwSize == 0)) - { - } - else - { - ParseFastrakFrame( pBuf, dwSize, ct ); - } -} - -// Parses the data collected from a DisplaySingle or DisplayContinuous command, packages it and sends it -// out to clients calling for it -VOID vrpn_Tracker_FastrakPDI::ParseFastrakFrame( PBYTE pBuf, DWORD dwSize, timeval current_time ) -{ - - DWORD index = 0; - char msgbuf[1000]; - vrpn_int32 len; - - while (index < dwSize){ - DWORD dw = index; - BYTE ucSensor = pBuf[dw+1]; - BYTE ucInitCommand = pBuf[dw]; - BYTE ucErrorNum = pBuf[dw+2]; - d_sensor = atoi((char*)(&ucSensor)); - - // skip rest of header - dw += m_nHeaderSize;//3; - - // Catch command response frames sent when tracker is in continuous mode - // and don't parse them but do provide output to the server screen - if (ucInitCommand != '0'){ - printf("FastrakPDI: received record type %x while in continuous mode, record error byte was %x \r\n", ucInitCommand, ucErrorNum); - } - else{ - - if (m_nStylusMap) - { - if ((m_nStylusMap & (1 << (d_sensor-1))) != 0) //FTstylusBtns[ucSensor-1]) - { - CHAR StyFlag = pBuf[dw+1]; - - FTstylusBtns[d_sensor-1]->set_button(0, StyFlag - '0'); - FTstylusBtns[d_sensor-1]->mainloop(); - } - dw +=2; - } - - PFLOAT pPno = (PFLOAT)(&pBuf[dw]); // Position and Orientation data - - if (isMetric == TRUE){ - pos[0] = float(pPno[0])*CM_TO_METERS; - pos[1] = float(pPno[1])*CM_TO_METERS; - pos[2] = float(pPno[2])*CM_TO_METERS; - } - else{ - pos[0] = float(pPno[0]); - pos[1] = float(pPno[1]); - pos[2] = float(pPno[2]); - } - - // Fastrak quaternion format is WXYZ, VRPN is XYZW - d_quat[0] = float(pPno[4]); - d_quat[1] = float(pPno[5]); - d_quat[2] = float(pPno[6]); - d_quat[3] = float(pPno[3]); - - - // Grab the current time and create a timestamp - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - if (d_connection) { - // Pack position report - len = encode_to(msgbuf); - d_connection->pack_message(len, timestamp, - position_m_id, d_sender_id, msgbuf, vrpn_CONNECTION_LOW_LATENCY); - } - } - index += m_nFrameSize;//28; - } -} - -// Constructor -vrpn_Tracker_LibertyPDI::vrpn_Tracker_LibertyPDI (const char * name, vrpn_Connection *cn, - vrpn_float64 Hz, const char * rcmd, unsigned int nStylusMap) : - vrpn_Tracker(name, cn), update_rate(Hz) - , m_nStylusMap(nStylusMap) - , m_nHeaderSize(8) - , m_nFrameSize(nStylusMap?40:36) - { - cmd = (char*)(rcmd); - register_server_handlers(); - if(!(Initialize())){ - status = vrpn_TRACKER_FAIL; - } - else if (nStylusMap & !(InitStylusBtns())) - { - status = vrpn_TRACKER_FAIL; - } - else if(!(Connect())){ - status = vrpn_TRACKER_FAIL; - } - else if(!(SetupDevice())){ - status = vrpn_TRACKER_FAIL; - } - else if(!(StartCont())){ - isCont = FALSE; - cout << "LibertyPDI: Failed to enter continuous mode\r\n"; - status = vrpn_TRACKER_FAIL; - } - else { - cout << "LibertyPDI: Initialization Complete\r\n"; - status = vrpn_TRACKER_REPORT_READY; - } - } - -// Deconstructor -vrpn_Tracker_LibertyPDI::~vrpn_Tracker_LibertyPDI(void){ - if(isCont) - StopCont(); - Disconnect(); - - for (int i=0; i<LIBERTY_MAX_SENSORS; i++) - { - if (StylusBtns[i]) - delete StylusBtns[i]; - } - } - -// Called by the vrpn_Generic_Sever class in order to report its status. -VOID vrpn_Tracker_LibertyPDI::mainloop() -{ - struct timeval current_time; - - // Call the generic server mainloop routine, since this is a server - server_mainloop(); - - // See if its time to generate a new report - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) >= 1000000.0/update_rate) { - DisplayCont(current_time); - } -} - -// NOTE: you need to be sure that if you are sending vrpn_float64 then -// the entire array needs to remain aligned to 8 byte boundaries -// (malloced data and static arrays are automatically alloced in -// this way). Assumes that there is enough room to store the -// entire message. Returns the number of characters sent. -int vrpn_Tracker_LibertyPDI::encode_to(char *buf) -{ - char *bufptr = buf; - int buflen = 1000; - - // Message includes: long sensor, long scrap, vrpn_float64 pos[3], vrpn_float64 quat[4] - // Byte order of each needs to be reversed to match network standard - - vrpn_buffer(&bufptr, &buflen, d_sensor); - vrpn_buffer(&bufptr, &buflen, d_sensor); // This is just to take up space to align - - vrpn_buffer(&bufptr, &buflen, pos[0]); - vrpn_buffer(&bufptr, &buflen, pos[1]); - vrpn_buffer(&bufptr, &buflen, pos[2]); - - vrpn_buffer(&bufptr, &buflen, d_quat[0]); - vrpn_buffer(&bufptr, &buflen, d_quat[1]); - vrpn_buffer(&bufptr, &buflen, d_quat[2]); - vrpn_buffer(&bufptr, &buflen, d_quat[3]); - - return 1000 - buflen; -} - - -// Initialize the device and some variables -BOOL vrpn_Tracker_LibertyPDI::Initialize(VOID){ - - pos[0]=0; pos[1]=0; pos[2]=0; - d_quat[0]=0; d_quat[1]=0; d_quat[2]=0; d_quat[3]=0; - - memset( StylusBtns, 0, sizeof(StylusBtns)); - - hContEvent = NULL; - hwnd = NULL; - dwOverflowCount = 0; - - BOOL bRet = TRUE; - - pdiDev.Trace(TRUE, 5); // Report debugging information to IDE output - - bCnxReady = FALSE; - dwStationMap = 0; - - return bRet; -} - - -BOOL vrpn_Tracker_LibertyPDI::InitStylusBtns() -{ - BOOL bRet = TRUE; - int mask = 1; - for (int i=0; i<LIBERTY_MAX_SENSORS; i++) - { - if (((1<<i) & m_nStylusMap) != 0) - { - char btnName[512]; - sprintf( btnName, "%sStylus%d", d_servicename, i+1); - StylusBtns[i] = new vrpn_Button_Server( btnName, d_connection, 1 ); - if (StylusBtns[i] == NULL) - { - cout << "Cannot create button device " << btnName << endl; - bRet = FALSE; - } - else - { - cout << "Button device " << btnName << " created." << endl; - } - } - } - return bRet; -} - -// Connect to the Liberty using the filepath provided in the config file. -// Sets tracker to default VRPN units and frames -BOOL vrpn_Tracker_LibertyPDI::Connect( VOID ) -{ - if (!(pdiDev.CnxReady())) - { - pdiDev.SetSerialIF( &pdiSer ); - - ePiCommType eType; - - eType = pdiDev.DiscoverCnx(); - DWORD attempts = 0; - while (eType != PI_CNX_USB && eType != PI_CNX_SERIAL && attempts < 10){ - switch (eType) - { - case PI_CNX_USB: - cout << "LibertyPDI: USB Connection\r\n"; - status = vrpn_TRACKER_SYNCING; - break; - case PI_CNX_SERIAL: - cout << "LibertyPDI: Serial Connection\r\n"; - status = vrpn_TRACKER_SYNCING; - break; - default: - printf("LibertyPDI: %s\r\n", pdiDev.GetLastResultStr() ); - eType = pdiDev.DiscoverCnx(); - attempts++; - break; - } - Sleep(3000); - } - - UpdateStationMap(); - num_sensors = pdiDev.StationCount(); - - CPDIbiterr cBE; - pdiDev.GetBITErrs( cBE ); - - CHAR sz[100]; - cBE.Parse( sz, 100 ); - - if(!(cBE.IsClear())) - pdiDev.ClearBITErrs(); - - // Set VRPN defaults for position, orientation and frame structure - pdiMDat.Empty(); - if (m_nStylusMap) - { - pdiMDat.Append(PDI_MODATA_STYLUS); - } - pdiMDat.Append( PDI_MODATA_POS ); - pdiMDat.Append( PDI_MODATA_QTRN ); - pdiDev.SetSDataList( -1, pdiMDat ); - - pdiDev.SetMetric(TRUE); - isMetric = TRUE; - isBinary = TRUE; - - // The CPDIdev class will use this space, even if we don't access it directly, - // which allows us to specify the size of the buffer - pdiDev.SetPnoBuffer( pMotionBuf, VRPN_PDI_BUFFER_SIZE ); - - bCnxReady = pdiDev.CnxReady(); - } - else{ - cout << "LibertyPDI: Already connected\r\n"; - bCnxReady = TRUE; - } - - return bCnxReady; -} - -// End the connection to the Liberty -VOID vrpn_Tracker_LibertyPDI::Disconnect(VOID) -{ - string msg; - if (!(pdiDev.CnxReady())) - { - cout << "LibertyPDI: Already disconnected\r\n"; - } - else - { - pdiDev.Disconnect(); - cout << "LibertyPDI: Disconnected\r\n"; - } - -} - -// Send reset commands to tracker -BOOL vrpn_Tracker_LibertyPDI::SetupDevice( VOID ) -{ - char * pcmd = cmd; - if(strlen(pcmd) > 0){ - char * pch = strchr(pcmd,'\\'); - while (pch != NULL){ - pch[0] = '\0'; - SendCommand(pcmd); - pcmd = pch + sizeof(char); - pch = strchr(pcmd,'\\'); - } - SendCommand(pcmd); - } - - // warn the user if tracker is in ASCII mode - if (isBinary == FALSE) - cout << "LibertyPDI: Warning! Tracker is still in ASCII mode!\r\n"; - - return TRUE; -} - -// Updates the map of hubs and sensors -VOID vrpn_Tracker_LibertyPDI::UpdateStationMap( VOID ) -{ - pdiDev.GetStationMap( dwStationMap ); -} - -// Sends commands to the tracker, the syntax is explained in vrpn_LibertyPDI.cfg -VOID vrpn_Tracker_LibertyPDI::SendCommand(char *scmd) -{ - char szCmd[PI_MAX_CMD_BUF_LEN] = "\0"; - DWORD dwRspSize = 5000; - char szRsp[5000] = "\0"; - bool parseErr = false; - - // print scmd to server screen - cout << "LibertyPDI: reset command "; - unsigned int i = 0; - while (scmd[i] != '\0'){ - // ignore carriage returns and new lines (cleans up output) - if (scmd[i] != '\n' && scmd[i] != '\r') - cout << scmd[i]; - i++; - } - - // parse scmd and create a liberty friendly command string szCmd - for (i = 0; i < strlen(scmd); i++){ - switch (scmd[i]){ - case '^': // convert ^ to control+char ascii equivalent - i++; - switch (scmd[i]){ - case 'A': - strncat(szCmd, "\x01", 1); - break; - case 'B': - strncat(szCmd, "\x02", 1); - break; - case 'D': - strncat(szCmd, "\x04", 1); - break; - case 'E': - strncat(szCmd, "\x05", 1); - break; - case 'F': - strncat(szCmd, "\x06", 1); - break; - case 'G': - strncat(szCmd, "\x07", 1); - break; - case 'K': - strncat(szCmd, "\x0b", 1); - break; - case 'L': - strncat(szCmd, "\x0c", 1); - break; - case 'N': - strncat(szCmd, "\x0e", 1); - break; - case 'O': - strncat(szCmd, "\x0f", 1); - break; - case 'P': - strncat(szCmd, "\x10", 1); - break; - case 'R': - strncat(szCmd, "\x12", 1); - break; - case 'S': - strncat(szCmd, "\x13", 1); - break; - case 'T': - strncat(szCmd, "\x14", 1); - break; - case 'U': - strncat(szCmd, "\x15", 1); - break; - case 'V': - strncat(szCmd, "\x16", 1); - break; - case 'W': - strncat(szCmd, "\x17", 1); - break; - case 'X': - strncat(szCmd, "\x18", 1); - break; - case 'Y': - strncat(szCmd, "\x19", 1); - break; - case 'Z': - strncat(szCmd, "\x1a", 1); - break; - default: // no match, flip parseErr - i = strlen(scmd); - parseErr = true; - } - break; - case '<': // check for <>, which represents a carriage return - i++; - if (scmd[i] != '>'){ - i = strlen(scmd); - parseErr = true; - } - else - strncat(szCmd, "\r\n", 1); - break; - case '\r': // ignore carriage returns. - break; - case '\n': // ignore new lines - break; - case '\xff': // ignore eof - break; - default: - strncat(szCmd, &scmd[i], 1); - } - } - - if (parseErr == true) - cout << "\r\n\t<unrecognized command>\r\n"; - else{ - strncat(szCmd, "\0", 1); - switch (szCmd[0]){ - case 'C': // Continuous pno command - case 'c': // Ignored since this would conflict with VRPN directly - cout << "\r\n\t<command ignored, use P instead>\r\n"; - break; - case 0x19: // reset command - pdiDev.TxtCmd(szCmd,dwRspSize,szRsp); - cout << "\r\n\t<tracker will be set to VRPN defaults on reconnect>\r\n"; - Disconnect(); - Sleep(2500); - Connect(); - break; - case 'U': // units command - pdiDev.TxtCmd(szCmd,dwRspSize,szRsp); - if (isBinary == TRUE) - pdiDev.GetMetric(isMetric); - else{ - pdiDev.SetBinary(TRUE); - pdiDev.GetMetric(isMetric); - pdiDev.SetBinary(FALSE); - } - if (isMetric == FALSE) - cout << "\r\n\t<position units set to inches>\r\n"; - else - cout << "\r\n\t<position units set to meters>\r\n"; - break; - case 'F': // format (binary or ascii) command - pdiDev.TxtCmd(szCmd,dwRspSize,szRsp); - pdiDev.GetBinary(isBinary); - if (isBinary == FALSE) - cout << "\r\n\t<response frames set to ascii>\r\n"; - else - cout << "\r\n\t<response frames set to binary>\r\n"; - break; - case 'O': // data list format command - pdiDev.TxtCmd(szCmd,dwRspSize,szRsp); - cout << "\r\n\t<pno frame format changed (use extreme caution)>\r\n"; - break; - default: - pdiDev.TxtCmd(szCmd,dwRspSize,szRsp); - if (isBinary == TRUE && dwRspSize != 0 && dwRspSize != 5000){ - char * pRsp = szRsp; - pRsp += 4; - if (*pRsp == 0x00 || *pRsp == 0x20) - cout << "\r\n\t<binary response contained no error>\r\n"; - else{ - pRsp += 2; - cout << "\r\n\t<binary error response bgn>\r\n\t"; - for (int i = 2; i < 2 + short(*pRsp); i++){ - if (szRsp[i] != '\r') - printf("%c",pRsp[i]); - if (szRsp[i] == '\n') - printf("\t"); - } - cout << "\r\n\t<binary error response end>\r\n"; - } - } - else if (dwRspSize != 0 && dwRspSize != 5000){ - cout << "\r\n\t<ASCII response bgn>\r\n\t"; - for (unsigned int i = 0; i < dwRspSize; i++){ - if (szRsp[i] != '\r') - printf("%c",szRsp[i]); - if (szRsp[i] == '\n') - printf("\t"); - } - cout << "\r\n\t<ASCII response end>\r\n"; - } - else - cout << "\r\n\t<command sent>\r\n"; - } - } -} - -// Start Continuous Mode for the Liberty -BOOL vrpn_Tracker_LibertyPDI::StartCont( VOID ) -{ - cout << "LibertyPDI: Start Continuous Mode\r\n"; - BOOL bRet = FALSE; - - - if (!(pdiDev.StartContPno(hwnd))) - { - } - else - { - isCont = TRUE; - dwOverflowCount = 0; - bRet = TRUE; - } - - return bRet; -} - -// Stops Continuous Mode for the Liberty -BOOL vrpn_Tracker_LibertyPDI::StopCont( VOID ) -{ - cout << "LibertyPDI: Stop Continuous Mode\r\n"; - BOOL bRet = FALSE; - - if (!(pdiDev.StopContPno())) - { - } - else - { - isCont = FALSE; - bRet = TRUE; - Sleep(1000); - } - - ::ResetEvent(hContEvent); - return bRet; -} - -// Displays a frame of information taken from the continuous stream of -// Continuous Mode by calling displayFrame -BOOL vrpn_Tracker_LibertyPDI::DisplayCont( timeval ct ) -{ - BOOL bRet = FALSE; - - PBYTE pBuf; - DWORD dwSize; - PBYTE pLastBuf = 0; - DWORD dwLastSize = 0; - - if (!(pdiDev.LastPnoPtr(pBuf, dwSize))) - { - } - else if ((pBuf == 0) || (dwSize == 0)) - { - } - else if (pLastBuf && (pBuf > pLastBuf)) - { - ParseLibertyFrame( pLastBuf+dwLastSize, dwSize+(pBuf-pLastBuf-dwLastSize), ct ); - pLastBuf = pBuf; - dwLastSize = dwSize; - bRet = TRUE; - } - else if (pBuf != pLastBuf) // it wrapped in buffer - { - if (pLastBuf) - cout << "wrapped\n"; - - pLastBuf = pBuf; - dwLastSize = dwSize; - ParseLibertyFrame( pBuf, dwSize, ct ); - bRet = TRUE; - } - - return bRet; -} - -// Displays a single frame of information from the Liberty by collecting data -// and calling DisplayFrame -VOID vrpn_Tracker_LibertyPDI::DisplaySingle( timeval ct ) -{ - BOOL bExit = FALSE; - - PBYTE pBuf; - DWORD dwSize; - - cout << endl; - - if (!(pdiDev.ReadSinglePnoBuf(pBuf, dwSize))) - { - bExit = TRUE; - } - else if ((pBuf == 0) || (dwSize == 0)) - { - } - else - { - ParseLibertyFrame( pBuf, dwSize, ct ); - } -} - -// Parses the data collected from a DisplaySingle or DisplayContinuous command, packages it and sends it -// out to clients calling for it -VOID vrpn_Tracker_LibertyPDI::ParseLibertyFrame( PBYTE pBuf, DWORD dwSize, timeval current_time ) -{ - - DWORD index = 0; - char msgbuf[1000]; - vrpn_int32 len; - - while (index < dwSize){ - DWORD dw = index; - BYTE ucSensor = pBuf[dw+2]; - BYTE ucInitCommand = pBuf[dw+3]; - BYTE ucErrorNum = pBuf[dw+4]; - SHORT shSize = pBuf[dw+6]; - d_sensor = unsigned short(ucSensor); - - // skip rest of header - dw += m_nHeaderSize;//8; - - // Catch command response frames sent when tracker is in continuous mode - // and don't parse them but do provide output to the server screen - if (ucInitCommand != 'C' && ucInitCommand != 'P'){ - printf("LibertyPDI: received command %x while in continuous mode, tracker response was %x \r\n", ucInitCommand, ucErrorNum); - } - else{ - if (m_nStylusMap) - { - if ((m_nStylusMap & (1 << (d_sensor-1))) != 0) - { - DWORD m_dwStylus = *((DWORD*)&pBuf[dw]); - - StylusBtns[d_sensor-1]->set_button(0, m_dwStylus); - StylusBtns[d_sensor-1]->mainloop(); - } - dw += sizeof(DWORD);; - } - - - PFLOAT pPno = (PFLOAT)(&pBuf[dw]); // Position and Orientation data - - if (isMetric == TRUE){ - pos[0] = float(pPno[0])*CM_TO_METERS; - pos[1] = float(pPno[1])*CM_TO_METERS; - pos[2] = float(pPno[2])*CM_TO_METERS; - } - else{ - pos[0] = float(pPno[0]); - pos[1] = float(pPno[1]); - pos[2] = float(pPno[2]); - } - - // Liberty quaternion format is WXYZ, VRPN is XYZW - d_quat[0] = float(pPno[4]); - d_quat[1] = float(pPno[5]); - d_quat[2] = float(pPno[6]); - d_quat[3] = float(pPno[3]); - - // Grab the current time and create a timestamp - timestamp.tv_sec = current_time.tv_sec; - timestamp.tv_usec = current_time.tv_usec; - if (d_connection) { - // Pack position report - len = encode_to(msgbuf); - d_connection->pack_message(len, timestamp, - position_m_id, d_sender_id, msgbuf, vrpn_CONNECTION_LOW_LATENCY); - } - } - index += m_nFrameSize; - } -} - -#endif diff --git a/src/vrpn/vrpn_Tracker_PDI.h b/src/vrpn/vrpn_Tracker_PDI.h deleted file mode 100644 index 826827964834519a62e70fd3fae543914c0dde1f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_PDI.h +++ /dev/null @@ -1,272 +0,0 @@ -// $Header: /PDIvrpn.root/2.0.0/PDIVRPN/vrpn/vrpn_Tracker_G4.h 1 6/05/12 12:21p Ben $ -#ifndef VRPN_TRACKER_PDI_H -#define VRPN_TRACKER_PDI_H - -// See if we have defined the use of this code in vrpn_Configure.h or in CMake -#include "vrpn_Configure.h" -#include "vrpn_Tracker.h" -#include "vrpn_Button.h" - -#ifdef VRPN_USE_PDI - -#include "tchar.h" -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <iostream> - -#include "PDI.h" - -#define VRPN_PDI_BUFFER_SIZE 0x1FA400 // 30 seconds of xyzaer+fc 8 sensors at 240 hz - -#define VRPN_G4_HUB_NAME_SIZE 64 -#define VRPN_G4_POWERTRAK_BUTTON_COUNT 4 - -//vrpn_Tracker_G4_HubMap_El and vrpn_Tracker_G4_HubMap -//classes are used in place of STL vector or list for listing -//ordered non-contiguous hub identifiers for management of -//digital i/o inputs on those hubs. -//These classes could easily be used for listing stylus -//button stations for other PDI trackers instead of the bitmap -//approach used now. -class VRPN_API vrpn_Tracker_G4_HubMap_El -{ -public: - vrpn_Tracker_G4_HubMap_El( int nHub ) - : pBtnSrv(NULL), nHubID(nHub), pNext(NULL), nBtnCount(0) - { - memset(BtnName, 0, sizeof(BtnName)); - }; - ~vrpn_Tracker_G4_HubMap_El() - { - if (pBtnSrv) - delete pBtnSrv; - } - - void ButtonName( char * NewName ) - { - if (!NewName) - {} - else - { - strncpy(BtnName, NewName, VRPN_G4_HUB_NAME_SIZE); - } - } - - void ButtonCount( int n ) - { - nBtnCount = n; - } - - - vrpn_Tracker_G4_HubMap_El * Next() - { return pNext; } - - void SetNext( vrpn_Tracker_G4_HubMap_El *pn) - { pNext = pn; } - - friend class vrpn_Tracker_G4_HubMap; - friend class vrpn_Tracker_G4; - -private: - int nHubID; - vrpn_Button_Server * pBtnSrv; - vrpn_Tracker_G4_HubMap_El * pNext; - char BtnName[VRPN_G4_HUB_NAME_SIZE]; - int nBtnCount; -}; - -typedef vrpn_Tracker_G4_HubMap_El HUBMAP_ENTRY; - -class VRPN_API vrpn_Tracker_G4_HubMap -{ -public: - vrpn_Tracker_G4_HubMap():p_hub_map(NULL){}; - - ~vrpn_Tracker_G4_HubMap() - { - while (p_hub_map != NULL) - { - HUBMAP_ENTRY *next = p_hub_map->Next(); - delete p_hub_map; - p_hub_map = next; - } - } - - void Add( int nHub ) - { - HUBMAP_ENTRY *next = p_hub_map; - p_hub_map = new HUBMAP_ENTRY( nHub ); - p_hub_map->SetNext(next); - } - - HUBMAP_ENTRY * Find( int nHub ) - { - HUBMAP_ENTRY * pH = p_hub_map; - while (pH && (pH->nHubID != nHub)) - pH = pH->Next(); - return pH; - } - - void ButtonInfo( int nHub, char * BtnName, int nBtnCount ) - { - HUBMAP_ENTRY * pHub = Find( nHub ); - if (pHub) - { - pHub->ButtonName( BtnName ); - pHub->ButtonCount( nBtnCount ); - } - } - - vrpn_Tracker_G4_HubMap_El * Begin() - { - return p_hub_map; - } - - HUBMAP_ENTRY * p_hub_map; -}; - -class VRPN_API vrpn_Tracker_G4: public vrpn_Tracker { - public: - vrpn_Tracker_G4 (const char *name, vrpn_Connection *cn, const char *filepath, - vrpn_float64 Hz = 10.0, const char *rcmd = NULL, vrpn_Tracker_G4_HubMap * pHMap=NULL); - - ~vrpn_Tracker_G4(void); - virtual void mainloop(); - int encode_to(char *buf); - BOOL Initialize ( VOID ); - BOOL InitDigIOBtns( void ); - BOOL Connect ( VOID ); - VOID Disconnect ( VOID ); - BOOL SetupDevice ( VOID ); - VOID UpdateStationMap ( VOID ); - BOOL DisplaySingle( timeval ct ); - BOOL StartCont ( VOID ); - BOOL StopCont ( VOID ); - BOOL DisplayCont ( timeval ct ); - void sendCommand(char * scmd); - void DoBoresightCmd(char *scmd); - void DoFilterCmd(char *scmd); - void SetFilterPreset( int nLev, CPDIfilter & f, char **pLevName ); - void DoFORCmd( char *scmd ); - void DoIncrementCmd( char *scmd ); - void DoTipOffsetCmd( char *scmd ); - - void ParseG4NativeFrame( PBYTE pBuf, DWORD dwSize, timeval current_time ); - - protected: - vrpn_float64 update_rate; - vrpn_float64 pos[3], quat[4]; - int status; - char *cmd; // additional commands for the tracker - bool isCont; // Keeps track of whether or not device is in continuous mode - CPDIg4 pdiG4; // PDI object for the device - CPDImdat pdiMDat; // Map of output format - LPCTSTR srcCalPath; // Filepath of the Source Calibration file - BOOL bCnxReady; // Keeps track of wheter the connection is active - DWORD dwStationMap; // map of the hubs and sensors - ePDIoriUnits OriUnits; // Orientaion Units e.g. Euler, Quaternion - ePDIposUnits PosUnits; // Positions Units e.g. Inches, Meters - vrpn_Tracker_G4_HubMap * m_pHMap; - - HANDLE hContEvent; - HWND hwnd; - DWORD dwOverflowCount; - BYTE pMotionBuf[VRPN_PDI_BUFFER_SIZE]; -}; - -class VRPN_API vrpn_Tracker_FastrakPDI: public vrpn_Tracker { - public: - vrpn_Tracker_FastrakPDI (const char * name, vrpn_Connection * cn, - vrpn_float64 Hz = 10, const char * rcmd = NULL, unsigned int nStylusMap = 0); - - ~vrpn_Tracker_FastrakPDI(void); - virtual void mainloop(); - int encode_to(char *buf); - BOOL Initialize ( VOID ); - BOOL InitStylusBtns(); - BOOL Connect ( VOID ); - VOID Disconnect ( VOID ); - BOOL SetupDevice ( VOID ); - VOID UpdateStationMap ( VOID ); - VOID DisplaySingle ( timeval current_time ); - BOOL StartCont ( VOID ); - BOOL StopCont ( VOID ); - BOOL DisplayCont ( timeval current_time ); - VOID SendCommand( char *scmd ); - - VOID ParseFastrakFrame ( PBYTE pBuf, DWORD dwSize, timeval current_time ); - - protected: - vrpn_float64 update_rate; - vrpn_float64 pos[3], d_quat[4]; - int status; - char *cmd; // pointer to individual command, member of rcmd, for tracker - BOOL isBinary; // keeps track of whether or not the device is in binary mode - BOOL isCont; // Keeps track of whether or not device is in continuous mode - BOOL isMetric; // tracks pos units - CPDIfastrak pdiDev; // PDI object for the device - CPDImdat pdiMDat; // Map of output format - CPDIser pdiSer; // Serial connection object for the device - BOOL bCnxReady; // Keeps track of whether the connection is active - DWORD dwStationMap; // Map of the hubs and sensors - DWORD m_nStylusMap; // Map of sensors with stylus - int m_nHeaderSize;// Num byte in P&O frame header - int m_nFrameSize; // Num bytes in entire P&O frame (inc header) - vrpn_Button_Server * FTstylusBtns[FT_MAX_SENSORS]; //< Pointer to button on each sensor (NULL if none) - - HANDLE hContEvent; - HWND hwnd; - DWORD dwOverflowCount; - BYTE pMotionBuf[VRPN_PDI_BUFFER_SIZE]; -}; - -class VRPN_API vrpn_Tracker_LibertyPDI: public vrpn_Tracker { - public: - vrpn_Tracker_LibertyPDI (const char * name, vrpn_Connection * cn, - vrpn_float64 Hz = 10, const char * rcmd = NULL, unsigned int nStylusMap = 0); - - ~vrpn_Tracker_LibertyPDI(void); - virtual void mainloop(); - int encode_to(char *buf); - BOOL Initialize ( VOID ); - BOOL InitStylusBtns(); - BOOL Connect ( VOID ); - VOID Disconnect ( VOID ); - BOOL SetupDevice ( VOID ); - VOID UpdateStationMap ( VOID ); - VOID DisplaySingle ( timeval current_time ); - BOOL StartCont ( VOID ); - BOOL StopCont ( VOID ); - BOOL DisplayCont ( timeval current_time ); - VOID SendCommand( char *scmd ); - - VOID ParseLibertyFrame ( PBYTE pBuf, DWORD dwSize, timeval current_time ); - - protected: - vrpn_float64 update_rate; - vrpn_float64 pos[3], d_quat[4]; - int status; - char *cmd; // pointer to individual command, member of rcmd, for tracker - BOOL isBinary; // keeps track of whether or not the device is in binary mode - BOOL isCont; // Keeps track of whether or not device is in continuous mode - BOOL isMetric; // tracks pos units - CPDIdev pdiDev; // PDI object for the device - CPDImdat pdiMDat; // Map of output format - CPDIser pdiSer; // Serial connection object for the device - BOOL bCnxReady; // Keeps track of whether the connection is active - DWORD dwStationMap; // Map of the hubs and sensors - DWORD m_nStylusMap; // Map of sensors with stylus - int m_nHeaderSize;// Num byte in P&O frame header - int m_nFrameSize; // Num bytes in entire P&O frame (inc header) - - vrpn_Button_Server * StylusBtns[LIBERTY_MAX_SENSORS]; //< Pointer to button on each sensor (NULL if none) - - HANDLE hContEvent; - HWND hwnd; - DWORD dwOverflowCount; - BYTE pMotionBuf[VRPN_PDI_BUFFER_SIZE]; -}; - -#endif -#endif diff --git a/src/vrpn/vrpn_Tracker_PhaseSpace.C b/src/vrpn/vrpn_Tracker_PhaseSpace.C deleted file mode 100644 index 843959d82e3b7ca08ed97588c497345fc66decb4..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_PhaseSpace.C +++ /dev/null @@ -1,443 +0,0 @@ -#include "vrpn_Tracker_PhaseSpace.h" - -#define MM_TO_METERS (0.001) - -#ifdef VRPN_INCLUDE_PHASESPACE -//#define DEBUG - -// -inline void frame_to_time(int frame, float frequency, struct timeval &time) { - float t = frame / frequency; - time.tv_sec = int(t); - time.tv_usec = int((t - time.tv_sec)*1E6); -} - -// -vrpn_Tracker_PhaseSpace::vrpn_Tracker_PhaseSpace(const char *name, vrpn_Connection *c, const char* device, float frequency,int readflag, int slave) - : vrpn_Tracker(name,c) -{ -#ifdef DEBUG - printf("%s %s %s %f %d\n", __PRETTY_FUNCTION__, name, device, frequency, readflag); -#endif - - if(d_connection) { - // Register a handler for the update change callback - if (register_autodeleted_handler(update_rate_id, handle_update_rate_request, this, d_sender_id)) - fprintf(stderr,"vrpn_Tracker: Can't register workspace handler\n"); - } - - this->slave = slave; - this->frequency = frequency; - - numRigids = 0; - numMarkers = 0; - markers.reserve(VRPN_PHASESPACE_MAXMARKERS); - rigids.reserve(VRPN_PHASESPACE_MAXRIGIDS); - - int owlflag = 0; - if(slave) owlflag |= OWL_SLAVE; - - int ret = owlInit(device,owlflag); - if(ret != owlflag) { - fprintf(stderr, "owlInit error: 0x%x\n", ret); - owlRunning = false; - return; - } else { - owlRunning = true; - } - - char msg[512]; - if(owlGetString(OWL_VERSION,msg)) { - printf("OWL version: %s\n",msg); - } else { - printf("Unable to query OWL version.\n"); - } - - if(!slave) { - //The master point tracker is index 0. So all rigid trackers will start from 1. - owlTrackeri(0, OWL_CREATE, OWL_POINT_TRACKER); - if(!owlGetStatus()) { - fprintf(stderr,"Error: Unable to create main point tracker.\n"); - return; - } - } else { - printf("Ignoring tracker creation in slave mode.\n"); - } - - readMostRecent = readflag ? true : false; - frame = 0; -} - -// -vrpn_Tracker_PhaseSpace::~vrpn_Tracker_PhaseSpace() -{ -#ifdef DEBUG - printf("%s\n", __PRETTY_FUNCTION__); -#endif - - if(owlRunning) - owlDone(); -} - - -// This function should be called each time through the main loop -// of the server code. It polls for data from the OWL server and -// sends them if available. -void vrpn_Tracker_PhaseSpace::mainloop() -{ - get_report(); - - // Call the generic server mainloop, since we are a server - server_mainloop(); - return; -} - -// -bool vrpn_Tracker_PhaseSpace::addMarker(int sensor,int led_id) -{ -#ifdef DEBUG - printf("%s %d %d\n", __PRETTY_FUNCTION__, sensor, led_id); -#endif - - if(!owlRunning) return false; - if(slave) return false; - - if(numMarkers >= VRPN_PHASESPACE_MAXMARKERS) { - fprintf(stderr, "Error: Maximum markers (%d) exceeded.\n", VRPN_PHASESPACE_MAXMARKERS); - return false; - } - - owlMarkeri(MARKER(0,sensor),OWL_SET_LED,led_id); - - if(!owlGetStatus()) - return false; - - numMarkers++; - return true; -} - -/* -This function must only be called after startNewRigidBody has been called. -*/ -bool vrpn_Tracker_PhaseSpace::addRigidMarker(int sensor, int led_id, float x, float y, float z) -{ -#ifdef DEBUG - printf("%s %d %d %f %f %f\n", __PRETTY_FUNCTION__, sensor, led_id, x, y, z); -#endif - - if(!owlRunning) return false; - if(slave) return false; - - if(numRigids == 0) { - fprintf(stderr, "Error: Attempting to add rigid body marker with no rigid body defined."); - return false; - } - if(numMarkers >= VRPN_PHASESPACE_MAXMARKERS) { - fprintf(stderr, "Error: Maximum markers (%d) exceeded.\n", VRPN_PHASESPACE_MAXMARKERS); - return false; - } - - float xyz[3]; - xyz[0] = x; - xyz[1] = y; - xyz[2] = z; - - owlMarkeri(MARKER(numRigids,sensor),OWL_SET_LED,led_id); - owlMarkerfv(MARKER(numRigids,sensor),OWL_SET_POSITION,&xyz[0]); - - if(!owlGetStatus()) - return false; - - numMarkers++; - return true; -} - -/* -Starts a new rigid body definition and creates a tracker for it on -the server. Use addRigidMarker() to add markers to the tracker. -Trackers must be disabled (using enableTracker(false)) before being -modified or created. -*/ -bool vrpn_Tracker_PhaseSpace::startNewRigidBody(int sensor) -{ -#ifdef DEBUG - printf("%s %d\n", __PRETTY_FUNCTION__, sensor); -#endif - - if(!owlRunning) return false; - if(slave) return false; - - if(numRigids >= VRPN_PHASESPACE_MAXRIGIDS) { - fprintf(stderr, "error: maximum rigid bodies (%d) exceeded\n", VRPN_PHASESPACE_MAXRIGIDS); - return false; - } - - owlTrackeri(++numRigids, OWL_CREATE, OWL_RIGID_TRACKER); - - if(!owlGetStatus()) { - numRigids--; - return false; - } - - //remember the sensor that this rigid tracker is mapped to. - r2s_map[numRigids] = sensor; - return true; -} - -/* -Enables all the trackers and sets the streaming frequency. -Note: Trackers according to VRPN and Trackers as defined by OWL -are two entirely different things. -*/ -bool vrpn_Tracker_PhaseSpace::enableTracker(bool enable) -{ -#ifdef DEBUG - printf("%s %d\n", __PRETTY_FUNCTION__, enable); -#endif - - if(!owlRunning) return false; - - // Scale the reports for this tracker to be in meters rather than - // in MM, to match the VRPN standard. - owlScale(MM_TO_METERS); - - if(!slave) { - int option = enable ? OWL_ENABLE : OWL_DISABLE; - owlTracker(0,option); //enables/disables the point tracker - if(!owlGetStatus()) - return false; - - //enable/disable the rigid trackers - for(int i = 1; i <= numRigids; i++) { - owlTracker(i,option); - if(!owlGetStatus()) - return false; - } - } - - if(enable) { - setFrequency(frequency); - owlSetInteger(OWL_EVENTS, OWL_ENABLE); - owlSetInteger(OWL_STREAMING,OWL_ENABLE); - if(!owlGetStatus()) - return false; - printf("Streaming enabled.\n"); - } else { - owlSetInteger(OWL_EVENTS, OWL_DISABLE); - owlSetInteger(OWL_STREAMING,OWL_DISABLE); - if(!owlGetStatus()) - return false; - printf("Streaming disabled.\n"); - } - return true; -} - -int debugcounter = 0; - -// -int vrpn_Tracker_PhaseSpace::read_frame(void) -{ - int ret = 0; - char buffer[1024]; - OWLEvent e = owlGetEvent(); - switch(e.type) { - case 0: - break; - case OWL_DONE: - owlRunning = false; - send_text_message("owl stopped\n", timestamp, vrpn_TEXT_ERROR); - return 0; - case OWL_FREQUENCY: - owlGetFloatv(OWL_FREQUENCY, &frequency); - fprintf(stdout, "frequency: %d\n", frequency); - break; - case OWL_BUTTONS: break; - case OWL_MARKERS: - markers.resize(VRPN_PHASESPACE_MAXMARKERS); - ret = owlGetMarkers(&markers.front(), markers.size()); - if(ret > 0) markers.resize(ret); - break; - case OWL_RIGIDS: - rigids.resize(VRPN_PHASESPACE_MAXRIGIDS); - ret = owlGetRigids(&rigids.front(), rigids.size()); - if(ret > 0) rigids.resize(ret); - break; - case OWL_COMMDATA: - owlGetString(OWL_COMMDATA, buffer); - break; - case OWL_TIMESTAMP: - owlGetIntegerv(OWL_TIMESTAMP, &ret); - break; - case OWL_PLANES: - planes.resize(VRPN_PHASESPACE_MAXPLANES); - ret = owlGetPlanes(&planes.front(), planes.size()); - if(ret > 0) planes.resize(ret); - break; - case OWL_DETECTORS: - detectors.resize(VRPN_PHASESPACE_MAXDETECTORS); - ret = owlGetDetectors(&detectors.front(), detectors.size()); - if(ret > 0) detectors.resize(ret); - break; - case OWL_PEAKS: - peaks.resize(VRPN_PHASESPACE_MAXPEAKS); - ret = owlGetPeaks(&peaks.front(), peaks.size()); - if(ret > 0) peaks.resize(ret); - break; - case OWL_IMAGES: - images.resize(VRPN_PHASESPACE_MAXIMAGES); - ret = owlGetImages(&images.front(), images.size()); - if(ret > 0) images.resize(ret); - break; - case OWL_CAMERAS: - cameras.resize(VRPN_PHASESPACE_MAXCAMERAS); - ret = owlGetCameras(&cameras.front(), cameras.size()); - if(ret > 0) cameras.resize(ret); - break; - case OWL_STATUS_STRING: break; - case OWL_CUSTOM_STRING: break; - case OWL_FRAME_NUMBER: - if(owlGetIntegerv(OWL_FRAME_NUMBER, &ret)) - frame = ret; - break; - default: - fprintf(stderr, "unsupported OWLEvent type: 0x%x\n", e.type); - break; - } - return e.type; -} - -// -int vrpn_Tracker_PhaseSpace::get_report(void) -{ - if(!owlRunning) return 0; - - int maxiter = 1; - if(readMostRecent) maxiter = 1024; // not technically most recent, but if the client is slow, avoids infinite loop. - - int ret = 1; - int oldframe = frame; - for(int i = 0; i < maxiter && ret; i++) { - int cframe = frame; - while(ret && cframe == frame) { - ret = read_frame(); - } - } - // no new data? abort. - if(oldframe == frame) - return 0; - -#ifdef DEBUG - char buffer[1024]; - owlGetString(OWL_FRAME_BUFFER_SIZE, buffer); - printf("%s\n", buffer); -#endif - - for(int i = 0; i < markers.size(); i++) - { - if(markers[i].cond <= 0) continue; - - //set the sensor - d_sensor = markers[i].id; - - pos[0] = markers[i].x; - pos[1] = markers[i].y; - pos[2] = markers[i].z; - - //raw positions have no rotation - d_quat[0] = 0; - d_quat[1] = 0; - d_quat[2] = 0; - d_quat[3] = 1; - - // send time out in OWL time - if(frequency) frame_to_time(frame, frequency, timestamp); - else memset(×tamp, 0, sizeof(timestamp)); - - //send the report - send_report(); - } - for(int j = 0; j < rigids.size(); j++) - { - if(rigids[j].cond <= 0) continue; - - //set the sensor - d_sensor = r2s_map[rigids[j].id]; - if(slave && d_sensor == 0) { - // rigid bodies aren't allowed to be sensor zero in slave mode - r2s_map[rigids[j].id] = rigids[j].id; - } - - //set the position - pos[0] = rigids[j].pose[0]; - pos[1] = rigids[j].pose[1]; - pos[2] = rigids[j].pose[2]; - - //set the orientation quaternion - //OWL has the scale factor first, whereas VRPN has it last. - d_quat[0] = rigids[j].pose[4]; - d_quat[1] = rigids[j].pose[5];; - d_quat[2] = rigids[j].pose[6];; - d_quat[3] = rigids[j].pose[3];; - - // send time out in OWL time - if(frequency) frame_to_time(frame, frequency, timestamp); - else memset(×tamp, 0, sizeof(timestamp)); - - //send the report - send_report(); - } - - return markers.size() || rigids.size() > 0 ? 1 : 0; -} - -// -void vrpn_Tracker_PhaseSpace::send_report(void) -{ - if(d_connection) - { - char msgbuf[VRPN_PHASESPACE_MSGBUFSIZE]; - int len = encode_to(msgbuf); - if(d_connection->pack_message(len, timestamp, position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"PhaseSpace: cannot write message: tossing\n"); - } - } -} - -// -void vrpn_Tracker_PhaseSpace::setFrequency(float freq) -{ -#ifdef DEBUG - printf("%s %f\n", __PRETTY_FUNCTION__, freq); -#endif - if(freq < 0 || freq > OWL_MAX_FREQUENCY) { - fprintf(stderr,"Error: Invalid frequency requested, defaulting to %f hz\n", OWL_MAX_FREQUENCY); - freq = OWL_MAX_FREQUENCY; - } - - frequency = freq; - - if(owlRunning) { - float tmp = -1; - owlSetFloat(OWL_FREQUENCY, frequency); - owlGetFloatv(OWL_FREQUENCY, &tmp); - if(!owlGetStatus() || tmp == -1) - fprintf(stderr,"Error: unable to set frequency\n"); - } - return; -} - -// -int vrpn_Tracker_PhaseSpace::handle_update_rate_request(void *userdata, vrpn_HANDLERPARAM p) -{ -#ifdef DEBUG - printf("%s\n", __PRETTY_FUNCTION__); -#endif - vrpn_Tracker_PhaseSpace* thistracker = (vrpn_Tracker_PhaseSpace*)userdata; - vrpn_float64 update_rate = 0; - vrpn_unbuffer(&p.buffer,&update_rate); - thistracker->setFrequency((float) update_rate); - return 0; -} - -#endif diff --git a/src/vrpn/vrpn_Tracker_PhaseSpace.h b/src/vrpn/vrpn_Tracker_PhaseSpace.h deleted file mode 100644 index d0e4f04332c3040f07e85f880fabf60baa44a94e..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_PhaseSpace.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef VRPN_TRACKER_PHASESPACE_H -#define VRPN_TRACKER_PHASESPACE_H - -#include "vrpn_Configure.h" // IWYU pragma: keep - -#ifdef VRPN_INCLUDE_PHASESPACE -#include <map> -#include <vector> - -#include "vrpn_Shared.h" -#include "vrpn_Tracker.h" - -#include "owl.h" -#include "owl_planes.h" -#include "owl_peaks.h" -#include "owl_images.h" - -#define VRPN_PHASESPACE_MAXMARKERS 256 -#define VRPN_PHASESPACE_MAXRIGIDS 32 -#define VRPN_PHASESPACE_MAXCAMERAS 128 -#define VRPN_PHASESPACE_MAXDETECTORS 128 -#define VRPN_PHASESPACE_MAXPLANES 256 -#define VRPN_PHASESPACE_MAXPEAKS 512 -#define VRPN_PHASESPACE_MAXIMAGES 512 -#define VRPN_PHASESPACE_MSGBUFSIZE 1024 - -class VRPN_API vrpn_Tracker_PhaseSpace : public vrpn_Tracker { - -public: - - vrpn_Tracker_PhaseSpace(const char *name, - vrpn_Connection *c, - const char* device, - float frequency, - int readflag, - int slaveflag=0); - - - ~vrpn_Tracker_PhaseSpace(); - - virtual void mainloop(); - - bool addMarker(int sensor,int led_id); - bool addRigidMarker(int sensor, int led_id, float x, float y, float z); - bool startNewRigidBody(int sensor); - bool enableTracker(bool enable); - void setFrequency(float freq); - - static int VRPN_CALLBACK handle_update_rate_request(void *userdata, vrpn_HANDLERPARAM p); - -protected: - - int numRigids; - int numMarkers; - bool owlRunning; - float frequency; - bool readMostRecent; - bool slave; - int frame; - - typedef std::map<int, vrpn_int32> RigidToSensorMap; - RigidToSensorMap r2s_map; - std::vector<OWLMarker> markers; - std::vector<OWLRigid> rigids; - std::vector<OWLCamera> cameras; - std::vector<OWLPlane> planes; - std::vector<OWLPeak> peaks; - std::vector<OWLImage> images; - std::vector<OWLDetectors> detectors; - -protected: - int read_frame(void); - - virtual int get_report(void); - virtual void send_report(void); -}; -#endif - -#endif diff --git a/src/vrpn/vrpn_Tracker_RazerHydra.C b/src/vrpn/vrpn_Tracker_RazerHydra.C deleted file mode 100644 index fd14c26ee19ae1c6ded49e3a23fd84b5a02deabb..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_RazerHydra.C +++ /dev/null @@ -1,599 +0,0 @@ -/** - @file - @brief Implementation - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// Internal Includes -#include "vrpn_Tracker_RazerHydra.h" -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#ifdef VRPN_USE_HID -#include "vrpn_HumanInterface.h" // for vrpn_HidInterface, etc -#include "vrpn_SendTextMessageStreamProxy.h" // for operator<<, etc - -// Library/third-party includes -// - none - -// Standard includes -#include <sstream> // for operator<<, basic_ostream, etc -#include <string> // for char_traits, basic_string, etc -#include <stddef.h> // for size_t -#include <stdio.h> // for fprintf, NULL, stderr -#include <string.h> // for memset - - -const unsigned int HYDRA_VENDOR = 0x1532; -const unsigned int HYDRA_PRODUCT = 0x0300; -const unsigned int HYDRA_INTERFACE = 0x0; -const unsigned int HYDRA_CONTROL_INTERFACE = 0x1; - -/// Feature report 0 to set to enter motion controller mode -static const vrpn_uint8 HYDRA_FEATURE_REPORT[] = -{ - 0x00, // first byte must be report type - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x06, 0x00 -}; -static const int HYDRA_FEATURE_REPORT_LEN = 91; - -/// Feature report 0 to set to enter gamepad mode -static const vrpn_uint8 HYDRA_GAMEPAD_COMMAND[] = -{ - 0x00, // first byte must be report type - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00 -}; -static const int HYDRA_GAMEPAD_COMMAND_LEN = 91; - -/// 1 second is as long as we give it to send a first report if it's already -/// in motion-controller mode -static const unsigned long MAXIMUM_INITIAL_WAIT_USEC = 1000000L; - -/// 5 seconds is as long as we give it to switch into motion-controller mode -/// after we tell it to. -static const unsigned long MAXIMUM_WAIT_USEC = 5000000L; - -class vrpn_Tracker_RazerHydra::MyInterface : public vrpn_HidInterface -{ - public: - MyInterface(unsigned which_interface, vrpn_Tracker_RazerHydra *hydra) -#ifndef _WIN32 - // The InterfaceNumber is not supported on the mac and Linux versions -- it - // is always returned as -1. So we need to do this based on which - // device shows up first and hope that it is always the same order. - // On my mac, the control interface shows up first on iHid, so we - // try this order. If we get it wrong, then we swap things out later. - : vrpn_HidInterface(new vrpn_HidNthMatchAcceptor(which_interface, -#else - : vrpn_HidInterface(new vrpn_HidBooleanAndAcceptor( - new vrpn_HidInterfaceNumberAcceptor(which_interface), -#endif - new vrpn_HidProductAcceptor(HYDRA_VENDOR, HYDRA_PRODUCT))) - { - d_my_interface = which_interface; - d_hydra = hydra; - } - - void on_data_received(size_t bytes, vrpn_uint8 *buffer) - { - if (d_my_interface == HYDRA_CONTROL_INTERFACE) - { -#ifndef _WIN32 - d_hydra->send_text_message(vrpn_TEXT_WARNING) - << "Got report on controller channel. This means that we need to swap channels. " - << "Swapping channels."; - - MyInterface *t = d_hydra->_ctrl; - d_hydra->_ctrl = d_hydra->_data; - d_hydra->_data = t; - d_hydra->_ctrl->set_interface(HYDRA_CONTROL_INTERFACE); - d_hydra->_data->set_interface(HYDRA_INTERFACE); -#else - fprintf(stderr, "Unexpected receipt of %d bytes on Hydra control interface!\n", static_cast<int>(bytes)); - for (size_t i = 0; i < bytes; ++i) - { - fprintf(stderr, "%x ", buffer[i]); - } - fprintf(stderr, "\n"); -#endif - } - else - { - if (bytes != 52) - { - d_hydra->send_text_message(vrpn_TEXT_WARNING) - << "Got input report of " << bytes << " bytes, expected 52! Discarding, and re-connecting to Hydra." -#ifdef _WIN32 - << " Please make sure that you have completely quit the Hydra Configurator software and the Hydra system tray icon," - << " since this usually indicates that the Razer software has changed the Hydra's mode behind our back." -#endif - ; - d_hydra->reconnect(); - return; - } - - if (d_hydra->status < HYDRA_REPORTING) - { - - d_hydra->send_text_message(vrpn_TEXT_WARNING) - << "Got first motion controller report! This means everything is working properly now. " - << "(Took " << d_hydra->_attempt << " attempt" << (d_hydra->_attempt > 1 ? "s" : "") << " to change modes.)"; - d_hydra->status = HYDRA_REPORTING; - } - - vrpn_gettimeofday(&d_hydra->_timestamp, NULL); - double dt = vrpn_TimevalDurationSeconds(d_hydra->_timestamp, d_hydra->vrpn_Button::timestamp); - d_hydra->vrpn_Button::timestamp = d_hydra->_timestamp; - d_hydra->vrpn_Tracker::timestamp = d_hydra->_timestamp; - - d_hydra->_report_for_sensor(0, buffer + 8, dt); - d_hydra->_report_for_sensor(1, buffer + 30, dt); - - d_hydra->vrpn_Analog::report_changes(vrpn_CONNECTION_LOW_LATENCY, d_hydra->_timestamp); - d_hydra->vrpn_Button::report_changes(); - } - } - - - std::string getSerialNumber() - { - if (connected()) - { - char buf[256]; - memset(buf, 0, sizeof(buf)); - int bytes = get_feature_report(sizeof(buf) - 1, reinterpret_cast<vrpn_uint8*>(buf)); - if (bytes > 0) - { - return std::string(buf + 216, 17); - } - else - { - return "[FAILED TO GET FEATURE REPORT]"; - } - } - else - { - return "[HYDRA CONTROL INTERFACE NOT CONNECTED]"; - } - } - - void setMotionControllerMode() - { - /// Prompt to start streaming motion data - send_feature_report(HYDRA_FEATURE_REPORT_LEN, HYDRA_FEATURE_REPORT); - - vrpn_uint8 buf[91] = {0}; - buf[0] = 0; - get_feature_report(91, buf); - } - - void setGamepadMode() - { - /// Prompt to stop streaming motion data - send_feature_report(HYDRA_GAMEPAD_COMMAND_LEN, HYDRA_GAMEPAD_COMMAND); - } - - bool connected() - { - return vrpn_HidInterface::connected(); - } - - void update() - { - vrpn_HidInterface::update(); - } - - void set_interface(unsigned which_interface) - { - d_my_interface = which_interface; - } - - protected: - unsigned d_my_interface; - vrpn_Tracker_RazerHydra *d_hydra; -}; - -vrpn_Tracker_RazerHydra::vrpn_Tracker_RazerHydra(const char *name, vrpn_Connection *con) - : vrpn_Analog(name, con) - , vrpn_Button_Filter(name, con) - , vrpn_Tracker(name, con) - , status(HYDRA_WAITING_FOR_CONNECT) - , _wasInGamepadMode(false) /// assume not - if we have to send a command, then set to true - , _attempt(0) - , _docking_distance(0.1f) -{ - // Set up the control and data channels - _ctrl = new MyInterface(HYDRA_CONTROL_INTERFACE, this); - _data = new MyInterface(HYDRA_INTERFACE, this); - - /// Set up sensor counts - vrpn_Analog::num_channel = ANALOG_CHANNELS; /// 3 analog channels from each controller - vrpn_Button::num_buttons = BUTTON_CHANNELS; /// 7 for each controller, starting at a nice number for each - vrpn_Tracker::num_sensors = POSE_CHANNELS; - - /// Initialize all data - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); - - vrpn_gettimeofday(&_timestamp, NULL); - - for (int i = 0; i < vrpn_Tracker::num_sensors; ++i) - { - _calibration_done[i] = false; - _mirror[i] = 1; - _sign_x[i] = 1; - - memset(_old_position[i], 0, sizeof(q_vec_type)); - memset(_calibration_pose_conj[i], 0, sizeof(q_type)); - _calibration_pose_conj[i][Q_W] = 1.0; - } -} - -vrpn_Tracker_RazerHydra::~vrpn_Tracker_RazerHydra() -{ - if (status == HYDRA_REPORTING && _wasInGamepadMode) - { - send_text_message(vrpn_TEXT_WARNING) - << "Hydra was in gamepad mode when we started: switching back to gamepad mode."; - _ctrl->setGamepadMode(); - - send_text_message() << "Waiting 2 seconds for mode change to complete."; - vrpn_SleepMsecs(2000); - } - - delete _ctrl; -} - -void vrpn_Tracker_RazerHydra::mainloop() -{ - // server update. We only need to call this once for all three - // base devices because it is in the unique base class. - server_mainloop(); - - if (_data->connected()) - { - // HID device update - _data->update(); - _ctrl->update(); - - // Check/update listening state during connection/handshaking - switch(status) - { - case HYDRA_WAITING_FOR_CONNECT: - _waiting_for_connect(); - break; - - case HYDRA_LISTENING_AFTER_CONNECT: - _listening_after_connect(); - break; - - case HYDRA_LISTENING_AFTER_SET_FEATURE: - _listening_after_set_feature(); - break; - - case HYDRA_REPORTING: - default: - break; - } - } -} - -bool vrpn_Tracker_RazerHydra::reconnect() -{ - status = HYDRA_WAITING_FOR_CONNECT; - - // Reset calibration if we have to reconnect. - for (int i = 0; i < vrpn_Tracker::num_sensors; ++i) - { - _calibration_done[i] = false; - _mirror[i] = 1; - } - - _data->reconnect(); - return _ctrl->reconnect(); -} - -void vrpn_Tracker_RazerHydra::_waiting_for_connect() -{ - if (status != HYDRA_WAITING_FOR_CONNECT) - { - fprintf(stderr, "vrpn_Tracker_RazerHydra::_waiting_for_connect(): bad status\n"); - return; - } - if (_data->connected() && _ctrl->connected()) - { - send_text_message(vrpn_TEXT_WARNING) << "Connected to Razer Hydra with serial number " << _ctrl->getSerialNumber(); - - status = HYDRA_LISTENING_AFTER_CONNECT; - vrpn_gettimeofday(&_connected, NULL); - send_text_message() << "Listening to see if device is in motion controller mode."; - - /// Reset the mode-change-attempt counter - _attempt = 0; - /// We'll assume not in gamepad mode unless we have to tell it to switch - _wasInGamepadMode = false; - } -} - -void vrpn_Tracker_RazerHydra::_listening_after_connect() -{ - if (status != HYDRA_LISTENING_AFTER_CONNECT) - { - fprintf(stderr, "vrpn_Tracker_RazerHydra::_listening_after_connect(): bad status\n"); - return; - } - if (!_data->connected() || !_ctrl->connected()) - { - fprintf(stderr, "vrpn_Tracker_RazerHydra::_listening_after_connect(): Data or control channel not connected\n"); - return; - } - struct timeval now; - vrpn_gettimeofday(&now, NULL); - if (vrpn_TimevalDuration(now, _connected) > MAXIMUM_INITIAL_WAIT_USEC) - { - _enter_motion_controller_mode(); - } -} - -void vrpn_Tracker_RazerHydra::_listening_after_set_feature() -{ - if (status != HYDRA_LISTENING_AFTER_SET_FEATURE) - { - fprintf(stderr, "vrpn_Tracker_RazerHydra::_listening_after_set_feature(): bad status\n"); - return; - } - if (!_data->connected() || !_ctrl->connected()) - { - fprintf(stderr, "vrpn_Tracker_RazerHydra::_listening_after_set_feature(): Data or control channel not connected\n"); - return; - } - struct timeval now; - vrpn_gettimeofday(&now, NULL); - if (vrpn_TimevalDuration(now, _set_feature) > MAXIMUM_WAIT_USEC) - { - send_text_message(vrpn_TEXT_WARNING) - << "Really sleepy device - won't start motion controller reports despite our earlier " - << _attempt << " attempt" << (_attempt > 1 ? ". " : "s. ") - << " Will give it another try. " - << "If this doesn't work, unplug and replug device and restart the VRPN server."; -#ifndef _WIN32 - if ((_attempt % 2) == 0) - { - send_text_message(vrpn_TEXT_WARNING) - << "Switching control and data interface (mac can't tell the difference)."; - MyInterface *t = _ctrl; - _ctrl = _data; - _data = t; - _ctrl->set_interface(HYDRA_CONTROL_INTERFACE); - _data->set_interface(HYDRA_INTERFACE); - } -#endif - _enter_motion_controller_mode(); - } -} - -void vrpn_Tracker_RazerHydra::_enter_motion_controller_mode() -{ - if ( (status != HYDRA_LISTENING_AFTER_CONNECT) && - (status != HYDRA_LISTENING_AFTER_SET_FEATURE) ) - { - fprintf(stderr, "vrpn_Tracker_RazerHydra::_enter_motion_controller_mode(): bad status\n"); - return; - } - if (!_data->connected()) - { - fprintf(stderr, "vrpn_Tracker_RazerHydra::_enter_motion_controller_mode(): Control channel not connected\n"); - return; - } - - _attempt++; - _wasInGamepadMode = true; - - /** @todo get a feature report as a way of determining current mode - - buf[0] = 0; - int bytes = get_feature_report(91, buf); - printf("feature report 0:\n"); - dumpReport(buf, bytes); - */ - - send_text_message(vrpn_TEXT_WARNING) - << "Hydra not in motion-controller mode - attempting to change modes. " - << "Please be sure that the left and right sensors are to the left and " - << "right sides of the base for automatic calibration to take place."; - - /// Prompt to start streaming motion data - _ctrl->setMotionControllerMode(); - - status = HYDRA_LISTENING_AFTER_SET_FEATURE; - vrpn_gettimeofday(&_set_feature, NULL); -} - -void vrpn_Tracker_RazerHydra::_report_for_sensor(int sensorNum, vrpn_uint8 * data, double dt) -{ - if (!d_connection) - { - return; - } - static const double MM_PER_METER = 0.001; - static const double SCALE_INT16_TO_FLOAT_PLUSMINUS_1 = 1.0 / 32768.0; - static const double SCALE_UINT8_TO_FLOAT_0_TO_1 = 1.0 / 255.0; - const int channelOffset = sensorNum * 3; - // There are only 7 buttons per hydra, but the original driver code here - // skipped 8 per hand-held unit. We're leaving this the same to avoid - // clients having to remap their controls. - const int buttonOffset = sensorNum * 8; - - d_sensor = sensorNum; - - /***************** - * Decode pose - *****************/ - pos[0] = vrpn_unbuffer_from_little_endian<vrpn_int16>(data) * MM_PER_METER; - pos[1] = vrpn_unbuffer_from_little_endian<vrpn_int16>(data) * MM_PER_METER; - pos[2] = vrpn_unbuffer_from_little_endian<vrpn_int16>(data) * MM_PER_METER; - - // Switch handedness when we read the Quaternion values. - // We do this by inverting the Y and Z axes; it is equivalent - // to invert the X and W axes. - d_quat[Q_W] = vrpn_unbuffer_from_little_endian<vrpn_int16>(data) * SCALE_INT16_TO_FLOAT_PLUSMINUS_1; - d_quat[Q_X] = vrpn_unbuffer_from_little_endian<vrpn_int16>(data) * SCALE_INT16_TO_FLOAT_PLUSMINUS_1; - d_quat[Q_Y] = -vrpn_unbuffer_from_little_endian<vrpn_int16>(data) * SCALE_INT16_TO_FLOAT_PLUSMINUS_1; - d_quat[Q_Z] = -vrpn_unbuffer_from_little_endian<vrpn_int16>(data) * SCALE_INT16_TO_FLOAT_PLUSMINUS_1; - - q_normalize(d_quat, d_quat); - - // autocalibrate if docked - _docked[sensorNum] = q_vec_magnitude(pos) < _docking_distance; - if(_docked[sensorNum]) - { - _calibration_done[sensorNum] = true; - - // store the base quaternion to fix up any bizarre rotations - ensures that we start x-right, y-front, z-up - // We invert the quaternion to undo its transformation. - q_invert(_calibration_pose_conj[sensorNum], d_quat); - - // initialize hemisphere tracking - // coordinate sanity check - sensor 0 (left): -x, -y, -z - // sensor 1 (right) +x, -y, -z - if(pos[1] > 0 || pos[2] > 0) - _mirror[sensorNum] = -1; // wrong hemisphere, switch - else - _mirror[sensorNum] = 1; - - q_vec_type tmp; - q_vec_copy(tmp, pos); - q_vec_scale(tmp, _mirror[sensorNum], tmp); - - // Hydra sometimes starts up with the x axis inverted (left-handed), so - // we catch the case here and correct for it - if(sensorNum == 0) - _sign_x[0] = (tmp[0] < 0) ? 1 : -1; - else - _sign_x[1] = (tmp[0] > 0) ? 1 : -1; - - tmp[0] *= _sign_x[sensorNum]; - - q_vec_copy(_old_position[sensorNum], tmp); - } - - if (_calibration_done[sensorNum]) - { - // apply orientation calibration, undoing the original - // rotation and then doing the current rotation using the - // calibration data. - q_mult(d_quat, d_quat, _calibration_pose_conj[sensorNum]); - - // apply sign correction (left/right-handed) - pos[0] *= _sign_x[sensorNum]; - - // apply current hemisphere fix - q_vec_scale(pos, _mirror[sensorNum], pos); - - if(!_docked[sensorNum]) - { - // check for hemisphere transition - q_vec_type v_direct, v_mirror, pos_inv; - q_vec_subtract(v_direct, pos, _old_position[sensorNum]); - - q_vec_invert(pos_inv, pos); - q_vec_subtract(v_mirror, pos_inv, _old_position[sensorNum]); - - double dist_direct = q_vec_magnitude(v_direct); - double dist_mirror = q_vec_magnitude(v_mirror); - - // too big jump, likely hemisphere switch - // in that case the coordinates given are mirrored symmetrically across the base - if (dist_direct > dist_mirror) - { - /* - fprintf(stdout, "%d Switched hemisphere! %3.2f %3.2f\n", sensorNum, dist_direct, dist_mirror); - fprintf(stdout, "\tOld: %3.2f, %3.2f, %3.2f Current: %3.2f, %3.2f, %3.2f\n", - _old_position[sensorNum][0], _old_position[sensorNum][1], _old_position[sensorNum][2], - pos[0], pos[1], pos[2]); - */ - - q_vec_copy(pos, pos_inv); - _mirror[sensorNum] *= -1; - } - } - } - - // store the data - q_vec_copy(_old_position[sensorNum], pos); - - /***************** - * Decode buttons - *****************/ - - vrpn_uint8 buttonBits = vrpn_unbuffer_from_little_endian<vrpn_uint8>(data); - - /// "middle" button - buttons[0 + buttonOffset] = (buttonBits & 0x20) != 0; - - /// Numbered buttons - buttons[1 + buttonOffset] = (buttonBits & 0x04) != 0; - buttons[2 + buttonOffset] = (buttonBits & 0x08) != 0; - buttons[3 + buttonOffset] = (buttonBits & 0x02) != 0; - buttons[4 + buttonOffset] = (buttonBits & 0x10) != 0; - - /// "Bumper" button - buttons[5 + buttonOffset] = (buttonBits & 0x01) != 0; - - /// Joystick button - buttons[6 + buttonOffset] = (buttonBits & 0x40) != 0; - - - /********************* - * Decode analog axes - *********************/ - - /// Joystick X, Y - channel[0 + channelOffset] = vrpn_unbuffer_from_little_endian<vrpn_int16>(data) * SCALE_INT16_TO_FLOAT_PLUSMINUS_1; - channel[1 + channelOffset] = vrpn_unbuffer_from_little_endian<vrpn_int16>(data) * SCALE_INT16_TO_FLOAT_PLUSMINUS_1; - - /// Trigger analog - channel[2 + channelOffset] = vrpn_unbuffer_from_little_endian<vrpn_uint8>(data) * SCALE_UINT8_TO_FLOAT_0_TO_1; - - /************************ - * Send report for sensor - ************************/ - - char msgbuf[512]; - int len = vrpn_Tracker::encode_to(msgbuf); - if (d_connection->pack_message(len, _timestamp, position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) - { - fprintf(stderr, "vrpn_Tracker_RazerHydra: cannot write message: tossing\n"); - } -} - -#endif // VRPN_USE_HID diff --git a/src/vrpn/vrpn_Tracker_RazerHydra.h b/src/vrpn/vrpn_Tracker_RazerHydra.h deleted file mode 100644 index aaf907473b195c081588129d3ee6285858957dc4..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_RazerHydra.h +++ /dev/null @@ -1,151 +0,0 @@ -/** @file - @brief Header - - @date 2011 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program -*/ - -// Copyright Iowa State University 2011. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#pragma once - -// Internal Includes -#include "quat.h" // for q_vec_type -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Tracker.h" // for vrpn_Tracker - -// Library/third-party includes -// - none - -// Standard includes -// - none - -#ifdef VRPN_USE_HID - -/** @brief Device supporting the Razer Hydra game controller as a tracker, - analog device, and button device, using the USB HID protocol directly - - The left wand (the one with LB and LT on its "end" buttons - look from above) - is sensor 0, and the right wand (with RB and RT on it) is sensor 1. - The "front" of the base is the side opposite the cables: there's a small - logo on it. You can have the base in any orientation you want, but the info - that follows assumes you have the base sitting on a desk, with the front toward you. - If you have the base in a different coordinate frame in the world, please make - the appropriate mental transformations yourself. :) - - When starting the VRPN server, make sure that the left wand is somewhere to - the left of the base, and the right wand somewhere right of the base - - they do not need to be placed on the base or any more complicated homing/calibration - procedure. This is for the hemisphere tracking: it needs to have an "initial state" - that is roughly known, so it uses the sign of the X coordinate position. - - (If you can't do this for whatever reason, modification of the driver code for an - alternate calibration procedure is possible.) - - If using the Hydra on Windows, the server will work with or without the official - Razer Hydra drivers installed. If you are only using the device with VRPN, don't - install the official drivers. However, if you do have them installed, make sure that - the "Hydra Configurator" and the Hydra system tray icon are closed to avoid unexpected - failure (their software can switch the device out of the mode that VRPN uses). - - Works great on Linux (regardless of endianness) - no drivers needed, thanks to USB HID. - - The base coordinate system is right-handed with the axes: - * X - out the right of the base - * Y - out the front of the base - * Z - down - - The wand coordinates are also right-handed, with the tracked point somewhere near - the cable entry to the controller. When held with the joystick vertical, the axes - are: - * X - to the right - * Y - out the front of the controller (trigger buttons) - * Z - Up, along the joystick - - Buttons are as follows, with the right controller's button channels starting - at 7 instead of 0: - * 0 - "middle" button below joystick - * 1-4 - numbered buttons - * 5 - "bumper" button (above trigger) - * 6 - joystick button (if you push straight down on the joystick) - - Analog channels are as follows, with the right controller starting at 3 - instead of 0: - * 0 - joystick left/right: centered at 0, right is positive, in [-1, 1] - * 1 - joystick up/down: centered at 0, up is positive, in [-1, 1] - * 2 - analog trigger, in range 0 (not pressed) to 1 (fully pressed). -*/ - -class VRPN_API vrpn_Tracker_RazerHydra: public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Tracker -{ - public: - vrpn_Tracker_RazerHydra(const char * name, vrpn_Connection * trackercon); - ~vrpn_Tracker_RazerHydra(); - - virtual void mainloop(); - - virtual bool reconnect(); - - private: - enum HydraStatus - { - HYDRA_WAITING_FOR_CONNECT, - HYDRA_LISTENING_AFTER_CONNECT, - HYDRA_LISTENING_AFTER_SET_FEATURE, - HYDRA_REPORTING - }; - - enum - { - ANALOG_CHANNELS = 6, - BUTTON_CHANNELS = 14, - POSE_CHANNELS = 2 - }; - - void _waiting_for_connect(); - void _listening_after_connect(); - void _listening_after_set_feature(); - - void _enter_motion_controller_mode(); - - void _report_for_sensor(int sensorNum, vrpn_uint8 * data, double dt); - - HydraStatus status; - bool _wasInGamepadMode; - int _attempt; - struct timeval _timestamp; - struct timeval _connected; - struct timeval _set_feature; - - const float _docking_distance; - bool _docked[POSE_CHANNELS]; - bool _calibration_done[POSE_CHANNELS]; - int _mirror[POSE_CHANNELS]; - int _sign_x[POSE_CHANNELS]; - q_vec_type _old_position[POSE_CHANNELS]; - - q_type _calibration_pose_conj[POSE_CHANNELS]; - - // This device has both a control and a data interface. - // On the mac, we may need to swap these because we can't tell which - // is which when we open them. - class MyInterface; - - MyInterface * _ctrl; - MyInterface * _data; -}; - -#else -class VRPN_API vrpn_Tracker_RazerHydra; -#endif - diff --git a/src/vrpn/vrpn_Tracker_SpacePoint.C b/src/vrpn/vrpn_Tracker_SpacePoint.C deleted file mode 100644 index 5f2282cef745ffbb9f3f0b3661e304ca3fe05b40..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_SpacePoint.C +++ /dev/null @@ -1,97 +0,0 @@ -/* - * vrpn_Tracker_SpacePoint.cpp - * - * Created on: Nov 22, 2010 - * Author: janoc - */ - -#include <stdio.h> // for fprintf, stderr -#include <string.h> // for memset - -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Tracker_SpacePoint.h" - -const unsigned SPACEPOINT_VENDOR = 0x20ff; -const unsigned SPACEPOINT_PRODUCT = 0x0100; - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#ifdef VRPN_USE_HID -vrpn_Tracker_SpacePoint::vrpn_Tracker_SpacePoint(const char * name, vrpn_Connection * trackercon) : - vrpn_Tracker(name, trackercon), vrpn_Button(name, trackercon), - vrpn_HidInterface(new vrpn_HidProductAcceptor(SPACEPOINT_VENDOR, SPACEPOINT_PRODUCT)) -{ - memset(d_quat, 0, 4 * sizeof(float)); - d_quat[3] = 1.0; - - vrpn_Button::num_buttons = 2; - vrpn_gettimeofday(&_timestamp, NULL); -} - -void vrpn_Tracker_SpacePoint::on_data_received(size_t bytes, vrpn_uint8 *buffer) -{ - /* - * Horrible kludge - as we do not have a way to select the correct endpoint, we have to use a hack - * to identify the correct device. In Windows the SpacePoint appears as 2 devices with same VID/PID, one for each endpoint - * The correct device sends a report 15 bytes long. If we get a report of a different length, we try to open - * the other device instead. - */ - - // test from the app note - // the quaternion should be: 0.2474, -0.1697, -0.1713, 0.9384 - /* - bytes = 15; - vrpn_uint8 test_dta[] = - { 0x2f, 0x85, 0x23, 0x8a, 0x5b, 0x90, 0xac, 0x9f, 0x49, 0x6a, 0x12, 0x6a, 0x1e, 0xf8, 0xd0 }; - memcpy(buffer, test_dta, 15 * sizeof(vrpn_uint8)); - */ - - if (bytes == 15) { - vrpn_uint8 * bufptr = buffer + 6; - - for (int i = 0; i < 4; i++) { - d_quat[i] = (vrpn_unbuffer_from_little_endian<vrpn_uint16>(bufptr) - 32768) / 32768.0; - } - - buttons[0] = buffer[14] & 0x1; - buttons[1] = buffer[14] & 0x2; - - // Find out what time we received the new information, then send any - // changes to the client. - vrpn_gettimeofday(&_timestamp, NULL); - vrpn_Tracker::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - // send tracker orientation - d_sensor = 0; - memset(pos, 0, sizeof(vrpn_float64) * 3); // no position - - char msgbuf[1000]; - int len = vrpn_Tracker::encode_to(msgbuf); - if (d_connection->pack_message(len, _timestamp, position_m_id, d_sender_id, msgbuf, vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "SpacePoint tracker: can't write message: tossing\n"); - } - - // send buttons - vrpn_Button::report_changes(); - - } else { - // try the other iface - // as we are keeping the first one open, - // it will not enumerate and we get the next one. Horrible kludge :( - reconnect(); - } -} - -void vrpn_Tracker_SpacePoint::mainloop() -{ - if (connected()) { - // device update. This will call on_data_received() if we get something. - update(); - - // server update - server_mainloop(); - } -} - -#endif diff --git a/src/vrpn/vrpn_Tracker_SpacePoint.h b/src/vrpn/vrpn_Tracker_SpacePoint.h deleted file mode 100644 index 9abb1128c348ec94d10e66f4084f3217b2d88aec..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_SpacePoint.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * vrpn_Tracker_SpacePoint.h - * - * Created on: Nov 22, 2010 - * Author: janoc - */ - -#ifndef VRPN_TRACKER_SPACEPOINT_H_ -#define VRPN_TRACKER_SPACEPOINT_H_ - -#include <stddef.h> // for size_t - -#include "vrpn_Button.h" // for vrpn_Button -#include "vrpn_Configure.h" // for VRPN_API, VRPN_USE_HID -#include "vrpn_HumanInterface.h" // for vrpn_HidInterface -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker -#include "vrpn_Types.h" // for vrpn_uint8 - -class VRPN_API vrpn_Connection; - -#ifdef VRPN_USE_HID - -class VRPN_API vrpn_Tracker_SpacePoint: public vrpn_Tracker, vrpn_Button, vrpn_HidInterface -{ - public: - vrpn_Tracker_SpacePoint(const char * name, vrpn_Connection * trackercon); - - virtual void mainloop (); - - virtual void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - protected: - bool _should_report; - struct timeval _timestamp; -}; - -#endif - -#endif /* VRPN_TRACKER_SPACEPOINT_H_ */ diff --git a/src/vrpn/vrpn_Tracker_TrivisioColibri.C b/src/vrpn/vrpn_Tracker_TrivisioColibri.C deleted file mode 100644 index 2d1828608936f301d34225891a3fda4ace6fc3da..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_TrivisioColibri.C +++ /dev/null @@ -1,199 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// Name: vrpn_Tracker_TrivisioColibri.C -// -// Author: David Borland -// Institut d'Investigacions Biomèdiques August Pi i Sunyer (IDIBAPS) -// Virtual Embodiment and Robotic Re-Embodiment (VERE) Project – 257695 -// -// Description: VRPN tracker class for Trivisio Colibri device. -// -/////////////////////////////////////////////////////////////////////////////////////////////// - -#include "vrpn_Tracker_TrivisioColibri.h" - -#ifdef VRPN_USE_TRIVISIOCOLIBRI - -// XXX: Some horrible hackery here... -// -// The TravisioTypes.h header file has an #if WIN32 test. This is problematic, because -// WIN32 is not guaranteed to be defined to a value of 1 on Windows. Thus, this test can fail -// inadvertently. For example, #define WIN32 or #define WIN32 WIN32 will both produce -// unwanted results, but for different reasons. #define WIN32 will cause the #if WIN32 -// test to fail because WIN32 has not been assigned a value. #define WIN32 WIN32 will cause -// #if WIN32 to produce a compiler error because WIN32 does not have an integer value. -// -// The correct thing to do would be to fix TrivisioTypes.h to use #ifdef _WIN32, as _WIN32 is -// always defined on Windows. However, so that users don't have to manually edit the -// Trivisio SDK source files, we redefine WIN32 to have a value of 1, include the Trivisio -// headers, and then redefine WIN32 with no value, which is what windows.h does... -// -#ifdef _WIN32 -# ifdef WIN32 -# undef WIN32 -# endif -# define WIN32 1 -# include VRPN_TRIVISIOCOLIBRI_H -# undef WIN32 -# define WIN32 -#else -# include VRPN_TRIVISIOCOLIBRI_H -#endif - -vrpn_Tracker_TrivisioColibri::vrpn_Tracker_TrivisioColibri(const char* name, vrpn_Connection* c, - int numSensors, int Hz, int bufLen) : - vrpn_Tracker(name, c) -{ - // Query the number of connected devices - struct TrivisioSensor* sensorList = new TrivisioSensor[numSensors]; - int sensorCount = colibriGetDeviceList(sensorList, numSensors); - - // If sensorCount == -1, there are more sensors connected than we specified, which is fine. - // Else, sensorCount == the number of sensors connected, which is all we can use. - if (sensorCount < 0) { - num_sensors = numSensors; - } - else { - num_sensors = sensorCount; - } - - - // Print info - if (num_sensors < 1) { - printf("Warning: No Colibri sensors found\n"); - status = vrpn_TRACKER_FAIL; - return; - } - - printf("Using %d Colibri sensors\n", num_sensors); - for (int i = 0; i < num_sensors; i++) { - printf("%s:\t %s (FW %d.%d)\n", sensorList[i].dev, sensorList[i].ID, - sensorList[i].FWver, sensorList[i].FWsubver); - } - printf("\n\n"); - - - // From the sample code: - // - // Diagonal matrices with diagonal element .68 yields approx 20Hz - // bandwidth @ 100Hz - // - float Ka[9] = { 0.68f, 0.00f, 0.00f, - 0.00f, 0.68f, 0.00f, - 0.00f, 0.00f, 0.68f }; - float Kg[9] = { 0.68f, 0.00f, 0.00f, - 0.00f, 0.68f, 0.00f, - 0.00f, 0.00f, 0.68f }; - - - // Create the array of device handles - imu = new void*[num_sensors]; - - // Create device handles and configure them - for (int i = 0; i < num_sensors; i++) { - imu[i] = colibriCreate(bufLen); - - if (colibriOpen(imu[i], 0, sensorList[i].dev) < 0) { - printf("Warning: Could not access Colibri device on %s\n", sensorList[i]); - continue; - } - - struct ColibriConfig conf; - - // Taken from sample code - colibriGetConfig(imu[i], &conf); - conf.raw = 0; - conf.freq = Hz; - conf.sensor = (ColibriConfig::Sensor)1023; - conf.ascii = 0; - colibriSetConfig(imu[i], &conf); - - colibriSetKa(imu[i], Ka); - colibriSetKaStatus(imu[i], 1); - colibriSetKg(imu[i], Kg); - colibriSetKgStatus(imu[i], 1); - colibriSetJitterStatus(imu[i], 1); - - // Print info - char id[8]; - - printf("Colibri IMU %d\n", i); - colibriGetID(imu, id); - printf("\tDevice ID: %s\n", id); - printf("\tSensor config: %d\n", conf.sensor); - printf("\tMagnetic div: %d\n", (unsigned)conf.magDiv); - printf("\tFrequency: %d\n", conf.freq); - printf("\tASCII output: %d\n", conf.ascii); - printf("\tAutoStart: %d\n", conf.autoStart); - printf("\tRAW mode: %d\n", conf.raw); - printf("\tJitter reduction: %d\n", colibriGetJitterStatus(imu[i])); - printf("\n\n"); - } - - - // Start the devices - for (int i = 0; i < num_sensors; i++) { - colibriStart(imu[i]); - } - - - // VRPN stuff - register_server_handlers(); -} - -vrpn_Tracker_TrivisioColibri::~vrpn_Tracker_TrivisioColibri() -{ - for (int i = 0; i < num_sensors; i++) { - colibriStop(imu[i]); - colibriClose(imu[i]); - } - - delete [] imu; -} - -void vrpn_Tracker_TrivisioColibri::mainloop() -{ - // Call the generic server mainloop, since we are a server - server_mainloop(); - - // Get latest data - get_report(); -} - -void vrpn_Tracker_TrivisioColibri::get_report() -{ - vrpn_gettimeofday(×tamp, NULL); - - for (int i = 0; i < num_sensors; i++) { - TrivisioIMUData data; - colibriGetData(imu[i], &data); - - // The sensor number - d_sensor = i; - - // No need to fill in position, as we don´t get position information - - // The orientation - d_quat[0] = data.q_x; - d_quat[1] = data.q_y; - d_quat[2] = data.q_z; - d_quat[3] = data.q_w; - - // Send the data - send_report(); - } -} - -void vrpn_Tracker_TrivisioColibri::send_report() -{ - if (d_connection) { - char msgbuf[1000]; - int len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "Tracker: cannot write message: tossing\n"); - } - } -} - -#endif \ No newline at end of file diff --git a/src/vrpn/vrpn_Tracker_TrivisioColibri.h b/src/vrpn/vrpn_Tracker_TrivisioColibri.h deleted file mode 100644 index 8119c019a9d2fdba466952a43d213e3836b4e17d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_TrivisioColibri.h +++ /dev/null @@ -1,62 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// Name: vrpn_Tracker_TrivisioColibri.h -// -// Author: David Borland -// Institut d'Investigacions Biomèdiques August Pi i Sunyer (IDIBAPS) -// Virtual Embodiment and Robotic Re-Embodiment (VERE) Project – 257695 -// -// Description: VRPN tracker class for Trivisio Colibri device -// -/////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef VRPN_TRACKER_TRIVISIOCOLIBRI -#define VRPN_TRACKER_TRIVISIOCOLIBRI - -#include "vrpn_Configure.h" // IWYU pragma: keep - -#ifdef VRPN_USE_TRIVISIOCOLIBRI - -#include "vrpn_Tracker.h" - -class vrpn_Tracker_TrivisioColibri : public vrpn_Tracker { -public: - // Constructor - // - // name: VRPN tracker name - // - // c: VRPN connection to use - // - // numSensors: The number of devices to connect to - // - // Hz: Update rate in Hertz - // - // bufLen: The buffer length for reading data. - // - // From the reference manual: - // - // An short buffer (0) ensures minimal delay until the sensor measurement is available at the risk - // of lost measurements. A long buffer guarantees that no data is dropped, at - // the same time if data is not read fast enough there is a potential risk of a - // bufLenfrequency before the measurement becomes available. - // - vrpn_Tracker_TrivisioColibri(const char* name, vrpn_Connection* c, - int numSensors = 1, int Hz = 60, int bufLen = 0); - ~vrpn_Tracker_TrivisioColibri(); - - /// This function should be called each time through the main loop - /// of the server code. It checks for a report from the tracker and - /// sends it if there is one. - virtual void mainloop(); - -protected: - virtual void get_report(); - virtual void send_report(); - - // Array of pointers to devices handles - void** imu; -}; - - -#endif -#endif diff --git a/src/vrpn/vrpn_Tracker_ViewPoint.C b/src/vrpn/vrpn_Tracker_ViewPoint.C deleted file mode 100644 index 5887b2d4bee4c8c162fe0d5e00f8df0253c01766..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_ViewPoint.C +++ /dev/null @@ -1,225 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// Name: vrpn_Tracker_ViewPoint.C -// -// Author: David Borland -// -// EventLab at the University of Barcelona -// -// Description: VRPN server class for Arrington Research ViewPoint EyeTracker. -// -// The VRPN server connects to the eye tracker using the VPX_InterApp DLL. -// Whatever other control software is being used to connect to the eye tracker -// (e.g. the ViewPoint software that comes with the tracker) to perform -// calibration, etc. should link to the same copy of the DLL, so they can share -// information. -// -// ------------------------------------------------------------------------------- -// -// Tracker: -// -// The tracker has two sensors, as the ViewPoint can optionally have binocular -// tracking. In the case of monocular tracking, only sensor 0 (EYE_A) will have -// valid information. Retrieving smoothed or raw tracking data is controlled by -// the smoothedData parameter. -// -// Position: The (x,y) gaze point in gaze space (smoothed or raw). -// -// Rotation: The (x,y) gaze angle as a quaternion (smoothed or raw). -// -// Velocity: The x- and y- components of the eye movement velocity in gaze space -// (always smoothed). -// -// ------------------------------------------------------------------------------- -// -// Analog: -// -// There are a lot of additional data that can be retrieved from the tracker. -// These values are always calculated from the smoothed gaze point. Currently, -// the following are sent as analog values, but more can be added as needed. -// Please see the ViewPoint documentation regarding what other data are available. -// -// Because each channel needs to be duplicated in the case of a binocular tracker, -// the first n/2 values are for EYE_A, and the second n/2 values are for EYE_B. -// -// EYE_A: -// -// Channel 0: The pupil aspect ratio, from 0.0 to 1.0. Can be used to detect -// blinks when it falls below a given threshold. -// -// Channel 1: The total velocity (magnitude of eye movement velocity). Can be -// used to detect saccades. -// -// Channel 2: The fixation seconds (length of time below the velocity criterion -// used to detect saccades). 0 if saccade is occurring. -// -// EYE_B: -// -// Channels 3-5: See EYE_A. -// -/////////////////////////////////////////////////////////////////////////////////////////////// - -#include "vrpn_Tracker_ViewPoint.h" - -#ifdef VRPN_USE_VIEWPOINT - -#include VRPN_VIEWPOINT_H -#include "quat.h" - -vrpn_Tracker_ViewPoint::vrpn_Tracker_ViewPoint(const char* name, vrpn_Connection* c, bool smoothedData) : - vrpn_Tracker(name, c), vrpn_Analog(name, c), useSmoothedData(smoothedData) -{ - // Check the DLL version - double version = VPX_GetDLLVersion(); - if (VPX_VersionMismatch(VPX_SDK_VERSION)) { - fprintf(stderr, "vrpn_Tracker_ViewPoint::vrpn_Tracker_ViewPoint(): Warning, SDK version is %g, while DLL version is %g \n", version, VPX_SDK_VERSION); - } - else { - printf("vrpn_Tracker_ViewPoint::vrpn_Tracker_ViewPoint(): SDK version %g matches DLL version %g \n", version, VPX_SDK_VERSION); - } - - // Two sensors, one for each eye - vrpn_Tracker::num_sensors = 2; - - // Currently 3 analog channels per eye - const int channels_per_eye = 3; - - // Total number of channels is two times the number of channels per eye - vrpn_Analog::num_channel = channels_per_eye * 2; - - // VRPN stuff - register_server_handlers(); -} - -vrpn_Tracker_ViewPoint::~vrpn_Tracker_ViewPoint() -{ -} - -void vrpn_Tracker_ViewPoint::mainloop() -{ - // Call the server mainloop - server_mainloop(); - - // Get data from the DLL - get_report(); -} - -void vrpn_Tracker_ViewPoint::get_report() -{ - // Get a time stamp - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - - // Set the time stamp for each device type - vrpn_Tracker::timestamp = current_time; - vrpn_Analog::timestamp = current_time; - - // Get tracker and analog data - get_tracker(); - get_analog(); -} - - -void vrpn_Tracker_ViewPoint::get_tracker() -{ - // Get information for each eye - for (int i = 0; i < 2; i++) { - // The sensor - d_sensor = i; - - - // Which eye? - VPX_EyeType eye; - if (d_sensor == 0) eye = EYE_A; - else eye = EYE_B; - - - // Get tracker data from the DLL - VPX_RealPoint gp, cv, ga; - if (useSmoothedData) { - // Use smoothed data, when available - VPX_GetGazePointSmoothed2(eye, &gp); - VPX_GetComponentVelocity2(eye, &cv); // Always smoothed - VPX_GetGazeAngleSmoothed2(eye, &ga); - } - else { - // Use raw data - VPX_GetGazePoint2(eye, &gp); - VPX_GetComponentVelocity2(eye, &cv); // Always smoothed - VPX_GetGazeAngle2(eye, &ga); - } - - - // Set the tracker position from the gaze point - pos[0] = gp.x; - pos[1] = gp.y; - pos[2] = 0.0; - - - // Set the tracker velocity from the eye velocity - vel[0] = cv.x; - vel[1] = cv.y; - vel[2] = 0.0; - - - // Convert the gaze angle to a quaternion - q_from_euler(d_quat, 0.0, Q_DEG_TO_RAD(ga.y), Q_DEG_TO_RAD(ga.x)); - - - // Send the data for this eye - send_report(); - } -} - -void vrpn_Tracker_ViewPoint::get_analog() -{ - // Get information for each eye - for (int i = 0; i < 2; i++) { - // Which eye? - VPX_EyeType eye; - if (i == 0) eye = EYE_A; - else eye = EYE_B; - - - // Analog channel index offset for second eye - unsigned int eyeOffset = i * vrpn_Analog::num_channel / 2; - - - // Get analog information from the DLL - double ar, tv, fs; - VPX_GetPupilAspectRatio2(eye, &ar); - VPX_GetTotalVelocity2(eye, &tv); - VPX_GetFixationSeconds2(eye, &fs); - - - // Set the analog channels - channel[0 + eyeOffset] = ar; - channel[1 + eyeOffset] = tv; - channel[2 + eyeOffset] = fs; - } - - - // Send all analog data - vrpn_Analog::report_changes(); -} - - -void vrpn_Tracker_ViewPoint::send_report() -{ - // Send tracker data - if (d_connection) { - char msgbuf[1000]; - int len = vrpn_Tracker::encode_to(msgbuf); - if (d_connection->pack_message(len, vrpn_Tracker::timestamp, position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"vrpn_Tracker_ViewPoint: cannot write message: tossing\n"); - } - len = vrpn_Tracker::encode_vel_to(msgbuf); - if (d_connection->pack_message(len, vrpn_Tracker::timestamp, velocity_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"vrpn_Tracker_ViewPoint: cannot write message: tossing\n"); - } - } -} - -#endif \ No newline at end of file diff --git a/src/vrpn/vrpn_Tracker_ViewPoint.h b/src/vrpn/vrpn_Tracker_ViewPoint.h deleted file mode 100644 index c350236624052c81f3947f6658bd6a815f16c6a0..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_ViewPoint.h +++ /dev/null @@ -1,103 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// Name: vrpn_Tracker_ViewPoint.h -// -// Author: David Borland -// -// EventLab at the University of Barcelona -// -// Description: VRPN server class for Arrington Research ViewPoint EyeTracker. -// -// The VRPN server connects to the eye tracker using the VPX_InterApp DLL. -// Whatever other control software is being used to connect to the eye tracker -// (e.g. the ViewPoint software that comes with the tracker) to perform -// calibration, etc. should link to the same copy of the DLL, so they can share -// information. -// -// ------------------------------------------------------------------------------- -// -// Tracker: -// -// The tracker has two sensors, as the ViewPoint can optionally have binocular -// tracking. In the case of monocular tracking, only sensor 0 (EYE_A) will have -// valid information. Retrieving smoothed or raw tracking data is controlled by -// the smoothedData parameter. -// -// Position: The (x,y) gaze point in gaze space (smoothed or raw). -// -// Rotation: The (x,y) gaze angle as a quaternion (smoothed or raw). -// -// Velocity: The x- and y- components of the eye movement velocity in gaze space -// (always smoothed). -// -// ------------------------------------------------------------------------------- -// -// Analog: -// -// There are a lot of additional data that can be retrieved from the tracker. -// These values are always calculated from the smoothed gaze point. Currently, -// the following are sent as analog values, but more can be added as needed. -// Please see the ViewPoint documentation regarding what other data are available. -// -// Because each channel needs to be duplicated in the case of a binocular tracker, -// the first n/2 values are for EYE_A, and the second n/2 values are for EYE_B. -// -// EYE_A: -// -// Channel 0: The pupil aspect ratio, from 0.0 to 1.0. Can be used to detect -// blinks when it falls below a given threshold. -// -// Channel 1: The total velocity (magnitude of eye movement velocity). Can be -// used to detect saccades. -// -// Channel 2: The fixation seconds (length of time below the velocity criterion -// used to detect saccades). 0 if saccade is occurring. -// -// EYE_B: -// -// Channels 3-5: See EYE_A. -// -/////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef VRPN_TRACKER_VIEWPOINT -#define VRPN_TRACKER_VIEWPOINT - -// Make sure ViewPoint EyeTracker is being used -#include "vrpn_Configure.h" // IWYU pragma: keep -#ifdef VRPN_USE_VIEWPOINT - -#include "vrpn_Tracker.h" -#include "vrpn_Analog.h" - -class vrpn_Tracker_ViewPoint : public vrpn_Tracker, public vrpn_Analog { -public: - // Constructor - // - // name: VRPN tracker name - // - // c: VRPN connection to use - // - // smoothedData: Get smoothed data or raw data for tracker values. - // - vrpn_Tracker_ViewPoint(const char* name, vrpn_Connection* c, bool smoothedData = true); - ~vrpn_Tracker_ViewPoint(); - - /// This function should be called each time through the main loop - /// of the server code. It checks for a report from the tracker and - /// sends it if there is one. - virtual void mainloop(); - -protected: - virtual void get_report(); - - virtual void get_tracker(); - virtual void get_analog(); - - virtual void send_report(); - - bool useSmoothedData; -}; - - -#endif -#endif diff --git a/src/vrpn/vrpn_Tracker_WiimoteHead.C b/src/vrpn/vrpn_Tracker_WiimoteHead.C deleted file mode 100644 index 6f3441f9ac68251393189266555619aa10d21118..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_WiimoteHead.C +++ /dev/null @@ -1,552 +0,0 @@ -/** @file vrpn_Tracker_WiimoteHead.C - @brief Implementation of Wii Remote head tracking filter driver - - @date 2009-2010 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program - - See ASME paper WINVR2010-3771 for more details on this system. -*/ -/* - Copyright Iowa State University 2009-2010 - Distributed under the Boost Software License, Version 1.0. - (See accompanying comment below or copy at - http://www.boost.org/LICENSE_1_0.txt) - - Boost Software License - Version 1.0 - August 17th, 2003 - - Permission is hereby granted, free of charge, to any person or organization - obtaining a copy of the software and accompanying documentation covered by - this license (the "Software") to use, reproduce, display, distribute, - execute, and transmit the Software, and to prepare derivative works of the - Software, and to permit third-parties to whom the Software is furnished to - do so, all subject to the following: - - The copyright notices in the Software and this entire statement, including - the above license grant, this restriction and the following disclaimer, - must be included in all copies of the Software, in whole or in part, and - all derivative works of the Software, unless such copies or derivative - works are solely in the form of machine-executable object code generated by - a source language processor. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - - - -// Local Includes -#include "quat.h" // for q_xyz_quat_type, q_vec_copy, etc -#include "vrpn_Connection.h" // for vrpn_Connection, etc -#include "vrpn_Tracker_WiimoteHead.h" -#include "vrpn_Types.h" // for vrpn_float64 - -// Standard includes -#include <math.h> // for tan, atan2, sqrt -#include <stdio.h> // for NULL, fprintf, stderr -#include <algorithm> // for swap -#include <iostream> // for operator<<, basic_ostream, etc - -#undef VERBOSE - -/// We need isnan but don't want to go crazy on requirements -/// hence the following -inline static bool wm_isnan(const double x) { - return (x != x); -} - -/// @name Constants -/// @{ -const double two = 2; - -// Some stats source: http://wiibrew.org/wiki/Wiimote#IR_Camera -const double xResSensor = 1024.0, yResSensor = 768.0; - -/// Field of view experimentally determined at Iowa State University -/// March 2010 -const double fovX = Q_DEG_TO_RAD(43.0), fovY = Q_DEG_TO_RAD(32.00); -//const double fovX = Q_DEG_TO_RAD(45.0), fovY = (fovX / xResSensor) * yResSensor; - -const double radPerPx = fovX / xResSensor; -const double cvtDistToAngle = radPerPx / two; -/// @} - -/** @brief Utility function to set a quat equal to the identity rotation - */ -#define MAKE_IDENTITY_QUAT(dest) \ - dest[0] = dest[1] = dest[2] = 0; dest[3] = 1 - -/** @brief Utility function to set a 3-vector equal to the zero vector - */ -#define MAKE_NULL_VEC(dest) \ - dest[0] = dest[1] = dest[2] = 0 - - -vrpn_Tracker_WiimoteHead::vrpn_Tracker_WiimoteHead(const char* name, - vrpn_Connection* trackercon, - const char* wiimote, - float update_rate, - float led_spacing) : - vrpn_Tracker(name, trackercon), - d_name(wiimote), - d_update_interval(update_rate ? (1.0 / update_rate) : 1.0 / 60.0), - d_blobDistance(led_spacing), - d_flipState(FLIP_UNKNOWN), - d_points(0), - d_ana(NULL), - d_contact(false), - d_lock(false), - d_updated(false), - d_gravDirty(true) { - // If the name is NULL, we're done. - if (wiimote == NULL) { - d_name = NULL; - fprintf(stderr, "vrpn_Tracker_WiimoteHead: " - "Can't start without a valid specified Wiimote device!"); - return; - } - - setup_wiimote(); - - //-------------------------------------------------------------------- - // Whenever we get a connection, set a flag so we make sure to send an - // update. Set up a handler to do this. - register_autodeleted_handler(d_connection->register_message_type(vrpn_got_connection), - handle_connection, this); - - //-------------------------------------------------------------------- - // Set the current matrix to identity, the current timestamp to "now", - // the current matrix to identity in case we never hear from the Wiimote. - // Also, set the updated flag to send a single report - reset(); - - // put a little z translation as a saner default - d_currentPose.xyz[2] = 1; - - // Set up our initial "default" pose to make sure everything is - // safely initialized before our first report. - _convert_pose_to_tracker(); -} - -vrpn_Tracker_WiimoteHead::~vrpn_Tracker_WiimoteHead(void) { - - // If the analog pointer is NULL, we're done. - if (d_ana == NULL) { - return; - } - - // Turn off the callback handler - int ret; - ret = d_ana->unregister_change_handler(this, handle_analog_update); - - // Delete the analog device. - delete d_ana; - d_ana = NULL; -} - -/** Reset the current pose to identity and store it into the tracker - position/quaternion location, and set the updated flag. -*/ -void vrpn_Tracker_WiimoteHead::reset() { - _reset_gravity(); - _reset_pose(); - _reset_points(); -} - -void vrpn_Tracker_WiimoteHead::setup_wiimote() { - if (d_ana) { - // Turn off the callback handler and delete old analog - // if we already have an analog source - d_ana->unregister_change_handler(this, handle_analog_update); - delete d_ana; - d_ana = NULL; - } - - // Open the analog device and point the remote at it. - // If the name starts with the '*' character, use the server - // connection rather than making a new one. - if (d_name[0] == '*') { - d_ana = new vrpn_Analog_Remote(&(d_name[1]), d_connection); - } else { - d_ana = new vrpn_Analog_Remote(d_name); - } - - if (d_ana == NULL) { - fprintf(stderr, "vrpn_Tracker_WiimoteHead: " - "Can't open Analog %s\n", d_name); - return; - } - - // register callback - int ret = d_ana->register_change_handler(this, handle_analog_update); - if (ret == -1) { - fprintf(stderr, "vrpn_Tracker_WiimoteHead: " - "Can't setup change handler on Analog %s\n", d_name); - delete d_ana; - d_ana = NULL; - return; - } - - // will notify when we catch the first report. - d_contact = false; -} - -void vrpn_Tracker_WiimoteHead::mainloop() { - struct timeval now; - - // Call generic server mainloop, since we are a server - server_mainloop(); - - // Mainloop() the wiimote to get fresh values - if (d_ana != NULL) { - d_ana->mainloop(); - } - - // See if we have new data, or if it has been too long since our last - // report. Send a new report in either case. - vrpn_gettimeofday(&now, NULL); - double interval = vrpn_TimevalDurationSeconds(now, d_prevtime); - - if (_should_report(interval)) { - // Figure out the new matrix based on the current values and - // the length of the interval since the last report - update_pose(); - - report(); - } -} - -void vrpn_Tracker_WiimoteHead::update_pose() { - q_xyz_quat_type newPose; - - // Start at the identity pose - MAKE_NULL_VEC(newPose.xyz); - MAKE_IDENTITY_QUAT(newPose.quat); - - // If our gravity vector has changed and it's not 0, - // we need to update our gravity correction transform. - if (d_gravDirty && _have_gravity()) { - _update_gravity_moving_avg(); - } - - // Update pose estimate - _update_2_LED_pose(newPose); - - if (d_lock) { - // Gravity correction - if (_have_gravity()) { - q_xyz_quat_compose(&d_currentPose, &d_currentPose, &d_gravityXform); - } - - if (d_flipState == FLIP_UNKNOWN) { - _update_flip_state(); - if (d_flipState == FLIP_180) { - return; // must throw away first update after setting flip to 180 - } - } - - // Copy final pose into the tracker position and quaternion structures. - _convert_pose_to_tracker(); - } -} - -void vrpn_Tracker_WiimoteHead::report() { - // pack and deliver tracker report; - if (d_connection) { - char msgbuf[1000]; - int len = encode_to(msgbuf); - if (d_connection->pack_message(len, vrpn_Tracker::timestamp, - position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr, "vrpn_Tracker_WiimoteHead: " - "cannot write message: tossing\n"); - } - } else { - fprintf(stderr, "vrpn_Tracker_WiimoteHead: " - "No valid connection\n"); - } - - // We just sent a report, so reset the time - vrpn_gettimeofday(&d_prevtime, NULL); - d_updated = false; -} - -// static -void vrpn_Tracker_WiimoteHead::handle_analog_update(void* userdata, const vrpn_ANALOGCB info) { - vrpn_Tracker_WiimoteHead* wh = (vrpn_Tracker_WiimoteHead*)userdata; - - if (!wh) { - return; - } - if (!wh->d_contact) { -#ifdef VERBOSE - fprintf(stderr, "vrpn_Tracker_WiimoteHead: " - "got first report from Wiimote!\n"); -#endif - } - - int i, firstchan; - // Grab all the blobs - for (i = 0; i < 4; i++) { - firstchan = i * 3 + 4; - // -1 should signal a missing blob, but experimentally - // we sometimes get 0 instead - if (info.channel[firstchan] > 0 - && info.channel[firstchan + 1] > 0 - && info.channel[firstchan + 2] > 0) { - wh->d_vX[i] = info.channel[firstchan]; - wh->d_vY[i] = info.channel[firstchan + 1]; - wh->d_vSize[i] = info.channel[firstchan + 2]; - wh->d_points = i + 1; - } else { - break; - } - } - - wh->d_contact = true; - wh->d_updated = true; - - bool newgrav = false; - - // Grab gravity - for (i = 0; i < 3; i++) { - if (info.channel[1 + i] != wh->d_vGrav[i]) { - newgrav = true; - break; - } - } - - if (newgrav) { - if (!wh->d_gravDirty) { - // only slide back the previous gravity if we actually used it once. - q_vec_copy(wh->d_vGravAntepenultimate, wh->d_vGravPenultimate); - q_vec_copy(wh->d_vGravPenultimate, wh->d_vGrav); - } - for (i = 0; i < 3; i++) { - wh->d_vGrav[i] = info.channel[1 + i]; - } - wh->d_gravDirty = true; - } - - // Store the time of the report into the tracker's timestamp field. - wh->vrpn_Tracker::timestamp = info.msg_time; -} - -// static -int vrpn_Tracker_WiimoteHead::handle_connection(void* userdata, vrpn_HANDLERPARAM) { - vrpn_Tracker_WiimoteHead* wh = reinterpret_cast<vrpn_Tracker_WiimoteHead*>(userdata); - - // Indicate that we should send a report with whatever we have. - wh->d_updated = true; - - // Always return 0 here, because nonzero return means that the input data - // was garbage, not that there was an error. If we return nonzero from a - // vrpn_Connection handler, it shuts down the connection. - return 0; -} - -void vrpn_Tracker_WiimoteHead::_update_gravity_moving_avg() { - // Moving average of last three gravity vectors - /// @todo replace/supplement gravity moving average with Kalman filter - q_vec_type movingAvg = Q_NULL_VECTOR; - - q_vec_copy(movingAvg, d_vGrav); - q_vec_add(movingAvg, movingAvg, d_vGravPenultimate); - q_vec_add(movingAvg, movingAvg, d_vGravAntepenultimate); - q_vec_scale(movingAvg, 0.33333, movingAvg); - - // reset gravity transform - MAKE_IDENTITY_QUAT(d_gravityXform.quat); - MAKE_NULL_VEC(d_gravityXform.xyz); - - q_vec_type regulargravity = Q_NULL_VECTOR; - regulargravity[2] = 1; - - q_from_two_vecs(d_gravityXform.quat, movingAvg, regulargravity); - d_gravDirty = false; -} - -void vrpn_Tracker_WiimoteHead::_update_2_LED_pose(q_xyz_quat_type & newPose) { - if (d_points != 2) { - // we simply stop updating our pos+orientation if we lost LED's - // TODO: right now if we don't have exactly 2 points we lose the lock - d_lock = false; - d_flipState = FLIP_UNKNOWN; - return; - } - - // TODO right now only handling the 2-LED glasses - - d_lock = true; - double rx, ry, rz; - rx = ry = rz = 0; - - double X0, X1, Y0, Y1; - - X0 = d_vX[0]; - X1 = d_vX[1]; - Y0 = d_vY[0]; - Y1 = d_vY[1]; - - if (d_flipState == FLIP_180) { - /// If the first report of a new tracking lock indicated that - /// our "up" vector had no positive y component, we have the - /// points in the wrong order - flip them around. - /// This uses the assumption that the first time we see the glasses, - /// they ought to be right-side up (a reasonable assumption for - /// head tracking) - std::swap(X0, X1); - std::swap(Y0, Y1); - } - - const double dx = X0 - X1; - const double dy = Y0 - Y1; - const double dist = sqrt(dx * dx + dy * dy); - const double angle = dist * cvtDistToAngle; - // Note that this is an approximation, since we don't know the - // distance/horizontal position. (I think...) - - const double headDist = (d_blobDistance / 2.0) / tan(angle); - - // Translate the distance along z axis, and tilt the head - newPose.xyz[2] = headDist; // translate along Z - rz = atan2(dy, dx); // rotate around Z - - // Find the sensor pixel of the line of sight - directly between - // the LEDs - const double avgX = (X0 + X1) / 2.0; - const double avgY = (Y0 + Y1) / 2.0; - - /// @todo For some unnerving reason, in release builds, avgX tends to become NaN/undefined - /// However, any kind of inspection (such as the following, or even a simple cout) - /// appears to prevent the issue. This makes me uneasy, but I won't argue with - /// what is working. - if (wm_isnan(avgX)) { - std::cerr << "NaN detected in avgX: X0 = " << X0 << ", X1 = " << X1 << std::endl; - return; - } - - if (wm_isnan(avgY)) { - std::cerr << "NaN detected in avgY: Y0 = " << Y0 << ", Y1 = " << Y1 << std::endl; - return; - } - - // b is the virtual depth in the sensor from a point to the full sensor - // used for finding similar triangles to calculate x/y translation - const double bHoriz = xResSensor / 2 / tan(fovX / 2); - const double bVert = yResSensor / 2 / tan(fovY / 2); - - // World head displacement (X and Y) from a centered origin at - // the calculated distance from the sensor - newPose.xyz[0] = headDist * (avgX - xResSensor / 2) / bHoriz; - newPose.xyz[1] = headDist * (avgY - yResSensor / 2) / bVert; - - // set the quat. part of our pose with rotation angles - q_from_euler(newPose.quat, rz, ry, rx); - - // Apply the new pose - q_vec_copy(d_currentPose.xyz, newPose.xyz); - q_copy(d_currentPose.quat, newPose.quat); -} - -void vrpn_Tracker_WiimoteHead::_update_flip_state() { - if (d_flipState != FLIP_UNKNOWN) { - return; - } - - q_vec_type upVec = {0, 1, 0}; - - q_xform(upVec, d_currentPose.quat, upVec); - if (upVec[1] < 0) { - // We are upside down - we will need to rotate 180 about the sensor Z - // Must recalculate now. -#ifdef VERBOSE - fprintf(stderr, "vrpn_Tracker_WiimoteHead: d_flipState = FLIP_180\n"); -#endif - d_flipState = FLIP_180; - update_pose(); - } else { - // OK, we are fine - there is a positive Y component to our up vector -#ifdef VERBOSE - fprintf(stderr, "vrpn_Tracker_WiimoteHead: d_flipState = FLIP_NORMAL\n"); -#endif - d_flipState = FLIP_NORMAL; - } -} - -void vrpn_Tracker_WiimoteHead::_convert_pose_to_tracker() { - q_vec_copy(pos, d_currentPose.xyz); // set position; - q_copy(d_quat, d_currentPose.quat); // set orientation -} - - -void vrpn_Tracker_WiimoteHead::_reset_gravity() { - MAKE_NULL_VEC(d_gravityXform.xyz); - MAKE_IDENTITY_QUAT(d_gravityXform.quat); - - MAKE_NULL_VEC(d_vGrav); - MAKE_NULL_VEC(d_vGravPenultimate); - MAKE_NULL_VEC(d_vGravAntepenultimate); - - // Default earth gravity is (0, 1, 0) - d_vGravAntepenultimate[2] = d_vGravPenultimate[2] = d_vGrav[2] = 1; - - d_gravDirty = true; -} - -void vrpn_Tracker_WiimoteHead::_reset_points() { - d_vX[0] = d_vX[1] = d_vX[2] = d_vX[3] = -1; - d_vY[0] = d_vY[1] = d_vY[2] = d_vY[3] = -1; - d_vSize[0] = d_vSize[1] = d_vSize[2] = d_vSize[3] = -1; - d_points = 0; - - - d_flipState = FLIP_UNKNOWN; - d_lock = false; -} - -void vrpn_Tracker_WiimoteHead::_reset_pose() { - // Reset to the identity pose - MAKE_NULL_VEC(d_currentPose.xyz); - MAKE_IDENTITY_QUAT(d_currentPose.quat); - - vrpn_gettimeofday(&d_prevtime, NULL); - - // Set the updated flag to send a report - d_updated = true; - d_flipState = FLIP_UNKNOWN; - d_lock = false; - - // Convert the matrix into quaternion notation and copy into the - // tracker pos and quat elements. - _convert_pose_to_tracker(); -} - -bool vrpn_Tracker_WiimoteHead::_should_report(double elapsedInterval) const { - // If we've gotten new wiimote reports since our last report, return true. - if (d_updated) { - return true; - } - - // If it's been more than our max interval, send an update anyway - if (elapsedInterval >= d_update_interval) { - return true; - } - - // Not time has elapsed, and nothing has changed, so return false. - return false; -} - -bool vrpn_Tracker_WiimoteHead::_have_gravity() const { - return (d_vGrav[0] != 0 || d_vGrav[1] != 1 || d_vGrav[2] != 0); -} diff --git a/src/vrpn/vrpn_Tracker_WiimoteHead.h b/src/vrpn/vrpn_Tracker_WiimoteHead.h deleted file mode 100644 index e0ed7655ede9a6b46fa02667fd69fb19ab83bb16..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_WiimoteHead.h +++ /dev/null @@ -1,239 +0,0 @@ -/** @file vrpn_Tracker_WiimoteHead.h - @brief vrpn_Tracker interface provided by processing Wii Remote data - for head tracking. - - @date 2009-2010 - - @author - Ryan Pavlik - <rpavlik@iastate.edu> and <abiryan@ryand.net> - http://academic.cleardefinition.com/ - Iowa State University Virtual Reality Applications Center - Human-Computer Interaction Graduate Program - - See ASME paper WINVR2010-3771 for more details on this system. -*/ -/* - Copyright Iowa State University 2009-2010 - Distributed under the Boost Software License, Version 1.0. - (See accompanying comment below or copy at - http://www.boost.org/LICENSE_1_0.txt) - - Boost Software License - Version 1.0 - August 17th, 2003 - - Permission is hereby granted, free of charge, to any person or organization - obtaining a copy of the software and accompanying documentation covered by - this license (the "Software") to use, reproduce, display, distribute, - execute, and transmit the Software, and to prepare derivative works of the - Software, and to permit third-parties to whom the Software is furnished to - do so, all subject to the following: - - The copyright notices in the Software and this entire statement, including - the above license grant, this restriction and the following disclaimer, - must be included in all copies of the Software, in whole or in part, and - all derivative works of the Software, unless such copies or derivative - works are solely in the form of machine-executable object code generated by - a source language processor. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -#ifndef __TRACKER_WIIMOTEHEAD_H -#define __TRACKER_WIIMOTEHEAD_H - -#include <quat.h> // for q_vec_type, q_xyz_quat_type - -#include "vrpn_Analog.h" // for vrpn_ANALOGCB, etc -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Tracker.h" // for vrpn_Tracker - -class VRPN_API vrpn_Connection; -struct vrpn_HANDLERPARAM; - -/** @brief Provides a tracker device given data from a Wii Remote and LED glasses. - - Assumes a reasonably-stationary Wii Remote (on a tripod, for example) - and two LEDs on a pair of glasses, some fixed distance (default 0.145m) - apart. You can use the "Johnny Lee" glasses with this. - - Reports poses in a right-hand coordinate system, y-up, that is always - level with respect to gravity no matter how your Wii Remote is tilted. - */ -class VRPN_API vrpn_Tracker_WiimoteHead : public vrpn_Tracker { - public: - /** @brief constructor - - @param name Name for the tracker device to expose - @param trackercon Connection to provide tracker device over - @param wiimote VRPN device name for existing vrpn_WiiMote device or - device with a compatible interface - see - vrpn_Tracker_WiimoteHead::d_ana for more info. If it starts - with *, the server connection will be used instead of creating a - new connection. - @param update_rate Minimum number of updates per second to issue - @param led_spacing Distance between LEDs in meters (0.145 is default) - */ - vrpn_Tracker_WiimoteHead(const char* name, - vrpn_Connection * trackercon, - const char* wiimote, - float update_rate, - float led_spacing = 0.145); - - /// @brief destructor - virtual ~vrpn_Tracker_WiimoteHead(); - - /// @brief reset pose, gravity transform, and cached points and gravity - virtual void reset(); - - /// @brief set up connection to wiimote-like analog device - void setup_wiimote(); - - /// @brief VRPN mainloop function - virtual void mainloop(); - - /** @brief function to drive the full pose update process - - If we claim to have a tracker lock after updating, we will transform - the current pose by the gravity transform before continuing. - */ - void update_pose(); - - /// @brief Pack and send tracker report - void report(); - - /// @brief Callback triggered when a new client connects to the tracker - static int VRPN_CALLBACK VRPN_CALLBACK handle_connection(void*, vrpn_HANDLERPARAM); - - /// @brief Callback triggered when our data source issues an update - static void VRPN_CALLBACK VRPN_CALLBACK handle_analog_update(void* userdata, const vrpn_ANALOGCB info); - - protected: - // Pose update steps - - /** @brief based on cached gravity data, use a moving average to update - the tracker's stored gravity transform. - - The moving average is computed over the last 3 unique gravity reports. - The transform is the rotation required to rotate the averaged gravity - vector to (0, 1, 0). - */ - void _update_gravity_moving_avg(); - - /** @brief Create tracker-relative pose estimate based on sensor location - of 2 tracked points. - - If d_points == 2: - - @post d_currentPose contains a tracker-relative pose estimate - - @post d_lock == true - Else: - - @post d_lock == false - - @post d_flipState = FLIP_UNKNOWN - - */ - void _update_2_LED_pose(q_xyz_quat_type & newPose); - - /** @brief If flip state is unknown, set flip state appropriately. - @post d_flipState=FLIP_NORMAL if the up vector created by d_currentPose - has a positive y component (tracked object is right side up) - @post d_flipState=FLIP_180 if the up vector created by d_currentPose - does not have a positive y component (tracked object appears upside-down), - which means that you should re-try the pose computation with - the points in the opposite order. - */ - void _update_flip_state(); - - /** @brief Set the vrpn_Tracker position and rotation to that indicated - by our d_currentPose; - */ - void _convert_pose_to_tracker(); - - // Partial resets - /** @brief reset gravity transform and cached gravity vectors - */ - void _reset_gravity(); - - /// @brief reset cached points, point count, and flip state, - void _reset_points(); - - /// @brief reset current pose, last report time, and tracker pose - void _reset_pose(); - - // Internal query/accessor functions - - /// @brief return true if we have new data or max time elapsed - bool _should_report(double elapsedInterval) const; - - /// @brief return true if our gravity values look like real data - bool _have_gravity() const; - - // Configuration Parameters - - /// @brief Tracker device name - const char* d_name; - - /// @brief maximum time between updates, in seconds - const double d_update_interval; - - /// @brief distance between LEDs on glasses, in meters - const double d_blobDistance; - - enum FlipState { FLIP_NORMAL, FLIP_180, FLIP_UNKNOWN }; - /// @brief Whether we need to flip the order of the tracked points - /// before calculating a pose. - FlipState d_flipState; - - /// @brief Time of last tracker report issued - struct timeval d_prevtime; - - //Cached data from Wiimote update - double d_vX[4]; - double d_vY[4]; - double d_vSize[4]; - double d_points; - - /** @brief Source of analog data, traditionally vrpn_WiiMote - Must present analog channels in this order: - - x, y, z components of vector opposed to gravity - - (0,0,1) is nominal Earth gravity - - four 3-tuples containing either: - - (x, y, size) for a tracked point (ranges [0, 1023], [0, 1023], [1,16]) - - (-1, -1, -1) as a place holder - point not seen - */ - vrpn_Analog_Remote* d_ana; - - - /// @brief Gravity correction transformation - q_xyz_quat_type d_gravityXform; - - /// @brief Current pose estimate - q_xyz_quat_type d_currentPose; - - // flags - - /// @brief Flag: Have we received the first message from the Wiimote? - bool d_contact; - - /// @brief Flag: Does the tracking algorithm report a lock? - bool d_lock; - - /// @brief Flag: Have we received updated Wiimote data since last report? - bool d_updated; - - /// @brief Flag: Have we received updated gravity data since - /// last gravity update? - bool d_gravDirty; - - // Gravity moving avg, window of 3 - q_vec_type d_vGravAntepenultimate; - q_vec_type d_vGravPenultimate; - q_vec_type d_vGrav; -}; - -#endif diff --git a/src/vrpn/vrpn_Tracker_Wintracker.C b/src/vrpn/vrpn_Tracker_Wintracker.C deleted file mode 100644 index f5d0880ddd917a2d962de5a1df03044395b8d757..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_Wintracker.C +++ /dev/null @@ -1,145 +0,0 @@ -/* - * vrpn_Tracker_Wintracker.cpp - * - * Created on: Dec 7, 2012 - * Author: Emiliano Pastorelli - Institute of Cybernetics, Tallinn (Estonia) - */ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <iostream> - -#include "quat.h" -#include "vrpn_Tracker_Wintracker.h" - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -//using namespace std; - -const unsigned VENDOR_ID = 0x09d9; -const unsigned PRODUCT_ID = 0x64df; - -using namespace std; - -//WintrackerIII Data length + 1 Byte for HID Report ID (0x0 as the device has no report IDs) - - - -#ifdef VRPN_USE_HID -vrpn_Tracker_Wintracker::vrpn_Tracker_Wintracker(const char * name, vrpn_Connection * trackercon, const char s0, const char s1, const char s2, const char ext, const char hemisphere): - vrpn_Tracker(name, trackercon), vrpn_HidInterface(new vrpn_HidProductAcceptor(VENDOR_ID, PRODUCT_ID)){ - _name = name; - _con = trackercon; - - memset(d_quat, 0, 4 * sizeof(float)); - memset(pos, 0, 3 * sizeof(float)); - - vrpn_Tracker::num_sensors=3; - - //configure WintrackerIII sensors activation state - const vrpn_uint8 sensor0 = s0; - const vrpn_uint8 sensor1 = s1; - const vrpn_uint8 sensor2 = s2; - const vrpn_uint8 set_sensors_cmd[] = {0x0,'S','A',sensor0,sensor1,sensor2,'\n'}; - //Send sensors activation data to the WintrackerIII device - send_data(sizeof(set_sensors_cmd),set_sensors_cmd); - - cout << "WintrackerIII Vrpn Server up and running..." << endl; - cout << "Sensors activation state : " << endl; - cout << "Sensor 0: " << sensor0 << " - " << "Sensor 1: " << sensor1 << " - " << "Sensor 2: " << sensor2 <<endl; - - //if parameter hemisphere is set to Z, change the hemisphere of operation to the upper one (Z<0) - //by default set to front one (X>0) - if(hemisphere=='Z'){ - cout << "Hemisphere of operation : Upper(Z<0)" << endl; - const vrpn_uint8 set_hemi[] = {0x0,'S','H','U','\n'}; - send_data(sizeof(set_hemi),set_hemi); - } - else{ - cout << "Hemisphere of operation : Front(X>0)" << endl; - } - - //if parameter ext == 1, activate VRSpace Range Extender - if(ext=='1'){ - cout << "Range Extender : Activated" << endl; - const vrpn_uint8 set_extender_cmd[] = {0x0,'S','L','\n'}; - send_data(sizeof(set_extender_cmd),set_extender_cmd); - } - else{ - cout << "Range Extender : Not Activated" << endl; - } - - vrpn_gettimeofday(&_timestamp, NULL); -} - - -void vrpn_Tracker_Wintracker::on_data_received(size_t bytes, vrpn_uint8 *buff){ - - if (bytes == 24){ - - vrpn_uint8 recordType = vrpn_unbuffer_from_little_endian<vrpn_int8>(buff); - //second byte of the buffer, identifying the sensor number - vrpn_uint8 recordNumber = vrpn_unbuffer_from_little_endian<vrpn_int8>(buff); - - //WintrackerIII identifies the sensors using recordNumber - //48=sensor 0 - //49=sensor 1 - //50=sensor 2 - if(((int)recordNumber)==48){ - d_sensor = 0; - }else if(((int)recordNumber)==49){ - d_sensor = 1; - }else if(((int)recordNumber)==50){ - d_sensor = 2; - } - - //position data (transformed in meters from WintrackerIII 0.1 mm data - pos[0]=vrpn_unbuffer_from_little_endian<vrpn_int16>(buff)/10000.00; - pos[1]=vrpn_unbuffer_from_little_endian<vrpn_int16>(buff)/10000.00; - pos[2]=vrpn_unbuffer_from_little_endian<vrpn_int16>(buff)/10000.00; - - //azimuth, elevation and roll data, not used by the vrpn server - vrpn_uint16 azimuth = vrpn_unbuffer_from_little_endian<vrpn_int16>(buff); - vrpn_uint16 elevation = vrpn_unbuffer_from_little_endian<vrpn_int16>(buff); - vrpn_uint16 roll = vrpn_unbuffer_from_little_endian<vrpn_int16>(buff); - - //normalized quaternion data (Vrpn Order Qx,Qy,Qz,Qw - WintrackerIII Order Qw,Qx,Qy,Qz) - d_quat[3]=vrpn_unbuffer_from_little_endian<vrpn_int16>(buff)/10000.00; - d_quat[0]=vrpn_unbuffer_from_little_endian<vrpn_int16>(buff)/10000.00; - d_quat[1]=vrpn_unbuffer_from_little_endian<vrpn_int16>(buff)/10000.00; - d_quat[2]=vrpn_unbuffer_from_little_endian<vrpn_int16>(buff)/10000.00; - - vrpn_gettimeofday(&_timestamp, NULL); - vrpn_Tracker::timestamp = _timestamp; - - char msgbuf[1000]; - - int len = vrpn_Tracker::encode_to(msgbuf); - - if (d_connection->pack_message(len, _timestamp, position_m_id, d_sender_id, msgbuf, vrpn_CONNECTION_LOW_LATENCY)){ - fprintf(stderr, "FAIL \n"); - } - } - else - { - fprintf(stderr, "FAIL : Cannot read input from Wintracker \n"); - } -} - - -void vrpn_Tracker_Wintracker::mainloop() -{ - if (connected()) - { - // device update - update(); - - // server update - server_mainloop(); - - } -} - -#endif - - diff --git a/src/vrpn/vrpn_Tracker_Wintracker.h b/src/vrpn/vrpn_Tracker_Wintracker.h deleted file mode 100644 index 994811e76d32625b4923da0fe25e520d24aba245..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_Wintracker.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * vrpn_Tracker_Wintracker.h - * - * Created on: Dec 11, 2012 - * Author: Emiliano Pastorelli - Institute of Cybernetics, Tallinn (Estonia) - */ - -#ifndef VRPN_TRACKER_WINTRACKER_H_ -#define VRPN_TRACKER_WINTRACKER_H_ - -#include "vrpn_Configure.h" -#include "vrpn_HumanInterface.h" -#include "vrpn_Tracker.h" - - -#if defined(VRPN_USE_HID) -#include <string> - -class VRPN_API vrpn_Tracker_Wintracker: public vrpn_Tracker, vrpn_HidInterface { - - public: - vrpn_Tracker_Wintracker(const char * name, vrpn_Connection * trackercon, const char s0, const char s1, const char s2, const char ext, const char hemisphere); - - virtual void mainloop(); - - virtual void on_data_received(size_t bytes, vrpn_uint8 *buffer); - -protected: - std::string _name; - vrpn_Connection *_con; - - bool _should_report; - struct timeval _timestamp; -}; -#endif - -#endif /* VRPN_TRACKER_WINTRACKER_H_ */ diff --git a/src/vrpn/vrpn_Tracker_isense.C b/src/vrpn/vrpn_Tracker_isense.C deleted file mode 100644 index 1329f8730749ad0a98a9102b88b731017270c141..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_isense.C +++ /dev/null @@ -1,585 +0,0 @@ - -#include "vrpn_Tracker_isense.h" - -#ifdef VRPN_INCLUDE_INTERSENSE -#include <time.h> -#include <math.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <ctype.h> - -#ifdef linux -#include <termios.h> -#endif - -#ifndef _WIN32 -#include <sys/ioctl.h> -#include <sys/time.h> -#include <unistd.h> -#include <netinet/in.h> -#endif - -#include "vrpn_Tracker.h" -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR -#include "quat.h" -#include "isense.c" - -#define MAX_TIME_INTERVAL (5000000) // max time between reports (usec) -#define INCHES_TO_METERS (2.54/100.0) -#define PI (3.14159265358979323846) -#define DEG_TO_RAD (PI/180.) - - -void vrpn_Tracker_InterSense::getTrackerInfo(char *msg) -{ - sprintf(msg, "Port%d (Intersense lib %g) (Firmware Rev %g)", m_TrackerInfo.Port, m_TrackerInfo.LibVersion, m_TrackerInfo.FirmwareRev); - switch(m_TrackerInfo.TrackerType) { - case ISD_NONE: - sprintf(msg, "%s (Unknown series:", msg); - break; - case ISD_PRECISION_SERIES: - sprintf(msg, "%s (Precision series:", msg); - break; - case ISD_INTERTRAX_SERIES: - sprintf(msg, "%s (InterTrax series:", msg); - break; - } - switch(m_TrackerInfo.TrackerModel) { - case ISD_UNKNOWN: - sprintf(msg, "%s Unknown model)", msg); - break; - - case ISD_IS300: - sprintf(msg, "%s IS300)", msg); - break; - - case ISD_IS600: - sprintf(msg, "%s IS600)", msg); - break; - - case ISD_IS900: - sprintf(msg, "%s IS900)", msg); - break; - - case ISD_IS1200: - sprintf(msg, "%s IS1200)", msg); - break; - - case ISD_INTERTRAX: - sprintf(msg, "%s InterTrax)", msg); - break; - - case ISD_INTERTRAX_2: - sprintf(msg, "%s InterTrax2)", msg); - break; - - case ISD_INTERTRAX_LS: - sprintf(msg, "%s InterTrax LS)", msg); - break; - - case ISD_INTERTRAX_LC: - sprintf(msg, "%s InterTrax LC)", msg); - break; - - case ISD_ICUBE2: - sprintf(msg, "%s InertiaCube2)", msg); - break; - - case ISD_ICUBE2_PRO: - sprintf(msg, "%s InertiaCube2 Pro)", msg); - break; - - case ISD_ICUBE3: - sprintf(msg, "%s InertiaCube3)", msg); - break; - } - sprintf(msg, "%s\n", msg); -} - -vrpn_Tracker_InterSense::vrpn_Tracker_InterSense(const char *name, - vrpn_Connection *c, - int commPort, const char *additional_reset_commands, - int is900_timestamps, int reset_at_start) : -vrpn_Tracker(name,c), do_is900_timestamps(is900_timestamps), -m_reset_at_start(reset_at_start) -{ -#ifdef VRPN_INCLUDE_INTERSENSE - char errStr[1024]; - int i; - - register_server_handlers(); - - if (additional_reset_commands == NULL) { - sprintf(add_reset_cmd, ""); - } else { - strncpy(add_reset_cmd, additional_reset_commands, sizeof(add_reset_cmd)-1); - } - - // Initially, set to no buttons or analogs on the stations. The - // methods to add buttons and analogs must be called to add them. - for (i = 0; i < ISD_MAX_STATIONS; i++) { - is900_buttons[i] = NULL; - is900_analogs[i] = NULL; - } - - m_CommPort = commPort; - m_Handle = ISD_OpenTracker(NULL, commPort, FALSE, FALSE); - - if(m_Handle == -1) - { - sprintf(errStr,"Failed to open tracker '%s' on COM%d: ISLIB_OpenTracker returned -1",name,commPort); - status = vrpn_TRACKER_FAIL; - return; - } - - // ISD_TRACKER_INFO_TYPE trackerInfo; - - ISD_GetTrackerConfig(m_Handle,&m_TrackerInfo,FALSE); - - for (i = 0; i < ISD_MAX_STATIONS; i++) { - if (set_sensor_output_format(i)) { - sprintf(errStr,"Failed to reset sensor %d on tracker '%s' on COM%d",i, name,commPort); - status = vrpn_TRACKER_FAIL; - return; - } - } - - - //what is the update rate of this tracker? - //we might want to set the update rate of the mainloop to based on this value. - //for now we just print it out. - getTrackerInfo(errStr); - vrpn_gettimeofday(×tamp, NULL); - VRPN_MSG_INFO(errStr); - fprintf(stderr,errStr); - - status = vrpn_TRACKER_SYNCING; -#else - fprintf(stderr,"Intersense library not compiled into this version. Use Fastrak driver for IS-600/900 or recompile with VRPN_INCLUDE_INTERSENSE defined\n"); - status = vrpn_TRACKER_FAIL; -#endif -} - -vrpn_Tracker_InterSense::~vrpn_Tracker_InterSense() -{ -#ifdef VRPN_INCLUDE_INTERSENSE - - int i; - - ISD_CloseTracker(m_Handle); - - // Delete any button and analog devices that were created - for (i = 0; i < ISD_MAX_STATIONS; i++) { - if (is900_buttons[i]) { - delete is900_buttons[i]; - is900_buttons[i] = NULL; - } - if (is900_analogs[i]) { - delete is900_analogs[i]; - is900_analogs[i] = NULL; - } - } -#endif -} - -/** This routine augments the basic sensor-output setting function of the Intersense - to allow the possibility of requesting timestamp, button data, and/or analog - data from the device. It sets the device for position + quaternion + any of - the extended fields. - - Returns 0 on success and -1 on failure. -*/ - -int vrpn_Tracker_InterSense::set_sensor_output_format(int station) -{ - char errStr[1024]; - - //Get the info about the station - ISD_GetStationConfig(m_Handle,&m_StationInfo[station],station+1,0); - - //ISD_ResetHeading(m_Handle,station+1); //Not sure if this is needed - // nahon@virtools.com - - if (m_reset_at_start) - ISD_Boresight(m_Handle, station+1, true); // equivalent to ISD_ResetHeading for itrax, see isense.h - - - // First, try to set the orientation reporting format to quaternions if possible. - // But, some models of intersense trackers (like the intertrax series) will only report - // in euler angles - - // Try to set the tracker to report in quaternion format - // (to avoid gimbal lock) - // nahon@virtools.com : Let's try, even if we are not a precision series - // It seems that this is OK with Intertrax2, what would happen to old Intertrax ? -// if (m_TrackerInfo.TrackerType == ISD_PRECISION_SERIES && - if ( - m_StationInfo[station].AngleFormat == ISD_EULER) - { - m_StationInfo[station].AngleFormat = ISD_QUATERNION; - if(!ISD_SetStationConfig(m_Handle,&m_StationInfo[station],station+1,FALSE)) - { - sprintf(errStr,"Warning: Your tracker doesn't seem to support the quaternion format - couldn't set station config for Station%d. ",station+1); - vrpn_gettimeofday(×tamp, NULL); - VRPN_MSG_WARNING(errStr); - - m_StationInfo[station].AngleFormat = ISD_EULER; - } - } - - // do is900 special things - // IS900 states (timestamp, button, analog). - if(m_TrackerInfo.TrackerModel == ISD_IS900) { - if (do_is900_timestamps) { - m_StationInfo[station].TimeStamped = TRUE; - if(!ISD_SetStationConfig(m_Handle,&m_StationInfo[station],station+1,FALSE)) - { - sprintf(errStr,"Warning: Your tracker doesn't seem to support the IS900 timestamps - couldn't set station config for Station%d. ",station+1); - vrpn_gettimeofday(×tamp, NULL); - VRPN_MSG_WARNING(errStr); - m_StationInfo[station].TimeStamped = FALSE; - } - } - - if (is900_buttons[station] || is900_analogs[station]) { - m_StationInfo[station].GetInputs = TRUE; - if(!ISD_SetStationConfig(m_Handle,&m_StationInfo[station],station+1,FALSE)) - { - sprintf(errStr,"Warning: Your tracker doesn't seem to support the IS900 buttons/analogs - couldn't set station config for Station%d. ",station+1); - vrpn_gettimeofday(×tamp, NULL); - VRPN_MSG_WARNING(errStr); - m_StationInfo[station].GetInputs = FALSE; - } - } - } - return 0; -} - -void vrpn_Tracker_InterSense::reset() -{ -#ifdef VRPN_INCLUDE_INTERSENSE - char errStr[1024]; - int i; - - m_Handle = ISD_OpenTracker(NULL,m_CommPort,FALSE,FALSE); - - if(m_Handle == -1) - { - sprintf(errStr,"InterSense: Failed to open tracker '%s' on COM%d: ISD_OpenTracker returned -1",d_servicename,m_CommPort); - fprintf(stderr,errStr); - vrpn_gettimeofday(×tamp, NULL); - VRPN_MSG_ERROR(errStr); - - status = vrpn_TRACKER_FAIL; - } - else - { - - //-------------------------------------------------------------------- - // Now that the tracker has given a valid status report, set all of - // the parameters the way we want them. We rely on power-up setting - // based on the receiver select switches to turn on the receivers that - // the user wants. - //-------------------------------------------------------------------- - - // Set output format for each of the possible stations. - - for (i = 0; i < ISD_MAX_STATIONS; i++) { - if (set_sensor_output_format(i)) { - return; - } - } - - // Send the additional reset commands, if any, to the tracker. - // These commands come in lines, with character \015 ending each - // line. - if (strlen(add_reset_cmd) > 0) { - printf(" Intersense writing extended reset commands...\n"); - if(!ISD_SendScript(m_Handle,add_reset_cmd)) - { - sprintf(errStr,"Warning: Your tracker failed executing the additional command string. "); - vrpn_gettimeofday(×tamp, NULL); - VRPN_MSG_WARNING(errStr); - } - } - - // If we are using the IS-900 timestamps, clear the timer on the device and - // store the time when we cleared it. First, drain any characters in the output - // buffer to ensure we're sending right away. Then, send the reset command and - // store the time that we sent it, plus the estimated time for the characters to - // get across the serial line to the device at the current baud rate. - // Set time units to milliseconds (MT) and reset the time (MZ). - if (do_is900_timestamps) { - char clear_timestamp_cmd[] = "MT\015MZ\015"; - if(!ISD_SendScript(m_Handle,clear_timestamp_cmd)) - { - sprintf(errStr,"Warning: Your tracker failed executing the additional command string. "); - vrpn_gettimeofday(×tamp, NULL); - VRPN_MSG_WARNING(errStr); - } - - vrpn_gettimeofday(&is900_zerotime, NULL); - } - - // Done with reset. - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - VRPN_MSG_WARNING("Reset Completed (this is good)"); - - status = vrpn_TRACKER_SYNCING; // We're trying for a new reading - } -#else - fprintf(stderr,"Intersense library not compiled into this version. Use Fastrak driver for IS-600/900 or recompile with VRPN_INCLUDE_INTERSENSE defined\n"); - status = vrpn_TRACKER_FAIL; -#endif -} - -// This function will get the reports from the intersense dll, then -// put that report into the time, sensor, pos and quat fields, and -// finally call send_report to send it. -void vrpn_Tracker_InterSense::get_report(void) -{ -#ifdef VRPN_INCLUDE_INTERSENSE - q_vec_type angles; - ISD_TRACKING_DATA_TYPE data; - int i; - - if(ISD_GetTrackingData(m_Handle,&data)) { - for(int station=0;station<ISD_MAX_STATIONS;station++) { - if(data.Station[station].NewData == TRUE) { - - d_sensor = station; - - //-------------------------------------------------------------------- - // If we are doing IS900 timestamps, decode the time, add it to the - // time we zeroed the tracker, and update the report time. Remember - // to convert the MILLIseconds from the report into MICROseconds and - // seconds. - //-------------------------------------------------------------------- - - if (do_is900_timestamps) { - vrpn_float32 read_time = data.Station[station].TimeStamp; - - struct timeval delta_time; // Time since the clock was reset - - // Convert from the float in MILLIseconds to the struct timeval - delta_time.tv_sec = (long)(read_time / 1000); // Integer trunction to seconds - read_time -= delta_time.tv_sec * 1000; // Subtract out what we just counted - delta_time.tv_usec = (long)(read_time * 1000); // Convert remainder to MICROseconds - - // Store the current time - timestamp = vrpn_TimevalSum(is900_zerotime, delta_time); - } else { - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - } - - //-------------------------------------------------------------------- - // If this sensor has an IS900 button on it, decode - // the button values into the button device and mainloop the button - // device so that it will report any changes. Each button is stored - // in one bit of the byte, with the lowest-numbered button in the - // lowest bit. - //-------------------------------------------------------------------- - - if (is900_buttons[station]) { - for (i = 0; i < is900_buttons[station]->number_of_buttons(); i++) { - is900_buttons[station]->set_button(i, data.Station[station].ButtonState[i]); - } - is900_buttons[station]->mainloop(); - } - - //-------------------------------------------------------------------- - // If this sensor has an IS900 analog on it, decode the analog values - // into the analog device and mainloop the analog device so that it - // will report any changes. The first byte holds the unsigned char - // representation of left/right. The second holds up/down. For each, - // 0 means min (left or rear), 127 means center and 255 means max. - //-------------------------------------------------------------------- - - if (is900_analogs[station]) { - // Normalize the values to the range -1 to 1 - is900_analogs[station]->setChannelValue(0, (data.Station[station].AnalogData[0] - 127) / 128.0); - is900_analogs[station]->setChannelValue(1, (data.Station[station].AnalogData[1] - 127) / 128.0); - - // Report the new values - is900_analogs[station]->report_changes(); - is900_analogs[station]->mainloop(); - } - - // Copy the tracker data into our internal storage before sending - // (no unit problem as the Position vector is already in meters, see ISD_STATION_STATE_TYPE) - // Watch: For some reason, to get consistent rotation and translation axis permutations, - // we need non direct mapping. - // RMT: Based on a report from Christian Odom, it seems like the Quaternions in the - // Isense are QXYZ, whereas in Quatlib (and VRPN) they are XYZQ. Once these - // are switched correctly, the positions can be read without strange swapping. - pos[0] = data.Station[station].Position[0]; - pos[1] = data.Station[station].Position[1]; - pos[2] = data.Station[station].Position[2]; - - if(m_StationInfo[station].AngleFormat == ISD_QUATERNION) { - d_quat[0] = data.Station[station].Quaternion[1]; - d_quat[1] = data.Station[station].Quaternion[2]; - d_quat[2] = data.Station[station].Quaternion[3]; - d_quat[3] = data.Station[station].Quaternion[0]; - } else { - // Just return Euler for now... - // nahon@virtools needs to convert to radians - angles[0] = DEG_TO_RAD*data.Station[station].Euler[0]; - angles[1] = DEG_TO_RAD*data.Station[station].Euler[1]; - angles[2] = DEG_TO_RAD*data.Station[station].Euler[2]; - - q_from_euler(d_quat, angles[0], angles[1], angles[2]); - } - - // have to just send it now - status = vrpn_TRACKER_REPORT_READY; -// fprintf(stderr, "sending message len %d\n", len); - send_report(); - - //printf("Isense %f, %f, %f\n",pos[0],pos[1],pos[2]); - //printf("Isense a:%f, %f, %f : ",angles[0],angles[1],angles[2]); //if the tracker reports a quat, these will be garbage - //printf("q: %f, %f, %f, %f\n",d_quat[0],d_quat[1],d_quat[2],d_quat[3]); - } - } - - } -#endif -} - -void vrpn_Tracker_InterSense::send_report(void) -{ -#ifdef VRPN_INCLUDE_INTERSENSE - // Send the message on the connection - if (d_connection) - { - char msgbuf[1000]; - int len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"InterSense: cannot write message: tossing\n"); - } - } -#endif -} - - - -// This function should be called each time through the main loop -// of the server code. It polls for a report from the tracker and -// sends it if there is one. It will reset the tracker if there is -// no data from it for a few seconds. - -void vrpn_Tracker_InterSense::mainloop() -{ - // Call the generic server mainloop, since we are a server - server_mainloop(); - - switch (status) { - case vrpn_TRACKER_SYNCING: - case vrpn_TRACKER_AWAITING_STATION: - case vrpn_TRACKER_PARTIAL: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - - get_report(); - - // Ready for another report - status = vrpn_TRACKER_SYNCING; - } - break; - - case vrpn_TRACKER_RESETTING: - reset(); - break; - - case vrpn_TRACKER_FAIL: - VRPN_MSG_WARNING("Tracking failed, trying to reset (try power cycle if more than 4 attempts made)"); - status = vrpn_TRACKER_RESETTING; - break; - } -} - - -/** This function indicates to the driver that there is some sort of InterSense IS-900- - compatible button device attached to the port (either a Wand or a Stylus). The driver - will configure the device to send reports when buttons are pressed and released. - - This routine returns 0 on success and -1 on failure (due to the sensor number being too - large or errors writing to the device or can't create the button). -*/ - -int vrpn_Tracker_InterSense::add_is900_button(const char *button_device_name, int sensor, int numbuttons) -{ - // Make sure this is a valid sensor - if ( (sensor < 0) || (sensor >= ISD_MAX_STATIONS) ) { - return -1; - } - - // Add a new button device and set the pointer to point at it. - is900_buttons[sensor] = new vrpn_Button_Server(button_device_name, d_connection, numbuttons); - if (is900_buttons[sensor] == NULL) { - VRPN_MSG_ERROR("Cannot open button device"); - return -1; - } - - // Send a new station-format command to the tracker so it will report the button states. - return set_sensor_output_format(sensor); -} - - -/** This function indicates to the driver that there is an InterSense IS-900- - compatible joystick device attached to the port (a Wand). The driver - will configure the device to send reports indicating the current status of the - analogs when they change. Note that a separate call to add_is900_button must - be made in order to enable the buttons on the wand: this routine only handles - the analog channels. - - The c0 and c1 parameters specify the clipping and scaling to take the reports - from the two joystick axes into the range [-1..1]. The default is unscaled. - - This routine returns 0 on success and -1 on failure (due to the sensor number being too - large or errors writing to the device or can't create the analog). -*/ - -int vrpn_Tracker_InterSense::add_is900_analog(const char *analog_device_name, int sensor, - double c0Min, double c0Low, double c0Hi, double c0Max, - double c1Min, double c1Low, double c1Hi, double c1Max) -{ - // Make sure this is a valid sensor - if ( (sensor < 0) || (sensor >= ISD_MAX_STATIONS) ) { - return -1; - } - - // Add a new analog device and set the pointer to point at it. - is900_analogs[sensor] = new vrpn_Clipping_Analog_Server(analog_device_name, d_connection); - if (is900_analogs[sensor] == NULL) { - VRPN_MSG_ERROR("Cannot open analog device"); - return -1; - } - - // Set the analog to have two channels, and set its channels to 0 to start with - is900_analogs[sensor]->setNumChannels(2); - is900_analogs[sensor]->setChannelValue(0, 0.0); - is900_analogs[sensor]->setChannelValue(1, 0.0); - - // Set the scaling on the two channels. - is900_analogs[sensor]->setClipValues(0, c0Min, c0Low, c0Hi, c0Max); - is900_analogs[sensor]->setClipValues(1, c1Min, c1Low, c1Hi, c1Max); - - // Send a new station-format command to the tracker so it will report the analog status - return set_sensor_output_format(sensor); -} -#endif diff --git a/src/vrpn/vrpn_Tracker_isense.h b/src/vrpn/vrpn_Tracker_isense.h deleted file mode 100644 index 251e547840503ff3a5a3a7617e377c0260c996d1..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_isense.h +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef __TRACKER_ISENSE_H -#define __TRACKER_ISENSE_H - -#include "vrpn_Configure.h" // IWYU pragma: keep - -#ifdef VRPN_INCLUDE_INTERSENSE - -#ifdef __APPLE__ -#define MACOSX -#endif - -#include <time.h> -#include <math.h> -#include <stdlib.h> -#include <stdio.h> -#ifndef _WIN32 -#include <sys/time.h> -#endif - -#include "vrpn_Tracker.h" -#include "vrpn_Button.h" -#include "vrpn_Analog.h" - -#include "isense.h" - -class VRPN_API vrpn_Tracker_InterSense : public vrpn_Tracker { - - public: - - vrpn_Tracker_InterSense(const char *name, - vrpn_Connection *c, - int commPort, const char *additional_reset_commands = NULL, - int is900_timestamps = 0, int reset_at_start=0); - - ~vrpn_Tracker_InterSense(); - - /// Add an IS900 button device to one of the sensors - /// This allows configuration of an InterSense IS-900 - int add_is900_button(const char *button_device_name, int sensor, int numbuttons = 5); - - /// Add the analog part of an IS900 joystick device to one of the sensors - /// This allows configuration of an InterSense IS-900 - /// The optional parameters specify the clipping and scaling to take the reports - /// from the two joystick axes into the range [-1..1]. The default is unscaled. - int add_is900_analog(const char *analog_device_name, int sensor, - double c0Min = -1, double c0Low = 0, double c0Hi = 0, double c0Max = 1, - double c1Min = -1, double c1Low = 0, double c1Hi = 0, double c1Max = 1); - - /// This function should be called each time through the main loop - /// of the server code. It polls for a report from the tracker and - /// sends it if there is one. It will reset the tracker if there is - /// no data from it for a few seconds. - - virtual void mainloop(); - - protected: - - virtual void get_report(void); - virtual void reset(); - virtual void send_report(void); - - char add_reset_cmd[2048]; //< Additional reset commands to be sent - - int m_CommPort; - ISD_TRACKER_HANDLE m_Handle; - ISD_TRACKER_INFO_TYPE m_TrackerInfo; - ISD_STATION_INFO_TYPE m_StationInfo[ISD_MAX_STATIONS]; - - int do_is900_timestamps; //< Request and process IS-900 timestamps? - int m_reset_at_start; //< should the tracker reset at startup - - struct timeval is900_zerotime; //< When the IS-900 time counter was zeroed - vrpn_Button_Server *is900_buttons[ISD_MAX_STATIONS]; //< Pointer to button on each sensor (NULL if none) - vrpn_Clipping_Analog_Server *is900_analogs[ISD_MAX_STATIONS]; //< Pointer to analog on each sensor (NULL if none) - - /// Augments the basic Fastrak format to include IS900 features if needed - int set_sensor_output_format(int sensor); - - void getTrackerInfo(char *msg); -}; -#endif - - -#endif diff --git a/src/vrpn/vrpn_Tracker_zSight.C b/src/vrpn/vrpn_Tracker_zSight.C deleted file mode 100644 index 54f257621d405b85c48676dd7241ffd0f5b812ea..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_zSight.C +++ /dev/null @@ -1,240 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// Name: vrpn_Tracker_zSight.C -// -// Authors: David Borland -// Josep Maria Tomas Sanahuja -// -// EventLab at the University of Barcelona -// -// Description: VRPN tracker class for Sensics zSight HMD with built-in tracker. The tracker -// reports only orientation information, not position. It is interfaced to as -// a DirectX joystick, so VRPN_USE_DIRECTINPUT must be defined in -// vrpn_Configure.h to use it. -// -/////////////////////////////////////////////////////////////////////////////////////////////// - -#include "vrpn_Tracker_zSight.h" - -#if defined(_WIN32) && defined(VRPN_USE_DIRECTINPUT) && defined(VRPN_HAVE_ATLBASE) - -#include <math.h> - -// Convert from 2's complement, as per the Sensics zSight documentation -short FromTwos(unsigned short x) { - if ( x < 0x8000 ) { - return (short) x; - } - else { - x = x ^ 0xFFFF; - short y = (short) x; - if (y != 32767) { - y = y + 1; - } - y = -y; - return (short) y; - } -} - -vrpn_Tracker_zSight::vrpn_Tracker_zSight(const char* name, vrpn_Connection* c) : - vrpn_Tracker(name, c) -{ - // Create a window handle - hWnd = CreateWindow("STATIC", "zSightWindow", WS_ICONIC, 0, 0, 10, 10, NULL, NULL, NULL, NULL); - - // Initialize DirectInput and acquire the device - if (FAILED(InitDevice())) { - fprintf(stderr,"vrpn_Tracker_zSight::vrpn_Tracker_zSight(): Failed to open device\n"); - hWnd = NULL; - return; - } - - // VRPN stuff - register_server_handlers(); -} - -vrpn_Tracker_zSight::~vrpn_Tracker_zSight() -{ - // Release the Sensics device if necessary - if (sensics) { - sensics->Unacquire(); - } -} - -void vrpn_Tracker_zSight::mainloop() -{ - // Call the generic server mainloop, since we are a server - server_mainloop(); - - // Get latest data - get_report(); -} - -void vrpn_Tracker_zSight::get_report() -{ - // Get the current time - vrpn_gettimeofday(×tamp, NULL); - - if (hWnd) { - HRESULT hr; - DIJOYSTATE2 js; - if (FAILED(hr = sensics->GetDeviceState(sizeof(DIJOYSTATE2), &js))) { - fprintf(stderr, "vrpn_Tracker_zSight::get_report(): Can't read tracker\n"); - return; - } - - // No need to fill in position, as we don´t get position information - - // Get the orientation, as per the Sensics zSight documentation - float w = FromTwos((unsigned short) js.lRx) / 32768.0f; - float x = FromTwos((unsigned short) js.lRy) / 32768.0f; - float y = FromTwos((unsigned short) js.lX) / 32768.0f; - float z = FromTwos((unsigned short) js.lY) / 32768.0f; - float mag = sqrt(w*w + x*x + y*y + z*z); - - // Set for internal quat, as per the Sensics zSight documentation - d_quat[3] = w / mag; - d_quat[0] = x / mag; - d_quat[1] = y / mag; - d_quat[2] = -z / mag; - } - - // Send the data - send_report(); -} - -void vrpn_Tracker_zSight::send_report() -{ - if (d_connection) { - char msgbuf[1000]; - int len = encode_to(msgbuf); - if (d_connection->pack_message(len, timestamp, position_m_id, d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"vrpn_Tracker_zSight: cannot write message: tossing\n"); - } - } -} - -HRESULT vrpn_Tracker_zSight::InitDevice() -{ - HRESULT hr; - - // Register with the DirectInput subsystem and get a pointer to an IDirectInput interface we can use. - if (FAILED(hr = DirectInput8Create(GetModuleHandle(NULL), - DIRECTINPUT_VERSION, - IID_IDirectInput8, - (void**)&directInput, NULL))) { - fprintf(stderr, "vrpn_Tracker_zSight::InitDevice(): Cannot open DirectInput\n"); - return hr; - } - - // Initialize the zSight device, which is implemented as a DirectInput joystick - if (FAILED(hr = directInput->EnumDevices(DI8DEVCLASS_GAMECTRL, EnumSensicsCallback, this, DIEDFL_ATTACHEDONLY))) { - fprintf(stderr, "vrpn_Tracker_zSight::InitDevice(): Cannot enumerate device\n"); - return hr; - } - - // Make sure we got the device we wanted - if (sensics == NULL) { - fprintf(stderr, "vrpn_Tracker_zSight::InitDevice(): No Sensics zSight device found\n"); - return E_FAIL; - } - - // Set the data format - if (FAILED(hr = sensics->SetDataFormat(&c_dfDIJoystick2))) - { - fprintf(stderr, "vrpn_Tracker_zSight::InitDevice(): Cannot set data format\n"); - sensics->Unacquire(); - return hr; - } - - // Set the cooperative level - if (FAILED(hr = sensics->SetCooperativeLevel(hWnd, DISCL_EXCLUSIVE | DISCL_BACKGROUND))) { - fprintf(stderr, "vrpn_Tracker_zSight::InitDevice(): Cannot set cooperative level\n"); - sensics->Unacquire(); - return hr; - } - - // Get the joystick axis object - if (FAILED(hr = sensics->EnumObjects(EnumObjectsCallback, this, DIDFT_AXIS))) { - fprintf(stderr, "vrpn_Tracker_zSight::InitDevice(): Cannot enumerate objects\n"); - sensics->Unacquire(); - return hr; - } - - // Acquire the joystick - if (FAILED(hr = sensics->Acquire())) { - char *reason; - - switch (hr) { - - case DIERR_INVALIDPARAM: - reason = "Invalid parameter"; - break; - - case DIERR_NOTINITIALIZED: - reason = "Not initialized"; - break; - - case DIERR_OTHERAPPHASPRIO: - reason = "Another application has priority"; - break; - - default: - reason = "Unknown"; - } - - fprintf(stderr, "vrpn_Tracker_zSight::InitDevice(): Cannot acquire device because %s\n", reason); - sensics->Unacquire(); - return hr; - } - - return S_OK; -} - -BOOL CALLBACK vrpn_Tracker_zSight::EnumSensicsCallback(const DIDEVICEINSTANCE* pdidInstance, VOID* selfPtr) -{ - vrpn_Tracker_zSight* me = (vrpn_Tracker_zSight*)(selfPtr); - HRESULT hr; - - // Obtain an interface to the tracker - hr = me->directInput->CreateDevice(pdidInstance->guidInstance, &me->sensics, NULL); - - // Make sure it is a Sensics zSight device - if (SUCCEEDED(hr) == TRUE) { - if (strcmp(pdidInstance->tszProductName, "Sensics zSight HMD") != 0) { - me->sensics->Unacquire(); - } - else { - return DIENUM_STOP; - } - } - - return DIENUM_CONTINUE; -} - -BOOL CALLBACK vrpn_Tracker_zSight::EnumObjectsCallback(const DIDEVICEOBJECTINSTANCE* pdidoi, VOID* selfPtr) -{ - vrpn_Tracker_zSight* me = (vrpn_Tracker_zSight*)(selfPtr); - - if (pdidoi->dwType & DIDFT_AXIS) { - DIPROPRANGE diprg; - ::memset(&diprg, 0, sizeof(DIPROPRANGE)); - diprg.diph.dwSize = sizeof(DIPROPRANGE); - diprg.diph.dwHeaderSize = sizeof(DIPROPHEADER); - diprg.diph.dwHow = DIPH_BYID; - diprg.diph.dwObj = pdidoi->dwType; // Specify the enumerated axis - diprg.lMin = 0; - diprg.lMax = 65535; - - // Set the range for the axis - if (FAILED(me->sensics->SetProperty(DIPROP_RANGE, &diprg.diph))) { - fprintf(stderr, "vrpn_Tracker_zSight::vrpn_Tracker_zSight(): Cannot set data range\n"); - return DIENUM_STOP; - } - } - - return DIENUM_CONTINUE; -} - -#endif diff --git a/src/vrpn/vrpn_Tracker_zSight.h b/src/vrpn/vrpn_Tracker_zSight.h deleted file mode 100644 index 067be8d68e5e45a41b09cb1f27f20b67165f4950..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Tracker_zSight.h +++ /dev/null @@ -1,72 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// Name: vrpn_Tracker_zSight.h -// -// Authors: David Borland -// Josep Maria Tomas Sanahuja -// -// EventLab at the University of Barcelona -// -// Description: VRPN tracker class for Sensics zSight HMD with built-in tracker. The tracker -// reports only orientation information, no position. It is interfaced to as -// a DirectX joystick, so VRPN_USE_DIRECTINPUT must be defined in -// vrpn_Configure.h to use it. -// -/////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef VRPN_TRACKER_ZSIGHT -#define VRPN_TRACKER_ZSIGHT - -// Make sure Direct Input is being used and atlbase is available for CComPtr. -#include "vrpn_Configure.h" // IWYU pragma: keep - -#if defined(_WIN32) && defined(VRPN_USE_DIRECTINPUT) && defined(VRPN_HAVE_ATLBASE) - -#include "vrpn_Tracker.h" - -#ifndef DIRECTINPUT_VERSION -#define DIRECTINPUT_VERSION 0x0800 -#endif -#include <atlbase.h> -#include <dinput.h> -#include <windows.h> - -class vrpn_Tracker_zSight : public vrpn_Tracker { -public: - // Constructor - // - // name: VRPN tracker name - // - // c: VRPN connection to use - // - vrpn_Tracker_zSight(const char* name, vrpn_Connection* c); - ~vrpn_Tracker_zSight(); - - /// This function should be called each time through the main loop - /// of the server code. It checks for a report from the tracker and - /// sends it if there is one. - virtual void mainloop(); - -protected: - // VRPN tracker functions for generating and sending reports - virtual void get_report(); - virtual void send_report(); - - // Initialize the device - HRESULT InitDevice(); - - // Callbacks for Direct Input - static BOOL CALLBACK EnumSensicsCallback(const DIDEVICEINSTANCE* pdidInstance, VOID* selfPtr); - static BOOL CALLBACK EnumObjectsCallback(const DIDEVICEOBJECTINSTANCE* pdidoi, VOID* selfPtr); - - // Handle to the console window - HWND hWnd; - - // The Direct Input and device handles - CComPtr<IDirectInput8> directInput; - CComPtr<IDirectInputDevice8> sensics; -}; - - -#endif -#endif diff --git a/src/vrpn/vrpn_Types.h b/src/vrpn/vrpn_Types.h deleted file mode 100644 index 54cfa42c27effa9138ebb8fe574ae1c712af9824..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Types.h +++ /dev/null @@ -1,223 +0,0 @@ -#ifndef VRPN_TYPES_H -#define VRPN_TYPES_H - -#include "vrpn_Configure.h" - -//------------------------------------------------------------------ -// Do a test for a C++ compiler first, to ensure it's the first -// error message. Otherwise, the error messages you get are -// completely cryptic. -//------------------------------------------------------------------ -#ifndef __cplusplus -#ifndef VRPN_IGNORE_NO_CPLUSPLUS -#error Need to compile with a C++ compiler, not a C compiler. The problem is that in Windows, filenames are case-insensitive. So the compiler cannot tell mumble.c from mumble.C. Visual Studio decided to make .cpp (which used to mean run the C preprocessor) mean C++ and both .c and .C mean C. The other problem is that when you insert a new file into a project, it FOR THAT FILE makes an override. The project settings say C++ but if you right-click on the file itself it has an override to compile with C. This needs to be changed for both the .C file and the .h file. -#endif -#endif - -//------------------------------------------------------------------ -// This section contains definitions for architecture-dependent -// types. It is important that the data sent over a vrpn_Connection -// be of the same size on all hosts sending and receiving it. Since -// C++ does not constrain the size of 'int', 'long', 'double' and -// so forth, we create new types here that are defined correctly for -// each architecture and use them for all data that might be sent -// across a connection. -// Part of porting VRPN to a new architecture is defining the -// types below on that architecture in such as way that the compiler -// can determine which machine type it is on. -//------------------------------------------------------------------ - -#undef VRPN_ARCH - -#ifdef sgi -#define VRPN_ARCH sgi -typedef char vrpn_int8; -typedef unsigned char vrpn_uint8; -typedef short vrpn_int16; -typedef unsigned short vrpn_uint16; -typedef int vrpn_int32; -typedef unsigned int vrpn_uint32; -typedef float vrpn_float32; -typedef double vrpn_float64; -#endif - -#ifdef hpux -#define VRPN_ARCH hpux -typedef char vrpn_int8; -typedef unsigned char vrpn_uint8; -typedef short vrpn_int16; -typedef unsigned short vrpn_uint16; -typedef int vrpn_int32; -typedef unsigned int vrpn_uint32; -typedef float vrpn_float32; -typedef double vrpn_float64; -#endif - -// For PixelFlow aCC compiler -#ifdef __hpux -#undef VRPN_ARCH -#define VRPN_ARCH __hpux -typedef char vrpn_int8; -typedef unsigned char vrpn_uint8; -typedef short vrpn_int16; -typedef unsigned short vrpn_uint16; -typedef int vrpn_int32; -typedef unsigned int vrpn_uint32; -typedef float vrpn_float32; -typedef double vrpn_float64; -#endif - -#ifdef sparc -#define VRPN_ARCH sparc -typedef char vrpn_int8; -typedef unsigned char vrpn_uint8; -typedef short vrpn_int16; -typedef unsigned short vrpn_uint16; -typedef int vrpn_int32; -typedef unsigned int vrpn_uint32; -typedef float vrpn_float32; -typedef double vrpn_float64; -#endif - -#ifdef linux -#define VRPN_ARCH linux -typedef char vrpn_int8; -typedef unsigned char vrpn_uint8; -typedef short vrpn_int16; -typedef unsigned short vrpn_uint16; -typedef int vrpn_int32; -typedef unsigned int vrpn_uint32; -typedef float vrpn_float32; -typedef double vrpn_float64; -#endif - -#ifdef _AIX -#define VRPN_ARCH aix -typedef char vrpn_int8; -typedef unsigned char vrpn_uint8; -typedef short vrpn_int16; -typedef unsigned short vrpn_uint16; -typedef int vrpn_int32; -typedef unsigned int vrpn_uint32; -typedef float vrpn_float32; -typedef double vrpn_float64; -#endif - -// _WIN32 is defined for all compilers for Windows (cygnus g++ included) -// WIN32 (sans underline) is defined only by the Windows VC++ compiler. -// -// DO NOT EVER USE WIN32 -// -// It is too hard to differentiate from _WIN32, and may not actually be -// defined by VC++ (it's a project option). If you use WIN32 to distinguish -// between VC++ and cygwin/g++, may your wrists quickly develop a nerve -// disorder that prevents you from ever typing again ;) -// -#ifdef _WIN32 -#define VRPN_ARCH _WIN32 -typedef char vrpn_int8; -typedef unsigned char vrpn_uint8; -typedef short vrpn_int16; -typedef unsigned short vrpn_uint16; -typedef int vrpn_int32; -typedef unsigned int vrpn_uint32; -typedef float vrpn_float32; -typedef double vrpn_float64; -#endif - -#if defined(FreeBSD) || defined(__FreeBSD__) -#ifndef FreeBSD -#define FreeBSD -#endif -#define VRPN_ARCH FreeBSD -typedef char vrpn_int8; -typedef unsigned char vrpn_uint8; -typedef short vrpn_int16; -typedef unsigned short vrpn_uint16; -typedef int vrpn_int32; -typedef unsigned int vrpn_uint32; -typedef float vrpn_float32; -typedef double vrpn_float64; -#endif - -#ifdef __APPLE__ -#define VRPN_ARCH MacOSX -typedef char vrpn_int8; -typedef unsigned char vrpn_uint8; -typedef short vrpn_int16; -typedef unsigned short vrpn_uint16; -typedef int vrpn_int32; -typedef unsigned int vrpn_uint32; -typedef float vrpn_float32; -typedef double vrpn_float64; -#endif - -// Architecture of last resort. -#ifndef VRPN_ARCH -#ifdef __GNUC__ -#define VRPN_ARCH _WIN32 -typedef char vrpn_int8; -typedef unsigned char vrpn_uint8; -typedef short vrpn_int16; -typedef unsigned short vrpn_uint16; -typedef int vrpn_int32; -typedef unsigned int vrpn_uint32; -typedef float vrpn_float32; -typedef double vrpn_float64; -#endif -#endif - -#ifndef VRPN_ARCH -#error Need to define architecture-dependent sizes in this file -#endif - -// Prevent use of this macro outside this file; -// if you need to distinguish more types, then define new types in this file. - -#undef VRPN_ARCH - -// ******************************************************* -// you should NOT need to modify anything below this point -// ******************************************************* -#ifdef __cplusplus -typedef vrpn_int16 vrpn_bool; - -const vrpn_int16 vrpn_true = 1; -const vrpn_int16 vrpn_false = 0; -const vrpn_int16 vrpn_TRUE = 1; -const vrpn_int16 vrpn_FALSE = 0; -const vrpn_int16 VRPN_TRUE = 1; -const vrpn_int16 VRPN_FALSE = 0; -#endif - -// should we add a success & fail? - -// [juliano 10/9/99] The vrpn bool variables can not actually be fully -// optimized away, because the compiler is not allowed to assume their -// values don't change. -// -// [juliano 11/28/99] Perhaps the optimization can be done if they are -// static? I don't know enough about what compilers can/cannot do today. -// -// If you are willing to assume templates, there is an alternative using -// a traits class that does make the optimization possible (and likely). -// -// If you don't want to use templates, but still want the sizeof -// these things be vrpn_int16, you can use macros like this. -// -// #define vrpn_false /*false*/vrpn_int16(0) -// #define vrpn_true /*true*/vrpn_int16(1) -// -// With this method, you will still be able to tell, in the -// compiler error messages, what the real code contains. -// -// If you don't care about them being a different type than -// vrpn_int16 (probably not a good idea), you can use this technique, -// which guarantees optimizations can be performed. -// -// enum vrpn_bool_constants_t{ -// vrpn_false=0, vrpn_FALSE=0, VRPN_FALSE=0, -// vrpn_true=1, vrpn_TRUE=1, VRPN_TRUE=1 }; -// - -#endif // VRPN_TYPES_H diff --git a/src/vrpn/vrpn_UNC_Joystick.C b/src/vrpn/vrpn_UNC_Joystick.C deleted file mode 100644 index ce2bf62b56df56169410ab9a22ee2b378d4dd162..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_UNC_Joystick.C +++ /dev/null @@ -1,274 +0,0 @@ -#include <stdio.h> // for fprintf, stderr, perror, etc -#include <string.h> // for strlen - -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_SleepMsecs, etc -#include "vrpn_Types.h" // for vrpn_float64, vrpn_int32 -#include "vrpn_UNC_Joystick.h" - -// This class runs the UNC custom serial joystick. It includes two -// buttons, a slider, and two 3-axis joysticks. It is based on a -// single-board computer. This driver is based on the px_sjoy.c -// code. - -static const vrpn_float64 JoyScale[] = {1019, 200, 200, 350, 200, 200, 350}; - -vrpn_Joystick::vrpn_Joystick(char * name, - vrpn_Connection * c, char * portname,int baud, - vrpn_float64 update_rate): - vrpn_Serial_Analog(name, c, portname, baud), - vrpn_Button_Filter(name, c) -{ - num_buttons = 2; // Has 2 buttons - num_channel = 7; // Has a slider and two 3-axis joysticks - if (update_rate != 0) { - MAX_TIME_INTERVAL = (long)(1000000/update_rate); - } else { - MAX_TIME_INTERVAL = -1; - } - status = vrpn_ANALOG_RESETTING; -} - -void vrpn_Joystick::report(struct timeval current_time) -{ - // Store the current time in the structures - vrpn_Analog::timestamp.tv_sec = current_time.tv_sec; - vrpn_Analog::timestamp.tv_usec = current_time.tv_usec; - vrpn_Button::timestamp.tv_sec = current_time.tv_sec; - vrpn_Button::timestamp.tv_usec = current_time.tv_usec; - - vrpn_Button::report_changes(); // report any button event; - - // Send the message on the connection; - if (vrpn_Analog::d_connection) { - char msgbuf[1000]; - vrpn_int32 len = vrpn_Analog::encode_to(msgbuf); - if (vrpn_Analog::d_connection->pack_message(len, vrpn_Analog::timestamp, - channel_m_id, vrpn_Analog::d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"UNC Joystick: Cannot pack message, tossing\n"); - } - } else { - fprintf(stderr,"UNC Joystick: No valid Connection\n"); - } -} - -void vrpn_Joystick::mainloop(void) { - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - - // Since we are a server, call the generic server mainloop() - server_mainloop(); - - switch (status) { - - case vrpn_ANALOG_SYNCING: - case vrpn_ANALOG_PARTIAL: - { - // As long as we keep getting reports, send them. - // XXX Ideally, this time would be the time of the first - // character read from the serial port for this report. - while (get_report()) { - vrpn_gettimeofday(¤t_time, NULL); - report(current_time); - } - - // If it has been longer than the requested report interval - // since we sent a report, send a complete report - // anyway (a repeat of the previous one). - if ( (vrpn_TimevalDuration(current_time, vrpn_Analog::timestamp) - > MAX_TIME_INTERVAL) && (MAX_TIME_INTERVAL != -1) ) { - - // send out the last report again; - report(current_time); - } - } - break; - - case vrpn_ANALOG_RESETTING: - case vrpn_ANALOG_FAIL: - reset(); - break; - } -} - -/****************************************************************************/ -/* Send request for status to joysticks and reads response. - * Resets all of the rest values for the analog channels. - */ -void vrpn_Joystick::reset() { - char request[256]; - int write_rt, bytesread; - - fprintf(stderr, "Going into vrpn_Joystick::reset()\n"); - - /* Request baseline report for comparison */ - request[0] = 'r'; - request[1] = 0; - write_rt = vrpn_write_characters(serial_fd, (unsigned char*)request, strlen(request)); - if (write_rt < 0) { - fprintf(stderr, "vrpn_Joystick::reset: write failed\n"); - status = vrpn_ANALOG_FAIL; - return; - } - vrpn_SleepMsecs(1000.0*1); - - // Read the report and parse each entry. For each one, have - // the parse routine store the restvalue, so that it will be - // subtracted from subsequent readings. - bytesread= vrpn_read_available_characters(serial_fd, serialbuf, 16); - if (bytesread != 16) { - fprintf(stderr, "vrpn_Joystick::reset: got only %d char from \ -joystick, should be 16, trying again\n", bytesread); - status = vrpn_ANALOG_FAIL; - } else { - // Parse the analog reports in the serialbuf and reset each - // channel's rest value. The button report is not - // parsed. - for (int i=0; i< num_channel; i++) { - parse(i*2, 1); - } - status = vrpn_ANALOG_SYNCING; - - /* Request only send each channel when state has changed */ - request[0] = 'j'; - vrpn_write_characters(serial_fd, (unsigned char*)request, strlen(request)); - } -} - -// SYNCING means that we are looking for a character that has -// the high bit clear (the first character of a report has this, -// while the second has this bit set). -// PARTIAL means that we have gotten the first character and are -// looking for the second character (which will have the high bit -// set). -int vrpn_Joystick::get_report() { - int bytesread = 0; - - if (status == vrpn_ANALOG_SYNCING) { - bytesread =vrpn_read_available_characters(serial_fd, serialbuf, 1); - if (bytesread == -1) { - perror("vrpn_Joystick::get_report() 1st read failed"); - return 0; - } - if (bytesread == 1) { - if ((serialbuf[0] >> 7) == 0) { - status = vrpn_ANALOG_PARTIAL; - } else { - fprintf(stderr,"vrpn_Joystick::get_report(): Bad 1st byte (re-syncing)\n"); - return 0; - } - } - } - - // Since we are not syncing, we must be in partial mode and - // looking for the second character. - bytesread = vrpn_read_available_characters(serial_fd, serialbuf+1, 1); - if (bytesread == -1) { - perror("vrpn_Joystick::get_report() 2nd read failed"); - return 0; - } - if (bytesread == 0) { - return 0; - } - // If the high bit is not set, then what we have here is a - // first character, not a second. Go ahead and put it into - // the first byte and continue on in partial mode. Scary but - // true: this seems to get all of the reports accurately, - // when tossing it out loses reports. Looks like there are - // sometimes duplicate first characters in the report ?!?!? - if ( (serialbuf[1] >> 7) == 0 ) { // Should have high bit set - serialbuf[0] = serialbuf[1]; - status = vrpn_ANALOG_PARTIAL; - return 0; - } - - parse(0); // Parse starting at the beginning of the serialbuf. - status = vrpn_ANALOG_SYNCING; - return 1; // Indicates that we have gotten a report -} - -/****************************************************************************/ -/* Decodes bytes as follows: - First byte of set received (from high order bit down): - -bit == 0 to signify first byte - -empty bit - -3 bit channel label - -3 bits (out of 10) of channel reading (high-order bits) - Second byte of set received (from high order bit down): - -bit == 1 to signify second byte - -7 bits (out of 10) of channel reading (low-order bits) -*/ - -void vrpn_Joystick::parse (int index, int reset_rest_pos) -{ - unsigned int temp; - static const unsigned int mask1 = 7, mask2 = 127, left = 1, right = 2; - - int chan; // Channel number extracted from report - int value; // Integer value extracted from report - - // Isolate the channel part of the first byte by shifting it - // to the lowest bits and then masking off the rest. - chan = serialbuf[index] >> 3; - chan = chan & mask1; - - // If channel number is > 7, this is illegal. - if (chan > 7) { - fprintf(stderr,"vrpn_Joystick::parse(): Invalid channel (%d)\n",chan); - status = vrpn_ANALOG_FAIL; - return; - } - - // Channel 7 is the button report. - if (chan == 7) { - /****************************************************************** - * The least most significant bit should be the left button and the next - * should be the right button. In the original reading the two bits are - * opposite this. We swap the two least significant bits. */; - - buttons[0] = static_cast<unsigned char>(!(serialbuf[index+1] & left)?1:0); - buttons[1] = static_cast<unsigned char>(!(serialbuf[index+1] & right)?1:0); -#ifdef VERBOSE - printf("Joystick::parse: Buttons: %d %d\n", - buttons[1], buttons[0]); -#endif - return; - } - - // The other channels are the analog channels [0..6] - // Strip off the high-order 3 bits from the first byte and - // shift them up to their proper location. - // Then strip off check bit from the second byte and insert - // the value bits to form the full value. - temp = serialbuf[index] & mask1; /* isolate value bits */ - temp = temp << 7; /* position value bits */ - value = (serialbuf[index+1] & mask2) | temp; - - // If we're resetting, set the rest positions to this value. - // Don't do this for the slider (channel 0), since it is not - // auto-centering. - if (reset_rest_pos) { - if (chan == 0) { - restval[chan] = 512; - } else { - restval[chan]= value; - } - } - - // Subtract the current value from the rest value to form the - // relative location, then scale to get into the range - // [-0.5 --- 0.5]. Clamp to make sure we are in this range. - channel[chan] = (restval[chan] - value)/JoyScale[chan]; - if (channel[chan] > 0.5) { channel[chan] = 0.5; } - if (channel[chan] < -0.5) { channel[chan] = -0.5; } - - // The slider should be inverted, to match the conventional - // reading. - if (chan == 0) {channel[chan] = -channel[chan];} - -#ifdef VERBOSE - printf("Joystick::parse: channel[%d] = %f\n", chan, channel[chan]); -#endif -} diff --git a/src/vrpn/vrpn_UNC_Joystick.h b/src/vrpn/vrpn_UNC_Joystick.h deleted file mode 100644 index 4332ae16cbc11ff26452014dc3240de24ff281b2..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_UNC_Joystick.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef VRPN_JOYSTICK -#define VRPN_JOYSTICK -#include "vrpn_Analog.h" // for vrpn_CHANNEL_MAX, etc -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API - -class VRPN_API vrpn_Connection; - -// This class runs the UNC custom serial joystick. It includes two -// buttons, a slider, and two 3-axis joysticks. It is based on a -// single-board computer. This driver is based on the px_sjoy.c -// code. - -class VRPN_API vrpn_Joystick :public vrpn_Serial_Analog, public vrpn_Button_Filter { -public: - vrpn_Joystick(char * name, vrpn_Connection * c, char * portname,int - baud, double); - - void mainloop(void); - -protected: - int get_report(); - void report(struct timeval current_time); - void reset(); - void parse(int, int reset_rest_pos = 0); -private: - unsigned char serialbuf[32]; - double restval[vrpn_CHANNEL_MAX]; // Initial value of each channel - unsigned long MAX_TIME_INTERVAL; -}; - - -#endif diff --git a/src/vrpn/vrpn_VPJoystick.C b/src/vrpn/vrpn_VPJoystick.C deleted file mode 100644 index cad82ea683bf4b8991b37b4dd168bdf322aa179d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_VPJoystick.C +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Button driver for Virtual Presence Joystick - * - * This joystick is a device built by Virtual Presence Ltd - * (http://www.vrweb.com ) consisting of an 8-button joystick handle - * containing an Ascension Flock-of-Birds sensor. - * - * This driver reads the button states as transmitted via the serial line. - * - * The buttons map as follows: - * - * 0 Bottom - * 1 Middle - * 2 Top - * 3 Trigger - * 4 Hat Up - * 5 Hat Right - * 6 Hat Down - * 7 Hat Left - * - * Use the Flock driver for position data. - * - * Written September 2003 by Matt Harvey <m.j.harvey@ucl.ac.uk> - * Derived from vrpn_ADBox.C -*/ - -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday -#include "vrpn_VPJoystick.h" - -class VRPN_API vrpn_Connection; - -#define STATE_SYNCHING (0) -#define STATE_READING (1) -#define STATE_RECEIVED (2) - -#define SYNC_BYTE (0xff) - -#define VP_BUTTON_1 4096 -#define VP_BUTTON_2 256 -#define VP_BUTTON_3 1 -#define VP_BUTTON_4 512 -#define VP_BUTTON_5 2048 -#define VP_BUTTON_6 2 -#define VP_BUTTON_7 1024 -#define VP_BUTTON_8 4 - -#define VP_HAT_UP VP_BUTTON_5 -#define VP_HAT_DOWN VP_BUTTON_7 -#define VP_HAT_LEFT VP_BUTTON_8 -#define VP_HAT_RIGHT VP_BUTTON_6 - -#define VP_TRIGGER VP_BUTTON_4 -#define VP_BUTTON_TOP VP_BUTTON_3 -#define VP_BUTTON_MIDDLE VP_BUTTON_2 -#define VP_BUTTON_BOTTOM VP_BUTTON_1 - - -#define VP_HAT_ALL ( VP_HAT_UP | VP_HAT_DOWN | VP_HAT_LEFT | VP_HAT_RIGHT ) -#define VP_BUTTON_ALL ( VP_TRIGGER | VP_BUTTON_TOP | VP_BUTTON_MIDDLE | VP_BUTTON_BOTTOM ) - -#include <stdio.h> // for fprintf, stderr - -vrpn_VPJoystick::vrpn_VPJoystick(char* name, vrpn_Connection *c, - const char *port, long baud) - : vrpn_Button_Filter(name, c), - serial_fd(0), state( STATE_SYNCHING ) -{ - int i; - - // Open the serial port - if ( (serial_fd=vrpn_open_commport(port, baud)) == -1) { - fprintf(stderr,"vrpn_VPJoystick: Cannot Open serial port\n"); - } - - // find out what time it is - needed? - vrpn_gettimeofday(×tamp, 0); - vrpn_Button::timestamp = timestamp; - - num_buttons = vrpn_VPJOY_NUM_BUTTONS; - - button_masks[0] = VP_BUTTON_1; - button_masks[1] = VP_BUTTON_2; - button_masks[2] = VP_BUTTON_3; - button_masks[3] = VP_BUTTON_4; - button_masks[4] = VP_BUTTON_5; - button_masks[5] = VP_BUTTON_6; - button_masks[6] = VP_BUTTON_7; - button_masks[7] = VP_BUTTON_8; - - for( i=0; i< num_buttons; i++ ) { - buttons[i] = lastbuttons[i] = VRPN_BUTTON_OFF; - } -} - - -vrpn_VPJoystick::~vrpn_VPJoystick() -{ - vrpn_close_commport(serial_fd); -} - -void vrpn_VPJoystick::mainloop() -{ - server_mainloop(); - - // XXX Why not have a timeout of zero? This would cause faster - // update rates for other devices in the same server. - struct timeval timeout = { 0,200000 }; - - if (serial_fd == -1) { - fprintf(stderr,"vrpn_VPJOystick::mainloop(): Bad serial port descriptor\n"); - return; - } - - if( state == STATE_SYNCHING ) { - - // Read bytes from the incoming stream until - // the synch byte is received - - message_buffer[0] = 0; - if( vrpn_read_available_characters( serial_fd, message_buffer, 1, &timeout ) ) { - if( message_buffer[0] == SYNC_BYTE ) { - state = STATE_READING; - bytes_read = 1; - } - } - - } - - // The state may just have been set to this, so don't do this in a switch - // or if-then-else statement because we may take another whole loop iteration - // before checking it again. - if( state == STATE_READING ) { - - // Read the remaining bytes of the packet - // - - bytes_read += vrpn_read_available_characters( serial_fd, message_buffer + bytes_read, vrpn_VPJOY_MESSAGE_LENGTH - bytes_read, &timeout ); - if( bytes_read == vrpn_VPJOY_MESSAGE_LENGTH ) { - state = STATE_RECEIVED; - } - - } - - // The state may just have been set to this, so don't do this in a switch - // or if-then-else statement because we may take another whole loop iteration - // before checking it again. - if( state == STATE_RECEIVED ) { - - // decode a received packet - - int i; - int flag = ((int) message_buffer[1])*256 + message_buffer[2]; - flag = (~flag) & ( VP_BUTTON_ALL | VP_HAT_ALL ); - - for( i = 0 ; i < num_buttons; i++ ) { - buttons[ i ] = static_cast<unsigned char>( ( ( flag & button_masks[i] ) == button_masks[i] ) ? VRPN_BUTTON_ON : VRPN_BUTTON_OFF ); - } - - vrpn_Button::report_changes(); - state = STATE_SYNCHING; - } -} diff --git a/src/vrpn/vrpn_VPJoystick.h b/src/vrpn/vrpn_VPJoystick.h deleted file mode 100644 index 4a6240ff5a77f5a732c5701c2071a5793e2962cc..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_VPJoystick.h +++ /dev/null @@ -1,35 +0,0 @@ - -#ifndef VRPN_VPJOYSTICK -#define VRPN_VPJOYSTICK 1 - -#include "vrpn_Button.h" // for VRPN_BUTTON_BUF_SIZE, etc -#include "vrpn_Configure.h" // for VRPN_API - -class VRPN_API vrpn_Connection; - - -#define vrpn_VPJOY_MESSAGE_LENGTH (4) -#define vrpn_VPJOY_NUM_BUTTONS (8) - -class VRPN_API vrpn_VPJoystick : public vrpn_Button_Filter { - - public: - vrpn_VPJoystick(char* name, vrpn_Connection *c, - const char *port="/dev/ttyS0", long baud=9600); - - ~vrpn_VPJoystick(); - - void mainloop(); - - private: - int serial_fd; - unsigned char buffer[VRPN_BUTTON_BUF_SIZE]; - - unsigned char message_buffer[ vrpn_VPJOY_MESSAGE_LENGTH ]; - unsigned int bytes_read; - unsigned int button_masks[ vrpn_VPJOY_NUM_BUTTONS ]; - - unsigned int state; -}; - -#endif // #ifndef VRPN_VPJOYSTICK diff --git a/src/vrpn/vrpn_Wanda.C b/src/vrpn/vrpn_Wanda.C deleted file mode 100644 index e23772e1eeed14c5ed43694ed33ab6cc29fda03e..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Wanda.C +++ /dev/null @@ -1,244 +0,0 @@ -#include <stdio.h> // for fprintf, stderr, NULL -#include <stdlib.h> // for getenv - -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday -#include "vrpn_Types.h" // for vrpn_float64, vrpn_int32 -#include "vrpn_Wanda.h" - -// This will cause the value to be set when the program is run, before -// main() is called. It will be the same for all vrpn_Wanda instances. -int vrpn_Wanda::dbug_wanda = getenv("DBUG_WANDA") ? 1 : 0; - -// Returns time in seconds in a double. -inline double the_time() -{ - struct timeval ts; - vrpn_gettimeofday(&ts, NULL); - return (double)(ts.tv_sec + ts.tv_usec/1e6); -} - -void -print_bits( char *buf, int num_bytes ) -{ - for(int i=0;i<num_bytes;i++) { - for(int b=7;b>=0;b--) - fprintf(stderr,"%d ", (((1 << b) & ((int)buf[i])) ? 1 : 0)); - } - fprintf(stderr,"\n"); -} - -void print_bits(unsigned char *buf, int n) { print_bits((char *)buf, n); } - -// -// Note: Wanda works at 1200 baud, 1 stopbit, CS7 (character size), and no parity -// -vrpn_Wanda::vrpn_Wanda(char * name, - vrpn_Connection * c, char * portname,int baud, - vrpn_float64 update_rate): - vrpn_Serial_Analog(name, c, portname, baud, 7), vrpn_Button_Filter(name, c), - bytesread(0), - first(1), - index(0) -{ - num_buttons = 3; // Wanda has 3 buttons - num_channel = 2; - for(int i=0; i<num_channel; i++) resetval[i] = -1; - if (update_rate != 0) - MAX_TIME_INTERVAL = (long)(1000000/update_rate); - else MAX_TIME_INTERVAL = -1; - status = vrpn_ANALOG_RESETTING; - - // reset buttons & channels - buttons[0] = buttons[1] = buttons[2] = 0; - channel[0] = channel[1] = 0; - - // Set the time - last_val_timestamp = the_time(); -} - -void -vrpn_Wanda::report_new_button_info() -{ - if (dbug_wanda) { - fprintf(stderr, "buttons = %d %d %d\n", int(buttons[0]), int(buttons[1]), int(buttons[2])); - } - vrpn_Button::report_changes(); // report any button event; -} - - -void -vrpn_Wanda::report_new_valuator_info() -{ - last_val_timestamp = the_time(); - if (dbug_wanda) { - fprintf(stderr, "vals = %lf %lf\n", channel[0], channel[1]); - } - - // Send the message on the connection; - if (vrpn_Analog::d_connection) { - char msgbuf[1000]; - vrpn_int32 len = vrpn_Analog::encode_to(msgbuf); -#ifdef VERBOSE - vrpn_Analog::print(); -#endif - if (vrpn_Analog::d_connection->pack_message(len, vrpn_Analog::timestamp, - channel_m_id, vrpn_Analog::d_sender_id, msgbuf, - vrpn_CONNECTION_LOW_LATENCY)) { - fprintf(stderr,"Tracker: cannot write message: tossing\n"); - } - } else { - fprintf(stderr,"Tracker Fastrak: No valid connection\n"); - } -} - -void vrpn_Wanda::mainloop(void) -{ - server_mainloop(); - - if (first) { - bytesread += vrpn_read_available_characters(serial_fd,buffer+bytesread,1024-bytesread); - - if (bytesread < 2) return; - - if (bytesread > 2) { - fprintf(stderr,"wanda huh? expected 2 characters on opening (got %d)\n", bytesread); - } else { - if (buffer[0] == 'M' && buffer[1] == '3') { - fprintf(stderr,"Read init message from wanda\n"); - } else { - fprintf(stderr,"vrpn_Wanda: ERROR, expected 'M3' from wanda...\n"); - } - } - bytesread = 0; - first = 0; - return; - } - - int new_button_info = 0; - int new_valuator_info = 0; - - // read available characters into end of buffer -// bytesread += vrpn_read_available_characters(serial_fd,buffer+bytesread,1024-bytesread); - int num_read = vrpn_read_available_characters(serial_fd,buffer+bytesread,1024-bytesread); -#if 1 - if (dbug_wanda) - if (num_read > 0) - print_bits(buffer+bytesread, num_read); -#endif - bytesread += num_read; - - // handling synching - while( index == 0 && bytesread > 0 && !(buffer[0] & (1<<6)) ) { - fprintf(stderr,"synching wanda\n"); - for(int i=0;i<bytesread-1;i++) - buffer[i] = buffer[i+1]; - - bytesread--; - } - -#if 1 - double curtime = the_time(); - // XXX - hack. why doesn't wanda send a record when the user - // XXX - isn't pushing the joystick ball? we weren't getting - // XXX - the last record -// if (bytesread == 3 && index == 3 && curtime - last_val_timestamp > 0.2) { - if (curtime - last_val_timestamp > 0.2) { - int new_valuator_info = 0; - - if (channel[0] != 0) { - channel[0] = 0; - new_valuator_info = 1; - } - if (channel[1] != 0) { - channel[1] = 0; - new_valuator_info = 1; - } - - if (new_valuator_info) { - if (dbug_wanda) { - fprintf(stderr, "timeout: %lf\n", curtime - last_val_timestamp); - } - report_new_valuator_info(); - } - } -#endif - - // process all data in buffer -#if 1 - if (dbug_wanda) - if (num_read > 0) - fprintf(stderr, "\t(bytesread = %d)\n", bytesread); -#endif - - while( bytesread >= 3 && index < bytesread ) { - // as soon as 3 bytes are available, report them... - if (index == 0 && bytesread >= 3) { - // update valuators & buttons #0 & #2 - - signed char x = static_cast<char>((buffer[1] | ((buffer[0]&3) << 6))); - signed char y = static_cast<char>((buffer[2] | ((buffer[0]&12) << 4))); - double xd = -((double)x) / 34.0; // XXX - what is max range? 34? - double yd = ((double)y) / 34.0; - - if (xd > 1.0) xd = 1.0; - if (xd <-1.0) xd =-1.0; - if (yd > 1.0) yd = 1.0; - if (yd <-1.0) yd =-1.0; - - if (channel[0] != xd) { - channel[0] = xd; - new_valuator_info = 1; - } - if (channel[1] != yd) { - channel[1] = yd; - new_valuator_info = 1; - } - - - // decode button data - int blue_val = (buffer[0] & (1<<4)) ? 1 : 0; // blue button - int red_val = (buffer[0] & (1<<5)) ? 1 : 0; // red button - - if (blue_val != buttons[0]) { - buttons[0] = static_cast<unsigned char>(blue_val); - new_button_info = 1; - } - if (red_val != buttons[2]) { - buttons[2] = static_cast<unsigned char>(red_val); - new_button_info = 1; - } - - - index = 3; - } - - // if index is at 3 & there are more bytes & the next byte - // isn't the start of a new record, then process button info - if (index == 3 && bytesread > 3 && !(buffer[3] & (1<<6))) { - int new_val = (buffer[3]) ? 1 : 0; // yellow button - - if (new_val != buttons[1]) { - buttons[1] = static_cast<unsigned char>(new_val); - new_button_info = 1; - } - - index = 4; - } - - if (new_button_info) - report_new_button_info(); - - if (new_valuator_info) - report_new_valuator_info(); - - // if next byte is start of new record, shift bytes - if (index == 4 || (index == 3 && bytesread > 3 && (buffer[3] & (1<<6)))) { - for(int i=index;i<bytesread;i++) - buffer[i - index] = buffer[i]; - bytesread -= index; - index = 0; - } - } -} diff --git a/src/vrpn/vrpn_Wanda.h b/src/vrpn/vrpn_Wanda.h deleted file mode 100644 index 000faae3d7b98a69e0ed5b5b2d37d7137fe3897d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Wanda.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef VRPN_WANDA -#define VRPN_WANDA -#include "vrpn_Analog.h" // for vrpn_CHANNEL_MAX, etc -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API - -class VRPN_API vrpn_Connection; - -// This is a driver for the Wanda device, which is an analog and -// button device. You can find out more at http://home.att.net/~glenmurray/ -// This driver was written at Brown University. - -class VRPN_API vrpn_Wanda :public vrpn_Serial_Analog, public vrpn_Button_Filter { -public: - vrpn_Wanda(char * name, vrpn_Connection * c, char * portname,int - baud, double); - - void mainloop(void); - -protected: - void report_new_button_info(); - void report_new_valuator_info(); - -private: - double last_val_timestamp; - double resetval[vrpn_CHANNEL_MAX]; - long MAX_TIME_INTERVAL; - int bytesread; - int first; - int index; - static int dbug_wanda; -}; - - -#endif diff --git a/src/vrpn/vrpn_WiiMote.C b/src/vrpn/vrpn_WiiMote.C deleted file mode 100644 index 0d0b3099024696fe06d70f01bece1b79141ed59e..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_WiiMote.C +++ /dev/null @@ -1,732 +0,0 @@ -// vrpn_WiiMote.C: Drive for the WiiMote, based on the WiiUse library. -// -// Russ Taylor, revised December 2008 - -#include "vrpn_WiiMote.h" - -#if defined(VRPN_USE_WIIUSE) -#include <stdio.h> -#include <stdlib.h> -#ifndef _WIN32 -#include <unistd.h> -#endif - -#include VRPN_WIIUSE_H - -#include <string> - -/// If we don't have this macro, we don't have any newer feature. -#ifndef WIIUSE_HAS_VERSION -#define WIIUSE_HAS_VERSION(major, minor, patch) false -#endif - -// Opaque class to hold WiiMote device information so we don't have -// to include wiimote.h in the vrpn_WiiMote.h file. -class vrpn_Wiimote_Device { - public: - vrpn_Wiimote_Device() : - device(NULL), - which(0), - useMS(0), - useIR(0), - reorderButtons(false), - found(false), - connected(false) {} - struct wiimote_t *device; - unsigned which; - unsigned useMS; - unsigned useIR; - bool reorderButtons; - bool found; - bool connected; - std::string bdaddr; -}; - -// Helper routines. -#ifndef min -#define min(x,y) ((x)<(y)?(x):(y)) -#endif - -#if defined (vrpn_THREADS_AVAILABLE) -struct vrpn_WiiMote_SharedData { - vrpn_WiiMote_SharedData(vrpn_WiiMote* wm) - : connectLock(), wmHandle(wm), msgLock(), stopFlag(false), running(false) - {} - vrpn_Semaphore connectLock; - vrpn_WiiMote *wmHandle; - vrpn_Semaphore msgLock; - bool stopFlag; - bool running; -}; -#endif - - -inline void vrpn_WiiMote::acquireMessageLock() { -#if defined (vrpn_THREADS_AVAILABLE) - // altering server state needs to be synced with server main loop! - sharedData->msgLock.p(); -#endif -} - -inline void vrpn_WiiMote::releaseMessageLock() { -#if defined (vrpn_THREADS_AVAILABLE) - sharedData->msgLock.v(); -#endif -} - -unsigned vrpn_WiiMote::map_button(unsigned btn) { - switch (btn) { - case 0: //WIIMOTE_BUTTON_TWO: - return 2; - case 1: //WIIMOTE_BUTTON_ONE: - return 1; - case 2: //WIIMOTE_BUTTON_B: - return 4; - case 3: //WIIMOTE_BUTTON_A: - return 3; - case 4: //WIIMOTE_BUTTON_MINUS: - return 5; - case 5: //WIIMOTE_BUTTON_ZACCEL_BIT6 - return 13; - case 6: //WIIMOTE_BUTTON_ZACCEL_BIT7 - return 14; - case 7: //WIIMOTE_BUTTON_HOME: - return 0; - case 8: //WIIMOTE_BUTTON_LEFT: - return 7; - case 9: //WIIMOTE_BUTTON_RIGHT: - return 8; - case 10: //WIIMOTE_BUTTON_DOWN: - return 9; - case 11: //WIIMOTE_BUTTON_UP: - return 10; - case 12: //WIIMOTE_BUTTON_PLUS: - return 6; - case 13: //WIIMOTE_BUTTON_ZACCEL_BIT4 - return 11; - case 14: //WIIMOTE_BUTTON_ZACCEL_BIT5 - return 12; - case 15: //WIIMOTE_BUTTON_UNKNOWN - return 15; - default: -#ifdef DEBUG - fprintf(stderr, "WiiMote: unhandled button %d\n", btn); -#endif - return btn; - } -} - -void vrpn_WiiMote::handle_event() { - //------------------------------------------------------------------------- - // Set the status of the buttons. The first 16 buttons come from - // the main contoller. If there is an expansion controller plugged in, - // then there is a second set of up to 16 buttons that can be read from it. - unsigned i; - for (i = 0; i < 16; i++) { - if (wiimote->reorderButtons) { - buttons[map_button(i)] = (wiimote->device->btns & (1 << i)) != 0; - } else { - buttons[i] = (wiimote->device->btns & (1 << i)) != 0; - } - } - - switch (wiimote->device->exp.type) { - case EXP_NONE: - // No expansion buttons to grab - break; - case EXP_NUNCHUK: - for (i = 0; i < 16; i++) { - buttons[16 + i] = (wiimote->device->exp.nunchuk.btns & (1 << i)) != 0; - } - break; - - case EXP_CLASSIC: - for (i = 0; i < 16; i++) { - buttons[32 + i] = (wiimote->device->exp.classic.btns & (1 << i)) != 0; - } - break; - - case EXP_GUITAR_HERO_3: - for (i = 0; i < 16; i++) { - buttons[48 + i] = (wiimote->device->exp.gh3.btns & (1 << i)) != 0; - } - break; -#ifdef EXP_WII_BOARD - case EXP_WII_BOARD: - // The balance board pretends to be its own wiimote, with only an "a" button - // Use to calibrate, in a perfect world.. - if (IS_PRESSED(wiimote->device, WIIMOTE_BUTTON_A)) { - wiiuse_set_wii_board_calib(wiimote->device); - } - break; -#endif - } - - //------------------------------------------------------------------------- - // Read the status of the analog values. There are six of them for the - // base unit and extras for expansion units. - channel[0] = wiimote->device->battery_level; - if (WIIUSE_USING_ACC(wiimote->device)) { - channel[1] = wiimote->device->gforce.x; - channel[2] = wiimote->device->gforce.y; - channel[3] = wiimote->device->gforce.z; - } - if (WIIUSE_USING_IR(wiimote->device)) { - unsigned dot; - for (dot = 0; dot < 4; dot++) { - if (wiimote->device->ir.dot[dot].visible) { - channel[4 + 3 * dot + 0] = wiimote->device->ir.dot[dot].rx; - channel[4 + 3 * dot + 1] = wiimote->device->ir.dot[dot].ry; - channel[4 + 3 * dot + 2] = wiimote->device->ir.dot[dot].size; - } else { - channel[4 + 3 * dot + 0] = -1; - channel[4 + 3 * dot + 1] = -1; - channel[4 + 3 * dot + 2] = -1; - } - } - } - - // See which secondary controller is installed and report - switch (wiimote->device->exp.type) { - case EXP_NONE: - // No expansion analogs to grab - break; - - case EXP_NUNCHUK: - channel[16 + 0] = wiimote->device->exp.nunchuk.gforce.x; - channel[16 + 1] = wiimote->device->exp.nunchuk.gforce.y; - channel[16 + 2] = wiimote->device->exp.nunchuk.gforce.z; - channel[16 + 3] = wiimote->device->exp.nunchuk.js.ang; - channel[16 + 4] = wiimote->device->exp.nunchuk.js.mag; -#if WIIUSE_HAS_VERSION(0,14,2) - channel[16 + 5] = wiimote->device->exp.nunchuk.js.x; - channel[16 + 6] = wiimote->device->exp.nunchuk.js.y; -#endif - break; - - case EXP_CLASSIC: - channel[32 + 0] = wiimote->device->exp.classic.l_shoulder; - channel[32 + 1] = wiimote->device->exp.classic.r_shoulder; - channel[32 + 2] = wiimote->device->exp.classic.ljs.ang; - channel[32 + 3] = wiimote->device->exp.classic.ljs.mag; - channel[32 + 4] = wiimote->device->exp.classic.rjs.ang; - channel[32 + 5] = wiimote->device->exp.classic.rjs.mag; -#if WIIUSE_HAS_VERSION(0,14,2) - channel[32 + 6] = wiimote->device->exp.classic.ljs.x; - channel[32 + 7] = wiimote->device->exp.classic.ljs.y; - channel[32 + 8] = wiimote->device->exp.classic.rjs.x; - channel[32 + 9] = wiimote->device->exp.classic.rjs.y; -#endif - break; - - - case EXP_GUITAR_HERO_3: - channel[48 + 0] = wiimote->device->exp.gh3.whammy_bar; - channel[48 + 1] = wiimote->device->exp.gh3.js.ang; - channel[48 + 2] = wiimote->device->exp.gh3.js.mag; -#if WIIUSE_HAS_VERSION(0,14,2) - channel[48 + 3] = wiimote->device->exp.gh3.js.x; - channel[48 + 4] = wiimote->device->exp.gh3.js.y; -#endif - break; - -#ifdef EXP_WII_BOARD - case EXP_WII_BOARD: - { - struct wii_board_t* wb = (wii_board_t*)&wiimote->device->exp.wb; - float total = wb->tl + wb->tr + wb->bl + wb->br; - float x = ((wb->tr + wb->br) / total) * 2 - 1; - float y = ((wb->tl + wb->tr) / total) * 2 - 1; - //printf("Got a wii board report: %f kg, @ (%f, %f)\n", total, x, y); - //printf("Got a wii board report: %f, %f, %f, %f\n", wb->tl, wb->tr, wb->bl, wb->br); - channel[64 + 0] = wb->tl; - channel[64 + 1] = wb->tr; - channel[64 + 2] = wb->bl; - channel[64 + 3] = wb->br; - channel[64 + 4] = total; - channel[64 + 5] = x; - channel[64 + 6] = y; - break; - } -#endif - default: - struct timeval now; - vrpn_gettimeofday(&now, NULL); - char msg[1024]; - sprintf(msg, "Unknown Wii Remote expansion type: device->exp.type = %d", wiimote->device->exp.type); - send_text_message(msg, now, vrpn_TEXT_ERROR); - } - - //------------------------------------------------------------------------- - // Read the state of the Infrared sensors. -} - -void vrpn_WiiMote::connect_wiimote(int timeout) { - struct timeval now; - char msg[1024]; - - wiimote->device = NULL; - unsigned num_available; - num_available = wiiuse_find(available_wiimotes, VRPN_WIIUSE_MAX_WIIMOTES, timeout); -#ifdef __linux - if (!wiimote->bdaddr.empty()) { - for (int i = 0; i < VRPN_WIIUSE_MAX_WIIMOTES; ++i) { - std::string current(available_wiimotes[i]->bdaddr_str); - if (current == wiimote->bdaddr) { - wiimote->device = available_wiimotes[i]; - break; - } else if (!current.empty()) { - acquireMessageLock(); - vrpn_gettimeofday(&now, NULL); - sprintf(msg, "Wiimote found, but it's not the one we want: '%s' isn't '%s'\n", available_wiimotes[i]->bdaddr_str, wiimote->bdaddr.c_str()); - send_text_message(msg, now); - releaseMessageLock(); - } - } - } -#endif - if (wiimote->bdaddr.empty()) { - wiimote->device = wiiuse_get_by_id(available_wiimotes, VRPN_WIIUSE_MAX_WIIMOTES, wiimote->which); - } - if (! wiimote->device) { - acquireMessageLock(); - vrpn_gettimeofday(&now, NULL); - sprintf(msg, "Could not open remote %d (%d found)", wiimote->which, num_available); - send_text_message(msg, now, vrpn_TEXT_ERROR); - releaseMessageLock(); - wiimote->found = false; - return; - } else { - wiimote->found = true; - } - - wiimote->connected = (wiiuse_connect(&(wiimote->device), 1) != 0); - if (wiimote->connected) { - acquireMessageLock(); - vrpn_gettimeofday(&now, NULL); - sprintf(msg, "Connected to remote %d", wiimote->which); - send_text_message(msg, now); - releaseMessageLock(); - - // rumble shortly to acknowledge connection: - wiiuse_rumble(wiimote->device, 1); - vrpn_SleepMsecs(200); - initialize_wiimote_state(); - } -#ifdef DEBUG - else { - acquireMessageLock(); - vrpn_gettimeofday(&now, NULL); - sprintf(msg, "No connection to remote %d", wiimote->which); - send_text_message(msg, now, vrpn_TEXT_ERROR); - releaseMessageLock(); - } -#endif -} - -void vrpn_WiiMote::initialize_wiimote_state(void) { - if (!wiimote->device || !wiimote->found || !wiimote->connected) { - return; - } - - // Turn on a light so we know which device we are. - switch (wiimote->which) { - case 1: - wiiuse_set_leds(wiimote->device, WIIMOTE_LED_1); - break; - case 2: - wiiuse_set_leds(wiimote->device, WIIMOTE_LED_2); - break; - case 3: - wiiuse_set_leds(wiimote->device, WIIMOTE_LED_3); - break; - case 4: - wiiuse_set_leds(wiimote->device, WIIMOTE_LED_4); - break; - default: - struct timeval now; - vrpn_gettimeofday(&now, NULL); - char msg[1024]; - sprintf(msg, "Too-large remote %d (1-4 available)", wiimote->which); - send_text_message(msg, now, vrpn_TEXT_ERROR); - break; - } - - // Set motion sensing on or off - wiiuse_motion_sensing(wiimote->device, wiimote->useMS); - - // Turn off rumbling - wiiuse_rumble(wiimote->device, 0); - - // Set IR sensing on or off - wiiuse_set_ir(wiimote->device, wiimote->useIR); -} - -// Device constructor. -// Parameters: -// - name: VRPN name to assign to this server -// - c: VRPN connection this device should be attached to -vrpn_WiiMote::vrpn_WiiMote(const char *name, vrpn_Connection *c, unsigned which, unsigned useMS, unsigned useIR, unsigned reorderButtons, const char *bdaddr): - vrpn_Analog(name, c), - vrpn_Button_Filter(name, c), - vrpn_Analog_Output(name, c), -#if defined (vrpn_THREADS_AVAILABLE) - waitingForConnection(true), - sharedData(0), - connectThread(0), -#endif - wiimote(new vrpn_Wiimote_Device) -{ -#ifndef vrpn_THREADS_AVAILABLE - last_reconnect_attempt.tv_sec = 0; - last_reconnect_attempt.tv_usec = 0; -#endif - - int i; - - vrpn_Analog::num_channel = min(96, vrpn_CHANNEL_MAX); - for (i = 0; i < vrpn_Analog::num_channel; i++) { - channel[i] = 0; - } - - // There are bits for up to 16 buttons on the main remote, and for - // up to 16 more on an expansion pack. - vrpn_Button::num_buttons = min(64, vrpn_BUTTON_MAX_BUTTONS); - for (i = 0; i < vrpn_Button::num_buttons; i++) { - buttons[i] = 0; - } - - // Two channels: channel 0 is rumble, channel 1 is IR sensitivity. - vrpn_Analog_Output::o_num_channel = 2; - - // Register a handler for the request channel change message - if (register_autodeleted_handler(request_m_id, - handle_request_message, this, d_sender_id)) { - FAIL("vrpn_WiiMote: can't register change channel request handler"); - return; - } - - // Register a handler for the request channels change message - if (register_autodeleted_handler(request_channels_m_id, - handle_request_channels_message, this, d_sender_id)) { - FAIL("vrpn_WiiMote: can't register change channels request handler"); - return; - } - - // Register a handler for the no-one's-connected-now message - if (register_autodeleted_handler( - d_connection->register_message_type(vrpn_dropped_last_connection), - handle_last_connection_dropped, this)) { - FAIL("Can't register self-destruct handler"); - return; - } - - // Get a list of available devices and select the one we want. - // Look for up to VRPN_WIIUSE_MAX_WIIMOTES motes. Timeout in 5 seconds if one not found. - wiimote->which = which > 0 ? which : 1; - wiimote->useMS = useMS; - wiimote->useIR = useIR; - wiimote->reorderButtons = (reorderButtons != 0); - if (bdaddr) { - wiimote->bdaddr = std::string(bdaddr); - } -#ifndef __linux - if (!wiimote->bdaddr.empty()) { - fprintf(stderr, "vrpn_WiiMote: Specifying the bluetooth address of the desired wiimote is only supported on Linux right now\n"); - wiimote->bdaddr.clear(); - } -#endif - - available_wiimotes = wiiuse_init(VRPN_WIIUSE_MAX_WIIMOTES); -#if !defined(DEBUG) && defined(WIIUSE_HAS_OUTPUT_REDIRECTION) - /* disable debug and info messages from wiiuse itself */ - wiiuse_set_output(LOGLEVEL_DEBUG, 0); - wiiuse_set_output(LOGLEVEL_INFO, 0); -#endif -#if defined (vrpn_THREADS_AVAILABLE) - // Pack the sharedData into another ThreadData - // (this is an API flaw in vrpn_Thread) - vrpn_ThreadData connectThreadData; - sharedData = new vrpn_WiiMote_SharedData(this); - connectThreadData.pvUD = sharedData; - // take ownership of msgLock: - acquireMessageLock(); - // initialize connectThread: - connectThread = new vrpn_Thread(&vrpn_WiiMote::connectThreadFunc, connectThreadData); - connectThread->go(); -#else - connect_wiimote(3); -#endif -} - -// Device destructor -vrpn_WiiMote::~vrpn_WiiMote() { -#if defined (vrpn_THREADS_AVAILABLE) - // stop connectThread - sharedData->stopFlag = true; - // Release the lock blocking the connection thread. - if (!waitingForConnection) { - sharedData->connectLock.v(); - } - while (connectThread->running()) { - // Let the connect thread send messages - - releaseMessageLock(); - vrpn_SleepMsecs(10); - acquireMessageLock(); - } - - delete connectThread; - delete sharedData; -#endif - // Close the device and delete - - if (wiimote->connected) { - wiiuse_disconnect(wiimote->device); - } - delete wiimote; -} - -// VRPN main loop -// Poll the device and let the VRPN change notifications fire -void vrpn_WiiMote::mainloop() { - - vrpn_gettimeofday(&_timestamp, NULL); - -#if defined (vrpn_THREADS_AVAILABLE) - if (waitingForConnection) { - // did connectThread establish a connection? - if (sharedData->connectLock.condP()) { - // yay, we can use wiimote again! - waitingForConnection = false; - } else { - // allow connectThread to send its messages: - releaseMessageLock(); - vrpn_SleepMsecs(10); - acquireMessageLock(); - // still waiting - // do housekeeping and return: - server_mainloop(); - // no need to update timestamp? - // no need to call report_changes? - return; - } - } -#endif - if (! isValid()) { -#if defined (vrpn_THREADS_AVAILABLE) - waitingForConnection = true; - // release semaphore, so connectThread gets active again: - sharedData->connectLock.v(); -#else // no thread support: we have to block the server: - // try reconnect every second: - timeval diff = vrpn_TimevalDiff(_timestamp, last_reconnect_attempt); - if (diff.tv_sec >= 1) { - last_reconnect_attempt = _timestamp; - //reconnect - // timeout=1 means that we block the vrpn server for a whole second! - connect_wiimote(1); - } -#endif - } - - server_mainloop(); - - // Poll to get the status of the device. When an event happens, call - // the appropriate handler to fill in our data structures. - if (wiimote->connected && wiiuse_poll(&(wiimote->device), 1)) { - switch (wiimote->device->event) { - case WIIUSE_EVENT: // A generic event - handle_event(); - break; - - case WIIUSE_STATUS: // A status event - // Nothing to do here, we're polling what we need to know in mainloop. - break; - - case WIIUSE_DISCONNECT: - case WIIUSE_UNEXPECTED_DISCONNECT: - wiimote->connected = false; - wiiuse_disconnect(wiimote->device); - send_text_message("Disconnected", _timestamp, vrpn_TEXT_ERROR); -#ifndef vrpn_THREADS_AVAILABLE - last_reconnect_attempt = _timestamp; -#endif - break; - - case WIIUSE_READ_DATA: - // Data we requested was returned. Take a look at wiimote->device->read_req - // for the info. - break; - - case WIIUSE_NUNCHUK_INSERTED: - send_text_message("Nunchuck inserted", _timestamp); - break; - - case WIIUSE_CLASSIC_CTRL_INSERTED: - send_text_message("Classic controller inserted", _timestamp); - break; - - case WIIUSE_GUITAR_HERO_3_CTRL_INSERTED: - send_text_message("Guitar Hero 3 controller inserted", _timestamp); - break; - -#ifdef EXP_WII_BOARD - case WIIUSE_WII_BOARD_CTRL_INSERTED: - send_text_message("Wii Balance Board controller inserted/detected", _timestamp); - break; -#endif - - case WIIUSE_NUNCHUK_REMOVED: - case WIIUSE_CLASSIC_CTRL_REMOVED: - case WIIUSE_GUITAR_HERO_3_CTRL_REMOVED: - send_text_message("An expansion controller was removed", _timestamp, - vrpn_TEXT_WARNING); - break; -#ifdef EXP_WII_BOARD - case WIIUSE_WII_BOARD_CTRL_REMOVED: - send_text_message("Wii Balance Board controller removed/disconnected", _timestamp, - vrpn_TEXT_WARNING); - break; -#endif - - default: - send_text_message("unknown event", _timestamp); - break; - } - } - - // Send any changes out over the connection. - vrpn_gettimeofday(&_timestamp, NULL); - report_changes(); -} - -bool vrpn_WiiMote::isValid() const { - return (wiimote->found) && (wiimote->connected); -} - -void vrpn_WiiMote::report(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_WiiMote::report_changes(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -/* static */ -int vrpn_WiiMote::handle_request_message(void *userdata, - vrpn_HANDLERPARAM p) { - const char* bufptr = p.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_float64 value; - vrpn_WiiMote* me = (vrpn_WiiMote*)userdata; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - vrpn_unbuffer(&bufptr, &value); - - // Set the appropriate value, if the channel number is in the - // range of the ones we have. - if ((chan_num < 0) || (chan_num >= me->o_num_channel)) { - fprintf(stderr, "vrpn_WiiMote::handle_request_message(): Index out of bounds\n"); - char msg[1024]; - sprintf(msg, "Error: (handle_request_message): channel %d is not active. Squelching.", chan_num); - me->send_text_message(msg, p.msg_time, vrpn_TEXT_ERROR); - return 0; - } - me->o_channel[chan_num] = value; - switch (chan_num) { - case 0: - { - if (value >= 0.5) { - wiiuse_rumble(me->wiimote->device, 1); - } else { - wiiuse_rumble(me->wiimote->device, 0); - } - break; - } - case 1: - { - int level = static_cast<int>(value); - wiiuse_set_ir_sensitivity(me->wiimote->device, level); - break; - } - } - return 0; -} - -/* static */ -int vrpn_WiiMote::handle_request_channels_message(void* userdata, - vrpn_HANDLERPARAM p) { - const char* bufptr = p.buffer; - vrpn_int32 num; - vrpn_int32 pad; - vrpn_WiiMote* me = (vrpn_WiiMote*)userdata; - - // Read the values from the buffer - vrpn_unbuffer(&bufptr, &num); - vrpn_unbuffer(&bufptr, &pad); - if (num > me->o_num_channel) { - char msg[1024]; - sprintf(msg, "Error: (handle_request_channels_message): channels above %d not active; " - "bad request up to channel %d. Squelching.", me->o_num_channel, num); - me->send_text_message(msg, p.msg_time, vrpn_TEXT_ERROR); - num = me->o_num_channel; - } - if (num < 0) { - char msg[1024]; - sprintf(msg, "Error: (handle_request_channels_message): invalid channel %d. Squelching.", num); - me->send_text_message(msg, p.msg_time, vrpn_TEXT_ERROR); - return 0; - } - - // Pull only channel 0 from the buffer, no matter how many values we received. - vrpn_float64 value; - vrpn_unbuffer(&bufptr, &value); - if (value >= 0.5) { - wiiuse_rumble(me->wiimote->device, 1); - } else { - wiiuse_rumble(me->wiimote->device, 0); - } - - return 0; -} - -int VRPN_CALLBACK vrpn_WiiMote::handle_last_connection_dropped(void *selfPtr, vrpn_HANDLERPARAM data) { - //XXX Turn off any rumble. - return 0; -} - -#if defined (vrpn_THREADS_AVAILABLE) -/* static */ -void vrpn_WiiMote::connectThreadFunc(vrpn_ThreadData &threadData) { - vrpn_WiiMote_SharedData *sharedData = static_cast<vrpn_WiiMote_SharedData *>(threadData.pvUD); - if (! sharedData || ! sharedData->wmHandle) { - return; - } - while (true) { - // wait for semaphore - sharedData->connectLock.p(); - if (sharedData->stopFlag) { - break; - } - sharedData->wmHandle->connect_wiimote(3); - // release semaphore - sharedData->connectLock.v(); - // make sure that main thread gets semaphore: - vrpn_SleepMsecs(100); - } -} -#endif - -#endif // VRPN_USE_WIIUSE diff --git a/src/vrpn/vrpn_WiiMote.h b/src/vrpn/vrpn_WiiMote.h deleted file mode 100644 index 6d5fb086233e45f85b9be6e3ed46c03932b71c4f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_WiiMote.h +++ /dev/null @@ -1,212 +0,0 @@ -// vrpn_WiiMote.h: Drive for the WiiMote, based on the WiiUse library. -// Tested on Windows. Is supposed to also run on Linux. -// -// Russ Taylor, revised December 2008 - -#ifndef VRPN_WIIMOTE_H -#define VRPN_WIIMOTE_H - -#include "vrpn_Configure.h" // IWYU pragma: keep - -#if defined(VRPN_USE_WIIUSE) - -#include "vrpn_Analog.h" -#include "vrpn_Analog_Output.h" -#include "vrpn_Button.h" -#include "vrpn_Connection.h" -#include "vrpn_Shared.h" - -// maximum number of wiimotes connected to the system -#define VRPN_WIIUSE_MAX_WIIMOTES 4 - -// Opaque class to keep us from having to include wiiuse.h in user files. -// This is defined in vrpn_WiiMote.C. -class vrpn_Wiimote_Device; -struct wiimote_t; -#ifdef vrpn_THREADS_AVAILABLE -struct vrpn_WiiMote_SharedData; -#endif - -// The buttons are as read from the bit-fields of the primary controller (bits 0-15) -// and then a second set for any extended controller (nunchuck bits 16-31), -// (classic controller bits 32-47), (guitar hero 3 bits 48-63). -// -// If you enable "reorderButtons" by setting it to 1, the buttons on the Wiimote -// itself are re-ordered to be reported as follows: -// button[0] = Home -// button[1] = "1" -// button[2] = "2" -// button[3] = "A" -// button[4] = "B" -// button[5] = "-" -// button[6] = "+" -// button[7] = direction pad: left -// button[8] = direction pad: right -// button[9] = direction pad: down -// button[10] = direction pad: up -// button[11] = WIIMOTE_BUTTON_ZACCEL_BIT4 -// button[12] = WIIMOTE_BUTTON_ZACCEL_BIT5 -// button[13] = WIIMOTE_BUTTON_ZACCEL_BIT6 -// button[14] = WIIMOTE_BUTTON_ZACCEL_BIT7 -// button[15] = WIIMOTE_BUTTON_UNKNOWN -// -// The Analogs are in an even more random order, both from the primary controller: -// channel[0] = battery level (0-1) -// channel[1] = gravity X vector calculation (1 = Earth gravity) -// channel[2] = gravity Y vector calculation (1 = Earth gravity) -// channel[3] = gravity Z vector calculation (1 = Earth gravity) -// channel[4] = X of first sensor spot (0-1023, -1 if not seen) -// channel[5] = Y of first sensor spot (0-767, -1 if not seen) -// channel[6] = size of first sensor spot (0-15, -1 if not seen) -// channel[7] = X of second sensor spot (0-1023, -1 if not seen) -// channel[9] = Y of second sensor spot (0-767, -1 if not seen) -// channel[9] = size of second sensor spot (0-15, -1 if not seen) -// channel[10] = X of third sensor spot (0-1023, -1 if not seen) -// channel[11] = Y of third sensor spot (0-767, -1 if not seen) -// channel[12] = size of third sensor spot (0-15, -1 if not seen) -// channel[13] = X of fourth sensor spot (0-1023, -1 if not seen) -// channel[14] = Y of fourth sensor spot (0-767, -1 if not seen) -// channel[15] = size of fourth sensor spot (0-15, -1 if not seen) -// and on the secondary controllers (skipping values to leave room for expansion) -// (with the joystick x and y values only available with WiiUse 0.14.2 or newer) -// channel[16] = nunchuck gravity X vector -// channel[17] = nunchuck gravity Y vector -// channel[18] = nunchuck gravity Z vector -// channel[19] = nunchuck joystick angle -// channel[20] = nunchuck joystick magnitude -// channel[21] = nunchuck joystick X -// channel[22] = nunchuck joystick Y -// -// channel[32] = classic L button -// channel[33] = classic R button -// channel[34] = classic L joystick angle -// channel[35] = classic L joystick magnitude -// channel[36] = classic R joystick angle -// channel[37] = classic R joystick magnitude -// channel[38] = classic L joystick X -// channel[39] = classic L joystick Y -// channel[40] = classic R joystick X -// channel[41] = classic R joystick Y -// -// channel[48] = guitar hero whammy bar -// channel[49] = guitar hero joystick angle -// channel[50] = guitar hero joystick magnitude -// channel[51] = guitar hero joystick X -// channel[52] = guitar hero joystick Y -// -// Balance board data: (requires WiiUse 0.13 or newer, preferably 0.14 or newer) -// channel[64] = Balance board: top-left sensor, kg -// channel[65] = Balance board: top-right sensor, kg -// channel[66] = Balance board: bottom-left sensor, kg -// channel[67] = Balance board: bottom-right sensor, kg -// channel[68] = Balance board: total mass, kg -// channel[69] = Balance board: center of gravity x, in [-1, 1] -// channel[70] = Balance board: center of gravity y, in [-1, 1] -// -// The Analog_Output 0 is a hack to enable control over the rumble, inherited from -// the RumblePack driver. This should eventually move to a binary output of -// some kind (and so should the lights). For now, if you set output 0 to a -// value greater than or equal to 0.5, it will turn on the rumble; if less, then -// it will disable it. -// Channel 1 sets the IR sensitivity: accepts 1, 2, 3, 4, 5 (clipping to this -// range if given other values), same as the Wii system's sensitivity settings. - -// XXX It would be great to use the IR and accelerometer data along with -// a description of the size of the official Wii sensor bar to compute -// a pose and report this as a tracker report. This could be done as -// a second device that reads the values or (better) as a built-in that -// exports a vrpn_Tracker report. Best would be a Kalman filter that -// takes all of these as inputs and produces an optimal estimate. This -// needs to report in meters and we'll have to define an origin (middle -// of the bar?) and a coordinate system (X along bar's most-horizontal -// axis, Y vertical to gravity, Z perpendicular to these?). - -// XXX It would be great to have a vrpn_Sound device that could play through -// the speaker on the WiiMote. - -class VRPN_API vrpn_WiiMote: public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Analog_Output { - public: - // If there is more than one WiiMote on the machine, the zero-indexed 'which' - // parameter tells which one we want to open. - vrpn_WiiMote(const char *name, vrpn_Connection *c = NULL, unsigned which = 0 - , unsigned useMS = 1, unsigned useIR = 1, unsigned reorderButtons = 0, - const char *bdaddr = NULL); - ~vrpn_WiiMote(); - - virtual void mainloop(); - - bool isValid() const; - - protected: - // Handle the rumble-magnitude setting (channel 0). - static int VRPN_CALLBACK handle_request_message(void *userdata, - vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK handle_request_channels_message(void* userdata, - vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK handle_last_connection_dropped(void *selfPtr, vrpn_HANDLERPARAM data); - - private: - /// @name Message lock functions - /// Used to reduce the amount of in-line ifdefs: these are no-ops - /// if threading support isn't available - /// @{ - void acquireMessageLock(); - void releaseMessageLock(); - /// @} -#ifdef vrpn_THREADS_AVAILABLE - /// function to (re)connect to wiimote in background: - static void connectThreadFunc(vrpn_ThreadData &threadData); - /// mainloop is waiting for the connectThread to reestablish the connection: - bool waitingForConnection; - /// the struct holding the shared data pointer and the mutex: - vrpn_WiiMote_SharedData *sharedData; - /// thread for asynchronous reconnection function: - vrpn_Thread *connectThread; -#else - struct timeval last_reconnect_attempt -#endif - /// The WiiMote to use - vrpn_Wiimote_Device *wiimote; - /// a list of available wiimotes - wiimote_t **available_wiimotes; - - /// Error-handling procedure (spit out a message and die) - inline void FAIL(const char *msg) { - struct timeval now; - vrpn_gettimeofday(&now, NULL); - send_text_message(msg, now, vrpn_TEXT_ERROR); - d_connection = NULL; - } - - /** @brief send report iff changed - - @note class_of_service is only applied to vrpn_Analog values, - not vrpn_Button - */ - void report_changes(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - /** @brief send report whether or not changed - - @note class_of_service is only applied to vrpn_Analog values, - not vrpn_Button - */ - void report(vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - /// Time stamp of last read event - struct timeval _timestamp; - - /// Helper routine to initialize state of the WiiMote. - void initialize_wiimote_state(void); - - /// Helper functions to handle events - void handle_event(void); - - /// Helper function to connect a wiimote - void connect_wiimote(int timeout); - - /// Helper function that defines a mapping for button ids: - unsigned map_button(unsigned btn); -}; - -#endif // VRPN_USE_WIIUSE - -#endif // VRPN_WIIMOTE_H diff --git a/src/vrpn/vrpn_XInputGamepad.C b/src/vrpn/vrpn_XInputGamepad.C deleted file mode 100644 index a700d0c865c95c8a36716815e8542181a72d80ab..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_XInputGamepad.C +++ /dev/null @@ -1,258 +0,0 @@ -// vrpn_XInputGamepad.C: Gamepad driver for devices using XInput -// such as (read: primarily) the Microsoft Xbox 360 controller. - -#include "vrpn_XInputGamepad.h" - -#if defined(_WIN32) && defined(VRPN_USE_WINDOWS_XINPUT) -#include <xinput.h> - -vrpn_XInputGamepad::vrpn_XInputGamepad(const char *name, vrpn_Connection *c, unsigned int controllerIndex): - vrpn_Analog(name, c), - vrpn_Button_Filter(name, c), - vrpn_Analog_Output(name, c), - _controllerIndex(controllerIndex) -{ - vrpn_Analog::num_channel = 7; - vrpn_Button::num_buttons = 10; - vrpn_Analog_Output::o_num_channel = 2; - - _motorSpeed[0] = 0; - _motorSpeed[1] = 0; - - if (register_autodeleted_handler(request_m_id, - handle_request_message, this, d_sender_id)) { - fprintf(stderr, "vrpn_XInputGamepad: Can't register request-single handler\n"); - return; - } - - if (register_autodeleted_handler(request_channels_m_id, - handle_request_channels_message, this, d_sender_id)) { - fprintf(stderr, "vrpn_XInputGamepad: Can't register request-multiple handler\n"); - return; - } - - if (register_autodeleted_handler( - d_connection->register_message_type(vrpn_dropped_last_connection), - handle_last_connection_dropped, this)) { - fprintf(stderr, "vrpn_XInputGamepad: Can't register connections-dropped handler\n"); - return; - } -} - -vrpn_XInputGamepad::~vrpn_XInputGamepad() { -} - -void vrpn_XInputGamepad::mainloop() { - XINPUT_STATE state; - DWORD rv; - - server_mainloop(); - if ((rv = XInputGetState(_controllerIndex, &state)) != ERROR_SUCCESS) { - char errMsg[256]; - struct timeval now; - - if (rv == ERROR_DEVICE_NOT_CONNECTED) - sprintf(errMsg, "XInput device %u not connected", _controllerIndex); - else - sprintf(errMsg, "XInput device %u returned Windows error code %u", - _controllerIndex, rv); - - vrpn_gettimeofday(&now, NULL); - send_text_message(errMsg, now, vrpn_TEXT_ERROR); - return; - } - - // Set device state in VRPN_Analog - channel[0] = normalize_axis(state.Gamepad.sThumbLX, XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE); - channel[1] = normalize_axis(state.Gamepad.sThumbLY, XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE); - channel[2] = normalize_axis(state.Gamepad.sThumbRX, XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE); - channel[3] = normalize_axis(state.Gamepad.sThumbRY, XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE); - channel[4] = normalize_dpad(state.Gamepad.wButtons); - channel[5] = normalize_trigger(state.Gamepad.bLeftTrigger); - channel[6] = normalize_trigger(state.Gamepad.bRightTrigger); - - // Set device state in VRPN_Button - // Buttons are listed in DirectInput ordering - buttons[0] = (state.Gamepad.wButtons & XINPUT_GAMEPAD_A) != 0; - buttons[1] = (state.Gamepad.wButtons & XINPUT_GAMEPAD_B) != 0; - buttons[2] = (state.Gamepad.wButtons & XINPUT_GAMEPAD_X) != 0; - buttons[3] = (state.Gamepad.wButtons & XINPUT_GAMEPAD_Y) != 0; - buttons[4] = (state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER) != 0; - buttons[5] = (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER) != 0; - buttons[6] = (state.Gamepad.wButtons & XINPUT_GAMEPAD_BACK) != 0; - buttons[7] = (state.Gamepad.wButtons & XINPUT_GAMEPAD_START) != 0; - buttons[8] = (state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) != 0; - buttons[9] = (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) != 0; - - vrpn_gettimeofday(&_timestamp, NULL); - report_changes(); -} - -vrpn_float64 vrpn_XInputGamepad::normalize_dpad(WORD buttons) const { - int x = 0; - int y = 0; - - if (buttons & XINPUT_GAMEPAD_DPAD_RIGHT) - x += 1; - if (buttons & XINPUT_GAMEPAD_DPAD_LEFT) - x -= 1; - if (buttons & XINPUT_GAMEPAD_DPAD_UP) - y += 1; - if (buttons & XINPUT_GAMEPAD_DPAD_DOWN) - y -= 1; - - size_t index = (x + 1) * 3 + (y + 1); - vrpn_float64 angles[] = {225, 270, 315, 180, -1, 0, 135, 90, 45}; - return angles[index]; -} - - -vrpn_float64 vrpn_XInputGamepad::normalize_axis(SHORT axis, SHORT deadzone) const { - // Filter out areas near the center - if (axis > -deadzone && axis < deadzone) - return 0; - - // Note ranges are asymmetric (-32768 to 32767) - return axis / ((axis < 0) ? 32768.0 : 32767.0); -} - -vrpn_float64 vrpn_XInputGamepad::normalize_trigger(BYTE trigger) const { - // Filter out low-intensity signals - if (trigger < XINPUT_GAMEPAD_TRIGGER_THRESHOLD) - return 0; - - return trigger / 255.0; -} - -void vrpn_XInputGamepad::update_vibration() { - XINPUT_VIBRATION vibration; - - vibration.wLeftMotorSpeed = _motorSpeed[0]; - vibration.wRightMotorSpeed = _motorSpeed[1]; - - DWORD rv = XInputSetState(_controllerIndex, &vibration); - if (rv != ERROR_SUCCESS) { - char errMsg[256]; - struct timeval now; - - if (rv == ERROR_DEVICE_NOT_CONNECTED) - sprintf(errMsg, "XInput device %u not connected", _controllerIndex); - else - sprintf(errMsg, "XInput device %u returned Windows error code %u", - _controllerIndex, rv); - - vrpn_gettimeofday(&now, NULL); - send_text_message(errMsg, now, vrpn_TEXT_ERROR); - return; - } -} - -void vrpn_XInputGamepad::report(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_XInputGamepad::report_changes(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -// Static callback -int VRPN_CALLBACK vrpn_XInputGamepad::handle_request_message(void *selfPtr, - vrpn_HANDLERPARAM data) -{ - const char *bufptr = data.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_float64 value; - vrpn_XInputGamepad *me = (vrpn_XInputGamepad *) selfPtr; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - vrpn_unbuffer(&bufptr, &value); - - // Set the appropriate value, if the channel number is in the - // range of the ones we have. - if ( (chan_num < 0) || (chan_num >= me->o_num_channel) ) { - fprintf(stderr,"vrpn_Analog_Output_Server::handle_request_message(): Index out of bounds\n"); - char msg[1024]; - sprintf( msg, "Error: (handle_request_message): channel %d is not active. Squelching.", chan_num ); - me->send_text_message( msg, data.msg_time, vrpn_TEXT_ERROR ); - return 0; - } - me->o_channel[chan_num] = value; - - float magnitude = static_cast<float>(value); - magnitude = (magnitude < 0) ? 0 : (magnitude > 1) ? 1 : magnitude; - - me->_motorSpeed[chan_num] = static_cast<WORD>(magnitude * 65535); - me->update_vibration(); - - return 0; -} - -// Static callback -int VRPN_CALLBACK vrpn_XInputGamepad::handle_request_channels_message(void *selfPtr, - vrpn_HANDLERPARAM data) -{ - const char *bufptr = data.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_XInputGamepad *me = (vrpn_XInputGamepad *) selfPtr; - int i; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - - if (chan_num > me->o_num_channel) { - char msg[1024]; - sprintf( msg, "Error: (handle_request_channels_message): channels above %d not active; " - "bad request up to channel %d. Squelching.", me->o_num_channel, chan_num ); - me->send_text_message( msg, data.msg_time, vrpn_TEXT_ERROR ); - chan_num = me->o_num_channel; - } - if (chan_num < 0) { - char msg[1024]; - sprintf( msg, "Error: (handle_request_channels_message): invalid channel %d. Squelching.", chan_num ); - me->send_text_message( msg, data.msg_time, vrpn_TEXT_ERROR ); - return 0; - } - for (i = 0; i < chan_num; i++) { - vrpn_float64 value; - vrpn_unbuffer(&bufptr, &value); - - float magnitude = static_cast<float>(value); - magnitude = (magnitude < 0) ? 0 : (magnitude > 1) ? 1 : magnitude; - - me->_motorSpeed[chan_num] = static_cast<WORD>(magnitude * 65535); - } - - me->update_vibration(); - - return 0; -} - -// Static callback -int VRPN_CALLBACK vrpn_XInputGamepad::handle_last_connection_dropped(void *selfPtr, - vrpn_HANDLERPARAM data) -{ - vrpn_XInputGamepad *me = static_cast<vrpn_XInputGamepad *>(selfPtr); - - // Kill force feedback if no one is connected - me->_motorSpeed[0] = 0; - me->_motorSpeed[1] = 0; - me->update_vibration(); - - return 0; -} - -#endif // _WIN32 && VRPN_USE_DIRECTINPUT - diff --git a/src/vrpn/vrpn_XInputGamepad.h b/src/vrpn/vrpn_XInputGamepad.h deleted file mode 100644 index 88dc6db19c75714bef23f636657a9c9eb1a4c9b5..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_XInputGamepad.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef VRPN_XINPUTGAMEPAD_H -#define VRPN_XINPUTGAMEPAD_H - -#include "vrpn_Configure.h" // IWYU pragma: keep - -#if defined(_WIN32) && defined(VRPN_USE_WINDOWS_XINPUT) - -#include "vrpn_Analog.h" -#include "vrpn_Analog_Output.h" -#include "vrpn_Button.h" -#include "vrpn_Connection.h" - -// This implements an XInput gamepad (read: Xbox 360 controller), which has -// analog outputs and button outputs but also enables the user to set a -// rumble magnitude using an Analog_Output (channel 0 controls the left motor, -// channel 1 controls the right motor). - -class VRPN_API vrpn_XInputGamepad: public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Analog_Output { -public: - vrpn_XInputGamepad(const char *name, vrpn_Connection *c = NULL, unsigned int controllerIndex = 0); - ~vrpn_XInputGamepad(); - - virtual void mainloop(); - -protected: - // Handle requests to change rumble magnitude - static int VRPN_CALLBACK handle_request_message(void *selfPtr, vrpn_HANDLERPARAM data); - static int VRPN_CALLBACK handle_request_channels_message(void *selfPtr, vrpn_HANDLERPARAM data); - static int VRPN_CALLBACK handle_last_connection_dropped(void *selfPtr, vrpn_HANDLERPARAM data); - - // send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button - - void update_vibration(); - - // These functions may be overridden to disable the default filtering - virtual vrpn_float64 normalize_axis(SHORT axis, SHORT deadzone) const; - virtual vrpn_float64 normalize_trigger(BYTE trigger) const; - virtual vrpn_float64 normalize_dpad(WORD buttons) const; - -private: - unsigned int _controllerIndex; - timeval _timestamp; - - WORD _motorSpeed[2]; -}; - -#endif // _WIN32 && VRPN_USE_DIRECTINPUT -#endif // VRPN_XINPUTGAMEPAD_H - diff --git a/src/vrpn/vrpn_Xkeys.C b/src/vrpn/vrpn_Xkeys.C deleted file mode 100644 index 75004322164cea93c1b25678ec41035b3475109d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Xkeys.C +++ /dev/null @@ -1,627 +0,0 @@ -// vrpn_Xkeys.C: VRPN driver for P.I. Engineering's X-Keys devices - -#include <stdio.h> // for fprintf, stderr, NULL -#include <string.h> // for memset - -#include "vrpn_Xkeys.h" - -VRPN_SUPPRESS_EMPTY_OBJECT_WARNING() - -#if defined(VRPN_USE_HID) - -// USB vendor and product IDs for the models we support -static const vrpn_uint16 XKEYS_VENDOR = 0x05F3; -static const vrpn_uint16 XKEYS_DESKTOP = 0x0281; -static const vrpn_uint16 XKEYS_JOG_AND_SHUTTLE = 0x0241; -static const vrpn_uint16 XKEYS_PRO = 0x0291; -static const vrpn_uint16 XKEYS_JOYSTICK = 0x0251; -static const vrpn_uint16 XKEYS_XK3 = 0x042C; - -vrpn_Xkeys::vrpn_Xkeys(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c, bool toggle_light) - : _filter(filter) - , vrpn_HidInterface(filter) - , vrpn_BaseClass(name, c) - , _toggle_light(toggle_light) -{ - init_hid(); -} - -vrpn_Xkeys::~vrpn_Xkeys() -{ - if (_toggle_light) { - // Indicate we're no longer waiting for a connection by - // turning off both the red and green LEDs. - vrpn_uint8 outputs[9] = {0}; - outputs[8] = 0; - send_data(9, outputs); - - } - delete _filter; -} - -void vrpn_Xkeys::init_hid() { - // Get notifications when clients connect and disconnect - register_autodeleted_handler(d_connection->register_message_type(vrpn_dropped_last_connection), on_last_disconnect, this); - register_autodeleted_handler(d_connection->register_message_type(vrpn_got_connection), on_connect, this); - - // Indicate we're waiting for a connection by turning on the red LED - if (_toggle_light) { - vrpn_uint8 outputs[9] = {0}; - outputs[8] = 128; - send_data(9, outputs); - } -} - -void vrpn_Xkeys::on_data_received(size_t bytes, vrpn_uint8 *buffer) -{ - decodePacket(bytes, buffer); -} - -int vrpn_Xkeys::on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Xkeys *me = static_cast<vrpn_Xkeys *>(thisPtr); - if (me->_toggle_light) { - // Set light to red to indicate we have no active connections - vrpn_uint8 outputs[9] = {0}; - outputs[8] = 128; - me->send_data(9, outputs); - } - return 0; -} - -int vrpn_Xkeys::on_connect(void *thisPtr, vrpn_HANDLERPARAM /*p*/) -{ - vrpn_Xkeys *me = static_cast<vrpn_Xkeys *>(thisPtr); - - if (me->_toggle_light) { - // Set light to green to indicate we have an active connection - vrpn_uint8 outputs[9] = {0}; - outputs[8] = 64; - me->send_data(9, outputs); - } - return 0; -} - -vrpn_Xkeys_Desktop::vrpn_Xkeys_Desktop(const char *name, vrpn_Connection *c) - : vrpn_Xkeys(_filter = new vrpn_HidProductAcceptor(XKEYS_VENDOR, XKEYS_DESKTOP), name, c) - , vrpn_Button_Filter(name, c) -{ - // 21 buttons (don't forget about button 0) - vrpn_Button::num_buttons = 21; - - // Initialize the state of all the buttons - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); -} - -void vrpn_Xkeys_Desktop::mainloop() -{ - update(); - server_mainloop(); - vrpn_gettimeofday(&_timestamp, NULL); - report_changes(); - - vrpn_Button::server_mainloop(); -} - -void vrpn_Xkeys_Desktop::report(void) { - vrpn_Button::timestamp = _timestamp; - vrpn_Button::report_changes(); -} - -void vrpn_Xkeys_Desktop::report_changes(void) { - vrpn_Button::timestamp = _timestamp; - vrpn_Button::report_changes(); -} - -void vrpn_Xkeys_Desktop::decodePacket(size_t bytes, vrpn_uint8 *buffer) { - // Decode all full reports, each of which is 11 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - for (size_t i = 0; i < bytes / 11; i++) { - vrpn_uint8 *report = buffer + (i * 11); - - if (!(report[10] & 0x08)) { - // Apparently we got a corrupted report; skip this one. - fprintf(stderr, "vrpn_Xkeys_Desktop: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - continue; - } - - // Decode the "programming switch" - buttons[0] = (report[10] & 0x10) != 0; - - // Decode the other buttons into column-major order - for (int btn = 0; btn < 20; btn++) { - vrpn_uint8 *offset, mask; - - offset = report + btn / 5; - mask = static_cast<vrpn_uint8>(1 << (btn % 5)); - - buttons[btn + 1] = (*offset & mask) != 0; - } - } -} - -vrpn_Xkeys_Jog_And_Shuttle::vrpn_Xkeys_Jog_And_Shuttle(const char *name, vrpn_Connection *c) - : vrpn_Xkeys(_filter = new vrpn_HidProductAcceptor(XKEYS_VENDOR, XKEYS_JOG_AND_SHUTTLE), name, c) - , vrpn_Button_Filter(name, c) - , vrpn_Analog(name, c) - , vrpn_Dial(name, c) -{ - vrpn_Analog::num_channel = 2; - vrpn_Dial::num_dials = 1; - vrpn_Button::num_buttons = 59; // Don't forget button 0 - - // Initialize the state of all the analogs, buttons, and dials - _lastDial = 0; - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); -} - -void vrpn_Xkeys_Jog_And_Shuttle::mainloop() -{ - update(); - server_mainloop(); - vrpn_gettimeofday(&_timestamp, NULL); - report_changes(); - - vrpn_Analog::server_mainloop(); - vrpn_Button::server_mainloop(); - vrpn_Dial::server_mainloop(); -} - -void vrpn_Xkeys_Jog_And_Shuttle::report(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - vrpn_Dial::timestamp = _timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); - vrpn_Dial::report(); -} - -void vrpn_Xkeys_Jog_And_Shuttle::report_changes(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - vrpn_Dial::timestamp = _timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); - vrpn_Dial::report_changes(); -} - -void vrpn_Xkeys_Jog_And_Shuttle::decodePacket(size_t bytes, vrpn_uint8 *buffer) -{ - // Decode all full reports. - // Full reports for all of the pro devices are 15 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver, leaving 14 bytes. - // Also, it appears as though the - // remaining 14-byte command is split into two, one 8-byte that is sent - // first and then a 6-byte that is sent later. So we need to check the - // length of the packet to see which it is and then parse it appropriately. - if (bytes == 8) { // The first 8 bytes of a report (happens on Linux) - - // Report jog dial as analog and dial - // Report shuttle knob as analog - - // Double cast on channel 0 ensures negative values stay negative - channel[0] = static_cast<float>(static_cast<signed char>(buffer[0])) / 7.0; - channel[1] = static_cast<float>(buffer[1]); - - // Do the unsigned/signed conversion at the last minute so the - // signed values work properly. - dials[0] = static_cast<vrpn_int8>(buffer[1] - _lastDial) / 256.0; - - // Store the current dial position for the next delta - _lastDial = buffer[1]; - - // Decode the other buttons in column-major order. We skip the - // first three bytes, which record the joystick value or the - // shuttle/jog value (depending on device). - // This results in some gaps when using a shuttle or joystick model, - // but there really aren't any internally consistent numbering schemes. - // The first 35 buttons are in this report, the remaining 23 in the next. - for (int btn = 0; btn < 35; btn++) { - vrpn_uint8 *offset, mask; - - offset = buffer + btn / 7 + 3; - mask = static_cast<vrpn_uint8>(1 << (btn % 7)); - - buttons[btn + 1] = (*offset & mask) != 0; - } - - } else if (bytes == 6) { // The last 6 bytes of a report (happens on Linux) - - if (!(buffer[5] & 0x08)) { - // Garbled report; skip it - fprintf(stderr, "vrpn_Xkeys: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - return; - } - - // Decode the "programming switch" - buttons[0] = (buffer[5] & 0x10) != 0; - - // Decode the other buttons in column-major order. - // This results in some gaps when using a shuttle or joystick model, - // but there really aren't any internally consistent numbering schemes. - // The last 23 buttons are in this report, the remaining 23 in the next. - for (int btn = 35; btn < 58; btn++) { - vrpn_uint8 *offset, mask; - int local_btn = btn - 35; - - offset = buffer + local_btn / 7; - mask = static_cast<vrpn_uint8>(1 << (local_btn % 7)); - - buttons[btn + 1] = (*offset & mask) != 0; - } - - } else if (bytes == 14) { // A full report in one swoop (happens on Windows) - // Full reports for all of the pro devices are 15 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver, leaving 14 bytes. - size_t i; - for (i = 0; i < bytes / 14; i++) { - vrpn_uint8 *report = buffer + (i * 14); - - if (!(report[13] & 0x08)) { - // Garbled report; skip it - fprintf(stderr, "vrpn_Xkeys: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - continue; - } - - // Decode the "programming switch" - buttons[0] = (report[13] & 0x10) != 0; - - // Decode the other buttons in column-major order - // This results in some gaps when using a shuttle or joystick model, - // but there really aren't any internally consistent numbering schemes. - for (int btn = 0; btn < 58; btn++) { - vrpn_uint8 *offset, mask; - - offset = report + btn / 7 + 3; - mask = static_cast<vrpn_uint8>(1 << (btn % 7)); - - buttons[btn + 1] = (*offset & mask) != 0; - } - - // Report jog dial as analog and dial - // Report shuttle knob as analog - - // Double cast on channel 0 ensures negative values stay negative - channel[0] = static_cast<float>(static_cast<signed char>(report[0])) / 7.0; - channel[1] = static_cast<float>(report[1]); - - // Do the unsigned/signed conversion at the last minute so the - // signed values work properly. - dials[0] = static_cast<vrpn_int8>(report[1] - _lastDial) / 256.0; - - // Store the current dial position for the next delta - _lastDial = report[1]; - - } - } else { - fprintf(stderr,"vrpn_Xkeys_Jog_And_Shuttle::decodePacket(): Unrecognized packet length (%u)\n", static_cast<unsigned>(bytes)); - return; - } -} - -vrpn_Xkeys_Joystick::vrpn_Xkeys_Joystick(const char *name, vrpn_Connection *c) - : vrpn_Xkeys(_filter = new vrpn_HidProductAcceptor(XKEYS_VENDOR, XKEYS_JOYSTICK), name, c) - , vrpn_Button_Filter(name, c) - , vrpn_Analog(name, c) -{ - vrpn_Analog::num_channel = 2; - vrpn_Button::num_buttons = 59; // Don't forget button 0 - - // Initialize the state of all the analogs and buttons - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - memset(channel, 0, sizeof(channel)); - memset(last, 0, sizeof(last)); -} - -void vrpn_Xkeys_Joystick::mainloop() -{ - update(); - server_mainloop(); - vrpn_gettimeofday(&_timestamp, NULL); - report_changes(); - - vrpn_Analog::server_mainloop(); - vrpn_Button::server_mainloop(); -} - -void vrpn_Xkeys_Joystick::report(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_Xkeys_Joystick::report_changes(vrpn_uint32 class_of_service) { - vrpn_Analog::timestamp = _timestamp; - vrpn_Button::timestamp = _timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_Xkeys_Joystick::decodePacket(size_t bytes, vrpn_uint8 *buffer) -{ - // Decode all full reports. - // Full reports for all of the pro devices are 15 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver, leaving 14 bytes. - // Also, it appears as though the - // remaining 14-byte command is split into two, one 8-byte that is sent - // first and then a 6-byte that is sent later. So we need to check the - // length of the packet to see which it is and then parse it appropriately. - if (bytes == 8) { // The first 8 bytes of a report - - // Report joystick axes as analogs - channel[0] = (static_cast<float>(buffer[0]) - 128) / 128.0; - channel[1] = (static_cast<float>(buffer[1]) - 128) / 128.0; - channel[2] = (static_cast<float>(buffer[2]) - 128) / 128.0; - - // Decode the other buttons in column-major order. We skip the - // first three bytes, which record the joystick value or the - // shuttle/jog value (depending on device). - // This results in some gaps when using a shuttle or joystick model, - // but there really aren't any internally consistent numbering schemes. - // The first 35 buttons are in this report, the remaining 23 in the next. - for (int btn = 0; btn < 35; btn++) { - vrpn_uint8 *offset, mask; - - offset = buffer + btn / 7 + 3; - mask = static_cast<vrpn_uint8>(1 << (btn % 7)); - - buttons[btn + 1] = (*offset & mask) != 0; - } - - } else if (bytes == 6) { // The last 6 bytes of a report - - if (!(buffer[5] & 0x08)) { - // Garbled report; skip it - fprintf(stderr, "vrpn_Xkeys: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - return; - } - - // Decode the "programming switch" - buttons[0] = (buffer[5] & 0x10) != 0; - - // Decode the other buttons in column-major order. - // This results in some gaps when using a shuttle or joystick model, - // but there really aren't any internally consistent numbering schemes. - // The last 23 buttons are in this report, the remaining 23 in the next. - for (int btn = 35; btn < 58; btn++) { - vrpn_uint8 *offset, mask; - int local_btn = btn - 35; - - offset = buffer + local_btn / 7; - mask = static_cast<vrpn_uint8>(1 << (local_btn % 7)); - - buttons[btn + 1] = (*offset & mask) != 0; - } - - } else if (bytes == 14) { // A full report in one swoop (happens on Windows) - // Full reports for all of the pro devices are 15 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver, leaving 14 bytes. - size_t i; - for (i = 0; i < bytes / 14; i++) { - vrpn_uint8 *report = buffer + (i * 14); - - if (!(report[13] & 0x08)) { - // Garbled report; skip it - fprintf(stderr, "vrpn_Xkeys: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - continue; - } - - // Decode the "programming switch" - buttons[0] = (report[13] & 0x10) != 0; - - // Decode the other buttons in column-major order - // This results in some gaps when using a shuttle or joystick model, - // but there really aren't any internally consistent numbering schemes. - for (int btn = 0; btn < 58; btn++) { - vrpn_uint8 *offset, mask; - - offset = report + btn / 7 + 3; - mask = static_cast<vrpn_uint8>(1 << (btn % 7)); - - buttons[btn + 1] = (*offset & mask) != 0; - } - - // Report joystick axes as analogs - channel[0] = (static_cast<float>(report[0]) - 128) / 128.0; - channel[1] = (static_cast<float>(report[1]) - 128) / 128.0; - channel[2] = (static_cast<float>(report[2]) - 128) / 128.0; - } - } else { - fprintf(stderr,"vrpn_Xkeys_Joystick::decodePacket(): Unrecognized packet length (%u)\n", static_cast<unsigned>(bytes)); - return; - } -} - -vrpn_Xkeys_Pro::vrpn_Xkeys_Pro(const char *name, vrpn_Connection *c) - : vrpn_Xkeys(_filter = new vrpn_HidProductAcceptor(XKEYS_VENDOR, XKEYS_PRO), name, c) - , vrpn_Button_Filter(name, c) -{ - vrpn_Button::num_buttons = 59; // Don't forget button 0 - - // Initialize the state of all the buttons - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); -} - -void vrpn_Xkeys_Pro::mainloop() -{ - update(); - server_mainloop(); - vrpn_gettimeofday(&_timestamp, NULL); - report_changes(); - - vrpn_Button::server_mainloop(); -} - -void vrpn_Xkeys_Pro::report(void) { - vrpn_Button::timestamp = _timestamp; - vrpn_Button::report_changes(); -} - -void vrpn_Xkeys_Pro::report_changes(void) { - vrpn_Button::timestamp = _timestamp; - vrpn_Button::report_changes(); -} - -void vrpn_Xkeys_Pro::decodePacket(size_t bytes, vrpn_uint8 *buffer) -{ - // Decode all full reports. - // Full reports for all of the pro devices are 15 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver, leaving 14 bytes. - // Also, it appears as though the - // remaining 14-byte command is split into two, one 8-byte that is sent - // first and then a 6-byte that is sent later. So we need to check the - // length of the packet to see which it is and then parse it appropriately. - if (bytes == 8) { // The first 8 bytes of a report - - // Decode the other buttons in column-major order. We skip the - // first three bytes, which record the joystick value or the - // shuttle/jog value (depending on device). - // This results in some gaps when using a shuttle or joystick model, - // but there really aren't any internally consistent numbering schemes. - // The first 35 buttons are in this report, the remaining 23 in the next. - for (int btn = 0; btn < 35; btn++) { - vrpn_uint8 *offset, mask; - - offset = buffer + btn / 7 + 3; - mask = static_cast<vrpn_uint8>(1 << (btn % 7)); - - buttons[btn + 1] = (*offset & mask) != 0; - } - - } else if (bytes == 6) { // The last 6 bytes of a report - - if (!(buffer[5] & 0x08)) { - // Garbled report; skip it - fprintf(stderr, "vrpn_Xkeys: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - return; - } - - // Decode the "programming switch" - buttons[0] = (buffer[5] & 0x10) != 0; - - // Decode the other buttons in column-major order. - // This results in some gaps when using a shuttle or joystick model, - // but there really aren't any internally consistent numbering schemes. - // The last 23 buttons are in this report, the remaining 23 in the next. - for (int btn = 35; btn < 58; btn++) { - vrpn_uint8 *offset, mask; - int local_btn = btn - 35; - - offset = buffer + local_btn / 7; - mask = static_cast<vrpn_uint8>(1 << (local_btn % 7)); - - buttons[btn + 1] = (*offset & mask) != 0; - } - - } else if (bytes == 14) { // A full report in one swoop (happens on Windows) - // Full reports for all of the pro devices are 15 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver, leaving 14 bytes. - size_t i; - // Decode all full reports. - // Full reports for all of the pro devices are 15 bytes long. - for (i = 0; i < bytes / 14; i++) { - vrpn_uint8 *report = buffer + (i * 14); - - if (!(report[13] & 0x08)) { - // Garbled report; skip it - fprintf(stderr, "vrpn_Xkeys: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - continue; - } - - // Decode the "programming switch" - buttons[0] = (report[13] & 0x10) != 0; - - // Decode the other buttons in column-major order - // This results in some gaps when using a shuttle or joystick model, - // but there really aren't any internally consistent numbering schemes. - for (int btn = 0; btn < 58; btn++) { - vrpn_uint8 *offset, mask; - - offset = buffer + btn / 7 + 3; - mask = static_cast<vrpn_uint8>(1 << (btn % 7)); - - buttons[btn + 1] = (*offset & mask) != 0; - } - } - } else { - fprintf(stderr,"vrpn_Xkeys_Pro::decodePacket(): Unrecognized packet length (%u)\n", static_cast<unsigned>(bytes)); - return; - } -} - -vrpn_Xkeys_XK3::vrpn_Xkeys_XK3(const char *name, vrpn_Connection *c) - : vrpn_Xkeys(_filter = new vrpn_HidProductAcceptor(XKEYS_VENDOR, XKEYS_XK3), name, c, false) - , vrpn_Button_Filter(name, c) -{ - // 3 buttons - vrpn_Button::num_buttons = 3; - - // Initialize the state of all the buttons - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); -} - -void vrpn_Xkeys_XK3::mainloop() -{ - update(); - server_mainloop(); - vrpn_gettimeofday(&_timestamp, NULL); - report_changes(); - - vrpn_Button::server_mainloop(); -} - -void vrpn_Xkeys_XK3::report(void) { - vrpn_Button::timestamp = _timestamp; - vrpn_Button::report_changes(); -} - -void vrpn_Xkeys_XK3::report_changes(void) { - vrpn_Button::timestamp = _timestamp; - vrpn_Button::report_changes(); -} - -void vrpn_Xkeys_XK3::decodePacket(size_t bytes, vrpn_uint8 *buffer) { - // Decode all full reports, each of which is 32 bytes long. - // Because there is only one type of report, the initial "0" report-type - // byte is removed by the HIDAPI driver. - for (size_t i = 0; i < bytes / 32; i++) { - vrpn_uint8 *report = buffer + (i * 32); - - // The first two bytes of the report always seem to be - // 0x00 0x01. - if ((report[0] != 0x00) || (report[1] != 0x01) ) { - // Apparently we got a corrupted report; skip this one. - fprintf(stderr, "vrpn_Xkeys_XK3: Found a corrupted report; # total bytes = %u\n", static_cast<unsigned>(bytes)); - continue; - } - - // The left button is bit 1 (value 0x02) in the third byte - // The middle button is bit 2 (value 0x04) in the third byte - // The right button is bit 3 (value 0x08) in the third byte - buttons[0] = (report[2] & 0x02) != 0; - buttons[1] = (report[2] & 0x04) != 0; - buttons[2] = (report[2] & 0x08) != 0; - } -} - -// End of VRPN_USE_HID -#endif diff --git a/src/vrpn/vrpn_Xkeys.h b/src/vrpn/vrpn_Xkeys.h deleted file mode 100644 index f73416859adebe8df36e7e396a2319de704dfa1b..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Xkeys.h +++ /dev/null @@ -1,155 +0,0 @@ -#pragma once - -#include <stddef.h> // for size_t - -#include "vrpn_Analog.h" // for vrpn_Analog -#include "vrpn_BaseClass.h" // for vrpn_BaseClass -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_USE_HID -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Dial.h" // for vrpn_Dial -#include "vrpn_HumanInterface.h" // for vrpn_HidAcceptor (ptr only), etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint8, vrpn_uint32 - -#if defined(VRPN_USE_HID) - -// Device drivers for the X-Keys USB line of products from P.I. Engineering -// Currently supported: X-Keys Desktop, X-Keys Jog & Shuttle Pro. -// Theoretically working but untested: X-Keys Professional, X-Keys Joystick Pro. -// -// Exposes three major VRPN device classes: Button, Analog, Dial (as appropriate). -// All models expose Buttons for the keys on the device. -// Button 0 is the programming switch; it is set if the switch is in the "red" position. -// -// For the X-Keys Jog & Shuttle: -// Analog channel 0 is the shuttle position (-1 to 1). There are 15 levels. -// Analog channel 1 is the dial orientation (0 to 255). -// Dial channel 0 sends deltas on the dial. -// -// For the X-Keys Joystick Pro: -// Analog channel 0 is the joystick X axis (-1 to 1). -// Analog channel 1 is the joystick Y axis (-1 to 1). -// Analog channel 2 is the joystick RZ axis (-1 to 1). - -class vrpn_Xkeys: public vrpn_BaseClass, protected vrpn_HidInterface { -public: - vrpn_Xkeys(vrpn_HidAcceptor *filter, const char *name, vrpn_Connection *c = 0, bool toggle_light = true); - virtual ~vrpn_Xkeys(); - - virtual void mainloop() = 0; - -protected: - // Set up message handlers, etc. - void init_hid(); - void on_data_received(size_t bytes, vrpn_uint8 *buffer); - - static int VRPN_CALLBACK on_connect(void *thisPtr, vrpn_HANDLERPARAM p); - static int VRPN_CALLBACK on_last_disconnect(void *thisPtr, vrpn_HANDLERPARAM p); - - virtual void decodePacket(size_t bytes, vrpn_uint8 *buffer) = 0; - struct timeval _timestamp; - vrpn_HidAcceptor *_filter; - bool _toggle_light; - - // No actual types to register, derived classes will be buttons, analogs, and/or dials - int register_types(void) { return 0; } -}; - -class vrpn_Xkeys_Desktop: protected vrpn_Xkeys, public vrpn_Button_Filter { -public: - vrpn_Xkeys_Desktop(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Xkeys_Desktop() {}; - - virtual void mainloop(); - -protected: - // Send report iff changed - void report_changes (void); - // Send report whether or not changed - void report (void); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); -}; - -class vrpn_Xkeys_Pro: protected vrpn_Xkeys, public vrpn_Button_Filter { -public: - vrpn_Xkeys_Pro(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Xkeys_Pro() {}; - - virtual void mainloop(); - -protected: - // Send report iff changed - void report_changes (void); - // Send report whether or not changed - void report (void); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); -}; - -class vrpn_Xkeys_Joystick: protected vrpn_Xkeys, public vrpn_Analog, public vrpn_Button_Filter { -public: - vrpn_Xkeys_Joystick(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Xkeys_Joystick() {}; - - virtual void mainloop(); - -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button or vrpn_Dial - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); -}; - -class vrpn_Xkeys_Jog_And_Shuttle: protected vrpn_Xkeys, public vrpn_Analog, public vrpn_Button_Filter, public vrpn_Dial { -public: - vrpn_Xkeys_Jog_And_Shuttle(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Xkeys_Jog_And_Shuttle() {}; - - virtual void mainloop(); - -protected: - // Send report iff changed - void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // Send report whether or not changed - void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button or vrpn_Dial - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); - - // Previous dial value, used to determine delta to send when it changes. - vrpn_uint8 _lastDial; -}; - -class vrpn_Xkeys_XK3: protected vrpn_Xkeys, public vrpn_Button_Filter { -public: - vrpn_Xkeys_XK3(const char *name, vrpn_Connection *c = 0); - virtual ~vrpn_Xkeys_XK3() {}; - - virtual void mainloop(); - -protected: - // Send report iff changed - void report_changes (void); - // Send report whether or not changed - void report (void); - - void decodePacket(size_t bytes, vrpn_uint8 *buffer); -}; - -// end of VRPN_USE_HID -#else -class VRPN_API vrpn_Xkeys; -class VRPN_API vrpn_Xkeys_Desktop; -class VRPN_API vrpn_Xkeys_Pro; -class VRPN_API vrpn_Xkeys_Joystick; -class VRPN_API vrpn_Xkeys_Jog_And_Shuttle; -class VRPN_API vrpn_Xkeys_XK3; -#endif - diff --git a/src/vrpn/vrpn_YEI_3Space.C b/src/vrpn/vrpn_YEI_3Space.C deleted file mode 100644 index 8c1e906c6dc9b58fa95dce32616a7079a779d01c..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_YEI_3Space.C +++ /dev/null @@ -1,1218 +0,0 @@ -// This is a driver for the YEI 3Space serial-port devices. - -#include <stdio.h> // for sprintf, printf - -#include "vrpn_YEI_3Space.h" -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR -#include "quat.h" - -//#define VERBOSE - -// Defines the modes in which the device can find itself. -#define STATUS_NOT_INITIALIZED (-2) // Not yet initialized -#define STATUS_RESETTING (-1) // Resetting the device -#define STATUS_READING (0) // Looking for the a report - -// The wired USB connection can stream up to 256 bytes, but the wireless -// can stream a maximum of 96 bytes per sensor. -static const int REPORT_LENGTH = 16 + 16 + 12 + 36 + 4 + 4 + 1; -#define MAX_TIME_INTERVAL (2000000) // max time between reports (usec) - - -/****************************************************************************** - * NAME : vrpn_YEI_3Space::vrpn_YEI_3Space - * ROLE : This creates a vrpn_YEI_3Space and sets it to reset mode. - * ARGUMENTS : - * RETURN : - ******************************************************************************/ -vrpn_YEI_3Space::vrpn_YEI_3Space (const char * p_name - , vrpn_Connection * p_c - , bool calibrate_gyros_on_setup - , bool tare_on_setup - , double frames_per_second - , double red_LED_color - , double green_LED_color - , double blue_LED_color - , int LED_mode - , const char *reset_commands[]) - : vrpn_Tracker_Server (p_name, p_c, 2) - , vrpn_Analog (p_name, p_c) - , vrpn_Button_Filter(p_name, p_c) - , d_frames_per_second(frames_per_second) -{ - // Count the reset commands and allocate an array to store them in. - const char **ptr = reset_commands; - d_reset_commands = NULL; - d_reset_command_count = 0; - if (ptr != NULL) while ((*ptr) != NULL) { - d_reset_command_count++; - ptr++; - } - if (d_reset_command_count > 0) { - d_reset_commands = new char *[d_reset_command_count]; - if (d_reset_commands == NULL) { - fprintf(stderr,"vrpn_YEI_3Space::vrpn_YEI_3Space(): Out of memory, ignoring reset commands\n"); - d_reset_command_count = 0; - } - } - - // Copy any reset commands. - ptr = reset_commands; - for (int i = 0; i < d_reset_command_count; i++) { - d_reset_commands[i] = new char[strlen(reset_commands[i]) + 1]; - if (d_reset_commands[i] == NULL) { - fprintf(stderr,"vrpn_YEI_3Space::vrpn_YEI_3Space(): Out of memory, giving up\n"); - return; - } - strcpy(d_reset_commands[i], reset_commands[i]); - } - - // Set the parameters in the parent classes - vrpn_Analog::num_channel = 11; - - // Initialize the state of all the buttons - vrpn_Button::num_buttons = 8; - memset(buttons, 0, sizeof(buttons)); - memset(lastbuttons, 0, sizeof(lastbuttons)); - - // We're constructed, but not yet initialized. - d_status = STATUS_NOT_INITIALIZED; -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space::~vrpn_YEI_3Space - * ROLE : This destroys a vrpn_YEI_3Space and frees its memory. - * ARGUMENTS : - * RETURN : - ******************************************************************************/ -vrpn_YEI_3Space::~vrpn_YEI_3Space() -{ - // Free the space used to store the additional reset commands, - // then free the array used to store the pointers. - for (int i = 0; i < d_reset_command_count; i++) { - delete [] d_reset_commands[i]; - } - if (d_reset_commands != NULL) { - delete [] d_reset_commands; - d_reset_commands = NULL; - } -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space::vrpn_YEI_3Space - * ROLE : This creates a vrpn_YEI_3Space and sets it to reset mode. - * ARGUMENTS : - * RETURN : - ******************************************************************************/ -void vrpn_YEI_3Space::init (bool calibrate_gyros_on_setup - , bool tare_on_setup - , double frames_per_second - , double red_LED_color - , double green_LED_color - , double blue_LED_color - , int LED_mode) -{ - // Configure LED mode. - unsigned char set_LED_mode[2] = { 0xC4, 0 }; - set_LED_mode[1] = static_cast<unsigned char>(LED_mode); - if (!send_binary_command(set_LED_mode, sizeof(set_LED_mode))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::init: Unable to send set-LED-mode command\n"); - } -#ifdef VERBOSE - printf("LED mode set\n"); -#endif - - // Configure LED color. - unsigned char set_LED_color[13] = { 0xEE, 0,0,0,0,0,0,0,0,0,0,0,0 }; - unsigned char *bufptr = &set_LED_color[1]; - vrpn_int32 buflen = 12; - vrpn_float32 LEDs[3]; - LEDs[0] = static_cast<vrpn_float32>(red_LED_color); - LEDs[1] = static_cast<vrpn_float32>(green_LED_color); - LEDs[2] = static_cast<vrpn_float32>(blue_LED_color); - vrpn_buffer(&bufptr, &buflen, LEDs[0]); - vrpn_buffer(&bufptr, &buflen, LEDs[1]); - vrpn_buffer(&bufptr, &buflen, LEDs[2]); - if (!send_binary_command (set_LED_color, sizeof(set_LED_color))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::init: Unable to send set-LED-color command\n"); - } - - // If we're supposed to calibrate the gyros on startup, do so now. - if (calibrate_gyros_on_setup) { - unsigned char begin_gyroscope_calibration[1] = { 0xA5 }; - if (!send_binary_command (begin_gyroscope_calibration, sizeof(begin_gyroscope_calibration))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::init: Unable to send set-gyroscope-calibration command\n"); - } - } - - // If we're supposed to tare on startup, do so now. - if (tare_on_setup) { - unsigned char tare[1] = { 0x60 }; - if (!send_binary_command (tare, sizeof(tare))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::init: Unable to send tare command\n"); - } - } - - // Set the mode to reset - vrpn_gettimeofday(×tamp, NULL); - d_status = STATUS_RESETTING; -#ifdef VERBOSE - printf("init() complete\n"); -#endif -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space::reset - * ROLE : This routine will reset the YEI_3Space - * ARGUMENTS : - * RETURN : 0 else -1 in case of error - ******************************************************************************/ -int vrpn_YEI_3Space::reset (void) -{ - struct timeval l_timeout; - - // Ask the device to stop streaming and then wait a little and flush the - // input buffer and then ask it for the LED mode and make sure we get a response. - unsigned char stop_streaming[1] = { 0x56 }; - if (!send_binary_command (stop_streaming, sizeof(stop_streaming))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::reset: Unable to send stop-streaming command\n"); - return -1; - } - vrpn_SleepMsecs(50); - flush_input(); - unsigned char get_led_mode[1] = { 0xC8 }; - if (!send_binary_command (get_led_mode, sizeof(get_led_mode))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::reset: Unable to send get-led-mode command\n"); - return -1; - } - l_timeout.tv_sec = 2; - l_timeout.tv_usec = 0; - if (!receive_LED_mode_response(&l_timeout)) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::reset: Unable to read get-led-mode response\n"); - return -1; - } - - // Request the 3 LED colors and set our internal values to match them. - unsigned char get_led_values[1] = { 0xEF }; - if (!send_binary_command (get_led_values, sizeof(get_led_values))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::reset: Unable to send get-led-values command\n"); - return -1; - } - if (!receive_LED_values_response(&l_timeout)) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::reset: Unable to read get-led-mode response\n"); - return -1; - } - - // Change into the x-right, z-up right handed CS we want - unsigned char set_rh_system[] = { 0x74, 0x01 }; - if (!send_binary_command(set_rh_system, sizeof(set_rh_system))) { - VRPN_MSG_ERROR("vrpn_YEI_3Space::reset: Unable to send coordinate system selection command\n"); - return -1; - } - - // Configure streaming speed based on the requested frames/second value. - unsigned char set_streaming_timing[13] = { 0x52, 0,0,0,0,0,0,0,0,0,0,0,0 }; - vrpn_uint32 interval; - if (d_frames_per_second <= 0) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::reset: Bad frames/second value, setting to maximum\n"); - interval = 0; - } else { - interval = static_cast<vrpn_uint32>(1e6 * 1 / d_frames_per_second); - } - vrpn_uint32 duration = 0xFFFFFFFF; - vrpn_uint32 delay = 0; - unsigned char *bufptr = &set_streaming_timing[1]; - vrpn_int32 buflen = 12; - vrpn_buffer(&bufptr, &buflen, interval); - vrpn_buffer(&bufptr, &buflen, duration); - vrpn_buffer(&bufptr, &buflen, delay); - if (!send_binary_command (set_streaming_timing, sizeof(set_streaming_timing))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::reset: Unable to send set-streaming-timing command\n"); - return -1; - } - - // Configure the set of values we want to have streamed. - // The value 0xFF means "nothing." We want to stream the untared - // orientiation as a quaternion, the tared orientation as a quaternion, - // all corrected sensor data, the temperature in Celsius, and the - // confidence factor. - unsigned char set_streaming_slots[9] = { 0x50, - 0x06, // untared quat - 0x00, // tared quat - 0x29, // tared corrected linear acceleration with gravity removed - 0x25, // all corrected sensor data (3D vectors: rate gyro in rad/s, accel in g, and compass in gauss) - 0x2B, // temperature C - 0x2D, // confidence factor - 0xFA, // button state - 0xFF }; // followed by empty streaming spots. - if (!send_binary_command (set_streaming_slots, sizeof(set_streaming_slots))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::reset: Unable to send set-streaming-slots command\n"); - return -1; - } - - // Send any additional ACII reset commands that were passed into the - // constructor. - for (int i = 0; i < d_reset_command_count; i++) { - if (!send_ascii_command(d_reset_commands[i])) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::reset: Unable to send additional reset command\n"); - return -1; - } - } - - // Start streaming mode. - unsigned char start_streaming[1] = { 0x55 }; - if (!send_binary_command (start_streaming, sizeof(start_streaming))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::reset: Unable to send start-streaming command\n"); - return -1; - } - - // We're now entering the reading mode with no characters. - d_expected_characters = REPORT_LENGTH; - d_characters_read = 0; - d_status = STATUS_READING; - - vrpn_gettimeofday (×tamp, NULL); // Set watchdog now - return 0; -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space::handle_report - * ROLE : This function will parse a full report, then - * put that report into analog fields and call the report methods on these. - * ARGUMENTS : void - * RETURN : void - ******************************************************************************/ -void vrpn_YEI_3Space::handle_report(unsigned char *report) -{ - vrpn_float32 value; - unsigned char *bufptr = report; - - // Read the two orientations and report them - q_vec_type pos; - pos[Q_X] = pos[Q_Y] = pos[Q_Z] = 0; - q_type quat; - - for (int i = 0; i < 2; i++) { - vrpn_unbuffer(&bufptr, &value); - quat[Q_X] = value; - vrpn_unbuffer(&bufptr, &value); - quat[Q_Y] = value; - vrpn_unbuffer(&bufptr, &value); - quat[Q_Z] = value; - vrpn_unbuffer(&bufptr, &value); - quat[Q_W] = value; - if (0 != report_pose(i, timestamp, pos, quat)) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::handle_report(): Error sending sensor report"); - d_sensor = STATUS_RESETTING; - } - } - - // XXX Linear rate gyros into orientation change? - - // Read the three values for linear acceleration in tared - // space with gravity removed. Convert it into units of - // meters/second/second. Put it into the tared sensor. - q_vec_type acc; - q_type acc_quat; - acc_quat[Q_X] = acc_quat[Q_Y] = acc_quat[Q_Z] = 0; acc_quat[Q_W] = 1; - vrpn_unbuffer(&bufptr, &value); - static const double GRAVITY = 9.80665; // Meters/second/second - acc[Q_X] = value * GRAVITY; - vrpn_unbuffer(&bufptr, &value); - acc[Q_Y] = value * GRAVITY; - vrpn_unbuffer(&bufptr, &value); - acc[Q_Z] = value * GRAVITY; - int sensor = 1; - double interval = 1; - if (0 != report_pose_acceleration(sensor, timestamp, acc, acc_quat, interval)) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::handle_report(): Error sending acceleration report"); - d_sensor = STATUS_RESETTING; - } - - // Read the analog values and put them into the channels. - for (int i = 0; i < vrpn_Analog::getNumChannels(); i++) { - vrpn_unbuffer(&bufptr, &value); - channel[i] = value; - } - - // Check the temperature to make sure it is above 1. - // If not, there is trouble parsing the report. Sometimes the wired - // unit gets the wrong number of bytes in the report, causing things - // to wrap around. This catches that case. - if (channel[9] <= 1) { - VRPN_MSG_ERROR("vrpn_YEI_3Space::handle_report(): Invalid temperature, resetting"); - d_sensor = STATUS_RESETTING; - } - - // Check the confidence factor to make sure it is between 0 and 1. - // If not, there is trouble parsing the report. Sometimes the wired - // unit gets the wrong number of bytes in the report, causing things - // to wrap around. This catches that case. - if ((channel[10] < 0) || (channel[10] > 1)) { - VRPN_MSG_ERROR("vrpn_YEI_3Space::handle_report(): Invalid confidence, resetting"); - d_sensor = STATUS_RESETTING; - } - - // Read the button values and put them into the buttons. - vrpn_uint8 b; - vrpn_unbuffer(&bufptr, &b); - for (int i = 0; i < 8; i++) { - buttons[i] = (b & (1 << i)) != 0; - } - - //-------------------------------------------------------------------- - // Done with the decoding, send the analog and button reports. - //-------------------------------------------------------------------- - - report_changes(); -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space::report_changes - * ROLE : - * ARGUMENTS : - * RETURN : void - ******************************************************************************/ -void vrpn_YEI_3Space::report_changes (vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::timestamp = timestamp; - vrpn_Button::report_changes(); -} - - -/****************************************************************************** - * NAME : vrpn_YEI_3Space::report - * ROLE : - * ARGUMENTS : - * RETURN : void - ******************************************************************************/ -void vrpn_YEI_3Space::report (vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Analog::report(class_of_service); -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space::mainloop - * ROLE : This routine is called each time through the server's main loop. It will - * take a course of action depending on the current status of the device, - * either trying to reset it or trying to get a reading from it. It will - * try to reset the device if no data has come from it for a couple of - * seconds - * ARGUMENTS : - * RETURN : void - ******************************************************************************/ -void vrpn_YEI_3Space::mainloop () -{ - char l_errmsg[256]; - - server_mainloop(); - - switch (d_status) - { - case STATUS_NOT_INITIALIZED: - break; - - case STATUS_RESETTING: - if (reset()== -1) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space: Cannot reset!"); - } - break; - - case STATUS_READING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - while (get_report()) {} - struct timeval current_time; - vrpn_gettimeofday (¤t_time, NULL); - if (vrpn_TimevalDuration (current_time, timestamp) > MAX_TIME_INTERVAL) { - sprintf (l_errmsg, "vrpn_YEI_3Space::mainloop: Timeout... current_time=%ld:%ld, timestamp=%ld:%ld", - current_time.tv_sec, - static_cast<long> (current_time.tv_usec), - timestamp.tv_sec, - static_cast<long> (timestamp.tv_usec)); - VRPN_MSG_ERROR (l_errmsg); - d_status = STATUS_RESETTING; - } - } - break; - - default: - VRPN_MSG_ERROR ("vrpn_YEI_3Space::mainloop: Unknown mode (internal error)"); - break; - } -} - - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor::vrpn_YEI_3Space_Sensor - * ROLE : This creates a vrpn_YEI_3Space_Sensor and sets it to reset mode. It opens - * the serial port to use to communicate to it. - * ARGUMENTS : - * RETURN : - ******************************************************************************/ -vrpn_YEI_3Space_Sensor::vrpn_YEI_3Space_Sensor (const char * p_name - , vrpn_Connection * p_c - , const char * p_port - , int p_baud - , bool calibrate_gyros_on_setup - , bool tare_on_setup - , double frames_per_second - , double red_LED_color - , double green_LED_color - , double blue_LED_color - , int LED_mode - , const char *reset_commands[]) - : vrpn_YEI_3Space (p_name, p_c, calibrate_gyros_on_setup - , tare_on_setup, frames_per_second, red_LED_color - , green_LED_color, blue_LED_color, LED_mode - , reset_commands) -{ - // Open the serial port we're going to use to talk with the device. - if ((d_serial_fd = vrpn_open_commport(p_port, p_baud, - 8, vrpn_SER_PARITY_NONE)) == -1) { - perror("vrpn_YEI_3Space_Sensor::vrpn_YEI_3Space_Sensor: Cannot open serial port"); - fprintf(stderr," (port %s)\n", p_port); - } - - // Initialize the state of the device, now that we've established a - // way to talk with it. - init(calibrate_gyros_on_setup - , tare_on_setup, frames_per_second, red_LED_color - , green_LED_color, blue_LED_color, LED_mode); -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor::~vrpn_YEI_3Space_Sensor - * ROLE : This destroys a vrpn_YEI_3Space_Sensor and closes its ports. - * ARGUMENTS : - * RETURN : - ******************************************************************************/ -vrpn_YEI_3Space_Sensor::~vrpn_YEI_3Space_Sensor () -{ - // Ask the device to stop streaming. - unsigned char stop_streaming[1] = { 0x56 }; - if (!send_binary_command(stop_streaming, sizeof(stop_streaming))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space_Sensor_Wireless::~vrpn_YEI_3Space_Sensor_Wireless: Unable to send stop-streaming command\n"); - } - - // Close com port when destroyed. - if (d_serial_fd != -1) { - vrpn_close_commport(d_serial_fd); - } -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor::send_binary_command - * ROLE : - * ARGUMENTS : char *cmd : the command to be sent - * int len : Length of the command to be sent - * RETURN : true on success, false on failure. - ******************************************************************************/ - -// Info from YEI 3-Space Sensor User's Manual Wireless 2.0 R21 26 March2014 -// http://www.yeitechnology.com/sites/default/files/YEI_3-Space_Sensor_Users_Manual_Wireless_2.0_r21_26Mar2014.pdf -// Binary-mode command packet format: -// 0xF7 (start of packet) -// Command byte (command value) -// Command data (0 or more bytes of parameters, in big-endian format) -// Checksum (sum of all bytes in the packet % 256) -bool vrpn_YEI_3Space_Sensor::send_binary_command (const unsigned char *p_cmd, int p_len) -{ - const unsigned char START_OF_PACKET = 0xF7; - - // Compute the checksum. The description of the checksum implies that it should - // include the START_OF_PACKET data, but the example provided in page 28 does not - // include that data in the checksum, so we only include the packet data here. - int checksum = 0; - for (int i = 0; i < p_len; i++) { - checksum += p_cmd[i]; - } - checksum %= 256; - - // Pack the command into the buffer with the start-of-packet and checksum. - unsigned char buffer[256]; // Large enough buffer to hold all possible commands. - buffer[0] = START_OF_PACKET; - memcpy(&(buffer[1]), p_cmd, p_len); - buffer[p_len + 1] = static_cast<unsigned char>(checksum); - - // Send the command and return whether it worked. - int l_ret; - l_ret = vrpn_write_characters (d_serial_fd, buffer, p_len+2); - // Tell if this all worked. - if (l_ret == p_len+2) { - return true; - } else { - return false; - } -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor::send_ascii_command - * ROLE : - * ARGUMENTS : char *cmd : the command to be sent - * RETURN : true on success, false on failure. - ******************************************************************************/ - -// Info from YEI 3-Space Sensor User's Manual Wireless 2.0 R21 26 March2014 -// http://www.yeitechnology.com/sites/default/files/YEI_3-Space_Sensor_Users_Manual_Wireless_2.0_r21_26Mar2014.pdf -// Ascii-mode command packet format: -// ':' (start of packet) -// Command value (decimal) -// ',' Command data (0 or more bytes of parameters -// '\n' -bool vrpn_YEI_3Space_Sensor::send_ascii_command (const char *p_cmd) -{ - // Check to make sure we have a non-empty command - if (strlen(p_cmd) == 0) { - return false; - } - - // Allocate space for the command plus padding and zero terminator - int buflen = static_cast<int>(strlen(p_cmd) + 3); - unsigned char *buffer = new unsigned char[buflen]; - if (buffer == NULL) { - return false; - } - - // Fill in the command - buffer[0] = ':'; - memcpy(&buffer[1], p_cmd, strlen(p_cmd)); - buffer[buflen-2] = '\n'; - buffer[buflen-1] = 0; - - // Send the command and see if it worked. - int l_ret = vrpn_write_characters (d_serial_fd, buffer, buflen); - - // Free the buffer. - delete [] buffer; - - // Tell if sending worked. - if (l_ret == buflen) { - return true; - } else { - return false; - } -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor::receive_LED_mode_response - * ROLE : - * ARGUMENTS : struct timeval *timeout; how long to wait, NULL for forever - * RETURN : true on success, false on failure. - ******************************************************************************/ - -// Info from YEI 3-Space Sensor User's Manual Wireless 2.0 R21 26 March2014 -// http://www.yeitechnology.com/sites/default/files/YEI_3-Space_Sensor_Users_Manual_Wireless_2.0_r21_26Mar2014.pdf -// Binary-mode command packet format: -// Single byte: value 0 or 1. -bool vrpn_YEI_3Space_Sensor::receive_LED_mode_response (struct timeval *timeout) -{ - unsigned char value; - int ret = vrpn_read_available_characters (d_serial_fd, &value, sizeof(value), timeout); - if (ret != sizeof(value)) { - return false; - } - d_LED_mode = value; - return true; -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor::receive_LED_values_response - * ROLE : - * ARGUMENTS : struct timeval *timeout; how long to wait, NULL for forever - * RETURN : true on success, false on failure. - ******************************************************************************/ - -// Info from YEI 3-Space Sensor User's Manual Wireless 2.0 R21 26 March2014 -// http://www.yeitechnology.com/sites/default/files/YEI_3-Space_Sensor_Users_Manual_Wireless_2.0_r21_26Mar2014.pdf -// Binary-mode command packet format: -// Three four-byte float responses, each big-endian. -bool vrpn_YEI_3Space_Sensor::receive_LED_values_response (struct timeval *timeout) -{ - unsigned char buffer[3*sizeof(vrpn_float32)]; - int ret = vrpn_read_available_characters (d_serial_fd, buffer, sizeof(buffer), timeout); - if (ret != sizeof(buffer)) { - return false; - } - vrpn_float32 value; - unsigned char *bufptr = buffer; - vrpn_unbuffer(&bufptr, &value); - d_LED_color[0] = value; - vrpn_unbuffer(&bufptr, &value); - d_LED_color[1] = value; - vrpn_unbuffer(&bufptr, &value); - d_LED_color[2] = value; - return true; -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor::get_report - * ROLE : This function will read characters until it has a full report, then - * call handle_report() with the report and clear the counts. - * ARGUMENTS : void - * RETURN : bool: Did I get a complete report? - ******************************************************************************/ -bool vrpn_YEI_3Space_Sensor::get_report (void) -{ - int l_ret; // Return value from function call to be checked - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. - //-------------------------------------------------------------------- - - l_ret = vrpn_read_available_characters (d_serial_fd, &d_buffer [d_characters_read], - d_expected_characters - d_characters_read); - if (l_ret == -1) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space_Sensor::get_report(): Error reading the sensor, resetting"); - d_status = STATUS_RESETTING; - return false; - } -#ifdef VERBOSE - if (l_ret != 0) printf("... got %d characters (%d total)\n",l_ret, d_characters_read); -#endif - - //-------------------------------------------------------------------- - // The time of the report is the time at which the first character for - // the report is read. - //-------------------------------------------------------------------- - - if ( (l_ret > 0) && (d_characters_read == 0) ) { - vrpn_gettimeofday(×tamp, NULL); - } - - //-------------------------------------------------------------------- - // We keep track of how many characters we have received and keep - // going back until we get as many as we expect. - //-------------------------------------------------------------------- - - d_characters_read += l_ret; - if (d_characters_read < d_expected_characters) { // Not done -- go back for more - return false; - } - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. Parse each - // input in order and check to make sure they work, then send the results. - //-------------------------------------------------------------------- - handle_report(d_buffer); - - //-------------------------------------------------------------------- - // Clear our counts to be ready for the next report - //-------------------------------------------------------------------- - d_expected_characters = REPORT_LENGTH; - d_characters_read = 0; - return true; -} - -void vrpn_YEI_3Space_Sensor::flush_input(void) -{ - vrpn_flush_input_buffer (d_serial_fd); -} - - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor_Wireless::vrpn_YEI_3Space_Sensor_Wireless - * ROLE : This creates a vrpn_YEI_3Space_Sensor_Wireless and sets it to - * reset mode. This constructor is for the first sensor on a - * given dongle, so it opens the serial port and configures the - * dongle. - * ARGUMENTS : - * RETURN : - ******************************************************************************/ -vrpn_YEI_3Space_Sensor_Wireless::vrpn_YEI_3Space_Sensor_Wireless (const char * p_name - , vrpn_Connection * p_c - , int logical_id - , int serial_number - , const char * p_port - , int p_baud - , bool calibrate_gyros_on_setup - , bool tare_on_setup - , double frames_per_second - , double red_LED_color - , double green_LED_color - , double blue_LED_color - , int LED_mode - , const char *reset_commands[]) - : vrpn_YEI_3Space (p_name, p_c, calibrate_gyros_on_setup - , tare_on_setup, frames_per_second, red_LED_color - , green_LED_color, blue_LED_color, LED_mode - , reset_commands) - , d_i_am_first(true) - , d_logical_id(-1) -{ - // Open the serial port we're going to use to talk with the device. - if ((d_serial_fd = vrpn_open_commport(p_port, p_baud, - 8, vrpn_SER_PARITY_NONE)) == -1) { - perror("vrpn_YEI_3Space_Sensor_Wireless::vrpn_YEI_3Space_Sensor_Wireless: Cannot open serial port"); - fprintf(stderr," (port %s)\n", p_port); - } -#ifdef VERBOSE - printf("Serial port opened\n"); -#endif - - // Initialize the dongle state, since we are the first device to connect - // to it. - if (!configure_dongle()){ - fprintf(stderr,"vrpn_YEI_3Space_Sensor_Wireless::vrpn_YEI_3Space_Sensor_Wireless: Could not configure dongle\n"); - vrpn_close_commport(d_serial_fd); - d_serial_fd = -1; - return; - } -#ifdef VERBOSE - printf("Dongle configured\n"); -#endif - - // Set our serial number in the specified logical-ID slot. - if (!set_logical_id(static_cast<vrpn_uint8>(logical_id), serial_number)) { - fprintf(stderr,"vrpn_YEI_3Space_Sensor_Wireless::vrpn_YEI_3Space_Sensor_Wireless: Could not set logical ID\n"); - return; - } - d_logical_id = logical_id; - -#ifdef VERBOSE - printf("Logical ID set\n"); -#endif - // Initialize the state of the device, now that we've established a - // way to talk with it. - init(calibrate_gyros_on_setup - , tare_on_setup, frames_per_second, red_LED_color - , green_LED_color, blue_LED_color, LED_mode); -#ifdef VERBOSE - printf("Constructor done\n"); -#endif -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor_Wireless::vrpn_YEI_3Space_Sensor_Wireless - * ROLE : This creates a vrpn_YEI_3Space_Sensor_Wireless and sets it to - * reset mode. This constructor is for not the first sensor on a - * given dongle. - * ARGUMENTS : - * RETURN : - ******************************************************************************/ -vrpn_YEI_3Space_Sensor_Wireless::vrpn_YEI_3Space_Sensor_Wireless (const char * p_name - , vrpn_Connection * p_c - , int logical_id - , int serial_number - , int serial_file_descriptor - , bool calibrate_gyros_on_setup - , bool tare_on_setup - , double frames_per_second - , double red_LED_color - , double green_LED_color - , double blue_LED_color - , int LED_mode - , const char *reset_commands[]) - : vrpn_YEI_3Space (p_name, p_c, calibrate_gyros_on_setup - , tare_on_setup, frames_per_second, red_LED_color - , green_LED_color, blue_LED_color, LED_mode - , reset_commands) - , d_i_am_first(false) - , d_serial_fd(serial_file_descriptor) - , d_logical_id(-1) -{ - // Set our serial number in the specified logical-ID slot. - if (!set_logical_id(static_cast<vrpn_uint8>(logical_id), serial_number)) { - fprintf(stderr,"vrpn_YEI_3Space_Sensor_Wireless::vrpn_YEI_3Space_Sensor_Wireless: Could not set logical ID\n"); - return; - } - d_logical_id = logical_id; - - // Initialize the state of the device, now that we've established a - // way to talk with it. - init(calibrate_gyros_on_setup - , tare_on_setup, frames_per_second, red_LED_color - , green_LED_color, blue_LED_color, LED_mode); -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor_Wireless::~vrpn_YEI_3Space_Sensor_Wireless - * ROLE : This destroys a vrpn_YEI_3Space_Sensor_Wireless and closes its ports. - * ARGUMENTS : - * RETURN : - ******************************************************************************/ -vrpn_YEI_3Space_Sensor_Wireless::~vrpn_YEI_3Space_Sensor_Wireless () -{ - // Ask the device to stop streaming. - unsigned char stop_streaming[1] = { 0x56 }; - if (!send_binary_command(stop_streaming, sizeof(stop_streaming))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space_Sensor_Wireless::~vrpn_YEI_3Space_Sensor_Wireless: Unable to send stop-streaming command\n"); - } - - // Close com port when destroyed, if I am the first device on the dongle. - if (d_i_am_first) if (d_serial_fd != -1) { - vrpn_close_commport(d_serial_fd); - } -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor_Wireless::configure_dongle - * ROLE : * ARGUMENTS : - * RETURN : true on success, false on failure. - ******************************************************************************/ - -bool vrpn_YEI_3Space_Sensor_Wireless::configure_dongle() -{ - // Configure the wireless streaming mode to manual flush. - unsigned char set_mode[2] = { 0xb0, 0 }; - if (!send_binary_command_to_dongle(set_mode, sizeof(set_mode))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space_Sensor_Wireless::configure_dongle: Unable to send set-streaming-mode command\n"); - return false; - } - - return true; -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor_Wireless::configure_dongle - * ROLE : - * ARGUMENTS : - * RETURN : true on success, false on failure. - ******************************************************************************/ - -bool vrpn_YEI_3Space_Sensor_Wireless::set_logical_id(vrpn_uint8 logical_id, int serial_number) -{ - // Configure logical ID. - unsigned char set_id[6] = { 0xd1, 0, 0,0,0,0 }; - unsigned char *bufptr = &set_id[1]; - vrpn_int32 buflen = 5; - vrpn_buffer(&bufptr, &buflen, logical_id); - vrpn_buffer(&bufptr, &buflen, serial_number); - if (!send_binary_command_to_dongle(set_id, sizeof(set_id))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space_Sensor_Wireless::set_logical_id: Unable to send set-logical-id command\n"); - return false; - } -#ifdef VERBOSE - printf("... Logical id %d set to serial_number %x\n", logical_id, serial_number); -#endif - - return true; -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor_Wireless::send_binary_command_to_dongle - * ROLE : - * ARGUMENTS : char *cmd : the command to be sent - * int len : Length of the command to be sent - * RETURN : true on success, false on failure. - ******************************************************************************/ - -// This is the same as the send_binary_command() from the wired interface. -bool vrpn_YEI_3Space_Sensor_Wireless::send_binary_command_to_dongle (const unsigned char *p_cmd, int p_len) -{ - const unsigned char START_OF_PACKET = 0xF7; - - // Compute the checksum. The description of the checksum implies that it should - // include the START_OF_PACKET data, but the example provided in page 28 does not - // include that data in the checksum, so we only include the packet data here. - int checksum = 0; - for (int i = 0; i < p_len; i++) { - checksum += p_cmd[i]; - } - checksum %= 256; - - // Pack the command into the buffer with the start-of-packet and checksum. - unsigned char buffer[256]; // Large enough buffer to hold all possible commands. - buffer[0] = START_OF_PACKET; - memcpy(&(buffer[1]), p_cmd, p_len); - buffer[p_len + 1] = static_cast<unsigned char>(checksum); - - // Send the command and return whether it worked. - int l_ret; - l_ret = vrpn_write_characters (d_serial_fd, buffer, p_len+2); - // Tell if this all worked. - if (l_ret == p_len+2) { - return true; - } else { - return false; - } -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor_Wireless::send_binary_command - * ROLE : - * ARGUMENTS : char *cmd : the command to be sent - * int len : Length of the command to be sent - * RETURN : true on success, false on failure. - ******************************************************************************/ - -// Info from YEI 3-Space Sensor User's Manual Wireless 2.0 R21 26 March2014 -// http://www.yeitechnology.com/sites/default/files/YEI_3-Space_Sensor_Users_Manual_Wireless_2.0_r21_26Mar2014.pdf -// Binary-mode wireless command packet format: -// 0xF8 (start of packet) -// Logical address -// Command byte (command value) -// Command data (0 or more bytes of parameters, in big-endian format) -// Checksum (sum of all bytes in the packet including the address) % 256 -// NOTE: In the wireless protocol, all commands are acknowledged, so we -// wait for the response to make sure the command was properly received. -bool vrpn_YEI_3Space_Sensor_Wireless::send_binary_command (const unsigned char *p_cmd, int p_len) -{ - const unsigned char START_OF_PACKET = 0xF8; - - // Pack the command into the buffer with the start-of-packet and checksum. - unsigned char buffer[256]; // Large enough buffer to hold all possible commands. - buffer[0] = START_OF_PACKET; - buffer[1] = d_logical_id; - memcpy(&(buffer[2]), p_cmd, p_len); - - // Compute the checksum. The description of the checksum implies that it should - // include the START_OF_PACKET data, but the example provided in page 25 does not - // include that data in the checksum, so we only include the address and - // packet data here. - int checksum = 0; - for (int i = 0; i < p_len+1; i++) { - checksum += buffer[1 + i]; - } - checksum %= 256; - buffer[p_len + 2] = static_cast<unsigned char>(checksum); - - // Send the command. - int l_ret; - l_ret = vrpn_write_characters (d_serial_fd, buffer, p_len+3); - if (l_ret != p_len+3) { - fprintf(stderr, "vrpn_YEI_3Space_Sensor_Wireless::send_binary_command: Could not send command\n"); - return false; - } -#ifdef VERBOSE - printf("... packet of length %d sent\n", l_ret); -#endif - - // Listen for a response telling whether the command was received. - // We do not listen for the data returned by the command, but only - // check the header on the return to make sure the command was a - // success. The caller should separately look for any requested - // data. - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 500000; - int ret = vrpn_read_available_characters(d_serial_fd, buffer, 3, &timeout); - if (ret == 2) { - fprintf(stderr, "vrpn_YEI_3Space_Sensor_Wireless::send_binary_command: Error (%d) from ID %d\n", buffer[0], buffer[1]); - return false; - } else if (ret != 3) { - fprintf(stderr, "vrpn_YEI_3Space_Sensor_Wireless::send_binary_command: Timeout waiting for command status (got %d chars)\n", ret); - return false; - } - if (buffer[0] != 0) { - fprintf(stderr, "vrpn_YEI_3Space_Sensor_Wireless::send_binary_command: Command failed\n"); - return false; - } - if (buffer[1] != d_logical_id) { - fprintf(stderr, "vrpn_YEI_3Space_Sensor_Wireless::send_binary_command: Got response for incorrect logical ID\n"); - return false; - } -#ifdef VERBOSE - printf("..... send succeded\n"); -#endif - - return true; -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor_Wireless::send_ascii_command - * ROLE : - * ARGUMENTS : char *cmd : the command to be sent - * RETURN : true on success, false on failure. - ******************************************************************************/ - -// Info from YEI 3-Space Sensor User's Manual Wireless 2.0 R21 26 March2014 -// http://www.yeitechnology.com/sites/default/files/YEI_3-Space_Sensor_Users_Manual_Wireless_2.0_r21_26Mar2014.pdf -// Ascii-mode command packet format: -// '>' (start of packet) -// ',' and then logical ID (decimal) -// ',' and then data Command value (decimal) -// ',' Command data (0 or more bytes of parameters -// '\n' -// NOTE: In the wireless protocol, all commands are acknowledged, so we -// wait for the response to make sure the command was properly received. -bool vrpn_YEI_3Space_Sensor_Wireless::send_ascii_command (const char *p_cmd) -{ - // Check to make sure we have a non-empty command - if (strlen(p_cmd) == 0) { - return false; - } - - // Allocate space for the longest command plus padding and zero terminator - char buffer[256]; - - // Fill in the command - sprintf(buffer, ">%d,%s\n", d_logical_id, p_cmd); - - // Send the command and see if it worked. - int buflen = static_cast<int>(strlen(buffer) + 1); - unsigned char *bufptr = static_cast<unsigned char *>( - static_cast<void*>(buffer)); - int l_ret = vrpn_write_characters(d_serial_fd, bufptr, buflen); - - // Tell if sending worked. - if (l_ret != buflen) { - fprintf(stderr, "vrpn_YEI_3Space_Sensor_Wireless::send_ascii_command: Error sending command\n"); - return false; - } - - // Listen for a response telling whether the command was received. - // We parse the entire ASCII command response, including the \n at - // the end, since we aren't programmatically handling any of these - // in the driver but only letting the user specify them in the - // reset routine. - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 500000; - int ret; - if ((ret = vrpn_read_available_characters(d_serial_fd, bufptr, sizeof(buffer)-1, &timeout)) <= 0) { - fprintf(stderr, "vrpn_YEI_3Space_Sensor_Wireless::send_ascii_command: Timeout waiting for command status\n"); - return false; - } - buffer[ret] = '\0'; - if (buffer[0] != '0') { - fprintf(stderr, "vrpn_YEI_3Space_Sensor_Wireless::send_ascii_command: Command failed: response (%s)\n", buffer); - return false; - } - if (buffer[strlen(buffer)-1] != '\n') { - fprintf(stderr, "vrpn_YEI_3Space_Sensor_Wireless::send_ascii_command: Got ill-formatted response: (%s).\n", buffer); - return false; - } - - return true; -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor_Wireless::receive_LED_mode_response - * ROLE : - * ARGUMENTS : struct timeval *timeout; how long to wait, NULL for forever - * RETURN : true on success, false on failure. - ******************************************************************************/ - -// Info from YEI 3-Space Sensor User's Manual Wireless 2.0 R21 26 March2014 -// http://www.yeitechnology.com/sites/default/files/YEI_3-Space_Sensor_Users_Manual_Wireless_2.0_r21_26Mar2014.pdf -// Binary-mode command packet format: -// Single byte: value 0 or 1. -bool vrpn_YEI_3Space_Sensor_Wireless::receive_LED_mode_response (struct timeval *timeout) -{ - unsigned char value; - int ret = vrpn_read_available_characters (d_serial_fd, &value, sizeof(value), timeout); - if (ret != sizeof(value)) { - return false; - } - d_LED_mode = value; - return true; -} - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor_Wireless::receive_LED_values_response - * ROLE : - * ARGUMENTS : struct timeval *timeout; how long to wait, NULL for forever - * RETURN : true on success, false on failure. - ******************************************************************************/ - -// Info from YEI 3-Space Sensor User's Manual Wireless 2.0 R21 26 March2014 -// http://www.yeitechnology.com/sites/default/files/YEI_3-Space_Sensor_Users_Manual_Wireless_2.0_r21_26Mar2014.pdf -// Binary-mode command packet format: -// Three four-byte float responses, each big-endian. -bool vrpn_YEI_3Space_Sensor_Wireless::receive_LED_values_response (struct timeval *timeout) -{ - unsigned char buffer[3*sizeof(vrpn_float32)]; - int ret = vrpn_read_available_characters (d_serial_fd, buffer, sizeof(buffer), timeout); - if (ret != sizeof(buffer)) { - return false; - } - vrpn_float32 value; - unsigned char *bufptr = buffer; - vrpn_unbuffer(&bufptr, &value); - d_LED_color[0] = value; - vrpn_unbuffer(&bufptr, &value); - d_LED_color[1] = value; - vrpn_unbuffer(&bufptr, &value); - d_LED_color[2] = value; - return true; -} - -// XXXX Fix things below here. - -/****************************************************************************** - * NAME : vrpn_YEI_3Space_Sensor_Wireless::get_report - * ROLE : This function will read characters until it has a full report, then - * call handle_report() with the report and clear the counts. For the - * wireless protocol, we need to manually request release of streaming - * characters from our logical ID before checking to see if there are - * any. - * ARGUMENTS : void - * RETURN : bool: Did we get a complete report? - ******************************************************************************/ -bool vrpn_YEI_3Space_Sensor_Wireless::get_report (void) -{ - int l_ret; // Return value from function call to be checked - - //-------------------------------------------------------------------- - // Request release of pending reports from our ID. - unsigned char release_report[2] = { 0xB4, 0 }; - release_report[1] = d_logical_id; - if (!send_binary_command_to_dongle(release_report, sizeof(release_report))) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space::get_report: Unable to send release-report command\n"); - return false; - } - - //-------------------------------------------------------------------- - // Read a report if it is available. - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 1000; - l_ret = vrpn_read_available_characters(d_serial_fd, d_buffer, - REPORT_LENGTH + 3, - &timeout); - if (l_ret == -1) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space_Sensor_Wireless::get_report(): Error reading the sensor, resetting"); - d_status = STATUS_RESETTING; - return false; - } -#ifdef VERBOSE - if (l_ret != 0) printf("... got %d characters\n",l_ret); -#endif - // If we didn't get any reports, we're done and will look again next time. - if (l_ret == 0) { - return false; - } - - // Check to be sure that the length was what we expect, we got no errors - // (first header byte 0) and the response is from the correct device. - if (l_ret != REPORT_LENGTH + 3) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space_Sensor_Wireless::get_report(): Truncated report, resetting"); - d_status = STATUS_RESETTING; - return false; - } - if (d_buffer[0] != 0) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space_Sensor_Wireless::get_report(): Error reported, resetting"); - d_status = STATUS_RESETTING; - return false; - } - if (d_buffer[1] != d_logical_id) { - VRPN_MSG_ERROR ("vrpn_YEI_3Space_Sensor_Wireless::get_report(): Report from wrong sensor received, resetting"); - d_status = STATUS_RESETTING; - return false; - } - - //-------------------------------------------------------------------- - // Parse and handle the report. - vrpn_gettimeofday(×tamp, NULL); - handle_report(&d_buffer[3]); - return true; -} - -void vrpn_YEI_3Space_Sensor_Wireless::flush_input(void) -{ - vrpn_flush_input_buffer(d_serial_fd); -} diff --git a/src/vrpn/vrpn_YEI_3Space.h b/src/vrpn/vrpn_YEI_3Space.h deleted file mode 100644 index b256fb9d2e39169e2b38c911a10aa4ec78cf982e..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_YEI_3Space.h +++ /dev/null @@ -1,309 +0,0 @@ -#ifndef VRPN_YEI_3SPACE_H -#define VRPN_YEI_3SPACE_H - -#include "quat.h" -#include "vrpn_Tracker.h" -#include "vrpn_Analog.h" -#include "vrpn_Button.h" - -/** @brief Base class with routines for YEI 3Space units. -*/ -class VRPN_API vrpn_YEI_3Space - : public vrpn_Tracker_Server - , public vrpn_Analog - , public vrpn_Button_Filter -{ -public: - /** @brief Constructor. - @param name Name for the device - @param c Connection to use. - @param calibrate_gyros_on_setup - true to cause this to happen - @param tare_on_setup - true to cause this to happen (usually manufacturing-time operation!) - @param frames_per_second - How many frames/second to read - @param red_LED_color - brightness of LED (0-1) - @param green_LED_color - brightness of LED (0-1) - @param blue_LED_color - brightness of LED (0-1) - @param LED_state - 0 = standard, 1 = static - @param reset_commands - Array of pointers to commands, NULL for end. - These will be sent after other commands whenever the tracker - is reset. This will be copied; the caller is responsible for - freeing any storage after calling the constructor. - */ - vrpn_YEI_3Space (const char * name, - vrpn_Connection * c, - bool calibrate_gyros_on_setup = false, - bool tare_on_setup = false, - double frames_per_second = 50, - double red_LED_color = 0, - double green_LED_color = 0, - double blue_LED_color = 0, - int LED_mode = 1, - const char *reset_commands[] = NULL); - - /// Destructor. - virtual ~vrpn_YEI_3Space(); - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - -protected: - /// Initialization that would normally happen in the constructor, but - /// we need to wait for the derived classes to open a communications port - /// before we can do this. Derived classes should call this at the end - /// of their constructors. - void init(bool calibrate_gyros_on_setup - , bool tare_on_setup - , double frames_per_second - , double red_LED_color - , double green_LED_color - , double blue_LED_color - , int LED_mode); - - /// Flush any incoming characters in the communications channel. - virtual void flush_input(void) = 0; - - // A list of ASCII commands that are sent to the device after - // the other reset commands have been sent, each time the device - // is reset. This enables arbitrary configuration. - char **d_reset_commands; //< Commands to send on reset - int d_reset_command_count; //< How many reset commands - - // Status and handlers for different states - int d_status; //< What are we currently up to? - virtual int reset(void); //< Set device back to starting config - virtual bool get_report(void) = 0; //< Try to read and handle a report from the device - virtual void handle_report(unsigned char *report); //< Parse and handle a complete streaming report - - double d_frames_per_second; //< How many frames/second do we want? - int d_LED_mode; //< LED mode we read from the device. - vrpn_float32 d_LED_color[3]; //< LED color we read from the device. - - /// Compute the CRC for the message, append it, and send message. - /// Returns true on success, false on failure. - virtual bool send_binary_command(const unsigned char *cmd, int len) = 0; - - /// Put a ':' character at the front and '\n' at the end and then - /// send the resulting command as an ASCII command. - /// Returns true on success, false on failure. - virtual bool send_ascii_command(const char *cmd) = 0; - - /// Read and parse the response to an LED-state request command. - /// NULL timeout pointer means wait forever. - /// Returns true on success and false on failure. - virtual bool receive_LED_mode_response(struct timeval *timeout = NULL) = 0; - - /// Read and parse the response to an LED-values request command. - /// NULL timeout pointer means wait forever. - /// Returns true on success and false on failure. - virtual bool receive_LED_values_response(struct timeval *timeout = NULL) = 0; - - unsigned char d_buffer[128]; //< Buffer to read reports into. - unsigned d_expected_characters; //< How many characters we are expecting - unsigned d_characters_read; //< How many characters we've read so far - - struct timeval timestamp; //< Time of the last report from the device - - /// send report iff changed - virtual void report_changes - (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - /// send report whether or not changed - virtual void report - (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); -}; - -/** @brief Class to support reading data from a wired YEI 3Space unit. -*/ -class VRPN_API vrpn_YEI_3Space_Sensor - : public vrpn_YEI_3Space -{ -public: - /** @brief Constructor. - @param name Name for the device - @param c Connection to use. - @param port serial port to connect to - @param baud Baud rate - 115200 is default. - @param calibrate_gyros_on_setup - true to cause this to happen - @param tare_on_setup - true to cause this to happen (usually manufacturing-time operation!) - @param frames_per_second - How many frames/second to read - @param red_LED_color - brightness of LED (0-1) - @param green_LED_color - brightness of LED (0-1) - @param blue_LED_color - brightness of LED (0-1) - @param LED_state - 0 = standard, 1 = static - @param reset_commands - Array of pointers to commands, NULL for end. - These will be sent after other commands whenever the tracker - is reset. This will be copied; the caller is responsible for - freeing any storage after calling the constructor. - */ - vrpn_YEI_3Space_Sensor (const char * name, - vrpn_Connection * c, - const char * port, - int baud = 115200, - bool calibrate_gyros_on_setup = false, - bool tare_on_setup = false, - double frames_per_second = 50, - double red_LED_color = 0, - double green_LED_color = 0, - double blue_LED_color = 0, - int LED_mode = 1, - const char *reset_commands[] = NULL); - - /// Destructor. - virtual ~vrpn_YEI_3Space_Sensor(); - -protected: - int d_serial_fd; //< Serial port to read from. - - /// Flush any incoming characters in the communications channel. - virtual void flush_input(void); - - virtual bool get_report(void); //< Try to read and handle a report from the device - - /// Compute the CRC for the message, append it, and send message. - /// Returns true on success, false on failure. - bool send_binary_command(const unsigned char *cmd, int len); - - /// Put a ':' character at the front and '\n' at the end and then - /// send the resulting command as an ASCII command. - /// Returns true on success, false on failure. - bool send_ascii_command(const char *cmd); - - /// Read and parse the response to an LED-state request command. - /// NULL timeout pointer means wait forever. - /// Returns true on success and false on failure. - bool receive_LED_mode_response(struct timeval *timeout = NULL); - - /// Read and parse the response to an LED-values request command. - /// NULL timeout pointer means wait forever. - /// Returns true on success and false on failure. - bool receive_LED_values_response(struct timeval *timeout = NULL); -}; - -/** @brief Class to support reading data from a wireless YEI 3Space unit. -*/ -class VRPN_API vrpn_YEI_3Space_Sensor_Wireless - : public vrpn_YEI_3Space -{ -public: - /** @brief Constructor for the first device, which will open the serial - port and configure the dongle. The first device on a wireless - dongle should call this constructor. The later ones should call - the constructor that takes the serial_file_descriptor argument - after querying the first for that descriptor. - @param name Name for the device - @param c Connection to use. - @param logical_id Which logical ID to use on the wireless unit. - @param serial_number Serial number of this device, used to configure. - @param port serial port to connect to - @param baud Baud rate - 115200 is default. - @param calibrate_gyros_on_setup - true to cause this to happen - @param tare_on_setup - true to cause this to happen (usually manufacturing-time operation!) - @param frames_per_second - How many frames/second to read - @param red_LED_color - brightness of LED (0-1) - @param green_LED_color - brightness of LED (0-1) - @param blue_LED_color - brightness of LED (0-1) - @param LED_state - 0 = standard, 1 = static - @param reset_commands - Array of pointers to commands, NULL for end. - These will be sent after other commands whenever the tracker - is reset. This will be copied; the caller is responsible for - freeing any storage after calling the constructor. - */ - vrpn_YEI_3Space_Sensor_Wireless (const char * name, - vrpn_Connection * c, - int logical_id, - int serial_number, - const char * port, - int baud = 115200, - bool calibrate_gyros_on_setup = false, - bool tare_on_setup = false, - double frames_per_second = 50, - double red_LED_color = 0, - double green_LED_color = 0, - double blue_LED_color = 0, - int LED_mode = 1, - const char *reset_commands[] = NULL); - - /** @brief Constructor for a follow-on device, once a wireless unit has already - been opened on a given dongle. The serial_file_descriptor argument - should be found by querying the first device. - @param name Name for the device - @param c Connection to use. - @param logical_id Which logical ID to use on the wireless unit. - @param serial_number Serial number of this device, used to configure. - @param serial_file_descriptor: Pre-opened serial descriptor to use. - @param calibrate_gyros_on_setup - true to cause this to happen - @param tare_on_setup - true to cause this to happen (usually manufacturing-time operation!) - @param frames_per_second - How many frames/second to read - @param red_LED_color - brightness of LED (0-1) - @param green_LED_color - brightness of LED (0-1) - @param blue_LED_color - brightness of LED (0-1) - @param LED_state - 0 = standard, 1 = static - @param reset_commands - Array of pointers to commands, NULL for end. - These will be sent after other commands whenever the tracker - is reset. This will be copied; the caller is responsible for - freeing any storage after calling the constructor. - */ - vrpn_YEI_3Space_Sensor_Wireless (const char * name, - vrpn_Connection * c, - int logical_id, - int serial_number, - int serial_file_descriptor, - bool calibrate_gyros_on_setup = false, - bool tare_on_setup = false, - double frames_per_second = 50, - double red_LED_color = 0, - double green_LED_color = 0, - double blue_LED_color = 0, - int LED_mode = 1, - const char *reset_commands[] = NULL); - - /// Destructor. - virtual ~vrpn_YEI_3Space_Sensor_Wireless(); - - /// Reports the serial_fd that was opened, so that additional - /// sensors that use the same wireless dongle can be opened. - int get_serial_file_descriptor(void) const { return d_serial_fd; } - -protected: - bool d_i_am_first; //< Records whether I'm the first sensor (so close the port) - int d_serial_fd; //< Serial port to read from. - vrpn_uint8 d_logical_id; //< Which logical ID are we assigned to on the dongle? - - /// Configure the dongle (called if we are the first one) - virtual bool configure_dongle(void); - - /// Insert our serial number into the specified slot. - virtual bool set_logical_id(vrpn_uint8 logical_id, vrpn_int32 serial_number); - - /// Flush any incoming characters in the communications channel. - virtual void flush_input(void); - - /// Get and handle a report from the device if one is available. Return true - /// if one was available, false if not. - virtual bool get_report(void); - - /// Compute the CRC for the message, append it, and send message - /// to the dongle directly (not a wireless command). - /// Returns true on success, false on failure. - bool send_binary_command_to_dongle(const unsigned char *cmd, int len); - - /// Compute the CRC for the message, append it, and send message. - /// Returns true on success, false on failure. - bool send_binary_command(const unsigned char *cmd, int len); - - /// Put a ':' character at the front and '\n' at the end and then - /// send the resulting command as an ASCII command. - /// Returns true on success, false on failure. - bool send_ascii_command(const char *cmd); - - /// Read and parse the response to an LED-state request command. - /// NULL timeout pointer means wait forever. - /// Returns true on success and false on failure. - bool receive_LED_mode_response(struct timeval *timeout = NULL); - - /// Read and parse the response to an LED-values request command. - /// NULL timeout pointer means wait forever. - /// Returns true on success and false on failure. - bool receive_LED_values_response(struct timeval *timeout = NULL); -}; - -#endif diff --git a/src/vrpn/vrpn_Zaber.C b/src/vrpn/vrpn_Zaber.C deleted file mode 100644 index b1b0d5e9d26b9ff773b9e0e095eb286e6435807f..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Zaber.C +++ /dev/null @@ -1,472 +0,0 @@ -// vrpn_Zaber.C -// This is a driver for the Zaber T-LA linear actuators. -// They plug in a daisy chain into a serial -// line and communicates using RS-232 (this is a raw-mode driver). -// You can find out more at www.zaber.com. They have a manual with -// a section on the serial interface; this code is based on that. -// It was written in May 2002 by Russ Taylor. - -// INFO about how the device communicates: -// There are 6-byte commands. Byte 0 is the device number (with -// device 0 meaning "all devices." Byte 1 is the command number. -// Byte 2 is the LSB of the 4-byte signed integer data, byte 5 is -// the MSB (most-significant byte) of the data. - - -#include <stdio.h> // for sprintf, fprintf, stderr, etc - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR, etc -#include "vrpn_Serial.h" // for vrpn_flush_input_buffer, etc -#include "vrpn_Shared.h" // for timeval, vrpn_unbuffer, etc -#include "vrpn_Zaber.h" -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -#undef VERBOSE - -// Defines the modes in which the device can find itself. -#define STATUS_RESETTING (-1) // Resetting the device -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report - -#define TIMEOUT_TIME_INTERVAL (2000000L) // max time between reports (usec) -#define POLL_INTERVAL (1000000L) // time to poll if no response in a while (usec) - - -// This creates a vrpn_Zaber and sets it to reset mode. It opens -// the serial device using the code in the vrpn_Serial_Analog constructor. - -vrpn_Zaber::vrpn_Zaber (const char * name, vrpn_Connection * c, - const char * port): - vrpn_Serial_Analog(name, c, port), - vrpn_Analog_Output(name, c) -{ - d_last_poll.tv_sec = 0; - d_last_poll.tv_usec = 0; - - num_channel = 0; // This is an estimate; will change when the reset happens - o_num_channel = 0; - - // Set the mode to reset - status = STATUS_RESETTING; - - // Register to receive the message to request changes and to receive connection - // messages. - if (d_connection != NULL) { - if (register_autodeleted_handler(request_m_id, handle_request_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_Zaber: can't register handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler(request_channels_m_id, handle_request_channels_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_Zaber: can't register handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler(d_ping_message_id, handle_connect_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_Zaber: can't register handler\n"); - d_connection = NULL; - } - } else { - fprintf(stderr,"vrpn_Zaber: Can't get connection!\n"); - } - -} - -bool vrpn_Zaber::send_command(unsigned char devicenum, unsigned char cmd, vrpn_int32 data) -{ - unsigned char command[128]; - - // Fill in the device number and command number - command[0] = devicenum; - command[1] = cmd; - - // Fill in the data in the correct byte order - command[2] = static_cast<unsigned char>(data & 0x000000FF); - command[3] = static_cast<unsigned char>((data >> 8) & 0x000000FF); - command[4] = static_cast<unsigned char>((data >> 16) & 0x000000FF); - command[5] = static_cast<unsigned char>((data >> 24) & 0x000000FF); - - // Send the command to the serial port - return (vrpn_write_characters(serial_fd, command, 6) == 6); -} - -bool vrpn_Zaber::send_command(unsigned char devnum, unsigned char cmd, unsigned char d0, - unsigned char d1, unsigned char d2, unsigned char d3) -{ - unsigned char command[128]; - - // Fill in the device number and command number - command[0] = devnum; - command[1] = cmd; - - // Fill in the data in the correct byte order - command[2] = d0; - command[3] = d1; - command[4] = d2; - command[5] = d3; - - // Send the command to the serial port - return (vrpn_write_characters(serial_fd, command, 6) == 6); -} - -/** Convert the four bytes that have been read into a signed integer value. */ -vrpn_int32 vrpn_Zaber::convert_bytes_to_reading(const unsigned char *buf) -{ - vrpn_int32 data; - - data = ((buf[0]) & 0x000000FF) - + ((buf[1] << 8) & 0x0000FF00) - + ((buf[2] << 16) & 0x00FF0000) - + ((buf[3] << 24) & 0xFF000000); - - return data; -} - - -// This routine will reset the Zebers, asking them to renumber themselves and then polling -// to see how many there are in the chain. -// Commands Responses Meanings -// [0][2][0][0][0][0] None Renumber the devices on the chain (wait 1 second) -// [X][23][0][0][0][0] [X][23][Position] Tell each to stop and see if get a reply (tells where they are) -// [X][40][16][0][0][0] [X][40][16][0][0][0] Set it to report position when moving linearly - -int vrpn_Zaber::reset(void) -{ - struct timeval timeout; - unsigned char inbuf[128]; - int ret; - char errmsg[256]; - - //----------------------------------------------------------------------- - // Sleep a second and then drain the input buffer to make sure we start - // with a fresh slate. - vrpn_SleepMsecs(1000); - vrpn_flush_input_buffer(serial_fd); - - //----------------------------------------------------------------------- - // Send the command to request that the units renumber themselves. Then - // wait 1 second to give them time to do so. - if (!send_command(0,2,0)) { - fprintf(stderr,"vrpn_Zaber::reset(): Cannot send renumber command, trying again\n"); - return -1; - } - vrpn_SleepMsecs(1000); - - //----------------------------------------------------------------------- - // Go one by one and request the units to stop. This will cause them to - // say where they are. When one doesn't respond, we've figured out how - // many we have! Also, set it to report position when moving at constant - // linear velocity and set the minimum step size and maximum step size - // to be slower than the defaults to hopefully give more torque. - - num_channel = 0; - o_num_channel = 0; - do { - int expected_chars = 4*6; - vrpn_flush_input_buffer(serial_fd); - unsigned char channel_id = static_cast<unsigned char>(num_channel+1); - send_command(channel_id, 23, 0); vrpn_SleepMsecs(10); - send_command(channel_id, 40, 16, 0, 0, 0); vrpn_SleepMsecs(10); - send_command(channel_id, 41, 128, 0, 0, 0); vrpn_SleepMsecs(10); - send_command(channel_id, 42, 128, 0, 0, 0); - - timeout.tv_sec = 0; - timeout.tv_usec = 30000; - ret = vrpn_read_available_characters(serial_fd, inbuf, expected_chars, &timeout); - if (ret < 0) { - perror("vrpn_Zaber::reset(): Error reading position from device"); - return -1; - } - if (ret == 0) { - break; //< No more devices found - } - if (ret != expected_chars) { - sprintf(errmsg,"reset: Got %d of %d expected characters for position\n",ret, expected_chars); - VRPN_MSG_ERROR(errmsg); - return -1; - } - - // Make sure the string we got back is what we expected and set the value - // for this channel to what we got from the device. - if ( (inbuf[0] != num_channel+1) || (inbuf[1] != 23) ) { - VRPN_MSG_ERROR("reset: Bad response to device # request"); - return -1; - } - channel[num_channel] = convert_bytes_to_reading(&inbuf[2]); - - num_channel++; - o_num_channel++; - -// Yes, I know the conditional expression is a constant! -#ifdef _WIN32 -#pragma warning ( disable : 4127 ) -#endif - } while (true); -#ifdef _WIN32 -#pragma warning ( default : 4127 ) -#endif - sprintf(errmsg,"found %d devices",num_channel); - VRPN_MSG_WARNING(errmsg); - - // We're now waiting for any responses from devices - status = STATUS_SYNCING; - - VRPN_MSG_WARNING("reset complete (this is good)"); - - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - return 0; -} - -// This function will read characters until it has a full report, then -// put that report into analog fields and call the report methods on these. -// The time stored is that of the first character received as part of the -// report. - -int vrpn_Zaber::get_report(void) -{ - int ret; // Return value from function call to be checked - - //-------------------------------------------------------------------- - // If we're SYNCing, then the next character we get should be the start - // of a report. If we recognize it, go into READing mode and tell how - // many characters we expect total. If we don't recognize it, then we - // must have misinterpreted a command or something; reset - // and start over - //-------------------------------------------------------------------- - - if (status == STATUS_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, d_buffer, 1) != 1) { - return 0; - } - - d_expected_chars = 6; - - //XXX How do we know when we're out of sync? - - // Got the first character of a report -- go into READING mode - // and record that we got one character at this time. The next - // bit of code will attempt to read the rest of the report. - // The time stored here is as close as possible to when the - // report was generated. - d_bufcount = 1; - vrpn_gettimeofday(×tamp, NULL); - status = STATUS_READING; -#ifdef VERBOSE - printf("... Got the 1st char\n"); -#endif - } - - //-------------------------------------------------------------------- - // Read as many bytes of this report as we can, storing them - // in the buffer. We keep track of how many have been read so far - // and only try to read the rest. - //-------------------------------------------------------------------- - - ret = vrpn_read_available_characters(serial_fd, &d_buffer[d_bufcount], - d_expected_chars-d_bufcount); - if (ret == -1) { - VRPN_MSG_ERROR("Error reading"); - status = STATUS_RESETTING; - return 0; - } - d_bufcount += ret; -#ifdef VERBOSE - if (ret != 0) printf("... got %d characters (%d total)\n",ret, d_bufcount); -#endif - if (d_bufcount < d_expected_chars) { // Not done -- go back for more - return 0; - } - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. Check to make - // sure that its format matches what we expect. If it does, the next - // section will parse it. If it does not, we need to go back into - // synch mode and ignore this report. A well-formed report has - // either 23 or 10 as its command. Also accept command number 1 - // (reset). Also accept command 20 (go to absolute position). Also - // parse command 255 (out of range setting requested -- it puts the - // actual position in place). - //-------------------------------------------------------------------- - - if ( (d_buffer[1] != 10) && (d_buffer[1] != 23) && (d_buffer[1] != 1) - && (d_buffer[1] != 20) && (d_buffer[1] != 255) ) { - status = STATUS_SYNCING; - char msg[1024]; - sprintf(msg,"Bad command type (%d) in report (ignoring this report)", d_buffer[1]); - VRPN_MSG_WARNING(msg); - vrpn_flush_input_buffer(serial_fd); - return 0; - } - if (d_buffer[1] == 255) { - VRPN_MSG_WARNING("Requested value out of range"); - } - -#ifdef VERBOSE - printf("got a complete report (%d of %d)!\n", d_bufcount, d_expected_chars); -#endif - - //-------------------------------------------------------------------- - // Decode the report and store the values in it into the analog value - //-------------------------------------------------------------------- - - unsigned char chan = static_cast<unsigned char>(d_buffer[0] - 1); - vrpn_int32 value = convert_bytes_to_reading(&d_buffer[2]); - if (chan >= num_channel) { // Unsigned, so can't be < 0 - char msg[1024]; - sprintf(msg,"Invalid channel (%d of %d), resetting", chan, num_channel); - VRPN_MSG_ERROR(msg); - status = STATUS_RESETTING; - } - channel[chan] = value; - - //-------------------------------------------------------------------- - // Done with the decoding, send the reports and go back to syncing - //-------------------------------------------------------------------- - - report_changes(); - status = STATUS_SYNCING; - d_bufcount = 0; - - return 1; -} - -int vrpn_Zaber::handle_request_message(void *userdata, vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_float64 value; - vrpn_Zaber *me = (vrpn_Zaber *)userdata; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - vrpn_unbuffer(&bufptr, &value); - - // Set the position to the appropriate value, if the channel number is in the - // range of the ones we have. - if ( (chan_num < 0) || (chan_num >= me->o_num_channel) ) { - char msg[1024]; - sprintf(msg,"vrpn_Zaber::handle_request_message(): Index out of bounds (%d of %d), value %lg\n", - chan_num, me->num_channel, value); - me->send_text_message(msg, me->timestamp, vrpn_TEXT_ERROR); - return 0; - } - me->channel[chan_num] = value; - me->send_command(static_cast<unsigned char>(chan_num+1),20,(vrpn_int32)value); - - return 0; -} - -int vrpn_Zaber::handle_request_channels_message(void* userdata, vrpn_HANDLERPARAM p) -{ - int i; - const char* bufptr = p.buffer; - vrpn_int32 num; - vrpn_int32 pad; - vrpn_Zaber* me = (vrpn_Zaber *)userdata; - - // Read the values from the buffer - vrpn_unbuffer(&bufptr, &num); - vrpn_unbuffer(&bufptr, &pad); - if (num > me->o_num_channel) { - char msg[1024]; - sprintf(msg,"vrpn_Zaber::handle_request_channels_message(): Index out of bounds (%d of %d), clipping\n", - num, me->o_num_channel); - me->send_text_message(msg, me->timestamp, vrpn_TEXT_ERROR); - num = me->o_num_channel; - } - for (i = 0; i < num; i++) { - vrpn_unbuffer(&bufptr, &(me->o_channel[i])); - me->send_command(static_cast<unsigned char>(i+1),20,(vrpn_int32)me->o_channel[i]); - } - - return 0; -} - -/** When we get a connection request from a remote object, send our state so - they will know it to start with. */ -int vrpn_Zaber::handle_connect_message(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_Zaber *me = (vrpn_Zaber *)userdata; - - me->report(vrpn_CONNECTION_RELIABLE); - return 0; -} - -void vrpn_Zaber::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - - vrpn_Analog::report_changes(class_of_service); -} - -void vrpn_Zaber::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - - vrpn_Analog::report(class_of_service); -} - -/** This routine is called each time through the server's main loop. It will - take a course of action depending on the current status of the device, - either trying to reset it or trying to get a reading from it. It will - try to reset the device if no data has come from it for a couple of - seconds -*/ - -void vrpn_Zaber::mainloop() -{ - char errmsg[256]; - - server_mainloop(); - - switch(status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - while (get_report()) {}; // Keep getting reports so long as there are more - - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) > POLL_INTERVAL) { - - if (vrpn_TimevalDuration(current_time, d_last_poll) > TIMEOUT_TIME_INTERVAL) { - // Tell unit 1 to stop, which will cause it to respond. - send_command(1,23,0); - vrpn_gettimeofday(&d_last_poll, NULL); - } else { - return; - } - } - - if ( vrpn_TimevalDuration(current_time,timestamp) > TIMEOUT_TIME_INTERVAL) { - sprintf(errmsg,"Timeout... current_time=%ld:%ld, timestamp=%ld:%ld", - current_time.tv_sec, static_cast<long>(current_time.tv_usec), - timestamp.tv_sec, static_cast<long>(timestamp.tv_usec)); - VRPN_MSG_ERROR(errmsg); - status = STATUS_RESETTING; - } - } - break; - - default: - VRPN_MSG_ERROR("Unknown mode (internal error)"); - break; - } -} diff --git a/src/vrpn/vrpn_Zaber.h b/src/vrpn/vrpn_Zaber.h deleted file mode 100644 index 4f07f744ab1296f2d6ce9c3320f25257fffa50b8..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_Zaber.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef VRPN_ZABER_H -#define VRPN_ZABER_H - -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Analog_Output.h" // for vrpn_Analog_Output -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_RELIABLE, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_int32, vrpn_uint32 - -class VRPN_API vrpn_Zaber: public vrpn_Serial_Analog, public vrpn_Analog_Output -{ -public: - vrpn_Zaber (const char * name, vrpn_Connection * c, - const char * port); - ~vrpn_Zaber () {}; - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - - protected: - unsigned d_expected_chars; //< How many characters to expect in the report - unsigned char d_buffer[512]; //< Buffer of characters in report - unsigned d_bufcount; //< How many characters we have so far - - struct timeval timestamp; //< Time of the last report from the device - struct timeval d_last_poll; //< Time of last poll of the device. - - virtual int reset(void); //< Set device back to starting config - virtual int get_report(void); //< Try to read a report from the device - - bool send_command(unsigned char devicenum, unsigned char cmd, vrpn_int32 data); - bool send_command(unsigned char devnum, unsigned char cmd, unsigned char d0, - unsigned char d1, unsigned char d2, unsigned char d3); - vrpn_int32 convert_bytes_to_reading(const unsigned char *buf); - - /// send report iff changed - virtual void report_changes - (vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - /// send report whether or not changed - virtual void report - (vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE); - - /// Responds to a request to change one of the values by - /// setting the channel to that value. - static int VRPN_CALLBACK handle_request_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Responds to a request to change multiple channels at once. - static int VRPN_CALLBACK handle_request_channels_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Responds to a connection request with a report of the values - static int VRPN_CALLBACK handle_connect_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -#endif diff --git a/src/vrpn/vrpn_android/README.txt b/src/vrpn/vrpn_android/README.txt deleted file mode 100644 index c8d42a44402185fd0c58d6370bfb56e59ce93704..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/README.txt +++ /dev/null @@ -1,97 +0,0 @@ ------------------------------------------------------------ -Getting things compiled and loaded on the Android: - Open Eclipse (after having installed everything according to the instructions that came with the user and design manual and using the notes in the section below). - Select "File/Import..." then "Existing Projects into Workspace", then the "vrpn_android/comp523android" directory. - I did "Project/Clean" and then "Project/Build All"; it can be set to build automatically. - This built the comp523android.apk file in the bin/ directory. - -On Android phone: - Settings/Application Settings/Unknown sources should be checked. - Put the Droid into PC mode (may not be needed) - Plug in USB cable. - Copy the comp523android.apk file to the SD card. - Open the Files app on the Droid. - Go find the file. - Run it. - -On remote machine: - Run vrpn_print_devices giving it the names Analog0, Analog1, Analog2, and Button0, all @tcp: - the IP address listed at the top of the Droid phone when the app is running - (for example: Button0@tcp:192.168.0.17). - Briefly press the "Search" button for button 0. There is a 2D touch pad, a slider, - and accelerometers for analogs (values also shown in the upper-left corner). - There are two more buttons (1 and 2) on the phone GUI as well. - Button0: All three buttons. - Analog0: The touch pad. - Analog1: The slider on the GUI. - Analog2: The Accelerometer. - ------------------------------------------------------------ -Compiling the JNI code: - To turn the C source code into an .so library for linking into the Java code, run ndk-build in the jni subdirectory (where the Android.mk file lives). - Note: After you do this, you need to make clean and then make the project in Eclipse; there are a bunch of errors if you don't make clean first. - - I've not yet figured out how to use javah to create the jni_layer.h file as listed in the manual, but the code compiles fine without it so I think maybe that was a leftover that is no longer needed. I can make the .so and then build the project and then run the resulting executable, so I think we're done! - ------------------------------------------------------------ -Notes made by Russ Taylor as he was working with Eric Boren -to get the code to compile on his laptop: - -Follow the instructions on Developer/Android.com/sdk/installing.html. - Get the stdout connector to help debugging using the log - -You need to run in Android SDK Tools/SDK manager. - Go ahead and let it install what it wants to install. - Also create a new virtual device: Android 2.2 - -Open Eclipse and you need to teach it how to open an Android project. - developer.android.com/sdk/installing.html tells you how to do this. - Installing ADT Plug-In link tells one part: you add from: - https://dl-ssl.google.com/android/eclipse/ - (address depends on version of Eclipse) - If you did this before running SDK manager, you need to update the plug-in. - - Do Window/Preferences/Android/SDK Location and tell it where - the Android SDK directory is. - - Configure the build path on Eclipse (in response to error message in JNILayer.java) - -This lets you do File/New/Android Project. Or File/New and see Android Project - Create from existing source. - Probably from code\comp523android -Or File/Open and open the .project file. - -You don't need to run the javah if you just want to build the project as is. You also don't need to follow the rest of the steps in Com - -Failed to open exiting project: trying new project from source: - File/New/Project/Android Project - Create from existing source - Point at the directory - FAILED -- already a project there. - -Tried to do File/Import/Existing Project - Same problem: "Android requires .class compatibility set to 5.0." -Google says: After importing the project to your workspace, you’ve received the error. So what you need to do next is to right click on the project -> Android Tools -> Fix Project Properties. Now this alone won’t fix the problem, you need to restart Eclipse after this. After that try building the project again and it should work successfully this time (unless you have bugs in the code itself, I did). - -Problem with Override: Google says: - -Eclipse is defaulting to Java 1.5 and you have classes implementing interface methods (which in Java 1.6 can be annotated with @Override, but in Java 1.5 can only be applied to methods overriding a superclass method). - -Go to your project/ide preferences and set the java compiler level to 1.6 and also make sure you select JRE 1.6 to execute your program from eclipse. - -Now it still may show compiler compliance level at 1.6, yet you still see this problem. So now select the link "Configure Project Specific Settings..." and in there you'll see the project is set to 1.5, now change this to 1.6. You'll need to do this for all affected projects. - -(This was under Properties of the right-click menu on the compiler.) - -Upper-right table icon on Eclipse, select Other, then turn on Android DDMS. - -This builds comp523android.apk in the bin directory. - -On Android phone: - Settings/Application Settings/Unknown sources should be checked. - Put the Droid into PC mode (may not be needed) - Plug in USB cable. - Copy the comp523android.apk file to the SD card. - Open the Files app on the Droid. - Go find the file. - Run it. \ No newline at end of file diff --git a/src/vrpn/vrpn_android/comp523android/.classpath b/src/vrpn/vrpn_android/comp523android/.classpath deleted file mode 100644 index b665303bc9b313a169032704e4a26c413ba4bff2..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="gen"/> - <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/src/vrpn/vrpn_android/comp523android/.project b/src/vrpn/vrpn_android/comp523android/.project deleted file mode 100644 index 172a5bc89d7bd84f81728169142ddb7becf961c1..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/.project +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>comp523android</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>com.android.ide.eclipse.adt.ApkBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>com.android.ide.eclipse.adt.AndroidNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/src/vrpn/vrpn_android/comp523android/AndroidManifest.xml b/src/vrpn/vrpn_android/comp523android/AndroidManifest.xml deleted file mode 100644 index eeb1efc4024d658dbfb15476dacb460f6f49af1a..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="edu.unc.cs.vrpn" - android:versionCode="1" - android:versionName="1.0"> - <uses-permission android:name="android.permission.INTERNET" /> - <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> - <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> - <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> - <uses-permission android:name="android.permission.READ_LOGS" /> - <application android:icon="@drawable/vrpn48" android:label="@string/app_name"> - <activity android:name=".Main" - android:label="@string/app_name" android:screenOrientation="portrait"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - </application> -<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission> -</manifest> \ No newline at end of file diff --git a/src/vrpn/vrpn_android/comp523android/debugging.txt b/src/vrpn/vrpn_android/comp523android/debugging.txt deleted file mode 100644 index 11df27de2884c25759bcef575b8be89c7e4eaec3..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/debugging.txt +++ /dev/null @@ -1,53 +0,0 @@ - - -Cases: - - --No connections-- - Emulator running, - app started successfully - app closed - app restarted successfully (no port errors) - - (note, app CAN connect to client after this sequence) - - --With connections(tcp), not closing the android app-- - App running, client connects -> good - App running, client connects and closes and reconnects -> good - App not running, client starts, app starts, client connects -> good - *Here, before the app is started, i DO get the cookie errors... :( - - --With connections(tcp), closing the android app - App starts successfully - client connects succesfully - app closes - cookie errors appear - app cannot reconnect (port in use error on emulator, cookie errors appearing on client log) - - -QUESTIONS - - - Reconnection problem - why? - Show him the test cases and exactly when it breaks. - - Analog servers - Are they fundamentally different from button servers? - -Can we get an example that creates an analog server? - - UDP - can connect and reconnect, but doesnt send analog values. - - -HYPOTHESIS: - - Telnet is messing up the connection because of the redirection stuff. - Accepting connections on 5000, and never communicating to 3883, so client is confused that there's no cookie/connection when server isn't running. - Try this on an actual android. - - 0.0 values in analog -> check byte order. - vrpn_Shared.h -> contains htond function (host to network double), ntohd, need to implement these for android. - -Changes were made to vrpn_Shared.c, line 196 - - UDP not working with analog -> - Check the code where this happens. the error message might be lying to us. - - - - \ No newline at end of file diff --git a/src/vrpn/vrpn_android/comp523android/default.properties b/src/vrpn/vrpn_android/comp523android/default.properties deleted file mode 100644 index 0b9250e021cfaac0bcbf8575a75aab1ec81008f8..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/default.properties +++ /dev/null @@ -1,11 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-8 diff --git a/src/vrpn/vrpn_android/comp523android/jni/Android.mk b/src/vrpn/vrpn_android/comp523android/jni/Android.mk deleted file mode 100644 index 68dffbf951b90d6f8b2718506156a17d6f53c8bc..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/jni/Android.mk +++ /dev/null @@ -1,18 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := vrpn - -LOCAL_SRC_FILES := \ - ../../../vrpn_Analog.c \ - ../../../vrpn_Button.c \ - ../../../vrpn_BaseClass.c \ - ../../../vrpn_Connection.c \ - ../../../vrpn_FileConnection.c \ - ../../../vrpn_Serial.c \ - ../../../vrpn_Shared.c \ - ../../../vrpn_Android.c \ - ../../../jni_layer.cpp \ - -include $(BUILD_SHARED_LIBRARY) diff --git a/src/vrpn/vrpn_android/comp523android/jniInfo.txt b/src/vrpn/vrpn_android/comp523android/jniInfo.txt deleted file mode 100644 index 379dbe1b11ae962b5452ef9c73ba1eecff46e135..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/jniInfo.txt +++ /dev/null @@ -1,88 +0,0 @@ -Instructions for compiling JNI libraries. - -1. Make java file w/ interface methods -2. Cygwin: - -cd $WORKSPACE/jniTest/bin -"$JAVA"/javah -o jni_vrpn_button.h jni.VrpnButton - -3. Move the created .h file into the $CRYSTAX/sources/xxx/jni folder -4. Implement in a .cpp file -5. Update the Android.mk file -6. Cygwin: - -cd $CRYSTAX/sources/xxx -$CRYSTAX/ndk-build - -7. Fix errors, rinse, repeat. - - - -NOTE: To convert jstring to char* : - -char* xxx = strdup(env->GetStringUTFChars(yyy, 0)); - -and back: - -jstring yyy = env->NewStringUTF((xxx).c_str()); - - -NOTE: To call java methods from c++: - - Log example: - - jclass c = env->GetObjectClass(obj); - const char * name = "log"; - const char * type = "(Ljava/lang/String;)V"; - jmethodID method = env->GetMethodID(c, name, type); - env->CallVoidMethod(obj, method, env->NewStringUTF((s).c_str())); - - Note that this calls the method: "void log(String s)" which must exist in the corresponding java class. - -NOTE: To redirect stdio to Android log: - Create a local.prop file. - With the line: log.redirect-stdio=true - Run the emulator and add the file to the /data/ folder. - Restart the emulator. - - -NOTE: Some includes req'd: placed in "android_includes.h" and referenced in "vrpn_Types.h" - Need to find the compiled versions (or source) for these. - - Also had to define __ANDROID__ in ndk/build/toolchains/arm-eabi4.4.0/setup.mk as well as forcing compilation as c++ - -CHANGES TO EXISTING VRPN: - vrpn_Types.h : Added #include for __ANDROID__, lines 4-9 - vrpn_Connection.C : Added __ANDROID___ to ifdef on line 2424 - : Added import "jni_layer" for logging - : Changed lines 3523, 2299, 198 - vrpn_Shared.h : Added extern pointer for logging on line 5 - vrpn_Shared.C : Line 196: added && !defined(__ANDROID__) to the ifdef - ---- Testing the app with echo-apps on your local machine --- - To access the virtual network on the android emulator, you must do port forwarding. - Basic idea is that we'll take a port on our localhost (127.0.0.1) and map it to - a port on the emulators virtual network interface (10.0.2.15) - - To set up port-forwarding, do the following: - - 1) Have your emulator/virtual android instance running - 2) Open a terminal/command prompt (you must have Telnet to do this) - 3) Enter 'telnet localhost 5554'. This will connect you to the emulators console - 4) Enter 'redir add (udp|tcp):xxxx:yyyy', - where: - (udp|tcp) is your choice of either udp or tcp protocol, - xxxx is the port on 127.0.0.1 you want to use (i.e. 127.0.0.1:5000, where xxxx = 5000*) - yyyy is the port on the emulators network interface that you want to listen to (i.e. 10.0.2.15:3883, where yyyy = 3883**) - - * 5000 is just an arbitrary port - ** 3883 is the default port for vrpn to use. This will most likely always be the port you are forwarding to, unless you have - changed something. - - 5) Now you should have port forwarding to the emulator set up. Run your echo/test app with the target as 'name@127.0.0.1:xxxx' - 6) ???? - 7) Profit - - - - \ No newline at end of file diff --git a/src/vrpn/vrpn_android/comp523android/res/drawable-hdpi/icon.png b/src/vrpn/vrpn_android/comp523android/res/drawable-hdpi/icon.png deleted file mode 100644 index 8074c4c571b8cd19e27f4ee5545df367420686d7..0000000000000000000000000000000000000000 Binary files a/src/vrpn/vrpn_android/comp523android/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/src/vrpn/vrpn_android/comp523android/res/drawable-ldpi/icon.png b/src/vrpn/vrpn_android/comp523android/res/drawable-ldpi/icon.png deleted file mode 100644 index 1095584ec21f71cd0afc9e0993aa2209671b590c..0000000000000000000000000000000000000000 Binary files a/src/vrpn/vrpn_android/comp523android/res/drawable-ldpi/icon.png and /dev/null differ diff --git a/src/vrpn/vrpn_android/comp523android/res/drawable-mdpi/icon.png b/src/vrpn/vrpn_android/comp523android/res/drawable-mdpi/icon.png deleted file mode 100644 index a07c69fa5a0f4da5d5efe96eea12a543154dbab6..0000000000000000000000000000000000000000 Binary files a/src/vrpn/vrpn_android/comp523android/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/src/vrpn/vrpn_android/comp523android/res/drawable/gradient.xml b/src/vrpn/vrpn_android/comp523android/res/drawable/gradient.xml deleted file mode 100644 index 9e7610985905f97ea9dd24e1e180c73c33f45fb4..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/res/drawable/gradient.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <gradient android:startColor="@color/myColor" - android:centerColor="@color/black" - android:endColor="@color/black" android:angle="-90"> - </gradient> -</shape> \ No newline at end of file diff --git a/src/vrpn/vrpn_android/comp523android/res/drawable/vrpn48.png b/src/vrpn/vrpn_android/comp523android/res/drawable/vrpn48.png deleted file mode 100644 index 94994ee2068203b036a72c7253c51a4b208542da..0000000000000000000000000000000000000000 Binary files a/src/vrpn/vrpn_android/comp523android/res/drawable/vrpn48.png and /dev/null differ diff --git a/src/vrpn/vrpn_android/comp523android/res/layout/main.xml b/src/vrpn/vrpn_android/comp523android/res/layout/main.xml deleted file mode 100644 index 7338d7bcc6e6365d92d137cad7a3b8fde74ddefd..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/res/layout/main.xml +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" android:layout_width="fill_parent" - android:layout_height="fill_parent" android:background="@color/myColor"> - - <LinearLayout android:orientation="vertical" - android:layout_width="fill_parent" android:layout_height="wrap_content"> - <LinearLayout android:orientation="horizontal" - android:layout_width="wrap_content" android:layout_height="fill_parent"> - <TextView android:text="@string/textView_address" android:id="@+id/ipAddress" - android:layout_width="fill_parent" android:layout_height="wrap_content" - android:textColor="#000000" /> - <TextView android:text="@string/textView_portNumber" android:id="@+id/portNumber" - android:layout_width="fill_parent" android:layout_height="wrap_content" - android:textColor="#000000" android:layout_gravity="right" /> - </LinearLayout> - <TextView android:id="@+id/accelerometerReport" - android:layout_width="fill_parent" android:layout_height="wrap_content" /> - <TextView android:text="@string/textView_track" android:id="@+id/textView_track" - android:layout_width="fill_parent" android:layout_height="wrap_content" /> - <TextView android:text="@string/textView_cordReport" - android:id="@+id/onScreenLog" android:layout_width="fill_parent" - android:layout_height="wrap_content" /> - <TextView android:layout_width="fill_parent" android:id="@+id/touchpad" - android:layout_gravity="top" android:background="@color/myColor" - android:layout_height="600dip" /> - </LinearLayout> - - - <LinearLayout android:orientation="vertical" - android:layout_alignParentBottom="true" android:layout_width="wrap_content" - android:layout_height="wrap_content" android:background="@drawable/gradient"> - <LinearLayout android:orientation="horizontal" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:padding="3dip"> - <Button android:layout_width="157dip" android:layout_height="wrap_content" - android:id="@+id/Button0" android:text="@string/controller_button_00" /> - - <Button android:layout_width="157dip" android:layout_height="wrap_content" - android:id="@+id/Button1" android:text="@string/controller_button_01" /> - </LinearLayout> - - <LinearLayout android:orientation="horizontal" - android:layout_width="314dip" android:layout_height="wrap_content" - android:padding="3dip"> - <SeekBar android:id="@+id/textView_seekBar_01" - android:layout_width="fill_parent" android:layout_height="wrap_content" - android:max="100" android:progress="0" /> - </LinearLayout> - <TextView android:id="@+id/spacer" android:background="@color/black" android:layout_height="15dip" android:layout_width="fill_parent"></TextView> - </LinearLayout> -</RelativeLayout> diff --git a/src/vrpn/vrpn_android/comp523android/res/menu/controller_menu.xml b/src/vrpn/vrpn_android/comp523android/res/menu/controller_menu.xml deleted file mode 100644 index 4b2d03efa904a0f94ff8f4809f3435877e19d6ae..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/res/menu/controller_menu.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu - xmlns:android="http://schemas.android.com/apk/res/android"> - -<item android:id="@+id/calibrate" android:title="Calibrate"></item> -<item android:id="@+id/exit" android:title="Exit"></item> -</menu> diff --git a/src/vrpn/vrpn_android/comp523android/res/values/strings.xml b/src/vrpn/vrpn_android/comp523android/res/values/strings.xml deleted file mode 100644 index 85e6cfe58f4095afebedcc7252a6ccebca240f8c..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/res/values/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="hello">Hello World, Main!</string> - <string name="app_name">VRPN Controller</string> -<string name="rotate">Rotate</string> -<string name="controller_button_00">Button 1</string> -<string name="controller_button_01">Button 2</string> -<string name="textView_cordReport">x: , y: </string> -<string name="textView_incReport">Int: </string> -<color name="myColor">#3399CC</color> -<string name="textView_address">IP Address:</string> -<string name="textView_seekBar_01">Bar</string> -<string name="textView_track">TRACKING</string> -<string name="ip_address">IP Address: %s</string> -<color name="black">#000</color> -<string name="textView_portNumber">Port Number:</string> - -<string name="port_number">:%s</string> -</resources> diff --git a/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/AccelerometerListener.java b/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/AccelerometerListener.java deleted file mode 100644 index d7c340a623ebe34ac124d9343f9bb48ddacd7840..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/AccelerometerListener.java +++ /dev/null @@ -1,80 +0,0 @@ -package edu.unc.cs.vrpn; - -import jni.JniLayer; -import android.hardware.Sensor; -import android.hardware.SensorEvent; -import android.hardware.SensorEventListener; - -/** - * Handles input from the phone's accelerometer. - * - * @author Ted - * - */ -public class AccelerometerListener implements SensorEventListener -{ - private JniBuilder builder; - private JniBuilder.Analog accelerometer; - private JniLayer layer; - private int cachedJniValue; - private String last = ""; - private Main activity; - - public AccelerometerListener(JniBuilder builder, JniBuilder.Analog accelerometer) - { - this.builder = builder; - this.accelerometer = accelerometer; - if (this.builder.isLocked()) - { - this.layer = this.builder.toJni(); - } - - this.cachedJniValue = this.builder.getAnalogIndex(this.accelerometer); - } - - public AccelerometerListener(JniBuilder builder, JniBuilder.Analog accelerometer, Main activity) - { - this.builder = builder; - this.accelerometer = accelerometer; - if (this.builder.isLocked()) - { - this.layer = this.builder.toJni(); - } - - this.cachedJniValue = this.builder.getAnalogIndex(this.accelerometer); - this.activity = activity; - } - - @Override - public void onAccuracyChanged(Sensor sensor, int accuracy) - { - - } - - @Override - public void onSensorChanged(SensorEvent event) - { - if (this.layer == null && this.builder.isLocked()) - { - this.layer = this.builder.toJni(); - } - - for (int i = 0, stop = (int) Math.min(this.accelerometer.getChannels() , event.values.length), analog = this.cachedJniValue; i < stop; i++) - { - this.layer.updateAnalogVal(analog , i , event.values[i]); - } - - this.layer.reportAnalogChg(this.cachedJniValue); - - if (this.activity != null) - { - String report = String.format("{%.2f, %.2f, %.2f}" , event.values[0], event.values[1], event.values[2]); - if (!report.equals(this.last)) - { - this.activity.logAccelerometer(report); - this.last = report; - } - } - } - -} diff --git a/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/ButtonListener.java b/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/ButtonListener.java deleted file mode 100644 index 6bffd471b70b0f223ab9cf91f7d2b57a099c1d22..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/ButtonListener.java +++ /dev/null @@ -1,61 +0,0 @@ -package edu.unc.cs.vrpn; - -import jni.JniLayer; -import android.util.Log; -import android.view.MotionEvent; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.View.OnTouchListener; - -/** - * Button event listener. - * - * @author Ted - * - */ -public class ButtonListener implements OnTouchListener, OnClickListener -{ - private JniBuilder.Button button; - private int buttonNumber; - private JniLayer jniLayer; - - /** - * Creates a new instance of the {@link ButtonListener} class, connecting to a given - * button number in the JNI layer - * - * @param buttonNumber - the number that the JNI layer will pass to VRPN - * @param jniCallback - the JNI Layer which will connect to VRPN clients - */ - public ButtonListener(int buttonNumber, JniLayer jniCallback) - { - this(null , buttonNumber , jniCallback); - } - - public ButtonListener(JniBuilder.Button button, int buttonNumber, JniLayer jniCallback) - { - this.button = button; - this.buttonNumber = buttonNumber; - this.jniLayer = jniCallback; - } - - @Override - public void onClick(View v) - { - Log.d(Main.TAG , (this.button != null ? this.button.getName() + " (button " : "Button (") - + this.buttonNumber + ") clicked"); - } - - @Override - public boolean onTouch(View view, MotionEvent event) - { - switch (event.getAction()) { - case MotionEvent.ACTION_DOWN: - this.jniLayer.updateButtonStatus(this.buttonNumber , true); - break; - case MotionEvent.ACTION_UP: - this.jniLayer.updateButtonStatus(this.buttonNumber , false); - break; - } - return false; - } -} diff --git a/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/JniBuilder.java b/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/JniBuilder.java deleted file mode 100644 index 69619949d70484415a2fae166035defdfd7cbf57..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/JniBuilder.java +++ /dev/null @@ -1,238 +0,0 @@ -package edu.unc.cs.vrpn; - -import java.util.LinkedList; -import java.util.List; - -import jni.JniLayer; - -/** - * Represents an unbuilt JNI translator. - * - * @author Ted - * - */ -public class JniBuilder -{ - /** - * Represents a VRPN analog input - * - * @author Ted - * - */ - public static class Analog - { - private String name; - private int channels; - - /** - * Initializes a new instance of the {@link JniBuilder.Analog} class. - * - * @param name - * - The name of the new analog input - * @param channels - * - The number of channels the new analog will have - * @throws IllegalArgumentException - * - Thrown if {@code channels} < 0 - */ - public Analog(String name, int channels) - { - this.setName(name); - this.setChannels(channels); - } - - /** - * Initializes a new instance of the {@link JniBuilder.Analog} class with an - * auto-generated name. - * - * @param channels - * - The number of channels the new analog will have - * @throws IllegalArgumentException - * - Thrown if {@code channels} < 0 - */ - public Analog(int channels) - { - this("Unnamed " + channels + "-dimensional analog" , channels); - } - - public int getChannels() - { - return channels; - } - - public String getName() - { - return name; - } - - /** - * Sets the number of channels for this analog - * - * @param channels - * - The number of channels (dimensions) of the analog. This is 1 for a - * slider, 2 for a 2D input, or 3 for a 3D input - * @throws IllegalArgumentException - * - Thrown if {@code channels} < 0 - */ - private void setChannels(int channels) - { - if (channels < 0) - throw new IllegalArgumentException("Analog must have 0 or more channels: Was " + channels); - - this.channels = channels; - } - - private void setName(String name) - { - this.name = name; - } - - @Override - public String toString() - { - return String.format("%s (%d channel analog)" , this.getName() , this.getChannels()); - } - } - - /** - * Represents a VRPN button input - * @author Ted - * - */ - public static class Button - { - private String name; - - // if a button is not given a name, this value is - // incremented and assigned. Purely for logging - private static int unnamedCount = 0; - - /** - * Initializes a new instance of the Button class with the given button name. - * @param name - the name to be given to this button. - */ - public Button(String name) - { - if (name == null || name.trim().equals("")) - name = "Unnamed Button #" + Button.unnamedCount++; - - this.setName(name); - } - - /** - * Initializes a new instance of the Button class with an auto-generated name. - */ - public Button() - { - this(null); - } - - public String getName() - { - return name; - } - - private void setName(String value) - { - this.name = value; - } - - @Override - public String toString() - { - return this.getName() + " (button)"; - } - } - - private static final int DEFAULT_PORT = 3883; - private List<Analog> analogs = new LinkedList<Analog>(); - private List<Button> buttons = new LinkedList<Button>(); - private JniLayer jni = null; - private int port = DEFAULT_PORT; - - public JniBuilder() - { - - } - - public void add(Analog... analogs) - { - if (this.jni != null) - throw new IllegalStateException("Cannot alter builder after JNI has been instantiated"); - - for (Analog analog : analogs) - if (analog != null) - this.analogs.add(analog); - } - - public void add(Button... buttons) - { - if (this.jni != null) - throw new IllegalStateException("Cannot alter builder after JNI has been instantiated"); - - for (Button button : buttons) - if (button != null) - this.buttons.add(button); - } - - public Analog getAnalog(int number) - { - return this.analogs.get(number); - } - - public int getAnalogIndex(Analog analog) - { - return this.analogs.indexOf(analog); - } - - public int getButtonIndex(Button button) - { - return this.buttons.indexOf(button); - } - - public Button getButton(int number) - { - return this.buttons.get(number); - } - - public void setPort(int port) - { - this.port = port; - } - - public int getPort() - { - return this.port; - } - - /** - * Gets a JNI translator instance for the builder - * @return - */ - public JniLayer toJni() - { - if (this.jni == null) - { - int[] analogs = new int[this.analogs.size()]; - int numButtons = this.buttons.size(); - - for (int i = 0; i < analogs.length; i++) - { - analogs[i] = this.analogs.get(i).getChannels(); - } - - this.jni = new JniLayer(analogs , numButtons, port); - } - - return this.jni; - } - - /** - * Gets whether or not the Builder is currently accepting changes (if a JNI layer has been instantiated from the builder) - * @return - */ - public boolean isLocked() - { - return this.jni != null; - } - -} diff --git a/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/Main.java b/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/Main.java deleted file mode 100644 index 413465c345303a577f69563fbaeddca0c068dd81..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/Main.java +++ /dev/null @@ -1,513 +0,0 @@ -package edu.unc.cs.vrpn; - -import java.io.IOException; -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.net.ServerSocket; -import java.net.SocketException; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.List; -import java.util.Timer; -import java.util.TimerTask; - -import jni.JniLayer; -import android.app.Activity; -import android.app.ProgressDialog; -import android.content.Context; -import android.hardware.Sensor; -import android.hardware.SensorEventListener; -import android.hardware.SensorManager; -import android.os.Bundle; -import android.os.Handler; -import android.os.PowerManager; -import android.os.PowerManager.WakeLock; -import android.util.Log; -import android.view.KeyEvent; -import android.view.MotionEvent; -import android.view.View; -import android.view.Window; -import android.view.View.OnTouchListener; -import android.widget.Button; -import android.widget.SeekBar; -import android.widget.TextView; - -/** - * The remote activity for the Android VRPN controller. This class is not very - * pretty, but is the glue which holds the server together. - * - * @author UNC VRPN Team - * - */ -public class Main extends Activity implements OnTouchListener -{ - /** - * The interval (in milliseconds) between calls to vrpn's mainloop() - * functions. Calling these on a timer prevents the client application - * from complaining that it hasn't heard from the Android server. - */ - public static final int IDLE_INTERVAL = 1000; - - /** - * The Tag used by this class for logging - */ - static final String TAG = "VRPN"; - - /** - * The buttons on the default on-screen interface - */ - private ArrayList<Button> buttons; - - /** - * The horizontal seek bar of the default on-screen interface - */ - private SeekBar seekBar1; - - /** - * The text area where multitouch coordinates are displayed - */ - private TextView multitouchReport; - - /** - * The text area where the device's IP address will be displayed - */ - private TextView ipAddressReport; - - /** - * The text area where the device's port number will be displayed - */ - private TextView portNumberReport; - - /** - * The text area where the Seek Bar data will be displayed - */ - private TextView seekbarReport; - - /** - * The text area where the Accelerometer data will be displayed - */ - private TextView accelerometerReport; - - /** - * The listener for the hardware accelerometer - */ - private SensorEventListener listener; - - /** - * The timer that calls mainloop to persist the connection - */ - private Timer idleTimer; - - /** - * Gets the sensor manager in use by the activity. - */ - private SensorManager sensorManager; - - /** - * The connection between Java and the C++ world of VRPN, using Android's Java Native - * Interface, called the JNI - */ - private JniLayer jniLayer; - - /** - * The JNI creator object - */ - private JniBuilder builder; - - /** - * Analog channel for multitouch data - */ - private JniBuilder.Analog multitouch; - - /** - * Analog channel for accelerometer data - */ - private JniBuilder.Analog accelerometer; - - - private int multitouchAnalogNumber; - - /** - * This prevents the phone from sleeping while the app is running. Is acquired in the - * onResume event and released during onPause - */ - private WakeLock wakeLock; - - /** - * Listener for the Seek Bar data - */ - private SeekBar.OnSeekBarChangeListener seekBarChangeListener; - - private ProgressDialog waitingForConnectionDialog; - - @Override - public void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - requestWindowFeature(Window.FEATURE_NO_TITLE); - super.setContentView(R.layout.main); - - TextView view = (TextView) findViewById(R.id.touchpad); - view.setOnTouchListener(this); - - this.multitouchReport = (TextView) findViewById(R.id.onScreenLog); - this.ipAddressReport = (TextView) findViewById(R.id.ipAddress); - this.portNumberReport = (TextView) findViewById(R.id.portNumber); - this.accelerometerReport = (TextView) findViewById(R.id.accelerometerReport); - this.seekbarReport = (TextView) findViewById(R.id.textView_track); - - this.buttons = new ArrayList<Button>(); - this.buttons.add((Button) findViewById(R.id.Button0)); - this.buttons.add((Button) findViewById(R.id.Button1)); - - JniBuilder.Analog slider = new JniBuilder.Analog("Slider" , 1); - this.multitouch = new JniBuilder.Analog("Multitouch" , 2); - this.accelerometer = new JniBuilder.Analog("Accelerometer" , 3); - - this.builder = new JniBuilder(); - this.builder.add(this.multitouch , slider , this.accelerometer); - this.builder.add(new JniBuilder.Button("Search") , new JniBuilder.Button() , new JniBuilder.Button()); - - // the JNI Layer must be instantiated before the ButtonTouchListeners are created - this.jniLayer = builder.toJni(); - - this.multitouchAnalogNumber = this.builder.getAnalogIndex(this.multitouch); - this.seekBar1 = (SeekBar) findViewById(R.id.textView_seekBar_01); - this.seekBarChangeListener = new VrpnSeekBarChangeListener(this.builder , slider , this); - this.seekBar1.setOnSeekBarChangeListener(this.seekBarChangeListener); - - this.setupButtons(this.buttons); - - PowerManager pm = (PowerManager) super.getSystemService(Context.POWER_SERVICE); - this.wakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK , Main.TAG); - } - - @Override - public boolean onKeyDown(int keyCode, KeyEvent event) - { - if (keyCode == KeyEvent.KEYCODE_SEARCH) - { - String message = "Search button " - + ((event.getFlags() & KeyEvent.FLAG_LONG_PRESS) != 0 ? "long " : "") + "pressed"; - Log.i(Main.TAG , message); - this.logText(message); - this.jniLayer.updateButtonStatus(0 , true); - return true; - } - - return super.onKeyDown(keyCode , event); - } - - @Override - public boolean onKeyUp(int keyCode, KeyEvent event) - { - if (keyCode == KeyEvent.KEYCODE_SEARCH) - { - String message = "Search button released"; - Log.i(Main.TAG , message); - this.logText(message); - this.jniLayer.updateButtonStatus(0 , false); - // finish(); - //android.os.Process.killProcess(android.os.Process.myPid()); - return true; - } - return super.onKeyUp(keyCode , event); - } - - @Override - public void onPause() - { - super.onPause(); - - if (this.idleTimer != null) - { - this.idleTimer.cancel(); - } - - if (this.listener != null) - { - this.sensorManager.unregisterListener(this.listener); - } - - this.sensorManager = null; - - // disconnect from the JNI-VRPN bridge, and release the WakeLock to - // allow the phone to sleep - this.wakeLock.release(); - jniLayer.stop(); - } - - @Override - public void onResume() - { - super.onResume(); - this.setupVrpn(); - } - - class WaitingForConnectionThread extends Thread - { - Handler handler; - - public WaitingForConnectionThread(Handler handler) - { - super(); - this.handler = handler; - } - - public void run() - { - // this is the hack to allow reconnection to the client - // after a disconnect. the hack polls for a open port, - // and loops until the port is open/free'd by GC. - boolean stop = false; - ServerSocket server = null; - while (!stop) - { - try - { - server = new ServerSocket(jniLayer.getPort()); - Log.i(TAG, "Connection found!"); - server.close(); - stop = true; - } - catch(IOException e) - { - if (waitingForConnectionDialog != null) - { - - } - Log.v(TAG, "Connecting..."); - try { - Thread.sleep(1000); - } catch (InterruptedException e1) { - - } - } - } - - jniLayer.start(); - try { - Thread.sleep(250); - } catch (InterruptedException e) { - - } - handler.post(new GotConnectionThread()); - } - } - - class GotConnectionThread extends Thread { - public void run() - { - if (waitingForConnectionDialog != null) - { - waitingForConnectionDialog.dismiss(); - } - } - } - - - /** - * Creates/recreates the JniLayer and attaches the phone's sensors. - * The content of this method was moved from onResume() - */ - public void setupVrpn() - { - //////// This bit of code opens a new thread in case we need to wait for Dalvik to free up the port ////////// - waitingForConnectionDialog = ProgressDialog.show(Main.this , "" , "Connecting..." , true); - Handler handler = new Handler(); - new WaitingForConnectionThread(handler).start(); - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - this.sensorManager = (SensorManager) this.getSystemService(SENSOR_SERVICE); - List<Sensor> sensors = this.sensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER); - if (!sensors.isEmpty()) - { - this.listener = new AccelerometerListener(this.builder , this.accelerometer , this); - boolean accelerationSupported = this.sensorManager.registerListener(this.listener , - sensors.get(0) , SensorManager.SENSOR_DELAY_UI); - if (!accelerationSupported) - { - Log.w(Main.TAG , "Accelerometer offline"); - this.multitouchReport.setText("Accelerometer offline"); - } - else - { - this.multitouchReport.setText("Accelerometer online"); - } - } - else - { - Log.w(Main.TAG , "Accelerometer not found"); - this.multitouchReport.setText("Accelerometer not found"); - } - - Log.i(TAG , "Retrieving IP Address..."); - - // load the IP Address string from - this.ipAddressReport.setText(String.format(super.getString(R.string.ip_address) , this.getIpAddress())); - - this.portNumberReport.setText(String.format(super.getString(R.string.port_number) , - Integer.toString(jniLayer.getPort()))); - - this.wakeLock.acquire(); - - // setup the idle timer - this.idleTimer = new Timer(); - this.idleTimer.schedule(new TimerTask() { - @Override - public void run() - { - sendIdle(); - } - - } , IDLE_INTERVAL, IDLE_INTERVAL); - - Log.i(TAG, "setupVrpn finished"); - } - - @Override - public boolean onTouch(View v, MotionEvent event) - { - this.transmitEvent(event); - this.setMultitouchReport(event); - return true; - } - - /** - * Calls the vrpn connection's mainLoop to send an empty message to persist the - * connection. - */ - public void sendIdle() - { - this.jniLayer.mainLoop(); - } - - /** - * Gets IP address of device. Copied from - * http://www.droidnova.com/get-the-ip-address-of-your-device,304.html - * - * @return The IP address of the Droid - */ - private String getIpAddress() - { - try - { - for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) - { - NetworkInterface intf = en.nextElement(); - for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) - { - InetAddress inetAddress = enumIpAddr.nextElement(); - if (!inetAddress.isLoopbackAddress()) { return inetAddress.getHostAddress().toString(); } - } - } - } - catch(SocketException ex) - { - Log.e(TAG , ex.toString()); - } - return null; - } - - private void transmitEvent(MotionEvent event) - { - this.jniLayer.updateAnalogVal(this.multitouchAnalogNumber , 0 , event.getX()); - this.jniLayer.updateAnalogVal(this.multitouchAnalogNumber , 1 , event.getY()); - this.jniLayer.reportAnalogChg(this.multitouchAnalogNumber); - } - - /** - * Update the text on the screen to show the x and y coordinate - * Multitouch data - * - * @param event - * The event which updates the multitouch report - */ - private void setMultitouchReport(MotionEvent event) - { - String x; - float xVal = event.getX(); - if (xVal >= 0 && xVal < 10) - { - x = " " + xVal; - } - else if (xVal >= 10 && xVal < 100) - { - x = " " + xVal; - } - else if (xVal >= 100) - { - x = "" + xVal; - } - else - { - x = " 0.0"; - } - - String y; - float yVal = event.getY(); - if (yVal >= 0 && yVal < 10) - { - y = " " + yVal; - } - else if (yVal >= 10 && yVal < 100) - { - y = " " + yVal; - } - else if (yVal >= 100) - { - y = "" + yVal; - } - else - { - y = " 0.0"; - } - - this.logText("x: " + x + ", y: " + y); - } - - /** - * Updates text to be displayed in the multitouch textview - * - * @param message the message to display on the screen - */ - private void logText(String message) - { - this.multitouchReport.setText(message); - } - - /** - * This method sets up and initializes all the button event listeners - * - * @param buttons list of buttons to be initialized - */ - private void setupButtons(List<Button> buttons) - { - for (int i = 1, len = buttons.size(); i <= len; i++) - { - ButtonListener bl = new ButtonListener(this.builder.getButton(i) , i , this.jniLayer); - buttons.get(i - 1).setClickable(true); - buttons.get(i - 1).setOnTouchListener(bl); - } - } - /** - * Updates text to be displayed in the accelerometerReport - * textview. - * - * @param message the message to display on the screen - */ - void logAccelerometer(String message) - { - this.accelerometerReport.setText(message); - } - /** - * Updates text to be displayed in the seekbarReport textview. - * - * @param message the message to display on the screen - */ - void logSlider(String message) - { - this.seekbarReport.setText(message); - } -} \ No newline at end of file diff --git a/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/VrpnSeekBarChangeListener.java b/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/VrpnSeekBarChangeListener.java deleted file mode 100644 index c4d9472452e72f38667d9387f47cddfc6aafbc02..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/src/edu/unc/cs/vrpn/VrpnSeekBarChangeListener.java +++ /dev/null @@ -1,86 +0,0 @@ -package edu.unc.cs.vrpn; - -import jni.JniLayer; -import android.widget.SeekBar; - -/** - * Track changes to the value of a seek bar and notify VRPN clients. This code is fairly - * self-explanatory and seekbar-specific, so it is not documented as extensively as - * {@link Main} and {@link JniBuilder} - * - * @author Ted - * - */ -public class VrpnSeekBarChangeListener implements SeekBar.OnSeekBarChangeListener -{ - /** - * The JniBuilder which has an analog for this seekbar - */ - private JniBuilder builder; - /** - * The JniLayer which {@link VrpnSeekBarChangeListener#builder} created - */ - private JniLayer layer = null; - /** - * A reference to this seekbar analog from {@link VrpnSeekBarChangeListener#builder}. - * This could be recreated by going to that object, but it is cached here. - */ - private JniBuilder.Analog analog; - /** - * Another cached JniBuilder value - */ - private int cachedAnalog; - - /** - * It is necessary for the SeekBarChangeListener to have a reference to the - * {@link Main} activity. For obvious reasons this is not particularly loosely-coupled - * so it would be best to refactor this before attempting serious modifications. - */ - private Main activity = null; - private String msg; - - public VrpnSeekBarChangeListener(JniBuilder builder, JniBuilder.Analog analog) - { - this.builder = builder; - this.analog = analog; - this.cachedAnalog = this.builder.getAnalogIndex(this.analog); - if (this.builder.isLocked()) - this.layer = builder.toJni(); - } - - public VrpnSeekBarChangeListener(JniBuilder builder, JniBuilder.Analog analog, Main activity) - { - this(builder , analog); - this.activity = activity; - } - - @Override - public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) - { - this.layer.updateAnalogVal(this.cachedAnalog , 0 , progress); // Should compute - // these - this.layer.reportAnalogChg(this.cachedAnalog); - if (this.activity != null) - { - this.msg = "Seek bar at " + progress + "%"; - this.activity.logSlider(msg); - } - } - - @Override - public void onStartTrackingTouch(SeekBar seekBar) - { - if (this.activity != null) - this.activity.logSlider("Seekbar Pressed"); - } - - @Override - public void onStopTrackingTouch(SeekBar seekBar) - { - if (this.activity != null) - { - this.activity.logSlider(this.msg + " (released)"); - } - } - -} diff --git a/src/vrpn/vrpn_android/comp523android/src/jni/JniLayer.java b/src/vrpn/vrpn_android/comp523android/src/jni/JniLayer.java deleted file mode 100644 index 0f99c3db389d18c55be089541253838ac201f500..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/src/jni/JniLayer.java +++ /dev/null @@ -1,164 +0,0 @@ -package jni; - -import android.util.Log; - -/** - * Represents the connection between the Java user-interface code and the C++ VRPN code - * @author Eric Boren - * - */ -public class JniLayer -{ - static - { - try - { - Log.i("JNI", "Trying to load libvrpn.so"); - System.loadLibrary("vrpn"); - } - catch (UnsatisfiedLinkError ule) - { - Log.e("JNI", "WARNING: Could not load libvrpn.so"); - } - } - - private static final String TAG = "JNI Layer"; - private long cppPointer; - private int numButtons; - private int [] analogs; - private boolean running = false; - private int port; - - /** - * Instantiates a new JniLayer, for communication between this Android app and the VRPN network. - * Should only be called from JniBuilder. - * - * @param analogs - an array representing the number of channels in each analog server - * @param numButtons - the number of buttons used by the app - * @param port - the port number to use for connections - */ - public JniLayer(int[] analogs, int numButtons, int port) - { - this.numButtons = numButtons; - this.analogs = analogs; - this.port = port; - } - - /** - * Instantiates VRPN servers on the C++ side and opens a connection. - */ - public void start() - { - if (!this.running) - { - this.cppPointer = jni_layer_initialize(this.analogs, this.numButtons, this.port); - Log.i(TAG, "Created JniLayer at address: " + this.cppPointer); - if (this.cppPointer != 0) - { - this.running = true; - } - } - } - - /** - * Deconstructs all objects on the C++ side and closes the connection. - * This is necessary any time the app loses focus. - */ - public void stop() - { - if (this.running) - { - jni_layer_kill(this.cppPointer); - this.running = false; - this.cppPointer = 0L; - } - } - - /** - * Is the Android server on the C++ side instantiated? - * @return - whether or not the VRPN Android Server is up and running - */ - public boolean isRunning() - { - return this.running; - } - - /** - * Calls the mainloop() method on the VRPN Android Server. This initiates - * the sending of data to the client, and should be called at least once - * every three seconds in order to prevent the client from complaining, even - * if no data has changed. - */ - public void mainLoop() - { - if (this.running) - { - jni_layer_mainloop(cppPointer); - } - } - - /** - * Sets the status (up or down) of a given button. True for button down, false for button up. - * @param buttonId - the button whose status to update - * @param state - whether to set the button's status to pressed (true) or not pressed (false) - */ - public void updateButtonStatus(int buttonId, boolean state) - { - if (this.running) - { - jni_layer_set_button(cppPointer, buttonId, (state == true ? 1 : 0)); - mainLoop(); - } - } - - /** - * Sets the value for the specified channel in the specified analog server. - * - * @param analogId - The identifier of the analog server to update - * @param channel - Which channel (or dimension) of the analog to pass the value - * @param val - The new value - */ - public void updateAnalogVal(int analogId, int channel, float val) - { - if (this.running) - { - jni_layer_set_analog(cppPointer, analogId, channel, val); - mainLoop(); - } - } - - - /** - * Forces a data report to be sent from the given analog server, even if the value has not changed. - * - * @param analogId - The identifier of the analog server for which to report a value - */ - public void reportAnalogChg(int analogId) - { - if (this.running) - { - jni_layer_report_analog_chg(cppPointer, analogId); - mainLoop(); - } - } - - /** - * Returns the port number which is being used. - * - * @return port - the port which is in use - */ - public int getPort() - { - return port; - } - - /* - * These are JNI calls to the corresponding C++ objects. - */ - private native long jni_layer_initialize(int[] numAnalogChannels, int numButtons, int port); - private native void jni_layer_mainloop(long pointer); - private native void jni_layer_set_button(long pointer, int buttonId, int state); - private native void jni_layer_set_analog(long pointer, int analogId, int channel, float val); - private native void jni_layer_report_analog_chg(long pointer, int analogId); - private native void jni_layer_kill(long pointer); -} diff --git a/src/vrpn/vrpn_android/comp523android/todo.txt b/src/vrpn/vrpn_android/comp523android/todo.txt deleted file mode 100644 index e65eb34ee191c3ea21a0d06187e511a7ee312cc6..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/comp523android/todo.txt +++ /dev/null @@ -1,7 +0,0 @@ -TODO: - -5) Add everything to GIT - -6) UI - Move value reports - try to fit on one line, fit to same width - -7) Name formats for credits page \ No newline at end of file diff --git a/src/vrpn/vrpn_android/cpp_doc.htm b/src/vrpn/vrpn_android/cpp_doc.htm deleted file mode 100644 index 8687d6c9d27aded75a21bc46cd6153d804349181..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/cpp_doc.htm +++ /dev/null @@ -1,66 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<!-- saved from url=(0046)http://www.unc.edu/~boren/comp523/cpp_doc.html --> -<HTML><HEAD> -<META content="text/html; charset=windows-1252" http-equiv=Content-Type> -<STYLE type=text/css>CODE { - WHITE-SPACE: nowrap; FONT-SIZE: 16px -} -LI { - MARGIN-BOTTOM: 10px -} -</STYLE> - -<META name=GENERATOR content="MSHTML 8.00.6001.18999"></HEAD> -<BODY> -<H1>vrpn_Android_Server</H1> -<P>This is an Android server implementation. It has as members a -<CODE>vrpn_Button_Server</CODE> and some number of -<CODE>vrpn_Analog_Servers</CODE>, as determined by the Java side. This -implementation also has <CODE>vrpn_Button_Remote</CODE> and -<CODE>vrpn_Analog_Remote</CODE> clients for the sole purpose of testing. All -data from the Android is represented here as either Analogs or Buttons. </P> -<P>All interaction between this class and the Java side are handled by the jni -layer. </P> -<P>It's worth noting that it is possible to pipe stdout to the Android log - -directions for doing so are in the manual for this project - and all output is -in the form of: <CODE>fprintf(stderr, "...")</CODE>, which we've found to be -more reliable than other methods, including <CODE>fprintf(stdout, "...")</CODE>. -</P> -<H2>class vrpn_Android_Server:</H2> -<H3>public members:</H3> -<UL> - <LI><CODE>vrpn_Android_Server(vrpn_int32 num_analogs, vrpn_int32 * - analog_sizes, vrpn_int32 num_buttons, vrpn_int32 port);</CODE><BR>Constructor. - Takes an array of integers representing the number of channels for each analog - server, the number of buttons, and the port number. - <LI><CODE>~vrpn_Android_Server();</CODE><BR>Destructor. - <LI><CODE>void mainloop();</CODE><BR>Main loop to be called at every time - step. Calls the <CODE>mainloop()</CODE> functions of the member servers. - <LI><CODE>void set_analog(vrpn_int32 analog_id, vrpn_int32 channel, - vrpn_float64 val);</CODE><BR>Set the value for the given channel of the given - vrpn_Analog_Server - <LI><CODE>void set_button(vrpn_int32 button_id, vrpn_int32 - state);</CODE><BR>Set the value for the given button - <LI><CODE>void report_analog_chg(vrpn_int32 analog_id);</CODE><BR>Called when - changes are made to any of the analog values </LI></UL> -<H3>private members:</H3> -<UL> - <LI><CODE>void initialize(vrpn_int32 num_analogs, vrpn_int32 * analog_sizes, - vrpn_int32 num_buttons);</CODE><BR>Sets up the member servers - <LI><CODE>const char * ANALOG_SERVER_NAME;</CODE> - <LI><CODE>const char * BUTTON_SERVER_NAME;</CODE><BR>Names of the member - servers. Only used by the local clients - <LI><CODE>vrpn_int32 num_analogs;</CODE><BR>Number of vrpn_Analog_Servers - <LI><CODE>vrpn_int32 * analog_sizes;</CODE><BR>Array of numbers of channels in - the analog servers - <LI><CODE>vrpn_Analog_Server ** analog_server;</CODE><BR>Handles multi-touch x - and y as well as any sliders, dials, etc - <LI><CODE>vrpn_Button_Server * button_server;</CODE><BR>Handles all button - press data - <LI><CODE>vrpn_Analog_Remote ** analog_client;</CODE> - <LI><CODE>vrpn_Button_Remote * button_client;</CODE><BR>Local test clients, - used for testing only. - <LI><CODE>vrpn_Connection * connection;</CODE><BR>The connection over which - data from the phone is sent - <LI><CODE>vrpn_int32 port;</CODE><BR>The port over which the - <CODE>vrpn_Connection</CODE> communicates </LI></UL><PRE></PRE></BODY></HTML> diff --git a/src/vrpn/vrpn_android/index.htm b/src/vrpn/vrpn_android/index.htm deleted file mode 100644 index d232063ee510d1aff374b92995ea22174b469755..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_android/index.htm +++ /dev/null @@ -1,41 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<!-- saved from url=(0034)http://www.unc.edu/~boren/comp523/ --> -<HTML><HEAD> -<META content="text/html; charset=windows-1252" http-equiv=Content-Type> -<STYLE type=text/css>H1 { - MARGIN: 20px; DISPLAY: inline; VERTICAL-ALIGN: 100% -} -IMG { - MARGIN: 20px -} -</STYLE> - -<META name=GENERATOR content="MSHTML 8.00.6001.18999"></HEAD> -<BODY><IMG src="index_files/vrpn48.png"> -<H1>VRPN Android Controller Documentation</H1> -<H2>Manual</H2> -<UL> - <LI><A href="manuals/manual.pdf">Access the User and Developer Manuals</A> </LI> - <LI><a href="manuals/User%20Manuals.docx">Access the original Doc file for the - manuals</a></LI> -</UL> -<H2>README.txt file to get you started along with the manual</H2> -<ul> - <li><a href="README.txt">Access the README.txt</a> </li> -</ul> -<h2></h2> -<H2>Design Document</H2> -<UL> - <LI><A href="manuals/designdoc.pdf">Access the Design Document</A> </LI> -</UL> -<H2>Functional Specification</H2> -<UL> - <LI><A href="manuals/functionalspec.pdf">Access the Functional Spec</A> </LI> -</UL> -<H2>Android Javadoc</H2> -<UL> - <LI><A href="http://www.unc.edu/~boren/comp523/doc/index.html">Read the Java documentation here</A> </LI></UL> -<H2>C++ Documentation</H2> -<UL> - <LI><A href="cpp_doc.htm">Read the C++ documentation here</A> </LI> -</UL></BODY></HTML> diff --git a/src/vrpn/vrpn_android/index_files/vrpn48.png b/src/vrpn/vrpn_android/index_files/vrpn48.png deleted file mode 100644 index 94994ee2068203b036a72c7253c51a4b208542da..0000000000000000000000000000000000000000 Binary files a/src/vrpn/vrpn_android/index_files/vrpn48.png and /dev/null differ diff --git a/src/vrpn/vrpn_android/manuals/User Manuals.docx b/src/vrpn/vrpn_android/manuals/User Manuals.docx deleted file mode 100644 index 47943ac4d1a76f83c4b6226f1bc017d7a7e81f7a..0000000000000000000000000000000000000000 Binary files a/src/vrpn/vrpn_android/manuals/User Manuals.docx and /dev/null differ diff --git a/src/vrpn/vrpn_android/manuals/designdoc.pdf b/src/vrpn/vrpn_android/manuals/designdoc.pdf deleted file mode 100644 index 75c36d299c5fffaf8b7dd6b19f39f09e307a41a2..0000000000000000000000000000000000000000 Binary files a/src/vrpn/vrpn_android/manuals/designdoc.pdf and /dev/null differ diff --git a/src/vrpn/vrpn_android/manuals/functionalspec.pdf b/src/vrpn/vrpn_android/manuals/functionalspec.pdf deleted file mode 100644 index f03035c390ab6f442b55bf7627f71751bcc3167a..0000000000000000000000000000000000000000 Binary files a/src/vrpn/vrpn_android/manuals/functionalspec.pdf and /dev/null differ diff --git a/src/vrpn/vrpn_android/manuals/manual.pdf b/src/vrpn/vrpn_android/manuals/manual.pdf deleted file mode 100644 index 79aab63f6f03339bfb595d0f3d79a63902ac6693..0000000000000000000000000000000000000000 Binary files a/src/vrpn/vrpn_android/manuals/manual.pdf and /dev/null differ diff --git a/src/vrpn/vrpn_embedded/quat/quat.vcp b/src/vrpn/vrpn_embedded/quat/quat.vcp deleted file mode 100644 index 8795d0e53b73a12f6d05671427ffd579d133c03c..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_embedded/quat/quat.vcp +++ /dev/null @@ -1,576 +0,0 @@ -# Microsoft eMbedded Visual Tools Project File - Name="quat" - Package Owner=<4> -# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (WCE MIPS) Static Library" 0x8204 -# TARGTYPE "Win32 (WCE x86em) Static Library" 0x7f04 -# TARGTYPE "Win32 (WCE ARM) Static Library" 0x8504 -# TARGTYPE "Win32 (WCE SH3) Static Library" 0x8104 - -CFG=quat - Win32 (WCE MIPS) Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "quat.vcn". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "quat.vcn" CFG="quat - Win32 (WCE MIPS) Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "quat - Win32 (WCE MIPS) Release" (based on "Win32 (WCE MIPS) Static Library") -!MESSAGE "quat - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Static Library") -!MESSAGE "quat - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Static Library") -!MESSAGE "quat - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Static Library") -!MESSAGE "quat - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Static Library") -!MESSAGE "quat - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Static Library") -!MESSAGE "quat - Win32 (WCE x86em) Release" (based on "Win32 (WCE x86em) Static Library") -!MESSAGE "quat - Win32 (WCE x86em) Debug" (based on "Win32 (WCE x86em) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP ATL_Project 2 - -!IF "$(CFG)" == "quat - Win32 (WCE MIPS) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSRel" -# PROP BASE Intermediate_Dir "MIPSRel" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSRel" -# PROP Intermediate_Dir "MIPSRel" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE MIPS) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSDbg" -# PROP BASE Intermediate_Dir "MIPSDbg" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSDbg" -# PROP Intermediate_Dir "MIPSDbg" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c /Tp -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE SH3) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "SH3Rel" -# PROP BASE Intermediate_Dir "SH3Rel" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "SH3Rel" -# PROP Intermediate_Dir "SH3Rel" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE SH3) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SH3Dbg" -# PROP BASE Intermediate_Dir "SH3Dbg" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "SH3Dbg" -# PROP Intermediate_Dir "SH3Dbg" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE ARM) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMRel" -# PROP BASE Intermediate_Dir "ARMRel" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMRel" -# PROP Intermediate_Dir "ARMRel" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE ARM) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMDbg" -# PROP BASE Intermediate_Dir "ARMDbg" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMDbg" -# PROP Intermediate_Dir "ARMDbg" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE x86em) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "X86EMRel" -# PROP BASE Intermediate_Dir "X86EMRel" -# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "X86EMRel" -# PROP Intermediate_Dir "X86EMRel" -# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Oxs /Gz /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Oxs /Gz /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE x86em) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "X86EMDbg" -# PROP BASE Intermediate_Dir "X86EMDbg" -# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "X86EMDbg" -# PROP Intermediate_Dir "X86EMDbg" -# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gz /c -# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gz /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ENDIF - -# Begin Target - -# Name "quat - Win32 (WCE MIPS) Release" -# Name "quat - Win32 (WCE MIPS) Debug" -# Name "quat - Win32 (WCE SH3) Release" -# Name "quat - Win32 (WCE SH3) Debug" -# Name "quat - Win32 (WCE ARM) Release" -# Name "quat - Win32 (WCE ARM) Debug" -# Name "quat - Win32 (WCE x86em) Release" -# Name "quat - Win32 (WCE x86em) Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\quat\matrix.c - -!IF "$(CFG)" == "quat - Win32 (WCE MIPS) Release" - -DEP_CPP_MATRI=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_MATRI=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE MIPS) Debug" - -DEP_CPP_MATRI=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_MATRI=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE SH3) Release" - -DEP_CPP_MATRI=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_MATRI=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE SH3) Debug" - -DEP_CPP_MATRI=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_MATRI=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE ARM) Release" - -DEP_CPP_MATRI=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_MATRI=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE ARM) Debug" - -DEP_CPP_MATRI=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_MATRI=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE x86em) Release" - -DEP_CPP_MATRI=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_MATRI=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE x86em) Debug" - -DEP_CPP_MATRI=\ - "..\..\..\quat\quat.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\..\quat\quat.c - -!IF "$(CFG)" == "quat - Win32 (WCE MIPS) Release" - -DEP_CPP_QUAT_=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_QUAT_=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE MIPS) Debug" - -DEP_CPP_QUAT_=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_QUAT_=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE SH3) Release" - -DEP_CPP_QUAT_=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_QUAT_=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE SH3) Debug" - -DEP_CPP_QUAT_=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_QUAT_=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE ARM) Release" - -DEP_CPP_QUAT_=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_QUAT_=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE ARM) Debug" - -DEP_CPP_QUAT_=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_QUAT_=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE x86em) Release" - -DEP_CPP_QUAT_=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_QUAT_=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE x86em) Debug" - -DEP_CPP_QUAT_=\ - "..\..\..\quat\quat.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\..\quat\vector.c - -!IF "$(CFG)" == "quat - Win32 (WCE MIPS) Release" - -DEP_CPP_VECTO=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_VECTO=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE MIPS) Debug" - -DEP_CPP_VECTO=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_VECTO=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE SH3) Release" - -DEP_CPP_VECTO=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_VECTO=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE SH3) Debug" - -DEP_CPP_VECTO=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_VECTO=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE ARM) Release" - -DEP_CPP_VECTO=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_VECTO=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE ARM) Debug" - -DEP_CPP_VECTO=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_VECTO=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE x86em) Release" - -DEP_CPP_VECTO=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_VECTO=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE x86em) Debug" - -DEP_CPP_VECTO=\ - "..\..\..\quat\quat.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\..\quat\xyzquat.c - -!IF "$(CFG)" == "quat - Win32 (WCE MIPS) Release" - -DEP_CPP_XYZQU=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_XYZQU=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE MIPS) Debug" - -DEP_CPP_XYZQU=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_XYZQU=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE SH3) Release" - -DEP_CPP_XYZQU=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_XYZQU=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE SH3) Debug" - -DEP_CPP_XYZQU=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_XYZQU=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE ARM) Release" - -DEP_CPP_XYZQU=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_XYZQU=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE ARM) Debug" - -DEP_CPP_XYZQU=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_XYZQU=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE x86em) Release" - -DEP_CPP_XYZQU=\ - "..\..\..\quat\quat.h"\ - -NODEP_CPP_XYZQU=\ - "..\..\..\quat\pdefs.h"\ - - -!ELSEIF "$(CFG)" == "quat - Win32 (WCE x86em) Debug" - -DEP_CPP_XYZQU=\ - "..\..\..\quat\quat.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\quat\quat.h -# End Source File -# End Group -# End Target -# End Project diff --git a/src/vrpn/vrpn_embedded/vrpn_client_library/vrpn_client_library.vcp b/src/vrpn/vrpn_embedded/vrpn_client_library/vrpn_client_library.vcp deleted file mode 100644 index 70707ff23bd319b4ef6d0a2cf0c263d9f07ee6af..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_embedded/vrpn_client_library/vrpn_client_library.vcp +++ /dev/null @@ -1,1289 +0,0 @@ -# Microsoft eMbedded Visual Tools Project File - Name="vrpn_client_library" - Package Owner=<4> -# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (WCE MIPS) Static Library" 0x8204 -# TARGTYPE "Win32 (WCE x86em) Static Library" 0x7f04 -# TARGTYPE "Win32 (WCE ARM) Static Library" 0x8504 -# TARGTYPE "Win32 (WCE SH3) Static Library" 0x8104 - -CFG=vrpn_client_library - Win32 (WCE MIPS) Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "vrpn_client_library.vcn". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "vrpn_client_library.vcn" CFG="vrpn_client_library - Win32 (WCE MIPS) Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "vrpn_client_library - Win32 (WCE MIPS) Release" (based on "Win32 (WCE MIPS) Static Library") -!MESSAGE "vrpn_client_library - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Static Library") -!MESSAGE "vrpn_client_library - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Static Library") -!MESSAGE "vrpn_client_library - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Static Library") -!MESSAGE "vrpn_client_library - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Static Library") -!MESSAGE "vrpn_client_library - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Static Library") -!MESSAGE "vrpn_client_library - Win32 (WCE x86em) Release" (based on "Win32 (WCE x86em) Static Library") -!MESSAGE "vrpn_client_library - Win32 (WCE x86em) Debug" (based on "Win32 (WCE x86em) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP ATL_Project 2 - -!IF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSRel" -# PROP BASE Intermediate_Dir "MIPSRel" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSRel" -# PROP Intermediate_Dir "MIPSRel" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSDbg" -# PROP BASE Intermediate_Dir "MIPSDbg" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSDbg" -# PROP Intermediate_Dir "MIPSDbg" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /D "VRPN_CLIENT_ONLY" /D "VRPN_USE_WINSOCK_SOCKETS" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /FR /YX /M$(CECrtMTDebug) /c /Tp -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "SH3Rel" -# PROP BASE Intermediate_Dir "SH3Rel" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "SH3Rel" -# PROP Intermediate_Dir "SH3Rel" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SH3Dbg" -# PROP BASE Intermediate_Dir "SH3Dbg" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "SH3Dbg" -# PROP Intermediate_Dir "SH3Dbg" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMRel" -# PROP BASE Intermediate_Dir "ARMRel" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMRel" -# PROP Intermediate_Dir "ARMRel" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Oxs /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMDbg" -# PROP BASE Intermediate_Dir "ARMDbg" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMDbg" -# PROP Intermediate_Dir "ARMDbg" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "X86EMRel" -# PROP BASE Intermediate_Dir "X86EMRel" -# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "X86EMRel" -# PROP Intermediate_Dir "X86EMRel" -# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Oxs /Gz /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Oxs /Gz /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "X86EMDbg" -# PROP BASE Intermediate_Dir "X86EMDbg" -# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "X86EMDbg" -# PROP Intermediate_Dir "X86EMDbg" -# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gz /c -# ADD CPP /nologo /W3 /Zi /Od /D "VRPN_CLIENT_ONLY" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gz /c /Tp -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ENDIF - -# Begin Target - -# Name "vrpn_client_library - Win32 (WCE MIPS) Release" -# Name "vrpn_client_library - Win32 (WCE MIPS) Debug" -# Name "vrpn_client_library - Win32 (WCE SH3) Release" -# Name "vrpn_client_library - Win32 (WCE SH3) Debug" -# Name "vrpn_client_library - Win32 (WCE ARM) Release" -# Name "vrpn_client_library - Win32 (WCE ARM) Debug" -# Name "vrpn_client_library - Win32 (WCE x86em) Release" -# Name "vrpn_client_library - Win32 (WCE x86em) Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\vrpn_Analog.C - -!IF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Release" - -DEP_CPP_VRPN_=\ - "..\..\vrpn_Analog.h"\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Debug" - -DEP_CPP_VRPN_=\ - "..\..\vrpn_Analog.h"\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Release" - -DEP_CPP_VRPN_=\ - "..\..\vrpn_Analog.h"\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Debug" - -DEP_CPP_VRPN_=\ - "..\..\vrpn_Analog.h"\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Release" - -DEP_CPP_VRPN_=\ - "..\..\vrpn_Analog.h"\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Debug" - -DEP_CPP_VRPN_=\ - "..\..\vrpn_Analog.h"\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Release" - -DEP_CPP_VRPN_=\ - "..\..\vrpn_Analog.h"\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Debug" - -DEP_CPP_VRPN_=\ - "..\..\vrpn_Analog.h"\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_BaseClass.C - -!IF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Release" - -DEP_CPP_VRPN_B=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Debug" - -DEP_CPP_VRPN_B=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Release" - -DEP_CPP_VRPN_B=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Debug" - -DEP_CPP_VRPN_B=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Release" - -DEP_CPP_VRPN_B=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Debug" - -DEP_CPP_VRPN_B=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Release" - -DEP_CPP_VRPN_B=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Debug" - -DEP_CPP_VRPN_B=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Button.C - -!IF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Release" - -DEP_CPP_VRPN_BU=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Button.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Debug" - -DEP_CPP_VRPN_BU=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Button.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Release" - -DEP_CPP_VRPN_BU=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Button.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Debug" - -DEP_CPP_VRPN_BU=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Button.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Release" - -DEP_CPP_VRPN_BU=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Button.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Debug" - -DEP_CPP_VRPN_BU=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Button.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Release" - -DEP_CPP_VRPN_BU=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Button.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Debug" - -DEP_CPP_VRPN_BU=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Button.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Clock.C - -!IF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Release" - -DEP_CPP_VRPN_C=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Debug" - -DEP_CPP_VRPN_C=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Release" - -DEP_CPP_VRPN_C=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Debug" - -DEP_CPP_VRPN_C=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Release" - -DEP_CPP_VRPN_C=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Debug" - -DEP_CPP_VRPN_C=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Release" - -DEP_CPP_VRPN_C=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Debug" - -DEP_CPP_VRPN_C=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Connection.C - -!IF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Release" - -DEP_CPP_VRPN_CO=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Debug" - -DEP_CPP_VRPN_CO=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Release" - -DEP_CPP_VRPN_CO=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Debug" - -DEP_CPP_VRPN_CO=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Release" - -DEP_CPP_VRPN_CO=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Debug" - -DEP_CPP_VRPN_CO=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Release" - -DEP_CPP_VRPN_CO=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Debug" - -DEP_CPP_VRPN_CO=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Clock.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Dial.C - -!IF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Release" - -DEP_CPP_VRPN_D=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Dial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Debug" - -DEP_CPP_VRPN_D=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Dial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Release" - -DEP_CPP_VRPN_D=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Dial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Debug" - -DEP_CPP_VRPN_D=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Dial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Release" - -DEP_CPP_VRPN_D=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Dial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Debug" - -DEP_CPP_VRPN_D=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Dial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Release" - -DEP_CPP_VRPN_D=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Dial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Debug" - -DEP_CPP_VRPN_D=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Dial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_FileConnection.C - -!IF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Release" - -DEP_CPP_VRPN_F=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Debug" - -DEP_CPP_VRPN_F=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Release" - -DEP_CPP_VRPN_F=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Debug" - -DEP_CPP_VRPN_F=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Release" - -DEP_CPP_VRPN_F=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Debug" - -DEP_CPP_VRPN_F=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Release" - -DEP_CPP_VRPN_F=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Debug" - -DEP_CPP_VRPN_F=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileConnection.h"\ - "..\..\vrpn_Log.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_FileController.C - -!IF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Release" - -DEP_CPP_VRPN_FI=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileController.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Debug" - -DEP_CPP_VRPN_FI=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileController.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Release" - -DEP_CPP_VRPN_FI=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileController.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Debug" - -DEP_CPP_VRPN_FI=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileController.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Release" - -DEP_CPP_VRPN_FI=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileController.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Debug" - -DEP_CPP_VRPN_FI=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileController.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Release" - -DEP_CPP_VRPN_FI=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileController.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Debug" - -DEP_CPP_VRPN_FI=\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_FileController.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Shared.C - -!IF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Release" - -DEP_CPP_VRPN_S=\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Debug" - -DEP_CPP_VRPN_S=\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Release" - -DEP_CPP_VRPN_S=\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Debug" - -DEP_CPP_VRPN_S=\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Release" - -DEP_CPP_VRPN_S=\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Debug" - -DEP_CPP_VRPN_S=\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Release" - -DEP_CPP_VRPN_S=\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Debug" - -DEP_CPP_VRPN_S=\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Text.C - -!IF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Release" - -DEP_CPP_VRPN_T=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Text.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Debug" - -DEP_CPP_VRPN_T=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Text.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Release" - -DEP_CPP_VRPN_T=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Text.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Debug" - -DEP_CPP_VRPN_T=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Text.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Release" - -DEP_CPP_VRPN_T=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Text.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Debug" - -DEP_CPP_VRPN_T=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Text.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Release" - -DEP_CPP_VRPN_T=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Text.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Debug" - -DEP_CPP_VRPN_T=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Text.h"\ - "..\..\vrpn_Types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Tracker.C - -!IF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Release" - -DEP_CPP_VRPN_TR=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_RedundantTransmission.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Tracker.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE MIPS) Debug" - -DEP_CPP_VRPN_TR=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_RedundantTransmission.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Tracker.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Release" - -DEP_CPP_VRPN_TR=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_RedundantTransmission.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Tracker.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE SH3) Debug" - -DEP_CPP_VRPN_TR=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_RedundantTransmission.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Tracker.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Release" - -DEP_CPP_VRPN_TR=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_RedundantTransmission.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Tracker.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE ARM) Debug" - -DEP_CPP_VRPN_TR=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_RedundantTransmission.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Tracker.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Release" - -DEP_CPP_VRPN_TR=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_RedundantTransmission.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Tracker.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_client_library - Win32 (WCE x86em) Debug" - -DEP_CPP_VRPN_TR=\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_RedundantTransmission.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Tracker.h"\ - "..\..\vrpn_Types.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\vrpn_Analog.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_BaseClass.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Button.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Clock.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Connection.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_ConnectionTypes.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Dial.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_FileConnection.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_FileController.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Log.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Shared.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Text.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Tracker.h -# End Source File -# Begin Source File - -SOURCE=..\..\vrpn_Types.h -# End Source File -# End Group -# End Target -# End Project diff --git a/src/vrpn/vrpn_embedded/vrpn_embedded.vcw b/src/vrpn/vrpn_embedded/vrpn_embedded.vcw deleted file mode 100644 index 44722d6bba61802508dd032bd30fe8fc4a080e53..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_embedded/vrpn_embedded.vcw +++ /dev/null @@ -1,59 +0,0 @@ -Microsoft eMbedded Visual Tools Workspace File, Format Version 3.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "quat"=.\quat\quat.vcp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "vrpn_client_library"=.\vrpn_client_library\vrpn_client_library.vcp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name quat - End Project Dependency -}}} - -############################################################################### - -Project: "vrpn_print_devices"=.\vrpn_print_devices\vrpn_print_devices.vcp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name vrpn_client_library - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/src/vrpn/vrpn_embedded/vrpn_print_devices/vrpn_print_devices.vcp b/src/vrpn/vrpn_embedded/vrpn_print_devices/vrpn_print_devices.vcp deleted file mode 100644 index 240c5595f1efb9b393067573427f301f3639428c..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_embedded/vrpn_print_devices/vrpn_print_devices.vcp +++ /dev/null @@ -1,369 +0,0 @@ -# Microsoft eMbedded Visual Tools Project File - Name="vrpn_print_devices" - Package Owner=<4> -# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (WCE ARM) Application" 0x8501 -# TARGTYPE "Win32 (WCE x86em) Application" 0x7f01 -# TARGTYPE "Win32 (WCE SH3) Application" 0x8101 -# TARGTYPE "Win32 (WCE MIPS) Application" 0x8201 - -CFG=vrpn_print_devices - Win32 (WCE MIPS) Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "vrpn_print_devices.vcn". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "vrpn_print_devices.vcn" CFG="vrpn_print_devices - Win32 (WCE MIPS) Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "vrpn_print_devices - Win32 (WCE MIPS) Release" (based on "Win32 (WCE MIPS) Application") -!MESSAGE "vrpn_print_devices - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Application") -!MESSAGE "vrpn_print_devices - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Application") -!MESSAGE "vrpn_print_devices - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Application") -!MESSAGE "vrpn_print_devices - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application") -!MESSAGE "vrpn_print_devices - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application") -!MESSAGE "vrpn_print_devices - Win32 (WCE x86em) Release" (based on "Win32 (WCE x86em) Application") -!MESSAGE "vrpn_print_devices - Win32 (WCE x86em) Debug" (based on "Win32 (WCE x86em) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP ATL_Project 2 - -!IF "$(CFG)" == "vrpn_print_devices - Win32 (WCE MIPS) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSRel" -# PROP BASE Intermediate_Dir "MIPSRel" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSRel" -# PROP Intermediate_Dir "MIPSRel" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE MIPS) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSDbg" -# PROP BASE Intermediate_Dir "MIPSDbg" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSDbg" -# PROP Intermediate_Dir "MIPSDbg" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\..\\" /D "VRPN_CLIENT_ONLY" /D "VRPN_USE_WINSOCK_SOCKETS" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c /Tp -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 ..\vrpn_client_library\MIPSDbg\vrpn_client_library.lib ..\quat\MIPSDbg\quat.lib commctrl.lib coredll.lib aygshell.lib winsock.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE SH3) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "SH3Rel" -# PROP BASE Intermediate_Dir "SH3Rel" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "SH3Rel" -# PROP Intermediate_Dir "SH3Rel" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE SH3) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SH3Dbg" -# PROP BASE Intermediate_Dir "SH3Dbg" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "SH3Dbg" -# PROP Intermediate_Dir "SH3Dbg" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE ARM) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMRel" -# PROP BASE Intermediate_Dir "ARMRel" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMRel" -# PROP Intermediate_Dir "ARMRel" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE ARM) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMDbg" -# PROP BASE Intermediate_Dir "ARMDbg" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMDbg" -# PROP Intermediate_Dir "ARMDbg" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE x86em) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "X86EMRel" -# PROP BASE Intermediate_Dir "X86EMRel" -# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "X86EMRel" -# PROP Intermediate_Dir "X86EMRel" -# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE x86em) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "X86EMDbg" -# PROP BASE Intermediate_Dir "X86EMDbg" -# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "X86EMDbg" -# PROP Intermediate_Dir "X86EMDbg" -# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gz /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\.." /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gz /c /Tp -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib winsock.lib /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 - -!ENDIF - -# Begin Target - -# Name "vrpn_print_devices - Win32 (WCE MIPS) Release" -# Name "vrpn_print_devices - Win32 (WCE MIPS) Debug" -# Name "vrpn_print_devices - Win32 (WCE SH3) Release" -# Name "vrpn_print_devices - Win32 (WCE SH3) Debug" -# Name "vrpn_print_devices - Win32 (WCE ARM) Release" -# Name "vrpn_print_devices - Win32 (WCE ARM) Debug" -# Name "vrpn_print_devices - Win32 (WCE x86em) Release" -# Name "vrpn_print_devices - Win32 (WCE x86em) Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\client_src\vrpn_print_devices.C - -!IF "$(CFG)" == "vrpn_print_devices - Win32 (WCE MIPS) Release" - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE MIPS) Debug" - -DEP_CPP_VRPN_=\ - "..\..\vrpn_Analog.h"\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Button.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Dial.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Tracker.h"\ - "..\..\vrpn_Types.h"\ - - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE SH3) Release" - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE SH3) Debug" - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE ARM) Release" - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE ARM) Debug" - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE x86em) Release" - -!ELSEIF "$(CFG)" == "vrpn_print_devices - Win32 (WCE x86em) Debug" - -DEP_CPP_VRPN_=\ - "..\..\vrpn_Analog.h"\ - "..\..\vrpn_BaseClass.h"\ - "..\..\vrpn_Button.h"\ - "..\..\vrpn_Connection.h"\ - "..\..\vrpn_Dial.h"\ - "..\..\vrpn_Serial.h"\ - "..\..\vrpn_Shared.h"\ - "..\..\vrpn_Tracker.h"\ - "..\..\vrpn_Types.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/vrpn_inertiamouse.C b/src/vrpn/vrpn_inertiamouse.C deleted file mode 100644 index fe3b745f5153450eff9c21742fb411e02c137602..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_inertiamouse.C +++ /dev/null @@ -1,270 +0,0 @@ -/* - * vrpn_inertiamouse.C - */ - -#include <math.h> // for fabs -#include <stdio.h> // for fprintf, stderr, NULL -#include "vrpn_Shared.h" // for timeval, vrpn_gettimeofday - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR -#include "vrpn_Serial.h" -#include "vrpn_inertiamouse.h" - -#undef VERBOSE - -const double vrpn_inertiamouse::Vel_Decay = 0.66; - -namespace { - enum { - STATUS_RESETTING = -1, // Resetting the device - STATUS_SYNCING = 0, // Looking for the first character of report - STATUS_READING = 1, // Looking for the rest of the report - - MAX_TIME_INTERVAL = 2000000 // max time between reports (usec) - }; -} // namespace -vrpn_inertiamouse::vrpn_inertiamouse (const char* name, - vrpn_Connection * c, - const char* port, - int baud_rate) - : vrpn_Serial_Analog (name, c, port, baud_rate) - , vrpn_Button_Filter (name, c) - , numbuttons_ (Buttons) - , numchannels_ (Channels) - , null_radius_ (0) - , bufcount_ (0) - , expected_chars_ (1) - , dcb_ () - , lp_ () -{ - vrpn_Button::num_buttons = numbuttons_; - vrpn_Analog::num_channel = numchannels_; - - vel_ = new double[numchannels_]; - if (vel_ == NULL) { - fprintf(stderr,"vrpn_inertiamouse::vrpn_inertiamouse(): Out of memory\n"); - } - - clear_values(); - - status_ = STATUS_RESETTING; -} - -// factory method -vrpn_inertiamouse* -vrpn_inertiamouse::create (const char* name, - vrpn_Connection * c, - const char* port, - int baud_rate) -{ - return new vrpn_inertiamouse (name, c, port, baud_rate); -} - - -void vrpn_inertiamouse::clear_values(void) -{ - int i; - - for (i = 0; i < numbuttons_; i++) { - vrpn_Button::buttons[i] = vrpn_Button::lastbuttons[i] = 0; - } - for (i = 0; i < numchannels_; i++) { - vrpn_Analog::channel[i] = vrpn_Analog::last[i] = 0; - } -} - -int vrpn_inertiamouse::reset(void) -{ - clear_values(); - vrpn_flush_input_buffer(serial_fd); - - status_ = STATUS_SYNCING; - - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - return 0; -} - - -int vrpn_inertiamouse::get_report(void) -{ - int ret; // Return value from function call to be checked - - // - // If we're SYNCing, then the next character we get should be the - // start of a report. If we recognize it, go into READing mode - // and tell how many characters we expect total. If we don't - // recognize it, then we must have misinterpreted a command or - // something; reset the intertiamouse and start over - // - if (status_ == STATUS_SYNCING) { - // Try to get a character. If none, just return. - ret = vrpn_read_available_characters (serial_fd, &buffer_[0], 1); - if (ret != 1) { return 0; } - - switch (buffer_[0]) { - case 'D': - expected_chars_ = 25; - break; - case 'B': - expected_chars_ = 4; - break; - - default: - fprintf(stderr, "vrpn_inertiamouse: Unknown command (%c), resetting\n", buffer_[0]); - status_ = STATUS_RESETTING; - return 0; - } - - bufcount_ = 1; - vrpn_gettimeofday (×tamp, NULL); - - status_ = STATUS_READING; - } - - ret = vrpn_read_available_characters(serial_fd, - &buffer_[bufcount_], - expected_chars_ - bufcount_); - if (ret == -1) { - send_text_message("vrpn_inertiamouse: Error reading", - timestamp, - vrpn_TEXT_ERROR); - status_ = STATUS_RESETTING; - return 0; - } - bufcount_ += ret; - - if (bufcount_ < expected_chars_) { // Not done -- go back for more - return 0; - } - - if (buffer_[expected_chars_ - 1] != '\n') { - status_ = STATUS_SYNCING; - send_text_message("vrpn_inertiamouse: No newline in record", - timestamp, - vrpn_TEXT_ERROR); - return 0; - } - - switch ( buffer_[0] ) { - case 'D': - { - int i; - int nextchar; - for (i = 0, nextchar = 0; i < numchannels_; ++i) { - int packet; - packet = (buffer_[++nextchar] & 0xf0) << 8; - packet |= (buffer_[++nextchar] & 0xf0) << 4; - packet |= (buffer_[++nextchar] & 0xf0); - packet |= (buffer_[++nextchar] & 0xf0) >> 4; - - int chnl = (packet >> 10) & 7; - if (chnl >= Channels) { - status_ = STATUS_SYNCING; - send_text_message("vrpn_inertiamouse: Too-large channel value", - timestamp, - vrpn_TEXT_ERROR); - return 0; - } - int acc = packet & 0x3ff; // 10 bits - - // normalize to interval [-1,1] - // just a guess, block dc later - double normval = ((double)(acc - 256) / - (double)256); - -// normval *= 1.5; - - // update rotation data - if ( (chnl == 4) || (chnl == 5) ) { - channel[chnl] = normval; - break; - } - normval = dcb_[chnl].filter (normval); - normval = lp_[chnl].filter (normval); - - double dt = 0.25; - - // update velocity and position only when button[0] pressed - if (buttons[0]) { - - double pos = vel_[chnl] * dt + normval * dt * dt / 2; - - vel_[chnl] += normval*dt; - if(fabs (vel_[chnl]) < dt/2.0) - vel_[chnl] *= 0.90; -// else -// if (fabs (vel_[chnl]) > 1.0) -// vel_[chnl] *= 1.0 / fabs (vel_[chnl]); - - channel[chnl] = pos; -// channel[chnl] *= 0.95; - } else { - vel_[chnl] = 0.0; - channel[chnl] = 0.0; - } - } - } - break; - case 'B': - buttons[0] = ((buffer_[1] & 1) != 0); - buttons[1] = ((buffer_[1] & 2) != 0); - break; - default: - fprintf(stderr, "vrpn_inertiamouse: Unknown [internal] command (%c), resetting\n", buffer_[0]); - status_ = STATUS_RESETTING; - return 0; - } - - // - // Done with the decoding, send the reports and go back to syncing - // - - report_changes(); - status_ = STATUS_SYNCING; - bufcount_ = 0; - - return 1; // We got a full report. -} - -void vrpn_inertiamouse::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; - - vrpn_Analog::report_changes(class_of_service); - vrpn_Button::report_changes(); -} - -void vrpn_inertiamouse::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - vrpn_Button::timestamp = timestamp; - - vrpn_Analog::report(class_of_service); - vrpn_Button::report_changes(); -} - -// This routine is called each time through the server's main loop. It -// will take a course of action depending on the current status of the -// intertiamouse, either trying to reset it or trying to get a reading -// from it. -void vrpn_inertiamouse::mainloop() -{ - server_mainloop(); - - switch(status_) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - // Keep getting reports until all full reports are read. - while (get_report()); - break; - - default: - fprintf(stderr, "vrpn_inertiamouse: Unknown mode (internal error)\n"); - break; - } -} diff --git a/src/vrpn/vrpn_inertiamouse.h b/src/vrpn/vrpn_inertiamouse.h deleted file mode 100644 index 60df3e0abc30488e33b448c3870c2e58b75bd6ab..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_inertiamouse.h +++ /dev/null @@ -1,163 +0,0 @@ -//----------------------------------------------------------------------------------------- -// Driver for the Bauhaus University Weimar "inertiamouse" device. The class for this -// device is found at the end of the file, after two helper classes. - -#ifndef VRPN_INERTIAMOUSE_H -#define VRPN_INERTIAMOUSE_H - -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Button.h" // for vrpn_Button_Filter -#include "vrpn_Configure.h" // for VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32 - -// Helper classes -class VRPN_API dcblocker { -public: // ctors, dtor - dcblocker () - : in_ (0.0), - out_ (0.0) - {} - dcblocker (dcblocker const& o) - : in_ (o.in_), - out_ (o.out_) - {} - ~dcblocker () throw () {} -public: // methods - void swap (dcblocker& o) throw () - { - double t; - t = in_; in_ = o.in_; o.in_ = t; - t = out_; out_ = o.out_; o.out_ = t; - } - dcblocker& operator= (dcblocker const& o) - { - dcblocker tmp (o); - swap (tmp); - return *this; - } - double filter (double s) - { - out_ = s - in_ + (0.95 * out_); - in_ = s; - return out_; - } - void reset () - { - in_ = out_ = 0.0; - } -private: // variables - double in_; - double out_; -}; - -// Helper classes -/* - * butterworth lowpass - */ -class VRPN_API lowpass { -public: // ctors, dtor - lowpass () - { - in_[0] = 0.0; - in_[1] = 0.0; - out_[0] = 0.0; - out_[1] = 0.0; - } - lowpass (lowpass const& o) - { - in_[0] = o.in_[0]; - in_[1] = o.in_[1]; - out_[0] = o.out_[0]; - out_[1] = o.out_[1]; - } - ~lowpass () throw () {} -public: // methods - double filter (double s) - { - in_[0] = in_[1]; - in_[1] = s / 6.242183581; - out_[0] = out_[1]; - out_[1] = in_[0] + in_[1] + (0.6795992982 * out_[0]); - return out_[1]; - } - void reset () - { - in_[0] = in_[1] = out_[0] = out_[1] = 0.0; - } -private: // variables - double in_[2]; - double out_[2]; -}; - -class VRPN_API vrpn_inertiamouse : public vrpn_Serial_Analog , public vrpn_Button_Filter { -public: // constants - - enum { - Channels = 6, - Buttons = 2, - Update_Interval_Hz = 7372800 / 64 / 13 / Channels, - }; - static const double Vel_Decay; - -public: // construction/destruction - // ctor - vrpn_inertiamouse (const char* name, - vrpn_Connection* c, - const char* port, - int baud_rate); - - // factory method - static vrpn_inertiamouse* create (const char* name, - vrpn_Connection* c, - const char* port, - int baud_rate); - // dtor - ~vrpn_inertiamouse () { if (vel_) { delete [] vel_;} }; - -public: // virtual methods - - /// Called once through each main loop iteration to handle updates. - virtual void mainloop (); - - virtual int reset(void); //< Set device back to starting config - -protected: - int status_; //< Used by mainloop() and get_report() - int numbuttons_; //< How many buttons to open - int numchannels_; //< How many analog channels to open - - int expected_chars_; //< How many characters to expect in the report - unsigned char buffer_[512]; //< Buffer of characters in report - int bufcount_; //< How many characters we have so far - - int null_radius_; //< The range over which no motion should be - // reported - - struct timeval timestamp; //< Time of the last report from the device - - double *vel_; // velocity update - - dcblocker dcb_[Channels]; // dc blockers for all Channels - lowpass lp_[Channels]; // lowpass filters for all Channels - - // Set all buttons, analogs and encoders back to 0 - virtual void clear_values(void); - - /// Try to read a report from the device. Returns 1 if complete report received, - /// 0 otherwise. Sets _status to match current status. - virtual int get_report(void); - - /// send report iff changed - virtual void report_changes (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - /// send report whether or not changed - virtual void report (vrpn_uint32 class_of_service - = vrpn_CONNECTION_LOW_LATENCY); - - // NOTE: class_of_service is only applied to vrpn_Analog - // values, not vrpn_Button, which are always vrpn_RELIABLE -}; - -#endif diff --git a/src/vrpn/vrpn_nikon_controls.C b/src/vrpn/vrpn_nikon_controls.C deleted file mode 100644 index 482ccb2c0d9d032a52df318fa0bded484cc7a120..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_nikon_controls.C +++ /dev/null @@ -1,510 +0,0 @@ -//XXXX Change this to use relative motion commands but still use -// absolute position requests. This will both reduce the number -// of characters to send (and time) and avoid the problem of the -// device being reset at an out-of-range place. - -#include <stdio.h> // for fprintf, stderr, sprintf, etc -#include <stdlib.h> // for atoi -#include <string.h> // for strlen, NULL, strncmp, etc - -#include "vrpn_BaseClass.h" // for ::vrpn_TEXT_ERROR, etc -#include "vrpn_Serial.h" -#include "vrpn_nikon_controls.h" -#include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR - -//#define VERBOSE -//#define VERBOSE2 - -/// Characters that can start a report of the type we recognize. -const char *VALID_REPORT_CHARS = "anqo"; - -// Defines the modes in which the device can find itself. -#define STATUS_RESETTING (-1) // Resetting the device -#define STATUS_SYNCING (0) // Looking for the first character of report -#define STATUS_READING (1) // Looking for the rest of the report - -#define TIMEOUT_TIME_INTERVAL (10000000L) // max time between reports (usec) -#define POLL_INTERVAL (1000000L) // time to poll if no response in a while (usec) - -vrpn_Nikon_Controls::vrpn_Nikon_Controls(const char *device_name, vrpn_Connection *con, const char *port_name) -: vrpn_Serial_Analog(device_name, con, port_name), - vrpn_Analog_Output(device_name, con) -{ - num_channel = 1; // Focus control - o_num_channel = 1; // Focus control - - last_poll.tv_sec = 0; - last_poll.tv_usec = 0; - - // Set the mode to reset - _status = STATUS_RESETTING; - - // Register to receive the message to request changes and to receive connection - // messages. - if (d_connection != NULL) { - if (register_autodeleted_handler(request_m_id, handle_request_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_Nikon_Controls: can't register handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler(request_channels_m_id, handle_request_channels_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_Nikon_Controls: can't register handler\n"); - d_connection = NULL; - } - if (register_autodeleted_handler(d_ping_message_id, handle_connect_message, - this, d_sender_id)) { - fprintf(stderr,"vrpn_Nikon_Controls: can't register handler\n"); - d_connection = NULL; - } - } else { - fprintf(stderr,"vrpn_Nikon_Controls: Can't get connection!\n"); - } -} - -/// Looks up the response from the table in the appendix of the Nikon -/// control manual. -static const char *error_code_to_string(const int code) -{ - switch (code) { - case 1: return "Command error"; - case 2: return "Operand error"; - case 3: return "Procedding timout error"; - case 4: return "Receive buffer overflow error"; - case 5: return "Device not mounted"; - case 6: return "Drive count overflow error"; - case 7: return "Processing prohibited error"; - default: return "unknown error"; - } -} - -/// Parses the response position from the Nikon found in inbuf. If a report -/// is found that sets the response, then 1 is returned from -/// the function call. If no response is found, 0 is returned both from -/// the function and in response_pos. If there is an error response found -/// in the buffer, -1 is returned response_pos is set to the error code that -/// was found. If a report is found that does not set the response but that -/// indicates completion of a command, then 2 is returned and response_pos is -/// not set. If a report is found that indicates it is in the process of -/// doing a command, 3 is returned and response_pos is not set. - -static int parse_focus_position_response(const char *inbuf, double &response_pos) -{ - // Make sure that the command ends with [CR][LF]. All valid reports should end - // with this. - size_t len = strlen((const char *)inbuf); - if (len < 2) { - fprintf(stderr,"parse_focus_position_response(): String too short\n"); - response_pos = 0; return 0; - } - if ( (inbuf[len-2] != '\r') || (inbuf[len-1] != '\n') ) { - fprintf(stderr,"parse_focus_position_response(): (%s) Not [CR][LF] at end\n",inbuf); - response_pos = 0; return 0; - } - - //------------------------------------------------------------------------- - // Parse the report based on the first part of the report. - -#ifdef VERBOSE - printf("Nikon control: parsing [%s]\n", inbuf); -#endif - // Reported focus - if (strncmp(inbuf, "aSPR", strlen("aSPR")) == 0) { - response_pos = atoi(&inbuf[4]); - return 1; - - // Error message - } else if (strncmp(inbuf, "nSPR", strlen("nSPR")) == 0) { - response_pos = atoi(&inbuf[4]); - return -1; - - // In the process of moving focus where it was requested - } else if (strncmp(inbuf, "qSMVA", strlen("qSMVA")) == 0) { - return 3; - - // Done moving focus where it was requested - } else if (strncmp(inbuf, "oSMV", strlen("oSMV")) == 0) { - return 2; - - // Error moving focus where it was requested - } else if (strncmp(inbuf, "nSMV", strlen("nSMV")) == 0) { - response_pos = atoi(&inbuf[4]); - return -1; - - // Don't know how to parse the command. - } else { - fprintf(stderr,"parse_focus_position_response(): Unknown response (%s)\n", inbuf); - response_pos = 0; return 0; - } -} - -// This function will flush any characters in the input buffer, then ask the -// Nikon for the state of its focus control. If it gets a valid response, all is -// well; otherwise, not. -// Commands Responses Meanings -// rSPR[CR] aSPR[value][CR][LF] Request focus: value tells the focus in number of ticks -// nSPR[errcode][CR][LF] errcode tells what went wrong -// fSMV[value][CR] qSMVA[CR][LF] Set focus to value: q command says in progress -// oSMV[CR][LF] o says that the requested position has been obtained - -int vrpn_Nikon_Controls::reset(void) -{ - unsigned char inbuf[256]; - int ret; - char errmsg[256]; - char cmd[256]; - double response_pos; //< Where the focus says it is. - - //----------------------------------------------------------------------- - // Sleep a second and then drain the input buffer to make sure we start - // with a fresh slate. - vrpn_SleepMsecs(1000); - vrpn_flush_input_buffer(serial_fd); - - //----------------------------------------------------------------------- - // Send the command to request the focus. Then wait 1 second for a response - sprintf(cmd, "rSPR\r"); - if (vrpn_write_characters(serial_fd, (unsigned char *)cmd, strlen(cmd)) != (int)strlen(cmd)) { - fprintf(stderr,"vrpn_Nikon_Controls::reset(): Cannot send focus request\n"); - return -1; - } - vrpn_SleepMsecs(1000); - - //----------------------------------------------------------------------- - // Read the response from the camera and then see if it is a good response, - // an error message, or nothing. - - ret = vrpn_read_available_characters(serial_fd, inbuf, sizeof(inbuf)); - if (ret < 0) { - perror("vrpn_Nikon_Controls::reset(): Error reading position from device"); - return -1; - } - if (ret == 0) { - fprintf(stderr, "vrpn_Nikon_Controls::reset(): No characters when reading position from device\n"); - return -1; - } - inbuf[ret] = '\0'; //< Null-terminate the input string - ret = parse_focus_position_response((char *)inbuf, response_pos); - if (ret < 0) { - fprintf(stderr,"vrpn_Nikon_Controls::reset(): Error reading focus: %s\n", - error_code_to_string((int)(response_pos))); - return -1; - } - if (ret != 1) { - fprintf(stderr,"vrpn_Nikon_Controls::reset(): Unexpected response to focus request\n"); - return -1; - } - channel[0] = response_pos; - - sprintf(errmsg,"Focus reported (this is good)"); - VRPN_MSG_WARNING(errmsg); - - // We're now waiting for any responses from devices - status = STATUS_SYNCING; - - VRPN_MSG_WARNING("reset complete (this is good)"); - - vrpn_gettimeofday(×tamp, NULL); // Set watchdog now - return 0; -} - - -// This function will read characters until it has a full report, then -// put that report into analog field and call the report method on that. -// The time stored is that of the first character received as part of the -// report. - -int vrpn_Nikon_Controls::get_report(void) -{ - int ret; // Return value from function call to be checked - - //-------------------------------------------------------------------- - // If we're SYNCing, then the next character we get should be the start - // of a report. If we recognize it, go into READing mode and tell how - // many characters we expect total. If we don't recognize it, then we - // must have misinterpreted a command or something; reset - // and start over - //-------------------------------------------------------------------- - - if (status == STATUS_SYNCING) { - // Try to get a character. If none, just return. - if (vrpn_read_available_characters(serial_fd, _buffer, 1) != 1) { - return 0; - } - - // See if we recognize the character as one of the ones making - // up a report. If not, then we need to continue syncing. - if (strchr(VALID_REPORT_CHARS, _buffer[0]) == NULL) { - VRPN_MSG_WARNING("Syncing"); - return 0; - } - - // Got the first character of a report -- go into READING mode - // and record that we got one character at this time. The next - // bit of code will attempt to read the rest of the report. - // The time stored here is as close as possible to when the - // report was generated. - _bufcount = 1; - vrpn_gettimeofday(×tamp, NULL); - status = STATUS_READING; -#ifdef VERBOSE2 - printf("... Got the 1st char\n"); -#endif - } - - //-------------------------------------------------------------------- - // Read a character at a time from the serial port, storing them - // in the buffer. Do this until we either run out of characters to - // read or else find [CR][LF] along the way, which indicates the end - // of a command. - //-------------------------------------------------------------------- - - do { - ret = vrpn_read_available_characters(serial_fd, &_buffer[_bufcount], 1); - if (ret == -1) { - VRPN_MSG_ERROR("Error reading"); - status = STATUS_RESETTING; - return 0; - } - _bufcount += ret; -#ifdef VERBOSE2 - if (ret != 0) printf("... got %d characters (%d total)\n",ret, _bufcount); -#endif - - // See if the last characters in the buffer are [CR][LF]. If so, then - // we have a full report so null-terminate and go ahead and parse - if ( (_bufcount > 2) && - (_buffer[_bufcount-2] == '\r') && - (_buffer[_bufcount-1] == '\n') ) { - _buffer[_bufcount] = '\0'; - break; - } - - // If we have a full buffer, then we've gotten into a bad way. - if (_bufcount >= sizeof(_buffer) - 1) { - VRPN_MSG_ERROR("Buffer full when reading"); - status = STATUS_RESETTING; - return 0; - } - } while (ret != 0); - if (ret == 0) { - return 0; - } - - //-------------------------------------------------------------------- - // We now have enough characters to make a full report. Check it by - // trying to parse it. If it is not valid, then we return to - // synch mode and ignore this report. A well-formed report has - // on of VALID_REPORT_CHARS as its command. We expect these responses - // either set the response position (due to a query) or to be valid - // but not set the response position (due to a position move request, - // for which we store the requested position into the value). - //-------------------------------------------------------------------- - - double response_pos; - ret = parse_focus_position_response((const char *)_buffer, response_pos); - if (ret <= 0) { - fprintf(stderr,"Bad response from nikon [%s], syncing\n", _buffer); - fprintf(stderr," (%s)\n", error_code_to_string((int)response_pos)); - status = STATUS_SYNCING; - return 0; - } - // Type 3 returns mean "in progress" for some function. Ignore this - // report. - if (ret == 3) { - status = STATUS_SYNCING; - _bufcount = 0; - return 1; - } - - // Type 2 means that the command we issued before has completed -- put - // the value we requested for the focus into the response since that is - // where we are now. - if (ret == 2) { // We must have gotten where we are going. - response_pos = _requested_focus; - } - - //-------------------------------------------------------------------- - // Done with the decoding, send the reports and go back to syncing - //-------------------------------------------------------------------- - - channel[0] = response_pos; - report_changes(); - status = STATUS_SYNCING; - _bufcount = 0; - - return 1; -} - -/** Set the channel associated with the index to the specified value. - Channel 0 controls the focus. - **/ - -int vrpn_Nikon_Controls::set_channel(unsigned chan_num, vrpn_float64 value) -{ - // Ask to change the focus if this was channel 0. Also, store away where we - // asked the focus to go to so that we can know where we are when we get there - // (the response from the microscope just says "we got here!). - if ( (int)chan_num >= o_num_channel ) { - char msg[1024]; - sprintf(msg,"vrpn_Nikon_Controls::set_channel(): Index out of bounds (%d of %d), value %lg\n", - chan_num, o_num_channel, value); - vrpn_gettimeofday(&o_timestamp, NULL); - send_text_message(msg, o_timestamp, vrpn_TEXT_ERROR); - } - - char msg[256]; - sprintf(msg, "fSMV%ld\r", (long)value); -#ifdef VERBOSE - printf("Nikon Control: Asking to move to %ld with command %s\n", (long)value, msg); -#endif - if (vrpn_write_characters(serial_fd, (unsigned char *)msg, strlen(msg)) != (int)strlen(msg)) { - fprintf(stderr, "vrpn_Nikon_Controls::set_channel(): Can't write command\n"); - return -1; - } - if (vrpn_drain_output_buffer(serial_fd)) { - fprintf(stderr, "vrpn_Nikon_Controls::set_channel(): Can't drain command\n"); - return -1; - } - _requested_focus = value; - - return 0; -} - -// If the client requests a value for the focus control, then try to set the -// focus to the requested value. -int vrpn_Nikon_Controls::handle_request_message(void *userdata, vrpn_HANDLERPARAM p) -{ - const char *bufptr = p.buffer; - vrpn_int32 chan_num; - vrpn_int32 pad; - vrpn_float64 value; - vrpn_Nikon_Controls *me = (vrpn_Nikon_Controls *)userdata; - - // Read the parameters from the buffer - vrpn_unbuffer(&bufptr, &chan_num); - vrpn_unbuffer(&bufptr, &pad); - vrpn_unbuffer(&bufptr, &value); - - // Set the position to the appropriate value, if the channel number is in the - me->set_channel(chan_num, value); - return 0; -} - -int vrpn_Nikon_Controls::handle_request_channels_message(void* userdata, vrpn_HANDLERPARAM p) -{ - int i; - const char* bufptr = p.buffer; - vrpn_int32 num; - vrpn_int32 pad; - vrpn_Nikon_Controls* me = (vrpn_Nikon_Controls *)userdata; - - // Read the values from the buffer - vrpn_unbuffer(&bufptr, &num); - vrpn_unbuffer(&bufptr, &pad); - if (num > me->o_num_channel) { - char msg[1024]; - sprintf(msg,"vrpn_Nikon_Controls::handle_request_channels_message(): Index out of bounds (%d of %d), clipping\n", - num, me->o_num_channel); - me->send_text_message(msg, me->timestamp, vrpn_TEXT_ERROR); - num = me->o_num_channel; - } - for (i = 0; i < num; i++) { - vrpn_unbuffer(&bufptr, &(me->o_channel[i])); - me->set_channel(i, me->o_channel[i]); - } - - return 0; -} - -/** When we get a connection request from a remote object, send our state so - they will know it to start with. */ -int vrpn_Nikon_Controls::handle_connect_message(void *userdata, vrpn_HANDLERPARAM) -{ - vrpn_Nikon_Controls *me = (vrpn_Nikon_Controls *)userdata; - - me->report(vrpn_CONNECTION_RELIABLE); - return 0; -} - -void vrpn_Nikon_Controls::report_changes(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - - vrpn_Analog::report_changes(class_of_service); -} - -void vrpn_Nikon_Controls::report(vrpn_uint32 class_of_service) -{ - vrpn_Analog::timestamp = timestamp; - - vrpn_Analog::report(class_of_service); -} - - -/** This routine is called each time through the server's main loop. It will - take a course of action depending on the current status of the device, - either trying to reset it or trying to get a reading from it. It will - try to reset the device if no data has come from it for a couple of - seconds. -*/ - -void vrpn_Nikon_Controls::mainloop() -{ - char errmsg[256]; - - server_mainloop(); - - switch(status) { - case STATUS_RESETTING: - reset(); - break; - - case STATUS_SYNCING: - case STATUS_READING: - { - // It turns out to be important to get the report before checking - // to see if it has been too long since the last report. This is - // because there is the possibility that some other device running - // in the same server may have taken a long time on its last pass - // through mainloop(). Trackers that are resetting do this. When - // this happens, you can get an infinite loop -- where one tracker - // resets and causes the other to timeout, and then it returns the - // favor. By checking for the report here, we reset the timestamp - // if there is a report ready (ie, if THIS device is still operating). - while (get_report()) {}; // Keep getting reports so long as there are more - - struct timeval current_time; - vrpn_gettimeofday(¤t_time, NULL); - if ( vrpn_TimevalDuration(current_time,timestamp) > POLL_INTERVAL) { - - if (vrpn_TimevalDuration(current_time, last_poll) > TIMEOUT_TIME_INTERVAL) { - // Ask the unit for its current focus location, which will cause it to respond. - char msg[256]; - sprintf(msg, "rSPR\r"); - if (vrpn_write_characters(serial_fd, (unsigned char *)msg, strlen(msg)) != (int)strlen(msg)) { - fprintf(stderr, "vrpn_Nikon_Controls::mainloop(): Can't write focus request command\n"); - status = STATUS_RESETTING; - return; - } - vrpn_gettimeofday(&last_poll, NULL); - } else { - return; - } - } - - if ( vrpn_TimevalDuration(current_time,timestamp) > TIMEOUT_TIME_INTERVAL) { - sprintf(errmsg,"Timeout... current_time=%ld:%ld, timestamp=%ld:%ld", - current_time.tv_sec, static_cast<long>(current_time.tv_usec), - timestamp.tv_sec, static_cast<long>(timestamp.tv_usec)); - VRPN_MSG_ERROR(errmsg); - status = STATUS_RESETTING; - } - } - break; - - default: - VRPN_MSG_ERROR("Unknown mode (internal error)"); - break; - } -} diff --git a/src/vrpn/vrpn_nikon_controls.h b/src/vrpn/vrpn_nikon_controls.h deleted file mode 100644 index 9def88e0a86c02b93892621a297c11520da52767..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_nikon_controls.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef VRPN_NIKON_CONTROLS_H -#define VRPN_NIKON_CONTROLS_H - -#include <stddef.h> // for NULL - -#include "vrpn_Analog.h" // for vrpn_Serial_Analog -#include "vrpn_Analog_Output.h" // for vrpn_Analog_Output -#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API -#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc -#include "vrpn_Shared.h" // for timeval -#include "vrpn_Types.h" // for vrpn_uint32, vrpn_float64 - -class VRPN_API vrpn_Nikon_Controls : public vrpn_Serial_Analog, public vrpn_Analog_Output { -public: - vrpn_Nikon_Controls(const char *device_name, vrpn_Connection *con = NULL, const char *port_name = "COM1"); - ~vrpn_Nikon_Controls(void) {}; - - virtual void mainloop (); - -protected: - int _status; - - unsigned char _buffer[512]; //< Buffer of characters in report - unsigned _bufcount; //< How many characters we have so far - - double _requested_focus; //< Where we asked the focus to be set to - - struct timeval timestamp; //< Time of the last report from the device - struct timeval last_poll; //< Last time we polled the device - - virtual int reset(void); //< Set device back to starting config - virtual int get_report(void); //< Try to read a report from the device - virtual int set_channel(unsigned chan_num, vrpn_float64 value); //< Try to set the focus to this - - /// Send changes since the last time - virtual void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - /// Send values whether or not they have changed. - virtual void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY); - - /// Responds to a connection request with a report of the values - static int VRPN_CALLBACK handle_connect_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Responds to a request to change one of the values by - /// setting the channel to that value. - static int VRPN_CALLBACK handle_request_message(void *userdata, vrpn_HANDLERPARAM p); - - /// Responds to a request to change multiple channels at once. - static int VRPN_CALLBACK handle_request_channels_message(void *userdata, vrpn_HANDLERPARAM p); -}; - -#endif diff --git a/src/vrpn/vrpn_raw_sgibox.C b/src/vrpn/vrpn_raw_sgibox.C deleted file mode 100644 index 0f2ecef398c3d2197ecdb2de48f4fd3359d8d2f8..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_raw_sgibox.C +++ /dev/null @@ -1,399 +0,0 @@ -/* vrpn_raw_sgibox.C - * This file contains the implementation for a controller to - * the SGI dial and button boxes. This is an implementation that - * goes directly through the serial port rather than using the - * SGI GL library. The two connect together and then to a serial - * port at 9600 baud, 8 bits, 1 start 1 stop, no parity. The single- - * byte command 0x20 resets both of them; they respond with 0x20. - * The dial box returns 3-byte values whenever a dial is moved. - * There are 200 ticks per rotation, and there is an internal counter - * that counts up to 16 bits and then rolls over. The message format - * that is returned is 3Z XX YY, where Z is the dial number and XXYY - * is the new positional value for the dial. The dials are clamped to - * the range -0.5<-->0.5, and this is twice VRPN_DIAL_RANGE. If the - * dials are turned past this, the values are set to clamp. As soon - * as the dial is turned the other direction, it will lower the value; - * this provides a "saturating" dial effect. - * The button box takes commands to turn the lights on or off; the - * command is 0x75 followed by 4 bytes; the bits of byte 1 turn on or - * off the first 8 lights, with MSB turning on light 7 and LSB controlling - * byte 0. Lights 8-15 are byte 2, 16-23 byte 3, 24-31 byte 4. When a - * button is pressed or released, a single-byte message is returned. - * For press, D8 is button 0, D9 is 1... DF is 7; D0 is 8...D7 is 15; - * C8 is 16...CF is 23, C0 is 24...C7 is 31. For release, F8 is 0... - * FF is 7, F0 is 8...F7 is 15, E8 is 16...EF is 23, E0 is 24...E7 is 31. - * The button box needs to have its buttons enabled and activated - * using the 0x73 and 0x71 commands, each followed by FFFFFFFF to turn - * on them all. The dial box enable command is 0x50 followed by xxFF, - * where xx is ignored and FF turns on all of the dials. - */ - -//#define VERBOSE - -#include <stdio.h> // for perror, fprintf, printf, etc -#include <string.h> // for memcpy - -#include "vrpn_Connection.h" // for vrpn_HANDLERPARAM, etc -#include "vrpn_Serial.h" -#include "vrpn_Shared.h" // for vrpn_SleepMsecs, timeval -#include "vrpn_Types.h" // for vrpn_float64, vrpn_int16, etc -#include "vrpn_raw_sgibox.h" - -static const unsigned char BBOX_RESET = 0x20; -static const int VRPN_DIAL_RANGE = 200; - -static int VRPN_CALLBACK sgibox_raw_con_cb(void * userdata, vrpn_HANDLERPARAM p); -static int VRPN_CALLBACK sgibox_raw_alert_handler(void * userdata, vrpn_HANDLERPARAM); - -vrpn_raw_SGIBox::vrpn_raw_SGIBox(char * name, vrpn_Connection * c, - char *serialPortName): - vrpn_Analog(name, c), vrpn_Dial(name, c), vrpn_Button_Filter(name, c) -{ - char message[1024]; - serialfd = -1; - - // Open the serial port that will be used to communicate to - // the dial and button box. Then reset the boxes. - serialfd = vrpn_open_commport(serialPortName, 9600); - if (serialfd < 0) { - sprintf(message,"vrpn_raw_SGIBox: error opening serial port: %s\n",serialPortName); - perror(message); - return; - } - reset(); - - num_channel = vrpn_SGI_NUM_DIALS; - num_dials = vrpn_SGI_NUM_DIALS; - num_buttons = vrpn_SGI_NUM_BUTTONS; - - // We can use either autodeleted handler; choose the one in Analog - register_autodeleted_handler(c->register_message_type(vrpn_got_first_connection), sgibox_raw_con_cb, this); - register_autodeleted_handler(alert_message_id,sgibox_raw_alert_handler, this); - - set_alerts(1); //turn on alerts from toggle filter class to notify - //local sgibox that lights should be turned on/off -} - -int vrpn_raw_SGIBox::reset() { /* Button/Dial box setup */ - int i; - int ret; - unsigned char inbuf[100]; -#ifdef VERBOSE - unsigned char lightson[5] = {0x75, 0xff, 0xff, 0xff, 0xff}; - unsigned char lightsoff[5] = {0x75, 0x00, 0x00, 0x00, 0x00}; -#endif - unsigned char activatebuttons[5] = {0x73, 0xff, 0xff, 0xff, 0xff}; - unsigned char enablebuttons[5] = {0x71, 0xff, 0xff, 0xff, 0xff}; - unsigned char enabledials[3] = {0x50, 0xff, 0xff}; - - - // Clear the incoming serial buffer of all characters - // Send the reset message to the dials and buttons. Wait for any return - // messages, which should be 1 or 2 "0x20" bytes. - - if (serialfd != -1) { // Write reset command - if (vrpn_flush_input_buffer(serialfd) == -1) { - perror("vrpn_raw_SGIBox::reset(): Can't flush incoming buffer"); - return -1; - } - if (vrpn_write_slowly(serialfd, &BBOX_RESET,1,1) != 1) { - perror("vrpn_raw_SGIBox::reset(): Can't write reset command"); - return -1; - } - if (vrpn_write_slowly(serialfd, &BBOX_RESET,1,1) != 1) { - perror("vrpn_raw_SGIBox::reset(): Can't write reset command"); - return -1; - } - } - vrpn_SleepMsecs(1000.0*1); // Give the box time to respond - if ( (ret=vrpn_read_available_characters(serialfd, inbuf, 2)) <= 0) { - //XXX Turn this into a vrpn text message - perror("vrpn_raw_SGIBox::reset(): Can't read or no data from serial port"); - return -1; - } -#ifdef VERBOSE - printf("vrpn_raw_SGIBox::reset(): Box's response to reset command: %02x\n", inbuf[0]); -#endif - - for (i = 0; i < ret; i++) { - if (inbuf[i] != BBOX_RESET) { - //XXX Turn this into a vrpn text message - fprintf(stderr,"vrpn_raw_SGIBox::reset(): Bad response to reset command : %02x- please restart sgiBox vrpn server\n",inbuf[i]); - return -1; - } - } - -#ifdef VERBOSE - if (serialfd != -1) { - printf("vrpn_raw_SGIBox: flashing the lights on then off...\n"); - if (vrpn_write_slowly(serialfd, lightson,5,1) != 5) { - perror("vrpn_raw_SGIBox::reset(): Can't turn the lights on"); - return -1; - } - vrpn_SleepMsecs(1000.0*5); - if (vrpn_write_slowly(serialfd, lightsoff,5,1) != 5) { - perror("vrpn_raw_SGIBox::reset(): Can't turn the lights off"); - return -1; - } - } -#endif - - // Active and enable all of the buttons, enable the dials - - if (serialfd != -1) { - // for some reason, enabling the dials disables the buttons - // so we have to enable the dials first - if (vrpn_write_slowly(serialfd, enabledials,5,1) != 5) { - perror("vrpn_raw_SGIBox::reset(): Can't enable dials"); - return -1; - } -#ifdef VERBOSE - else { - printf("vrpn_raw_SGIBOX::reset() : Enabled Dials\n"); - } -#endif - // for some reasn the box doesn't always understand the enable buttons - // command the first time. So we send it twice to make sure - for (i=0; i < 2; i++) { - - if (vrpn_write_slowly(serialfd, enablebuttons,5,1) != 5) { - perror("vrpn_raw_SGIBox::reset(): Can't enable buttons"); - return -1; - } -#ifdef VERBOSE - else { - printf("vrpn_raw_SGIBOX::reset() : Enabled Buttons\n"); - } -#endif - if (vrpn_write_slowly(serialfd, activatebuttons,5,1) != 5) { - perror("vrpn_raw_SGIBox::reset(): Can't activate buttons\n"); - return -1; - } -#ifdef VERBOSE - else { - printf("vrpn_raw_SGIBOX::reset() : Activated Buttons\n"); - } -#endif - } // end of loop to send enable and activate commands - - } - - // Reset the button and, analog, and dial values to zero, since the dial box - // and button box are now reset. - - for (i=0; i<vrpn_SGI_NUM_BUTTONS; i++) { - buttons[i] = lastbuttons[i] = 0; // The buttons are released - //XXX Reset the button-light handling registers - } - - for (i=0; i<vrpn_SGI_NUM_DIALS; i++) { - mid_values[i] = 0; // The middle of saturating analog range - last[i] = channel[i] = 0; // The analog values are reset to 0 - dials[i] = 0; // Reset the dials to zero - last_values[i] = 0; // Reset the values used by dial code to zero - } - - // Set the lights to how they should be - send_light_command(); - - return 0; -} - -// This checks one bank of eight buttons to see if the command refers -// to a press event in that bank. If it does, it will set the button. -// If not, it does nothing. -void vrpn_raw_SGIBox::check_press_bank(int base_button, unsigned char base_command, - unsigned char command) { - if ( (command >= base_command) && (command < (base_command+8)) ) { - buttons[base_button + (command-base_command)] = 1; - } -} - -// This checks one bank of eight buttons to see if the command refers -// to a release event in that bank. If it does, it will clear the button. -// If not, it does nothing. -void vrpn_raw_SGIBox::check_release_bank(int base_button, unsigned char base_command, - unsigned char command) { - if ( (command >= base_command) && (command < (base_command+8)) ) { - buttons[base_button + (command-base_command)] = 0; - } -} - - -// See what reports have come in over the serial port. When something -// comes in, figure out if it is a dial report or a button report -// and act on it accordingly. If we get a partial report, go ahead -// and wait for the rest of the report before leaving the loop. -// XXX This should be modified to handle partial reports the same way -// that the trackers do. - -void vrpn_raw_SGIBox::get_report() { - unsigned char command; - int ret; - -#ifdef VERBOSE - printf("."); fflush(stdout); -#endif - // Read a character if there is one. See if it matches one of - // the known command start bytes. If it does not, there is - // something wrong. - ret = vrpn_read_available_characters(serialfd, &command, 1); - if (ret == 0) { // Nothing there, we're done - return; - } - if (ret == -1) { // Error in the read; try resetting. -#ifdef VERBOSE - perror("vrpn_raw_SGIBOX::get_report(): error reading serial port - reseting..."); -#endif - reset(); - return; - } - -#ifdef VERBOSE - printf("vrpn_raw_SGIBox::get_report(): Got %02x\n", command); -#endif - // If this is a reset command, we can skip it and get the next command - // next time. - if (command == 0x20) { - perror("vrpn_raw_SGIBOX::get_report(): Got reset response when we didn't expect it - reseting...\n"); - reset(); - return; - } - - // See if this is a button report, which are only a single byte. - if ( command >= 0xC0 ) { - // Due to the strange layout of the commands to buttons, - // we need to check each group of 8 button messages in chunks, - // both for the press commands and the release commands. - check_press_bank(24, 0xC0, command); - check_press_bank(16, 0xC8, command); - check_press_bank(8, 0xD0, command); - check_press_bank(0, 0xD8, command); - - check_release_bank(24, 0xE0, command); - check_release_bank(16, 0xE8, command); - check_release_bank(8, 0xF0, command); - check_release_bank(0, 0xF8, command); - } - - vrpn_Button_Filter::report_changes(); - - - // Parse the dial turn results, which are more than single-byte - // results so will require reading in the rest of the command. - // We will block until either we get them or get an error or time - // out. If there is an error or timeout, try resetting. - if ( (command >= 0x30) && (command <= 0x37) ) { -#ifdef VERBOSE - printf("vrpn_raw_SGIBOX::get_report(): Got dial event\n"); -#endif - unsigned char dial_value[2]; - int i = command - 0x30; // Which dial - vrpn_int16 value; - struct timeval timeout = {0, 10000}; // 10 milliseconds - - // Attempt to read both new values until we run out of time - // and give up. If we give up or have an error, try a reset. - if (vrpn_read_available_characters(serialfd, dial_value, 2, &timeout) != 2) { - perror("vrpn_raw_SGIBOX: starting getting a dial command from box, but message wasn't completed -reseting ..."); - reset(); - return; - } -#ifdef VERBOSE - printf("vrpn_raw_SGIBOX::get_report(): Dial event %02x:[ %02x %02x] \n", - command,dial_value[0],dial_value[1]); -#endif - - // Make sure to sign-extend the 16-bit value properly. - value = static_cast<short>((dial_value[0]<<8) | dial_value[1]); - - // Figure out the value and adjust the corresponding analog value. - // The analogs are set up to clamp at both the to and bottom end of - // the scale, but will back off immediately if you turn it the other - // direction. The range of outputs (channels) is from -0.5 to 0.5. - int temp = value - mid_values[i]; - if (temp > VRPN_DIAL_RANGE) { - channel[i] = 0.5; - mid_values[i] = value - VRPN_DIAL_RANGE; - } else if (temp < -VRPN_DIAL_RANGE) { - channel[i] = -0.5; - mid_values[i] = value + VRPN_DIAL_RANGE; - } else { - channel[i] = temp/400.0; - } - - // Figure out the change for the dial report, and report fraction - // turned. - dials[i] = (value-last_values[i])/(double)(VRPN_DIAL_RANGE); - last_values[i] = value; - } - vrpn_Analog::report_changes(); - vrpn_Dial::report_changes(); - - // check for an unrecognized command from the box - if (! ( - ( (command >= 0x30) && (command <= 0x37) ) || - (command >= 0xC0) - )) - { - perror("vrpn_raw_SGIBOX: unrecognized command from sgiBox - reseting..."); - reset(); - } -} - -void vrpn_raw_SGIBox::mainloop() -{ - server_mainloop(); - get_report(); -} - -int vrpn_raw_SGIBox::send_light_command(void) { - int bank, i; - unsigned char lights[4]; // Array to hold the light-control bits - unsigned char msg[5]; // Message to send to turn on lights - - // Figure out which lights should be on, and pack them into the - // four bytes that describe which should be on. - for (bank = 0; bank < 4; bank++) { - lights[bank] = 0; //one bit per button light - for (i = 0; i < 8; i++) { - int buttonLightNumber = bank*8 + i; - if (buttonstate[buttonLightNumber]==vrpn_BUTTON_TOGGLE_ON) { - lights[bank]=static_cast<unsigned char>(lights[bank]|1<<i); - } - } - } - - // Prepare the control message to turn the lights on, then - // send it. - - msg[0] = 0x75; memcpy(&msg[1],lights,4); - if (vrpn_write_slowly(serialfd, msg, 5,1) != 5) { - perror("Could not write light control message"); - //XXX Should be vrpn_Text message - reset(); - return -1; - } - return 0; -} - -// Turn on all the lights that are currently enabled. This ignores -// the HANDLERPARAM parameter, since it is not required to figure this -// out. - -static int VRPN_CALLBACK sgibox_raw_alert_handler(void * userdata, vrpn_HANDLERPARAM) -{ - vrpn_raw_SGIBox *me=(vrpn_raw_SGIBox *)userdata; - - me->send_light_command(); - return 0; -} - -static int VRPN_CALLBACK sgibox_raw_con_cb(void * userdata, vrpn_HANDLERPARAM) -{ - - printf("vrpn_raw_SGIBox::Get first new connection, reset the box\n"); - ((vrpn_raw_SGIBox *)userdata) ->reset(); - return 0; -} - diff --git a/src/vrpn/vrpn_raw_sgibox.h b/src/vrpn/vrpn_raw_sgibox.h deleted file mode 100644 index 369808d84c82e0ba4f378bf56494ef797cd1e52d..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_raw_sgibox.h +++ /dev/null @@ -1,49 +0,0 @@ -/* vrpn_raw_sgibox.h - * - * This file describes the interface to an SGI dial & button box that - * is connected through a serial interface. This allows the control of - * the boxes without going through the SGI GL library, rather using the - * serial interface to connect with the device. - */ - -#ifndef VRPN_RAW_SGIBOX -#define VRPN_RAW_SGIBOX - -#include "vrpn_Configure.h" // for VRPN_API - -#include "vrpn_Analog.h" -#include "vrpn_Dial.h" -#include "vrpn_Button.h" - -class VRPN_API vrpn_Connection; - -/* Number of buttons and number of dials on sgi button/dial boxes */ -#define vrpn_SGI_NUM_BUTTONS (32) -#define vrpn_SGI_NUM_DIALS (8) -#define vrpn_SGI_NUMDEVS (vrpn_SGI_NUM_BUTTONS+vrpn_SGI_NUM_DIALS) - -class VRPN_API vrpn_raw_SGIBox :public vrpn_Analog, public vrpn_Dial, public vrpn_Button_Filter { -public: - vrpn_raw_SGIBox(char * name, vrpn_Connection * c, char *serialDevName); - void mainloop(); - int reset(); - int send_light_command(); - -protected: - void get_report(); - void check_press_bank(int base_button, unsigned char base_command, - unsigned char command); - void check_release_bank(int base_button, unsigned char base_command, - unsigned char command); - -private: - int serialfd; // Serial port that has been opened - unsigned long btstat; /* status of of on/off buttons */ - unsigned long bs1, bs2; /* status of all buttons */ - short vals1[vrpn_SGI_NUMDEVS]; // Value array? - int dial_changed[vrpn_SGI_NUM_DIALS]; - int mid_values[vrpn_SGI_NUM_DIALS]; //< Used to perform clamping - int last_values[vrpn_SGI_NUM_DIALS]; //< Used by dial reporting code -}; - -#endif // VRPN_RAW_SGIBOX diff --git a/src/vrpn/vrpn_sgibox.C b/src/vrpn/vrpn_sgibox.C deleted file mode 100644 index 6ac54cfd88a427c1c1451a6ea91b3a5f044e71f9..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_sgibox.C +++ /dev/null @@ -1,117 +0,0 @@ -#ifdef sgi - -#include "vrpn_sgibox.h" -#include <stdio.h> - -// all for gethostbyname(); -#include <unistd.h> -static int sgibox_con_cb(void * userdata, vrpn_HANDLERPARAM p); -static int sgibox_alert_handler(void * userdata, vrpn_HANDLERPARAM); - - -vrpn_SGIBox::vrpn_SGIBox(char * name, vrpn_Connection * c): - vrpn_Analog(name, c), vrpn_Button_Filter(name, c) { - int ret; - char hn[128]; - sid = -1; - winid = -1; - - if (winid != -1) { - printf("Closing previous windows Winid=%d, sid = %d:\n",winid, sid); - winclose(winid); - //dglclose(sid); - dglclose(-1); // close all dgl connection; - } - - ret = gethostname(hn, 100); - if (ret < 0) { - fprintf(stderr, "vrpn_SGIBox: error in gethostname()\n"); - return; - } - sid = ret = dglopen(hn,DGLLOCAL); - if (ret < 0) { - fprintf(stderr, "vrpn_SGIBox: error in dglopen()\n"); - return; - } - noport(); - winid = winopen(""); - reset(); - num_channel = NUM_DIALS; - num_buttons = NUM_BUTTONS; - - register_autodeleted_handler(c->register_message_type( vrpn_got_first_connection), sgibox_con_cb, this); - register_autodeleted_handler(alert_message_id,sgibox_alert_handler, this); - set_alerts(1); //turn on alerts from toggle filter class to notify - //local sgibox that lights should be turned on/off -} - -void vrpn_SGIBox::reset() { /* Button/Dial box setup */ - int i; - - for (i=0; i<NUM_DIALS; i++) devs[i] = DIAL0+i; - for (i=0; i<NUM_BUTTONS; i++) devs[i+NUM_DIALS] = SW0+i; - btstat = 0; /* Set all on/off buttons to off */ - //fprintf(stderr, "vrpn_SGIBox::reset %d\n", __LINE__); - setdblights(btstat); /* Make the lights reflect this */ - //fprintf(stderr, "vrpn_SGIBox::reset %d\n", __LINE__); - getdev(NUMDEVS, devs, vals1); /* Get initial values */ - - for (i=0; i<NUM_BUTTONS; i++) - lastbuttons[i] = vals1[NUM_DIALS+i]; - - for (i=0; i<NUM_DIALS; i++) mid_values[i] = vals1[i], last[i] = 0; -} - -void vrpn_SGIBox::get_report() { - int i; - getdev(NUMDEVS, devs, vals1); /* read button/dial boxes */ - //fprintf(stderr, "Button="); - for (i=0; i< NUM_BUTTONS; i++) { - buttons[i] = vals1[NUM_DIALS+i]; - } - for (i=0; i< NUM_DIALS; i++) { - int temp = vals1[i] -mid_values[i]; - if (temp > 200) channel[i] = 0.5, mid_values[i] = vals1[i] - 200; - else if (temp < -200) channel[i] = -0.5, mid_values[i] = vals1[i] - + 200; - else - channel[i] = temp/400.0; - //fprintf(stderr, " %d", vals1[i]); - } - //fprintf(stderr, "\n"); - - vrpn_Analog::report_changes(); - vrpn_Button_Filter::report_changes(); -} - -void vrpn_SGIBox::mainloop() { - server_mainloop(); - get_report(); -} - - -static int sgibox_alert_handler(void * userdata, vrpn_HANDLERPARAM){ - int i; - long lights; - vrpn_SGIBox*me=(vrpn_SGIBox *)userdata; - - lights=0; - for(i=0;i<NUM_BUTTONS;i++){ - if(me->buttonstate[i]==vrpn_BUTTON_TOGGLE_ON) lights=lights|1<<i; - } - setdblights(lights); - return 0; - -} - -static int sgibox_con_cb(void * userdata, vrpn_HANDLERPARAM) -{ - - printf("vrpn_SGIBox::Get first new connection, reset the box\n"); - ((vrpn_SGIBox *)userdata) ->reset(); - return 0; -} - -#endif // sgi - - diff --git a/src/vrpn/vrpn_sgibox.h b/src/vrpn/vrpn_sgibox.h deleted file mode 100644 index 1fe8be3d24bde481552abf0ad6f95d0c48fd9dbd..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpn_sgibox.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef VRPN_SGIBOX -#define VRPN_SGIBOX - -#ifdef sgi - -#include "vrpn_Analog.h" -#include "vrpn_Button.h" -// Do we really need this here as everything is already -// surrounded by #ifdef sgi...??? -#ifndef _WIN32 -#include <netinet/in.h> -#include <sys/ioctl.h> -#endif -#ifndef MICROSCAPE_H -#include <gl/gl.h> -#include <gl/device.h> -#endif - -/* Number of buttons and number of dials on sgi button/dial boxes */ -#define NUM_BUTTONS (32) -#define NUM_DIALS (8) -#define NUMDEVS (NUM_BUTTONS+NUM_DIALS) - -class VRPN_API vrpn_SGIBox :public vrpn_Analog, public vrpn_Button_Filter { -public: - vrpn_SGIBox(char * name, vrpn_Connection * c); - void mainloop(); - void reset(); - - -protected: - void get_report(); - - -private: - double resetval[vrpn_CHANNEL_MAX]; - long MAX_TIME_INTERVAL; - - unsigned long btstat; /* status of of on/off buttons */ - unsigned long bs1, bs2; /* status of all buttons */ - unsigned long *bpA, *bpB, *bpT; /* ptrs to above */ - Device devs[NUMDEVS]; /* device array */ - short vals1[NUMDEVS], - vals2[NUMDEVS]; /* two values arrays */ - int dial_changed[NUM_DIALS]; - int mid_values[NUM_DIALS]; - int winid; - int sid;// server id; -}; - -#endif // sgi - -#endif // VRPN_SGIBOX - diff --git a/src/vrpn/vrpndll.dsp b/src/vrpn/vrpndll.dsp deleted file mode 100644 index 6a8e1463a1c8d18c007a43c1995ebf95089e9ca4..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpndll.dsp +++ /dev/null @@ -1,743 +0,0 @@ -# Microsoft Developer Studio Project File - Name="vrpndll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=vrpndll - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "vrpndll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "vrpndll.mak" CFG="vrpndll - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "vrpndll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "vrpndll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "vrpndll - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "pc_win32/DLL/Release" -# PROP Intermediate_Dir "pc_win32/DLL/Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VRPNDLL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "./atmellib" /I "../quat" /I "../isense" /I "../Dtrack" /I "$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include" /I "$(SYSTEMDRIVE)\sdk\cpp" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VRPNDLL_EXPORTS" /YX /FD /c /Tp -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 - -!ELSEIF "$(CFG)" == "vrpndll - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "pc_win32/DLL/Debug" -# PROP Intermediate_Dir "pc_win32/DLL/Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VRPNDLL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "./atmellib" /I "../quat" /I "../isense" /I "../Dtrack" /I "$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include" /I "$(SYSTEMDRIVE)\sdk\cpp" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VRPNDLL_EXPORTS" /FD /GZ /c /Tp -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "vrpndll - Win32 Release" -# Name "vrpndll - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\vrpn_3DConnexion.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_3DMicroscribe.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_3Space.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_5DT16.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ADBox.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_5dt.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_Output.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_Radamec_SPI.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_USDigital_A2.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Auxiliary_Logger.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_BaseClass.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Button.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Button_NI_DIO24.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Button_USB.cpp -# End Source File -# Begin Source File - -SOURCE=.\vrpn_CerealBox.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Connection.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Dial.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_DirectXFFJoystick.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_DirectXRumblePad.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Dyna.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Event.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Event_Analog.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Event_Mouse.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_FileConnection.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_FileController.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Flock.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Flock_Parallel.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForceDevice.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForceDeviceServer.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Forwarder.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForwarderController.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_GlobalHapticsOrb.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_HumanInterface.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Imager.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Imager_Stream_Buffer.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ImmersionBox.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_inertiamouse.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Joylin.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Joywin32.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Keyboard.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_LamportClock.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Magellan.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Mouse.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Mutex.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_NationalInstruments.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_nikon_controls.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Poser.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Poser_Analog.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Poser_Tek4662.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_raw_sgibox.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_RedundantTransmission.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Serial.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Shared.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_SharedObject.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Sound.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Spaceball.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Text.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tng3.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_CHProducts_Controller_Raw.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_3DMouse.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_AnalogFly.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_ButtonFly.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Crossbow.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_DTrack.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Fastrak.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_isense.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Isotrak.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Liberty.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_MotionNode.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_NDI_Polaris.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_PhaseSpace.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_UNC_Joystick.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_VPJoystick.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Wanda.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Xkeys.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_YEI_3Space.C -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Zaber.C -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\isense\isense.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_3DConnexion.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_3DMicroscribe.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_3Space.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_5DT16.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ADBox.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_5dt.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_Output.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_Radamec_SPI.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Analog_USDigital_A2.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Auxiliary_Logger.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_BaseClass.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Button.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Button_NI_DIO24.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Button_USB.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_CerealBox.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Configure.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Connection.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Dial.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_DirectXFFJoystick.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_DirectXRumblePad.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Dyna.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Event.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Event_Analog.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Event_Mouse.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_FileConnection.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_FileController.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Flock.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Flock_Parallel.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForceDevice.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Forwarder.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ForwarderController.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_GlobalHapticsOrb.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_HumanInterface.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Imager.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Imager_Stream_Buffer.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_ImmersionBox.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_inertiamouse.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Joylin.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Joywin32.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Keyboard.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_LamportClock.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Magellan.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Mouse.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Mutex.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_NationalInstruments.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_nikon_controls.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Poser.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Poser_Analog.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Poser_Tek4662.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_raw_sgibox.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_RedundantTransmission.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Serial.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Shared.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_SharedObject.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Sound.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Spaceball.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Text.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tng3.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_CHProducts_Controller_Raw.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_3DMouse.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_AnalogFly.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_ButtonFly.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Crossbow.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_DTrack.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Fastrak.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_isense.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Isotrak.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_Liberty.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_MotionNode.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_NDI_Polaris.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Tracker_PhaseSpace.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Types.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_UNC_Joystick.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_VPJoystick.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Wanda.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Xkeys.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_YEI_3Space.h -# End Source File -# Begin Source File - -SOURCE=.\vrpn_Zaber.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/src/vrpn/vrpndll.vcproj b/src/vrpn/vrpndll.vcproj deleted file mode 100644 index 954dde7536bcbf2c4560b39bea1f5e3cbc5d2a0a..0000000000000000000000000000000000000000 --- a/src/vrpn/vrpndll.vcproj +++ /dev/null @@ -1,2938 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="vrpndll" - ProjectGUID="{5F38B32E-B5AE-4316-B15E-9E21D033B1BE}" - RootNamespace="vrpndll" - TargetFrameworkVersion="131072" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory=".\pc_win32/DLL/Debug" - IntermediateDirectory=".\pc_win32/DLL/Debug" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="_DEBUG" - MkTypLibCompatible="true" - SuppressStartupBanner="true" - TargetEnvironment="1" - TypeLibraryName=".\pc_win32/DLL/Debug/vrpndll.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";quat;../isense;../Dtrack;../libfreespace/include;"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include";"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include";"$(SYSTEMDRIVE)\sdk\cpp";"$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1";./submodules/hidapi/hidapi;"$(SYSTEMDRIVE)\Program Files\libusb-1.0\libusb";"C:\Program Files (x86)\Polhemus\PDI\PDI_90\Inc"" - PreprocessorDefinitions="VRPNDLL_EXPORTS,_CRT_SECURE_NO_WARNINGS" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - PrecompiledHeaderFile=".\pc_win32/DLL/Debug/vrpndll.pch" - AssemblerListingLocation=".\pc_win32/DLL/Debug/" - ObjectFile=".\pc_win32/DLL/Debug/" - ProgramDataBaseFileName=".\pc_win32/DLL/Debug/" - WarningLevel="3" - SuppressStartupBanner="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - IgnoreImportLibrary="true" - OutputFile=".\pc_win32/DLL/Debug/vrpndll.dll" - LinkIncremental="2" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib,$(SYSTEMDRIVE)\sdk\cpp,$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1\lib" - GenerateDebugInformation="true" - ProgramDatabaseFile=".\pc_win32/DLL/Debug/vrpndll.pdb" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - ImportLibrary=".\pc_win32\DLL\Debug\vrpndll.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32/DLL/Debug/vrpndll.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory=".\pc_win32/DLL/Release" - IntermediateDirectory=".\pc_win32/DLL/Release" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - PreprocessorDefinitions="NDEBUG" - MkTypLibCompatible="true" - SuppressStartupBanner="true" - TargetEnvironment="1" - TypeLibraryName=".\pc_win32/DLL/Release/vrpndll.tlb" - HeaderFileName="" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";quat;../isense;../Dtrack;../libfreespace/include;"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include";"$(SYSTEMDRIVE)\Program Files\National Instruments\NI-DAQ\Include";"$(SYSTEMDRIVE)\sdk\cpp";"$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1";./submodules/hidapi/hidapi;"$(SYSTEMDRIVE)\Program Files\libusb-1.0\libusb";"C:\Program Files (x86)\Polhemus\PDI\PDI_90\Inc"" - PreprocessorDefinitions="VRPNDLL_EXPORTS,_CRT_SECURE_NO_WARNINGS" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - PrecompiledHeaderFile=".\pc_win32/DLL/Release/vrpndll.pch" - AssemblerListingLocation=".\pc_win32/DLL/Release/" - ObjectFile=".\pc_win32/DLL/Release/" - ProgramDataBaseFileName=".\pc_win32/DLL/Release/" - WarningLevel="3" - SuppressStartupBanner="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - IgnoreImportLibrary="true" - OutputFile=".\pc_win32/DLL/Release/vrpndll.dll" - LinkIncremental="1" - SuppressStartupBanner="true" - AdditionalLibraryDirectories="$(SYSTEMDRIVE)\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib,$(SYSTEMDRIVE)\sdk\cpp,$(SYSTEMDRIVE)\Program Files\boost\boost_1_34_1\lib" - ProgramDatabaseFile=".\pc_win32/DLL/Release/vrpndll.pdb" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" - ImportLibrary=".\pc_win32\DLL\Release\vrpndll.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - SuppressStartupBanner="true" - OutputFile=".\pc_win32/DLL/Release/vrpndll.bsc" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" - > - <File - RelativePath="vrpn_3DConnexion.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_3DMicroscribe.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_3Space.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_5DT16.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_ADBox.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Analog.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Analog_5dt.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Analog_5dtUSB.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Analog_Output.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Analog_Radamec_SPI.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Analog_USDigital_A2.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Auxiliary_Logger.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_BaseClass.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Button.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Button_NI_DIO24.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Button_USB.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_CerealBox.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Connection.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_Contour.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_CHProducts_Controller_Raw.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Dial.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_DirectXFFJoystick.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_DirectXRumblePad.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_DreamCheeky.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Dyna.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Event.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Event_Analog.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Event_Mouse.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_FileConnection.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_FileController.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Flock.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Flock_Parallel.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_ForceDevice.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_ForceDeviceServer.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Forwarder.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_ForwarderController.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Freespace.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_FunctionGenerator.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_Futaba.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_GlobalHapticsOrb.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_Griffin.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_HumanInterface.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_IDEA.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Imager.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Imager_Stream_Buffer.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_ImmersionBox.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_inertiamouse.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_JoyFly.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Joylin.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Joywin32.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Keyboard.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_LamportClock.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Local_HIDAPI.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_Logitech_Controller_Raw.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_LUDL.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Magellan.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_Microsoft_Controller_Raw.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Mouse.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Mutex.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_NationalInstruments.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Nidaq.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_nikon_controls.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Poser.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Poser_Analog.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Poser_Tek4662.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_raw_sgibox.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_RetroLink.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_RedundantTransmission.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\vrpn_Saitek_Controller_Raw.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Serial.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_sgibox.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Shared.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_SharedObject.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Sound.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Spaceball.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Text.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tng3.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_3DMouse.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_AnalogFly.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_ButtonFly.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_Crossbow.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_DTrack.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_Fastrak.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_Filter.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_GameTrak.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_GPS.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_isense.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_Isotrak.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_JsonNet.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_Liberty.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_LibertyHS.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_MotionNode.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_NDI_Polaris.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_NovintFalcon.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_PDI.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_PhaseSpace.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_RazerHydra.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_SpacePoint.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_TrivisioColibri.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_ViewPoint.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_WiimoteHead.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_Wintracker.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Tracker_zSight.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_UNC_Joystick.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_VPJoystick.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Wanda.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_WiiMote.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_XInputGamepad.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Xkeys.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_YEI_3Space.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - <File - RelativePath="vrpn_Zaber.C" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - CompileAs="2" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl" - > - <File - RelativePath="vrpn_3DConnexion.h" - > - </File> - <File - RelativePath="vrpn_3DMicroscribe.h" - > - </File> - <File - RelativePath="vrpn_3Space.h" - > - </File> - <File - RelativePath="vrpn_5DT16.h" - > - </File> - <File - RelativePath="vrpn_ADBox.h" - > - </File> - <File - RelativePath="vrpn_Analog.h" - > - </File> - <File - RelativePath="vrpn_Analog_5dt.h" - > - </File> - <File - RelativePath="vrpn_Analog_5dtUSB.h" - > - </File> - <File - RelativePath="vrpn_Analog_Output.h" - > - </File> - <File - RelativePath="vrpn_Analog_Radamec_SPI.h" - > - </File> - <File - RelativePath="vrpn_Analog_USDigital_A2.h" - > - </File> - <File - RelativePath="vrpn_Auxiliary_Logger.h" - > - </File> - <File - RelativePath="vrpn_BaseClass.h" - > - </File> - <File - RelativePath="vrpn_Button.h" - > - </File> - <File - RelativePath="vrpn_Button_NI_DIO24.h" - > - </File> - <File - RelativePath="vrpn_Button_USB.h" - > - </File> - <File - RelativePath="vrpn_CerealBox.h" - > - </File> - <File - RelativePath="vrpn_Configure.h" - > - </File> - <File - RelativePath="vrpn_Connection.h" - > - </File> - <File - RelativePath=".\vrpn_Contour.h" - > - </File> - <File - RelativePath=".\vrpn_CHProducts_Controller_Raw.h" - > - </File> - <File - RelativePath="vrpn_Dial.h" - > - </File> - <File - RelativePath="vrpn_DirectXFFJoystick.h" - > - </File> - <File - RelativePath="vrpn_DirectXRumblePad.h" - > - </File> - <File - RelativePath="vrpn_DreamCheeky.h" - > - </File> - <File - RelativePath="vrpn_Dyna.h" - > - </File> - <File - RelativePath="vrpn_Event.h" - > - </File> - <File - RelativePath="vrpn_Event_Analog.h" - > - </File> - <File - RelativePath="vrpn_Event_Mouse.h" - > - </File> - <File - RelativePath="vrpn_FileConnection.h" - > - </File> - <File - RelativePath="vrpn_FileController.h" - > - </File> - <File - RelativePath="vrpn_Flock.h" - > - </File> - <File - RelativePath="vrpn_Flock_Parallel.h" - > - </File> - <File - RelativePath="vrpn_ForceDevice.h" - > - </File> - <File - RelativePath="vrpn_ForceDeviceServer.h" - > - </File> - <File - RelativePath="vrpn_Forwarder.h" - > - </File> - <File - RelativePath="vrpn_ForwarderController.h" - > - </File> - <File - RelativePath="vrpn_Freespace.h" - > - </File> - <File - RelativePath="vrpn_FunctionGenerator.h" - > - </File> - <File - RelativePath=".\vrpn_Futaba.h" - > - </File> - <File - RelativePath="vrpn_GlobalHapticsOrb.h" - > - </File> - <File - RelativePath=".\vrpn_Griffin.h" - > - </File> - <File - RelativePath="vrpn_HashST.h" - > - </File> - <File - RelativePath="vrpn_HumanInterface.h" - > - </File> - <File - RelativePath="vrpn_IDEA.h" - > - </File> - <File - RelativePath="vrpn_Imager.h" - > - </File> - <File - RelativePath="vrpn_Imager_Stream_Buffer.h" - > - </File> - <File - RelativePath="vrpn_ImmersionBox.h" - > - </File> - <File - RelativePath="vrpn_inertiamouse.h" - > - </File> - <File - RelativePath="vrpn_JoyFly.h" - > - </File> - <File - RelativePath="vrpn_Joylin.h" - > - </File> - <File - RelativePath="vrpn_Joywin32.h" - > - </File> - <File - RelativePath="vrpn_Keyboard.h" - > - </File> - <File - RelativePath="vrpn_LamportClock.h" - > - </File> - <File - RelativePath="vrpn_Log.h" - > - </File> - <File - RelativePath=".\vrpn_Logitech_Controller_Raw.h" - > - </File> - <File - RelativePath="vrpn_LUDL.h" - > - </File> - <File - RelativePath="vrpn_Magellan.h" - > - </File> - <File - RelativePath="vrpn_MainloopContainer.h" - > - </File> - <File - RelativePath="vrpn_MainloopObject.h" - > - </File> - <File - RelativePath=".\vrpn_Microsoft_Controller_Raw.h" - > - </File> - <File - RelativePath="vrpn_Mouse.h" - > - </File> - <File - RelativePath="vrpn_Mutex.h" - > - </File> - <File - RelativePath="vrpn_NationalInstruments.h" - > - </File> - <File - RelativePath="vrpn_Nidaq.h" - > - </File> - <File - RelativePath="vrpn_nikon_controls.h" - > - </File> - <File - RelativePath="vrpn_Poser.h" - > - </File> - <File - RelativePath="vrpn_Poser_Analog.h" - > - </File> - <File - RelativePath="vrpn_Poser_Tek4662.h" - > - </File> - <File - RelativePath="vrpn_raw_sgibox.h" - > - </File> - <File - RelativePath="vrpn_RetroLink.h" - > - </File> - <File - RelativePath="vrpn_RedundantTransmission.h" - > - </File> - <File - RelativePath=".\vrpn_Saitek_Controller_Raw.h" - > - </File> - <File - RelativePath="vrpn_Serial.h" - > - </File> - <File - RelativePath="vrpn_sgibox.h" - > - </File> - <File - RelativePath="vrpn_Shared.h" - > - </File> - <File - RelativePath="vrpn_SharedObject.h" - > - </File> - <File - RelativePath="vrpn_Sound.h" - > - </File> - <File - RelativePath="vrpn_Spaceball.h" - > - </File> - <File - RelativePath="vrpn_Text.h" - > - </File> - <File - RelativePath="vrpn_Tng3.h" - > - </File> - <File - RelativePath="vrpn_Tracker.h" - > - </File> - <File - RelativePath="vrpn_Tracker_3DMouse.h" - > - </File> - <File - RelativePath="vrpn_Tracker_AnalogFly.h" - > - </File> - <File - RelativePath="vrpn_Tracker_ButtonFly.h" - > - </File> - <File - RelativePath="vrpn_Tracker_Crossbow.h" - > - </File> - <File - RelativePath="vrpn_Tracker_DTrack.h" - > - </File> - <File - RelativePath="vrpn_Tracker_Fastrak.h" - > - </File> - <File - RelativePath="vrpn_Tracker_Filter.h" - > - </File> - <File - RelativePath="vrpn_Tracker_GameTrak.h" - > - </File> - <File - RelativePath="vrpn_Tracker_GPS.h" - > - </File> - <File - RelativePath="vrpn_Tracker_isense.h" - > - </File> - <File - RelativePath="vrpn_Tracker_Isotrak.h" - > - </File> - <File - RelativePath="vrpn_Tracker_JsonNet.h" - > - </File> - <File - RelativePath="vrpn_Tracker_Liberty.h" - > - </File> - <File - RelativePath="vrpn_Tracker_LibertyHS.h" - > - </File> - <File - RelativePath="vrpn_Tracker_MotionNode.h" - > - </File> - <File - RelativePath="vrpn_Tracker_NDI_Polaris.h" - > - </File> - <File - RelativePath="vrpn_Tracker_NovintFalcon.h" - > - </File> - <File - RelativePath="vrpn_Tracker_PDI.h" - > - </File> - <File - RelativePath="vrpn_Tracker_PhaseSpace.h" - > - </File> - <File - RelativePath="vrpn_Tracker_RazerHydra.h" - > - </File> - <File - RelativePath="vrpn_Tracker_SpacePoint.h" - > - </File> - <File - RelativePath="vrpn_Tracker_TrivisioColibri.h" - > - </File> - <File - RelativePath="vrpn_Tracker_ViewPoint.h" - > - </File> - <File - RelativePath="vrpn_Tracker_WiimoteHead.h" - > - </File> - <File - RelativePath="vrpn_Tracker_Wintracker.h" - > - </File> - <File - RelativePath="vrpn_Tracker_zSight.h" - > - </File> - <File - RelativePath="vrpn_Types.h" - > - </File> - <File - RelativePath="vrpn_UNC_Joystick.h" - > - </File> - <File - RelativePath="vrpn_VPJoystick.h" - > - </File> - <File - RelativePath="vrpn_Wanda.h" - > - </File> - <File - RelativePath="vrpn_WiiMote.h" - > - </File> - <File - RelativePath="vrpn_XInputGamepad.h" - > - </File> - <File - RelativePath="vrpn_Xkeys.h" - > - </File> - <File - RelativePath="vrpn_YEI_3Space.h" - > - </File> - <File - RelativePath="vrpn_Zaber.h" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/src/vrpn_tracker.cpp b/src/vrpn_tracker.cpp deleted file mode 100644 index 49cbaed12e4599a22cecf95ad6351d51de9c6bf5..0000000000000000000000000000000000000000 --- a/src/vrpn_tracker.cpp +++ /dev/null @@ -1,174 +0,0 @@ -#include <iostream> -#include <algorithm> - -#include "vrpn_Tracker.h" -#include "quat.h" - -#include "vrpn_tracker.hpp" - -namespace microcart -{ - static void VRPN_CALLBACK vrpn_cb(void * param, const vrpn_TRACKERCB t); - - Tracker::Tracker(std::string server) : Tracker(server.c_str()) - { - } - - Tracker::Tracker(const char * server) : - remote(server), - stop_flag(0), - trackerData({ - .x = 0.0, - .y = 0.0, - .z = 0.0, - .pitch = 0.0, - .roll = 0.0, - .yaw = 0.0, - .fps = 0.0, - .timestamp = { - .tv_sec = 0, - .tv_usec = 0 - } - }) - - { - remote.register_change_handler(this, vrpn_cb); - - stop_flag = 0; - vrpn_thread = std::thread(&Tracker::vrpn_loop, this); - } - - Tracker::~Tracker() - { - { - std::lock_guard<std::mutex> guard(vrpn_mutex); - stop_flag = 1; - } - vrpn_thread.join(); - } - - const struct TrackerData Tracker::getData(void) - { - std::lock_guard<std::mutex> guard(vrpn_mutex); - return trackerData; - } - - void Tracker::vrpn_loop(void) - { - while (1) { - remote.mainloop(); - { - std::lock_guard<std::mutex> guard(vrpn_mutex); - - if (stop_flag) { - return; - } - } - } - } - - void Tracker::callback(const vrpn_TRACKERCB t) - { - std::lock_guard<std::mutex> guard(vrpn_mutex); - - q_vec_type euler; - q_to_euler(euler, t.quat); - - trackerData.x = (double) t.pos[0]; - trackerData.y = (double) t.pos[1]; - trackerData.z = (double) t.pos[2]; - - trackerData.roll = (double) euler[2]; - trackerData.pitch = (double) euler[1]; - trackerData.yaw = (double) euler[0]; - - timeval elapsed_time; - timersub(&t.msg_time, &trackerData.timestamp, &elapsed_time); - trackerData.timestamp = t.msg_time; - - double elapsed_time_usec = (double) elapsed_time.tv_usec + - ((1000000.0) * (double) elapsed_time.tv_sec); - - trackerData.fps = 1.0 / elapsed_time_usec; - - auto td = trackerData; - std::for_each(cb_vector.begin(), cb_vector.end(), - [td](std::function<void(const TrackerData &)> &fn){ - fn(td); - }); - } - - void Tracker::addCallback(std::function<void(const TrackerData&)> cb) - { - cb_vector.push_back(cb); - } - - static void VRPN_CALLBACK vrpn_cb(void * param, const vrpn_TRACKERCB t) - { - Tracker * inst = (Tracker *)(param); - inst->callback(t); - } -} - -/* C Interface stuff */ -struct ucart_vrpn_tracker { - microcart::Tracker * t; -}; - -extern "C" -{ - struct ucart_vrpn_tracker * ucart_vrpn_tracker_createInstance( - const char * server) - { - try { - auto inst = new struct ucart_vrpn_tracker; - inst->t = new microcart::Tracker(server); - } catch(...) { - return NULL; - } - } - - void ucart_vrpn_tracker_freeInstance(struct ucart_vrpn_tracker * inst) - { - delete inst->t; - delete inst; - } - - int ucart_vrpn_tracker_addCallback(struct ucart_vrpn_tracker * inst, - void (*cb)(struct ucart_vrpn_TrackerData *)) - { - try { - inst->t->addCallback([cb](const microcart::TrackerData & td) { - struct ucart_vrpn_TrackerData data; - data.x = td.x; - data.y = td.y; - data.z = td.z; - data.pitch = td.pitch; - data.roll = td.roll; - data.yaw = td.yaw; - (*cb)(&data); - }); - } catch(...) { - return -1; - } - return 0; - } - - int ucart_vrpn_tracker_getData(struct ucart_vrpn_tracker *inst, - struct ucart_vrpn_TrackerData *td) - { - try { - auto data = inst->t->getData(); - td->x = data.x; - td->y = data.y; - td->z = data.z; - td->pitch = data.pitch; - td->roll = data.roll; - td->yaw = data.yaw; - - return 0; - } catch(...) { - return -1; - } - } -} diff --git a/src/vrpn_tracker.hpp b/src/vrpn_tracker.hpp deleted file mode 100644 index ebd217551dab4fa6d26faf8ab1bd14a193aac317..0000000000000000000000000000000000000000 --- a/src/vrpn_tracker.hpp +++ /dev/null @@ -1,97 +0,0 @@ -/* Author: Jake Drahos - * - * VPRN tracker module header file. - */ - -#ifndef _MICROCART_VRPN_TRACKER_HPP -#define _MICROCART_VRPN_TRACKER_HPP - -#ifdef __cplusplus -#include <mutex> -#include <thread> -#include <functional> -#include <vector> - -#include "vrpn_Tracker.h" -#endif - -#include <sys/time.h> - -#ifdef __cplusplus -extern "C" -{ -#endif - struct ucart_vrpn_tracker; - struct ucart_vrpn_TrackerData { - double x; - double y; - double z; - - double pitch; - double roll; - double yaw; - - double fps; - struct timeval timestamp; - }; - - struct ucart_vrpn_tracker * ucart_vrpn_tracker_createInstance( - const char * server); - - void ucart_vrpn_tracker_freeInstance(struct ucart_vrpn_tracker * inst); - - int ucart_vrpn_tracker_addCallback(struct ucart_vrpn_tracker * inst, - void (*cb)(struct ucart_vrpn_TrackerData *)); - - int ucart_vrpn_tracker_getData(struct ucart_vrpn_tracker * inst, - struct ucart_vrpn_TrackerData * td); - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -namespace microcart -{ - struct TrackerData { - double x; - double y; - double z; - - double pitch; - double roll; - double yaw; - - double fps; - timeval timestamp; - }; - - class Tracker { - public: - const struct TrackerData getData(void); - void callback(const vrpn_TRACKERCB t); - - Tracker(std::string server); - Tracker(const char * server); - ~Tracker(); - - void addCallback(std::function<void(const TrackerData &)> cb); - private: - int stop_flag; - TrackerData trackerData; - std::thread vrpn_thread; - std::mutex vrpn_mutex; - - vrpn_Tracker_Remote remote; - - void vrpn_loop(void); - - std::vector<std::function<void(const TrackerData &)>> cb_vector; - }; - - -} -/* __cplusplus */ -#endif - -#endif